appwrite-cli 13.4.0 → 13.6.0
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/CHANGELOG.md +15 -0
- package/README.md +2 -2
- package/cli.ts +4 -2
- package/dist/bundle-win-arm64.mjs +1633 -2075
- package/dist/cli.cjs +1633 -2075
- package/dist/index.cjs +109645 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +780 -1831
- package/dist/lib/commands/generators/base.d.ts +16 -5
- package/dist/lib/commands/generators/base.d.ts.map +1 -1
- package/dist/lib/commands/generators/typescript/databases.d.ts.map +1 -1
- package/dist/lib/commands/push.d.ts +1 -0
- package/dist/lib/commands/push.d.ts.map +1 -1
- package/dist/lib/commands/schema.d.ts.map +1 -1
- package/dist/lib/commands/services/activities.d.ts +3 -0
- package/dist/lib/commands/services/activities.d.ts.map +1 -0
- package/dist/lib/commands/services/backups.d.ts +3 -0
- package/dist/lib/commands/services/backups.d.ts.map +1 -0
- package/dist/lib/commands/utils/attributes.d.ts +3 -1
- package/dist/lib/commands/utils/attributes.d.ts.map +1 -1
- package/dist/lib/commands/utils/pools.d.ts +3 -1
- package/dist/lib/commands/utils/pools.d.ts.map +1 -1
- package/dist/lib/constants.d.ts +1 -1
- package/dist/lib/json.d.ts.map +1 -1
- package/dist/lib/utils.d.ts +1 -0
- package/dist/lib/utils.d.ts.map +1 -1
- package/docs/examples/account/create-key.md +5 -0
- package/docs/examples/account/delete-key.md +4 -0
- package/docs/examples/account/get-key.md +4 -0
- package/docs/examples/account/list-keys.md +3 -0
- package/docs/examples/account/update-key.md +6 -0
- package/docs/examples/activities/get-event.md +4 -0
- package/docs/examples/activities/list-events.md +3 -0
- package/docs/examples/backups/create-archive.md +4 -0
- package/docs/examples/backups/create-policy.md +7 -0
- package/docs/examples/backups/create-restoration.md +5 -0
- package/docs/examples/backups/delete-archive.md +4 -0
- package/docs/examples/backups/delete-policy.md +4 -0
- package/docs/examples/backups/get-archive.md +4 -0
- package/docs/examples/backups/get-policy.md +4 -0
- package/docs/examples/backups/get-restoration.md +4 -0
- package/docs/examples/backups/list-archives.md +3 -0
- package/docs/examples/backups/list-policies.md +3 -0
- package/docs/examples/backups/list-restorations.md +3 -0
- package/docs/examples/backups/update-policy.md +4 -0
- package/docs/examples/projects/create-schedule.md +7 -0
- package/docs/examples/projects/get-schedule.md +5 -0
- package/docs/examples/projects/list-schedules.md +4 -0
- package/index.ts +1 -0
- package/install.ps1 +2 -2
- package/install.sh +1 -1
- package/lib/commands/generators/base.ts +30 -9
- package/lib/commands/generators/typescript/databases.ts +12 -18
- package/lib/commands/push.ts +276 -201
- package/lib/commands/schema.ts +1 -3
- package/lib/commands/services/account.ts +234 -0
- package/lib/commands/services/activities.ts +51 -0
- package/lib/commands/services/backups.ts +184 -0
- package/lib/commands/services/health.ts +55 -0
- package/lib/commands/services/migrations.ts +1 -1
- package/lib/commands/services/projects.ts +51 -0
- package/lib/commands/services/storage.ts +2 -2
- package/lib/commands/utils/attributes.ts +9 -6
- package/lib/commands/utils/pools.ts +9 -6
- package/lib/constants.ts +1 -1
- package/lib/json.ts +14 -7
- package/lib/utils.ts +15 -0
- package/package.json +19 -5
- package/scoop/appwrite.config.json +3 -3
- package/dist/lib/commands/services/console.d.ts +0 -3
- package/dist/lib/commands/services/console.d.ts.map +0 -1
- package/docs/examples/console/get-resource.md +0 -5
- package/docs/examples/console/variables.md +0 -3
- package/lib/commands/services/console.ts +0 -49
package/dist/index.js
CHANGED
|
@@ -19586,9 +19586,9 @@ var require_stream_duplex = __commonJS({
|
|
|
19586
19586
|
}
|
|
19587
19587
|
});
|
|
19588
19588
|
|
|
19589
|
-
// node_modules/safe-buffer/index.js
|
|
19589
|
+
// node_modules/string_decoder/node_modules/safe-buffer/index.js
|
|
19590
19590
|
var require_safe_buffer = __commonJS({
|
|
19591
|
-
"node_modules/safe-buffer/index.js"(exports, module) {
|
|
19591
|
+
"node_modules/string_decoder/node_modules/safe-buffer/index.js"(exports, module) {
|
|
19592
19592
|
var buffer = __require("buffer");
|
|
19593
19593
|
var Buffer2 = buffer.Buffer;
|
|
19594
19594
|
function copyProps(src, dst) {
|
|
@@ -52608,14 +52608,14 @@ var require_undici = __commonJS({
|
|
|
52608
52608
|
}
|
|
52609
52609
|
});
|
|
52610
52610
|
|
|
52611
|
-
// node_modules/
|
|
52611
|
+
// node_modules/bignumber.js/bignumber.js
|
|
52612
52612
|
var require_bignumber = __commonJS({
|
|
52613
|
-
"node_modules/
|
|
52613
|
+
"node_modules/bignumber.js/bignumber.js"(exports, module) {
|
|
52614
52614
|
(function(globalObject) {
|
|
52615
52615
|
"use strict";
|
|
52616
|
-
var
|
|
52616
|
+
var BigNumber, isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, mathceil = Math.ceil, mathfloor = Math.floor, bignumberError = "[BigNumber Error] ", tooManyDigits = bignumberError + "Number primitive has more than 15 significant digits: ", BASE = 1e14, LOG_BASE = 14, MAX_SAFE_INTEGER = 9007199254740991, POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], SQRT_BASE = 1e7, MAX = 1e9;
|
|
52617
52617
|
function clone2(configObject) {
|
|
52618
|
-
var div, convertBase, parseNumeric, P =
|
|
52618
|
+
var div, convertBase, parseNumeric, P = BigNumber2.prototype = { constructor: BigNumber2, toString: null, valueOf: null }, ONE = new BigNumber2(1), DECIMAL_PLACES = 20, ROUNDING_MODE = 4, TO_EXP_NEG = -7, TO_EXP_POS = 21, MIN_EXP = -1e7, MAX_EXP = 1e7, CRYPTO = false, MODULO_MODE = 1, POW_PRECISION = 0, FORMAT = {
|
|
52619
52619
|
prefix: "",
|
|
52620
52620
|
groupSize: 3,
|
|
52621
52621
|
secondaryGroupSize: 0,
|
|
@@ -52626,9 +52626,9 @@ var require_bignumber = __commonJS({
|
|
|
52626
52626
|
// non-breaking space
|
|
52627
52627
|
suffix: ""
|
|
52628
52628
|
}, ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz", alphabetHasNormalDecimalDigits = true;
|
|
52629
|
-
function
|
|
52629
|
+
function BigNumber2(v, b) {
|
|
52630
52630
|
var alphabet, c, caseChanged, e, i, isNum, len, str, x = this;
|
|
52631
|
-
if (!(x instanceof
|
|
52631
|
+
if (!(x instanceof BigNumber2)) return new BigNumber2(v, b);
|
|
52632
52632
|
if (b == null) {
|
|
52633
52633
|
if (v && v._isBigNumber === true) {
|
|
52634
52634
|
x.s = v.s;
|
|
@@ -52670,14 +52670,14 @@ var require_bignumber = __commonJS({
|
|
|
52670
52670
|
} else {
|
|
52671
52671
|
intCheck(b, 2, ALPHABET.length, "Base");
|
|
52672
52672
|
if (b == 10 && alphabetHasNormalDecimalDigits) {
|
|
52673
|
-
x = new
|
|
52673
|
+
x = new BigNumber2(v);
|
|
52674
52674
|
return round(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE);
|
|
52675
52675
|
}
|
|
52676
52676
|
str = String(v);
|
|
52677
52677
|
if (isNum = typeof v == "number") {
|
|
52678
52678
|
if (v * 0 != 0) return parseNumeric(x, str, isNum, b);
|
|
52679
52679
|
x.s = 1 / v < 0 ? (str = str.slice(1), -1) : 1;
|
|
52680
|
-
if (
|
|
52680
|
+
if (BigNumber2.DEBUG && str.replace(/^0\.0*|\./, "").length > 15) {
|
|
52681
52681
|
throw Error(tooManyDigits + v);
|
|
52682
52682
|
}
|
|
52683
52683
|
} else {
|
|
@@ -52712,7 +52712,7 @@ var require_bignumber = __commonJS({
|
|
|
52712
52712
|
for (len = str.length; str.charCodeAt(--len) === 48; ) ;
|
|
52713
52713
|
if (str = str.slice(i, ++len)) {
|
|
52714
52714
|
len -= i;
|
|
52715
|
-
if (isNum &&
|
|
52715
|
+
if (isNum && BigNumber2.DEBUG && len > 15 && (v > MAX_SAFE_INTEGER || v !== mathfloor(v))) {
|
|
52716
52716
|
throw Error(tooManyDigits + x.s * v);
|
|
52717
52717
|
}
|
|
52718
52718
|
if ((e = e - i - 1) > MAX_EXP) {
|
|
@@ -52740,18 +52740,18 @@ var require_bignumber = __commonJS({
|
|
|
52740
52740
|
x.c = [x.e = 0];
|
|
52741
52741
|
}
|
|
52742
52742
|
}
|
|
52743
|
-
|
|
52744
|
-
|
|
52745
|
-
|
|
52746
|
-
|
|
52747
|
-
|
|
52748
|
-
|
|
52749
|
-
|
|
52750
|
-
|
|
52751
|
-
|
|
52752
|
-
|
|
52753
|
-
|
|
52754
|
-
|
|
52743
|
+
BigNumber2.clone = clone2;
|
|
52744
|
+
BigNumber2.ROUND_UP = 0;
|
|
52745
|
+
BigNumber2.ROUND_DOWN = 1;
|
|
52746
|
+
BigNumber2.ROUND_CEIL = 2;
|
|
52747
|
+
BigNumber2.ROUND_FLOOR = 3;
|
|
52748
|
+
BigNumber2.ROUND_HALF_UP = 4;
|
|
52749
|
+
BigNumber2.ROUND_HALF_DOWN = 5;
|
|
52750
|
+
BigNumber2.ROUND_HALF_EVEN = 6;
|
|
52751
|
+
BigNumber2.ROUND_HALF_CEIL = 7;
|
|
52752
|
+
BigNumber2.ROUND_HALF_FLOOR = 8;
|
|
52753
|
+
BigNumber2.EUCLID = 9;
|
|
52754
|
+
BigNumber2.config = BigNumber2.set = function(obj) {
|
|
52755
52755
|
var p, v;
|
|
52756
52756
|
if (obj != null) {
|
|
52757
52757
|
if (typeof obj == "object") {
|
|
@@ -52850,9 +52850,9 @@ var require_bignumber = __commonJS({
|
|
|
52850
52850
|
ALPHABET
|
|
52851
52851
|
};
|
|
52852
52852
|
};
|
|
52853
|
-
|
|
52853
|
+
BigNumber2.isBigNumber = function(v) {
|
|
52854
52854
|
if (!v || v._isBigNumber !== true) return false;
|
|
52855
|
-
if (!
|
|
52855
|
+
if (!BigNumber2.DEBUG) return true;
|
|
52856
52856
|
var i, n, c = v.c, e = v.e, s = v.s;
|
|
52857
52857
|
out: if ({}.toString.call(c) == "[object Array]") {
|
|
52858
52858
|
if ((s === 1 || s === -1) && e >= -MAX && e <= MAX && e === mathfloor(e)) {
|
|
@@ -52875,13 +52875,13 @@ var require_bignumber = __commonJS({
|
|
|
52875
52875
|
}
|
|
52876
52876
|
throw Error(bignumberError + "Invalid BigNumber: " + v);
|
|
52877
52877
|
};
|
|
52878
|
-
|
|
52878
|
+
BigNumber2.maximum = BigNumber2.max = function() {
|
|
52879
52879
|
return maxOrMin(arguments, -1);
|
|
52880
52880
|
};
|
|
52881
|
-
|
|
52881
|
+
BigNumber2.minimum = BigNumber2.min = function() {
|
|
52882
52882
|
return maxOrMin(arguments, 1);
|
|
52883
52883
|
};
|
|
52884
|
-
|
|
52884
|
+
BigNumber2.random = (function() {
|
|
52885
52885
|
var pow2_53 = 9007199254740992;
|
|
52886
52886
|
var random53bitInt = Math.random() * pow2_53 & 2097151 ? function() {
|
|
52887
52887
|
return mathfloor(Math.random() * pow2_53);
|
|
@@ -52889,7 +52889,7 @@ var require_bignumber = __commonJS({
|
|
|
52889
52889
|
return (Math.random() * 1073741824 | 0) * 8388608 + (Math.random() * 8388608 | 0);
|
|
52890
52890
|
};
|
|
52891
52891
|
return function(dp) {
|
|
52892
|
-
var a, b, e, k, v, i = 0, c = [], rand = new
|
|
52892
|
+
var a, b, e, k, v, i = 0, c = [], rand = new BigNumber2(ONE);
|
|
52893
52893
|
if (dp == null) dp = DECIMAL_PLACES;
|
|
52894
52894
|
else intCheck(dp, 0, MAX);
|
|
52895
52895
|
k = mathceil(dp / LOG_BASE);
|
|
@@ -52950,8 +52950,8 @@ var require_bignumber = __commonJS({
|
|
|
52950
52950
|
return rand;
|
|
52951
52951
|
};
|
|
52952
52952
|
})();
|
|
52953
|
-
|
|
52954
|
-
var i = 1, args = arguments, sum = new
|
|
52953
|
+
BigNumber2.sum = function() {
|
|
52954
|
+
var i = 1, args = arguments, sum = new BigNumber2(args[0]);
|
|
52955
52955
|
for (; i < args.length; ) sum = sum.plus(args[i++]);
|
|
52956
52956
|
return sum;
|
|
52957
52957
|
};
|
|
@@ -52978,7 +52978,7 @@ var require_bignumber = __commonJS({
|
|
|
52978
52978
|
k = POW_PRECISION;
|
|
52979
52979
|
POW_PRECISION = 0;
|
|
52980
52980
|
str = str.replace(".", "");
|
|
52981
|
-
y = new
|
|
52981
|
+
y = new BigNumber2(baseIn);
|
|
52982
52982
|
x = y.pow(str.length - i);
|
|
52983
52983
|
POW_PRECISION = k;
|
|
52984
52984
|
y.c = toBaseOut(
|
|
@@ -53069,7 +53069,7 @@ var require_bignumber = __commonJS({
|
|
|
53069
53069
|
return function(x, y, dp, rm, base) {
|
|
53070
53070
|
var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0, yL, yz, s = x.s == y.s ? 1 : -1, xc = x.c, yc = y.c;
|
|
53071
53071
|
if (!xc || !xc[0] || !yc || !yc[0]) {
|
|
53072
|
-
return new
|
|
53072
|
+
return new BigNumber2(
|
|
53073
53073
|
// Return NaN if either NaN, or both Infinity or 0.
|
|
53074
53074
|
!x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN : (
|
|
53075
53075
|
// Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.
|
|
@@ -53077,7 +53077,7 @@ var require_bignumber = __commonJS({
|
|
|
53077
53077
|
)
|
|
53078
53078
|
);
|
|
53079
53079
|
}
|
|
53080
|
-
q = new
|
|
53080
|
+
q = new BigNumber2(s);
|
|
53081
53081
|
qc = q.c = [];
|
|
53082
53082
|
e = x.e - y.e;
|
|
53083
53083
|
s = dp + e + 1;
|
|
@@ -53182,7 +53182,7 @@ var require_bignumber = __commonJS({
|
|
|
53182
53182
|
str = coeffToString(n.c);
|
|
53183
53183
|
str = id == 1 || id == 2 && (ne <= TO_EXP_NEG || ne >= TO_EXP_POS) ? toExponential(str, ne) : toFixedPoint(str, ne, "0");
|
|
53184
53184
|
} else {
|
|
53185
|
-
n = round(new
|
|
53185
|
+
n = round(new BigNumber2(n), i, rm);
|
|
53186
53186
|
e = n.e;
|
|
53187
53187
|
str = coeffToString(n.c);
|
|
53188
53188
|
len = str.length;
|
|
@@ -53206,9 +53206,9 @@ var require_bignumber = __commonJS({
|
|
|
53206
53206
|
return n.s < 0 && c0 ? "-" + str : str;
|
|
53207
53207
|
}
|
|
53208
53208
|
function maxOrMin(args, n) {
|
|
53209
|
-
var k, y, i = 1, x = new
|
|
53209
|
+
var k, y, i = 1, x = new BigNumber2(args[0]);
|
|
53210
53210
|
for (; i < args.length; i++) {
|
|
53211
|
-
y = new
|
|
53211
|
+
y = new BigNumber2(args[i]);
|
|
53212
53212
|
if (!y.s || (k = compare(x, y)) === n || k === 0 && x.s === n) {
|
|
53213
53213
|
x = y;
|
|
53214
53214
|
}
|
|
@@ -53245,9 +53245,9 @@ var require_bignumber = __commonJS({
|
|
|
53245
53245
|
base = b;
|
|
53246
53246
|
s = s.replace(dotAfter, "$1").replace(dotBefore, "0.$1");
|
|
53247
53247
|
}
|
|
53248
|
-
if (str != s) return new
|
|
53248
|
+
if (str != s) return new BigNumber2(s, base);
|
|
53249
53249
|
}
|
|
53250
|
-
if (
|
|
53250
|
+
if (BigNumber2.DEBUG) {
|
|
53251
53251
|
throw Error(bignumberError + "Not a" + (b ? " base " + b : "") + " number: " + str);
|
|
53252
53252
|
}
|
|
53253
53253
|
x.s = null;
|
|
@@ -53349,12 +53349,12 @@ var require_bignumber = __commonJS({
|
|
|
53349
53349
|
return n.s < 0 ? "-" + str : str;
|
|
53350
53350
|
}
|
|
53351
53351
|
P.absoluteValue = P.abs = function() {
|
|
53352
|
-
var x = new
|
|
53352
|
+
var x = new BigNumber2(this);
|
|
53353
53353
|
if (x.s < 0) x.s = 1;
|
|
53354
53354
|
return x;
|
|
53355
53355
|
};
|
|
53356
53356
|
P.comparedTo = function(y, b) {
|
|
53357
|
-
return compare(this, new
|
|
53357
|
+
return compare(this, new BigNumber2(y, b));
|
|
53358
53358
|
};
|
|
53359
53359
|
P.decimalPlaces = P.dp = function(dp, rm) {
|
|
53360
53360
|
var c, n, v, x = this;
|
|
@@ -53362,7 +53362,7 @@ var require_bignumber = __commonJS({
|
|
|
53362
53362
|
intCheck(dp, 0, MAX);
|
|
53363
53363
|
if (rm == null) rm = ROUNDING_MODE;
|
|
53364
53364
|
else intCheck(rm, 0, 8);
|
|
53365
|
-
return round(new
|
|
53365
|
+
return round(new BigNumber2(x), dp + x.e + 1, rm);
|
|
53366
53366
|
}
|
|
53367
53367
|
if (!(c = x.c)) return null;
|
|
53368
53368
|
n = ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE;
|
|
@@ -53371,44 +53371,44 @@ var require_bignumber = __commonJS({
|
|
|
53371
53371
|
return n;
|
|
53372
53372
|
};
|
|
53373
53373
|
P.dividedBy = P.div = function(y, b) {
|
|
53374
|
-
return div(this, new
|
|
53374
|
+
return div(this, new BigNumber2(y, b), DECIMAL_PLACES, ROUNDING_MODE);
|
|
53375
53375
|
};
|
|
53376
53376
|
P.dividedToIntegerBy = P.idiv = function(y, b) {
|
|
53377
|
-
return div(this, new
|
|
53377
|
+
return div(this, new BigNumber2(y, b), 0, 1);
|
|
53378
53378
|
};
|
|
53379
53379
|
P.exponentiatedBy = P.pow = function(n, m) {
|
|
53380
53380
|
var half, isModExp, i, k, more, nIsBig, nIsNeg, nIsOdd, y, x = this;
|
|
53381
|
-
n = new
|
|
53381
|
+
n = new BigNumber2(n);
|
|
53382
53382
|
if (n.c && !n.isInteger()) {
|
|
53383
53383
|
throw Error(bignumberError + "Exponent not an integer: " + valueOf(n));
|
|
53384
53384
|
}
|
|
53385
|
-
if (m != null) m = new
|
|
53385
|
+
if (m != null) m = new BigNumber2(m);
|
|
53386
53386
|
nIsBig = n.e > 14;
|
|
53387
53387
|
if (!x.c || !x.c[0] || x.c[0] == 1 && !x.e && x.c.length == 1 || !n.c || !n.c[0]) {
|
|
53388
|
-
y = new
|
|
53388
|
+
y = new BigNumber2(Math.pow(+valueOf(x), nIsBig ? n.s * (2 - isOdd(n)) : +valueOf(n)));
|
|
53389
53389
|
return m ? y.mod(m) : y;
|
|
53390
53390
|
}
|
|
53391
53391
|
nIsNeg = n.s < 0;
|
|
53392
53392
|
if (m) {
|
|
53393
|
-
if (m.c ? !m.c[0] : !m.s) return new
|
|
53393
|
+
if (m.c ? !m.c[0] : !m.s) return new BigNumber2(NaN);
|
|
53394
53394
|
isModExp = !nIsNeg && x.isInteger() && m.isInteger();
|
|
53395
53395
|
if (isModExp) x = x.mod(m);
|
|
53396
53396
|
} else if (n.e > 9 && (x.e > 0 || x.e < -1 || (x.e == 0 ? x.c[0] > 1 || nIsBig && x.c[1] >= 24e7 : x.c[0] < 8e13 || nIsBig && x.c[0] <= 9999975e7))) {
|
|
53397
53397
|
k = x.s < 0 && isOdd(n) ? -0 : 0;
|
|
53398
53398
|
if (x.e > -1) k = 1 / k;
|
|
53399
|
-
return new
|
|
53399
|
+
return new BigNumber2(nIsNeg ? 1 / k : k);
|
|
53400
53400
|
} else if (POW_PRECISION) {
|
|
53401
53401
|
k = mathceil(POW_PRECISION / LOG_BASE + 2);
|
|
53402
53402
|
}
|
|
53403
53403
|
if (nIsBig) {
|
|
53404
|
-
half = new
|
|
53404
|
+
half = new BigNumber2(0.5);
|
|
53405
53405
|
if (nIsNeg) n.s = 1;
|
|
53406
53406
|
nIsOdd = isOdd(n);
|
|
53407
53407
|
} else {
|
|
53408
53408
|
i = Math.abs(+valueOf(n));
|
|
53409
53409
|
nIsOdd = i % 2;
|
|
53410
53410
|
}
|
|
53411
|
-
y = new
|
|
53411
|
+
y = new BigNumber2(ONE);
|
|
53412
53412
|
for (; ; ) {
|
|
53413
53413
|
if (nIsOdd) {
|
|
53414
53414
|
y = y.times(x);
|
|
@@ -53446,31 +53446,31 @@ var require_bignumber = __commonJS({
|
|
|
53446
53446
|
return m ? y.mod(m) : k ? round(y, POW_PRECISION, ROUNDING_MODE, more) : y;
|
|
53447
53447
|
};
|
|
53448
53448
|
P.integerValue = function(rm) {
|
|
53449
|
-
var n = new
|
|
53449
|
+
var n = new BigNumber2(this);
|
|
53450
53450
|
if (rm == null) rm = ROUNDING_MODE;
|
|
53451
53451
|
else intCheck(rm, 0, 8);
|
|
53452
53452
|
return round(n, n.e + 1, rm);
|
|
53453
53453
|
};
|
|
53454
53454
|
P.isEqualTo = P.eq = function(y, b) {
|
|
53455
|
-
return compare(this, new
|
|
53455
|
+
return compare(this, new BigNumber2(y, b)) === 0;
|
|
53456
53456
|
};
|
|
53457
53457
|
P.isFinite = function() {
|
|
53458
53458
|
return !!this.c;
|
|
53459
53459
|
};
|
|
53460
53460
|
P.isGreaterThan = P.gt = function(y, b) {
|
|
53461
|
-
return compare(this, new
|
|
53461
|
+
return compare(this, new BigNumber2(y, b)) > 0;
|
|
53462
53462
|
};
|
|
53463
53463
|
P.isGreaterThanOrEqualTo = P.gte = function(y, b) {
|
|
53464
|
-
return (b = compare(this, new
|
|
53464
|
+
return (b = compare(this, new BigNumber2(y, b))) === 1 || b === 0;
|
|
53465
53465
|
};
|
|
53466
53466
|
P.isInteger = function() {
|
|
53467
53467
|
return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2;
|
|
53468
53468
|
};
|
|
53469
53469
|
P.isLessThan = P.lt = function(y, b) {
|
|
53470
|
-
return compare(this, new
|
|
53470
|
+
return compare(this, new BigNumber2(y, b)) < 0;
|
|
53471
53471
|
};
|
|
53472
53472
|
P.isLessThanOrEqualTo = P.lte = function(y, b) {
|
|
53473
|
-
return (b = compare(this, new
|
|
53473
|
+
return (b = compare(this, new BigNumber2(y, b))) === -1 || b === 0;
|
|
53474
53474
|
};
|
|
53475
53475
|
P.isNaN = function() {
|
|
53476
53476
|
return !this.s;
|
|
@@ -53486,18 +53486,18 @@ var require_bignumber = __commonJS({
|
|
|
53486
53486
|
};
|
|
53487
53487
|
P.minus = function(y, b) {
|
|
53488
53488
|
var i, j, t, xLTy, x = this, a = x.s;
|
|
53489
|
-
y = new
|
|
53489
|
+
y = new BigNumber2(y, b);
|
|
53490
53490
|
b = y.s;
|
|
53491
|
-
if (!a || !b) return new
|
|
53491
|
+
if (!a || !b) return new BigNumber2(NaN);
|
|
53492
53492
|
if (a != b) {
|
|
53493
53493
|
y.s = -b;
|
|
53494
53494
|
return x.plus(y);
|
|
53495
53495
|
}
|
|
53496
53496
|
var xe = x.e / LOG_BASE, ye = y.e / LOG_BASE, xc = x.c, yc = y.c;
|
|
53497
53497
|
if (!xe || !ye) {
|
|
53498
|
-
if (!xc || !yc) return xc ? (y.s = -b, y) : new
|
|
53498
|
+
if (!xc || !yc) return xc ? (y.s = -b, y) : new BigNumber2(yc ? x : NaN);
|
|
53499
53499
|
if (!xc[0] || !yc[0]) {
|
|
53500
|
-
return yc[0] ? (y.s = -b, y) : new
|
|
53500
|
+
return yc[0] ? (y.s = -b, y) : new BigNumber2(xc[0] ? x : (
|
|
53501
53501
|
// IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity
|
|
53502
53502
|
ROUNDING_MODE == 3 ? -0 : 0
|
|
53503
53503
|
));
|
|
@@ -53553,11 +53553,11 @@ var require_bignumber = __commonJS({
|
|
|
53553
53553
|
};
|
|
53554
53554
|
P.modulo = P.mod = function(y, b) {
|
|
53555
53555
|
var q, s, x = this;
|
|
53556
|
-
y = new
|
|
53556
|
+
y = new BigNumber2(y, b);
|
|
53557
53557
|
if (!x.c || !y.s || y.c && !y.c[0]) {
|
|
53558
|
-
return new
|
|
53558
|
+
return new BigNumber2(NaN);
|
|
53559
53559
|
} else if (!y.c || x.c && !x.c[0]) {
|
|
53560
|
-
return new
|
|
53560
|
+
return new BigNumber2(x);
|
|
53561
53561
|
}
|
|
53562
53562
|
if (MODULO_MODE == 9) {
|
|
53563
53563
|
s = y.s;
|
|
@@ -53573,7 +53573,7 @@ var require_bignumber = __commonJS({
|
|
|
53573
53573
|
return y;
|
|
53574
53574
|
};
|
|
53575
53575
|
P.multipliedBy = P.times = function(y, b) {
|
|
53576
|
-
var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc, base, sqrtBase, x = this, xc = x.c, yc = (y = new
|
|
53576
|
+
var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc, base, sqrtBase, x = this, xc = x.c, yc = (y = new BigNumber2(y, b)).c;
|
|
53577
53577
|
if (!xc || !yc || !xc[0] || !yc[0]) {
|
|
53578
53578
|
if (!x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) {
|
|
53579
53579
|
y.c = y.e = y.s = null;
|
|
@@ -53625,23 +53625,23 @@ var require_bignumber = __commonJS({
|
|
|
53625
53625
|
return normalise(y, zc, e);
|
|
53626
53626
|
};
|
|
53627
53627
|
P.negated = function() {
|
|
53628
|
-
var x = new
|
|
53628
|
+
var x = new BigNumber2(this);
|
|
53629
53629
|
x.s = -x.s || null;
|
|
53630
53630
|
return x;
|
|
53631
53631
|
};
|
|
53632
53632
|
P.plus = function(y, b) {
|
|
53633
53633
|
var t, x = this, a = x.s;
|
|
53634
|
-
y = new
|
|
53634
|
+
y = new BigNumber2(y, b);
|
|
53635
53635
|
b = y.s;
|
|
53636
|
-
if (!a || !b) return new
|
|
53636
|
+
if (!a || !b) return new BigNumber2(NaN);
|
|
53637
53637
|
if (a != b) {
|
|
53638
53638
|
y.s = -b;
|
|
53639
53639
|
return x.minus(y);
|
|
53640
53640
|
}
|
|
53641
53641
|
var xe = x.e / LOG_BASE, ye = y.e / LOG_BASE, xc = x.c, yc = y.c;
|
|
53642
53642
|
if (!xe || !ye) {
|
|
53643
|
-
if (!xc || !yc) return new
|
|
53644
|
-
if (!xc[0] || !yc[0]) return yc[0] ? y : new
|
|
53643
|
+
if (!xc || !yc) return new BigNumber2(a / 0);
|
|
53644
|
+
if (!xc[0] || !yc[0]) return yc[0] ? y : new BigNumber2(xc[0] ? x : a * 0);
|
|
53645
53645
|
}
|
|
53646
53646
|
xe = bitFloor(xe);
|
|
53647
53647
|
ye = bitFloor(ye);
|
|
@@ -53682,7 +53682,7 @@ var require_bignumber = __commonJS({
|
|
|
53682
53682
|
intCheck(sd, 1, MAX);
|
|
53683
53683
|
if (rm == null) rm = ROUNDING_MODE;
|
|
53684
53684
|
else intCheck(rm, 0, 8);
|
|
53685
|
-
return round(new
|
|
53685
|
+
return round(new BigNumber2(x), sd, rm);
|
|
53686
53686
|
}
|
|
53687
53687
|
if (!(c = x.c)) return null;
|
|
53688
53688
|
v = c.length - 1;
|
|
@@ -53699,9 +53699,9 @@ var require_bignumber = __commonJS({
|
|
|
53699
53699
|
return this.times("1e" + k);
|
|
53700
53700
|
};
|
|
53701
53701
|
P.squareRoot = P.sqrt = function() {
|
|
53702
|
-
var m, n, r, rep, t, x = this, c = x.c, s = x.s, e = x.e, dp = DECIMAL_PLACES + 4, half = new
|
|
53702
|
+
var m, n, r, rep, t, x = this, c = x.c, s = x.s, e = x.e, dp = DECIMAL_PLACES + 4, half = new BigNumber2("0.5");
|
|
53703
53703
|
if (s !== 1 || !c || !c[0]) {
|
|
53704
|
-
return new
|
|
53704
|
+
return new BigNumber2(!s || s < 0 && (!c || c[0]) ? NaN : c ? x : 1 / 0);
|
|
53705
53705
|
}
|
|
53706
53706
|
s = Math.sqrt(+valueOf(x));
|
|
53707
53707
|
if (s == 0 || s == 1 / 0) {
|
|
@@ -53715,9 +53715,9 @@ var require_bignumber = __commonJS({
|
|
|
53715
53715
|
n = s.toExponential();
|
|
53716
53716
|
n = n.slice(0, n.indexOf("e") + 1) + e;
|
|
53717
53717
|
}
|
|
53718
|
-
r = new
|
|
53718
|
+
r = new BigNumber2(n);
|
|
53719
53719
|
} else {
|
|
53720
|
-
r = new
|
|
53720
|
+
r = new BigNumber2(s + "");
|
|
53721
53721
|
}
|
|
53722
53722
|
if (r.c[0]) {
|
|
53723
53723
|
e = r.e;
|
|
@@ -53807,22 +53807,22 @@ var require_bignumber = __commonJS({
|
|
|
53807
53807
|
P.toFraction = function(md) {
|
|
53808
53808
|
var d, d0, d1, d2, e, exp, n, n0, n1, q, r, s, x = this, xc = x.c;
|
|
53809
53809
|
if (md != null) {
|
|
53810
|
-
n = new
|
|
53810
|
+
n = new BigNumber2(md);
|
|
53811
53811
|
if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) {
|
|
53812
53812
|
throw Error(bignumberError + "Argument " + (n.isInteger() ? "out of range: " : "not an integer: ") + valueOf(n));
|
|
53813
53813
|
}
|
|
53814
53814
|
}
|
|
53815
|
-
if (!xc) return new
|
|
53816
|
-
d = new
|
|
53817
|
-
n1 = d0 = new
|
|
53818
|
-
d1 = n0 = new
|
|
53815
|
+
if (!xc) return new BigNumber2(x);
|
|
53816
|
+
d = new BigNumber2(ONE);
|
|
53817
|
+
n1 = d0 = new BigNumber2(ONE);
|
|
53818
|
+
d1 = n0 = new BigNumber2(ONE);
|
|
53819
53819
|
s = coeffToString(xc);
|
|
53820
53820
|
e = d.e = s.length - x.e - 1;
|
|
53821
53821
|
d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp];
|
|
53822
53822
|
md = !md || n.comparedTo(d) > 0 ? e > 0 ? d : n1 : n;
|
|
53823
53823
|
exp = MAX_EXP;
|
|
53824
53824
|
MAX_EXP = 1 / 0;
|
|
53825
|
-
n = new
|
|
53825
|
+
n = new BigNumber2(s);
|
|
53826
53826
|
n0.c[0] = 0;
|
|
53827
53827
|
for (; ; ) {
|
|
53828
53828
|
q = div(n, d, 0, 1);
|
|
@@ -53866,7 +53866,7 @@ var require_bignumber = __commonJS({
|
|
|
53866
53866
|
if (b == null) {
|
|
53867
53867
|
str = e <= TO_EXP_NEG || e >= TO_EXP_POS ? toExponential(coeffToString(n.c), e) : toFixedPoint(coeffToString(n.c), e, "0");
|
|
53868
53868
|
} else if (b === 10 && alphabetHasNormalDecimalDigits) {
|
|
53869
|
-
n = round(new
|
|
53869
|
+
n = round(new BigNumber2(n), DECIMAL_PLACES + e + 1, ROUNDING_MODE);
|
|
53870
53870
|
str = toFixedPoint(coeffToString(n.c), n.e, "0");
|
|
53871
53871
|
} else {
|
|
53872
53872
|
intCheck(b, 2, ALPHABET.length, "Base");
|
|
@@ -53880,8 +53880,8 @@ var require_bignumber = __commonJS({
|
|
|
53880
53880
|
return valueOf(this);
|
|
53881
53881
|
};
|
|
53882
53882
|
P._isBigNumber = true;
|
|
53883
|
-
if (configObject != null)
|
|
53884
|
-
return
|
|
53883
|
+
if (configObject != null) BigNumber2.set(configObject);
|
|
53884
|
+
return BigNumber2;
|
|
53885
53885
|
}
|
|
53886
53886
|
function bitFloor(n) {
|
|
53887
53887
|
var i = n | 0;
|
|
@@ -53941,19 +53941,19 @@ var require_bignumber = __commonJS({
|
|
|
53941
53941
|
}
|
|
53942
53942
|
return str;
|
|
53943
53943
|
}
|
|
53944
|
-
|
|
53945
|
-
|
|
53944
|
+
BigNumber = clone2();
|
|
53945
|
+
BigNumber["default"] = BigNumber.BigNumber = BigNumber;
|
|
53946
53946
|
if (typeof define == "function" && define.amd) {
|
|
53947
53947
|
define(function() {
|
|
53948
|
-
return
|
|
53948
|
+
return BigNumber;
|
|
53949
53949
|
});
|
|
53950
53950
|
} else if (typeof module != "undefined" && module.exports) {
|
|
53951
|
-
module.exports =
|
|
53951
|
+
module.exports = BigNumber;
|
|
53952
53952
|
} else {
|
|
53953
53953
|
if (!globalObject) {
|
|
53954
53954
|
globalObject = typeof self != "undefined" && self ? self : window;
|
|
53955
53955
|
}
|
|
53956
|
-
globalObject.BigNumber =
|
|
53956
|
+
globalObject.BigNumber = BigNumber;
|
|
53957
53957
|
}
|
|
53958
53958
|
})(exports);
|
|
53959
53959
|
}
|
|
@@ -53962,7 +53962,7 @@ var require_bignumber = __commonJS({
|
|
|
53962
53962
|
// node_modules/json-bigint/lib/stringify.js
|
|
53963
53963
|
var require_stringify = __commonJS({
|
|
53964
53964
|
"node_modules/json-bigint/lib/stringify.js"(exports, module) {
|
|
53965
|
-
var
|
|
53965
|
+
var BigNumber = require_bignumber();
|
|
53966
53966
|
var JSON2 = module.exports;
|
|
53967
53967
|
(function() {
|
|
53968
53968
|
"use strict";
|
|
@@ -53987,7 +53987,7 @@ var require_stringify = __commonJS({
|
|
|
53987
53987
|
}) + '"' : '"' + string4 + '"';
|
|
53988
53988
|
}
|
|
53989
53989
|
function str(key, holder) {
|
|
53990
|
-
var i, k, v, length, mind = gap, partial2, value = holder[key],
|
|
53990
|
+
var i, k, v, length, mind = gap, partial2, value = holder[key], isBigNumber3 = value != null && (value instanceof BigNumber || BigNumber.isBigNumber(value));
|
|
53991
53991
|
if (value && typeof value === "object" && typeof value.toJSON === "function") {
|
|
53992
53992
|
value = value.toJSON(key);
|
|
53993
53993
|
}
|
|
@@ -53996,7 +53996,7 @@ var require_stringify = __commonJS({
|
|
|
53996
53996
|
}
|
|
53997
53997
|
switch (typeof value) {
|
|
53998
53998
|
case "string":
|
|
53999
|
-
if (
|
|
53999
|
+
if (isBigNumber3) {
|
|
54000
54000
|
return value;
|
|
54001
54001
|
} else {
|
|
54002
54002
|
return quote(value);
|
|
@@ -54074,7 +54074,7 @@ var require_stringify = __commonJS({
|
|
|
54074
54074
|
// node_modules/json-bigint/lib/parse.js
|
|
54075
54075
|
var require_parse2 = __commonJS({
|
|
54076
54076
|
"node_modules/json-bigint/lib/parse.js"(exports, module) {
|
|
54077
|
-
var
|
|
54077
|
+
var BigNumber = null;
|
|
54078
54078
|
var suspectProtoRx = /(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/;
|
|
54079
54079
|
var suspectConstructorRx = /(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/;
|
|
54080
54080
|
var json_parse = function(options) {
|
|
@@ -54174,11 +54174,11 @@ var require_parse2 = __commonJS({
|
|
|
54174
54174
|
if (!isFinite(number5)) {
|
|
54175
54175
|
error49("Bad number");
|
|
54176
54176
|
} else {
|
|
54177
|
-
if (
|
|
54177
|
+
if (BigNumber == null) BigNumber = require_bignumber();
|
|
54178
54178
|
if (string5.length > 15)
|
|
54179
|
-
return _options.storeAsString ? string5 : _options.useNativeBigInt ? BigInt(string5) : new
|
|
54179
|
+
return _options.storeAsString ? string5 : _options.useNativeBigInt ? BigInt(string5) : new BigNumber(string5);
|
|
54180
54180
|
else
|
|
54181
|
-
return !_options.alwaysParseAsBig ? number5 : _options.useNativeBigInt ? BigInt(number5) : new
|
|
54181
|
+
return !_options.alwaysParseAsBig ? number5 : _options.useNativeBigInt ? BigInt(number5) : new BigNumber(number5);
|
|
54182
54182
|
}
|
|
54183
54183
|
}, string4 = function() {
|
|
54184
54184
|
var hex3, i, string5 = "", uffff;
|
|
@@ -61553,1547 +61553,216 @@ var require_unpack = __commonJS({
|
|
|
61553
61553
|
}
|
|
61554
61554
|
if (er || closeError) {
|
|
61555
61555
|
this[ONERROR](er || closeError, entry);
|
|
61556
|
-
}
|
|
61557
|
-
done();
|
|
61558
|
-
};
|
|
61559
|
-
let fd;
|
|
61560
|
-
try {
|
|
61561
|
-
fd = fs8.openSync(entry.absolute, getFlag(entry.size), mode);
|
|
61562
|
-
} catch (er) {
|
|
61563
|
-
return oner(er);
|
|
61564
|
-
}
|
|
61565
|
-
const tx = this.transform ? this.transform(entry) || entry : entry;
|
|
61566
|
-
if (tx !== entry) {
|
|
61567
|
-
tx.on("error", (er) => this[ONERROR](er, entry));
|
|
61568
|
-
entry.pipe(tx);
|
|
61569
|
-
}
|
|
61570
|
-
tx.on("data", (chunk) => {
|
|
61571
|
-
try {
|
|
61572
|
-
fs8.writeSync(fd, chunk, 0, chunk.length);
|
|
61573
|
-
} catch (er) {
|
|
61574
|
-
oner(er);
|
|
61575
|
-
}
|
|
61576
|
-
});
|
|
61577
|
-
tx.on("end", (_) => {
|
|
61578
|
-
let er = null;
|
|
61579
|
-
if (entry.mtime && !this.noMtime) {
|
|
61580
|
-
const atime = entry.atime || /* @__PURE__ */ new Date();
|
|
61581
|
-
const mtime = entry.mtime;
|
|
61582
|
-
try {
|
|
61583
|
-
fs8.futimesSync(fd, atime, mtime);
|
|
61584
|
-
} catch (futimeser) {
|
|
61585
|
-
try {
|
|
61586
|
-
fs8.utimesSync(entry.absolute, atime, mtime);
|
|
61587
|
-
} catch (utimeser) {
|
|
61588
|
-
er = futimeser;
|
|
61589
|
-
}
|
|
61590
|
-
}
|
|
61591
|
-
}
|
|
61592
|
-
if (this[DOCHOWN](entry)) {
|
|
61593
|
-
const uid = this[UID](entry);
|
|
61594
|
-
const gid = this[GID](entry);
|
|
61595
|
-
try {
|
|
61596
|
-
fs8.fchownSync(fd, uid, gid);
|
|
61597
|
-
} catch (fchowner) {
|
|
61598
|
-
try {
|
|
61599
|
-
fs8.chownSync(entry.absolute, uid, gid);
|
|
61600
|
-
} catch (chowner) {
|
|
61601
|
-
er = er || fchowner;
|
|
61602
|
-
}
|
|
61603
|
-
}
|
|
61604
|
-
}
|
|
61605
|
-
oner(er);
|
|
61606
|
-
});
|
|
61607
|
-
}
|
|
61608
|
-
[DIRECTORY](entry, done) {
|
|
61609
|
-
const mode = entry.mode & 4095 || this.dmode;
|
|
61610
|
-
const er = this[MKDIR](entry.absolute, mode);
|
|
61611
|
-
if (er) {
|
|
61612
|
-
this[ONERROR](er, entry);
|
|
61613
|
-
done();
|
|
61614
|
-
return;
|
|
61615
|
-
}
|
|
61616
|
-
if (entry.mtime && !this.noMtime) {
|
|
61617
|
-
try {
|
|
61618
|
-
fs8.utimesSync(entry.absolute, entry.atime || /* @__PURE__ */ new Date(), entry.mtime);
|
|
61619
|
-
} catch (er2) {
|
|
61620
|
-
}
|
|
61621
|
-
}
|
|
61622
|
-
if (this[DOCHOWN](entry)) {
|
|
61623
|
-
try {
|
|
61624
|
-
fs8.chownSync(entry.absolute, this[UID](entry), this[GID](entry));
|
|
61625
|
-
} catch (er2) {
|
|
61626
|
-
}
|
|
61627
|
-
}
|
|
61628
|
-
done();
|
|
61629
|
-
entry.resume();
|
|
61630
|
-
}
|
|
61631
|
-
[MKDIR](dir, mode) {
|
|
61632
|
-
try {
|
|
61633
|
-
return mkdir.sync(normPath(dir), {
|
|
61634
|
-
uid: this.uid,
|
|
61635
|
-
gid: this.gid,
|
|
61636
|
-
processUid: this.processUid,
|
|
61637
|
-
processGid: this.processGid,
|
|
61638
|
-
umask: this.processUmask,
|
|
61639
|
-
preserve: this.preservePaths,
|
|
61640
|
-
unlink: this.unlink,
|
|
61641
|
-
cache: this.dirCache,
|
|
61642
|
-
cwd: this.cwd,
|
|
61643
|
-
mode
|
|
61644
|
-
});
|
|
61645
|
-
} catch (er) {
|
|
61646
|
-
return er;
|
|
61647
|
-
}
|
|
61648
|
-
}
|
|
61649
|
-
[LINK](entry, linkpath, link, done) {
|
|
61650
|
-
try {
|
|
61651
|
-
fs8[link + "Sync"](linkpath, entry.absolute);
|
|
61652
|
-
done();
|
|
61653
|
-
entry.resume();
|
|
61654
|
-
} catch (er) {
|
|
61655
|
-
return this[ONERROR](er, entry);
|
|
61656
|
-
}
|
|
61657
|
-
}
|
|
61658
|
-
};
|
|
61659
|
-
Unpack.Sync = UnpackSync;
|
|
61660
|
-
module.exports = Unpack;
|
|
61661
|
-
}
|
|
61662
|
-
});
|
|
61663
|
-
|
|
61664
|
-
// node_modules/tar/lib/extract.js
|
|
61665
|
-
var require_extract = __commonJS({
|
|
61666
|
-
"node_modules/tar/lib/extract.js"(exports, module) {
|
|
61667
|
-
"use strict";
|
|
61668
|
-
var hlo = require_high_level_opt();
|
|
61669
|
-
var Unpack = require_unpack();
|
|
61670
|
-
var fs8 = __require("fs");
|
|
61671
|
-
var fsm = require_fs_minipass();
|
|
61672
|
-
var path7 = __require("path");
|
|
61673
|
-
var stripSlash = require_strip_trailing_slashes();
|
|
61674
|
-
module.exports = (opt_, files, cb) => {
|
|
61675
|
-
if (typeof opt_ === "function") {
|
|
61676
|
-
cb = opt_, files = null, opt_ = {};
|
|
61677
|
-
} else if (Array.isArray(opt_)) {
|
|
61678
|
-
files = opt_, opt_ = {};
|
|
61679
|
-
}
|
|
61680
|
-
if (typeof files === "function") {
|
|
61681
|
-
cb = files, files = null;
|
|
61682
|
-
}
|
|
61683
|
-
if (!files) {
|
|
61684
|
-
files = [];
|
|
61685
|
-
} else {
|
|
61686
|
-
files = Array.from(files);
|
|
61687
|
-
}
|
|
61688
|
-
const opt = hlo(opt_);
|
|
61689
|
-
if (opt.sync && typeof cb === "function") {
|
|
61690
|
-
throw new TypeError("callback not supported for sync tar functions");
|
|
61691
|
-
}
|
|
61692
|
-
if (!opt.file && typeof cb === "function") {
|
|
61693
|
-
throw new TypeError("callback only supported with file option");
|
|
61694
|
-
}
|
|
61695
|
-
if (files.length) {
|
|
61696
|
-
filesFilter(opt, files);
|
|
61697
|
-
}
|
|
61698
|
-
return opt.file && opt.sync ? extractFileSync(opt) : opt.file ? extractFile(opt, cb) : opt.sync ? extractSync(opt) : extract(opt);
|
|
61699
|
-
};
|
|
61700
|
-
var filesFilter = (opt, files) => {
|
|
61701
|
-
const map2 = new Map(files.map((f) => [stripSlash(f), true]));
|
|
61702
|
-
const filter = opt.filter;
|
|
61703
|
-
const mapHas = (file2, r) => {
|
|
61704
|
-
const root = r || path7.parse(file2).root || ".";
|
|
61705
|
-
const ret = file2 === root ? false : map2.has(file2) ? map2.get(file2) : mapHas(path7.dirname(file2), root);
|
|
61706
|
-
map2.set(file2, ret);
|
|
61707
|
-
return ret;
|
|
61708
|
-
};
|
|
61709
|
-
opt.filter = filter ? (file2, entry) => filter(file2, entry) && mapHas(stripSlash(file2)) : (file2) => mapHas(stripSlash(file2));
|
|
61710
|
-
};
|
|
61711
|
-
var extractFileSync = (opt) => {
|
|
61712
|
-
const u = new Unpack.Sync(opt);
|
|
61713
|
-
const file2 = opt.file;
|
|
61714
|
-
const stat = fs8.statSync(file2);
|
|
61715
|
-
const readSize = opt.maxReadSize || 16 * 1024 * 1024;
|
|
61716
|
-
const stream = new fsm.ReadStreamSync(file2, {
|
|
61717
|
-
readSize,
|
|
61718
|
-
size: stat.size
|
|
61719
|
-
});
|
|
61720
|
-
stream.pipe(u);
|
|
61721
|
-
};
|
|
61722
|
-
var extractFile = (opt, cb) => {
|
|
61723
|
-
const u = new Unpack(opt);
|
|
61724
|
-
const readSize = opt.maxReadSize || 16 * 1024 * 1024;
|
|
61725
|
-
const file2 = opt.file;
|
|
61726
|
-
const p = new Promise((resolve3, reject) => {
|
|
61727
|
-
u.on("error", reject);
|
|
61728
|
-
u.on("close", resolve3);
|
|
61729
|
-
fs8.stat(file2, (er, stat) => {
|
|
61730
|
-
if (er) {
|
|
61731
|
-
reject(er);
|
|
61732
|
-
} else {
|
|
61733
|
-
const stream = new fsm.ReadStream(file2, {
|
|
61734
|
-
readSize,
|
|
61735
|
-
size: stat.size
|
|
61736
|
-
});
|
|
61737
|
-
stream.on("error", reject);
|
|
61738
|
-
stream.pipe(u);
|
|
61739
|
-
}
|
|
61740
|
-
});
|
|
61741
|
-
});
|
|
61742
|
-
return cb ? p.then(cb, cb) : p;
|
|
61743
|
-
};
|
|
61744
|
-
var extractSync = (opt) => new Unpack.Sync(opt);
|
|
61745
|
-
var extract = (opt) => new Unpack(opt);
|
|
61746
|
-
}
|
|
61747
|
-
});
|
|
61748
|
-
|
|
61749
|
-
// node_modules/tar/index.js
|
|
61750
|
-
var require_tar = __commonJS({
|
|
61751
|
-
"node_modules/tar/index.js"(exports) {
|
|
61752
|
-
"use strict";
|
|
61753
|
-
exports.c = exports.create = require_create();
|
|
61754
|
-
exports.r = exports.replace = require_replace();
|
|
61755
|
-
exports.t = exports.list = require_list2();
|
|
61756
|
-
exports.u = exports.update = require_update();
|
|
61757
|
-
exports.x = exports.extract = require_extract();
|
|
61758
|
-
exports.Pack = require_pack();
|
|
61759
|
-
exports.Unpack = require_unpack();
|
|
61760
|
-
exports.Parse = require_parse3();
|
|
61761
|
-
exports.ReadEntry = require_read_entry();
|
|
61762
|
-
exports.WriteEntry = require_write_entry();
|
|
61763
|
-
exports.Header = require_header();
|
|
61764
|
-
exports.Pax = require_pax();
|
|
61765
|
-
exports.types = require_types2();
|
|
61766
|
-
}
|
|
61767
|
-
});
|
|
61768
|
-
|
|
61769
|
-
// node_modules/bignumber.js/bignumber.js
|
|
61770
|
-
var require_bignumber2 = __commonJS({
|
|
61771
|
-
"node_modules/bignumber.js/bignumber.js"(exports, module) {
|
|
61772
|
-
(function(globalObject) {
|
|
61773
|
-
"use strict";
|
|
61774
|
-
var BigNumber2, isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, mathceil = Math.ceil, mathfloor = Math.floor, bignumberError = "[BigNumber Error] ", tooManyDigits = bignumberError + "Number primitive has more than 15 significant digits: ", BASE = 1e14, LOG_BASE = 14, MAX_SAFE_INTEGER = 9007199254740991, POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], SQRT_BASE = 1e7, MAX = 1e9;
|
|
61775
|
-
function clone2(configObject) {
|
|
61776
|
-
var div, convertBase, parseNumeric, P = BigNumber3.prototype = { constructor: BigNumber3, toString: null, valueOf: null }, ONE = new BigNumber3(1), DECIMAL_PLACES = 20, ROUNDING_MODE = 4, TO_EXP_NEG = -7, TO_EXP_POS = 21, MIN_EXP = -1e7, MAX_EXP = 1e7, CRYPTO = false, MODULO_MODE = 1, POW_PRECISION = 0, FORMAT = {
|
|
61777
|
-
prefix: "",
|
|
61778
|
-
groupSize: 3,
|
|
61779
|
-
secondaryGroupSize: 0,
|
|
61780
|
-
groupSeparator: ",",
|
|
61781
|
-
decimalSeparator: ".",
|
|
61782
|
-
fractionGroupSize: 0,
|
|
61783
|
-
fractionGroupSeparator: "\xA0",
|
|
61784
|
-
// non-breaking space
|
|
61785
|
-
suffix: ""
|
|
61786
|
-
}, ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz";
|
|
61787
|
-
function BigNumber3(v, b) {
|
|
61788
|
-
var alphabet, c, caseChanged, e, i, isNum, len, str, x = this;
|
|
61789
|
-
if (!(x instanceof BigNumber3)) return new BigNumber3(v, b);
|
|
61790
|
-
if (b == null) {
|
|
61791
|
-
if (v && v._isBigNumber === true) {
|
|
61792
|
-
x.s = v.s;
|
|
61793
|
-
if (!v.c || v.e > MAX_EXP) {
|
|
61794
|
-
x.c = x.e = null;
|
|
61795
|
-
} else if (v.e < MIN_EXP) {
|
|
61796
|
-
x.c = [x.e = 0];
|
|
61797
|
-
} else {
|
|
61798
|
-
x.e = v.e;
|
|
61799
|
-
x.c = v.c.slice();
|
|
61800
|
-
}
|
|
61801
|
-
return;
|
|
61802
|
-
}
|
|
61803
|
-
if ((isNum = typeof v == "number") && v * 0 == 0) {
|
|
61804
|
-
x.s = 1 / v < 0 ? (v = -v, -1) : 1;
|
|
61805
|
-
if (v === ~~v) {
|
|
61806
|
-
for (e = 0, i = v; i >= 10; i /= 10, e++) ;
|
|
61807
|
-
if (e > MAX_EXP) {
|
|
61808
|
-
x.c = x.e = null;
|
|
61809
|
-
} else {
|
|
61810
|
-
x.e = e;
|
|
61811
|
-
x.c = [v];
|
|
61812
|
-
}
|
|
61813
|
-
return;
|
|
61814
|
-
}
|
|
61815
|
-
str = String(v);
|
|
61816
|
-
} else {
|
|
61817
|
-
if (!isNumeric.test(str = String(v))) return parseNumeric(x, str, isNum);
|
|
61818
|
-
x.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1;
|
|
61819
|
-
}
|
|
61820
|
-
if ((e = str.indexOf(".")) > -1) str = str.replace(".", "");
|
|
61821
|
-
if ((i = str.search(/e/i)) > 0) {
|
|
61822
|
-
if (e < 0) e = i;
|
|
61823
|
-
e += +str.slice(i + 1);
|
|
61824
|
-
str = str.substring(0, i);
|
|
61825
|
-
} else if (e < 0) {
|
|
61826
|
-
e = str.length;
|
|
61827
|
-
}
|
|
61828
|
-
} else {
|
|
61829
|
-
intCheck(b, 2, ALPHABET.length, "Base");
|
|
61830
|
-
if (b == 10) {
|
|
61831
|
-
x = new BigNumber3(v);
|
|
61832
|
-
return round(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE);
|
|
61833
|
-
}
|
|
61834
|
-
str = String(v);
|
|
61835
|
-
if (isNum = typeof v == "number") {
|
|
61836
|
-
if (v * 0 != 0) return parseNumeric(x, str, isNum, b);
|
|
61837
|
-
x.s = 1 / v < 0 ? (str = str.slice(1), -1) : 1;
|
|
61838
|
-
if (BigNumber3.DEBUG && str.replace(/^0\.0*|\./, "").length > 15) {
|
|
61839
|
-
throw Error(tooManyDigits + v);
|
|
61840
|
-
}
|
|
61841
|
-
} else {
|
|
61842
|
-
x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1;
|
|
61843
|
-
}
|
|
61844
|
-
alphabet = ALPHABET.slice(0, b);
|
|
61845
|
-
e = i = 0;
|
|
61846
|
-
for (len = str.length; i < len; i++) {
|
|
61847
|
-
if (alphabet.indexOf(c = str.charAt(i)) < 0) {
|
|
61848
|
-
if (c == ".") {
|
|
61849
|
-
if (i > e) {
|
|
61850
|
-
e = len;
|
|
61851
|
-
continue;
|
|
61852
|
-
}
|
|
61853
|
-
} else if (!caseChanged) {
|
|
61854
|
-
if (str == str.toUpperCase() && (str = str.toLowerCase()) || str == str.toLowerCase() && (str = str.toUpperCase())) {
|
|
61855
|
-
caseChanged = true;
|
|
61856
|
-
i = -1;
|
|
61857
|
-
e = 0;
|
|
61858
|
-
continue;
|
|
61859
|
-
}
|
|
61860
|
-
}
|
|
61861
|
-
return parseNumeric(x, String(v), isNum, b);
|
|
61862
|
-
}
|
|
61863
|
-
}
|
|
61864
|
-
isNum = false;
|
|
61865
|
-
str = convertBase(str, b, 10, x.s);
|
|
61866
|
-
if ((e = str.indexOf(".")) > -1) str = str.replace(".", "");
|
|
61867
|
-
else e = str.length;
|
|
61868
|
-
}
|
|
61869
|
-
for (i = 0; str.charCodeAt(i) === 48; i++) ;
|
|
61870
|
-
for (len = str.length; str.charCodeAt(--len) === 48; ) ;
|
|
61871
|
-
if (str = str.slice(i, ++len)) {
|
|
61872
|
-
len -= i;
|
|
61873
|
-
if (isNum && BigNumber3.DEBUG && len > 15 && (v > MAX_SAFE_INTEGER || v !== mathfloor(v))) {
|
|
61874
|
-
throw Error(tooManyDigits + x.s * v);
|
|
61875
|
-
}
|
|
61876
|
-
if ((e = e - i - 1) > MAX_EXP) {
|
|
61877
|
-
x.c = x.e = null;
|
|
61878
|
-
} else if (e < MIN_EXP) {
|
|
61879
|
-
x.c = [x.e = 0];
|
|
61880
|
-
} else {
|
|
61881
|
-
x.e = e;
|
|
61882
|
-
x.c = [];
|
|
61883
|
-
i = (e + 1) % LOG_BASE;
|
|
61884
|
-
if (e < 0) i += LOG_BASE;
|
|
61885
|
-
if (i < len) {
|
|
61886
|
-
if (i) x.c.push(+str.slice(0, i));
|
|
61887
|
-
for (len -= LOG_BASE; i < len; ) {
|
|
61888
|
-
x.c.push(+str.slice(i, i += LOG_BASE));
|
|
61889
|
-
}
|
|
61890
|
-
i = LOG_BASE - (str = str.slice(i)).length;
|
|
61891
|
-
} else {
|
|
61892
|
-
i -= len;
|
|
61893
|
-
}
|
|
61894
|
-
for (; i--; str += "0") ;
|
|
61895
|
-
x.c.push(+str);
|
|
61896
|
-
}
|
|
61897
|
-
} else {
|
|
61898
|
-
x.c = [x.e = 0];
|
|
61899
|
-
}
|
|
61900
|
-
}
|
|
61901
|
-
BigNumber3.clone = clone2;
|
|
61902
|
-
BigNumber3.ROUND_UP = 0;
|
|
61903
|
-
BigNumber3.ROUND_DOWN = 1;
|
|
61904
|
-
BigNumber3.ROUND_CEIL = 2;
|
|
61905
|
-
BigNumber3.ROUND_FLOOR = 3;
|
|
61906
|
-
BigNumber3.ROUND_HALF_UP = 4;
|
|
61907
|
-
BigNumber3.ROUND_HALF_DOWN = 5;
|
|
61908
|
-
BigNumber3.ROUND_HALF_EVEN = 6;
|
|
61909
|
-
BigNumber3.ROUND_HALF_CEIL = 7;
|
|
61910
|
-
BigNumber3.ROUND_HALF_FLOOR = 8;
|
|
61911
|
-
BigNumber3.EUCLID = 9;
|
|
61912
|
-
BigNumber3.config = BigNumber3.set = function(obj) {
|
|
61913
|
-
var p, v;
|
|
61914
|
-
if (obj != null) {
|
|
61915
|
-
if (typeof obj == "object") {
|
|
61916
|
-
if (obj.hasOwnProperty(p = "DECIMAL_PLACES")) {
|
|
61917
|
-
v = obj[p];
|
|
61918
|
-
intCheck(v, 0, MAX, p);
|
|
61919
|
-
DECIMAL_PLACES = v;
|
|
61920
|
-
}
|
|
61921
|
-
if (obj.hasOwnProperty(p = "ROUNDING_MODE")) {
|
|
61922
|
-
v = obj[p];
|
|
61923
|
-
intCheck(v, 0, 8, p);
|
|
61924
|
-
ROUNDING_MODE = v;
|
|
61925
|
-
}
|
|
61926
|
-
if (obj.hasOwnProperty(p = "EXPONENTIAL_AT")) {
|
|
61927
|
-
v = obj[p];
|
|
61928
|
-
if (v && v.pop) {
|
|
61929
|
-
intCheck(v[0], -MAX, 0, p);
|
|
61930
|
-
intCheck(v[1], 0, MAX, p);
|
|
61931
|
-
TO_EXP_NEG = v[0];
|
|
61932
|
-
TO_EXP_POS = v[1];
|
|
61933
|
-
} else {
|
|
61934
|
-
intCheck(v, -MAX, MAX, p);
|
|
61935
|
-
TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v);
|
|
61936
|
-
}
|
|
61937
|
-
}
|
|
61938
|
-
if (obj.hasOwnProperty(p = "RANGE")) {
|
|
61939
|
-
v = obj[p];
|
|
61940
|
-
if (v && v.pop) {
|
|
61941
|
-
intCheck(v[0], -MAX, -1, p);
|
|
61942
|
-
intCheck(v[1], 1, MAX, p);
|
|
61943
|
-
MIN_EXP = v[0];
|
|
61944
|
-
MAX_EXP = v[1];
|
|
61945
|
-
} else {
|
|
61946
|
-
intCheck(v, -MAX, MAX, p);
|
|
61947
|
-
if (v) {
|
|
61948
|
-
MIN_EXP = -(MAX_EXP = v < 0 ? -v : v);
|
|
61949
|
-
} else {
|
|
61950
|
-
throw Error(bignumberError + p + " cannot be zero: " + v);
|
|
61951
|
-
}
|
|
61952
|
-
}
|
|
61953
|
-
}
|
|
61954
|
-
if (obj.hasOwnProperty(p = "CRYPTO")) {
|
|
61955
|
-
v = obj[p];
|
|
61956
|
-
if (v === !!v) {
|
|
61957
|
-
if (v) {
|
|
61958
|
-
if (typeof crypto != "undefined" && crypto && (crypto.getRandomValues || crypto.randomBytes)) {
|
|
61959
|
-
CRYPTO = v;
|
|
61960
|
-
} else {
|
|
61961
|
-
CRYPTO = !v;
|
|
61962
|
-
throw Error(bignumberError + "crypto unavailable");
|
|
61963
|
-
}
|
|
61964
|
-
} else {
|
|
61965
|
-
CRYPTO = v;
|
|
61966
|
-
}
|
|
61967
|
-
} else {
|
|
61968
|
-
throw Error(bignumberError + p + " not true or false: " + v);
|
|
61969
|
-
}
|
|
61970
|
-
}
|
|
61971
|
-
if (obj.hasOwnProperty(p = "MODULO_MODE")) {
|
|
61972
|
-
v = obj[p];
|
|
61973
|
-
intCheck(v, 0, 9, p);
|
|
61974
|
-
MODULO_MODE = v;
|
|
61975
|
-
}
|
|
61976
|
-
if (obj.hasOwnProperty(p = "POW_PRECISION")) {
|
|
61977
|
-
v = obj[p];
|
|
61978
|
-
intCheck(v, 0, MAX, p);
|
|
61979
|
-
POW_PRECISION = v;
|
|
61980
|
-
}
|
|
61981
|
-
if (obj.hasOwnProperty(p = "FORMAT")) {
|
|
61982
|
-
v = obj[p];
|
|
61983
|
-
if (typeof v == "object") FORMAT = v;
|
|
61984
|
-
else throw Error(bignumberError + p + " not an object: " + v);
|
|
61985
|
-
}
|
|
61986
|
-
if (obj.hasOwnProperty(p = "ALPHABET")) {
|
|
61987
|
-
v = obj[p];
|
|
61988
|
-
if (typeof v == "string" && !/^.$|[+-.\s]|(.).*\1/.test(v)) {
|
|
61989
|
-
ALPHABET = v;
|
|
61990
|
-
} else {
|
|
61991
|
-
throw Error(bignumberError + p + " invalid: " + v);
|
|
61992
|
-
}
|
|
61993
|
-
}
|
|
61994
|
-
} else {
|
|
61995
|
-
throw Error(bignumberError + "Object expected: " + obj);
|
|
61996
|
-
}
|
|
61997
|
-
}
|
|
61998
|
-
return {
|
|
61999
|
-
DECIMAL_PLACES,
|
|
62000
|
-
ROUNDING_MODE,
|
|
62001
|
-
EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS],
|
|
62002
|
-
RANGE: [MIN_EXP, MAX_EXP],
|
|
62003
|
-
CRYPTO,
|
|
62004
|
-
MODULO_MODE,
|
|
62005
|
-
POW_PRECISION,
|
|
62006
|
-
FORMAT,
|
|
62007
|
-
ALPHABET
|
|
62008
|
-
};
|
|
62009
|
-
};
|
|
62010
|
-
BigNumber3.isBigNumber = function(v) {
|
|
62011
|
-
if (!v || v._isBigNumber !== true) return false;
|
|
62012
|
-
if (!BigNumber3.DEBUG) return true;
|
|
62013
|
-
var i, n, c = v.c, e = v.e, s = v.s;
|
|
62014
|
-
out: if ({}.toString.call(c) == "[object Array]") {
|
|
62015
|
-
if ((s === 1 || s === -1) && e >= -MAX && e <= MAX && e === mathfloor(e)) {
|
|
62016
|
-
if (c[0] === 0) {
|
|
62017
|
-
if (e === 0 && c.length === 1) return true;
|
|
62018
|
-
break out;
|
|
62019
|
-
}
|
|
62020
|
-
i = (e + 1) % LOG_BASE;
|
|
62021
|
-
if (i < 1) i += LOG_BASE;
|
|
62022
|
-
if (String(c[0]).length == i) {
|
|
62023
|
-
for (i = 0; i < c.length; i++) {
|
|
62024
|
-
n = c[i];
|
|
62025
|
-
if (n < 0 || n >= BASE || n !== mathfloor(n)) break out;
|
|
62026
|
-
}
|
|
62027
|
-
if (n !== 0) return true;
|
|
62028
|
-
}
|
|
62029
|
-
}
|
|
62030
|
-
} else if (c === null && e === null && (s === null || s === 1 || s === -1)) {
|
|
62031
|
-
return true;
|
|
62032
|
-
}
|
|
62033
|
-
throw Error(bignumberError + "Invalid BigNumber: " + v);
|
|
62034
|
-
};
|
|
62035
|
-
BigNumber3.maximum = BigNumber3.max = function() {
|
|
62036
|
-
return maxOrMin(arguments, P.lt);
|
|
62037
|
-
};
|
|
62038
|
-
BigNumber3.minimum = BigNumber3.min = function() {
|
|
62039
|
-
return maxOrMin(arguments, P.gt);
|
|
62040
|
-
};
|
|
62041
|
-
BigNumber3.random = (function() {
|
|
62042
|
-
var pow2_53 = 9007199254740992;
|
|
62043
|
-
var random53bitInt = Math.random() * pow2_53 & 2097151 ? function() {
|
|
62044
|
-
return mathfloor(Math.random() * pow2_53);
|
|
62045
|
-
} : function() {
|
|
62046
|
-
return (Math.random() * 1073741824 | 0) * 8388608 + (Math.random() * 8388608 | 0);
|
|
62047
|
-
};
|
|
62048
|
-
return function(dp) {
|
|
62049
|
-
var a, b, e, k, v, i = 0, c = [], rand = new BigNumber3(ONE);
|
|
62050
|
-
if (dp == null) dp = DECIMAL_PLACES;
|
|
62051
|
-
else intCheck(dp, 0, MAX);
|
|
62052
|
-
k = mathceil(dp / LOG_BASE);
|
|
62053
|
-
if (CRYPTO) {
|
|
62054
|
-
if (crypto.getRandomValues) {
|
|
62055
|
-
a = crypto.getRandomValues(new Uint32Array(k *= 2));
|
|
62056
|
-
for (; i < k; ) {
|
|
62057
|
-
v = a[i] * 131072 + (a[i + 1] >>> 11);
|
|
62058
|
-
if (v >= 9e15) {
|
|
62059
|
-
b = crypto.getRandomValues(new Uint32Array(2));
|
|
62060
|
-
a[i] = b[0];
|
|
62061
|
-
a[i + 1] = b[1];
|
|
62062
|
-
} else {
|
|
62063
|
-
c.push(v % 1e14);
|
|
62064
|
-
i += 2;
|
|
62065
|
-
}
|
|
62066
|
-
}
|
|
62067
|
-
i = k / 2;
|
|
62068
|
-
} else if (crypto.randomBytes) {
|
|
62069
|
-
a = crypto.randomBytes(k *= 7);
|
|
62070
|
-
for (; i < k; ) {
|
|
62071
|
-
v = (a[i] & 31) * 281474976710656 + a[i + 1] * 1099511627776 + a[i + 2] * 4294967296 + a[i + 3] * 16777216 + (a[i + 4] << 16) + (a[i + 5] << 8) + a[i + 6];
|
|
62072
|
-
if (v >= 9e15) {
|
|
62073
|
-
crypto.randomBytes(7).copy(a, i);
|
|
62074
|
-
} else {
|
|
62075
|
-
c.push(v % 1e14);
|
|
62076
|
-
i += 7;
|
|
62077
|
-
}
|
|
62078
|
-
}
|
|
62079
|
-
i = k / 7;
|
|
62080
|
-
} else {
|
|
62081
|
-
CRYPTO = false;
|
|
62082
|
-
throw Error(bignumberError + "crypto unavailable");
|
|
62083
|
-
}
|
|
62084
|
-
}
|
|
62085
|
-
if (!CRYPTO) {
|
|
62086
|
-
for (; i < k; ) {
|
|
62087
|
-
v = random53bitInt();
|
|
62088
|
-
if (v < 9e15) c[i++] = v % 1e14;
|
|
62089
|
-
}
|
|
62090
|
-
}
|
|
62091
|
-
k = c[--i];
|
|
62092
|
-
dp %= LOG_BASE;
|
|
62093
|
-
if (k && dp) {
|
|
62094
|
-
v = POWS_TEN[LOG_BASE - dp];
|
|
62095
|
-
c[i] = mathfloor(k / v) * v;
|
|
62096
|
-
}
|
|
62097
|
-
for (; c[i] === 0; c.pop(), i--) ;
|
|
62098
|
-
if (i < 0) {
|
|
62099
|
-
c = [e = 0];
|
|
62100
|
-
} else {
|
|
62101
|
-
for (e = -1; c[0] === 0; c.splice(0, 1), e -= LOG_BASE) ;
|
|
62102
|
-
for (i = 1, v = c[0]; v >= 10; v /= 10, i++) ;
|
|
62103
|
-
if (i < LOG_BASE) e -= LOG_BASE - i;
|
|
62104
|
-
}
|
|
62105
|
-
rand.e = e;
|
|
62106
|
-
rand.c = c;
|
|
62107
|
-
return rand;
|
|
62108
|
-
};
|
|
62109
|
-
})();
|
|
62110
|
-
BigNumber3.sum = function() {
|
|
62111
|
-
var i = 1, args = arguments, sum = new BigNumber3(args[0]);
|
|
62112
|
-
for (; i < args.length; ) sum = sum.plus(args[i++]);
|
|
62113
|
-
return sum;
|
|
62114
|
-
};
|
|
62115
|
-
convertBase = /* @__PURE__ */ (function() {
|
|
62116
|
-
var decimal = "0123456789";
|
|
62117
|
-
function toBaseOut(str, baseIn, baseOut, alphabet) {
|
|
62118
|
-
var j, arr = [0], arrL, i = 0, len = str.length;
|
|
62119
|
-
for (; i < len; ) {
|
|
62120
|
-
for (arrL = arr.length; arrL--; arr[arrL] *= baseIn) ;
|
|
62121
|
-
arr[0] += alphabet.indexOf(str.charAt(i++));
|
|
62122
|
-
for (j = 0; j < arr.length; j++) {
|
|
62123
|
-
if (arr[j] > baseOut - 1) {
|
|
62124
|
-
if (arr[j + 1] == null) arr[j + 1] = 0;
|
|
62125
|
-
arr[j + 1] += arr[j] / baseOut | 0;
|
|
62126
|
-
arr[j] %= baseOut;
|
|
62127
|
-
}
|
|
62128
|
-
}
|
|
62129
|
-
}
|
|
62130
|
-
return arr.reverse();
|
|
62131
|
-
}
|
|
62132
|
-
return function(str, baseIn, baseOut, sign, callerIsToString) {
|
|
62133
|
-
var alphabet, d, e, k, r, x, xc, y, i = str.indexOf("."), dp = DECIMAL_PLACES, rm = ROUNDING_MODE;
|
|
62134
|
-
if (i >= 0) {
|
|
62135
|
-
k = POW_PRECISION;
|
|
62136
|
-
POW_PRECISION = 0;
|
|
62137
|
-
str = str.replace(".", "");
|
|
62138
|
-
y = new BigNumber3(baseIn);
|
|
62139
|
-
x = y.pow(str.length - i);
|
|
62140
|
-
POW_PRECISION = k;
|
|
62141
|
-
y.c = toBaseOut(
|
|
62142
|
-
toFixedPoint(coeffToString(x.c), x.e, "0"),
|
|
62143
|
-
10,
|
|
62144
|
-
baseOut,
|
|
62145
|
-
decimal
|
|
62146
|
-
);
|
|
62147
|
-
y.e = y.c.length;
|
|
62148
|
-
}
|
|
62149
|
-
xc = toBaseOut(str, baseIn, baseOut, callerIsToString ? (alphabet = ALPHABET, decimal) : (alphabet = decimal, ALPHABET));
|
|
62150
|
-
e = k = xc.length;
|
|
62151
|
-
for (; xc[--k] == 0; xc.pop()) ;
|
|
62152
|
-
if (!xc[0]) return alphabet.charAt(0);
|
|
62153
|
-
if (i < 0) {
|
|
62154
|
-
--e;
|
|
62155
|
-
} else {
|
|
62156
|
-
x.c = xc;
|
|
62157
|
-
x.e = e;
|
|
62158
|
-
x.s = sign;
|
|
62159
|
-
x = div(x, y, dp, rm, baseOut);
|
|
62160
|
-
xc = x.c;
|
|
62161
|
-
r = x.r;
|
|
62162
|
-
e = x.e;
|
|
62163
|
-
}
|
|
62164
|
-
d = e + dp + 1;
|
|
62165
|
-
i = xc[d];
|
|
62166
|
-
k = baseOut / 2;
|
|
62167
|
-
r = r || d < 0 || xc[d + 1] != null;
|
|
62168
|
-
r = rm < 4 ? (i != null || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) : i > k || i == k && (rm == 4 || r || rm == 6 && xc[d - 1] & 1 || rm == (x.s < 0 ? 8 : 7));
|
|
62169
|
-
if (d < 1 || !xc[0]) {
|
|
62170
|
-
str = r ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) : alphabet.charAt(0);
|
|
62171
|
-
} else {
|
|
62172
|
-
xc.length = d;
|
|
62173
|
-
if (r) {
|
|
62174
|
-
for (--baseOut; ++xc[--d] > baseOut; ) {
|
|
62175
|
-
xc[d] = 0;
|
|
62176
|
-
if (!d) {
|
|
62177
|
-
++e;
|
|
62178
|
-
xc = [1].concat(xc);
|
|
62179
|
-
}
|
|
62180
|
-
}
|
|
62181
|
-
}
|
|
62182
|
-
for (k = xc.length; !xc[--k]; ) ;
|
|
62183
|
-
for (i = 0, str = ""; i <= k; str += alphabet.charAt(xc[i++])) ;
|
|
62184
|
-
str = toFixedPoint(str, e, alphabet.charAt(0));
|
|
62185
|
-
}
|
|
62186
|
-
return str;
|
|
62187
|
-
};
|
|
62188
|
-
})();
|
|
62189
|
-
div = /* @__PURE__ */ (function() {
|
|
62190
|
-
function multiply(x, k, base) {
|
|
62191
|
-
var m, temp, xlo, xhi, carry = 0, i = x.length, klo = k % SQRT_BASE, khi = k / SQRT_BASE | 0;
|
|
62192
|
-
for (x = x.slice(); i--; ) {
|
|
62193
|
-
xlo = x[i] % SQRT_BASE;
|
|
62194
|
-
xhi = x[i] / SQRT_BASE | 0;
|
|
62195
|
-
m = khi * xlo + xhi * klo;
|
|
62196
|
-
temp = klo * xlo + m % SQRT_BASE * SQRT_BASE + carry;
|
|
62197
|
-
carry = (temp / base | 0) + (m / SQRT_BASE | 0) + khi * xhi;
|
|
62198
|
-
x[i] = temp % base;
|
|
62199
|
-
}
|
|
62200
|
-
if (carry) x = [carry].concat(x);
|
|
62201
|
-
return x;
|
|
62202
|
-
}
|
|
62203
|
-
function compare2(a, b, aL, bL) {
|
|
62204
|
-
var i, cmp;
|
|
62205
|
-
if (aL != bL) {
|
|
62206
|
-
cmp = aL > bL ? 1 : -1;
|
|
62207
|
-
} else {
|
|
62208
|
-
for (i = cmp = 0; i < aL; i++) {
|
|
62209
|
-
if (a[i] != b[i]) {
|
|
62210
|
-
cmp = a[i] > b[i] ? 1 : -1;
|
|
62211
|
-
break;
|
|
62212
|
-
}
|
|
62213
|
-
}
|
|
62214
|
-
}
|
|
62215
|
-
return cmp;
|
|
62216
|
-
}
|
|
62217
|
-
function subtract(a, b, aL, base) {
|
|
62218
|
-
var i = 0;
|
|
62219
|
-
for (; aL--; ) {
|
|
62220
|
-
a[aL] -= i;
|
|
62221
|
-
i = a[aL] < b[aL] ? 1 : 0;
|
|
62222
|
-
a[aL] = i * base + a[aL] - b[aL];
|
|
62223
|
-
}
|
|
62224
|
-
for (; !a[0] && a.length > 1; a.splice(0, 1)) ;
|
|
62225
|
-
}
|
|
62226
|
-
return function(x, y, dp, rm, base) {
|
|
62227
|
-
var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0, yL, yz, s = x.s == y.s ? 1 : -1, xc = x.c, yc = y.c;
|
|
62228
|
-
if (!xc || !xc[0] || !yc || !yc[0]) {
|
|
62229
|
-
return new BigNumber3(
|
|
62230
|
-
// Return NaN if either NaN, or both Infinity or 0.
|
|
62231
|
-
!x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN : (
|
|
62232
|
-
// Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.
|
|
62233
|
-
xc && xc[0] == 0 || !yc ? s * 0 : s / 0
|
|
62234
|
-
)
|
|
62235
|
-
);
|
|
62236
|
-
}
|
|
62237
|
-
q = new BigNumber3(s);
|
|
62238
|
-
qc = q.c = [];
|
|
62239
|
-
e = x.e - y.e;
|
|
62240
|
-
s = dp + e + 1;
|
|
62241
|
-
if (!base) {
|
|
62242
|
-
base = BASE;
|
|
62243
|
-
e = bitFloor(x.e / LOG_BASE) - bitFloor(y.e / LOG_BASE);
|
|
62244
|
-
s = s / LOG_BASE | 0;
|
|
62245
|
-
}
|
|
62246
|
-
for (i = 0; yc[i] == (xc[i] || 0); i++) ;
|
|
62247
|
-
if (yc[i] > (xc[i] || 0)) e--;
|
|
62248
|
-
if (s < 0) {
|
|
62249
|
-
qc.push(1);
|
|
62250
|
-
more = true;
|
|
62251
|
-
} else {
|
|
62252
|
-
xL = xc.length;
|
|
62253
|
-
yL = yc.length;
|
|
62254
|
-
i = 0;
|
|
62255
|
-
s += 2;
|
|
62256
|
-
n = mathfloor(base / (yc[0] + 1));
|
|
62257
|
-
if (n > 1) {
|
|
62258
|
-
yc = multiply(yc, n, base);
|
|
62259
|
-
xc = multiply(xc, n, base);
|
|
62260
|
-
yL = yc.length;
|
|
62261
|
-
xL = xc.length;
|
|
62262
|
-
}
|
|
62263
|
-
xi = yL;
|
|
62264
|
-
rem = xc.slice(0, yL);
|
|
62265
|
-
remL = rem.length;
|
|
62266
|
-
for (; remL < yL; rem[remL++] = 0) ;
|
|
62267
|
-
yz = yc.slice();
|
|
62268
|
-
yz = [0].concat(yz);
|
|
62269
|
-
yc0 = yc[0];
|
|
62270
|
-
if (yc[1] >= base / 2) yc0++;
|
|
62271
|
-
do {
|
|
62272
|
-
n = 0;
|
|
62273
|
-
cmp = compare2(yc, rem, yL, remL);
|
|
62274
|
-
if (cmp < 0) {
|
|
62275
|
-
rem0 = rem[0];
|
|
62276
|
-
if (yL != remL) rem0 = rem0 * base + (rem[1] || 0);
|
|
62277
|
-
n = mathfloor(rem0 / yc0);
|
|
62278
|
-
if (n > 1) {
|
|
62279
|
-
if (n >= base) n = base - 1;
|
|
62280
|
-
prod = multiply(yc, n, base);
|
|
62281
|
-
prodL = prod.length;
|
|
62282
|
-
remL = rem.length;
|
|
62283
|
-
while (compare2(prod, rem, prodL, remL) == 1) {
|
|
62284
|
-
n--;
|
|
62285
|
-
subtract(prod, yL < prodL ? yz : yc, prodL, base);
|
|
62286
|
-
prodL = prod.length;
|
|
62287
|
-
cmp = 1;
|
|
62288
|
-
}
|
|
62289
|
-
} else {
|
|
62290
|
-
if (n == 0) {
|
|
62291
|
-
cmp = n = 1;
|
|
62292
|
-
}
|
|
62293
|
-
prod = yc.slice();
|
|
62294
|
-
prodL = prod.length;
|
|
62295
|
-
}
|
|
62296
|
-
if (prodL < remL) prod = [0].concat(prod);
|
|
62297
|
-
subtract(rem, prod, remL, base);
|
|
62298
|
-
remL = rem.length;
|
|
62299
|
-
if (cmp == -1) {
|
|
62300
|
-
while (compare2(yc, rem, yL, remL) < 1) {
|
|
62301
|
-
n++;
|
|
62302
|
-
subtract(rem, yL < remL ? yz : yc, remL, base);
|
|
62303
|
-
remL = rem.length;
|
|
62304
|
-
}
|
|
62305
|
-
}
|
|
62306
|
-
} else if (cmp === 0) {
|
|
62307
|
-
n++;
|
|
62308
|
-
rem = [0];
|
|
62309
|
-
}
|
|
62310
|
-
qc[i++] = n;
|
|
62311
|
-
if (rem[0]) {
|
|
62312
|
-
rem[remL++] = xc[xi] || 0;
|
|
62313
|
-
} else {
|
|
62314
|
-
rem = [xc[xi]];
|
|
62315
|
-
remL = 1;
|
|
62316
|
-
}
|
|
62317
|
-
} while ((xi++ < xL || rem[0] != null) && s--);
|
|
62318
|
-
more = rem[0] != null;
|
|
62319
|
-
if (!qc[0]) qc.splice(0, 1);
|
|
62320
|
-
}
|
|
62321
|
-
if (base == BASE) {
|
|
62322
|
-
for (i = 1, s = qc[0]; s >= 10; s /= 10, i++) ;
|
|
62323
|
-
round(q, dp + (q.e = i + e * LOG_BASE - 1) + 1, rm, more);
|
|
62324
|
-
} else {
|
|
62325
|
-
q.e = e;
|
|
62326
|
-
q.r = +more;
|
|
62327
|
-
}
|
|
62328
|
-
return q;
|
|
62329
|
-
};
|
|
62330
|
-
})();
|
|
62331
|
-
function format(n, i, rm, id) {
|
|
62332
|
-
var c0, e, ne, len, str;
|
|
62333
|
-
if (rm == null) rm = ROUNDING_MODE;
|
|
62334
|
-
else intCheck(rm, 0, 8);
|
|
62335
|
-
if (!n.c) return n.toString();
|
|
62336
|
-
c0 = n.c[0];
|
|
62337
|
-
ne = n.e;
|
|
62338
|
-
if (i == null) {
|
|
62339
|
-
str = coeffToString(n.c);
|
|
62340
|
-
str = id == 1 || id == 2 && (ne <= TO_EXP_NEG || ne >= TO_EXP_POS) ? toExponential(str, ne) : toFixedPoint(str, ne, "0");
|
|
62341
|
-
} else {
|
|
62342
|
-
n = round(new BigNumber3(n), i, rm);
|
|
62343
|
-
e = n.e;
|
|
62344
|
-
str = coeffToString(n.c);
|
|
62345
|
-
len = str.length;
|
|
62346
|
-
if (id == 1 || id == 2 && (i <= e || e <= TO_EXP_NEG)) {
|
|
62347
|
-
for (; len < i; str += "0", len++) ;
|
|
62348
|
-
str = toExponential(str, e);
|
|
62349
|
-
} else {
|
|
62350
|
-
i -= ne;
|
|
62351
|
-
str = toFixedPoint(str, e, "0");
|
|
62352
|
-
if (e + 1 > len) {
|
|
62353
|
-
if (--i > 0) for (str += "."; i--; str += "0") ;
|
|
62354
|
-
} else {
|
|
62355
|
-
i += e - len;
|
|
62356
|
-
if (i > 0) {
|
|
62357
|
-
if (e + 1 == len) str += ".";
|
|
62358
|
-
for (; i--; str += "0") ;
|
|
62359
|
-
}
|
|
62360
|
-
}
|
|
62361
|
-
}
|
|
62362
|
-
}
|
|
62363
|
-
return n.s < 0 && c0 ? "-" + str : str;
|
|
62364
|
-
}
|
|
62365
|
-
function maxOrMin(args, method) {
|
|
62366
|
-
var n, i = 1, m = new BigNumber3(args[0]);
|
|
62367
|
-
for (; i < args.length; i++) {
|
|
62368
|
-
n = new BigNumber3(args[i]);
|
|
62369
|
-
if (!n.s) {
|
|
62370
|
-
m = n;
|
|
62371
|
-
break;
|
|
62372
|
-
} else if (method.call(m, n)) {
|
|
62373
|
-
m = n;
|
|
62374
|
-
}
|
|
62375
|
-
}
|
|
62376
|
-
return m;
|
|
62377
|
-
}
|
|
62378
|
-
function normalise(n, c, e) {
|
|
62379
|
-
var i = 1, j = c.length;
|
|
62380
|
-
for (; !c[--j]; c.pop()) ;
|
|
62381
|
-
for (j = c[0]; j >= 10; j /= 10, i++) ;
|
|
62382
|
-
if ((e = i + e * LOG_BASE - 1) > MAX_EXP) {
|
|
62383
|
-
n.c = n.e = null;
|
|
62384
|
-
} else if (e < MIN_EXP) {
|
|
62385
|
-
n.c = [n.e = 0];
|
|
62386
|
-
} else {
|
|
62387
|
-
n.e = e;
|
|
62388
|
-
n.c = c;
|
|
62389
|
-
}
|
|
62390
|
-
return n;
|
|
62391
|
-
}
|
|
62392
|
-
parseNumeric = /* @__PURE__ */ (function() {
|
|
62393
|
-
var basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i, dotAfter = /^([^.]+)\.$/, dotBefore = /^\.([^.]+)$/, isInfinityOrNaN = /^-?(Infinity|NaN)$/, whitespaceOrPlus = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
|
|
62394
|
-
return function(x, str, isNum, b) {
|
|
62395
|
-
var base, s = isNum ? str : str.replace(whitespaceOrPlus, "");
|
|
62396
|
-
if (isInfinityOrNaN.test(s)) {
|
|
62397
|
-
x.s = isNaN(s) ? null : s < 0 ? -1 : 1;
|
|
62398
|
-
} else {
|
|
62399
|
-
if (!isNum) {
|
|
62400
|
-
s = s.replace(basePrefix, function(m, p1, p2) {
|
|
62401
|
-
base = (p2 = p2.toLowerCase()) == "x" ? 16 : p2 == "b" ? 2 : 8;
|
|
62402
|
-
return !b || b == base ? p1 : m;
|
|
62403
|
-
});
|
|
62404
|
-
if (b) {
|
|
62405
|
-
base = b;
|
|
62406
|
-
s = s.replace(dotAfter, "$1").replace(dotBefore, "0.$1");
|
|
62407
|
-
}
|
|
62408
|
-
if (str != s) return new BigNumber3(s, base);
|
|
62409
|
-
}
|
|
62410
|
-
if (BigNumber3.DEBUG) {
|
|
62411
|
-
throw Error(bignumberError + "Not a" + (b ? " base " + b : "") + " number: " + str);
|
|
62412
|
-
}
|
|
62413
|
-
x.s = null;
|
|
62414
|
-
}
|
|
62415
|
-
x.c = x.e = null;
|
|
62416
|
-
};
|
|
62417
|
-
})();
|
|
62418
|
-
function round(x, sd, rm, r) {
|
|
62419
|
-
var d, i, j, k, n, ni, rd, xc = x.c, pows10 = POWS_TEN;
|
|
62420
|
-
if (xc) {
|
|
62421
|
-
out: {
|
|
62422
|
-
for (d = 1, k = xc[0]; k >= 10; k /= 10, d++) ;
|
|
62423
|
-
i = sd - d;
|
|
62424
|
-
if (i < 0) {
|
|
62425
|
-
i += LOG_BASE;
|
|
62426
|
-
j = sd;
|
|
62427
|
-
n = xc[ni = 0];
|
|
62428
|
-
rd = n / pows10[d - j - 1] % 10 | 0;
|
|
62429
|
-
} else {
|
|
62430
|
-
ni = mathceil((i + 1) / LOG_BASE);
|
|
62431
|
-
if (ni >= xc.length) {
|
|
62432
|
-
if (r) {
|
|
62433
|
-
for (; xc.length <= ni; xc.push(0)) ;
|
|
62434
|
-
n = rd = 0;
|
|
62435
|
-
d = 1;
|
|
62436
|
-
i %= LOG_BASE;
|
|
62437
|
-
j = i - LOG_BASE + 1;
|
|
62438
|
-
} else {
|
|
62439
|
-
break out;
|
|
62440
|
-
}
|
|
62441
|
-
} else {
|
|
62442
|
-
n = k = xc[ni];
|
|
62443
|
-
for (d = 1; k >= 10; k /= 10, d++) ;
|
|
62444
|
-
i %= LOG_BASE;
|
|
62445
|
-
j = i - LOG_BASE + d;
|
|
62446
|
-
rd = j < 0 ? 0 : n / pows10[d - j - 1] % 10 | 0;
|
|
62447
|
-
}
|
|
62448
|
-
}
|
|
62449
|
-
r = r || sd < 0 || // Are there any non-zero digits after the rounding digit?
|
|
62450
|
-
// The expression n % pows10[d - j - 1] returns all digits of n to the right
|
|
62451
|
-
// of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.
|
|
62452
|
-
xc[ni + 1] != null || (j < 0 ? n : n % pows10[d - j - 1]);
|
|
62453
|
-
r = rm < 4 ? (rd || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) : rd > 5 || rd == 5 && (rm == 4 || r || rm == 6 && // Check whether the digit to the left of the rounding digit is odd.
|
|
62454
|
-
(i > 0 ? j > 0 ? n / pows10[d - j] : 0 : xc[ni - 1]) % 10 & 1 || rm == (x.s < 0 ? 8 : 7));
|
|
62455
|
-
if (sd < 1 || !xc[0]) {
|
|
62456
|
-
xc.length = 0;
|
|
62457
|
-
if (r) {
|
|
62458
|
-
sd -= x.e + 1;
|
|
62459
|
-
xc[0] = pows10[(LOG_BASE - sd % LOG_BASE) % LOG_BASE];
|
|
62460
|
-
x.e = -sd || 0;
|
|
62461
|
-
} else {
|
|
62462
|
-
xc[0] = x.e = 0;
|
|
62463
|
-
}
|
|
62464
|
-
return x;
|
|
62465
|
-
}
|
|
62466
|
-
if (i == 0) {
|
|
62467
|
-
xc.length = ni;
|
|
62468
|
-
k = 1;
|
|
62469
|
-
ni--;
|
|
62470
|
-
} else {
|
|
62471
|
-
xc.length = ni + 1;
|
|
62472
|
-
k = pows10[LOG_BASE - i];
|
|
62473
|
-
xc[ni] = j > 0 ? mathfloor(n / pows10[d - j] % pows10[j]) * k : 0;
|
|
62474
|
-
}
|
|
62475
|
-
if (r) {
|
|
62476
|
-
for (; ; ) {
|
|
62477
|
-
if (ni == 0) {
|
|
62478
|
-
for (i = 1, j = xc[0]; j >= 10; j /= 10, i++) ;
|
|
62479
|
-
j = xc[0] += k;
|
|
62480
|
-
for (k = 1; j >= 10; j /= 10, k++) ;
|
|
62481
|
-
if (i != k) {
|
|
62482
|
-
x.e++;
|
|
62483
|
-
if (xc[0] == BASE) xc[0] = 1;
|
|
62484
|
-
}
|
|
62485
|
-
break;
|
|
62486
|
-
} else {
|
|
62487
|
-
xc[ni] += k;
|
|
62488
|
-
if (xc[ni] != BASE) break;
|
|
62489
|
-
xc[ni--] = 0;
|
|
62490
|
-
k = 1;
|
|
62491
|
-
}
|
|
62492
|
-
}
|
|
62493
|
-
}
|
|
62494
|
-
for (i = xc.length; xc[--i] === 0; xc.pop()) ;
|
|
62495
|
-
}
|
|
62496
|
-
if (x.e > MAX_EXP) {
|
|
62497
|
-
x.c = x.e = null;
|
|
62498
|
-
} else if (x.e < MIN_EXP) {
|
|
62499
|
-
x.c = [x.e = 0];
|
|
62500
|
-
}
|
|
62501
|
-
}
|
|
62502
|
-
return x;
|
|
62503
|
-
}
|
|
62504
|
-
function valueOf(n) {
|
|
62505
|
-
var str, e = n.e;
|
|
62506
|
-
if (e === null) return n.toString();
|
|
62507
|
-
str = coeffToString(n.c);
|
|
62508
|
-
str = e <= TO_EXP_NEG || e >= TO_EXP_POS ? toExponential(str, e) : toFixedPoint(str, e, "0");
|
|
62509
|
-
return n.s < 0 ? "-" + str : str;
|
|
62510
|
-
}
|
|
62511
|
-
P.absoluteValue = P.abs = function() {
|
|
62512
|
-
var x = new BigNumber3(this);
|
|
62513
|
-
if (x.s < 0) x.s = 1;
|
|
62514
|
-
return x;
|
|
62515
|
-
};
|
|
62516
|
-
P.comparedTo = function(y, b) {
|
|
62517
|
-
return compare(this, new BigNumber3(y, b));
|
|
62518
|
-
};
|
|
62519
|
-
P.decimalPlaces = P.dp = function(dp, rm) {
|
|
62520
|
-
var c, n, v, x = this;
|
|
62521
|
-
if (dp != null) {
|
|
62522
|
-
intCheck(dp, 0, MAX);
|
|
62523
|
-
if (rm == null) rm = ROUNDING_MODE;
|
|
62524
|
-
else intCheck(rm, 0, 8);
|
|
62525
|
-
return round(new BigNumber3(x), dp + x.e + 1, rm);
|
|
62526
|
-
}
|
|
62527
|
-
if (!(c = x.c)) return null;
|
|
62528
|
-
n = ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE;
|
|
62529
|
-
if (v = c[v]) for (; v % 10 == 0; v /= 10, n--) ;
|
|
62530
|
-
if (n < 0) n = 0;
|
|
62531
|
-
return n;
|
|
62532
|
-
};
|
|
62533
|
-
P.dividedBy = P.div = function(y, b) {
|
|
62534
|
-
return div(this, new BigNumber3(y, b), DECIMAL_PLACES, ROUNDING_MODE);
|
|
62535
|
-
};
|
|
62536
|
-
P.dividedToIntegerBy = P.idiv = function(y, b) {
|
|
62537
|
-
return div(this, new BigNumber3(y, b), 0, 1);
|
|
62538
|
-
};
|
|
62539
|
-
P.exponentiatedBy = P.pow = function(n, m) {
|
|
62540
|
-
var half, isModExp, i, k, more, nIsBig, nIsNeg, nIsOdd, y, x = this;
|
|
62541
|
-
n = new BigNumber3(n);
|
|
62542
|
-
if (n.c && !n.isInteger()) {
|
|
62543
|
-
throw Error(bignumberError + "Exponent not an integer: " + valueOf(n));
|
|
62544
|
-
}
|
|
62545
|
-
if (m != null) m = new BigNumber3(m);
|
|
62546
|
-
nIsBig = n.e > 14;
|
|
62547
|
-
if (!x.c || !x.c[0] || x.c[0] == 1 && !x.e && x.c.length == 1 || !n.c || !n.c[0]) {
|
|
62548
|
-
y = new BigNumber3(Math.pow(+valueOf(x), nIsBig ? 2 - isOdd(n) : +valueOf(n)));
|
|
62549
|
-
return m ? y.mod(m) : y;
|
|
62550
|
-
}
|
|
62551
|
-
nIsNeg = n.s < 0;
|
|
62552
|
-
if (m) {
|
|
62553
|
-
if (m.c ? !m.c[0] : !m.s) return new BigNumber3(NaN);
|
|
62554
|
-
isModExp = !nIsNeg && x.isInteger() && m.isInteger();
|
|
62555
|
-
if (isModExp) x = x.mod(m);
|
|
62556
|
-
} else if (n.e > 9 && (x.e > 0 || x.e < -1 || (x.e == 0 ? x.c[0] > 1 || nIsBig && x.c[1] >= 24e7 : x.c[0] < 8e13 || nIsBig && x.c[0] <= 9999975e7))) {
|
|
62557
|
-
k = x.s < 0 && isOdd(n) ? -0 : 0;
|
|
62558
|
-
if (x.e > -1) k = 1 / k;
|
|
62559
|
-
return new BigNumber3(nIsNeg ? 1 / k : k);
|
|
62560
|
-
} else if (POW_PRECISION) {
|
|
62561
|
-
k = mathceil(POW_PRECISION / LOG_BASE + 2);
|
|
62562
|
-
}
|
|
62563
|
-
if (nIsBig) {
|
|
62564
|
-
half = new BigNumber3(0.5);
|
|
62565
|
-
if (nIsNeg) n.s = 1;
|
|
62566
|
-
nIsOdd = isOdd(n);
|
|
62567
|
-
} else {
|
|
62568
|
-
i = Math.abs(+valueOf(n));
|
|
62569
|
-
nIsOdd = i % 2;
|
|
62570
|
-
}
|
|
62571
|
-
y = new BigNumber3(ONE);
|
|
62572
|
-
for (; ; ) {
|
|
62573
|
-
if (nIsOdd) {
|
|
62574
|
-
y = y.times(x);
|
|
62575
|
-
if (!y.c) break;
|
|
62576
|
-
if (k) {
|
|
62577
|
-
if (y.c.length > k) y.c.length = k;
|
|
62578
|
-
} else if (isModExp) {
|
|
62579
|
-
y = y.mod(m);
|
|
62580
|
-
}
|
|
62581
|
-
}
|
|
62582
|
-
if (i) {
|
|
62583
|
-
i = mathfloor(i / 2);
|
|
62584
|
-
if (i === 0) break;
|
|
62585
|
-
nIsOdd = i % 2;
|
|
62586
|
-
} else {
|
|
62587
|
-
n = n.times(half);
|
|
62588
|
-
round(n, n.e + 1, 1);
|
|
62589
|
-
if (n.e > 14) {
|
|
62590
|
-
nIsOdd = isOdd(n);
|
|
62591
|
-
} else {
|
|
62592
|
-
i = +valueOf(n);
|
|
62593
|
-
if (i === 0) break;
|
|
62594
|
-
nIsOdd = i % 2;
|
|
62595
|
-
}
|
|
62596
|
-
}
|
|
62597
|
-
x = x.times(x);
|
|
62598
|
-
if (k) {
|
|
62599
|
-
if (x.c && x.c.length > k) x.c.length = k;
|
|
62600
|
-
} else if (isModExp) {
|
|
62601
|
-
x = x.mod(m);
|
|
62602
|
-
}
|
|
62603
|
-
}
|
|
62604
|
-
if (isModExp) return y;
|
|
62605
|
-
if (nIsNeg) y = ONE.div(y);
|
|
62606
|
-
return m ? y.mod(m) : k ? round(y, POW_PRECISION, ROUNDING_MODE, more) : y;
|
|
62607
|
-
};
|
|
62608
|
-
P.integerValue = function(rm) {
|
|
62609
|
-
var n = new BigNumber3(this);
|
|
62610
|
-
if (rm == null) rm = ROUNDING_MODE;
|
|
62611
|
-
else intCheck(rm, 0, 8);
|
|
62612
|
-
return round(n, n.e + 1, rm);
|
|
62613
|
-
};
|
|
62614
|
-
P.isEqualTo = P.eq = function(y, b) {
|
|
62615
|
-
return compare(this, new BigNumber3(y, b)) === 0;
|
|
62616
|
-
};
|
|
62617
|
-
P.isFinite = function() {
|
|
62618
|
-
return !!this.c;
|
|
62619
|
-
};
|
|
62620
|
-
P.isGreaterThan = P.gt = function(y, b) {
|
|
62621
|
-
return compare(this, new BigNumber3(y, b)) > 0;
|
|
62622
|
-
};
|
|
62623
|
-
P.isGreaterThanOrEqualTo = P.gte = function(y, b) {
|
|
62624
|
-
return (b = compare(this, new BigNumber3(y, b))) === 1 || b === 0;
|
|
62625
|
-
};
|
|
62626
|
-
P.isInteger = function() {
|
|
62627
|
-
return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2;
|
|
62628
|
-
};
|
|
62629
|
-
P.isLessThan = P.lt = function(y, b) {
|
|
62630
|
-
return compare(this, new BigNumber3(y, b)) < 0;
|
|
62631
|
-
};
|
|
62632
|
-
P.isLessThanOrEqualTo = P.lte = function(y, b) {
|
|
62633
|
-
return (b = compare(this, new BigNumber3(y, b))) === -1 || b === 0;
|
|
62634
|
-
};
|
|
62635
|
-
P.isNaN = function() {
|
|
62636
|
-
return !this.s;
|
|
62637
|
-
};
|
|
62638
|
-
P.isNegative = function() {
|
|
62639
|
-
return this.s < 0;
|
|
62640
|
-
};
|
|
62641
|
-
P.isPositive = function() {
|
|
62642
|
-
return this.s > 0;
|
|
62643
|
-
};
|
|
62644
|
-
P.isZero = function() {
|
|
62645
|
-
return !!this.c && this.c[0] == 0;
|
|
62646
|
-
};
|
|
62647
|
-
P.minus = function(y, b) {
|
|
62648
|
-
var i, j, t, xLTy, x = this, a = x.s;
|
|
62649
|
-
y = new BigNumber3(y, b);
|
|
62650
|
-
b = y.s;
|
|
62651
|
-
if (!a || !b) return new BigNumber3(NaN);
|
|
62652
|
-
if (a != b) {
|
|
62653
|
-
y.s = -b;
|
|
62654
|
-
return x.plus(y);
|
|
62655
|
-
}
|
|
62656
|
-
var xe = x.e / LOG_BASE, ye = y.e / LOG_BASE, xc = x.c, yc = y.c;
|
|
62657
|
-
if (!xe || !ye) {
|
|
62658
|
-
if (!xc || !yc) return xc ? (y.s = -b, y) : new BigNumber3(yc ? x : NaN);
|
|
62659
|
-
if (!xc[0] || !yc[0]) {
|
|
62660
|
-
return yc[0] ? (y.s = -b, y) : new BigNumber3(xc[0] ? x : (
|
|
62661
|
-
// IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity
|
|
62662
|
-
ROUNDING_MODE == 3 ? -0 : 0
|
|
62663
|
-
));
|
|
62664
|
-
}
|
|
62665
|
-
}
|
|
62666
|
-
xe = bitFloor(xe);
|
|
62667
|
-
ye = bitFloor(ye);
|
|
62668
|
-
xc = xc.slice();
|
|
62669
|
-
if (a = xe - ye) {
|
|
62670
|
-
if (xLTy = a < 0) {
|
|
62671
|
-
a = -a;
|
|
62672
|
-
t = xc;
|
|
62673
|
-
} else {
|
|
62674
|
-
ye = xe;
|
|
62675
|
-
t = yc;
|
|
62676
|
-
}
|
|
62677
|
-
t.reverse();
|
|
62678
|
-
for (b = a; b--; t.push(0)) ;
|
|
62679
|
-
t.reverse();
|
|
62680
|
-
} else {
|
|
62681
|
-
j = (xLTy = (a = xc.length) < (b = yc.length)) ? a : b;
|
|
62682
|
-
for (a = b = 0; b < j; b++) {
|
|
62683
|
-
if (xc[b] != yc[b]) {
|
|
62684
|
-
xLTy = xc[b] < yc[b];
|
|
62685
|
-
break;
|
|
62686
|
-
}
|
|
62687
|
-
}
|
|
62688
|
-
}
|
|
62689
|
-
if (xLTy) t = xc, xc = yc, yc = t, y.s = -y.s;
|
|
62690
|
-
b = (j = yc.length) - (i = xc.length);
|
|
62691
|
-
if (b > 0) for (; b--; xc[i++] = 0) ;
|
|
62692
|
-
b = BASE - 1;
|
|
62693
|
-
for (; j > a; ) {
|
|
62694
|
-
if (xc[--j] < yc[j]) {
|
|
62695
|
-
for (i = j; i && !xc[--i]; xc[i] = b) ;
|
|
62696
|
-
--xc[i];
|
|
62697
|
-
xc[j] += BASE;
|
|
62698
|
-
}
|
|
62699
|
-
xc[j] -= yc[j];
|
|
62700
|
-
}
|
|
62701
|
-
for (; xc[0] == 0; xc.splice(0, 1), --ye) ;
|
|
62702
|
-
if (!xc[0]) {
|
|
62703
|
-
y.s = ROUNDING_MODE == 3 ? -1 : 1;
|
|
62704
|
-
y.c = [y.e = 0];
|
|
62705
|
-
return y;
|
|
62706
|
-
}
|
|
62707
|
-
return normalise(y, xc, ye);
|
|
62708
|
-
};
|
|
62709
|
-
P.modulo = P.mod = function(y, b) {
|
|
62710
|
-
var q, s, x = this;
|
|
62711
|
-
y = new BigNumber3(y, b);
|
|
62712
|
-
if (!x.c || !y.s || y.c && !y.c[0]) {
|
|
62713
|
-
return new BigNumber3(NaN);
|
|
62714
|
-
} else if (!y.c || x.c && !x.c[0]) {
|
|
62715
|
-
return new BigNumber3(x);
|
|
62716
|
-
}
|
|
62717
|
-
if (MODULO_MODE == 9) {
|
|
62718
|
-
s = y.s;
|
|
62719
|
-
y.s = 1;
|
|
62720
|
-
q = div(x, y, 0, 3);
|
|
62721
|
-
y.s = s;
|
|
62722
|
-
q.s *= s;
|
|
62723
|
-
} else {
|
|
62724
|
-
q = div(x, y, 0, MODULO_MODE);
|
|
62725
|
-
}
|
|
62726
|
-
y = x.minus(q.times(y));
|
|
62727
|
-
if (!y.c[0] && MODULO_MODE == 1) y.s = x.s;
|
|
62728
|
-
return y;
|
|
62729
|
-
};
|
|
62730
|
-
P.multipliedBy = P.times = function(y, b) {
|
|
62731
|
-
var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc, base, sqrtBase, x = this, xc = x.c, yc = (y = new BigNumber3(y, b)).c;
|
|
62732
|
-
if (!xc || !yc || !xc[0] || !yc[0]) {
|
|
62733
|
-
if (!x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) {
|
|
62734
|
-
y.c = y.e = y.s = null;
|
|
62735
|
-
} else {
|
|
62736
|
-
y.s *= x.s;
|
|
62737
|
-
if (!xc || !yc) {
|
|
62738
|
-
y.c = y.e = null;
|
|
62739
|
-
} else {
|
|
62740
|
-
y.c = [0];
|
|
62741
|
-
y.e = 0;
|
|
62742
|
-
}
|
|
62743
|
-
}
|
|
62744
|
-
return y;
|
|
62745
|
-
}
|
|
62746
|
-
e = bitFloor(x.e / LOG_BASE) + bitFloor(y.e / LOG_BASE);
|
|
62747
|
-
y.s *= x.s;
|
|
62748
|
-
xcL = xc.length;
|
|
62749
|
-
ycL = yc.length;
|
|
62750
|
-
if (xcL < ycL) zc = xc, xc = yc, yc = zc, i = xcL, xcL = ycL, ycL = i;
|
|
62751
|
-
for (i = xcL + ycL, zc = []; i--; zc.push(0)) ;
|
|
62752
|
-
base = BASE;
|
|
62753
|
-
sqrtBase = SQRT_BASE;
|
|
62754
|
-
for (i = ycL; --i >= 0; ) {
|
|
62755
|
-
c = 0;
|
|
62756
|
-
ylo = yc[i] % sqrtBase;
|
|
62757
|
-
yhi = yc[i] / sqrtBase | 0;
|
|
62758
|
-
for (k = xcL, j = i + k; j > i; ) {
|
|
62759
|
-
xlo = xc[--k] % sqrtBase;
|
|
62760
|
-
xhi = xc[k] / sqrtBase | 0;
|
|
62761
|
-
m = yhi * xlo + xhi * ylo;
|
|
62762
|
-
xlo = ylo * xlo + m % sqrtBase * sqrtBase + zc[j] + c;
|
|
62763
|
-
c = (xlo / base | 0) + (m / sqrtBase | 0) + yhi * xhi;
|
|
62764
|
-
zc[j--] = xlo % base;
|
|
62765
|
-
}
|
|
62766
|
-
zc[j] = c;
|
|
62767
|
-
}
|
|
62768
|
-
if (c) {
|
|
62769
|
-
++e;
|
|
62770
|
-
} else {
|
|
62771
|
-
zc.splice(0, 1);
|
|
62772
|
-
}
|
|
62773
|
-
return normalise(y, zc, e);
|
|
62774
|
-
};
|
|
62775
|
-
P.negated = function() {
|
|
62776
|
-
var x = new BigNumber3(this);
|
|
62777
|
-
x.s = -x.s || null;
|
|
62778
|
-
return x;
|
|
62779
|
-
};
|
|
62780
|
-
P.plus = function(y, b) {
|
|
62781
|
-
var t, x = this, a = x.s;
|
|
62782
|
-
y = new BigNumber3(y, b);
|
|
62783
|
-
b = y.s;
|
|
62784
|
-
if (!a || !b) return new BigNumber3(NaN);
|
|
62785
|
-
if (a != b) {
|
|
62786
|
-
y.s = -b;
|
|
62787
|
-
return x.minus(y);
|
|
62788
|
-
}
|
|
62789
|
-
var xe = x.e / LOG_BASE, ye = y.e / LOG_BASE, xc = x.c, yc = y.c;
|
|
62790
|
-
if (!xe || !ye) {
|
|
62791
|
-
if (!xc || !yc) return new BigNumber3(a / 0);
|
|
62792
|
-
if (!xc[0] || !yc[0]) return yc[0] ? y : new BigNumber3(xc[0] ? x : a * 0);
|
|
62793
|
-
}
|
|
62794
|
-
xe = bitFloor(xe);
|
|
62795
|
-
ye = bitFloor(ye);
|
|
62796
|
-
xc = xc.slice();
|
|
62797
|
-
if (a = xe - ye) {
|
|
62798
|
-
if (a > 0) {
|
|
62799
|
-
ye = xe;
|
|
62800
|
-
t = yc;
|
|
62801
|
-
} else {
|
|
62802
|
-
a = -a;
|
|
62803
|
-
t = xc;
|
|
62804
|
-
}
|
|
62805
|
-
t.reverse();
|
|
62806
|
-
for (; a--; t.push(0)) ;
|
|
62807
|
-
t.reverse();
|
|
62808
|
-
}
|
|
62809
|
-
a = xc.length;
|
|
62810
|
-
b = yc.length;
|
|
62811
|
-
if (a - b < 0) t = yc, yc = xc, xc = t, b = a;
|
|
62812
|
-
for (a = 0; b; ) {
|
|
62813
|
-
a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0;
|
|
62814
|
-
xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE;
|
|
62815
|
-
}
|
|
62816
|
-
if (a) {
|
|
62817
|
-
xc = [a].concat(xc);
|
|
62818
|
-
++ye;
|
|
62819
|
-
}
|
|
62820
|
-
return normalise(y, xc, ye);
|
|
62821
|
-
};
|
|
62822
|
-
P.precision = P.sd = function(sd, rm) {
|
|
62823
|
-
var c, n, v, x = this;
|
|
62824
|
-
if (sd != null && sd !== !!sd) {
|
|
62825
|
-
intCheck(sd, 1, MAX);
|
|
62826
|
-
if (rm == null) rm = ROUNDING_MODE;
|
|
62827
|
-
else intCheck(rm, 0, 8);
|
|
62828
|
-
return round(new BigNumber3(x), sd, rm);
|
|
62829
|
-
}
|
|
62830
|
-
if (!(c = x.c)) return null;
|
|
62831
|
-
v = c.length - 1;
|
|
62832
|
-
n = v * LOG_BASE + 1;
|
|
62833
|
-
if (v = c[v]) {
|
|
62834
|
-
for (; v % 10 == 0; v /= 10, n--) ;
|
|
62835
|
-
for (v = c[0]; v >= 10; v /= 10, n++) ;
|
|
62836
|
-
}
|
|
62837
|
-
if (sd && x.e + 1 > n) n = x.e + 1;
|
|
62838
|
-
return n;
|
|
62839
|
-
};
|
|
62840
|
-
P.shiftedBy = function(k) {
|
|
62841
|
-
intCheck(k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER);
|
|
62842
|
-
return this.times("1e" + k);
|
|
62843
|
-
};
|
|
62844
|
-
P.squareRoot = P.sqrt = function() {
|
|
62845
|
-
var m, n, r, rep, t, x = this, c = x.c, s = x.s, e = x.e, dp = DECIMAL_PLACES + 4, half = new BigNumber3("0.5");
|
|
62846
|
-
if (s !== 1 || !c || !c[0]) {
|
|
62847
|
-
return new BigNumber3(!s || s < 0 && (!c || c[0]) ? NaN : c ? x : 1 / 0);
|
|
62848
|
-
}
|
|
62849
|
-
s = Math.sqrt(+valueOf(x));
|
|
62850
|
-
if (s == 0 || s == 1 / 0) {
|
|
62851
|
-
n = coeffToString(c);
|
|
62852
|
-
if ((n.length + e) % 2 == 0) n += "0";
|
|
62853
|
-
s = Math.sqrt(+n);
|
|
62854
|
-
e = bitFloor((e + 1) / 2) - (e < 0 || e % 2);
|
|
62855
|
-
if (s == 1 / 0) {
|
|
62856
|
-
n = "1e" + e;
|
|
62857
|
-
} else {
|
|
62858
|
-
n = s.toExponential();
|
|
62859
|
-
n = n.slice(0, n.indexOf("e") + 1) + e;
|
|
62860
|
-
}
|
|
62861
|
-
r = new BigNumber3(n);
|
|
62862
|
-
} else {
|
|
62863
|
-
r = new BigNumber3(s + "");
|
|
62864
|
-
}
|
|
62865
|
-
if (r.c[0]) {
|
|
62866
|
-
e = r.e;
|
|
62867
|
-
s = e + dp;
|
|
62868
|
-
if (s < 3) s = 0;
|
|
62869
|
-
for (; ; ) {
|
|
62870
|
-
t = r;
|
|
62871
|
-
r = half.times(t.plus(div(x, t, dp, 1)));
|
|
62872
|
-
if (coeffToString(t.c).slice(0, s) === (n = coeffToString(r.c)).slice(0, s)) {
|
|
62873
|
-
if (r.e < e) --s;
|
|
62874
|
-
n = n.slice(s - 3, s + 1);
|
|
62875
|
-
if (n == "9999" || !rep && n == "4999") {
|
|
62876
|
-
if (!rep) {
|
|
62877
|
-
round(t, t.e + DECIMAL_PLACES + 2, 0);
|
|
62878
|
-
if (t.times(t).eq(x)) {
|
|
62879
|
-
r = t;
|
|
62880
|
-
break;
|
|
62881
|
-
}
|
|
62882
|
-
}
|
|
62883
|
-
dp += 4;
|
|
62884
|
-
s += 4;
|
|
62885
|
-
rep = 1;
|
|
62886
|
-
} else {
|
|
62887
|
-
if (!+n || !+n.slice(1) && n.charAt(0) == "5") {
|
|
62888
|
-
round(r, r.e + DECIMAL_PLACES + 2, 1);
|
|
62889
|
-
m = !r.times(r).eq(x);
|
|
62890
|
-
}
|
|
62891
|
-
break;
|
|
62892
|
-
}
|
|
62893
|
-
}
|
|
62894
|
-
}
|
|
62895
|
-
}
|
|
62896
|
-
return round(r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m);
|
|
62897
|
-
};
|
|
62898
|
-
P.toExponential = function(dp, rm) {
|
|
62899
|
-
if (dp != null) {
|
|
62900
|
-
intCheck(dp, 0, MAX);
|
|
62901
|
-
dp++;
|
|
62902
|
-
}
|
|
62903
|
-
return format(this, dp, rm, 1);
|
|
62904
|
-
};
|
|
62905
|
-
P.toFixed = function(dp, rm) {
|
|
62906
|
-
if (dp != null) {
|
|
62907
|
-
intCheck(dp, 0, MAX);
|
|
62908
|
-
dp = dp + this.e + 1;
|
|
62909
|
-
}
|
|
62910
|
-
return format(this, dp, rm);
|
|
62911
|
-
};
|
|
62912
|
-
P.toFormat = function(dp, rm, format2) {
|
|
62913
|
-
var str, x = this;
|
|
62914
|
-
if (format2 == null) {
|
|
62915
|
-
if (dp != null && rm && typeof rm == "object") {
|
|
62916
|
-
format2 = rm;
|
|
62917
|
-
rm = null;
|
|
62918
|
-
} else if (dp && typeof dp == "object") {
|
|
62919
|
-
format2 = dp;
|
|
62920
|
-
dp = rm = null;
|
|
62921
|
-
} else {
|
|
62922
|
-
format2 = FORMAT;
|
|
62923
|
-
}
|
|
62924
|
-
} else if (typeof format2 != "object") {
|
|
62925
|
-
throw Error(bignumberError + "Argument not an object: " + format2);
|
|
62926
|
-
}
|
|
62927
|
-
str = x.toFixed(dp, rm);
|
|
62928
|
-
if (x.c) {
|
|
62929
|
-
var i, arr = str.split("."), g1 = +format2.groupSize, g2 = +format2.secondaryGroupSize, groupSeparator = format2.groupSeparator || "", intPart = arr[0], fractionPart = arr[1], isNeg = x.s < 0, intDigits = isNeg ? intPart.slice(1) : intPart, len = intDigits.length;
|
|
62930
|
-
if (g2) i = g1, g1 = g2, g2 = i, len -= i;
|
|
62931
|
-
if (g1 > 0 && len > 0) {
|
|
62932
|
-
i = len % g1 || g1;
|
|
62933
|
-
intPart = intDigits.substr(0, i);
|
|
62934
|
-
for (; i < len; i += g1) intPart += groupSeparator + intDigits.substr(i, g1);
|
|
62935
|
-
if (g2 > 0) intPart += groupSeparator + intDigits.slice(i);
|
|
62936
|
-
if (isNeg) intPart = "-" + intPart;
|
|
62937
|
-
}
|
|
62938
|
-
str = fractionPart ? intPart + (format2.decimalSeparator || "") + ((g2 = +format2.fractionGroupSize) ? fractionPart.replace(
|
|
62939
|
-
new RegExp("\\d{" + g2 + "}\\B", "g"),
|
|
62940
|
-
"$&" + (format2.fractionGroupSeparator || "")
|
|
62941
|
-
) : fractionPart) : intPart;
|
|
62942
|
-
}
|
|
62943
|
-
return (format2.prefix || "") + str + (format2.suffix || "");
|
|
62944
|
-
};
|
|
62945
|
-
P.toFraction = function(md) {
|
|
62946
|
-
var d, d0, d1, d2, e, exp, n, n0, n1, q, r, s, x = this, xc = x.c;
|
|
62947
|
-
if (md != null) {
|
|
62948
|
-
n = new BigNumber3(md);
|
|
62949
|
-
if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) {
|
|
62950
|
-
throw Error(bignumberError + "Argument " + (n.isInteger() ? "out of range: " : "not an integer: ") + valueOf(n));
|
|
62951
|
-
}
|
|
62952
|
-
}
|
|
62953
|
-
if (!xc) return new BigNumber3(x);
|
|
62954
|
-
d = new BigNumber3(ONE);
|
|
62955
|
-
n1 = d0 = new BigNumber3(ONE);
|
|
62956
|
-
d1 = n0 = new BigNumber3(ONE);
|
|
62957
|
-
s = coeffToString(xc);
|
|
62958
|
-
e = d.e = s.length - x.e - 1;
|
|
62959
|
-
d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp];
|
|
62960
|
-
md = !md || n.comparedTo(d) > 0 ? e > 0 ? d : n1 : n;
|
|
62961
|
-
exp = MAX_EXP;
|
|
62962
|
-
MAX_EXP = 1 / 0;
|
|
62963
|
-
n = new BigNumber3(s);
|
|
62964
|
-
n0.c[0] = 0;
|
|
62965
|
-
for (; ; ) {
|
|
62966
|
-
q = div(n, d, 0, 1);
|
|
62967
|
-
d2 = d0.plus(q.times(d1));
|
|
62968
|
-
if (d2.comparedTo(md) == 1) break;
|
|
62969
|
-
d0 = d1;
|
|
62970
|
-
d1 = d2;
|
|
62971
|
-
n1 = n0.plus(q.times(d2 = n1));
|
|
62972
|
-
n0 = d2;
|
|
62973
|
-
d = n.minus(q.times(d2 = d));
|
|
62974
|
-
n = d2;
|
|
62975
|
-
}
|
|
62976
|
-
d2 = div(md.minus(d0), d1, 0, 1);
|
|
62977
|
-
n0 = n0.plus(d2.times(n1));
|
|
62978
|
-
d0 = d0.plus(d2.times(d1));
|
|
62979
|
-
n0.s = n1.s = x.s;
|
|
62980
|
-
e = e * 2;
|
|
62981
|
-
r = div(n1, d1, e, ROUNDING_MODE).minus(x).abs().comparedTo(
|
|
62982
|
-
div(n0, d0, e, ROUNDING_MODE).minus(x).abs()
|
|
62983
|
-
) < 1 ? [n1, d1] : [n0, d0];
|
|
62984
|
-
MAX_EXP = exp;
|
|
62985
|
-
return r;
|
|
62986
|
-
};
|
|
62987
|
-
P.toNumber = function() {
|
|
62988
|
-
return +valueOf(this);
|
|
62989
|
-
};
|
|
62990
|
-
P.toPrecision = function(sd, rm) {
|
|
62991
|
-
if (sd != null) intCheck(sd, 1, MAX);
|
|
62992
|
-
return format(this, sd, rm, 2);
|
|
61556
|
+
}
|
|
61557
|
+
done();
|
|
62993
61558
|
};
|
|
62994
|
-
|
|
62995
|
-
|
|
62996
|
-
|
|
62997
|
-
|
|
62998
|
-
|
|
62999
|
-
|
|
63000
|
-
|
|
63001
|
-
|
|
61559
|
+
let fd;
|
|
61560
|
+
try {
|
|
61561
|
+
fd = fs8.openSync(entry.absolute, getFlag(entry.size), mode);
|
|
61562
|
+
} catch (er) {
|
|
61563
|
+
return oner(er);
|
|
61564
|
+
}
|
|
61565
|
+
const tx = this.transform ? this.transform(entry) || entry : entry;
|
|
61566
|
+
if (tx !== entry) {
|
|
61567
|
+
tx.on("error", (er) => this[ONERROR](er, entry));
|
|
61568
|
+
entry.pipe(tx);
|
|
61569
|
+
}
|
|
61570
|
+
tx.on("data", (chunk) => {
|
|
61571
|
+
try {
|
|
61572
|
+
fs8.writeSync(fd, chunk, 0, chunk.length);
|
|
61573
|
+
} catch (er) {
|
|
61574
|
+
oner(er);
|
|
61575
|
+
}
|
|
61576
|
+
});
|
|
61577
|
+
tx.on("end", (_) => {
|
|
61578
|
+
let er = null;
|
|
61579
|
+
if (entry.mtime && !this.noMtime) {
|
|
61580
|
+
const atime = entry.atime || /* @__PURE__ */ new Date();
|
|
61581
|
+
const mtime = entry.mtime;
|
|
61582
|
+
try {
|
|
61583
|
+
fs8.futimesSync(fd, atime, mtime);
|
|
61584
|
+
} catch (futimeser) {
|
|
61585
|
+
try {
|
|
61586
|
+
fs8.utimesSync(entry.absolute, atime, mtime);
|
|
61587
|
+
} catch (utimeser) {
|
|
61588
|
+
er = futimeser;
|
|
61589
|
+
}
|
|
63002
61590
|
}
|
|
63003
|
-
}
|
|
63004
|
-
|
|
63005
|
-
|
|
63006
|
-
|
|
63007
|
-
|
|
63008
|
-
|
|
63009
|
-
}
|
|
63010
|
-
|
|
63011
|
-
|
|
61591
|
+
}
|
|
61592
|
+
if (this[DOCHOWN](entry)) {
|
|
61593
|
+
const uid = this[UID](entry);
|
|
61594
|
+
const gid = this[GID](entry);
|
|
61595
|
+
try {
|
|
61596
|
+
fs8.fchownSync(fd, uid, gid);
|
|
61597
|
+
} catch (fchowner) {
|
|
61598
|
+
try {
|
|
61599
|
+
fs8.chownSync(entry.absolute, uid, gid);
|
|
61600
|
+
} catch (chowner) {
|
|
61601
|
+
er = er || fchowner;
|
|
61602
|
+
}
|
|
63012
61603
|
}
|
|
63013
|
-
if (s < 0 && n.c[0]) str = "-" + str;
|
|
63014
61604
|
}
|
|
63015
|
-
|
|
63016
|
-
};
|
|
63017
|
-
P.valueOf = P.toJSON = function() {
|
|
63018
|
-
return valueOf(this);
|
|
63019
|
-
};
|
|
63020
|
-
P._isBigNumber = true;
|
|
63021
|
-
if (configObject != null) BigNumber3.set(configObject);
|
|
63022
|
-
return BigNumber3;
|
|
63023
|
-
}
|
|
63024
|
-
function bitFloor(n) {
|
|
63025
|
-
var i = n | 0;
|
|
63026
|
-
return n > 0 || n === i ? i : i - 1;
|
|
61605
|
+
oner(er);
|
|
61606
|
+
});
|
|
63027
61607
|
}
|
|
63028
|
-
|
|
63029
|
-
|
|
63030
|
-
|
|
63031
|
-
|
|
63032
|
-
|
|
63033
|
-
|
|
63034
|
-
|
|
61608
|
+
[DIRECTORY](entry, done) {
|
|
61609
|
+
const mode = entry.mode & 4095 || this.dmode;
|
|
61610
|
+
const er = this[MKDIR](entry.absolute, mode);
|
|
61611
|
+
if (er) {
|
|
61612
|
+
this[ONERROR](er, entry);
|
|
61613
|
+
done();
|
|
61614
|
+
return;
|
|
63035
61615
|
}
|
|
63036
|
-
|
|
63037
|
-
|
|
63038
|
-
|
|
63039
|
-
|
|
63040
|
-
|
|
63041
|
-
|
|
63042
|
-
|
|
63043
|
-
|
|
63044
|
-
|
|
63045
|
-
|
|
63046
|
-
|
|
63047
|
-
|
|
63048
|
-
|
|
63049
|
-
|
|
63050
|
-
j = (k = xc.length) < (l = yc.length) ? k : l;
|
|
63051
|
-
for (i = 0; i < j; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1;
|
|
63052
|
-
return k == l ? 0 : k > l ^ a ? 1 : -1;
|
|
61616
|
+
if (entry.mtime && !this.noMtime) {
|
|
61617
|
+
try {
|
|
61618
|
+
fs8.utimesSync(entry.absolute, entry.atime || /* @__PURE__ */ new Date(), entry.mtime);
|
|
61619
|
+
} catch (er2) {
|
|
61620
|
+
}
|
|
61621
|
+
}
|
|
61622
|
+
if (this[DOCHOWN](entry)) {
|
|
61623
|
+
try {
|
|
61624
|
+
fs8.chownSync(entry.absolute, this[UID](entry), this[GID](entry));
|
|
61625
|
+
} catch (er2) {
|
|
61626
|
+
}
|
|
61627
|
+
}
|
|
61628
|
+
done();
|
|
61629
|
+
entry.resume();
|
|
63053
61630
|
}
|
|
63054
|
-
|
|
63055
|
-
|
|
63056
|
-
|
|
61631
|
+
[MKDIR](dir, mode) {
|
|
61632
|
+
try {
|
|
61633
|
+
return mkdir.sync(normPath(dir), {
|
|
61634
|
+
uid: this.uid,
|
|
61635
|
+
gid: this.gid,
|
|
61636
|
+
processUid: this.processUid,
|
|
61637
|
+
processGid: this.processGid,
|
|
61638
|
+
umask: this.processUmask,
|
|
61639
|
+
preserve: this.preservePaths,
|
|
61640
|
+
unlink: this.unlink,
|
|
61641
|
+
cache: this.dirCache,
|
|
61642
|
+
cwd: this.cwd,
|
|
61643
|
+
mode
|
|
61644
|
+
});
|
|
61645
|
+
} catch (er) {
|
|
61646
|
+
return er;
|
|
63057
61647
|
}
|
|
63058
61648
|
}
|
|
63059
|
-
|
|
63060
|
-
|
|
63061
|
-
|
|
61649
|
+
[LINK](entry, linkpath, link, done) {
|
|
61650
|
+
try {
|
|
61651
|
+
fs8[link + "Sync"](linkpath, entry.absolute);
|
|
61652
|
+
done();
|
|
61653
|
+
entry.resume();
|
|
61654
|
+
} catch (er) {
|
|
61655
|
+
return this[ONERROR](er, entry);
|
|
61656
|
+
}
|
|
63062
61657
|
}
|
|
63063
|
-
|
|
63064
|
-
|
|
61658
|
+
};
|
|
61659
|
+
Unpack.Sync = UnpackSync;
|
|
61660
|
+
module.exports = Unpack;
|
|
61661
|
+
}
|
|
61662
|
+
});
|
|
61663
|
+
|
|
61664
|
+
// node_modules/tar/lib/extract.js
|
|
61665
|
+
var require_extract = __commonJS({
|
|
61666
|
+
"node_modules/tar/lib/extract.js"(exports, module) {
|
|
61667
|
+
"use strict";
|
|
61668
|
+
var hlo = require_high_level_opt();
|
|
61669
|
+
var Unpack = require_unpack();
|
|
61670
|
+
var fs8 = __require("fs");
|
|
61671
|
+
var fsm = require_fs_minipass();
|
|
61672
|
+
var path7 = __require("path");
|
|
61673
|
+
var stripSlash = require_strip_trailing_slashes();
|
|
61674
|
+
module.exports = (opt_, files, cb) => {
|
|
61675
|
+
if (typeof opt_ === "function") {
|
|
61676
|
+
cb = opt_, files = null, opt_ = {};
|
|
61677
|
+
} else if (Array.isArray(opt_)) {
|
|
61678
|
+
files = opt_, opt_ = {};
|
|
63065
61679
|
}
|
|
63066
|
-
|
|
63067
|
-
|
|
63068
|
-
if (e < 0) {
|
|
63069
|
-
for (zs = z3 + "."; ++e; zs += z3) ;
|
|
63070
|
-
str = zs + str;
|
|
63071
|
-
} else {
|
|
63072
|
-
len = str.length;
|
|
63073
|
-
if (++e > len) {
|
|
63074
|
-
for (zs = z3, e -= len; --e; zs += z3) ;
|
|
63075
|
-
str += zs;
|
|
63076
|
-
} else if (e < len) {
|
|
63077
|
-
str = str.slice(0, e) + "." + str.slice(e);
|
|
63078
|
-
}
|
|
63079
|
-
}
|
|
63080
|
-
return str;
|
|
61680
|
+
if (typeof files === "function") {
|
|
61681
|
+
cb = files, files = null;
|
|
63081
61682
|
}
|
|
63082
|
-
|
|
63083
|
-
|
|
63084
|
-
if (typeof define == "function" && define.amd) {
|
|
63085
|
-
define(function() {
|
|
63086
|
-
return BigNumber2;
|
|
63087
|
-
});
|
|
63088
|
-
} else if (typeof module != "undefined" && module.exports) {
|
|
63089
|
-
module.exports = BigNumber2;
|
|
61683
|
+
if (!files) {
|
|
61684
|
+
files = [];
|
|
63090
61685
|
} else {
|
|
63091
|
-
|
|
63092
|
-
globalObject = typeof self != "undefined" && self ? self : window;
|
|
63093
|
-
}
|
|
63094
|
-
globalObject.BigNumber = BigNumber2;
|
|
61686
|
+
files = Array.from(files);
|
|
63095
61687
|
}
|
|
63096
|
-
|
|
61688
|
+
const opt = hlo(opt_);
|
|
61689
|
+
if (opt.sync && typeof cb === "function") {
|
|
61690
|
+
throw new TypeError("callback not supported for sync tar functions");
|
|
61691
|
+
}
|
|
61692
|
+
if (!opt.file && typeof cb === "function") {
|
|
61693
|
+
throw new TypeError("callback only supported with file option");
|
|
61694
|
+
}
|
|
61695
|
+
if (files.length) {
|
|
61696
|
+
filesFilter(opt, files);
|
|
61697
|
+
}
|
|
61698
|
+
return opt.file && opt.sync ? extractFileSync(opt) : opt.file ? extractFile(opt, cb) : opt.sync ? extractSync(opt) : extract(opt);
|
|
61699
|
+
};
|
|
61700
|
+
var filesFilter = (opt, files) => {
|
|
61701
|
+
const map2 = new Map(files.map((f) => [stripSlash(f), true]));
|
|
61702
|
+
const filter = opt.filter;
|
|
61703
|
+
const mapHas = (file2, r) => {
|
|
61704
|
+
const root = r || path7.parse(file2).root || ".";
|
|
61705
|
+
const ret = file2 === root ? false : map2.has(file2) ? map2.get(file2) : mapHas(path7.dirname(file2), root);
|
|
61706
|
+
map2.set(file2, ret);
|
|
61707
|
+
return ret;
|
|
61708
|
+
};
|
|
61709
|
+
opt.filter = filter ? (file2, entry) => filter(file2, entry) && mapHas(stripSlash(file2)) : (file2) => mapHas(stripSlash(file2));
|
|
61710
|
+
};
|
|
61711
|
+
var extractFileSync = (opt) => {
|
|
61712
|
+
const u = new Unpack.Sync(opt);
|
|
61713
|
+
const file2 = opt.file;
|
|
61714
|
+
const stat = fs8.statSync(file2);
|
|
61715
|
+
const readSize = opt.maxReadSize || 16 * 1024 * 1024;
|
|
61716
|
+
const stream = new fsm.ReadStreamSync(file2, {
|
|
61717
|
+
readSize,
|
|
61718
|
+
size: stat.size
|
|
61719
|
+
});
|
|
61720
|
+
stream.pipe(u);
|
|
61721
|
+
};
|
|
61722
|
+
var extractFile = (opt, cb) => {
|
|
61723
|
+
const u = new Unpack(opt);
|
|
61724
|
+
const readSize = opt.maxReadSize || 16 * 1024 * 1024;
|
|
61725
|
+
const file2 = opt.file;
|
|
61726
|
+
const p = new Promise((resolve3, reject) => {
|
|
61727
|
+
u.on("error", reject);
|
|
61728
|
+
u.on("close", resolve3);
|
|
61729
|
+
fs8.stat(file2, (er, stat) => {
|
|
61730
|
+
if (er) {
|
|
61731
|
+
reject(er);
|
|
61732
|
+
} else {
|
|
61733
|
+
const stream = new fsm.ReadStream(file2, {
|
|
61734
|
+
readSize,
|
|
61735
|
+
size: stat.size
|
|
61736
|
+
});
|
|
61737
|
+
stream.on("error", reject);
|
|
61738
|
+
stream.pipe(u);
|
|
61739
|
+
}
|
|
61740
|
+
});
|
|
61741
|
+
});
|
|
61742
|
+
return cb ? p.then(cb, cb) : p;
|
|
61743
|
+
};
|
|
61744
|
+
var extractSync = (opt) => new Unpack.Sync(opt);
|
|
61745
|
+
var extract = (opt) => new Unpack(opt);
|
|
61746
|
+
}
|
|
61747
|
+
});
|
|
61748
|
+
|
|
61749
|
+
// node_modules/tar/index.js
|
|
61750
|
+
var require_tar = __commonJS({
|
|
61751
|
+
"node_modules/tar/index.js"(exports) {
|
|
61752
|
+
"use strict";
|
|
61753
|
+
exports.c = exports.create = require_create();
|
|
61754
|
+
exports.r = exports.replace = require_replace();
|
|
61755
|
+
exports.t = exports.list = require_list2();
|
|
61756
|
+
exports.u = exports.update = require_update();
|
|
61757
|
+
exports.x = exports.extract = require_extract();
|
|
61758
|
+
exports.Pack = require_pack();
|
|
61759
|
+
exports.Unpack = require_unpack();
|
|
61760
|
+
exports.Parse = require_parse3();
|
|
61761
|
+
exports.ReadEntry = require_read_entry();
|
|
61762
|
+
exports.WriteEntry = require_write_entry();
|
|
61763
|
+
exports.Header = require_header();
|
|
61764
|
+
exports.Pax = require_pax();
|
|
61765
|
+
exports.types = require_types2();
|
|
63097
61766
|
}
|
|
63098
61767
|
});
|
|
63099
61768
|
|
|
@@ -70688,7 +69357,7 @@ var id_default = ID;
|
|
|
70688
69357
|
// lib/constants.ts
|
|
70689
69358
|
var SDK_TITLE = "Appwrite";
|
|
70690
69359
|
var SDK_TITLE_LOWER = "appwrite";
|
|
70691
|
-
var SDK_VERSION = "13.
|
|
69360
|
+
var SDK_VERSION = "13.6.0";
|
|
70692
69361
|
var SDK_LOGO = "\n _ _ _ ___ __ _____\n /_\\ _ __ _ ____ ___ __(_) |_ ___ / __\\ / / \\_ \\\n //_\\\\| '_ \\| '_ \\ \\ /\\ / / '__| | __/ _ \\ / / / / / /\\/\n / _ \\ |_) | |_) \\ V V /| | | | || __/ / /___/ /___/\\/ /_\n \\_/ \\_/ .__/| .__/ \\_/\\_/ |_| |_|\\__\\___| \\____/\\____/\\____/\n |_| |_|\n\n";
|
|
70693
69362
|
var EXECUTABLE_NAME = "appwrite";
|
|
70694
69363
|
var NPM_PACKAGE_NAME = "appwrite-cli";
|
|
@@ -84931,6 +83600,14 @@ function isCloud() {
|
|
|
84931
83600
|
const hostname3 = new URL(endpoint).hostname;
|
|
84932
83601
|
return hostname3.endsWith("appwrite.io");
|
|
84933
83602
|
}
|
|
83603
|
+
function arrayEqualsUnordered(left, right) {
|
|
83604
|
+
const a = Array.isArray(left) ? [...left].map((item) => String(item)).sort() : [];
|
|
83605
|
+
const b = Array.isArray(right) ? [...right].map((item) => String(item)).sort() : [];
|
|
83606
|
+
if (a.length !== b.length) {
|
|
83607
|
+
return false;
|
|
83608
|
+
}
|
|
83609
|
+
return a.every((value, index) => value === b[index]);
|
|
83610
|
+
}
|
|
84934
83611
|
function filterBySchema(data, schema) {
|
|
84935
83612
|
const allowedKeys = Object.keys(schema.shape);
|
|
84936
83613
|
const result = {};
|
|
@@ -84948,6 +83625,8 @@ var JSONbigParser = (0, import_json_bigint.default)({ storeAsString: false });
|
|
|
84948
83625
|
var JSONbigSerializer = (0, import_json_bigint.default)({ useNativeBigInt: true });
|
|
84949
83626
|
var MAX_SAFE = BigInt(Number.MAX_SAFE_INTEGER);
|
|
84950
83627
|
var MIN_SAFE = BigInt(Number.MIN_SAFE_INTEGER);
|
|
83628
|
+
var MAX_INT64 = BigInt("9223372036854775807");
|
|
83629
|
+
var MIN_INT64 = BigInt("-9223372036854775808");
|
|
84951
83630
|
function isBigNumber(value) {
|
|
84952
83631
|
return value !== null && typeof value === "object" && value._isBigNumber === true && typeof value.isInteger === "function" && typeof value.toFixed === "function" && typeof value.toNumber === "function";
|
|
84953
83632
|
}
|
|
@@ -84959,7 +83638,10 @@ function reviver(_key, value) {
|
|
|
84959
83638
|
if (bi >= MIN_SAFE && bi <= MAX_SAFE) {
|
|
84960
83639
|
return Number(str);
|
|
84961
83640
|
}
|
|
84962
|
-
|
|
83641
|
+
if (bi >= MIN_INT64 && bi <= MAX_INT64) {
|
|
83642
|
+
return bi;
|
|
83643
|
+
}
|
|
83644
|
+
return value.toNumber();
|
|
84963
83645
|
}
|
|
84964
83646
|
return value.toNumber();
|
|
84965
83647
|
}
|
|
@@ -86069,7 +84751,6 @@ import path from "path";
|
|
|
86069
84751
|
|
|
86070
84752
|
// node_modules/@appwrite.io/console/dist/esm/sdk.js
|
|
86071
84753
|
var import_json_bigint2 = __toESM(require_json_bigint(), 1);
|
|
86072
|
-
var import_bignumber = __toESM(require_bignumber2(), 1);
|
|
86073
84754
|
function __awaiter(thisArg, _arguments, P, generator) {
|
|
86074
84755
|
function adopt(value) {
|
|
86075
84756
|
return value instanceof P ? value : new P(function(resolve3) {
|
|
@@ -86159,6 +84840,8 @@ Query.cursorBefore = (documentId) => new Query("cursorBefore", void 0, documentI
|
|
|
86159
84840
|
Query.limit = (limit) => new Query("limit", void 0, limit).toString();
|
|
86160
84841
|
Query.offset = (offset) => new Query("offset", void 0, offset).toString();
|
|
86161
84842
|
Query.contains = (attribute, value) => new Query("contains", attribute, value).toString();
|
|
84843
|
+
Query.containsAny = (attribute, value) => new Query("containsAny", attribute, value).toString();
|
|
84844
|
+
Query.containsAll = (attribute, value) => new Query("containsAll", attribute, value).toString();
|
|
86162
84845
|
Query.notContains = (attribute, value) => new Query("notContains", attribute, value).toString();
|
|
86163
84846
|
Query.notSearch = (attribute, value) => new Query("notSearch", attribute, value).toString();
|
|
86164
84847
|
Query.notBetween = (attribute, start, end) => new Query("notBetween", attribute, [start, end]).toString();
|
|
@@ -86189,15 +84872,23 @@ var JSONbigParser2 = (0, import_json_bigint2.default)({ storeAsString: false });
|
|
|
86189
84872
|
var JSONbigSerializer2 = (0, import_json_bigint2.default)({ useNativeBigInt: true });
|
|
86190
84873
|
var MAX_SAFE2 = BigInt(Number.MAX_SAFE_INTEGER);
|
|
86191
84874
|
var MIN_SAFE2 = BigInt(Number.MIN_SAFE_INTEGER);
|
|
84875
|
+
var MAX_INT642 = BigInt("9223372036854775807");
|
|
84876
|
+
var MIN_INT642 = BigInt("-9223372036854775808");
|
|
84877
|
+
function isBigNumber2(value) {
|
|
84878
|
+
return value !== null && typeof value === "object" && value._isBigNumber === true && typeof value.isInteger === "function" && typeof value.toFixed === "function" && typeof value.toNumber === "function";
|
|
84879
|
+
}
|
|
86192
84880
|
function reviver2(_key, value) {
|
|
86193
|
-
if (
|
|
84881
|
+
if (isBigNumber2(value)) {
|
|
86194
84882
|
if (value.isInteger()) {
|
|
86195
84883
|
const str = value.toFixed();
|
|
86196
84884
|
const bi = BigInt(str);
|
|
86197
84885
|
if (bi >= MIN_SAFE2 && bi <= MAX_SAFE2) {
|
|
86198
84886
|
return Number(str);
|
|
86199
84887
|
}
|
|
86200
|
-
|
|
84888
|
+
if (bi >= MIN_INT642 && bi <= MAX_INT642) {
|
|
84889
|
+
return bi;
|
|
84890
|
+
}
|
|
84891
|
+
return value.toNumber();
|
|
86201
84892
|
}
|
|
86202
84893
|
return value.toNumber();
|
|
86203
84894
|
}
|
|
@@ -86244,7 +84935,7 @@ var Client = class _Client {
|
|
|
86244
84935
|
"x-sdk-name": "Console",
|
|
86245
84936
|
"x-sdk-platform": "console",
|
|
86246
84937
|
"x-sdk-language": "web",
|
|
86247
|
-
"x-sdk-version": "
|
|
84938
|
+
"x-sdk-version": "3.1.0",
|
|
86248
84939
|
"X-Appwrite-Response-Format": "1.8.0"
|
|
86249
84940
|
};
|
|
86250
84941
|
this.realtime = {
|
|
@@ -95322,21 +94013,26 @@ var Organizations = class {
|
|
|
95322
94013
|
const apiHeaders = {};
|
|
95323
94014
|
return this.client.call("get", uri, apiHeaders, payload);
|
|
95324
94015
|
}
|
|
95325
|
-
getScopes(paramsOrFirst) {
|
|
94016
|
+
getScopes(paramsOrFirst, ...rest) {
|
|
95326
94017
|
let params;
|
|
95327
94018
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
95328
94019
|
params = paramsOrFirst || {};
|
|
95329
94020
|
} else {
|
|
95330
94021
|
params = {
|
|
95331
|
-
organizationId: paramsOrFirst
|
|
94022
|
+
organizationId: paramsOrFirst,
|
|
94023
|
+
projectId: rest[0]
|
|
95332
94024
|
};
|
|
95333
94025
|
}
|
|
95334
94026
|
const organizationId = params.organizationId;
|
|
94027
|
+
const projectId = params.projectId;
|
|
95335
94028
|
if (typeof organizationId === "undefined") {
|
|
95336
94029
|
throw new AppwriteException('Missing required parameter: "organizationId"');
|
|
95337
94030
|
}
|
|
95338
94031
|
const apiPath = "/organizations/{organizationId}/roles".replace("{organizationId}", organizationId);
|
|
95339
94032
|
const payload = {};
|
|
94033
|
+
if (typeof projectId !== "undefined") {
|
|
94034
|
+
payload["projectId"] = projectId;
|
|
94035
|
+
}
|
|
95340
94036
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
95341
94037
|
const apiHeaders = {};
|
|
95342
94038
|
return this.client.call("get", uri, apiHeaders, payload);
|
|
@@ -96743,6 +95439,114 @@ var Projects = class {
|
|
|
96743
95439
|
};
|
|
96744
95440
|
return this.client.call("delete", uri, apiHeaders, payload);
|
|
96745
95441
|
}
|
|
95442
|
+
listSchedules(paramsOrFirst, ...rest) {
|
|
95443
|
+
let params;
|
|
95444
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
95445
|
+
params = paramsOrFirst || {};
|
|
95446
|
+
} else {
|
|
95447
|
+
params = {
|
|
95448
|
+
projectId: paramsOrFirst,
|
|
95449
|
+
queries: rest[0],
|
|
95450
|
+
total: rest[1]
|
|
95451
|
+
};
|
|
95452
|
+
}
|
|
95453
|
+
const projectId = params.projectId;
|
|
95454
|
+
const queries = params.queries;
|
|
95455
|
+
const total = params.total;
|
|
95456
|
+
if (typeof projectId === "undefined") {
|
|
95457
|
+
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
95458
|
+
}
|
|
95459
|
+
const apiPath = "/projects/{projectId}/schedules".replace("{projectId}", projectId);
|
|
95460
|
+
const payload = {};
|
|
95461
|
+
if (typeof queries !== "undefined") {
|
|
95462
|
+
payload["queries"] = queries;
|
|
95463
|
+
}
|
|
95464
|
+
if (typeof total !== "undefined") {
|
|
95465
|
+
payload["total"] = total;
|
|
95466
|
+
}
|
|
95467
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
95468
|
+
const apiHeaders = {};
|
|
95469
|
+
return this.client.call("get", uri, apiHeaders, payload);
|
|
95470
|
+
}
|
|
95471
|
+
createSchedule(paramsOrFirst, ...rest) {
|
|
95472
|
+
let params;
|
|
95473
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
95474
|
+
params = paramsOrFirst || {};
|
|
95475
|
+
} else {
|
|
95476
|
+
params = {
|
|
95477
|
+
projectId: paramsOrFirst,
|
|
95478
|
+
resourceType: rest[0],
|
|
95479
|
+
resourceId: rest[1],
|
|
95480
|
+
schedule: rest[2],
|
|
95481
|
+
active: rest[3],
|
|
95482
|
+
data: rest[4]
|
|
95483
|
+
};
|
|
95484
|
+
}
|
|
95485
|
+
const projectId = params.projectId;
|
|
95486
|
+
const resourceType = params.resourceType;
|
|
95487
|
+
const resourceId = params.resourceId;
|
|
95488
|
+
const schedule = params.schedule;
|
|
95489
|
+
const active = params.active;
|
|
95490
|
+
const data = params.data;
|
|
95491
|
+
if (typeof projectId === "undefined") {
|
|
95492
|
+
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
95493
|
+
}
|
|
95494
|
+
if (typeof resourceType === "undefined") {
|
|
95495
|
+
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
95496
|
+
}
|
|
95497
|
+
if (typeof resourceId === "undefined") {
|
|
95498
|
+
throw new AppwriteException('Missing required parameter: "resourceId"');
|
|
95499
|
+
}
|
|
95500
|
+
if (typeof schedule === "undefined") {
|
|
95501
|
+
throw new AppwriteException('Missing required parameter: "schedule"');
|
|
95502
|
+
}
|
|
95503
|
+
const apiPath = "/projects/{projectId}/schedules".replace("{projectId}", projectId);
|
|
95504
|
+
const payload = {};
|
|
95505
|
+
if (typeof resourceType !== "undefined") {
|
|
95506
|
+
payload["resourceType"] = resourceType;
|
|
95507
|
+
}
|
|
95508
|
+
if (typeof resourceId !== "undefined") {
|
|
95509
|
+
payload["resourceId"] = resourceId;
|
|
95510
|
+
}
|
|
95511
|
+
if (typeof schedule !== "undefined") {
|
|
95512
|
+
payload["schedule"] = schedule;
|
|
95513
|
+
}
|
|
95514
|
+
if (typeof active !== "undefined") {
|
|
95515
|
+
payload["active"] = active;
|
|
95516
|
+
}
|
|
95517
|
+
if (typeof data !== "undefined") {
|
|
95518
|
+
payload["data"] = data;
|
|
95519
|
+
}
|
|
95520
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
95521
|
+
const apiHeaders = {
|
|
95522
|
+
"content-type": "application/json"
|
|
95523
|
+
};
|
|
95524
|
+
return this.client.call("post", uri, apiHeaders, payload);
|
|
95525
|
+
}
|
|
95526
|
+
getSchedule(paramsOrFirst, ...rest) {
|
|
95527
|
+
let params;
|
|
95528
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
95529
|
+
params = paramsOrFirst || {};
|
|
95530
|
+
} else {
|
|
95531
|
+
params = {
|
|
95532
|
+
projectId: paramsOrFirst,
|
|
95533
|
+
scheduleId: rest[0]
|
|
95534
|
+
};
|
|
95535
|
+
}
|
|
95536
|
+
const projectId = params.projectId;
|
|
95537
|
+
const scheduleId = params.scheduleId;
|
|
95538
|
+
if (typeof projectId === "undefined") {
|
|
95539
|
+
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
95540
|
+
}
|
|
95541
|
+
if (typeof scheduleId === "undefined") {
|
|
95542
|
+
throw new AppwriteException('Missing required parameter: "scheduleId"');
|
|
95543
|
+
}
|
|
95544
|
+
const apiPath = "/projects/{projectId}/schedules/{scheduleId}".replace("{projectId}", projectId).replace("{scheduleId}", scheduleId);
|
|
95545
|
+
const payload = {};
|
|
95546
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
95547
|
+
const apiHeaders = {};
|
|
95548
|
+
return this.client.call("get", uri, apiHeaders, payload);
|
|
95549
|
+
}
|
|
96746
95550
|
updateServiceStatus(paramsOrFirst, ...rest) {
|
|
96747
95551
|
let params;
|
|
96748
95552
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
@@ -103443,6 +102247,8 @@ var Scopes;
|
|
|
103443
102247
|
Scopes2["TargetsWrite"] = "targets.write";
|
|
103444
102248
|
Scopes2["RulesRead"] = "rules.read";
|
|
103445
102249
|
Scopes2["RulesWrite"] = "rules.write";
|
|
102250
|
+
Scopes2["SchedulesRead"] = "schedules.read";
|
|
102251
|
+
Scopes2["SchedulesWrite"] = "schedules.write";
|
|
103446
102252
|
Scopes2["MigrationsRead"] = "migrations.read";
|
|
103447
102253
|
Scopes2["MigrationsWrite"] = "migrations.write";
|
|
103448
102254
|
Scopes2["VcsRead"] = "vcs.read";
|
|
@@ -103512,8 +102318,6 @@ var OAuthProvider;
|
|
|
103512
102318
|
OAuthProvider2["Yandex"] = "yandex";
|
|
103513
102319
|
OAuthProvider2["Zoho"] = "zoho";
|
|
103514
102320
|
OAuthProvider2["Zoom"] = "zoom";
|
|
103515
|
-
OAuthProvider2["GithubImagine"] = "githubImagine";
|
|
103516
|
-
OAuthProvider2["GoogleImagine"] = "googleImagine";
|
|
103517
102321
|
})(OAuthProvider || (OAuthProvider = {}));
|
|
103518
102322
|
var Browser;
|
|
103519
102323
|
(function(Browser2) {
|
|
@@ -104277,24 +103081,35 @@ var Runtime;
|
|
|
104277
103081
|
Runtime2["Node200"] = "node-20.0";
|
|
104278
103082
|
Runtime2["Node210"] = "node-21.0";
|
|
104279
103083
|
Runtime2["Node22"] = "node-22";
|
|
103084
|
+
Runtime2["Node23"] = "node-23";
|
|
103085
|
+
Runtime2["Node24"] = "node-24";
|
|
103086
|
+
Runtime2["Node25"] = "node-25";
|
|
104280
103087
|
Runtime2["Php80"] = "php-8.0";
|
|
104281
103088
|
Runtime2["Php81"] = "php-8.1";
|
|
104282
103089
|
Runtime2["Php82"] = "php-8.2";
|
|
104283
103090
|
Runtime2["Php83"] = "php-8.3";
|
|
103091
|
+
Runtime2["Php84"] = "php-8.4";
|
|
104284
103092
|
Runtime2["Ruby30"] = "ruby-3.0";
|
|
104285
103093
|
Runtime2["Ruby31"] = "ruby-3.1";
|
|
104286
103094
|
Runtime2["Ruby32"] = "ruby-3.2";
|
|
104287
103095
|
Runtime2["Ruby33"] = "ruby-3.3";
|
|
103096
|
+
Runtime2["Ruby34"] = "ruby-3.4";
|
|
103097
|
+
Runtime2["Ruby40"] = "ruby-4.0";
|
|
104288
103098
|
Runtime2["Python38"] = "python-3.8";
|
|
104289
103099
|
Runtime2["Python39"] = "python-3.9";
|
|
104290
103100
|
Runtime2["Python310"] = "python-3.10";
|
|
104291
103101
|
Runtime2["Python311"] = "python-3.11";
|
|
104292
103102
|
Runtime2["Python312"] = "python-3.12";
|
|
103103
|
+
Runtime2["Python313"] = "python-3.13";
|
|
103104
|
+
Runtime2["Python314"] = "python-3.14";
|
|
104293
103105
|
Runtime2["Pythonml311"] = "python-ml-3.11";
|
|
104294
103106
|
Runtime2["Pythonml312"] = "python-ml-3.12";
|
|
103107
|
+
Runtime2["Pythonml313"] = "python-ml-3.13";
|
|
104295
103108
|
Runtime2["Deno140"] = "deno-1.40";
|
|
104296
103109
|
Runtime2["Deno146"] = "deno-1.46";
|
|
104297
103110
|
Runtime2["Deno20"] = "deno-2.0";
|
|
103111
|
+
Runtime2["Deno25"] = "deno-2.5";
|
|
103112
|
+
Runtime2["Deno26"] = "deno-2.6";
|
|
104298
103113
|
Runtime2["Dart215"] = "dart-2.15";
|
|
104299
103114
|
Runtime2["Dart216"] = "dart-2.16";
|
|
104300
103115
|
Runtime2["Dart217"] = "dart-2.17";
|
|
@@ -104310,25 +103125,34 @@ var Runtime;
|
|
|
104310
103125
|
Runtime2["Dotnet60"] = "dotnet-6.0";
|
|
104311
103126
|
Runtime2["Dotnet70"] = "dotnet-7.0";
|
|
104312
103127
|
Runtime2["Dotnet80"] = "dotnet-8.0";
|
|
103128
|
+
Runtime2["Dotnet10"] = "dotnet-10";
|
|
104313
103129
|
Runtime2["Java80"] = "java-8.0";
|
|
104314
103130
|
Runtime2["Java110"] = "java-11.0";
|
|
104315
103131
|
Runtime2["Java170"] = "java-17.0";
|
|
104316
103132
|
Runtime2["Java180"] = "java-18.0";
|
|
104317
103133
|
Runtime2["Java210"] = "java-21.0";
|
|
104318
103134
|
Runtime2["Java22"] = "java-22";
|
|
103135
|
+
Runtime2["Java25"] = "java-25";
|
|
104319
103136
|
Runtime2["Swift55"] = "swift-5.5";
|
|
104320
103137
|
Runtime2["Swift58"] = "swift-5.8";
|
|
104321
103138
|
Runtime2["Swift59"] = "swift-5.9";
|
|
104322
103139
|
Runtime2["Swift510"] = "swift-5.10";
|
|
103140
|
+
Runtime2["Swift62"] = "swift-6.2";
|
|
104323
103141
|
Runtime2["Kotlin16"] = "kotlin-1.6";
|
|
104324
103142
|
Runtime2["Kotlin18"] = "kotlin-1.8";
|
|
104325
103143
|
Runtime2["Kotlin19"] = "kotlin-1.9";
|
|
104326
103144
|
Runtime2["Kotlin20"] = "kotlin-2.0";
|
|
103145
|
+
Runtime2["Kotlin23"] = "kotlin-2.3";
|
|
104327
103146
|
Runtime2["Cpp17"] = "cpp-17";
|
|
104328
103147
|
Runtime2["Cpp20"] = "cpp-20";
|
|
104329
103148
|
Runtime2["Bun10"] = "bun-1.0";
|
|
104330
103149
|
Runtime2["Bun11"] = "bun-1.1";
|
|
103150
|
+
Runtime2["Bun12"] = "bun-1.2";
|
|
103151
|
+
Runtime2["Bun13"] = "bun-1.3";
|
|
104331
103152
|
Runtime2["Go123"] = "go-1.23";
|
|
103153
|
+
Runtime2["Go124"] = "go-1.24";
|
|
103154
|
+
Runtime2["Go125"] = "go-1.25";
|
|
103155
|
+
Runtime2["Go126"] = "go-1.26";
|
|
104332
103156
|
Runtime2["Static1"] = "static-1";
|
|
104333
103157
|
Runtime2["Flutter324"] = "flutter-3.24";
|
|
104334
103158
|
Runtime2["Flutter327"] = "flutter-3.27";
|
|
@@ -104346,24 +103170,35 @@ var Runtimes;
|
|
|
104346
103170
|
Runtimes2["Node200"] = "node-20.0";
|
|
104347
103171
|
Runtimes2["Node210"] = "node-21.0";
|
|
104348
103172
|
Runtimes2["Node22"] = "node-22";
|
|
103173
|
+
Runtimes2["Node23"] = "node-23";
|
|
103174
|
+
Runtimes2["Node24"] = "node-24";
|
|
103175
|
+
Runtimes2["Node25"] = "node-25";
|
|
104349
103176
|
Runtimes2["Php80"] = "php-8.0";
|
|
104350
103177
|
Runtimes2["Php81"] = "php-8.1";
|
|
104351
103178
|
Runtimes2["Php82"] = "php-8.2";
|
|
104352
103179
|
Runtimes2["Php83"] = "php-8.3";
|
|
103180
|
+
Runtimes2["Php84"] = "php-8.4";
|
|
104353
103181
|
Runtimes2["Ruby30"] = "ruby-3.0";
|
|
104354
103182
|
Runtimes2["Ruby31"] = "ruby-3.1";
|
|
104355
103183
|
Runtimes2["Ruby32"] = "ruby-3.2";
|
|
104356
103184
|
Runtimes2["Ruby33"] = "ruby-3.3";
|
|
103185
|
+
Runtimes2["Ruby34"] = "ruby-3.4";
|
|
103186
|
+
Runtimes2["Ruby40"] = "ruby-4.0";
|
|
104357
103187
|
Runtimes2["Python38"] = "python-3.8";
|
|
104358
103188
|
Runtimes2["Python39"] = "python-3.9";
|
|
104359
103189
|
Runtimes2["Python310"] = "python-3.10";
|
|
104360
103190
|
Runtimes2["Python311"] = "python-3.11";
|
|
104361
103191
|
Runtimes2["Python312"] = "python-3.12";
|
|
103192
|
+
Runtimes2["Python313"] = "python-3.13";
|
|
103193
|
+
Runtimes2["Python314"] = "python-3.14";
|
|
104362
103194
|
Runtimes2["Pythonml311"] = "python-ml-3.11";
|
|
104363
103195
|
Runtimes2["Pythonml312"] = "python-ml-3.12";
|
|
103196
|
+
Runtimes2["Pythonml313"] = "python-ml-3.13";
|
|
104364
103197
|
Runtimes2["Deno140"] = "deno-1.40";
|
|
104365
103198
|
Runtimes2["Deno146"] = "deno-1.46";
|
|
104366
103199
|
Runtimes2["Deno20"] = "deno-2.0";
|
|
103200
|
+
Runtimes2["Deno25"] = "deno-2.5";
|
|
103201
|
+
Runtimes2["Deno26"] = "deno-2.6";
|
|
104367
103202
|
Runtimes2["Dart215"] = "dart-2.15";
|
|
104368
103203
|
Runtimes2["Dart216"] = "dart-2.16";
|
|
104369
103204
|
Runtimes2["Dart217"] = "dart-2.17";
|
|
@@ -104379,25 +103214,34 @@ var Runtimes;
|
|
|
104379
103214
|
Runtimes2["Dotnet60"] = "dotnet-6.0";
|
|
104380
103215
|
Runtimes2["Dotnet70"] = "dotnet-7.0";
|
|
104381
103216
|
Runtimes2["Dotnet80"] = "dotnet-8.0";
|
|
103217
|
+
Runtimes2["Dotnet10"] = "dotnet-10";
|
|
104382
103218
|
Runtimes2["Java80"] = "java-8.0";
|
|
104383
103219
|
Runtimes2["Java110"] = "java-11.0";
|
|
104384
103220
|
Runtimes2["Java170"] = "java-17.0";
|
|
104385
103221
|
Runtimes2["Java180"] = "java-18.0";
|
|
104386
103222
|
Runtimes2["Java210"] = "java-21.0";
|
|
104387
103223
|
Runtimes2["Java22"] = "java-22";
|
|
103224
|
+
Runtimes2["Java25"] = "java-25";
|
|
104388
103225
|
Runtimes2["Swift55"] = "swift-5.5";
|
|
104389
103226
|
Runtimes2["Swift58"] = "swift-5.8";
|
|
104390
103227
|
Runtimes2["Swift59"] = "swift-5.9";
|
|
104391
103228
|
Runtimes2["Swift510"] = "swift-5.10";
|
|
103229
|
+
Runtimes2["Swift62"] = "swift-6.2";
|
|
104392
103230
|
Runtimes2["Kotlin16"] = "kotlin-1.6";
|
|
104393
103231
|
Runtimes2["Kotlin18"] = "kotlin-1.8";
|
|
104394
103232
|
Runtimes2["Kotlin19"] = "kotlin-1.9";
|
|
104395
103233
|
Runtimes2["Kotlin20"] = "kotlin-2.0";
|
|
103234
|
+
Runtimes2["Kotlin23"] = "kotlin-2.3";
|
|
104396
103235
|
Runtimes2["Cpp17"] = "cpp-17";
|
|
104397
103236
|
Runtimes2["Cpp20"] = "cpp-20";
|
|
104398
103237
|
Runtimes2["Bun10"] = "bun-1.0";
|
|
104399
103238
|
Runtimes2["Bun11"] = "bun-1.1";
|
|
103239
|
+
Runtimes2["Bun12"] = "bun-1.2";
|
|
103240
|
+
Runtimes2["Bun13"] = "bun-1.3";
|
|
104400
103241
|
Runtimes2["Go123"] = "go-1.23";
|
|
103242
|
+
Runtimes2["Go124"] = "go-1.24";
|
|
103243
|
+
Runtimes2["Go125"] = "go-1.25";
|
|
103244
|
+
Runtimes2["Go126"] = "go-1.26";
|
|
104401
103245
|
Runtimes2["Static1"] = "static-1";
|
|
104402
103246
|
Runtimes2["Flutter324"] = "flutter-3.24";
|
|
104403
103247
|
Runtimes2["Flutter327"] = "flutter-3.27";
|
|
@@ -104534,6 +103378,13 @@ var PlatformType;
|
|
|
104534
103378
|
PlatformType2["Reactnativeios"] = "react-native-ios";
|
|
104535
103379
|
PlatformType2["Reactnativeandroid"] = "react-native-android";
|
|
104536
103380
|
})(PlatformType || (PlatformType = {}));
|
|
103381
|
+
var ResourceType;
|
|
103382
|
+
(function(ResourceType2) {
|
|
103383
|
+
ResourceType2["Function"] = "function";
|
|
103384
|
+
ResourceType2["Execution"] = "execution";
|
|
103385
|
+
ResourceType2["Message"] = "message";
|
|
103386
|
+
ResourceType2["Backup"] = "backup";
|
|
103387
|
+
})(ResourceType || (ResourceType = {}));
|
|
104537
103388
|
var ApiService;
|
|
104538
103389
|
(function(ApiService3) {
|
|
104539
103390
|
ApiService3["Account"] = "account";
|
|
@@ -104558,12 +103409,12 @@ var SMTPSecure;
|
|
|
104558
103409
|
var EmailTemplateType;
|
|
104559
103410
|
(function(EmailTemplateType2) {
|
|
104560
103411
|
EmailTemplateType2["Verification"] = "verification";
|
|
104561
|
-
EmailTemplateType2["
|
|
103412
|
+
EmailTemplateType2["MagicSession"] = "magicSession";
|
|
104562
103413
|
EmailTemplateType2["Recovery"] = "recovery";
|
|
104563
103414
|
EmailTemplateType2["Invitation"] = "invitation";
|
|
104564
|
-
EmailTemplateType2["
|
|
104565
|
-
EmailTemplateType2["
|
|
104566
|
-
EmailTemplateType2["
|
|
103415
|
+
EmailTemplateType2["MfaChallenge"] = "mfaChallenge";
|
|
103416
|
+
EmailTemplateType2["SessionAlert"] = "sessionAlert";
|
|
103417
|
+
EmailTemplateType2["OtpSession"] = "otpSession";
|
|
104567
103418
|
})(EmailTemplateType || (EmailTemplateType = {}));
|
|
104568
103419
|
var EmailTemplateLocale;
|
|
104569
103420
|
(function(EmailTemplateLocale2) {
|
|
@@ -104704,7 +103555,7 @@ var SmsTemplateType;
|
|
|
104704
103555
|
SmsTemplateType2["Verification"] = "verification";
|
|
104705
103556
|
SmsTemplateType2["Login"] = "login";
|
|
104706
103557
|
SmsTemplateType2["Invitation"] = "invitation";
|
|
104707
|
-
SmsTemplateType2["
|
|
103558
|
+
SmsTemplateType2["MfaChallenge"] = "mfaChallenge";
|
|
104708
103559
|
})(SmsTemplateType || (SmsTemplateType = {}));
|
|
104709
103560
|
var SmsTemplateLocale;
|
|
104710
103561
|
(function(SmsTemplateLocale2) {
|
|
@@ -104879,24 +103730,35 @@ var BuildRuntime;
|
|
|
104879
103730
|
BuildRuntime2["Node200"] = "node-20.0";
|
|
104880
103731
|
BuildRuntime2["Node210"] = "node-21.0";
|
|
104881
103732
|
BuildRuntime2["Node22"] = "node-22";
|
|
103733
|
+
BuildRuntime2["Node23"] = "node-23";
|
|
103734
|
+
BuildRuntime2["Node24"] = "node-24";
|
|
103735
|
+
BuildRuntime2["Node25"] = "node-25";
|
|
104882
103736
|
BuildRuntime2["Php80"] = "php-8.0";
|
|
104883
103737
|
BuildRuntime2["Php81"] = "php-8.1";
|
|
104884
103738
|
BuildRuntime2["Php82"] = "php-8.2";
|
|
104885
103739
|
BuildRuntime2["Php83"] = "php-8.3";
|
|
103740
|
+
BuildRuntime2["Php84"] = "php-8.4";
|
|
104886
103741
|
BuildRuntime2["Ruby30"] = "ruby-3.0";
|
|
104887
103742
|
BuildRuntime2["Ruby31"] = "ruby-3.1";
|
|
104888
103743
|
BuildRuntime2["Ruby32"] = "ruby-3.2";
|
|
104889
103744
|
BuildRuntime2["Ruby33"] = "ruby-3.3";
|
|
103745
|
+
BuildRuntime2["Ruby34"] = "ruby-3.4";
|
|
103746
|
+
BuildRuntime2["Ruby40"] = "ruby-4.0";
|
|
104890
103747
|
BuildRuntime2["Python38"] = "python-3.8";
|
|
104891
103748
|
BuildRuntime2["Python39"] = "python-3.9";
|
|
104892
103749
|
BuildRuntime2["Python310"] = "python-3.10";
|
|
104893
103750
|
BuildRuntime2["Python311"] = "python-3.11";
|
|
104894
103751
|
BuildRuntime2["Python312"] = "python-3.12";
|
|
103752
|
+
BuildRuntime2["Python313"] = "python-3.13";
|
|
103753
|
+
BuildRuntime2["Python314"] = "python-3.14";
|
|
104895
103754
|
BuildRuntime2["Pythonml311"] = "python-ml-3.11";
|
|
104896
103755
|
BuildRuntime2["Pythonml312"] = "python-ml-3.12";
|
|
103756
|
+
BuildRuntime2["Pythonml313"] = "python-ml-3.13";
|
|
104897
103757
|
BuildRuntime2["Deno140"] = "deno-1.40";
|
|
104898
103758
|
BuildRuntime2["Deno146"] = "deno-1.46";
|
|
104899
103759
|
BuildRuntime2["Deno20"] = "deno-2.0";
|
|
103760
|
+
BuildRuntime2["Deno25"] = "deno-2.5";
|
|
103761
|
+
BuildRuntime2["Deno26"] = "deno-2.6";
|
|
104900
103762
|
BuildRuntime2["Dart215"] = "dart-2.15";
|
|
104901
103763
|
BuildRuntime2["Dart216"] = "dart-2.16";
|
|
104902
103764
|
BuildRuntime2["Dart217"] = "dart-2.17";
|
|
@@ -104912,25 +103774,34 @@ var BuildRuntime;
|
|
|
104912
103774
|
BuildRuntime2["Dotnet60"] = "dotnet-6.0";
|
|
104913
103775
|
BuildRuntime2["Dotnet70"] = "dotnet-7.0";
|
|
104914
103776
|
BuildRuntime2["Dotnet80"] = "dotnet-8.0";
|
|
103777
|
+
BuildRuntime2["Dotnet10"] = "dotnet-10";
|
|
104915
103778
|
BuildRuntime2["Java80"] = "java-8.0";
|
|
104916
103779
|
BuildRuntime2["Java110"] = "java-11.0";
|
|
104917
103780
|
BuildRuntime2["Java170"] = "java-17.0";
|
|
104918
103781
|
BuildRuntime2["Java180"] = "java-18.0";
|
|
104919
103782
|
BuildRuntime2["Java210"] = "java-21.0";
|
|
104920
103783
|
BuildRuntime2["Java22"] = "java-22";
|
|
103784
|
+
BuildRuntime2["Java25"] = "java-25";
|
|
104921
103785
|
BuildRuntime2["Swift55"] = "swift-5.5";
|
|
104922
103786
|
BuildRuntime2["Swift58"] = "swift-5.8";
|
|
104923
103787
|
BuildRuntime2["Swift59"] = "swift-5.9";
|
|
104924
103788
|
BuildRuntime2["Swift510"] = "swift-5.10";
|
|
103789
|
+
BuildRuntime2["Swift62"] = "swift-6.2";
|
|
104925
103790
|
BuildRuntime2["Kotlin16"] = "kotlin-1.6";
|
|
104926
103791
|
BuildRuntime2["Kotlin18"] = "kotlin-1.8";
|
|
104927
103792
|
BuildRuntime2["Kotlin19"] = "kotlin-1.9";
|
|
104928
103793
|
BuildRuntime2["Kotlin20"] = "kotlin-2.0";
|
|
103794
|
+
BuildRuntime2["Kotlin23"] = "kotlin-2.3";
|
|
104929
103795
|
BuildRuntime2["Cpp17"] = "cpp-17";
|
|
104930
103796
|
BuildRuntime2["Cpp20"] = "cpp-20";
|
|
104931
103797
|
BuildRuntime2["Bun10"] = "bun-1.0";
|
|
104932
103798
|
BuildRuntime2["Bun11"] = "bun-1.1";
|
|
103799
|
+
BuildRuntime2["Bun12"] = "bun-1.2";
|
|
103800
|
+
BuildRuntime2["Bun13"] = "bun-1.3";
|
|
104933
103801
|
BuildRuntime2["Go123"] = "go-1.23";
|
|
103802
|
+
BuildRuntime2["Go124"] = "go-1.24";
|
|
103803
|
+
BuildRuntime2["Go125"] = "go-1.25";
|
|
103804
|
+
BuildRuntime2["Go126"] = "go-1.26";
|
|
104934
103805
|
BuildRuntime2["Static1"] = "static-1";
|
|
104935
103806
|
BuildRuntime2["Flutter324"] = "flutter-3.24";
|
|
104936
103807
|
BuildRuntime2["Flutter327"] = "flutter-3.27";
|
|
@@ -105105,10 +103976,23 @@ var package_default = {
|
|
|
105105
103976
|
type: "module",
|
|
105106
103977
|
homepage: "https://appwrite.io/support",
|
|
105107
103978
|
description: "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API",
|
|
105108
|
-
version: "13.
|
|
103979
|
+
version: "13.6.0",
|
|
105109
103980
|
license: "BSD-3-Clause",
|
|
105110
|
-
main: "dist/index.
|
|
103981
|
+
main: "dist/index.cjs",
|
|
103982
|
+
module: "dist/index.js",
|
|
105111
103983
|
types: "dist/index.d.ts",
|
|
103984
|
+
exports: {
|
|
103985
|
+
".": {
|
|
103986
|
+
import: {
|
|
103987
|
+
types: "./dist/index.d.ts",
|
|
103988
|
+
default: "./dist/index.js"
|
|
103989
|
+
},
|
|
103990
|
+
require: {
|
|
103991
|
+
types: "./dist/index.d.ts",
|
|
103992
|
+
default: "./dist/index.cjs"
|
|
103993
|
+
}
|
|
103994
|
+
}
|
|
103995
|
+
},
|
|
105112
103996
|
bin: {
|
|
105113
103997
|
appwrite: "dist/cli.cjs"
|
|
105114
103998
|
},
|
|
@@ -105119,8 +104003,9 @@ var package_default = {
|
|
|
105119
104003
|
scripts: {
|
|
105120
104004
|
build: "npm run build:types && npm run build:runtime",
|
|
105121
104005
|
"build:types": "tsc -p tsconfig.json --emitDeclarationOnly",
|
|
105122
|
-
"build:runtime": "npm run build:lib:
|
|
105123
|
-
"build:lib:
|
|
104006
|
+
"build:runtime": "npm run build:lib:esm && npm run build:lib:cjs && npm run build:cli",
|
|
104007
|
+
"build:lib:esm": "esbuild index.ts --bundle --platform=node --target=node18 --format=esm --loader:.hbs=text --outfile=dist/index.js",
|
|
104008
|
+
"build:lib:cjs": "esbuild index.ts --bundle --platform=node --target=node18 --format=cjs --loader:.hbs=text --outfile=dist/index.cjs",
|
|
105124
104009
|
"build:cli": "esbuild cli.ts --bundle --platform=node --target=node18 --format=cjs --loader:.hbs=text --external:fsevents --outfile=dist/cli.cjs",
|
|
105125
104010
|
format: 'prettier --write "**/*.{js,ts,json,md}"',
|
|
105126
104011
|
generate: "tsx scripts/generate-commands.ts",
|
|
@@ -105134,7 +104019,7 @@ var package_default = {
|
|
|
105134
104019
|
"windows-arm64": "esbuild cli.ts --bundle --loader:.hbs=text --platform=node --target=node18 --format=esm --external:fsevents --outfile=dist/bundle-win-arm64.mjs && pkg dist/bundle-win-arm64.mjs -t node18-win-arm64 -o build/appwrite-cli-win-arm64.exe"
|
|
105135
104020
|
},
|
|
105136
104021
|
dependencies: {
|
|
105137
|
-
"@appwrite.io/console": "^
|
|
104022
|
+
"@appwrite.io/console": "^3.1.0",
|
|
105138
104023
|
chalk: "4.1.2",
|
|
105139
104024
|
chokidar: "^3.6.0",
|
|
105140
104025
|
"cli-progress": "^3.12.0",
|
|
@@ -106060,7 +104945,9 @@ var Pools = class {
|
|
|
106060
104945
|
// Milliseconds
|
|
106061
104946
|
pollMaxDebounces = 30;
|
|
106062
104947
|
POLL_DEFAULT_VALUE = 30;
|
|
106063
|
-
|
|
104948
|
+
client;
|
|
104949
|
+
constructor(pollMaxDebounces, client) {
|
|
104950
|
+
this.client = client;
|
|
106064
104951
|
if (pollMaxDebounces) {
|
|
106065
104952
|
this.pollMaxDebounces = pollMaxDebounces;
|
|
106066
104953
|
}
|
|
@@ -106069,7 +104956,7 @@ var Pools = class {
|
|
|
106069
104956
|
if (iteration > this.pollMaxDebounces) {
|
|
106070
104957
|
return false;
|
|
106071
104958
|
}
|
|
106072
|
-
const databasesService = await getDatabasesService();
|
|
104959
|
+
const databasesService = await getDatabasesService(this.client);
|
|
106073
104960
|
const response = await databasesService.listAttributes(
|
|
106074
104961
|
databaseId,
|
|
106075
104962
|
collectionId,
|
|
@@ -106095,7 +104982,7 @@ var Pools = class {
|
|
|
106095
104982
|
if (iteration > this.pollMaxDebounces) {
|
|
106096
104983
|
return false;
|
|
106097
104984
|
}
|
|
106098
|
-
const databasesService = await getDatabasesService();
|
|
104985
|
+
const databasesService = await getDatabasesService(this.client);
|
|
106099
104986
|
const response = await databasesService.listIndexes(
|
|
106100
104987
|
databaseId,
|
|
106101
104988
|
collectionId,
|
|
@@ -106132,7 +105019,7 @@ var Pools = class {
|
|
|
106132
105019
|
}
|
|
106133
105020
|
const { attributes } = await paginate(
|
|
106134
105021
|
async (args) => {
|
|
106135
|
-
const databasesService = await getDatabasesService();
|
|
105022
|
+
const databasesService = await getDatabasesService(this.client);
|
|
106136
105023
|
return await databasesService.listAttributes({
|
|
106137
105024
|
databaseId: args.databaseId,
|
|
106138
105025
|
collectionId: args.collectionId,
|
|
@@ -106175,7 +105062,7 @@ var Pools = class {
|
|
|
106175
105062
|
}
|
|
106176
105063
|
const { attributes } = await paginate(
|
|
106177
105064
|
async (args) => {
|
|
106178
|
-
const databasesService = await getDatabasesService();
|
|
105065
|
+
const databasesService = await getDatabasesService(this.client);
|
|
106179
105066
|
return await databasesService.listAttributes(
|
|
106180
105067
|
args.databaseId,
|
|
106181
105068
|
args.collectionId,
|
|
@@ -106224,7 +105111,7 @@ var Pools = class {
|
|
|
106224
105111
|
}
|
|
106225
105112
|
const { indexes } = await paginate(
|
|
106226
105113
|
async (args) => {
|
|
106227
|
-
const databasesService = await getDatabasesService();
|
|
105114
|
+
const databasesService = await getDatabasesService(this.client);
|
|
106228
105115
|
return await databasesService.listIndexes(
|
|
106229
105116
|
args.databaseId,
|
|
106230
105117
|
args.collectionId,
|
|
@@ -106290,8 +105177,10 @@ var questionPushChangesConfirmation2 = [
|
|
|
106290
105177
|
var Attributes = class {
|
|
106291
105178
|
pools;
|
|
106292
105179
|
skipConfirmation;
|
|
106293
|
-
|
|
106294
|
-
|
|
105180
|
+
client;
|
|
105181
|
+
constructor(pools, skipConfirmation = false, client) {
|
|
105182
|
+
this.client = client;
|
|
105183
|
+
this.pools = pools || new Pools(void 0, client);
|
|
106295
105184
|
this.skipConfirmation = skipConfirmation;
|
|
106296
105185
|
}
|
|
106297
105186
|
getConfirmation = async () => {
|
|
@@ -106379,7 +105268,7 @@ var Attributes = class {
|
|
|
106379
105268
|
};
|
|
106380
105269
|
};
|
|
106381
105270
|
createAttribute = async (databaseId, collectionId, attribute) => {
|
|
106382
|
-
const databasesService = await getDatabasesService();
|
|
105271
|
+
const databasesService = await getDatabasesService(this.client);
|
|
106383
105272
|
switch (attribute.type) {
|
|
106384
105273
|
case "string":
|
|
106385
105274
|
switch (attribute.format) {
|
|
@@ -106549,7 +105438,7 @@ var Attributes = class {
|
|
|
106549
105438
|
}
|
|
106550
105439
|
};
|
|
106551
105440
|
updateAttribute = async (databaseId, collectionId, attribute) => {
|
|
106552
|
-
const databasesService = await getDatabasesService();
|
|
105441
|
+
const databasesService = await getDatabasesService(this.client);
|
|
106553
105442
|
switch (attribute.type) {
|
|
106554
105443
|
case "string":
|
|
106555
105444
|
switch (attribute.format) {
|
|
@@ -106703,7 +105592,7 @@ var Attributes = class {
|
|
|
106703
105592
|
log(
|
|
106704
105593
|
`Deleting ${isIndex ? "index" : "attribute"} ${attribute.key} of ${collection.name} ( ${collection["$id"]} )`
|
|
106705
105594
|
);
|
|
106706
|
-
const databasesService = await getDatabasesService();
|
|
105595
|
+
const databasesService = await getDatabasesService(this.client);
|
|
106707
105596
|
if (isIndex) {
|
|
106708
105597
|
await databasesService.deleteIndex(
|
|
106709
105598
|
collection["databaseId"],
|
|
@@ -106858,7 +105747,7 @@ var Attributes = class {
|
|
|
106858
105747
|
};
|
|
106859
105748
|
createIndexes = async (indexes, collection) => {
|
|
106860
105749
|
log(`Creating indexes ...`);
|
|
106861
|
-
const databasesService = await getDatabasesService();
|
|
105750
|
+
const databasesService = await getDatabasesService(this.client);
|
|
106862
105751
|
for (let index of indexes) {
|
|
106863
105752
|
await databasesService.createIndex({
|
|
106864
105753
|
databaseId: collection["databaseId"],
|
|
@@ -107227,158 +106116,169 @@ var Push = class {
|
|
|
107227
106116
|
}
|
|
107228
106117
|
}
|
|
107229
106118
|
async pushResources(config2, options = { all: true, skipDeprecated: true }) {
|
|
107230
|
-
const
|
|
107231
|
-
|
|
107232
|
-
|
|
107233
|
-
const shouldPushAll = options.all === true;
|
|
107234
|
-
if ((shouldPushAll || options.settings) && (config2.projectName || config2.settings)) {
|
|
107235
|
-
try {
|
|
107236
|
-
this.log("Pushing settings ...");
|
|
107237
|
-
await this.pushSettings({
|
|
107238
|
-
projectId: config2.projectId,
|
|
107239
|
-
projectName: config2.projectName,
|
|
107240
|
-
settings: config2.settings
|
|
107241
|
-
});
|
|
107242
|
-
this.success(
|
|
107243
|
-
`Successfully pushed ${import_chalk7.default.bold("all")} project settings.`
|
|
107244
|
-
);
|
|
107245
|
-
results.settings = { success: true };
|
|
107246
|
-
} catch (e) {
|
|
107247
|
-
allErrors.push(e);
|
|
107248
|
-
results.settings = { success: false, error: e.message };
|
|
107249
|
-
}
|
|
106119
|
+
const previousForce = cliConfig.force;
|
|
106120
|
+
if (options.force !== void 0) {
|
|
106121
|
+
cliConfig.force = options.force;
|
|
107250
106122
|
}
|
|
107251
|
-
|
|
107252
|
-
|
|
107253
|
-
|
|
107254
|
-
|
|
107255
|
-
|
|
107256
|
-
|
|
107257
|
-
|
|
107258
|
-
|
|
107259
|
-
|
|
107260
|
-
|
|
107261
|
-
|
|
107262
|
-
|
|
106123
|
+
try {
|
|
106124
|
+
const { skipDeprecated = true } = options;
|
|
106125
|
+
const results = {};
|
|
106126
|
+
const allErrors = [];
|
|
106127
|
+
const shouldPushAll = options.all === true;
|
|
106128
|
+
if ((shouldPushAll || options.settings) && (config2.projectName || config2.settings)) {
|
|
106129
|
+
try {
|
|
106130
|
+
this.log("Pushing settings ...");
|
|
106131
|
+
await this.pushSettings({
|
|
106132
|
+
projectId: config2.projectId,
|
|
106133
|
+
projectName: config2.projectName,
|
|
106134
|
+
settings: config2.settings
|
|
106135
|
+
});
|
|
106136
|
+
this.success(
|
|
106137
|
+
`Successfully pushed ${import_chalk7.default.bold("all")} project settings.`
|
|
106138
|
+
);
|
|
106139
|
+
results.settings = { success: true };
|
|
106140
|
+
} catch (e) {
|
|
106141
|
+
allErrors.push(e);
|
|
106142
|
+
results.settings = { success: false, error: e.message };
|
|
106143
|
+
}
|
|
107263
106144
|
}
|
|
107264
|
-
|
|
107265
|
-
|
|
107266
|
-
|
|
107267
|
-
|
|
107268
|
-
|
|
107269
|
-
|
|
107270
|
-
|
|
107271
|
-
|
|
107272
|
-
|
|
107273
|
-
|
|
107274
|
-
|
|
107275
|
-
|
|
107276
|
-
|
|
106145
|
+
if ((shouldPushAll || options.buckets) && config2.buckets && config2.buckets.length > 0) {
|
|
106146
|
+
try {
|
|
106147
|
+
this.log("Pushing buckets ...");
|
|
106148
|
+
const result = await this.pushBuckets(config2.buckets);
|
|
106149
|
+
this.success(
|
|
106150
|
+
`Successfully pushed ${import_chalk7.default.bold(result.successfullyPushed)} buckets.`
|
|
106151
|
+
);
|
|
106152
|
+
results.buckets = result;
|
|
106153
|
+
allErrors.push(...result.errors);
|
|
106154
|
+
} catch (e) {
|
|
106155
|
+
allErrors.push(e);
|
|
106156
|
+
results.buckets = { successfullyPushed: 0, errors: [e] };
|
|
106157
|
+
}
|
|
107277
106158
|
}
|
|
107278
|
-
|
|
107279
|
-
|
|
107280
|
-
|
|
107281
|
-
|
|
107282
|
-
|
|
107283
|
-
|
|
107284
|
-
|
|
107285
|
-
|
|
107286
|
-
|
|
107287
|
-
|
|
107288
|
-
|
|
107289
|
-
|
|
107290
|
-
|
|
106159
|
+
if ((shouldPushAll || options.teams) && config2.teams && config2.teams.length > 0) {
|
|
106160
|
+
try {
|
|
106161
|
+
this.log("Pushing teams ...");
|
|
106162
|
+
const result = await this.pushTeams(config2.teams);
|
|
106163
|
+
this.success(
|
|
106164
|
+
`Successfully pushed ${import_chalk7.default.bold(result.successfullyPushed)} teams.`
|
|
106165
|
+
);
|
|
106166
|
+
results.teams = result;
|
|
106167
|
+
allErrors.push(...result.errors);
|
|
106168
|
+
} catch (e) {
|
|
106169
|
+
allErrors.push(e);
|
|
106170
|
+
results.teams = { successfullyPushed: 0, errors: [e] };
|
|
106171
|
+
}
|
|
107291
106172
|
}
|
|
107292
|
-
|
|
107293
|
-
|
|
107294
|
-
|
|
107295
|
-
|
|
107296
|
-
|
|
107297
|
-
|
|
107298
|
-
|
|
107299
|
-
|
|
107300
|
-
|
|
107301
|
-
|
|
107302
|
-
|
|
107303
|
-
|
|
107304
|
-
|
|
107305
|
-
} catch (e) {
|
|
107306
|
-
allErrors.push(e);
|
|
107307
|
-
results.functions = {
|
|
107308
|
-
successfullyPushed: 0,
|
|
107309
|
-
successfullyDeployed: 0,
|
|
107310
|
-
failedDeployments: [],
|
|
107311
|
-
errors: [e]
|
|
107312
|
-
};
|
|
106173
|
+
if ((shouldPushAll || options.topics) && config2.topics && config2.topics.length > 0) {
|
|
106174
|
+
try {
|
|
106175
|
+
this.log("Pushing topics ...");
|
|
106176
|
+
const result = await this.pushMessagingTopics(config2.topics);
|
|
106177
|
+
this.success(
|
|
106178
|
+
`Successfully pushed ${import_chalk7.default.bold(result.successfullyPushed)} topics.`
|
|
106179
|
+
);
|
|
106180
|
+
results.topics = result;
|
|
106181
|
+
allErrors.push(...result.errors);
|
|
106182
|
+
} catch (e) {
|
|
106183
|
+
allErrors.push(e);
|
|
106184
|
+
results.topics = { successfullyPushed: 0, errors: [e] };
|
|
106185
|
+
}
|
|
107313
106186
|
}
|
|
107314
|
-
|
|
107315
|
-
|
|
107316
|
-
|
|
107317
|
-
|
|
107318
|
-
|
|
107319
|
-
|
|
107320
|
-
|
|
107321
|
-
|
|
107322
|
-
|
|
107323
|
-
|
|
107324
|
-
|
|
107325
|
-
|
|
107326
|
-
|
|
107327
|
-
|
|
107328
|
-
|
|
107329
|
-
|
|
107330
|
-
|
|
107331
|
-
|
|
106187
|
+
if ((shouldPushAll || options.functions) && config2.functions && config2.functions.length > 0) {
|
|
106188
|
+
try {
|
|
106189
|
+
this.log("Pushing functions ...");
|
|
106190
|
+
const result = await this.pushFunctions(
|
|
106191
|
+
config2.functions,
|
|
106192
|
+
options.functionOptions
|
|
106193
|
+
);
|
|
106194
|
+
this.success(
|
|
106195
|
+
`Successfully pushed ${import_chalk7.default.bold(result.successfullyPushed)} functions.`
|
|
106196
|
+
);
|
|
106197
|
+
results.functions = result;
|
|
106198
|
+
allErrors.push(...result.errors);
|
|
106199
|
+
} catch (e) {
|
|
106200
|
+
allErrors.push(e);
|
|
106201
|
+
results.functions = {
|
|
106202
|
+
successfullyPushed: 0,
|
|
106203
|
+
successfullyDeployed: 0,
|
|
106204
|
+
failedDeployments: [],
|
|
106205
|
+
errors: [e]
|
|
106206
|
+
};
|
|
106207
|
+
}
|
|
107332
106208
|
}
|
|
107333
|
-
|
|
107334
|
-
|
|
107335
|
-
|
|
107336
|
-
|
|
107337
|
-
|
|
107338
|
-
|
|
107339
|
-
|
|
107340
|
-
|
|
107341
|
-
|
|
107342
|
-
|
|
107343
|
-
|
|
107344
|
-
|
|
107345
|
-
|
|
107346
|
-
|
|
107347
|
-
|
|
107348
|
-
|
|
106209
|
+
if ((shouldPushAll || options.sites) && config2.sites && config2.sites.length > 0) {
|
|
106210
|
+
try {
|
|
106211
|
+
this.log("Pushing sites ...");
|
|
106212
|
+
const result = await this.pushSites(
|
|
106213
|
+
config2.sites,
|
|
106214
|
+
options.siteOptions
|
|
106215
|
+
);
|
|
106216
|
+
this.success(
|
|
106217
|
+
`Successfully pushed ${import_chalk7.default.bold(result.successfullyPushed)} sites.`
|
|
106218
|
+
);
|
|
106219
|
+
results.sites = result;
|
|
106220
|
+
allErrors.push(...result.errors);
|
|
106221
|
+
} catch (e) {
|
|
106222
|
+
allErrors.push(e);
|
|
106223
|
+
results.sites = {
|
|
106224
|
+
successfullyPushed: 0,
|
|
106225
|
+
successfullyDeployed: 0,
|
|
106226
|
+
failedDeployments: [],
|
|
106227
|
+
errors: [e]
|
|
106228
|
+
};
|
|
106229
|
+
}
|
|
107349
106230
|
}
|
|
107350
|
-
|
|
107351
|
-
|
|
107352
|
-
|
|
107353
|
-
|
|
107354
|
-
|
|
107355
|
-
|
|
107356
|
-
|
|
107357
|
-
|
|
107358
|
-
)
|
|
107359
|
-
|
|
107360
|
-
|
|
107361
|
-
|
|
107362
|
-
|
|
107363
|
-
|
|
107364
|
-
|
|
107365
|
-
|
|
107366
|
-
|
|
107367
|
-
|
|
107368
|
-
|
|
107369
|
-
|
|
107370
|
-
|
|
107371
|
-
|
|
107372
|
-
|
|
107373
|
-
|
|
107374
|
-
|
|
107375
|
-
|
|
106231
|
+
if ((shouldPushAll || options.tables) && config2.tables && config2.tables.length > 0) {
|
|
106232
|
+
try {
|
|
106233
|
+
this.log("Pushing tables ...");
|
|
106234
|
+
const result = await this.pushTables(config2.tables, {
|
|
106235
|
+
attempts: options.tableOptions?.attempts,
|
|
106236
|
+
skipConfirmation: options.skipConfirmation
|
|
106237
|
+
});
|
|
106238
|
+
this.success(
|
|
106239
|
+
`Successfully pushed ${import_chalk7.default.bold(result.successfullyPushed)} tables.`
|
|
106240
|
+
);
|
|
106241
|
+
results.tables = result;
|
|
106242
|
+
allErrors.push(...result.errors);
|
|
106243
|
+
} catch (e) {
|
|
106244
|
+
allErrors.push(e);
|
|
106245
|
+
results.tables = { successfullyPushed: 0, errors: [e] };
|
|
106246
|
+
}
|
|
106247
|
+
}
|
|
106248
|
+
if ((options.collections || shouldPushAll && !skipDeprecated) && config2.collections && config2.collections.length > 0) {
|
|
106249
|
+
try {
|
|
106250
|
+
this.log("Pushing collections ...");
|
|
106251
|
+
const collectionsWithDbNames = config2.collections.map(
|
|
106252
|
+
(collection) => {
|
|
106253
|
+
const database = config2.databases?.find(
|
|
106254
|
+
(db) => db.$id === collection.databaseId
|
|
106255
|
+
);
|
|
106256
|
+
return {
|
|
106257
|
+
...collection,
|
|
106258
|
+
databaseName: database?.name ?? collection.databaseId
|
|
106259
|
+
};
|
|
106260
|
+
}
|
|
106261
|
+
);
|
|
106262
|
+
const result = await this.pushCollections(collectionsWithDbNames, {
|
|
106263
|
+
skipConfirmation: options.skipConfirmation
|
|
106264
|
+
});
|
|
106265
|
+
this.success(
|
|
106266
|
+
`Successfully pushed ${import_chalk7.default.bold(result.successfullyPushed)} collections.`
|
|
106267
|
+
);
|
|
106268
|
+
results.collections = result;
|
|
106269
|
+
allErrors.push(...result.errors);
|
|
106270
|
+
} catch (e) {
|
|
106271
|
+
allErrors.push(e);
|
|
106272
|
+
results.collections = { successfullyPushed: 0, errors: [e] };
|
|
106273
|
+
}
|
|
107376
106274
|
}
|
|
106275
|
+
return {
|
|
106276
|
+
results,
|
|
106277
|
+
errors: allErrors
|
|
106278
|
+
};
|
|
106279
|
+
} finally {
|
|
106280
|
+
cliConfig.force = previousForce;
|
|
107377
106281
|
}
|
|
107378
|
-
return {
|
|
107379
|
-
results,
|
|
107380
|
-
errors: allErrors
|
|
107381
|
-
};
|
|
107382
106282
|
}
|
|
107383
106283
|
async pushSettings(config2) {
|
|
107384
106284
|
const projectsService = await getProjectsService(this.consoleClient);
|
|
@@ -107453,12 +106353,43 @@ var Push = class {
|
|
|
107453
106353
|
async pushBuckets(buckets) {
|
|
107454
106354
|
let successfullyPushed = 0;
|
|
107455
106355
|
const errors = [];
|
|
106356
|
+
const hasBucketChanges = (remoteBucket, localBucket) => {
|
|
106357
|
+
const scalarFields = [
|
|
106358
|
+
"name",
|
|
106359
|
+
"fileSecurity",
|
|
106360
|
+
"enabled",
|
|
106361
|
+
"maximumFileSize",
|
|
106362
|
+
"encryption",
|
|
106363
|
+
"antivirus",
|
|
106364
|
+
"compression"
|
|
106365
|
+
];
|
|
106366
|
+
if (scalarFields.some((field) => remoteBucket[field] !== localBucket[field])) {
|
|
106367
|
+
return true;
|
|
106368
|
+
}
|
|
106369
|
+
if (!arrayEqualsUnordered(
|
|
106370
|
+
remoteBucket["$permissions"],
|
|
106371
|
+
localBucket["$permissions"]
|
|
106372
|
+
)) {
|
|
106373
|
+
return true;
|
|
106374
|
+
}
|
|
106375
|
+
return !arrayEqualsUnordered(
|
|
106376
|
+
remoteBucket.allowedFileExtensions,
|
|
106377
|
+
localBucket.allowedFileExtensions
|
|
106378
|
+
);
|
|
106379
|
+
};
|
|
107456
106380
|
for (const bucket of buckets) {
|
|
107457
106381
|
try {
|
|
107458
106382
|
this.log(`Pushing bucket ${import_chalk7.default.bold(bucket["name"])} ...`);
|
|
107459
106383
|
const storageService = await getStorageService(this.projectClient);
|
|
107460
106384
|
try {
|
|
107461
|
-
await storageService.getBucket(bucket["$id"]);
|
|
106385
|
+
const remoteBucket = await storageService.getBucket(bucket["$id"]);
|
|
106386
|
+
const hasChanges = hasBucketChanges(remoteBucket, bucket);
|
|
106387
|
+
if (!hasChanges) {
|
|
106388
|
+
this.log(
|
|
106389
|
+
`No changes detected for bucket ${import_chalk7.default.bold(bucket["name"])}. Skipping.`
|
|
106390
|
+
);
|
|
106391
|
+
continue;
|
|
106392
|
+
}
|
|
107462
106393
|
await storageService.updateBucket({
|
|
107463
106394
|
bucketId: bucket["$id"],
|
|
107464
106395
|
name: bucket.name,
|
|
@@ -107471,6 +106402,7 @@ var Push = class {
|
|
|
107471
106402
|
antivirus: bucket.antivirus,
|
|
107472
106403
|
compression: bucket.compression
|
|
107473
106404
|
});
|
|
106405
|
+
successfullyPushed++;
|
|
107474
106406
|
} catch (e) {
|
|
107475
106407
|
if (e instanceof AppwriteException && Number(e.code) === 404) {
|
|
107476
106408
|
await storageService.createBucket({
|
|
@@ -107485,11 +106417,11 @@ var Push = class {
|
|
|
107485
106417
|
encryption: bucket.encryption,
|
|
107486
106418
|
antivirus: bucket.antivirus
|
|
107487
106419
|
});
|
|
106420
|
+
successfullyPushed++;
|
|
107488
106421
|
} else {
|
|
107489
106422
|
throw e;
|
|
107490
106423
|
}
|
|
107491
106424
|
}
|
|
107492
|
-
successfullyPushed++;
|
|
107493
106425
|
} catch (e) {
|
|
107494
106426
|
errors.push(e);
|
|
107495
106427
|
this.error(`Failed to push bucket ${bucket["name"]}: ${e.message}`);
|
|
@@ -108170,8 +107102,12 @@ var Push = class {
|
|
|
108170
107102
|
async pushTables(tables, options = {}) {
|
|
108171
107103
|
const { attempts, skipConfirmation = false } = options;
|
|
108172
107104
|
const pollMaxDebounces = attempts ?? POLL_DEFAULT_VALUE;
|
|
108173
|
-
const pools = new Pools(pollMaxDebounces);
|
|
108174
|
-
const attributes = new Attributes(
|
|
107105
|
+
const pools = new Pools(pollMaxDebounces, this.projectClient);
|
|
107106
|
+
const attributes = new Attributes(
|
|
107107
|
+
pools,
|
|
107108
|
+
skipConfirmation,
|
|
107109
|
+
this.projectClient
|
|
107110
|
+
);
|
|
108175
107111
|
let tablesChanged = /* @__PURE__ */ new Set();
|
|
108176
107112
|
const errors = [];
|
|
108177
107113
|
await Promise.all(
|
|
@@ -108246,6 +107182,11 @@ var Push = class {
|
|
|
108246
107182
|
indexes = indexesResult.attributes;
|
|
108247
107183
|
hadChanges = columnsResult.hasChanges || indexesResult.hasChanges;
|
|
108248
107184
|
if (!hadChanges && columns.length <= 0 && indexes.length <= 0) {
|
|
107185
|
+
if (!tablesChanged.has(table["$id"])) {
|
|
107186
|
+
this.log(
|
|
107187
|
+
`No changes detected for table ${import_chalk7.default.bold(table["name"])}. Skipping.`
|
|
107188
|
+
);
|
|
107189
|
+
}
|
|
108249
107190
|
continue;
|
|
108250
107191
|
}
|
|
108251
107192
|
}
|
|
@@ -108274,8 +107215,12 @@ var Push = class {
|
|
|
108274
107215
|
}
|
|
108275
107216
|
async pushCollections(collections, options = {}) {
|
|
108276
107217
|
const { skipConfirmation = false } = options;
|
|
108277
|
-
const pools = new Pools(POLL_DEFAULT_VALUE);
|
|
108278
|
-
const attributesHelper = new Attributes(
|
|
107218
|
+
const pools = new Pools(POLL_DEFAULT_VALUE, this.projectClient);
|
|
107219
|
+
const attributesHelper = new Attributes(
|
|
107220
|
+
pools,
|
|
107221
|
+
skipConfirmation,
|
|
107222
|
+
this.projectClient
|
|
107223
|
+
);
|
|
108279
107224
|
const errors = [];
|
|
108280
107225
|
const collectionsWithState = collections;
|
|
108281
107226
|
const databases = Array.from(
|
|
@@ -108963,10 +107908,11 @@ var pushCollection = async () => {
|
|
|
108963
107908
|
const localDatabase = localConfig.getDatabase(collection.databaseId);
|
|
108964
107909
|
collection.databaseName = localDatabase.name ?? collection.databaseId;
|
|
108965
107910
|
});
|
|
107911
|
+
const projectClient = await sdkForProject();
|
|
108966
107912
|
if (!await approveChanges(
|
|
108967
107913
|
collections,
|
|
108968
107914
|
async (args) => {
|
|
108969
|
-
const databasesService = await getDatabasesService();
|
|
107915
|
+
const databasesService = await getDatabasesService(projectClient);
|
|
108970
107916
|
return await databasesService.getCollection(
|
|
108971
107917
|
args.databaseId,
|
|
108972
107918
|
args.collectionId
|
|
@@ -109916,7 +108862,6 @@ pull.command("team").alias("teams").description("Pull your Appwrite teams").acti
|
|
|
109916
108862
|
pull.command("topic").alias("topics").description("Pull your Appwrite messaging topics").action(actionRunner(pullMessagingTopic));
|
|
109917
108863
|
|
|
109918
108864
|
// lib/commands/schema.ts
|
|
109919
|
-
var import_json_bigint3 = __toESM(require_json_bigint(), 1);
|
|
109920
108865
|
import * as fs7 from "fs";
|
|
109921
108866
|
import * as path6 from "path";
|
|
109922
108867
|
|
|
@@ -110185,7 +109130,13 @@ var BaseDatabasesGenerator = class {
|
|
|
110185
109130
|
if (!fs6.existsSync(sdkDir)) {
|
|
110186
109131
|
fs6.mkdirSync(sdkDir, { recursive: true });
|
|
110187
109132
|
}
|
|
110188
|
-
|
|
109133
|
+
const fileEntries = [
|
|
109134
|
+
["databases.ts", result.dbContent],
|
|
109135
|
+
["types.ts", result.typesContent],
|
|
109136
|
+
["index.ts", result.indexContent],
|
|
109137
|
+
["constants.ts", result.constantsContent]
|
|
109138
|
+
];
|
|
109139
|
+
for (const [relativePath, content] of fileEntries) {
|
|
110189
109140
|
const filePath = path5.join(sdkDir, relativePath);
|
|
110190
109141
|
const fileDir = path5.dirname(filePath);
|
|
110191
109142
|
if (!fs6.existsSync(fileDir)) {
|
|
@@ -110197,10 +109148,13 @@ var BaseDatabasesGenerator = class {
|
|
|
110197
109148
|
fs6.writeFileSync(filePath, content, "utf-8");
|
|
110198
109149
|
}
|
|
110199
109150
|
}
|
|
110200
|
-
getGeneratedFilePaths(
|
|
110201
|
-
return
|
|
110202
|
-
|
|
110203
|
-
|
|
109151
|
+
getGeneratedFilePaths(_result) {
|
|
109152
|
+
return [
|
|
109153
|
+
path5.join(SDK_TITLE_LOWER, "databases.ts"),
|
|
109154
|
+
path5.join(SDK_TITLE_LOWER, "types.ts"),
|
|
109155
|
+
path5.join(SDK_TITLE_LOWER, "index.ts"),
|
|
109156
|
+
path5.join(SDK_TITLE_LOWER, "constants.ts")
|
|
109157
|
+
];
|
|
110204
109158
|
}
|
|
110205
109159
|
};
|
|
110206
109160
|
|
|
@@ -110527,34 +109481,28 @@ ${supportsServerSide ? ` create: (databaseId: string, name: string, options?: {
|
|
|
110527
109481
|
throw new Error("Project ID is required in configuration");
|
|
110528
109482
|
}
|
|
110529
109483
|
const importExt = detectImportExtension();
|
|
110530
|
-
const files = /* @__PURE__ */ new Map();
|
|
110531
109484
|
const hasEntities = config2.tables && config2.tables.length > 0 || config2.collections && config2.collections.length > 0;
|
|
110532
109485
|
if (!hasEntities) {
|
|
110533
109486
|
console.log(
|
|
110534
109487
|
"No tables or collections found in configuration. Skipping database generation."
|
|
110535
109488
|
);
|
|
110536
|
-
|
|
110537
|
-
"
|
|
110538
|
-
"// No tables or collections found in configuration\n"
|
|
110539
|
-
|
|
110540
|
-
|
|
110541
|
-
|
|
110542
|
-
"// No tables or collections found in configuration\n"
|
|
110543
|
-
);
|
|
110544
|
-
files.set("index.ts", this.generateIndexFile(importExt));
|
|
110545
|
-
files.set("constants.ts", this.generateConstantsFile(config2));
|
|
110546
|
-
return { files };
|
|
109489
|
+
return {
|
|
109490
|
+
dbContent: "// No tables or collections found in configuration\n",
|
|
109491
|
+
typesContent: "// No tables or collections found in configuration\n",
|
|
109492
|
+
indexContent: this.generateIndexFile(importExt),
|
|
109493
|
+
constantsContent: this.generateConstantsFile(config2)
|
|
109494
|
+
};
|
|
110547
109495
|
}
|
|
110548
|
-
|
|
110549
|
-
|
|
110550
|
-
|
|
110551
|
-
|
|
110552
|
-
|
|
109496
|
+
return {
|
|
109497
|
+
dbContent: this.generateDatabasesFile(config2, importExt),
|
|
109498
|
+
typesContent: this.generateTypesFile(config2),
|
|
109499
|
+
indexContent: this.generateIndexFile(importExt),
|
|
109500
|
+
constantsContent: this.generateConstantsFile(config2)
|
|
109501
|
+
};
|
|
110553
109502
|
}
|
|
110554
109503
|
};
|
|
110555
109504
|
|
|
110556
109505
|
// lib/commands/schema.ts
|
|
110557
|
-
var JSONBig2 = (0, import_json_bigint3.default)({ useNativeBigInt: true });
|
|
110558
109506
|
var Schema = class {
|
|
110559
109507
|
pullCommand;
|
|
110560
109508
|
pushCommand;
|
|
@@ -110627,7 +109575,7 @@ var Schema = class {
|
|
|
110627
109575
|
* @returns The configuration object.
|
|
110628
109576
|
*/
|
|
110629
109577
|
read(path7) {
|
|
110630
|
-
return
|
|
109578
|
+
return JSONBig.parse(fs7.readFileSync(path7, "utf8"));
|
|
110631
109579
|
}
|
|
110632
109580
|
/**
|
|
110633
109581
|
* Writes the configuration object to a file.
|
|
@@ -110638,13 +109586,14 @@ var Schema = class {
|
|
|
110638
109586
|
*/
|
|
110639
109587
|
write(config2, filePath) {
|
|
110640
109588
|
const resolvedPath = path6.resolve(filePath);
|
|
110641
|
-
const content =
|
|
109589
|
+
const content = JSONBig.stringify(config2, null, 4);
|
|
110642
109590
|
fs7.writeFileSync(resolvedPath, content);
|
|
110643
109591
|
}
|
|
110644
109592
|
};
|
|
110645
109593
|
export {
|
|
110646
109594
|
AttributeSchema,
|
|
110647
109595
|
BucketSchema,
|
|
109596
|
+
Client,
|
|
110648
109597
|
CollectionSchema,
|
|
110649
109598
|
ColumnSchema,
|
|
110650
109599
|
ConfigSchema,
|