build
This commit is contained in:
parent
f2562a37d1
commit
7032eb1329
39 changed files with 442 additions and 790 deletions
|
|
@ -1,19 +1,10 @@
|
|||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
import { respostaComuns } from "p-respostas";
|
||||
import { urlAutenticacao } from "./_urlAutenticacao";
|
||||
import node_fetch from "cross-fetch";
|
||||
export const codigoContaSite = (_a) => __awaiter(void 0, [_a], void 0, function* ({ ambiente, post, }) {
|
||||
export const codigoContaSite = async ({ ambiente, post, }) => {
|
||||
const url = `${urlAutenticacao(ambiente)}/api/codigo_prefeitura_site`;
|
||||
try {
|
||||
const resp = yield node_fetch(url, {
|
||||
const resp = await node_fetch(url, {
|
||||
method: "POST",
|
||||
body: JSON.stringify(post),
|
||||
headers: { "Content-Type": "application/json" },
|
||||
|
|
@ -26,4 +17,4 @@ export const codigoContaSite = (_a) => __awaiter(void 0, [_a], void 0, function*
|
|||
catch (e) {
|
||||
return respostaComuns.erro(`erro ao buscar código do site: ${e}`);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,16 +1,7 @@
|
|||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
import node_fetch from "cross-fetch";
|
||||
import { respostaComuns } from "p-respostas";
|
||||
import { urlAutenticacao } from "./_urlAutenticacao";
|
||||
export const usuarios_quipo_governo = (_a) => __awaiter(void 0, [_a], void 0, function* ({ token_produto, ambiente, }) {
|
||||
export const usuarios_quipo_governo = async ({ token_produto, ambiente, }) => {
|
||||
const url = `${urlAutenticacao(ambiente)}/api/usuarios_quipo_governo`;
|
||||
if (!token_produto)
|
||||
return respostaComuns.erro("token_produto não informado");
|
||||
|
|
@ -23,4 +14,4 @@ export const usuarios_quipo_governo = (_a) => __awaiter(void 0, [_a], void 0, fu
|
|||
.then((r) => r.json())
|
||||
.catch((e) => respostaComuns.erro(`Erro ao buscar usuários quipo governo ${e.message}`))
|
||||
.then((r) => r);
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,16 +1,7 @@
|
|||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
import node_fetch from "cross-fetch";
|
||||
import { respostaComuns } from "p-respostas";
|
||||
import { urlAutenticacao } from "./_urlAutenticacao";
|
||||
export const usuarios_quipo_vincular = (_a) => __awaiter(void 0, [_a], void 0, function* ({ token_produto, ambiente, conta, vinculo, codigo_usuario, email, }) {
|
||||
export const usuarios_quipo_vincular = async ({ token_produto, ambiente, conta, vinculo, codigo_usuario, email, }) => {
|
||||
const url = `${urlAutenticacao(ambiente)}/api/vinculos__criar`;
|
||||
if (!token_produto)
|
||||
return respostaComuns.erro("token_produto não informado");
|
||||
|
|
@ -22,11 +13,11 @@ export const usuarios_quipo_vincular = (_a) => __awaiter(void 0, [_a], void 0, f
|
|||
vinculos: { codigo_conta: conta, codigo_usuario, vinculo },
|
||||
email: email,
|
||||
};
|
||||
return yield node_fetch(url, {
|
||||
return await node_fetch(url, {
|
||||
headers,
|
||||
body: JSON.stringify(parametros),
|
||||
method: "POST",
|
||||
})
|
||||
.then((r) => __awaiter(void 0, void 0, void 0, function* () { return yield r.json(); }))
|
||||
.then(async (r) => await r.json())
|
||||
.catch((e) => respostaComuns.erro(`Erro ao criar vinculo de usuario ${e.message}`));
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,19 +1,10 @@
|
|||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
import { urlAutenticacao } from "./_urlAutenticacao";
|
||||
import node_fetch from "cross-fetch";
|
||||
/** faz a validação do token */
|
||||
export const validarToken = (_a) => __awaiter(void 0, [_a], void 0, function* ({ ambiente, post, }) {
|
||||
export const validarToken = async ({ ambiente, post, }) => {
|
||||
const url = `${urlAutenticacao(ambiente)}/api/validar_token`;
|
||||
try {
|
||||
const resposta = yield node_fetch(url, {
|
||||
const resposta = await node_fetch(url, {
|
||||
method: "POST",
|
||||
body: JSON.stringify(post),
|
||||
headers: { "Content-Type": "application/json" },
|
||||
|
|
@ -27,4 +18,4 @@ export const validarToken = (_a) => __awaiter(void 0, [_a], void 0, function* ({
|
|||
catch (e) {
|
||||
return "erro";
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue