import node_fetch from 'cross-fetch';
This commit is contained in:
parent
5e04f26bbb
commit
a6205f1ab6
14 changed files with 53 additions and 58 deletions
|
|
@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
import node_fetch from "node-fetch";
|
||||
import node_fetch from "cross-fetch";
|
||||
import { respostaComuns } from "p-respostas";
|
||||
import { z } from "zod";
|
||||
import { PREFIXO, baseUrlPilao } from "./_variaveis";
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
import node_fetch from "node-fetch";
|
||||
import node_fetch from "cross-fetch";
|
||||
import { respostaComuns } from "p-respostas";
|
||||
import { z } from "zod";
|
||||
import { PREFIXO, baseUrlPilao, z_tipo_coluna_base_dados, } from "./_variaveis";
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
import node_fetch from "node-fetch";
|
||||
import node_fetch from "cross-fetch";
|
||||
import { respostaComuns } from "p-respostas";
|
||||
import { z } from "zod";
|
||||
import { PREFIXO, baseUrlPilao, tiposSeriesAgregacoes, } from "./_variaveis";
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
import node_fetch from "node-fetch";
|
||||
import node_fetch from "cross-fetch";
|
||||
import { respostaComuns } from "p-respostas";
|
||||
import { z } from "zod";
|
||||
import { PREFIXO, baseUrlPilao, tiposSeriesAgregacoes, } from "./_variaveis";
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.deletar_registros = exports.zp_deletar_registros = void 0;
|
||||
var node_fetch_1 = __importDefault(require("node-fetch"));
|
||||
var cross_fetch_1 = __importDefault(require("cross-fetch"));
|
||||
var p_respostas_1 = require("p-respostas");
|
||||
var zod_1 = require("zod");
|
||||
var _variaveis_1 = require("./_variaveis");
|
||||
|
|
@ -62,7 +62,7 @@ var deletar_registros = function (_a) {
|
|||
case 1:
|
||||
if (!(codigos.length > 0)) return [3 /*break*/, 3];
|
||||
bloco = codigos.splice(0, tamanhoBlocos);
|
||||
return [4 /*yield*/, (0, node_fetch_1.default)(url.toString(), {
|
||||
return [4 /*yield*/, (0, cross_fetch_1.default)(url.toString(), {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ tabela: tabela, codigos: bloco }),
|
||||
headers: { "Content-Type": "application/json" },
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.enviar_registros = exports.zp_enviar_registros = exports.zp_registrar_base_dados = void 0;
|
||||
var node_fetch_1 = __importDefault(require("node-fetch"));
|
||||
var cross_fetch_1 = __importDefault(require("cross-fetch"));
|
||||
var p_respostas_1 = require("p-respostas");
|
||||
var zod_1 = require("zod");
|
||||
var _variaveis_1 = require("./_variaveis");
|
||||
|
|
@ -72,7 +72,7 @@ var enviar_registros = function (_a) {
|
|||
case 1:
|
||||
if (!(registros.length > 0)) return [3 /*break*/, 3];
|
||||
bloco = registros.splice(0, tamanhoBlocos);
|
||||
return [4 /*yield*/, (0, node_fetch_1.default)(url.toString(), {
|
||||
return [4 /*yield*/, (0, cross_fetch_1.default)(url.toString(), {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ tabela: tabela, registros: bloco }),
|
||||
headers: { "Content-Type": "application/json" },
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.serie_consultar = exports.zp_serie_consultar = void 0;
|
||||
var node_fetch_1 = __importDefault(require("node-fetch"));
|
||||
var cross_fetch_1 = __importDefault(require("cross-fetch"));
|
||||
var p_respostas_1 = require("p-respostas");
|
||||
var zod_1 = require("zod");
|
||||
var _variaveis_1 = require("./_variaveis");
|
||||
|
|
@ -56,7 +56,7 @@ var serie_consultar = function (_a) {
|
|||
switch (_a.label) {
|
||||
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)));
|
||||
return [4 /*yield*/, (0, node_fetch_1.default)(url.toString(), {
|
||||
return [4 /*yield*/, (0, cross_fetch_1.default)(url.toString(), {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
identificador: identificador,
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.serie_registrar = exports.zp_serie_registrar = void 0;
|
||||
var node_fetch_1 = __importDefault(require("node-fetch"));
|
||||
var cross_fetch_1 = __importDefault(require("cross-fetch"));
|
||||
var p_respostas_1 = require("p-respostas");
|
||||
var zod_1 = require("zod");
|
||||
var _variaveis_1 = require("./_variaveis");
|
||||
|
|
@ -60,7 +60,7 @@ var serie_registrar = function (_a) {
|
|||
switch (_d.label) {
|
||||
case 0:
|
||||
url = new URL("".concat((0, _variaveis_1.baseUrlPilao)(emDesenvolvimento)).concat("".concat(_variaveis_1.PREFIXO, "/").concat(Object.keys({ serie_registrar: exports.serie_registrar })[0], "/").concat(produto, "/").concat(conta)));
|
||||
return [4 /*yield*/, (0, node_fetch_1.default)(url.toString(), {
|
||||
return [4 /*yield*/, (0, cross_fetch_1.default)(url.toString(), {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
tabela: tabela,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "p-drives",
|
||||
"version": "0.73.0",
|
||||
"version": "0.74.0",
|
||||
"description": "",
|
||||
"main": "src/index.ts",
|
||||
"exports": {
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
},
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"node-fetch": "^3.3.2",
|
||||
"cross-fetch": "^4.0.0",
|
||||
"zod": "latest"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
75
pnpm-lock.yaml
generated
75
pnpm-lock.yaml
generated
|
|
@ -8,9 +8,9 @@ importers:
|
|||
|
||||
.:
|
||||
dependencies:
|
||||
node-fetch:
|
||||
specifier: ^3.3.2
|
||||
version: 3.3.2
|
||||
cross-fetch:
|
||||
specifier: ^4.0.0
|
||||
version: 4.0.0
|
||||
zod:
|
||||
specifier: latest
|
||||
version: 3.23.8
|
||||
|
|
@ -112,17 +112,8 @@ packages:
|
|||
color-name@1.1.4:
|
||||
resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==}
|
||||
|
||||
data-uri-to-buffer@4.0.1:
|
||||
resolution: {integrity: sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==}
|
||||
engines: {node: '>= 12'}
|
||||
|
||||
fetch-blob@3.2.0:
|
||||
resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==}
|
||||
engines: {node: ^12.20 || >= 14.13}
|
||||
|
||||
formdata-polyfill@4.0.10:
|
||||
resolution: {integrity: sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==}
|
||||
engines: {node: '>=12.20.0'}
|
||||
cross-fetch@4.0.0:
|
||||
resolution: {integrity: sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==}
|
||||
|
||||
has-flag@4.0.0:
|
||||
resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}
|
||||
|
|
@ -134,13 +125,14 @@ packages:
|
|||
minimist@1.2.8:
|
||||
resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==}
|
||||
|
||||
node-domexception@1.0.0:
|
||||
resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==}
|
||||
engines: {node: '>=10.5.0'}
|
||||
|
||||
node-fetch@3.3.2:
|
||||
resolution: {integrity: sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==}
|
||||
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
|
||||
node-fetch@2.7.0:
|
||||
resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==}
|
||||
engines: {node: 4.x || >=6.0.0}
|
||||
peerDependencies:
|
||||
encoding: ^0.1.0
|
||||
peerDependenciesMeta:
|
||||
encoding:
|
||||
optional: true
|
||||
|
||||
object-filter@1.0.2:
|
||||
resolution: {integrity: sha512-NahvP2vZcy1ZiiYah30CEPw0FpDcSkSePJBMpzl5EQgCmISijiGuJm3SPYp7U+Lf2TljyaIw3E5EgkEx/TNEVA==}
|
||||
|
|
@ -169,6 +161,9 @@ packages:
|
|||
resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
tr46@0.0.3:
|
||||
resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==}
|
||||
|
||||
typescript@4.9.5:
|
||||
resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==}
|
||||
engines: {node: '>=4.2.0'}
|
||||
|
|
@ -177,9 +172,11 @@ packages:
|
|||
undici-types@5.26.5:
|
||||
resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==}
|
||||
|
||||
web-streams-polyfill@3.3.3:
|
||||
resolution: {integrity: sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==}
|
||||
engines: {node: '>= 8'}
|
||||
webidl-conversions@3.0.1:
|
||||
resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==}
|
||||
|
||||
whatwg-url@5.0.0:
|
||||
resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==}
|
||||
|
||||
zod@3.23.8:
|
||||
resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==}
|
||||
|
|
@ -249,16 +246,11 @@ snapshots:
|
|||
|
||||
color-name@1.1.4: {}
|
||||
|
||||
data-uri-to-buffer@4.0.1: {}
|
||||
|
||||
fetch-blob@3.2.0:
|
||||
cross-fetch@4.0.0:
|
||||
dependencies:
|
||||
node-domexception: 1.0.0
|
||||
web-streams-polyfill: 3.3.3
|
||||
|
||||
formdata-polyfill@4.0.10:
|
||||
dependencies:
|
||||
fetch-blob: 3.2.0
|
||||
node-fetch: 2.7.0
|
||||
transitivePeerDependencies:
|
||||
- encoding
|
||||
|
||||
has-flag@4.0.0: {}
|
||||
|
||||
|
|
@ -266,13 +258,9 @@ snapshots:
|
|||
|
||||
minimist@1.2.8: {}
|
||||
|
||||
node-domexception@1.0.0: {}
|
||||
|
||||
node-fetch@3.3.2:
|
||||
node-fetch@2.7.0:
|
||||
dependencies:
|
||||
data-uri-to-buffer: 4.0.1
|
||||
fetch-blob: 3.2.0
|
||||
formdata-polyfill: 4.0.10
|
||||
whatwg-url: 5.0.0
|
||||
|
||||
object-filter@1.0.2: {}
|
||||
|
||||
|
|
@ -297,10 +285,17 @@ snapshots:
|
|||
dependencies:
|
||||
has-flag: 4.0.0
|
||||
|
||||
tr46@0.0.3: {}
|
||||
|
||||
typescript@4.9.5: {}
|
||||
|
||||
undici-types@5.26.5: {}
|
||||
|
||||
web-streams-polyfill@3.3.3: {}
|
||||
webidl-conversions@3.0.1: {}
|
||||
|
||||
whatwg-url@5.0.0:
|
||||
dependencies:
|
||||
tr46: 0.0.3
|
||||
webidl-conversions: 3.0.1
|
||||
|
||||
zod@3.23.8: {}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import node_fetch from "node-fetch"
|
||||
import node_fetch from "cross-fetch"
|
||||
import type { tipoResposta } from "p-respostas"
|
||||
import { respostaComuns } from "p-respostas"
|
||||
import { z } from "zod"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import node_fetch from "node-fetch"
|
||||
import node_fetch from "cross-fetch"
|
||||
import type { tipoResposta } from "p-respostas"
|
||||
import { respostaComuns } from "p-respostas"
|
||||
import { z } from "zod"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import node_fetch from "node-fetch"
|
||||
import node_fetch from "cross-fetch"
|
||||
import type { tipoResposta } from "p-respostas"
|
||||
import { respostaComuns } from "p-respostas"
|
||||
import { z } from "zod"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import node_fetch from "node-fetch"
|
||||
import node_fetch from "cross-fetch"
|
||||
import { respostaComuns, type tipoResposta } from "p-respostas"
|
||||
import { z } from "zod"
|
||||
import {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue