@otonoma/paranet-client 2.16.1 → 2.17.0-rc.2
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.
- package/dist/cjs/client.d.ts.map +1 -1
- package/dist/cjs/{index-Dz-_ygkd.cjs → index-eBiJ1Egw.cjs} +194 -70
- package/dist/cjs/index-eBiJ1Egw.cjs.map +1 -0
- package/dist/cjs/index.cjs +28 -4
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/pncp.d.ts +3 -0
- package/dist/cjs/pncp.d.ts.map +1 -1
- package/dist/cjs/proto/pncp.d.ts +18 -0
- package/dist/cjs/proto/pncp.d.ts.map +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +1 -0
- package/dist/esm/client.d.ts.map +1 -1
- package/dist/esm/{index-CO5PSAqf.mjs → index-PztyZob7.mjs} +194 -70
- package/dist/esm/index-PztyZob7.mjs.map +1 -0
- package/dist/esm/index.mjs +28 -4
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/pncp.d.ts +3 -0
- package/dist/esm/pncp.d.ts.map +1 -1
- package/dist/esm/proto/pncp.d.ts +18 -0
- package/dist/esm/proto/pncp.d.ts.map +1 -1
- package/dist/index.d.cts +21 -0
- package/dist/index.d.mts +21 -0
- package/dist/pncp.d.ts +3 -0
- package/dist/pncp.d.ts.map +1 -1
- package/dist/pncp.js +2 -0
- package/dist/proto/pncp.d.ts +18 -0
- package/dist/proto/pncp.d.ts.map +1 -1
- package/dist/proto/pncp.js +24 -3
- package/package.json +1 -1
- package/dist/cjs/index-Dz-_ygkd.cjs.map +0 -1
- package/dist/esm/index-CO5PSAqf.mjs.map +0 -1
package/dist/cjs/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,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M,WAAW,gBAAgB;IAE/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,UAAU,GAAG,OAAO,GAAG,KAAK,CAAC;CACpC;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAUF,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE;QACR,MAAM,EAAE,MAAM,CAAC;QACf,iBAAiB,EAAE,MAAM,CAAC;QAC1B,iBAAiB,EAAE,MAAM,CAAC;QAC1B,YAAY,EAAE,MAAM,CAAC;QACrB,gBAAgB,EAAE,MAAM,CAAC;QACzB,gBAAgB,EAAE,MAAM,CAAC;KAC1B,CAAA;CACF"}
|
|
@@ -203,7 +203,7 @@ let ResponseStatusCodeError$1 = class ResponseStatusCodeError extends UndiciErro
|
|
|
203
203
|
};
|
|
204
204
|
|
|
205
205
|
const kInvalidArgumentError = Symbol.for('undici.error.UND_ERR_INVALID_ARG');
|
|
206
|
-
let InvalidArgumentError$
|
|
206
|
+
let InvalidArgumentError$p = class InvalidArgumentError extends UndiciError$2 {
|
|
207
207
|
constructor (message) {
|
|
208
208
|
super(message);
|
|
209
209
|
this.name = 'InvalidArgumentError';
|
|
@@ -510,7 +510,7 @@ var errors$1 = {
|
|
|
510
510
|
RequestContentLengthMismatchError: RequestContentLengthMismatchError$2,
|
|
511
511
|
ConnectTimeoutError: ConnectTimeoutError$1,
|
|
512
512
|
ResponseStatusCodeError: ResponseStatusCodeError$1,
|
|
513
|
-
InvalidArgumentError: InvalidArgumentError$
|
|
513
|
+
InvalidArgumentError: InvalidArgumentError$p,
|
|
514
514
|
InvalidReturnValueError: InvalidReturnValueError$2,
|
|
515
515
|
RequestAbortedError: RequestAbortedError$8,
|
|
516
516
|
ClientDestroyedError: ClientDestroyedError$2,
|
|
@@ -803,7 +803,7 @@ const { Blob: Blob$1 } = require$$0$3;
|
|
|
803
803
|
const nodeUtil = require$$0$4;
|
|
804
804
|
const { stringify } = require$$7;
|
|
805
805
|
const { EventEmitter: EE$1 } = require$$8;
|
|
806
|
-
const { InvalidArgumentError: InvalidArgumentError$
|
|
806
|
+
const { InvalidArgumentError: InvalidArgumentError$o } = errors$1;
|
|
807
807
|
const { headerNameLowerCasedRecord: headerNameLowerCasedRecord$1 } = constants$5;
|
|
808
808
|
const { tree } = tree_1;
|
|
809
809
|
|
|
@@ -930,39 +930,39 @@ function parseURL (url) {
|
|
|
930
930
|
url = new URL(url);
|
|
931
931
|
|
|
932
932
|
if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {
|
|
933
|
-
throw new InvalidArgumentError$
|
|
933
|
+
throw new InvalidArgumentError$o('Invalid URL protocol: the URL must start with `http:` or `https:`.')
|
|
934
934
|
}
|
|
935
935
|
|
|
936
936
|
return url
|
|
937
937
|
}
|
|
938
938
|
|
|
939
939
|
if (!url || typeof url !== 'object') {
|
|
940
|
-
throw new InvalidArgumentError$
|
|
940
|
+
throw new InvalidArgumentError$o('Invalid URL: The URL argument must be a non-null object.')
|
|
941
941
|
}
|
|
942
942
|
|
|
943
943
|
if (!(url instanceof URL)) {
|
|
944
944
|
if (url.port != null && url.port !== '' && isValidPort(url.port) === false) {
|
|
945
|
-
throw new InvalidArgumentError$
|
|
945
|
+
throw new InvalidArgumentError$o('Invalid URL: port must be a valid integer or a string representation of an integer.')
|
|
946
946
|
}
|
|
947
947
|
|
|
948
948
|
if (url.path != null && typeof url.path !== 'string') {
|
|
949
|
-
throw new InvalidArgumentError$
|
|
949
|
+
throw new InvalidArgumentError$o('Invalid URL path: the path must be a string or null/undefined.')
|
|
950
950
|
}
|
|
951
951
|
|
|
952
952
|
if (url.pathname != null && typeof url.pathname !== 'string') {
|
|
953
|
-
throw new InvalidArgumentError$
|
|
953
|
+
throw new InvalidArgumentError$o('Invalid URL pathname: the pathname must be a string or null/undefined.')
|
|
954
954
|
}
|
|
955
955
|
|
|
956
956
|
if (url.hostname != null && typeof url.hostname !== 'string') {
|
|
957
|
-
throw new InvalidArgumentError$
|
|
957
|
+
throw new InvalidArgumentError$o('Invalid URL hostname: the hostname must be a string or null/undefined.')
|
|
958
958
|
}
|
|
959
959
|
|
|
960
960
|
if (url.origin != null && typeof url.origin !== 'string') {
|
|
961
|
-
throw new InvalidArgumentError$
|
|
961
|
+
throw new InvalidArgumentError$o('Invalid URL origin: the origin must be a string or null/undefined.')
|
|
962
962
|
}
|
|
963
963
|
|
|
964
964
|
if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {
|
|
965
|
-
throw new InvalidArgumentError$
|
|
965
|
+
throw new InvalidArgumentError$o('Invalid URL protocol: the URL must start with `http:` or `https:`.')
|
|
966
966
|
}
|
|
967
967
|
|
|
968
968
|
const port = url.port != null
|
|
@@ -990,7 +990,7 @@ function parseURL (url) {
|
|
|
990
990
|
}
|
|
991
991
|
|
|
992
992
|
if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {
|
|
993
|
-
throw new InvalidArgumentError$
|
|
993
|
+
throw new InvalidArgumentError$o('Invalid URL protocol: the URL must start with `http:` or `https:`.')
|
|
994
994
|
}
|
|
995
995
|
|
|
996
996
|
return url
|
|
@@ -1000,7 +1000,7 @@ function parseOrigin$1 (url) {
|
|
|
1000
1000
|
url = parseURL(url);
|
|
1001
1001
|
|
|
1002
1002
|
if (url.pathname !== '/' || url.search || url.hash) {
|
|
1003
|
-
throw new InvalidArgumentError$
|
|
1003
|
+
throw new InvalidArgumentError$o('invalid url')
|
|
1004
1004
|
}
|
|
1005
1005
|
|
|
1006
1006
|
return url
|
|
@@ -1196,36 +1196,36 @@ function isBuffer$1 (buffer) {
|
|
|
1196
1196
|
|
|
1197
1197
|
function validateHandler$1 (handler, method, upgrade) {
|
|
1198
1198
|
if (!handler || typeof handler !== 'object') {
|
|
1199
|
-
throw new InvalidArgumentError$
|
|
1199
|
+
throw new InvalidArgumentError$o('handler must be an object')
|
|
1200
1200
|
}
|
|
1201
1201
|
|
|
1202
1202
|
if (typeof handler.onConnect !== 'function') {
|
|
1203
|
-
throw new InvalidArgumentError$
|
|
1203
|
+
throw new InvalidArgumentError$o('invalid onConnect method')
|
|
1204
1204
|
}
|
|
1205
1205
|
|
|
1206
1206
|
if (typeof handler.onError !== 'function') {
|
|
1207
|
-
throw new InvalidArgumentError$
|
|
1207
|
+
throw new InvalidArgumentError$o('invalid onError method')
|
|
1208
1208
|
}
|
|
1209
1209
|
|
|
1210
1210
|
if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) {
|
|
1211
|
-
throw new InvalidArgumentError$
|
|
1211
|
+
throw new InvalidArgumentError$o('invalid onBodySent method')
|
|
1212
1212
|
}
|
|
1213
1213
|
|
|
1214
1214
|
if (upgrade || method === 'CONNECT') {
|
|
1215
1215
|
if (typeof handler.onUpgrade !== 'function') {
|
|
1216
|
-
throw new InvalidArgumentError$
|
|
1216
|
+
throw new InvalidArgumentError$o('invalid onUpgrade method')
|
|
1217
1217
|
}
|
|
1218
1218
|
} else {
|
|
1219
1219
|
if (typeof handler.onHeaders !== 'function') {
|
|
1220
|
-
throw new InvalidArgumentError$
|
|
1220
|
+
throw new InvalidArgumentError$o('invalid onHeaders method')
|
|
1221
1221
|
}
|
|
1222
1222
|
|
|
1223
1223
|
if (typeof handler.onData !== 'function') {
|
|
1224
|
-
throw new InvalidArgumentError$
|
|
1224
|
+
throw new InvalidArgumentError$o('invalid onData method')
|
|
1225
1225
|
}
|
|
1226
1226
|
|
|
1227
1227
|
if (typeof handler.onComplete !== 'function') {
|
|
1228
|
-
throw new InvalidArgumentError$
|
|
1228
|
+
throw new InvalidArgumentError$o('invalid onComplete method')
|
|
1229
1229
|
}
|
|
1230
1230
|
}
|
|
1231
1231
|
}
|
|
@@ -1715,7 +1715,7 @@ var diagnostics = {
|
|
|
1715
1715
|
};
|
|
1716
1716
|
|
|
1717
1717
|
const {
|
|
1718
|
-
InvalidArgumentError: InvalidArgumentError$
|
|
1718
|
+
InvalidArgumentError: InvalidArgumentError$n,
|
|
1719
1719
|
NotSupportedError: NotSupportedError$1
|
|
1720
1720
|
} = errors$1;
|
|
1721
1721
|
const assert$d = require$$0;
|
|
@@ -1759,45 +1759,45 @@ let Request$2 = class Request {
|
|
|
1759
1759
|
servername
|
|
1760
1760
|
}, handler) {
|
|
1761
1761
|
if (typeof path !== 'string') {
|
|
1762
|
-
throw new InvalidArgumentError$
|
|
1762
|
+
throw new InvalidArgumentError$n('path must be a string')
|
|
1763
1763
|
} else if (
|
|
1764
1764
|
path[0] !== '/' &&
|
|
1765
1765
|
!(path.startsWith('http://') || path.startsWith('https://')) &&
|
|
1766
1766
|
method !== 'CONNECT'
|
|
1767
1767
|
) {
|
|
1768
|
-
throw new InvalidArgumentError$
|
|
1768
|
+
throw new InvalidArgumentError$n('path must be an absolute URL or start with a slash')
|
|
1769
1769
|
} else if (invalidPathRegex.test(path)) {
|
|
1770
|
-
throw new InvalidArgumentError$
|
|
1770
|
+
throw new InvalidArgumentError$n('invalid request path')
|
|
1771
1771
|
}
|
|
1772
1772
|
|
|
1773
1773
|
if (typeof method !== 'string') {
|
|
1774
|
-
throw new InvalidArgumentError$
|
|
1774
|
+
throw new InvalidArgumentError$n('method must be a string')
|
|
1775
1775
|
} else if (normalizedMethodRecords[method] === undefined && !isValidHTTPToken(method)) {
|
|
1776
|
-
throw new InvalidArgumentError$
|
|
1776
|
+
throw new InvalidArgumentError$n('invalid request method')
|
|
1777
1777
|
}
|
|
1778
1778
|
|
|
1779
1779
|
if (upgrade && typeof upgrade !== 'string') {
|
|
1780
|
-
throw new InvalidArgumentError$
|
|
1780
|
+
throw new InvalidArgumentError$n('upgrade must be a string')
|
|
1781
1781
|
}
|
|
1782
1782
|
|
|
1783
1783
|
if (upgrade && !isValidHeaderValue(upgrade)) {
|
|
1784
|
-
throw new InvalidArgumentError$
|
|
1784
|
+
throw new InvalidArgumentError$n('invalid upgrade header')
|
|
1785
1785
|
}
|
|
1786
1786
|
|
|
1787
1787
|
if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) {
|
|
1788
|
-
throw new InvalidArgumentError$
|
|
1788
|
+
throw new InvalidArgumentError$n('invalid headersTimeout')
|
|
1789
1789
|
}
|
|
1790
1790
|
|
|
1791
1791
|
if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) {
|
|
1792
|
-
throw new InvalidArgumentError$
|
|
1792
|
+
throw new InvalidArgumentError$n('invalid bodyTimeout')
|
|
1793
1793
|
}
|
|
1794
1794
|
|
|
1795
1795
|
if (reset != null && typeof reset !== 'boolean') {
|
|
1796
|
-
throw new InvalidArgumentError$
|
|
1796
|
+
throw new InvalidArgumentError$n('invalid reset')
|
|
1797
1797
|
}
|
|
1798
1798
|
|
|
1799
1799
|
if (expectContinue != null && typeof expectContinue !== 'boolean') {
|
|
1800
|
-
throw new InvalidArgumentError$
|
|
1800
|
+
throw new InvalidArgumentError$n('invalid expectContinue')
|
|
1801
1801
|
}
|
|
1802
1802
|
|
|
1803
1803
|
this.headersTimeout = headersTimeout;
|
|
@@ -1842,7 +1842,7 @@ let Request$2 = class Request {
|
|
|
1842
1842
|
} else if (isFormDataLike(body) || isIterable(body) || isBlobLike(body)) {
|
|
1843
1843
|
this.body = body;
|
|
1844
1844
|
} else {
|
|
1845
|
-
throw new InvalidArgumentError$
|
|
1845
|
+
throw new InvalidArgumentError$n('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable')
|
|
1846
1846
|
}
|
|
1847
1847
|
|
|
1848
1848
|
this.completed = false;
|
|
@@ -1876,7 +1876,7 @@ let Request$2 = class Request {
|
|
|
1876
1876
|
|
|
1877
1877
|
if (Array.isArray(headers)) {
|
|
1878
1878
|
if (headers.length % 2 !== 0) {
|
|
1879
|
-
throw new InvalidArgumentError$
|
|
1879
|
+
throw new InvalidArgumentError$n('headers array must be even')
|
|
1880
1880
|
}
|
|
1881
1881
|
for (let i = 0; i < headers.length; i += 2) {
|
|
1882
1882
|
processHeader(this, headers[i], headers[i + 1]);
|
|
@@ -1885,7 +1885,7 @@ let Request$2 = class Request {
|
|
|
1885
1885
|
if (headers[Symbol.iterator]) {
|
|
1886
1886
|
for (const header of headers) {
|
|
1887
1887
|
if (!Array.isArray(header) || header.length !== 2) {
|
|
1888
|
-
throw new InvalidArgumentError$
|
|
1888
|
+
throw new InvalidArgumentError$n('headers must be in key-value pair format')
|
|
1889
1889
|
}
|
|
1890
1890
|
processHeader(this, header[0], header[1]);
|
|
1891
1891
|
}
|
|
@@ -1896,7 +1896,7 @@ let Request$2 = class Request {
|
|
|
1896
1896
|
}
|
|
1897
1897
|
}
|
|
1898
1898
|
} else if (headers != null) {
|
|
1899
|
-
throw new InvalidArgumentError$
|
|
1899
|
+
throw new InvalidArgumentError$n('headers must be an object or an array')
|
|
1900
1900
|
}
|
|
1901
1901
|
|
|
1902
1902
|
validateHandler(handler, method, upgrade);
|
|
@@ -2037,7 +2037,7 @@ let Request$2 = class Request {
|
|
|
2037
2037
|
|
|
2038
2038
|
function processHeader (request, key, val) {
|
|
2039
2039
|
if (val && (typeof val === 'object' && !Array.isArray(val))) {
|
|
2040
|
-
throw new InvalidArgumentError$
|
|
2040
|
+
throw new InvalidArgumentError$n(`invalid ${key} header`)
|
|
2041
2041
|
} else if (val === undefined) {
|
|
2042
2042
|
return
|
|
2043
2043
|
}
|
|
@@ -2047,7 +2047,7 @@ function processHeader (request, key, val) {
|
|
|
2047
2047
|
if (headerName === undefined) {
|
|
2048
2048
|
headerName = key.toLowerCase();
|
|
2049
2049
|
if (headerNameLowerCasedRecord[headerName] === undefined && !isValidHTTPToken(headerName)) {
|
|
2050
|
-
throw new InvalidArgumentError$
|
|
2050
|
+
throw new InvalidArgumentError$n('invalid header key')
|
|
2051
2051
|
}
|
|
2052
2052
|
}
|
|
2053
2053
|
|
|
@@ -2056,54 +2056,65 @@ function processHeader (request, key, val) {
|
|
|
2056
2056
|
for (let i = 0; i < val.length; i++) {
|
|
2057
2057
|
if (typeof val[i] === 'string') {
|
|
2058
2058
|
if (!isValidHeaderValue(val[i])) {
|
|
2059
|
-
throw new InvalidArgumentError$
|
|
2059
|
+
throw new InvalidArgumentError$n(`invalid ${key} header`)
|
|
2060
2060
|
}
|
|
2061
2061
|
arr.push(val[i]);
|
|
2062
2062
|
} else if (val[i] === null) {
|
|
2063
2063
|
arr.push('');
|
|
2064
2064
|
} else if (typeof val[i] === 'object') {
|
|
2065
|
-
throw new InvalidArgumentError$
|
|
2065
|
+
throw new InvalidArgumentError$n(`invalid ${key} header`)
|
|
2066
2066
|
} else {
|
|
2067
|
-
|
|
2067
|
+
// Coerce primitives (and reject unsafe coercions such as functions
|
|
2068
|
+
// with a crafted toString/Symbol.toPrimitive).
|
|
2069
|
+
const str = `${val[i]}`;
|
|
2070
|
+
if (!isValidHeaderValue(str)) {
|
|
2071
|
+
throw new InvalidArgumentError$n(`invalid ${key} header`)
|
|
2072
|
+
}
|
|
2073
|
+
arr.push(str);
|
|
2068
2074
|
}
|
|
2069
2075
|
}
|
|
2070
2076
|
val = arr;
|
|
2071
2077
|
} else if (typeof val === 'string') {
|
|
2072
2078
|
if (!isValidHeaderValue(val)) {
|
|
2073
|
-
throw new InvalidArgumentError$
|
|
2079
|
+
throw new InvalidArgumentError$n(`invalid ${key} header`)
|
|
2074
2080
|
}
|
|
2075
2081
|
} else if (val === null) {
|
|
2076
2082
|
val = '';
|
|
2077
2083
|
} else {
|
|
2084
|
+
// Coerce primitives (and reject unsafe coercions such as functions
|
|
2085
|
+
// with a crafted toString/Symbol.toPrimitive).
|
|
2078
2086
|
val = `${val}`;
|
|
2087
|
+
if (!isValidHeaderValue(val)) {
|
|
2088
|
+
throw new InvalidArgumentError$n(`invalid ${key} header`)
|
|
2089
|
+
}
|
|
2079
2090
|
}
|
|
2080
2091
|
|
|
2081
2092
|
if (headerName === 'host') {
|
|
2082
2093
|
if (request.host !== null) {
|
|
2083
|
-
throw new InvalidArgumentError$
|
|
2094
|
+
throw new InvalidArgumentError$n('duplicate host header')
|
|
2084
2095
|
}
|
|
2085
2096
|
if (typeof val !== 'string') {
|
|
2086
|
-
throw new InvalidArgumentError$
|
|
2097
|
+
throw new InvalidArgumentError$n('invalid host header')
|
|
2087
2098
|
}
|
|
2088
2099
|
// Consumed by Client
|
|
2089
2100
|
request.host = val;
|
|
2090
2101
|
} else if (headerName === 'content-length') {
|
|
2091
2102
|
if (request.contentLength !== null) {
|
|
2092
|
-
throw new InvalidArgumentError$
|
|
2103
|
+
throw new InvalidArgumentError$n('duplicate content-length header')
|
|
2093
2104
|
}
|
|
2094
2105
|
request.contentLength = parseInt(val, 10);
|
|
2095
2106
|
if (!Number.isFinite(request.contentLength)) {
|
|
2096
|
-
throw new InvalidArgumentError$
|
|
2107
|
+
throw new InvalidArgumentError$n('invalid content-length header')
|
|
2097
2108
|
}
|
|
2098
2109
|
} else if (request.contentType === null && headerName === 'content-type') {
|
|
2099
2110
|
request.contentType = val;
|
|
2100
2111
|
request.headers.push(key, val);
|
|
2101
2112
|
} else if (headerName === 'transfer-encoding' || headerName === 'keep-alive' || headerName === 'upgrade') {
|
|
2102
|
-
throw new InvalidArgumentError$
|
|
2113
|
+
throw new InvalidArgumentError$n(`invalid ${headerName} header`)
|
|
2103
2114
|
} else if (headerName === 'connection') {
|
|
2104
2115
|
const value = typeof val === 'string' ? val.toLowerCase() : null;
|
|
2105
2116
|
if (value !== 'close' && value !== 'keep-alive') {
|
|
2106
|
-
throw new InvalidArgumentError$
|
|
2117
|
+
throw new InvalidArgumentError$n('invalid connection header')
|
|
2107
2118
|
}
|
|
2108
2119
|
|
|
2109
2120
|
if (value === 'close') {
|
|
@@ -2187,7 +2198,7 @@ const Dispatcher$3 = dispatcher;
|
|
|
2187
2198
|
const {
|
|
2188
2199
|
ClientDestroyedError: ClientDestroyedError$1,
|
|
2189
2200
|
ClientClosedError,
|
|
2190
|
-
InvalidArgumentError: InvalidArgumentError$
|
|
2201
|
+
InvalidArgumentError: InvalidArgumentError$m
|
|
2191
2202
|
} = errors$1;
|
|
2192
2203
|
const { kDestroy: kDestroy$5, kClose: kClose$7, kClosed: kClosed$1, kDestroyed: kDestroyed$1, kDispatch: kDispatch$5, kInterceptors: kInterceptors$5 } = symbols$4;
|
|
2193
2204
|
|
|
@@ -2231,7 +2242,7 @@ let DispatcherBase$5 = class DispatcherBase extends Dispatcher$3 {
|
|
|
2231
2242
|
for (let i = newInterceptors.length - 1; i >= 0; i--) {
|
|
2232
2243
|
const interceptor = this[kInterceptors$5][i];
|
|
2233
2244
|
if (typeof interceptor !== 'function') {
|
|
2234
|
-
throw new InvalidArgumentError$
|
|
2245
|
+
throw new InvalidArgumentError$m('interceptor must be an function')
|
|
2235
2246
|
}
|
|
2236
2247
|
}
|
|
2237
2248
|
}
|
|
@@ -2249,7 +2260,7 @@ let DispatcherBase$5 = class DispatcherBase extends Dispatcher$3 {
|
|
|
2249
2260
|
}
|
|
2250
2261
|
|
|
2251
2262
|
if (typeof callback !== 'function') {
|
|
2252
|
-
throw new InvalidArgumentError$
|
|
2263
|
+
throw new InvalidArgumentError$m('invalid callback')
|
|
2253
2264
|
}
|
|
2254
2265
|
|
|
2255
2266
|
if (this[kDestroyed$1]) {
|
|
@@ -2300,7 +2311,7 @@ let DispatcherBase$5 = class DispatcherBase extends Dispatcher$3 {
|
|
|
2300
2311
|
}
|
|
2301
2312
|
|
|
2302
2313
|
if (typeof callback !== 'function') {
|
|
2303
|
-
throw new InvalidArgumentError$
|
|
2314
|
+
throw new InvalidArgumentError$m('invalid callback')
|
|
2304
2315
|
}
|
|
2305
2316
|
|
|
2306
2317
|
if (this[kDestroyed$1]) {
|
|
@@ -2350,12 +2361,12 @@ let DispatcherBase$5 = class DispatcherBase extends Dispatcher$3 {
|
|
|
2350
2361
|
|
|
2351
2362
|
dispatch (opts, handler) {
|
|
2352
2363
|
if (!handler || typeof handler !== 'object') {
|
|
2353
|
-
throw new InvalidArgumentError$
|
|
2364
|
+
throw new InvalidArgumentError$m('handler must be an object')
|
|
2354
2365
|
}
|
|
2355
2366
|
|
|
2356
2367
|
try {
|
|
2357
2368
|
if (!opts || typeof opts !== 'object') {
|
|
2358
|
-
throw new InvalidArgumentError$
|
|
2369
|
+
throw new InvalidArgumentError$m('opts must be an object.')
|
|
2359
2370
|
}
|
|
2360
2371
|
|
|
2361
2372
|
if (this[kDestroyed$1] || this[kOnDestroyed]) {
|
|
@@ -2369,7 +2380,7 @@ let DispatcherBase$5 = class DispatcherBase extends Dispatcher$3 {
|
|
|
2369
2380
|
return this[kInterceptedDispatch](opts, handler)
|
|
2370
2381
|
} catch (err) {
|
|
2371
2382
|
if (typeof handler.onError !== 'function') {
|
|
2372
|
-
throw new InvalidArgumentError$
|
|
2383
|
+
throw new InvalidArgumentError$m('invalid onError method')
|
|
2373
2384
|
}
|
|
2374
2385
|
|
|
2375
2386
|
handler.onError(err);
|
|
@@ -2806,7 +2817,7 @@ var timers$2 = {
|
|
|
2806
2817
|
const net$1 = require$$0$2;
|
|
2807
2818
|
const assert$c = require$$0;
|
|
2808
2819
|
const util$l = util$n;
|
|
2809
|
-
const { InvalidArgumentError: InvalidArgumentError$
|
|
2820
|
+
const { InvalidArgumentError: InvalidArgumentError$l, ConnectTimeoutError } = errors$1;
|
|
2810
2821
|
const timers$1 = timers$2;
|
|
2811
2822
|
|
|
2812
2823
|
function noop$3 () {}
|
|
@@ -2881,7 +2892,7 @@ if (commonjsGlobal.FinalizationRegistry && !(process.env.NODE_V8_COVERAGE || pro
|
|
|
2881
2892
|
|
|
2882
2893
|
function buildConnector$4 ({ allowH2, maxCachedSessions, socketPath, timeout, session: customSession, ...opts }) {
|
|
2883
2894
|
if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {
|
|
2884
|
-
throw new InvalidArgumentError$
|
|
2895
|
+
throw new InvalidArgumentError$l('maxCachedSessions must be a positive integer or zero')
|
|
2885
2896
|
}
|
|
2886
2897
|
|
|
2887
2898
|
const options = { path: socketPath, ...opts };
|
|
@@ -8072,6 +8083,7 @@ const {
|
|
|
8072
8083
|
RequestContentLengthMismatchError: RequestContentLengthMismatchError$1,
|
|
8073
8084
|
ResponseContentLengthMismatchError,
|
|
8074
8085
|
RequestAbortedError: RequestAbortedError$7,
|
|
8086
|
+
InvalidArgumentError: InvalidArgumentError$k,
|
|
8075
8087
|
HeadersTimeoutError,
|
|
8076
8088
|
HeadersOverflowError,
|
|
8077
8089
|
SocketError: SocketError$3,
|
|
@@ -9055,8 +9067,16 @@ function writeH1 (client, request) {
|
|
|
9055
9067
|
}
|
|
9056
9068
|
body = bodyStream.stream;
|
|
9057
9069
|
contentLength = bodyStream.length;
|
|
9058
|
-
} else if (util$j.isBlobLike(body) && request.contentType == null
|
|
9059
|
-
|
|
9070
|
+
} else if (util$j.isBlobLike(body) && request.contentType == null) {
|
|
9071
|
+
const contentType = body.type;
|
|
9072
|
+
if (contentType) {
|
|
9073
|
+
const contentTypeValue = `${contentType}`;
|
|
9074
|
+
if (!util$j.isValidHeaderValue(contentTypeValue)) {
|
|
9075
|
+
util$j.errorRequest(client, request, new InvalidArgumentError$k('invalid content-type header'));
|
|
9076
|
+
return false
|
|
9077
|
+
}
|
|
9078
|
+
headers.push('content-type', contentTypeValue);
|
|
9079
|
+
}
|
|
9060
9080
|
}
|
|
9061
9081
|
|
|
9062
9082
|
if (body && typeof body.read === 'function') {
|
|
@@ -12376,6 +12396,28 @@ function calculateRetryAfterHeader (retryAfter) {
|
|
|
12376
12396
|
return new Date(retryAfter).getTime() - current
|
|
12377
12397
|
}
|
|
12378
12398
|
|
|
12399
|
+
function validatePartialResponseContentLength (headers, range, statusCode, retryCount) {
|
|
12400
|
+
const contentLength = headers['content-length'];
|
|
12401
|
+
if (contentLength == null) {
|
|
12402
|
+
return null
|
|
12403
|
+
}
|
|
12404
|
+
|
|
12405
|
+
if (!Number.isFinite(range.start) || !Number.isFinite(range.end)) {
|
|
12406
|
+
return null
|
|
12407
|
+
}
|
|
12408
|
+
|
|
12409
|
+
const length = Number(contentLength);
|
|
12410
|
+
const expectedLength = range.end - range.start + 1;
|
|
12411
|
+
if (!Number.isFinite(length) || length !== expectedLength) {
|
|
12412
|
+
return new RequestRetryError('Content-Length mismatch', statusCode, {
|
|
12413
|
+
headers,
|
|
12414
|
+
data: { count: retryCount }
|
|
12415
|
+
})
|
|
12416
|
+
}
|
|
12417
|
+
|
|
12418
|
+
return null
|
|
12419
|
+
}
|
|
12420
|
+
|
|
12379
12421
|
let RetryHandler$3 = class RetryHandler {
|
|
12380
12422
|
constructor (opts, handlers) {
|
|
12381
12423
|
const { retryOptions, ...dispatchOpts } = opts;
|
|
@@ -12590,6 +12632,12 @@ let RetryHandler$3 = class RetryHandler {
|
|
|
12590
12632
|
return false
|
|
12591
12633
|
}
|
|
12592
12634
|
|
|
12635
|
+
const contentLengthError = validatePartialResponseContentLength(headers, contentRange, statusCode, this.retryCount);
|
|
12636
|
+
if (contentLengthError != null) {
|
|
12637
|
+
this.abort(contentLengthError);
|
|
12638
|
+
return false
|
|
12639
|
+
}
|
|
12640
|
+
|
|
12593
12641
|
const { start, size, end = size - 1 } = contentRange;
|
|
12594
12642
|
|
|
12595
12643
|
assert$7(this.start === start, 'content-range mismatch');
|
|
@@ -12613,6 +12661,12 @@ let RetryHandler$3 = class RetryHandler {
|
|
|
12613
12661
|
)
|
|
12614
12662
|
}
|
|
12615
12663
|
|
|
12664
|
+
const contentLengthError = validatePartialResponseContentLength(headers, range, statusCode, this.retryCount);
|
|
12665
|
+
if (contentLengthError != null) {
|
|
12666
|
+
this.abort(contentLengthError);
|
|
12667
|
+
return false
|
|
12668
|
+
}
|
|
12669
|
+
|
|
12616
12670
|
const { start, size, end = size - 1 } = range;
|
|
12617
12671
|
assert$7(
|
|
12618
12672
|
start != null && Number.isFinite(start),
|
|
@@ -22763,7 +22817,7 @@ function requireUtil$2 () {
|
|
|
22763
22817
|
|
|
22764
22818
|
if (
|
|
22765
22819
|
code < 0x20 || // exclude CTLs (0-31)
|
|
22766
|
-
code
|
|
22820
|
+
code > 0x7E || // exclude DEL and non-ascii
|
|
22767
22821
|
code === 0x3B // ;
|
|
22768
22822
|
) {
|
|
22769
22823
|
throw new Error('Invalid cookie path')
|
|
@@ -22772,16 +22826,80 @@ function requireUtil$2 () {
|
|
|
22772
22826
|
}
|
|
22773
22827
|
|
|
22774
22828
|
/**
|
|
22775
|
-
*
|
|
22776
|
-
*
|
|
22829
|
+
* <let-dig> ::= <letter> | <digit>
|
|
22830
|
+
*
|
|
22831
|
+
* <letter> ::= any one of the 52 alphabetic characters A through Z in
|
|
22832
|
+
* upper case and a through z in lower case
|
|
22833
|
+
*
|
|
22834
|
+
* <digit> ::= any one of the ten digits 0 through 9r
|
|
22835
|
+
*
|
|
22836
|
+
* @see https://www.rfc-editor.org/rfc/rfc1034#section-3.5
|
|
22837
|
+
* @param {number} code
|
|
22838
|
+
*/
|
|
22839
|
+
function isLetterOrDigit (code) {
|
|
22840
|
+
return (
|
|
22841
|
+
(code >= 0x30 && code <= 0x39) || // 0-9
|
|
22842
|
+
(code >= 0x41 && code <= 0x5A) || // A-Z
|
|
22843
|
+
(code >= 0x61 && code <= 0x7A) // a-z
|
|
22844
|
+
)
|
|
22845
|
+
}
|
|
22846
|
+
|
|
22847
|
+
/**
|
|
22848
|
+
* Validates a cookie domain against the "preferred name syntax".
|
|
22849
|
+
*
|
|
22850
|
+
* <domain> ::= <subdomain> | " "
|
|
22851
|
+
* <subdomain> ::= <label> | <subdomain> "." <label>
|
|
22852
|
+
* <label> ::= <let-dig> [ [ <ldh-str> ] <let-dig> ]
|
|
22853
|
+
* <ldh-str> ::= <let-dig-hyp> | <let-dig-hyp> <ldh-str>
|
|
22854
|
+
* <let-dig-hyp> ::= <let-dig> | "-"
|
|
22855
|
+
*
|
|
22856
|
+
* @see https://www.rfc-editor.org/rfc/rfc1034#section-3.5
|
|
22857
|
+
* @see https://www.rfc-editor.org/rfc/rfc1123#section-2.1
|
|
22858
|
+
* @see https://www.rfc-editor.org/rfc/rfc1035#section-2.3.4
|
|
22777
22859
|
* @param {string} domain
|
|
22778
22860
|
*/
|
|
22779
22861
|
function validateCookieDomain (domain) {
|
|
22780
|
-
|
|
22781
|
-
|
|
22782
|
-
|
|
22783
|
-
|
|
22784
|
-
|
|
22862
|
+
// <domain> ::= <subdomain> | " "
|
|
22863
|
+
if (domain === ' ') {
|
|
22864
|
+
return
|
|
22865
|
+
}
|
|
22866
|
+
|
|
22867
|
+
if (domain.length > 255) {
|
|
22868
|
+
throw new Error('Invalid cookie domain')
|
|
22869
|
+
}
|
|
22870
|
+
|
|
22871
|
+
let labelLength = 0;
|
|
22872
|
+
|
|
22873
|
+
for (let i = 0; i < domain.length; ++i) {
|
|
22874
|
+
const code = domain.charCodeAt(i);
|
|
22875
|
+
|
|
22876
|
+
if (code === 0x2E) {
|
|
22877
|
+
if (labelLength === 0) {
|
|
22878
|
+
throw new Error('Invalid cookie domain')
|
|
22879
|
+
}
|
|
22880
|
+
|
|
22881
|
+
if (domain.charCodeAt(i - 1) === 0x2D) { // "-"
|
|
22882
|
+
throw new Error('Invalid cookie domain')
|
|
22883
|
+
}
|
|
22884
|
+
|
|
22885
|
+
labelLength = 0;
|
|
22886
|
+
continue
|
|
22887
|
+
}
|
|
22888
|
+
|
|
22889
|
+
if (labelLength === 0 && !isLetterOrDigit(code)) {
|
|
22890
|
+
throw new Error('Invalid cookie domain')
|
|
22891
|
+
}
|
|
22892
|
+
|
|
22893
|
+
if (!isLetterOrDigit(code) && code !== 0x2D) { // "-"
|
|
22894
|
+
throw new Error('Invalid cookie domain')
|
|
22895
|
+
}
|
|
22896
|
+
|
|
22897
|
+
if (++labelLength > 63) {
|
|
22898
|
+
throw new Error('Invalid cookie domain')
|
|
22899
|
+
}
|
|
22900
|
+
}
|
|
22901
|
+
|
|
22902
|
+
if (labelLength === 0 || domain.charCodeAt(domain.length - 1) === 0x2D) { // "-"
|
|
22785
22903
|
throw new Error('Invalid cookie domain')
|
|
22786
22904
|
}
|
|
22787
22905
|
}
|
|
@@ -22924,7 +23042,13 @@ function requireUtil$2 () {
|
|
|
22924
23042
|
|
|
22925
23043
|
const [key, ...value] = part.split('=');
|
|
22926
23044
|
|
|
22927
|
-
|
|
23045
|
+
const trimmedKey = key.trim();
|
|
23046
|
+
const joinedValue = value.join('=');
|
|
23047
|
+
|
|
23048
|
+
validateCookieName(trimmedKey);
|
|
23049
|
+
validateCookieValue(joinedValue);
|
|
23050
|
+
|
|
23051
|
+
out.push(`${trimmedKey}=${joinedValue}`);
|
|
22928
23052
|
}
|
|
22929
23053
|
|
|
22930
23054
|
return out.join('; ')
|
|
@@ -27197,4 +27321,4 @@ var index = /*#__PURE__*/_mergeNamespaces({
|
|
|
27197
27321
|
}, [undici]);
|
|
27198
27322
|
|
|
27199
27323
|
exports.index = index;
|
|
27200
|
-
//# sourceMappingURL=index-
|
|
27324
|
+
//# sourceMappingURL=index-eBiJ1Egw.cjs.map
|