@slicemachine/adapter-nuxt 0.3.38-beta.1 → 0.3.38-beta.3

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.
Files changed (104) hide show
  1. package/dist/plugin.cjs +1 -3
  2. package/dist/plugin.cjs.map +1 -1
  3. package/dist/plugin.js +1 -3
  4. package/dist/plugin.js.map +1 -1
  5. package/package.json +2 -3
  6. package/src/plugin.ts +0 -7
  7. package/dist/_node_modules/data-uri-to-buffer/dist/index.cjs +0 -41
  8. package/dist/_node_modules/data-uri-to-buffer/dist/index.cjs.map +0 -1
  9. package/dist/_node_modules/data-uri-to-buffer/dist/index.js +0 -41
  10. package/dist/_node_modules/data-uri-to-buffer/dist/index.js.map +0 -1
  11. package/dist/_node_modules/fetch-blob/file.cjs +0 -61
  12. package/dist/_node_modules/fetch-blob/file.cjs.map +0 -1
  13. package/dist/_node_modules/fetch-blob/file.js +0 -61
  14. package/dist/_node_modules/fetch-blob/file.js.map +0 -1
  15. package/dist/_node_modules/fetch-blob/index.cjs +0 -223
  16. package/dist/_node_modules/fetch-blob/index.cjs.map +0 -1
  17. package/dist/_node_modules/fetch-blob/index.js +0 -223
  18. package/dist/_node_modules/fetch-blob/index.js.map +0 -1
  19. package/dist/_node_modules/fetch-blob/streams.cjs +0 -43
  20. package/dist/_node_modules/fetch-blob/streams.cjs.map +0 -1
  21. package/dist/_node_modules/fetch-blob/streams.js +0 -42
  22. package/dist/_node_modules/fetch-blob/streams.js.map +0 -1
  23. package/dist/_node_modules/formdata-polyfill/esm.min.cjs +0 -116
  24. package/dist/_node_modules/formdata-polyfill/esm.min.cjs.map +0 -1
  25. package/dist/_node_modules/formdata-polyfill/esm.min.js +0 -116
  26. package/dist/_node_modules/formdata-polyfill/esm.min.js.map +0 -1
  27. package/dist/_node_modules/node-domexception/index.cjs +0 -11
  28. package/dist/_node_modules/node-domexception/index.cjs.map +0 -1
  29. package/dist/_node_modules/node-domexception/index.js +0 -10
  30. package/dist/_node_modules/node-domexception/index.js.map +0 -1
  31. package/dist/_node_modules/node-fetch/src/body.cjs +0 -262
  32. package/dist/_node_modules/node-fetch/src/body.cjs.map +0 -1
  33. package/dist/_node_modules/node-fetch/src/body.js +0 -262
  34. package/dist/_node_modules/node-fetch/src/body.js.map +0 -1
  35. package/dist/_node_modules/node-fetch/src/errors/abort-error.cjs +0 -10
  36. package/dist/_node_modules/node-fetch/src/errors/abort-error.cjs.map +0 -1
  37. package/dist/_node_modules/node-fetch/src/errors/abort-error.js +0 -10
  38. package/dist/_node_modules/node-fetch/src/errors/abort-error.js.map +0 -1
  39. package/dist/_node_modules/node-fetch/src/errors/base.cjs +0 -17
  40. package/dist/_node_modules/node-fetch/src/errors/base.cjs.map +0 -1
  41. package/dist/_node_modules/node-fetch/src/errors/base.js +0 -17
  42. package/dist/_node_modules/node-fetch/src/errors/base.js.map +0 -1
  43. package/dist/_node_modules/node-fetch/src/errors/fetch-error.cjs +0 -19
  44. package/dist/_node_modules/node-fetch/src/errors/fetch-error.cjs.map +0 -1
  45. package/dist/_node_modules/node-fetch/src/errors/fetch-error.js +0 -19
  46. package/dist/_node_modules/node-fetch/src/errors/fetch-error.js.map +0 -1
  47. package/dist/_node_modules/node-fetch/src/headers.cjs +0 -190
  48. package/dist/_node_modules/node-fetch/src/headers.cjs.map +0 -1
  49. package/dist/_node_modules/node-fetch/src/headers.js +0 -190
  50. package/dist/_node_modules/node-fetch/src/headers.js.map +0 -1
  51. package/dist/_node_modules/node-fetch/src/index.cjs +0 -292
  52. package/dist/_node_modules/node-fetch/src/index.cjs.map +0 -1
  53. package/dist/_node_modules/node-fetch/src/index.js +0 -292
  54. package/dist/_node_modules/node-fetch/src/index.js.map +0 -1
  55. package/dist/_node_modules/node-fetch/src/request.cjs +0 -206
  56. package/dist/_node_modules/node-fetch/src/request.cjs.map +0 -1
  57. package/dist/_node_modules/node-fetch/src/request.js +0 -206
  58. package/dist/_node_modules/node-fetch/src/request.js.map +0 -1
  59. package/dist/_node_modules/node-fetch/src/response.cjs +0 -122
  60. package/dist/_node_modules/node-fetch/src/response.cjs.map +0 -1
  61. package/dist/_node_modules/node-fetch/src/response.js +0 -123
  62. package/dist/_node_modules/node-fetch/src/response.js.map +0 -1
  63. package/dist/_node_modules/node-fetch/src/utils/get-search.cjs +0 -12
  64. package/dist/_node_modules/node-fetch/src/utils/get-search.cjs.map +0 -1
  65. package/dist/_node_modules/node-fetch/src/utils/get-search.js +0 -12
  66. package/dist/_node_modules/node-fetch/src/utils/get-search.js.map +0 -1
  67. package/dist/_node_modules/node-fetch/src/utils/is-redirect.cjs +0 -8
  68. package/dist/_node_modules/node-fetch/src/utils/is-redirect.cjs.map +0 -1
  69. package/dist/_node_modules/node-fetch/src/utils/is-redirect.js +0 -8
  70. package/dist/_node_modules/node-fetch/src/utils/is-redirect.js.map +0 -1
  71. package/dist/_node_modules/node-fetch/src/utils/is.cjs +0 -28
  72. package/dist/_node_modules/node-fetch/src/utils/is.cjs.map +0 -1
  73. package/dist/_node_modules/node-fetch/src/utils/is.js +0 -28
  74. package/dist/_node_modules/node-fetch/src/utils/is.js.map +0 -1
  75. package/dist/_node_modules/node-fetch/src/utils/multipart-parser.cjs +0 -356
  76. package/dist/_node_modules/node-fetch/src/utils/multipart-parser.cjs.map +0 -1
  77. package/dist/_node_modules/node-fetch/src/utils/multipart-parser.js +0 -356
  78. package/dist/_node_modules/node-fetch/src/utils/multipart-parser.js.map +0 -1
  79. package/dist/_node_modules/node-fetch/src/utils/referrer.cjs +0 -149
  80. package/dist/_node_modules/node-fetch/src/utils/referrer.cjs.map +0 -1
  81. package/dist/_node_modules/node-fetch/src/utils/referrer.js +0 -149
  82. package/dist/_node_modules/node-fetch/src/utils/referrer.js.map +0 -1
  83. package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.cjs +0 -3822
  84. package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.cjs.map +0 -1
  85. package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.js +0 -3822
  86. package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.js.map +0 -1
  87. package/dist/_virtual/_commonjsHelpers.cjs +0 -5
  88. package/dist/_virtual/_commonjsHelpers.cjs.map +0 -1
  89. package/dist/_virtual/_commonjsHelpers.js +0 -5
  90. package/dist/_virtual/_commonjsHelpers.js.map +0 -1
  91. package/dist/_virtual/ponyfill.es2018.cjs +0 -5
  92. package/dist/_virtual/ponyfill.es2018.cjs.map +0 -1
  93. package/dist/_virtual/ponyfill.es2018.js +0 -5
  94. package/dist/_virtual/ponyfill.es2018.js.map +0 -1
  95. package/dist/hooks/sliceSimulator-setup-read.cjs +0 -150
  96. package/dist/hooks/sliceSimulator-setup-read.cjs.map +0 -1
  97. package/dist/hooks/sliceSimulator-setup-read.d.ts +0 -3
  98. package/dist/hooks/sliceSimulator-setup-read.js +0 -150
  99. package/dist/hooks/sliceSimulator-setup-read.js.map +0 -1
  100. package/src/hooks/sliceSimulator-setup-read.ts +0 -209
  101. /package/dist/{packages/adapter-nuxt/package.json.cjs → package.json.cjs} +0 -0
  102. /package/dist/{packages/adapter-nuxt/package.json.cjs.map → package.json.cjs.map} +0 -0
  103. /package/dist/{packages/adapter-nuxt/package.json.js → package.json.js} +0 -0
  104. /package/dist/{packages/adapter-nuxt/package.json.js.map → package.json.js.map} +0 -0
