@rg-dev/stdlib 1.0.41 → 1.0.43
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/lib/browser-env.cjs +3 -2
- package/lib/browser-env.js +3 -2
- package/lib/common-env.cjs +18 -3
- package/lib/common-env.js +21 -3
- package/lib/index.d.cts +4 -2
- package/lib/index.d.ts +4 -2
- package/lib/node-download.cjs +258 -130
- package/lib/node-download.js +258 -130
- package/lib/node-env.cjs +30 -12
- package/lib/node-env.d.cts +3 -1
- package/lib/node-env.d.ts +3 -1
- package/lib/node-env.js +30 -12
- package/package.json +2 -2
- package/lib/index.cjs +0 -0
- package/lib/index.js +0 -0
package/lib/node-download.cjs
CHANGED
|
@@ -1,9 +1,30 @@
|
|
|
1
1
|
var __create = Object.create;
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
8
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
|
|
12
|
+
var __typeError = (msg) => {
|
|
13
|
+
throw TypeError(msg);
|
|
14
|
+
};
|
|
15
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
16
|
+
var __spreadValues = (a, b) => {
|
|
17
|
+
for (var prop in b || (b = {}))
|
|
18
|
+
if (__hasOwnProp.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
|
+
if (__getOwnPropSymbols)
|
|
21
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
22
|
+
if (__propIsEnum.call(b, prop))
|
|
23
|
+
__defNormalProp(a, prop, b[prop]);
|
|
24
|
+
}
|
|
25
|
+
return a;
|
|
26
|
+
};
|
|
27
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
7
28
|
var __esm = (fn, res) => function __init() {
|
|
8
29
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
9
30
|
};
|
|
@@ -31,6 +52,54 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
31
52
|
mod
|
|
32
53
|
));
|
|
33
54
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
55
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
56
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
57
|
+
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
58
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
59
|
+
var __await = function(promise, isYieldStar) {
|
|
60
|
+
this[0] = promise;
|
|
61
|
+
this[1] = isYieldStar;
|
|
62
|
+
};
|
|
63
|
+
var __asyncGenerator = (__this, __arguments, generator) => {
|
|
64
|
+
var resume = (k, v, yes, no) => {
|
|
65
|
+
try {
|
|
66
|
+
var x2 = generator[k](v), isAwait = (v = x2.value) instanceof __await, done = x2.done;
|
|
67
|
+
Promise.resolve(isAwait ? v[0] : v).then((y) => isAwait ? resume(k === "return" ? k : "next", v[1] ? { done: y.done, value: y.value } : y, yes, no) : yes({ value: y, done })).catch((e2) => resume("throw", e2, yes, no));
|
|
68
|
+
} catch (e2) {
|
|
69
|
+
no(e2);
|
|
70
|
+
}
|
|
71
|
+
}, method = (k) => it[k] = (x2) => new Promise((yes, no) => resume(k, x2, yes, no)), it = {};
|
|
72
|
+
return generator = generator.apply(__this, __arguments), it[__knownSymbol("asyncIterator")] = () => it, method("next"), method("throw"), method("return"), it;
|
|
73
|
+
};
|
|
74
|
+
var __yieldStar = (value) => {
|
|
75
|
+
var obj = value[__knownSymbol("asyncIterator")], isAwait = false, method, it = {};
|
|
76
|
+
if (obj == null) {
|
|
77
|
+
obj = value[__knownSymbol("iterator")]();
|
|
78
|
+
method = (k) => it[k] = (x2) => obj[k](x2);
|
|
79
|
+
} else {
|
|
80
|
+
obj = obj.call(value);
|
|
81
|
+
method = (k) => it[k] = (v) => {
|
|
82
|
+
if (isAwait) {
|
|
83
|
+
isAwait = false;
|
|
84
|
+
if (k === "throw") throw v;
|
|
85
|
+
return v;
|
|
86
|
+
}
|
|
87
|
+
isAwait = true;
|
|
88
|
+
return {
|
|
89
|
+
done: false,
|
|
90
|
+
value: new __await(new Promise((resolve) => {
|
|
91
|
+
var x2 = obj[k](v);
|
|
92
|
+
if (!(x2 instanceof Object)) __typeError("Object expected");
|
|
93
|
+
resolve(x2);
|
|
94
|
+
}), 1)
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
return it[__knownSymbol("iterator")] = () => it, method("next"), "throw" in obj ? method("throw") : it.throw = (x2) => {
|
|
99
|
+
throw x2;
|
|
100
|
+
}, "return" in obj && method("return"), it;
|
|
101
|
+
};
|
|
102
|
+
var __forAwait = (obj, it, method) => (it = obj[__knownSymbol("asyncIterator")]) ? it.call(obj) : (obj = obj[__knownSymbol("iterator")](), it = {}, method = (key, fn) => (fn = obj[key]) && (it[key] = (arg) => new Promise((yes, no, done) => (arg = fn.call(obj, arg), done = arg.done, Promise.resolve(arg.value).then((value) => yes({ value, done }), no)))), method("next"), method("return"), it);
|
|
34
103
|
|
|
35
104
|
// node_modules/data-uri-to-buffer/dist/index.js
|
|
36
105
|
function dataUriToBuffer(uri) {
|
|
@@ -520,7 +589,9 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
520
589
|
function defaultReaderBrandCheckException(name) {
|
|
521
590
|
return new TypeError(`ReadableStreamDefaultReader.prototype.${name} can only be used on a ReadableStreamDefaultReader`);
|
|
522
591
|
}
|
|
523
|
-
const AsyncIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf(
|
|
592
|
+
const AsyncIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf(function() {
|
|
593
|
+
return __asyncGenerator(this, null, function* () {
|
|
594
|
+
});
|
|
524
595
|
}).prototype);
|
|
525
596
|
class ReadableStreamAsyncIteratorImpl {
|
|
526
597
|
constructor(reader, preventCancel) {
|
|
@@ -624,7 +695,7 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
624
695
|
}
|
|
625
696
|
try {
|
|
626
697
|
return x2._asyncIteratorImpl instanceof ReadableStreamAsyncIteratorImpl;
|
|
627
|
-
} catch (
|
|
698
|
+
} catch (_a4) {
|
|
628
699
|
return false;
|
|
629
700
|
}
|
|
630
701
|
}
|
|
@@ -1517,7 +1588,7 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
1517
1588
|
}
|
|
1518
1589
|
try {
|
|
1519
1590
|
return typeof value.aborted === "boolean";
|
|
1520
|
-
} catch (
|
|
1591
|
+
} catch (_a4) {
|
|
1521
1592
|
return false;
|
|
1522
1593
|
}
|
|
1523
1594
|
}
|
|
@@ -1658,12 +1729,12 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
1658
1729
|
return true;
|
|
1659
1730
|
}
|
|
1660
1731
|
function WritableStreamAbort(stream, reason) {
|
|
1661
|
-
var
|
|
1732
|
+
var _a4;
|
|
1662
1733
|
if (stream._state === "closed" || stream._state === "errored") {
|
|
1663
1734
|
return promiseResolvedWith(void 0);
|
|
1664
1735
|
}
|
|
1665
1736
|
stream._writableStreamController._abortReason = reason;
|
|
1666
|
-
(
|
|
1737
|
+
(_a4 = stream._writableStreamController._abortController) === null || _a4 === void 0 ? void 0 : _a4.abort();
|
|
1667
1738
|
const state = stream._state;
|
|
1668
1739
|
if (state === "closed" || state === "errored") {
|
|
1669
1740
|
return promiseResolvedWith(void 0);
|
|
@@ -2393,7 +2464,7 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
2393
2464
|
try {
|
|
2394
2465
|
new ctor();
|
|
2395
2466
|
return true;
|
|
2396
|
-
} catch (
|
|
2467
|
+
} catch (_a4) {
|
|
2397
2468
|
return false;
|
|
2398
2469
|
}
|
|
2399
2470
|
}
|
|
@@ -3449,7 +3520,7 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
3449
3520
|
value: "size",
|
|
3450
3521
|
configurable: true
|
|
3451
3522
|
});
|
|
3452
|
-
} catch (
|
|
3523
|
+
} catch (_a4) {
|
|
3453
3524
|
}
|
|
3454
3525
|
class ByteLengthQueuingStrategy {
|
|
3455
3526
|
constructor(options) {
|
|
@@ -3506,7 +3577,7 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
3506
3577
|
value: "size",
|
|
3507
3578
|
configurable: true
|
|
3508
3579
|
});
|
|
3509
|
-
} catch (
|
|
3580
|
+
} catch (_a4) {
|
|
3510
3581
|
}
|
|
3511
3582
|
class CountQueuingStrategy {
|
|
3512
3583
|
constructor(options) {
|
|
@@ -3908,9 +3979,9 @@ var require_streams = __commonJS({
|
|
|
3908
3979
|
}
|
|
3909
3980
|
}
|
|
3910
3981
|
try {
|
|
3911
|
-
const { Blob:
|
|
3912
|
-
if (
|
|
3913
|
-
|
|
3982
|
+
const { Blob: Blob2 } = require("buffer");
|
|
3983
|
+
if (Blob2 && !Blob2.prototype.stream) {
|
|
3984
|
+
Blob2.prototype.stream = function name(params) {
|
|
3914
3985
|
let position = 0;
|
|
3915
3986
|
const blob = this;
|
|
3916
3987
|
return new ReadableStream({
|
|
@@ -3933,51 +4004,48 @@ var require_streams = __commonJS({
|
|
|
3933
4004
|
});
|
|
3934
4005
|
|
|
3935
4006
|
// node_modules/fetch-blob/index.js
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
if (
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
4007
|
+
function toIterator(parts, clone2 = true) {
|
|
4008
|
+
return __asyncGenerator(this, null, function* () {
|
|
4009
|
+
for (const part of parts) {
|
|
4010
|
+
if ("stream" in part) {
|
|
4011
|
+
yield* __yieldStar(
|
|
4012
|
+
/** @type {AsyncIterableIterator<Uint8Array>} */
|
|
4013
|
+
part.stream()
|
|
4014
|
+
);
|
|
4015
|
+
} else if (ArrayBuffer.isView(part)) {
|
|
4016
|
+
if (clone2) {
|
|
4017
|
+
let position = part.byteOffset;
|
|
4018
|
+
const end = part.byteOffset + part.byteLength;
|
|
4019
|
+
while (position !== end) {
|
|
4020
|
+
const size = Math.min(end - position, POOL_SIZE);
|
|
4021
|
+
const chunk = part.buffer.slice(position, position + size);
|
|
4022
|
+
position += chunk.byteLength;
|
|
4023
|
+
yield new Uint8Array(chunk);
|
|
4024
|
+
}
|
|
4025
|
+
} else {
|
|
4026
|
+
yield part;
|
|
3952
4027
|
}
|
|
3953
4028
|
} else {
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
position += buffer.byteLength;
|
|
3965
|
-
yield new Uint8Array(buffer);
|
|
4029
|
+
let position = 0, b = (
|
|
4030
|
+
/** @type {Blob} */
|
|
4031
|
+
part
|
|
4032
|
+
);
|
|
4033
|
+
while (position !== b.size) {
|
|
4034
|
+
const chunk = b.slice(position, Math.min(b.size, position + POOL_SIZE));
|
|
4035
|
+
const buffer = yield new __await(chunk.arrayBuffer());
|
|
4036
|
+
position += buffer.byteLength;
|
|
4037
|
+
yield new Uint8Array(buffer);
|
|
4038
|
+
}
|
|
3966
4039
|
}
|
|
3967
4040
|
}
|
|
3968
|
-
}
|
|
4041
|
+
});
|
|
3969
4042
|
}
|
|
3970
|
-
var import_streams, POOL_SIZE, _Blob,
|
|
4043
|
+
var import_streams, POOL_SIZE, _parts, _type, _size, _endings, _a, _Blob, Blob, fetch_blob_default;
|
|
3971
4044
|
var init_fetch_blob = __esm({
|
|
3972
4045
|
"node_modules/fetch-blob/index.js"() {
|
|
3973
4046
|
import_streams = __toESM(require_streams(), 1);
|
|
3974
4047
|
POOL_SIZE = 65536;
|
|
3975
|
-
_Blob = class
|
|
3976
|
-
/** @type {Array.<(Blob|Uint8Array)>} */
|
|
3977
|
-
#parts = [];
|
|
3978
|
-
#type = "";
|
|
3979
|
-
#size = 0;
|
|
3980
|
-
#endings = "transparent";
|
|
4048
|
+
_Blob = (_a = class {
|
|
3981
4049
|
/**
|
|
3982
4050
|
* The Blob() constructor returns a new Blob object. The content
|
|
3983
4051
|
* of the blob consists of the concatenation of the values given
|
|
@@ -3987,6 +4055,11 @@ var init_fetch_blob = __esm({
|
|
|
3987
4055
|
* @param {{ type?: string, endings?: string }} [options]
|
|
3988
4056
|
*/
|
|
3989
4057
|
constructor(blobParts = [], options = {}) {
|
|
4058
|
+
/** @type {Array.<(Blob|Uint8Array)>} */
|
|
4059
|
+
__privateAdd(this, _parts, []);
|
|
4060
|
+
__privateAdd(this, _type, "");
|
|
4061
|
+
__privateAdd(this, _size, 0);
|
|
4062
|
+
__privateAdd(this, _endings, "transparent");
|
|
3990
4063
|
if (typeof blobParts !== "object" || blobParts === null) {
|
|
3991
4064
|
throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");
|
|
3992
4065
|
}
|
|
@@ -4004,30 +4077,30 @@ var init_fetch_blob = __esm({
|
|
|
4004
4077
|
part = new Uint8Array(element.buffer.slice(element.byteOffset, element.byteOffset + element.byteLength));
|
|
4005
4078
|
} else if (element instanceof ArrayBuffer) {
|
|
4006
4079
|
part = new Uint8Array(element.slice(0));
|
|
4007
|
-
} else if (element instanceof
|
|
4080
|
+
} else if (element instanceof _a) {
|
|
4008
4081
|
part = element;
|
|
4009
4082
|
} else {
|
|
4010
4083
|
part = encoder.encode(`${element}`);
|
|
4011
4084
|
}
|
|
4012
|
-
this
|
|
4013
|
-
this
|
|
4085
|
+
__privateSet(this, _size, __privateGet(this, _size) + (ArrayBuffer.isView(part) ? part.byteLength : part.size));
|
|
4086
|
+
__privateGet(this, _parts).push(part);
|
|
4014
4087
|
}
|
|
4015
|
-
this
|
|
4088
|
+
__privateSet(this, _endings, `${options.endings === void 0 ? "transparent" : options.endings}`);
|
|
4016
4089
|
const type = options.type === void 0 ? "" : String(options.type);
|
|
4017
|
-
this
|
|
4090
|
+
__privateSet(this, _type, /^[\x20-\x7E]*$/.test(type) ? type : "");
|
|
4018
4091
|
}
|
|
4019
4092
|
/**
|
|
4020
4093
|
* The Blob interface's size property returns the
|
|
4021
4094
|
* size of the Blob in bytes.
|
|
4022
4095
|
*/
|
|
4023
4096
|
get size() {
|
|
4024
|
-
return this
|
|
4097
|
+
return __privateGet(this, _size);
|
|
4025
4098
|
}
|
|
4026
4099
|
/**
|
|
4027
4100
|
* The type property of a Blob object returns the MIME type of the file.
|
|
4028
4101
|
*/
|
|
4029
4102
|
get type() {
|
|
4030
|
-
return this
|
|
4103
|
+
return __privateGet(this, _type);
|
|
4031
4104
|
}
|
|
4032
4105
|
/**
|
|
4033
4106
|
* The text() method in the Blob interface returns a Promise
|
|
@@ -4039,8 +4112,20 @@ var init_fetch_blob = __esm({
|
|
|
4039
4112
|
async text() {
|
|
4040
4113
|
const decoder = new TextDecoder();
|
|
4041
4114
|
let str = "";
|
|
4042
|
-
|
|
4043
|
-
|
|
4115
|
+
try {
|
|
4116
|
+
for (var iter = __forAwait(toIterator(__privateGet(this, _parts), false)), more, temp, error; more = !(temp = await iter.next()).done; more = false) {
|
|
4117
|
+
const part = temp.value;
|
|
4118
|
+
str += decoder.decode(part, { stream: true });
|
|
4119
|
+
}
|
|
4120
|
+
} catch (temp) {
|
|
4121
|
+
error = [temp];
|
|
4122
|
+
} finally {
|
|
4123
|
+
try {
|
|
4124
|
+
more && (temp = iter.return) && await temp.call(iter);
|
|
4125
|
+
} finally {
|
|
4126
|
+
if (error)
|
|
4127
|
+
throw error[0];
|
|
4128
|
+
}
|
|
4044
4129
|
}
|
|
4045
4130
|
str += decoder.decode();
|
|
4046
4131
|
return str;
|
|
@@ -4055,14 +4140,26 @@ var init_fetch_blob = __esm({
|
|
|
4055
4140
|
async arrayBuffer() {
|
|
4056
4141
|
const data = new Uint8Array(this.size);
|
|
4057
4142
|
let offset = 0;
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4143
|
+
try {
|
|
4144
|
+
for (var iter = __forAwait(toIterator(__privateGet(this, _parts), false)), more, temp, error; more = !(temp = await iter.next()).done; more = false) {
|
|
4145
|
+
const chunk = temp.value;
|
|
4146
|
+
data.set(chunk, offset);
|
|
4147
|
+
offset += chunk.length;
|
|
4148
|
+
}
|
|
4149
|
+
} catch (temp) {
|
|
4150
|
+
error = [temp];
|
|
4151
|
+
} finally {
|
|
4152
|
+
try {
|
|
4153
|
+
more && (temp = iter.return) && await temp.call(iter);
|
|
4154
|
+
} finally {
|
|
4155
|
+
if (error)
|
|
4156
|
+
throw error[0];
|
|
4157
|
+
}
|
|
4061
4158
|
}
|
|
4062
4159
|
return data.buffer;
|
|
4063
4160
|
}
|
|
4064
4161
|
stream() {
|
|
4065
|
-
const it = toIterator(this
|
|
4162
|
+
const it = toIterator(__privateGet(this, _parts), true);
|
|
4066
4163
|
return new globalThis.ReadableStream({
|
|
4067
4164
|
// @ts-ignore
|
|
4068
4165
|
type: "bytes",
|
|
@@ -4089,7 +4186,7 @@ var init_fetch_blob = __esm({
|
|
|
4089
4186
|
let relativeStart = start < 0 ? Math.max(size + start, 0) : Math.min(start, size);
|
|
4090
4187
|
let relativeEnd = end < 0 ? Math.max(size + end, 0) : Math.min(end, size);
|
|
4091
4188
|
const span = Math.max(relativeEnd - relativeStart, 0);
|
|
4092
|
-
const parts = this
|
|
4189
|
+
const parts = __privateGet(this, _parts);
|
|
4093
4190
|
const blobParts = [];
|
|
4094
4191
|
let added = 0;
|
|
4095
4192
|
for (const part of parts) {
|
|
@@ -4114,9 +4211,9 @@ var init_fetch_blob = __esm({
|
|
|
4114
4211
|
relativeStart = 0;
|
|
4115
4212
|
}
|
|
4116
4213
|
}
|
|
4117
|
-
const blob = new
|
|
4118
|
-
blob
|
|
4119
|
-
blob
|
|
4214
|
+
const blob = new _a([], { type: String(type).toLowerCase() });
|
|
4215
|
+
__privateSet(blob, _size, span);
|
|
4216
|
+
__privateSet(blob, _parts, blobParts);
|
|
4120
4217
|
return blob;
|
|
4121
4218
|
}
|
|
4122
4219
|
get [Symbol.toStringTag]() {
|
|
@@ -4125,25 +4222,23 @@ var init_fetch_blob = __esm({
|
|
|
4125
4222
|
static [Symbol.hasInstance](object) {
|
|
4126
4223
|
return object && typeof object === "object" && typeof object.constructor === "function" && (typeof object.stream === "function" || typeof object.arrayBuffer === "function") && /^(Blob|File)$/.test(object[Symbol.toStringTag]);
|
|
4127
4224
|
}
|
|
4128
|
-
};
|
|
4225
|
+
}, _parts = new WeakMap(), _type = new WeakMap(), _size = new WeakMap(), _endings = new WeakMap(), _a);
|
|
4129
4226
|
Object.defineProperties(_Blob.prototype, {
|
|
4130
4227
|
size: { enumerable: true },
|
|
4131
4228
|
type: { enumerable: true },
|
|
4132
4229
|
slice: { enumerable: true }
|
|
4133
4230
|
});
|
|
4134
|
-
|
|
4135
|
-
fetch_blob_default =
|
|
4231
|
+
Blob = _Blob;
|
|
4232
|
+
fetch_blob_default = Blob;
|
|
4136
4233
|
}
|
|
4137
4234
|
});
|
|
4138
4235
|
|
|
4139
4236
|
// node_modules/fetch-blob/file.js
|
|
4140
|
-
var _File,
|
|
4237
|
+
var _lastModified, _name, _a2, _File, File, file_default;
|
|
4141
4238
|
var init_file = __esm({
|
|
4142
4239
|
"node_modules/fetch-blob/file.js"() {
|
|
4143
4240
|
init_fetch_blob();
|
|
4144
|
-
_File = class
|
|
4145
|
-
#lastModified = 0;
|
|
4146
|
-
#name = "";
|
|
4241
|
+
_File = (_a2 = class extends fetch_blob_default {
|
|
4147
4242
|
/**
|
|
4148
4243
|
* @param {*[]} fileBits
|
|
4149
4244
|
* @param {string} fileName
|
|
@@ -4155,18 +4250,20 @@ var init_file = __esm({
|
|
|
4155
4250
|
throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);
|
|
4156
4251
|
}
|
|
4157
4252
|
super(fileBits, options);
|
|
4253
|
+
__privateAdd(this, _lastModified, 0);
|
|
4254
|
+
__privateAdd(this, _name, "");
|
|
4158
4255
|
if (options === null) options = {};
|
|
4159
4256
|
const lastModified = options.lastModified === void 0 ? Date.now() : Number(options.lastModified);
|
|
4160
4257
|
if (!Number.isNaN(lastModified)) {
|
|
4161
|
-
this
|
|
4258
|
+
__privateSet(this, _lastModified, lastModified);
|
|
4162
4259
|
}
|
|
4163
|
-
this
|
|
4260
|
+
__privateSet(this, _name, String(fileName));
|
|
4164
4261
|
}
|
|
4165
4262
|
get name() {
|
|
4166
|
-
return this
|
|
4263
|
+
return __privateGet(this, _name);
|
|
4167
4264
|
}
|
|
4168
4265
|
get lastModified() {
|
|
4169
|
-
return this
|
|
4266
|
+
return __privateGet(this, _lastModified);
|
|
4170
4267
|
}
|
|
4171
4268
|
get [Symbol.toStringTag]() {
|
|
4172
4269
|
return "File";
|
|
@@ -4174,9 +4271,9 @@ var init_file = __esm({
|
|
|
4174
4271
|
static [Symbol.hasInstance](object) {
|
|
4175
4272
|
return !!object && object instanceof fetch_blob_default && /^(File)$/.test(object[Symbol.toStringTag]);
|
|
4176
4273
|
}
|
|
4177
|
-
};
|
|
4178
|
-
|
|
4179
|
-
file_default =
|
|
4274
|
+
}, _lastModified = new WeakMap(), _name = new WeakMap(), _a2);
|
|
4275
|
+
File = _File;
|
|
4276
|
+
file_default = File;
|
|
4180
4277
|
}
|
|
4181
4278
|
});
|
|
4182
4279
|
|
|
@@ -4186,7 +4283,7 @@ function formDataToBlob(F2, B = fetch_blob_default) {
|
|
|
4186
4283
|
Content-Disposition: form-data; name="`;
|
|
4187
4284
|
F2.forEach((v, n) => typeof v == "string" ? c.push(p + e(n) + `"\r
|
|
4188
4285
|
\r
|
|
4189
|
-
${v.replace(
|
|
4286
|
+
${v.replace(new RegExp("\\r(?!\\n)|(?<!\\r)\\n", "g"), "\r\n")}\r
|
|
4190
4287
|
`) : c.push(p + e(n) + `"; filename="${e(v.name, 1)}"\r
|
|
4191
4288
|
Content-Type: ${v.type || "application/octet-stream"}\r
|
|
4192
4289
|
\r
|
|
@@ -4194,7 +4291,7 @@ Content-Type: ${v.type || "application/octet-stream"}\r
|
|
|
4194
4291
|
c.push(`--${b}--`);
|
|
4195
4292
|
return new B(c, { type: "multipart/form-data; boundary=" + b });
|
|
4196
4293
|
}
|
|
4197
|
-
var t, i, h, r, m, f, e, x, FormData;
|
|
4294
|
+
var t, i, h, r, m, f, e, x, _d, _a3, FormData;
|
|
4198
4295
|
var init_esm_min = __esm({
|
|
4199
4296
|
"node_modules/formdata-polyfill/esm.min.js"() {
|
|
4200
4297
|
init_fetch_blob();
|
|
@@ -4209,9 +4306,9 @@ var init_esm_min = __esm({
|
|
|
4209
4306
|
throw new TypeError(`Failed to execute '${n}' on 'FormData': ${e2} arguments required, but only ${a.length} present.`);
|
|
4210
4307
|
}
|
|
4211
4308
|
};
|
|
4212
|
-
FormData = class
|
|
4213
|
-
#d = [];
|
|
4309
|
+
FormData = (_a3 = class {
|
|
4214
4310
|
constructor(...a) {
|
|
4311
|
+
__privateAdd(this, _d, []);
|
|
4215
4312
|
if (a.length) throw new TypeError(`Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.`);
|
|
4216
4313
|
}
|
|
4217
4314
|
get [t]() {
|
|
@@ -4225,30 +4322,30 @@ var init_esm_min = __esm({
|
|
|
4225
4322
|
}
|
|
4226
4323
|
append(...a) {
|
|
4227
4324
|
x("append", arguments, 2);
|
|
4228
|
-
this
|
|
4325
|
+
__privateGet(this, _d).push(f(...a));
|
|
4229
4326
|
}
|
|
4230
4327
|
delete(a) {
|
|
4231
4328
|
x("delete", arguments, 1);
|
|
4232
4329
|
a += "";
|
|
4233
|
-
this
|
|
4330
|
+
__privateSet(this, _d, __privateGet(this, _d).filter(([b]) => b !== a));
|
|
4234
4331
|
}
|
|
4235
4332
|
get(a) {
|
|
4236
4333
|
x("get", arguments, 1);
|
|
4237
4334
|
a += "";
|
|
4238
|
-
for (var b = this
|
|
4335
|
+
for (var b = __privateGet(this, _d), l = b.length, c = 0; c < l; c++) if (b[c][0] === a) return b[c][1];
|
|
4239
4336
|
return null;
|
|
4240
4337
|
}
|
|
4241
4338
|
getAll(a, b) {
|
|
4242
4339
|
x("getAll", arguments, 1);
|
|
4243
4340
|
b = [];
|
|
4244
4341
|
a += "";
|
|
4245
|
-
this
|
|
4342
|
+
__privateGet(this, _d).forEach((c) => c[0] === a && b.push(c[1]));
|
|
4246
4343
|
return b;
|
|
4247
4344
|
}
|
|
4248
4345
|
has(a) {
|
|
4249
4346
|
x("has", arguments, 1);
|
|
4250
4347
|
a += "";
|
|
4251
|
-
return this
|
|
4348
|
+
return __privateGet(this, _d).some((b) => b[0] === a);
|
|
4252
4349
|
}
|
|
4253
4350
|
forEach(a, b) {
|
|
4254
4351
|
x("forEach", arguments, 1);
|
|
@@ -4258,14 +4355,14 @@ var init_esm_min = __esm({
|
|
|
4258
4355
|
x("set", arguments, 2);
|
|
4259
4356
|
var b = [], c = true;
|
|
4260
4357
|
a = f(...a);
|
|
4261
|
-
this
|
|
4358
|
+
__privateGet(this, _d).forEach((d) => {
|
|
4262
4359
|
d[0] === a[0] ? c && (c = !b.push(a)) : b.push(d);
|
|
4263
4360
|
});
|
|
4264
4361
|
c && b.push(a);
|
|
4265
|
-
this
|
|
4362
|
+
__privateSet(this, _d, b);
|
|
4266
4363
|
}
|
|
4267
4364
|
*entries() {
|
|
4268
|
-
yield* this
|
|
4365
|
+
yield* __yieldStar(__privateGet(this, _d));
|
|
4269
4366
|
}
|
|
4270
4367
|
*keys() {
|
|
4271
4368
|
for (var [a] of this) yield a;
|
|
@@ -4273,7 +4370,7 @@ var init_esm_min = __esm({
|
|
|
4273
4370
|
*values() {
|
|
4274
4371
|
for (var [, a] of this) yield a;
|
|
4275
4372
|
}
|
|
4276
|
-
};
|
|
4373
|
+
}, _d = new WeakMap(), _a3);
|
|
4277
4374
|
}
|
|
4278
4375
|
});
|
|
4279
4376
|
|
|
@@ -4362,7 +4459,7 @@ var require_node_domexception = __commonJS({
|
|
|
4362
4459
|
});
|
|
4363
4460
|
|
|
4364
4461
|
// node_modules/fetch-blob/from.js
|
|
4365
|
-
var import_node_fs, import_node_path, import_node_domexception, stat, blobFromSync, blobFrom, fileFrom, fileFromSync, fromBlob, fromFile, BlobDataItem;
|
|
4462
|
+
var import_node_fs, import_node_path, import_node_domexception, stat, blobFromSync, blobFrom, fileFrom, fileFromSync, fromBlob, fromFile, _path, _start, _BlobDataItem, BlobDataItem;
|
|
4366
4463
|
var init_from = __esm({
|
|
4367
4464
|
"node_modules/fetch-blob/from.js"() {
|
|
4368
4465
|
import_node_fs = require("fs");
|
|
@@ -4387,12 +4484,12 @@ var init_from = __esm({
|
|
|
4387
4484
|
lastModified: stat2.mtimeMs,
|
|
4388
4485
|
start: 0
|
|
4389
4486
|
})], (0, import_node_path.basename)(path), { type, lastModified: stat2.mtimeMs });
|
|
4390
|
-
|
|
4391
|
-
#path;
|
|
4392
|
-
#start;
|
|
4487
|
+
_BlobDataItem = class _BlobDataItem {
|
|
4393
4488
|
constructor(options) {
|
|
4394
|
-
this
|
|
4395
|
-
this
|
|
4489
|
+
__privateAdd(this, _path);
|
|
4490
|
+
__privateAdd(this, _start);
|
|
4491
|
+
__privateSet(this, _path, options.path);
|
|
4492
|
+
__privateSet(this, _start, options.start);
|
|
4396
4493
|
this.size = options.size;
|
|
4397
4494
|
this.lastModified = options.lastModified;
|
|
4398
4495
|
}
|
|
@@ -4402,26 +4499,31 @@ var init_from = __esm({
|
|
|
4402
4499
|
*/
|
|
4403
4500
|
slice(start, end) {
|
|
4404
4501
|
return new _BlobDataItem({
|
|
4405
|
-
path: this
|
|
4502
|
+
path: __privateGet(this, _path),
|
|
4406
4503
|
lastModified: this.lastModified,
|
|
4407
4504
|
size: end - start,
|
|
4408
|
-
start: this
|
|
4505
|
+
start: __privateGet(this, _start) + start
|
|
4409
4506
|
});
|
|
4410
4507
|
}
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4508
|
+
stream() {
|
|
4509
|
+
return __asyncGenerator(this, null, function* () {
|
|
4510
|
+
const { mtimeMs } = yield new __await(stat(__privateGet(this, _path)));
|
|
4511
|
+
if (mtimeMs > this.lastModified) {
|
|
4512
|
+
throw new import_node_domexception.default("The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.", "NotReadableError");
|
|
4513
|
+
}
|
|
4514
|
+
yield* __yieldStar((0, import_node_fs.createReadStream)(__privateGet(this, _path), {
|
|
4515
|
+
start: __privateGet(this, _start),
|
|
4516
|
+
end: __privateGet(this, _start) + this.size - 1
|
|
4517
|
+
}));
|
|
4419
4518
|
});
|
|
4420
4519
|
}
|
|
4421
4520
|
get [Symbol.toStringTag]() {
|
|
4422
4521
|
return "Blob";
|
|
4423
4522
|
}
|
|
4424
4523
|
};
|
|
4524
|
+
_path = new WeakMap();
|
|
4525
|
+
_start = new WeakMap();
|
|
4526
|
+
BlobDataItem = _BlobDataItem;
|
|
4425
4527
|
}
|
|
4426
4528
|
});
|
|
4427
4529
|
|
|
@@ -4511,8 +4613,20 @@ async function toFormData(Body2, ct) {
|
|
|
4511
4613
|
headerValue = "";
|
|
4512
4614
|
headerField = "";
|
|
4513
4615
|
};
|
|
4514
|
-
|
|
4515
|
-
|
|
4616
|
+
try {
|
|
4617
|
+
for (var iter = __forAwait(Body2), more, temp, error; more = !(temp = await iter.next()).done; more = false) {
|
|
4618
|
+
const chunk = temp.value;
|
|
4619
|
+
parser.write(chunk);
|
|
4620
|
+
}
|
|
4621
|
+
} catch (temp) {
|
|
4622
|
+
error = [temp];
|
|
4623
|
+
} finally {
|
|
4624
|
+
try {
|
|
4625
|
+
more && (temp = iter.return) && await temp.call(iter);
|
|
4626
|
+
} finally {
|
|
4627
|
+
if (error)
|
|
4628
|
+
throw error[0];
|
|
4629
|
+
}
|
|
4516
4630
|
}
|
|
4517
4631
|
parser.end();
|
|
4518
4632
|
return formData;
|
|
@@ -4806,17 +4920,29 @@ async function consumeBody(data) {
|
|
|
4806
4920
|
const accum = [];
|
|
4807
4921
|
let accumBytes = 0;
|
|
4808
4922
|
try {
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
const
|
|
4812
|
-
|
|
4813
|
-
|
|
4923
|
+
try {
|
|
4924
|
+
for (var iter = __forAwait(body), more, temp, error; more = !(temp = await iter.next()).done; more = false) {
|
|
4925
|
+
const chunk = temp.value;
|
|
4926
|
+
if (data.size > 0 && accumBytes + chunk.length > data.size) {
|
|
4927
|
+
const error2 = new FetchError(`content size at ${data.url} over limit: ${data.size}`, "max-size");
|
|
4928
|
+
body.destroy(error2);
|
|
4929
|
+
throw error2;
|
|
4930
|
+
}
|
|
4931
|
+
accumBytes += chunk.length;
|
|
4932
|
+
accum.push(chunk);
|
|
4933
|
+
}
|
|
4934
|
+
} catch (temp) {
|
|
4935
|
+
error = [temp];
|
|
4936
|
+
} finally {
|
|
4937
|
+
try {
|
|
4938
|
+
more && (temp = iter.return) && await temp.call(iter);
|
|
4939
|
+
} finally {
|
|
4940
|
+
if (error)
|
|
4941
|
+
throw error[0];
|
|
4814
4942
|
}
|
|
4815
|
-
accumBytes += chunk.length;
|
|
4816
|
-
accum.push(chunk);
|
|
4817
4943
|
}
|
|
4818
|
-
} catch (
|
|
4819
|
-
const error_ =
|
|
4944
|
+
} catch (error2) {
|
|
4945
|
+
const error_ = error2 instanceof FetchBaseError ? error2 : new FetchError(`Invalid response body while trying to fetch ${data.url}: ${error2.message}`, "system", error2);
|
|
4820
4946
|
throw error_;
|
|
4821
4947
|
}
|
|
4822
4948
|
if (body.readableEnded === true || body._readableState.ended === true) {
|
|
@@ -4825,8 +4951,8 @@ async function consumeBody(data) {
|
|
|
4825
4951
|
return import_node_buffer.Buffer.from(accum.join(""));
|
|
4826
4952
|
}
|
|
4827
4953
|
return import_node_buffer.Buffer.concat(accum, accumBytes);
|
|
4828
|
-
} catch (
|
|
4829
|
-
throw new FetchError(`Could not create Buffer from response body for ${data.url}: ${
|
|
4954
|
+
} catch (error2) {
|
|
4955
|
+
throw new FetchError(`Could not create Buffer from response body for ${data.url}: ${error2.message}`, "system", error2);
|
|
4830
4956
|
}
|
|
4831
4957
|
} else {
|
|
4832
4958
|
throw new FetchError(`Premature close of server response while trying to fetch ${data.url}`);
|
|
@@ -5058,7 +5184,7 @@ function fromRawHeaders(headers = []) {
|
|
|
5058
5184
|
validateHeaderName(name);
|
|
5059
5185
|
validateHeaderValue(name, String(value));
|
|
5060
5186
|
return true;
|
|
5061
|
-
} catch {
|
|
5187
|
+
} catch (e2) {
|
|
5062
5188
|
return false;
|
|
5063
5189
|
}
|
|
5064
5190
|
})
|
|
@@ -5351,10 +5477,9 @@ var init_response = __esm({
|
|
|
5351
5477
|
if (!headers.has("content-type")) {
|
|
5352
5478
|
headers.set("content-type", "application/json");
|
|
5353
5479
|
}
|
|
5354
|
-
return new _Response(body, {
|
|
5355
|
-
...init,
|
|
5480
|
+
return new _Response(body, __spreadProps(__spreadValues({}, init), {
|
|
5356
5481
|
headers
|
|
5357
|
-
});
|
|
5482
|
+
}));
|
|
5358
5483
|
}
|
|
5359
5484
|
get [Symbol.toStringTag]() {
|
|
5360
5485
|
return "Response";
|
|
@@ -5846,7 +5971,7 @@ async function fetch2(url, options_) {
|
|
|
5846
5971
|
let locationURL = null;
|
|
5847
5972
|
try {
|
|
5848
5973
|
locationURL = location === null ? null : new URL(location, request.url);
|
|
5849
|
-
} catch {
|
|
5974
|
+
} catch (e2) {
|
|
5850
5975
|
if (request.redirect !== "manual") {
|
|
5851
5976
|
reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, "invalid-redirect"));
|
|
5852
5977
|
finalize();
|
|
@@ -6084,7 +6209,7 @@ function downloadFile(url, destination, headers) {
|
|
|
6084
6209
|
async (resolve, reject) => {
|
|
6085
6210
|
try {
|
|
6086
6211
|
const fetcher = await getFetch();
|
|
6087
|
-
const response = await fetcher(url, { headers: {
|
|
6212
|
+
const response = await fetcher(url, { headers: __spreadValues({}, headers || {}) });
|
|
6088
6213
|
if (!response.ok) {
|
|
6089
6214
|
const { result: error } = await catchInline(response.text());
|
|
6090
6215
|
throw new Error(`Error throwed while downloading file: ${error || "status code: " + response.status}`);
|
|
@@ -6097,10 +6222,13 @@ function downloadFile(url, destination, headers) {
|
|
|
6097
6222
|
import_stream.Readable.fromWeb(body).pipe(dest);
|
|
6098
6223
|
}
|
|
6099
6224
|
dest.on("finish", () => resolve(destination));
|
|
6100
|
-
dest.on(
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
|
|
6225
|
+
dest.on(
|
|
6226
|
+
"error",
|
|
6227
|
+
(e2) => {
|
|
6228
|
+
console.error("error downloading", url);
|
|
6229
|
+
reject(e2);
|
|
6230
|
+
}
|
|
6231
|
+
);
|
|
6104
6232
|
} catch (e2) {
|
|
6105
6233
|
console.error("error downloading", url);
|
|
6106
6234
|
reject(e2);
|