@taquito/http-utils 23.0.2 → 23.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -29,22 +29,25 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
29
29
|
var _a;
|
|
30
30
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
31
|
exports.HttpBackend = exports.HttpTimeoutError = exports.HttpResponseError = exports.HttpRequestFailed = exports.VERSION = void 0;
|
|
32
|
+
const https_1 = require("https");
|
|
33
|
+
const http_1 = require("http");
|
|
32
34
|
let fetch = globalThis === null || globalThis === void 0 ? void 0 : globalThis.fetch;
|
|
33
|
-
let createAgent
|
|
35
|
+
let createAgent;
|
|
34
36
|
// Will only use browser fetch if we are in a browser environment,
|
|
35
37
|
// default to the more stable node-fetch otherwise
|
|
36
38
|
const isNode = typeof process !== 'undefined' && !!((_a = process === null || process === void 0 ? void 0 : process.versions) === null || _a === void 0 ? void 0 : _a.node);
|
|
37
39
|
if (isNode) {
|
|
38
|
-
|
|
40
|
+
// Handle both ESM and CJS default export patterns for webpack compatibility
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
42
|
+
const nodeFetch = require('node-fetch');
|
|
43
|
+
fetch = nodeFetch.default || nodeFetch;
|
|
39
44
|
if (Number(process.versions.node.split('.')[0]) >= 19) {
|
|
40
45
|
// we need agent with keepalive false for node 19 and above
|
|
41
|
-
createAgent = (url) =>
|
|
42
|
-
const { Agent: HttpsAgent } = yield Promise.resolve().then(() => require('https'));
|
|
43
|
-
const { Agent: HttpAgent } = yield Promise.resolve().then(() => require('http'));
|
|
46
|
+
createAgent = (url) => {
|
|
44
47
|
return url.startsWith('https')
|
|
45
|
-
? new
|
|
46
|
-
: new
|
|
47
|
-
}
|
|
48
|
+
? new https_1.Agent({ keepAlive: false })
|
|
49
|
+
: new http_1.Agent({ keepAlive: false });
|
|
50
|
+
};
|
|
48
51
|
}
|
|
49
52
|
}
|
|
50
53
|
const errors_1 = require("./errors");
|
|
@@ -112,7 +115,7 @@ class HttpBackend {
|
|
|
112
115
|
try {
|
|
113
116
|
const response = yield fetch(urlWithQuery, Object.assign({ keepalive: false, // Disable keepalive (keepalive defaults to true starting from Node 19 & 20)
|
|
114
117
|
method,
|
|
115
|
-
headers, body: JSON.stringify(data), signal: controller.signal }, (isNode && createAgent ? { agent:
|
|
118
|
+
headers, body: JSON.stringify(data), signal: controller.signal }, (isNode && createAgent ? { agent: createAgent(urlWithQuery) } : {})));
|
|
116
119
|
if (typeof response === 'undefined') {
|
|
117
120
|
throw new Error('Response is undefined');
|
|
118
121
|
}
|
package/dist/lib/version.js
CHANGED
|
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.VERSION = void 0;
|
|
4
4
|
// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN!
|
|
5
5
|
exports.VERSION = {
|
|
6
|
-
"commitHash": "
|
|
7
|
-
"version": "23.0
|
|
6
|
+
"commitHash": "c77fe4b0989665d8b5cfd15a7cc977499021f6fd",
|
|
7
|
+
"version": "23.1.0"
|
|
8
8
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Agent } from 'https';
|
|
2
|
+
import { Agent as Agent$1 } from 'http';
|
|
1
3
|
import { NetworkError } from '@taquito/core';
|
|
2
4
|
|
|
3
5
|
/******************************************************************************
|
|
@@ -397,8 +399,8 @@ var STATUS_CODE;
|
|
|
397
399
|
|
|
398
400
|
// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN!
|
|
399
401
|
const VERSION = {
|
|
400
|
-
"commitHash": "
|
|
401
|
-
"version": "23.0
|
|
402
|
+
"commitHash": "c77fe4b0989665d8b5cfd15a7cc977499021f6fd",
|
|
403
|
+
"version": "23.1.0"
|
|
402
404
|
};
|
|
403
405
|
|
|
404
406
|
/**
|
|
@@ -407,21 +409,22 @@ const VERSION = {
|
|
|
407
409
|
*/
|
|
408
410
|
var _a;
|
|
409
411
|
let fetch = globalThis === null || globalThis === void 0 ? void 0 : globalThis.fetch;
|
|
410
|
-
let createAgent
|
|
412
|
+
let createAgent;
|
|
411
413
|
// Will only use browser fetch if we are in a browser environment,
|
|
412
414
|
// default to the more stable node-fetch otherwise
|
|
413
415
|
const isNode = typeof process !== 'undefined' && !!((_a = process === null || process === void 0 ? void 0 : process.versions) === null || _a === void 0 ? void 0 : _a.node);
|
|
414
416
|
if (isNode) {
|
|
415
|
-
|
|
417
|
+
// Handle both ESM and CJS default export patterns for webpack compatibility
|
|
418
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
419
|
+
const nodeFetch = require('node-fetch');
|
|
420
|
+
fetch = nodeFetch.default || nodeFetch;
|
|
416
421
|
if (Number(process.versions.node.split('.')[0]) >= 19) {
|
|
417
422
|
// we need agent with keepalive false for node 19 and above
|
|
418
|
-
createAgent = (url) =>
|
|
419
|
-
const { Agent: HttpsAgent } = yield import('https');
|
|
420
|
-
const { Agent: HttpAgent } = yield import('http');
|
|
423
|
+
createAgent = (url) => {
|
|
421
424
|
return url.startsWith('https')
|
|
422
|
-
? new
|
|
423
|
-
: new
|
|
424
|
-
}
|
|
425
|
+
? new Agent({ keepAlive: false })
|
|
426
|
+
: new Agent$1({ keepAlive: false });
|
|
427
|
+
};
|
|
425
428
|
}
|
|
426
429
|
}
|
|
427
430
|
class HttpBackend {
|
|
@@ -481,7 +484,7 @@ class HttpBackend {
|
|
|
481
484
|
try {
|
|
482
485
|
const response = yield fetch(urlWithQuery, Object.assign({ keepalive: false, // Disable keepalive (keepalive defaults to true starting from Node 19 & 20)
|
|
483
486
|
method,
|
|
484
|
-
headers, body: JSON.stringify(data), signal: controller.signal }, (isNode && createAgent ? { agent:
|
|
487
|
+
headers, body: JSON.stringify(data), signal: controller.signal }, (isNode && createAgent ? { agent: createAgent(urlWithQuery) } : {})));
|
|
485
488
|
if (typeof response === 'undefined') {
|
|
486
489
|
throw new Error('Response is undefined');
|
|
487
490
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taquito-http-utils.es6.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"taquito-http-utils.es6.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@taquito/core')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', '@taquito/core'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.taquitoHttpUtils = {}, global.core));
|
|
5
|
-
})(this, (function (exports, core) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('https'), require('http'), require('@taquito/core')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'https', 'http', '@taquito/core'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.taquitoHttpUtils = {}, global.https, global.http, global.core));
|
|
5
|
+
})(this, (function (exports, https, http, core) { 'use strict';
|
|
6
6
|
|
|
7
7
|
/******************************************************************************
|
|
8
8
|
Copyright (c) Microsoft Corporation.
|
|
@@ -401,8 +401,8 @@
|
|
|
401
401
|
|
|
402
402
|
// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN!
|
|
403
403
|
const VERSION = {
|
|
404
|
-
"commitHash": "
|
|
405
|
-
"version": "23.0
|
|
404
|
+
"commitHash": "c77fe4b0989665d8b5cfd15a7cc977499021f6fd",
|
|
405
|
+
"version": "23.1.0"
|
|
406
406
|
};
|
|
407
407
|
|
|
408
408
|
/**
|
|
@@ -411,21 +411,22 @@
|
|
|
411
411
|
*/
|
|
412
412
|
var _a;
|
|
413
413
|
let fetch = globalThis === null || globalThis === void 0 ? void 0 : globalThis.fetch;
|
|
414
|
-
let createAgent
|
|
414
|
+
let createAgent;
|
|
415
415
|
// Will only use browser fetch if we are in a browser environment,
|
|
416
416
|
// default to the more stable node-fetch otherwise
|
|
417
417
|
const isNode = typeof process !== 'undefined' && !!((_a = process === null || process === void 0 ? void 0 : process.versions) === null || _a === void 0 ? void 0 : _a.node);
|
|
418
418
|
if (isNode) {
|
|
419
|
-
|
|
419
|
+
// Handle both ESM and CJS default export patterns for webpack compatibility
|
|
420
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
421
|
+
const nodeFetch = require('node-fetch');
|
|
422
|
+
fetch = nodeFetch.default || nodeFetch;
|
|
420
423
|
if (Number(process.versions.node.split('.')[0]) >= 19) {
|
|
421
424
|
// we need agent with keepalive false for node 19 and above
|
|
422
|
-
createAgent = (url) =>
|
|
423
|
-
const { Agent: HttpsAgent } = yield import('https');
|
|
424
|
-
const { Agent: HttpAgent } = yield import('http');
|
|
425
|
+
createAgent = (url) => {
|
|
425
426
|
return url.startsWith('https')
|
|
426
|
-
? new
|
|
427
|
-
: new
|
|
428
|
-
}
|
|
427
|
+
? new https.Agent({ keepAlive: false })
|
|
428
|
+
: new http.Agent({ keepAlive: false });
|
|
429
|
+
};
|
|
429
430
|
}
|
|
430
431
|
}
|
|
431
432
|
class HttpBackend {
|
|
@@ -485,7 +486,7 @@
|
|
|
485
486
|
try {
|
|
486
487
|
const response = yield fetch(urlWithQuery, Object.assign({ keepalive: false, // Disable keepalive (keepalive defaults to true starting from Node 19 & 20)
|
|
487
488
|
method,
|
|
488
|
-
headers, body: JSON.stringify(data), signal: controller.signal }, (isNode && createAgent ? { agent:
|
|
489
|
+
headers, body: JSON.stringify(data), signal: controller.signal }, (isNode && createAgent ? { agent: createAgent(urlWithQuery) } : {})));
|
|
489
490
|
if (typeof response === 'undefined') {
|
|
490
491
|
throw new Error('Response is undefined');
|
|
491
492
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taquito-http-utils.umd.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"taquito-http-utils.umd.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taquito/http-utils",
|
|
3
|
-
"version": "23.0
|
|
3
|
+
"version": "23.1.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tezos"
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
],
|
|
15
15
|
"browser": {
|
|
16
16
|
"http": false,
|
|
17
|
-
"https": false
|
|
17
|
+
"https": false,
|
|
18
|
+
"node-fetch": false
|
|
18
19
|
},
|
|
19
20
|
"author": "Simon Boissonneault-Robert <simon@ecadlabs.com>",
|
|
20
21
|
"repository": {
|
|
@@ -26,7 +27,7 @@
|
|
|
26
27
|
},
|
|
27
28
|
"license": "Apache-2.0",
|
|
28
29
|
"engines": {
|
|
29
|
-
"node": ">=
|
|
30
|
+
"node": ">=20"
|
|
30
31
|
},
|
|
31
32
|
"scripts": {
|
|
32
33
|
"lint": "eslint --ext .js,.ts .",
|
|
@@ -62,13 +63,13 @@
|
|
|
62
63
|
]
|
|
63
64
|
},
|
|
64
65
|
"dependencies": {
|
|
65
|
-
"@taquito/core": "^23.0
|
|
66
|
+
"@taquito/core": "^23.1.0",
|
|
66
67
|
"node-fetch": "^2.7.0"
|
|
67
68
|
},
|
|
68
69
|
"devDependencies": {
|
|
69
70
|
"@types/bluebird": "^3.5.42",
|
|
70
71
|
"@types/jest": "^29.5.12",
|
|
71
|
-
"@types/node": "^
|
|
72
|
+
"@types/node": "^20",
|
|
72
73
|
"@types/node-fetch": "^2.6.11",
|
|
73
74
|
"@types/superagent": "^8.1.8",
|
|
74
75
|
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
@@ -87,6 +88,7 @@
|
|
|
87
88
|
"rimraf": "^6.0.1",
|
|
88
89
|
"rollup": "^4.22.4",
|
|
89
90
|
"rollup-plugin-json": "^4.0.0",
|
|
91
|
+
"rollup-plugin-polyfill-node": "^0.13.0",
|
|
90
92
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
91
93
|
"shelljs": "^0.8.5",
|
|
92
94
|
"ts-jest": "^29.2.3",
|
|
@@ -94,5 +96,5 @@
|
|
|
94
96
|
"ts-toolbelt": "^9.6.0",
|
|
95
97
|
"typescript": "~5.5.4"
|
|
96
98
|
},
|
|
97
|
-
"gitHead": "
|
|
99
|
+
"gitHead": "bcf60513cade1e3272cd50c47a786d4bd45f70c8"
|
|
98
100
|
}
|