ajuste de libs
This commit is contained in:
parent
caf3f59453
commit
547f693652
22 changed files with 236 additions and 306 deletions
|
|
@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
import { respostaComuns } from "p-respostas";
|
||||
import { urlAutenticacao } from "./_urlAutenticacao";
|
||||
import node_fetch from "cross-fetch";
|
||||
export const codigoContaSite = ({ ambiente, post, }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
export const codigoContaSite = (_a) => __awaiter(void 0, [_a], void 0, function* ({ ambiente, post, }) {
|
||||
const url = `${urlAutenticacao(ambiente)}/api/codigo_prefeitura_site`;
|
||||
try {
|
||||
const resp = yield node_fetch(url, {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
import node_fetch from "cross-fetch";
|
||||
import { respostaComuns } from "p-respostas";
|
||||
import { urlAutenticacao } from "./_urlAutenticacao";
|
||||
export const usuarios_quipo_governo = ({ token_produto, ambiente, }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
export const usuarios_quipo_governo = (_a) => __awaiter(void 0, [_a], void 0, function* ({ token_produto, ambiente, }) {
|
||||
const url = `${urlAutenticacao(ambiente)}/api/usuarios_quipo_governo`;
|
||||
if (!token_produto)
|
||||
return respostaComuns.erro("token_produto não informado");
|
||||
|
|
|
|||
|
|
@ -6,6 +6,6 @@ export declare const usuarios_quipo_vincular: ({ token_produto, ambiente, conta,
|
|||
token_produto: string;
|
||||
conta: string;
|
||||
vinculo: string;
|
||||
codigo_usuario?: string | undefined;
|
||||
codigo_usuario?: string;
|
||||
email: string;
|
||||
}) => Promise<tipoResposta<string>>;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
import node_fetch from "cross-fetch";
|
||||
import { respostaComuns } from "p-respostas";
|
||||
import { urlAutenticacao } from "./_urlAutenticacao";
|
||||
export const usuarios_quipo_vincular = ({ token_produto, ambiente, conta, vinculo, codigo_usuario, email, }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
export const usuarios_quipo_vincular = (_a) => __awaiter(void 0, [_a], void 0, function* ({ 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");
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
import { urlAutenticacao } from "./_urlAutenticacao";
|
||||
import node_fetch from "cross-fetch";
|
||||
/** faz a validação do token */
|
||||
export const validarToken = ({ ambiente, post, }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
export const validarToken = (_a) => __awaiter(void 0, [_a], void 0, function* ({ ambiente, post, }) {
|
||||
const url = `${urlAutenticacao(ambiente)}/api/validar_token`;
|
||||
try {
|
||||
const resposta = yield node_fetch(url, {
|
||||
|
|
|
|||
13
dist-import/autenticacao/index.d.ts
vendored
13
dist-import/autenticacao/index.d.ts
vendored
|
|
@ -3,29 +3,28 @@ export type { tipoUsuarioExterno };
|
|||
/** todas as rotas de comunicação com autenticador partem dessa variável */
|
||||
export declare const pAutenticacao: {
|
||||
validarToken: ({ ambiente, post, }: {
|
||||
/** todas as rotas de comunicação com autenticador partem dessa variável */
|
||||
ambiente: "desenvolvimento" | "producao";
|
||||
ambiente: import("zod").TypeOf<typeof import("../ts/ambiente").zAmbiente>;
|
||||
post: {
|
||||
token: string;
|
||||
};
|
||||
}) => Promise<"valido" | "erro">;
|
||||
urlAutenticacao: (ambiente: "desenvolvimento" | "producao") => string;
|
||||
urlAutenticacao: (ambiente: import("zod").TypeOf<typeof import("../ts/ambiente").zAmbiente>) => string;
|
||||
codigoContaSite: ({ ambiente, post, }: {
|
||||
ambiente: "desenvolvimento" | "producao";
|
||||
ambiente: import("zod").TypeOf<typeof import("../ts/ambiente").zAmbiente>;
|
||||
post: {
|
||||
site: string;
|
||||
};
|
||||
}) => Promise<import("p-respostas").tipoResposta<string>>;
|
||||
usuarios_quipo_governo: ({ token_produto, ambiente, }: {
|
||||
ambiente: "desenvolvimento" | "producao";
|
||||
ambiente: import("zod").TypeOf<typeof import("../ts/ambiente").zAmbiente>;
|
||||
token_produto: string;
|
||||
}) => Promise<import("p-respostas").tipoResposta<tipoUsuarioExterno[]>>;
|
||||
usuarios_quipo_vincular: ({ token_produto, ambiente, conta, vinculo, codigo_usuario, email, }: {
|
||||
ambiente: "desenvolvimento" | "producao";
|
||||
ambiente: import("zod").TypeOf<typeof import("../ts/ambiente").zAmbiente>;
|
||||
token_produto: string;
|
||||
conta: string;
|
||||
vinculo: string;
|
||||
codigo_usuario?: string | undefined;
|
||||
codigo_usuario?: string;
|
||||
email: string;
|
||||
}) => Promise<import("p-respostas").tipoResposta<string>>;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ export const zp_deletar_registros = z.object({
|
|||
tabela: z.string(),
|
||||
codigos: z.array(z.string()),
|
||||
});
|
||||
export const deletar_registros = ({ conta, produto, emDesenvolvimento }) => ({ codigos, tabela, }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
export const deletar_registros = ({ conta, produto, emDesenvolvimento }) => (_a) => __awaiter(void 0, [_a], void 0, function* ({ codigos, tabela, }) {
|
||||
const url = new URL(`${baseUrlPilao(emDesenvolvimento)}${PREFIXO}/${Object.keys({ deletar_registros })[0]}/${produto}/${conta}`);
|
||||
const tamanhoBlocos = 1000;
|
||||
while (codigos.length > 0) {
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ export const zp_enviar_registros = z.object({
|
|||
tipo: z_tipo_coluna_base_dados.optional().nullable(),
|
||||
}))),
|
||||
});
|
||||
export const enviar_registros = ({ conta, produto, emDesenvolvimento }) => ({ registros, tabela, }) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
export const enviar_registros = ({ conta, produto, emDesenvolvimento }) => (_a) => __awaiter(void 0, [_a], void 0, function* ({ registros, tabela, }) {
|
||||
const url = new URL(`${baseUrlPilao(emDesenvolvimento)}${PREFIXO}/${Object.keys({ enviar_registros })[0]}/${produto}/${conta}`);
|
||||
const tamanhoBlocos = 1000;
|
||||
while (registros.length > 0) {
|
||||
|
|
|
|||
46
dist-import/pilao-de-dados/index.d.ts
vendored
46
dist-import/pilao-de-dados/index.d.ts
vendored
|
|
@ -1,4 +1,7 @@
|
|||
import { tiposSeriesAgregacoes } from "./variaveis";
|
||||
import { zp_deletar_registros } from "./_deletar_registros";
|
||||
import { zp_enviar_registros } from "./_enviar_registros";
|
||||
import { tiposSeriesAgregacoes, zp_produto_conta } from "./variaveis";
|
||||
import { zp_serie_registrar } from "./_serie_consultar";
|
||||
export { tiposSeriesAgregacoes };
|
||||
export declare const pPilao: {
|
||||
zp_registrar_base_dados: import("zod").ZodObject<{
|
||||
|
|
@ -26,17 +29,7 @@ export declare const pPilao: {
|
|||
tipo: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "data" | "mes";
|
||||
}[];
|
||||
}>;
|
||||
enviar_registros: ({ conta, produto, emDesenvolvimento }: {
|
||||
conta: string;
|
||||
produto: string;
|
||||
emDesenvolvimento?: boolean | undefined;
|
||||
}) => ({ registros, tabela, }: {
|
||||
tabela: string;
|
||||
registros: Record<string, {
|
||||
valor?: any;
|
||||
tipo?: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "data" | "mes" | null | undefined;
|
||||
}>[];
|
||||
}) => Promise<import("p-respostas").tipoResposta<true>>;
|
||||
enviar_registros: ({ conta, produto, emDesenvolvimento }: import("zod").TypeOf<typeof zp_produto_conta>) => ({ registros, tabela, }: import("zod").TypeOf<typeof zp_enviar_registros>) => Promise<import("p-respostas").tipoResposta<true>>;
|
||||
zp_enviar_registros: import("zod").ZodObject<{
|
||||
tabela: import("zod").ZodString;
|
||||
registros: import("zod").ZodArray<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
|
||||
|
|
@ -78,25 +71,11 @@ export declare const pPilao: {
|
|||
agregacao: "contagem" | "somatoria";
|
||||
colunaAgrupamento?: string[] | undefined;
|
||||
}>;
|
||||
serie_consultar: (cliente: {
|
||||
conta: string;
|
||||
produto: string;
|
||||
emDesenvolvimento?: boolean | undefined;
|
||||
}) => (parametros: {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
agregacao: "contagem" | "somatoria";
|
||||
colunaAgrupamento?: string[] | undefined;
|
||||
}) => {
|
||||
serie_consultar: (cliente: import("zod").TypeOf<typeof zp_produto_conta>) => (parametros: import("zod").TypeOf<typeof zp_serie_registrar>) => {
|
||||
dados: () => Promise<import("p-respostas").tipoResposta<{
|
||||
registros: any[];
|
||||
legenda: string;
|
||||
serie: {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
agregacao: "contagem" | "somatoria";
|
||||
colunaAgrupamento?: string[] | undefined;
|
||||
};
|
||||
serie: import("zod").TypeOf<typeof zp_serie_registrar>;
|
||||
}>>;
|
||||
url: () => string;
|
||||
};
|
||||
|
|
@ -113,15 +92,8 @@ export declare const pPilao: {
|
|||
produto: string;
|
||||
emDesenvolvimento?: boolean | undefined;
|
||||
}>;
|
||||
validarZ: <T>(zodType: import("zod").ZodType<T, any, T>, objeto: any, mensagem: string) => import("p-respostas").tipoRespostaErro | import("p-respostas").tipoRespostaSucesso<T>;
|
||||
deletar_registros: ({ conta, produto, emDesenvolvimento }: {
|
||||
conta: string;
|
||||
produto: string;
|
||||
emDesenvolvimento?: boolean | undefined;
|
||||
}) => ({ codigos, tabela, }: {
|
||||
tabela: string;
|
||||
codigos: string[];
|
||||
}) => Promise<import("p-respostas").tipoResposta<true>>;
|
||||
validarZ: <T>(zodType: import("zod").ZodType<T, any>, objeto: any, mensagem: string) => import("p-respostas").tipoRespostaErro | import("p-respostas").tipoRespostaSucesso<T>;
|
||||
deletar_registros: ({ conta, produto, emDesenvolvimento }: import("zod").TypeOf<typeof zp_produto_conta>) => ({ codigos, tabela, }: import("zod").TypeOf<typeof zp_deletar_registros>) => Promise<import("p-respostas").tipoResposta<true>>;
|
||||
zp_deletar_registros: import("zod").ZodObject<{
|
||||
tabela: import("zod").ZodString;
|
||||
codigos: import("zod").ZodArray<import("zod").ZodString, "many">;
|
||||
|
|
|
|||
2
dist-import/pilao-de-dados/variaveis.d.ts
vendored
2
dist-import/pilao-de-dados/variaveis.d.ts
vendored
|
|
@ -1,7 +1,7 @@
|
|||
import { z } from "zod";
|
||||
export declare const zAmbiente: z.ZodEnum<["desenvolvimento", "producao"]>;
|
||||
export declare const PREFIXO = "/pilao-de-dados";
|
||||
export declare const validarZ: <T>(zodType: z.ZodType<T, any, T>, objeto: any, mensagem: string) => import("p-respostas").tipoRespostaErro | import("p-respostas").tipoRespostaSucesso<T>;
|
||||
export declare const validarZ: <T>(zodType: z.ZodType<T, any>, objeto: any, mensagem: string) => import("p-respostas").tipoRespostaErro | import("p-respostas").tipoRespostaSucesso<T>;
|
||||
export declare const zp_produto_conta: z.ZodObject<{
|
||||
produto: z.ZodString;
|
||||
conta: z.ZodString;
|
||||
|
|
|
|||
|
|
@ -43,17 +43,16 @@ exports.codigoContaSite = void 0;
|
|||
var p_respostas_1 = require("p-respostas");
|
||||
var _urlAutenticacao_1 = require("./_urlAutenticacao");
|
||||
var cross_fetch_1 = __importDefault(require("cross-fetch"));
|
||||
var codigoContaSite = function (_a) {
|
||||
var ambiente = _a.ambiente, post = _a.post;
|
||||
return __awaiter(void 0, void 0, void 0, function () {
|
||||
var codigoContaSite = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
||||
var url, resp, e_1;
|
||||
return __generator(this, function (_b) {
|
||||
switch (_b.label) {
|
||||
var ambiente = _b.ambiente, post = _b.post;
|
||||
return __generator(this, function (_c) {
|
||||
switch (_c.label) {
|
||||
case 0:
|
||||
url = "".concat((0, _urlAutenticacao_1.urlAutenticacao)(ambiente), "/api/codigo_prefeitura_site");
|
||||
_b.label = 1;
|
||||
_c.label = 1;
|
||||
case 1:
|
||||
_b.trys.push([1, 3, , 4]);
|
||||
_c.trys.push([1, 3, , 4]);
|
||||
return [4 /*yield*/, (0, cross_fetch_1.default)(url, {
|
||||
method: "POST",
|
||||
body: JSON.stringify(post),
|
||||
|
|
@ -65,14 +64,13 @@ var codigoContaSite = function (_a) {
|
|||
})
|
||||
.then(function (r) { return r; })];
|
||||
case 2:
|
||||
resp = _b.sent();
|
||||
resp = _c.sent();
|
||||
return [2 /*return*/, resp];
|
||||
case 3:
|
||||
e_1 = _b.sent();
|
||||
e_1 = _c.sent();
|
||||
return [2 /*return*/, p_respostas_1.respostaComuns.erro("erro ao buscar c\u00F3digo do site: ".concat(e_1))];
|
||||
case 4: return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
}); };
|
||||
exports.codigoContaSite = codigoContaSite;
|
||||
|
|
|
|||
|
|
@ -43,11 +43,10 @@ exports.usuarios_quipo_governo = void 0;
|
|||
var cross_fetch_1 = __importDefault(require("cross-fetch"));
|
||||
var p_respostas_1 = require("p-respostas");
|
||||
var _urlAutenticacao_1 = require("./_urlAutenticacao");
|
||||
var usuarios_quipo_governo = function (_a) {
|
||||
var token_produto = _a.token_produto, ambiente = _a.ambiente;
|
||||
return __awaiter(void 0, void 0, void 0, function () {
|
||||
var usuarios_quipo_governo = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
||||
var url, headers;
|
||||
return __generator(this, function (_b) {
|
||||
var token_produto = _b.token_produto, ambiente = _b.ambiente;
|
||||
return __generator(this, function (_c) {
|
||||
url = "".concat((0, _urlAutenticacao_1.urlAutenticacao)(ambiente), "/api/usuarios_quipo_governo");
|
||||
if (!token_produto)
|
||||
return [2 /*return*/, p_respostas_1.respostaComuns.erro("token_produto não informado")];
|
||||
|
|
@ -63,6 +62,5 @@ var usuarios_quipo_governo = function (_a) {
|
|||
})
|
||||
.then(function (r) { return r; })];
|
||||
});
|
||||
});
|
||||
};
|
||||
}); };
|
||||
exports.usuarios_quipo_governo = usuarios_quipo_governo;
|
||||
|
|
|
|||
|
|
@ -6,6 +6,6 @@ export declare const usuarios_quipo_vincular: ({ token_produto, ambiente, conta,
|
|||
token_produto: string;
|
||||
conta: string;
|
||||
vinculo: string;
|
||||
codigo_usuario?: string | undefined;
|
||||
codigo_usuario?: string;
|
||||
email: string;
|
||||
}) => Promise<tipoResposta<string>>;
|
||||
|
|
|
|||
|
|
@ -43,12 +43,11 @@ exports.usuarios_quipo_vincular = void 0;
|
|||
var cross_fetch_1 = __importDefault(require("cross-fetch"));
|
||||
var p_respostas_1 = require("p-respostas");
|
||||
var _urlAutenticacao_1 = require("./_urlAutenticacao");
|
||||
var usuarios_quipo_vincular = function (_a) {
|
||||
var token_produto = _a.token_produto, ambiente = _a.ambiente, conta = _a.conta, vinculo = _a.vinculo, codigo_usuario = _a.codigo_usuario, email = _a.email;
|
||||
return __awaiter(void 0, void 0, void 0, function () {
|
||||
var usuarios_quipo_vincular = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
||||
var url, headers, parametros;
|
||||
return __generator(this, function (_b) {
|
||||
switch (_b.label) {
|
||||
var token_produto = _b.token_produto, ambiente = _b.ambiente, conta = _b.conta, vinculo = _b.vinculo, codigo_usuario = _b.codigo_usuario, email = _b.email;
|
||||
return __generator(this, function (_c) {
|
||||
switch (_c.label) {
|
||||
case 0:
|
||||
url = "".concat((0, _urlAutenticacao_1.urlAutenticacao)(ambiente), "/api/vinculos__criar");
|
||||
if (!token_produto)
|
||||
|
|
@ -75,9 +74,8 @@ var usuarios_quipo_vincular = function (_a) {
|
|||
.catch(function (e) {
|
||||
return p_respostas_1.respostaComuns.erro("Erro ao criar vinculo de usuario ".concat(e.message));
|
||||
})];
|
||||
case 1: return [2 /*return*/, _b.sent()];
|
||||
case 1: return [2 /*return*/, _c.sent()];
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
}); };
|
||||
exports.usuarios_quipo_vincular = usuarios_quipo_vincular;
|
||||
|
|
|
|||
|
|
@ -43,17 +43,16 @@ exports.validarToken = void 0;
|
|||
var _urlAutenticacao_1 = require("./_urlAutenticacao");
|
||||
var cross_fetch_1 = __importDefault(require("cross-fetch"));
|
||||
/** faz a validação do token */
|
||||
var validarToken = function (_a) {
|
||||
var ambiente = _a.ambiente, post = _a.post;
|
||||
return __awaiter(void 0, void 0, void 0, function () {
|
||||
var validarToken = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
||||
var url, resposta, e_1;
|
||||
return __generator(this, function (_b) {
|
||||
switch (_b.label) {
|
||||
var ambiente = _b.ambiente, post = _b.post;
|
||||
return __generator(this, function (_c) {
|
||||
switch (_c.label) {
|
||||
case 0:
|
||||
url = "".concat((0, _urlAutenticacao_1.urlAutenticacao)(ambiente), "/api/validar_token");
|
||||
_b.label = 1;
|
||||
_c.label = 1;
|
||||
case 1:
|
||||
_b.trys.push([1, 3, , 4]);
|
||||
_c.trys.push([1, 3, , 4]);
|
||||
return [4 /*yield*/, (0, cross_fetch_1.default)(url, {
|
||||
method: "POST",
|
||||
body: JSON.stringify(post),
|
||||
|
|
@ -66,14 +65,13 @@ var validarToken = function (_a) {
|
|||
})
|
||||
.catch(function () { return "erro"; })];
|
||||
case 2:
|
||||
resposta = _b.sent();
|
||||
resposta = _c.sent();
|
||||
return [2 /*return*/, resposta];
|
||||
case 3:
|
||||
e_1 = _b.sent();
|
||||
e_1 = _c.sent();
|
||||
return [2 /*return*/, "erro"];
|
||||
case 4: return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
}); };
|
||||
exports.validarToken = validarToken;
|
||||
|
|
|
|||
13
dist-require/autenticacao/index.d.ts
vendored
13
dist-require/autenticacao/index.d.ts
vendored
|
|
@ -3,29 +3,28 @@ export type { tipoUsuarioExterno };
|
|||
/** todas as rotas de comunicação com autenticador partem dessa variável */
|
||||
export declare const pAutenticacao: {
|
||||
validarToken: ({ ambiente, post, }: {
|
||||
/** todas as rotas de comunicação com autenticador partem dessa variável */
|
||||
ambiente: "desenvolvimento" | "producao";
|
||||
ambiente: import("zod").TypeOf<typeof import("../ts/ambiente").zAmbiente>;
|
||||
post: {
|
||||
token: string;
|
||||
};
|
||||
}) => Promise<"valido" | "erro">;
|
||||
urlAutenticacao: (ambiente: "desenvolvimento" | "producao") => string;
|
||||
urlAutenticacao: (ambiente: import("zod").TypeOf<typeof import("../ts/ambiente").zAmbiente>) => string;
|
||||
codigoContaSite: ({ ambiente, post, }: {
|
||||
ambiente: "desenvolvimento" | "producao";
|
||||
ambiente: import("zod").TypeOf<typeof import("../ts/ambiente").zAmbiente>;
|
||||
post: {
|
||||
site: string;
|
||||
};
|
||||
}) => Promise<import("p-respostas").tipoResposta<string>>;
|
||||
usuarios_quipo_governo: ({ token_produto, ambiente, }: {
|
||||
ambiente: "desenvolvimento" | "producao";
|
||||
ambiente: import("zod").TypeOf<typeof import("../ts/ambiente").zAmbiente>;
|
||||
token_produto: string;
|
||||
}) => Promise<import("p-respostas").tipoResposta<tipoUsuarioExterno[]>>;
|
||||
usuarios_quipo_vincular: ({ token_produto, ambiente, conta, vinculo, codigo_usuario, email, }: {
|
||||
ambiente: "desenvolvimento" | "producao";
|
||||
ambiente: import("zod").TypeOf<typeof import("../ts/ambiente").zAmbiente>;
|
||||
token_produto: string;
|
||||
conta: string;
|
||||
vinculo: string;
|
||||
codigo_usuario?: string | undefined;
|
||||
codigo_usuario?: string;
|
||||
email: string;
|
||||
}) => Promise<import("p-respostas").tipoResposta<string>>;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -51,16 +51,15 @@ exports.zp_deletar_registros = zod_1.z.object({
|
|||
});
|
||||
var deletar_registros = function (_a) {
|
||||
var conta = _a.conta, produto = _a.produto, emDesenvolvimento = _a.emDesenvolvimento;
|
||||
return function (_a) {
|
||||
var codigos = _a.codigos, tabela = _a.tabela;
|
||||
return __awaiter(void 0, void 0, void 0, function () {
|
||||
return function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
||||
var url, tamanhoBlocos, bloco, resp;
|
||||
return __generator(this, function (_b) {
|
||||
switch (_b.label) {
|
||||
var codigos = _b.codigos, tabela = _b.tabela;
|
||||
return __generator(this, function (_c) {
|
||||
switch (_c.label) {
|
||||
case 0:
|
||||
url = new URL("".concat((0, variaveis_1.baseUrlPilao)(emDesenvolvimento)).concat(variaveis_1.PREFIXO, "/").concat(Object.keys({ deletar_registros: exports.deletar_registros })[0], "/").concat(produto, "/").concat(conta));
|
||||
tamanhoBlocos = 1000;
|
||||
_b.label = 1;
|
||||
_c.label = 1;
|
||||
case 1:
|
||||
if (!(codigos.length > 0)) return [3 /*break*/, 3];
|
||||
bloco = codigos.splice(0, tamanhoBlocos);
|
||||
|
|
@ -75,7 +74,7 @@ var deletar_registros = function (_a) {
|
|||
})
|
||||
.then(function (r) { return r; })];
|
||||
case 2:
|
||||
resp = _b.sent();
|
||||
resp = _c.sent();
|
||||
if (resp.eErro) {
|
||||
return [2 /*return*/, resp];
|
||||
}
|
||||
|
|
@ -83,7 +82,6 @@ var deletar_registros = function (_a) {
|
|||
case 3: return [2 /*return*/, p_respostas_1.respostaComuns.valor(true)];
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
}); };
|
||||
};
|
||||
exports.deletar_registros = deletar_registros;
|
||||
|
|
|
|||
|
|
@ -77,16 +77,15 @@ exports.zp_enviar_registros = zod_1.z.object({
|
|||
});
|
||||
var enviar_registros = function (_a) {
|
||||
var conta = _a.conta, produto = _a.produto, emDesenvolvimento = _a.emDesenvolvimento;
|
||||
return function (_a) {
|
||||
var registros = _a.registros, tabela = _a.tabela;
|
||||
return __awaiter(void 0, void 0, void 0, function () {
|
||||
return function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
||||
var url, tamanhoBlocos, bloco, resp;
|
||||
return __generator(this, function (_b) {
|
||||
switch (_b.label) {
|
||||
var registros = _b.registros, tabela = _b.tabela;
|
||||
return __generator(this, function (_c) {
|
||||
switch (_c.label) {
|
||||
case 0:
|
||||
url = new URL("".concat((0, variaveis_1.baseUrlPilao)(emDesenvolvimento)).concat(variaveis_1.PREFIXO, "/").concat(Object.keys({ enviar_registros: exports.enviar_registros })[0], "/").concat(produto, "/").concat(conta));
|
||||
tamanhoBlocos = 1000;
|
||||
_b.label = 1;
|
||||
_c.label = 1;
|
||||
case 1:
|
||||
if (!(registros.length > 0)) return [3 /*break*/, 3];
|
||||
bloco = registros
|
||||
|
|
@ -108,7 +107,7 @@ var enviar_registros = function (_a) {
|
|||
})
|
||||
.then(function (r) { return r; })];
|
||||
case 2:
|
||||
resp = _b.sent();
|
||||
resp = _c.sent();
|
||||
if (resp.eErro) {
|
||||
return [2 /*return*/, resp];
|
||||
}
|
||||
|
|
@ -116,7 +115,6 @@ var enviar_registros = function (_a) {
|
|||
case 3: return [2 /*return*/, p_respostas_1.respostaComuns.valor(true)];
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
}); };
|
||||
};
|
||||
exports.enviar_registros = enviar_registros;
|
||||
|
|
|
|||
46
dist-require/pilao-de-dados/index.d.ts
vendored
46
dist-require/pilao-de-dados/index.d.ts
vendored
|
|
@ -1,4 +1,7 @@
|
|||
import { tiposSeriesAgregacoes } from "./variaveis";
|
||||
import { zp_deletar_registros } from "./_deletar_registros";
|
||||
import { zp_enviar_registros } from "./_enviar_registros";
|
||||
import { tiposSeriesAgregacoes, zp_produto_conta } from "./variaveis";
|
||||
import { zp_serie_registrar } from "./_serie_consultar";
|
||||
export { tiposSeriesAgregacoes };
|
||||
export declare const pPilao: {
|
||||
zp_registrar_base_dados: import("zod").ZodObject<{
|
||||
|
|
@ -26,17 +29,7 @@ export declare const pPilao: {
|
|||
tipo: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "data" | "mes";
|
||||
}[];
|
||||
}>;
|
||||
enviar_registros: ({ conta, produto, emDesenvolvimento }: {
|
||||
conta: string;
|
||||
produto: string;
|
||||
emDesenvolvimento?: boolean | undefined;
|
||||
}) => ({ registros, tabela, }: {
|
||||
tabela: string;
|
||||
registros: Record<string, {
|
||||
valor?: any;
|
||||
tipo?: "texto" | "numero" | "confirmacao" | "lista_texto" | "lista_numero" | "data" | "mes" | null | undefined;
|
||||
}>[];
|
||||
}) => Promise<import("p-respostas").tipoResposta<true>>;
|
||||
enviar_registros: ({ conta, produto, emDesenvolvimento }: import("zod").TypeOf<typeof zp_produto_conta>) => ({ registros, tabela, }: import("zod").TypeOf<typeof zp_enviar_registros>) => Promise<import("p-respostas").tipoResposta<true>>;
|
||||
zp_enviar_registros: import("zod").ZodObject<{
|
||||
tabela: import("zod").ZodString;
|
||||
registros: import("zod").ZodArray<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
|
||||
|
|
@ -78,25 +71,11 @@ export declare const pPilao: {
|
|||
agregacao: "contagem" | "somatoria";
|
||||
colunaAgrupamento?: string[] | undefined;
|
||||
}>;
|
||||
serie_consultar: (cliente: {
|
||||
conta: string;
|
||||
produto: string;
|
||||
emDesenvolvimento?: boolean | undefined;
|
||||
}) => (parametros: {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
agregacao: "contagem" | "somatoria";
|
||||
colunaAgrupamento?: string[] | undefined;
|
||||
}) => {
|
||||
serie_consultar: (cliente: import("zod").TypeOf<typeof zp_produto_conta>) => (parametros: import("zod").TypeOf<typeof zp_serie_registrar>) => {
|
||||
dados: () => Promise<import("p-respostas").tipoResposta<{
|
||||
registros: any[];
|
||||
legenda: string;
|
||||
serie: {
|
||||
tabela: string;
|
||||
colanuEixoX: string;
|
||||
agregacao: "contagem" | "somatoria";
|
||||
colunaAgrupamento?: string[] | undefined;
|
||||
};
|
||||
serie: import("zod").TypeOf<typeof zp_serie_registrar>;
|
||||
}>>;
|
||||
url: () => string;
|
||||
};
|
||||
|
|
@ -113,15 +92,8 @@ export declare const pPilao: {
|
|||
produto: string;
|
||||
emDesenvolvimento?: boolean | undefined;
|
||||
}>;
|
||||
validarZ: <T>(zodType: import("zod").ZodType<T, any, T>, objeto: any, mensagem: string) => import("p-respostas").tipoRespostaErro | import("p-respostas").tipoRespostaSucesso<T>;
|
||||
deletar_registros: ({ conta, produto, emDesenvolvimento }: {
|
||||
conta: string;
|
||||
produto: string;
|
||||
emDesenvolvimento?: boolean | undefined;
|
||||
}) => ({ codigos, tabela, }: {
|
||||
tabela: string;
|
||||
codigos: string[];
|
||||
}) => Promise<import("p-respostas").tipoResposta<true>>;
|
||||
validarZ: <T>(zodType: import("zod").ZodType<T, any>, objeto: any, mensagem: string) => import("p-respostas").tipoRespostaErro | import("p-respostas").tipoRespostaSucesso<T>;
|
||||
deletar_registros: ({ conta, produto, emDesenvolvimento }: import("zod").TypeOf<typeof zp_produto_conta>) => ({ codigos, tabela, }: import("zod").TypeOf<typeof zp_deletar_registros>) => Promise<import("p-respostas").tipoResposta<true>>;
|
||||
zp_deletar_registros: import("zod").ZodObject<{
|
||||
tabela: import("zod").ZodString;
|
||||
codigos: import("zod").ZodArray<import("zod").ZodString, "many">;
|
||||
|
|
|
|||
2
dist-require/pilao-de-dados/variaveis.d.ts
vendored
2
dist-require/pilao-de-dados/variaveis.d.ts
vendored
|
|
@ -1,7 +1,7 @@
|
|||
import { z } from "zod";
|
||||
export declare const zAmbiente: z.ZodEnum<["desenvolvimento", "producao"]>;
|
||||
export declare const PREFIXO = "/pilao-de-dados";
|
||||
export declare const validarZ: <T>(zodType: z.ZodType<T, any, T>, objeto: any, mensagem: string) => import("p-respostas").tipoRespostaErro | import("p-respostas").tipoRespostaSucesso<T>;
|
||||
export declare const validarZ: <T>(zodType: z.ZodType<T, any>, objeto: any, mensagem: string) => import("p-respostas").tipoRespostaErro | import("p-respostas").tipoRespostaSucesso<T>;
|
||||
export declare const zp_produto_conta: z.ZodObject<{
|
||||
produto: z.ZodString;
|
||||
conta: z.ZodString;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "p-drives",
|
||||
"version": "0.99.0",
|
||||
"version": "0.100.0",
|
||||
"description": "",
|
||||
"main": "src/index.ts",
|
||||
"exports": {
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
"check-node-version": "^4.2.1",
|
||||
"p-comuns": "git+http://leitura:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3MTQ3NTA1NzYsImlzcyI6IkdpdG5lc3MiLCJwaWQiOjgsInRrbiI6eyJ0eXAiOiJwYXQiLCJpZCI6MzJ9fQ.OYdExOVQm5UI3wfeTaWjmD0o65Y1hrjFz5EvMB1a__U@git.idz.one:3000/git/multi-modulos-ambientais/_comuns.git#producao",
|
||||
"p-respostas": "git+http://leitura:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3MTQ3NTA1NzYsImlzcyI6IkdpdG5lc3MiLCJwaWQiOjgsInRrbiI6eyJ0eXAiOiJwYXQiLCJpZCI6MzJ9fQ.OYdExOVQm5UI3wfeTaWjmD0o65Y1hrjFz5EvMB1a__U@git.idz.one:3000/git/multi-modulos-ambientais/_respostas.git#producao",
|
||||
"typescript": "^4.9.5"
|
||||
"typescript": "^5"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": {
|
||||
|
|
|
|||
26
pnpm-lock.yaml
generated
26
pnpm-lock.yaml
generated
|
|
@ -26,13 +26,13 @@ importers:
|
|||
version: 4.2.1
|
||||
p-comuns:
|
||||
specifier: git+http://leitura:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3MTQ3NTA1NzYsImlzcyI6IkdpdG5lc3MiLCJwaWQiOjgsInRrbiI6eyJ0eXAiOiJwYXQiLCJpZCI6MzJ9fQ.OYdExOVQm5UI3wfeTaWjmD0o65Y1hrjFz5EvMB1a__U@git.idz.one:3000/git/multi-modulos-ambientais/_comuns.git#producao
|
||||
version: git+http://leitura:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3MTQ3NTA1NzYsImlzcyI6IkdpdG5lc3MiLCJwaWQiOjgsInRrbiI6eyJ0eXAiOiJwYXQiLCJpZCI6MzJ9fQ.OYdExOVQm5UI3wfeTaWjmD0o65Y1hrjFz5EvMB1a__U@git.idz.one:3000/git/multi-modulos-ambientais/_comuns.git#b01ceca6b840e3a30ee85a2dd98015ab0e8f298d(typescript@4.9.5)
|
||||
version: git+http://leitura:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3MTQ3NTA1NzYsImlzcyI6IkdpdG5lc3MiLCJwaWQiOjgsInRrbiI6eyJ0eXAiOiJwYXQiLCJpZCI6MzJ9fQ.OYdExOVQm5UI3wfeTaWjmD0o65Y1hrjFz5EvMB1a__U@git.idz.one:3000/git/multi-modulos-ambientais/_comuns.git#1813ad10fdf0c1024cca1d399c7cd2902044e38b(typescript@5.5.2)
|
||||
p-respostas:
|
||||
specifier: git+http://leitura:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3MTQ3NTA1NzYsImlzcyI6IkdpdG5lc3MiLCJwaWQiOjgsInRrbiI6eyJ0eXAiOiJwYXQiLCJpZCI6MzJ9fQ.OYdExOVQm5UI3wfeTaWjmD0o65Y1hrjFz5EvMB1a__U@git.idz.one:3000/git/multi-modulos-ambientais/_respostas.git#producao
|
||||
version: git+http://leitura:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3MTQ3NTA1NzYsImlzcyI6IkdpdG5lc3MiLCJwaWQiOjgsInRrbiI6eyJ0eXAiOiJwYXQiLCJpZCI6MzJ9fQ.OYdExOVQm5UI3wfeTaWjmD0o65Y1hrjFz5EvMB1a__U@git.idz.one:3000/git/multi-modulos-ambientais/_respostas.git#c10a2584e6f6ec5c87462c810cafb1dad243067d
|
||||
typescript:
|
||||
specifier: ^4.9.5
|
||||
version: 4.9.5
|
||||
specifier: ^5
|
||||
version: 5.5.2
|
||||
|
||||
packages:
|
||||
|
||||
|
|
@ -137,11 +137,11 @@ packages:
|
|||
object-filter@1.0.2:
|
||||
resolution: {integrity: sha512-NahvP2vZcy1ZiiYah30CEPw0FpDcSkSePJBMpzl5EQgCmISijiGuJm3SPYp7U+Lf2TljyaIw3E5EgkEx/TNEVA==}
|
||||
|
||||
p-comuns@git+http://leitura:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3MTQ3NTA1NzYsImlzcyI6IkdpdG5lc3MiLCJwaWQiOjgsInRrbiI6eyJ0eXAiOiJwYXQiLCJpZCI6MzJ9fQ.OYdExOVQm5UI3wfeTaWjmD0o65Y1hrjFz5EvMB1a__U@git.idz.one:3000/git/multi-modulos-ambientais/_comuns.git#b01ceca6b840e3a30ee85a2dd98015ab0e8f298d:
|
||||
resolution: {commit: b01ceca6b840e3a30ee85a2dd98015ab0e8f298d, repo: http://leitura:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3MTQ3NTA1NzYsImlzcyI6IkdpdG5lc3MiLCJwaWQiOjgsInRrbiI6eyJ0eXAiOiJwYXQiLCJpZCI6MzJ9fQ.OYdExOVQm5UI3wfeTaWjmD0o65Y1hrjFz5EvMB1a__U@git.idz.one:3000/git/multi-modulos-ambientais/_comuns.git, type: git}
|
||||
version: 0.31.0
|
||||
p-comuns@git+http://leitura:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3MTQ3NTA1NzYsImlzcyI6IkdpdG5lc3MiLCJwaWQiOjgsInRrbiI6eyJ0eXAiOiJwYXQiLCJpZCI6MzJ9fQ.OYdExOVQm5UI3wfeTaWjmD0o65Y1hrjFz5EvMB1a__U@git.idz.one:3000/git/multi-modulos-ambientais/_comuns.git#1813ad10fdf0c1024cca1d399c7cd2902044e38b:
|
||||
resolution: {commit: 1813ad10fdf0c1024cca1d399c7cd2902044e38b, repo: http://leitura:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3MTQ3NTA1NzYsImlzcyI6IkdpdG5lc3MiLCJwaWQiOjgsInRrbiI6eyJ0eXAiOiJwYXQiLCJpZCI6MzJ9fQ.OYdExOVQm5UI3wfeTaWjmD0o65Y1hrjFz5EvMB1a__U@git.idz.one:3000/git/multi-modulos-ambientais/_comuns.git, type: git}
|
||||
version: 0.32.0
|
||||
peerDependencies:
|
||||
typescript: ^5.0.0
|
||||
typescript: ^5
|
||||
|
||||
p-respostas@git+http://leitura:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3MTQ3NTA1NzYsImlzcyI6IkdpdG5lc3MiLCJwaWQiOjgsInRrbiI6eyJ0eXAiOiJwYXQiLCJpZCI6MzJ9fQ.OYdExOVQm5UI3wfeTaWjmD0o65Y1hrjFz5EvMB1a__U@git.idz.one:3000/git/multi-modulos-ambientais/_respostas.git#c10a2584e6f6ec5c87462c810cafb1dad243067d:
|
||||
resolution: {commit: c10a2584e6f6ec5c87462c810cafb1dad243067d, repo: http://leitura:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3MTQ3NTA1NzYsImlzcyI6IkdpdG5lc3MiLCJwaWQiOjgsInRrbiI6eyJ0eXAiOiJwYXQiLCJpZCI6MzJ9fQ.OYdExOVQm5UI3wfeTaWjmD0o65Y1hrjFz5EvMB1a__U@git.idz.one:3000/git/multi-modulos-ambientais/_respostas.git, type: git}
|
||||
|
|
@ -164,9 +164,9 @@ packages:
|
|||
tr46@0.0.3:
|
||||
resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==}
|
||||
|
||||
typescript@4.9.5:
|
||||
resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==}
|
||||
engines: {node: '>=4.2.0'}
|
||||
typescript@5.5.2:
|
||||
resolution: {integrity: sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==}
|
||||
engines: {node: '>=14.17'}
|
||||
hasBin: true
|
||||
|
||||
undici-types@5.26.5:
|
||||
|
|
@ -264,9 +264,9 @@ snapshots:
|
|||
|
||||
object-filter@1.0.2: {}
|
||||
|
||||
p-comuns@git+http://leitura:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3MTQ3NTA1NzYsImlzcyI6IkdpdG5lc3MiLCJwaWQiOjgsInRrbiI6eyJ0eXAiOiJwYXQiLCJpZCI6MzJ9fQ.OYdExOVQm5UI3wfeTaWjmD0o65Y1hrjFz5EvMB1a__U@git.idz.one:3000/git/multi-modulos-ambientais/_comuns.git#b01ceca6b840e3a30ee85a2dd98015ab0e8f298d(typescript@4.9.5):
|
||||
p-comuns@git+http://leitura:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3MTQ3NTA1NzYsImlzcyI6IkdpdG5lc3MiLCJwaWQiOjgsInRrbiI6eyJ0eXAiOiJwYXQiLCJpZCI6MzJ9fQ.OYdExOVQm5UI3wfeTaWjmD0o65Y1hrjFz5EvMB1a__U@git.idz.one:3000/git/multi-modulos-ambientais/_comuns.git#1813ad10fdf0c1024cca1d399c7cd2902044e38b(typescript@5.5.2):
|
||||
dependencies:
|
||||
typescript: 4.9.5
|
||||
typescript: 5.5.2
|
||||
zod: 3.23.8
|
||||
|
||||
p-respostas@git+http://leitura:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3MTQ3NTA1NzYsImlzcyI6IkdpdG5lc3MiLCJwaWQiOjgsInRrbiI6eyJ0eXAiOiJwYXQiLCJpZCI6MzJ9fQ.OYdExOVQm5UI3wfeTaWjmD0o65Y1hrjFz5EvMB1a__U@git.idz.one:3000/git/multi-modulos-ambientais/_respostas.git#c10a2584e6f6ec5c87462c810cafb1dad243067d:
|
||||
|
|
@ -287,7 +287,7 @@ snapshots:
|
|||
|
||||
tr46@0.0.3: {}
|
||||
|
||||
typescript@4.9.5: {}
|
||||
typescript@5.5.2: {}
|
||||
|
||||
undici-types@5.26.5: {}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue