@ienlab/cloud-functions-library 0.9.0 → 0.9.4
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/.gemini/config.yaml +47 -0
- package/.github/ISSUE_TEMPLATE/bug_report.yaml +74 -0
- package/.github/ISSUE_TEMPLATE/documentation.yaml +23 -0
- package/.github/ISSUE_TEMPLATE/feature_request.yaml +60 -0
- package/.github/ISSUE_TEMPLATE/question.yaml +17 -0
- package/.github/ISSUE_TEMPLATE/refactor.yaml +42 -0
- package/.github/RELEASE_TEMPLATE.md +17 -0
- package/.github/workflows/publish.yml +30 -0
- package/eslint.config.js +23 -0
- package/index.html +13 -0
- package/package.json +5 -8
- package/public/favicon.svg +1 -0
- package/public/icons.svg +24 -0
- package/src/App.css +184 -0
- package/src/App.tsx +121 -0
- package/src/assets/hero.png +0 -0
- package/src/assets/react.svg +1 -0
- package/src/assets/vite.svg +1 -0
- package/src/index.css +111 -0
- package/src/index.ts +16 -0
- package/src/main.tsx +10 -0
- package/tsconfig.app.json +25 -0
- package/tsconfig.build.json +12 -0
- package/tsconfig.json +7 -0
- package/tsconfig.node.json +24 -0
- package/vite.config.ts +39 -0
- package/dist/__vite-browser-external-BrdF6Ba4.js +0 -1
- package/dist/__vite-browser-external-C4yfM1ew.mjs +0 -25
- package/dist/dist-B3gFypMh.js +0 -5
- package/dist/dist-BHRQIx5i.mjs +0 -460
- package/dist/dist-CkUzyZvx.js +0 -1
- package/dist/dist-Cum8lv5j.mjs +0 -16
- package/dist/from-BPj5eOuj.mjs +0 -2443
- package/dist/from-jzy6jn2J.js +0 -4
- package/dist/index.cjs.js +0 -66
- package/dist/index.d.ts +0 -17
- package/dist/index.es.js +0 -49920
- package/dist/multipart-parser-9TgDfPGH.mjs +0 -149
- package/dist/multipart-parser-D41wkGe-.js +0 -2
- package/dist/multipart-parser-DOk5BsUv.js +0 -2
- package/dist/multipart-parser-D_l0qnsO.mjs +0 -149
- package/dist/src-C0B8QY6h.js +0 -3
- package/dist/src-CNjb2Vfu.js +0 -3
- package/dist/src-CYCYovTl.mjs +0 -666
- package/dist/src-M25oq7Q_.mjs +0 -666
package/dist/src-M25oq7Q_.mjs
DELETED
|
@@ -1,666 +0,0 @@
|
|
|
1
|
-
import { r as e, s as t, t as n } from "./__vite-browser-external-C4yfM1ew.mjs";
|
|
2
|
-
import { n as r, t as i } from "./dist-Cum8lv5j.mjs";
|
|
3
|
-
import { i as a, n as o, o as s, r as c, s as l, t as u } from "./from-BPj5eOuj.mjs";
|
|
4
|
-
//#region node_modules/gcp-metadata/node_modules/node-fetch/src/errors/base.js
|
|
5
|
-
var d, f = e((() => {
|
|
6
|
-
d = class extends Error {
|
|
7
|
-
constructor(e, t) {
|
|
8
|
-
super(e), Error.captureStackTrace(this, this.constructor), this.type = t;
|
|
9
|
-
}
|
|
10
|
-
get name() {
|
|
11
|
-
return this.constructor.name;
|
|
12
|
-
}
|
|
13
|
-
get [Symbol.toStringTag]() {
|
|
14
|
-
return this.constructor.name;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
})), p, m = e((() => {
|
|
18
|
-
f(), p = class extends d {
|
|
19
|
-
constructor(e, t, n) {
|
|
20
|
-
super(e, t), n && (this.code = this.errno = n.code, this.erroredSysCall = n.syscall);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
})), h, g, _, ee, v, te, y = e((() => {
|
|
24
|
-
h = Symbol.toStringTag, g = (e) => typeof e == "object" && typeof e.append == "function" && typeof e.delete == "function" && typeof e.get == "function" && typeof e.getAll == "function" && typeof e.has == "function" && typeof e.set == "function" && typeof e.sort == "function" && e[h] === "URLSearchParams", _ = (e) => e && typeof e == "object" && typeof e.arrayBuffer == "function" && typeof e.type == "string" && typeof e.stream == "function" && typeof e.constructor == "function" && /^(Blob|File)$/.test(e[h]), ee = (e) => typeof e == "object" && (e[h] === "AbortSignal" || e[h] === "EventTarget"), v = (e, t) => {
|
|
25
|
-
let n = new URL(t).hostname, r = new URL(e).hostname;
|
|
26
|
-
return n === r || n.endsWith(`.${r}`);
|
|
27
|
-
}, te = (e, t) => new URL(t).protocol === new URL(e).protocol;
|
|
28
|
-
}));
|
|
29
|
-
//#endregion
|
|
30
|
-
//#region node_modules/gcp-metadata/node_modules/node-fetch/src/body.js
|
|
31
|
-
async function b(e) {
|
|
32
|
-
if (e[w].disturbed) throw TypeError(`body used already for: ${e.url}`);
|
|
33
|
-
if (e[w].disturbed = !0, e[w].error) throw e[w].error;
|
|
34
|
-
let { body: t } = e;
|
|
35
|
-
/* c8 ignore next 3 */
|
|
36
|
-
if (t === null || !(t instanceof x.default)) return C.Buffer.alloc(0);
|
|
37
|
-
let n = [], r = 0;
|
|
38
|
-
try {
|
|
39
|
-
for await (let i of t) {
|
|
40
|
-
if (e.size > 0 && r + i.length > e.size) {
|
|
41
|
-
let n = new p(`content size at ${e.url} over limit: ${e.size}`, "max-size");
|
|
42
|
-
throw t.destroy(n), n;
|
|
43
|
-
}
|
|
44
|
-
r += i.length, n.push(i);
|
|
45
|
-
}
|
|
46
|
-
} catch (t) {
|
|
47
|
-
throw t instanceof d ? t : new p(`Invalid response body while trying to fetch ${e.url}: ${t.message}`, "system", t);
|
|
48
|
-
}
|
|
49
|
-
if (t.readableEnded === !0 || t._readableState.ended === !0) try {
|
|
50
|
-
return n.every((e) => typeof e == "string") ? C.Buffer.from(n.join("")) : C.Buffer.concat(n, r);
|
|
51
|
-
} catch (t) {
|
|
52
|
-
throw new p(`Could not create Buffer from response body for ${e.url}: ${t.message}`, "system", t);
|
|
53
|
-
}
|
|
54
|
-
else throw new p(`Premature close of server response while trying to fetch ${e.url}`);
|
|
55
|
-
}
|
|
56
|
-
var x, S, C, ne, w, T, E, D, O, re, ie, k = e((() => {
|
|
57
|
-
x = /* @__PURE__ */ t(n(), 1), S = /* @__PURE__ */ t(n(), 1), C = /* @__PURE__ */ t(n(), 1), l(), a(), m(), f(), y(), ne = (0, S.promisify)(x.default.pipeline), w = Symbol("Body internals"), T = class {
|
|
58
|
-
constructor(e, { size: t = 0 } = {}) {
|
|
59
|
-
let n = null;
|
|
60
|
-
e === null ? e = null : g(e) ? e = C.Buffer.from(e.toString()) : _(e) || C.Buffer.isBuffer(e) || (S.types.isAnyArrayBuffer(e) ? e = C.Buffer.from(e) : ArrayBuffer.isView(e) ? e = C.Buffer.from(e.buffer, e.byteOffset, e.byteLength) : e instanceof x.default || (e instanceof o ? (e = c(e), n = e.type.split("=")[1]) : e = C.Buffer.from(String(e))));
|
|
61
|
-
let r = e;
|
|
62
|
-
C.Buffer.isBuffer(e) ? r = x.default.Readable.from(e) : _(e) && (r = x.default.Readable.from(e.stream())), this[w] = {
|
|
63
|
-
body: e,
|
|
64
|
-
stream: r,
|
|
65
|
-
boundary: n,
|
|
66
|
-
disturbed: !1,
|
|
67
|
-
error: null
|
|
68
|
-
}, this.size = t, e instanceof x.default && e.on("error", (e) => {
|
|
69
|
-
let t = e instanceof d ? e : new p(`Invalid response body while trying to fetch ${this.url}: ${e.message}`, "system", e);
|
|
70
|
-
this[w].error = t;
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
get body() {
|
|
74
|
-
return this[w].stream;
|
|
75
|
-
}
|
|
76
|
-
get bodyUsed() {
|
|
77
|
-
return this[w].disturbed;
|
|
78
|
-
}
|
|
79
|
-
async arrayBuffer() {
|
|
80
|
-
let { buffer: e, byteOffset: t, byteLength: n } = await b(this);
|
|
81
|
-
return e.slice(t, t + n);
|
|
82
|
-
}
|
|
83
|
-
async formData() {
|
|
84
|
-
let e = this.headers.get("content-type");
|
|
85
|
-
if (e.startsWith("application/x-www-form-urlencoded")) {
|
|
86
|
-
let e = new o(), t = new URLSearchParams(await this.text());
|
|
87
|
-
for (let [n, r] of t) e.append(n, r);
|
|
88
|
-
return e;
|
|
89
|
-
}
|
|
90
|
-
let { toFormData: t } = await import("./multipart-parser-D_l0qnsO.mjs");
|
|
91
|
-
return t(this.body, e);
|
|
92
|
-
}
|
|
93
|
-
async blob() {
|
|
94
|
-
let e = this.headers && this.headers.get("content-type") || this[w].body && this[w].body.type || "";
|
|
95
|
-
return new s([await this.arrayBuffer()], { type: e });
|
|
96
|
-
}
|
|
97
|
-
async json() {
|
|
98
|
-
let e = await this.text();
|
|
99
|
-
return JSON.parse(e);
|
|
100
|
-
}
|
|
101
|
-
async text() {
|
|
102
|
-
let e = await b(this);
|
|
103
|
-
return new TextDecoder().decode(e);
|
|
104
|
-
}
|
|
105
|
-
buffer() {
|
|
106
|
-
return b(this);
|
|
107
|
-
}
|
|
108
|
-
}, T.prototype.buffer = (0, S.deprecate)(T.prototype.buffer, "Please use 'response.arrayBuffer()' instead of 'response.buffer()'", "node-fetch#buffer"), Object.defineProperties(T.prototype, {
|
|
109
|
-
body: { enumerable: !0 },
|
|
110
|
-
bodyUsed: { enumerable: !0 },
|
|
111
|
-
arrayBuffer: { enumerable: !0 },
|
|
112
|
-
blob: { enumerable: !0 },
|
|
113
|
-
json: { enumerable: !0 },
|
|
114
|
-
text: { enumerable: !0 },
|
|
115
|
-
data: { get: (0, S.deprecate)(() => {}, "data doesn't exist, use json(), text(), arrayBuffer(), or body instead", "https://github.com/node-fetch/node-fetch/issues/1000 (response)") }
|
|
116
|
-
}), E = (e, t) => {
|
|
117
|
-
let n, r, { body: i } = e[w];
|
|
118
|
-
if (e.bodyUsed) throw Error("cannot clone body after it is used");
|
|
119
|
-
return i instanceof x.default && typeof i.getBoundary != "function" && (n = new x.PassThrough({ highWaterMark: t }), r = new x.PassThrough({ highWaterMark: t }), i.pipe(n), i.pipe(r), e[w].stream = n, i = r), i;
|
|
120
|
-
}, D = (0, S.deprecate)((e) => e.getBoundary(), "form-data doesn't follow the spec and requires special treatment. Use alternative package", "https://github.com/node-fetch/node-fetch/issues/1167"), O = (e, t) => e === null ? null : typeof e == "string" ? "text/plain;charset=UTF-8" : g(e) ? "application/x-www-form-urlencoded;charset=UTF-8" : _(e) ? e.type || null : C.Buffer.isBuffer(e) || S.types.isAnyArrayBuffer(e) || ArrayBuffer.isView(e) ? null : e instanceof o ? `multipart/form-data; boundary=${t[w].boundary}` : e && typeof e.getBoundary == "function" ? `multipart/form-data;boundary=${D(e)}` : e instanceof x.default ? null : "text/plain;charset=UTF-8", re = (e) => {
|
|
121
|
-
let { body: t } = e[w];
|
|
122
|
-
return t === null ? 0 : _(t) ? t.size : C.Buffer.isBuffer(t) ? t.length : t && typeof t.getLengthSync == "function" && t.hasKnownLength && t.hasKnownLength() ? t.getLengthSync() : null;
|
|
123
|
-
}, ie = async (e, { body: t }) => {
|
|
124
|
-
t === null ? e.end() : await ne(t, e);
|
|
125
|
-
};
|
|
126
|
-
}));
|
|
127
|
-
//#endregion
|
|
128
|
-
//#region node_modules/gcp-metadata/node_modules/node-fetch/src/headers.js
|
|
129
|
-
function ae(e = []) {
|
|
130
|
-
return new P(e.reduce((e, t, n, r) => (n % 2 == 0 && e.push(r.slice(n, n + 2)), e), []).filter(([e, t]) => {
|
|
131
|
-
try {
|
|
132
|
-
return M(e), N(e, String(t)), !0;
|
|
133
|
-
} catch {
|
|
134
|
-
return !1;
|
|
135
|
-
}
|
|
136
|
-
}));
|
|
137
|
-
}
|
|
138
|
-
var A, j, M, N, P, F = e((() => {
|
|
139
|
-
A = /* @__PURE__ */ t(n(), 1), j = /* @__PURE__ */ t(n(), 1), M = typeof j.default.validateHeaderName == "function" ? j.default.validateHeaderName : (e) => {
|
|
140
|
-
if (!/^[\^`\-\w!#$%&'*+.|~]+$/.test(e)) {
|
|
141
|
-
let t = /* @__PURE__ */ TypeError(`Header name must be a valid HTTP token [${e}]`);
|
|
142
|
-
throw Object.defineProperty(t, "code", { value: "ERR_INVALID_HTTP_TOKEN" }), t;
|
|
143
|
-
}
|
|
144
|
-
}, N = typeof j.default.validateHeaderValue == "function" ? j.default.validateHeaderValue : (e, t) => {
|
|
145
|
-
if (/[^\t\u0020-\u007E\u0080-\u00FF]/.test(t)) {
|
|
146
|
-
let t = /* @__PURE__ */ TypeError(`Invalid character in header content ["${e}"]`);
|
|
147
|
-
throw Object.defineProperty(t, "code", { value: "ERR_INVALID_CHAR" }), t;
|
|
148
|
-
}
|
|
149
|
-
}, P = class e extends URLSearchParams {
|
|
150
|
-
constructor(t) {
|
|
151
|
-
let n = [];
|
|
152
|
-
if (t instanceof e) {
|
|
153
|
-
let e = t.raw();
|
|
154
|
-
for (let [t, r] of Object.entries(e)) n.push(...r.map((e) => [t, e]));
|
|
155
|
-
} else if (t != null) if (typeof t == "object" && !A.types.isBoxedPrimitive(t)) {
|
|
156
|
-
let e = t[Symbol.iterator];
|
|
157
|
-
if (e == null) n.push(...Object.entries(t));
|
|
158
|
-
else {
|
|
159
|
-
if (typeof e != "function") throw TypeError("Header pairs must be iterable");
|
|
160
|
-
n = [...t].map((e) => {
|
|
161
|
-
if (typeof e != "object" || A.types.isBoxedPrimitive(e)) throw TypeError("Each header pair must be an iterable object");
|
|
162
|
-
return [...e];
|
|
163
|
-
}).map((e) => {
|
|
164
|
-
if (e.length !== 2) throw TypeError("Each header pair must be a name/value tuple");
|
|
165
|
-
return [...e];
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
} else throw TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)");
|
|
169
|
-
return n = n.length > 0 ? n.map(([e, t]) => (M(e), N(e, String(t)), [String(e).toLowerCase(), String(t)])) : void 0, super(n), new Proxy(this, { get(e, t, n) {
|
|
170
|
-
switch (t) {
|
|
171
|
-
case "append":
|
|
172
|
-
case "set": return (n, r) => (M(n), N(n, String(r)), URLSearchParams.prototype[t].call(e, String(n).toLowerCase(), String(r)));
|
|
173
|
-
case "delete":
|
|
174
|
-
case "has":
|
|
175
|
-
case "getAll": return (n) => (M(n), URLSearchParams.prototype[t].call(e, String(n).toLowerCase()));
|
|
176
|
-
case "keys": return () => (e.sort(), new Set(URLSearchParams.prototype.keys.call(e)).keys());
|
|
177
|
-
default: return Reflect.get(e, t, n);
|
|
178
|
-
}
|
|
179
|
-
} });
|
|
180
|
-
/* c8 ignore next */
|
|
181
|
-
}
|
|
182
|
-
get [Symbol.toStringTag]() {
|
|
183
|
-
return this.constructor.name;
|
|
184
|
-
}
|
|
185
|
-
toString() {
|
|
186
|
-
return Object.prototype.toString.call(this);
|
|
187
|
-
}
|
|
188
|
-
get(e) {
|
|
189
|
-
let t = this.getAll(e);
|
|
190
|
-
if (t.length === 0) return null;
|
|
191
|
-
let n = t.join(", ");
|
|
192
|
-
return /^content-encoding$/i.test(e) && (n = n.toLowerCase()), n;
|
|
193
|
-
}
|
|
194
|
-
forEach(e, t = void 0) {
|
|
195
|
-
for (let n of this.keys()) Reflect.apply(e, t, [
|
|
196
|
-
this.get(n),
|
|
197
|
-
n,
|
|
198
|
-
this
|
|
199
|
-
]);
|
|
200
|
-
}
|
|
201
|
-
*values() {
|
|
202
|
-
for (let e of this.keys()) yield this.get(e);
|
|
203
|
-
}
|
|
204
|
-
*entries() {
|
|
205
|
-
for (let e of this.keys()) yield [e, this.get(e)];
|
|
206
|
-
}
|
|
207
|
-
[Symbol.iterator]() {
|
|
208
|
-
return this.entries();
|
|
209
|
-
}
|
|
210
|
-
raw() {
|
|
211
|
-
return [...this.keys()].reduce((e, t) => (e[t] = this.getAll(t), e), {});
|
|
212
|
-
}
|
|
213
|
-
[Symbol.for("nodejs.util.inspect.custom")]() {
|
|
214
|
-
return [...this.keys()].reduce((e, t) => {
|
|
215
|
-
let n = this.getAll(t);
|
|
216
|
-
return t === "host" ? e[t] = n[0] : e[t] = n.length > 1 ? n : n[0], e;
|
|
217
|
-
}, {});
|
|
218
|
-
}
|
|
219
|
-
}, Object.defineProperties(P.prototype, [
|
|
220
|
-
"get",
|
|
221
|
-
"entries",
|
|
222
|
-
"forEach",
|
|
223
|
-
"values"
|
|
224
|
-
].reduce((e, t) => (e[t] = { enumerable: !0 }, e), {}));
|
|
225
|
-
})), I, L, oe = e((() => {
|
|
226
|
-
I = new Set([
|
|
227
|
-
301,
|
|
228
|
-
302,
|
|
229
|
-
303,
|
|
230
|
-
307,
|
|
231
|
-
308
|
|
232
|
-
]), L = (e) => I.has(e);
|
|
233
|
-
})), R, z, se = e((() => {
|
|
234
|
-
F(), k(), oe(), R = Symbol("Response internals"), z = class e extends T {
|
|
235
|
-
constructor(e = null, t = {}) {
|
|
236
|
-
super(e, t);
|
|
237
|
-
let n = t.status == null ? 200 : t.status, r = new P(t.headers);
|
|
238
|
-
if (e !== null && !r.has("Content-Type")) {
|
|
239
|
-
let t = O(e, this);
|
|
240
|
-
t && r.append("Content-Type", t);
|
|
241
|
-
}
|
|
242
|
-
this[R] = {
|
|
243
|
-
type: "default",
|
|
244
|
-
url: t.url,
|
|
245
|
-
status: n,
|
|
246
|
-
statusText: t.statusText || "",
|
|
247
|
-
headers: r,
|
|
248
|
-
counter: t.counter,
|
|
249
|
-
highWaterMark: t.highWaterMark
|
|
250
|
-
};
|
|
251
|
-
}
|
|
252
|
-
get type() {
|
|
253
|
-
return this[R].type;
|
|
254
|
-
}
|
|
255
|
-
get url() {
|
|
256
|
-
return this[R].url || "";
|
|
257
|
-
}
|
|
258
|
-
get status() {
|
|
259
|
-
return this[R].status;
|
|
260
|
-
}
|
|
261
|
-
get ok() {
|
|
262
|
-
return this[R].status >= 200 && this[R].status < 300;
|
|
263
|
-
}
|
|
264
|
-
get redirected() {
|
|
265
|
-
return this[R].counter > 0;
|
|
266
|
-
}
|
|
267
|
-
get statusText() {
|
|
268
|
-
return this[R].statusText;
|
|
269
|
-
}
|
|
270
|
-
get headers() {
|
|
271
|
-
return this[R].headers;
|
|
272
|
-
}
|
|
273
|
-
get highWaterMark() {
|
|
274
|
-
return this[R].highWaterMark;
|
|
275
|
-
}
|
|
276
|
-
clone() {
|
|
277
|
-
return new e(E(this, this.highWaterMark), {
|
|
278
|
-
type: this.type,
|
|
279
|
-
url: this.url,
|
|
280
|
-
status: this.status,
|
|
281
|
-
statusText: this.statusText,
|
|
282
|
-
headers: this.headers,
|
|
283
|
-
ok: this.ok,
|
|
284
|
-
redirected: this.redirected,
|
|
285
|
-
size: this.size,
|
|
286
|
-
highWaterMark: this.highWaterMark
|
|
287
|
-
});
|
|
288
|
-
}
|
|
289
|
-
static redirect(t, n = 302) {
|
|
290
|
-
if (!L(n)) throw RangeError("Failed to execute \"redirect\" on \"response\": Invalid status code");
|
|
291
|
-
return new e(null, {
|
|
292
|
-
headers: { location: new URL(t).toString() },
|
|
293
|
-
status: n
|
|
294
|
-
});
|
|
295
|
-
}
|
|
296
|
-
static error() {
|
|
297
|
-
let t = new e(null, {
|
|
298
|
-
status: 0,
|
|
299
|
-
statusText: ""
|
|
300
|
-
});
|
|
301
|
-
return t[R].type = "error", t;
|
|
302
|
-
}
|
|
303
|
-
static json(t = void 0, n = {}) {
|
|
304
|
-
let r = JSON.stringify(t);
|
|
305
|
-
if (r === void 0) throw TypeError("data is not JSON serializable");
|
|
306
|
-
let i = new P(n && n.headers);
|
|
307
|
-
return i.has("content-type") || i.set("content-type", "application/json"), new e(r, {
|
|
308
|
-
...n,
|
|
309
|
-
headers: i
|
|
310
|
-
});
|
|
311
|
-
}
|
|
312
|
-
get [Symbol.toStringTag]() {
|
|
313
|
-
return "Response";
|
|
314
|
-
}
|
|
315
|
-
}, Object.defineProperties(z.prototype, {
|
|
316
|
-
type: { enumerable: !0 },
|
|
317
|
-
url: { enumerable: !0 },
|
|
318
|
-
status: { enumerable: !0 },
|
|
319
|
-
ok: { enumerable: !0 },
|
|
320
|
-
redirected: { enumerable: !0 },
|
|
321
|
-
statusText: { enumerable: !0 },
|
|
322
|
-
headers: { enumerable: !0 },
|
|
323
|
-
clone: { enumerable: !0 }
|
|
324
|
-
});
|
|
325
|
-
})), B, ce = e((() => {
|
|
326
|
-
B = (e) => {
|
|
327
|
-
if (e.search) return e.search;
|
|
328
|
-
let t = e.href.length - 1, n = e.hash || (e.href[t] === "#" ? "#" : "");
|
|
329
|
-
return e.href[t - n.length] === "?" ? "?" : "";
|
|
330
|
-
};
|
|
331
|
-
}));
|
|
332
|
-
//#endregion
|
|
333
|
-
//#region node_modules/gcp-metadata/node_modules/node-fetch/src/utils/referrer.js
|
|
334
|
-
function V(e, t = !1) {
|
|
335
|
-
return e == null || (e = new URL(e), /^(about|blob|data):$/.test(e.protocol)) ? "no-referrer" : (e.username = "", e.password = "", e.hash = "", t && (e.pathname = "", e.search = ""), e);
|
|
336
|
-
}
|
|
337
|
-
function le(e) {
|
|
338
|
-
if (!W.has(e)) throw TypeError(`Invalid referrerPolicy: ${e}`);
|
|
339
|
-
return e;
|
|
340
|
-
}
|
|
341
|
-
function ue(e) {
|
|
342
|
-
if (/^(http|ws)s:$/.test(e.protocol)) return !0;
|
|
343
|
-
let t = e.host.replace(/(^\[)|(]$)/g, ""), n = (0, U.isIP)(t);
|
|
344
|
-
return n === 4 && /^127\./.test(t) || n === 6 && /^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(t) ? !0 : e.host === "localhost" || e.host.endsWith(".localhost") ? !1 : e.protocol === "file:";
|
|
345
|
-
}
|
|
346
|
-
function H(e) {
|
|
347
|
-
return /^about:(blank|srcdoc)$/.test(e) || e.protocol === "data:" || /^(blob|filesystem):$/.test(e.protocol) ? !0 : ue(e);
|
|
348
|
-
}
|
|
349
|
-
function de(e, { referrerURLCallback: t, referrerOriginCallback: n } = {}) {
|
|
350
|
-
if (e.referrer === "no-referrer" || e.referrerPolicy === "") return null;
|
|
351
|
-
let r = e.referrerPolicy;
|
|
352
|
-
if (e.referrer === "about:client") return "no-referrer";
|
|
353
|
-
let i = e.referrer, a = V(i), o = V(i, !0);
|
|
354
|
-
a.toString().length > 4096 && (a = o), t && (a = t(a)), n && (o = n(o));
|
|
355
|
-
let s = new URL(e.url);
|
|
356
|
-
switch (r) {
|
|
357
|
-
case "no-referrer": return "no-referrer";
|
|
358
|
-
case "origin": return o;
|
|
359
|
-
case "unsafe-url": return a;
|
|
360
|
-
case "strict-origin": return H(a) && !H(s) ? "no-referrer" : o.toString();
|
|
361
|
-
case "strict-origin-when-cross-origin": return a.origin === s.origin ? a : H(a) && !H(s) ? "no-referrer" : o;
|
|
362
|
-
case "same-origin": return a.origin === s.origin ? a : "no-referrer";
|
|
363
|
-
case "origin-when-cross-origin": return a.origin === s.origin ? a : o;
|
|
364
|
-
case "no-referrer-when-downgrade": return H(a) && !H(s) ? "no-referrer" : a;
|
|
365
|
-
default: throw TypeError(`Invalid referrerPolicy: ${r}`);
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
function fe(e) {
|
|
369
|
-
let t = (e.get("referrer-policy") || "").split(/[,\s]+/), n = "";
|
|
370
|
-
for (let e of t) e && W.has(e) && (n = e);
|
|
371
|
-
return n;
|
|
372
|
-
}
|
|
373
|
-
var U, W, G, K = e((() => {
|
|
374
|
-
U = /* @__PURE__ */ t(n(), 1), W = new Set([
|
|
375
|
-
"",
|
|
376
|
-
"no-referrer",
|
|
377
|
-
"no-referrer-when-downgrade",
|
|
378
|
-
"same-origin",
|
|
379
|
-
"origin",
|
|
380
|
-
"strict-origin",
|
|
381
|
-
"origin-when-cross-origin",
|
|
382
|
-
"strict-origin-when-cross-origin",
|
|
383
|
-
"unsafe-url"
|
|
384
|
-
]), G = "strict-origin-when-cross-origin";
|
|
385
|
-
})), pe, q, J, Y, me, X, he, ge = e((() => {
|
|
386
|
-
pe = /* @__PURE__ */ t(n(), 1), q = /* @__PURE__ */ t(n(), 1), F(), k(), y(), ce(), K(), J = Symbol("Request internals"), Y = (e) => typeof e == "object" && typeof e[J] == "object", me = (0, q.deprecate)(() => {}, ".data is not a valid RequestInit property, use .body instead", "https://github.com/node-fetch/node-fetch/issues/1000 (request)"), X = class e extends T {
|
|
387
|
-
constructor(e, t = {}) {
|
|
388
|
-
let n;
|
|
389
|
-
if (Y(e) ? n = new URL(e.url) : (n = new URL(e), e = {}), n.username !== "" || n.password !== "") throw TypeError(`${n} is an url with embedded credentials.`);
|
|
390
|
-
let r = t.method || e.method || "GET";
|
|
391
|
-
if (/^(delete|get|head|options|post|put)$/i.test(r) && (r = r.toUpperCase()), !Y(t) && "data" in t && me(), (t.body != null || Y(e) && e.body !== null) && (r === "GET" || r === "HEAD")) throw TypeError("Request with GET/HEAD method cannot have body");
|
|
392
|
-
let i = t.body ? t.body : Y(e) && e.body !== null ? E(e) : null;
|
|
393
|
-
super(i, { size: t.size || e.size || 0 });
|
|
394
|
-
let a = new P(t.headers || e.headers || {});
|
|
395
|
-
if (i !== null && !a.has("Content-Type")) {
|
|
396
|
-
let e = O(i, this);
|
|
397
|
-
e && a.set("Content-Type", e);
|
|
398
|
-
}
|
|
399
|
-
let o = Y(e) ? e.signal : null;
|
|
400
|
-
if ("signal" in t && (o = t.signal), o != null && !ee(o)) throw TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");
|
|
401
|
-
let s = t.referrer == null ? e.referrer : t.referrer;
|
|
402
|
-
if (s === "") s = "no-referrer";
|
|
403
|
-
else if (s) {
|
|
404
|
-
let e = new URL(s);
|
|
405
|
-
s = /^about:(\/\/)?client$/.test(e) ? "client" : e;
|
|
406
|
-
} else s = void 0;
|
|
407
|
-
this[J] = {
|
|
408
|
-
method: r,
|
|
409
|
-
redirect: t.redirect || e.redirect || "follow",
|
|
410
|
-
headers: a,
|
|
411
|
-
parsedURL: n,
|
|
412
|
-
signal: o,
|
|
413
|
-
referrer: s
|
|
414
|
-
}, this.follow = t.follow === void 0 ? e.follow === void 0 ? 20 : e.follow : t.follow, this.compress = t.compress === void 0 ? e.compress === void 0 ? !0 : e.compress : t.compress, this.counter = t.counter || e.counter || 0, this.agent = t.agent || e.agent, this.highWaterMark = t.highWaterMark || e.highWaterMark || 16384, this.insecureHTTPParser = t.insecureHTTPParser || e.insecureHTTPParser || !1, this.referrerPolicy = t.referrerPolicy || e.referrerPolicy || "";
|
|
415
|
-
}
|
|
416
|
-
get method() {
|
|
417
|
-
return this[J].method;
|
|
418
|
-
}
|
|
419
|
-
get url() {
|
|
420
|
-
return (0, pe.format)(this[J].parsedURL);
|
|
421
|
-
}
|
|
422
|
-
get headers() {
|
|
423
|
-
return this[J].headers;
|
|
424
|
-
}
|
|
425
|
-
get redirect() {
|
|
426
|
-
return this[J].redirect;
|
|
427
|
-
}
|
|
428
|
-
get signal() {
|
|
429
|
-
return this[J].signal;
|
|
430
|
-
}
|
|
431
|
-
get referrer() {
|
|
432
|
-
if (this[J].referrer === "no-referrer") return "";
|
|
433
|
-
if (this[J].referrer === "client") return "about:client";
|
|
434
|
-
if (this[J].referrer) return this[J].referrer.toString();
|
|
435
|
-
}
|
|
436
|
-
get referrerPolicy() {
|
|
437
|
-
return this[J].referrerPolicy;
|
|
438
|
-
}
|
|
439
|
-
set referrerPolicy(e) {
|
|
440
|
-
this[J].referrerPolicy = le(e);
|
|
441
|
-
}
|
|
442
|
-
clone() {
|
|
443
|
-
return new e(this);
|
|
444
|
-
}
|
|
445
|
-
get [Symbol.toStringTag]() {
|
|
446
|
-
return "Request";
|
|
447
|
-
}
|
|
448
|
-
}, Object.defineProperties(X.prototype, {
|
|
449
|
-
method: { enumerable: !0 },
|
|
450
|
-
url: { enumerable: !0 },
|
|
451
|
-
headers: { enumerable: !0 },
|
|
452
|
-
redirect: { enumerable: !0 },
|
|
453
|
-
clone: { enumerable: !0 },
|
|
454
|
-
signal: { enumerable: !0 },
|
|
455
|
-
referrer: { enumerable: !0 },
|
|
456
|
-
referrerPolicy: { enumerable: !0 }
|
|
457
|
-
}), he = (e) => {
|
|
458
|
-
let { parsedURL: t } = e[J], n = new P(e[J].headers);
|
|
459
|
-
n.has("Accept") || n.set("Accept", "*/*");
|
|
460
|
-
let r = null;
|
|
461
|
-
if (e.body === null && /^(post|put)$/i.test(e.method) && (r = "0"), e.body !== null) {
|
|
462
|
-
let t = re(e);
|
|
463
|
-
typeof t == "number" && !Number.isNaN(t) && (r = String(t));
|
|
464
|
-
}
|
|
465
|
-
r && n.set("Content-Length", r), e.referrerPolicy === "" && (e.referrerPolicy = G), e.referrer && e.referrer !== "no-referrer" ? e[J].referrer = de(e) : e[J].referrer = "no-referrer", e[J].referrer instanceof URL && n.set("Referer", e.referrer), n.has("User-Agent") || n.set("User-Agent", "node-fetch"), e.compress && !n.has("Accept-Encoding") && n.set("Accept-Encoding", "gzip, deflate, br");
|
|
466
|
-
let { agent: i } = e;
|
|
467
|
-
typeof i == "function" && (i = i(t));
|
|
468
|
-
let a = B(t);
|
|
469
|
-
return {
|
|
470
|
-
parsedURL: t,
|
|
471
|
-
options: {
|
|
472
|
-
path: t.pathname + a,
|
|
473
|
-
method: e.method,
|
|
474
|
-
headers: n[Symbol.for("nodejs.util.inspect.custom")](),
|
|
475
|
-
insecureHTTPParser: e.insecureHTTPParser,
|
|
476
|
-
agent: i
|
|
477
|
-
}
|
|
478
|
-
};
|
|
479
|
-
};
|
|
480
|
-
})), _e, ve = e((() => {
|
|
481
|
-
f(), _e = class extends d {
|
|
482
|
-
constructor(e, t = "aborted") {
|
|
483
|
-
super(e, t);
|
|
484
|
-
}
|
|
485
|
-
};
|
|
486
|
-
}));
|
|
487
|
-
//#endregion
|
|
488
|
-
//#region node_modules/gcp-metadata/node_modules/node-fetch/src/index.js
|
|
489
|
-
async function ye(e, t) {
|
|
490
|
-
return new Promise((n, r) => {
|
|
491
|
-
let a = new X(e, t), { parsedURL: o, options: s } = he(a);
|
|
492
|
-
if (!Ce.has(o.protocol)) throw TypeError(`node-fetch cannot load ${e}. URL scheme "${o.protocol.replace(/:$/, "")}" is not supported.`);
|
|
493
|
-
if (o.protocol === "data:") {
|
|
494
|
-
let e = i(a.url);
|
|
495
|
-
n(new z(e, { headers: { "Content-Type": e.typeFull } }));
|
|
496
|
-
return;
|
|
497
|
-
}
|
|
498
|
-
let c = (o.protocol === "https:" ? Se.default : xe.default).request, { signal: l } = a, u = null, d = () => {
|
|
499
|
-
let e = new _e("The operation was aborted.");
|
|
500
|
-
r(e), a.body && a.body instanceof Q.default.Readable && a.body.destroy(e), !(!u || !u.body) && u.body.emit("error", e);
|
|
501
|
-
};
|
|
502
|
-
if (l && l.aborted) {
|
|
503
|
-
d();
|
|
504
|
-
return;
|
|
505
|
-
}
|
|
506
|
-
let f = () => {
|
|
507
|
-
d(), h();
|
|
508
|
-
}, m = c(o.toString(), s);
|
|
509
|
-
l && l.addEventListener("abort", f);
|
|
510
|
-
let h = () => {
|
|
511
|
-
m.abort(), l && l.removeEventListener("abort", f);
|
|
512
|
-
};
|
|
513
|
-
m.on("error", (e) => {
|
|
514
|
-
r(new p(`request to ${a.url} failed, reason: ${e.message}`, "system", e)), h();
|
|
515
|
-
}), be(m, (e) => {
|
|
516
|
-
u && u.body && u.body.destroy(e);
|
|
517
|
-
}), process.version < "v14" && m.on("socket", (e) => {
|
|
518
|
-
let t;
|
|
519
|
-
e.prependListener("end", () => {
|
|
520
|
-
t = e._eventsCount;
|
|
521
|
-
}), e.prependListener("close", (n) => {
|
|
522
|
-
if (u && t < e._eventsCount && !n) {
|
|
523
|
-
let e = /* @__PURE__ */ Error("Premature close");
|
|
524
|
-
e.code = "ERR_STREAM_PREMATURE_CLOSE", u.body.emit("error", e);
|
|
525
|
-
}
|
|
526
|
-
});
|
|
527
|
-
}), m.on("response", (e) => {
|
|
528
|
-
m.setTimeout(0);
|
|
529
|
-
let i = ae(e.rawHeaders);
|
|
530
|
-
if (L(e.statusCode)) {
|
|
531
|
-
let o = i.get("Location"), s = null;
|
|
532
|
-
try {
|
|
533
|
-
s = o === null ? null : new URL(o, a.url);
|
|
534
|
-
} catch {
|
|
535
|
-
if (a.redirect !== "manual") {
|
|
536
|
-
r(new p(`uri requested responds with an invalid redirect URL: ${o}`, "invalid-redirect")), h();
|
|
537
|
-
return;
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
switch (a.redirect) {
|
|
541
|
-
case "error":
|
|
542
|
-
r(new p(`uri requested responds with a redirect, redirect mode is set to error: ${a.url}`, "no-redirect")), h();
|
|
543
|
-
return;
|
|
544
|
-
case "manual": break;
|
|
545
|
-
case "follow": {
|
|
546
|
-
if (s === null) break;
|
|
547
|
-
if (a.counter >= a.follow) {
|
|
548
|
-
r(new p(`maximum redirect reached at: ${a.url}`, "max-redirect")), h();
|
|
549
|
-
return;
|
|
550
|
-
}
|
|
551
|
-
let o = {
|
|
552
|
-
headers: new P(a.headers),
|
|
553
|
-
follow: a.follow,
|
|
554
|
-
counter: a.counter + 1,
|
|
555
|
-
agent: a.agent,
|
|
556
|
-
compress: a.compress,
|
|
557
|
-
method: a.method,
|
|
558
|
-
body: E(a),
|
|
559
|
-
signal: a.signal,
|
|
560
|
-
size: a.size,
|
|
561
|
-
referrer: a.referrer,
|
|
562
|
-
referrerPolicy: a.referrerPolicy
|
|
563
|
-
};
|
|
564
|
-
if (!v(a.url, s) || !te(a.url, s)) for (let e of [
|
|
565
|
-
"authorization",
|
|
566
|
-
"www-authenticate",
|
|
567
|
-
"cookie",
|
|
568
|
-
"cookie2"
|
|
569
|
-
]) o.headers.delete(e);
|
|
570
|
-
if (e.statusCode !== 303 && a.body && t.body instanceof Q.default.Readable) {
|
|
571
|
-
r(new p("Cannot follow redirect with body being a readable stream", "unsupported-redirect")), h();
|
|
572
|
-
return;
|
|
573
|
-
}
|
|
574
|
-
(e.statusCode === 303 || (e.statusCode === 301 || e.statusCode === 302) && a.method === "POST") && (o.method = "GET", o.body = void 0, o.headers.delete("content-length"));
|
|
575
|
-
let c = fe(i);
|
|
576
|
-
c && (o.referrerPolicy = c), n(ye(new X(s, o))), h();
|
|
577
|
-
return;
|
|
578
|
-
}
|
|
579
|
-
default: return r(/* @__PURE__ */ TypeError(`Redirect option '${a.redirect}' is not a valid value of RequestRedirect`));
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
l && e.once("end", () => {
|
|
583
|
-
l.removeEventListener("abort", f);
|
|
584
|
-
});
|
|
585
|
-
let o = (0, Q.pipeline)(e, new Q.PassThrough(), (e) => {
|
|
586
|
-
e && r(e);
|
|
587
|
-
});
|
|
588
|
-
/* c8 ignore next 3 */
|
|
589
|
-
process.version < "v12.10" && e.on("aborted", f);
|
|
590
|
-
let s = {
|
|
591
|
-
url: a.url,
|
|
592
|
-
status: e.statusCode,
|
|
593
|
-
statusText: e.statusMessage,
|
|
594
|
-
headers: i,
|
|
595
|
-
size: a.size,
|
|
596
|
-
counter: a.counter,
|
|
597
|
-
highWaterMark: a.highWaterMark
|
|
598
|
-
}, c = i.get("Content-Encoding");
|
|
599
|
-
if (!a.compress || a.method === "HEAD" || c === null || e.statusCode === 204 || e.statusCode === 304) {
|
|
600
|
-
u = new z(o, s), n(u);
|
|
601
|
-
return;
|
|
602
|
-
}
|
|
603
|
-
let d = {
|
|
604
|
-
flush: Z.default.Z_SYNC_FLUSH,
|
|
605
|
-
finishFlush: Z.default.Z_SYNC_FLUSH
|
|
606
|
-
};
|
|
607
|
-
if (c === "gzip" || c === "x-gzip") {
|
|
608
|
-
o = (0, Q.pipeline)(o, Z.default.createGunzip(d), (e) => {
|
|
609
|
-
e && r(e);
|
|
610
|
-
}), u = new z(o, s), n(u);
|
|
611
|
-
return;
|
|
612
|
-
}
|
|
613
|
-
if (c === "deflate" || c === "x-deflate") {
|
|
614
|
-
let t = (0, Q.pipeline)(e, new Q.PassThrough(), (e) => {
|
|
615
|
-
e && r(e);
|
|
616
|
-
});
|
|
617
|
-
t.once("data", (e) => {
|
|
618
|
-
o = (e[0] & 15) == 8 ? (0, Q.pipeline)(o, Z.default.createInflate(), (e) => {
|
|
619
|
-
e && r(e);
|
|
620
|
-
}) : (0, Q.pipeline)(o, Z.default.createInflateRaw(), (e) => {
|
|
621
|
-
e && r(e);
|
|
622
|
-
}), u = new z(o, s), n(u);
|
|
623
|
-
}), t.once("end", () => {
|
|
624
|
-
u || (u = new z(o, s), n(u));
|
|
625
|
-
});
|
|
626
|
-
return;
|
|
627
|
-
}
|
|
628
|
-
if (c === "br") {
|
|
629
|
-
o = (0, Q.pipeline)(o, Z.default.createBrotliDecompress(), (e) => {
|
|
630
|
-
e && r(e);
|
|
631
|
-
}), u = new z(o, s), n(u);
|
|
632
|
-
return;
|
|
633
|
-
}
|
|
634
|
-
u = new z(o, s), n(u);
|
|
635
|
-
}), ie(m, a).catch(r);
|
|
636
|
-
});
|
|
637
|
-
}
|
|
638
|
-
function be(e, t) {
|
|
639
|
-
let n = $.Buffer.from("0\r\n\r\n"), r = !1, i = !1, a;
|
|
640
|
-
e.on("response", (e) => {
|
|
641
|
-
let { headers: t } = e;
|
|
642
|
-
r = t["transfer-encoding"] === "chunked" && !t["content-length"];
|
|
643
|
-
}), e.on("socket", (o) => {
|
|
644
|
-
let s = () => {
|
|
645
|
-
if (r && !i) {
|
|
646
|
-
let e = /* @__PURE__ */ Error("Premature close");
|
|
647
|
-
e.code = "ERR_STREAM_PREMATURE_CLOSE", t(e);
|
|
648
|
-
}
|
|
649
|
-
}, c = (e) => {
|
|
650
|
-
i = $.Buffer.compare(e.slice(-5), n) === 0, !i && a && (i = $.Buffer.compare(a.slice(-3), n.slice(0, 3)) === 0 && $.Buffer.compare(e.slice(-2), n.slice(3)) === 0), a = e;
|
|
651
|
-
};
|
|
652
|
-
o.prependListener("close", s), o.on("data", c), e.on("close", () => {
|
|
653
|
-
o.removeListener("close", s), o.removeListener("data", c);
|
|
654
|
-
});
|
|
655
|
-
});
|
|
656
|
-
}
|
|
657
|
-
var xe, Se, Z, Q, $, Ce;
|
|
658
|
-
//#endregion
|
|
659
|
-
e((() => {
|
|
660
|
-
xe = /* @__PURE__ */ t(n(), 1), Se = /* @__PURE__ */ t(n(), 1), Z = /* @__PURE__ */ t(n(), 1), Q = /* @__PURE__ */ t(n(), 1), $ = /* @__PURE__ */ t(n(), 1), r(), k(), se(), F(), ge(), m(), ve(), oe(), a(), y(), K(), u(), Ce = new Set([
|
|
661
|
-
"data:",
|
|
662
|
-
"http:",
|
|
663
|
-
"https:"
|
|
664
|
-
]);
|
|
665
|
-
}))();
|
|
666
|
-
export { ye as default };
|