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/cli.cjs
CHANGED
|
@@ -21956,9 +21956,9 @@ var require_stream_duplex = __commonJS({
|
|
|
21956
21956
|
}
|
|
21957
21957
|
});
|
|
21958
21958
|
|
|
21959
|
-
// node_modules/safe-buffer/index.js
|
|
21959
|
+
// node_modules/string_decoder/node_modules/safe-buffer/index.js
|
|
21960
21960
|
var require_safe_buffer = __commonJS({
|
|
21961
|
-
"node_modules/safe-buffer/index.js"(exports2, module2) {
|
|
21961
|
+
"node_modules/string_decoder/node_modules/safe-buffer/index.js"(exports2, module2) {
|
|
21962
21962
|
var buffer = require("buffer");
|
|
21963
21963
|
var Buffer2 = buffer.Buffer;
|
|
21964
21964
|
function copyProps(src, dst) {
|
|
@@ -24518,16 +24518,16 @@ var require_base = __commonJS({
|
|
|
24518
24518
|
}),
|
|
24519
24519
|
share()
|
|
24520
24520
|
);
|
|
24521
|
-
const
|
|
24521
|
+
const success20 = validation.pipe(
|
|
24522
24522
|
filter((state) => state.isValid === true),
|
|
24523
24523
|
take(1)
|
|
24524
24524
|
);
|
|
24525
24525
|
const error49 = validation.pipe(
|
|
24526
24526
|
filter((state) => state.isValid !== true),
|
|
24527
|
-
takeUntil(
|
|
24527
|
+
takeUntil(success20)
|
|
24528
24528
|
);
|
|
24529
24529
|
return {
|
|
24530
|
-
success:
|
|
24530
|
+
success: success20,
|
|
24531
24531
|
error: error49
|
|
24532
24532
|
};
|
|
24533
24533
|
}
|
|
@@ -53947,14 +53947,14 @@ var require_undici = __commonJS({
|
|
|
53947
53947
|
}
|
|
53948
53948
|
});
|
|
53949
53949
|
|
|
53950
|
-
// node_modules/
|
|
53950
|
+
// node_modules/bignumber.js/bignumber.js
|
|
53951
53951
|
var require_bignumber = __commonJS({
|
|
53952
|
-
"node_modules/
|
|
53952
|
+
"node_modules/bignumber.js/bignumber.js"(exports2, module2) {
|
|
53953
53953
|
(function(globalObject) {
|
|
53954
53954
|
"use strict";
|
|
53955
|
-
var
|
|
53955
|
+
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;
|
|
53956
53956
|
function clone2(configObject) {
|
|
53957
|
-
var div, convertBase, parseNumeric, P =
|
|
53957
|
+
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 = {
|
|
53958
53958
|
prefix: "",
|
|
53959
53959
|
groupSize: 3,
|
|
53960
53960
|
secondaryGroupSize: 0,
|
|
@@ -53965,9 +53965,9 @@ var require_bignumber = __commonJS({
|
|
|
53965
53965
|
// non-breaking space
|
|
53966
53966
|
suffix: ""
|
|
53967
53967
|
}, ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz", alphabetHasNormalDecimalDigits = true;
|
|
53968
|
-
function
|
|
53968
|
+
function BigNumber2(v, b) {
|
|
53969
53969
|
var alphabet, c, caseChanged, e, i, isNum, len, str, x = this;
|
|
53970
|
-
if (!(x instanceof
|
|
53970
|
+
if (!(x instanceof BigNumber2)) return new BigNumber2(v, b);
|
|
53971
53971
|
if (b == null) {
|
|
53972
53972
|
if (v && v._isBigNumber === true) {
|
|
53973
53973
|
x.s = v.s;
|
|
@@ -54009,14 +54009,14 @@ var require_bignumber = __commonJS({
|
|
|
54009
54009
|
} else {
|
|
54010
54010
|
intCheck(b, 2, ALPHABET.length, "Base");
|
|
54011
54011
|
if (b == 10 && alphabetHasNormalDecimalDigits) {
|
|
54012
|
-
x = new
|
|
54012
|
+
x = new BigNumber2(v);
|
|
54013
54013
|
return round(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE);
|
|
54014
54014
|
}
|
|
54015
54015
|
str = String(v);
|
|
54016
54016
|
if (isNum = typeof v == "number") {
|
|
54017
54017
|
if (v * 0 != 0) return parseNumeric(x, str, isNum, b);
|
|
54018
54018
|
x.s = 1 / v < 0 ? (str = str.slice(1), -1) : 1;
|
|
54019
|
-
if (
|
|
54019
|
+
if (BigNumber2.DEBUG && str.replace(/^0\.0*|\./, "").length > 15) {
|
|
54020
54020
|
throw Error(tooManyDigits + v);
|
|
54021
54021
|
}
|
|
54022
54022
|
} else {
|
|
@@ -54051,7 +54051,7 @@ var require_bignumber = __commonJS({
|
|
|
54051
54051
|
for (len = str.length; str.charCodeAt(--len) === 48; ) ;
|
|
54052
54052
|
if (str = str.slice(i, ++len)) {
|
|
54053
54053
|
len -= i;
|
|
54054
|
-
if (isNum &&
|
|
54054
|
+
if (isNum && BigNumber2.DEBUG && len > 15 && (v > MAX_SAFE_INTEGER || v !== mathfloor(v))) {
|
|
54055
54055
|
throw Error(tooManyDigits + x.s * v);
|
|
54056
54056
|
}
|
|
54057
54057
|
if ((e = e - i - 1) > MAX_EXP) {
|
|
@@ -54079,18 +54079,18 @@ var require_bignumber = __commonJS({
|
|
|
54079
54079
|
x.c = [x.e = 0];
|
|
54080
54080
|
}
|
|
54081
54081
|
}
|
|
54082
|
-
|
|
54083
|
-
|
|
54084
|
-
|
|
54085
|
-
|
|
54086
|
-
|
|
54087
|
-
|
|
54088
|
-
|
|
54089
|
-
|
|
54090
|
-
|
|
54091
|
-
|
|
54092
|
-
|
|
54093
|
-
|
|
54082
|
+
BigNumber2.clone = clone2;
|
|
54083
|
+
BigNumber2.ROUND_UP = 0;
|
|
54084
|
+
BigNumber2.ROUND_DOWN = 1;
|
|
54085
|
+
BigNumber2.ROUND_CEIL = 2;
|
|
54086
|
+
BigNumber2.ROUND_FLOOR = 3;
|
|
54087
|
+
BigNumber2.ROUND_HALF_UP = 4;
|
|
54088
|
+
BigNumber2.ROUND_HALF_DOWN = 5;
|
|
54089
|
+
BigNumber2.ROUND_HALF_EVEN = 6;
|
|
54090
|
+
BigNumber2.ROUND_HALF_CEIL = 7;
|
|
54091
|
+
BigNumber2.ROUND_HALF_FLOOR = 8;
|
|
54092
|
+
BigNumber2.EUCLID = 9;
|
|
54093
|
+
BigNumber2.config = BigNumber2.set = function(obj) {
|
|
54094
54094
|
var p, v;
|
|
54095
54095
|
if (obj != null) {
|
|
54096
54096
|
if (typeof obj == "object") {
|
|
@@ -54189,9 +54189,9 @@ var require_bignumber = __commonJS({
|
|
|
54189
54189
|
ALPHABET
|
|
54190
54190
|
};
|
|
54191
54191
|
};
|
|
54192
|
-
|
|
54192
|
+
BigNumber2.isBigNumber = function(v) {
|
|
54193
54193
|
if (!v || v._isBigNumber !== true) return false;
|
|
54194
|
-
if (!
|
|
54194
|
+
if (!BigNumber2.DEBUG) return true;
|
|
54195
54195
|
var i, n, c = v.c, e = v.e, s = v.s;
|
|
54196
54196
|
out: if ({}.toString.call(c) == "[object Array]") {
|
|
54197
54197
|
if ((s === 1 || s === -1) && e >= -MAX && e <= MAX && e === mathfloor(e)) {
|
|
@@ -54214,13 +54214,13 @@ var require_bignumber = __commonJS({
|
|
|
54214
54214
|
}
|
|
54215
54215
|
throw Error(bignumberError + "Invalid BigNumber: " + v);
|
|
54216
54216
|
};
|
|
54217
|
-
|
|
54217
|
+
BigNumber2.maximum = BigNumber2.max = function() {
|
|
54218
54218
|
return maxOrMin(arguments, -1);
|
|
54219
54219
|
};
|
|
54220
|
-
|
|
54220
|
+
BigNumber2.minimum = BigNumber2.min = function() {
|
|
54221
54221
|
return maxOrMin(arguments, 1);
|
|
54222
54222
|
};
|
|
54223
|
-
|
|
54223
|
+
BigNumber2.random = (function() {
|
|
54224
54224
|
var pow2_53 = 9007199254740992;
|
|
54225
54225
|
var random53bitInt = Math.random() * pow2_53 & 2097151 ? function() {
|
|
54226
54226
|
return mathfloor(Math.random() * pow2_53);
|
|
@@ -54228,7 +54228,7 @@ var require_bignumber = __commonJS({
|
|
|
54228
54228
|
return (Math.random() * 1073741824 | 0) * 8388608 + (Math.random() * 8388608 | 0);
|
|
54229
54229
|
};
|
|
54230
54230
|
return function(dp) {
|
|
54231
|
-
var a, b, e, k, v, i = 0, c = [], rand = new
|
|
54231
|
+
var a, b, e, k, v, i = 0, c = [], rand = new BigNumber2(ONE);
|
|
54232
54232
|
if (dp == null) dp = DECIMAL_PLACES;
|
|
54233
54233
|
else intCheck(dp, 0, MAX);
|
|
54234
54234
|
k = mathceil(dp / LOG_BASE);
|
|
@@ -54289,8 +54289,8 @@ var require_bignumber = __commonJS({
|
|
|
54289
54289
|
return rand;
|
|
54290
54290
|
};
|
|
54291
54291
|
})();
|
|
54292
|
-
|
|
54293
|
-
var i = 1, args = arguments, sum = new
|
|
54292
|
+
BigNumber2.sum = function() {
|
|
54293
|
+
var i = 1, args = arguments, sum = new BigNumber2(args[0]);
|
|
54294
54294
|
for (; i < args.length; ) sum = sum.plus(args[i++]);
|
|
54295
54295
|
return sum;
|
|
54296
54296
|
};
|
|
@@ -54317,7 +54317,7 @@ var require_bignumber = __commonJS({
|
|
|
54317
54317
|
k = POW_PRECISION;
|
|
54318
54318
|
POW_PRECISION = 0;
|
|
54319
54319
|
str = str.replace(".", "");
|
|
54320
|
-
y = new
|
|
54320
|
+
y = new BigNumber2(baseIn);
|
|
54321
54321
|
x = y.pow(str.length - i);
|
|
54322
54322
|
POW_PRECISION = k;
|
|
54323
54323
|
y.c = toBaseOut(
|
|
@@ -54408,7 +54408,7 @@ var require_bignumber = __commonJS({
|
|
|
54408
54408
|
return function(x, y, dp, rm, base) {
|
|
54409
54409
|
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;
|
|
54410
54410
|
if (!xc || !xc[0] || !yc || !yc[0]) {
|
|
54411
|
-
return new
|
|
54411
|
+
return new BigNumber2(
|
|
54412
54412
|
// Return NaN if either NaN, or both Infinity or 0.
|
|
54413
54413
|
!x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN : (
|
|
54414
54414
|
// Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.
|
|
@@ -54416,7 +54416,7 @@ var require_bignumber = __commonJS({
|
|
|
54416
54416
|
)
|
|
54417
54417
|
);
|
|
54418
54418
|
}
|
|
54419
|
-
q = new
|
|
54419
|
+
q = new BigNumber2(s);
|
|
54420
54420
|
qc = q.c = [];
|
|
54421
54421
|
e = x.e - y.e;
|
|
54422
54422
|
s = dp + e + 1;
|
|
@@ -54521,7 +54521,7 @@ var require_bignumber = __commonJS({
|
|
|
54521
54521
|
str = coeffToString(n.c);
|
|
54522
54522
|
str = id == 1 || id == 2 && (ne <= TO_EXP_NEG || ne >= TO_EXP_POS) ? toExponential(str, ne) : toFixedPoint(str, ne, "0");
|
|
54523
54523
|
} else {
|
|
54524
|
-
n = round(new
|
|
54524
|
+
n = round(new BigNumber2(n), i, rm);
|
|
54525
54525
|
e = n.e;
|
|
54526
54526
|
str = coeffToString(n.c);
|
|
54527
54527
|
len = str.length;
|
|
@@ -54545,9 +54545,9 @@ var require_bignumber = __commonJS({
|
|
|
54545
54545
|
return n.s < 0 && c0 ? "-" + str : str;
|
|
54546
54546
|
}
|
|
54547
54547
|
function maxOrMin(args, n) {
|
|
54548
|
-
var k, y, i = 1, x = new
|
|
54548
|
+
var k, y, i = 1, x = new BigNumber2(args[0]);
|
|
54549
54549
|
for (; i < args.length; i++) {
|
|
54550
|
-
y = new
|
|
54550
|
+
y = new BigNumber2(args[i]);
|
|
54551
54551
|
if (!y.s || (k = compare(x, y)) === n || k === 0 && x.s === n) {
|
|
54552
54552
|
x = y;
|
|
54553
54553
|
}
|
|
@@ -54584,9 +54584,9 @@ var require_bignumber = __commonJS({
|
|
|
54584
54584
|
base = b;
|
|
54585
54585
|
s = s.replace(dotAfter, "$1").replace(dotBefore, "0.$1");
|
|
54586
54586
|
}
|
|
54587
|
-
if (str != s) return new
|
|
54587
|
+
if (str != s) return new BigNumber2(s, base);
|
|
54588
54588
|
}
|
|
54589
|
-
if (
|
|
54589
|
+
if (BigNumber2.DEBUG) {
|
|
54590
54590
|
throw Error(bignumberError + "Not a" + (b ? " base " + b : "") + " number: " + str);
|
|
54591
54591
|
}
|
|
54592
54592
|
x.s = null;
|
|
@@ -54688,12 +54688,12 @@ var require_bignumber = __commonJS({
|
|
|
54688
54688
|
return n.s < 0 ? "-" + str : str;
|
|
54689
54689
|
}
|
|
54690
54690
|
P.absoluteValue = P.abs = function() {
|
|
54691
|
-
var x = new
|
|
54691
|
+
var x = new BigNumber2(this);
|
|
54692
54692
|
if (x.s < 0) x.s = 1;
|
|
54693
54693
|
return x;
|
|
54694
54694
|
};
|
|
54695
54695
|
P.comparedTo = function(y, b) {
|
|
54696
|
-
return compare(this, new
|
|
54696
|
+
return compare(this, new BigNumber2(y, b));
|
|
54697
54697
|
};
|
|
54698
54698
|
P.decimalPlaces = P.dp = function(dp, rm) {
|
|
54699
54699
|
var c, n, v, x = this;
|
|
@@ -54701,7 +54701,7 @@ var require_bignumber = __commonJS({
|
|
|
54701
54701
|
intCheck(dp, 0, MAX);
|
|
54702
54702
|
if (rm == null) rm = ROUNDING_MODE;
|
|
54703
54703
|
else intCheck(rm, 0, 8);
|
|
54704
|
-
return round(new
|
|
54704
|
+
return round(new BigNumber2(x), dp + x.e + 1, rm);
|
|
54705
54705
|
}
|
|
54706
54706
|
if (!(c = x.c)) return null;
|
|
54707
54707
|
n = ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE;
|
|
@@ -54710,44 +54710,44 @@ var require_bignumber = __commonJS({
|
|
|
54710
54710
|
return n;
|
|
54711
54711
|
};
|
|
54712
54712
|
P.dividedBy = P.div = function(y, b) {
|
|
54713
|
-
return div(this, new
|
|
54713
|
+
return div(this, new BigNumber2(y, b), DECIMAL_PLACES, ROUNDING_MODE);
|
|
54714
54714
|
};
|
|
54715
54715
|
P.dividedToIntegerBy = P.idiv = function(y, b) {
|
|
54716
|
-
return div(this, new
|
|
54716
|
+
return div(this, new BigNumber2(y, b), 0, 1);
|
|
54717
54717
|
};
|
|
54718
54718
|
P.exponentiatedBy = P.pow = function(n, m) {
|
|
54719
54719
|
var half, isModExp, i, k, more, nIsBig, nIsNeg, nIsOdd, y, x = this;
|
|
54720
|
-
n = new
|
|
54720
|
+
n = new BigNumber2(n);
|
|
54721
54721
|
if (n.c && !n.isInteger()) {
|
|
54722
54722
|
throw Error(bignumberError + "Exponent not an integer: " + valueOf(n));
|
|
54723
54723
|
}
|
|
54724
|
-
if (m != null) m = new
|
|
54724
|
+
if (m != null) m = new BigNumber2(m);
|
|
54725
54725
|
nIsBig = n.e > 14;
|
|
54726
54726
|
if (!x.c || !x.c[0] || x.c[0] == 1 && !x.e && x.c.length == 1 || !n.c || !n.c[0]) {
|
|
54727
|
-
y = new
|
|
54727
|
+
y = new BigNumber2(Math.pow(+valueOf(x), nIsBig ? n.s * (2 - isOdd(n)) : +valueOf(n)));
|
|
54728
54728
|
return m ? y.mod(m) : y;
|
|
54729
54729
|
}
|
|
54730
54730
|
nIsNeg = n.s < 0;
|
|
54731
54731
|
if (m) {
|
|
54732
|
-
if (m.c ? !m.c[0] : !m.s) return new
|
|
54732
|
+
if (m.c ? !m.c[0] : !m.s) return new BigNumber2(NaN);
|
|
54733
54733
|
isModExp = !nIsNeg && x.isInteger() && m.isInteger();
|
|
54734
54734
|
if (isModExp) x = x.mod(m);
|
|
54735
54735
|
} 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))) {
|
|
54736
54736
|
k = x.s < 0 && isOdd(n) ? -0 : 0;
|
|
54737
54737
|
if (x.e > -1) k = 1 / k;
|
|
54738
|
-
return new
|
|
54738
|
+
return new BigNumber2(nIsNeg ? 1 / k : k);
|
|
54739
54739
|
} else if (POW_PRECISION) {
|
|
54740
54740
|
k = mathceil(POW_PRECISION / LOG_BASE + 2);
|
|
54741
54741
|
}
|
|
54742
54742
|
if (nIsBig) {
|
|
54743
|
-
half = new
|
|
54743
|
+
half = new BigNumber2(0.5);
|
|
54744
54744
|
if (nIsNeg) n.s = 1;
|
|
54745
54745
|
nIsOdd = isOdd(n);
|
|
54746
54746
|
} else {
|
|
54747
54747
|
i = Math.abs(+valueOf(n));
|
|
54748
54748
|
nIsOdd = i % 2;
|
|
54749
54749
|
}
|
|
54750
|
-
y = new
|
|
54750
|
+
y = new BigNumber2(ONE);
|
|
54751
54751
|
for (; ; ) {
|
|
54752
54752
|
if (nIsOdd) {
|
|
54753
54753
|
y = y.times(x);
|
|
@@ -54785,31 +54785,31 @@ var require_bignumber = __commonJS({
|
|
|
54785
54785
|
return m ? y.mod(m) : k ? round(y, POW_PRECISION, ROUNDING_MODE, more) : y;
|
|
54786
54786
|
};
|
|
54787
54787
|
P.integerValue = function(rm) {
|
|
54788
|
-
var n = new
|
|
54788
|
+
var n = new BigNumber2(this);
|
|
54789
54789
|
if (rm == null) rm = ROUNDING_MODE;
|
|
54790
54790
|
else intCheck(rm, 0, 8);
|
|
54791
54791
|
return round(n, n.e + 1, rm);
|
|
54792
54792
|
};
|
|
54793
54793
|
P.isEqualTo = P.eq = function(y, b) {
|
|
54794
|
-
return compare(this, new
|
|
54794
|
+
return compare(this, new BigNumber2(y, b)) === 0;
|
|
54795
54795
|
};
|
|
54796
54796
|
P.isFinite = function() {
|
|
54797
54797
|
return !!this.c;
|
|
54798
54798
|
};
|
|
54799
54799
|
P.isGreaterThan = P.gt = function(y, b) {
|
|
54800
|
-
return compare(this, new
|
|
54800
|
+
return compare(this, new BigNumber2(y, b)) > 0;
|
|
54801
54801
|
};
|
|
54802
54802
|
P.isGreaterThanOrEqualTo = P.gte = function(y, b) {
|
|
54803
|
-
return (b = compare(this, new
|
|
54803
|
+
return (b = compare(this, new BigNumber2(y, b))) === 1 || b === 0;
|
|
54804
54804
|
};
|
|
54805
54805
|
P.isInteger = function() {
|
|
54806
54806
|
return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2;
|
|
54807
54807
|
};
|
|
54808
54808
|
P.isLessThan = P.lt = function(y, b) {
|
|
54809
|
-
return compare(this, new
|
|
54809
|
+
return compare(this, new BigNumber2(y, b)) < 0;
|
|
54810
54810
|
};
|
|
54811
54811
|
P.isLessThanOrEqualTo = P.lte = function(y, b) {
|
|
54812
|
-
return (b = compare(this, new
|
|
54812
|
+
return (b = compare(this, new BigNumber2(y, b))) === -1 || b === 0;
|
|
54813
54813
|
};
|
|
54814
54814
|
P.isNaN = function() {
|
|
54815
54815
|
return !this.s;
|
|
@@ -54825,18 +54825,18 @@ var require_bignumber = __commonJS({
|
|
|
54825
54825
|
};
|
|
54826
54826
|
P.minus = function(y, b) {
|
|
54827
54827
|
var i, j, t, xLTy, x = this, a = x.s;
|
|
54828
|
-
y = new
|
|
54828
|
+
y = new BigNumber2(y, b);
|
|
54829
54829
|
b = y.s;
|
|
54830
|
-
if (!a || !b) return new
|
|
54830
|
+
if (!a || !b) return new BigNumber2(NaN);
|
|
54831
54831
|
if (a != b) {
|
|
54832
54832
|
y.s = -b;
|
|
54833
54833
|
return x.plus(y);
|
|
54834
54834
|
}
|
|
54835
54835
|
var xe = x.e / LOG_BASE, ye = y.e / LOG_BASE, xc = x.c, yc = y.c;
|
|
54836
54836
|
if (!xe || !ye) {
|
|
54837
|
-
if (!xc || !yc) return xc ? (y.s = -b, y) : new
|
|
54837
|
+
if (!xc || !yc) return xc ? (y.s = -b, y) : new BigNumber2(yc ? x : NaN);
|
|
54838
54838
|
if (!xc[0] || !yc[0]) {
|
|
54839
|
-
return yc[0] ? (y.s = -b, y) : new
|
|
54839
|
+
return yc[0] ? (y.s = -b, y) : new BigNumber2(xc[0] ? x : (
|
|
54840
54840
|
// IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity
|
|
54841
54841
|
ROUNDING_MODE == 3 ? -0 : 0
|
|
54842
54842
|
));
|
|
@@ -54892,11 +54892,11 @@ var require_bignumber = __commonJS({
|
|
|
54892
54892
|
};
|
|
54893
54893
|
P.modulo = P.mod = function(y, b) {
|
|
54894
54894
|
var q, s, x = this;
|
|
54895
|
-
y = new
|
|
54895
|
+
y = new BigNumber2(y, b);
|
|
54896
54896
|
if (!x.c || !y.s || y.c && !y.c[0]) {
|
|
54897
|
-
return new
|
|
54897
|
+
return new BigNumber2(NaN);
|
|
54898
54898
|
} else if (!y.c || x.c && !x.c[0]) {
|
|
54899
|
-
return new
|
|
54899
|
+
return new BigNumber2(x);
|
|
54900
54900
|
}
|
|
54901
54901
|
if (MODULO_MODE == 9) {
|
|
54902
54902
|
s = y.s;
|
|
@@ -54912,7 +54912,7 @@ var require_bignumber = __commonJS({
|
|
|
54912
54912
|
return y;
|
|
54913
54913
|
};
|
|
54914
54914
|
P.multipliedBy = P.times = function(y, b) {
|
|
54915
|
-
var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc, base, sqrtBase, x = this, xc = x.c, yc = (y = new
|
|
54915
|
+
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;
|
|
54916
54916
|
if (!xc || !yc || !xc[0] || !yc[0]) {
|
|
54917
54917
|
if (!x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) {
|
|
54918
54918
|
y.c = y.e = y.s = null;
|
|
@@ -54964,23 +54964,23 @@ var require_bignumber = __commonJS({
|
|
|
54964
54964
|
return normalise(y, zc, e);
|
|
54965
54965
|
};
|
|
54966
54966
|
P.negated = function() {
|
|
54967
|
-
var x = new
|
|
54967
|
+
var x = new BigNumber2(this);
|
|
54968
54968
|
x.s = -x.s || null;
|
|
54969
54969
|
return x;
|
|
54970
54970
|
};
|
|
54971
54971
|
P.plus = function(y, b) {
|
|
54972
54972
|
var t, x = this, a = x.s;
|
|
54973
|
-
y = new
|
|
54973
|
+
y = new BigNumber2(y, b);
|
|
54974
54974
|
b = y.s;
|
|
54975
|
-
if (!a || !b) return new
|
|
54975
|
+
if (!a || !b) return new BigNumber2(NaN);
|
|
54976
54976
|
if (a != b) {
|
|
54977
54977
|
y.s = -b;
|
|
54978
54978
|
return x.minus(y);
|
|
54979
54979
|
}
|
|
54980
54980
|
var xe = x.e / LOG_BASE, ye = y.e / LOG_BASE, xc = x.c, yc = y.c;
|
|
54981
54981
|
if (!xe || !ye) {
|
|
54982
|
-
if (!xc || !yc) return new
|
|
54983
|
-
if (!xc[0] || !yc[0]) return yc[0] ? y : new
|
|
54982
|
+
if (!xc || !yc) return new BigNumber2(a / 0);
|
|
54983
|
+
if (!xc[0] || !yc[0]) return yc[0] ? y : new BigNumber2(xc[0] ? x : a * 0);
|
|
54984
54984
|
}
|
|
54985
54985
|
xe = bitFloor(xe);
|
|
54986
54986
|
ye = bitFloor(ye);
|
|
@@ -55021,7 +55021,7 @@ var require_bignumber = __commonJS({
|
|
|
55021
55021
|
intCheck(sd, 1, MAX);
|
|
55022
55022
|
if (rm == null) rm = ROUNDING_MODE;
|
|
55023
55023
|
else intCheck(rm, 0, 8);
|
|
55024
|
-
return round(new
|
|
55024
|
+
return round(new BigNumber2(x), sd, rm);
|
|
55025
55025
|
}
|
|
55026
55026
|
if (!(c = x.c)) return null;
|
|
55027
55027
|
v = c.length - 1;
|
|
@@ -55038,9 +55038,9 @@ var require_bignumber = __commonJS({
|
|
|
55038
55038
|
return this.times("1e" + k);
|
|
55039
55039
|
};
|
|
55040
55040
|
P.squareRoot = P.sqrt = function() {
|
|
55041
|
-
var m, n, r, rep, t, x = this, c = x.c, s = x.s, e = x.e, dp = DECIMAL_PLACES + 4, half = new
|
|
55041
|
+
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");
|
|
55042
55042
|
if (s !== 1 || !c || !c[0]) {
|
|
55043
|
-
return new
|
|
55043
|
+
return new BigNumber2(!s || s < 0 && (!c || c[0]) ? NaN : c ? x : 1 / 0);
|
|
55044
55044
|
}
|
|
55045
55045
|
s = Math.sqrt(+valueOf(x));
|
|
55046
55046
|
if (s == 0 || s == 1 / 0) {
|
|
@@ -55054,9 +55054,9 @@ var require_bignumber = __commonJS({
|
|
|
55054
55054
|
n = s.toExponential();
|
|
55055
55055
|
n = n.slice(0, n.indexOf("e") + 1) + e;
|
|
55056
55056
|
}
|
|
55057
|
-
r = new
|
|
55057
|
+
r = new BigNumber2(n);
|
|
55058
55058
|
} else {
|
|
55059
|
-
r = new
|
|
55059
|
+
r = new BigNumber2(s + "");
|
|
55060
55060
|
}
|
|
55061
55061
|
if (r.c[0]) {
|
|
55062
55062
|
e = r.e;
|
|
@@ -55146,22 +55146,22 @@ var require_bignumber = __commonJS({
|
|
|
55146
55146
|
P.toFraction = function(md) {
|
|
55147
55147
|
var d, d0, d1, d2, e, exp, n, n0, n1, q, r, s, x = this, xc = x.c;
|
|
55148
55148
|
if (md != null) {
|
|
55149
|
-
n = new
|
|
55149
|
+
n = new BigNumber2(md);
|
|
55150
55150
|
if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) {
|
|
55151
55151
|
throw Error(bignumberError + "Argument " + (n.isInteger() ? "out of range: " : "not an integer: ") + valueOf(n));
|
|
55152
55152
|
}
|
|
55153
55153
|
}
|
|
55154
|
-
if (!xc) return new
|
|
55155
|
-
d = new
|
|
55156
|
-
n1 = d0 = new
|
|
55157
|
-
d1 = n0 = new
|
|
55154
|
+
if (!xc) return new BigNumber2(x);
|
|
55155
|
+
d = new BigNumber2(ONE);
|
|
55156
|
+
n1 = d0 = new BigNumber2(ONE);
|
|
55157
|
+
d1 = n0 = new BigNumber2(ONE);
|
|
55158
55158
|
s = coeffToString(xc);
|
|
55159
55159
|
e = d.e = s.length - x.e - 1;
|
|
55160
55160
|
d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp];
|
|
55161
55161
|
md = !md || n.comparedTo(d) > 0 ? e > 0 ? d : n1 : n;
|
|
55162
55162
|
exp = MAX_EXP;
|
|
55163
55163
|
MAX_EXP = 1 / 0;
|
|
55164
|
-
n = new
|
|
55164
|
+
n = new BigNumber2(s);
|
|
55165
55165
|
n0.c[0] = 0;
|
|
55166
55166
|
for (; ; ) {
|
|
55167
55167
|
q = div(n, d, 0, 1);
|
|
@@ -55205,1747 +55205,7 @@ var require_bignumber = __commonJS({
|
|
|
55205
55205
|
if (b == null) {
|
|
55206
55206
|
str = e <= TO_EXP_NEG || e >= TO_EXP_POS ? toExponential(coeffToString(n.c), e) : toFixedPoint(coeffToString(n.c), e, "0");
|
|
55207
55207
|
} else if (b === 10 && alphabetHasNormalDecimalDigits) {
|
|
55208
|
-
n = round(new
|
|
55209
|
-
str = toFixedPoint(coeffToString(n.c), n.e, "0");
|
|
55210
|
-
} else {
|
|
55211
|
-
intCheck(b, 2, ALPHABET.length, "Base");
|
|
55212
|
-
str = convertBase(toFixedPoint(coeffToString(n.c), e, "0"), 10, b, s, true);
|
|
55213
|
-
}
|
|
55214
|
-
if (s < 0 && n.c[0]) str = "-" + str;
|
|
55215
|
-
}
|
|
55216
|
-
return str;
|
|
55217
|
-
};
|
|
55218
|
-
P.valueOf = P.toJSON = function() {
|
|
55219
|
-
return valueOf(this);
|
|
55220
|
-
};
|
|
55221
|
-
P._isBigNumber = true;
|
|
55222
|
-
if (configObject != null) BigNumber3.set(configObject);
|
|
55223
|
-
return BigNumber3;
|
|
55224
|
-
}
|
|
55225
|
-
function bitFloor(n) {
|
|
55226
|
-
var i = n | 0;
|
|
55227
|
-
return n > 0 || n === i ? i : i - 1;
|
|
55228
|
-
}
|
|
55229
|
-
function coeffToString(a) {
|
|
55230
|
-
var s, z3, i = 1, j = a.length, r = a[0] + "";
|
|
55231
|
-
for (; i < j; ) {
|
|
55232
|
-
s = a[i++] + "";
|
|
55233
|
-
z3 = LOG_BASE - s.length;
|
|
55234
|
-
for (; z3--; s = "0" + s) ;
|
|
55235
|
-
r += s;
|
|
55236
|
-
}
|
|
55237
|
-
for (j = r.length; r.charCodeAt(--j) === 48; ) ;
|
|
55238
|
-
return r.slice(0, j + 1 || 1);
|
|
55239
|
-
}
|
|
55240
|
-
function compare(x, y) {
|
|
55241
|
-
var a, b, xc = x.c, yc = y.c, i = x.s, j = y.s, k = x.e, l = y.e;
|
|
55242
|
-
if (!i || !j) return null;
|
|
55243
|
-
a = xc && !xc[0];
|
|
55244
|
-
b = yc && !yc[0];
|
|
55245
|
-
if (a || b) return a ? b ? 0 : -j : i;
|
|
55246
|
-
if (i != j) return i;
|
|
55247
|
-
a = i < 0;
|
|
55248
|
-
b = k == l;
|
|
55249
|
-
if (!xc || !yc) return b ? 0 : !xc ^ a ? 1 : -1;
|
|
55250
|
-
if (!b) return k > l ^ a ? 1 : -1;
|
|
55251
|
-
j = (k = xc.length) < (l = yc.length) ? k : l;
|
|
55252
|
-
for (i = 0; i < j; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1;
|
|
55253
|
-
return k == l ? 0 : k > l ^ a ? 1 : -1;
|
|
55254
|
-
}
|
|
55255
|
-
function intCheck(n, min, max, name) {
|
|
55256
|
-
if (n < min || n > max || n !== mathfloor(n)) {
|
|
55257
|
-
throw Error(bignumberError + (name || "Argument") + (typeof n == "number" ? n < min || n > max ? " out of range: " : " not an integer: " : " not a primitive number: ") + String(n));
|
|
55258
|
-
}
|
|
55259
|
-
}
|
|
55260
|
-
function isOdd(n) {
|
|
55261
|
-
var k = n.c.length - 1;
|
|
55262
|
-
return bitFloor(n.e / LOG_BASE) == k && n.c[k] % 2 != 0;
|
|
55263
|
-
}
|
|
55264
|
-
function toExponential(str, e) {
|
|
55265
|
-
return (str.length > 1 ? str.charAt(0) + "." + str.slice(1) : str) + (e < 0 ? "e" : "e+") + e;
|
|
55266
|
-
}
|
|
55267
|
-
function toFixedPoint(str, e, z3) {
|
|
55268
|
-
var len, zs;
|
|
55269
|
-
if (e < 0) {
|
|
55270
|
-
for (zs = z3 + "."; ++e; zs += z3) ;
|
|
55271
|
-
str = zs + str;
|
|
55272
|
-
} else {
|
|
55273
|
-
len = str.length;
|
|
55274
|
-
if (++e > len) {
|
|
55275
|
-
for (zs = z3, e -= len; --e; zs += z3) ;
|
|
55276
|
-
str += zs;
|
|
55277
|
-
} else if (e < len) {
|
|
55278
|
-
str = str.slice(0, e) + "." + str.slice(e);
|
|
55279
|
-
}
|
|
55280
|
-
}
|
|
55281
|
-
return str;
|
|
55282
|
-
}
|
|
55283
|
-
BigNumber2 = clone2();
|
|
55284
|
-
BigNumber2["default"] = BigNumber2.BigNumber = BigNumber2;
|
|
55285
|
-
if (typeof define == "function" && define.amd) {
|
|
55286
|
-
define(function() {
|
|
55287
|
-
return BigNumber2;
|
|
55288
|
-
});
|
|
55289
|
-
} else if (typeof module2 != "undefined" && module2.exports) {
|
|
55290
|
-
module2.exports = BigNumber2;
|
|
55291
|
-
} else {
|
|
55292
|
-
if (!globalObject) {
|
|
55293
|
-
globalObject = typeof self != "undefined" && self ? self : window;
|
|
55294
|
-
}
|
|
55295
|
-
globalObject.BigNumber = BigNumber2;
|
|
55296
|
-
}
|
|
55297
|
-
})(exports2);
|
|
55298
|
-
}
|
|
55299
|
-
});
|
|
55300
|
-
|
|
55301
|
-
// node_modules/json-bigint/lib/stringify.js
|
|
55302
|
-
var require_stringify = __commonJS({
|
|
55303
|
-
"node_modules/json-bigint/lib/stringify.js"(exports2, module2) {
|
|
55304
|
-
var BigNumber2 = require_bignumber();
|
|
55305
|
-
var JSON2 = module2.exports;
|
|
55306
|
-
(function() {
|
|
55307
|
-
"use strict";
|
|
55308
|
-
function f(n) {
|
|
55309
|
-
return n < 10 ? "0" + n : n;
|
|
55310
|
-
}
|
|
55311
|
-
var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, gap, indent, meta3 = {
|
|
55312
|
-
// table of character substitutions
|
|
55313
|
-
"\b": "\\b",
|
|
55314
|
-
" ": "\\t",
|
|
55315
|
-
"\n": "\\n",
|
|
55316
|
-
"\f": "\\f",
|
|
55317
|
-
"\r": "\\r",
|
|
55318
|
-
'"': '\\"',
|
|
55319
|
-
"\\": "\\\\"
|
|
55320
|
-
}, rep;
|
|
55321
|
-
function quote(string4) {
|
|
55322
|
-
escapable.lastIndex = 0;
|
|
55323
|
-
return escapable.test(string4) ? '"' + string4.replace(escapable, function(a) {
|
|
55324
|
-
var c = meta3[a];
|
|
55325
|
-
return typeof c === "string" ? c : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4);
|
|
55326
|
-
}) + '"' : '"' + string4 + '"';
|
|
55327
|
-
}
|
|
55328
|
-
function str(key, holder) {
|
|
55329
|
-
var i, k, v, length, mind = gap, partial2, value = holder[key], isBigNumber2 = value != null && (value instanceof BigNumber2 || BigNumber2.isBigNumber(value));
|
|
55330
|
-
if (value && typeof value === "object" && typeof value.toJSON === "function") {
|
|
55331
|
-
value = value.toJSON(key);
|
|
55332
|
-
}
|
|
55333
|
-
if (typeof rep === "function") {
|
|
55334
|
-
value = rep.call(holder, key, value);
|
|
55335
|
-
}
|
|
55336
|
-
switch (typeof value) {
|
|
55337
|
-
case "string":
|
|
55338
|
-
if (isBigNumber2) {
|
|
55339
|
-
return value;
|
|
55340
|
-
} else {
|
|
55341
|
-
return quote(value);
|
|
55342
|
-
}
|
|
55343
|
-
case "number":
|
|
55344
|
-
return isFinite(value) ? String(value) : "null";
|
|
55345
|
-
case "boolean":
|
|
55346
|
-
case "null":
|
|
55347
|
-
case "bigint":
|
|
55348
|
-
return String(value);
|
|
55349
|
-
// If the type is 'object', we might be dealing with an object or an array or
|
|
55350
|
-
// null.
|
|
55351
|
-
case "object":
|
|
55352
|
-
if (!value) {
|
|
55353
|
-
return "null";
|
|
55354
|
-
}
|
|
55355
|
-
gap += indent;
|
|
55356
|
-
partial2 = [];
|
|
55357
|
-
if (Object.prototype.toString.apply(value) === "[object Array]") {
|
|
55358
|
-
length = value.length;
|
|
55359
|
-
for (i = 0; i < length; i += 1) {
|
|
55360
|
-
partial2[i] = str(i, value) || "null";
|
|
55361
|
-
}
|
|
55362
|
-
v = partial2.length === 0 ? "[]" : gap ? "[\n" + gap + partial2.join(",\n" + gap) + "\n" + mind + "]" : "[" + partial2.join(",") + "]";
|
|
55363
|
-
gap = mind;
|
|
55364
|
-
return v;
|
|
55365
|
-
}
|
|
55366
|
-
if (rep && typeof rep === "object") {
|
|
55367
|
-
length = rep.length;
|
|
55368
|
-
for (i = 0; i < length; i += 1) {
|
|
55369
|
-
if (typeof rep[i] === "string") {
|
|
55370
|
-
k = rep[i];
|
|
55371
|
-
v = str(k, value);
|
|
55372
|
-
if (v) {
|
|
55373
|
-
partial2.push(quote(k) + (gap ? ": " : ":") + v);
|
|
55374
|
-
}
|
|
55375
|
-
}
|
|
55376
|
-
}
|
|
55377
|
-
} else {
|
|
55378
|
-
Object.keys(value).forEach(function(k2) {
|
|
55379
|
-
var v2 = str(k2, value);
|
|
55380
|
-
if (v2) {
|
|
55381
|
-
partial2.push(quote(k2) + (gap ? ": " : ":") + v2);
|
|
55382
|
-
}
|
|
55383
|
-
});
|
|
55384
|
-
}
|
|
55385
|
-
v = partial2.length === 0 ? "{}" : gap ? "{\n" + gap + partial2.join(",\n" + gap) + "\n" + mind + "}" : "{" + partial2.join(",") + "}";
|
|
55386
|
-
gap = mind;
|
|
55387
|
-
return v;
|
|
55388
|
-
}
|
|
55389
|
-
}
|
|
55390
|
-
if (typeof JSON2.stringify !== "function") {
|
|
55391
|
-
JSON2.stringify = function(value, replacer, space) {
|
|
55392
|
-
var i;
|
|
55393
|
-
gap = "";
|
|
55394
|
-
indent = "";
|
|
55395
|
-
if (typeof space === "number") {
|
|
55396
|
-
for (i = 0; i < space; i += 1) {
|
|
55397
|
-
indent += " ";
|
|
55398
|
-
}
|
|
55399
|
-
} else if (typeof space === "string") {
|
|
55400
|
-
indent = space;
|
|
55401
|
-
}
|
|
55402
|
-
rep = replacer;
|
|
55403
|
-
if (replacer && typeof replacer !== "function" && (typeof replacer !== "object" || typeof replacer.length !== "number")) {
|
|
55404
|
-
throw new Error("JSON.stringify");
|
|
55405
|
-
}
|
|
55406
|
-
return str("", { "": value });
|
|
55407
|
-
};
|
|
55408
|
-
}
|
|
55409
|
-
})();
|
|
55410
|
-
}
|
|
55411
|
-
});
|
|
55412
|
-
|
|
55413
|
-
// node_modules/json-bigint/lib/parse.js
|
|
55414
|
-
var require_parse2 = __commonJS({
|
|
55415
|
-
"node_modules/json-bigint/lib/parse.js"(exports2, module2) {
|
|
55416
|
-
var BigNumber2 = null;
|
|
55417
|
-
var suspectProtoRx = /(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/;
|
|
55418
|
-
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)/;
|
|
55419
|
-
var json_parse = function(options) {
|
|
55420
|
-
"use strict";
|
|
55421
|
-
var _options = {
|
|
55422
|
-
strict: false,
|
|
55423
|
-
// not being strict means do not generate syntax errors for "duplicate key"
|
|
55424
|
-
storeAsString: false,
|
|
55425
|
-
// toggles whether the values should be stored as BigNumber (default) or a string
|
|
55426
|
-
alwaysParseAsBig: false,
|
|
55427
|
-
// toggles whether all numbers should be Big
|
|
55428
|
-
useNativeBigInt: false,
|
|
55429
|
-
// toggles whether to use native BigInt instead of bignumber.js
|
|
55430
|
-
protoAction: "error",
|
|
55431
|
-
constructorAction: "error"
|
|
55432
|
-
};
|
|
55433
|
-
if (options !== void 0 && options !== null) {
|
|
55434
|
-
if (options.strict === true) {
|
|
55435
|
-
_options.strict = true;
|
|
55436
|
-
}
|
|
55437
|
-
if (options.storeAsString === true) {
|
|
55438
|
-
_options.storeAsString = true;
|
|
55439
|
-
}
|
|
55440
|
-
_options.alwaysParseAsBig = options.alwaysParseAsBig === true ? options.alwaysParseAsBig : false;
|
|
55441
|
-
_options.useNativeBigInt = options.useNativeBigInt === true ? options.useNativeBigInt : false;
|
|
55442
|
-
if (typeof options.constructorAction !== "undefined") {
|
|
55443
|
-
if (options.constructorAction === "error" || options.constructorAction === "ignore" || options.constructorAction === "preserve") {
|
|
55444
|
-
_options.constructorAction = options.constructorAction;
|
|
55445
|
-
} else {
|
|
55446
|
-
throw new Error(
|
|
55447
|
-
`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${options.constructorAction}`
|
|
55448
|
-
);
|
|
55449
|
-
}
|
|
55450
|
-
}
|
|
55451
|
-
if (typeof options.protoAction !== "undefined") {
|
|
55452
|
-
if (options.protoAction === "error" || options.protoAction === "ignore" || options.protoAction === "preserve") {
|
|
55453
|
-
_options.protoAction = options.protoAction;
|
|
55454
|
-
} else {
|
|
55455
|
-
throw new Error(
|
|
55456
|
-
`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${options.protoAction}`
|
|
55457
|
-
);
|
|
55458
|
-
}
|
|
55459
|
-
}
|
|
55460
|
-
}
|
|
55461
|
-
var at, ch, escapee = {
|
|
55462
|
-
'"': '"',
|
|
55463
|
-
"\\": "\\",
|
|
55464
|
-
"/": "/",
|
|
55465
|
-
b: "\b",
|
|
55466
|
-
f: "\f",
|
|
55467
|
-
n: "\n",
|
|
55468
|
-
r: "\r",
|
|
55469
|
-
t: " "
|
|
55470
|
-
}, text, error49 = function(m) {
|
|
55471
|
-
throw {
|
|
55472
|
-
name: "SyntaxError",
|
|
55473
|
-
message: m,
|
|
55474
|
-
at,
|
|
55475
|
-
text
|
|
55476
|
-
};
|
|
55477
|
-
}, next = function(c) {
|
|
55478
|
-
if (c && c !== ch) {
|
|
55479
|
-
error49("Expected '" + c + "' instead of '" + ch + "'");
|
|
55480
|
-
}
|
|
55481
|
-
ch = text.charAt(at);
|
|
55482
|
-
at += 1;
|
|
55483
|
-
return ch;
|
|
55484
|
-
}, number4 = function() {
|
|
55485
|
-
var number5, string5 = "";
|
|
55486
|
-
if (ch === "-") {
|
|
55487
|
-
string5 = "-";
|
|
55488
|
-
next("-");
|
|
55489
|
-
}
|
|
55490
|
-
while (ch >= "0" && ch <= "9") {
|
|
55491
|
-
string5 += ch;
|
|
55492
|
-
next();
|
|
55493
|
-
}
|
|
55494
|
-
if (ch === ".") {
|
|
55495
|
-
string5 += ".";
|
|
55496
|
-
while (next() && ch >= "0" && ch <= "9") {
|
|
55497
|
-
string5 += ch;
|
|
55498
|
-
}
|
|
55499
|
-
}
|
|
55500
|
-
if (ch === "e" || ch === "E") {
|
|
55501
|
-
string5 += ch;
|
|
55502
|
-
next();
|
|
55503
|
-
if (ch === "-" || ch === "+") {
|
|
55504
|
-
string5 += ch;
|
|
55505
|
-
next();
|
|
55506
|
-
}
|
|
55507
|
-
while (ch >= "0" && ch <= "9") {
|
|
55508
|
-
string5 += ch;
|
|
55509
|
-
next();
|
|
55510
|
-
}
|
|
55511
|
-
}
|
|
55512
|
-
number5 = +string5;
|
|
55513
|
-
if (!isFinite(number5)) {
|
|
55514
|
-
error49("Bad number");
|
|
55515
|
-
} else {
|
|
55516
|
-
if (BigNumber2 == null) BigNumber2 = require_bignumber();
|
|
55517
|
-
if (string5.length > 15)
|
|
55518
|
-
return _options.storeAsString ? string5 : _options.useNativeBigInt ? BigInt(string5) : new BigNumber2(string5);
|
|
55519
|
-
else
|
|
55520
|
-
return !_options.alwaysParseAsBig ? number5 : _options.useNativeBigInt ? BigInt(number5) : new BigNumber2(number5);
|
|
55521
|
-
}
|
|
55522
|
-
}, string4 = function() {
|
|
55523
|
-
var hex3, i, string5 = "", uffff;
|
|
55524
|
-
if (ch === '"') {
|
|
55525
|
-
var startAt = at;
|
|
55526
|
-
while (next()) {
|
|
55527
|
-
if (ch === '"') {
|
|
55528
|
-
if (at - 1 > startAt) string5 += text.substring(startAt, at - 1);
|
|
55529
|
-
next();
|
|
55530
|
-
return string5;
|
|
55531
|
-
}
|
|
55532
|
-
if (ch === "\\") {
|
|
55533
|
-
if (at - 1 > startAt) string5 += text.substring(startAt, at - 1);
|
|
55534
|
-
next();
|
|
55535
|
-
if (ch === "u") {
|
|
55536
|
-
uffff = 0;
|
|
55537
|
-
for (i = 0; i < 4; i += 1) {
|
|
55538
|
-
hex3 = parseInt(next(), 16);
|
|
55539
|
-
if (!isFinite(hex3)) {
|
|
55540
|
-
break;
|
|
55541
|
-
}
|
|
55542
|
-
uffff = uffff * 16 + hex3;
|
|
55543
|
-
}
|
|
55544
|
-
string5 += String.fromCharCode(uffff);
|
|
55545
|
-
} else if (typeof escapee[ch] === "string") {
|
|
55546
|
-
string5 += escapee[ch];
|
|
55547
|
-
} else {
|
|
55548
|
-
break;
|
|
55549
|
-
}
|
|
55550
|
-
startAt = at;
|
|
55551
|
-
}
|
|
55552
|
-
}
|
|
55553
|
-
}
|
|
55554
|
-
error49("Bad string");
|
|
55555
|
-
}, white = function() {
|
|
55556
|
-
while (ch && ch <= " ") {
|
|
55557
|
-
next();
|
|
55558
|
-
}
|
|
55559
|
-
}, word = function() {
|
|
55560
|
-
switch (ch) {
|
|
55561
|
-
case "t":
|
|
55562
|
-
next("t");
|
|
55563
|
-
next("r");
|
|
55564
|
-
next("u");
|
|
55565
|
-
next("e");
|
|
55566
|
-
return true;
|
|
55567
|
-
case "f":
|
|
55568
|
-
next("f");
|
|
55569
|
-
next("a");
|
|
55570
|
-
next("l");
|
|
55571
|
-
next("s");
|
|
55572
|
-
next("e");
|
|
55573
|
-
return false;
|
|
55574
|
-
case "n":
|
|
55575
|
-
next("n");
|
|
55576
|
-
next("u");
|
|
55577
|
-
next("l");
|
|
55578
|
-
next("l");
|
|
55579
|
-
return null;
|
|
55580
|
-
}
|
|
55581
|
-
error49("Unexpected '" + ch + "'");
|
|
55582
|
-
}, value, array2 = function() {
|
|
55583
|
-
var array3 = [];
|
|
55584
|
-
if (ch === "[") {
|
|
55585
|
-
next("[");
|
|
55586
|
-
white();
|
|
55587
|
-
if (ch === "]") {
|
|
55588
|
-
next("]");
|
|
55589
|
-
return array3;
|
|
55590
|
-
}
|
|
55591
|
-
while (ch) {
|
|
55592
|
-
array3.push(value());
|
|
55593
|
-
white();
|
|
55594
|
-
if (ch === "]") {
|
|
55595
|
-
next("]");
|
|
55596
|
-
return array3;
|
|
55597
|
-
}
|
|
55598
|
-
next(",");
|
|
55599
|
-
white();
|
|
55600
|
-
}
|
|
55601
|
-
}
|
|
55602
|
-
error49("Bad array");
|
|
55603
|
-
}, object2 = function() {
|
|
55604
|
-
var key, object3 = /* @__PURE__ */ Object.create(null);
|
|
55605
|
-
if (ch === "{") {
|
|
55606
|
-
next("{");
|
|
55607
|
-
white();
|
|
55608
|
-
if (ch === "}") {
|
|
55609
|
-
next("}");
|
|
55610
|
-
return object3;
|
|
55611
|
-
}
|
|
55612
|
-
while (ch) {
|
|
55613
|
-
key = string4();
|
|
55614
|
-
white();
|
|
55615
|
-
next(":");
|
|
55616
|
-
if (_options.strict === true && Object.hasOwnProperty.call(object3, key)) {
|
|
55617
|
-
error49('Duplicate key "' + key + '"');
|
|
55618
|
-
}
|
|
55619
|
-
if (suspectProtoRx.test(key) === true) {
|
|
55620
|
-
if (_options.protoAction === "error") {
|
|
55621
|
-
error49("Object contains forbidden prototype property");
|
|
55622
|
-
} else if (_options.protoAction === "ignore") {
|
|
55623
|
-
value();
|
|
55624
|
-
} else {
|
|
55625
|
-
object3[key] = value();
|
|
55626
|
-
}
|
|
55627
|
-
} else if (suspectConstructorRx.test(key) === true) {
|
|
55628
|
-
if (_options.constructorAction === "error") {
|
|
55629
|
-
error49("Object contains forbidden constructor property");
|
|
55630
|
-
} else if (_options.constructorAction === "ignore") {
|
|
55631
|
-
value();
|
|
55632
|
-
} else {
|
|
55633
|
-
object3[key] = value();
|
|
55634
|
-
}
|
|
55635
|
-
} else {
|
|
55636
|
-
object3[key] = value();
|
|
55637
|
-
}
|
|
55638
|
-
white();
|
|
55639
|
-
if (ch === "}") {
|
|
55640
|
-
next("}");
|
|
55641
|
-
return object3;
|
|
55642
|
-
}
|
|
55643
|
-
next(",");
|
|
55644
|
-
white();
|
|
55645
|
-
}
|
|
55646
|
-
}
|
|
55647
|
-
error49("Bad object");
|
|
55648
|
-
};
|
|
55649
|
-
value = function() {
|
|
55650
|
-
white();
|
|
55651
|
-
switch (ch) {
|
|
55652
|
-
case "{":
|
|
55653
|
-
return object2();
|
|
55654
|
-
case "[":
|
|
55655
|
-
return array2();
|
|
55656
|
-
case '"':
|
|
55657
|
-
return string4();
|
|
55658
|
-
case "-":
|
|
55659
|
-
return number4();
|
|
55660
|
-
default:
|
|
55661
|
-
return ch >= "0" && ch <= "9" ? number4() : word();
|
|
55662
|
-
}
|
|
55663
|
-
};
|
|
55664
|
-
return function(source, reviver3) {
|
|
55665
|
-
var result;
|
|
55666
|
-
text = source + "";
|
|
55667
|
-
at = 0;
|
|
55668
|
-
ch = " ";
|
|
55669
|
-
result = value();
|
|
55670
|
-
white();
|
|
55671
|
-
if (ch) {
|
|
55672
|
-
error49("Syntax error");
|
|
55673
|
-
}
|
|
55674
|
-
return typeof reviver3 === "function" ? (function walk(holder, key) {
|
|
55675
|
-
var k, v, value2 = holder[key];
|
|
55676
|
-
if (value2 && typeof value2 === "object") {
|
|
55677
|
-
Object.keys(value2).forEach(function(k2) {
|
|
55678
|
-
v = walk(value2, k2);
|
|
55679
|
-
if (v !== void 0) {
|
|
55680
|
-
value2[k2] = v;
|
|
55681
|
-
} else {
|
|
55682
|
-
delete value2[k2];
|
|
55683
|
-
}
|
|
55684
|
-
});
|
|
55685
|
-
}
|
|
55686
|
-
return reviver3.call(holder, key, value2);
|
|
55687
|
-
})({ "": result }, "") : result;
|
|
55688
|
-
};
|
|
55689
|
-
};
|
|
55690
|
-
module2.exports = json_parse;
|
|
55691
|
-
}
|
|
55692
|
-
});
|
|
55693
|
-
|
|
55694
|
-
// node_modules/json-bigint/index.js
|
|
55695
|
-
var require_json_bigint = __commonJS({
|
|
55696
|
-
"node_modules/json-bigint/index.js"(exports2, module2) {
|
|
55697
|
-
var json_stringify = require_stringify().stringify;
|
|
55698
|
-
var json_parse = require_parse2();
|
|
55699
|
-
module2.exports = function(options) {
|
|
55700
|
-
return {
|
|
55701
|
-
parse: json_parse(options),
|
|
55702
|
-
stringify: json_stringify
|
|
55703
|
-
};
|
|
55704
|
-
};
|
|
55705
|
-
module2.exports.parse = json_parse();
|
|
55706
|
-
module2.exports.stringify = json_stringify;
|
|
55707
|
-
}
|
|
55708
|
-
});
|
|
55709
|
-
|
|
55710
|
-
// node_modules/bignumber.js/bignumber.js
|
|
55711
|
-
var require_bignumber2 = __commonJS({
|
|
55712
|
-
"node_modules/bignumber.js/bignumber.js"(exports2, module2) {
|
|
55713
|
-
(function(globalObject) {
|
|
55714
|
-
"use strict";
|
|
55715
|
-
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;
|
|
55716
|
-
function clone2(configObject) {
|
|
55717
|
-
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 = {
|
|
55718
|
-
prefix: "",
|
|
55719
|
-
groupSize: 3,
|
|
55720
|
-
secondaryGroupSize: 0,
|
|
55721
|
-
groupSeparator: ",",
|
|
55722
|
-
decimalSeparator: ".",
|
|
55723
|
-
fractionGroupSize: 0,
|
|
55724
|
-
fractionGroupSeparator: "\xA0",
|
|
55725
|
-
// non-breaking space
|
|
55726
|
-
suffix: ""
|
|
55727
|
-
}, ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz";
|
|
55728
|
-
function BigNumber3(v, b) {
|
|
55729
|
-
var alphabet, c, caseChanged, e, i, isNum, len, str, x = this;
|
|
55730
|
-
if (!(x instanceof BigNumber3)) return new BigNumber3(v, b);
|
|
55731
|
-
if (b == null) {
|
|
55732
|
-
if (v && v._isBigNumber === true) {
|
|
55733
|
-
x.s = v.s;
|
|
55734
|
-
if (!v.c || v.e > MAX_EXP) {
|
|
55735
|
-
x.c = x.e = null;
|
|
55736
|
-
} else if (v.e < MIN_EXP) {
|
|
55737
|
-
x.c = [x.e = 0];
|
|
55738
|
-
} else {
|
|
55739
|
-
x.e = v.e;
|
|
55740
|
-
x.c = v.c.slice();
|
|
55741
|
-
}
|
|
55742
|
-
return;
|
|
55743
|
-
}
|
|
55744
|
-
if ((isNum = typeof v == "number") && v * 0 == 0) {
|
|
55745
|
-
x.s = 1 / v < 0 ? (v = -v, -1) : 1;
|
|
55746
|
-
if (v === ~~v) {
|
|
55747
|
-
for (e = 0, i = v; i >= 10; i /= 10, e++) ;
|
|
55748
|
-
if (e > MAX_EXP) {
|
|
55749
|
-
x.c = x.e = null;
|
|
55750
|
-
} else {
|
|
55751
|
-
x.e = e;
|
|
55752
|
-
x.c = [v];
|
|
55753
|
-
}
|
|
55754
|
-
return;
|
|
55755
|
-
}
|
|
55756
|
-
str = String(v);
|
|
55757
|
-
} else {
|
|
55758
|
-
if (!isNumeric.test(str = String(v))) return parseNumeric(x, str, isNum);
|
|
55759
|
-
x.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1;
|
|
55760
|
-
}
|
|
55761
|
-
if ((e = str.indexOf(".")) > -1) str = str.replace(".", "");
|
|
55762
|
-
if ((i = str.search(/e/i)) > 0) {
|
|
55763
|
-
if (e < 0) e = i;
|
|
55764
|
-
e += +str.slice(i + 1);
|
|
55765
|
-
str = str.substring(0, i);
|
|
55766
|
-
} else if (e < 0) {
|
|
55767
|
-
e = str.length;
|
|
55768
|
-
}
|
|
55769
|
-
} else {
|
|
55770
|
-
intCheck(b, 2, ALPHABET.length, "Base");
|
|
55771
|
-
if (b == 10) {
|
|
55772
|
-
x = new BigNumber3(v);
|
|
55773
|
-
return round(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE);
|
|
55774
|
-
}
|
|
55775
|
-
str = String(v);
|
|
55776
|
-
if (isNum = typeof v == "number") {
|
|
55777
|
-
if (v * 0 != 0) return parseNumeric(x, str, isNum, b);
|
|
55778
|
-
x.s = 1 / v < 0 ? (str = str.slice(1), -1) : 1;
|
|
55779
|
-
if (BigNumber3.DEBUG && str.replace(/^0\.0*|\./, "").length > 15) {
|
|
55780
|
-
throw Error(tooManyDigits + v);
|
|
55781
|
-
}
|
|
55782
|
-
} else {
|
|
55783
|
-
x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1;
|
|
55784
|
-
}
|
|
55785
|
-
alphabet = ALPHABET.slice(0, b);
|
|
55786
|
-
e = i = 0;
|
|
55787
|
-
for (len = str.length; i < len; i++) {
|
|
55788
|
-
if (alphabet.indexOf(c = str.charAt(i)) < 0) {
|
|
55789
|
-
if (c == ".") {
|
|
55790
|
-
if (i > e) {
|
|
55791
|
-
e = len;
|
|
55792
|
-
continue;
|
|
55793
|
-
}
|
|
55794
|
-
} else if (!caseChanged) {
|
|
55795
|
-
if (str == str.toUpperCase() && (str = str.toLowerCase()) || str == str.toLowerCase() && (str = str.toUpperCase())) {
|
|
55796
|
-
caseChanged = true;
|
|
55797
|
-
i = -1;
|
|
55798
|
-
e = 0;
|
|
55799
|
-
continue;
|
|
55800
|
-
}
|
|
55801
|
-
}
|
|
55802
|
-
return parseNumeric(x, String(v), isNum, b);
|
|
55803
|
-
}
|
|
55804
|
-
}
|
|
55805
|
-
isNum = false;
|
|
55806
|
-
str = convertBase(str, b, 10, x.s);
|
|
55807
|
-
if ((e = str.indexOf(".")) > -1) str = str.replace(".", "");
|
|
55808
|
-
else e = str.length;
|
|
55809
|
-
}
|
|
55810
|
-
for (i = 0; str.charCodeAt(i) === 48; i++) ;
|
|
55811
|
-
for (len = str.length; str.charCodeAt(--len) === 48; ) ;
|
|
55812
|
-
if (str = str.slice(i, ++len)) {
|
|
55813
|
-
len -= i;
|
|
55814
|
-
if (isNum && BigNumber3.DEBUG && len > 15 && (v > MAX_SAFE_INTEGER || v !== mathfloor(v))) {
|
|
55815
|
-
throw Error(tooManyDigits + x.s * v);
|
|
55816
|
-
}
|
|
55817
|
-
if ((e = e - i - 1) > MAX_EXP) {
|
|
55818
|
-
x.c = x.e = null;
|
|
55819
|
-
} else if (e < MIN_EXP) {
|
|
55820
|
-
x.c = [x.e = 0];
|
|
55821
|
-
} else {
|
|
55822
|
-
x.e = e;
|
|
55823
|
-
x.c = [];
|
|
55824
|
-
i = (e + 1) % LOG_BASE;
|
|
55825
|
-
if (e < 0) i += LOG_BASE;
|
|
55826
|
-
if (i < len) {
|
|
55827
|
-
if (i) x.c.push(+str.slice(0, i));
|
|
55828
|
-
for (len -= LOG_BASE; i < len; ) {
|
|
55829
|
-
x.c.push(+str.slice(i, i += LOG_BASE));
|
|
55830
|
-
}
|
|
55831
|
-
i = LOG_BASE - (str = str.slice(i)).length;
|
|
55832
|
-
} else {
|
|
55833
|
-
i -= len;
|
|
55834
|
-
}
|
|
55835
|
-
for (; i--; str += "0") ;
|
|
55836
|
-
x.c.push(+str);
|
|
55837
|
-
}
|
|
55838
|
-
} else {
|
|
55839
|
-
x.c = [x.e = 0];
|
|
55840
|
-
}
|
|
55841
|
-
}
|
|
55842
|
-
BigNumber3.clone = clone2;
|
|
55843
|
-
BigNumber3.ROUND_UP = 0;
|
|
55844
|
-
BigNumber3.ROUND_DOWN = 1;
|
|
55845
|
-
BigNumber3.ROUND_CEIL = 2;
|
|
55846
|
-
BigNumber3.ROUND_FLOOR = 3;
|
|
55847
|
-
BigNumber3.ROUND_HALF_UP = 4;
|
|
55848
|
-
BigNumber3.ROUND_HALF_DOWN = 5;
|
|
55849
|
-
BigNumber3.ROUND_HALF_EVEN = 6;
|
|
55850
|
-
BigNumber3.ROUND_HALF_CEIL = 7;
|
|
55851
|
-
BigNumber3.ROUND_HALF_FLOOR = 8;
|
|
55852
|
-
BigNumber3.EUCLID = 9;
|
|
55853
|
-
BigNumber3.config = BigNumber3.set = function(obj) {
|
|
55854
|
-
var p, v;
|
|
55855
|
-
if (obj != null) {
|
|
55856
|
-
if (typeof obj == "object") {
|
|
55857
|
-
if (obj.hasOwnProperty(p = "DECIMAL_PLACES")) {
|
|
55858
|
-
v = obj[p];
|
|
55859
|
-
intCheck(v, 0, MAX, p);
|
|
55860
|
-
DECIMAL_PLACES = v;
|
|
55861
|
-
}
|
|
55862
|
-
if (obj.hasOwnProperty(p = "ROUNDING_MODE")) {
|
|
55863
|
-
v = obj[p];
|
|
55864
|
-
intCheck(v, 0, 8, p);
|
|
55865
|
-
ROUNDING_MODE = v;
|
|
55866
|
-
}
|
|
55867
|
-
if (obj.hasOwnProperty(p = "EXPONENTIAL_AT")) {
|
|
55868
|
-
v = obj[p];
|
|
55869
|
-
if (v && v.pop) {
|
|
55870
|
-
intCheck(v[0], -MAX, 0, p);
|
|
55871
|
-
intCheck(v[1], 0, MAX, p);
|
|
55872
|
-
TO_EXP_NEG = v[0];
|
|
55873
|
-
TO_EXP_POS = v[1];
|
|
55874
|
-
} else {
|
|
55875
|
-
intCheck(v, -MAX, MAX, p);
|
|
55876
|
-
TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v);
|
|
55877
|
-
}
|
|
55878
|
-
}
|
|
55879
|
-
if (obj.hasOwnProperty(p = "RANGE")) {
|
|
55880
|
-
v = obj[p];
|
|
55881
|
-
if (v && v.pop) {
|
|
55882
|
-
intCheck(v[0], -MAX, -1, p);
|
|
55883
|
-
intCheck(v[1], 1, MAX, p);
|
|
55884
|
-
MIN_EXP = v[0];
|
|
55885
|
-
MAX_EXP = v[1];
|
|
55886
|
-
} else {
|
|
55887
|
-
intCheck(v, -MAX, MAX, p);
|
|
55888
|
-
if (v) {
|
|
55889
|
-
MIN_EXP = -(MAX_EXP = v < 0 ? -v : v);
|
|
55890
|
-
} else {
|
|
55891
|
-
throw Error(bignumberError + p + " cannot be zero: " + v);
|
|
55892
|
-
}
|
|
55893
|
-
}
|
|
55894
|
-
}
|
|
55895
|
-
if (obj.hasOwnProperty(p = "CRYPTO")) {
|
|
55896
|
-
v = obj[p];
|
|
55897
|
-
if (v === !!v) {
|
|
55898
|
-
if (v) {
|
|
55899
|
-
if (typeof crypto != "undefined" && crypto && (crypto.getRandomValues || crypto.randomBytes)) {
|
|
55900
|
-
CRYPTO = v;
|
|
55901
|
-
} else {
|
|
55902
|
-
CRYPTO = !v;
|
|
55903
|
-
throw Error(bignumberError + "crypto unavailable");
|
|
55904
|
-
}
|
|
55905
|
-
} else {
|
|
55906
|
-
CRYPTO = v;
|
|
55907
|
-
}
|
|
55908
|
-
} else {
|
|
55909
|
-
throw Error(bignumberError + p + " not true or false: " + v);
|
|
55910
|
-
}
|
|
55911
|
-
}
|
|
55912
|
-
if (obj.hasOwnProperty(p = "MODULO_MODE")) {
|
|
55913
|
-
v = obj[p];
|
|
55914
|
-
intCheck(v, 0, 9, p);
|
|
55915
|
-
MODULO_MODE = v;
|
|
55916
|
-
}
|
|
55917
|
-
if (obj.hasOwnProperty(p = "POW_PRECISION")) {
|
|
55918
|
-
v = obj[p];
|
|
55919
|
-
intCheck(v, 0, MAX, p);
|
|
55920
|
-
POW_PRECISION = v;
|
|
55921
|
-
}
|
|
55922
|
-
if (obj.hasOwnProperty(p = "FORMAT")) {
|
|
55923
|
-
v = obj[p];
|
|
55924
|
-
if (typeof v == "object") FORMAT = v;
|
|
55925
|
-
else throw Error(bignumberError + p + " not an object: " + v);
|
|
55926
|
-
}
|
|
55927
|
-
if (obj.hasOwnProperty(p = "ALPHABET")) {
|
|
55928
|
-
v = obj[p];
|
|
55929
|
-
if (typeof v == "string" && !/^.$|[+-.\s]|(.).*\1/.test(v)) {
|
|
55930
|
-
ALPHABET = v;
|
|
55931
|
-
} else {
|
|
55932
|
-
throw Error(bignumberError + p + " invalid: " + v);
|
|
55933
|
-
}
|
|
55934
|
-
}
|
|
55935
|
-
} else {
|
|
55936
|
-
throw Error(bignumberError + "Object expected: " + obj);
|
|
55937
|
-
}
|
|
55938
|
-
}
|
|
55939
|
-
return {
|
|
55940
|
-
DECIMAL_PLACES,
|
|
55941
|
-
ROUNDING_MODE,
|
|
55942
|
-
EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS],
|
|
55943
|
-
RANGE: [MIN_EXP, MAX_EXP],
|
|
55944
|
-
CRYPTO,
|
|
55945
|
-
MODULO_MODE,
|
|
55946
|
-
POW_PRECISION,
|
|
55947
|
-
FORMAT,
|
|
55948
|
-
ALPHABET
|
|
55949
|
-
};
|
|
55950
|
-
};
|
|
55951
|
-
BigNumber3.isBigNumber = function(v) {
|
|
55952
|
-
if (!v || v._isBigNumber !== true) return false;
|
|
55953
|
-
if (!BigNumber3.DEBUG) return true;
|
|
55954
|
-
var i, n, c = v.c, e = v.e, s = v.s;
|
|
55955
|
-
out: if ({}.toString.call(c) == "[object Array]") {
|
|
55956
|
-
if ((s === 1 || s === -1) && e >= -MAX && e <= MAX && e === mathfloor(e)) {
|
|
55957
|
-
if (c[0] === 0) {
|
|
55958
|
-
if (e === 0 && c.length === 1) return true;
|
|
55959
|
-
break out;
|
|
55960
|
-
}
|
|
55961
|
-
i = (e + 1) % LOG_BASE;
|
|
55962
|
-
if (i < 1) i += LOG_BASE;
|
|
55963
|
-
if (String(c[0]).length == i) {
|
|
55964
|
-
for (i = 0; i < c.length; i++) {
|
|
55965
|
-
n = c[i];
|
|
55966
|
-
if (n < 0 || n >= BASE || n !== mathfloor(n)) break out;
|
|
55967
|
-
}
|
|
55968
|
-
if (n !== 0) return true;
|
|
55969
|
-
}
|
|
55970
|
-
}
|
|
55971
|
-
} else if (c === null && e === null && (s === null || s === 1 || s === -1)) {
|
|
55972
|
-
return true;
|
|
55973
|
-
}
|
|
55974
|
-
throw Error(bignumberError + "Invalid BigNumber: " + v);
|
|
55975
|
-
};
|
|
55976
|
-
BigNumber3.maximum = BigNumber3.max = function() {
|
|
55977
|
-
return maxOrMin(arguments, P.lt);
|
|
55978
|
-
};
|
|
55979
|
-
BigNumber3.minimum = BigNumber3.min = function() {
|
|
55980
|
-
return maxOrMin(arguments, P.gt);
|
|
55981
|
-
};
|
|
55982
|
-
BigNumber3.random = (function() {
|
|
55983
|
-
var pow2_53 = 9007199254740992;
|
|
55984
|
-
var random53bitInt = Math.random() * pow2_53 & 2097151 ? function() {
|
|
55985
|
-
return mathfloor(Math.random() * pow2_53);
|
|
55986
|
-
} : function() {
|
|
55987
|
-
return (Math.random() * 1073741824 | 0) * 8388608 + (Math.random() * 8388608 | 0);
|
|
55988
|
-
};
|
|
55989
|
-
return function(dp) {
|
|
55990
|
-
var a, b, e, k, v, i = 0, c = [], rand = new BigNumber3(ONE);
|
|
55991
|
-
if (dp == null) dp = DECIMAL_PLACES;
|
|
55992
|
-
else intCheck(dp, 0, MAX);
|
|
55993
|
-
k = mathceil(dp / LOG_BASE);
|
|
55994
|
-
if (CRYPTO) {
|
|
55995
|
-
if (crypto.getRandomValues) {
|
|
55996
|
-
a = crypto.getRandomValues(new Uint32Array(k *= 2));
|
|
55997
|
-
for (; i < k; ) {
|
|
55998
|
-
v = a[i] * 131072 + (a[i + 1] >>> 11);
|
|
55999
|
-
if (v >= 9e15) {
|
|
56000
|
-
b = crypto.getRandomValues(new Uint32Array(2));
|
|
56001
|
-
a[i] = b[0];
|
|
56002
|
-
a[i + 1] = b[1];
|
|
56003
|
-
} else {
|
|
56004
|
-
c.push(v % 1e14);
|
|
56005
|
-
i += 2;
|
|
56006
|
-
}
|
|
56007
|
-
}
|
|
56008
|
-
i = k / 2;
|
|
56009
|
-
} else if (crypto.randomBytes) {
|
|
56010
|
-
a = crypto.randomBytes(k *= 7);
|
|
56011
|
-
for (; i < k; ) {
|
|
56012
|
-
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];
|
|
56013
|
-
if (v >= 9e15) {
|
|
56014
|
-
crypto.randomBytes(7).copy(a, i);
|
|
56015
|
-
} else {
|
|
56016
|
-
c.push(v % 1e14);
|
|
56017
|
-
i += 7;
|
|
56018
|
-
}
|
|
56019
|
-
}
|
|
56020
|
-
i = k / 7;
|
|
56021
|
-
} else {
|
|
56022
|
-
CRYPTO = false;
|
|
56023
|
-
throw Error(bignumberError + "crypto unavailable");
|
|
56024
|
-
}
|
|
56025
|
-
}
|
|
56026
|
-
if (!CRYPTO) {
|
|
56027
|
-
for (; i < k; ) {
|
|
56028
|
-
v = random53bitInt();
|
|
56029
|
-
if (v < 9e15) c[i++] = v % 1e14;
|
|
56030
|
-
}
|
|
56031
|
-
}
|
|
56032
|
-
k = c[--i];
|
|
56033
|
-
dp %= LOG_BASE;
|
|
56034
|
-
if (k && dp) {
|
|
56035
|
-
v = POWS_TEN[LOG_BASE - dp];
|
|
56036
|
-
c[i] = mathfloor(k / v) * v;
|
|
56037
|
-
}
|
|
56038
|
-
for (; c[i] === 0; c.pop(), i--) ;
|
|
56039
|
-
if (i < 0) {
|
|
56040
|
-
c = [e = 0];
|
|
56041
|
-
} else {
|
|
56042
|
-
for (e = -1; c[0] === 0; c.splice(0, 1), e -= LOG_BASE) ;
|
|
56043
|
-
for (i = 1, v = c[0]; v >= 10; v /= 10, i++) ;
|
|
56044
|
-
if (i < LOG_BASE) e -= LOG_BASE - i;
|
|
56045
|
-
}
|
|
56046
|
-
rand.e = e;
|
|
56047
|
-
rand.c = c;
|
|
56048
|
-
return rand;
|
|
56049
|
-
};
|
|
56050
|
-
})();
|
|
56051
|
-
BigNumber3.sum = function() {
|
|
56052
|
-
var i = 1, args = arguments, sum = new BigNumber3(args[0]);
|
|
56053
|
-
for (; i < args.length; ) sum = sum.plus(args[i++]);
|
|
56054
|
-
return sum;
|
|
56055
|
-
};
|
|
56056
|
-
convertBase = /* @__PURE__ */ (function() {
|
|
56057
|
-
var decimal = "0123456789";
|
|
56058
|
-
function toBaseOut(str, baseIn, baseOut, alphabet) {
|
|
56059
|
-
var j, arr = [0], arrL, i = 0, len = str.length;
|
|
56060
|
-
for (; i < len; ) {
|
|
56061
|
-
for (arrL = arr.length; arrL--; arr[arrL] *= baseIn) ;
|
|
56062
|
-
arr[0] += alphabet.indexOf(str.charAt(i++));
|
|
56063
|
-
for (j = 0; j < arr.length; j++) {
|
|
56064
|
-
if (arr[j] > baseOut - 1) {
|
|
56065
|
-
if (arr[j + 1] == null) arr[j + 1] = 0;
|
|
56066
|
-
arr[j + 1] += arr[j] / baseOut | 0;
|
|
56067
|
-
arr[j] %= baseOut;
|
|
56068
|
-
}
|
|
56069
|
-
}
|
|
56070
|
-
}
|
|
56071
|
-
return arr.reverse();
|
|
56072
|
-
}
|
|
56073
|
-
return function(str, baseIn, baseOut, sign, callerIsToString) {
|
|
56074
|
-
var alphabet, d, e, k, r, x, xc, y, i = str.indexOf("."), dp = DECIMAL_PLACES, rm = ROUNDING_MODE;
|
|
56075
|
-
if (i >= 0) {
|
|
56076
|
-
k = POW_PRECISION;
|
|
56077
|
-
POW_PRECISION = 0;
|
|
56078
|
-
str = str.replace(".", "");
|
|
56079
|
-
y = new BigNumber3(baseIn);
|
|
56080
|
-
x = y.pow(str.length - i);
|
|
56081
|
-
POW_PRECISION = k;
|
|
56082
|
-
y.c = toBaseOut(
|
|
56083
|
-
toFixedPoint(coeffToString(x.c), x.e, "0"),
|
|
56084
|
-
10,
|
|
56085
|
-
baseOut,
|
|
56086
|
-
decimal
|
|
56087
|
-
);
|
|
56088
|
-
y.e = y.c.length;
|
|
56089
|
-
}
|
|
56090
|
-
xc = toBaseOut(str, baseIn, baseOut, callerIsToString ? (alphabet = ALPHABET, decimal) : (alphabet = decimal, ALPHABET));
|
|
56091
|
-
e = k = xc.length;
|
|
56092
|
-
for (; xc[--k] == 0; xc.pop()) ;
|
|
56093
|
-
if (!xc[0]) return alphabet.charAt(0);
|
|
56094
|
-
if (i < 0) {
|
|
56095
|
-
--e;
|
|
56096
|
-
} else {
|
|
56097
|
-
x.c = xc;
|
|
56098
|
-
x.e = e;
|
|
56099
|
-
x.s = sign;
|
|
56100
|
-
x = div(x, y, dp, rm, baseOut);
|
|
56101
|
-
xc = x.c;
|
|
56102
|
-
r = x.r;
|
|
56103
|
-
e = x.e;
|
|
56104
|
-
}
|
|
56105
|
-
d = e + dp + 1;
|
|
56106
|
-
i = xc[d];
|
|
56107
|
-
k = baseOut / 2;
|
|
56108
|
-
r = r || d < 0 || xc[d + 1] != null;
|
|
56109
|
-
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));
|
|
56110
|
-
if (d < 1 || !xc[0]) {
|
|
56111
|
-
str = r ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) : alphabet.charAt(0);
|
|
56112
|
-
} else {
|
|
56113
|
-
xc.length = d;
|
|
56114
|
-
if (r) {
|
|
56115
|
-
for (--baseOut; ++xc[--d] > baseOut; ) {
|
|
56116
|
-
xc[d] = 0;
|
|
56117
|
-
if (!d) {
|
|
56118
|
-
++e;
|
|
56119
|
-
xc = [1].concat(xc);
|
|
56120
|
-
}
|
|
56121
|
-
}
|
|
56122
|
-
}
|
|
56123
|
-
for (k = xc.length; !xc[--k]; ) ;
|
|
56124
|
-
for (i = 0, str = ""; i <= k; str += alphabet.charAt(xc[i++])) ;
|
|
56125
|
-
str = toFixedPoint(str, e, alphabet.charAt(0));
|
|
56126
|
-
}
|
|
56127
|
-
return str;
|
|
56128
|
-
};
|
|
56129
|
-
})();
|
|
56130
|
-
div = /* @__PURE__ */ (function() {
|
|
56131
|
-
function multiply(x, k, base) {
|
|
56132
|
-
var m, temp, xlo, xhi, carry = 0, i = x.length, klo = k % SQRT_BASE, khi = k / SQRT_BASE | 0;
|
|
56133
|
-
for (x = x.slice(); i--; ) {
|
|
56134
|
-
xlo = x[i] % SQRT_BASE;
|
|
56135
|
-
xhi = x[i] / SQRT_BASE | 0;
|
|
56136
|
-
m = khi * xlo + xhi * klo;
|
|
56137
|
-
temp = klo * xlo + m % SQRT_BASE * SQRT_BASE + carry;
|
|
56138
|
-
carry = (temp / base | 0) + (m / SQRT_BASE | 0) + khi * xhi;
|
|
56139
|
-
x[i] = temp % base;
|
|
56140
|
-
}
|
|
56141
|
-
if (carry) x = [carry].concat(x);
|
|
56142
|
-
return x;
|
|
56143
|
-
}
|
|
56144
|
-
function compare2(a, b, aL, bL) {
|
|
56145
|
-
var i, cmp;
|
|
56146
|
-
if (aL != bL) {
|
|
56147
|
-
cmp = aL > bL ? 1 : -1;
|
|
56148
|
-
} else {
|
|
56149
|
-
for (i = cmp = 0; i < aL; i++) {
|
|
56150
|
-
if (a[i] != b[i]) {
|
|
56151
|
-
cmp = a[i] > b[i] ? 1 : -1;
|
|
56152
|
-
break;
|
|
56153
|
-
}
|
|
56154
|
-
}
|
|
56155
|
-
}
|
|
56156
|
-
return cmp;
|
|
56157
|
-
}
|
|
56158
|
-
function subtract(a, b, aL, base) {
|
|
56159
|
-
var i = 0;
|
|
56160
|
-
for (; aL--; ) {
|
|
56161
|
-
a[aL] -= i;
|
|
56162
|
-
i = a[aL] < b[aL] ? 1 : 0;
|
|
56163
|
-
a[aL] = i * base + a[aL] - b[aL];
|
|
56164
|
-
}
|
|
56165
|
-
for (; !a[0] && a.length > 1; a.splice(0, 1)) ;
|
|
56166
|
-
}
|
|
56167
|
-
return function(x, y, dp, rm, base) {
|
|
56168
|
-
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;
|
|
56169
|
-
if (!xc || !xc[0] || !yc || !yc[0]) {
|
|
56170
|
-
return new BigNumber3(
|
|
56171
|
-
// Return NaN if either NaN, or both Infinity or 0.
|
|
56172
|
-
!x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN : (
|
|
56173
|
-
// Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.
|
|
56174
|
-
xc && xc[0] == 0 || !yc ? s * 0 : s / 0
|
|
56175
|
-
)
|
|
56176
|
-
);
|
|
56177
|
-
}
|
|
56178
|
-
q = new BigNumber3(s);
|
|
56179
|
-
qc = q.c = [];
|
|
56180
|
-
e = x.e - y.e;
|
|
56181
|
-
s = dp + e + 1;
|
|
56182
|
-
if (!base) {
|
|
56183
|
-
base = BASE;
|
|
56184
|
-
e = bitFloor(x.e / LOG_BASE) - bitFloor(y.e / LOG_BASE);
|
|
56185
|
-
s = s / LOG_BASE | 0;
|
|
56186
|
-
}
|
|
56187
|
-
for (i = 0; yc[i] == (xc[i] || 0); i++) ;
|
|
56188
|
-
if (yc[i] > (xc[i] || 0)) e--;
|
|
56189
|
-
if (s < 0) {
|
|
56190
|
-
qc.push(1);
|
|
56191
|
-
more = true;
|
|
56192
|
-
} else {
|
|
56193
|
-
xL = xc.length;
|
|
56194
|
-
yL = yc.length;
|
|
56195
|
-
i = 0;
|
|
56196
|
-
s += 2;
|
|
56197
|
-
n = mathfloor(base / (yc[0] + 1));
|
|
56198
|
-
if (n > 1) {
|
|
56199
|
-
yc = multiply(yc, n, base);
|
|
56200
|
-
xc = multiply(xc, n, base);
|
|
56201
|
-
yL = yc.length;
|
|
56202
|
-
xL = xc.length;
|
|
56203
|
-
}
|
|
56204
|
-
xi = yL;
|
|
56205
|
-
rem = xc.slice(0, yL);
|
|
56206
|
-
remL = rem.length;
|
|
56207
|
-
for (; remL < yL; rem[remL++] = 0) ;
|
|
56208
|
-
yz = yc.slice();
|
|
56209
|
-
yz = [0].concat(yz);
|
|
56210
|
-
yc0 = yc[0];
|
|
56211
|
-
if (yc[1] >= base / 2) yc0++;
|
|
56212
|
-
do {
|
|
56213
|
-
n = 0;
|
|
56214
|
-
cmp = compare2(yc, rem, yL, remL);
|
|
56215
|
-
if (cmp < 0) {
|
|
56216
|
-
rem0 = rem[0];
|
|
56217
|
-
if (yL != remL) rem0 = rem0 * base + (rem[1] || 0);
|
|
56218
|
-
n = mathfloor(rem0 / yc0);
|
|
56219
|
-
if (n > 1) {
|
|
56220
|
-
if (n >= base) n = base - 1;
|
|
56221
|
-
prod = multiply(yc, n, base);
|
|
56222
|
-
prodL = prod.length;
|
|
56223
|
-
remL = rem.length;
|
|
56224
|
-
while (compare2(prod, rem, prodL, remL) == 1) {
|
|
56225
|
-
n--;
|
|
56226
|
-
subtract(prod, yL < prodL ? yz : yc, prodL, base);
|
|
56227
|
-
prodL = prod.length;
|
|
56228
|
-
cmp = 1;
|
|
56229
|
-
}
|
|
56230
|
-
} else {
|
|
56231
|
-
if (n == 0) {
|
|
56232
|
-
cmp = n = 1;
|
|
56233
|
-
}
|
|
56234
|
-
prod = yc.slice();
|
|
56235
|
-
prodL = prod.length;
|
|
56236
|
-
}
|
|
56237
|
-
if (prodL < remL) prod = [0].concat(prod);
|
|
56238
|
-
subtract(rem, prod, remL, base);
|
|
56239
|
-
remL = rem.length;
|
|
56240
|
-
if (cmp == -1) {
|
|
56241
|
-
while (compare2(yc, rem, yL, remL) < 1) {
|
|
56242
|
-
n++;
|
|
56243
|
-
subtract(rem, yL < remL ? yz : yc, remL, base);
|
|
56244
|
-
remL = rem.length;
|
|
56245
|
-
}
|
|
56246
|
-
}
|
|
56247
|
-
} else if (cmp === 0) {
|
|
56248
|
-
n++;
|
|
56249
|
-
rem = [0];
|
|
56250
|
-
}
|
|
56251
|
-
qc[i++] = n;
|
|
56252
|
-
if (rem[0]) {
|
|
56253
|
-
rem[remL++] = xc[xi] || 0;
|
|
56254
|
-
} else {
|
|
56255
|
-
rem = [xc[xi]];
|
|
56256
|
-
remL = 1;
|
|
56257
|
-
}
|
|
56258
|
-
} while ((xi++ < xL || rem[0] != null) && s--);
|
|
56259
|
-
more = rem[0] != null;
|
|
56260
|
-
if (!qc[0]) qc.splice(0, 1);
|
|
56261
|
-
}
|
|
56262
|
-
if (base == BASE) {
|
|
56263
|
-
for (i = 1, s = qc[0]; s >= 10; s /= 10, i++) ;
|
|
56264
|
-
round(q, dp + (q.e = i + e * LOG_BASE - 1) + 1, rm, more);
|
|
56265
|
-
} else {
|
|
56266
|
-
q.e = e;
|
|
56267
|
-
q.r = +more;
|
|
56268
|
-
}
|
|
56269
|
-
return q;
|
|
56270
|
-
};
|
|
56271
|
-
})();
|
|
56272
|
-
function format(n, i, rm, id) {
|
|
56273
|
-
var c0, e, ne, len, str;
|
|
56274
|
-
if (rm == null) rm = ROUNDING_MODE;
|
|
56275
|
-
else intCheck(rm, 0, 8);
|
|
56276
|
-
if (!n.c) return n.toString();
|
|
56277
|
-
c0 = n.c[0];
|
|
56278
|
-
ne = n.e;
|
|
56279
|
-
if (i == null) {
|
|
56280
|
-
str = coeffToString(n.c);
|
|
56281
|
-
str = id == 1 || id == 2 && (ne <= TO_EXP_NEG || ne >= TO_EXP_POS) ? toExponential(str, ne) : toFixedPoint(str, ne, "0");
|
|
56282
|
-
} else {
|
|
56283
|
-
n = round(new BigNumber3(n), i, rm);
|
|
56284
|
-
e = n.e;
|
|
56285
|
-
str = coeffToString(n.c);
|
|
56286
|
-
len = str.length;
|
|
56287
|
-
if (id == 1 || id == 2 && (i <= e || e <= TO_EXP_NEG)) {
|
|
56288
|
-
for (; len < i; str += "0", len++) ;
|
|
56289
|
-
str = toExponential(str, e);
|
|
56290
|
-
} else {
|
|
56291
|
-
i -= ne;
|
|
56292
|
-
str = toFixedPoint(str, e, "0");
|
|
56293
|
-
if (e + 1 > len) {
|
|
56294
|
-
if (--i > 0) for (str += "."; i--; str += "0") ;
|
|
56295
|
-
} else {
|
|
56296
|
-
i += e - len;
|
|
56297
|
-
if (i > 0) {
|
|
56298
|
-
if (e + 1 == len) str += ".";
|
|
56299
|
-
for (; i--; str += "0") ;
|
|
56300
|
-
}
|
|
56301
|
-
}
|
|
56302
|
-
}
|
|
56303
|
-
}
|
|
56304
|
-
return n.s < 0 && c0 ? "-" + str : str;
|
|
56305
|
-
}
|
|
56306
|
-
function maxOrMin(args, method) {
|
|
56307
|
-
var n, i = 1, m = new BigNumber3(args[0]);
|
|
56308
|
-
for (; i < args.length; i++) {
|
|
56309
|
-
n = new BigNumber3(args[i]);
|
|
56310
|
-
if (!n.s) {
|
|
56311
|
-
m = n;
|
|
56312
|
-
break;
|
|
56313
|
-
} else if (method.call(m, n)) {
|
|
56314
|
-
m = n;
|
|
56315
|
-
}
|
|
56316
|
-
}
|
|
56317
|
-
return m;
|
|
56318
|
-
}
|
|
56319
|
-
function normalise(n, c, e) {
|
|
56320
|
-
var i = 1, j = c.length;
|
|
56321
|
-
for (; !c[--j]; c.pop()) ;
|
|
56322
|
-
for (j = c[0]; j >= 10; j /= 10, i++) ;
|
|
56323
|
-
if ((e = i + e * LOG_BASE - 1) > MAX_EXP) {
|
|
56324
|
-
n.c = n.e = null;
|
|
56325
|
-
} else if (e < MIN_EXP) {
|
|
56326
|
-
n.c = [n.e = 0];
|
|
56327
|
-
} else {
|
|
56328
|
-
n.e = e;
|
|
56329
|
-
n.c = c;
|
|
56330
|
-
}
|
|
56331
|
-
return n;
|
|
56332
|
-
}
|
|
56333
|
-
parseNumeric = /* @__PURE__ */ (function() {
|
|
56334
|
-
var basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i, dotAfter = /^([^.]+)\.$/, dotBefore = /^\.([^.]+)$/, isInfinityOrNaN = /^-?(Infinity|NaN)$/, whitespaceOrPlus = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
|
|
56335
|
-
return function(x, str, isNum, b) {
|
|
56336
|
-
var base, s = isNum ? str : str.replace(whitespaceOrPlus, "");
|
|
56337
|
-
if (isInfinityOrNaN.test(s)) {
|
|
56338
|
-
x.s = isNaN(s) ? null : s < 0 ? -1 : 1;
|
|
56339
|
-
} else {
|
|
56340
|
-
if (!isNum) {
|
|
56341
|
-
s = s.replace(basePrefix, function(m, p1, p2) {
|
|
56342
|
-
base = (p2 = p2.toLowerCase()) == "x" ? 16 : p2 == "b" ? 2 : 8;
|
|
56343
|
-
return !b || b == base ? p1 : m;
|
|
56344
|
-
});
|
|
56345
|
-
if (b) {
|
|
56346
|
-
base = b;
|
|
56347
|
-
s = s.replace(dotAfter, "$1").replace(dotBefore, "0.$1");
|
|
56348
|
-
}
|
|
56349
|
-
if (str != s) return new BigNumber3(s, base);
|
|
56350
|
-
}
|
|
56351
|
-
if (BigNumber3.DEBUG) {
|
|
56352
|
-
throw Error(bignumberError + "Not a" + (b ? " base " + b : "") + " number: " + str);
|
|
56353
|
-
}
|
|
56354
|
-
x.s = null;
|
|
56355
|
-
}
|
|
56356
|
-
x.c = x.e = null;
|
|
56357
|
-
};
|
|
56358
|
-
})();
|
|
56359
|
-
function round(x, sd, rm, r) {
|
|
56360
|
-
var d, i, j, k, n, ni, rd, xc = x.c, pows10 = POWS_TEN;
|
|
56361
|
-
if (xc) {
|
|
56362
|
-
out: {
|
|
56363
|
-
for (d = 1, k = xc[0]; k >= 10; k /= 10, d++) ;
|
|
56364
|
-
i = sd - d;
|
|
56365
|
-
if (i < 0) {
|
|
56366
|
-
i += LOG_BASE;
|
|
56367
|
-
j = sd;
|
|
56368
|
-
n = xc[ni = 0];
|
|
56369
|
-
rd = n / pows10[d - j - 1] % 10 | 0;
|
|
56370
|
-
} else {
|
|
56371
|
-
ni = mathceil((i + 1) / LOG_BASE);
|
|
56372
|
-
if (ni >= xc.length) {
|
|
56373
|
-
if (r) {
|
|
56374
|
-
for (; xc.length <= ni; xc.push(0)) ;
|
|
56375
|
-
n = rd = 0;
|
|
56376
|
-
d = 1;
|
|
56377
|
-
i %= LOG_BASE;
|
|
56378
|
-
j = i - LOG_BASE + 1;
|
|
56379
|
-
} else {
|
|
56380
|
-
break out;
|
|
56381
|
-
}
|
|
56382
|
-
} else {
|
|
56383
|
-
n = k = xc[ni];
|
|
56384
|
-
for (d = 1; k >= 10; k /= 10, d++) ;
|
|
56385
|
-
i %= LOG_BASE;
|
|
56386
|
-
j = i - LOG_BASE + d;
|
|
56387
|
-
rd = j < 0 ? 0 : n / pows10[d - j - 1] % 10 | 0;
|
|
56388
|
-
}
|
|
56389
|
-
}
|
|
56390
|
-
r = r || sd < 0 || // Are there any non-zero digits after the rounding digit?
|
|
56391
|
-
// The expression n % pows10[d - j - 1] returns all digits of n to the right
|
|
56392
|
-
// of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.
|
|
56393
|
-
xc[ni + 1] != null || (j < 0 ? n : n % pows10[d - j - 1]);
|
|
56394
|
-
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.
|
|
56395
|
-
(i > 0 ? j > 0 ? n / pows10[d - j] : 0 : xc[ni - 1]) % 10 & 1 || rm == (x.s < 0 ? 8 : 7));
|
|
56396
|
-
if (sd < 1 || !xc[0]) {
|
|
56397
|
-
xc.length = 0;
|
|
56398
|
-
if (r) {
|
|
56399
|
-
sd -= x.e + 1;
|
|
56400
|
-
xc[0] = pows10[(LOG_BASE - sd % LOG_BASE) % LOG_BASE];
|
|
56401
|
-
x.e = -sd || 0;
|
|
56402
|
-
} else {
|
|
56403
|
-
xc[0] = x.e = 0;
|
|
56404
|
-
}
|
|
56405
|
-
return x;
|
|
56406
|
-
}
|
|
56407
|
-
if (i == 0) {
|
|
56408
|
-
xc.length = ni;
|
|
56409
|
-
k = 1;
|
|
56410
|
-
ni--;
|
|
56411
|
-
} else {
|
|
56412
|
-
xc.length = ni + 1;
|
|
56413
|
-
k = pows10[LOG_BASE - i];
|
|
56414
|
-
xc[ni] = j > 0 ? mathfloor(n / pows10[d - j] % pows10[j]) * k : 0;
|
|
56415
|
-
}
|
|
56416
|
-
if (r) {
|
|
56417
|
-
for (; ; ) {
|
|
56418
|
-
if (ni == 0) {
|
|
56419
|
-
for (i = 1, j = xc[0]; j >= 10; j /= 10, i++) ;
|
|
56420
|
-
j = xc[0] += k;
|
|
56421
|
-
for (k = 1; j >= 10; j /= 10, k++) ;
|
|
56422
|
-
if (i != k) {
|
|
56423
|
-
x.e++;
|
|
56424
|
-
if (xc[0] == BASE) xc[0] = 1;
|
|
56425
|
-
}
|
|
56426
|
-
break;
|
|
56427
|
-
} else {
|
|
56428
|
-
xc[ni] += k;
|
|
56429
|
-
if (xc[ni] != BASE) break;
|
|
56430
|
-
xc[ni--] = 0;
|
|
56431
|
-
k = 1;
|
|
56432
|
-
}
|
|
56433
|
-
}
|
|
56434
|
-
}
|
|
56435
|
-
for (i = xc.length; xc[--i] === 0; xc.pop()) ;
|
|
56436
|
-
}
|
|
56437
|
-
if (x.e > MAX_EXP) {
|
|
56438
|
-
x.c = x.e = null;
|
|
56439
|
-
} else if (x.e < MIN_EXP) {
|
|
56440
|
-
x.c = [x.e = 0];
|
|
56441
|
-
}
|
|
56442
|
-
}
|
|
56443
|
-
return x;
|
|
56444
|
-
}
|
|
56445
|
-
function valueOf(n) {
|
|
56446
|
-
var str, e = n.e;
|
|
56447
|
-
if (e === null) return n.toString();
|
|
56448
|
-
str = coeffToString(n.c);
|
|
56449
|
-
str = e <= TO_EXP_NEG || e >= TO_EXP_POS ? toExponential(str, e) : toFixedPoint(str, e, "0");
|
|
56450
|
-
return n.s < 0 ? "-" + str : str;
|
|
56451
|
-
}
|
|
56452
|
-
P.absoluteValue = P.abs = function() {
|
|
56453
|
-
var x = new BigNumber3(this);
|
|
56454
|
-
if (x.s < 0) x.s = 1;
|
|
56455
|
-
return x;
|
|
56456
|
-
};
|
|
56457
|
-
P.comparedTo = function(y, b) {
|
|
56458
|
-
return compare(this, new BigNumber3(y, b));
|
|
56459
|
-
};
|
|
56460
|
-
P.decimalPlaces = P.dp = function(dp, rm) {
|
|
56461
|
-
var c, n, v, x = this;
|
|
56462
|
-
if (dp != null) {
|
|
56463
|
-
intCheck(dp, 0, MAX);
|
|
56464
|
-
if (rm == null) rm = ROUNDING_MODE;
|
|
56465
|
-
else intCheck(rm, 0, 8);
|
|
56466
|
-
return round(new BigNumber3(x), dp + x.e + 1, rm);
|
|
56467
|
-
}
|
|
56468
|
-
if (!(c = x.c)) return null;
|
|
56469
|
-
n = ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE;
|
|
56470
|
-
if (v = c[v]) for (; v % 10 == 0; v /= 10, n--) ;
|
|
56471
|
-
if (n < 0) n = 0;
|
|
56472
|
-
return n;
|
|
56473
|
-
};
|
|
56474
|
-
P.dividedBy = P.div = function(y, b) {
|
|
56475
|
-
return div(this, new BigNumber3(y, b), DECIMAL_PLACES, ROUNDING_MODE);
|
|
56476
|
-
};
|
|
56477
|
-
P.dividedToIntegerBy = P.idiv = function(y, b) {
|
|
56478
|
-
return div(this, new BigNumber3(y, b), 0, 1);
|
|
56479
|
-
};
|
|
56480
|
-
P.exponentiatedBy = P.pow = function(n, m) {
|
|
56481
|
-
var half, isModExp, i, k, more, nIsBig, nIsNeg, nIsOdd, y, x = this;
|
|
56482
|
-
n = new BigNumber3(n);
|
|
56483
|
-
if (n.c && !n.isInteger()) {
|
|
56484
|
-
throw Error(bignumberError + "Exponent not an integer: " + valueOf(n));
|
|
56485
|
-
}
|
|
56486
|
-
if (m != null) m = new BigNumber3(m);
|
|
56487
|
-
nIsBig = n.e > 14;
|
|
56488
|
-
if (!x.c || !x.c[0] || x.c[0] == 1 && !x.e && x.c.length == 1 || !n.c || !n.c[0]) {
|
|
56489
|
-
y = new BigNumber3(Math.pow(+valueOf(x), nIsBig ? 2 - isOdd(n) : +valueOf(n)));
|
|
56490
|
-
return m ? y.mod(m) : y;
|
|
56491
|
-
}
|
|
56492
|
-
nIsNeg = n.s < 0;
|
|
56493
|
-
if (m) {
|
|
56494
|
-
if (m.c ? !m.c[0] : !m.s) return new BigNumber3(NaN);
|
|
56495
|
-
isModExp = !nIsNeg && x.isInteger() && m.isInteger();
|
|
56496
|
-
if (isModExp) x = x.mod(m);
|
|
56497
|
-
} 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))) {
|
|
56498
|
-
k = x.s < 0 && isOdd(n) ? -0 : 0;
|
|
56499
|
-
if (x.e > -1) k = 1 / k;
|
|
56500
|
-
return new BigNumber3(nIsNeg ? 1 / k : k);
|
|
56501
|
-
} else if (POW_PRECISION) {
|
|
56502
|
-
k = mathceil(POW_PRECISION / LOG_BASE + 2);
|
|
56503
|
-
}
|
|
56504
|
-
if (nIsBig) {
|
|
56505
|
-
half = new BigNumber3(0.5);
|
|
56506
|
-
if (nIsNeg) n.s = 1;
|
|
56507
|
-
nIsOdd = isOdd(n);
|
|
56508
|
-
} else {
|
|
56509
|
-
i = Math.abs(+valueOf(n));
|
|
56510
|
-
nIsOdd = i % 2;
|
|
56511
|
-
}
|
|
56512
|
-
y = new BigNumber3(ONE);
|
|
56513
|
-
for (; ; ) {
|
|
56514
|
-
if (nIsOdd) {
|
|
56515
|
-
y = y.times(x);
|
|
56516
|
-
if (!y.c) break;
|
|
56517
|
-
if (k) {
|
|
56518
|
-
if (y.c.length > k) y.c.length = k;
|
|
56519
|
-
} else if (isModExp) {
|
|
56520
|
-
y = y.mod(m);
|
|
56521
|
-
}
|
|
56522
|
-
}
|
|
56523
|
-
if (i) {
|
|
56524
|
-
i = mathfloor(i / 2);
|
|
56525
|
-
if (i === 0) break;
|
|
56526
|
-
nIsOdd = i % 2;
|
|
56527
|
-
} else {
|
|
56528
|
-
n = n.times(half);
|
|
56529
|
-
round(n, n.e + 1, 1);
|
|
56530
|
-
if (n.e > 14) {
|
|
56531
|
-
nIsOdd = isOdd(n);
|
|
56532
|
-
} else {
|
|
56533
|
-
i = +valueOf(n);
|
|
56534
|
-
if (i === 0) break;
|
|
56535
|
-
nIsOdd = i % 2;
|
|
56536
|
-
}
|
|
56537
|
-
}
|
|
56538
|
-
x = x.times(x);
|
|
56539
|
-
if (k) {
|
|
56540
|
-
if (x.c && x.c.length > k) x.c.length = k;
|
|
56541
|
-
} else if (isModExp) {
|
|
56542
|
-
x = x.mod(m);
|
|
56543
|
-
}
|
|
56544
|
-
}
|
|
56545
|
-
if (isModExp) return y;
|
|
56546
|
-
if (nIsNeg) y = ONE.div(y);
|
|
56547
|
-
return m ? y.mod(m) : k ? round(y, POW_PRECISION, ROUNDING_MODE, more) : y;
|
|
56548
|
-
};
|
|
56549
|
-
P.integerValue = function(rm) {
|
|
56550
|
-
var n = new BigNumber3(this);
|
|
56551
|
-
if (rm == null) rm = ROUNDING_MODE;
|
|
56552
|
-
else intCheck(rm, 0, 8);
|
|
56553
|
-
return round(n, n.e + 1, rm);
|
|
56554
|
-
};
|
|
56555
|
-
P.isEqualTo = P.eq = function(y, b) {
|
|
56556
|
-
return compare(this, new BigNumber3(y, b)) === 0;
|
|
56557
|
-
};
|
|
56558
|
-
P.isFinite = function() {
|
|
56559
|
-
return !!this.c;
|
|
56560
|
-
};
|
|
56561
|
-
P.isGreaterThan = P.gt = function(y, b) {
|
|
56562
|
-
return compare(this, new BigNumber3(y, b)) > 0;
|
|
56563
|
-
};
|
|
56564
|
-
P.isGreaterThanOrEqualTo = P.gte = function(y, b) {
|
|
56565
|
-
return (b = compare(this, new BigNumber3(y, b))) === 1 || b === 0;
|
|
56566
|
-
};
|
|
56567
|
-
P.isInteger = function() {
|
|
56568
|
-
return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2;
|
|
56569
|
-
};
|
|
56570
|
-
P.isLessThan = P.lt = function(y, b) {
|
|
56571
|
-
return compare(this, new BigNumber3(y, b)) < 0;
|
|
56572
|
-
};
|
|
56573
|
-
P.isLessThanOrEqualTo = P.lte = function(y, b) {
|
|
56574
|
-
return (b = compare(this, new BigNumber3(y, b))) === -1 || b === 0;
|
|
56575
|
-
};
|
|
56576
|
-
P.isNaN = function() {
|
|
56577
|
-
return !this.s;
|
|
56578
|
-
};
|
|
56579
|
-
P.isNegative = function() {
|
|
56580
|
-
return this.s < 0;
|
|
56581
|
-
};
|
|
56582
|
-
P.isPositive = function() {
|
|
56583
|
-
return this.s > 0;
|
|
56584
|
-
};
|
|
56585
|
-
P.isZero = function() {
|
|
56586
|
-
return !!this.c && this.c[0] == 0;
|
|
56587
|
-
};
|
|
56588
|
-
P.minus = function(y, b) {
|
|
56589
|
-
var i, j, t, xLTy, x = this, a = x.s;
|
|
56590
|
-
y = new BigNumber3(y, b);
|
|
56591
|
-
b = y.s;
|
|
56592
|
-
if (!a || !b) return new BigNumber3(NaN);
|
|
56593
|
-
if (a != b) {
|
|
56594
|
-
y.s = -b;
|
|
56595
|
-
return x.plus(y);
|
|
56596
|
-
}
|
|
56597
|
-
var xe = x.e / LOG_BASE, ye = y.e / LOG_BASE, xc = x.c, yc = y.c;
|
|
56598
|
-
if (!xe || !ye) {
|
|
56599
|
-
if (!xc || !yc) return xc ? (y.s = -b, y) : new BigNumber3(yc ? x : NaN);
|
|
56600
|
-
if (!xc[0] || !yc[0]) {
|
|
56601
|
-
return yc[0] ? (y.s = -b, y) : new BigNumber3(xc[0] ? x : (
|
|
56602
|
-
// IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity
|
|
56603
|
-
ROUNDING_MODE == 3 ? -0 : 0
|
|
56604
|
-
));
|
|
56605
|
-
}
|
|
56606
|
-
}
|
|
56607
|
-
xe = bitFloor(xe);
|
|
56608
|
-
ye = bitFloor(ye);
|
|
56609
|
-
xc = xc.slice();
|
|
56610
|
-
if (a = xe - ye) {
|
|
56611
|
-
if (xLTy = a < 0) {
|
|
56612
|
-
a = -a;
|
|
56613
|
-
t = xc;
|
|
56614
|
-
} else {
|
|
56615
|
-
ye = xe;
|
|
56616
|
-
t = yc;
|
|
56617
|
-
}
|
|
56618
|
-
t.reverse();
|
|
56619
|
-
for (b = a; b--; t.push(0)) ;
|
|
56620
|
-
t.reverse();
|
|
56621
|
-
} else {
|
|
56622
|
-
j = (xLTy = (a = xc.length) < (b = yc.length)) ? a : b;
|
|
56623
|
-
for (a = b = 0; b < j; b++) {
|
|
56624
|
-
if (xc[b] != yc[b]) {
|
|
56625
|
-
xLTy = xc[b] < yc[b];
|
|
56626
|
-
break;
|
|
56627
|
-
}
|
|
56628
|
-
}
|
|
56629
|
-
}
|
|
56630
|
-
if (xLTy) t = xc, xc = yc, yc = t, y.s = -y.s;
|
|
56631
|
-
b = (j = yc.length) - (i = xc.length);
|
|
56632
|
-
if (b > 0) for (; b--; xc[i++] = 0) ;
|
|
56633
|
-
b = BASE - 1;
|
|
56634
|
-
for (; j > a; ) {
|
|
56635
|
-
if (xc[--j] < yc[j]) {
|
|
56636
|
-
for (i = j; i && !xc[--i]; xc[i] = b) ;
|
|
56637
|
-
--xc[i];
|
|
56638
|
-
xc[j] += BASE;
|
|
56639
|
-
}
|
|
56640
|
-
xc[j] -= yc[j];
|
|
56641
|
-
}
|
|
56642
|
-
for (; xc[0] == 0; xc.splice(0, 1), --ye) ;
|
|
56643
|
-
if (!xc[0]) {
|
|
56644
|
-
y.s = ROUNDING_MODE == 3 ? -1 : 1;
|
|
56645
|
-
y.c = [y.e = 0];
|
|
56646
|
-
return y;
|
|
56647
|
-
}
|
|
56648
|
-
return normalise(y, xc, ye);
|
|
56649
|
-
};
|
|
56650
|
-
P.modulo = P.mod = function(y, b) {
|
|
56651
|
-
var q, s, x = this;
|
|
56652
|
-
y = new BigNumber3(y, b);
|
|
56653
|
-
if (!x.c || !y.s || y.c && !y.c[0]) {
|
|
56654
|
-
return new BigNumber3(NaN);
|
|
56655
|
-
} else if (!y.c || x.c && !x.c[0]) {
|
|
56656
|
-
return new BigNumber3(x);
|
|
56657
|
-
}
|
|
56658
|
-
if (MODULO_MODE == 9) {
|
|
56659
|
-
s = y.s;
|
|
56660
|
-
y.s = 1;
|
|
56661
|
-
q = div(x, y, 0, 3);
|
|
56662
|
-
y.s = s;
|
|
56663
|
-
q.s *= s;
|
|
56664
|
-
} else {
|
|
56665
|
-
q = div(x, y, 0, MODULO_MODE);
|
|
56666
|
-
}
|
|
56667
|
-
y = x.minus(q.times(y));
|
|
56668
|
-
if (!y.c[0] && MODULO_MODE == 1) y.s = x.s;
|
|
56669
|
-
return y;
|
|
56670
|
-
};
|
|
56671
|
-
P.multipliedBy = P.times = function(y, b) {
|
|
56672
|
-
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;
|
|
56673
|
-
if (!xc || !yc || !xc[0] || !yc[0]) {
|
|
56674
|
-
if (!x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) {
|
|
56675
|
-
y.c = y.e = y.s = null;
|
|
56676
|
-
} else {
|
|
56677
|
-
y.s *= x.s;
|
|
56678
|
-
if (!xc || !yc) {
|
|
56679
|
-
y.c = y.e = null;
|
|
56680
|
-
} else {
|
|
56681
|
-
y.c = [0];
|
|
56682
|
-
y.e = 0;
|
|
56683
|
-
}
|
|
56684
|
-
}
|
|
56685
|
-
return y;
|
|
56686
|
-
}
|
|
56687
|
-
e = bitFloor(x.e / LOG_BASE) + bitFloor(y.e / LOG_BASE);
|
|
56688
|
-
y.s *= x.s;
|
|
56689
|
-
xcL = xc.length;
|
|
56690
|
-
ycL = yc.length;
|
|
56691
|
-
if (xcL < ycL) zc = xc, xc = yc, yc = zc, i = xcL, xcL = ycL, ycL = i;
|
|
56692
|
-
for (i = xcL + ycL, zc = []; i--; zc.push(0)) ;
|
|
56693
|
-
base = BASE;
|
|
56694
|
-
sqrtBase = SQRT_BASE;
|
|
56695
|
-
for (i = ycL; --i >= 0; ) {
|
|
56696
|
-
c = 0;
|
|
56697
|
-
ylo = yc[i] % sqrtBase;
|
|
56698
|
-
yhi = yc[i] / sqrtBase | 0;
|
|
56699
|
-
for (k = xcL, j = i + k; j > i; ) {
|
|
56700
|
-
xlo = xc[--k] % sqrtBase;
|
|
56701
|
-
xhi = xc[k] / sqrtBase | 0;
|
|
56702
|
-
m = yhi * xlo + xhi * ylo;
|
|
56703
|
-
xlo = ylo * xlo + m % sqrtBase * sqrtBase + zc[j] + c;
|
|
56704
|
-
c = (xlo / base | 0) + (m / sqrtBase | 0) + yhi * xhi;
|
|
56705
|
-
zc[j--] = xlo % base;
|
|
56706
|
-
}
|
|
56707
|
-
zc[j] = c;
|
|
56708
|
-
}
|
|
56709
|
-
if (c) {
|
|
56710
|
-
++e;
|
|
56711
|
-
} else {
|
|
56712
|
-
zc.splice(0, 1);
|
|
56713
|
-
}
|
|
56714
|
-
return normalise(y, zc, e);
|
|
56715
|
-
};
|
|
56716
|
-
P.negated = function() {
|
|
56717
|
-
var x = new BigNumber3(this);
|
|
56718
|
-
x.s = -x.s || null;
|
|
56719
|
-
return x;
|
|
56720
|
-
};
|
|
56721
|
-
P.plus = function(y, b) {
|
|
56722
|
-
var t, x = this, a = x.s;
|
|
56723
|
-
y = new BigNumber3(y, b);
|
|
56724
|
-
b = y.s;
|
|
56725
|
-
if (!a || !b) return new BigNumber3(NaN);
|
|
56726
|
-
if (a != b) {
|
|
56727
|
-
y.s = -b;
|
|
56728
|
-
return x.minus(y);
|
|
56729
|
-
}
|
|
56730
|
-
var xe = x.e / LOG_BASE, ye = y.e / LOG_BASE, xc = x.c, yc = y.c;
|
|
56731
|
-
if (!xe || !ye) {
|
|
56732
|
-
if (!xc || !yc) return new BigNumber3(a / 0);
|
|
56733
|
-
if (!xc[0] || !yc[0]) return yc[0] ? y : new BigNumber3(xc[0] ? x : a * 0);
|
|
56734
|
-
}
|
|
56735
|
-
xe = bitFloor(xe);
|
|
56736
|
-
ye = bitFloor(ye);
|
|
56737
|
-
xc = xc.slice();
|
|
56738
|
-
if (a = xe - ye) {
|
|
56739
|
-
if (a > 0) {
|
|
56740
|
-
ye = xe;
|
|
56741
|
-
t = yc;
|
|
56742
|
-
} else {
|
|
56743
|
-
a = -a;
|
|
56744
|
-
t = xc;
|
|
56745
|
-
}
|
|
56746
|
-
t.reverse();
|
|
56747
|
-
for (; a--; t.push(0)) ;
|
|
56748
|
-
t.reverse();
|
|
56749
|
-
}
|
|
56750
|
-
a = xc.length;
|
|
56751
|
-
b = yc.length;
|
|
56752
|
-
if (a - b < 0) t = yc, yc = xc, xc = t, b = a;
|
|
56753
|
-
for (a = 0; b; ) {
|
|
56754
|
-
a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0;
|
|
56755
|
-
xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE;
|
|
56756
|
-
}
|
|
56757
|
-
if (a) {
|
|
56758
|
-
xc = [a].concat(xc);
|
|
56759
|
-
++ye;
|
|
56760
|
-
}
|
|
56761
|
-
return normalise(y, xc, ye);
|
|
56762
|
-
};
|
|
56763
|
-
P.precision = P.sd = function(sd, rm) {
|
|
56764
|
-
var c, n, v, x = this;
|
|
56765
|
-
if (sd != null && sd !== !!sd) {
|
|
56766
|
-
intCheck(sd, 1, MAX);
|
|
56767
|
-
if (rm == null) rm = ROUNDING_MODE;
|
|
56768
|
-
else intCheck(rm, 0, 8);
|
|
56769
|
-
return round(new BigNumber3(x), sd, rm);
|
|
56770
|
-
}
|
|
56771
|
-
if (!(c = x.c)) return null;
|
|
56772
|
-
v = c.length - 1;
|
|
56773
|
-
n = v * LOG_BASE + 1;
|
|
56774
|
-
if (v = c[v]) {
|
|
56775
|
-
for (; v % 10 == 0; v /= 10, n--) ;
|
|
56776
|
-
for (v = c[0]; v >= 10; v /= 10, n++) ;
|
|
56777
|
-
}
|
|
56778
|
-
if (sd && x.e + 1 > n) n = x.e + 1;
|
|
56779
|
-
return n;
|
|
56780
|
-
};
|
|
56781
|
-
P.shiftedBy = function(k) {
|
|
56782
|
-
intCheck(k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER);
|
|
56783
|
-
return this.times("1e" + k);
|
|
56784
|
-
};
|
|
56785
|
-
P.squareRoot = P.sqrt = function() {
|
|
56786
|
-
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");
|
|
56787
|
-
if (s !== 1 || !c || !c[0]) {
|
|
56788
|
-
return new BigNumber3(!s || s < 0 && (!c || c[0]) ? NaN : c ? x : 1 / 0);
|
|
56789
|
-
}
|
|
56790
|
-
s = Math.sqrt(+valueOf(x));
|
|
56791
|
-
if (s == 0 || s == 1 / 0) {
|
|
56792
|
-
n = coeffToString(c);
|
|
56793
|
-
if ((n.length + e) % 2 == 0) n += "0";
|
|
56794
|
-
s = Math.sqrt(+n);
|
|
56795
|
-
e = bitFloor((e + 1) / 2) - (e < 0 || e % 2);
|
|
56796
|
-
if (s == 1 / 0) {
|
|
56797
|
-
n = "1e" + e;
|
|
56798
|
-
} else {
|
|
56799
|
-
n = s.toExponential();
|
|
56800
|
-
n = n.slice(0, n.indexOf("e") + 1) + e;
|
|
56801
|
-
}
|
|
56802
|
-
r = new BigNumber3(n);
|
|
56803
|
-
} else {
|
|
56804
|
-
r = new BigNumber3(s + "");
|
|
56805
|
-
}
|
|
56806
|
-
if (r.c[0]) {
|
|
56807
|
-
e = r.e;
|
|
56808
|
-
s = e + dp;
|
|
56809
|
-
if (s < 3) s = 0;
|
|
56810
|
-
for (; ; ) {
|
|
56811
|
-
t = r;
|
|
56812
|
-
r = half.times(t.plus(div(x, t, dp, 1)));
|
|
56813
|
-
if (coeffToString(t.c).slice(0, s) === (n = coeffToString(r.c)).slice(0, s)) {
|
|
56814
|
-
if (r.e < e) --s;
|
|
56815
|
-
n = n.slice(s - 3, s + 1);
|
|
56816
|
-
if (n == "9999" || !rep && n == "4999") {
|
|
56817
|
-
if (!rep) {
|
|
56818
|
-
round(t, t.e + DECIMAL_PLACES + 2, 0);
|
|
56819
|
-
if (t.times(t).eq(x)) {
|
|
56820
|
-
r = t;
|
|
56821
|
-
break;
|
|
56822
|
-
}
|
|
56823
|
-
}
|
|
56824
|
-
dp += 4;
|
|
56825
|
-
s += 4;
|
|
56826
|
-
rep = 1;
|
|
56827
|
-
} else {
|
|
56828
|
-
if (!+n || !+n.slice(1) && n.charAt(0) == "5") {
|
|
56829
|
-
round(r, r.e + DECIMAL_PLACES + 2, 1);
|
|
56830
|
-
m = !r.times(r).eq(x);
|
|
56831
|
-
}
|
|
56832
|
-
break;
|
|
56833
|
-
}
|
|
56834
|
-
}
|
|
56835
|
-
}
|
|
56836
|
-
}
|
|
56837
|
-
return round(r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m);
|
|
56838
|
-
};
|
|
56839
|
-
P.toExponential = function(dp, rm) {
|
|
56840
|
-
if (dp != null) {
|
|
56841
|
-
intCheck(dp, 0, MAX);
|
|
56842
|
-
dp++;
|
|
56843
|
-
}
|
|
56844
|
-
return format(this, dp, rm, 1);
|
|
56845
|
-
};
|
|
56846
|
-
P.toFixed = function(dp, rm) {
|
|
56847
|
-
if (dp != null) {
|
|
56848
|
-
intCheck(dp, 0, MAX);
|
|
56849
|
-
dp = dp + this.e + 1;
|
|
56850
|
-
}
|
|
56851
|
-
return format(this, dp, rm);
|
|
56852
|
-
};
|
|
56853
|
-
P.toFormat = function(dp, rm, format2) {
|
|
56854
|
-
var str, x = this;
|
|
56855
|
-
if (format2 == null) {
|
|
56856
|
-
if (dp != null && rm && typeof rm == "object") {
|
|
56857
|
-
format2 = rm;
|
|
56858
|
-
rm = null;
|
|
56859
|
-
} else if (dp && typeof dp == "object") {
|
|
56860
|
-
format2 = dp;
|
|
56861
|
-
dp = rm = null;
|
|
56862
|
-
} else {
|
|
56863
|
-
format2 = FORMAT;
|
|
56864
|
-
}
|
|
56865
|
-
} else if (typeof format2 != "object") {
|
|
56866
|
-
throw Error(bignumberError + "Argument not an object: " + format2);
|
|
56867
|
-
}
|
|
56868
|
-
str = x.toFixed(dp, rm);
|
|
56869
|
-
if (x.c) {
|
|
56870
|
-
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;
|
|
56871
|
-
if (g2) i = g1, g1 = g2, g2 = i, len -= i;
|
|
56872
|
-
if (g1 > 0 && len > 0) {
|
|
56873
|
-
i = len % g1 || g1;
|
|
56874
|
-
intPart = intDigits.substr(0, i);
|
|
56875
|
-
for (; i < len; i += g1) intPart += groupSeparator + intDigits.substr(i, g1);
|
|
56876
|
-
if (g2 > 0) intPart += groupSeparator + intDigits.slice(i);
|
|
56877
|
-
if (isNeg) intPart = "-" + intPart;
|
|
56878
|
-
}
|
|
56879
|
-
str = fractionPart ? intPart + (format2.decimalSeparator || "") + ((g2 = +format2.fractionGroupSize) ? fractionPart.replace(
|
|
56880
|
-
new RegExp("\\d{" + g2 + "}\\B", "g"),
|
|
56881
|
-
"$&" + (format2.fractionGroupSeparator || "")
|
|
56882
|
-
) : fractionPart) : intPart;
|
|
56883
|
-
}
|
|
56884
|
-
return (format2.prefix || "") + str + (format2.suffix || "");
|
|
56885
|
-
};
|
|
56886
|
-
P.toFraction = function(md) {
|
|
56887
|
-
var d, d0, d1, d2, e, exp, n, n0, n1, q, r, s, x = this, xc = x.c;
|
|
56888
|
-
if (md != null) {
|
|
56889
|
-
n = new BigNumber3(md);
|
|
56890
|
-
if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) {
|
|
56891
|
-
throw Error(bignumberError + "Argument " + (n.isInteger() ? "out of range: " : "not an integer: ") + valueOf(n));
|
|
56892
|
-
}
|
|
56893
|
-
}
|
|
56894
|
-
if (!xc) return new BigNumber3(x);
|
|
56895
|
-
d = new BigNumber3(ONE);
|
|
56896
|
-
n1 = d0 = new BigNumber3(ONE);
|
|
56897
|
-
d1 = n0 = new BigNumber3(ONE);
|
|
56898
|
-
s = coeffToString(xc);
|
|
56899
|
-
e = d.e = s.length - x.e - 1;
|
|
56900
|
-
d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp];
|
|
56901
|
-
md = !md || n.comparedTo(d) > 0 ? e > 0 ? d : n1 : n;
|
|
56902
|
-
exp = MAX_EXP;
|
|
56903
|
-
MAX_EXP = 1 / 0;
|
|
56904
|
-
n = new BigNumber3(s);
|
|
56905
|
-
n0.c[0] = 0;
|
|
56906
|
-
for (; ; ) {
|
|
56907
|
-
q = div(n, d, 0, 1);
|
|
56908
|
-
d2 = d0.plus(q.times(d1));
|
|
56909
|
-
if (d2.comparedTo(md) == 1) break;
|
|
56910
|
-
d0 = d1;
|
|
56911
|
-
d1 = d2;
|
|
56912
|
-
n1 = n0.plus(q.times(d2 = n1));
|
|
56913
|
-
n0 = d2;
|
|
56914
|
-
d = n.minus(q.times(d2 = d));
|
|
56915
|
-
n = d2;
|
|
56916
|
-
}
|
|
56917
|
-
d2 = div(md.minus(d0), d1, 0, 1);
|
|
56918
|
-
n0 = n0.plus(d2.times(n1));
|
|
56919
|
-
d0 = d0.plus(d2.times(d1));
|
|
56920
|
-
n0.s = n1.s = x.s;
|
|
56921
|
-
e = e * 2;
|
|
56922
|
-
r = div(n1, d1, e, ROUNDING_MODE).minus(x).abs().comparedTo(
|
|
56923
|
-
div(n0, d0, e, ROUNDING_MODE).minus(x).abs()
|
|
56924
|
-
) < 1 ? [n1, d1] : [n0, d0];
|
|
56925
|
-
MAX_EXP = exp;
|
|
56926
|
-
return r;
|
|
56927
|
-
};
|
|
56928
|
-
P.toNumber = function() {
|
|
56929
|
-
return +valueOf(this);
|
|
56930
|
-
};
|
|
56931
|
-
P.toPrecision = function(sd, rm) {
|
|
56932
|
-
if (sd != null) intCheck(sd, 1, MAX);
|
|
56933
|
-
return format(this, sd, rm, 2);
|
|
56934
|
-
};
|
|
56935
|
-
P.toString = function(b) {
|
|
56936
|
-
var str, n = this, s = n.s, e = n.e;
|
|
56937
|
-
if (e === null) {
|
|
56938
|
-
if (s) {
|
|
56939
|
-
str = "Infinity";
|
|
56940
|
-
if (s < 0) str = "-" + str;
|
|
56941
|
-
} else {
|
|
56942
|
-
str = "NaN";
|
|
56943
|
-
}
|
|
56944
|
-
} else {
|
|
56945
|
-
if (b == null) {
|
|
56946
|
-
str = e <= TO_EXP_NEG || e >= TO_EXP_POS ? toExponential(coeffToString(n.c), e) : toFixedPoint(coeffToString(n.c), e, "0");
|
|
56947
|
-
} else if (b === 10) {
|
|
56948
|
-
n = round(new BigNumber3(n), DECIMAL_PLACES + e + 1, ROUNDING_MODE);
|
|
55208
|
+
n = round(new BigNumber2(n), DECIMAL_PLACES + e + 1, ROUNDING_MODE);
|
|
56949
55209
|
str = toFixedPoint(coeffToString(n.c), n.e, "0");
|
|
56950
55210
|
} else {
|
|
56951
55211
|
intCheck(b, 2, ALPHABET.length, "Base");
|
|
@@ -56959,8 +55219,8 @@ var require_bignumber2 = __commonJS({
|
|
|
56959
55219
|
return valueOf(this);
|
|
56960
55220
|
};
|
|
56961
55221
|
P._isBigNumber = true;
|
|
56962
|
-
if (configObject != null)
|
|
56963
|
-
return
|
|
55222
|
+
if (configObject != null) BigNumber2.set(configObject);
|
|
55223
|
+
return BigNumber2;
|
|
56964
55224
|
}
|
|
56965
55225
|
function bitFloor(n) {
|
|
56966
55226
|
var i = n | 0;
|
|
@@ -57020,24 +55280,433 @@ var require_bignumber2 = __commonJS({
|
|
|
57020
55280
|
}
|
|
57021
55281
|
return str;
|
|
57022
55282
|
}
|
|
57023
|
-
|
|
57024
|
-
|
|
55283
|
+
BigNumber = clone2();
|
|
55284
|
+
BigNumber["default"] = BigNumber.BigNumber = BigNumber;
|
|
57025
55285
|
if (typeof define == "function" && define.amd) {
|
|
57026
55286
|
define(function() {
|
|
57027
|
-
return
|
|
55287
|
+
return BigNumber;
|
|
57028
55288
|
});
|
|
57029
55289
|
} else if (typeof module2 != "undefined" && module2.exports) {
|
|
57030
|
-
module2.exports =
|
|
55290
|
+
module2.exports = BigNumber;
|
|
57031
55291
|
} else {
|
|
57032
55292
|
if (!globalObject) {
|
|
57033
55293
|
globalObject = typeof self != "undefined" && self ? self : window;
|
|
57034
55294
|
}
|
|
57035
|
-
globalObject.BigNumber =
|
|
55295
|
+
globalObject.BigNumber = BigNumber;
|
|
57036
55296
|
}
|
|
57037
55297
|
})(exports2);
|
|
57038
55298
|
}
|
|
57039
55299
|
});
|
|
57040
55300
|
|
|
55301
|
+
// node_modules/json-bigint/lib/stringify.js
|
|
55302
|
+
var require_stringify = __commonJS({
|
|
55303
|
+
"node_modules/json-bigint/lib/stringify.js"(exports2, module2) {
|
|
55304
|
+
var BigNumber = require_bignumber();
|
|
55305
|
+
var JSON2 = module2.exports;
|
|
55306
|
+
(function() {
|
|
55307
|
+
"use strict";
|
|
55308
|
+
function f(n) {
|
|
55309
|
+
return n < 10 ? "0" + n : n;
|
|
55310
|
+
}
|
|
55311
|
+
var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, gap, indent, meta3 = {
|
|
55312
|
+
// table of character substitutions
|
|
55313
|
+
"\b": "\\b",
|
|
55314
|
+
" ": "\\t",
|
|
55315
|
+
"\n": "\\n",
|
|
55316
|
+
"\f": "\\f",
|
|
55317
|
+
"\r": "\\r",
|
|
55318
|
+
'"': '\\"',
|
|
55319
|
+
"\\": "\\\\"
|
|
55320
|
+
}, rep;
|
|
55321
|
+
function quote(string4) {
|
|
55322
|
+
escapable.lastIndex = 0;
|
|
55323
|
+
return escapable.test(string4) ? '"' + string4.replace(escapable, function(a) {
|
|
55324
|
+
var c = meta3[a];
|
|
55325
|
+
return typeof c === "string" ? c : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4);
|
|
55326
|
+
}) + '"' : '"' + string4 + '"';
|
|
55327
|
+
}
|
|
55328
|
+
function str(key, holder) {
|
|
55329
|
+
var i, k, v, length, mind = gap, partial2, value = holder[key], isBigNumber3 = value != null && (value instanceof BigNumber || BigNumber.isBigNumber(value));
|
|
55330
|
+
if (value && typeof value === "object" && typeof value.toJSON === "function") {
|
|
55331
|
+
value = value.toJSON(key);
|
|
55332
|
+
}
|
|
55333
|
+
if (typeof rep === "function") {
|
|
55334
|
+
value = rep.call(holder, key, value);
|
|
55335
|
+
}
|
|
55336
|
+
switch (typeof value) {
|
|
55337
|
+
case "string":
|
|
55338
|
+
if (isBigNumber3) {
|
|
55339
|
+
return value;
|
|
55340
|
+
} else {
|
|
55341
|
+
return quote(value);
|
|
55342
|
+
}
|
|
55343
|
+
case "number":
|
|
55344
|
+
return isFinite(value) ? String(value) : "null";
|
|
55345
|
+
case "boolean":
|
|
55346
|
+
case "null":
|
|
55347
|
+
case "bigint":
|
|
55348
|
+
return String(value);
|
|
55349
|
+
// If the type is 'object', we might be dealing with an object or an array or
|
|
55350
|
+
// null.
|
|
55351
|
+
case "object":
|
|
55352
|
+
if (!value) {
|
|
55353
|
+
return "null";
|
|
55354
|
+
}
|
|
55355
|
+
gap += indent;
|
|
55356
|
+
partial2 = [];
|
|
55357
|
+
if (Object.prototype.toString.apply(value) === "[object Array]") {
|
|
55358
|
+
length = value.length;
|
|
55359
|
+
for (i = 0; i < length; i += 1) {
|
|
55360
|
+
partial2[i] = str(i, value) || "null";
|
|
55361
|
+
}
|
|
55362
|
+
v = partial2.length === 0 ? "[]" : gap ? "[\n" + gap + partial2.join(",\n" + gap) + "\n" + mind + "]" : "[" + partial2.join(",") + "]";
|
|
55363
|
+
gap = mind;
|
|
55364
|
+
return v;
|
|
55365
|
+
}
|
|
55366
|
+
if (rep && typeof rep === "object") {
|
|
55367
|
+
length = rep.length;
|
|
55368
|
+
for (i = 0; i < length; i += 1) {
|
|
55369
|
+
if (typeof rep[i] === "string") {
|
|
55370
|
+
k = rep[i];
|
|
55371
|
+
v = str(k, value);
|
|
55372
|
+
if (v) {
|
|
55373
|
+
partial2.push(quote(k) + (gap ? ": " : ":") + v);
|
|
55374
|
+
}
|
|
55375
|
+
}
|
|
55376
|
+
}
|
|
55377
|
+
} else {
|
|
55378
|
+
Object.keys(value).forEach(function(k2) {
|
|
55379
|
+
var v2 = str(k2, value);
|
|
55380
|
+
if (v2) {
|
|
55381
|
+
partial2.push(quote(k2) + (gap ? ": " : ":") + v2);
|
|
55382
|
+
}
|
|
55383
|
+
});
|
|
55384
|
+
}
|
|
55385
|
+
v = partial2.length === 0 ? "{}" : gap ? "{\n" + gap + partial2.join(",\n" + gap) + "\n" + mind + "}" : "{" + partial2.join(",") + "}";
|
|
55386
|
+
gap = mind;
|
|
55387
|
+
return v;
|
|
55388
|
+
}
|
|
55389
|
+
}
|
|
55390
|
+
if (typeof JSON2.stringify !== "function") {
|
|
55391
|
+
JSON2.stringify = function(value, replacer, space) {
|
|
55392
|
+
var i;
|
|
55393
|
+
gap = "";
|
|
55394
|
+
indent = "";
|
|
55395
|
+
if (typeof space === "number") {
|
|
55396
|
+
for (i = 0; i < space; i += 1) {
|
|
55397
|
+
indent += " ";
|
|
55398
|
+
}
|
|
55399
|
+
} else if (typeof space === "string") {
|
|
55400
|
+
indent = space;
|
|
55401
|
+
}
|
|
55402
|
+
rep = replacer;
|
|
55403
|
+
if (replacer && typeof replacer !== "function" && (typeof replacer !== "object" || typeof replacer.length !== "number")) {
|
|
55404
|
+
throw new Error("JSON.stringify");
|
|
55405
|
+
}
|
|
55406
|
+
return str("", { "": value });
|
|
55407
|
+
};
|
|
55408
|
+
}
|
|
55409
|
+
})();
|
|
55410
|
+
}
|
|
55411
|
+
});
|
|
55412
|
+
|
|
55413
|
+
// node_modules/json-bigint/lib/parse.js
|
|
55414
|
+
var require_parse2 = __commonJS({
|
|
55415
|
+
"node_modules/json-bigint/lib/parse.js"(exports2, module2) {
|
|
55416
|
+
var BigNumber = null;
|
|
55417
|
+
var suspectProtoRx = /(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/;
|
|
55418
|
+
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)/;
|
|
55419
|
+
var json_parse = function(options) {
|
|
55420
|
+
"use strict";
|
|
55421
|
+
var _options = {
|
|
55422
|
+
strict: false,
|
|
55423
|
+
// not being strict means do not generate syntax errors for "duplicate key"
|
|
55424
|
+
storeAsString: false,
|
|
55425
|
+
// toggles whether the values should be stored as BigNumber (default) or a string
|
|
55426
|
+
alwaysParseAsBig: false,
|
|
55427
|
+
// toggles whether all numbers should be Big
|
|
55428
|
+
useNativeBigInt: false,
|
|
55429
|
+
// toggles whether to use native BigInt instead of bignumber.js
|
|
55430
|
+
protoAction: "error",
|
|
55431
|
+
constructorAction: "error"
|
|
55432
|
+
};
|
|
55433
|
+
if (options !== void 0 && options !== null) {
|
|
55434
|
+
if (options.strict === true) {
|
|
55435
|
+
_options.strict = true;
|
|
55436
|
+
}
|
|
55437
|
+
if (options.storeAsString === true) {
|
|
55438
|
+
_options.storeAsString = true;
|
|
55439
|
+
}
|
|
55440
|
+
_options.alwaysParseAsBig = options.alwaysParseAsBig === true ? options.alwaysParseAsBig : false;
|
|
55441
|
+
_options.useNativeBigInt = options.useNativeBigInt === true ? options.useNativeBigInt : false;
|
|
55442
|
+
if (typeof options.constructorAction !== "undefined") {
|
|
55443
|
+
if (options.constructorAction === "error" || options.constructorAction === "ignore" || options.constructorAction === "preserve") {
|
|
55444
|
+
_options.constructorAction = options.constructorAction;
|
|
55445
|
+
} else {
|
|
55446
|
+
throw new Error(
|
|
55447
|
+
`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${options.constructorAction}`
|
|
55448
|
+
);
|
|
55449
|
+
}
|
|
55450
|
+
}
|
|
55451
|
+
if (typeof options.protoAction !== "undefined") {
|
|
55452
|
+
if (options.protoAction === "error" || options.protoAction === "ignore" || options.protoAction === "preserve") {
|
|
55453
|
+
_options.protoAction = options.protoAction;
|
|
55454
|
+
} else {
|
|
55455
|
+
throw new Error(
|
|
55456
|
+
`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${options.protoAction}`
|
|
55457
|
+
);
|
|
55458
|
+
}
|
|
55459
|
+
}
|
|
55460
|
+
}
|
|
55461
|
+
var at, ch, escapee = {
|
|
55462
|
+
'"': '"',
|
|
55463
|
+
"\\": "\\",
|
|
55464
|
+
"/": "/",
|
|
55465
|
+
b: "\b",
|
|
55466
|
+
f: "\f",
|
|
55467
|
+
n: "\n",
|
|
55468
|
+
r: "\r",
|
|
55469
|
+
t: " "
|
|
55470
|
+
}, text, error49 = function(m) {
|
|
55471
|
+
throw {
|
|
55472
|
+
name: "SyntaxError",
|
|
55473
|
+
message: m,
|
|
55474
|
+
at,
|
|
55475
|
+
text
|
|
55476
|
+
};
|
|
55477
|
+
}, next = function(c) {
|
|
55478
|
+
if (c && c !== ch) {
|
|
55479
|
+
error49("Expected '" + c + "' instead of '" + ch + "'");
|
|
55480
|
+
}
|
|
55481
|
+
ch = text.charAt(at);
|
|
55482
|
+
at += 1;
|
|
55483
|
+
return ch;
|
|
55484
|
+
}, number4 = function() {
|
|
55485
|
+
var number5, string5 = "";
|
|
55486
|
+
if (ch === "-") {
|
|
55487
|
+
string5 = "-";
|
|
55488
|
+
next("-");
|
|
55489
|
+
}
|
|
55490
|
+
while (ch >= "0" && ch <= "9") {
|
|
55491
|
+
string5 += ch;
|
|
55492
|
+
next();
|
|
55493
|
+
}
|
|
55494
|
+
if (ch === ".") {
|
|
55495
|
+
string5 += ".";
|
|
55496
|
+
while (next() && ch >= "0" && ch <= "9") {
|
|
55497
|
+
string5 += ch;
|
|
55498
|
+
}
|
|
55499
|
+
}
|
|
55500
|
+
if (ch === "e" || ch === "E") {
|
|
55501
|
+
string5 += ch;
|
|
55502
|
+
next();
|
|
55503
|
+
if (ch === "-" || ch === "+") {
|
|
55504
|
+
string5 += ch;
|
|
55505
|
+
next();
|
|
55506
|
+
}
|
|
55507
|
+
while (ch >= "0" && ch <= "9") {
|
|
55508
|
+
string5 += ch;
|
|
55509
|
+
next();
|
|
55510
|
+
}
|
|
55511
|
+
}
|
|
55512
|
+
number5 = +string5;
|
|
55513
|
+
if (!isFinite(number5)) {
|
|
55514
|
+
error49("Bad number");
|
|
55515
|
+
} else {
|
|
55516
|
+
if (BigNumber == null) BigNumber = require_bignumber();
|
|
55517
|
+
if (string5.length > 15)
|
|
55518
|
+
return _options.storeAsString ? string5 : _options.useNativeBigInt ? BigInt(string5) : new BigNumber(string5);
|
|
55519
|
+
else
|
|
55520
|
+
return !_options.alwaysParseAsBig ? number5 : _options.useNativeBigInt ? BigInt(number5) : new BigNumber(number5);
|
|
55521
|
+
}
|
|
55522
|
+
}, string4 = function() {
|
|
55523
|
+
var hex3, i, string5 = "", uffff;
|
|
55524
|
+
if (ch === '"') {
|
|
55525
|
+
var startAt = at;
|
|
55526
|
+
while (next()) {
|
|
55527
|
+
if (ch === '"') {
|
|
55528
|
+
if (at - 1 > startAt) string5 += text.substring(startAt, at - 1);
|
|
55529
|
+
next();
|
|
55530
|
+
return string5;
|
|
55531
|
+
}
|
|
55532
|
+
if (ch === "\\") {
|
|
55533
|
+
if (at - 1 > startAt) string5 += text.substring(startAt, at - 1);
|
|
55534
|
+
next();
|
|
55535
|
+
if (ch === "u") {
|
|
55536
|
+
uffff = 0;
|
|
55537
|
+
for (i = 0; i < 4; i += 1) {
|
|
55538
|
+
hex3 = parseInt(next(), 16);
|
|
55539
|
+
if (!isFinite(hex3)) {
|
|
55540
|
+
break;
|
|
55541
|
+
}
|
|
55542
|
+
uffff = uffff * 16 + hex3;
|
|
55543
|
+
}
|
|
55544
|
+
string5 += String.fromCharCode(uffff);
|
|
55545
|
+
} else if (typeof escapee[ch] === "string") {
|
|
55546
|
+
string5 += escapee[ch];
|
|
55547
|
+
} else {
|
|
55548
|
+
break;
|
|
55549
|
+
}
|
|
55550
|
+
startAt = at;
|
|
55551
|
+
}
|
|
55552
|
+
}
|
|
55553
|
+
}
|
|
55554
|
+
error49("Bad string");
|
|
55555
|
+
}, white = function() {
|
|
55556
|
+
while (ch && ch <= " ") {
|
|
55557
|
+
next();
|
|
55558
|
+
}
|
|
55559
|
+
}, word = function() {
|
|
55560
|
+
switch (ch) {
|
|
55561
|
+
case "t":
|
|
55562
|
+
next("t");
|
|
55563
|
+
next("r");
|
|
55564
|
+
next("u");
|
|
55565
|
+
next("e");
|
|
55566
|
+
return true;
|
|
55567
|
+
case "f":
|
|
55568
|
+
next("f");
|
|
55569
|
+
next("a");
|
|
55570
|
+
next("l");
|
|
55571
|
+
next("s");
|
|
55572
|
+
next("e");
|
|
55573
|
+
return false;
|
|
55574
|
+
case "n":
|
|
55575
|
+
next("n");
|
|
55576
|
+
next("u");
|
|
55577
|
+
next("l");
|
|
55578
|
+
next("l");
|
|
55579
|
+
return null;
|
|
55580
|
+
}
|
|
55581
|
+
error49("Unexpected '" + ch + "'");
|
|
55582
|
+
}, value, array2 = function() {
|
|
55583
|
+
var array3 = [];
|
|
55584
|
+
if (ch === "[") {
|
|
55585
|
+
next("[");
|
|
55586
|
+
white();
|
|
55587
|
+
if (ch === "]") {
|
|
55588
|
+
next("]");
|
|
55589
|
+
return array3;
|
|
55590
|
+
}
|
|
55591
|
+
while (ch) {
|
|
55592
|
+
array3.push(value());
|
|
55593
|
+
white();
|
|
55594
|
+
if (ch === "]") {
|
|
55595
|
+
next("]");
|
|
55596
|
+
return array3;
|
|
55597
|
+
}
|
|
55598
|
+
next(",");
|
|
55599
|
+
white();
|
|
55600
|
+
}
|
|
55601
|
+
}
|
|
55602
|
+
error49("Bad array");
|
|
55603
|
+
}, object2 = function() {
|
|
55604
|
+
var key, object3 = /* @__PURE__ */ Object.create(null);
|
|
55605
|
+
if (ch === "{") {
|
|
55606
|
+
next("{");
|
|
55607
|
+
white();
|
|
55608
|
+
if (ch === "}") {
|
|
55609
|
+
next("}");
|
|
55610
|
+
return object3;
|
|
55611
|
+
}
|
|
55612
|
+
while (ch) {
|
|
55613
|
+
key = string4();
|
|
55614
|
+
white();
|
|
55615
|
+
next(":");
|
|
55616
|
+
if (_options.strict === true && Object.hasOwnProperty.call(object3, key)) {
|
|
55617
|
+
error49('Duplicate key "' + key + '"');
|
|
55618
|
+
}
|
|
55619
|
+
if (suspectProtoRx.test(key) === true) {
|
|
55620
|
+
if (_options.protoAction === "error") {
|
|
55621
|
+
error49("Object contains forbidden prototype property");
|
|
55622
|
+
} else if (_options.protoAction === "ignore") {
|
|
55623
|
+
value();
|
|
55624
|
+
} else {
|
|
55625
|
+
object3[key] = value();
|
|
55626
|
+
}
|
|
55627
|
+
} else if (suspectConstructorRx.test(key) === true) {
|
|
55628
|
+
if (_options.constructorAction === "error") {
|
|
55629
|
+
error49("Object contains forbidden constructor property");
|
|
55630
|
+
} else if (_options.constructorAction === "ignore") {
|
|
55631
|
+
value();
|
|
55632
|
+
} else {
|
|
55633
|
+
object3[key] = value();
|
|
55634
|
+
}
|
|
55635
|
+
} else {
|
|
55636
|
+
object3[key] = value();
|
|
55637
|
+
}
|
|
55638
|
+
white();
|
|
55639
|
+
if (ch === "}") {
|
|
55640
|
+
next("}");
|
|
55641
|
+
return object3;
|
|
55642
|
+
}
|
|
55643
|
+
next(",");
|
|
55644
|
+
white();
|
|
55645
|
+
}
|
|
55646
|
+
}
|
|
55647
|
+
error49("Bad object");
|
|
55648
|
+
};
|
|
55649
|
+
value = function() {
|
|
55650
|
+
white();
|
|
55651
|
+
switch (ch) {
|
|
55652
|
+
case "{":
|
|
55653
|
+
return object2();
|
|
55654
|
+
case "[":
|
|
55655
|
+
return array2();
|
|
55656
|
+
case '"':
|
|
55657
|
+
return string4();
|
|
55658
|
+
case "-":
|
|
55659
|
+
return number4();
|
|
55660
|
+
default:
|
|
55661
|
+
return ch >= "0" && ch <= "9" ? number4() : word();
|
|
55662
|
+
}
|
|
55663
|
+
};
|
|
55664
|
+
return function(source, reviver3) {
|
|
55665
|
+
var result;
|
|
55666
|
+
text = source + "";
|
|
55667
|
+
at = 0;
|
|
55668
|
+
ch = " ";
|
|
55669
|
+
result = value();
|
|
55670
|
+
white();
|
|
55671
|
+
if (ch) {
|
|
55672
|
+
error49("Syntax error");
|
|
55673
|
+
}
|
|
55674
|
+
return typeof reviver3 === "function" ? (function walk(holder, key) {
|
|
55675
|
+
var k, v, value2 = holder[key];
|
|
55676
|
+
if (value2 && typeof value2 === "object") {
|
|
55677
|
+
Object.keys(value2).forEach(function(k2) {
|
|
55678
|
+
v = walk(value2, k2);
|
|
55679
|
+
if (v !== void 0) {
|
|
55680
|
+
value2[k2] = v;
|
|
55681
|
+
} else {
|
|
55682
|
+
delete value2[k2];
|
|
55683
|
+
}
|
|
55684
|
+
});
|
|
55685
|
+
}
|
|
55686
|
+
return reviver3.call(holder, key, value2);
|
|
55687
|
+
})({ "": result }, "") : result;
|
|
55688
|
+
};
|
|
55689
|
+
};
|
|
55690
|
+
module2.exports = json_parse;
|
|
55691
|
+
}
|
|
55692
|
+
});
|
|
55693
|
+
|
|
55694
|
+
// node_modules/json-bigint/index.js
|
|
55695
|
+
var require_json_bigint = __commonJS({
|
|
55696
|
+
"node_modules/json-bigint/index.js"(exports2, module2) {
|
|
55697
|
+
var json_stringify = require_stringify().stringify;
|
|
55698
|
+
var json_parse = require_parse2();
|
|
55699
|
+
module2.exports = function(options) {
|
|
55700
|
+
return {
|
|
55701
|
+
parse: json_parse(options),
|
|
55702
|
+
stringify: json_stringify
|
|
55703
|
+
};
|
|
55704
|
+
};
|
|
55705
|
+
module2.exports.parse = json_parse();
|
|
55706
|
+
module2.exports.stringify = json_stringify;
|
|
55707
|
+
}
|
|
55708
|
+
});
|
|
55709
|
+
|
|
57041
55710
|
// node_modules/lodash/lodash.js
|
|
57042
55711
|
var require_lodash = __commonJS({
|
|
57043
55712
|
"node_modules/lodash/lodash.js"(exports2, module2) {
|
|
@@ -64756,14 +63425,14 @@ var require_base2 = __commonJS({
|
|
|
64756
63425
|
return { isValid: err };
|
|
64757
63426
|
});
|
|
64758
63427
|
}).share();
|
|
64759
|
-
var
|
|
63428
|
+
var success20 = validation.filter(function(state) {
|
|
64760
63429
|
return state.isValid === true;
|
|
64761
63430
|
}).take(1);
|
|
64762
63431
|
var error49 = validation.filter(function(state) {
|
|
64763
63432
|
return state.isValid !== true;
|
|
64764
|
-
}).takeUntil(
|
|
63433
|
+
}).takeUntil(success20);
|
|
64765
63434
|
return {
|
|
64766
|
-
success:
|
|
63435
|
+
success: success20,
|
|
64767
63436
|
error: error49
|
|
64768
63437
|
};
|
|
64769
63438
|
};
|
|
@@ -93392,10 +92061,23 @@ var package_default = {
|
|
|
93392
92061
|
type: "module",
|
|
93393
92062
|
homepage: "https://appwrite.io/support",
|
|
93394
92063
|
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",
|
|
93395
|
-
version: "13.
|
|
92064
|
+
version: "13.6.0",
|
|
93396
92065
|
license: "BSD-3-Clause",
|
|
93397
|
-
main: "dist/index.
|
|
92066
|
+
main: "dist/index.cjs",
|
|
92067
|
+
module: "dist/index.js",
|
|
93398
92068
|
types: "dist/index.d.ts",
|
|
92069
|
+
exports: {
|
|
92070
|
+
".": {
|
|
92071
|
+
import: {
|
|
92072
|
+
types: "./dist/index.d.ts",
|
|
92073
|
+
default: "./dist/index.js"
|
|
92074
|
+
},
|
|
92075
|
+
require: {
|
|
92076
|
+
types: "./dist/index.d.ts",
|
|
92077
|
+
default: "./dist/index.cjs"
|
|
92078
|
+
}
|
|
92079
|
+
}
|
|
92080
|
+
},
|
|
93399
92081
|
bin: {
|
|
93400
92082
|
appwrite: "dist/cli.cjs"
|
|
93401
92083
|
},
|
|
@@ -93406,8 +92088,9 @@ var package_default = {
|
|
|
93406
92088
|
scripts: {
|
|
93407
92089
|
build: "npm run build:types && npm run build:runtime",
|
|
93408
92090
|
"build:types": "tsc -p tsconfig.json --emitDeclarationOnly",
|
|
93409
|
-
"build:runtime": "npm run build:lib:
|
|
93410
|
-
"build:lib:
|
|
92091
|
+
"build:runtime": "npm run build:lib:esm && npm run build:lib:cjs && npm run build:cli",
|
|
92092
|
+
"build:lib:esm": "esbuild index.ts --bundle --platform=node --target=node18 --format=esm --loader:.hbs=text --outfile=dist/index.js",
|
|
92093
|
+
"build:lib:cjs": "esbuild index.ts --bundle --platform=node --target=node18 --format=cjs --loader:.hbs=text --outfile=dist/index.cjs",
|
|
93411
92094
|
"build:cli": "esbuild cli.ts --bundle --platform=node --target=node18 --format=cjs --loader:.hbs=text --external:fsevents --outfile=dist/cli.cjs",
|
|
93412
92095
|
format: 'prettier --write "**/*.{js,ts,json,md}"',
|
|
93413
92096
|
generate: "tsx scripts/generate-commands.ts",
|
|
@@ -93421,7 +92104,7 @@ var package_default = {
|
|
|
93421
92104
|
"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"
|
|
93422
92105
|
},
|
|
93423
92106
|
dependencies: {
|
|
93424
|
-
"@appwrite.io/console": "^
|
|
92107
|
+
"@appwrite.io/console": "^3.1.0",
|
|
93425
92108
|
chalk: "4.1.2",
|
|
93426
92109
|
chokidar: "^3.6.0",
|
|
93427
92110
|
"cli-progress": "^3.12.0",
|
|
@@ -107655,7 +106338,7 @@ var import_undici = __toESM(require_undici(), 1);
|
|
|
107655
106338
|
// lib/constants.ts
|
|
107656
106339
|
var SDK_TITLE = "Appwrite";
|
|
107657
106340
|
var SDK_TITLE_LOWER = "appwrite";
|
|
107658
|
-
var SDK_VERSION = "13.
|
|
106341
|
+
var SDK_VERSION = "13.6.0";
|
|
107659
106342
|
var SDK_NAME = "Command Line";
|
|
107660
106343
|
var SDK_PLATFORM = "console";
|
|
107661
106344
|
var SDK_LANGUAGE = "cli";
|
|
@@ -107793,6 +106476,14 @@ function isCloud() {
|
|
|
107793
106476
|
const hostname3 = new URL(endpoint).hostname;
|
|
107794
106477
|
return hostname3.endsWith("appwrite.io");
|
|
107795
106478
|
}
|
|
106479
|
+
function arrayEqualsUnordered(left, right) {
|
|
106480
|
+
const a = Array.isArray(left) ? [...left].map((item) => String(item)).sort() : [];
|
|
106481
|
+
const b = Array.isArray(right) ? [...right].map((item) => String(item)).sort() : [];
|
|
106482
|
+
if (a.length !== b.length) {
|
|
106483
|
+
return false;
|
|
106484
|
+
}
|
|
106485
|
+
return a.every((value, index) => value === b[index]);
|
|
106486
|
+
}
|
|
107796
106487
|
function filterBySchema(data, schema) {
|
|
107797
106488
|
const allowedKeys = Object.keys(schema.shape);
|
|
107798
106489
|
const result = {};
|
|
@@ -107810,6 +106501,8 @@ var JSONbigParser = (0, import_json_bigint.default)({ storeAsString: false });
|
|
|
107810
106501
|
var JSONbigSerializer = (0, import_json_bigint.default)({ useNativeBigInt: true });
|
|
107811
106502
|
var MAX_SAFE = BigInt(Number.MAX_SAFE_INTEGER);
|
|
107812
106503
|
var MIN_SAFE = BigInt(Number.MIN_SAFE_INTEGER);
|
|
106504
|
+
var MAX_INT64 = BigInt("9223372036854775807");
|
|
106505
|
+
var MIN_INT64 = BigInt("-9223372036854775808");
|
|
107813
106506
|
function isBigNumber(value) {
|
|
107814
106507
|
return value !== null && typeof value === "object" && value._isBigNumber === true && typeof value.isInteger === "function" && typeof value.toFixed === "function" && typeof value.toNumber === "function";
|
|
107815
106508
|
}
|
|
@@ -107821,7 +106514,10 @@ function reviver(_key, value) {
|
|
|
107821
106514
|
if (bi >= MIN_SAFE && bi <= MAX_SAFE) {
|
|
107822
106515
|
return Number(str);
|
|
107823
106516
|
}
|
|
107824
|
-
|
|
106517
|
+
if (bi >= MIN_INT64 && bi <= MAX_INT64) {
|
|
106518
|
+
return bi;
|
|
106519
|
+
}
|
|
106520
|
+
return value.toNumber();
|
|
107825
106521
|
}
|
|
107826
106522
|
return value.toNumber();
|
|
107827
106523
|
}
|
|
@@ -108491,7 +107187,6 @@ var import_os2 = __toESM(require("os"), 1);
|
|
|
108491
107187
|
|
|
108492
107188
|
// node_modules/@appwrite.io/console/dist/esm/sdk.js
|
|
108493
107189
|
var import_json_bigint2 = __toESM(require_json_bigint(), 1);
|
|
108494
|
-
var import_bignumber = __toESM(require_bignumber2(), 1);
|
|
108495
107190
|
function __awaiter(thisArg, _arguments, P, generator) {
|
|
108496
107191
|
function adopt(value) {
|
|
108497
107192
|
return value instanceof P ? value : new P(function(resolve3) {
|
|
@@ -108581,6 +107276,8 @@ Query.cursorBefore = (documentId) => new Query("cursorBefore", void 0, documentI
|
|
|
108581
107276
|
Query.limit = (limit) => new Query("limit", void 0, limit).toString();
|
|
108582
107277
|
Query.offset = (offset) => new Query("offset", void 0, offset).toString();
|
|
108583
107278
|
Query.contains = (attribute, value) => new Query("contains", attribute, value).toString();
|
|
107279
|
+
Query.containsAny = (attribute, value) => new Query("containsAny", attribute, value).toString();
|
|
107280
|
+
Query.containsAll = (attribute, value) => new Query("containsAll", attribute, value).toString();
|
|
108584
107281
|
Query.notContains = (attribute, value) => new Query("notContains", attribute, value).toString();
|
|
108585
107282
|
Query.notSearch = (attribute, value) => new Query("notSearch", attribute, value).toString();
|
|
108586
107283
|
Query.notBetween = (attribute, start, end) => new Query("notBetween", attribute, [start, end]).toString();
|
|
@@ -108611,15 +107308,23 @@ var JSONbigParser2 = (0, import_json_bigint2.default)({ storeAsString: false });
|
|
|
108611
107308
|
var JSONbigSerializer2 = (0, import_json_bigint2.default)({ useNativeBigInt: true });
|
|
108612
107309
|
var MAX_SAFE2 = BigInt(Number.MAX_SAFE_INTEGER);
|
|
108613
107310
|
var MIN_SAFE2 = BigInt(Number.MIN_SAFE_INTEGER);
|
|
107311
|
+
var MAX_INT642 = BigInt("9223372036854775807");
|
|
107312
|
+
var MIN_INT642 = BigInt("-9223372036854775808");
|
|
107313
|
+
function isBigNumber2(value) {
|
|
107314
|
+
return value !== null && typeof value === "object" && value._isBigNumber === true && typeof value.isInteger === "function" && typeof value.toFixed === "function" && typeof value.toNumber === "function";
|
|
107315
|
+
}
|
|
108614
107316
|
function reviver2(_key, value) {
|
|
108615
|
-
if (
|
|
107317
|
+
if (isBigNumber2(value)) {
|
|
108616
107318
|
if (value.isInteger()) {
|
|
108617
107319
|
const str = value.toFixed();
|
|
108618
107320
|
const bi = BigInt(str);
|
|
108619
107321
|
if (bi >= MIN_SAFE2 && bi <= MAX_SAFE2) {
|
|
108620
107322
|
return Number(str);
|
|
108621
107323
|
}
|
|
108622
|
-
|
|
107324
|
+
if (bi >= MIN_INT642 && bi <= MAX_INT642) {
|
|
107325
|
+
return bi;
|
|
107326
|
+
}
|
|
107327
|
+
return value.toNumber();
|
|
108623
107328
|
}
|
|
108624
107329
|
return value.toNumber();
|
|
108625
107330
|
}
|
|
@@ -108666,7 +107371,7 @@ var Client = class _Client {
|
|
|
108666
107371
|
"x-sdk-name": "Console",
|
|
108667
107372
|
"x-sdk-platform": "console",
|
|
108668
107373
|
"x-sdk-language": "web",
|
|
108669
|
-
"x-sdk-version": "
|
|
107374
|
+
"x-sdk-version": "3.1.0",
|
|
108670
107375
|
"X-Appwrite-Response-Format": "1.8.0"
|
|
108671
107376
|
};
|
|
108672
107377
|
this.realtime = {
|
|
@@ -110662,7 +109367,7 @@ var Account = class {
|
|
|
110662
109367
|
};
|
|
110663
109368
|
}
|
|
110664
109369
|
const provider = params.provider;
|
|
110665
|
-
const
|
|
109370
|
+
const success20 = params.success;
|
|
110666
109371
|
const failure = params.failure;
|
|
110667
109372
|
const scopes = params.scopes;
|
|
110668
109373
|
if (typeof provider === "undefined") {
|
|
@@ -110670,8 +109375,8 @@ var Account = class {
|
|
|
110670
109375
|
}
|
|
110671
109376
|
const apiPath = "/account/sessions/oauth2/{provider}".replace("{provider}", provider);
|
|
110672
109377
|
const payload = {};
|
|
110673
|
-
if (typeof
|
|
110674
|
-
payload["success"] =
|
|
109378
|
+
if (typeof success20 !== "undefined") {
|
|
109379
|
+
payload["success"] = success20;
|
|
110675
109380
|
}
|
|
110676
109381
|
if (typeof failure !== "undefined") {
|
|
110677
109382
|
payload["failure"] = failure;
|
|
@@ -111010,7 +109715,7 @@ var Account = class {
|
|
|
111010
109715
|
};
|
|
111011
109716
|
}
|
|
111012
109717
|
const provider = params.provider;
|
|
111013
|
-
const
|
|
109718
|
+
const success20 = params.success;
|
|
111014
109719
|
const failure = params.failure;
|
|
111015
109720
|
const scopes = params.scopes;
|
|
111016
109721
|
if (typeof provider === "undefined") {
|
|
@@ -111018,8 +109723,8 @@ var Account = class {
|
|
|
111018
109723
|
}
|
|
111019
109724
|
const apiPath = "/account/tokens/oauth2/{provider}".replace("{provider}", provider);
|
|
111020
109725
|
const payload = {};
|
|
111021
|
-
if (typeof
|
|
111022
|
-
payload["success"] =
|
|
109726
|
+
if (typeof success20 !== "undefined") {
|
|
109727
|
+
payload["success"] = success20;
|
|
111023
109728
|
}
|
|
111024
109729
|
if (typeof failure !== "undefined") {
|
|
111025
109730
|
payload["failure"] = failure;
|
|
@@ -111231,6 +109936,385 @@ var Account = class {
|
|
|
111231
109936
|
return this.client.call("put", uri, apiHeaders, payload);
|
|
111232
109937
|
}
|
|
111233
109938
|
};
|
|
109939
|
+
var Activities = class {
|
|
109940
|
+
constructor(client2) {
|
|
109941
|
+
this.client = client2;
|
|
109942
|
+
}
|
|
109943
|
+
listEvents(paramsOrFirst) {
|
|
109944
|
+
let params;
|
|
109945
|
+
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
109946
|
+
params = paramsOrFirst || {};
|
|
109947
|
+
} else {
|
|
109948
|
+
params = {
|
|
109949
|
+
queries: paramsOrFirst
|
|
109950
|
+
};
|
|
109951
|
+
}
|
|
109952
|
+
const queries = params.queries;
|
|
109953
|
+
const apiPath = "/activities/events";
|
|
109954
|
+
const payload = {};
|
|
109955
|
+
if (typeof queries !== "undefined") {
|
|
109956
|
+
payload["queries"] = queries;
|
|
109957
|
+
}
|
|
109958
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
109959
|
+
const apiHeaders = {};
|
|
109960
|
+
return this.client.call("get", uri, apiHeaders, payload);
|
|
109961
|
+
}
|
|
109962
|
+
getEvent(paramsOrFirst) {
|
|
109963
|
+
let params;
|
|
109964
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
109965
|
+
params = paramsOrFirst || {};
|
|
109966
|
+
} else {
|
|
109967
|
+
params = {
|
|
109968
|
+
eventId: paramsOrFirst
|
|
109969
|
+
};
|
|
109970
|
+
}
|
|
109971
|
+
const eventId = params.eventId;
|
|
109972
|
+
if (typeof eventId === "undefined") {
|
|
109973
|
+
throw new AppwriteException('Missing required parameter: "eventId"');
|
|
109974
|
+
}
|
|
109975
|
+
const apiPath = "/activities/events/{eventId}".replace("{eventId}", eventId);
|
|
109976
|
+
const payload = {};
|
|
109977
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
109978
|
+
const apiHeaders = {};
|
|
109979
|
+
return this.client.call("get", uri, apiHeaders, payload);
|
|
109980
|
+
}
|
|
109981
|
+
};
|
|
109982
|
+
var Backups = class {
|
|
109983
|
+
constructor(client2) {
|
|
109984
|
+
this.client = client2;
|
|
109985
|
+
}
|
|
109986
|
+
listArchives(paramsOrFirst) {
|
|
109987
|
+
let params;
|
|
109988
|
+
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
109989
|
+
params = paramsOrFirst || {};
|
|
109990
|
+
} else {
|
|
109991
|
+
params = {
|
|
109992
|
+
queries: paramsOrFirst
|
|
109993
|
+
};
|
|
109994
|
+
}
|
|
109995
|
+
const queries = params.queries;
|
|
109996
|
+
const apiPath = "/backups/archives";
|
|
109997
|
+
const payload = {};
|
|
109998
|
+
if (typeof queries !== "undefined") {
|
|
109999
|
+
payload["queries"] = queries;
|
|
110000
|
+
}
|
|
110001
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
110002
|
+
const apiHeaders = {};
|
|
110003
|
+
return this.client.call("get", uri, apiHeaders, payload);
|
|
110004
|
+
}
|
|
110005
|
+
createArchive(paramsOrFirst, ...rest) {
|
|
110006
|
+
let params;
|
|
110007
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && ("services" in paramsOrFirst || "resourceId" in paramsOrFirst)) {
|
|
110008
|
+
params = paramsOrFirst || {};
|
|
110009
|
+
} else {
|
|
110010
|
+
params = {
|
|
110011
|
+
services: paramsOrFirst,
|
|
110012
|
+
resourceId: rest[0]
|
|
110013
|
+
};
|
|
110014
|
+
}
|
|
110015
|
+
const services = params.services;
|
|
110016
|
+
const resourceId = params.resourceId;
|
|
110017
|
+
if (typeof services === "undefined") {
|
|
110018
|
+
throw new AppwriteException('Missing required parameter: "services"');
|
|
110019
|
+
}
|
|
110020
|
+
const apiPath = "/backups/archives";
|
|
110021
|
+
const payload = {};
|
|
110022
|
+
if (typeof services !== "undefined") {
|
|
110023
|
+
payload["services"] = services;
|
|
110024
|
+
}
|
|
110025
|
+
if (typeof resourceId !== "undefined") {
|
|
110026
|
+
payload["resourceId"] = resourceId;
|
|
110027
|
+
}
|
|
110028
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
110029
|
+
const apiHeaders = {
|
|
110030
|
+
"content-type": "application/json"
|
|
110031
|
+
};
|
|
110032
|
+
return this.client.call("post", uri, apiHeaders, payload);
|
|
110033
|
+
}
|
|
110034
|
+
getArchive(paramsOrFirst) {
|
|
110035
|
+
let params;
|
|
110036
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
110037
|
+
params = paramsOrFirst || {};
|
|
110038
|
+
} else {
|
|
110039
|
+
params = {
|
|
110040
|
+
archiveId: paramsOrFirst
|
|
110041
|
+
};
|
|
110042
|
+
}
|
|
110043
|
+
const archiveId = params.archiveId;
|
|
110044
|
+
if (typeof archiveId === "undefined") {
|
|
110045
|
+
throw new AppwriteException('Missing required parameter: "archiveId"');
|
|
110046
|
+
}
|
|
110047
|
+
const apiPath = "/backups/archives/{archiveId}".replace("{archiveId}", archiveId);
|
|
110048
|
+
const payload = {};
|
|
110049
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
110050
|
+
const apiHeaders = {};
|
|
110051
|
+
return this.client.call("get", uri, apiHeaders, payload);
|
|
110052
|
+
}
|
|
110053
|
+
deleteArchive(paramsOrFirst) {
|
|
110054
|
+
let params;
|
|
110055
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
110056
|
+
params = paramsOrFirst || {};
|
|
110057
|
+
} else {
|
|
110058
|
+
params = {
|
|
110059
|
+
archiveId: paramsOrFirst
|
|
110060
|
+
};
|
|
110061
|
+
}
|
|
110062
|
+
const archiveId = params.archiveId;
|
|
110063
|
+
if (typeof archiveId === "undefined") {
|
|
110064
|
+
throw new AppwriteException('Missing required parameter: "archiveId"');
|
|
110065
|
+
}
|
|
110066
|
+
const apiPath = "/backups/archives/{archiveId}".replace("{archiveId}", archiveId);
|
|
110067
|
+
const payload = {};
|
|
110068
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
110069
|
+
const apiHeaders = {
|
|
110070
|
+
"content-type": "application/json"
|
|
110071
|
+
};
|
|
110072
|
+
return this.client.call("delete", uri, apiHeaders, payload);
|
|
110073
|
+
}
|
|
110074
|
+
listPolicies(paramsOrFirst) {
|
|
110075
|
+
let params;
|
|
110076
|
+
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
110077
|
+
params = paramsOrFirst || {};
|
|
110078
|
+
} else {
|
|
110079
|
+
params = {
|
|
110080
|
+
queries: paramsOrFirst
|
|
110081
|
+
};
|
|
110082
|
+
}
|
|
110083
|
+
const queries = params.queries;
|
|
110084
|
+
const apiPath = "/backups/policies";
|
|
110085
|
+
const payload = {};
|
|
110086
|
+
if (typeof queries !== "undefined") {
|
|
110087
|
+
payload["queries"] = queries;
|
|
110088
|
+
}
|
|
110089
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
110090
|
+
const apiHeaders = {};
|
|
110091
|
+
return this.client.call("get", uri, apiHeaders, payload);
|
|
110092
|
+
}
|
|
110093
|
+
createPolicy(paramsOrFirst, ...rest) {
|
|
110094
|
+
let params;
|
|
110095
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
110096
|
+
params = paramsOrFirst || {};
|
|
110097
|
+
} else {
|
|
110098
|
+
params = {
|
|
110099
|
+
policyId: paramsOrFirst,
|
|
110100
|
+
services: rest[0],
|
|
110101
|
+
retention: rest[1],
|
|
110102
|
+
schedule: rest[2],
|
|
110103
|
+
name: rest[3],
|
|
110104
|
+
resourceId: rest[4],
|
|
110105
|
+
enabled: rest[5]
|
|
110106
|
+
};
|
|
110107
|
+
}
|
|
110108
|
+
const policyId = params.policyId;
|
|
110109
|
+
const services = params.services;
|
|
110110
|
+
const retention = params.retention;
|
|
110111
|
+
const schedule = params.schedule;
|
|
110112
|
+
const name = params.name;
|
|
110113
|
+
const resourceId = params.resourceId;
|
|
110114
|
+
const enabled = params.enabled;
|
|
110115
|
+
if (typeof policyId === "undefined") {
|
|
110116
|
+
throw new AppwriteException('Missing required parameter: "policyId"');
|
|
110117
|
+
}
|
|
110118
|
+
if (typeof services === "undefined") {
|
|
110119
|
+
throw new AppwriteException('Missing required parameter: "services"');
|
|
110120
|
+
}
|
|
110121
|
+
if (typeof retention === "undefined") {
|
|
110122
|
+
throw new AppwriteException('Missing required parameter: "retention"');
|
|
110123
|
+
}
|
|
110124
|
+
if (typeof schedule === "undefined") {
|
|
110125
|
+
throw new AppwriteException('Missing required parameter: "schedule"');
|
|
110126
|
+
}
|
|
110127
|
+
const apiPath = "/backups/policies";
|
|
110128
|
+
const payload = {};
|
|
110129
|
+
if (typeof policyId !== "undefined") {
|
|
110130
|
+
payload["policyId"] = policyId;
|
|
110131
|
+
}
|
|
110132
|
+
if (typeof name !== "undefined") {
|
|
110133
|
+
payload["name"] = name;
|
|
110134
|
+
}
|
|
110135
|
+
if (typeof services !== "undefined") {
|
|
110136
|
+
payload["services"] = services;
|
|
110137
|
+
}
|
|
110138
|
+
if (typeof resourceId !== "undefined") {
|
|
110139
|
+
payload["resourceId"] = resourceId;
|
|
110140
|
+
}
|
|
110141
|
+
if (typeof enabled !== "undefined") {
|
|
110142
|
+
payload["enabled"] = enabled;
|
|
110143
|
+
}
|
|
110144
|
+
if (typeof retention !== "undefined") {
|
|
110145
|
+
payload["retention"] = retention;
|
|
110146
|
+
}
|
|
110147
|
+
if (typeof schedule !== "undefined") {
|
|
110148
|
+
payload["schedule"] = schedule;
|
|
110149
|
+
}
|
|
110150
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
110151
|
+
const apiHeaders = {
|
|
110152
|
+
"content-type": "application/json"
|
|
110153
|
+
};
|
|
110154
|
+
return this.client.call("post", uri, apiHeaders, payload);
|
|
110155
|
+
}
|
|
110156
|
+
getPolicy(paramsOrFirst) {
|
|
110157
|
+
let params;
|
|
110158
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
110159
|
+
params = paramsOrFirst || {};
|
|
110160
|
+
} else {
|
|
110161
|
+
params = {
|
|
110162
|
+
policyId: paramsOrFirst
|
|
110163
|
+
};
|
|
110164
|
+
}
|
|
110165
|
+
const policyId = params.policyId;
|
|
110166
|
+
if (typeof policyId === "undefined") {
|
|
110167
|
+
throw new AppwriteException('Missing required parameter: "policyId"');
|
|
110168
|
+
}
|
|
110169
|
+
const apiPath = "/backups/policies/{policyId}".replace("{policyId}", policyId);
|
|
110170
|
+
const payload = {};
|
|
110171
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
110172
|
+
const apiHeaders = {};
|
|
110173
|
+
return this.client.call("get", uri, apiHeaders, payload);
|
|
110174
|
+
}
|
|
110175
|
+
updatePolicy(paramsOrFirst, ...rest) {
|
|
110176
|
+
let params;
|
|
110177
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
110178
|
+
params = paramsOrFirst || {};
|
|
110179
|
+
} else {
|
|
110180
|
+
params = {
|
|
110181
|
+
policyId: paramsOrFirst,
|
|
110182
|
+
name: rest[0],
|
|
110183
|
+
retention: rest[1],
|
|
110184
|
+
schedule: rest[2],
|
|
110185
|
+
enabled: rest[3]
|
|
110186
|
+
};
|
|
110187
|
+
}
|
|
110188
|
+
const policyId = params.policyId;
|
|
110189
|
+
const name = params.name;
|
|
110190
|
+
const retention = params.retention;
|
|
110191
|
+
const schedule = params.schedule;
|
|
110192
|
+
const enabled = params.enabled;
|
|
110193
|
+
if (typeof policyId === "undefined") {
|
|
110194
|
+
throw new AppwriteException('Missing required parameter: "policyId"');
|
|
110195
|
+
}
|
|
110196
|
+
const apiPath = "/backups/policies/{policyId}".replace("{policyId}", policyId);
|
|
110197
|
+
const payload = {};
|
|
110198
|
+
if (typeof name !== "undefined") {
|
|
110199
|
+
payload["name"] = name;
|
|
110200
|
+
}
|
|
110201
|
+
if (typeof retention !== "undefined") {
|
|
110202
|
+
payload["retention"] = retention;
|
|
110203
|
+
}
|
|
110204
|
+
if (typeof schedule !== "undefined") {
|
|
110205
|
+
payload["schedule"] = schedule;
|
|
110206
|
+
}
|
|
110207
|
+
if (typeof enabled !== "undefined") {
|
|
110208
|
+
payload["enabled"] = enabled;
|
|
110209
|
+
}
|
|
110210
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
110211
|
+
const apiHeaders = {
|
|
110212
|
+
"content-type": "application/json"
|
|
110213
|
+
};
|
|
110214
|
+
return this.client.call("patch", uri, apiHeaders, payload);
|
|
110215
|
+
}
|
|
110216
|
+
deletePolicy(paramsOrFirst) {
|
|
110217
|
+
let params;
|
|
110218
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
110219
|
+
params = paramsOrFirst || {};
|
|
110220
|
+
} else {
|
|
110221
|
+
params = {
|
|
110222
|
+
policyId: paramsOrFirst
|
|
110223
|
+
};
|
|
110224
|
+
}
|
|
110225
|
+
const policyId = params.policyId;
|
|
110226
|
+
if (typeof policyId === "undefined") {
|
|
110227
|
+
throw new AppwriteException('Missing required parameter: "policyId"');
|
|
110228
|
+
}
|
|
110229
|
+
const apiPath = "/backups/policies/{policyId}".replace("{policyId}", policyId);
|
|
110230
|
+
const payload = {};
|
|
110231
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
110232
|
+
const apiHeaders = {
|
|
110233
|
+
"content-type": "application/json"
|
|
110234
|
+
};
|
|
110235
|
+
return this.client.call("delete", uri, apiHeaders, payload);
|
|
110236
|
+
}
|
|
110237
|
+
createRestoration(paramsOrFirst, ...rest) {
|
|
110238
|
+
let params;
|
|
110239
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
110240
|
+
params = paramsOrFirst || {};
|
|
110241
|
+
} else {
|
|
110242
|
+
params = {
|
|
110243
|
+
archiveId: paramsOrFirst,
|
|
110244
|
+
services: rest[0],
|
|
110245
|
+
newResourceId: rest[1],
|
|
110246
|
+
newResourceName: rest[2]
|
|
110247
|
+
};
|
|
110248
|
+
}
|
|
110249
|
+
const archiveId = params.archiveId;
|
|
110250
|
+
const services = params.services;
|
|
110251
|
+
const newResourceId = params.newResourceId;
|
|
110252
|
+
const newResourceName = params.newResourceName;
|
|
110253
|
+
if (typeof archiveId === "undefined") {
|
|
110254
|
+
throw new AppwriteException('Missing required parameter: "archiveId"');
|
|
110255
|
+
}
|
|
110256
|
+
if (typeof services === "undefined") {
|
|
110257
|
+
throw new AppwriteException('Missing required parameter: "services"');
|
|
110258
|
+
}
|
|
110259
|
+
const apiPath = "/backups/restoration";
|
|
110260
|
+
const payload = {};
|
|
110261
|
+
if (typeof archiveId !== "undefined") {
|
|
110262
|
+
payload["archiveId"] = archiveId;
|
|
110263
|
+
}
|
|
110264
|
+
if (typeof services !== "undefined") {
|
|
110265
|
+
payload["services"] = services;
|
|
110266
|
+
}
|
|
110267
|
+
if (typeof newResourceId !== "undefined") {
|
|
110268
|
+
payload["newResourceId"] = newResourceId;
|
|
110269
|
+
}
|
|
110270
|
+
if (typeof newResourceName !== "undefined") {
|
|
110271
|
+
payload["newResourceName"] = newResourceName;
|
|
110272
|
+
}
|
|
110273
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
110274
|
+
const apiHeaders = {
|
|
110275
|
+
"content-type": "application/json"
|
|
110276
|
+
};
|
|
110277
|
+
return this.client.call("post", uri, apiHeaders, payload);
|
|
110278
|
+
}
|
|
110279
|
+
listRestorations(paramsOrFirst) {
|
|
110280
|
+
let params;
|
|
110281
|
+
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
110282
|
+
params = paramsOrFirst || {};
|
|
110283
|
+
} else {
|
|
110284
|
+
params = {
|
|
110285
|
+
queries: paramsOrFirst
|
|
110286
|
+
};
|
|
110287
|
+
}
|
|
110288
|
+
const queries = params.queries;
|
|
110289
|
+
const apiPath = "/backups/restorations";
|
|
110290
|
+
const payload = {};
|
|
110291
|
+
if (typeof queries !== "undefined") {
|
|
110292
|
+
payload["queries"] = queries;
|
|
110293
|
+
}
|
|
110294
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
110295
|
+
const apiHeaders = {};
|
|
110296
|
+
return this.client.call("get", uri, apiHeaders, payload);
|
|
110297
|
+
}
|
|
110298
|
+
getRestoration(paramsOrFirst) {
|
|
110299
|
+
let params;
|
|
110300
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
110301
|
+
params = paramsOrFirst || {};
|
|
110302
|
+
} else {
|
|
110303
|
+
params = {
|
|
110304
|
+
restorationId: paramsOrFirst
|
|
110305
|
+
};
|
|
110306
|
+
}
|
|
110307
|
+
const restorationId = params.restorationId;
|
|
110308
|
+
if (typeof restorationId === "undefined") {
|
|
110309
|
+
throw new AppwriteException('Missing required parameter: "restorationId"');
|
|
110310
|
+
}
|
|
110311
|
+
const apiPath = "/backups/restorations/{restorationId}".replace("{restorationId}", restorationId);
|
|
110312
|
+
const payload = {};
|
|
110313
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
110314
|
+
const apiHeaders = {};
|
|
110315
|
+
return this.client.call("get", uri, apiHeaders, payload);
|
|
110316
|
+
}
|
|
110317
|
+
};
|
|
111234
110318
|
var Console = class {
|
|
111235
110319
|
constructor(client2) {
|
|
111236
110320
|
this.client = client2;
|
|
@@ -121065,21 +120149,26 @@ var Organizations = class {
|
|
|
121065
120149
|
const apiHeaders = {};
|
|
121066
120150
|
return this.client.call("get", uri, apiHeaders, payload);
|
|
121067
120151
|
}
|
|
121068
|
-
getScopes(paramsOrFirst) {
|
|
120152
|
+
getScopes(paramsOrFirst, ...rest) {
|
|
121069
120153
|
let params;
|
|
121070
120154
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
121071
120155
|
params = paramsOrFirst || {};
|
|
121072
120156
|
} else {
|
|
121073
120157
|
params = {
|
|
121074
|
-
organizationId: paramsOrFirst
|
|
120158
|
+
organizationId: paramsOrFirst,
|
|
120159
|
+
projectId: rest[0]
|
|
121075
120160
|
};
|
|
121076
120161
|
}
|
|
121077
120162
|
const organizationId = params.organizationId;
|
|
120163
|
+
const projectId = params.projectId;
|
|
121078
120164
|
if (typeof organizationId === "undefined") {
|
|
121079
120165
|
throw new AppwriteException('Missing required parameter: "organizationId"');
|
|
121080
120166
|
}
|
|
121081
120167
|
const apiPath = "/organizations/{organizationId}/roles".replace("{organizationId}", organizationId);
|
|
121082
120168
|
const payload = {};
|
|
120169
|
+
if (typeof projectId !== "undefined") {
|
|
120170
|
+
payload["projectId"] = projectId;
|
|
120171
|
+
}
|
|
121083
120172
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
121084
120173
|
const apiHeaders = {};
|
|
121085
120174
|
return this.client.call("get", uri, apiHeaders, payload);
|
|
@@ -122655,6 +121744,114 @@ var Projects = class {
|
|
|
122655
121744
|
};
|
|
122656
121745
|
return this.client.call("delete", uri, apiHeaders, payload);
|
|
122657
121746
|
}
|
|
121747
|
+
listSchedules(paramsOrFirst, ...rest) {
|
|
121748
|
+
let params;
|
|
121749
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
121750
|
+
params = paramsOrFirst || {};
|
|
121751
|
+
} else {
|
|
121752
|
+
params = {
|
|
121753
|
+
projectId: paramsOrFirst,
|
|
121754
|
+
queries: rest[0],
|
|
121755
|
+
total: rest[1]
|
|
121756
|
+
};
|
|
121757
|
+
}
|
|
121758
|
+
const projectId = params.projectId;
|
|
121759
|
+
const queries = params.queries;
|
|
121760
|
+
const total = params.total;
|
|
121761
|
+
if (typeof projectId === "undefined") {
|
|
121762
|
+
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
121763
|
+
}
|
|
121764
|
+
const apiPath = "/projects/{projectId}/schedules".replace("{projectId}", projectId);
|
|
121765
|
+
const payload = {};
|
|
121766
|
+
if (typeof queries !== "undefined") {
|
|
121767
|
+
payload["queries"] = queries;
|
|
121768
|
+
}
|
|
121769
|
+
if (typeof total !== "undefined") {
|
|
121770
|
+
payload["total"] = total;
|
|
121771
|
+
}
|
|
121772
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
121773
|
+
const apiHeaders = {};
|
|
121774
|
+
return this.client.call("get", uri, apiHeaders, payload);
|
|
121775
|
+
}
|
|
121776
|
+
createSchedule(paramsOrFirst, ...rest) {
|
|
121777
|
+
let params;
|
|
121778
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
121779
|
+
params = paramsOrFirst || {};
|
|
121780
|
+
} else {
|
|
121781
|
+
params = {
|
|
121782
|
+
projectId: paramsOrFirst,
|
|
121783
|
+
resourceType: rest[0],
|
|
121784
|
+
resourceId: rest[1],
|
|
121785
|
+
schedule: rest[2],
|
|
121786
|
+
active: rest[3],
|
|
121787
|
+
data: rest[4]
|
|
121788
|
+
};
|
|
121789
|
+
}
|
|
121790
|
+
const projectId = params.projectId;
|
|
121791
|
+
const resourceType = params.resourceType;
|
|
121792
|
+
const resourceId = params.resourceId;
|
|
121793
|
+
const schedule = params.schedule;
|
|
121794
|
+
const active = params.active;
|
|
121795
|
+
const data = params.data;
|
|
121796
|
+
if (typeof projectId === "undefined") {
|
|
121797
|
+
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
121798
|
+
}
|
|
121799
|
+
if (typeof resourceType === "undefined") {
|
|
121800
|
+
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
121801
|
+
}
|
|
121802
|
+
if (typeof resourceId === "undefined") {
|
|
121803
|
+
throw new AppwriteException('Missing required parameter: "resourceId"');
|
|
121804
|
+
}
|
|
121805
|
+
if (typeof schedule === "undefined") {
|
|
121806
|
+
throw new AppwriteException('Missing required parameter: "schedule"');
|
|
121807
|
+
}
|
|
121808
|
+
const apiPath = "/projects/{projectId}/schedules".replace("{projectId}", projectId);
|
|
121809
|
+
const payload = {};
|
|
121810
|
+
if (typeof resourceType !== "undefined") {
|
|
121811
|
+
payload["resourceType"] = resourceType;
|
|
121812
|
+
}
|
|
121813
|
+
if (typeof resourceId !== "undefined") {
|
|
121814
|
+
payload["resourceId"] = resourceId;
|
|
121815
|
+
}
|
|
121816
|
+
if (typeof schedule !== "undefined") {
|
|
121817
|
+
payload["schedule"] = schedule;
|
|
121818
|
+
}
|
|
121819
|
+
if (typeof active !== "undefined") {
|
|
121820
|
+
payload["active"] = active;
|
|
121821
|
+
}
|
|
121822
|
+
if (typeof data !== "undefined") {
|
|
121823
|
+
payload["data"] = data;
|
|
121824
|
+
}
|
|
121825
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
121826
|
+
const apiHeaders = {
|
|
121827
|
+
"content-type": "application/json"
|
|
121828
|
+
};
|
|
121829
|
+
return this.client.call("post", uri, apiHeaders, payload);
|
|
121830
|
+
}
|
|
121831
|
+
getSchedule(paramsOrFirst, ...rest) {
|
|
121832
|
+
let params;
|
|
121833
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
121834
|
+
params = paramsOrFirst || {};
|
|
121835
|
+
} else {
|
|
121836
|
+
params = {
|
|
121837
|
+
projectId: paramsOrFirst,
|
|
121838
|
+
scheduleId: rest[0]
|
|
121839
|
+
};
|
|
121840
|
+
}
|
|
121841
|
+
const projectId = params.projectId;
|
|
121842
|
+
const scheduleId = params.scheduleId;
|
|
121843
|
+
if (typeof projectId === "undefined") {
|
|
121844
|
+
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
121845
|
+
}
|
|
121846
|
+
if (typeof scheduleId === "undefined") {
|
|
121847
|
+
throw new AppwriteException('Missing required parameter: "scheduleId"');
|
|
121848
|
+
}
|
|
121849
|
+
const apiPath = "/projects/{projectId}/schedules/{scheduleId}".replace("{projectId}", projectId).replace("{scheduleId}", scheduleId);
|
|
121850
|
+
const payload = {};
|
|
121851
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
121852
|
+
const apiHeaders = {};
|
|
121853
|
+
return this.client.call("get", uri, apiHeaders, payload);
|
|
121854
|
+
}
|
|
122658
121855
|
updateServiceStatus(paramsOrFirst, ...rest) {
|
|
122659
121856
|
let params;
|
|
122660
121857
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
@@ -131310,6 +130507,8 @@ var Scopes;
|
|
|
131310
130507
|
Scopes3["TargetsWrite"] = "targets.write";
|
|
131311
130508
|
Scopes3["RulesRead"] = "rules.read";
|
|
131312
130509
|
Scopes3["RulesWrite"] = "rules.write";
|
|
130510
|
+
Scopes3["SchedulesRead"] = "schedules.read";
|
|
130511
|
+
Scopes3["SchedulesWrite"] = "schedules.write";
|
|
131313
130512
|
Scopes3["MigrationsRead"] = "migrations.read";
|
|
131314
130513
|
Scopes3["MigrationsWrite"] = "migrations.write";
|
|
131315
130514
|
Scopes3["VcsRead"] = "vcs.read";
|
|
@@ -131379,8 +130578,6 @@ var OAuthProvider;
|
|
|
131379
130578
|
OAuthProvider2["Yandex"] = "yandex";
|
|
131380
130579
|
OAuthProvider2["Zoho"] = "zoho";
|
|
131381
130580
|
OAuthProvider2["Zoom"] = "zoom";
|
|
131382
|
-
OAuthProvider2["GithubImagine"] = "githubImagine";
|
|
131383
|
-
OAuthProvider2["GoogleImagine"] = "googleImagine";
|
|
131384
130581
|
})(OAuthProvider || (OAuthProvider = {}));
|
|
131385
130582
|
var Browser;
|
|
131386
130583
|
(function(Browser2) {
|
|
@@ -132144,24 +131341,35 @@ var Runtime;
|
|
|
132144
131341
|
Runtime2["Node200"] = "node-20.0";
|
|
132145
131342
|
Runtime2["Node210"] = "node-21.0";
|
|
132146
131343
|
Runtime2["Node22"] = "node-22";
|
|
131344
|
+
Runtime2["Node23"] = "node-23";
|
|
131345
|
+
Runtime2["Node24"] = "node-24";
|
|
131346
|
+
Runtime2["Node25"] = "node-25";
|
|
132147
131347
|
Runtime2["Php80"] = "php-8.0";
|
|
132148
131348
|
Runtime2["Php81"] = "php-8.1";
|
|
132149
131349
|
Runtime2["Php82"] = "php-8.2";
|
|
132150
131350
|
Runtime2["Php83"] = "php-8.3";
|
|
131351
|
+
Runtime2["Php84"] = "php-8.4";
|
|
132151
131352
|
Runtime2["Ruby30"] = "ruby-3.0";
|
|
132152
131353
|
Runtime2["Ruby31"] = "ruby-3.1";
|
|
132153
131354
|
Runtime2["Ruby32"] = "ruby-3.2";
|
|
132154
131355
|
Runtime2["Ruby33"] = "ruby-3.3";
|
|
131356
|
+
Runtime2["Ruby34"] = "ruby-3.4";
|
|
131357
|
+
Runtime2["Ruby40"] = "ruby-4.0";
|
|
132155
131358
|
Runtime2["Python38"] = "python-3.8";
|
|
132156
131359
|
Runtime2["Python39"] = "python-3.9";
|
|
132157
131360
|
Runtime2["Python310"] = "python-3.10";
|
|
132158
131361
|
Runtime2["Python311"] = "python-3.11";
|
|
132159
131362
|
Runtime2["Python312"] = "python-3.12";
|
|
131363
|
+
Runtime2["Python313"] = "python-3.13";
|
|
131364
|
+
Runtime2["Python314"] = "python-3.14";
|
|
132160
131365
|
Runtime2["Pythonml311"] = "python-ml-3.11";
|
|
132161
131366
|
Runtime2["Pythonml312"] = "python-ml-3.12";
|
|
131367
|
+
Runtime2["Pythonml313"] = "python-ml-3.13";
|
|
132162
131368
|
Runtime2["Deno140"] = "deno-1.40";
|
|
132163
131369
|
Runtime2["Deno146"] = "deno-1.46";
|
|
132164
131370
|
Runtime2["Deno20"] = "deno-2.0";
|
|
131371
|
+
Runtime2["Deno25"] = "deno-2.5";
|
|
131372
|
+
Runtime2["Deno26"] = "deno-2.6";
|
|
132165
131373
|
Runtime2["Dart215"] = "dart-2.15";
|
|
132166
131374
|
Runtime2["Dart216"] = "dart-2.16";
|
|
132167
131375
|
Runtime2["Dart217"] = "dart-2.17";
|
|
@@ -132177,25 +131385,34 @@ var Runtime;
|
|
|
132177
131385
|
Runtime2["Dotnet60"] = "dotnet-6.0";
|
|
132178
131386
|
Runtime2["Dotnet70"] = "dotnet-7.0";
|
|
132179
131387
|
Runtime2["Dotnet80"] = "dotnet-8.0";
|
|
131388
|
+
Runtime2["Dotnet10"] = "dotnet-10";
|
|
132180
131389
|
Runtime2["Java80"] = "java-8.0";
|
|
132181
131390
|
Runtime2["Java110"] = "java-11.0";
|
|
132182
131391
|
Runtime2["Java170"] = "java-17.0";
|
|
132183
131392
|
Runtime2["Java180"] = "java-18.0";
|
|
132184
131393
|
Runtime2["Java210"] = "java-21.0";
|
|
132185
131394
|
Runtime2["Java22"] = "java-22";
|
|
131395
|
+
Runtime2["Java25"] = "java-25";
|
|
132186
131396
|
Runtime2["Swift55"] = "swift-5.5";
|
|
132187
131397
|
Runtime2["Swift58"] = "swift-5.8";
|
|
132188
131398
|
Runtime2["Swift59"] = "swift-5.9";
|
|
132189
131399
|
Runtime2["Swift510"] = "swift-5.10";
|
|
131400
|
+
Runtime2["Swift62"] = "swift-6.2";
|
|
132190
131401
|
Runtime2["Kotlin16"] = "kotlin-1.6";
|
|
132191
131402
|
Runtime2["Kotlin18"] = "kotlin-1.8";
|
|
132192
131403
|
Runtime2["Kotlin19"] = "kotlin-1.9";
|
|
132193
131404
|
Runtime2["Kotlin20"] = "kotlin-2.0";
|
|
131405
|
+
Runtime2["Kotlin23"] = "kotlin-2.3";
|
|
132194
131406
|
Runtime2["Cpp17"] = "cpp-17";
|
|
132195
131407
|
Runtime2["Cpp20"] = "cpp-20";
|
|
132196
131408
|
Runtime2["Bun10"] = "bun-1.0";
|
|
132197
131409
|
Runtime2["Bun11"] = "bun-1.1";
|
|
131410
|
+
Runtime2["Bun12"] = "bun-1.2";
|
|
131411
|
+
Runtime2["Bun13"] = "bun-1.3";
|
|
132198
131412
|
Runtime2["Go123"] = "go-1.23";
|
|
131413
|
+
Runtime2["Go124"] = "go-1.24";
|
|
131414
|
+
Runtime2["Go125"] = "go-1.25";
|
|
131415
|
+
Runtime2["Go126"] = "go-1.26";
|
|
132199
131416
|
Runtime2["Static1"] = "static-1";
|
|
132200
131417
|
Runtime2["Flutter324"] = "flutter-3.24";
|
|
132201
131418
|
Runtime2["Flutter327"] = "flutter-3.27";
|
|
@@ -132213,24 +131430,35 @@ var Runtimes;
|
|
|
132213
131430
|
Runtimes2["Node200"] = "node-20.0";
|
|
132214
131431
|
Runtimes2["Node210"] = "node-21.0";
|
|
132215
131432
|
Runtimes2["Node22"] = "node-22";
|
|
131433
|
+
Runtimes2["Node23"] = "node-23";
|
|
131434
|
+
Runtimes2["Node24"] = "node-24";
|
|
131435
|
+
Runtimes2["Node25"] = "node-25";
|
|
132216
131436
|
Runtimes2["Php80"] = "php-8.0";
|
|
132217
131437
|
Runtimes2["Php81"] = "php-8.1";
|
|
132218
131438
|
Runtimes2["Php82"] = "php-8.2";
|
|
132219
131439
|
Runtimes2["Php83"] = "php-8.3";
|
|
131440
|
+
Runtimes2["Php84"] = "php-8.4";
|
|
132220
131441
|
Runtimes2["Ruby30"] = "ruby-3.0";
|
|
132221
131442
|
Runtimes2["Ruby31"] = "ruby-3.1";
|
|
132222
131443
|
Runtimes2["Ruby32"] = "ruby-3.2";
|
|
132223
131444
|
Runtimes2["Ruby33"] = "ruby-3.3";
|
|
131445
|
+
Runtimes2["Ruby34"] = "ruby-3.4";
|
|
131446
|
+
Runtimes2["Ruby40"] = "ruby-4.0";
|
|
132224
131447
|
Runtimes2["Python38"] = "python-3.8";
|
|
132225
131448
|
Runtimes2["Python39"] = "python-3.9";
|
|
132226
131449
|
Runtimes2["Python310"] = "python-3.10";
|
|
132227
131450
|
Runtimes2["Python311"] = "python-3.11";
|
|
132228
131451
|
Runtimes2["Python312"] = "python-3.12";
|
|
131452
|
+
Runtimes2["Python313"] = "python-3.13";
|
|
131453
|
+
Runtimes2["Python314"] = "python-3.14";
|
|
132229
131454
|
Runtimes2["Pythonml311"] = "python-ml-3.11";
|
|
132230
131455
|
Runtimes2["Pythonml312"] = "python-ml-3.12";
|
|
131456
|
+
Runtimes2["Pythonml313"] = "python-ml-3.13";
|
|
132231
131457
|
Runtimes2["Deno140"] = "deno-1.40";
|
|
132232
131458
|
Runtimes2["Deno146"] = "deno-1.46";
|
|
132233
131459
|
Runtimes2["Deno20"] = "deno-2.0";
|
|
131460
|
+
Runtimes2["Deno25"] = "deno-2.5";
|
|
131461
|
+
Runtimes2["Deno26"] = "deno-2.6";
|
|
132234
131462
|
Runtimes2["Dart215"] = "dart-2.15";
|
|
132235
131463
|
Runtimes2["Dart216"] = "dart-2.16";
|
|
132236
131464
|
Runtimes2["Dart217"] = "dart-2.17";
|
|
@@ -132246,25 +131474,34 @@ var Runtimes;
|
|
|
132246
131474
|
Runtimes2["Dotnet60"] = "dotnet-6.0";
|
|
132247
131475
|
Runtimes2["Dotnet70"] = "dotnet-7.0";
|
|
132248
131476
|
Runtimes2["Dotnet80"] = "dotnet-8.0";
|
|
131477
|
+
Runtimes2["Dotnet10"] = "dotnet-10";
|
|
132249
131478
|
Runtimes2["Java80"] = "java-8.0";
|
|
132250
131479
|
Runtimes2["Java110"] = "java-11.0";
|
|
132251
131480
|
Runtimes2["Java170"] = "java-17.0";
|
|
132252
131481
|
Runtimes2["Java180"] = "java-18.0";
|
|
132253
131482
|
Runtimes2["Java210"] = "java-21.0";
|
|
132254
131483
|
Runtimes2["Java22"] = "java-22";
|
|
131484
|
+
Runtimes2["Java25"] = "java-25";
|
|
132255
131485
|
Runtimes2["Swift55"] = "swift-5.5";
|
|
132256
131486
|
Runtimes2["Swift58"] = "swift-5.8";
|
|
132257
131487
|
Runtimes2["Swift59"] = "swift-5.9";
|
|
132258
131488
|
Runtimes2["Swift510"] = "swift-5.10";
|
|
131489
|
+
Runtimes2["Swift62"] = "swift-6.2";
|
|
132259
131490
|
Runtimes2["Kotlin16"] = "kotlin-1.6";
|
|
132260
131491
|
Runtimes2["Kotlin18"] = "kotlin-1.8";
|
|
132261
131492
|
Runtimes2["Kotlin19"] = "kotlin-1.9";
|
|
132262
131493
|
Runtimes2["Kotlin20"] = "kotlin-2.0";
|
|
131494
|
+
Runtimes2["Kotlin23"] = "kotlin-2.3";
|
|
132263
131495
|
Runtimes2["Cpp17"] = "cpp-17";
|
|
132264
131496
|
Runtimes2["Cpp20"] = "cpp-20";
|
|
132265
131497
|
Runtimes2["Bun10"] = "bun-1.0";
|
|
132266
131498
|
Runtimes2["Bun11"] = "bun-1.1";
|
|
131499
|
+
Runtimes2["Bun12"] = "bun-1.2";
|
|
131500
|
+
Runtimes2["Bun13"] = "bun-1.3";
|
|
132267
131501
|
Runtimes2["Go123"] = "go-1.23";
|
|
131502
|
+
Runtimes2["Go124"] = "go-1.24";
|
|
131503
|
+
Runtimes2["Go125"] = "go-1.25";
|
|
131504
|
+
Runtimes2["Go126"] = "go-1.26";
|
|
132268
131505
|
Runtimes2["Static1"] = "static-1";
|
|
132269
131506
|
Runtimes2["Flutter324"] = "flutter-3.24";
|
|
132270
131507
|
Runtimes2["Flutter327"] = "flutter-3.27";
|
|
@@ -132401,6 +131638,13 @@ var PlatformType;
|
|
|
132401
131638
|
PlatformType2["Reactnativeios"] = "react-native-ios";
|
|
132402
131639
|
PlatformType2["Reactnativeandroid"] = "react-native-android";
|
|
132403
131640
|
})(PlatformType || (PlatformType = {}));
|
|
131641
|
+
var ResourceType;
|
|
131642
|
+
(function(ResourceType2) {
|
|
131643
|
+
ResourceType2["Function"] = "function";
|
|
131644
|
+
ResourceType2["Execution"] = "execution";
|
|
131645
|
+
ResourceType2["Message"] = "message";
|
|
131646
|
+
ResourceType2["Backup"] = "backup";
|
|
131647
|
+
})(ResourceType || (ResourceType = {}));
|
|
132404
131648
|
var ApiService;
|
|
132405
131649
|
(function(ApiService3) {
|
|
132406
131650
|
ApiService3["Account"] = "account";
|
|
@@ -132425,12 +131669,12 @@ var SMTPSecure;
|
|
|
132425
131669
|
var EmailTemplateType;
|
|
132426
131670
|
(function(EmailTemplateType2) {
|
|
132427
131671
|
EmailTemplateType2["Verification"] = "verification";
|
|
132428
|
-
EmailTemplateType2["
|
|
131672
|
+
EmailTemplateType2["MagicSession"] = "magicSession";
|
|
132429
131673
|
EmailTemplateType2["Recovery"] = "recovery";
|
|
132430
131674
|
EmailTemplateType2["Invitation"] = "invitation";
|
|
132431
|
-
EmailTemplateType2["
|
|
132432
|
-
EmailTemplateType2["
|
|
132433
|
-
EmailTemplateType2["
|
|
131675
|
+
EmailTemplateType2["MfaChallenge"] = "mfaChallenge";
|
|
131676
|
+
EmailTemplateType2["SessionAlert"] = "sessionAlert";
|
|
131677
|
+
EmailTemplateType2["OtpSession"] = "otpSession";
|
|
132434
131678
|
})(EmailTemplateType || (EmailTemplateType = {}));
|
|
132435
131679
|
var EmailTemplateLocale;
|
|
132436
131680
|
(function(EmailTemplateLocale2) {
|
|
@@ -132571,7 +131815,7 @@ var SmsTemplateType;
|
|
|
132571
131815
|
SmsTemplateType2["Verification"] = "verification";
|
|
132572
131816
|
SmsTemplateType2["Login"] = "login";
|
|
132573
131817
|
SmsTemplateType2["Invitation"] = "invitation";
|
|
132574
|
-
SmsTemplateType2["
|
|
131818
|
+
SmsTemplateType2["MfaChallenge"] = "mfaChallenge";
|
|
132575
131819
|
})(SmsTemplateType || (SmsTemplateType = {}));
|
|
132576
131820
|
var SmsTemplateLocale;
|
|
132577
131821
|
(function(SmsTemplateLocale2) {
|
|
@@ -132746,24 +131990,35 @@ var BuildRuntime;
|
|
|
132746
131990
|
BuildRuntime2["Node200"] = "node-20.0";
|
|
132747
131991
|
BuildRuntime2["Node210"] = "node-21.0";
|
|
132748
131992
|
BuildRuntime2["Node22"] = "node-22";
|
|
131993
|
+
BuildRuntime2["Node23"] = "node-23";
|
|
131994
|
+
BuildRuntime2["Node24"] = "node-24";
|
|
131995
|
+
BuildRuntime2["Node25"] = "node-25";
|
|
132749
131996
|
BuildRuntime2["Php80"] = "php-8.0";
|
|
132750
131997
|
BuildRuntime2["Php81"] = "php-8.1";
|
|
132751
131998
|
BuildRuntime2["Php82"] = "php-8.2";
|
|
132752
131999
|
BuildRuntime2["Php83"] = "php-8.3";
|
|
132000
|
+
BuildRuntime2["Php84"] = "php-8.4";
|
|
132753
132001
|
BuildRuntime2["Ruby30"] = "ruby-3.0";
|
|
132754
132002
|
BuildRuntime2["Ruby31"] = "ruby-3.1";
|
|
132755
132003
|
BuildRuntime2["Ruby32"] = "ruby-3.2";
|
|
132756
132004
|
BuildRuntime2["Ruby33"] = "ruby-3.3";
|
|
132005
|
+
BuildRuntime2["Ruby34"] = "ruby-3.4";
|
|
132006
|
+
BuildRuntime2["Ruby40"] = "ruby-4.0";
|
|
132757
132007
|
BuildRuntime2["Python38"] = "python-3.8";
|
|
132758
132008
|
BuildRuntime2["Python39"] = "python-3.9";
|
|
132759
132009
|
BuildRuntime2["Python310"] = "python-3.10";
|
|
132760
132010
|
BuildRuntime2["Python311"] = "python-3.11";
|
|
132761
132011
|
BuildRuntime2["Python312"] = "python-3.12";
|
|
132012
|
+
BuildRuntime2["Python313"] = "python-3.13";
|
|
132013
|
+
BuildRuntime2["Python314"] = "python-3.14";
|
|
132762
132014
|
BuildRuntime2["Pythonml311"] = "python-ml-3.11";
|
|
132763
132015
|
BuildRuntime2["Pythonml312"] = "python-ml-3.12";
|
|
132016
|
+
BuildRuntime2["Pythonml313"] = "python-ml-3.13";
|
|
132764
132017
|
BuildRuntime2["Deno140"] = "deno-1.40";
|
|
132765
132018
|
BuildRuntime2["Deno146"] = "deno-1.46";
|
|
132766
132019
|
BuildRuntime2["Deno20"] = "deno-2.0";
|
|
132020
|
+
BuildRuntime2["Deno25"] = "deno-2.5";
|
|
132021
|
+
BuildRuntime2["Deno26"] = "deno-2.6";
|
|
132767
132022
|
BuildRuntime2["Dart215"] = "dart-2.15";
|
|
132768
132023
|
BuildRuntime2["Dart216"] = "dart-2.16";
|
|
132769
132024
|
BuildRuntime2["Dart217"] = "dart-2.17";
|
|
@@ -132779,25 +132034,34 @@ var BuildRuntime;
|
|
|
132779
132034
|
BuildRuntime2["Dotnet60"] = "dotnet-6.0";
|
|
132780
132035
|
BuildRuntime2["Dotnet70"] = "dotnet-7.0";
|
|
132781
132036
|
BuildRuntime2["Dotnet80"] = "dotnet-8.0";
|
|
132037
|
+
BuildRuntime2["Dotnet10"] = "dotnet-10";
|
|
132782
132038
|
BuildRuntime2["Java80"] = "java-8.0";
|
|
132783
132039
|
BuildRuntime2["Java110"] = "java-11.0";
|
|
132784
132040
|
BuildRuntime2["Java170"] = "java-17.0";
|
|
132785
132041
|
BuildRuntime2["Java180"] = "java-18.0";
|
|
132786
132042
|
BuildRuntime2["Java210"] = "java-21.0";
|
|
132787
132043
|
BuildRuntime2["Java22"] = "java-22";
|
|
132044
|
+
BuildRuntime2["Java25"] = "java-25";
|
|
132788
132045
|
BuildRuntime2["Swift55"] = "swift-5.5";
|
|
132789
132046
|
BuildRuntime2["Swift58"] = "swift-5.8";
|
|
132790
132047
|
BuildRuntime2["Swift59"] = "swift-5.9";
|
|
132791
132048
|
BuildRuntime2["Swift510"] = "swift-5.10";
|
|
132049
|
+
BuildRuntime2["Swift62"] = "swift-6.2";
|
|
132792
132050
|
BuildRuntime2["Kotlin16"] = "kotlin-1.6";
|
|
132793
132051
|
BuildRuntime2["Kotlin18"] = "kotlin-1.8";
|
|
132794
132052
|
BuildRuntime2["Kotlin19"] = "kotlin-1.9";
|
|
132795
132053
|
BuildRuntime2["Kotlin20"] = "kotlin-2.0";
|
|
132054
|
+
BuildRuntime2["Kotlin23"] = "kotlin-2.3";
|
|
132796
132055
|
BuildRuntime2["Cpp17"] = "cpp-17";
|
|
132797
132056
|
BuildRuntime2["Cpp20"] = "cpp-20";
|
|
132798
132057
|
BuildRuntime2["Bun10"] = "bun-1.0";
|
|
132799
132058
|
BuildRuntime2["Bun11"] = "bun-1.1";
|
|
132059
|
+
BuildRuntime2["Bun12"] = "bun-1.2";
|
|
132060
|
+
BuildRuntime2["Bun13"] = "bun-1.3";
|
|
132800
132061
|
BuildRuntime2["Go123"] = "go-1.23";
|
|
132062
|
+
BuildRuntime2["Go124"] = "go-1.24";
|
|
132063
|
+
BuildRuntime2["Go125"] = "go-1.25";
|
|
132064
|
+
BuildRuntime2["Go126"] = "go-1.26";
|
|
132801
132065
|
BuildRuntime2["Static1"] = "static-1";
|
|
132802
132066
|
BuildRuntime2["Flutter324"] = "flutter-3.24";
|
|
132803
132067
|
BuildRuntime2["Flutter327"] = "flutter-3.27";
|
|
@@ -135292,8 +134556,8 @@ async function createPullInstance(options = {
|
|
|
135292
134556
|
}) {
|
|
135293
134557
|
const { silent, requiresConsoleAuth } = options;
|
|
135294
134558
|
const projectClient2 = await sdkForProject();
|
|
135295
|
-
const
|
|
135296
|
-
const pullInstance = new Pull(projectClient2,
|
|
134559
|
+
const consoleClient = await sdkForConsole(requiresConsoleAuth);
|
|
134560
|
+
const pullInstance = new Pull(projectClient2, consoleClient, silent);
|
|
135297
134561
|
pullInstance.setConfigDirectoryPath(localConfig.configDirectoryPath);
|
|
135298
134562
|
return pullInstance;
|
|
135299
134563
|
}
|
|
@@ -135302,9 +134566,9 @@ var Pull = class {
|
|
|
135302
134566
|
consoleClient;
|
|
135303
134567
|
configDirectoryPath;
|
|
135304
134568
|
silent;
|
|
135305
|
-
constructor(projectClient2,
|
|
134569
|
+
constructor(projectClient2, consoleClient, silent = false) {
|
|
135306
134570
|
this.projectClient = projectClient2;
|
|
135307
|
-
this.consoleClient =
|
|
134571
|
+
this.consoleClient = consoleClient;
|
|
135308
134572
|
this.configDirectoryPath = process.cwd();
|
|
135309
134573
|
this.silent = silent;
|
|
135310
134574
|
}
|
|
@@ -138127,9 +137391,9 @@ var JwtManager = {
|
|
|
138127
137391
|
timerWarn: null,
|
|
138128
137392
|
timerError: null,
|
|
138129
137393
|
async setup(userId = null, projectScopes = []) {
|
|
138130
|
-
const
|
|
138131
|
-
const usersClient2 = new Users(
|
|
138132
|
-
const projectsClient2 = new Projects(
|
|
137394
|
+
const consoleClient = await sdkForConsole();
|
|
137395
|
+
const usersClient2 = new Users(consoleClient);
|
|
137396
|
+
const projectsClient2 = new Projects(consoleClient);
|
|
138133
137397
|
if (this.timerWarn) {
|
|
138134
137398
|
clearTimeout(this.timerWarn);
|
|
138135
137399
|
}
|
|
@@ -139166,7 +138430,9 @@ var Pools = class {
|
|
|
139166
138430
|
// Milliseconds
|
|
139167
138431
|
pollMaxDebounces = 30;
|
|
139168
138432
|
POLL_DEFAULT_VALUE = 30;
|
|
139169
|
-
|
|
138433
|
+
client;
|
|
138434
|
+
constructor(pollMaxDebounces, client2) {
|
|
138435
|
+
this.client = client2;
|
|
139170
138436
|
if (pollMaxDebounces) {
|
|
139171
138437
|
this.pollMaxDebounces = pollMaxDebounces;
|
|
139172
138438
|
}
|
|
@@ -139175,7 +138441,7 @@ var Pools = class {
|
|
|
139175
138441
|
if (iteration > this.pollMaxDebounces) {
|
|
139176
138442
|
return false;
|
|
139177
138443
|
}
|
|
139178
|
-
const databasesService = await getDatabasesService();
|
|
138444
|
+
const databasesService = await getDatabasesService(this.client);
|
|
139179
138445
|
const response = await databasesService.listAttributes(
|
|
139180
138446
|
databaseId,
|
|
139181
138447
|
collectionId,
|
|
@@ -139201,7 +138467,7 @@ var Pools = class {
|
|
|
139201
138467
|
if (iteration > this.pollMaxDebounces) {
|
|
139202
138468
|
return false;
|
|
139203
138469
|
}
|
|
139204
|
-
const databasesService = await getDatabasesService();
|
|
138470
|
+
const databasesService = await getDatabasesService(this.client);
|
|
139205
138471
|
const response = await databasesService.listIndexes(
|
|
139206
138472
|
databaseId,
|
|
139207
138473
|
collectionId,
|
|
@@ -139238,7 +138504,7 @@ var Pools = class {
|
|
|
139238
138504
|
}
|
|
139239
138505
|
const { attributes } = await paginate(
|
|
139240
138506
|
async (args) => {
|
|
139241
|
-
const databasesService = await getDatabasesService();
|
|
138507
|
+
const databasesService = await getDatabasesService(this.client);
|
|
139242
138508
|
return await databasesService.listAttributes({
|
|
139243
138509
|
databaseId: args.databaseId,
|
|
139244
138510
|
collectionId: args.collectionId,
|
|
@@ -139281,7 +138547,7 @@ var Pools = class {
|
|
|
139281
138547
|
}
|
|
139282
138548
|
const { attributes } = await paginate(
|
|
139283
138549
|
async (args) => {
|
|
139284
|
-
const databasesService = await getDatabasesService();
|
|
138550
|
+
const databasesService = await getDatabasesService(this.client);
|
|
139285
138551
|
return await databasesService.listAttributes(
|
|
139286
138552
|
args.databaseId,
|
|
139287
138553
|
args.collectionId,
|
|
@@ -139330,7 +138596,7 @@ var Pools = class {
|
|
|
139330
138596
|
}
|
|
139331
138597
|
const { indexes } = await paginate(
|
|
139332
138598
|
async (args) => {
|
|
139333
|
-
const databasesService = await getDatabasesService();
|
|
138599
|
+
const databasesService = await getDatabasesService(this.client);
|
|
139334
138600
|
return await databasesService.listIndexes(
|
|
139335
138601
|
args.databaseId,
|
|
139336
138602
|
args.collectionId,
|
|
@@ -139396,8 +138662,10 @@ var questionPushChangesConfirmation2 = [
|
|
|
139396
138662
|
var Attributes = class {
|
|
139397
138663
|
pools;
|
|
139398
138664
|
skipConfirmation;
|
|
139399
|
-
|
|
139400
|
-
|
|
138665
|
+
client;
|
|
138666
|
+
constructor(pools, skipConfirmation = false, client2) {
|
|
138667
|
+
this.client = client2;
|
|
138668
|
+
this.pools = pools || new Pools(void 0, client2);
|
|
139401
138669
|
this.skipConfirmation = skipConfirmation;
|
|
139402
138670
|
}
|
|
139403
138671
|
getConfirmation = async () => {
|
|
@@ -139485,7 +138753,7 @@ var Attributes = class {
|
|
|
139485
138753
|
};
|
|
139486
138754
|
};
|
|
139487
138755
|
createAttribute = async (databaseId, collectionId, attribute) => {
|
|
139488
|
-
const databasesService = await getDatabasesService();
|
|
138756
|
+
const databasesService = await getDatabasesService(this.client);
|
|
139489
138757
|
switch (attribute.type) {
|
|
139490
138758
|
case "string":
|
|
139491
138759
|
switch (attribute.format) {
|
|
@@ -139655,7 +138923,7 @@ var Attributes = class {
|
|
|
139655
138923
|
}
|
|
139656
138924
|
};
|
|
139657
138925
|
updateAttribute = async (databaseId, collectionId, attribute) => {
|
|
139658
|
-
const databasesService = await getDatabasesService();
|
|
138926
|
+
const databasesService = await getDatabasesService(this.client);
|
|
139659
138927
|
switch (attribute.type) {
|
|
139660
138928
|
case "string":
|
|
139661
138929
|
switch (attribute.format) {
|
|
@@ -139809,7 +139077,7 @@ var Attributes = class {
|
|
|
139809
139077
|
log(
|
|
139810
139078
|
`Deleting ${isIndex ? "index" : "attribute"} ${attribute.key} of ${collection.name} ( ${collection["$id"]} )`
|
|
139811
139079
|
);
|
|
139812
|
-
const databasesService = await getDatabasesService();
|
|
139080
|
+
const databasesService = await getDatabasesService(this.client);
|
|
139813
139081
|
if (isIndex) {
|
|
139814
139082
|
await databasesService.deleteIndex(
|
|
139815
139083
|
collection["databaseId"],
|
|
@@ -139964,7 +139232,7 @@ var Attributes = class {
|
|
|
139964
139232
|
};
|
|
139965
139233
|
createIndexes = async (indexes, collection) => {
|
|
139966
139234
|
log(`Creating indexes ...`);
|
|
139967
|
-
const databasesService = await getDatabasesService();
|
|
139235
|
+
const databasesService = await getDatabasesService(this.client);
|
|
139968
139236
|
for (let index of indexes) {
|
|
139969
139237
|
await databasesService.createIndex({
|
|
139970
139238
|
databaseId: collection["databaseId"],
|
|
@@ -140185,9 +139453,9 @@ var Push = class {
|
|
|
140185
139453
|
projectClient;
|
|
140186
139454
|
consoleClient;
|
|
140187
139455
|
silent;
|
|
140188
|
-
constructor(projectClient2,
|
|
139456
|
+
constructor(projectClient2, consoleClient, silent = false) {
|
|
140189
139457
|
this.projectClient = projectClient2;
|
|
140190
|
-
this.consoleClient =
|
|
139458
|
+
this.consoleClient = consoleClient;
|
|
140191
139459
|
this.silent = silent;
|
|
140192
139460
|
}
|
|
140193
139461
|
/**
|
|
@@ -140223,158 +139491,169 @@ var Push = class {
|
|
|
140223
139491
|
}
|
|
140224
139492
|
}
|
|
140225
139493
|
async pushResources(config2, options = { all: true, skipDeprecated: true }) {
|
|
140226
|
-
const
|
|
140227
|
-
|
|
140228
|
-
|
|
140229
|
-
const shouldPushAll = options.all === true;
|
|
140230
|
-
if ((shouldPushAll || options.settings) && (config2.projectName || config2.settings)) {
|
|
140231
|
-
try {
|
|
140232
|
-
this.log("Pushing settings ...");
|
|
140233
|
-
await this.pushSettings({
|
|
140234
|
-
projectId: config2.projectId,
|
|
140235
|
-
projectName: config2.projectName,
|
|
140236
|
-
settings: config2.settings
|
|
140237
|
-
});
|
|
140238
|
-
this.success(
|
|
140239
|
-
`Successfully pushed ${import_chalk11.default.bold("all")} project settings.`
|
|
140240
|
-
);
|
|
140241
|
-
results.settings = { success: true };
|
|
140242
|
-
} catch (e) {
|
|
140243
|
-
allErrors.push(e);
|
|
140244
|
-
results.settings = { success: false, error: e.message };
|
|
140245
|
-
}
|
|
139494
|
+
const previousForce = cliConfig.force;
|
|
139495
|
+
if (options.force !== void 0) {
|
|
139496
|
+
cliConfig.force = options.force;
|
|
140246
139497
|
}
|
|
140247
|
-
|
|
140248
|
-
|
|
140249
|
-
|
|
140250
|
-
|
|
140251
|
-
|
|
140252
|
-
|
|
140253
|
-
|
|
140254
|
-
|
|
140255
|
-
|
|
140256
|
-
|
|
140257
|
-
|
|
140258
|
-
|
|
139498
|
+
try {
|
|
139499
|
+
const { skipDeprecated = true } = options;
|
|
139500
|
+
const results = {};
|
|
139501
|
+
const allErrors = [];
|
|
139502
|
+
const shouldPushAll = options.all === true;
|
|
139503
|
+
if ((shouldPushAll || options.settings) && (config2.projectName || config2.settings)) {
|
|
139504
|
+
try {
|
|
139505
|
+
this.log("Pushing settings ...");
|
|
139506
|
+
await this.pushSettings({
|
|
139507
|
+
projectId: config2.projectId,
|
|
139508
|
+
projectName: config2.projectName,
|
|
139509
|
+
settings: config2.settings
|
|
139510
|
+
});
|
|
139511
|
+
this.success(
|
|
139512
|
+
`Successfully pushed ${import_chalk11.default.bold("all")} project settings.`
|
|
139513
|
+
);
|
|
139514
|
+
results.settings = { success: true };
|
|
139515
|
+
} catch (e) {
|
|
139516
|
+
allErrors.push(e);
|
|
139517
|
+
results.settings = { success: false, error: e.message };
|
|
139518
|
+
}
|
|
140259
139519
|
}
|
|
140260
|
-
|
|
140261
|
-
|
|
140262
|
-
|
|
140263
|
-
|
|
140264
|
-
|
|
140265
|
-
|
|
140266
|
-
|
|
140267
|
-
|
|
140268
|
-
|
|
140269
|
-
|
|
140270
|
-
|
|
140271
|
-
|
|
140272
|
-
|
|
139520
|
+
if ((shouldPushAll || options.buckets) && config2.buckets && config2.buckets.length > 0) {
|
|
139521
|
+
try {
|
|
139522
|
+
this.log("Pushing buckets ...");
|
|
139523
|
+
const result = await this.pushBuckets(config2.buckets);
|
|
139524
|
+
this.success(
|
|
139525
|
+
`Successfully pushed ${import_chalk11.default.bold(result.successfullyPushed)} buckets.`
|
|
139526
|
+
);
|
|
139527
|
+
results.buckets = result;
|
|
139528
|
+
allErrors.push(...result.errors);
|
|
139529
|
+
} catch (e) {
|
|
139530
|
+
allErrors.push(e);
|
|
139531
|
+
results.buckets = { successfullyPushed: 0, errors: [e] };
|
|
139532
|
+
}
|
|
140273
139533
|
}
|
|
140274
|
-
|
|
140275
|
-
|
|
140276
|
-
|
|
140277
|
-
|
|
140278
|
-
|
|
140279
|
-
|
|
140280
|
-
|
|
140281
|
-
|
|
140282
|
-
|
|
140283
|
-
|
|
140284
|
-
|
|
140285
|
-
|
|
140286
|
-
|
|
139534
|
+
if ((shouldPushAll || options.teams) && config2.teams && config2.teams.length > 0) {
|
|
139535
|
+
try {
|
|
139536
|
+
this.log("Pushing teams ...");
|
|
139537
|
+
const result = await this.pushTeams(config2.teams);
|
|
139538
|
+
this.success(
|
|
139539
|
+
`Successfully pushed ${import_chalk11.default.bold(result.successfullyPushed)} teams.`
|
|
139540
|
+
);
|
|
139541
|
+
results.teams = result;
|
|
139542
|
+
allErrors.push(...result.errors);
|
|
139543
|
+
} catch (e) {
|
|
139544
|
+
allErrors.push(e);
|
|
139545
|
+
results.teams = { successfullyPushed: 0, errors: [e] };
|
|
139546
|
+
}
|
|
140287
139547
|
}
|
|
140288
|
-
|
|
140289
|
-
|
|
140290
|
-
|
|
140291
|
-
|
|
140292
|
-
|
|
140293
|
-
|
|
140294
|
-
|
|
140295
|
-
|
|
140296
|
-
|
|
140297
|
-
|
|
140298
|
-
|
|
140299
|
-
|
|
140300
|
-
|
|
140301
|
-
} catch (e) {
|
|
140302
|
-
allErrors.push(e);
|
|
140303
|
-
results.functions = {
|
|
140304
|
-
successfullyPushed: 0,
|
|
140305
|
-
successfullyDeployed: 0,
|
|
140306
|
-
failedDeployments: [],
|
|
140307
|
-
errors: [e]
|
|
140308
|
-
};
|
|
139548
|
+
if ((shouldPushAll || options.topics) && config2.topics && config2.topics.length > 0) {
|
|
139549
|
+
try {
|
|
139550
|
+
this.log("Pushing topics ...");
|
|
139551
|
+
const result = await this.pushMessagingTopics(config2.topics);
|
|
139552
|
+
this.success(
|
|
139553
|
+
`Successfully pushed ${import_chalk11.default.bold(result.successfullyPushed)} topics.`
|
|
139554
|
+
);
|
|
139555
|
+
results.topics = result;
|
|
139556
|
+
allErrors.push(...result.errors);
|
|
139557
|
+
} catch (e) {
|
|
139558
|
+
allErrors.push(e);
|
|
139559
|
+
results.topics = { successfullyPushed: 0, errors: [e] };
|
|
139560
|
+
}
|
|
140309
139561
|
}
|
|
140310
|
-
|
|
140311
|
-
|
|
140312
|
-
|
|
140313
|
-
|
|
140314
|
-
|
|
140315
|
-
|
|
140316
|
-
|
|
140317
|
-
|
|
140318
|
-
|
|
140319
|
-
|
|
140320
|
-
|
|
140321
|
-
|
|
140322
|
-
|
|
140323
|
-
|
|
140324
|
-
|
|
140325
|
-
|
|
140326
|
-
|
|
140327
|
-
|
|
139562
|
+
if ((shouldPushAll || options.functions) && config2.functions && config2.functions.length > 0) {
|
|
139563
|
+
try {
|
|
139564
|
+
this.log("Pushing functions ...");
|
|
139565
|
+
const result = await this.pushFunctions(
|
|
139566
|
+
config2.functions,
|
|
139567
|
+
options.functionOptions
|
|
139568
|
+
);
|
|
139569
|
+
this.success(
|
|
139570
|
+
`Successfully pushed ${import_chalk11.default.bold(result.successfullyPushed)} functions.`
|
|
139571
|
+
);
|
|
139572
|
+
results.functions = result;
|
|
139573
|
+
allErrors.push(...result.errors);
|
|
139574
|
+
} catch (e) {
|
|
139575
|
+
allErrors.push(e);
|
|
139576
|
+
results.functions = {
|
|
139577
|
+
successfullyPushed: 0,
|
|
139578
|
+
successfullyDeployed: 0,
|
|
139579
|
+
failedDeployments: [],
|
|
139580
|
+
errors: [e]
|
|
139581
|
+
};
|
|
139582
|
+
}
|
|
140328
139583
|
}
|
|
140329
|
-
|
|
140330
|
-
|
|
140331
|
-
|
|
140332
|
-
|
|
140333
|
-
|
|
140334
|
-
|
|
140335
|
-
|
|
140336
|
-
|
|
140337
|
-
|
|
140338
|
-
|
|
140339
|
-
|
|
140340
|
-
|
|
140341
|
-
|
|
140342
|
-
|
|
140343
|
-
|
|
140344
|
-
|
|
139584
|
+
if ((shouldPushAll || options.sites) && config2.sites && config2.sites.length > 0) {
|
|
139585
|
+
try {
|
|
139586
|
+
this.log("Pushing sites ...");
|
|
139587
|
+
const result = await this.pushSites(
|
|
139588
|
+
config2.sites,
|
|
139589
|
+
options.siteOptions
|
|
139590
|
+
);
|
|
139591
|
+
this.success(
|
|
139592
|
+
`Successfully pushed ${import_chalk11.default.bold(result.successfullyPushed)} sites.`
|
|
139593
|
+
);
|
|
139594
|
+
results.sites = result;
|
|
139595
|
+
allErrors.push(...result.errors);
|
|
139596
|
+
} catch (e) {
|
|
139597
|
+
allErrors.push(e);
|
|
139598
|
+
results.sites = {
|
|
139599
|
+
successfullyPushed: 0,
|
|
139600
|
+
successfullyDeployed: 0,
|
|
139601
|
+
failedDeployments: [],
|
|
139602
|
+
errors: [e]
|
|
139603
|
+
};
|
|
139604
|
+
}
|
|
140345
139605
|
}
|
|
140346
|
-
|
|
140347
|
-
|
|
140348
|
-
|
|
140349
|
-
|
|
140350
|
-
|
|
140351
|
-
|
|
140352
|
-
|
|
140353
|
-
|
|
140354
|
-
)
|
|
140355
|
-
|
|
140356
|
-
|
|
140357
|
-
|
|
140358
|
-
|
|
140359
|
-
|
|
140360
|
-
|
|
140361
|
-
|
|
140362
|
-
skipConfirmation: options.skipConfirmation
|
|
140363
|
-
});
|
|
140364
|
-
this.success(
|
|
140365
|
-
`Successfully pushed ${import_chalk11.default.bold(result.successfullyPushed)} collections.`
|
|
140366
|
-
);
|
|
140367
|
-
results.collections = result;
|
|
140368
|
-
allErrors.push(...result.errors);
|
|
140369
|
-
} catch (e) {
|
|
140370
|
-
allErrors.push(e);
|
|
140371
|
-
results.collections = { successfullyPushed: 0, errors: [e] };
|
|
139606
|
+
if ((shouldPushAll || options.tables) && config2.tables && config2.tables.length > 0) {
|
|
139607
|
+
try {
|
|
139608
|
+
this.log("Pushing tables ...");
|
|
139609
|
+
const result = await this.pushTables(config2.tables, {
|
|
139610
|
+
attempts: options.tableOptions?.attempts,
|
|
139611
|
+
skipConfirmation: options.skipConfirmation
|
|
139612
|
+
});
|
|
139613
|
+
this.success(
|
|
139614
|
+
`Successfully pushed ${import_chalk11.default.bold(result.successfullyPushed)} tables.`
|
|
139615
|
+
);
|
|
139616
|
+
results.tables = result;
|
|
139617
|
+
allErrors.push(...result.errors);
|
|
139618
|
+
} catch (e) {
|
|
139619
|
+
allErrors.push(e);
|
|
139620
|
+
results.tables = { successfullyPushed: 0, errors: [e] };
|
|
139621
|
+
}
|
|
140372
139622
|
}
|
|
139623
|
+
if ((options.collections || shouldPushAll && !skipDeprecated) && config2.collections && config2.collections.length > 0) {
|
|
139624
|
+
try {
|
|
139625
|
+
this.log("Pushing collections ...");
|
|
139626
|
+
const collectionsWithDbNames = config2.collections.map(
|
|
139627
|
+
(collection) => {
|
|
139628
|
+
const database = config2.databases?.find(
|
|
139629
|
+
(db) => db.$id === collection.databaseId
|
|
139630
|
+
);
|
|
139631
|
+
return {
|
|
139632
|
+
...collection,
|
|
139633
|
+
databaseName: database?.name ?? collection.databaseId
|
|
139634
|
+
};
|
|
139635
|
+
}
|
|
139636
|
+
);
|
|
139637
|
+
const result = await this.pushCollections(collectionsWithDbNames, {
|
|
139638
|
+
skipConfirmation: options.skipConfirmation
|
|
139639
|
+
});
|
|
139640
|
+
this.success(
|
|
139641
|
+
`Successfully pushed ${import_chalk11.default.bold(result.successfullyPushed)} collections.`
|
|
139642
|
+
);
|
|
139643
|
+
results.collections = result;
|
|
139644
|
+
allErrors.push(...result.errors);
|
|
139645
|
+
} catch (e) {
|
|
139646
|
+
allErrors.push(e);
|
|
139647
|
+
results.collections = { successfullyPushed: 0, errors: [e] };
|
|
139648
|
+
}
|
|
139649
|
+
}
|
|
139650
|
+
return {
|
|
139651
|
+
results,
|
|
139652
|
+
errors: allErrors
|
|
139653
|
+
};
|
|
139654
|
+
} finally {
|
|
139655
|
+
cliConfig.force = previousForce;
|
|
140373
139656
|
}
|
|
140374
|
-
return {
|
|
140375
|
-
results,
|
|
140376
|
-
errors: allErrors
|
|
140377
|
-
};
|
|
140378
139657
|
}
|
|
140379
139658
|
async pushSettings(config2) {
|
|
140380
139659
|
const projectsService = await getProjectsService(this.consoleClient);
|
|
@@ -140449,12 +139728,43 @@ var Push = class {
|
|
|
140449
139728
|
async pushBuckets(buckets) {
|
|
140450
139729
|
let successfullyPushed = 0;
|
|
140451
139730
|
const errors = [];
|
|
139731
|
+
const hasBucketChanges = (remoteBucket, localBucket) => {
|
|
139732
|
+
const scalarFields = [
|
|
139733
|
+
"name",
|
|
139734
|
+
"fileSecurity",
|
|
139735
|
+
"enabled",
|
|
139736
|
+
"maximumFileSize",
|
|
139737
|
+
"encryption",
|
|
139738
|
+
"antivirus",
|
|
139739
|
+
"compression"
|
|
139740
|
+
];
|
|
139741
|
+
if (scalarFields.some((field) => remoteBucket[field] !== localBucket[field])) {
|
|
139742
|
+
return true;
|
|
139743
|
+
}
|
|
139744
|
+
if (!arrayEqualsUnordered(
|
|
139745
|
+
remoteBucket["$permissions"],
|
|
139746
|
+
localBucket["$permissions"]
|
|
139747
|
+
)) {
|
|
139748
|
+
return true;
|
|
139749
|
+
}
|
|
139750
|
+
return !arrayEqualsUnordered(
|
|
139751
|
+
remoteBucket.allowedFileExtensions,
|
|
139752
|
+
localBucket.allowedFileExtensions
|
|
139753
|
+
);
|
|
139754
|
+
};
|
|
140452
139755
|
for (const bucket of buckets) {
|
|
140453
139756
|
try {
|
|
140454
139757
|
this.log(`Pushing bucket ${import_chalk11.default.bold(bucket["name"])} ...`);
|
|
140455
139758
|
const storageService = await getStorageService(this.projectClient);
|
|
140456
139759
|
try {
|
|
140457
|
-
await storageService.getBucket(bucket["$id"]);
|
|
139760
|
+
const remoteBucket = await storageService.getBucket(bucket["$id"]);
|
|
139761
|
+
const hasChanges = hasBucketChanges(remoteBucket, bucket);
|
|
139762
|
+
if (!hasChanges) {
|
|
139763
|
+
this.log(
|
|
139764
|
+
`No changes detected for bucket ${import_chalk11.default.bold(bucket["name"])}. Skipping.`
|
|
139765
|
+
);
|
|
139766
|
+
continue;
|
|
139767
|
+
}
|
|
140458
139768
|
await storageService.updateBucket({
|
|
140459
139769
|
bucketId: bucket["$id"],
|
|
140460
139770
|
name: bucket.name,
|
|
@@ -140467,6 +139777,7 @@ var Push = class {
|
|
|
140467
139777
|
antivirus: bucket.antivirus,
|
|
140468
139778
|
compression: bucket.compression
|
|
140469
139779
|
});
|
|
139780
|
+
successfullyPushed++;
|
|
140470
139781
|
} catch (e) {
|
|
140471
139782
|
if (e instanceof AppwriteException && Number(e.code) === 404) {
|
|
140472
139783
|
await storageService.createBucket({
|
|
@@ -140481,11 +139792,11 @@ var Push = class {
|
|
|
140481
139792
|
encryption: bucket.encryption,
|
|
140482
139793
|
antivirus: bucket.antivirus
|
|
140483
139794
|
});
|
|
139795
|
+
successfullyPushed++;
|
|
140484
139796
|
} else {
|
|
140485
139797
|
throw e;
|
|
140486
139798
|
}
|
|
140487
139799
|
}
|
|
140488
|
-
successfullyPushed++;
|
|
140489
139800
|
} catch (e) {
|
|
140490
139801
|
errors.push(e);
|
|
140491
139802
|
this.error(`Failed to push bucket ${bucket["name"]}: ${e.message}`);
|
|
@@ -141166,8 +140477,12 @@ var Push = class {
|
|
|
141166
140477
|
async pushTables(tables, options = {}) {
|
|
141167
140478
|
const { attempts, skipConfirmation = false } = options;
|
|
141168
140479
|
const pollMaxDebounces = attempts ?? POLL_DEFAULT_VALUE;
|
|
141169
|
-
const pools = new Pools(pollMaxDebounces);
|
|
141170
|
-
const attributes = new Attributes(
|
|
140480
|
+
const pools = new Pools(pollMaxDebounces, this.projectClient);
|
|
140481
|
+
const attributes = new Attributes(
|
|
140482
|
+
pools,
|
|
140483
|
+
skipConfirmation,
|
|
140484
|
+
this.projectClient
|
|
140485
|
+
);
|
|
141171
140486
|
let tablesChanged = /* @__PURE__ */ new Set();
|
|
141172
140487
|
const errors = [];
|
|
141173
140488
|
await Promise.all(
|
|
@@ -141242,6 +140557,11 @@ var Push = class {
|
|
|
141242
140557
|
indexes = indexesResult.attributes;
|
|
141243
140558
|
hadChanges = columnsResult.hasChanges || indexesResult.hasChanges;
|
|
141244
140559
|
if (!hadChanges && columns.length <= 0 && indexes.length <= 0) {
|
|
140560
|
+
if (!tablesChanged.has(table["$id"])) {
|
|
140561
|
+
this.log(
|
|
140562
|
+
`No changes detected for table ${import_chalk11.default.bold(table["name"])}. Skipping.`
|
|
140563
|
+
);
|
|
140564
|
+
}
|
|
141245
140565
|
continue;
|
|
141246
140566
|
}
|
|
141247
140567
|
}
|
|
@@ -141270,8 +140590,12 @@ var Push = class {
|
|
|
141270
140590
|
}
|
|
141271
140591
|
async pushCollections(collections, options = {}) {
|
|
141272
140592
|
const { skipConfirmation = false } = options;
|
|
141273
|
-
const pools = new Pools(POLL_DEFAULT_VALUE);
|
|
141274
|
-
const attributesHelper = new Attributes(
|
|
140593
|
+
const pools = new Pools(POLL_DEFAULT_VALUE, this.projectClient);
|
|
140594
|
+
const attributesHelper = new Attributes(
|
|
140595
|
+
pools,
|
|
140596
|
+
skipConfirmation,
|
|
140597
|
+
this.projectClient
|
|
140598
|
+
);
|
|
141275
140599
|
const errors = [];
|
|
141276
140600
|
const collectionsWithState = collections;
|
|
141277
140601
|
const databases2 = Array.from(
|
|
@@ -141414,8 +140738,8 @@ async function createPushInstance(options = {
|
|
|
141414
140738
|
}) {
|
|
141415
140739
|
const { silent, requiresConsoleAuth } = options;
|
|
141416
140740
|
const projectClient2 = await sdkForProject();
|
|
141417
|
-
const
|
|
141418
|
-
return new Push(projectClient2,
|
|
140741
|
+
const consoleClient = await sdkForConsole(requiresConsoleAuth);
|
|
140742
|
+
return new Push(projectClient2, consoleClient, silent);
|
|
141419
140743
|
}
|
|
141420
140744
|
var pushResources = async ({
|
|
141421
140745
|
skipDeprecated = false
|
|
@@ -141959,10 +141283,11 @@ var pushCollection = async () => {
|
|
|
141959
141283
|
const localDatabase = localConfig.getDatabase(collection.databaseId);
|
|
141960
141284
|
collection.databaseName = localDatabase.name ?? collection.databaseId;
|
|
141961
141285
|
});
|
|
141286
|
+
const projectClient2 = await sdkForProject();
|
|
141962
141287
|
if (!await approveChanges(
|
|
141963
141288
|
collections,
|
|
141964
141289
|
async (args) => {
|
|
141965
|
-
const databasesService = await getDatabasesService();
|
|
141290
|
+
const databasesService = await getDatabasesService(projectClient2);
|
|
141966
141291
|
return await databasesService.getCollection(
|
|
141967
141292
|
args.databaseId,
|
|
141968
141293
|
args.collectionId
|
|
@@ -142465,7 +141790,13 @@ var BaseDatabasesGenerator = class {
|
|
|
142465
141790
|
if (!fs15.existsSync(sdkDir)) {
|
|
142466
141791
|
fs15.mkdirSync(sdkDir, { recursive: true });
|
|
142467
141792
|
}
|
|
142468
|
-
|
|
141793
|
+
const fileEntries = [
|
|
141794
|
+
["databases.ts", result.dbContent],
|
|
141795
|
+
["types.ts", result.typesContent],
|
|
141796
|
+
["index.ts", result.indexContent],
|
|
141797
|
+
["constants.ts", result.constantsContent]
|
|
141798
|
+
];
|
|
141799
|
+
for (const [relativePath, content] of fileEntries) {
|
|
142469
141800
|
const filePath = path14.join(sdkDir, relativePath);
|
|
142470
141801
|
const fileDir = path14.dirname(filePath);
|
|
142471
141802
|
if (!fs15.existsSync(fileDir)) {
|
|
@@ -142477,10 +141808,13 @@ var BaseDatabasesGenerator = class {
|
|
|
142477
141808
|
fs15.writeFileSync(filePath, content, "utf-8");
|
|
142478
141809
|
}
|
|
142479
141810
|
}
|
|
142480
|
-
getGeneratedFilePaths(
|
|
142481
|
-
return
|
|
142482
|
-
|
|
142483
|
-
|
|
141811
|
+
getGeneratedFilePaths(_result) {
|
|
141812
|
+
return [
|
|
141813
|
+
path14.join(SDK_TITLE_LOWER, "databases.ts"),
|
|
141814
|
+
path14.join(SDK_TITLE_LOWER, "types.ts"),
|
|
141815
|
+
path14.join(SDK_TITLE_LOWER, "index.ts"),
|
|
141816
|
+
path14.join(SDK_TITLE_LOWER, "constants.ts")
|
|
141817
|
+
];
|
|
142484
141818
|
}
|
|
142485
141819
|
};
|
|
142486
141820
|
|
|
@@ -142807,29 +142141,24 @@ ${supportsServerSide ? ` create: (databaseId: string, name: string, options?: {
|
|
|
142807
142141
|
throw new Error("Project ID is required in configuration");
|
|
142808
142142
|
}
|
|
142809
142143
|
const importExt = detectImportExtension();
|
|
142810
|
-
const files = /* @__PURE__ */ new Map();
|
|
142811
142144
|
const hasEntities = config2.tables && config2.tables.length > 0 || config2.collections && config2.collections.length > 0;
|
|
142812
142145
|
if (!hasEntities) {
|
|
142813
142146
|
console.log(
|
|
142814
142147
|
"No tables or collections found in configuration. Skipping database generation."
|
|
142815
142148
|
);
|
|
142816
|
-
|
|
142817
|
-
"
|
|
142818
|
-
"// No tables or collections found in configuration\n"
|
|
142819
|
-
|
|
142820
|
-
|
|
142821
|
-
|
|
142822
|
-
"// No tables or collections found in configuration\n"
|
|
142823
|
-
);
|
|
142824
|
-
files.set("index.ts", this.generateIndexFile(importExt));
|
|
142825
|
-
files.set("constants.ts", this.generateConstantsFile(config2));
|
|
142826
|
-
return { files };
|
|
142149
|
+
return {
|
|
142150
|
+
dbContent: "// No tables or collections found in configuration\n",
|
|
142151
|
+
typesContent: "// No tables or collections found in configuration\n",
|
|
142152
|
+
indexContent: this.generateIndexFile(importExt),
|
|
142153
|
+
constantsContent: this.generateConstantsFile(config2)
|
|
142154
|
+
};
|
|
142827
142155
|
}
|
|
142828
|
-
|
|
142829
|
-
|
|
142830
|
-
|
|
142831
|
-
|
|
142832
|
-
|
|
142156
|
+
return {
|
|
142157
|
+
dbContent: this.generateDatabasesFile(config2, importExt),
|
|
142158
|
+
typesContent: this.generateTypesFile(config2),
|
|
142159
|
+
indexContent: this.generateIndexFile(importExt),
|
|
142160
|
+
constantsContent: this.generateConstantsFile(config2)
|
|
142161
|
+
};
|
|
142833
142162
|
}
|
|
142834
142163
|
};
|
|
142835
142164
|
|
|
@@ -143024,6 +142353,36 @@ account.command(`delete`).description(`Delete the currently logged in user.`).ac
|
|
|
143024
142353
|
async () => parse3(await (await getAccountClient()).delete())
|
|
143025
142354
|
)
|
|
143026
142355
|
);
|
|
142356
|
+
account.command(`list-billing-addresses`).description(`List all billing addresses for a user.`).option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, expired, failed`).action(
|
|
142357
|
+
actionRunner(
|
|
142358
|
+
async ({ queries }) => parse3(await (await getAccountClient()).listBillingAddresses(queries))
|
|
142359
|
+
)
|
|
142360
|
+
);
|
|
142361
|
+
account.command(`create-billing-address`).description(`Add a new billing address to a user's account.`).requiredOption(`--country <country>`, `Country`).requiredOption(`--city <city>`, `City`).requiredOption(`--street-address <street-address>`, `Street address`).option(`--address-line-2 <address-line-2>`, `Address line 2`).option(`--state <state>`, `State or province`).option(`--postal-code <postal-code>`, `Postal code`).action(
|
|
142362
|
+
actionRunner(
|
|
142363
|
+
async ({ country, city, streetAddress, addressLine2, state, postalCode }) => parse3(await (await getAccountClient()).createBillingAddress(country, city, streetAddress, addressLine2, state, postalCode))
|
|
142364
|
+
)
|
|
142365
|
+
);
|
|
142366
|
+
account.command(`get-billing-address`).description(`Get a specific billing address for a user using it's ID.`).requiredOption(`--billing-address-id <billing-address-id>`, `Unique ID of billing address`).action(
|
|
142367
|
+
actionRunner(
|
|
142368
|
+
async ({ billingAddressId }) => parse3(await (await getAccountClient()).getBillingAddress(billingAddressId))
|
|
142369
|
+
)
|
|
142370
|
+
);
|
|
142371
|
+
account.command(`update-billing-address`).description(`Update a specific billing address using it's ID.`).requiredOption(`--billing-address-id <billing-address-id>`, `Unique ID of billing address`).requiredOption(`--country <country>`, `Country`).requiredOption(`--city <city>`, `City`).requiredOption(`--street-address <street-address>`, `Street address`).option(`--address-line-2 <address-line-2>`, `Address line 2`).option(`--state <state>`, `State or province`).option(`--postal-code <postal-code>`, `Postal code`).action(
|
|
142372
|
+
actionRunner(
|
|
142373
|
+
async ({ billingAddressId, country, city, streetAddress, addressLine2, state, postalCode }) => parse3(await (await getAccountClient()).updateBillingAddress(billingAddressId, country, city, streetAddress, addressLine2, state, postalCode))
|
|
142374
|
+
)
|
|
142375
|
+
);
|
|
142376
|
+
account.command(`delete-billing-address`).description(`Delete a specific billing address using it's ID.`).requiredOption(`--billing-address-id <billing-address-id>`, `Billing address unique ID`).action(
|
|
142377
|
+
actionRunner(
|
|
142378
|
+
async ({ billingAddressId }) => parse3(await (await getAccountClient()).deleteBillingAddress(billingAddressId))
|
|
142379
|
+
)
|
|
142380
|
+
);
|
|
142381
|
+
account.command(`get-coupon`).description(`Get coupon details for an account.`).requiredOption(`--coupon-id <coupon-id>`, `ID of the coupon`).action(
|
|
142382
|
+
actionRunner(
|
|
142383
|
+
async ({ couponId }) => parse3(await (await getAccountClient()).getCoupon(couponId))
|
|
142384
|
+
)
|
|
142385
|
+
);
|
|
143027
142386
|
account.command(`update-email`).description(`Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.
|
|
143028
142387
|
This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.
|
|
143029
142388
|
`).requiredOption(`--email <email>`, `User email.`).requiredOption(`--password <password>`, `User password. Must be at least 8 chars.`).action(
|
|
@@ -143045,11 +142404,45 @@ account.command(`delete-identity`).description(`Delete an identity by its unique
|
|
|
143045
142404
|
async ({ identityId }) => parse3(await (await getAccountClient()).deleteIdentity(identityId))
|
|
143046
142405
|
)
|
|
143047
142406
|
);
|
|
142407
|
+
account.command(`list-invoices`).description(`List all invoices tied to an account.`).option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: teamId, aggregationId, amount, currency, from, to, dueAt, attempts, status, grossAmount`).action(
|
|
142408
|
+
actionRunner(
|
|
142409
|
+
async ({ queries }) => parse3(await (await getAccountClient()).listInvoices(queries))
|
|
142410
|
+
)
|
|
142411
|
+
);
|
|
143048
142412
|
account.command(`create-jwt`).description(`Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.`).option(`--duration <duration>`, `Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.`, parseInteger).action(
|
|
143049
142413
|
actionRunner(
|
|
143050
142414
|
async ({ duration: duration3 }) => parse3(await (await getAccountClient()).createJWT(duration3))
|
|
143051
142415
|
)
|
|
143052
142416
|
);
|
|
142417
|
+
account.command(`list-keys`).description(`Get a list of all API keys from the current account. `).option(
|
|
142418
|
+
`--total [value]`,
|
|
142419
|
+
`When set to false, the total count returned will be 0 and will not be calculated.`,
|
|
142420
|
+
(value) => value === void 0 ? true : parseBool(value)
|
|
142421
|
+
).action(
|
|
142422
|
+
actionRunner(
|
|
142423
|
+
async ({ total }) => parse3(await (await getAccountClient()).listKeys(total))
|
|
142424
|
+
)
|
|
142425
|
+
);
|
|
142426
|
+
account.command(`create-key`).description(`Create a new account API key.`).requiredOption(`--name <name>`, `Key name. Max length: 128 chars.`).requiredOption(`--scopes [scopes...]`, `Key scopes list. Maximum of 100 scopes are allowed.`).option(`--expire <expire>`, `Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.`).action(
|
|
142427
|
+
actionRunner(
|
|
142428
|
+
async ({ name, scopes, expire }) => parse3(await (await getAccountClient()).createKey(name, scopes, expire))
|
|
142429
|
+
)
|
|
142430
|
+
);
|
|
142431
|
+
account.command(`get-key`).description(`Get a key by its unique ID. This endpoint returns details about a specific API key in your account including it's scopes.`).requiredOption(`--key-id <key-id>`, `Key unique ID.`).action(
|
|
142432
|
+
actionRunner(
|
|
142433
|
+
async ({ keyId }) => parse3(await (await getAccountClient()).getKey(keyId))
|
|
142434
|
+
)
|
|
142435
|
+
);
|
|
142436
|
+
account.command(`update-key`).description(`Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key.`).requiredOption(`--key-id <key-id>`, `Key unique ID.`).requiredOption(`--name <name>`, `Key name. Max length: 128 chars.`).requiredOption(`--scopes [scopes...]`, `Key scopes list. Maximum of 100 scopes are allowed.`).option(`--expire <expire>`, `Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.`).action(
|
|
142437
|
+
actionRunner(
|
|
142438
|
+
async ({ keyId, name, scopes, expire }) => parse3(await (await getAccountClient()).updateKey(keyId, name, scopes, expire))
|
|
142439
|
+
)
|
|
142440
|
+
);
|
|
142441
|
+
account.command(`delete-key`).description(`Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls.`).requiredOption(`--key-id <key-id>`, `Key unique ID.`).action(
|
|
142442
|
+
actionRunner(
|
|
142443
|
+
async ({ keyId }) => parse3(await (await getAccountClient()).deleteKey(keyId))
|
|
142444
|
+
)
|
|
142445
|
+
);
|
|
143053
142446
|
account.command(`list-logs`).description(`Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log.`).option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset`).option(
|
|
143054
142447
|
`--total [value]`,
|
|
143055
142448
|
`When set to false, the total count returned will be 0 and will not be calculated.`,
|
|
@@ -143119,6 +142512,41 @@ account.command(`update-password`).description(`Update currently logged in user
|
|
|
143119
142512
|
async ({ password, oldPassword }) => parse3(await (await getAccountClient()).updatePassword(password, oldPassword))
|
|
143120
142513
|
)
|
|
143121
142514
|
);
|
|
142515
|
+
account.command(`list-payment-methods`).description(`List payment methods for this account.`).option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, expired, failed`).action(
|
|
142516
|
+
actionRunner(
|
|
142517
|
+
async ({ queries }) => parse3(await (await getAccountClient()).listPaymentMethods(queries))
|
|
142518
|
+
)
|
|
142519
|
+
);
|
|
142520
|
+
account.command(`create-payment-method`).description(`Create a new payment method for the current user account.`).action(
|
|
142521
|
+
actionRunner(
|
|
142522
|
+
async () => parse3(await (await getAccountClient()).createPaymentMethod())
|
|
142523
|
+
)
|
|
142524
|
+
);
|
|
142525
|
+
account.command(`get-payment-method`).description(`Get a specific payment method for the user.`).requiredOption(`--payment-method-id <payment-method-id>`, `Unique ID of payment method`).action(
|
|
142526
|
+
actionRunner(
|
|
142527
|
+
async ({ paymentMethodId }) => parse3(await (await getAccountClient()).getPaymentMethod(paymentMethodId))
|
|
142528
|
+
)
|
|
142529
|
+
);
|
|
142530
|
+
account.command(`update-payment-method`).description(`Update a new payment method for the current user account.`).requiredOption(`--payment-method-id <payment-method-id>`, `Unique ID of payment method`).requiredOption(`--expiry-month <expiry-month>`, `Payment expiry month`, parseInteger).requiredOption(`--expiry-year <expiry-year>`, `Expiry year`, parseInteger).option(`--state <state>`, `State of the payment method country`).action(
|
|
142531
|
+
actionRunner(
|
|
142532
|
+
async ({ paymentMethodId, expiryMonth, expiryYear, state }) => parse3(await (await getAccountClient()).updatePaymentMethod(paymentMethodId, expiryMonth, expiryYear, state))
|
|
142533
|
+
)
|
|
142534
|
+
);
|
|
142535
|
+
account.command(`delete-payment-method`).description(`Delete a specific payment method from a user's account.`).requiredOption(`--payment-method-id <payment-method-id>`, `Unique ID of payment method`).action(
|
|
142536
|
+
actionRunner(
|
|
142537
|
+
async ({ paymentMethodId }) => parse3(await (await getAccountClient()).deletePaymentMethod(paymentMethodId))
|
|
142538
|
+
)
|
|
142539
|
+
);
|
|
142540
|
+
account.command(`update-payment-method-provider`).description(`Update payment method provider.`).requiredOption(`--payment-method-id <payment-method-id>`, `Unique ID of payment method`).requiredOption(`--provider-method-id <provider-method-id>`, `Payment method ID from the payment provider`).requiredOption(`--name <name>`, `Name in the payment method`).option(`--state <state>`, `State of the payment method country`).action(
|
|
142541
|
+
actionRunner(
|
|
142542
|
+
async ({ paymentMethodId, providerMethodId, name, state }) => parse3(await (await getAccountClient()).updatePaymentMethodProvider(paymentMethodId, providerMethodId, name, state))
|
|
142543
|
+
)
|
|
142544
|
+
);
|
|
142545
|
+
account.command(`update-payment-method-mandate-options`).description(`Update payment method mandate options.`).requiredOption(`--payment-method-id <payment-method-id>`, `Unique ID of payment method`).action(
|
|
142546
|
+
actionRunner(
|
|
142547
|
+
async ({ paymentMethodId }) => parse3(await (await getAccountClient()).updatePaymentMethodMandateOptions(paymentMethodId))
|
|
142548
|
+
)
|
|
142549
|
+
);
|
|
143122
142550
|
account.command(`update-phone`).description(`Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification) endpoint to send a confirmation SMS.`).requiredOption(`--phone <phone>`, `Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`).requiredOption(`--password <password>`, `User password. Must be at least 8 chars.`).action(
|
|
143123
142551
|
actionRunner(
|
|
143124
142552
|
async ({ phone, password }) => parse3(await (await getAccountClient()).updatePhone(phone, password))
|
|
@@ -143180,8 +142608,8 @@ If there is already an active session, the new session will be attached to the l
|
|
|
143180
142608
|
A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
|
|
143181
142609
|
`).requiredOption(`--provider <provider>`, `OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.`).option(`--success <success>`, `URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.`).option(`--failure <failure>`, `URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.`).option(`--scopes [scopes...]`, `A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.`).action(
|
|
143182
142610
|
actionRunner(
|
|
143183
|
-
async ({ provider, success:
|
|
143184
|
-
const url2 = (await getAccountClient()).createOAuth2Session(provider,
|
|
142611
|
+
async ({ provider, success: success20, failure, scopes }) => {
|
|
142612
|
+
const url2 = (await getAccountClient()).createOAuth2Session(provider, success20, failure, scopes);
|
|
143185
142613
|
if (url2) console.log(url2);
|
|
143186
142614
|
}
|
|
143187
142615
|
)
|
|
@@ -143261,8 +142689,8 @@ If authentication succeeds, \`userId\` and \`secret\` of a token will be appende
|
|
|
143261
142689
|
|
|
143262
142690
|
A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).`).requiredOption(`--provider <provider>`, `OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.`).option(`--success <success>`, `URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.`).option(`--failure <failure>`, `URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.`).option(`--scopes [scopes...]`, `A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.`).action(
|
|
143263
142691
|
actionRunner(
|
|
143264
|
-
async ({ provider, success:
|
|
143265
|
-
const url2 = (await getAccountClient()).createOAuth2Token(provider,
|
|
142692
|
+
async ({ provider, success: success20, failure, scopes }) => {
|
|
142693
|
+
const url2 = (await getAccountClient()).createOAuth2Token(provider, success20, failure, scopes);
|
|
143266
142694
|
if (url2) console.log(url2);
|
|
143267
142695
|
}
|
|
143268
142696
|
)
|
|
@@ -143311,26 +142739,108 @@ account.command(`update-phone-verification`).description(`Use this endpoint to c
|
|
|
143311
142739
|
)
|
|
143312
142740
|
);
|
|
143313
142741
|
|
|
143314
|
-
// lib/commands/services/
|
|
143315
|
-
var
|
|
143316
|
-
var
|
|
143317
|
-
if (!
|
|
142742
|
+
// lib/commands/services/activities.ts
|
|
142743
|
+
var activitiesClient = null;
|
|
142744
|
+
var getActivitiesClient = async () => {
|
|
142745
|
+
if (!activitiesClient) {
|
|
142746
|
+
const sdkClient = await sdkForProject();
|
|
142747
|
+
activitiesClient = new Activities(sdkClient);
|
|
142748
|
+
}
|
|
142749
|
+
return activitiesClient;
|
|
142750
|
+
};
|
|
142751
|
+
var activities = new Command("activities").description(commandDescriptions["activities"] ?? "").configureHelp({
|
|
142752
|
+
helpWidth: process.stdout.columns || 80
|
|
142753
|
+
});
|
|
142754
|
+
activities.command(`list-events`).description(`List all events for selected filters.`).option(`--queries <queries>`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on attributes such as userId, teamId, etc.`).action(
|
|
142755
|
+
actionRunner(
|
|
142756
|
+
async ({ queries }) => parse3(await (await getActivitiesClient()).listEvents(queries))
|
|
142757
|
+
)
|
|
142758
|
+
);
|
|
142759
|
+
activities.command(`get-event`).description(`Get event by ID.
|
|
142760
|
+
`).requiredOption(`--event-id <event-id>`, `Event ID.`).action(
|
|
142761
|
+
actionRunner(
|
|
142762
|
+
async ({ eventId }) => parse3(await (await getActivitiesClient()).getEvent(eventId))
|
|
142763
|
+
)
|
|
142764
|
+
);
|
|
142765
|
+
|
|
142766
|
+
// lib/commands/services/backups.ts
|
|
142767
|
+
var backupsClient = null;
|
|
142768
|
+
var getBackupsClient = async () => {
|
|
142769
|
+
if (!backupsClient) {
|
|
143318
142770
|
const sdkClient = await sdkForProject();
|
|
143319
|
-
|
|
142771
|
+
backupsClient = new Backups(sdkClient);
|
|
143320
142772
|
}
|
|
143321
|
-
return
|
|
142773
|
+
return backupsClient;
|
|
143322
142774
|
};
|
|
143323
|
-
var
|
|
142775
|
+
var backups = new Command("backups").description(commandDescriptions["backups"] ?? "").configureHelp({
|
|
143324
142776
|
helpWidth: process.stdout.columns || 80
|
|
143325
142777
|
});
|
|
143326
|
-
|
|
142778
|
+
backups.command(`list-archives`).description(`List all archives for a project.`).option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.`).action(
|
|
142779
|
+
actionRunner(
|
|
142780
|
+
async ({ queries }) => parse3(await (await getBackupsClient()).listArchives(queries))
|
|
142781
|
+
)
|
|
142782
|
+
);
|
|
142783
|
+
backups.command(`create-archive`).description(`Create a new archive asynchronously for a project.`).requiredOption(`--services [services...]`, `Array of services to backup`).option(`--resource-id <resource-id>`, `Resource ID. When set, only this single resource will be backed up.`).action(
|
|
142784
|
+
actionRunner(
|
|
142785
|
+
async ({ services, resourceId }) => parse3(await (await getBackupsClient()).createArchive(services, resourceId))
|
|
142786
|
+
)
|
|
142787
|
+
);
|
|
142788
|
+
backups.command(`get-archive`).description(`Get a backup archive using it's ID.`).requiredOption(`--archive-id <archive-id>`, `Archive ID. Choose a custom ID\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`).action(
|
|
142789
|
+
actionRunner(
|
|
142790
|
+
async ({ archiveId }) => parse3(await (await getBackupsClient()).getArchive(archiveId))
|
|
142791
|
+
)
|
|
142792
|
+
);
|
|
142793
|
+
backups.command(`delete-archive`).description(`Delete an existing archive for a project.`).requiredOption(`--archive-id <archive-id>`, `Policy ID. Choose a custom ID or generate a random ID with \`ID.unique()\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`).action(
|
|
142794
|
+
actionRunner(
|
|
142795
|
+
async ({ archiveId }) => parse3(await (await getBackupsClient()).deleteArchive(archiveId))
|
|
142796
|
+
)
|
|
142797
|
+
);
|
|
142798
|
+
backups.command(`list-policies`).description(`List all policies for a project.`).option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.`).action(
|
|
142799
|
+
actionRunner(
|
|
142800
|
+
async ({ queries }) => parse3(await (await getBackupsClient()).listPolicies(queries))
|
|
142801
|
+
)
|
|
142802
|
+
);
|
|
142803
|
+
backups.command(`create-policy`).description(`Create a new backup policy.`).requiredOption(`--policy-id <policy-id>`, `Policy ID. Choose a custom ID or generate a random ID with \`ID.unique()\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`).requiredOption(`--services [services...]`, `Array of services to backup`).requiredOption(`--retention <retention>`, `Days to keep backups before deletion`, parseInteger).requiredOption(`--schedule <schedule>`, `Schedule CRON syntax.`).option(`--name <name>`, `Policy name. Max length: 128 chars.`).option(`--resource-id <resource-id>`, `Resource ID. When set, only this single resource will be backed up.`).option(
|
|
142804
|
+
`--enabled [value]`,
|
|
142805
|
+
`Is policy enabled? When set to 'disabled', no backups will be taken`,
|
|
142806
|
+
(value) => value === void 0 ? true : parseBool(value)
|
|
142807
|
+
).action(
|
|
143327
142808
|
actionRunner(
|
|
143328
|
-
async ({
|
|
142809
|
+
async ({ policyId, services, retention, schedule, name, resourceId, enabled }) => parse3(await (await getBackupsClient()).createPolicy(policyId, services, retention, schedule, name, resourceId, enabled))
|
|
143329
142810
|
)
|
|
143330
142811
|
);
|
|
143331
|
-
|
|
142812
|
+
backups.command(`get-policy`).description(`Get a backup policy using it's ID.`).requiredOption(`--policy-id <policy-id>`, `Policy ID. Choose a custom ID\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`).action(
|
|
142813
|
+
actionRunner(
|
|
142814
|
+
async ({ policyId }) => parse3(await (await getBackupsClient()).getPolicy(policyId))
|
|
142815
|
+
)
|
|
142816
|
+
);
|
|
142817
|
+
backups.command(`update-policy`).description(`Update an existing policy using it's ID.`).requiredOption(`--policy-id <policy-id>`, `Policy ID. Choose a custom ID\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`).option(`--name <name>`, `Policy name. Max length: 128 chars.`).option(`--retention <retention>`, `Days to keep backups before deletion`, parseInteger).option(`--schedule <schedule>`, `Cron expression`).option(
|
|
142818
|
+
`--enabled [value]`,
|
|
142819
|
+
`Is Backup enabled? When set to 'disabled', No backup will be taken`,
|
|
142820
|
+
(value) => value === void 0 ? true : parseBool(value)
|
|
142821
|
+
).action(
|
|
143332
142822
|
actionRunner(
|
|
143333
|
-
async () => parse3(await (await
|
|
142823
|
+
async ({ policyId, name, retention, schedule, enabled }) => parse3(await (await getBackupsClient()).updatePolicy(policyId, name, retention, schedule, enabled))
|
|
142824
|
+
)
|
|
142825
|
+
);
|
|
142826
|
+
backups.command(`delete-policy`).description(`Delete a policy using it's ID.`).requiredOption(`--policy-id <policy-id>`, `Policy ID. Choose a custom ID or generate a random ID with \`ID.unique()\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`).action(
|
|
142827
|
+
actionRunner(
|
|
142828
|
+
async ({ policyId }) => parse3(await (await getBackupsClient()).deletePolicy(policyId))
|
|
142829
|
+
)
|
|
142830
|
+
);
|
|
142831
|
+
backups.command(`create-restoration`).description(`Create and trigger a new restoration for a backup on a project.`).requiredOption(`--archive-id <archive-id>`, `Backup archive ID to restore`).requiredOption(`--services [services...]`, `Array of services to restore`).option(`--new-resource-id <new-resource-id>`, `Unique Id. Choose a custom ID or generate a random ID with \`ID.unique()\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`).option(`--new-resource-name <new-resource-name>`, `Database name. Max length: 128 chars.`).action(
|
|
142832
|
+
actionRunner(
|
|
142833
|
+
async ({ archiveId, services, newResourceId, newResourceName }) => parse3(await (await getBackupsClient()).createRestoration(archiveId, services, newResourceId, newResourceName))
|
|
142834
|
+
)
|
|
142835
|
+
);
|
|
142836
|
+
backups.command(`list-restorations`).description(`List all backup restorations for a project.`).option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.`).action(
|
|
142837
|
+
actionRunner(
|
|
142838
|
+
async ({ queries }) => parse3(await (await getBackupsClient()).listRestorations(queries))
|
|
142839
|
+
)
|
|
142840
|
+
);
|
|
142841
|
+
backups.command(`get-restoration`).description(`Get the current status of a backup restoration.`).requiredOption(`--restoration-id <restoration-id>`, `Restoration ID. Choose a custom ID\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`).action(
|
|
142842
|
+
actionRunner(
|
|
142843
|
+
async ({ restorationId }) => parse3(await (await getBackupsClient()).getRestoration(restorationId))
|
|
143334
142844
|
)
|
|
143335
142845
|
);
|
|
143336
142846
|
|
|
@@ -144190,11 +143700,26 @@ health.command(`get-queue-audits`).description(`Get the number of audit logs tha
|
|
|
144190
143700
|
async ({ threshold }) => parse3(await (await getHealthClient()).getQueueAudits(threshold))
|
|
144191
143701
|
)
|
|
144192
143702
|
);
|
|
143703
|
+
health.command(`get-queue-billing-project-aggregation`).description(`Get billing project aggregation queue.`).option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger).action(
|
|
143704
|
+
actionRunner(
|
|
143705
|
+
async ({ threshold }) => parse3(await (await getHealthClient()).getQueueBillingProjectAggregation(threshold))
|
|
143706
|
+
)
|
|
143707
|
+
);
|
|
143708
|
+
health.command(`get-queue-billing-team-aggregation`).description(`Get billing team aggregation queue.`).option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger).action(
|
|
143709
|
+
actionRunner(
|
|
143710
|
+
async ({ threshold }) => parse3(await (await getHealthClient()).getQueueBillingTeamAggregation(threshold))
|
|
143711
|
+
)
|
|
143712
|
+
);
|
|
144193
143713
|
health.command(`get-queue-builds`).description(`Get the number of builds that are waiting to be processed in the Appwrite internal queue server.`).option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger).action(
|
|
144194
143714
|
actionRunner(
|
|
144195
143715
|
async ({ threshold }) => parse3(await (await getHealthClient()).getQueueBuilds(threshold))
|
|
144196
143716
|
)
|
|
144197
143717
|
);
|
|
143718
|
+
health.command(`get-queue-priority-builds`).description(`Get the priority builds queue size.`).option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 500.`, parseInteger).action(
|
|
143719
|
+
actionRunner(
|
|
143720
|
+
async ({ threshold }) => parse3(await (await getHealthClient()).getQueuePriorityBuilds(threshold))
|
|
143721
|
+
)
|
|
143722
|
+
);
|
|
144198
143723
|
health.command(`get-queue-certificates`).description(`Get the number of certificates that are waiting to be issued against [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue server.`).option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger).action(
|
|
144199
143724
|
actionRunner(
|
|
144200
143725
|
async ({ threshold }) => parse3(await (await getHealthClient()).getQueueCertificates(threshold))
|
|
@@ -144241,6 +143766,11 @@ health.command(`get-queue-migrations`).description(`Get the number of migrations
|
|
|
144241
143766
|
async ({ threshold }) => parse3(await (await getHealthClient()).getQueueMigrations(threshold))
|
|
144242
143767
|
)
|
|
144243
143768
|
);
|
|
143769
|
+
health.command(`get-queue-region-manager`).description(`Get region manager queue.`).option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 100.`, parseInteger).action(
|
|
143770
|
+
actionRunner(
|
|
143771
|
+
async ({ threshold }) => parse3(await (await getHealthClient()).getQueueRegionManager(threshold))
|
|
143772
|
+
)
|
|
143773
|
+
);
|
|
144244
143774
|
health.command(`get-queue-stats-resources`).description(`Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue.`).option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger).action(
|
|
144245
143775
|
actionRunner(
|
|
144246
143776
|
async ({ threshold }) => parse3(await (await getHealthClient()).getQueueStatsResources(threshold))
|
|
@@ -144251,6 +143781,11 @@ health.command(`get-queue-usage`).description(`Get the number of metrics that ar
|
|
|
144251
143781
|
async ({ threshold }) => parse3(await (await getHealthClient()).getQueueUsage(threshold))
|
|
144252
143782
|
)
|
|
144253
143783
|
);
|
|
143784
|
+
health.command(`get-queue-threats`).description(`Get threats queue.`).option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 100.`, parseInteger).action(
|
|
143785
|
+
actionRunner(
|
|
143786
|
+
async ({ threshold }) => parse3(await (await getHealthClient()).getQueueThreats(threshold))
|
|
143787
|
+
)
|
|
143788
|
+
);
|
|
144254
143789
|
health.command(`get-queue-webhooks`).description(`Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.`).option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger).action(
|
|
144255
143790
|
actionRunner(
|
|
144256
143791
|
async ({ threshold }) => parse3(await (await getHealthClient()).getQueueWebhooks(threshold))
|
|
@@ -144796,7 +144331,7 @@ var getMigrationsClient = async () => {
|
|
|
144796
144331
|
var migrations = new Command("migrations").description(commandDescriptions["migrations"] ?? "").configureHelp({
|
|
144797
144332
|
helpWidth: process.stdout.columns || 80
|
|
144798
144333
|
});
|
|
144799
|
-
migrations.command(`list`).description(`List all migrations in the current project. This endpoint returns a list of all migrations including their status, progress, and any errors that occurred during the migration process.`).option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, stage, source, destination, resources, statusCounters, resourceData, errors`).option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`).option(
|
|
144334
|
+
migrations.command(`list`).description(`List all migrations in the current project. This endpoint returns a list of all migrations including their status, progress, and any errors that occurred during the migration process.`).option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, stage, source, destination, resources, resourceId, resourceType, statusCounters, resourceData, errors`).option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`).option(
|
|
144800
144335
|
`--total [value]`,
|
|
144801
144336
|
`When set to false, the total count returned will be 0 and will not be calculated.`,
|
|
144802
144337
|
(value) => value === void 0 ? true : parseBool(value)
|
|
@@ -145142,6 +144677,29 @@ projects.command(`delete-platform`).description(`Delete a platform by its unique
|
|
|
145142
144677
|
async ({ projectId, platformId }) => parse3(await (await getProjectsClient()).deletePlatform(projectId, platformId))
|
|
145143
144678
|
)
|
|
145144
144679
|
);
|
|
144680
|
+
projects.command(`list-schedules`).description(`Get a list of all the project's schedules. You can use the query params to filter your results.`).requiredOption(`--project-id <project-id>`, `Project unique ID.`).option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: resourceType, resourceId, projectId, schedule, active, region`).option(
|
|
144681
|
+
`--total [value]`,
|
|
144682
|
+
`When set to false, the total count returned will be 0 and will not be calculated.`,
|
|
144683
|
+
(value) => value === void 0 ? true : parseBool(value)
|
|
144684
|
+
).action(
|
|
144685
|
+
actionRunner(
|
|
144686
|
+
async ({ projectId, queries, total }) => parse3(await (await getProjectsClient()).listSchedules(projectId, queries, total))
|
|
144687
|
+
)
|
|
144688
|
+
);
|
|
144689
|
+
projects.command(`create-schedule`).description(`Create a new schedule for a resource.`).requiredOption(`--project-id <project-id>`, `Project unique ID.`).requiredOption(`--resource-type <resource-type>`, `The resource type for the schedule. Possible values: function, execution, message, backup.`).requiredOption(`--resource-id <resource-id>`, `The resource ID to associate with this schedule.`).requiredOption(`--schedule <schedule>`, `Schedule CRON expression.`).option(
|
|
144690
|
+
`--active [value]`,
|
|
144691
|
+
`Whether the schedule is active.`,
|
|
144692
|
+
(value) => value === void 0 ? true : parseBool(value)
|
|
144693
|
+
).option(`--data <data>`, `Schedule data as a JSON string. Used to store resource-specific context needed for execution.`).action(
|
|
144694
|
+
actionRunner(
|
|
144695
|
+
async ({ projectId, resourceType, resourceId, schedule, active, data }) => parse3(await (await getProjectsClient()).createSchedule(projectId, resourceType, resourceId, schedule, active, JSON.parse(data)))
|
|
144696
|
+
)
|
|
144697
|
+
);
|
|
144698
|
+
projects.command(`get-schedule`).description(`Get a schedule by its unique ID.`).requiredOption(`--project-id <project-id>`, `Project unique ID.`).requiredOption(`--schedule-id <schedule-id>`, `Schedule ID.`).action(
|
|
144699
|
+
actionRunner(
|
|
144700
|
+
async ({ projectId, scheduleId }) => parse3(await (await getProjectsClient()).getSchedule(projectId, scheduleId))
|
|
144701
|
+
)
|
|
144702
|
+
);
|
|
145145
144703
|
projects.command(`update-service-status`).description(`Update the status of a specific service. Use this endpoint to enable or disable a service in your project. `).requiredOption(`--project-id <project-id>`, `Project unique ID.`).requiredOption(`--service <service>`, `Service name.`).requiredOption(`--status <status>`, `Service status.`, parseBool).action(
|
|
145146
144704
|
actionRunner(
|
|
145147
144705
|
async ({ projectId, service, status }) => parse3(await (await getProjectsClient()).updateServiceStatus(projectId, service, status))
|
|
@@ -145548,7 +145106,7 @@ storage.command(`create-bucket`).description(`Create a new storage bucket.`).req
|
|
|
145548
145106
|
`--enabled [value]`,
|
|
145549
145107
|
`Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.`,
|
|
145550
145108
|
(value) => value === void 0 ? true : parseBool(value)
|
|
145551
|
-
).option(`--maximum-file-size <maximum-file-size>`, `Maximum file size allowed in bytes. Maximum allowed value is
|
|
145109
|
+
).option(`--maximum-file-size <maximum-file-size>`, `Maximum file size allowed in bytes. Maximum allowed value is 5GB.`, parseInteger).option(`--allowed-file-extensions [allowed-file-extensions...]`, `Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.`).option(`--compression <compression>`, `Compression algorithm chosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled`).option(
|
|
145552
145110
|
`--encryption [value]`,
|
|
145553
145111
|
`Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled`,
|
|
145554
145112
|
(value) => value === void 0 ? true : parseBool(value)
|
|
@@ -145578,7 +145136,7 @@ storage.command(`update-bucket`).description(`Update a storage bucket by its uni
|
|
|
145578
145136
|
`--enabled [value]`,
|
|
145579
145137
|
`Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.`,
|
|
145580
145138
|
(value) => value === void 0 ? true : parseBool(value)
|
|
145581
|
-
).option(`--maximum-file-size <maximum-file-size>`, `Maximum file size allowed in bytes. Maximum allowed value is
|
|
145139
|
+
).option(`--maximum-file-size <maximum-file-size>`, `Maximum file size allowed in bytes. Maximum allowed value is 5GB.`, parseInteger).option(`--allowed-file-extensions [allowed-file-extensions...]`, `Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.`).option(`--compression <compression>`, `Compression algorithm chosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled`).option(
|
|
145582
145140
|
`--encryption [value]`,
|
|
145583
145141
|
`Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled`,
|
|
145584
145142
|
(value) => value === void 0 ? true : parseBool(value)
|
|
@@ -146750,7 +146308,7 @@ if (process.argv.includes("-v") || process.argv.includes("--version")) {
|
|
|
146750
146308
|
cliConfig.all = true;
|
|
146751
146309
|
}).on("option:id", function() {
|
|
146752
146310
|
cliConfig.ids = this.opts().id;
|
|
146753
|
-
}).showSuggestionAfterError().addCommand(whoami).addCommand(register).addCommand(login).addCommand(init).addCommand(pull).addCommand(push).addCommand(types).addCommand(deploy).addCommand(run).addCommand(update).addCommand(generate).addCommand(logout).addCommand(account).addCommand(
|
|
146311
|
+
}).showSuggestionAfterError().addCommand(whoami).addCommand(register).addCommand(login).addCommand(init).addCommand(pull).addCommand(push).addCommand(types).addCommand(deploy).addCommand(run).addCommand(update).addCommand(generate).addCommand(logout).addCommand(account).addCommand(activities).addCommand(backups).addCommand(databases).addCommand(functions).addCommand(graphql).addCommand(health).addCommand(locale).addCommand(messaging).addCommand(migrations).addCommand(project).addCommand(projects).addCommand(proxy).addCommand(sites).addCommand(storage).addCommand(tablesDB).addCommand(teams).addCommand(tokens).addCommand(users).addCommand(vcs).addCommand(client).parse(process.argv);
|
|
146754
146312
|
process.stdout.columns = oldWidth;
|
|
146755
146313
|
}
|
|
146756
146314
|
/*! Bundled license information:
|