@capgo/cli 4.12.12 → 4.12.14
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/.github/workflows/autofix.yml +25 -0
- package/CHANGELOG.md +9 -0
- package/bun.lockb +0 -0
- package/bunfig.toml +2 -0
- package/dist/index.js +1670 -298
- package/package.json +2 -2
- package/src/bundle/upload.ts +30 -24
- package/src/index.ts +6 -3
package/dist/index.js
CHANGED
|
@@ -53,7 +53,7 @@ var require_error = __commonJS({
|
|
|
53
53
|
this.nestedError = void 0;
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
|
-
var
|
|
56
|
+
var InvalidArgumentError3 = class extends CommanderError2 {
|
|
57
57
|
/**
|
|
58
58
|
* Constructs the InvalidArgumentError class
|
|
59
59
|
* @param {string} [message] explanation of why argument is invalid
|
|
@@ -65,14 +65,14 @@ var require_error = __commonJS({
|
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
67
|
exports2.CommanderError = CommanderError2;
|
|
68
|
-
exports2.InvalidArgumentError =
|
|
68
|
+
exports2.InvalidArgumentError = InvalidArgumentError3;
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
71
|
|
|
72
72
|
// node_modules/commander/lib/argument.js
|
|
73
73
|
var require_argument = __commonJS({
|
|
74
74
|
"node_modules/commander/lib/argument.js"(exports2) {
|
|
75
|
-
var { InvalidArgumentError:
|
|
75
|
+
var { InvalidArgumentError: InvalidArgumentError3 } = require_error();
|
|
76
76
|
var Argument2 = class {
|
|
77
77
|
/**
|
|
78
78
|
* Initialize a new command argument with the given name and description.
|
|
@@ -157,7 +157,7 @@ var require_argument = __commonJS({
|
|
|
157
157
|
this.argChoices = values.slice();
|
|
158
158
|
this.parseArg = (arg, previous) => {
|
|
159
159
|
if (!this.argChoices.includes(arg)) {
|
|
160
|
-
throw new
|
|
160
|
+
throw new InvalidArgumentError3(
|
|
161
161
|
`Allowed choices are ${this.argChoices.join(", ")}.`
|
|
162
162
|
);
|
|
163
163
|
}
|
|
@@ -613,7 +613,7 @@ var require_help = __commonJS({
|
|
|
613
613
|
// node_modules/commander/lib/option.js
|
|
614
614
|
var require_option = __commonJS({
|
|
615
615
|
"node_modules/commander/lib/option.js"(exports2) {
|
|
616
|
-
var { InvalidArgumentError:
|
|
616
|
+
var { InvalidArgumentError: InvalidArgumentError3 } = require_error();
|
|
617
617
|
var Option2 = class {
|
|
618
618
|
/**
|
|
619
619
|
* Initialize a new `Option` with the given `flags` and `description`.
|
|
@@ -770,7 +770,7 @@ var require_option = __commonJS({
|
|
|
770
770
|
this.argChoices = values.slice();
|
|
771
771
|
this.parseArg = (arg, previous) => {
|
|
772
772
|
if (!this.argChoices.includes(arg)) {
|
|
773
|
-
throw new
|
|
773
|
+
throw new InvalidArgumentError3(
|
|
774
774
|
`Allowed choices are ${this.argChoices.join(", ")}.`
|
|
775
775
|
);
|
|
776
776
|
}
|
|
@@ -3010,7 +3010,7 @@ var require_commander = __commonJS({
|
|
|
3010
3010
|
"node_modules/commander/index.js"(exports2) {
|
|
3011
3011
|
var { Argument: Argument2 } = require_argument();
|
|
3012
3012
|
var { Command: Command2 } = require_command();
|
|
3013
|
-
var { CommanderError: CommanderError2, InvalidArgumentError:
|
|
3013
|
+
var { CommanderError: CommanderError2, InvalidArgumentError: InvalidArgumentError3 } = require_error();
|
|
3014
3014
|
var { Help: Help2 } = require_help();
|
|
3015
3015
|
var { Option: Option2 } = require_option();
|
|
3016
3016
|
exports2.program = new Command2();
|
|
@@ -3022,8 +3022,8 @@ var require_commander = __commonJS({
|
|
|
3022
3022
|
exports2.Argument = Argument2;
|
|
3023
3023
|
exports2.Help = Help2;
|
|
3024
3024
|
exports2.CommanderError = CommanderError2;
|
|
3025
|
-
exports2.InvalidArgumentError =
|
|
3026
|
-
exports2.InvalidOptionArgumentError =
|
|
3025
|
+
exports2.InvalidArgumentError = InvalidArgumentError3;
|
|
3026
|
+
exports2.InvalidOptionArgumentError = InvalidArgumentError3;
|
|
3027
3027
|
}
|
|
3028
3028
|
});
|
|
3029
3029
|
|
|
@@ -4039,13 +4039,13 @@ var require_clone = __commonJS({
|
|
|
4039
4039
|
if (obj === null || typeof obj !== "object")
|
|
4040
4040
|
return obj;
|
|
4041
4041
|
if (obj instanceof Object)
|
|
4042
|
-
var
|
|
4042
|
+
var copy2 = { __proto__: getPrototypeOf(obj) };
|
|
4043
4043
|
else
|
|
4044
|
-
var
|
|
4044
|
+
var copy2 = /* @__PURE__ */ Object.create(null);
|
|
4045
4045
|
Object.getOwnPropertyNames(obj).forEach(function(key2) {
|
|
4046
|
-
Object.defineProperty(
|
|
4046
|
+
Object.defineProperty(copy2, key2, Object.getOwnPropertyDescriptor(obj, key2));
|
|
4047
4047
|
});
|
|
4048
|
-
return
|
|
4048
|
+
return copy2;
|
|
4049
4049
|
}
|
|
4050
4050
|
}
|
|
4051
4051
|
});
|
|
@@ -4974,7 +4974,7 @@ var require_copy = __commonJS({
|
|
|
4974
4974
|
var pathExists = require_path_exists().pathExists;
|
|
4975
4975
|
var utimesMillis = require_utimes().utimesMillis;
|
|
4976
4976
|
var stat = require_stat();
|
|
4977
|
-
function
|
|
4977
|
+
function copy2(src, dest, opts, cb) {
|
|
4978
4978
|
if (typeof opts === "function" && !cb) {
|
|
4979
4979
|
cb = opts;
|
|
4980
4980
|
opts = {};
|
|
@@ -5155,7 +5155,7 @@ var require_copy = __commonJS({
|
|
|
5155
5155
|
return fs6.symlink(resolvedSrc, dest, cb);
|
|
5156
5156
|
});
|
|
5157
5157
|
}
|
|
5158
|
-
module2.exports =
|
|
5158
|
+
module2.exports = copy2;
|
|
5159
5159
|
}
|
|
5160
5160
|
});
|
|
5161
5161
|
|
|
@@ -6034,7 +6034,7 @@ var require_move = __commonJS({
|
|
|
6034
6034
|
"use strict";
|
|
6035
6035
|
var fs6 = require_graceful_fs();
|
|
6036
6036
|
var path5 = require("path");
|
|
6037
|
-
var
|
|
6037
|
+
var copy2 = require_copy2().copy;
|
|
6038
6038
|
var remove = require_remove().remove;
|
|
6039
6039
|
var mkdirp = require_mkdirs().mkdirp;
|
|
6040
6040
|
var pathExists = require_path_exists().pathExists;
|
|
@@ -6082,7 +6082,7 @@ var require_move = __commonJS({
|
|
|
6082
6082
|
overwrite,
|
|
6083
6083
|
errorOnExist: true
|
|
6084
6084
|
};
|
|
6085
|
-
|
|
6085
|
+
copy2(src, dest, opts, (err) => {
|
|
6086
6086
|
if (err) return cb(err);
|
|
6087
6087
|
return remove(src, cb);
|
|
6088
6088
|
});
|
|
@@ -6415,7 +6415,7 @@ var require_ms = __commonJS({
|
|
|
6415
6415
|
options = options || {};
|
|
6416
6416
|
var type = typeof val;
|
|
6417
6417
|
if (type === "string" && val.length > 0) {
|
|
6418
|
-
return
|
|
6418
|
+
return parse2(val);
|
|
6419
6419
|
} else if (type === "number" && isFinite(val)) {
|
|
6420
6420
|
return options.long ? fmtLong(val) : fmtShort(val);
|
|
6421
6421
|
}
|
|
@@ -6423,7 +6423,7 @@ var require_ms = __commonJS({
|
|
|
6423
6423
|
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
|
6424
6424
|
);
|
|
6425
6425
|
};
|
|
6426
|
-
function
|
|
6426
|
+
function parse2(str) {
|
|
6427
6427
|
str = String(str);
|
|
6428
6428
|
if (str.length > 100) {
|
|
6429
6429
|
return;
|
|
@@ -20074,7 +20074,7 @@ var require_sax = __commonJS({
|
|
|
20074
20074
|
var stringFromCharCode = String.fromCharCode;
|
|
20075
20075
|
var floor = Math.floor;
|
|
20076
20076
|
var fromCodePoint = function() {
|
|
20077
|
-
var
|
|
20077
|
+
var MAX_SIZE2 = 16384;
|
|
20078
20078
|
var codeUnits = [];
|
|
20079
20079
|
var highSurrogate;
|
|
20080
20080
|
var lowSurrogate;
|
|
@@ -20100,7 +20100,7 @@ var require_sax = __commonJS({
|
|
|
20100
20100
|
lowSurrogate = codePoint % 1024 + 56320;
|
|
20101
20101
|
codeUnits.push(highSurrogate, lowSurrogate);
|
|
20102
20102
|
}
|
|
20103
|
-
if (index + 1 === length || codeUnits.length >
|
|
20103
|
+
if (index + 1 === length || codeUnits.length > MAX_SIZE2) {
|
|
20104
20104
|
result += stringFromCharCode.apply(null, codeUnits);
|
|
20105
20105
|
codeUnits.length = 0;
|
|
20106
20106
|
}
|
|
@@ -22276,7 +22276,7 @@ var require_parse = __commonJS({
|
|
|
22276
22276
|
}
|
|
22277
22277
|
return parsed;
|
|
22278
22278
|
}
|
|
22279
|
-
function
|
|
22279
|
+
function parse2(command, args, options) {
|
|
22280
22280
|
if (args && !Array.isArray(args)) {
|
|
22281
22281
|
options = args;
|
|
22282
22282
|
args = null;
|
|
@@ -22295,7 +22295,7 @@ var require_parse = __commonJS({
|
|
|
22295
22295
|
};
|
|
22296
22296
|
return options.shell ? parsed : parseNonShell(parsed);
|
|
22297
22297
|
}
|
|
22298
|
-
module2.exports =
|
|
22298
|
+
module2.exports = parse2;
|
|
22299
22299
|
}
|
|
22300
22300
|
});
|
|
22301
22301
|
|
|
@@ -22354,16 +22354,16 @@ var require_cross_spawn = __commonJS({
|
|
|
22354
22354
|
"node_modules/cross-spawn/index.js"(exports2, module2) {
|
|
22355
22355
|
"use strict";
|
|
22356
22356
|
var cp = require("child_process");
|
|
22357
|
-
var
|
|
22357
|
+
var parse2 = require_parse();
|
|
22358
22358
|
var enoent = require_enoent();
|
|
22359
22359
|
function spawn(command, args, options) {
|
|
22360
|
-
const parsed =
|
|
22360
|
+
const parsed = parse2(command, args, options);
|
|
22361
22361
|
const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
|
|
22362
22362
|
enoent.hookChildProcess(spawned, parsed);
|
|
22363
22363
|
return spawned;
|
|
22364
22364
|
}
|
|
22365
22365
|
function spawnSync2(command, args, options) {
|
|
22366
|
-
const parsed =
|
|
22366
|
+
const parsed = parse2(command, args, options);
|
|
22367
22367
|
const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
|
|
22368
22368
|
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
22369
22369
|
return result;
|
|
@@ -22371,7 +22371,7 @@ var require_cross_spawn = __commonJS({
|
|
|
22371
22371
|
module2.exports = spawn;
|
|
22372
22372
|
module2.exports.spawn = spawn;
|
|
22373
22373
|
module2.exports.sync = spawnSync2;
|
|
22374
|
-
module2.exports._parse =
|
|
22374
|
+
module2.exports._parse = parse2;
|
|
22375
22375
|
module2.exports._enoent = enoent;
|
|
22376
22376
|
}
|
|
22377
22377
|
});
|
|
@@ -23023,7 +23023,7 @@ var require_semver = __commonJS({
|
|
|
23023
23023
|
var require_parse2 = __commonJS({
|
|
23024
23024
|
"node_modules/semver/functions/parse.js"(exports2, module2) {
|
|
23025
23025
|
var SemVer = require_semver();
|
|
23026
|
-
var
|
|
23026
|
+
var parse2 = (version, options, throwErrors = false) => {
|
|
23027
23027
|
if (version instanceof SemVer) {
|
|
23028
23028
|
return version;
|
|
23029
23029
|
}
|
|
@@ -23036,16 +23036,16 @@ var require_parse2 = __commonJS({
|
|
|
23036
23036
|
throw er;
|
|
23037
23037
|
}
|
|
23038
23038
|
};
|
|
23039
|
-
module2.exports =
|
|
23039
|
+
module2.exports = parse2;
|
|
23040
23040
|
}
|
|
23041
23041
|
});
|
|
23042
23042
|
|
|
23043
23043
|
// node_modules/semver/functions/valid.js
|
|
23044
23044
|
var require_valid = __commonJS({
|
|
23045
23045
|
"node_modules/semver/functions/valid.js"(exports2, module2) {
|
|
23046
|
-
var
|
|
23046
|
+
var parse2 = require_parse2();
|
|
23047
23047
|
var valid = (version, options) => {
|
|
23048
|
-
const v2 =
|
|
23048
|
+
const v2 = parse2(version, options);
|
|
23049
23049
|
return v2 ? v2.version : null;
|
|
23050
23050
|
};
|
|
23051
23051
|
module2.exports = valid;
|
|
@@ -23055,9 +23055,9 @@ var require_valid = __commonJS({
|
|
|
23055
23055
|
// node_modules/semver/functions/clean.js
|
|
23056
23056
|
var require_clean = __commonJS({
|
|
23057
23057
|
"node_modules/semver/functions/clean.js"(exports2, module2) {
|
|
23058
|
-
var
|
|
23058
|
+
var parse2 = require_parse2();
|
|
23059
23059
|
var clean = (version, options) => {
|
|
23060
|
-
const s =
|
|
23060
|
+
const s = parse2(version.trim().replace(/^[=v]+/, ""), options);
|
|
23061
23061
|
return s ? s.version : null;
|
|
23062
23062
|
};
|
|
23063
23063
|
module2.exports = clean;
|
|
@@ -23090,10 +23090,10 @@ var require_inc = __commonJS({
|
|
|
23090
23090
|
// node_modules/semver/functions/diff.js
|
|
23091
23091
|
var require_diff = __commonJS({
|
|
23092
23092
|
"node_modules/semver/functions/diff.js"(exports2, module2) {
|
|
23093
|
-
var
|
|
23093
|
+
var parse2 = require_parse2();
|
|
23094
23094
|
var diff = (version1, version2) => {
|
|
23095
|
-
const v1 =
|
|
23096
|
-
const v2 =
|
|
23095
|
+
const v1 = parse2(version1, null, true);
|
|
23096
|
+
const v2 = parse2(version2, null, true);
|
|
23097
23097
|
const comparison = v1.compare(v2);
|
|
23098
23098
|
if (comparison === 0) {
|
|
23099
23099
|
return null;
|
|
@@ -23161,9 +23161,9 @@ var require_patch = __commonJS({
|
|
|
23161
23161
|
// node_modules/semver/functions/prerelease.js
|
|
23162
23162
|
var require_prerelease = __commonJS({
|
|
23163
23163
|
"node_modules/semver/functions/prerelease.js"(exports2, module2) {
|
|
23164
|
-
var
|
|
23164
|
+
var parse2 = require_parse2();
|
|
23165
23165
|
var prerelease = (version, options) => {
|
|
23166
|
-
const parsed =
|
|
23166
|
+
const parsed = parse2(version, options);
|
|
23167
23167
|
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
23168
23168
|
};
|
|
23169
23169
|
module2.exports = prerelease;
|
|
@@ -23335,7 +23335,7 @@ var require_cmp = __commonJS({
|
|
|
23335
23335
|
var require_coerce = __commonJS({
|
|
23336
23336
|
"node_modules/semver/functions/coerce.js"(exports2, module2) {
|
|
23337
23337
|
var SemVer = require_semver();
|
|
23338
|
-
var
|
|
23338
|
+
var parse2 = require_parse2();
|
|
23339
23339
|
var { safeRe: re, t } = require_re();
|
|
23340
23340
|
var coerce = (version, options) => {
|
|
23341
23341
|
if (version instanceof SemVer) {
|
|
@@ -23370,7 +23370,7 @@ var require_coerce = __commonJS({
|
|
|
23370
23370
|
const patch = match[4] || "0";
|
|
23371
23371
|
const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : "";
|
|
23372
23372
|
const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
|
|
23373
|
-
return
|
|
23373
|
+
return parse2(`${major}.${minor}.${patch}${prerelease}${build}`, options);
|
|
23374
23374
|
};
|
|
23375
23375
|
module2.exports = coerce;
|
|
23376
23376
|
}
|
|
@@ -24350,7 +24350,7 @@ var require_semver2 = __commonJS({
|
|
|
24350
24350
|
var constants2 = require_constants();
|
|
24351
24351
|
var SemVer = require_semver();
|
|
24352
24352
|
var identifiers = require_identifiers();
|
|
24353
|
-
var
|
|
24353
|
+
var parse2 = require_parse2();
|
|
24354
24354
|
var valid = require_valid();
|
|
24355
24355
|
var clean = require_clean();
|
|
24356
24356
|
var inc = require_inc();
|
|
@@ -24388,7 +24388,7 @@ var require_semver2 = __commonJS({
|
|
|
24388
24388
|
var simplifyRange = require_simplify();
|
|
24389
24389
|
var subset = require_subset();
|
|
24390
24390
|
module2.exports = {
|
|
24391
|
-
parse,
|
|
24391
|
+
parse: parse2,
|
|
24392
24392
|
valid,
|
|
24393
24393
|
clean,
|
|
24394
24394
|
inc,
|
|
@@ -32830,7 +32830,7 @@ var require_extension = __commonJS({
|
|
|
32830
32830
|
if (dest[name] === void 0) dest[name] = [elem];
|
|
32831
32831
|
else dest[name].push(elem);
|
|
32832
32832
|
}
|
|
32833
|
-
function
|
|
32833
|
+
function parse2(header) {
|
|
32834
32834
|
const offers = /* @__PURE__ */ Object.create(null);
|
|
32835
32835
|
let params = /* @__PURE__ */ Object.create(null);
|
|
32836
32836
|
let mustUnescape = false;
|
|
@@ -32970,7 +32970,7 @@ var require_extension = __commonJS({
|
|
|
32970
32970
|
}).join(", ");
|
|
32971
32971
|
}).join(", ");
|
|
32972
32972
|
}
|
|
32973
|
-
module2.exports = { format, parse };
|
|
32973
|
+
module2.exports = { format, parse: parse2 };
|
|
32974
32974
|
}
|
|
32975
32975
|
});
|
|
32976
32976
|
|
|
@@ -33002,7 +33002,7 @@ var require_websocket = __commonJS({
|
|
|
33002
33002
|
var {
|
|
33003
33003
|
EventTarget: { addEventListener, removeEventListener }
|
|
33004
33004
|
} = require_event_target();
|
|
33005
|
-
var { format, parse } = require_extension();
|
|
33005
|
+
var { format, parse: parse2 } = require_extension();
|
|
33006
33006
|
var { toBuffer } = require_buffer_util();
|
|
33007
33007
|
var closeTimeout = 30 * 1e3;
|
|
33008
33008
|
var kAborted = Symbol("kAborted");
|
|
@@ -33668,7 +33668,7 @@ var require_websocket = __commonJS({
|
|
|
33668
33668
|
}
|
|
33669
33669
|
let extensions;
|
|
33670
33670
|
try {
|
|
33671
|
-
extensions =
|
|
33671
|
+
extensions = parse2(secWebSocketExtensions);
|
|
33672
33672
|
} catch (err) {
|
|
33673
33673
|
const message = "Invalid Sec-WebSocket-Extensions header";
|
|
33674
33674
|
abortHandshake(websocket, socket, message);
|
|
@@ -33934,7 +33934,7 @@ var require_subprotocol = __commonJS({
|
|
|
33934
33934
|
"node_modules/ws/lib/subprotocol.js"(exports2, module2) {
|
|
33935
33935
|
"use strict";
|
|
33936
33936
|
var { tokenChars } = require_validation();
|
|
33937
|
-
function
|
|
33937
|
+
function parse2(header) {
|
|
33938
33938
|
const protocols = /* @__PURE__ */ new Set();
|
|
33939
33939
|
let start = -1;
|
|
33940
33940
|
let end = -1;
|
|
@@ -33970,7 +33970,7 @@ var require_subprotocol = __commonJS({
|
|
|
33970
33970
|
protocols.add(protocol);
|
|
33971
33971
|
return protocols;
|
|
33972
33972
|
}
|
|
33973
|
-
module2.exports = { parse };
|
|
33973
|
+
module2.exports = { parse: parse2 };
|
|
33974
33974
|
}
|
|
33975
33975
|
});
|
|
33976
33976
|
|
|
@@ -40201,7 +40201,7 @@ var require_safer = __commonJS({
|
|
|
40201
40201
|
"node_modules/safer-buffer/safer.js"(exports2, module2) {
|
|
40202
40202
|
"use strict";
|
|
40203
40203
|
var buffer = require("buffer");
|
|
40204
|
-
var
|
|
40204
|
+
var Buffer5 = buffer.Buffer;
|
|
40205
40205
|
var safer = {};
|
|
40206
40206
|
var key2;
|
|
40207
40207
|
for (key2 in buffer) {
|
|
@@ -40210,12 +40210,12 @@ var require_safer = __commonJS({
|
|
|
40210
40210
|
safer[key2] = buffer[key2];
|
|
40211
40211
|
}
|
|
40212
40212
|
var Safer = safer.Buffer = {};
|
|
40213
|
-
for (key2 in
|
|
40214
|
-
if (!
|
|
40213
|
+
for (key2 in Buffer5) {
|
|
40214
|
+
if (!Buffer5.hasOwnProperty(key2)) continue;
|
|
40215
40215
|
if (key2 === "allocUnsafe" || key2 === "allocUnsafeSlow") continue;
|
|
40216
|
-
Safer[key2] =
|
|
40216
|
+
Safer[key2] = Buffer5[key2];
|
|
40217
40217
|
}
|
|
40218
|
-
safer.Buffer.prototype =
|
|
40218
|
+
safer.Buffer.prototype = Buffer5.prototype;
|
|
40219
40219
|
if (!Safer.from || Safer.from === Uint8Array.from) {
|
|
40220
40220
|
Safer.from = function(value, encodingOrOffset, length) {
|
|
40221
40221
|
if (typeof value === "number") {
|
|
@@ -40224,7 +40224,7 @@ var require_safer = __commonJS({
|
|
|
40224
40224
|
if (value && typeof value.length === "undefined") {
|
|
40225
40225
|
throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value);
|
|
40226
40226
|
}
|
|
40227
|
-
return
|
|
40227
|
+
return Buffer5(value, encodingOrOffset, length);
|
|
40228
40228
|
};
|
|
40229
40229
|
}
|
|
40230
40230
|
if (!Safer.alloc) {
|
|
@@ -40235,7 +40235,7 @@ var require_safer = __commonJS({
|
|
|
40235
40235
|
if (size < 0 || size >= 2 * (1 << 30)) {
|
|
40236
40236
|
throw new RangeError('The value "' + size + '" is invalid for option "size"');
|
|
40237
40237
|
}
|
|
40238
|
-
var buf =
|
|
40238
|
+
var buf = Buffer5(size);
|
|
40239
40239
|
if (!fill || fill.length === 0) {
|
|
40240
40240
|
buf.fill(0);
|
|
40241
40241
|
} else if (typeof encoding === "string") {
|
|
@@ -40312,7 +40312,7 @@ var require_bom_handling = __commonJS({
|
|
|
40312
40312
|
var require_internal = __commonJS({
|
|
40313
40313
|
"node_modules/iconv-lite/encodings/internal.js"(exports2, module2) {
|
|
40314
40314
|
"use strict";
|
|
40315
|
-
var
|
|
40315
|
+
var Buffer5 = require_safer().Buffer;
|
|
40316
40316
|
module2.exports = {
|
|
40317
40317
|
// Encodings
|
|
40318
40318
|
utf8: { type: "_internal", bomAware: true },
|
|
@@ -40334,7 +40334,7 @@ var require_internal = __commonJS({
|
|
|
40334
40334
|
else if (this.enc === "cesu8") {
|
|
40335
40335
|
this.enc = "utf8";
|
|
40336
40336
|
this.encoder = InternalEncoderCesu8;
|
|
40337
|
-
if (
|
|
40337
|
+
if (Buffer5.from("eda0bdedb2a9", "hex").toString() !== "\u{1F4A9}") {
|
|
40338
40338
|
this.decoder = InternalDecoderCesu8;
|
|
40339
40339
|
this.defaultCharUnicode = iconv.defaultCharUnicode;
|
|
40340
40340
|
}
|
|
@@ -40350,8 +40350,8 @@ var require_internal = __commonJS({
|
|
|
40350
40350
|
this.decoder = new StringDecoder(codec.enc);
|
|
40351
40351
|
}
|
|
40352
40352
|
InternalDecoder.prototype.write = function(buf) {
|
|
40353
|
-
if (!
|
|
40354
|
-
buf =
|
|
40353
|
+
if (!Buffer5.isBuffer(buf)) {
|
|
40354
|
+
buf = Buffer5.from(buf);
|
|
40355
40355
|
}
|
|
40356
40356
|
return this.decoder.write(buf);
|
|
40357
40357
|
};
|
|
@@ -40362,7 +40362,7 @@ var require_internal = __commonJS({
|
|
|
40362
40362
|
this.enc = codec.enc;
|
|
40363
40363
|
}
|
|
40364
40364
|
InternalEncoder.prototype.write = function(str) {
|
|
40365
|
-
return
|
|
40365
|
+
return Buffer5.from(str, this.enc);
|
|
40366
40366
|
};
|
|
40367
40367
|
InternalEncoder.prototype.end = function() {
|
|
40368
40368
|
};
|
|
@@ -40374,15 +40374,15 @@ var require_internal = __commonJS({
|
|
|
40374
40374
|
var completeQuads = str.length - str.length % 4;
|
|
40375
40375
|
this.prevStr = str.slice(completeQuads);
|
|
40376
40376
|
str = str.slice(0, completeQuads);
|
|
40377
|
-
return
|
|
40377
|
+
return Buffer5.from(str, "base64");
|
|
40378
40378
|
};
|
|
40379
40379
|
InternalEncoderBase64.prototype.end = function() {
|
|
40380
|
-
return
|
|
40380
|
+
return Buffer5.from(this.prevStr, "base64");
|
|
40381
40381
|
};
|
|
40382
40382
|
function InternalEncoderCesu8(options, codec) {
|
|
40383
40383
|
}
|
|
40384
40384
|
InternalEncoderCesu8.prototype.write = function(str) {
|
|
40385
|
-
var buf =
|
|
40385
|
+
var buf = Buffer5.alloc(str.length * 3), bufIdx = 0;
|
|
40386
40386
|
for (var i = 0; i < str.length; i++) {
|
|
40387
40387
|
var charCode = str.charCodeAt(i);
|
|
40388
40388
|
if (charCode < 128)
|
|
@@ -40464,7 +40464,7 @@ var require_internal = __commonJS({
|
|
|
40464
40464
|
var require_utf32 = __commonJS({
|
|
40465
40465
|
"node_modules/iconv-lite/encodings/utf32.js"(exports2) {
|
|
40466
40466
|
"use strict";
|
|
40467
|
-
var
|
|
40467
|
+
var Buffer5 = require_safer().Buffer;
|
|
40468
40468
|
exports2._utf32 = Utf32Codec;
|
|
40469
40469
|
function Utf32Codec(codecOptions, iconv) {
|
|
40470
40470
|
this.iconv = iconv;
|
|
@@ -40482,8 +40482,8 @@ var require_utf32 = __commonJS({
|
|
|
40482
40482
|
this.highSurrogate = 0;
|
|
40483
40483
|
}
|
|
40484
40484
|
Utf32Encoder.prototype.write = function(str) {
|
|
40485
|
-
var src =
|
|
40486
|
-
var dst =
|
|
40485
|
+
var src = Buffer5.from(str, "ucs2");
|
|
40486
|
+
var dst = Buffer5.alloc(src.length * 2);
|
|
40487
40487
|
var write32 = this.isLE ? dst.writeUInt32LE : dst.writeUInt32BE;
|
|
40488
40488
|
var offset = 0;
|
|
40489
40489
|
for (var i = 0; i < src.length; i += 2) {
|
|
@@ -40517,7 +40517,7 @@ var require_utf32 = __commonJS({
|
|
|
40517
40517
|
Utf32Encoder.prototype.end = function() {
|
|
40518
40518
|
if (!this.highSurrogate)
|
|
40519
40519
|
return;
|
|
40520
|
-
var buf =
|
|
40520
|
+
var buf = Buffer5.alloc(4);
|
|
40521
40521
|
if (this.isLE)
|
|
40522
40522
|
buf.writeUInt32LE(this.highSurrogate, 0);
|
|
40523
40523
|
else
|
|
@@ -40535,7 +40535,7 @@ var require_utf32 = __commonJS({
|
|
|
40535
40535
|
return "";
|
|
40536
40536
|
var i = 0;
|
|
40537
40537
|
var codepoint = 0;
|
|
40538
|
-
var dst =
|
|
40538
|
+
var dst = Buffer5.alloc(src.length + 4);
|
|
40539
40539
|
var offset = 0;
|
|
40540
40540
|
var isLE = this.isLE;
|
|
40541
40541
|
var overflow = this.overflow;
|
|
@@ -40683,7 +40683,7 @@ var require_utf32 = __commonJS({
|
|
|
40683
40683
|
var require_utf16 = __commonJS({
|
|
40684
40684
|
"node_modules/iconv-lite/encodings/utf16.js"(exports2) {
|
|
40685
40685
|
"use strict";
|
|
40686
|
-
var
|
|
40686
|
+
var Buffer5 = require_safer().Buffer;
|
|
40687
40687
|
exports2.utf16be = Utf16BECodec;
|
|
40688
40688
|
function Utf16BECodec() {
|
|
40689
40689
|
}
|
|
@@ -40693,7 +40693,7 @@ var require_utf16 = __commonJS({
|
|
|
40693
40693
|
function Utf16BEEncoder() {
|
|
40694
40694
|
}
|
|
40695
40695
|
Utf16BEEncoder.prototype.write = function(str) {
|
|
40696
|
-
var buf =
|
|
40696
|
+
var buf = Buffer5.from(str, "ucs2");
|
|
40697
40697
|
for (var i = 0; i < buf.length; i += 2) {
|
|
40698
40698
|
var tmp2 = buf[i];
|
|
40699
40699
|
buf[i] = buf[i + 1];
|
|
@@ -40709,7 +40709,7 @@ var require_utf16 = __commonJS({
|
|
|
40709
40709
|
Utf16BEDecoder.prototype.write = function(buf) {
|
|
40710
40710
|
if (buf.length == 0)
|
|
40711
40711
|
return "";
|
|
40712
|
-
var buf2 =
|
|
40712
|
+
var buf2 = Buffer5.alloc(buf.length + 1), i = 0, j2 = 0;
|
|
40713
40713
|
if (this.overflowByte !== -1) {
|
|
40714
40714
|
buf2[0] = buf[0];
|
|
40715
40715
|
buf2[1] = this.overflowByte;
|
|
@@ -40817,7 +40817,7 @@ var require_utf16 = __commonJS({
|
|
|
40817
40817
|
var require_utf7 = __commonJS({
|
|
40818
40818
|
"node_modules/iconv-lite/encodings/utf7.js"(exports2) {
|
|
40819
40819
|
"use strict";
|
|
40820
|
-
var
|
|
40820
|
+
var Buffer5 = require_safer().Buffer;
|
|
40821
40821
|
exports2.utf7 = Utf7Codec;
|
|
40822
40822
|
exports2.unicode11utf7 = "utf7";
|
|
40823
40823
|
function Utf7Codec(codecOptions, iconv) {
|
|
@@ -40831,7 +40831,7 @@ var require_utf7 = __commonJS({
|
|
|
40831
40831
|
this.iconv = codec.iconv;
|
|
40832
40832
|
}
|
|
40833
40833
|
Utf7Encoder.prototype.write = function(str) {
|
|
40834
|
-
return
|
|
40834
|
+
return Buffer5.from(str.replace(nonDirectChars, function(chunk) {
|
|
40835
40835
|
return "+" + (chunk === "+" ? "" : this.iconv.encode(chunk, "utf16-be").toString("base64").replace(/=+$/, "")) + "-";
|
|
40836
40836
|
}.bind(this)));
|
|
40837
40837
|
};
|
|
@@ -40865,7 +40865,7 @@ var require_utf7 = __commonJS({
|
|
|
40865
40865
|
res += "+";
|
|
40866
40866
|
} else {
|
|
40867
40867
|
var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i2), "ascii");
|
|
40868
|
-
res += this.iconv.decode(
|
|
40868
|
+
res += this.iconv.decode(Buffer5.from(b64str, "base64"), "utf16-be");
|
|
40869
40869
|
}
|
|
40870
40870
|
if (buf[i2] != minusChar)
|
|
40871
40871
|
i2--;
|
|
@@ -40882,7 +40882,7 @@ var require_utf7 = __commonJS({
|
|
|
40882
40882
|
var canBeDecoded = b64str.length - b64str.length % 8;
|
|
40883
40883
|
base64Accum = b64str.slice(canBeDecoded);
|
|
40884
40884
|
b64str = b64str.slice(0, canBeDecoded);
|
|
40885
|
-
res += this.iconv.decode(
|
|
40885
|
+
res += this.iconv.decode(Buffer5.from(b64str, "base64"), "utf16-be");
|
|
40886
40886
|
}
|
|
40887
40887
|
this.inBase64 = inBase64;
|
|
40888
40888
|
this.base64Accum = base64Accum;
|
|
@@ -40891,7 +40891,7 @@ var require_utf7 = __commonJS({
|
|
|
40891
40891
|
Utf7Decoder.prototype.end = function() {
|
|
40892
40892
|
var res = "";
|
|
40893
40893
|
if (this.inBase64 && this.base64Accum.length > 0)
|
|
40894
|
-
res = this.iconv.decode(
|
|
40894
|
+
res = this.iconv.decode(Buffer5.from(this.base64Accum, "base64"), "utf16-be");
|
|
40895
40895
|
this.inBase64 = false;
|
|
40896
40896
|
this.base64Accum = "";
|
|
40897
40897
|
return res;
|
|
@@ -40906,11 +40906,11 @@ var require_utf7 = __commonJS({
|
|
|
40906
40906
|
function Utf7IMAPEncoder(options, codec) {
|
|
40907
40907
|
this.iconv = codec.iconv;
|
|
40908
40908
|
this.inBase64 = false;
|
|
40909
|
-
this.base64Accum =
|
|
40909
|
+
this.base64Accum = Buffer5.alloc(6);
|
|
40910
40910
|
this.base64AccumIdx = 0;
|
|
40911
40911
|
}
|
|
40912
40912
|
Utf7IMAPEncoder.prototype.write = function(str) {
|
|
40913
|
-
var inBase64 = this.inBase64, base64Accum = this.base64Accum, base64AccumIdx = this.base64AccumIdx, buf =
|
|
40913
|
+
var inBase64 = this.inBase64, base64Accum = this.base64Accum, base64AccumIdx = this.base64AccumIdx, buf = Buffer5.alloc(str.length * 5 + 10), bufIdx = 0;
|
|
40914
40914
|
for (var i2 = 0; i2 < str.length; i2++) {
|
|
40915
40915
|
var uChar = str.charCodeAt(i2);
|
|
40916
40916
|
if (32 <= uChar && uChar <= 126) {
|
|
@@ -40947,7 +40947,7 @@ var require_utf7 = __commonJS({
|
|
|
40947
40947
|
return buf.slice(0, bufIdx);
|
|
40948
40948
|
};
|
|
40949
40949
|
Utf7IMAPEncoder.prototype.end = function() {
|
|
40950
|
-
var buf =
|
|
40950
|
+
var buf = Buffer5.alloc(10), bufIdx = 0;
|
|
40951
40951
|
if (this.inBase64) {
|
|
40952
40952
|
if (this.base64AccumIdx > 0) {
|
|
40953
40953
|
bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), bufIdx);
|
|
@@ -40980,7 +40980,7 @@ var require_utf7 = __commonJS({
|
|
|
40980
40980
|
res += "&";
|
|
40981
40981
|
} else {
|
|
40982
40982
|
var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i2), "ascii").replace(/,/g, "/");
|
|
40983
|
-
res += this.iconv.decode(
|
|
40983
|
+
res += this.iconv.decode(Buffer5.from(b64str, "base64"), "utf16-be");
|
|
40984
40984
|
}
|
|
40985
40985
|
if (buf[i2] != minusChar)
|
|
40986
40986
|
i2--;
|
|
@@ -40997,7 +40997,7 @@ var require_utf7 = __commonJS({
|
|
|
40997
40997
|
var canBeDecoded = b64str.length - b64str.length % 8;
|
|
40998
40998
|
base64Accum = b64str.slice(canBeDecoded);
|
|
40999
40999
|
b64str = b64str.slice(0, canBeDecoded);
|
|
41000
|
-
res += this.iconv.decode(
|
|
41000
|
+
res += this.iconv.decode(Buffer5.from(b64str, "base64"), "utf16-be");
|
|
41001
41001
|
}
|
|
41002
41002
|
this.inBase64 = inBase64;
|
|
41003
41003
|
this.base64Accum = base64Accum;
|
|
@@ -41006,7 +41006,7 @@ var require_utf7 = __commonJS({
|
|
|
41006
41006
|
Utf7IMAPDecoder.prototype.end = function() {
|
|
41007
41007
|
var res = "";
|
|
41008
41008
|
if (this.inBase64 && this.base64Accum.length > 0)
|
|
41009
|
-
res = this.iconv.decode(
|
|
41009
|
+
res = this.iconv.decode(Buffer5.from(this.base64Accum, "base64"), "utf16-be");
|
|
41010
41010
|
this.inBase64 = false;
|
|
41011
41011
|
this.base64Accum = "";
|
|
41012
41012
|
return res;
|
|
@@ -41018,7 +41018,7 @@ var require_utf7 = __commonJS({
|
|
|
41018
41018
|
var require_sbcs_codec = __commonJS({
|
|
41019
41019
|
"node_modules/iconv-lite/encodings/sbcs-codec.js"(exports2) {
|
|
41020
41020
|
"use strict";
|
|
41021
|
-
var
|
|
41021
|
+
var Buffer5 = require_safer().Buffer;
|
|
41022
41022
|
exports2._sbcs = SBCSCodec;
|
|
41023
41023
|
function SBCSCodec(codecOptions, iconv) {
|
|
41024
41024
|
if (!codecOptions)
|
|
@@ -41031,8 +41031,8 @@ var require_sbcs_codec = __commonJS({
|
|
|
41031
41031
|
asciiString += String.fromCharCode(i);
|
|
41032
41032
|
codecOptions.chars = asciiString + codecOptions.chars;
|
|
41033
41033
|
}
|
|
41034
|
-
this.decodeBuf =
|
|
41035
|
-
var encodeBuf =
|
|
41034
|
+
this.decodeBuf = Buffer5.from(codecOptions.chars, "ucs2");
|
|
41035
|
+
var encodeBuf = Buffer5.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0));
|
|
41036
41036
|
for (var i = 0; i < codecOptions.chars.length; i++)
|
|
41037
41037
|
encodeBuf[codecOptions.chars.charCodeAt(i)] = i;
|
|
41038
41038
|
this.encodeBuf = encodeBuf;
|
|
@@ -41043,7 +41043,7 @@ var require_sbcs_codec = __commonJS({
|
|
|
41043
41043
|
this.encodeBuf = codec.encodeBuf;
|
|
41044
41044
|
}
|
|
41045
41045
|
SBCSEncoder.prototype.write = function(str) {
|
|
41046
|
-
var buf =
|
|
41046
|
+
var buf = Buffer5.alloc(str.length);
|
|
41047
41047
|
for (var i = 0; i < str.length; i++)
|
|
41048
41048
|
buf[i] = this.encodeBuf[str.charCodeAt(i)];
|
|
41049
41049
|
return buf;
|
|
@@ -41055,7 +41055,7 @@ var require_sbcs_codec = __commonJS({
|
|
|
41055
41055
|
}
|
|
41056
41056
|
SBCSDecoder.prototype.write = function(buf) {
|
|
41057
41057
|
var decodeBuf = this.decodeBuf;
|
|
41058
|
-
var newBuf =
|
|
41058
|
+
var newBuf = Buffer5.alloc(buf.length * 2);
|
|
41059
41059
|
var idx1 = 0, idx2 = 0;
|
|
41060
41060
|
for (var i = 0; i < buf.length; i++) {
|
|
41061
41061
|
idx1 = buf[i] * 2;
|
|
@@ -41682,7 +41682,7 @@ var require_sbcs_data_generated = __commonJS({
|
|
|
41682
41682
|
var require_dbcs_codec = __commonJS({
|
|
41683
41683
|
"node_modules/iconv-lite/encodings/dbcs-codec.js"(exports2) {
|
|
41684
41684
|
"use strict";
|
|
41685
|
-
var
|
|
41685
|
+
var Buffer5 = require_safer().Buffer;
|
|
41686
41686
|
exports2._dbcs = DBCSCodec;
|
|
41687
41687
|
var UNASSIGNED = -1;
|
|
41688
41688
|
var GB18030_CODE = -2;
|
|
@@ -41894,7 +41894,7 @@ var require_dbcs_codec = __commonJS({
|
|
|
41894
41894
|
this.gb18030 = codec.gb18030;
|
|
41895
41895
|
}
|
|
41896
41896
|
DBCSEncoder.prototype.write = function(str) {
|
|
41897
|
-
var newBuf =
|
|
41897
|
+
var newBuf = Buffer5.alloc(str.length * (this.gb18030 ? 4 : 3)), leadSurrogate = this.leadSurrogate, seqObj = this.seqObj, nextChar = -1, i2 = 0, j2 = 0;
|
|
41898
41898
|
while (true) {
|
|
41899
41899
|
if (nextChar === -1) {
|
|
41900
41900
|
if (i2 == str.length) break;
|
|
@@ -41990,7 +41990,7 @@ var require_dbcs_codec = __commonJS({
|
|
|
41990
41990
|
DBCSEncoder.prototype.end = function() {
|
|
41991
41991
|
if (this.leadSurrogate === -1 && this.seqObj === void 0)
|
|
41992
41992
|
return;
|
|
41993
|
-
var newBuf =
|
|
41993
|
+
var newBuf = Buffer5.alloc(10), j2 = 0;
|
|
41994
41994
|
if (this.seqObj) {
|
|
41995
41995
|
var dbcsCode = this.seqObj[DEF_CHAR];
|
|
41996
41996
|
if (dbcsCode !== void 0) {
|
|
@@ -42020,7 +42020,7 @@ var require_dbcs_codec = __commonJS({
|
|
|
42020
42020
|
this.gb18030 = codec.gb18030;
|
|
42021
42021
|
}
|
|
42022
42022
|
DBCSDecoder.prototype.write = function(buf) {
|
|
42023
|
-
var newBuf =
|
|
42023
|
+
var newBuf = Buffer5.alloc(buf.length * 2), nodeIdx = this.nodeIdx, prevBytes = this.prevBytes, prevOffset = this.prevBytes.length, seqStart = -this.prevBytes.length, uCode;
|
|
42024
42024
|
for (var i2 = 0, j2 = 0; i2 < buf.length; i2++) {
|
|
42025
42025
|
var curByte = i2 >= 0 ? buf[i2] : prevBytes[i2 + prevOffset];
|
|
42026
42026
|
var uCode = this.decodeTables[nodeIdx][curByte];
|
|
@@ -43621,7 +43621,7 @@ var require_encodings = __commonJS({
|
|
|
43621
43621
|
var require_streams = __commonJS({
|
|
43622
43622
|
"node_modules/iconv-lite/lib/streams.js"(exports2, module2) {
|
|
43623
43623
|
"use strict";
|
|
43624
|
-
var
|
|
43624
|
+
var Buffer5 = require_safer().Buffer;
|
|
43625
43625
|
module2.exports = function(stream_module) {
|
|
43626
43626
|
var Transform = stream_module.Transform;
|
|
43627
43627
|
function IconvLiteEncoderStream(conv, options) {
|
|
@@ -43660,7 +43660,7 @@ var require_streams = __commonJS({
|
|
|
43660
43660
|
chunks.push(chunk);
|
|
43661
43661
|
});
|
|
43662
43662
|
this.on("end", function() {
|
|
43663
|
-
cb(null,
|
|
43663
|
+
cb(null, Buffer5.concat(chunks));
|
|
43664
43664
|
});
|
|
43665
43665
|
return this;
|
|
43666
43666
|
};
|
|
@@ -43674,7 +43674,7 @@ var require_streams = __commonJS({
|
|
|
43674
43674
|
constructor: { value: IconvLiteDecoderStream }
|
|
43675
43675
|
});
|
|
43676
43676
|
IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) {
|
|
43677
|
-
if (!
|
|
43677
|
+
if (!Buffer5.isBuffer(chunk) && !(chunk instanceof Uint8Array))
|
|
43678
43678
|
return done(new Error("Iconv decoding stream needs buffers as its input."));
|
|
43679
43679
|
try {
|
|
43680
43680
|
var res = this.conv.write(chunk);
|
|
@@ -43716,7 +43716,7 @@ var require_streams = __commonJS({
|
|
|
43716
43716
|
var require_lib6 = __commonJS({
|
|
43717
43717
|
"node_modules/iconv-lite/lib/index.js"(exports2, module2) {
|
|
43718
43718
|
"use strict";
|
|
43719
|
-
var
|
|
43719
|
+
var Buffer5 = require_safer().Buffer;
|
|
43720
43720
|
var bomHandling = require_bom_handling();
|
|
43721
43721
|
var iconv = module2.exports;
|
|
43722
43722
|
iconv.encodings = null;
|
|
@@ -43727,7 +43727,7 @@ var require_lib6 = __commonJS({
|
|
|
43727
43727
|
var encoder = iconv.getEncoder(encoding, options);
|
|
43728
43728
|
var res = encoder.write(str);
|
|
43729
43729
|
var trail = encoder.end();
|
|
43730
|
-
return trail && trail.length > 0 ?
|
|
43730
|
+
return trail && trail.length > 0 ? Buffer5.concat([res, trail]) : res;
|
|
43731
43731
|
};
|
|
43732
43732
|
iconv.decode = function decode(buf, encoding, options) {
|
|
43733
43733
|
if (typeof buf === "string") {
|
|
@@ -43735,7 +43735,7 @@ var require_lib6 = __commonJS({
|
|
|
43735
43735
|
console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding");
|
|
43736
43736
|
iconv.skipDecodeWarning = true;
|
|
43737
43737
|
}
|
|
43738
|
-
buf =
|
|
43738
|
+
buf = Buffer5.from("" + (buf || ""), "binary");
|
|
43739
43739
|
}
|
|
43740
43740
|
var decoder = iconv.getDecoder(encoding, options);
|
|
43741
43741
|
var res = decoder.write(buf);
|
|
@@ -46447,7 +46447,7 @@ var require_copy3 = __commonJS({
|
|
|
46447
46447
|
var pathExists = require_path_exists3().pathExists;
|
|
46448
46448
|
var utimes = require_utimes2().utimesMillis;
|
|
46449
46449
|
var stat = require_stat2();
|
|
46450
|
-
function
|
|
46450
|
+
function copy2(src, dest, opts, cb) {
|
|
46451
46451
|
if (typeof opts === "function" && !cb) {
|
|
46452
46452
|
cb = opts;
|
|
46453
46453
|
opts = {};
|
|
@@ -46616,7 +46616,7 @@ var require_copy3 = __commonJS({
|
|
|
46616
46616
|
return fs6.symlink(resolvedSrc, dest, cb);
|
|
46617
46617
|
});
|
|
46618
46618
|
}
|
|
46619
|
-
module2.exports =
|
|
46619
|
+
module2.exports = copy2;
|
|
46620
46620
|
}
|
|
46621
46621
|
});
|
|
46622
46622
|
|
|
@@ -47499,7 +47499,7 @@ var require_move3 = __commonJS({
|
|
|
47499
47499
|
"use strict";
|
|
47500
47500
|
var fs6 = require_graceful_fs();
|
|
47501
47501
|
var path5 = require("path");
|
|
47502
|
-
var
|
|
47502
|
+
var copy2 = require_copy4().copy;
|
|
47503
47503
|
var remove = require_remove2().remove;
|
|
47504
47504
|
var mkdirp = require_mkdirs3().mkdirp;
|
|
47505
47505
|
var pathExists = require_path_exists3().pathExists;
|
|
@@ -47547,7 +47547,7 @@ var require_move3 = __commonJS({
|
|
|
47547
47547
|
overwrite,
|
|
47548
47548
|
errorOnExist: true
|
|
47549
47549
|
};
|
|
47550
|
-
|
|
47550
|
+
copy2(src, dest, opts, (err) => {
|
|
47551
47551
|
if (err) return cb(err);
|
|
47552
47552
|
return remove(src, cb);
|
|
47553
47553
|
});
|
|
@@ -48320,7 +48320,7 @@ var require_copy5 = __commonJS({
|
|
|
48320
48320
|
var pathExists = require_path_exists4().pathExists;
|
|
48321
48321
|
var utimes = require_utimes3().utimesMillis;
|
|
48322
48322
|
var stat = require_stat3();
|
|
48323
|
-
function
|
|
48323
|
+
function copy2(src, dest, opts, cb) {
|
|
48324
48324
|
if (typeof opts === "function" && !cb) {
|
|
48325
48325
|
cb = opts;
|
|
48326
48326
|
opts = {};
|
|
@@ -48489,7 +48489,7 @@ var require_copy5 = __commonJS({
|
|
|
48489
48489
|
return fs6.symlink(resolvedSrc, dest, cb);
|
|
48490
48490
|
});
|
|
48491
48491
|
}
|
|
48492
|
-
module2.exports =
|
|
48492
|
+
module2.exports = copy2;
|
|
48493
48493
|
}
|
|
48494
48494
|
});
|
|
48495
48495
|
|
|
@@ -49372,7 +49372,7 @@ var require_move5 = __commonJS({
|
|
|
49372
49372
|
"use strict";
|
|
49373
49373
|
var fs6 = require_graceful_fs();
|
|
49374
49374
|
var path5 = require("path");
|
|
49375
|
-
var
|
|
49375
|
+
var copy2 = require_copy6().copy;
|
|
49376
49376
|
var remove = require_remove3().remove;
|
|
49377
49377
|
var mkdirp = require_mkdirs5().mkdirp;
|
|
49378
49378
|
var pathExists = require_path_exists4().pathExists;
|
|
@@ -49420,7 +49420,7 @@ var require_move5 = __commonJS({
|
|
|
49420
49420
|
overwrite,
|
|
49421
49421
|
errorOnExist: true
|
|
49422
49422
|
};
|
|
49423
|
-
|
|
49423
|
+
copy2(src, dest, opts, (err) => {
|
|
49424
49424
|
if (err) return cb(err);
|
|
49425
49425
|
return remove(src, cb);
|
|
49426
49426
|
});
|
|
@@ -50743,7 +50743,7 @@ var require_parse3 = __commonJS({
|
|
|
50743
50743
|
CHAR_NO_BREAK_SPACE,
|
|
50744
50744
|
CHAR_ZERO_WIDTH_NOBREAK_SPACE
|
|
50745
50745
|
} = require_constants9();
|
|
50746
|
-
var
|
|
50746
|
+
var parse2 = (input, options = {}) => {
|
|
50747
50747
|
if (typeof input !== "string") {
|
|
50748
50748
|
throw new TypeError("Expected a string");
|
|
50749
50749
|
}
|
|
@@ -50945,7 +50945,7 @@ var require_parse3 = __commonJS({
|
|
|
50945
50945
|
push({ type: "eos" });
|
|
50946
50946
|
return ast;
|
|
50947
50947
|
};
|
|
50948
|
-
module2.exports =
|
|
50948
|
+
module2.exports = parse2;
|
|
50949
50949
|
}
|
|
50950
50950
|
});
|
|
50951
50951
|
|
|
@@ -50956,7 +50956,7 @@ var require_braces = __commonJS({
|
|
|
50956
50956
|
var stringify = require_stringify();
|
|
50957
50957
|
var compile = require_compile();
|
|
50958
50958
|
var expand = require_expand();
|
|
50959
|
-
var
|
|
50959
|
+
var parse2 = require_parse3();
|
|
50960
50960
|
var braces = (input, options = {}) => {
|
|
50961
50961
|
let output = [];
|
|
50962
50962
|
if (Array.isArray(input)) {
|
|
@@ -50976,7 +50976,7 @@ var require_braces = __commonJS({
|
|
|
50976
50976
|
}
|
|
50977
50977
|
return output;
|
|
50978
50978
|
};
|
|
50979
|
-
braces.parse = (input, options = {}) =>
|
|
50979
|
+
braces.parse = (input, options = {}) => parse2(input, options);
|
|
50980
50980
|
braces.stringify = (input, options = {}) => {
|
|
50981
50981
|
if (typeof input === "string") {
|
|
50982
50982
|
return stringify(braces.parse(input, options), options);
|
|
@@ -51629,7 +51629,7 @@ var require_parse4 = __commonJS({
|
|
|
51629
51629
|
var syntaxError = (type, char) => {
|
|
51630
51630
|
return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
|
|
51631
51631
|
};
|
|
51632
|
-
var
|
|
51632
|
+
var parse2 = (input, options) => {
|
|
51633
51633
|
if (typeof input !== "string") {
|
|
51634
51634
|
throw new TypeError("Expected a string");
|
|
51635
51635
|
}
|
|
@@ -51778,7 +51778,7 @@ var require_parse4 = __commonJS({
|
|
|
51778
51778
|
output = token.close = `)$))${extglobStar}`;
|
|
51779
51779
|
}
|
|
51780
51780
|
if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
|
|
51781
|
-
const expression =
|
|
51781
|
+
const expression = parse2(rest, { ...options, fastpaths: false }).output;
|
|
51782
51782
|
output = token.close = `)${expression})${extglobStar})`;
|
|
51783
51783
|
}
|
|
51784
51784
|
if (token.prev.type === "bos") {
|
|
@@ -52303,7 +52303,7 @@ var require_parse4 = __commonJS({
|
|
|
52303
52303
|
}
|
|
52304
52304
|
return state;
|
|
52305
52305
|
};
|
|
52306
|
-
|
|
52306
|
+
parse2.fastpaths = (input, options) => {
|
|
52307
52307
|
const opts = { ...options };
|
|
52308
52308
|
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
52309
52309
|
const len = input.length;
|
|
@@ -52369,7 +52369,7 @@ var require_parse4 = __commonJS({
|
|
|
52369
52369
|
}
|
|
52370
52370
|
return source;
|
|
52371
52371
|
};
|
|
52372
|
-
module2.exports =
|
|
52372
|
+
module2.exports = parse2;
|
|
52373
52373
|
}
|
|
52374
52374
|
});
|
|
52375
52375
|
|
|
@@ -52379,7 +52379,7 @@ var require_picomatch = __commonJS({
|
|
|
52379
52379
|
"use strict";
|
|
52380
52380
|
var path5 = require("path");
|
|
52381
52381
|
var scan = require_scan();
|
|
52382
|
-
var
|
|
52382
|
+
var parse2 = require_parse4();
|
|
52383
52383
|
var utils = require_utils6();
|
|
52384
52384
|
var constants2 = require_constants10();
|
|
52385
52385
|
var isObject2 = (val) => val && typeof val === "object" && !Array.isArray(val);
|
|
@@ -52467,7 +52467,7 @@ var require_picomatch = __commonJS({
|
|
|
52467
52467
|
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
|
52468
52468
|
picomatch.parse = (pattern, options) => {
|
|
52469
52469
|
if (Array.isArray(pattern)) return pattern.map((p2) => picomatch.parse(p2, options));
|
|
52470
|
-
return
|
|
52470
|
+
return parse2(pattern, { ...options, fastpaths: false });
|
|
52471
52471
|
};
|
|
52472
52472
|
picomatch.scan = (input, options) => scan(input, options);
|
|
52473
52473
|
picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
|
|
@@ -52493,10 +52493,10 @@ var require_picomatch = __commonJS({
|
|
|
52493
52493
|
}
|
|
52494
52494
|
let parsed = { negated: false, fastpaths: true };
|
|
52495
52495
|
if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) {
|
|
52496
|
-
parsed.output =
|
|
52496
|
+
parsed.output = parse2.fastpaths(input, options);
|
|
52497
52497
|
}
|
|
52498
52498
|
if (!parsed.output) {
|
|
52499
|
-
parsed =
|
|
52499
|
+
parsed = parse2(input, options);
|
|
52500
52500
|
}
|
|
52501
52501
|
return picomatch.compileRe(parsed, options, returnOutput, returnState);
|
|
52502
52502
|
};
|
|
@@ -58611,11 +58611,11 @@ var require_read_yaml_file = __commonJS({
|
|
|
58611
58611
|
var pify = require_pify();
|
|
58612
58612
|
var stripBom = require_strip_bom();
|
|
58613
58613
|
var yaml = require_js_yaml2();
|
|
58614
|
-
var
|
|
58615
|
-
var readYamlFile = (fp) => pify(fs6.readFile)(fp, "utf8").then((data) =>
|
|
58614
|
+
var parse2 = (data) => yaml.safeLoad(stripBom(data));
|
|
58615
|
+
var readYamlFile = (fp) => pify(fs6.readFile)(fp, "utf8").then((data) => parse2(data));
|
|
58616
58616
|
module2.exports = readYamlFile;
|
|
58617
58617
|
module2.exports.default = readYamlFile;
|
|
58618
|
-
module2.exports.sync = (fp) =>
|
|
58618
|
+
module2.exports.sync = (fp) => parse2(fs6.readFileSync(fp, "utf8"));
|
|
58619
58619
|
}
|
|
58620
58620
|
});
|
|
58621
58621
|
|
|
@@ -58695,7 +58695,7 @@ var require_parse5 = __commonJS({
|
|
|
58695
58695
|
}
|
|
58696
58696
|
return result + "\n" + srcline + "\n" + underline;
|
|
58697
58697
|
}
|
|
58698
|
-
function
|
|
58698
|
+
function parse2(input, options) {
|
|
58699
58699
|
var json5 = false;
|
|
58700
58700
|
var cjson = false;
|
|
58701
58701
|
if (options.legacy || options.mode === "json") {
|
|
@@ -59153,7 +59153,7 @@ var require_parse5 = __commonJS({
|
|
|
59153
59153
|
}
|
|
59154
59154
|
}
|
|
59155
59155
|
try {
|
|
59156
|
-
return
|
|
59156
|
+
return parse2(input, options);
|
|
59157
59157
|
} catch (err) {
|
|
59158
59158
|
if (err instanceof SyntaxError && err.row != null && err.column != null) {
|
|
59159
59159
|
var old_err = err;
|
|
@@ -63647,33 +63647,33 @@ var require_stream6 = __commonJS({
|
|
|
63647
63647
|
var require_safe_buffer = __commonJS({
|
|
63648
63648
|
"node_modules/safe-buffer/index.js"(exports2, module2) {
|
|
63649
63649
|
var buffer = require("buffer");
|
|
63650
|
-
var
|
|
63650
|
+
var Buffer5 = buffer.Buffer;
|
|
63651
63651
|
function copyProps(src, dst) {
|
|
63652
63652
|
for (var key2 in src) {
|
|
63653
63653
|
dst[key2] = src[key2];
|
|
63654
63654
|
}
|
|
63655
63655
|
}
|
|
63656
|
-
if (
|
|
63656
|
+
if (Buffer5.from && Buffer5.alloc && Buffer5.allocUnsafe && Buffer5.allocUnsafeSlow) {
|
|
63657
63657
|
module2.exports = buffer;
|
|
63658
63658
|
} else {
|
|
63659
63659
|
copyProps(buffer, exports2);
|
|
63660
63660
|
exports2.Buffer = SafeBuffer;
|
|
63661
63661
|
}
|
|
63662
63662
|
function SafeBuffer(arg, encodingOrOffset, length) {
|
|
63663
|
-
return
|
|
63663
|
+
return Buffer5(arg, encodingOrOffset, length);
|
|
63664
63664
|
}
|
|
63665
|
-
copyProps(
|
|
63665
|
+
copyProps(Buffer5, SafeBuffer);
|
|
63666
63666
|
SafeBuffer.from = function(arg, encodingOrOffset, length) {
|
|
63667
63667
|
if (typeof arg === "number") {
|
|
63668
63668
|
throw new TypeError("Argument must not be a number");
|
|
63669
63669
|
}
|
|
63670
|
-
return
|
|
63670
|
+
return Buffer5(arg, encodingOrOffset, length);
|
|
63671
63671
|
};
|
|
63672
63672
|
SafeBuffer.alloc = function(size, fill, encoding) {
|
|
63673
63673
|
if (typeof size !== "number") {
|
|
63674
63674
|
throw new TypeError("Argument must be a number");
|
|
63675
63675
|
}
|
|
63676
|
-
var buf =
|
|
63676
|
+
var buf = Buffer5(size);
|
|
63677
63677
|
if (fill !== void 0) {
|
|
63678
63678
|
if (typeof encoding === "string") {
|
|
63679
63679
|
buf.fill(fill, encoding);
|
|
@@ -63689,7 +63689,7 @@ var require_safe_buffer = __commonJS({
|
|
|
63689
63689
|
if (typeof size !== "number") {
|
|
63690
63690
|
throw new TypeError("Argument must be a number");
|
|
63691
63691
|
}
|
|
63692
|
-
return
|
|
63692
|
+
return Buffer5(size);
|
|
63693
63693
|
};
|
|
63694
63694
|
SafeBuffer.allocUnsafeSlow = function(size) {
|
|
63695
63695
|
if (typeof size !== "number") {
|
|
@@ -63825,7 +63825,7 @@ var require_BufferList = __commonJS({
|
|
|
63825
63825
|
throw new TypeError("Cannot call a class as a function");
|
|
63826
63826
|
}
|
|
63827
63827
|
}
|
|
63828
|
-
var
|
|
63828
|
+
var Buffer5 = require_safe_buffer().Buffer;
|
|
63829
63829
|
var util = require("util");
|
|
63830
63830
|
function copyBuffer(src, target, offset) {
|
|
63831
63831
|
src.copy(target, offset);
|
|
@@ -63872,8 +63872,8 @@ var require_BufferList = __commonJS({
|
|
|
63872
63872
|
return ret;
|
|
63873
63873
|
};
|
|
63874
63874
|
BufferList.prototype.concat = function concat(n) {
|
|
63875
|
-
if (this.length === 0) return
|
|
63876
|
-
var ret =
|
|
63875
|
+
if (this.length === 0) return Buffer5.alloc(0);
|
|
63876
|
+
var ret = Buffer5.allocUnsafe(n >>> 0);
|
|
63877
63877
|
var p2 = this.head;
|
|
63878
63878
|
var i = 0;
|
|
63879
63879
|
while (p2) {
|
|
@@ -63993,14 +63993,14 @@ var require_stream_writable = __commonJS({
|
|
|
63993
63993
|
deprecate: require_node3()
|
|
63994
63994
|
};
|
|
63995
63995
|
var Stream = require_stream6();
|
|
63996
|
-
var
|
|
63996
|
+
var Buffer5 = require_safe_buffer().Buffer;
|
|
63997
63997
|
var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
|
|
63998
63998
|
};
|
|
63999
63999
|
function _uint8ArrayToBuffer(chunk) {
|
|
64000
|
-
return
|
|
64000
|
+
return Buffer5.from(chunk);
|
|
64001
64001
|
}
|
|
64002
64002
|
function _isUint8Array(obj) {
|
|
64003
|
-
return
|
|
64003
|
+
return Buffer5.isBuffer(obj) || obj instanceof OurUint8Array;
|
|
64004
64004
|
}
|
|
64005
64005
|
var destroyImpl = require_destroy();
|
|
64006
64006
|
util.inherits(Writable, Stream);
|
|
@@ -64122,7 +64122,7 @@ var require_stream_writable = __commonJS({
|
|
|
64122
64122
|
var state = this._writableState;
|
|
64123
64123
|
var ret = false;
|
|
64124
64124
|
var isBuf = !state.objectMode && _isUint8Array(chunk);
|
|
64125
|
-
if (isBuf && !
|
|
64125
|
+
if (isBuf && !Buffer5.isBuffer(chunk)) {
|
|
64126
64126
|
chunk = _uint8ArrayToBuffer(chunk);
|
|
64127
64127
|
}
|
|
64128
64128
|
if (typeof encoding === "function") {
|
|
@@ -64158,7 +64158,7 @@ var require_stream_writable = __commonJS({
|
|
|
64158
64158
|
};
|
|
64159
64159
|
function decodeChunk(state, chunk, encoding) {
|
|
64160
64160
|
if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") {
|
|
64161
|
-
chunk =
|
|
64161
|
+
chunk = Buffer5.from(chunk, encoding);
|
|
64162
64162
|
}
|
|
64163
64163
|
return chunk;
|
|
64164
64164
|
}
|
|
@@ -64491,8 +64491,8 @@ var require_stream_duplex = __commonJS({
|
|
|
64491
64491
|
var require_string_decoder = __commonJS({
|
|
64492
64492
|
"node_modules/string_decoder/lib/string_decoder.js"(exports2) {
|
|
64493
64493
|
"use strict";
|
|
64494
|
-
var
|
|
64495
|
-
var isEncoding =
|
|
64494
|
+
var Buffer5 = require_safe_buffer().Buffer;
|
|
64495
|
+
var isEncoding = Buffer5.isEncoding || function(encoding) {
|
|
64496
64496
|
encoding = "" + encoding;
|
|
64497
64497
|
switch (encoding && encoding.toLowerCase()) {
|
|
64498
64498
|
case "hex":
|
|
@@ -64540,7 +64540,7 @@ var require_string_decoder = __commonJS({
|
|
|
64540
64540
|
}
|
|
64541
64541
|
function normalizeEncoding(enc) {
|
|
64542
64542
|
var nenc = _normalizeEncoding(enc);
|
|
64543
|
-
if (typeof nenc !== "string" && (
|
|
64543
|
+
if (typeof nenc !== "string" && (Buffer5.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc);
|
|
64544
64544
|
return nenc || enc;
|
|
64545
64545
|
}
|
|
64546
64546
|
exports2.StringDecoder = StringDecoder;
|
|
@@ -64569,7 +64569,7 @@ var require_string_decoder = __commonJS({
|
|
|
64569
64569
|
}
|
|
64570
64570
|
this.lastNeed = 0;
|
|
64571
64571
|
this.lastTotal = 0;
|
|
64572
|
-
this.lastChar =
|
|
64572
|
+
this.lastChar = Buffer5.allocUnsafe(nb);
|
|
64573
64573
|
}
|
|
64574
64574
|
StringDecoder.prototype.write = function(buf) {
|
|
64575
64575
|
if (buf.length === 0) return "";
|
|
@@ -64739,14 +64739,14 @@ var require_stream_readable = __commonJS({
|
|
|
64739
64739
|
return emitter.listeners(type).length;
|
|
64740
64740
|
};
|
|
64741
64741
|
var Stream = require_stream6();
|
|
64742
|
-
var
|
|
64742
|
+
var Buffer5 = require_safe_buffer().Buffer;
|
|
64743
64743
|
var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
|
|
64744
64744
|
};
|
|
64745
64745
|
function _uint8ArrayToBuffer(chunk) {
|
|
64746
|
-
return
|
|
64746
|
+
return Buffer5.from(chunk);
|
|
64747
64747
|
}
|
|
64748
64748
|
function _isUint8Array(obj) {
|
|
64749
|
-
return
|
|
64749
|
+
return Buffer5.isBuffer(obj) || obj instanceof OurUint8Array;
|
|
64750
64750
|
}
|
|
64751
64751
|
var util = Object.create(require_util4());
|
|
64752
64752
|
util.inherits = require_inherits();
|
|
@@ -64845,7 +64845,7 @@ var require_stream_readable = __commonJS({
|
|
|
64845
64845
|
if (typeof chunk === "string") {
|
|
64846
64846
|
encoding = encoding || state.defaultEncoding;
|
|
64847
64847
|
if (encoding !== state.encoding) {
|
|
64848
|
-
chunk =
|
|
64848
|
+
chunk = Buffer5.from(chunk, encoding);
|
|
64849
64849
|
encoding = "";
|
|
64850
64850
|
}
|
|
64851
64851
|
skipChunkCheck = true;
|
|
@@ -64869,7 +64869,7 @@ var require_stream_readable = __commonJS({
|
|
|
64869
64869
|
if (er) {
|
|
64870
64870
|
stream.emit("error", er);
|
|
64871
64871
|
} else if (state.objectMode || chunk && chunk.length > 0) {
|
|
64872
|
-
if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !==
|
|
64872
|
+
if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer5.prototype) {
|
|
64873
64873
|
chunk = _uint8ArrayToBuffer(chunk);
|
|
64874
64874
|
}
|
|
64875
64875
|
if (addToFront) {
|
|
@@ -65361,7 +65361,7 @@ var require_stream_readable = __commonJS({
|
|
|
65361
65361
|
return ret;
|
|
65362
65362
|
}
|
|
65363
65363
|
function copyFromBuffer(n, list) {
|
|
65364
|
-
var ret =
|
|
65364
|
+
var ret = Buffer5.allocUnsafe(n);
|
|
65365
65365
|
var p2 = list.head;
|
|
65366
65366
|
var c2 = 1;
|
|
65367
65367
|
p2.data.copy(ret);
|
|
@@ -69968,7 +69968,7 @@ var require_inftrees = __commonJS({
|
|
|
69968
69968
|
var MAXBITS = 15;
|
|
69969
69969
|
var ENOUGH_LENS = 852;
|
|
69970
69970
|
var ENOUGH_DISTS = 592;
|
|
69971
|
-
var
|
|
69971
|
+
var CODES2 = 0;
|
|
69972
69972
|
var LENS = 1;
|
|
69973
69973
|
var DISTS = 2;
|
|
69974
69974
|
var lbase = [
|
|
@@ -70170,7 +70170,7 @@ var require_inftrees = __commonJS({
|
|
|
70170
70170
|
return -1;
|
|
70171
70171
|
}
|
|
70172
70172
|
}
|
|
70173
|
-
if (left > 0 && (type ===
|
|
70173
|
+
if (left > 0 && (type === CODES2 || max !== 1)) {
|
|
70174
70174
|
return -1;
|
|
70175
70175
|
}
|
|
70176
70176
|
offs[1] = 0;
|
|
@@ -70182,7 +70182,7 @@ var require_inftrees = __commonJS({
|
|
|
70182
70182
|
work[offs[lens[lens_index + sym]]++] = sym;
|
|
70183
70183
|
}
|
|
70184
70184
|
}
|
|
70185
|
-
if (type ===
|
|
70185
|
+
if (type === CODES2) {
|
|
70186
70186
|
base = extra = work;
|
|
70187
70187
|
end = 19;
|
|
70188
70188
|
} else if (type === LENS) {
|
|
@@ -70285,7 +70285,7 @@ var require_inflate = __commonJS({
|
|
|
70285
70285
|
var crc32 = require_crc322();
|
|
70286
70286
|
var inflate_fast = require_inffast();
|
|
70287
70287
|
var inflate_table = require_inftrees();
|
|
70288
|
-
var
|
|
70288
|
+
var CODES2 = 0;
|
|
70289
70289
|
var LENS = 1;
|
|
70290
70290
|
var DISTS = 2;
|
|
70291
70291
|
var Z_FINISH = 4;
|
|
@@ -70488,7 +70488,7 @@ var require_inflate = __commonJS({
|
|
|
70488
70488
|
state.distcode = distfix;
|
|
70489
70489
|
state.distbits = 5;
|
|
70490
70490
|
}
|
|
70491
|
-
function updatewindow(strm, src, end,
|
|
70491
|
+
function updatewindow(strm, src, end, copy2) {
|
|
70492
70492
|
var dist;
|
|
70493
70493
|
var state = strm.state;
|
|
70494
70494
|
if (state.window === null) {
|
|
@@ -70497,20 +70497,20 @@ var require_inflate = __commonJS({
|
|
|
70497
70497
|
state.whave = 0;
|
|
70498
70498
|
state.window = new utils.Buf8(state.wsize);
|
|
70499
70499
|
}
|
|
70500
|
-
if (
|
|
70500
|
+
if (copy2 >= state.wsize) {
|
|
70501
70501
|
utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);
|
|
70502
70502
|
state.wnext = 0;
|
|
70503
70503
|
state.whave = state.wsize;
|
|
70504
70504
|
} else {
|
|
70505
70505
|
dist = state.wsize - state.wnext;
|
|
70506
|
-
if (dist >
|
|
70507
|
-
dist =
|
|
70508
|
-
}
|
|
70509
|
-
utils.arraySet(state.window, src, end -
|
|
70510
|
-
|
|
70511
|
-
if (
|
|
70512
|
-
utils.arraySet(state.window, src, end -
|
|
70513
|
-
state.wnext =
|
|
70506
|
+
if (dist > copy2) {
|
|
70507
|
+
dist = copy2;
|
|
70508
|
+
}
|
|
70509
|
+
utils.arraySet(state.window, src, end - copy2, dist, state.wnext);
|
|
70510
|
+
copy2 -= dist;
|
|
70511
|
+
if (copy2) {
|
|
70512
|
+
utils.arraySet(state.window, src, end - copy2, copy2, 0);
|
|
70513
|
+
state.wnext = copy2;
|
|
70514
70514
|
state.whave = state.wsize;
|
|
70515
70515
|
} else {
|
|
70516
70516
|
state.wnext += dist;
|
|
@@ -70533,7 +70533,7 @@ var require_inflate = __commonJS({
|
|
|
70533
70533
|
var hold;
|
|
70534
70534
|
var bits;
|
|
70535
70535
|
var _in, _out;
|
|
70536
|
-
var
|
|
70536
|
+
var copy2;
|
|
70537
70537
|
var from;
|
|
70538
70538
|
var from_source;
|
|
70539
70539
|
var here = 0;
|
|
@@ -70724,11 +70724,11 @@ var require_inflate = __commonJS({
|
|
|
70724
70724
|
state.mode = EXTRA;
|
|
70725
70725
|
case EXTRA:
|
|
70726
70726
|
if (state.flags & 1024) {
|
|
70727
|
-
|
|
70728
|
-
if (
|
|
70729
|
-
|
|
70727
|
+
copy2 = state.length;
|
|
70728
|
+
if (copy2 > have) {
|
|
70729
|
+
copy2 = have;
|
|
70730
70730
|
}
|
|
70731
|
-
if (
|
|
70731
|
+
if (copy2) {
|
|
70732
70732
|
if (state.head) {
|
|
70733
70733
|
len = state.head.extra_len - state.length;
|
|
70734
70734
|
if (!state.head.extra) {
|
|
@@ -70740,17 +70740,17 @@ var require_inflate = __commonJS({
|
|
|
70740
70740
|
next,
|
|
70741
70741
|
// extra field is limited to 65536 bytes
|
|
70742
70742
|
// - no need for additional size check
|
|
70743
|
-
|
|
70743
|
+
copy2,
|
|
70744
70744
|
/*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/
|
|
70745
70745
|
len
|
|
70746
70746
|
);
|
|
70747
70747
|
}
|
|
70748
70748
|
if (state.flags & 512) {
|
|
70749
|
-
state.check = crc32(state.check, input,
|
|
70749
|
+
state.check = crc32(state.check, input, copy2, next);
|
|
70750
70750
|
}
|
|
70751
|
-
have -=
|
|
70752
|
-
next +=
|
|
70753
|
-
state.length -=
|
|
70751
|
+
have -= copy2;
|
|
70752
|
+
next += copy2;
|
|
70753
|
+
state.length -= copy2;
|
|
70754
70754
|
}
|
|
70755
70755
|
if (state.length) {
|
|
70756
70756
|
break inf_leave;
|
|
@@ -70763,18 +70763,18 @@ var require_inflate = __commonJS({
|
|
|
70763
70763
|
if (have === 0) {
|
|
70764
70764
|
break inf_leave;
|
|
70765
70765
|
}
|
|
70766
|
-
|
|
70766
|
+
copy2 = 0;
|
|
70767
70767
|
do {
|
|
70768
|
-
len = input[next +
|
|
70768
|
+
len = input[next + copy2++];
|
|
70769
70769
|
if (state.head && len && state.length < 65536) {
|
|
70770
70770
|
state.head.name += String.fromCharCode(len);
|
|
70771
70771
|
}
|
|
70772
|
-
} while (len &&
|
|
70772
|
+
} while (len && copy2 < have);
|
|
70773
70773
|
if (state.flags & 512) {
|
|
70774
|
-
state.check = crc32(state.check, input,
|
|
70774
|
+
state.check = crc32(state.check, input, copy2, next);
|
|
70775
70775
|
}
|
|
70776
|
-
have -=
|
|
70777
|
-
next +=
|
|
70776
|
+
have -= copy2;
|
|
70777
|
+
next += copy2;
|
|
70778
70778
|
if (len) {
|
|
70779
70779
|
break inf_leave;
|
|
70780
70780
|
}
|
|
@@ -70788,18 +70788,18 @@ var require_inflate = __commonJS({
|
|
|
70788
70788
|
if (have === 0) {
|
|
70789
70789
|
break inf_leave;
|
|
70790
70790
|
}
|
|
70791
|
-
|
|
70791
|
+
copy2 = 0;
|
|
70792
70792
|
do {
|
|
70793
|
-
len = input[next +
|
|
70793
|
+
len = input[next + copy2++];
|
|
70794
70794
|
if (state.head && len && state.length < 65536) {
|
|
70795
70795
|
state.head.comment += String.fromCharCode(len);
|
|
70796
70796
|
}
|
|
70797
|
-
} while (len &&
|
|
70797
|
+
} while (len && copy2 < have);
|
|
70798
70798
|
if (state.flags & 512) {
|
|
70799
|
-
state.check = crc32(state.check, input,
|
|
70799
|
+
state.check = crc32(state.check, input, copy2, next);
|
|
70800
70800
|
}
|
|
70801
|
-
have -=
|
|
70802
|
-
next +=
|
|
70801
|
+
have -= copy2;
|
|
70802
|
+
next += copy2;
|
|
70803
70803
|
if (len) {
|
|
70804
70804
|
break inf_leave;
|
|
70805
70805
|
}
|
|
@@ -70928,23 +70928,23 @@ var require_inflate = __commonJS({
|
|
|
70928
70928
|
case COPY_:
|
|
70929
70929
|
state.mode = COPY;
|
|
70930
70930
|
case COPY:
|
|
70931
|
-
|
|
70932
|
-
if (
|
|
70933
|
-
if (
|
|
70934
|
-
|
|
70931
|
+
copy2 = state.length;
|
|
70932
|
+
if (copy2) {
|
|
70933
|
+
if (copy2 > have) {
|
|
70934
|
+
copy2 = have;
|
|
70935
70935
|
}
|
|
70936
|
-
if (
|
|
70937
|
-
|
|
70936
|
+
if (copy2 > left) {
|
|
70937
|
+
copy2 = left;
|
|
70938
70938
|
}
|
|
70939
|
-
if (
|
|
70939
|
+
if (copy2 === 0) {
|
|
70940
70940
|
break inf_leave;
|
|
70941
70941
|
}
|
|
70942
|
-
utils.arraySet(output, input, next,
|
|
70943
|
-
have -=
|
|
70944
|
-
next +=
|
|
70945
|
-
left -=
|
|
70946
|
-
put +=
|
|
70947
|
-
state.length -=
|
|
70942
|
+
utils.arraySet(output, input, next, copy2, put);
|
|
70943
|
+
have -= copy2;
|
|
70944
|
+
next += copy2;
|
|
70945
|
+
left -= copy2;
|
|
70946
|
+
put += copy2;
|
|
70947
|
+
state.length -= copy2;
|
|
70948
70948
|
break;
|
|
70949
70949
|
}
|
|
70950
70950
|
state.mode = TYPE;
|
|
@@ -70994,7 +70994,7 @@ var require_inflate = __commonJS({
|
|
|
70994
70994
|
state.lencode = state.lendyn;
|
|
70995
70995
|
state.lenbits = 7;
|
|
70996
70996
|
opts = { bits: state.lenbits };
|
|
70997
|
-
ret = inflate_table(
|
|
70997
|
+
ret = inflate_table(CODES2, state.lens, 0, 19, state.lencode, 0, state.work, opts);
|
|
70998
70998
|
state.lenbits = opts.bits;
|
|
70999
70999
|
if (ret) {
|
|
71000
71000
|
strm.msg = "invalid code lengths set";
|
|
@@ -71043,7 +71043,7 @@ var require_inflate = __commonJS({
|
|
|
71043
71043
|
break;
|
|
71044
71044
|
}
|
|
71045
71045
|
len = state.lens[state.have - 1];
|
|
71046
|
-
|
|
71046
|
+
copy2 = 3 + (hold & 3);
|
|
71047
71047
|
hold >>>= 2;
|
|
71048
71048
|
bits -= 2;
|
|
71049
71049
|
} else if (here_val === 17) {
|
|
@@ -71059,7 +71059,7 @@ var require_inflate = __commonJS({
|
|
|
71059
71059
|
hold >>>= here_bits;
|
|
71060
71060
|
bits -= here_bits;
|
|
71061
71061
|
len = 0;
|
|
71062
|
-
|
|
71062
|
+
copy2 = 3 + (hold & 7);
|
|
71063
71063
|
hold >>>= 3;
|
|
71064
71064
|
bits -= 3;
|
|
71065
71065
|
} else {
|
|
@@ -71075,16 +71075,16 @@ var require_inflate = __commonJS({
|
|
|
71075
71075
|
hold >>>= here_bits;
|
|
71076
71076
|
bits -= here_bits;
|
|
71077
71077
|
len = 0;
|
|
71078
|
-
|
|
71078
|
+
copy2 = 11 + (hold & 127);
|
|
71079
71079
|
hold >>>= 7;
|
|
71080
71080
|
bits -= 7;
|
|
71081
71081
|
}
|
|
71082
|
-
if (state.have +
|
|
71082
|
+
if (state.have + copy2 > state.nlen + state.ndist) {
|
|
71083
71083
|
strm.msg = "invalid bit length repeat";
|
|
71084
71084
|
state.mode = BAD;
|
|
71085
71085
|
break;
|
|
71086
71086
|
}
|
|
71087
|
-
while (
|
|
71087
|
+
while (copy2--) {
|
|
71088
71088
|
state.lens[state.have++] = len;
|
|
71089
71089
|
}
|
|
71090
71090
|
}
|
|
@@ -71297,39 +71297,39 @@ var require_inflate = __commonJS({
|
|
|
71297
71297
|
if (left === 0) {
|
|
71298
71298
|
break inf_leave;
|
|
71299
71299
|
}
|
|
71300
|
-
|
|
71301
|
-
if (state.offset >
|
|
71302
|
-
|
|
71303
|
-
if (
|
|
71300
|
+
copy2 = _out - left;
|
|
71301
|
+
if (state.offset > copy2) {
|
|
71302
|
+
copy2 = state.offset - copy2;
|
|
71303
|
+
if (copy2 > state.whave) {
|
|
71304
71304
|
if (state.sane) {
|
|
71305
71305
|
strm.msg = "invalid distance too far back";
|
|
71306
71306
|
state.mode = BAD;
|
|
71307
71307
|
break;
|
|
71308
71308
|
}
|
|
71309
71309
|
}
|
|
71310
|
-
if (
|
|
71311
|
-
|
|
71312
|
-
from = state.wsize -
|
|
71310
|
+
if (copy2 > state.wnext) {
|
|
71311
|
+
copy2 -= state.wnext;
|
|
71312
|
+
from = state.wsize - copy2;
|
|
71313
71313
|
} else {
|
|
71314
|
-
from = state.wnext -
|
|
71314
|
+
from = state.wnext - copy2;
|
|
71315
71315
|
}
|
|
71316
|
-
if (
|
|
71317
|
-
|
|
71316
|
+
if (copy2 > state.length) {
|
|
71317
|
+
copy2 = state.length;
|
|
71318
71318
|
}
|
|
71319
71319
|
from_source = state.window;
|
|
71320
71320
|
} else {
|
|
71321
71321
|
from_source = output;
|
|
71322
71322
|
from = put - state.offset;
|
|
71323
|
-
|
|
71323
|
+
copy2 = state.length;
|
|
71324
71324
|
}
|
|
71325
|
-
if (
|
|
71326
|
-
|
|
71325
|
+
if (copy2 > left) {
|
|
71326
|
+
copy2 = left;
|
|
71327
71327
|
}
|
|
71328
|
-
left -=
|
|
71329
|
-
state.length -=
|
|
71328
|
+
left -= copy2;
|
|
71329
|
+
state.length -= copy2;
|
|
71330
71330
|
do {
|
|
71331
71331
|
output[put++] = from_source[from++];
|
|
71332
|
-
} while (--
|
|
71332
|
+
} while (--copy2);
|
|
71333
71333
|
if (state.length === 0) {
|
|
71334
71334
|
state.mode = LEN;
|
|
71335
71335
|
}
|
|
@@ -73876,12 +73876,12 @@ var require_buffer_list = __commonJS({
|
|
|
73876
73876
|
return (hint === "string" ? String : Number)(input);
|
|
73877
73877
|
}
|
|
73878
73878
|
var _require = require("buffer");
|
|
73879
|
-
var
|
|
73879
|
+
var Buffer5 = _require.Buffer;
|
|
73880
73880
|
var _require2 = require("util");
|
|
73881
73881
|
var inspect = _require2.inspect;
|
|
73882
73882
|
var custom = inspect && inspect.custom || "inspect";
|
|
73883
73883
|
function copyBuffer(src, target, offset) {
|
|
73884
|
-
|
|
73884
|
+
Buffer5.prototype.copy.call(src, target, offset);
|
|
73885
73885
|
}
|
|
73886
73886
|
module2.exports = /* @__PURE__ */ function() {
|
|
73887
73887
|
function BufferList() {
|
|
@@ -73941,8 +73941,8 @@ var require_buffer_list = __commonJS({
|
|
|
73941
73941
|
}, {
|
|
73942
73942
|
key: "concat",
|
|
73943
73943
|
value: function concat(n) {
|
|
73944
|
-
if (this.length === 0) return
|
|
73945
|
-
var ret =
|
|
73944
|
+
if (this.length === 0) return Buffer5.alloc(0);
|
|
73945
|
+
var ret = Buffer5.allocUnsafe(n >>> 0);
|
|
73946
73946
|
var p2 = this.head;
|
|
73947
73947
|
var i = 0;
|
|
73948
73948
|
while (p2) {
|
|
@@ -74006,7 +74006,7 @@ var require_buffer_list = __commonJS({
|
|
|
74006
74006
|
}, {
|
|
74007
74007
|
key: "_getBuffer",
|
|
74008
74008
|
value: function _getBuffer(n) {
|
|
74009
|
-
var ret =
|
|
74009
|
+
var ret = Buffer5.allocUnsafe(n);
|
|
74010
74010
|
var p2 = this.head;
|
|
74011
74011
|
var c2 = 1;
|
|
74012
74012
|
p2.data.copy(ret);
|
|
@@ -74282,14 +74282,14 @@ var require_stream_writable2 = __commonJS({
|
|
|
74282
74282
|
deprecate: require_node3()
|
|
74283
74283
|
};
|
|
74284
74284
|
var Stream = require_stream7();
|
|
74285
|
-
var
|
|
74285
|
+
var Buffer5 = require("buffer").Buffer;
|
|
74286
74286
|
var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
|
|
74287
74287
|
};
|
|
74288
74288
|
function _uint8ArrayToBuffer(chunk) {
|
|
74289
|
-
return
|
|
74289
|
+
return Buffer5.from(chunk);
|
|
74290
74290
|
}
|
|
74291
74291
|
function _isUint8Array(obj) {
|
|
74292
|
-
return
|
|
74292
|
+
return Buffer5.isBuffer(obj) || obj instanceof OurUint8Array;
|
|
74293
74293
|
}
|
|
74294
74294
|
var destroyImpl = require_destroy2();
|
|
74295
74295
|
var _require = require_state();
|
|
@@ -74417,7 +74417,7 @@ var require_stream_writable2 = __commonJS({
|
|
|
74417
74417
|
var state = this._writableState;
|
|
74418
74418
|
var ret = false;
|
|
74419
74419
|
var isBuf = !state.objectMode && _isUint8Array(chunk);
|
|
74420
|
-
if (isBuf && !
|
|
74420
|
+
if (isBuf && !Buffer5.isBuffer(chunk)) {
|
|
74421
74421
|
chunk = _uint8ArrayToBuffer(chunk);
|
|
74422
74422
|
}
|
|
74423
74423
|
if (typeof encoding === "function") {
|
|
@@ -74461,7 +74461,7 @@ var require_stream_writable2 = __commonJS({
|
|
|
74461
74461
|
});
|
|
74462
74462
|
function decodeChunk(state, chunk, encoding) {
|
|
74463
74463
|
if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") {
|
|
74464
|
-
chunk =
|
|
74464
|
+
chunk = Buffer5.from(chunk, encoding);
|
|
74465
74465
|
}
|
|
74466
74466
|
return chunk;
|
|
74467
74467
|
}
|
|
@@ -74831,34 +74831,34 @@ var require_stream_duplex2 = __commonJS({
|
|
|
74831
74831
|
var require_safe_buffer2 = __commonJS({
|
|
74832
74832
|
"node_modules/crc32-stream/node_modules/readable-stream/node_modules/string_decoder/node_modules/safe-buffer/index.js"(exports2, module2) {
|
|
74833
74833
|
var buffer = require("buffer");
|
|
74834
|
-
var
|
|
74834
|
+
var Buffer5 = buffer.Buffer;
|
|
74835
74835
|
function copyProps(src, dst) {
|
|
74836
74836
|
for (var key2 in src) {
|
|
74837
74837
|
dst[key2] = src[key2];
|
|
74838
74838
|
}
|
|
74839
74839
|
}
|
|
74840
|
-
if (
|
|
74840
|
+
if (Buffer5.from && Buffer5.alloc && Buffer5.allocUnsafe && Buffer5.allocUnsafeSlow) {
|
|
74841
74841
|
module2.exports = buffer;
|
|
74842
74842
|
} else {
|
|
74843
74843
|
copyProps(buffer, exports2);
|
|
74844
74844
|
exports2.Buffer = SafeBuffer;
|
|
74845
74845
|
}
|
|
74846
74846
|
function SafeBuffer(arg, encodingOrOffset, length) {
|
|
74847
|
-
return
|
|
74847
|
+
return Buffer5(arg, encodingOrOffset, length);
|
|
74848
74848
|
}
|
|
74849
|
-
SafeBuffer.prototype = Object.create(
|
|
74850
|
-
copyProps(
|
|
74849
|
+
SafeBuffer.prototype = Object.create(Buffer5.prototype);
|
|
74850
|
+
copyProps(Buffer5, SafeBuffer);
|
|
74851
74851
|
SafeBuffer.from = function(arg, encodingOrOffset, length) {
|
|
74852
74852
|
if (typeof arg === "number") {
|
|
74853
74853
|
throw new TypeError("Argument must not be a number");
|
|
74854
74854
|
}
|
|
74855
|
-
return
|
|
74855
|
+
return Buffer5(arg, encodingOrOffset, length);
|
|
74856
74856
|
};
|
|
74857
74857
|
SafeBuffer.alloc = function(size, fill, encoding) {
|
|
74858
74858
|
if (typeof size !== "number") {
|
|
74859
74859
|
throw new TypeError("Argument must be a number");
|
|
74860
74860
|
}
|
|
74861
|
-
var buf =
|
|
74861
|
+
var buf = Buffer5(size);
|
|
74862
74862
|
if (fill !== void 0) {
|
|
74863
74863
|
if (typeof encoding === "string") {
|
|
74864
74864
|
buf.fill(fill, encoding);
|
|
@@ -74874,7 +74874,7 @@ var require_safe_buffer2 = __commonJS({
|
|
|
74874
74874
|
if (typeof size !== "number") {
|
|
74875
74875
|
throw new TypeError("Argument must be a number");
|
|
74876
74876
|
}
|
|
74877
|
-
return
|
|
74877
|
+
return Buffer5(size);
|
|
74878
74878
|
};
|
|
74879
74879
|
SafeBuffer.allocUnsafeSlow = function(size) {
|
|
74880
74880
|
if (typeof size !== "number") {
|
|
@@ -74889,8 +74889,8 @@ var require_safe_buffer2 = __commonJS({
|
|
|
74889
74889
|
var require_string_decoder2 = __commonJS({
|
|
74890
74890
|
"node_modules/crc32-stream/node_modules/readable-stream/node_modules/string_decoder/lib/string_decoder.js"(exports2) {
|
|
74891
74891
|
"use strict";
|
|
74892
|
-
var
|
|
74893
|
-
var isEncoding =
|
|
74892
|
+
var Buffer5 = require_safe_buffer2().Buffer;
|
|
74893
|
+
var isEncoding = Buffer5.isEncoding || function(encoding) {
|
|
74894
74894
|
encoding = "" + encoding;
|
|
74895
74895
|
switch (encoding && encoding.toLowerCase()) {
|
|
74896
74896
|
case "hex":
|
|
@@ -74938,7 +74938,7 @@ var require_string_decoder2 = __commonJS({
|
|
|
74938
74938
|
}
|
|
74939
74939
|
function normalizeEncoding(enc) {
|
|
74940
74940
|
var nenc = _normalizeEncoding(enc);
|
|
74941
|
-
if (typeof nenc !== "string" && (
|
|
74941
|
+
if (typeof nenc !== "string" && (Buffer5.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc);
|
|
74942
74942
|
return nenc || enc;
|
|
74943
74943
|
}
|
|
74944
74944
|
exports2.StringDecoder = StringDecoder;
|
|
@@ -74967,7 +74967,7 @@ var require_string_decoder2 = __commonJS({
|
|
|
74967
74967
|
}
|
|
74968
74968
|
this.lastNeed = 0;
|
|
74969
74969
|
this.lastTotal = 0;
|
|
74970
|
-
this.lastChar =
|
|
74970
|
+
this.lastChar = Buffer5.allocUnsafe(nb);
|
|
74971
74971
|
}
|
|
74972
74972
|
StringDecoder.prototype.write = function(buf) {
|
|
74973
74973
|
if (buf.length === 0) return "";
|
|
@@ -75528,14 +75528,14 @@ var require_stream_readable2 = __commonJS({
|
|
|
75528
75528
|
return emitter.listeners(type).length;
|
|
75529
75529
|
};
|
|
75530
75530
|
var Stream = require_stream7();
|
|
75531
|
-
var
|
|
75531
|
+
var Buffer5 = require("buffer").Buffer;
|
|
75532
75532
|
var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
|
|
75533
75533
|
};
|
|
75534
75534
|
function _uint8ArrayToBuffer(chunk) {
|
|
75535
|
-
return
|
|
75535
|
+
return Buffer5.from(chunk);
|
|
75536
75536
|
}
|
|
75537
75537
|
function _isUint8Array(obj) {
|
|
75538
|
-
return
|
|
75538
|
+
return Buffer5.isBuffer(obj) || obj instanceof OurUint8Array;
|
|
75539
75539
|
}
|
|
75540
75540
|
var debugUtil = require("util");
|
|
75541
75541
|
var debug;
|
|
@@ -75643,7 +75643,7 @@ var require_stream_readable2 = __commonJS({
|
|
|
75643
75643
|
if (typeof chunk === "string") {
|
|
75644
75644
|
encoding = encoding || state.defaultEncoding;
|
|
75645
75645
|
if (encoding !== state.encoding) {
|
|
75646
|
-
chunk =
|
|
75646
|
+
chunk = Buffer5.from(chunk, encoding);
|
|
75647
75647
|
encoding = "";
|
|
75648
75648
|
}
|
|
75649
75649
|
skipChunkCheck = true;
|
|
@@ -75668,7 +75668,7 @@ var require_stream_readable2 = __commonJS({
|
|
|
75668
75668
|
if (er) {
|
|
75669
75669
|
errorOrDestroy(stream, er);
|
|
75670
75670
|
} else if (state.objectMode || chunk && chunk.length > 0) {
|
|
75671
|
-
if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !==
|
|
75671
|
+
if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer5.prototype) {
|
|
75672
75672
|
chunk = _uint8ArrayToBuffer(chunk);
|
|
75673
75673
|
}
|
|
75674
75674
|
if (addToFront) {
|
|
@@ -77802,34 +77802,34 @@ var require_progress_stream = __commonJS({
|
|
|
77802
77802
|
var require_safe_buffer3 = __commonJS({
|
|
77803
77803
|
"node_modules/tunnel-agent/node_modules/safe-buffer/index.js"(exports2, module2) {
|
|
77804
77804
|
var buffer = require("buffer");
|
|
77805
|
-
var
|
|
77805
|
+
var Buffer5 = buffer.Buffer;
|
|
77806
77806
|
function copyProps(src, dst) {
|
|
77807
77807
|
for (var key2 in src) {
|
|
77808
77808
|
dst[key2] = src[key2];
|
|
77809
77809
|
}
|
|
77810
77810
|
}
|
|
77811
|
-
if (
|
|
77811
|
+
if (Buffer5.from && Buffer5.alloc && Buffer5.allocUnsafe && Buffer5.allocUnsafeSlow) {
|
|
77812
77812
|
module2.exports = buffer;
|
|
77813
77813
|
} else {
|
|
77814
77814
|
copyProps(buffer, exports2);
|
|
77815
77815
|
exports2.Buffer = SafeBuffer;
|
|
77816
77816
|
}
|
|
77817
77817
|
function SafeBuffer(arg, encodingOrOffset, length) {
|
|
77818
|
-
return
|
|
77818
|
+
return Buffer5(arg, encodingOrOffset, length);
|
|
77819
77819
|
}
|
|
77820
|
-
SafeBuffer.prototype = Object.create(
|
|
77821
|
-
copyProps(
|
|
77820
|
+
SafeBuffer.prototype = Object.create(Buffer5.prototype);
|
|
77821
|
+
copyProps(Buffer5, SafeBuffer);
|
|
77822
77822
|
SafeBuffer.from = function(arg, encodingOrOffset, length) {
|
|
77823
77823
|
if (typeof arg === "number") {
|
|
77824
77824
|
throw new TypeError("Argument must not be a number");
|
|
77825
77825
|
}
|
|
77826
|
-
return
|
|
77826
|
+
return Buffer5(arg, encodingOrOffset, length);
|
|
77827
77827
|
};
|
|
77828
77828
|
SafeBuffer.alloc = function(size, fill, encoding) {
|
|
77829
77829
|
if (typeof size !== "number") {
|
|
77830
77830
|
throw new TypeError("Argument must be a number");
|
|
77831
77831
|
}
|
|
77832
|
-
var buf =
|
|
77832
|
+
var buf = Buffer5(size);
|
|
77833
77833
|
if (fill !== void 0) {
|
|
77834
77834
|
if (typeof encoding === "string") {
|
|
77835
77835
|
buf.fill(fill, encoding);
|
|
@@ -77845,7 +77845,7 @@ var require_safe_buffer3 = __commonJS({
|
|
|
77845
77845
|
if (typeof size !== "number") {
|
|
77846
77846
|
throw new TypeError("Argument must be a number");
|
|
77847
77847
|
}
|
|
77848
|
-
return
|
|
77848
|
+
return Buffer5(size);
|
|
77849
77849
|
};
|
|
77850
77850
|
SafeBuffer.allocUnsafeSlow = function(size) {
|
|
77851
77851
|
if (typeof size !== "number") {
|
|
@@ -77867,7 +77867,7 @@ var require_tunnel_agent = __commonJS({
|
|
|
77867
77867
|
var events = require("events");
|
|
77868
77868
|
var assert = require("assert");
|
|
77869
77869
|
var util = require("util");
|
|
77870
|
-
var
|
|
77870
|
+
var Buffer5 = require_safe_buffer3().Buffer;
|
|
77871
77871
|
exports2.httpOverHttp = httpOverHttp;
|
|
77872
77872
|
exports2.httpsOverHttp = httpsOverHttp;
|
|
77873
77873
|
exports2.httpOverHttps = httpOverHttps;
|
|
@@ -77965,7 +77965,7 @@ var require_tunnel_agent = __commonJS({
|
|
|
77965
77965
|
);
|
|
77966
77966
|
if (connectOptions.proxyAuth) {
|
|
77967
77967
|
connectOptions.headers = connectOptions.headers || {};
|
|
77968
|
-
connectOptions.headers["Proxy-Authorization"] = "Basic " +
|
|
77968
|
+
connectOptions.headers["Proxy-Authorization"] = "Basic " + Buffer5.from(connectOptions.proxyAuth).toString("base64");
|
|
77969
77969
|
}
|
|
77970
77970
|
debug("making CONNECT request");
|
|
77971
77971
|
var connectReq = self2.request(connectOptions);
|
|
@@ -79551,7 +79551,7 @@ var require_utils12 = __commonJS({
|
|
|
79551
79551
|
var ini = require_ini();
|
|
79552
79552
|
var path5 = require("path");
|
|
79553
79553
|
var stripJsonComments = require_strip_json_comments();
|
|
79554
|
-
var
|
|
79554
|
+
var parse2 = exports2.parse = function(content) {
|
|
79555
79555
|
if (/^\s*{/.test(content))
|
|
79556
79556
|
return JSON.parse(stripJsonComments(content));
|
|
79557
79557
|
return ini.parse(content);
|
|
@@ -79573,7 +79573,7 @@ var require_utils12 = __commonJS({
|
|
|
79573
79573
|
};
|
|
79574
79574
|
var json = exports2.json = function() {
|
|
79575
79575
|
var content = file.apply(null, arguments);
|
|
79576
|
-
return content ?
|
|
79576
|
+
return content ? parse2(content) : null;
|
|
79577
79577
|
};
|
|
79578
79578
|
var env = exports2.env = function(prefix, env2) {
|
|
79579
79579
|
env2 = env2 || process.env;
|
|
@@ -79930,13 +79930,13 @@ var require_rc = __commonJS({
|
|
|
79930
79930
|
var etc = "/etc";
|
|
79931
79931
|
var win = process.platform === "win32";
|
|
79932
79932
|
var home = win ? process.env.USERPROFILE : process.env.HOME;
|
|
79933
|
-
module2.exports = function(name, defaults, argv,
|
|
79933
|
+
module2.exports = function(name, defaults, argv, parse2) {
|
|
79934
79934
|
if ("string" !== typeof name)
|
|
79935
79935
|
throw new Error("rc(name): name *must* be string");
|
|
79936
79936
|
if (!argv)
|
|
79937
79937
|
argv = require_minimist()(process.argv.slice(2));
|
|
79938
79938
|
defaults = ("string" === typeof defaults ? cc.json(defaults) : defaults) || {};
|
|
79939
|
-
|
|
79939
|
+
parse2 = parse2 || cc.parse;
|
|
79940
79940
|
var env = cc.env(name + "_");
|
|
79941
79941
|
var configs = [defaults];
|
|
79942
79942
|
var configFiles = [];
|
|
@@ -79944,7 +79944,7 @@ var require_rc = __commonJS({
|
|
|
79944
79944
|
if (configFiles.indexOf(file) >= 0) return;
|
|
79945
79945
|
var fileConfig = cc.file(file);
|
|
79946
79946
|
if (fileConfig) {
|
|
79947
|
-
configs.push(
|
|
79947
|
+
configs.push(parse2(fileConfig));
|
|
79948
79948
|
configFiles.push(file);
|
|
79949
79949
|
}
|
|
79950
79950
|
}
|
|
@@ -80383,13 +80383,13 @@ var require_clone2 = __commonJS({
|
|
|
80383
80383
|
if (obj === null || typeof obj !== "object")
|
|
80384
80384
|
return obj;
|
|
80385
80385
|
if (obj instanceof Object)
|
|
80386
|
-
var
|
|
80386
|
+
var copy2 = { __proto__: getPrototypeOf(obj) };
|
|
80387
80387
|
else
|
|
80388
|
-
var
|
|
80388
|
+
var copy2 = /* @__PURE__ */ Object.create(null);
|
|
80389
80389
|
Object.getOwnPropertyNames(obj).forEach(function(key2) {
|
|
80390
|
-
Object.defineProperty(
|
|
80390
|
+
Object.defineProperty(copy2, key2, Object.getOwnPropertyDescriptor(obj, key2));
|
|
80391
80391
|
});
|
|
80392
|
-
return
|
|
80392
|
+
return copy2;
|
|
80393
80393
|
}
|
|
80394
80394
|
}
|
|
80395
80395
|
});
|
|
@@ -81104,7 +81104,7 @@ var require_config_chain = __commonJS({
|
|
|
81104
81104
|
}
|
|
81105
81105
|
return find2(__dirname, rel);
|
|
81106
81106
|
};
|
|
81107
|
-
var
|
|
81107
|
+
var parse2 = exports2.parse = function(content, file, type) {
|
|
81108
81108
|
content = "" + content;
|
|
81109
81109
|
if (!type) {
|
|
81110
81110
|
try {
|
|
@@ -81137,7 +81137,7 @@ var require_config_chain = __commonJS({
|
|
|
81137
81137
|
} catch (err) {
|
|
81138
81138
|
return;
|
|
81139
81139
|
}
|
|
81140
|
-
return
|
|
81140
|
+
return parse2(content, file, "json");
|
|
81141
81141
|
};
|
|
81142
81142
|
var env = exports2.env = function(prefix, env2) {
|
|
81143
81143
|
env2 = env2 || process.env;
|
|
@@ -82510,7 +82510,7 @@ var require_semver3 = __commonJS({
|
|
|
82510
82510
|
var require_parse6 = __commonJS({
|
|
82511
82511
|
"node_modules/get-latest-version/node_modules/semver/functions/parse.js"(exports2, module2) {
|
|
82512
82512
|
var SemVer = require_semver3();
|
|
82513
|
-
var
|
|
82513
|
+
var parse2 = (version, options, throwErrors = false) => {
|
|
82514
82514
|
if (version instanceof SemVer) {
|
|
82515
82515
|
return version;
|
|
82516
82516
|
}
|
|
@@ -82523,16 +82523,16 @@ var require_parse6 = __commonJS({
|
|
|
82523
82523
|
throw er;
|
|
82524
82524
|
}
|
|
82525
82525
|
};
|
|
82526
|
-
module2.exports =
|
|
82526
|
+
module2.exports = parse2;
|
|
82527
82527
|
}
|
|
82528
82528
|
});
|
|
82529
82529
|
|
|
82530
82530
|
// node_modules/get-latest-version/node_modules/semver/functions/valid.js
|
|
82531
82531
|
var require_valid3 = __commonJS({
|
|
82532
82532
|
"node_modules/get-latest-version/node_modules/semver/functions/valid.js"(exports2, module2) {
|
|
82533
|
-
var
|
|
82533
|
+
var parse2 = require_parse6();
|
|
82534
82534
|
var valid = (version, options) => {
|
|
82535
|
-
const v2 =
|
|
82535
|
+
const v2 = parse2(version, options);
|
|
82536
82536
|
return v2 ? v2.version : null;
|
|
82537
82537
|
};
|
|
82538
82538
|
module2.exports = valid;
|
|
@@ -82542,9 +82542,9 @@ var require_valid3 = __commonJS({
|
|
|
82542
82542
|
// node_modules/get-latest-version/node_modules/semver/functions/clean.js
|
|
82543
82543
|
var require_clean2 = __commonJS({
|
|
82544
82544
|
"node_modules/get-latest-version/node_modules/semver/functions/clean.js"(exports2, module2) {
|
|
82545
|
-
var
|
|
82545
|
+
var parse2 = require_parse6();
|
|
82546
82546
|
var clean = (version, options) => {
|
|
82547
|
-
const s =
|
|
82547
|
+
const s = parse2(version.trim().replace(/^[=v]+/, ""), options);
|
|
82548
82548
|
return s ? s.version : null;
|
|
82549
82549
|
};
|
|
82550
82550
|
module2.exports = clean;
|
|
@@ -82577,10 +82577,10 @@ var require_inc2 = __commonJS({
|
|
|
82577
82577
|
// node_modules/get-latest-version/node_modules/semver/functions/diff.js
|
|
82578
82578
|
var require_diff2 = __commonJS({
|
|
82579
82579
|
"node_modules/get-latest-version/node_modules/semver/functions/diff.js"(exports2, module2) {
|
|
82580
|
-
var
|
|
82580
|
+
var parse2 = require_parse6();
|
|
82581
82581
|
var diff = (version1, version2) => {
|
|
82582
|
-
const v1 =
|
|
82583
|
-
const v2 =
|
|
82582
|
+
const v1 = parse2(version1, null, true);
|
|
82583
|
+
const v2 = parse2(version2, null, true);
|
|
82584
82584
|
const comparison = v1.compare(v2);
|
|
82585
82585
|
if (comparison === 0) {
|
|
82586
82586
|
return null;
|
|
@@ -82648,9 +82648,9 @@ var require_patch2 = __commonJS({
|
|
|
82648
82648
|
// node_modules/get-latest-version/node_modules/semver/functions/prerelease.js
|
|
82649
82649
|
var require_prerelease2 = __commonJS({
|
|
82650
82650
|
"node_modules/get-latest-version/node_modules/semver/functions/prerelease.js"(exports2, module2) {
|
|
82651
|
-
var
|
|
82651
|
+
var parse2 = require_parse6();
|
|
82652
82652
|
var prerelease = (version, options) => {
|
|
82653
|
-
const parsed =
|
|
82653
|
+
const parsed = parse2(version, options);
|
|
82654
82654
|
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
82655
82655
|
};
|
|
82656
82656
|
module2.exports = prerelease;
|
|
@@ -82822,7 +82822,7 @@ var require_cmp2 = __commonJS({
|
|
|
82822
82822
|
var require_coerce2 = __commonJS({
|
|
82823
82823
|
"node_modules/get-latest-version/node_modules/semver/functions/coerce.js"(exports2, module2) {
|
|
82824
82824
|
var SemVer = require_semver3();
|
|
82825
|
-
var
|
|
82825
|
+
var parse2 = require_parse6();
|
|
82826
82826
|
var { safeRe: re, t } = require_re2();
|
|
82827
82827
|
var coerce = (version, options) => {
|
|
82828
82828
|
if (version instanceof SemVer) {
|
|
@@ -82851,7 +82851,7 @@ var require_coerce2 = __commonJS({
|
|
|
82851
82851
|
if (match === null) {
|
|
82852
82852
|
return null;
|
|
82853
82853
|
}
|
|
82854
|
-
return
|
|
82854
|
+
return parse2(`${match[2]}.${match[3] || "0"}.${match[4] || "0"}`, options);
|
|
82855
82855
|
};
|
|
82856
82856
|
module2.exports = coerce;
|
|
82857
82857
|
}
|
|
@@ -84446,7 +84446,7 @@ var require_semver4 = __commonJS({
|
|
|
84446
84446
|
var constants2 = require_constants14();
|
|
84447
84447
|
var SemVer = require_semver3();
|
|
84448
84448
|
var identifiers = require_identifiers2();
|
|
84449
|
-
var
|
|
84449
|
+
var parse2 = require_parse6();
|
|
84450
84450
|
var valid = require_valid3();
|
|
84451
84451
|
var clean = require_clean2();
|
|
84452
84452
|
var inc = require_inc2();
|
|
@@ -84484,7 +84484,7 @@ var require_semver4 = __commonJS({
|
|
|
84484
84484
|
var simplifyRange = require_simplify2();
|
|
84485
84485
|
var subset = require_subset2();
|
|
84486
84486
|
module2.exports = {
|
|
84487
|
-
parse,
|
|
84487
|
+
parse: parse2,
|
|
84488
84488
|
valid,
|
|
84489
84489
|
clean,
|
|
84490
84490
|
inc,
|
|
@@ -86219,7 +86219,7 @@ var {
|
|
|
86219
86219
|
// package.json
|
|
86220
86220
|
var package_default = {
|
|
86221
86221
|
name: "@capgo/cli",
|
|
86222
|
-
version: "4.12.
|
|
86222
|
+
version: "4.12.14",
|
|
86223
86223
|
description: "A CLI to upload to capgo servers",
|
|
86224
86224
|
author: "github.com/riderx",
|
|
86225
86225
|
license: "Apache 2.0",
|
|
@@ -86263,7 +86263,7 @@ var package_default = {
|
|
|
86263
86263
|
"check-posix-paths": "node test/check-posix-paths.js"
|
|
86264
86264
|
},
|
|
86265
86265
|
dependencies: {
|
|
86266
|
-
"@
|
|
86266
|
+
"@bradenmacdonald/s3-lite-client": "npm:@jsr/bradenmacdonald__s3-lite-client",
|
|
86267
86267
|
"@capacitor/cli": "6.1.0",
|
|
86268
86268
|
"@capgo/find-package-manager": "^0.0.17",
|
|
86269
86269
|
"@clack/prompts": "^0.7.0",
|
|
@@ -88896,6 +88896,1368 @@ var import_node_fs8 = require("node:fs");
|
|
|
88896
88896
|
var import_node_process13 = __toESM(require("node:process"));
|
|
88897
88897
|
var import_checksum2 = __toESM(require_dist13());
|
|
88898
88898
|
var import_ci_info = __toESM(require_ci_info());
|
|
88899
|
+
|
|
88900
|
+
// node_modules/@jsr/std__bytes/copy.js
|
|
88901
|
+
function copy(src, dst, offset = 0) {
|
|
88902
|
+
offset = Math.max(0, Math.min(offset, dst.byteLength));
|
|
88903
|
+
const dstBytesAvailable = dst.byteLength - offset;
|
|
88904
|
+
if (src.byteLength > dstBytesAvailable) {
|
|
88905
|
+
src = src.subarray(0, dstBytesAvailable);
|
|
88906
|
+
}
|
|
88907
|
+
dst.set(src, offset);
|
|
88908
|
+
return src.byteLength;
|
|
88909
|
+
}
|
|
88910
|
+
|
|
88911
|
+
// node_modules/@jsr/std__io/buffer.js
|
|
88912
|
+
var MIN_READ = 32 * 1024;
|
|
88913
|
+
var MAX_SIZE = 2 ** 32 - 2;
|
|
88914
|
+
var Buffer4 = class {
|
|
88915
|
+
#buf;
|
|
88916
|
+
#off = 0;
|
|
88917
|
+
constructor(ab) {
|
|
88918
|
+
this.#buf = ab === void 0 ? new Uint8Array(0) : new Uint8Array(ab);
|
|
88919
|
+
}
|
|
88920
|
+
/** Returns a slice holding the unread portion of the buffer.
|
|
88921
|
+
*
|
|
88922
|
+
* The slice is valid for use only until the next buffer modification (that
|
|
88923
|
+
* is, only until the next call to a method like `read()`, `write()`,
|
|
88924
|
+
* `reset()`, or `truncate()`). If `options.copy` is false the slice aliases the buffer content at
|
|
88925
|
+
* least until the next buffer modification, so immediate changes to the
|
|
88926
|
+
* slice will affect the result of future reads.
|
|
88927
|
+
* @param [options={ copy: true }]
|
|
88928
|
+
*/
|
|
88929
|
+
bytes(options = {
|
|
88930
|
+
copy: true
|
|
88931
|
+
}) {
|
|
88932
|
+
if (options.copy === false) return this.#buf.subarray(this.#off);
|
|
88933
|
+
return this.#buf.slice(this.#off);
|
|
88934
|
+
}
|
|
88935
|
+
/** Returns whether the unread portion of the buffer is empty. */
|
|
88936
|
+
empty() {
|
|
88937
|
+
return this.#buf.byteLength <= this.#off;
|
|
88938
|
+
}
|
|
88939
|
+
/** A read only number of bytes of the unread portion of the buffer. */
|
|
88940
|
+
get length() {
|
|
88941
|
+
return this.#buf.byteLength - this.#off;
|
|
88942
|
+
}
|
|
88943
|
+
/** The read only capacity of the buffer's underlying byte slice, that is,
|
|
88944
|
+
* the total space allocated for the buffer's data. */
|
|
88945
|
+
get capacity() {
|
|
88946
|
+
return this.#buf.buffer.byteLength;
|
|
88947
|
+
}
|
|
88948
|
+
/** Discards all but the first `n` unread bytes from the buffer but
|
|
88949
|
+
* continues to use the same allocated storage. It throws if `n` is
|
|
88950
|
+
* negative or greater than the length of the buffer. */
|
|
88951
|
+
truncate(n) {
|
|
88952
|
+
if (n === 0) {
|
|
88953
|
+
this.reset();
|
|
88954
|
+
return;
|
|
88955
|
+
}
|
|
88956
|
+
if (n < 0 || n > this.length) {
|
|
88957
|
+
throw Error("bytes.Buffer: truncation out of range");
|
|
88958
|
+
}
|
|
88959
|
+
this.#reslice(this.#off + n);
|
|
88960
|
+
}
|
|
88961
|
+
reset() {
|
|
88962
|
+
this.#reslice(0);
|
|
88963
|
+
this.#off = 0;
|
|
88964
|
+
}
|
|
88965
|
+
#tryGrowByReslice(n) {
|
|
88966
|
+
const l = this.#buf.byteLength;
|
|
88967
|
+
if (n <= this.capacity - l) {
|
|
88968
|
+
this.#reslice(l + n);
|
|
88969
|
+
return l;
|
|
88970
|
+
}
|
|
88971
|
+
return -1;
|
|
88972
|
+
}
|
|
88973
|
+
#reslice(len) {
|
|
88974
|
+
if (len > this.#buf.buffer.byteLength) {
|
|
88975
|
+
throw new RangeError("Length is greater than buffer capacity");
|
|
88976
|
+
}
|
|
88977
|
+
this.#buf = new Uint8Array(this.#buf.buffer, 0, len);
|
|
88978
|
+
}
|
|
88979
|
+
/** Reads the next `p.length` bytes from the buffer or until the buffer is
|
|
88980
|
+
* drained. Returns the number of bytes read. If the buffer has no data to
|
|
88981
|
+
* return, the return is EOF (`null`). */
|
|
88982
|
+
readSync(p2) {
|
|
88983
|
+
if (this.empty()) {
|
|
88984
|
+
this.reset();
|
|
88985
|
+
if (p2.byteLength === 0) {
|
|
88986
|
+
return 0;
|
|
88987
|
+
}
|
|
88988
|
+
return null;
|
|
88989
|
+
}
|
|
88990
|
+
const nread = copy(this.#buf.subarray(this.#off), p2);
|
|
88991
|
+
this.#off += nread;
|
|
88992
|
+
return nread;
|
|
88993
|
+
}
|
|
88994
|
+
/** Reads the next `p.length` bytes from the buffer or until the buffer is
|
|
88995
|
+
* drained. Resolves to the number of bytes read. If the buffer has no
|
|
88996
|
+
* data to return, resolves to EOF (`null`).
|
|
88997
|
+
*
|
|
88998
|
+
* NOTE: This methods reads bytes synchronously; it's provided for
|
|
88999
|
+
* compatibility with `Reader` interfaces.
|
|
89000
|
+
*/
|
|
89001
|
+
read(p2) {
|
|
89002
|
+
const rr = this.readSync(p2);
|
|
89003
|
+
return Promise.resolve(rr);
|
|
89004
|
+
}
|
|
89005
|
+
writeSync(p2) {
|
|
89006
|
+
const m2 = this.#grow(p2.byteLength);
|
|
89007
|
+
return copy(p2, this.#buf, m2);
|
|
89008
|
+
}
|
|
89009
|
+
/** NOTE: This methods writes bytes synchronously; it's provided for
|
|
89010
|
+
* compatibility with `Writer` interface. */
|
|
89011
|
+
write(p2) {
|
|
89012
|
+
const n = this.writeSync(p2);
|
|
89013
|
+
return Promise.resolve(n);
|
|
89014
|
+
}
|
|
89015
|
+
#grow(n) {
|
|
89016
|
+
const m2 = this.length;
|
|
89017
|
+
if (m2 === 0 && this.#off !== 0) {
|
|
89018
|
+
this.reset();
|
|
89019
|
+
}
|
|
89020
|
+
const i = this.#tryGrowByReslice(n);
|
|
89021
|
+
if (i >= 0) {
|
|
89022
|
+
return i;
|
|
89023
|
+
}
|
|
89024
|
+
const c2 = this.capacity;
|
|
89025
|
+
if (n <= Math.floor(c2 / 2) - m2) {
|
|
89026
|
+
copy(this.#buf.subarray(this.#off), this.#buf);
|
|
89027
|
+
} else if (c2 + n > MAX_SIZE) {
|
|
89028
|
+
throw new Error("The buffer cannot be grown beyond the maximum size.");
|
|
89029
|
+
} else {
|
|
89030
|
+
const buf = new Uint8Array(Math.min(2 * c2 + n, MAX_SIZE));
|
|
89031
|
+
copy(this.#buf.subarray(this.#off), buf);
|
|
89032
|
+
this.#buf = buf;
|
|
89033
|
+
}
|
|
89034
|
+
this.#off = 0;
|
|
89035
|
+
this.#reslice(Math.min(m2 + n, MAX_SIZE));
|
|
89036
|
+
return m2;
|
|
89037
|
+
}
|
|
89038
|
+
/** Grows the buffer's capacity, if necessary, to guarantee space for
|
|
89039
|
+
* another `n` bytes. After `.grow(n)`, at least `n` bytes can be written to
|
|
89040
|
+
* the buffer without another allocation. If `n` is negative, `.grow()` will
|
|
89041
|
+
* throw. If the buffer can't grow it will throw an error.
|
|
89042
|
+
*
|
|
89043
|
+
* Based on Go Lang's
|
|
89044
|
+
* {@link https://golang.org/pkg/bytes/#Buffer.Grow | Buffer.Grow}. */
|
|
89045
|
+
grow(n) {
|
|
89046
|
+
if (n < 0) {
|
|
89047
|
+
throw Error("Buffer.grow: negative count");
|
|
89048
|
+
}
|
|
89049
|
+
const m2 = this.#grow(n);
|
|
89050
|
+
this.#reslice(m2);
|
|
89051
|
+
}
|
|
89052
|
+
/** Reads data from `r` until EOF (`null`) and appends it to the buffer,
|
|
89053
|
+
* growing the buffer as needed. It resolves to the number of bytes read.
|
|
89054
|
+
* If the buffer becomes too large, `.readFrom()` will reject with an error.
|
|
89055
|
+
*
|
|
89056
|
+
* Based on Go Lang's
|
|
89057
|
+
* {@link https://golang.org/pkg/bytes/#Buffer.ReadFrom | Buffer.ReadFrom}. */
|
|
89058
|
+
async readFrom(r2) {
|
|
89059
|
+
let n = 0;
|
|
89060
|
+
const tmp2 = new Uint8Array(MIN_READ);
|
|
89061
|
+
while (true) {
|
|
89062
|
+
const shouldGrow = this.capacity - this.length < MIN_READ;
|
|
89063
|
+
const buf = shouldGrow ? tmp2 : new Uint8Array(this.#buf.buffer, this.length);
|
|
89064
|
+
const nread = await r2.read(buf);
|
|
89065
|
+
if (nread === null) {
|
|
89066
|
+
return n;
|
|
89067
|
+
}
|
|
89068
|
+
if (shouldGrow) this.writeSync(buf.subarray(0, nread));
|
|
89069
|
+
else this.#reslice(this.length + nread);
|
|
89070
|
+
n += nread;
|
|
89071
|
+
}
|
|
89072
|
+
}
|
|
89073
|
+
/** Reads data from `r` until EOF (`null`) and appends it to the buffer,
|
|
89074
|
+
* growing the buffer as needed. It returns the number of bytes read. If the
|
|
89075
|
+
* buffer becomes too large, `.readFromSync()` will throw an error.
|
|
89076
|
+
*
|
|
89077
|
+
* Based on Go Lang's
|
|
89078
|
+
* {@link https://golang.org/pkg/bytes/#Buffer.ReadFrom | Buffer.ReadFrom}. */
|
|
89079
|
+
readFromSync(r2) {
|
|
89080
|
+
let n = 0;
|
|
89081
|
+
const tmp2 = new Uint8Array(MIN_READ);
|
|
89082
|
+
while (true) {
|
|
89083
|
+
const shouldGrow = this.capacity - this.length < MIN_READ;
|
|
89084
|
+
const buf = shouldGrow ? tmp2 : new Uint8Array(this.#buf.buffer, this.length);
|
|
89085
|
+
const nread = r2.readSync(buf);
|
|
89086
|
+
if (nread === null) {
|
|
89087
|
+
return n;
|
|
89088
|
+
}
|
|
89089
|
+
if (shouldGrow) this.writeSync(buf.subarray(0, nread));
|
|
89090
|
+
else this.#reslice(this.length + nread);
|
|
89091
|
+
n += nread;
|
|
89092
|
+
}
|
|
89093
|
+
}
|
|
89094
|
+
};
|
|
89095
|
+
|
|
89096
|
+
// node_modules/@bradenmacdonald/s3-lite-client/transform-chunk-sizes.js
|
|
89097
|
+
var TransformChunkSizes = class extends TransformStream {
|
|
89098
|
+
constructor(outChunkSize) {
|
|
89099
|
+
const buffer = new Buffer4();
|
|
89100
|
+
buffer.grow(outChunkSize);
|
|
89101
|
+
super({
|
|
89102
|
+
start() {
|
|
89103
|
+
},
|
|
89104
|
+
async transform(chunk, controller) {
|
|
89105
|
+
buffer.write(chunk);
|
|
89106
|
+
while (buffer.length >= outChunkSize) {
|
|
89107
|
+
const outChunk = new Uint8Array(outChunkSize);
|
|
89108
|
+
const readFromBuffer = await buffer.read(outChunk);
|
|
89109
|
+
if (readFromBuffer !== outChunkSize) {
|
|
89110
|
+
throw new Error(`Unexpectedly read ${readFromBuffer} bytes from transform buffer when trying to read ${outChunkSize} bytes.`);
|
|
89111
|
+
}
|
|
89112
|
+
controller.enqueue(outChunk);
|
|
89113
|
+
}
|
|
89114
|
+
},
|
|
89115
|
+
flush(controller) {
|
|
89116
|
+
if (buffer.length) {
|
|
89117
|
+
controller.enqueue(buffer.bytes());
|
|
89118
|
+
}
|
|
89119
|
+
}
|
|
89120
|
+
});
|
|
89121
|
+
}
|
|
89122
|
+
};
|
|
89123
|
+
|
|
89124
|
+
// node_modules/@bradenmacdonald/s3-lite-client/xml-parser.js
|
|
89125
|
+
function parse(xml) {
|
|
89126
|
+
xml = xml.trim();
|
|
89127
|
+
xml = xml.replace(/<!--[\s\S]*?-->/g, "");
|
|
89128
|
+
return document2();
|
|
89129
|
+
function document2() {
|
|
89130
|
+
return {
|
|
89131
|
+
declaration: declaration(),
|
|
89132
|
+
root: tag()
|
|
89133
|
+
};
|
|
89134
|
+
}
|
|
89135
|
+
function declaration() {
|
|
89136
|
+
const m2 = match(/^<\?xml\s*/);
|
|
89137
|
+
if (!m2) return;
|
|
89138
|
+
const node = {
|
|
89139
|
+
attributes: {}
|
|
89140
|
+
};
|
|
89141
|
+
while (!(eos() || is("?>"))) {
|
|
89142
|
+
const attr = attribute();
|
|
89143
|
+
if (!attr) return node;
|
|
89144
|
+
node.attributes[attr.name] = attr.value;
|
|
89145
|
+
}
|
|
89146
|
+
match(/\?>\s*/);
|
|
89147
|
+
return node;
|
|
89148
|
+
}
|
|
89149
|
+
function tag() {
|
|
89150
|
+
const m2 = match(/^<([\w-:.]+)\s*/);
|
|
89151
|
+
if (!m2) return;
|
|
89152
|
+
const node = {
|
|
89153
|
+
name: m2[1],
|
|
89154
|
+
attributes: {},
|
|
89155
|
+
children: []
|
|
89156
|
+
};
|
|
89157
|
+
while (!(eos() || is(">") || is("?>") || is("/>"))) {
|
|
89158
|
+
const attr = attribute();
|
|
89159
|
+
if (!attr) return node;
|
|
89160
|
+
node.attributes[attr.name] = attr.value;
|
|
89161
|
+
}
|
|
89162
|
+
if (match(/^\s*\/>\s*/)) {
|
|
89163
|
+
return node;
|
|
89164
|
+
}
|
|
89165
|
+
match(/\??>\s*/);
|
|
89166
|
+
node.content = content();
|
|
89167
|
+
let child;
|
|
89168
|
+
while (child = tag()) {
|
|
89169
|
+
node.children.push(child);
|
|
89170
|
+
}
|
|
89171
|
+
match(/^<\/[\w-:.]+>\s*/);
|
|
89172
|
+
return node;
|
|
89173
|
+
}
|
|
89174
|
+
function content() {
|
|
89175
|
+
const m2 = match(/^([^<]*)/);
|
|
89176
|
+
if (m2) return entities(m2[1]);
|
|
89177
|
+
return "";
|
|
89178
|
+
}
|
|
89179
|
+
function attribute() {
|
|
89180
|
+
const m2 = match(/([\w:-]+)\s*=\s*("[^"]*"|'[^']*'|\w+)\s*/);
|
|
89181
|
+
if (!m2) return;
|
|
89182
|
+
return {
|
|
89183
|
+
name: m2[1],
|
|
89184
|
+
value: entities(strip(m2[2]))
|
|
89185
|
+
};
|
|
89186
|
+
}
|
|
89187
|
+
function strip(val) {
|
|
89188
|
+
return val.replace(/^['"]|['"]$/g, "");
|
|
89189
|
+
}
|
|
89190
|
+
function entities(val) {
|
|
89191
|
+
return val.replaceAll("<", "<").replaceAll(">", ">").replaceAll("&", "&");
|
|
89192
|
+
}
|
|
89193
|
+
function match(re) {
|
|
89194
|
+
const m2 = xml.match(re);
|
|
89195
|
+
if (!m2) return;
|
|
89196
|
+
xml = xml.slice(m2[0].length);
|
|
89197
|
+
return m2;
|
|
89198
|
+
}
|
|
89199
|
+
function eos() {
|
|
89200
|
+
return 0 == xml.length;
|
|
89201
|
+
}
|
|
89202
|
+
function is(prefix) {
|
|
89203
|
+
return 0 == xml.indexOf(prefix);
|
|
89204
|
+
}
|
|
89205
|
+
}
|
|
89206
|
+
|
|
89207
|
+
// node_modules/@bradenmacdonald/s3-lite-client/errors.js
|
|
89208
|
+
var S3Error = class extends Error {
|
|
89209
|
+
constructor(message) {
|
|
89210
|
+
super(message);
|
|
89211
|
+
}
|
|
89212
|
+
};
|
|
89213
|
+
var InvalidArgumentError2 = class extends S3Error {
|
|
89214
|
+
};
|
|
89215
|
+
var InvalidEndpointError = class extends S3Error {
|
|
89216
|
+
};
|
|
89217
|
+
var InvalidBucketNameError = class extends S3Error {
|
|
89218
|
+
};
|
|
89219
|
+
var InvalidObjectNameError = class extends S3Error {
|
|
89220
|
+
};
|
|
89221
|
+
var AccessKeyRequiredError = class extends S3Error {
|
|
89222
|
+
};
|
|
89223
|
+
var SecretKeyRequiredError = class extends S3Error {
|
|
89224
|
+
};
|
|
89225
|
+
var InvalidExpiryError = class extends S3Error {
|
|
89226
|
+
};
|
|
89227
|
+
var ServerError = class extends S3Error {
|
|
89228
|
+
statusCode;
|
|
89229
|
+
code;
|
|
89230
|
+
key;
|
|
89231
|
+
bucketName;
|
|
89232
|
+
resource;
|
|
89233
|
+
region;
|
|
89234
|
+
constructor(statusCode, code, message, otherData = {}) {
|
|
89235
|
+
super(message);
|
|
89236
|
+
this.statusCode = statusCode;
|
|
89237
|
+
this.code = code;
|
|
89238
|
+
this.key = otherData.key;
|
|
89239
|
+
this.bucketName = otherData.bucketName;
|
|
89240
|
+
this.resource = otherData.resource;
|
|
89241
|
+
this.region = otherData.region;
|
|
89242
|
+
}
|
|
89243
|
+
};
|
|
89244
|
+
async function parseServerError(response) {
|
|
89245
|
+
try {
|
|
89246
|
+
const xmlParsed = parse(await response.text());
|
|
89247
|
+
const errorRoot = xmlParsed.root;
|
|
89248
|
+
if (errorRoot?.name !== "Error") {
|
|
89249
|
+
throw new Error("Invalid root, expected <Error>");
|
|
89250
|
+
}
|
|
89251
|
+
const code = errorRoot.children.find((c2) => c2.name === "Code")?.content ?? "UnknownErrorCode";
|
|
89252
|
+
const message = errorRoot.children.find((c2) => c2.name === "Message")?.content ?? "The error message could not be determined.";
|
|
89253
|
+
const key2 = errorRoot.children.find((c2) => c2.name === "Key")?.content;
|
|
89254
|
+
const bucketName = errorRoot.children.find((c2) => c2.name === "BucketName")?.content;
|
|
89255
|
+
const resource = errorRoot.children.find((c2) => c2.name === "Resource")?.content;
|
|
89256
|
+
const region = errorRoot.children.find((c2) => c2.name === "Region")?.content;
|
|
89257
|
+
return new ServerError(response.status, code, message, {
|
|
89258
|
+
key: key2,
|
|
89259
|
+
bucketName,
|
|
89260
|
+
resource,
|
|
89261
|
+
region
|
|
89262
|
+
});
|
|
89263
|
+
} catch {
|
|
89264
|
+
return new ServerError(response.status, "UnrecognizedError", `Error: Unexpected response code ${response.status} ${response.statusText}. Unable to parse response as XML.`);
|
|
89265
|
+
}
|
|
89266
|
+
}
|
|
89267
|
+
|
|
89268
|
+
// node_modules/@bradenmacdonald/s3-lite-client/helpers.js
|
|
89269
|
+
function isValidPort(port) {
|
|
89270
|
+
if (typeof port !== "number" || isNaN(port)) {
|
|
89271
|
+
return false;
|
|
89272
|
+
}
|
|
89273
|
+
if (port <= 0) {
|
|
89274
|
+
return false;
|
|
89275
|
+
}
|
|
89276
|
+
const minPort = 1;
|
|
89277
|
+
const maxPort = 65535;
|
|
89278
|
+
return port >= minPort && port <= maxPort;
|
|
89279
|
+
}
|
|
89280
|
+
function isValidBucketName(bucket) {
|
|
89281
|
+
if (typeof bucket !== "string") {
|
|
89282
|
+
return false;
|
|
89283
|
+
}
|
|
89284
|
+
if (bucket.length < 3 || bucket.length > 63) {
|
|
89285
|
+
return false;
|
|
89286
|
+
}
|
|
89287
|
+
if (bucket.indexOf("..") > -1) {
|
|
89288
|
+
return false;
|
|
89289
|
+
}
|
|
89290
|
+
if (bucket.match(/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/)) {
|
|
89291
|
+
return false;
|
|
89292
|
+
}
|
|
89293
|
+
if (bucket.match(/^[a-z0-9][a-z0-9.-]+[a-z0-9]$/)) {
|
|
89294
|
+
return true;
|
|
89295
|
+
}
|
|
89296
|
+
return false;
|
|
89297
|
+
}
|
|
89298
|
+
function isValidObjectName(objectName) {
|
|
89299
|
+
if (!isValidPrefix(objectName)) return false;
|
|
89300
|
+
if (objectName.length === 0) return false;
|
|
89301
|
+
return true;
|
|
89302
|
+
}
|
|
89303
|
+
function isValidPrefix(prefix) {
|
|
89304
|
+
if (typeof prefix !== "string") return false;
|
|
89305
|
+
if (prefix.length > 1024) return false;
|
|
89306
|
+
return true;
|
|
89307
|
+
}
|
|
89308
|
+
function bin2hex(binary) {
|
|
89309
|
+
return Array.from(binary).map((b3) => b3.toString(16).padStart(2, "0")).join("");
|
|
89310
|
+
}
|
|
89311
|
+
function sanitizeETag(etag = "") {
|
|
89312
|
+
const replaceChars = {
|
|
89313
|
+
'"': "",
|
|
89314
|
+
""": "",
|
|
89315
|
+
""": "",
|
|
89316
|
+
""": "",
|
|
89317
|
+
""": ""
|
|
89318
|
+
};
|
|
89319
|
+
return etag.replace(/^("|"|")|("|"|")$/g, (m2) => replaceChars[m2]);
|
|
89320
|
+
}
|
|
89321
|
+
function getVersionId(headers) {
|
|
89322
|
+
return headers.get("x-amz-version-id") ?? null;
|
|
89323
|
+
}
|
|
89324
|
+
function makeDateLong(date) {
|
|
89325
|
+
date = date || /* @__PURE__ */ new Date();
|
|
89326
|
+
const dateStr = date.toISOString();
|
|
89327
|
+
return dateStr.substr(0, 4) + dateStr.substr(5, 2) + dateStr.substr(8, 5) + dateStr.substr(14, 2) + dateStr.substr(17, 2) + "Z";
|
|
89328
|
+
}
|
|
89329
|
+
function makeDateShort(date) {
|
|
89330
|
+
date = date || /* @__PURE__ */ new Date();
|
|
89331
|
+
const dateStr = date.toISOString();
|
|
89332
|
+
return dateStr.substr(0, 4) + dateStr.substr(5, 2) + dateStr.substr(8, 2);
|
|
89333
|
+
}
|
|
89334
|
+
function getScope(region, date) {
|
|
89335
|
+
return `${makeDateShort(date)}/${region}/s3/aws4_request`;
|
|
89336
|
+
}
|
|
89337
|
+
async function sha256digestHex(data) {
|
|
89338
|
+
if (!(data instanceof Uint8Array)) {
|
|
89339
|
+
data = new TextEncoder().encode(data);
|
|
89340
|
+
}
|
|
89341
|
+
return bin2hex(new Uint8Array(await crypto.subtle.digest("SHA-256", data)));
|
|
89342
|
+
}
|
|
89343
|
+
|
|
89344
|
+
// node_modules/@bradenmacdonald/s3-lite-client/object-uploader.js
|
|
89345
|
+
var multipartTagAlongMetadataKeys = [
|
|
89346
|
+
"x-amz-server-side-encryption-customer-algorithm",
|
|
89347
|
+
"x-amz-server-side-encryption-customer-key",
|
|
89348
|
+
"x-amz-server-side-encryption-customer-key-MD5"
|
|
89349
|
+
];
|
|
89350
|
+
var ObjectUploader = class extends WritableStream {
|
|
89351
|
+
getResult;
|
|
89352
|
+
constructor({ client, bucketName, objectName, partSize, metadata }) {
|
|
89353
|
+
let result;
|
|
89354
|
+
let nextPartNumber = 1;
|
|
89355
|
+
let uploadId;
|
|
89356
|
+
const etags = [];
|
|
89357
|
+
const partsPromises = [];
|
|
89358
|
+
super({
|
|
89359
|
+
start() {
|
|
89360
|
+
},
|
|
89361
|
+
async write(chunk, _controller) {
|
|
89362
|
+
const method = "PUT";
|
|
89363
|
+
const partNumber = nextPartNumber++;
|
|
89364
|
+
try {
|
|
89365
|
+
if (partNumber == 1 && chunk.length < partSize) {
|
|
89366
|
+
const response = await client.makeRequest({
|
|
89367
|
+
method,
|
|
89368
|
+
headers: new Headers({
|
|
89369
|
+
// Set user metadata as this is not a multipart upload
|
|
89370
|
+
...metadata,
|
|
89371
|
+
"Content-Length": String(chunk.length)
|
|
89372
|
+
}),
|
|
89373
|
+
bucketName,
|
|
89374
|
+
objectName,
|
|
89375
|
+
payload: chunk
|
|
89376
|
+
});
|
|
89377
|
+
result = {
|
|
89378
|
+
etag: sanitizeETag(response.headers.get("etag") ?? void 0),
|
|
89379
|
+
versionId: getVersionId(response.headers)
|
|
89380
|
+
};
|
|
89381
|
+
return;
|
|
89382
|
+
}
|
|
89383
|
+
if (partNumber === 1) {
|
|
89384
|
+
uploadId = (await initiateNewMultipartUpload({
|
|
89385
|
+
client,
|
|
89386
|
+
bucketName,
|
|
89387
|
+
objectName,
|
|
89388
|
+
metadata
|
|
89389
|
+
})).uploadId;
|
|
89390
|
+
}
|
|
89391
|
+
const partHeaders = {
|
|
89392
|
+
"Content-Length": String(chunk.length)
|
|
89393
|
+
};
|
|
89394
|
+
for (const key2 of multipartTagAlongMetadataKeys) {
|
|
89395
|
+
const value = metadata[key2];
|
|
89396
|
+
if (value) {
|
|
89397
|
+
partHeaders[key2] = value;
|
|
89398
|
+
}
|
|
89399
|
+
}
|
|
89400
|
+
const partPromise = client.makeRequest({
|
|
89401
|
+
method,
|
|
89402
|
+
query: {
|
|
89403
|
+
partNumber: partNumber.toString(),
|
|
89404
|
+
uploadId
|
|
89405
|
+
},
|
|
89406
|
+
headers: new Headers(partHeaders),
|
|
89407
|
+
bucketName,
|
|
89408
|
+
objectName,
|
|
89409
|
+
payload: chunk
|
|
89410
|
+
});
|
|
89411
|
+
partPromise.then((response) => {
|
|
89412
|
+
let etag = response.headers.get("etag") ?? "";
|
|
89413
|
+
if (etag) {
|
|
89414
|
+
etag = etag.replace(/^"/, "").replace(/"$/, "");
|
|
89415
|
+
}
|
|
89416
|
+
etags.push({
|
|
89417
|
+
part: partNumber,
|
|
89418
|
+
etag
|
|
89419
|
+
});
|
|
89420
|
+
});
|
|
89421
|
+
partsPromises.push(partPromise);
|
|
89422
|
+
} catch (err) {
|
|
89423
|
+
throw err;
|
|
89424
|
+
}
|
|
89425
|
+
},
|
|
89426
|
+
async close() {
|
|
89427
|
+
if (result) {
|
|
89428
|
+
} else if (uploadId) {
|
|
89429
|
+
await Promise.all(partsPromises);
|
|
89430
|
+
etags.sort((a2, b3) => a2.part > b3.part ? 1 : -1);
|
|
89431
|
+
result = await completeMultipartUpload({
|
|
89432
|
+
client,
|
|
89433
|
+
bucketName,
|
|
89434
|
+
objectName,
|
|
89435
|
+
uploadId,
|
|
89436
|
+
etags
|
|
89437
|
+
});
|
|
89438
|
+
} else {
|
|
89439
|
+
throw new Error("Stream was closed without uploading any data.");
|
|
89440
|
+
}
|
|
89441
|
+
}
|
|
89442
|
+
});
|
|
89443
|
+
this.getResult = () => {
|
|
89444
|
+
if (result === void 0) {
|
|
89445
|
+
throw new Error("Result is not ready. await the stream first.");
|
|
89446
|
+
}
|
|
89447
|
+
return result;
|
|
89448
|
+
};
|
|
89449
|
+
}
|
|
89450
|
+
};
|
|
89451
|
+
async function initiateNewMultipartUpload(options) {
|
|
89452
|
+
const method = "POST";
|
|
89453
|
+
const headers = new Headers(options.metadata);
|
|
89454
|
+
const query = "uploads";
|
|
89455
|
+
const response = await options.client.makeRequest({
|
|
89456
|
+
method,
|
|
89457
|
+
bucketName: options.bucketName,
|
|
89458
|
+
objectName: options.objectName,
|
|
89459
|
+
query,
|
|
89460
|
+
headers,
|
|
89461
|
+
returnBody: true
|
|
89462
|
+
});
|
|
89463
|
+
const responseText = await response.text();
|
|
89464
|
+
const root = parse(responseText).root;
|
|
89465
|
+
if (!root || root.name !== "InitiateMultipartUploadResult") {
|
|
89466
|
+
throw new Error(`Unexpected response: ${responseText}`);
|
|
89467
|
+
}
|
|
89468
|
+
const uploadId = root.children.find((c2) => c2.name === "UploadId")?.content;
|
|
89469
|
+
if (!uploadId) {
|
|
89470
|
+
throw new Error(`Unable to get UploadId from response: ${responseText}`);
|
|
89471
|
+
}
|
|
89472
|
+
return {
|
|
89473
|
+
uploadId
|
|
89474
|
+
};
|
|
89475
|
+
}
|
|
89476
|
+
async function completeMultipartUpload({ client, bucketName, objectName, uploadId, etags }) {
|
|
89477
|
+
const payload = `
|
|
89478
|
+
<CompleteMultipartUpload xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
|
|
89479
|
+
${etags.map((et) => ` <Part><PartNumber>${et.part}</PartNumber><ETag>${et.etag}</ETag></Part>`).join("\n")}
|
|
89480
|
+
</CompleteMultipartUpload>
|
|
89481
|
+
`;
|
|
89482
|
+
const response = await client.makeRequest({
|
|
89483
|
+
method: "POST",
|
|
89484
|
+
bucketName,
|
|
89485
|
+
objectName,
|
|
89486
|
+
query: `uploadId=${encodeURIComponent(uploadId)}`,
|
|
89487
|
+
payload: new TextEncoder().encode(payload),
|
|
89488
|
+
returnBody: true
|
|
89489
|
+
});
|
|
89490
|
+
const responseText = await response.text();
|
|
89491
|
+
const root = parse(responseText).root;
|
|
89492
|
+
if (!root || root.name !== "CompleteMultipartUploadResult") {
|
|
89493
|
+
throw new Error(`Unexpected response: ${responseText}`);
|
|
89494
|
+
}
|
|
89495
|
+
const etagRaw = root.children.find((c2) => c2.name === "ETag")?.content;
|
|
89496
|
+
if (!etagRaw) throw new Error(`Unable to get ETag from response: ${responseText}`);
|
|
89497
|
+
const versionId = getVersionId(response.headers);
|
|
89498
|
+
return {
|
|
89499
|
+
etag: sanitizeETag(etagRaw),
|
|
89500
|
+
versionId
|
|
89501
|
+
};
|
|
89502
|
+
}
|
|
89503
|
+
|
|
89504
|
+
// node_modules/@bradenmacdonald/s3-lite-client/signing.js
|
|
89505
|
+
var signV4Algorithm = "AWS4-HMAC-SHA256";
|
|
89506
|
+
async function signV4(request) {
|
|
89507
|
+
if (!request.accessKey) {
|
|
89508
|
+
throw new AccessKeyRequiredError("accessKey is required for signing");
|
|
89509
|
+
}
|
|
89510
|
+
if (!request.secretKey) {
|
|
89511
|
+
throw new SecretKeyRequiredError("secretKey is required for signing");
|
|
89512
|
+
}
|
|
89513
|
+
const sha256sum = request.headers.get("x-amz-content-sha256");
|
|
89514
|
+
if (sha256sum === null) {
|
|
89515
|
+
throw new Error("Internal S3 client error - expected x-amz-content-sha256 header, but it's missing.");
|
|
89516
|
+
}
|
|
89517
|
+
const signedHeaders = getHeadersToSign(request.headers);
|
|
89518
|
+
const canonicalRequest = getCanonicalRequest(request.method, request.path, request.headers, signedHeaders, sha256sum);
|
|
89519
|
+
const stringToSign = await getStringToSign(canonicalRequest, request.date, request.region);
|
|
89520
|
+
const signingKey = await getSigningKey(request.date, request.region, request.secretKey);
|
|
89521
|
+
const credential = getCredential(request.accessKey, request.region, request.date);
|
|
89522
|
+
const signature = bin2hex(await sha256hmac(signingKey, stringToSign)).toLowerCase();
|
|
89523
|
+
return `${signV4Algorithm} Credential=${credential}, SignedHeaders=${signedHeaders.join(";").toLowerCase()}, Signature=${signature}`;
|
|
89524
|
+
}
|
|
89525
|
+
async function presignV4(request) {
|
|
89526
|
+
if (!request.accessKey) {
|
|
89527
|
+
throw new AccessKeyRequiredError("accessKey is required for signing");
|
|
89528
|
+
}
|
|
89529
|
+
if (!request.secretKey) {
|
|
89530
|
+
throw new SecretKeyRequiredError("secretKey is required for signing");
|
|
89531
|
+
}
|
|
89532
|
+
if (request.expirySeconds < 1) {
|
|
89533
|
+
throw new InvalidExpiryError("expirySeconds cannot be less than 1 seconds");
|
|
89534
|
+
}
|
|
89535
|
+
if (request.expirySeconds > 604800) {
|
|
89536
|
+
throw new InvalidExpiryError("expirySeconds cannot be greater than 7 days");
|
|
89537
|
+
}
|
|
89538
|
+
if (!request.headers.has("Host")) {
|
|
89539
|
+
throw new Error("Internal error: host header missing");
|
|
89540
|
+
}
|
|
89541
|
+
const resource = request.path.split("?")[0];
|
|
89542
|
+
const queryString = request.path.split("?")[1];
|
|
89543
|
+
const iso8601Date = makeDateLong(request.date);
|
|
89544
|
+
const signedHeaders = getHeadersToSign(request.headers);
|
|
89545
|
+
const credential = getCredential(request.accessKey, request.region, request.date);
|
|
89546
|
+
const hashedPayload = "UNSIGNED-PAYLOAD";
|
|
89547
|
+
const newQuery = new URLSearchParams(queryString);
|
|
89548
|
+
newQuery.set("X-Amz-Algorithm", signV4Algorithm);
|
|
89549
|
+
newQuery.set("X-Amz-Credential", credential);
|
|
89550
|
+
newQuery.set("X-Amz-Date", iso8601Date);
|
|
89551
|
+
newQuery.set("X-Amz-Expires", request.expirySeconds.toString());
|
|
89552
|
+
newQuery.set("X-Amz-SignedHeaders", signedHeaders.join(";").toLowerCase());
|
|
89553
|
+
const newPath = resource + "?" + newQuery.toString().replace("+", "%20");
|
|
89554
|
+
const canonicalRequest = getCanonicalRequest(request.method, newPath, request.headers, signedHeaders, hashedPayload);
|
|
89555
|
+
const stringToSign = await getStringToSign(canonicalRequest, request.date, request.region);
|
|
89556
|
+
const signingKey = await getSigningKey(request.date, request.region, request.secretKey);
|
|
89557
|
+
const signature = bin2hex(await sha256hmac(signingKey, stringToSign)).toLowerCase();
|
|
89558
|
+
const presignedUrl = `${request.protocol}//${request.headers.get("Host")}${newPath}&X-Amz-Signature=${signature}`;
|
|
89559
|
+
return presignedUrl;
|
|
89560
|
+
}
|
|
89561
|
+
function getHeadersToSign(headers) {
|
|
89562
|
+
const ignoredHeaders = [
|
|
89563
|
+
"authorization",
|
|
89564
|
+
"content-length",
|
|
89565
|
+
"content-type",
|
|
89566
|
+
"user-agent"
|
|
89567
|
+
];
|
|
89568
|
+
const headersToSign = [];
|
|
89569
|
+
for (const key2 of headers.keys()) {
|
|
89570
|
+
if (ignoredHeaders.includes(key2.toLowerCase())) {
|
|
89571
|
+
continue;
|
|
89572
|
+
}
|
|
89573
|
+
headersToSign.push(key2);
|
|
89574
|
+
}
|
|
89575
|
+
headersToSign.sort();
|
|
89576
|
+
return headersToSign;
|
|
89577
|
+
}
|
|
89578
|
+
var CODES = {
|
|
89579
|
+
A: "A".charCodeAt(0),
|
|
89580
|
+
Z: "Z".charCodeAt(0),
|
|
89581
|
+
a: "a".charCodeAt(0),
|
|
89582
|
+
z: "z".charCodeAt(0),
|
|
89583
|
+
"0": "0".charCodeAt(0),
|
|
89584
|
+
"9": "9".charCodeAt(0),
|
|
89585
|
+
"/": "/".charCodeAt(0)
|
|
89586
|
+
};
|
|
89587
|
+
var ALLOWED_BYTES = "-._~".split("").map((s) => s.charCodeAt(0));
|
|
89588
|
+
function awsUriEncode(string, allowSlashes = false) {
|
|
89589
|
+
const bytes = new TextEncoder().encode(string);
|
|
89590
|
+
let encoded = "";
|
|
89591
|
+
for (const byte of bytes) {
|
|
89592
|
+
if (byte >= CODES.A && byte <= CODES.Z || byte >= CODES.a && byte <= CODES.z || byte >= CODES["0"] && byte <= CODES["9"] || ALLOWED_BYTES.includes(byte) || byte == CODES["/"] && allowSlashes) {
|
|
89593
|
+
encoded += String.fromCharCode(byte);
|
|
89594
|
+
} else {
|
|
89595
|
+
encoded += "%" + byte.toString(16).padStart(2, "0").toUpperCase();
|
|
89596
|
+
}
|
|
89597
|
+
}
|
|
89598
|
+
return encoded;
|
|
89599
|
+
}
|
|
89600
|
+
function getCanonicalRequest(method, path5, headers, headersToSign, payloadHash) {
|
|
89601
|
+
const headersArray = headersToSign.reduce((acc, headerKey) => {
|
|
89602
|
+
const val = `${headers.get(headerKey)}`.replace(/ +/g, " ");
|
|
89603
|
+
acc.push(`${headerKey.toLowerCase()}:${val}`);
|
|
89604
|
+
return acc;
|
|
89605
|
+
}, []);
|
|
89606
|
+
const requestResource = path5.split("?")[0];
|
|
89607
|
+
let requestQuery = path5.split("?")[1];
|
|
89608
|
+
if (requestQuery) {
|
|
89609
|
+
requestQuery = requestQuery.split("&").sort().map((element) => element.indexOf("=") === -1 ? element + "=" : element).join("&");
|
|
89610
|
+
} else {
|
|
89611
|
+
requestQuery = "";
|
|
89612
|
+
}
|
|
89613
|
+
const canonical = [];
|
|
89614
|
+
canonical.push(method.toUpperCase());
|
|
89615
|
+
canonical.push(awsUriEncode(requestResource, true));
|
|
89616
|
+
canonical.push(requestQuery);
|
|
89617
|
+
canonical.push(headersArray.join("\n") + "\n");
|
|
89618
|
+
canonical.push(headersToSign.join(";").toLowerCase());
|
|
89619
|
+
canonical.push(payloadHash);
|
|
89620
|
+
return canonical.join("\n");
|
|
89621
|
+
}
|
|
89622
|
+
async function getStringToSign(canonicalRequest, requestDate, region) {
|
|
89623
|
+
const hash = await sha256digestHex(canonicalRequest);
|
|
89624
|
+
const scope = getScope(region, requestDate);
|
|
89625
|
+
const stringToSign = [];
|
|
89626
|
+
stringToSign.push(signV4Algorithm);
|
|
89627
|
+
stringToSign.push(makeDateLong(requestDate));
|
|
89628
|
+
stringToSign.push(scope);
|
|
89629
|
+
stringToSign.push(hash);
|
|
89630
|
+
return stringToSign.join("\n");
|
|
89631
|
+
}
|
|
89632
|
+
async function getSigningKey(date, region, secretKey) {
|
|
89633
|
+
const dateLine = makeDateShort(date);
|
|
89634
|
+
const hmac1 = await sha256hmac("AWS4" + secretKey, dateLine);
|
|
89635
|
+
const hmac2 = await sha256hmac(hmac1, region);
|
|
89636
|
+
const hmac3 = await sha256hmac(hmac2, "s3");
|
|
89637
|
+
return await sha256hmac(hmac3, "aws4_request");
|
|
89638
|
+
}
|
|
89639
|
+
function getCredential(accessKey, region, requestDate) {
|
|
89640
|
+
return `${accessKey}/${getScope(region, requestDate)}`;
|
|
89641
|
+
}
|
|
89642
|
+
async function sha256hmac(secretKey, data) {
|
|
89643
|
+
const enc = new TextEncoder();
|
|
89644
|
+
const keyObject = await crypto.subtle.importKey("raw", secretKey instanceof Uint8Array ? secretKey : enc.encode(secretKey), {
|
|
89645
|
+
name: "HMAC",
|
|
89646
|
+
hash: {
|
|
89647
|
+
name: "SHA-256"
|
|
89648
|
+
}
|
|
89649
|
+
}, false, [
|
|
89650
|
+
"sign",
|
|
89651
|
+
"verify"
|
|
89652
|
+
]);
|
|
89653
|
+
const signature = await crypto.subtle.sign("HMAC", keyObject, data instanceof Uint8Array ? data : enc.encode(data));
|
|
89654
|
+
return new Uint8Array(signature);
|
|
89655
|
+
}
|
|
89656
|
+
|
|
89657
|
+
// node_modules/@bradenmacdonald/s3-lite-client/client.js
|
|
89658
|
+
var metadataKeys = [
|
|
89659
|
+
"Content-Type",
|
|
89660
|
+
"Cache-Control",
|
|
89661
|
+
"Content-Disposition",
|
|
89662
|
+
"Content-Encoding",
|
|
89663
|
+
"Content-Language",
|
|
89664
|
+
"Expires",
|
|
89665
|
+
"x-amz-grant-full-control",
|
|
89666
|
+
"x-amz-grant-read",
|
|
89667
|
+
"x-amz-grant-read-acp",
|
|
89668
|
+
"x-amz-grant-write-acp",
|
|
89669
|
+
"x-amz-server-side-encryption",
|
|
89670
|
+
"x-amz-storage-class",
|
|
89671
|
+
"x-amz-website-redirect-location",
|
|
89672
|
+
"x-amz-server-side-encryption-customer-algorithm",
|
|
89673
|
+
"x-amz-server-side-encryption-customer-key",
|
|
89674
|
+
"x-amz-server-side-encryption-customer-key-MD5",
|
|
89675
|
+
"x-amz-server-side-encryption-aws-kms-key-id",
|
|
89676
|
+
"x-amz-server-side-encryption-context",
|
|
89677
|
+
"x-amz-server-side-encryption-bucket-key-enabled",
|
|
89678
|
+
"x-amz-request-payer",
|
|
89679
|
+
"x-amz-tagging",
|
|
89680
|
+
"x-amz-object-lock-mode",
|
|
89681
|
+
"x-amz-object-lock-retain-until-date",
|
|
89682
|
+
"x-amz-object-lock-legal-hold",
|
|
89683
|
+
"x-amz-expected-bucket-owner"
|
|
89684
|
+
];
|
|
89685
|
+
var minimumPartSize = 5 * 1024 * 1024;
|
|
89686
|
+
var maximumPartSize = 5 * 1024 * 1024 * 1024;
|
|
89687
|
+
var maxObjectSize = 5 * 1024 * 1024 * 1024 * 1024;
|
|
89688
|
+
var Client = class {
|
|
89689
|
+
host;
|
|
89690
|
+
port;
|
|
89691
|
+
protocol;
|
|
89692
|
+
accessKey;
|
|
89693
|
+
#secretKey;
|
|
89694
|
+
sessionToken;
|
|
89695
|
+
defaultBucket;
|
|
89696
|
+
region;
|
|
89697
|
+
userAgent = "s3-lite-client";
|
|
89698
|
+
/** Use path-style requests, e.g. https://endpoint/bucket/object-key instead of https://bucket/object-key */
|
|
89699
|
+
pathStyle;
|
|
89700
|
+
constructor(params) {
|
|
89701
|
+
if (params.useSSL === void 0) {
|
|
89702
|
+
params.useSSL = true;
|
|
89703
|
+
}
|
|
89704
|
+
if (typeof params.endPoint !== "string" || params.endPoint.length === 0 || params.endPoint.indexOf("/") !== -1) {
|
|
89705
|
+
throw new InvalidEndpointError(`Invalid endPoint : ${params.endPoint}`);
|
|
89706
|
+
}
|
|
89707
|
+
if (params.port !== void 0 && !isValidPort(params.port)) {
|
|
89708
|
+
throw new InvalidArgumentError2(`Invalid port : ${params.port}`);
|
|
89709
|
+
}
|
|
89710
|
+
if (params.accessKey && !params.secretKey) {
|
|
89711
|
+
throw new InvalidArgumentError2(`If specifying access key, secret key must also be provided.`);
|
|
89712
|
+
}
|
|
89713
|
+
if (params.accessKey && params.accessKey.startsWith("ASIA") && !params.sessionToken) {
|
|
89714
|
+
throw new InvalidArgumentError2(`If specifying temporary access key, session token must also be provided.`);
|
|
89715
|
+
}
|
|
89716
|
+
const defaultPort = params.useSSL ? 443 : 80;
|
|
89717
|
+
this.port = params.port ?? defaultPort;
|
|
89718
|
+
this.host = params.endPoint.toLowerCase() + (this.port !== defaultPort ? `:${params.port}` : "");
|
|
89719
|
+
this.protocol = params.useSSL ? "https:" : "http:";
|
|
89720
|
+
this.accessKey = params.accessKey;
|
|
89721
|
+
this.#secretKey = params.secretKey ?? "";
|
|
89722
|
+
this.sessionToken = params.sessionToken;
|
|
89723
|
+
this.pathStyle = params.pathStyle ?? true;
|
|
89724
|
+
this.defaultBucket = params.bucket;
|
|
89725
|
+
this.region = params.region;
|
|
89726
|
+
}
|
|
89727
|
+
/** Internal helper method to figure out which bucket name to use for a request */
|
|
89728
|
+
getBucketName(options) {
|
|
89729
|
+
const bucketName = options?.bucketName ?? this.defaultBucket;
|
|
89730
|
+
if (bucketName === void 0 || !isValidBucketName(bucketName)) {
|
|
89731
|
+
throw new InvalidBucketNameError(`Invalid bucket name: ${bucketName}`);
|
|
89732
|
+
}
|
|
89733
|
+
return bucketName;
|
|
89734
|
+
}
|
|
89735
|
+
/**
|
|
89736
|
+
* Common code used for both "normal" requests and presigned UTL requests
|
|
89737
|
+
*/
|
|
89738
|
+
buildRequestOptions(options) {
|
|
89739
|
+
const bucketName = this.getBucketName(options);
|
|
89740
|
+
const host = this.pathStyle ? this.host : `${bucketName}.${this.host}`;
|
|
89741
|
+
const headers = options.headers ?? new Headers();
|
|
89742
|
+
headers.set("host", host);
|
|
89743
|
+
const queryAsString = typeof options.query === "object" ? new URLSearchParams(options.query).toString().replace("+", "%20") : options.query;
|
|
89744
|
+
const path5 = (this.pathStyle ? `/${bucketName}/${options.objectName}` : `/${options.objectName}`) + (queryAsString ? `?${queryAsString}` : "");
|
|
89745
|
+
return {
|
|
89746
|
+
headers,
|
|
89747
|
+
host,
|
|
89748
|
+
path: path5
|
|
89749
|
+
};
|
|
89750
|
+
}
|
|
89751
|
+
/**
|
|
89752
|
+
* Make a single request to S3
|
|
89753
|
+
*/
|
|
89754
|
+
async makeRequest({ method, payload, ...options }) {
|
|
89755
|
+
const date = /* @__PURE__ */ new Date();
|
|
89756
|
+
const { headers, host, path: path5 } = this.buildRequestOptions(options);
|
|
89757
|
+
const statusCode = options.statusCode ?? 200;
|
|
89758
|
+
if (method === "POST" || method === "PUT" || method === "DELETE") {
|
|
89759
|
+
if (payload === void 0) {
|
|
89760
|
+
payload = new Uint8Array();
|
|
89761
|
+
} else if (typeof payload === "string") {
|
|
89762
|
+
payload = new TextEncoder().encode(payload);
|
|
89763
|
+
}
|
|
89764
|
+
headers.set("Content-Length", String(payload.length));
|
|
89765
|
+
} else if (payload) {
|
|
89766
|
+
throw new Error(`Unexpected payload on ${method} request.`);
|
|
89767
|
+
}
|
|
89768
|
+
const sha256sum = await sha256digestHex(payload ?? new Uint8Array());
|
|
89769
|
+
headers.set("x-amz-date", makeDateLong(date));
|
|
89770
|
+
headers.set("x-amz-content-sha256", sha256sum);
|
|
89771
|
+
if (this.accessKey) {
|
|
89772
|
+
if (this.sessionToken) {
|
|
89773
|
+
headers.set("x-amz-security-token", this.sessionToken);
|
|
89774
|
+
}
|
|
89775
|
+
headers.set("authorization", await signV4({
|
|
89776
|
+
headers,
|
|
89777
|
+
method,
|
|
89778
|
+
path: path5,
|
|
89779
|
+
accessKey: this.accessKey,
|
|
89780
|
+
secretKey: this.#secretKey,
|
|
89781
|
+
region: this.region,
|
|
89782
|
+
date
|
|
89783
|
+
}));
|
|
89784
|
+
}
|
|
89785
|
+
const fullUrl = `${this.protocol}//${host}${path5}`;
|
|
89786
|
+
const response = await fetch(fullUrl, {
|
|
89787
|
+
method,
|
|
89788
|
+
headers,
|
|
89789
|
+
body: payload
|
|
89790
|
+
});
|
|
89791
|
+
if (response.status !== statusCode) {
|
|
89792
|
+
if (response.status >= 400) {
|
|
89793
|
+
const error = await parseServerError(response);
|
|
89794
|
+
throw error;
|
|
89795
|
+
} else if (response.status === 301) {
|
|
89796
|
+
throw new ServerError(response.status, "UnexpectedRedirect", `The server unexpectedly returned a redirect response. With AWS S3, this usually means you need to use a region-specific endpoint like "s3.us-west-2.amazonaws.com" instead of "s3.amazonaws.com"`);
|
|
89797
|
+
}
|
|
89798
|
+
throw new ServerError(response.status, "UnexpectedStatusCode", `Unexpected response code from the server (expected ${statusCode}, got ${response.status} ${response.statusText}).`);
|
|
89799
|
+
}
|
|
89800
|
+
if (!options.returnBody) {
|
|
89801
|
+
await response.body?.getReader().read();
|
|
89802
|
+
}
|
|
89803
|
+
return response;
|
|
89804
|
+
}
|
|
89805
|
+
/**
|
|
89806
|
+
* Delete a single object.
|
|
89807
|
+
*
|
|
89808
|
+
* You can also pass a versionId to delete a specific version of an object.
|
|
89809
|
+
*/
|
|
89810
|
+
async deleteObject(objectName, options = {}) {
|
|
89811
|
+
const bucketName = this.getBucketName(options);
|
|
89812
|
+
if (!isValidObjectName(objectName)) {
|
|
89813
|
+
throw new InvalidObjectNameError(`Invalid object name: ${objectName}`);
|
|
89814
|
+
}
|
|
89815
|
+
const query = options.versionId ? {
|
|
89816
|
+
versionId: options.versionId
|
|
89817
|
+
} : {};
|
|
89818
|
+
const headers = new Headers();
|
|
89819
|
+
if (options.governanceBypass) {
|
|
89820
|
+
headers.set("X-Amz-Bypass-Governance-Retention", "true");
|
|
89821
|
+
}
|
|
89822
|
+
await this.makeRequest({
|
|
89823
|
+
method: "DELETE",
|
|
89824
|
+
bucketName,
|
|
89825
|
+
objectName,
|
|
89826
|
+
headers,
|
|
89827
|
+
query,
|
|
89828
|
+
statusCode: 204
|
|
89829
|
+
});
|
|
89830
|
+
}
|
|
89831
|
+
/**
|
|
89832
|
+
* Check if an object with the specified key exists.
|
|
89833
|
+
*/
|
|
89834
|
+
async exists(objectName, options) {
|
|
89835
|
+
try {
|
|
89836
|
+
await this.statObject(objectName, options);
|
|
89837
|
+
return true;
|
|
89838
|
+
} catch (err) {
|
|
89839
|
+
if (err instanceof ServerError && err.statusCode === 404) {
|
|
89840
|
+
return false;
|
|
89841
|
+
}
|
|
89842
|
+
throw err;
|
|
89843
|
+
}
|
|
89844
|
+
}
|
|
89845
|
+
/**
|
|
89846
|
+
* Get an object.
|
|
89847
|
+
*
|
|
89848
|
+
* Returns a standard HTTP Response object, which has many ways of consuming the response including
|
|
89849
|
+
* `.text()`, `.json()`, `.body` (ReadableStream), `.arrayBuffer()`, and `.blob()`.
|
|
89850
|
+
*/
|
|
89851
|
+
getObject(objectName, options) {
|
|
89852
|
+
return this.getPartialObject(objectName, {
|
|
89853
|
+
...options,
|
|
89854
|
+
offset: 0,
|
|
89855
|
+
length: 0
|
|
89856
|
+
});
|
|
89857
|
+
}
|
|
89858
|
+
/**
|
|
89859
|
+
* Stream a partial object, starting from the specified offset in bytes, up to the specified length in bytes.
|
|
89860
|
+
* A length of zero will return the rest of the object from the specified offset.
|
|
89861
|
+
* Pass a version UUID as "versionId" to download a specific version.
|
|
89862
|
+
*
|
|
89863
|
+
* Returns a standard HTTP Response object.
|
|
89864
|
+
*/
|
|
89865
|
+
async getPartialObject(objectName, { offset, length, ...options }) {
|
|
89866
|
+
const bucketName = this.getBucketName(options);
|
|
89867
|
+
if (!isValidObjectName(objectName)) {
|
|
89868
|
+
throw new InvalidObjectNameError(`Invalid object name: ${objectName}`);
|
|
89869
|
+
}
|
|
89870
|
+
const headers = new Headers(Object.entries(options.metadata ?? {}));
|
|
89871
|
+
let statusCode = 200;
|
|
89872
|
+
if (offset || length) {
|
|
89873
|
+
let range = "";
|
|
89874
|
+
if (offset) {
|
|
89875
|
+
range = `bytes=${+offset}-`;
|
|
89876
|
+
} else {
|
|
89877
|
+
range = "bytes=0-";
|
|
89878
|
+
offset = 0;
|
|
89879
|
+
}
|
|
89880
|
+
if (length) {
|
|
89881
|
+
range += `${+length + offset - 1}`;
|
|
89882
|
+
}
|
|
89883
|
+
headers.set("Range", range);
|
|
89884
|
+
statusCode = 206;
|
|
89885
|
+
}
|
|
89886
|
+
const query = {
|
|
89887
|
+
...options.responseParams,
|
|
89888
|
+
...options.versionId ? {
|
|
89889
|
+
versionId: options.versionId
|
|
89890
|
+
} : {}
|
|
89891
|
+
};
|
|
89892
|
+
return await this.makeRequest({
|
|
89893
|
+
method: "GET",
|
|
89894
|
+
bucketName,
|
|
89895
|
+
objectName,
|
|
89896
|
+
headers,
|
|
89897
|
+
query,
|
|
89898
|
+
statusCode,
|
|
89899
|
+
returnBody: true
|
|
89900
|
+
});
|
|
89901
|
+
}
|
|
89902
|
+
/**
|
|
89903
|
+
* Low-level method to generate a pre-signed URL.
|
|
89904
|
+
* @param method The HTTP method to use for the request
|
|
89905
|
+
* @param objectName The object name, e.g. "path/to/file.txt"
|
|
89906
|
+
* @param options Detailed options, such as expiry time for the pre-signed URL. Use expirySeconds to specify the expiry time; default is seven days.
|
|
89907
|
+
*/
|
|
89908
|
+
getPresignedUrl(method, objectName, options = {}) {
|
|
89909
|
+
if (!this.accessKey) {
|
|
89910
|
+
throw new AccessKeyRequiredError(`Presigned ${method} URLs cannot be generated for anonymous requests. Specify an accessKey and secretKey.`);
|
|
89911
|
+
}
|
|
89912
|
+
if (!isValidObjectName(objectName)) {
|
|
89913
|
+
throw new InvalidObjectNameError(`Invalid object name: ${objectName}`);
|
|
89914
|
+
}
|
|
89915
|
+
const { headers, path: path5 } = this.buildRequestOptions({
|
|
89916
|
+
objectName,
|
|
89917
|
+
bucketName: options.bucketName,
|
|
89918
|
+
query: options.parameters
|
|
89919
|
+
});
|
|
89920
|
+
const requestDate = options.requestDate ?? /* @__PURE__ */ new Date();
|
|
89921
|
+
const expirySeconds = options.expirySeconds ?? 24 * 60 * 60 * 7;
|
|
89922
|
+
return presignV4({
|
|
89923
|
+
protocol: this.protocol,
|
|
89924
|
+
headers,
|
|
89925
|
+
method,
|
|
89926
|
+
path: path5,
|
|
89927
|
+
accessKey: this.accessKey,
|
|
89928
|
+
secretKey: this.#secretKey,
|
|
89929
|
+
region: this.region,
|
|
89930
|
+
date: requestDate,
|
|
89931
|
+
expirySeconds
|
|
89932
|
+
});
|
|
89933
|
+
}
|
|
89934
|
+
/**
|
|
89935
|
+
* Generate a pre-signed GET request URL.
|
|
89936
|
+
*
|
|
89937
|
+
* Use options.expirySeconds to override the expiration time (default is 7 days)
|
|
89938
|
+
*/
|
|
89939
|
+
presignedGetObject(objectName, options = {}) {
|
|
89940
|
+
const { versionId, responseParams, ...otherOptions } = options;
|
|
89941
|
+
const parameters = {
|
|
89942
|
+
...responseParams,
|
|
89943
|
+
...versionId ? {
|
|
89944
|
+
versionId
|
|
89945
|
+
} : {}
|
|
89946
|
+
};
|
|
89947
|
+
return this.getPresignedUrl("GET", objectName, {
|
|
89948
|
+
parameters,
|
|
89949
|
+
...otherOptions
|
|
89950
|
+
});
|
|
89951
|
+
}
|
|
89952
|
+
/**
|
|
89953
|
+
* List objects in the bucket, optionally filtered by the given key prefix.
|
|
89954
|
+
*
|
|
89955
|
+
* This returns a flat list; use listObjectsGrouped() for more advanced behavior.
|
|
89956
|
+
*/
|
|
89957
|
+
async *listObjects(options = {}) {
|
|
89958
|
+
for await (const result of this.listObjectsGrouped({
|
|
89959
|
+
...options,
|
|
89960
|
+
delimiter: ""
|
|
89961
|
+
})) {
|
|
89962
|
+
if (result.type === "Object") {
|
|
89963
|
+
yield result;
|
|
89964
|
+
} else {
|
|
89965
|
+
throw new Error(`Unexpected result from listObjectsGrouped(): ${result}`);
|
|
89966
|
+
}
|
|
89967
|
+
}
|
|
89968
|
+
}
|
|
89969
|
+
/**
|
|
89970
|
+
* List objects in the bucket, grouped based on the specified "delimiter".
|
|
89971
|
+
*
|
|
89972
|
+
* See https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-prefixes.html
|
|
89973
|
+
*/
|
|
89974
|
+
async *listObjectsGrouped(options) {
|
|
89975
|
+
const bucketName = this.getBucketName(options);
|
|
89976
|
+
let continuationToken = "";
|
|
89977
|
+
const pageSize = options.pageSize ?? 1e3;
|
|
89978
|
+
if (pageSize < 1 || pageSize > 1e3) {
|
|
89979
|
+
throw new InvalidArgumentError2("pageSize must be between 1 and 1,000.");
|
|
89980
|
+
}
|
|
89981
|
+
let resultCount = 0;
|
|
89982
|
+
while (true) {
|
|
89983
|
+
const maxKeys = options.maxResults ? Math.min(pageSize, options.maxResults - resultCount) : pageSize;
|
|
89984
|
+
if (maxKeys === 0) {
|
|
89985
|
+
return;
|
|
89986
|
+
}
|
|
89987
|
+
const pageResponse = await this.makeRequest({
|
|
89988
|
+
method: "GET",
|
|
89989
|
+
bucketName,
|
|
89990
|
+
objectName: "",
|
|
89991
|
+
query: {
|
|
89992
|
+
"list-type": "2",
|
|
89993
|
+
prefix: options.prefix ?? "",
|
|
89994
|
+
delimiter: options.delimiter,
|
|
89995
|
+
"max-keys": String(maxKeys),
|
|
89996
|
+
...continuationToken ? {
|
|
89997
|
+
"continuation-token": continuationToken
|
|
89998
|
+
} : {}
|
|
89999
|
+
},
|
|
90000
|
+
returnBody: true
|
|
90001
|
+
});
|
|
90002
|
+
const responseText = await pageResponse.text();
|
|
90003
|
+
const root = parse(responseText).root;
|
|
90004
|
+
if (!root || root.name !== "ListBucketResult") {
|
|
90005
|
+
throw new Error(`Unexpected response: ${responseText}`);
|
|
90006
|
+
}
|
|
90007
|
+
const prefixElements = root.children.filter((c2) => c2.name === "CommonPrefixes").flatMap((c2) => c2.children);
|
|
90008
|
+
const toYield = [];
|
|
90009
|
+
for (const prefixElement of prefixElements) {
|
|
90010
|
+
toYield.push({
|
|
90011
|
+
type: "CommonPrefix",
|
|
90012
|
+
prefix: prefixElement.content ?? ""
|
|
90013
|
+
});
|
|
90014
|
+
resultCount++;
|
|
90015
|
+
}
|
|
90016
|
+
for (const objectElement of root.children.filter((c2) => c2.name === "Contents")) {
|
|
90017
|
+
toYield.push({
|
|
90018
|
+
type: "Object",
|
|
90019
|
+
key: objectElement.children.find((c2) => c2.name === "Key")?.content ?? "",
|
|
90020
|
+
etag: sanitizeETag(objectElement.children.find((c2) => c2.name === "ETag")?.content ?? ""),
|
|
90021
|
+
size: parseInt(objectElement.children.find((c2) => c2.name === "Size")?.content ?? "", 10),
|
|
90022
|
+
lastModified: new Date(objectElement.children.find((c2) => c2.name === "LastModified")?.content ?? "invalid")
|
|
90023
|
+
});
|
|
90024
|
+
resultCount++;
|
|
90025
|
+
}
|
|
90026
|
+
toYield.sort((a2, b3) => {
|
|
90027
|
+
const aStr = a2.type === "Object" ? a2.key : a2.prefix;
|
|
90028
|
+
const bStr = b3.type === "Object" ? b3.key : b3.prefix;
|
|
90029
|
+
return aStr > bStr ? 1 : aStr < bStr ? -1 : 0;
|
|
90030
|
+
});
|
|
90031
|
+
for (const entry of toYield) {
|
|
90032
|
+
yield entry;
|
|
90033
|
+
}
|
|
90034
|
+
const isTruncated = root.children.find((c2) => c2.name === "IsTruncated")?.content === "true";
|
|
90035
|
+
if (isTruncated) {
|
|
90036
|
+
const nextContinuationToken = root.children.find((c2) => c2.name === "NextContinuationToken")?.content;
|
|
90037
|
+
if (!nextContinuationToken) {
|
|
90038
|
+
throw new Error("Unexpectedly missing continuation token, but server said there are more results.");
|
|
90039
|
+
}
|
|
90040
|
+
continuationToken = nextContinuationToken;
|
|
90041
|
+
} else {
|
|
90042
|
+
return;
|
|
90043
|
+
}
|
|
90044
|
+
}
|
|
90045
|
+
}
|
|
90046
|
+
/**
|
|
90047
|
+
* Upload an object
|
|
90048
|
+
*/
|
|
90049
|
+
async putObject(objectName, streamOrData, options) {
|
|
90050
|
+
const bucketName = this.getBucketName(options);
|
|
90051
|
+
if (!isValidObjectName(objectName)) {
|
|
90052
|
+
throw new InvalidObjectNameError(`Invalid object name: ${objectName}`);
|
|
90053
|
+
}
|
|
90054
|
+
let size;
|
|
90055
|
+
let stream;
|
|
90056
|
+
if (typeof streamOrData === "string") {
|
|
90057
|
+
const binaryData = new TextEncoder().encode(streamOrData);
|
|
90058
|
+
if (typeof ReadableStream.from !== "undefined") {
|
|
90059
|
+
stream = ReadableStream.from([
|
|
90060
|
+
binaryData
|
|
90061
|
+
]);
|
|
90062
|
+
} else {
|
|
90063
|
+
stream = new ReadableStream({
|
|
90064
|
+
start(c2) {
|
|
90065
|
+
c2.enqueue(binaryData);
|
|
90066
|
+
c2.close();
|
|
90067
|
+
}
|
|
90068
|
+
});
|
|
90069
|
+
}
|
|
90070
|
+
size = binaryData.length;
|
|
90071
|
+
} else if (streamOrData instanceof Uint8Array) {
|
|
90072
|
+
if (typeof ReadableStream.from !== "undefined") {
|
|
90073
|
+
stream = ReadableStream.from([
|
|
90074
|
+
streamOrData
|
|
90075
|
+
]);
|
|
90076
|
+
} else {
|
|
90077
|
+
stream = new ReadableStream({
|
|
90078
|
+
start(c2) {
|
|
90079
|
+
c2.enqueue(streamOrData);
|
|
90080
|
+
c2.close();
|
|
90081
|
+
}
|
|
90082
|
+
});
|
|
90083
|
+
}
|
|
90084
|
+
size = streamOrData.byteLength;
|
|
90085
|
+
} else if (streamOrData instanceof ReadableStream) {
|
|
90086
|
+
stream = streamOrData;
|
|
90087
|
+
} else {
|
|
90088
|
+
throw new InvalidArgumentError2(`Invalid stream/data type provided.`);
|
|
90089
|
+
}
|
|
90090
|
+
if (options?.size !== void 0) {
|
|
90091
|
+
if (size !== void 0 && options?.size !== size) {
|
|
90092
|
+
throw new InvalidArgumentError2(`size was specified (${options.size}) but doesn't match auto-detected size (${size}).`);
|
|
90093
|
+
}
|
|
90094
|
+
if (typeof options.size !== "number" || options.size < 0 || isNaN(options.size)) {
|
|
90095
|
+
throw new InvalidArgumentError2(`invalid size specified: ${options.size}`);
|
|
90096
|
+
} else {
|
|
90097
|
+
size = options.size;
|
|
90098
|
+
}
|
|
90099
|
+
}
|
|
90100
|
+
const partSize = options?.partSize ?? this.calculatePartSize(size);
|
|
90101
|
+
if (partSize < minimumPartSize) {
|
|
90102
|
+
throw new InvalidArgumentError2(`Part size should be greater than 5MB`);
|
|
90103
|
+
} else if (partSize > maximumPartSize) {
|
|
90104
|
+
throw new InvalidArgumentError2(`Part size should be less than 6MB`);
|
|
90105
|
+
}
|
|
90106
|
+
const chunker = new TransformChunkSizes(partSize);
|
|
90107
|
+
const uploader = new ObjectUploader({
|
|
90108
|
+
client: this,
|
|
90109
|
+
bucketName,
|
|
90110
|
+
objectName,
|
|
90111
|
+
partSize,
|
|
90112
|
+
metadata: options?.metadata ?? {}
|
|
90113
|
+
});
|
|
90114
|
+
await stream.pipeThrough(chunker).pipeTo(uploader);
|
|
90115
|
+
return uploader.getResult();
|
|
90116
|
+
}
|
|
90117
|
+
/**
|
|
90118
|
+
* Calculate part size given the object size. Part size will be at least this.partSize.
|
|
90119
|
+
*
|
|
90120
|
+
* Per https://docs.aws.amazon.com/AmazonS3/latest/userguide/qfacts.html we have to
|
|
90121
|
+
* stick to the following rules:
|
|
90122
|
+
* - part size between 5MB (this.maximumPartSize) and 5GB (this.maxObjectSize)
|
|
90123
|
+
* (the final part can be smaller than 5MB however)
|
|
90124
|
+
* - maximum of 10,000 parts per upload
|
|
90125
|
+
* - maximum object size of 5TB
|
|
90126
|
+
*/
|
|
90127
|
+
calculatePartSize(size) {
|
|
90128
|
+
if (size === void 0) {
|
|
90129
|
+
size = maxObjectSize;
|
|
90130
|
+
}
|
|
90131
|
+
if (size > maxObjectSize) {
|
|
90132
|
+
throw new TypeError(`size should not be more than ${maxObjectSize}`);
|
|
90133
|
+
}
|
|
90134
|
+
let partSize = 64 * 1024 * 1024;
|
|
90135
|
+
while (true) {
|
|
90136
|
+
if (partSize * 1e4 > size) {
|
|
90137
|
+
return partSize;
|
|
90138
|
+
}
|
|
90139
|
+
partSize += 16 * 1024 * 1024;
|
|
90140
|
+
}
|
|
90141
|
+
}
|
|
90142
|
+
/**
|
|
90143
|
+
* Get detailed information about an object.
|
|
90144
|
+
*/
|
|
90145
|
+
async statObject(objectName, options) {
|
|
90146
|
+
const bucketName = this.getBucketName(options);
|
|
90147
|
+
if (!isValidObjectName(objectName)) {
|
|
90148
|
+
throw new InvalidObjectNameError(`Invalid object name: ${objectName}`);
|
|
90149
|
+
}
|
|
90150
|
+
const query = {};
|
|
90151
|
+
if (options?.versionId) {
|
|
90152
|
+
query.versionId = options.versionId;
|
|
90153
|
+
}
|
|
90154
|
+
const response = await this.makeRequest({
|
|
90155
|
+
method: "HEAD",
|
|
90156
|
+
bucketName,
|
|
90157
|
+
objectName,
|
|
90158
|
+
query
|
|
90159
|
+
});
|
|
90160
|
+
const metadata = {};
|
|
90161
|
+
for (const header of metadataKeys) {
|
|
90162
|
+
if (response.headers.has(header)) {
|
|
90163
|
+
metadata[header] = response.headers.get(header);
|
|
90164
|
+
}
|
|
90165
|
+
}
|
|
90166
|
+
response.headers.forEach((_value, key2) => {
|
|
90167
|
+
if (key2.startsWith("x-amz-meta-")) {
|
|
90168
|
+
metadata[key2] = response.headers.get(key2);
|
|
90169
|
+
}
|
|
90170
|
+
});
|
|
90171
|
+
return {
|
|
90172
|
+
type: "Object",
|
|
90173
|
+
key: objectName,
|
|
90174
|
+
size: parseInt(response.headers.get("content-length") ?? "", 10),
|
|
90175
|
+
metadata,
|
|
90176
|
+
lastModified: new Date(response.headers.get("Last-Modified") ?? "error: missing last modified"),
|
|
90177
|
+
versionId: response.headers.get("x-amz-version-id") || null,
|
|
90178
|
+
etag: sanitizeETag(response.headers.get("ETag") ?? "")
|
|
90179
|
+
};
|
|
90180
|
+
}
|
|
90181
|
+
/**
|
|
90182
|
+
* Copy an object into this bucket
|
|
90183
|
+
*/
|
|
90184
|
+
async copyObject(source, objectName, options) {
|
|
90185
|
+
const bucketName = this.getBucketName(options);
|
|
90186
|
+
const sourceBucketName = source.sourceBucketName ?? bucketName;
|
|
90187
|
+
if (!isValidObjectName(objectName)) {
|
|
90188
|
+
throw new InvalidObjectNameError(`Invalid object name: ${objectName}`);
|
|
90189
|
+
}
|
|
90190
|
+
let xAmzCopySource = `${sourceBucketName}/${source.sourceKey}`;
|
|
90191
|
+
if (source.sourceVersionId) xAmzCopySource += `?versionId=${source.sourceVersionId}`;
|
|
90192
|
+
const headers = new Headers(options?.metadata);
|
|
90193
|
+
if (options?.metadata !== void 0) {
|
|
90194
|
+
headers.set("x-amz-metadata-directive", "REPLACE");
|
|
90195
|
+
}
|
|
90196
|
+
headers.set("x-amz-copy-source", xAmzCopySource);
|
|
90197
|
+
const response = await this.makeRequest({
|
|
90198
|
+
method: "PUT",
|
|
90199
|
+
bucketName,
|
|
90200
|
+
objectName,
|
|
90201
|
+
headers,
|
|
90202
|
+
returnBody: true
|
|
90203
|
+
});
|
|
90204
|
+
const responseText = await response.text();
|
|
90205
|
+
const root = parse(responseText).root;
|
|
90206
|
+
if (!root || root.name !== "CopyObjectResult") {
|
|
90207
|
+
throw new Error(`Unexpected response: ${responseText}`);
|
|
90208
|
+
}
|
|
90209
|
+
const etagString = root.children.find((c2) => c2.name === "ETag")?.content ?? "";
|
|
90210
|
+
const lastModifiedString = root.children.find((c2) => c2.name === "LastModified")?.content;
|
|
90211
|
+
if (lastModifiedString === void 0) {
|
|
90212
|
+
throw new Error("Unable to find <LastModified>...</LastModified> from the server.");
|
|
90213
|
+
}
|
|
90214
|
+
return {
|
|
90215
|
+
copySourceVersionId: response.headers.get("x-amz-copy-source-version-id") || null,
|
|
90216
|
+
etag: sanitizeETag(etagString),
|
|
90217
|
+
lastModified: new Date(lastModifiedString),
|
|
90218
|
+
versionId: response.headers.get("x-amz-version-id") || null
|
|
90219
|
+
};
|
|
90220
|
+
}
|
|
90221
|
+
/** Check if a bucket exists */
|
|
90222
|
+
async bucketExists(bucketName) {
|
|
90223
|
+
try {
|
|
90224
|
+
const objects = this.listObjects({
|
|
90225
|
+
bucketName
|
|
90226
|
+
});
|
|
90227
|
+
await objects.next();
|
|
90228
|
+
return true;
|
|
90229
|
+
} catch (err) {
|
|
90230
|
+
if (err instanceof ServerError && err.statusCode === 404) {
|
|
90231
|
+
return false;
|
|
90232
|
+
}
|
|
90233
|
+
throw err;
|
|
90234
|
+
}
|
|
90235
|
+
}
|
|
90236
|
+
/** Create a new bucket */
|
|
90237
|
+
async makeBucket(bucketName) {
|
|
90238
|
+
await this.makeRequest({
|
|
90239
|
+
method: "PUT",
|
|
90240
|
+
bucketName: this.getBucketName({
|
|
90241
|
+
bucketName
|
|
90242
|
+
}),
|
|
90243
|
+
objectName: "",
|
|
90244
|
+
statusCode: 200
|
|
90245
|
+
});
|
|
90246
|
+
}
|
|
90247
|
+
/** Delete a bucket (must be empty) */
|
|
90248
|
+
async removeBucket(bucketName) {
|
|
90249
|
+
await this.makeRequest({
|
|
90250
|
+
method: "DELETE",
|
|
90251
|
+
bucketName: this.getBucketName({
|
|
90252
|
+
bucketName
|
|
90253
|
+
}),
|
|
90254
|
+
objectName: "",
|
|
90255
|
+
statusCode: 204
|
|
90256
|
+
});
|
|
90257
|
+
}
|
|
90258
|
+
};
|
|
90259
|
+
|
|
90260
|
+
// src/bundle/upload.ts
|
|
88899
90261
|
var alertMb2 = 20;
|
|
88900
90262
|
var UPLOAD_TIMEOUT = 12e4;
|
|
88901
90263
|
function getBundle(config, options) {
|
|
@@ -89162,19 +90524,7 @@ async function uploadBundle(preAppid, options, shouldExit = true) {
|
|
|
89162
90524
|
oe(`Uploading`);
|
|
89163
90525
|
const pm2 = getPMAndCommand();
|
|
89164
90526
|
await checkLatest();
|
|
89165
|
-
const { s3Region, s3Apikey, s3Apisecret, s3BucketName } = options;
|
|
89166
|
-
if (s3BucketName || s3Region || s3Apikey || s3Apisecret) {
|
|
89167
|
-
if (!s3BucketName || !s3Region || !s3Apikey || !s3Apisecret) {
|
|
89168
|
-
f2.error("Missing argument, for S3 upload you need to provide a bucket name, region, API key, and API secret");
|
|
89169
|
-
program.error("");
|
|
89170
|
-
}
|
|
89171
|
-
}
|
|
89172
|
-
if (s3Region && s3Apikey && s3Apisecret && s3BucketName) {
|
|
89173
|
-
f2.info("Uploading to S3");
|
|
89174
|
-
f2.error("S3 upload is not available we have currenly an issue with it");
|
|
89175
|
-
program.error("");
|
|
89176
|
-
return;
|
|
89177
|
-
}
|
|
90527
|
+
const { s3Region, s3Apikey, s3Apisecret, s3BucketName, s3Endpoint, s3Port, s3SSL } = options;
|
|
89178
90528
|
const apikey = getApikey(options);
|
|
89179
90529
|
const config = await getConfig();
|
|
89180
90530
|
const { appid, path: path5 } = getAppIdAndPath(preAppid, options, config);
|
|
@@ -89236,7 +90586,29 @@ async function uploadBundle(preAppid, options, shouldExit = true) {
|
|
|
89236
90586
|
f2.error(`Cannot add bundle ${formatError(dbError)}`);
|
|
89237
90587
|
program.error("");
|
|
89238
90588
|
}
|
|
89239
|
-
if (zipped) {
|
|
90589
|
+
if (zipped && (s3BucketName || s3Endpoint || s3Region || s3Apikey || s3Apisecret || s3Port || s3SSL)) {
|
|
90590
|
+
if (!s3BucketName || !s3Endpoint || !s3Region || !s3Apikey || !s3Apisecret || !s3Port) {
|
|
90591
|
+
f2.error("Missing argument, for S3 upload you need to provide a bucket name, endpoint, region, port, API key, and API secret");
|
|
90592
|
+
program.error("");
|
|
90593
|
+
}
|
|
90594
|
+
f2.info("Uploading to S3");
|
|
90595
|
+
const s3Client = new Client({
|
|
90596
|
+
endPoint: s3Endpoint,
|
|
90597
|
+
region: s3Region,
|
|
90598
|
+
port: s3Port,
|
|
90599
|
+
useSSL: s3SSL,
|
|
90600
|
+
bucket: s3BucketName,
|
|
90601
|
+
credentials: {
|
|
90602
|
+
accessKeyId: s3Apikey,
|
|
90603
|
+
secretAccessKey: s3Apisecret
|
|
90604
|
+
}
|
|
90605
|
+
});
|
|
90606
|
+
const fileName = `${appid}-${bundle2}`;
|
|
90607
|
+
const encodeFileName = encodeURIComponent(fileName);
|
|
90608
|
+
await s3Client.putObject(fileName, zipped);
|
|
90609
|
+
versionData.external_url = `https://${s3Endpoint}/${encodeFileName}`;
|
|
90610
|
+
versionData.storage_provider = "external";
|
|
90611
|
+
} else if (zipped) {
|
|
89240
90612
|
await uploadBundleToCapgoCloud(supabase, appid, bundle2, orgId, zipped, options);
|
|
89241
90613
|
versionData.storage_provider = "r2";
|
|
89242
90614
|
const { error: dbError2 } = await updateOrCreateVersion(supabase, versionData);
|
|
@@ -90832,7 +92204,7 @@ app.command("list").alias("l").description("list apps in Capgo Cloud").action(li
|
|
|
90832
92204
|
app.command("debug [appId]").description("Listen for live updates event in Capgo Cloud to debug your app").option("-a, --apikey <apikey>", "apikey to link to your account").option("-d, --device <device>", "the specific device to debug").action(debugApp);
|
|
90833
92205
|
app.command("set [appId]").alias("s").description("Set an app in Capgo Cloud").action(setApp).option("-n, --name <name>", "app name").option("-i, --icon <icon>", "app icon path").option("-a, --apikey <apikey>", "apikey to link to your account").option("-r, --retention <retention>", "retention period of app bundle in days");
|
|
90834
92206
|
var bundle = program.command("bundle").description("Manage bundle");
|
|
90835
|
-
bundle.command("upload [appId]").alias("u").description("Upload a new bundle in Capgo Cloud").action(uploadCommand).option("-a, --apikey <apikey>", "apikey to link to your account").option("-p, --path <path>", "path of the folder to upload").option("-c, --channel <channel>", "channel to link to").option("-e, --external <url>", "link to external url intead of upload to Capgo Cloud").option("--iv-session-key <key>", "Set the iv and session key for bundle url external").option("--s3-region <region>", "Region for your
|
|
92207
|
+
bundle.command("upload [appId]").alias("u").description("Upload a new bundle in Capgo Cloud").action(uploadCommand).option("-a, --apikey <apikey>", "apikey to link to your account").option("-p, --path <path>", "path of the folder to upload").option("-c, --channel <channel>", "channel to link to").option("-e, --external <url>", "link to external url intead of upload to Capgo Cloud").option("--iv-session-key <key>", "Set the iv and session key for bundle url external").option("--s3-region <region>", "Region for your S3 bucket").option("--s3-apikey <apikey>", "Apikey for your S3 endpoint").option("--s3-apisecret <apisecret>", "Api secret for your S3 endpoint").option("--s3-endoint <s3Endpoint>", "Url of S3 endpoint").option("--s3-bucket-name <bucketName>", "Name for your AWS S3 bucket").option("--s3-port <port>", "Port for your S3 endpoint").option("--no-s3-ssl", "Disable SSL for S3 upload").option("--key <key>", "custom path for public signing key").option("--key-data <keyData>", "base64 public signing key").option("--bundle-url", "prints bundle url into stdout").option("--no-key", "ignore signing key and send clear update").option("--no-code-check", "Ignore checking if notifyAppReady() is called in soure code and index present in root folder").option("--display-iv-session", "Show in the console the iv and session key used to encrypt the update").option("-b, --bundle <bundle>", "bundle version number of the bundle to upload").option(
|
|
90836
92208
|
"--min-update-version <minUpdateVersion>",
|
|
90837
92209
|
"Minimal version required to update to this version. Used only if the disable auto update is set to metadata in channel"
|
|
90838
92210
|
).option("--auto-min-update-version", "Set the min update version based on native packages").option("--ignore-metadata-check", "Ignores the metadata (node_modules) check when uploading").option("--ignore-checksum-check", "Ignores the checksum check when uploading").option("--timeout <timeout>", "Timeout for the upload process in seconds").option("--multipart", "Uses multipart protocol to upload data to S3");
|