@@ -1,190 +0,0 @@
1
- import { types } from "node:util";
2
- import http from "node:http";
3
- const validateHeaderName = typeof http.validateHeaderName === "function" ? http.validateHeaderName : (name) => {
4
- if (!/^[\^`\-\w!#$%&'*+.|~]+$/.test(name)) {
5
- const error = new TypeError(`Header name must be a valid HTTP token [${name}]`);
6
- Object.defineProperty(error, "code", { value: "ERR_INVALID_HTTP_TOKEN" });
7
- throw error;
8
- }
9
- };
10
- const validateHeaderValue = typeof http.validateHeaderValue === "function" ? http.validateHeaderValue : (name, value) => {
11
- if (/[^\t\u0020-\u007E\u0080-\u00FF]/.test(value)) {
12
- const error = new TypeError(`Invalid character in header content ["${name}"]`);
13
- Object.defineProperty(error, "code", { value: "ERR_INVALID_CHAR" });
14
- throw error;
15
- }
16
- };
17
- class Headers extends URLSearchParams {
18
- /**
19
- * Headers class
20
- *
21
- * @constructor
22
- * @param {HeadersInit} [init] - Response headers
23
- */
24
- constructor(init) {
25
- let result = [];
26
- if (init instanceof Headers) {
27
- const raw = init.raw();
28
- for (const [name, values] of Object.entries(raw)) {
29
- result.push(...values.map((value) => [name, value]));
30
- }
31
- } else if (init == null)
32
- ;
33
- else if (typeof init === "object" && !types.isBoxedPrimitive(init)) {
34
- const method = init[Symbol.iterator];
35
- if (method == null) {
36
- result.push(...Object.entries(init));
37
- } else {
38
- if (typeof method !== "function") {
39
- throw new TypeError("Header pairs must be iterable");
40
- }
41
- result = [...init].map((pair) => {
42
- if (typeof pair !== "object" || types.isBoxedPrimitive(pair)) {
43
- throw new TypeError("Each header pair must be an iterable object");
44
- }
45
- return [...pair];
46
- }).map((pair) => {
47
- if (pair.length !== 2) {
48
- throw new TypeError("Each header pair must be a name/value tuple");
49
- }
50
- return [...pair];
51
- });
52
- }
53
- } else {
54
- throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)");
55
- }
56
- result = result.length > 0 ? result.map(([name, value]) => {
57
- validateHeaderName(name);
58
- validateHeaderValue(name, String(value));
59
- return [String(name).toLowerCase(), String(value)];
60
- }) : void 0;
61
- super(result);
62
- return new Proxy(this, {
63
- get(target, p, receiver) {
64
- switch (p) {
65
- case "append":
66
- case "set":
67
- return (name, value) => {
68
- validateHeaderName(name);
69
- validateHeaderValue(name, String(value));
70
- return URLSearchParams.prototype[p].call(
71
- target,
72
- String(name).toLowerCase(),
73
- String(value)
74
- );
75
- };
76
- case "delete":
77
- case "has":
78
- case "getAll":
79
- return (name) => {
80
- validateHeaderName(name);
81
- return URLSearchParams.prototype[p].call(
82
- target,
83
- String(name).toLowerCase()
84
- );
85
- };
86
- case "keys":
87
- return () => {
88
- target.sort();
89
- return new Set(URLSearchParams.prototype.keys.call(target)).keys();
90
- };
91
- default:
92
- return Reflect.get(target, p, receiver);
93
- }
94
- }
95
- });
96
- }
97
- get [Symbol.toStringTag]() {
98
- return this.constructor.name;
99
- }
100
- toString() {
101
- return Object.prototype.toString.call(this);
102
- }
103
- get(name) {
104
- const values = this.getAll(name);
105
- if (values.length === 0) {
106
- return null;
107
- }
108
- let value = values.join(", ");
109
- if (/^content-encoding$/i.test(name)) {
110
- value = value.toLowerCase();
111
- }
112
- return value;
113
- }
114
- forEach(callback, thisArg = void 0) {
115
- for (const name of this.keys()) {
116
- Reflect.apply(callback, thisArg, [this.get(name), name, this]);
117
- }
118
- }
119
- *values() {
120
- for (const name of this.keys()) {
121
- yield this.get(name);
122
- }
123
- }
124
- /**
125
- * @type {() => IterableIterator<[string, string]>}
126
- */
127
- *entries() {
128
- for (const name of this.keys()) {
129
- yield [name, this.get(name)];
130
- }
131
- }
132
- [Symbol.iterator]() {
133
- return this.entries();
134
- }
135
- /**
136
- * Node-fetch non-spec method
137
- * returning all headers and their values as array
138
- * @returns {Record<string, string[]>}
139
- */
140
- raw() {
141
- return [...this.keys()].reduce((result, key) => {
142
- result[key] = this.getAll(key);
143
- return result;
144
- }, {});
145
- }
146
- /**
147
- * For better console.log(headers) and also to convert Headers into Node.js Request compatible format
148
- */
149
- [Symbol.for("nodejs.util.inspect.custom")]() {
150
- return [...this.keys()].reduce((result, key) => {
151
- const values = this.getAll(key);
152
- if (key === "host") {
153
- result[key] = values[0];
154
- } else {
155
- result[key] = values.length > 1 ? values : values[0];
156
- }
157
- return result;
158
- }, {});
159
- }
160
- }
161
- Object.defineProperties(
162
- Headers.prototype,
163
- ["get", "entries", "forEach", "values"].reduce((result, property) => {
164
- result[property] = { enumerable: true };
165
- return result;
166
- }, {})
167
- );
168
- function fromRawHeaders(headers = []) {
169
- return new Headers(
170
- headers.reduce((result, value, index, array) => {
171
- if (index % 2 === 0) {
172
- result.push(array.slice(index, index + 2));
173
- }
174
- return result;
175
- }, []).filter(([name, value]) => {
176
- try {
177
- validateHeaderName(name);
178
- validateHeaderValue(name, String(value));
179
- return true;
180
- } catch {
181
- return false;
182
- }
183
- })
184
- );
185
- }
186
- export {
187
- Headers as default,
188
- fromRawHeaders
189
- };
190
- //# sourceMappingURL=headers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"headers.js","sources":["../../../../../../node_modules/node-fetch/src/headers.js"],"sourcesContent":["/**\n * Headers.js\n *\n * Headers class offers convenient helpers\n */\n\nimport {types} from 'node:util';\nimport http from 'node:http';\n\n/* c8 ignore next 9 */\nconst validateHeaderName = typeof http.validateHeaderName === 'function' ?\n\thttp.validateHeaderName :\n\tname => {\n\t\tif (!/^[\\^`\\-\\w!#$%&'*+.|~]+$/.test(name)) {\n\t\t\tconst error = new TypeError(`Header name must be a valid HTTP token [${name}]`);\n\t\t\tObject.defineProperty(error, 'code', {value: 'ERR_INVALID_HTTP_TOKEN'});\n\t\t\tthrow error;\n\t\t}\n\t};\n\n/* c8 ignore next 9 */\nconst validateHeaderValue = typeof http.validateHeaderValue === 'function' ?\n\thttp.validateHeaderValue :\n\t(name, value) => {\n\t\tif (/[^\\t\\u0020-\\u007E\\u0080-\\u00FF]/.test(value)) {\n\t\t\tconst error = new TypeError(`Invalid character in header content [\"${name}\"]`);\n\t\t\tObject.defineProperty(error, 'code', {value: 'ERR_INVALID_CHAR'});\n\t\t\tthrow error;\n\t\t}\n\t};\n\n/**\n * @typedef {Headers | Record<string, string> | Iterable<readonly [string, string]> | Iterable<Iterable<string>>} HeadersInit\n */\n\n/**\n * This Fetch API interface allows you to perform various actions on HTTP request and response headers.\n * These actions include retrieving, setting, adding to, and removing.\n * A Headers object has an associated header list, which is initially empty and consists of zero or more name and value pairs.\n * You can add to this using methods like append() (see Examples.)\n * In all methods of this interface, header names are matched by case-insensitive byte sequence.\n *\n */\nexport default class Headers extends URLSearchParams {\n\t/**\n\t * Headers class\n\t *\n\t * @constructor\n\t * @param {HeadersInit} [init] - Response headers\n\t */\n\tconstructor(init) {\n\t\t// Validate and normalize init object in [name, value(s)][]\n\t\t/** @type {string[][]} */\n\t\tlet result = [];\n\t\tif (init instanceof Headers) {\n\t\t\tconst raw = init.raw();\n\t\t\tfor (const [name, values] of Object.entries(raw)) {\n\t\t\t\tresult.push(...values.map(value => [name, value]));\n\t\t\t}\n\t\t} else if (init == null) { // eslint-disable-line no-eq-null, eqeqeq\n\t\t\t// No op\n\t\t} else if (typeof init === 'object' && !types.isBoxedPrimitive(init)) {\n\t\t\tconst method = init[Symbol.iterator];\n\t\t\t// eslint-disable-next-line no-eq-null, eqeqeq\n\t\t\tif (method == null) {\n\t\t\t\t// Record<ByteString, ByteString>\n\t\t\t\tresult.push(...Object.entries(init));\n\t\t\t} else {\n\t\t\t\tif (typeof method !== 'function') {\n\t\t\t\t\tthrow new TypeError('Header pairs must be iterable');\n\t\t\t\t}\n\n\t\t\t\t// Sequence<sequence<ByteString>>\n\t\t\t\t// Note: per spec we have to first exhaust the lists then process them\n\t\t\t\tresult = [...init]\n\t\t\t\t\t.map(pair => {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\ttypeof pair !== 'object' || types.isBoxedPrimitive(pair)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tthrow new TypeError('Each header pair must be an iterable object');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn [...pair];\n\t\t\t\t\t}).map(pair => {\n\t\t\t\t\t\tif (pair.length !== 2) {\n\t\t\t\t\t\t\tthrow new TypeError('Each header pair must be a name/value tuple');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn [...pair];\n\t\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new TypeError('Failed to construct \\'Headers\\': The provided value is not of type \\'(sequence<sequence<ByteString>> or record<ByteString, ByteString>)');\n\t\t}\n\n\t\t// Validate and lowercase\n\t\tresult =\n\t\t\tresult.length > 0 ?\n\t\t\t\tresult.map(([name, value]) => {\n\t\t\t\t\tvalidateHeaderName(name);\n\t\t\t\t\tvalidateHeaderValue(name, String(value));\n\t\t\t\t\treturn [String(name).toLowerCase(), String(value)];\n\t\t\t\t}) :\n\t\t\t\tundefined;\n\n\t\tsuper(result);\n\n\t\t// Returning a Proxy that will lowercase key names, validate parameters and sort keys\n\t\t// eslint-disable-next-line no-constructor-return\n\t\treturn new Proxy(this, {\n\t\t\tget(target, p, receiver) {\n\t\t\t\tswitch (p) {\n\t\t\t\t\tcase 'append':\n\t\t\t\t\tcase 'set':\n\t\t\t\t\t\treturn (name, value) => {\n\t\t\t\t\t\t\tvalidateHeaderName(name);\n\t\t\t\t\t\t\tvalidateHeaderValue(name, String(value));\n\t\t\t\t\t\t\treturn URLSearchParams.prototype[p].call(\n\t\t\t\t\t\t\t\ttarget,\n\t\t\t\t\t\t\t\tString(name).toLowerCase(),\n\t\t\t\t\t\t\t\tString(value)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t};\n\n\t\t\t\t\tcase 'delete':\n\t\t\t\t\tcase 'has':\n\t\t\t\t\tcase 'getAll':\n\t\t\t\t\t\treturn name => {\n\t\t\t\t\t\t\tvalidateHeaderName(name);\n\t\t\t\t\t\t\treturn URLSearchParams.prototype[p].call(\n\t\t\t\t\t\t\t\ttarget,\n\t\t\t\t\t\t\t\tString(name).toLowerCase()\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t};\n\n\t\t\t\t\tcase 'keys':\n\t\t\t\t\t\treturn () => {\n\t\t\t\t\t\t\ttarget.sort();\n\t\t\t\t\t\t\treturn new Set(URLSearchParams.prototype.keys.call(target)).keys();\n\t\t\t\t\t\t};\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn Reflect.get(target, p, receiver);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t/* c8 ignore next */\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn this.constructor.name;\n\t}\n\n\ttoString() {\n\t\treturn Object.prototype.toString.call(this);\n\t}\n\n\tget(name) {\n\t\tconst values = this.getAll(name);\n\t\tif (values.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tlet value = values.join(', ');\n\t\tif (/^content-encoding$/i.test(name)) {\n\t\t\tvalue = value.toLowerCase();\n\t\t}\n\n\t\treturn value;\n\t}\n\n\tforEach(callback, thisArg = undefined) {\n\t\tfor (const name of this.keys()) {\n\t\t\tReflect.apply(callback, thisArg, [this.get(name), name, this]);\n\t\t}\n\t}\n\n\t* values() {\n\t\tfor (const name of this.keys()) {\n\t\t\tyield this.get(name);\n\t\t}\n\t}\n\n\t/**\n\t * @type {() => IterableIterator<[string, string]>}\n\t */\n\t* entries() {\n\t\tfor (const name of this.keys()) {\n\t\t\tyield [name, this.get(name)];\n\t\t}\n\t}\n\n\t[Symbol.iterator]() {\n\t\treturn this.entries();\n\t}\n\n\t/**\n\t * Node-fetch non-spec method\n\t * returning all headers and their values as array\n\t * @returns {Record<string, string[]>}\n\t */\n\traw() {\n\t\treturn [...this.keys()].reduce((result, key) => {\n\t\t\tresult[key] = this.getAll(key);\n\t\t\treturn result;\n\t\t}, {});\n\t}\n\n\t/**\n\t * For better console.log(headers) and also to convert Headers into Node.js Request compatible format\n\t */\n\t[Symbol.for('nodejs.util.inspect.custom')]() {\n\t\treturn [...this.keys()].reduce((result, key) => {\n\t\t\tconst values = this.getAll(key);\n\t\t\t// Http.request() only supports string as Host header.\n\t\t\t// This hack makes specifying custom Host header possible.\n\t\t\tif (key === 'host') {\n\t\t\t\tresult[key] = values[0];\n\t\t\t} else {\n\t\t\t\tresult[key] = values.length > 1 ? values : values[0];\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}, {});\n\t}\n}\n\n/**\n * Re-shaping object for Web IDL tests\n * Only need to do it for overridden methods\n */\nObject.defineProperties(\n\tHeaders.prototype,\n\t['get', 'entries', 'forEach', 'values'].reduce((result, property) => {\n\t\tresult[property] = {enumerable: true};\n\t\treturn result;\n\t}, {})\n);\n\n/**\n * Create a Headers object from an http.IncomingMessage.rawHeaders, ignoring those that do\n * not conform to HTTP grammar productions.\n * @param {import('http').IncomingMessage['rawHeaders']} headers\n */\nexport function fromRawHeaders(headers = []) {\n\treturn new Headers(\n\t\theaders\n\t\t\t// Split into pairs\n\t\t\t.reduce((result, value, index, array) => {\n\t\t\t\tif (index % 2 === 0) {\n\t\t\t\t\tresult.push(array.slice(index, index + 2));\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t}, [])\n\t\t\t.filter(([name, value]) => {\n\t\t\t\ttry {\n\t\t\t\t\tvalidateHeaderName(name);\n\t\t\t\t\tvalidateHeaderValue(name, String(value));\n\t\t\t\t\treturn true;\n\t\t\t\t} catch {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t})\n\n\t);\n}\n"],"names":[],"mappings":";;AAUA,MAAM,qBAAqB,OAAO,KAAK,uBAAuB,aAC7D,KAAK,qBACL,UAAQ;AACP,MAAI,CAAC,0BAA0B,KAAK,IAAI,GAAG;AAC1C,UAAM,QAAQ,IAAI,UAAU,2CAA2C,OAAO;AAC9E,WAAO,eAAe,OAAO,QAAQ,EAAC,OAAO,yBAAwB,CAAC;AACtE,UAAM;AAAA,EACN;AACH;AAGA,MAAM,sBAAsB,OAAO,KAAK,wBAAwB,aAC/D,KAAK,sBACL,CAAC,MAAM,UAAU;AAChB,MAAI,kCAAkC,KAAK,KAAK,GAAG;AAClD,UAAM,QAAQ,IAAI,UAAU,yCAAyC,QAAQ;AAC7E,WAAO,eAAe,OAAO,QAAQ,EAAC,OAAO,mBAAkB,CAAC;AAChE,UAAM;AAAA,EACN;AACH;AAce,MAAM,gBAAgB,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOpD,YAAY,MAAM;AAGjB,QAAI,SAAS,CAAA;AACb,QAAI,gBAAgB,SAAS;AAC5B,YAAM,MAAM,KAAK;AACjB,iBAAW,CAAC,MAAM,MAAM,KAAK,OAAO,QAAQ,GAAG,GAAG;AACjD,e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A,IACP,GAAE,EAAE,EACJ,OAAO,CAAC,CAAC,MAAM,KAAK,MAAM;AAC1B,UAAI;AACH,2BAAmB,IAAI;AACvB,4BAAoB,MAAM,OAAO,KAAK,CAAC;AACvC,eAAO;AAAA,MACZ,QAAM;AACD,eAAO;AAAA,MACP;AAAA,IACL,CAAI;AAAA,EAEJ;AACA;","x_google_ignoreList":[0]}
@@ -1,292 +0,0 @@
1
- "use strict";
2
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const http = require("node:http");
4
- const https = require("node:https");
5
- const zlib = require("node:zlib");
6
- const Stream = require("node:stream");
7
- const node_buffer = require("node:buffer");
8
- const index$1 = require("../../data-uri-to-buffer/dist/index.cjs");
9
- const body = require("./body.cjs");
10
- const response = require("./response.cjs");
11
- const headers = require("./headers.cjs");
12
- const request = require("./request.cjs");
13
- const fetchError = require("./errors/fetch-error.cjs");
14
- const abortError = require("./errors/abort-error.cjs");
15
- const isRedirect = require("./utils/is-redirect.cjs");
16
- const index = require("../../fetch-blob/index.cjs");
17
- const is = require("./utils/is.cjs");
18
- const referrer = require("./utils/referrer.cjs");
19
- require("node:fs");
20
- require("node:path");
21
- require("../../node-domexception/index.cjs");
22
- const supportedSchemas = /* @__PURE__ */ new Set(["data:", "http:", "https:"]);
23
- async function fetch(url, options_) {
24
- return new Promise((resolve, reject) => {
25
- const request$1 = new request.default(url, options_);
26
- const { parsedURL, options } = request.getNodeRequestOptions(request$1);
27
- if (!supportedSchemas.has(parsedURL.protocol)) {
28
- throw new TypeError(`node-fetch cannot load ${url}. URL scheme "${parsedURL.protocol.replace(/:$/, "")}" is not supported.`);
29
- }
30
- if (parsedURL.protocol === "data:") {
31
- const data = index$1.dataUriToBuffer(request$1.url);
32
- const response$12 = new response(data, { headers: { "Content-Type": data.typeFull } });
33
- resolve(response$12);
34
- return;
35
- }
36
- const send = (parsedURL.protocol === "https:" ? https : http).request;
37
- const { signal } = request$1;
38
- let response$1 = null;
39
- const abort = () => {
40
- const error = new abortError.AbortError("The operation was aborted.");
41
- reject(error);
42
- if (request$1.body && request$1.body instanceof Stream.Readable) {
43
- request$1.body.destroy(error);
44
- }
45
- if (!response$1 || !response$1.body) {
46
- return;
47
- }
48
- response$1.body.emit("error", error);
49
- };
50
- if (signal && signal.aborted) {
51
- abort();
52
- return;
53
- }
54
- const abortAndFinalize = () => {
55
- abort();
56
- finalize();
57
- };
58
- const request_ = send(parsedURL.toString(), options);
59
- if (signal) {
60
- signal.addEventListener("abort", abortAndFinalize);
61
- }
62
- const finalize = () => {
63
- request_.abort();
64
- if (signal) {
65
- signal.removeEventListener("abort", abortAndFinalize);
66
- }
67
- };
68
- request_.on("error", (error) => {
69
- reject(new fetchError.FetchError(`request to ${request$1.url} failed, reason: ${error.message}`, "system", error));
70
- finalize();
71
- });
72
- fixResponseChunkedTransferBadEnding(request_, (error) => {
73
- if (response$1 && response$1.body) {
74
- response$1.body.destroy(error);
75
- }
76
- });
77
- if (process.version < "v14") {
78
- request_.on("socket", (s) => {
79
- let endedWithEventsCount;
80
- s.prependListener("end", () => {
81
- endedWithEventsCount = s._eventsCount;
82
- });
83
- s.prependListener("close", (hadError) => {
84
- if (response$1 && endedWithEventsCount < s._eventsCount && !hadError) {
85
- const error = new Error("Premature close");
86
- error.code = "ERR_STREAM_PREMATURE_CLOSE";
87
- response$1.body.emit("error", error);
88
- }
89
- });
90
- });
91
- }
92
- request_.on("response", (response_) => {
93
- request_.setTimeout(0);
94
- const headers$1 = headers.fromRawHeaders(response_.rawHeaders);
95
- if (isRedirect.isRedirect(response_.statusCode)) {
96
- const location = headers$1.get("Location");
97
- let locationURL = null;
98
- try {
99
- locationURL = location === null ? null : new URL(location, request$1.url);
100
- } catch {
101
- if (request$1.redirect !== "manual") {
102
- reject(new fetchError.FetchError(`uri requested responds with an invalid redirect URL: ${location}`, "invalid-redirect"));
103
- finalize();
104
- return;
105
- }
106
- }
107
- switch (request$1.redirect) {
108
- case "error":
109
- reject(new fetchError.FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request$1.url}`, "no-redirect"));
110
- finalize();
111
- return;
112
- case "manual":
113
- break;
114
- case "follow": {
115
- if (locationURL === null) {
116
- break;
117
- }
118
- if (request$1.counter >= request$1.follow) {
119
- reject(new fetchError.FetchError(`maximum redirect reached at: ${request$1.url}`, "max-redirect"));
120
- finalize();
121
- return;
122
- }
123
- const requestOptions = {
124
- headers: new headers.default(request$1.headers),
125
- follow: request$1.follow,
126
- counter: request$1.counter + 1,
127
- agent: request$1.agent,
128
- compress: request$1.compress,
129
- method: request$1.method,
130
- body: body.clone(request$1),
131
- signal: request$1.signal,
132
- size: request$1.size,
133
- referrer: request$1.referrer,
134
- referrerPolicy: request$1.referrerPolicy
135
- };
136
- if (!is.isDomainOrSubdomain(request$1.url, locationURL) || !is.isSameProtocol(request$1.url, locationURL)) {
137
- for (const name of ["authorization", "www-authenticate", "cookie", "cookie2"]) {
138
- requestOptions.headers.delete(name);
139
- }
140
- }
141
- if (response_.statusCode !== 303 && request$1.body && options_.body instanceof Stream.Readable) {
142
- reject(new fetchError.FetchError("Cannot follow redirect with body being a readable stream", "unsupported-redirect"));
143
- finalize();
144
- return;
145
- }
146
- if (response_.statusCode === 303 || (response_.statusCode === 301 || response_.statusCode === 302) && request$1.method === "POST") {
147
- requestOptions.method = "GET";
148
- requestOptions.body = void 0;
149
- requestOptions.headers.delete("content-length");
150
- }
151
- const responseReferrerPolicy = referrer.parseReferrerPolicyFromHeader(headers$1);
152
- if (responseReferrerPolicy) {
153
- requestOptions.referrerPolicy = responseReferrerPolicy;
154
- }
155
- resolve(fetch(new request.default(locationURL, requestOptions)));
156
- finalize();
157
- return;
158
- }
159
- default:
160
- return reject(new TypeError(`Redirect option '${request$1.redirect}' is not a valid value of RequestRedirect`));
161
- }
162
- }
163
- if (signal) {
164
- response_.once("end", () => {
165
- signal.removeEventListener("abort", abortAndFinalize);
166
- });
167
- }
168
- let body$1 = Stream.pipeline(response_, new Stream.PassThrough(), (error) => {
169
- if (error) {
170
- reject(error);
171
- }
172
- });
173
- if (process.version < "v12.10") {
174
- response_.on("aborted", abortAndFinalize);
175
- }
176
- const responseOptions = {
177
- url: request$1.url,
178
- status: response_.statusCode,
179
- statusText: response_.statusMessage,
180
- headers: headers$1,
181
- size: request$1.size,
182
- counter: request$1.counter,
183
- highWaterMark: request$1.highWaterMark
184
- };
185
- const codings = headers$1.get("Content-Encoding");
186
- if (!request$1.compress || request$1.method === "HEAD" || codings === null || response_.statusCode === 204 || response_.statusCode === 304) {
187
- response$1 = new response(body$1, responseOptions);
188
- resolve(response$1);
189
- return;
190
- }
191
- const zlibOptions = {
192
- flush: zlib.Z_SYNC_FLUSH,
193
- finishFlush: zlib.Z_SYNC_FLUSH
194
- };
195
- if (codings === "gzip" || codings === "x-gzip") {
196
- body$1 = Stream.pipeline(body$1, zlib.createGunzip(zlibOptions), (error) => {
197
- if (error) {
198
- reject(error);
199
- }
200
- });
201
- response$1 = new response(body$1, responseOptions);
202
- resolve(response$1);
203
- return;
204
- }
205
- if (codings === "deflate" || codings === "x-deflate") {
206
- const raw = Stream.pipeline(response_, new Stream.PassThrough(), (error) => {
207
- if (error) {
208
- reject(error);
209
- }
210
- });
211
- raw.once("data", (chunk) => {
212
- if ((chunk[0] & 15) === 8) {
213
- body$1 = Stream.pipeline(body$1, zlib.createInflate(), (error) => {
214
- if (error) {
215
- reject(error);
216
- }
217
- });
218
- } else {
219
- body$1 = Stream.pipeline(body$1, zlib.createInflateRaw(), (error) => {
220
- if (error) {
221
- reject(error);
222
- }
223
- });
224
- }
225
- response$1 = new response(body$1, responseOptions);
226
- resolve(response$1);
227
- });
228
- raw.once("end", () => {
229
- if (!response$1) {
230
- response$1 = new response(body$1, responseOptions);
231
- resolve(response$1);
232
- }
233
- });
234
- return;
235
- }
236
- if (codings === "br") {
237
- body$1 = Stream.pipeline(body$1, zlib.createBrotliDecompress(), (error) => {
238
- if (error) {
239
- reject(error);
240
- }
241
- });
242
- response$1 = new response(body$1, responseOptions);
243
- resolve(response$1);
244
- return;
245
- }
246
- response$1 = new response(body$1, responseOptions);
247
- resolve(response$1);
248
- });
249
- body.writeToStream(request_, request$1).catch(reject);
250
- });
251
- }
252
- function fixResponseChunkedTransferBadEnding(request2, errorCallback) {
253
- const LAST_CHUNK = node_buffer.Buffer.from("0\r\n\r\n");
254
- let isChunkedTransfer = false;
255
- let properLastChunkReceived = false;
256
- let previousChunk;
257
- request2.on("response", (response2) => {
258
- const { headers: headers2 } = response2;
259
- isChunkedTransfer = headers2["transfer-encoding"] === "chunked" && !headers2["content-length"];
260
- });
261
- request2.on("socket", (socket) => {
262
- const onSocketClose = () => {
263
- if (isChunkedTransfer && !properLastChunkReceived) {
264
- const error = new Error("Premature close");
265
- error.code = "ERR_STREAM_PREMATURE_CLOSE";
266
- errorCallback(error);
267
- }
268
- };
269
- const onData = (buf) => {
270
- properLastChunkReceived = node_buffer.Buffer.compare(buf.slice(-5), LAST_CHUNK) === 0;
271
- if (!properLastChunkReceived && previousChunk) {
272
- properLastChunkReceived = node_buffer.Buffer.compare(previousChunk.slice(-3), LAST_CHUNK.slice(0, 3)) === 0 && node_buffer.Buffer.compare(buf.slice(-2), LAST_CHUNK.slice(3)) === 0;
273
- }
274
- previousChunk = buf;
275
- };
276
- socket.prependListener("close", onSocketClose);
277
- socket.on("data", onData);
278
- request2.on("close", () => {
279
- socket.removeListener("close", onSocketClose);
280
- socket.removeListener("data", onData);
281
- });
282
- });
283
- }
284
- exports.Response = response;
285
- exports.Headers = headers.default;
286
- exports.Request = request.default;
287
- exports.FetchError = fetchError.FetchError;
288
- exports.AbortError = abortError.AbortError;
289
- exports.isRedirect = isRedirect.isRedirect;
290
- exports.Blob = index.default;
291
- exports.default = fetch;
292
- //# sourceMappingURL=index.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../../../../node_modules/node-fetch/src/index.js"],"sourcesContent":["/**\n * Index.js\n *\n * a request API compatible with window.fetch\n *\n * All spec algorithm step numbers are based on https://fetch.spec.whatwg.org/commit-snapshots/ae716822cb3a61843226cd090eefc6589446c1d2/.\n */\n\nimport http from 'node:http';\nimport https from 'node:https';\nimport zlib from 'node:zlib';\nimport Stream, {PassThrough, pipeline as pump} from 'node:stream';\nimport {Buffer} from 'node:buffer';\n\nimport dataUriToBuffer from 'data-uri-to-buffer';\n\nimport {writeToStream, clone} from './body.js';\nimport Response from './response.js';\nimport Headers, {fromRawHeaders} from './headers.js';\nimport Request, {getNodeRequestOptions} from './request.js';\nimport {FetchError} from './errors/fetch-error.js';\nimport {AbortError} from './errors/abort-error.js';\nimport {isRedirect} from './utils/is-redirect.js';\nimport {FormData} from 'formdata-polyfill/esm.min.js';\nimport {isDomainOrSubdomain, isSameProtocol} from './utils/is.js';\nimport {parseReferrerPolicyFromHeader} from './utils/referrer.js';\nimport {\n\tBlob,\n\tFile,\n\tfileFromSync,\n\tfileFrom,\n\tblobFromSync,\n\tblobFrom\n} from 'fetch-blob/from.js';\n\nexport {FormData, Headers, Request, Response, FetchError, AbortError, isRedirect};\nexport {Blob, File, fileFromSync, fileFrom, blobFromSync, blobFrom};\n\nconst supportedSchemas = new Set(['data:', 'http:', 'https:']);\n\n/**\n * Fetch function\n *\n * @param {string | URL | import('./request').default} url - Absolute url or Request instance\n * @param {*} [options_] - Fetch options\n * @return {Promise<import('./response').default>}\n */\nexport default async function fetch(url, options_) {\n\treturn new Promise((resolve, reject) => {\n\t\t// Build request object\n\t\tconst request = new Request(url, options_);\n\t\tconst {parsedURL, options} = getNodeRequestOptions(request);\n\t\tif (!supportedSchemas.has(parsedURL.protocol)) {\n\t\t\tthrow new TypeError(`node-fetch cannot load ${url}. URL scheme \"${parsedURL.protocol.replace(/:$/, '')}\" is not supported.`);\n\t\t}\n\n\t\tif (parsedURL.protocol === 'data:') {\n\t\t\tconst data = dataUriToBuffer(request.url);\n\t\t\tconst response = new Response(data, {headers: {'Content-Type': data.typeFull}});\n\t\t\tresolve(response);\n\t\t\treturn;\n\t\t}\n\n\t\t// Wrap http.request into fetch\n\t\tconst send = (parsedURL.protocol === 'https:' ? https : http).request;\n\t\tconst {signal} = request;\n\t\tlet response = null;\n\n\t\tconst abort = () => {\n\t\t\tconst error = new AbortError('The operation was aborted.');\n\t\t\treject(error);\n\t\t\tif (request.body && request.body instanceof Stream.Readable) {\n\t\t\t\trequest.body.destroy(error);\n\t\t\t}\n\n\t\t\tif (!response || !response.body) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresponse.body.emit('error', error);\n\t\t};\n\n\t\tif (signal && signal.aborted) {\n\t\t\tabort();\n\t\t\treturn;\n\t\t}\n\n\t\tconst abortAndFinalize = () => {\n\t\t\tabort();\n\t\t\tfinalize();\n\t\t};\n\n\t\t// Send request\n\t\tconst request_ = send(parsedURL.toString(), options);\n\n\t\tif (signal) {\n\t\t\tsignal.addEventListener('abort', abortAndFinalize);\n\t\t}\n\n\t\tconst finalize = () => {\n\t\t\trequest_.abort();\n\t\t\tif (signal) {\n\t\t\t\tsignal.removeEventListener('abort', abortAndFinalize);\n\t\t\t}\n\t\t};\n\n\t\trequest_.on('error', error => {\n\t\t\treject(new FetchError(`request to ${request.url} failed, reason: ${error.message}`, 'system', error));\n\t\t\tfinalize();\n\t\t});\n\n\t\tfixResponseChunkedTransferBadEnding(request_, error => {\n\t\t\tif (response && response.body) {\n\t\t\t\tresponse.body.destroy(error);\n\t\t\t}\n\t\t});\n\n\t\t/* c8 ignore next 18 */\n\t\tif (process.version < 'v14') {\n\t\t\t// Before Node.js 14, pipeline() does not fully support async iterators and does not always\n\t\t\t// properly handle when the socket close/end events are out of order.\n\t\t\trequest_.on('socket', s => {\n\t\t\t\tlet endedWithEventsCount;\n\t\t\t\ts.prependListener('end', () => {\n\t\t\t\t\tendedWithEventsCount = s._eventsCount;\n\t\t\t\t});\n\t\t\t\ts.prependListener('close', hadError => {\n\t\t\t\t\t// if end happened before close but the socket didn't emit an error, do it now\n\t\t\t\t\tif (response && endedWithEventsCount < s._eventsCount && !hadError) {\n\t\t\t\t\t\tconst error = new Error('Premature close');\n\t\t\t\t\t\terror.code = 'ERR_STREAM_PREMATURE_CLOSE';\n\t\t\t\t\t\tresponse.body.emit('error', error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\trequest_.on('response', response_ => {\n\t\t\trequest_.setTimeout(0);\n\t\t\tconst headers = fromRawHeaders(response_.rawHeaders);\n\n\t\t\t// HTTP fetch step 5\n\t\t\tif (isRedirect(response_.statusCode)) {\n\t\t\t\t// HTTP fetch step 5.2\n\t\t\t\tconst location = headers.get('Location');\n\n\t\t\t\t// HTTP fetch step 5.3\n\t\t\t\tlet locationURL = null;\n\t\t\t\ttry {\n\t\t\t\t\tlocationURL = location === null ? null : new URL(location, request.url);\n\t\t\t\t} catch {\n\t\t\t\t\t// error here can only be invalid URL in Location: header\n\t\t\t\t\t// do not throw when options.redirect == manual\n\t\t\t\t\t// let the user extract the errorneous redirect URL\n\t\t\t\t\tif (request.redirect !== 'manual') {\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect'));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// HTTP fetch step 5.5\n\t\t\t\tswitch (request.redirect) {\n\t\t\t\t\tcase 'error':\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect'));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase 'manual':\n\t\t\t\t\t\t// Nothing to do\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'follow': {\n\t\t\t\t\t\t// HTTP-redirect fetch step 2\n\t\t\t\t\t\tif (locationURL === null) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 5\n\t\t\t\t\t\tif (request.counter >= request.follow) {\n\t\t\t\t\t\t\treject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 6 (counter increment)\n\t\t\t\t\t\t// Create a new Request object.\n\t\t\t\t\t\tconst requestOptions = {\n\t\t\t\t\t\t\theaders: new Headers(request.headers),\n\t\t\t\t\t\t\tfollow: request.follow,\n\t\t\t\t\t\t\tcounter: request.counter + 1,\n\t\t\t\t\t\t\tagent: request.agent,\n\t\t\t\t\t\t\tcompress: request.compress,\n\t\t\t\t\t\t\tmethod: request.method,\n\t\t\t\t\t\t\tbody: clone(request),\n\t\t\t\t\t\t\tsignal: request.signal,\n\t\t\t\t\t\t\tsize: request.size,\n\t\t\t\t\t\t\treferrer: request.referrer,\n\t\t\t\t\t\t\treferrerPolicy: request.referrerPolicy\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// when forwarding sensitive headers like \"Authorization\",\n\t\t\t\t\t\t// \"WWW-Authenticate\", and \"Cookie\" to untrusted targets,\n\t\t\t\t\t\t// headers will be ignored when following a redirect to a domain\n\t\t\t\t\t\t// that is not a subdomain match or exact match of the initial domain.\n\t\t\t\t\t\t// For example, a redirect from \"foo.com\" to either \"foo.com\" or \"sub.foo.com\"\n\t\t\t\t\t\t// will forward the sensitive headers, but a redirect to \"bar.com\" will not.\n\t\t\t\t\t\t// headers will also be ignored when following a redirect to a domain using\n\t\t\t\t\t\t// a different protocol. For example, a redirect from \"https://foo.com\" to \"http://foo.com\"\n\t\t\t\t\t\t// will not forward the sensitive headers\n\t\t\t\t\t\tif (!isDomainOrSubdomain(request.url, locationURL) || !isSameProtocol(request.url, locationURL)) {\n\t\t\t\t\t\t\tfor (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) {\n\t\t\t\t\t\t\t\trequestOptions.headers.delete(name);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 9\n\t\t\t\t\t\tif (response_.statusCode !== 303 && request.body && options_.body instanceof Stream.Readable) {\n\t\t\t\t\t\t\treject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 11\n\t\t\t\t\t\tif (response_.statusCode === 303 || ((response_.statusCode === 301 || response_.statusCode === 302) && request.method === 'POST')) {\n\t\t\t\t\t\t\trequestOptions.method = 'GET';\n\t\t\t\t\t\t\trequestOptions.body = undefined;\n\t\t\t\t\t\t\trequestOptions.headers.delete('content-length');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 14\n\t\t\t\t\t\tconst responseReferrerPolicy = parseReferrerPolicyFromHeader(headers);\n\t\t\t\t\t\tif (responseReferrerPolicy) {\n\t\t\t\t\t\t\trequestOptions.referrerPolicy = responseReferrerPolicy;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 15\n\t\t\t\t\t\tresolve(fetch(new Request(locationURL, requestOptions)));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn reject(new TypeError(`Redirect option '${request.redirect}' is not a valid value of RequestRedirect`));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Prepare response\n\t\t\tif (signal) {\n\t\t\t\tresponse_.once('end', () => {\n\t\t\t\t\tsignal.removeEventListener('abort', abortAndFinalize);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tlet body = pump(response_, new PassThrough(), error => {\n\t\t\t\tif (error) {\n\t\t\t\t\treject(error);\n\t\t\t\t}\n\t\t\t});\n\t\t\t// see https://github.com/nodejs/node/pull/29376\n\t\t\t/* c8 ignore next 3 */\n\t\t\tif (process.version < 'v12.10') {\n\t\t\t\tresponse_.on('aborted', abortAndFinalize);\n\t\t\t}\n\n\t\t\tconst responseOptions = {\n\t\t\t\turl: request.url,\n\t\t\t\tstatus: response_.statusCode,\n\t\t\t\tstatusText: response_.statusMessage,\n\t\t\t\theaders,\n\t\t\t\tsize: request.size,\n\t\t\t\tcounter: request.counter,\n\t\t\t\thighWaterMark: request.highWaterMark\n\t\t\t};\n\n\t\t\t// HTTP-network fetch step 12.1.1.3\n\t\t\tconst codings = headers.get('Content-Encoding');\n\n\t\t\t// HTTP-network fetch step 12.1.1.4: handle content codings\n\n\t\t\t// in following scenarios we ignore compression support\n\t\t\t// 1. compression support is disabled\n\t\t\t// 2. HEAD request\n\t\t\t// 3. no Content-Encoding header\n\t\t\t// 4. no content response (204)\n\t\t\t// 5. content not modified response (304)\n\t\t\tif (!request.compress || request.method === 'HEAD' || codings === null || response_.statusCode === 204 || response_.statusCode === 304) {\n\t\t\t\tresponse = new Response(body, responseOptions);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For Node v6+\n\t\t\t// Be less strict when decoding compressed responses, since sometimes\n\t\t\t// servers send slightly invalid responses that are still accepted\n\t\t\t// by common browsers.\n\t\t\t// Always using Z_SYNC_FLUSH is what cURL does.\n\t\t\tconst zlibOptions = {\n\t\t\t\tflush: zlib.Z_SYNC_FLUSH,\n\t\t\t\tfinishFlush: zlib.Z_SYNC_FLUSH\n\t\t\t};\n\n\t\t\t// For gzip\n\t\t\tif (codings === 'gzip' || codings === 'x-gzip') {\n\t\t\t\tbody = pump(body, zlib.createGunzip(zlibOptions), error => {\n\t\t\t\t\tif (error) {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tresponse = new Response(body, responseOptions);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For deflate\n\t\t\tif (codings === 'deflate' || codings === 'x-deflate') {\n\t\t\t\t// Handle the infamous raw deflate response from old servers\n\t\t\t\t// a hack for old IIS and Apache servers\n\t\t\t\tconst raw = pump(response_, new PassThrough(), error => {\n\t\t\t\t\tif (error) {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\traw.once('data', chunk => {\n\t\t\t\t\t// See http://stackoverflow.com/questions/37519828\n\t\t\t\t\tif ((chunk[0] & 0x0F) === 0x08) {\n\t\t\t\t\t\tbody = pump(body, zlib.createInflate(), error => {\n\t\t\t\t\t\t\tif (error) {\n\t\t\t\t\t\t\t\treject(error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbody = pump(body, zlib.createInflateRaw(), error => {\n\t\t\t\t\t\t\tif (error) {\n\t\t\t\t\t\t\t\treject(error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tresponse = new Response(body, responseOptions);\n\t\t\t\t\tresolve(response);\n\t\t\t\t});\n\t\t\t\traw.once('end', () => {\n\t\t\t\t\t// Some old IIS servers return zero-length OK deflate responses, so\n\t\t\t\t\t// 'data' is never emitted. See https://github.com/node-fetch/node-fetch/pull/903\n\t\t\t\t\tif (!response) {\n\t\t\t\t\t\tresponse = new Response(body, responseOptions);\n\t\t\t\t\t\tresolve(response);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For br\n\t\t\tif (codings === 'br') {\n\t\t\t\tbody = pump(body, zlib.createBrotliDecompress(), error => {\n\t\t\t\t\tif (error) {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tresponse = new Response(body, responseOptions);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Otherwise, use response as-is\n\t\t\tresponse = new Response(body, responseOptions);\n\t\t\tresolve(response);\n\t\t});\n\n\t\t// eslint-disable-next-line promise/prefer-await-to-then\n\t\twriteToStream(request_, request).catch(reject);\n\t});\n}\n\nfunction fixResponseChunkedTransferBadEnding(request, errorCallback) {\n\tconst LAST_CHUNK = Buffer.from('0\\r\\n\\r\\n');\n\n\tlet isChunkedTransfer = false;\n\tlet properLastChunkReceived = false;\n\tlet previousChunk;\n\n\trequest.on('response', response => {\n\t\tconst {headers} = response;\n\t\tisChunkedTransfer = headers['transfer-encoding'] === 'chunked' && !headers['content-length'];\n\t});\n\n\trequest.on('socket', socket => {\n\t\tconst onSocketClose = () => {\n\t\t\tif (isChunkedTransfer && !properLastChunkReceived) {\n\t\t\t\tconst error = new Error('Premature close');\n\t\t\t\terror.code = 'ERR_STREAM_PREMATURE_CLOSE';\n\t\t\t\terrorCallback(error);\n\t\t\t}\n\t\t};\n\n\t\tconst onData = buf => {\n\t\t\tproperLastChunkReceived = Buffer.compare(buf.slice(-5), LAST_CHUNK) === 0;\n\n\t\t\t// Sometimes final 0-length chunk and end of message code are in separate packets\n\t\t\tif (!properLastChunkReceived && previousChunk) {\n\t\t\t\tproperLastChunkReceived = (\n\t\t\t\t\tBuffer.compare(previousChunk.slice(-3), LAST_CHUNK.slice(0, 3)) === 0 &&\n\t\t\t\t\tBuffer.compare(buf.slice(-2), LAST_CHUNK.slice(3)) === 0\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tpreviousChunk = buf;\n\t\t};\n\n\t\tsocket.prependListener('close', onSocketClose);\n\t\tsocket.on('data', onData);\n\n\t\trequest.on('close', () => {\n\t\t\tsocket.removeListener('close', onSocketClose);\n\t\t\tsocket.removeListener('data', onData);\n\t\t});\n\t});\n}\n"],"names":["request","Request","getNodeRequestOptions","dataUriToBuffer","response","Response","AbortError","FetchError","headers","fromRawHeaders","isRedirect","Headers","clone","isDomainOrSubdomain","isSameProtocol","parseReferrerPolicyFromHeader","body","pump","PassThrough","writeToStream","Buffer"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsCA,MAAM,mBAAmB,oBAAI,IAAI,CAAC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