.
This commit is contained in:
parent
e580643abc
commit
46d1880cef
8 changed files with 28 additions and 95 deletions
2
dist-import/pilao-de-dados/index.d.ts
vendored
2
dist-import/pilao-de-dados/index.d.ts
vendored
|
|
@ -81,7 +81,7 @@ export declare const pPilao: {
|
||||||
colunaAgrupamento: string;
|
colunaAgrupamento: string;
|
||||||
agregacao: "contagem" | "somatoria";
|
agregacao: "contagem" | "somatoria";
|
||||||
}>;
|
}>;
|
||||||
serie_consultar: ({ emDesenvolvimento, cliente: { conta, produto }, parametros: { agregacao, colanuEixoX, colunaAgrupamento, tabela }, }: {
|
serie_consultar: ({ emDesenvolvimento, cliente, parametros, }: {
|
||||||
emDesenvolvimento?: boolean | null | undefined;
|
emDesenvolvimento?: boolean | null | undefined;
|
||||||
cliente: {
|
cliente: {
|
||||||
produto: string;
|
produto: string;
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ export declare const zp_serie_registrar: z.ZodObject<{
|
||||||
colunaAgrupamento: string;
|
colunaAgrupamento: string;
|
||||||
agregacao: "contagem" | "somatoria";
|
agregacao: "contagem" | "somatoria";
|
||||||
}>;
|
}>;
|
||||||
export declare const serie_consultar: ({ emDesenvolvimento, cliente: { conta, produto }, parametros: { agregacao, colanuEixoX, colunaAgrupamento, tabela }, }: {
|
export declare const serie_consultar: ({ emDesenvolvimento, cliente, parametros, }: {
|
||||||
emDesenvolvimento?: boolean | undefined | null;
|
emDesenvolvimento?: boolean | undefined | null;
|
||||||
/** Identificação do cliente */
|
/** Identificação do cliente */
|
||||||
cliente: z.infer<typeof zp_produto_conta>;
|
cliente: z.infer<typeof zp_produto_conta>;
|
||||||
|
|
|
||||||
|
|
@ -17,17 +17,12 @@ export const zp_serie_registrar = z.object({
|
||||||
colunaAgrupamento: z.string(),
|
colunaAgrupamento: z.string(),
|
||||||
agregacao: tiposSeriesAgregacoes,
|
agregacao: tiposSeriesAgregacoes,
|
||||||
});
|
});
|
||||||
export const serie_consultar = ({ emDesenvolvimento, cliente: { conta, produto }, parametros: { agregacao, colanuEixoX, colunaAgrupamento, tabela }, }) => {
|
export const serie_consultar = ({ emDesenvolvimento, cliente, parametros, }) => {
|
||||||
const dados = () => __awaiter(void 0, void 0, void 0, function* () {
|
const dados = () => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
const url = new URL(`${baseUrlPilao(emDesenvolvimento)}${`${PREFIXO}/${tiposSeriesAgregacoes.enum.contagem}/${produto}/${conta}`}`);
|
const url = new URL(`${baseUrlPilao(emDesenvolvimento)}${`${PREFIXO}/${tiposSeriesAgregacoes.enum.contagem}/${cliente.produto}/${cliente.conta}`}`);
|
||||||
const resp = yield node_fetch(url.toString(), {
|
const resp = yield node_fetch(url.toString(), {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify({
|
body: JSON.stringify(parametros),
|
||||||
agregacao,
|
|
||||||
colanuEixoX,
|
|
||||||
colunaAgrupamento,
|
|
||||||
tabela,
|
|
||||||
}),
|
|
||||||
headers: { "Content-Type": "application/json" },
|
headers: { "Content-Type": "application/json" },
|
||||||
})
|
})
|
||||||
.then((r) => r.json())
|
.then((r) => r.json())
|
||||||
|
|
@ -37,19 +32,14 @@ export const serie_consultar = ({ emDesenvolvimento, cliente: { conta, produto }
|
||||||
});
|
});
|
||||||
const url = () => {
|
const url = () => {
|
||||||
const pr = {
|
const pr = {
|
||||||
produto,
|
cliente,
|
||||||
conta,
|
parametros,
|
||||||
agregacao,
|
|
||||||
colanuEixoX,
|
|
||||||
colunaAgrupamento,
|
|
||||||
tabela,
|
|
||||||
};
|
};
|
||||||
|
const pr64 = btoa(JSON.stringify(pr, null, 2));
|
||||||
const vUrl = new URL(`${emDesenvolvimento
|
const vUrl = new URL(`${emDesenvolvimento
|
||||||
? "http://127.0.0.1:5081"
|
? "http://127.0.0.1:5081"
|
||||||
: "https://carro-de-boi.idz.one"}${PREFIXO}/${tiposSeriesAgregacoes.enum.contagem}`);
|
: "https://carro-de-boi.idz.one"}${PREFIXO}/${tiposSeriesAgregacoes.enum.contagem}`);
|
||||||
for (const [k, v] of Object.entries(pr)) {
|
vUrl.searchParams.append("serie", pr64);
|
||||||
vUrl.searchParams.append(k, JSON.stringify(v));
|
|
||||||
}
|
|
||||||
return vUrl.href;
|
return vUrl.href;
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
2
dist-require/pilao-de-dados/index.d.ts
vendored
2
dist-require/pilao-de-dados/index.d.ts
vendored
|
|
@ -81,7 +81,7 @@ export declare const pPilao: {
|
||||||
colunaAgrupamento: string;
|
colunaAgrupamento: string;
|
||||||
agregacao: "contagem" | "somatoria";
|
agregacao: "contagem" | "somatoria";
|
||||||
}>;
|
}>;
|
||||||
serie_consultar: ({ emDesenvolvimento, cliente: { conta, produto }, parametros: { agregacao, colanuEixoX, colunaAgrupamento, tabela }, }: {
|
serie_consultar: ({ emDesenvolvimento, cliente, parametros, }: {
|
||||||
emDesenvolvimento?: boolean | null | undefined;
|
emDesenvolvimento?: boolean | null | undefined;
|
||||||
cliente: {
|
cliente: {
|
||||||
produto: string;
|
produto: string;
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ export declare const zp_serie_registrar: z.ZodObject<{
|
||||||
colunaAgrupamento: string;
|
colunaAgrupamento: string;
|
||||||
agregacao: "contagem" | "somatoria";
|
agregacao: "contagem" | "somatoria";
|
||||||
}>;
|
}>;
|
||||||
export declare const serie_consultar: ({ emDesenvolvimento, cliente: { conta, produto }, parametros: { agregacao, colanuEixoX, colunaAgrupamento, tabela }, }: {
|
export declare const serie_consultar: ({ emDesenvolvimento, cliente, parametros, }: {
|
||||||
emDesenvolvimento?: boolean | undefined | null;
|
emDesenvolvimento?: boolean | undefined | null;
|
||||||
/** Identificação do cliente */
|
/** Identificação do cliente */
|
||||||
cliente: z.infer<typeof zp_produto_conta>;
|
cliente: z.infer<typeof zp_produto_conta>;
|
||||||
|
|
|
||||||
|
|
@ -35,33 +35,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var __values = (this && this.__values) || function(o) {
|
|
||||||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
||||||
if (m) return m.call(o);
|
|
||||||
if (o && typeof o.length === "number") return {
|
|
||||||
next: function () {
|
|
||||||
if (o && i >= o.length) o = void 0;
|
|
||||||
return { value: o && o[i++], done: !o };
|
|
||||||
}
|
|
||||||
};
|
|
||||||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
||||||
};
|
|
||||||
var __read = (this && this.__read) || function (o, n) {
|
|
||||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
||||||
if (!m) return o;
|
|
||||||
var i = m.call(o), r, ar = [], e;
|
|
||||||
try {
|
|
||||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
||||||
}
|
|
||||||
catch (error) { e = { error: error }; }
|
|
||||||
finally {
|
|
||||||
try {
|
|
||||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
||||||
}
|
|
||||||
finally { if (e) throw e.error; }
|
|
||||||
}
|
|
||||||
return ar;
|
|
||||||
};
|
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
|
|
@ -78,21 +51,16 @@ exports.zp_serie_registrar = zod_1.z.object({
|
||||||
agregacao: _variaveis_1.tiposSeriesAgregacoes,
|
agregacao: _variaveis_1.tiposSeriesAgregacoes,
|
||||||
});
|
});
|
||||||
var serie_consultar = function (_a) {
|
var serie_consultar = function (_a) {
|
||||||
var emDesenvolvimento = _a.emDesenvolvimento, _b = _a.cliente, conta = _b.conta, produto = _b.produto, _c = _a.parametros, agregacao = _c.agregacao, colanuEixoX = _c.colanuEixoX, colunaAgrupamento = _c.colunaAgrupamento, tabela = _c.tabela;
|
var emDesenvolvimento = _a.emDesenvolvimento, cliente = _a.cliente, parametros = _a.parametros;
|
||||||
var dados = function () { return __awaiter(void 0, void 0, void 0, function () {
|
var dados = function () { return __awaiter(void 0, void 0, void 0, function () {
|
||||||
var url, resp;
|
var url, resp;
|
||||||
return __generator(this, function (_a) {
|
return __generator(this, function (_a) {
|
||||||
switch (_a.label) {
|
switch (_a.label) {
|
||||||
case 0:
|
case 0:
|
||||||
url = new URL("".concat((0, _variaveis_1.baseUrlPilao)(emDesenvolvimento)).concat("".concat(_variaveis_1.PREFIXO, "/").concat(_variaveis_1.tiposSeriesAgregacoes.enum.contagem, "/").concat(produto, "/").concat(conta)));
|
url = new URL("".concat((0, _variaveis_1.baseUrlPilao)(emDesenvolvimento)).concat("".concat(_variaveis_1.PREFIXO, "/").concat(_variaveis_1.tiposSeriesAgregacoes.enum.contagem, "/").concat(cliente.produto, "/").concat(cliente.conta)));
|
||||||
return [4 /*yield*/, (0, cross_fetch_1.default)(url.toString(), {
|
return [4 /*yield*/, (0, cross_fetch_1.default)(url.toString(), {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify({
|
body: JSON.stringify(parametros),
|
||||||
agregacao: agregacao,
|
|
||||||
colanuEixoX: colanuEixoX,
|
|
||||||
colunaAgrupamento: colunaAgrupamento,
|
|
||||||
tabela: tabela,
|
|
||||||
}),
|
|
||||||
headers: { "Content-Type": "application/json" },
|
headers: { "Content-Type": "application/json" },
|
||||||
})
|
})
|
||||||
.then(function (r) { return r.json(); })
|
.then(function (r) { return r.json(); })
|
||||||
|
|
@ -107,31 +75,15 @@ var serie_consultar = function (_a) {
|
||||||
});
|
});
|
||||||
}); };
|
}); };
|
||||||
var url = function () {
|
var url = function () {
|
||||||
var e_1, _a;
|
|
||||||
var pr = {
|
var pr = {
|
||||||
produto: produto,
|
cliente: cliente,
|
||||||
conta: conta,
|
parametros: parametros,
|
||||||
agregacao: agregacao,
|
|
||||||
colanuEixoX: colanuEixoX,
|
|
||||||
colunaAgrupamento: colunaAgrupamento,
|
|
||||||
tabela: tabela,
|
|
||||||
};
|
};
|
||||||
|
var pr64 = btoa(JSON.stringify(pr, null, 2));
|
||||||
var vUrl = new URL("".concat(emDesenvolvimento
|
var vUrl = new URL("".concat(emDesenvolvimento
|
||||||
? "http://127.0.0.1:5081"
|
? "http://127.0.0.1:5081"
|
||||||
: "https://carro-de-boi.idz.one").concat(_variaveis_1.PREFIXO, "/").concat(_variaveis_1.tiposSeriesAgregacoes.enum.contagem));
|
: "https://carro-de-boi.idz.one").concat(_variaveis_1.PREFIXO, "/").concat(_variaveis_1.tiposSeriesAgregacoes.enum.contagem));
|
||||||
try {
|
vUrl.searchParams.append("serie", pr64);
|
||||||
for (var _b = __values(Object.entries(pr)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
||||||
var _d = __read(_c.value, 2), k = _d[0], v = _d[1];
|
|
||||||
vUrl.searchParams.append(k, JSON.stringify(v));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
||||||
finally {
|
|
||||||
try {
|
|
||||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
||||||
}
|
|
||||||
finally { if (e_1) throw e_1.error; }
|
|
||||||
}
|
|
||||||
return vUrl.href;
|
return vUrl.href;
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "p-drives",
|
"name": "p-drives",
|
||||||
"version": "0.77.0",
|
"version": "0.78.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,8 @@ export const zp_serie_registrar = z.object({
|
||||||
|
|
||||||
export const serie_consultar = ({
|
export const serie_consultar = ({
|
||||||
emDesenvolvimento,
|
emDesenvolvimento,
|
||||||
cliente: { conta, produto },
|
cliente,
|
||||||
parametros: { agregacao, colanuEixoX, colunaAgrupamento, tabela },
|
parametros,
|
||||||
}: {
|
}: {
|
||||||
emDesenvolvimento?: boolean | undefined | null
|
emDesenvolvimento?: boolean | undefined | null
|
||||||
|
|
||||||
|
|
@ -37,17 +37,12 @@ export const serie_consultar = ({
|
||||||
const url = new URL(
|
const url = new URL(
|
||||||
`${baseUrlPilao(emDesenvolvimento)}${`${PREFIXO}/${
|
`${baseUrlPilao(emDesenvolvimento)}${`${PREFIXO}/${
|
||||||
tiposSeriesAgregacoes.enum.contagem
|
tiposSeriesAgregacoes.enum.contagem
|
||||||
}/${produto}/${conta}`}`,
|
}/${cliente.produto}/${cliente.conta}`}`,
|
||||||
)
|
)
|
||||||
|
|
||||||
const resp = await node_fetch(url.toString(), {
|
const resp = await node_fetch(url.toString(), {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify({
|
body: JSON.stringify(parametros),
|
||||||
agregacao,
|
|
||||||
colanuEixoX,
|
|
||||||
colunaAgrupamento,
|
|
||||||
tabela,
|
|
||||||
}),
|
|
||||||
headers: { "Content-Type": "application/json" },
|
headers: { "Content-Type": "application/json" },
|
||||||
})
|
})
|
||||||
.then((r) => r.json())
|
.then((r) => r.json())
|
||||||
|
|
@ -61,14 +56,12 @@ export const serie_consultar = ({
|
||||||
|
|
||||||
const url = (): string => {
|
const url = (): string => {
|
||||||
const pr = {
|
const pr = {
|
||||||
produto,
|
cliente,
|
||||||
conta,
|
parametros,
|
||||||
agregacao,
|
|
||||||
colanuEixoX,
|
|
||||||
colunaAgrupamento,
|
|
||||||
tabela,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const pr64 = btoa(JSON.stringify(pr, null, 2))
|
||||||
|
|
||||||
const vUrl = new URL(
|
const vUrl = new URL(
|
||||||
`${
|
`${
|
||||||
emDesenvolvimento
|
emDesenvolvimento
|
||||||
|
|
@ -77,9 +70,7 @@ export const serie_consultar = ({
|
||||||
}${PREFIXO}/${tiposSeriesAgregacoes.enum.contagem}`,
|
}${PREFIXO}/${tiposSeriesAgregacoes.enum.contagem}`,
|
||||||
)
|
)
|
||||||
|
|
||||||
for (const [k, v] of Object.entries(pr)) {
|
vUrl.searchParams.append("serie", pr64)
|
||||||
vUrl.searchParams.append(k, JSON.stringify(v))
|
|
||||||
}
|
|
||||||
|
|
||||||
return vUrl.href
|
return vUrl.href
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue