appwrite-cli 13.5.0 → 13.6.1
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 +14 -0
- package/README.md +2 -2
- package/cli.ts +7 -5
- package/dist/bundle-win-arm64.mjs +988 -258
- package/dist/cli.cjs +988 -258
- package/dist/index.cjs +183 -112
- package/dist/index.js +183 -112
- package/dist/lib/commands/config-validations.d.ts +1 -1
- package/dist/lib/commands/config-validations.d.ts.map +1 -1
- package/dist/lib/commands/errors.d.ts +4 -4
- package/dist/lib/commands/errors.d.ts.map +1 -1
- package/dist/lib/commands/generate.d.ts.map +1 -1
- package/dist/lib/commands/generators/base.d.ts +5 -0
- package/dist/lib/commands/generators/base.d.ts.map +1 -1
- package/dist/lib/commands/generic.d.ts.map +1 -1
- package/dist/lib/commands/init.d.ts.map +1 -1
- package/dist/lib/commands/run.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/types.d.ts.map +1 -1
- package/dist/lib/commands/update.d.ts.map +1 -1
- package/dist/lib/commands/utils/change-approval.d.ts +3 -3
- package/dist/lib/commands/utils/change-approval.d.ts.map +1 -1
- package/dist/lib/commands/utils/database-sync.d.ts.map +1 -1
- package/dist/lib/commands/utils/deployment.d.ts +16 -4
- package/dist/lib/commands/utils/deployment.d.ts.map +1 -1
- package/dist/lib/commands/utils/pools.d.ts.map +1 -1
- package/dist/lib/constants.d.ts +1 -1
- package/dist/lib/emulation/docker.d.ts.map +1 -1
- package/dist/lib/json.d.ts +1 -1
- package/dist/lib/json.d.ts.map +1 -1
- package/dist/lib/paginate.d.ts +5 -6
- package/dist/lib/paginate.d.ts.map +1 -1
- package/dist/lib/parser.d.ts +5 -4
- package/dist/lib/parser.d.ts.map +1 -1
- package/dist/lib/spinner.d.ts +1 -1
- package/dist/lib/spinner.d.ts.map +1 -1
- package/dist/lib/utils.d.ts +6 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/validations.d.ts +1 -1
- package/dist/lib/validations.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/eslint.config.js +45 -0
- package/install.ps1 +2 -2
- package/install.sh +1 -1
- package/lib/client.ts +3 -3
- package/lib/commands/config-validations.ts +1 -1
- package/lib/commands/config.ts +2 -2
- package/lib/commands/errors.ts +2 -2
- package/lib/commands/generate.ts +8 -6
- package/lib/commands/generators/base.ts +6 -0
- package/lib/commands/generators/typescript/databases.ts +9 -9
- package/lib/commands/generators/typescript/templates/databases.ts.hbs +16 -16
- package/lib/commands/generic.ts +21 -16
- package/lib/commands/init.ts +147 -61
- package/lib/commands/pull.ts +1 -1
- package/lib/commands/push.ts +19 -19
- package/lib/commands/run.ts +15 -9
- 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/projects.ts +1 -1
- package/lib/commands/services/storage.ts +2 -2
- package/lib/commands/types.ts +18 -8
- package/lib/commands/update.ts +24 -16
- package/lib/commands/utils/attributes.ts +6 -6
- package/lib/commands/utils/change-approval.ts +26 -19
- package/lib/commands/utils/database-sync.ts +58 -18
- package/lib/commands/utils/deployment.ts +22 -5
- package/lib/commands/utils/pools.ts +11 -5
- package/lib/config.ts +1 -1
- package/lib/constants.ts +1 -1
- package/lib/emulation/docker.ts +5 -6
- package/lib/emulation/utils.ts +2 -2
- package/lib/json.ts +21 -8
- package/lib/paginate.ts +30 -20
- package/lib/parser.ts +46 -15
- package/lib/questions.ts +38 -38
- package/lib/spinner.ts +5 -1
- package/lib/utils.ts +15 -3
- package/lib/validations.ts +1 -1
- package/package.json +8 -2
- 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
|
@@ -2354,7 +2354,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2354
2354
|
}
|
|
2355
2355
|
return positiveOption || option2;
|
|
2356
2356
|
};
|
|
2357
|
-
const
|
|
2357
|
+
const getErrorMessage2 = (option2) => {
|
|
2358
2358
|
const bestOption = findBestOptionFromValue(option2);
|
|
2359
2359
|
const optionKey = bestOption.attributeName();
|
|
2360
2360
|
const source = this.getOptionValueSource(optionKey);
|
|
@@ -2363,7 +2363,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2363
2363
|
}
|
|
2364
2364
|
return `option '${bestOption.flags}'`;
|
|
2365
2365
|
};
|
|
2366
|
-
const message = `error: ${
|
|
2366
|
+
const message = `error: ${getErrorMessage2(option)} cannot be used with ${getErrorMessage2(conflictingOption)}`;
|
|
2367
2367
|
this.error(message, { code: "commander.conflictingOption" });
|
|
2368
2368
|
}
|
|
2369
2369
|
/**
|
|
@@ -4309,9 +4309,9 @@ var require_source = __commonJS({
|
|
|
4309
4309
|
}
|
|
4310
4310
|
});
|
|
4311
4311
|
|
|
4312
|
-
// node_modules/escape-string-regexp/index.js
|
|
4312
|
+
// node_modules/figures/node_modules/escape-string-regexp/index.js
|
|
4313
4313
|
var require_escape_string_regexp = __commonJS({
|
|
4314
|
-
"node_modules/escape-string-regexp/index.js"(exports2, module2) {
|
|
4314
|
+
"node_modules/figures/node_modules/escape-string-regexp/index.js"(exports2, module2) {
|
|
4315
4315
|
"use strict";
|
|
4316
4316
|
var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
|
|
4317
4317
|
module2.exports = function(str) {
|
|
@@ -21975,6 +21975,7 @@ var require_safe_buffer = __commonJS({
|
|
|
21975
21975
|
function SafeBuffer(arg, encodingOrOffset, length) {
|
|
21976
21976
|
return Buffer2(arg, encodingOrOffset, length);
|
|
21977
21977
|
}
|
|
21978
|
+
SafeBuffer.prototype = Object.create(Buffer2.prototype);
|
|
21978
21979
|
copyProps(Buffer2, SafeBuffer);
|
|
21979
21980
|
SafeBuffer.from = function(arg, encodingOrOffset, length) {
|
|
21980
21981
|
if (typeof arg === "number") {
|
|
@@ -24517,16 +24518,16 @@ var require_base = __commonJS({
|
|
|
24517
24518
|
}),
|
|
24518
24519
|
share()
|
|
24519
24520
|
);
|
|
24520
|
-
const
|
|
24521
|
+
const success20 = validation.pipe(
|
|
24521
24522
|
filter((state) => state.isValid === true),
|
|
24522
24523
|
take(1)
|
|
24523
24524
|
);
|
|
24524
24525
|
const error49 = validation.pipe(
|
|
24525
24526
|
filter((state) => state.isValid !== true),
|
|
24526
|
-
takeUntil(
|
|
24527
|
+
takeUntil(success20)
|
|
24527
24528
|
);
|
|
24528
24529
|
return {
|
|
24529
|
-
success:
|
|
24530
|
+
success: success20,
|
|
24530
24531
|
error: error49
|
|
24531
24532
|
};
|
|
24532
24533
|
}
|
|
@@ -61206,6 +61207,20 @@ var require_lodash = __commonJS({
|
|
|
61206
61207
|
}
|
|
61207
61208
|
});
|
|
61208
61209
|
|
|
61210
|
+
// node_modules/inquirer-search-list/node_modules/chalk/node_modules/escape-string-regexp/index.js
|
|
61211
|
+
var require_escape_string_regexp2 = __commonJS({
|
|
61212
|
+
"node_modules/inquirer-search-list/node_modules/chalk/node_modules/escape-string-regexp/index.js"(exports2, module2) {
|
|
61213
|
+
"use strict";
|
|
61214
|
+
var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
|
|
61215
|
+
module2.exports = function(str) {
|
|
61216
|
+
if (typeof str !== "string") {
|
|
61217
|
+
throw new TypeError("Expected a string");
|
|
61218
|
+
}
|
|
61219
|
+
return str.replace(matchOperatorsRe, "\\$&");
|
|
61220
|
+
};
|
|
61221
|
+
}
|
|
61222
|
+
});
|
|
61223
|
+
|
|
61209
61224
|
// node_modules/inquirer-search-list/node_modules/chalk/node_modules/ansi-styles/node_modules/color-convert/node_modules/color-name/index.js
|
|
61210
61225
|
var require_color_name2 = __commonJS({
|
|
61211
61226
|
"node_modules/inquirer-search-list/node_modules/chalk/node_modules/ansi-styles/node_modules/color-convert/node_modules/color-name/index.js"(exports2, module2) {
|
|
@@ -62572,7 +62587,7 @@ var require_templates2 = __commonJS({
|
|
|
62572
62587
|
var require_chalk = __commonJS({
|
|
62573
62588
|
"node_modules/inquirer-search-list/node_modules/chalk/index.js"(exports2, module2) {
|
|
62574
62589
|
"use strict";
|
|
62575
|
-
var escapeStringRegexp =
|
|
62590
|
+
var escapeStringRegexp = require_escape_string_regexp2();
|
|
62576
62591
|
var ansiStyles = require_ansi_styles2();
|
|
62577
62592
|
var stdoutColor = require_supports_color2().stdout;
|
|
62578
62593
|
var template = require_templates2();
|
|
@@ -62735,11 +62750,25 @@ var require_chalk = __commonJS({
|
|
|
62735
62750
|
}
|
|
62736
62751
|
});
|
|
62737
62752
|
|
|
62753
|
+
// node_modules/inquirer-search-list/node_modules/figures/node_modules/escape-string-regexp/index.js
|
|
62754
|
+
var require_escape_string_regexp3 = __commonJS({
|
|
62755
|
+
"node_modules/inquirer-search-list/node_modules/figures/node_modules/escape-string-regexp/index.js"(exports2, module2) {
|
|
62756
|
+
"use strict";
|
|
62757
|
+
var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
|
|
62758
|
+
module2.exports = function(str) {
|
|
62759
|
+
if (typeof str !== "string") {
|
|
62760
|
+
throw new TypeError("Expected a string");
|
|
62761
|
+
}
|
|
62762
|
+
return str.replace(matchOperatorsRe, "\\$&");
|
|
62763
|
+
};
|
|
62764
|
+
}
|
|
62765
|
+
});
|
|
62766
|
+
|
|
62738
62767
|
// node_modules/inquirer-search-list/node_modules/figures/index.js
|
|
62739
62768
|
var require_figures2 = __commonJS({
|
|
62740
62769
|
"node_modules/inquirer-search-list/node_modules/figures/index.js"(exports2, module2) {
|
|
62741
62770
|
"use strict";
|
|
62742
|
-
var escapeStringRegexp =
|
|
62771
|
+
var escapeStringRegexp = require_escape_string_regexp3();
|
|
62743
62772
|
var platform = process.platform;
|
|
62744
62773
|
var main = {
|
|
62745
62774
|
tick: "\u2714",
|
|
@@ -63424,14 +63453,14 @@ var require_base2 = __commonJS({
|
|
|
63424
63453
|
return { isValid: err };
|
|
63425
63454
|
});
|
|
63426
63455
|
}).share();
|
|
63427
|
-
var
|
|
63456
|
+
var success20 = validation.filter(function(state) {
|
|
63428
63457
|
return state.isValid === true;
|
|
63429
63458
|
}).take(1);
|
|
63430
63459
|
var error49 = validation.filter(function(state) {
|
|
63431
63460
|
return state.isValid !== true;
|
|
63432
|
-
}).takeUntil(
|
|
63461
|
+
}).takeUntil(success20);
|
|
63433
63462
|
return {
|
|
63434
|
-
success:
|
|
63463
|
+
success: success20,
|
|
63435
63464
|
error: error49
|
|
63436
63465
|
};
|
|
63437
63466
|
};
|
|
@@ -82335,9 +82364,9 @@ var require_is_glob = __commonJS({
|
|
|
82335
82364
|
}
|
|
82336
82365
|
});
|
|
82337
82366
|
|
|
82338
|
-
// node_modules/glob-parent/index.js
|
|
82367
|
+
// node_modules/chokidar/node_modules/glob-parent/index.js
|
|
82339
82368
|
var require_glob_parent = __commonJS({
|
|
82340
|
-
"node_modules/glob-parent/index.js"(exports2, module2) {
|
|
82369
|
+
"node_modules/chokidar/node_modules/glob-parent/index.js"(exports2, module2) {
|
|
82341
82370
|
"use strict";
|
|
82342
82371
|
var isGlob = require_is_glob();
|
|
82343
82372
|
var pathPosixDirname = require("path").posix.dirname;
|
|
@@ -92060,7 +92089,7 @@ var package_default = {
|
|
|
92060
92089
|
type: "module",
|
|
92061
92090
|
homepage: "https://appwrite.io/support",
|
|
92062
92091
|
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",
|
|
92063
|
-
version: "13.
|
|
92092
|
+
version: "13.6.1",
|
|
92064
92093
|
license: "BSD-3-Clause",
|
|
92065
92094
|
main: "dist/index.cjs",
|
|
92066
92095
|
module: "dist/index.js",
|
|
@@ -92091,6 +92120,7 @@ var package_default = {
|
|
|
92091
92120
|
"build:lib:esm": "esbuild index.ts --bundle --platform=node --target=node18 --format=esm --loader:.hbs=text --outfile=dist/index.js",
|
|
92092
92121
|
"build:lib:cjs": "esbuild index.ts --bundle --platform=node --target=node18 --format=cjs --loader:.hbs=text --outfile=dist/index.cjs",
|
|
92093
92122
|
"build:cli": "esbuild cli.ts --bundle --platform=node --target=node18 --format=cjs --loader:.hbs=text --external:fsevents --outfile=dist/cli.cjs",
|
|
92123
|
+
lint: "eslint .",
|
|
92094
92124
|
format: 'prettier --write "**/*.{js,ts,json,md}"',
|
|
92095
92125
|
generate: "tsx scripts/generate-commands.ts",
|
|
92096
92126
|
prepublishOnly: "npm run build",
|
|
@@ -92103,7 +92133,7 @@ var package_default = {
|
|
|
92103
92133
|
"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"
|
|
92104
92134
|
},
|
|
92105
92135
|
dependencies: {
|
|
92106
|
-
"@appwrite.io/console": "^3.
|
|
92136
|
+
"@appwrite.io/console": "^3.1.0",
|
|
92107
92137
|
chalk: "4.1.2",
|
|
92108
92138
|
chokidar: "^3.6.0",
|
|
92109
92139
|
"cli-progress": "^3.12.0",
|
|
@@ -92122,7 +92152,12 @@ var package_default = {
|
|
|
92122
92152
|
zod: "^4.3.5"
|
|
92123
92153
|
},
|
|
92124
92154
|
devDependencies: {
|
|
92155
|
+
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
92156
|
+
"@typescript-eslint/parser": "^8.0.0",
|
|
92125
92157
|
"@types/bun": "^1.3.5",
|
|
92158
|
+
eslint: "^9.0.0",
|
|
92159
|
+
"eslint-plugin-unused-imports": "^4.0.0",
|
|
92160
|
+
"typescript-eslint": "^8.0.0",
|
|
92126
92161
|
"@types/cli-progress": "^3.11.5",
|
|
92127
92162
|
"@types/inquirer": "^8.2.10",
|
|
92128
92163
|
"@types/json-bigint": "^1.0.4",
|
|
@@ -106045,7 +106080,7 @@ var int64Schema = external_exports.preprocess(
|
|
|
106045
106080
|
const valueOfResult = val.valueOf();
|
|
106046
106081
|
const bigIntVal = BigInt(valueOfResult);
|
|
106047
106082
|
return bigIntVal;
|
|
106048
|
-
} catch (
|
|
106083
|
+
} catch (_e) {
|
|
106049
106084
|
return void 0;
|
|
106050
106085
|
}
|
|
106051
106086
|
}
|
|
@@ -106055,7 +106090,7 @@ var int64Schema = external_exports.preprocess(
|
|
|
106055
106090
|
if (typeof val === "string") {
|
|
106056
106091
|
try {
|
|
106057
106092
|
return BigInt(val);
|
|
106058
|
-
} catch (
|
|
106093
|
+
} catch (_e) {
|
|
106059
106094
|
return void 0;
|
|
106060
106095
|
}
|
|
106061
106096
|
}
|
|
@@ -106337,7 +106372,7 @@ var import_undici = __toESM(require_undici(), 1);
|
|
|
106337
106372
|
// lib/constants.ts
|
|
106338
106373
|
var SDK_TITLE = "Appwrite";
|
|
106339
106374
|
var SDK_TITLE_LOWER = "appwrite";
|
|
106340
|
-
var SDK_VERSION = "13.
|
|
106375
|
+
var SDK_VERSION = "13.6.1";
|
|
106341
106376
|
var SDK_NAME = "Command Line";
|
|
106342
106377
|
var SDK_PLATFORM = "console";
|
|
106343
106378
|
var SDK_LANGUAGE = "cli";
|
|
@@ -106389,6 +106424,12 @@ var createSettingsObject = (project2) => {
|
|
|
106389
106424
|
}
|
|
106390
106425
|
};
|
|
106391
106426
|
};
|
|
106427
|
+
var getErrorMessage = (error49) => {
|
|
106428
|
+
if (error49 instanceof Error) {
|
|
106429
|
+
return error49.message;
|
|
106430
|
+
}
|
|
106431
|
+
return String(error49);
|
|
106432
|
+
};
|
|
106392
106433
|
async function getLatestVersion() {
|
|
106393
106434
|
try {
|
|
106394
106435
|
const response = await (0, import_undici.fetch)(NPM_REGISTRY_URL);
|
|
@@ -106419,7 +106460,7 @@ function getAllFiles(folder) {
|
|
|
106419
106460
|
let stats;
|
|
106420
106461
|
try {
|
|
106421
106462
|
stats = import_fs.default.statSync(pathAbsolute);
|
|
106422
|
-
} catch (
|
|
106463
|
+
} catch (_error) {
|
|
106423
106464
|
continue;
|
|
106424
106465
|
}
|
|
106425
106466
|
if (stats.isDirectory()) {
|
|
@@ -106464,7 +106505,7 @@ function systemHasCommand(command) {
|
|
|
106464
106505
|
return true;
|
|
106465
106506
|
}
|
|
106466
106507
|
var checkDeployConditions = (localConfig2) => {
|
|
106467
|
-
if (
|
|
106508
|
+
if (localConfig2.keys().length === 0) {
|
|
106468
106509
|
throw new Error(
|
|
106469
106510
|
"No appwrite.config.json file found in the current directory. Please run this command again in the folder containing your appwrite.config.json file, or run 'appwrite init project' to link current directory to an Appwrite project."
|
|
106470
106511
|
);
|
|
@@ -106500,6 +106541,8 @@ var JSONbigParser = (0, import_json_bigint.default)({ storeAsString: false });
|
|
|
106500
106541
|
var JSONbigSerializer = (0, import_json_bigint.default)({ useNativeBigInt: true });
|
|
106501
106542
|
var MAX_SAFE = BigInt(Number.MAX_SAFE_INTEGER);
|
|
106502
106543
|
var MIN_SAFE = BigInt(Number.MIN_SAFE_INTEGER);
|
|
106544
|
+
var MAX_INT64 = BigInt("9223372036854775807");
|
|
106545
|
+
var MIN_INT64 = BigInt("-9223372036854775808");
|
|
106503
106546
|
function isBigNumber(value) {
|
|
106504
106547
|
return value !== null && typeof value === "object" && value._isBigNumber === true && typeof value.isInteger === "function" && typeof value.toFixed === "function" && typeof value.toNumber === "function";
|
|
106505
106548
|
}
|
|
@@ -106511,7 +106554,10 @@ function reviver(_key, value) {
|
|
|
106511
106554
|
if (bi >= MIN_SAFE && bi <= MAX_SAFE) {
|
|
106512
106555
|
return Number(str);
|
|
106513
106556
|
}
|
|
106514
|
-
|
|
106557
|
+
if (bi >= MIN_INT64 && bi <= MAX_INT64) {
|
|
106558
|
+
return bi;
|
|
106559
|
+
}
|
|
106560
|
+
return value.toNumber();
|
|
106515
106561
|
}
|
|
106516
106562
|
return value.toNumber();
|
|
106517
106563
|
}
|
|
@@ -106607,7 +106653,7 @@ var Config = class {
|
|
|
106607
106653
|
try {
|
|
106608
106654
|
const file2 = import_fs2.default.readFileSync(this.path).toString();
|
|
106609
106655
|
this.data = JSONBig.parse(file2);
|
|
106610
|
-
} catch (
|
|
106656
|
+
} catch (_e) {
|
|
106611
106657
|
this.data = {};
|
|
106612
106658
|
}
|
|
106613
106659
|
}
|
|
@@ -107270,6 +107316,8 @@ Query.cursorBefore = (documentId) => new Query("cursorBefore", void 0, documentI
|
|
|
107270
107316
|
Query.limit = (limit) => new Query("limit", void 0, limit).toString();
|
|
107271
107317
|
Query.offset = (offset) => new Query("offset", void 0, offset).toString();
|
|
107272
107318
|
Query.contains = (attribute, value) => new Query("contains", attribute, value).toString();
|
|
107319
|
+
Query.containsAny = (attribute, value) => new Query("containsAny", attribute, value).toString();
|
|
107320
|
+
Query.containsAll = (attribute, value) => new Query("containsAll", attribute, value).toString();
|
|
107273
107321
|
Query.notContains = (attribute, value) => new Query("notContains", attribute, value).toString();
|
|
107274
107322
|
Query.notSearch = (attribute, value) => new Query("notSearch", attribute, value).toString();
|
|
107275
107323
|
Query.notBetween = (attribute, start, end) => new Query("notBetween", attribute, [start, end]).toString();
|
|
@@ -107300,6 +107348,8 @@ var JSONbigParser2 = (0, import_json_bigint2.default)({ storeAsString: false });
|
|
|
107300
107348
|
var JSONbigSerializer2 = (0, import_json_bigint2.default)({ useNativeBigInt: true });
|
|
107301
107349
|
var MAX_SAFE2 = BigInt(Number.MAX_SAFE_INTEGER);
|
|
107302
107350
|
var MIN_SAFE2 = BigInt(Number.MIN_SAFE_INTEGER);
|
|
107351
|
+
var MAX_INT642 = BigInt("9223372036854775807");
|
|
107352
|
+
var MIN_INT642 = BigInt("-9223372036854775808");
|
|
107303
107353
|
function isBigNumber2(value) {
|
|
107304
107354
|
return value !== null && typeof value === "object" && value._isBigNumber === true && typeof value.isInteger === "function" && typeof value.toFixed === "function" && typeof value.toNumber === "function";
|
|
107305
107355
|
}
|
|
@@ -107311,7 +107361,10 @@ function reviver2(_key, value) {
|
|
|
107311
107361
|
if (bi >= MIN_SAFE2 && bi <= MAX_SAFE2) {
|
|
107312
107362
|
return Number(str);
|
|
107313
107363
|
}
|
|
107314
|
-
|
|
107364
|
+
if (bi >= MIN_INT642 && bi <= MAX_INT642) {
|
|
107365
|
+
return bi;
|
|
107366
|
+
}
|
|
107367
|
+
return value.toNumber();
|
|
107315
107368
|
}
|
|
107316
107369
|
return value.toNumber();
|
|
107317
107370
|
}
|
|
@@ -107358,7 +107411,7 @@ var Client = class _Client {
|
|
|
107358
107411
|
"x-sdk-name": "Console",
|
|
107359
107412
|
"x-sdk-platform": "console",
|
|
107360
107413
|
"x-sdk-language": "web",
|
|
107361
|
-
"x-sdk-version": "3.
|
|
107414
|
+
"x-sdk-version": "3.1.0",
|
|
107362
107415
|
"X-Appwrite-Response-Format": "1.8.0"
|
|
107363
107416
|
};
|
|
107364
107417
|
this.realtime = {
|
|
@@ -109354,7 +109407,7 @@ var Account = class {
|
|
|
109354
109407
|
};
|
|
109355
109408
|
}
|
|
109356
109409
|
const provider = params.provider;
|
|
109357
|
-
const
|
|
109410
|
+
const success20 = params.success;
|
|
109358
109411
|
const failure = params.failure;
|
|
109359
109412
|
const scopes = params.scopes;
|
|
109360
109413
|
if (typeof provider === "undefined") {
|
|
@@ -109362,8 +109415,8 @@ var Account = class {
|
|
|
109362
109415
|
}
|
|
109363
109416
|
const apiPath = "/account/sessions/oauth2/{provider}".replace("{provider}", provider);
|
|
109364
109417
|
const payload = {};
|
|
109365
|
-
if (typeof
|
|
109366
|
-
payload["success"] =
|
|
109418
|
+
if (typeof success20 !== "undefined") {
|
|
109419
|
+
payload["success"] = success20;
|
|
109367
109420
|
}
|
|
109368
109421
|
if (typeof failure !== "undefined") {
|
|
109369
109422
|
payload["failure"] = failure;
|
|
@@ -109702,7 +109755,7 @@ var Account = class {
|
|
|
109702
109755
|
};
|
|
109703
109756
|
}
|
|
109704
109757
|
const provider = params.provider;
|
|
109705
|
-
const
|
|
109758
|
+
const success20 = params.success;
|
|
109706
109759
|
const failure = params.failure;
|
|
109707
109760
|
const scopes = params.scopes;
|
|
109708
109761
|
if (typeof provider === "undefined") {
|
|
@@ -109710,8 +109763,8 @@ var Account = class {
|
|
|
109710
109763
|
}
|
|
109711
109764
|
const apiPath = "/account/tokens/oauth2/{provider}".replace("{provider}", provider);
|
|
109712
109765
|
const payload = {};
|
|
109713
|
-
if (typeof
|
|
109714
|
-
payload["success"] =
|
|
109766
|
+
if (typeof success20 !== "undefined") {
|
|
109767
|
+
payload["success"] = success20;
|
|
109715
109768
|
}
|
|
109716
109769
|
if (typeof failure !== "undefined") {
|
|
109717
109770
|
payload["failure"] = failure;
|
|
@@ -109923,6 +109976,385 @@ var Account = class {
|
|
|
109923
109976
|
return this.client.call("put", uri, apiHeaders, payload);
|
|
109924
109977
|
}
|
|
109925
109978
|
};
|
|
109979
|
+
var Activities = class {
|
|
109980
|
+
constructor(client2) {
|
|
109981
|
+
this.client = client2;
|
|
109982
|
+
}
|
|
109983
|
+
listEvents(paramsOrFirst) {
|
|
109984
|
+
let params;
|
|
109985
|
+
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
109986
|
+
params = paramsOrFirst || {};
|
|
109987
|
+
} else {
|
|
109988
|
+
params = {
|
|
109989
|
+
queries: paramsOrFirst
|
|
109990
|
+
};
|
|
109991
|
+
}
|
|
109992
|
+
const queries = params.queries;
|
|
109993
|
+
const apiPath = "/activities/events";
|
|
109994
|
+
const payload = {};
|
|
109995
|
+
if (typeof queries !== "undefined") {
|
|
109996
|
+
payload["queries"] = queries;
|
|
109997
|
+
}
|
|
109998
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
109999
|
+
const apiHeaders = {};
|
|
110000
|
+
return this.client.call("get", uri, apiHeaders, payload);
|
|
110001
|
+
}
|
|
110002
|
+
getEvent(paramsOrFirst) {
|
|
110003
|
+
let params;
|
|
110004
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
110005
|
+
params = paramsOrFirst || {};
|
|
110006
|
+
} else {
|
|
110007
|
+
params = {
|
|
110008
|
+
eventId: paramsOrFirst
|
|
110009
|
+
};
|
|
110010
|
+
}
|
|
110011
|
+
const eventId = params.eventId;
|
|
110012
|
+
if (typeof eventId === "undefined") {
|
|
110013
|
+
throw new AppwriteException('Missing required parameter: "eventId"');
|
|
110014
|
+
}
|
|
110015
|
+
const apiPath = "/activities/events/{eventId}".replace("{eventId}", eventId);
|
|
110016
|
+
const payload = {};
|
|
110017
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
110018
|
+
const apiHeaders = {};
|
|
110019
|
+
return this.client.call("get", uri, apiHeaders, payload);
|
|
110020
|
+
}
|
|
110021
|
+
};
|
|
110022
|
+
var Backups = class {
|
|
110023
|
+
constructor(client2) {
|
|
110024
|
+
this.client = client2;
|
|
110025
|
+
}
|
|
110026
|
+
listArchives(paramsOrFirst) {
|
|
110027
|
+
let params;
|
|
110028
|
+
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
110029
|
+
params = paramsOrFirst || {};
|
|
110030
|
+
} else {
|
|
110031
|
+
params = {
|
|
110032
|
+
queries: paramsOrFirst
|
|
110033
|
+
};
|
|
110034
|
+
}
|
|
110035
|
+
const queries = params.queries;
|
|
110036
|
+
const apiPath = "/backups/archives";
|
|
110037
|
+
const payload = {};
|
|
110038
|
+
if (typeof queries !== "undefined") {
|
|
110039
|
+
payload["queries"] = queries;
|
|
110040
|
+
}
|
|
110041
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
110042
|
+
const apiHeaders = {};
|
|
110043
|
+
return this.client.call("get", uri, apiHeaders, payload);
|
|
110044
|
+
}
|
|
110045
|
+
createArchive(paramsOrFirst, ...rest) {
|
|
110046
|
+
let params;
|
|
110047
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && ("services" in paramsOrFirst || "resourceId" in paramsOrFirst)) {
|
|
110048
|
+
params = paramsOrFirst || {};
|
|
110049
|
+
} else {
|
|
110050
|
+
params = {
|
|
110051
|
+
services: paramsOrFirst,
|
|
110052
|
+
resourceId: rest[0]
|
|
110053
|
+
};
|
|
110054
|
+
}
|
|
110055
|
+
const services = params.services;
|
|
110056
|
+
const resourceId = params.resourceId;
|
|
110057
|
+
if (typeof services === "undefined") {
|
|
110058
|
+
throw new AppwriteException('Missing required parameter: "services"');
|
|
110059
|
+
}
|
|
110060
|
+
const apiPath = "/backups/archives";
|
|
110061
|
+
const payload = {};
|
|
110062
|
+
if (typeof services !== "undefined") {
|
|
110063
|
+
payload["services"] = services;
|
|
110064
|
+
}
|
|
110065
|
+
if (typeof resourceId !== "undefined") {
|
|
110066
|
+
payload["resourceId"] = resourceId;
|
|
110067
|
+
}
|
|
110068
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
110069
|
+
const apiHeaders = {
|
|
110070
|
+
"content-type": "application/json"
|
|
110071
|
+
};
|
|
110072
|
+
return this.client.call("post", uri, apiHeaders, payload);
|
|
110073
|
+
}
|
|
110074
|
+
getArchive(paramsOrFirst) {
|
|
110075
|
+
let params;
|
|
110076
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
110077
|
+
params = paramsOrFirst || {};
|
|
110078
|
+
} else {
|
|
110079
|
+
params = {
|
|
110080
|
+
archiveId: paramsOrFirst
|
|
110081
|
+
};
|
|
110082
|
+
}
|
|
110083
|
+
const archiveId = params.archiveId;
|
|
110084
|
+
if (typeof archiveId === "undefined") {
|
|
110085
|
+
throw new AppwriteException('Missing required parameter: "archiveId"');
|
|
110086
|
+
}
|
|
110087
|
+
const apiPath = "/backups/archives/{archiveId}".replace("{archiveId}", archiveId);
|
|
110088
|
+
const payload = {};
|
|
110089
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
110090
|
+
const apiHeaders = {};
|
|
110091
|
+
return this.client.call("get", uri, apiHeaders, payload);
|
|
110092
|
+
}
|
|
110093
|
+
deleteArchive(paramsOrFirst) {
|
|
110094
|
+
let params;
|
|
110095
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
110096
|
+
params = paramsOrFirst || {};
|
|
110097
|
+
} else {
|
|
110098
|
+
params = {
|
|
110099
|
+
archiveId: paramsOrFirst
|
|
110100
|
+
};
|
|
110101
|
+
}
|
|
110102
|
+
const archiveId = params.archiveId;
|
|
110103
|
+
if (typeof archiveId === "undefined") {
|
|
110104
|
+
throw new AppwriteException('Missing required parameter: "archiveId"');
|
|
110105
|
+
}
|
|
110106
|
+
const apiPath = "/backups/archives/{archiveId}".replace("{archiveId}", archiveId);
|
|
110107
|
+
const payload = {};
|
|
110108
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
110109
|
+
const apiHeaders = {
|
|
110110
|
+
"content-type": "application/json"
|
|
110111
|
+
};
|
|
110112
|
+
return this.client.call("delete", uri, apiHeaders, payload);
|
|
110113
|
+
}
|
|
110114
|
+
listPolicies(paramsOrFirst) {
|
|
110115
|
+
let params;
|
|
110116
|
+
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
110117
|
+
params = paramsOrFirst || {};
|
|
110118
|
+
} else {
|
|
110119
|
+
params = {
|
|
110120
|
+
queries: paramsOrFirst
|
|
110121
|
+
};
|
|
110122
|
+
}
|
|
110123
|
+
const queries = params.queries;
|
|
110124
|
+
const apiPath = "/backups/policies";
|
|
110125
|
+
const payload = {};
|
|
110126
|
+
if (typeof queries !== "undefined") {
|
|
110127
|
+
payload["queries"] = queries;
|
|
110128
|
+
}
|
|
110129
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
110130
|
+
const apiHeaders = {};
|
|
110131
|
+
return this.client.call("get", uri, apiHeaders, payload);
|
|
110132
|
+
}
|
|
110133
|
+
createPolicy(paramsOrFirst, ...rest) {
|
|
110134
|
+
let params;
|
|
110135
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
110136
|
+
params = paramsOrFirst || {};
|
|
110137
|
+
} else {
|
|
110138
|
+
params = {
|
|
110139
|
+
policyId: paramsOrFirst,
|
|
110140
|
+
services: rest[0],
|
|
110141
|
+
retention: rest[1],
|
|
110142
|
+
schedule: rest[2],
|
|
110143
|
+
name: rest[3],
|
|
110144
|
+
resourceId: rest[4],
|
|
110145
|
+
enabled: rest[5]
|
|
110146
|
+
};
|
|
110147
|
+
}
|
|
110148
|
+
const policyId = params.policyId;
|
|
110149
|
+
const services = params.services;
|
|
110150
|
+
const retention = params.retention;
|
|
110151
|
+
const schedule = params.schedule;
|
|
110152
|
+
const name = params.name;
|
|
110153
|
+
const resourceId = params.resourceId;
|
|
110154
|
+
const enabled = params.enabled;
|
|
110155
|
+
if (typeof policyId === "undefined") {
|
|
110156
|
+
throw new AppwriteException('Missing required parameter: "policyId"');
|
|
110157
|
+
}
|
|
110158
|
+
if (typeof services === "undefined") {
|
|
110159
|
+
throw new AppwriteException('Missing required parameter: "services"');
|
|
110160
|
+
}
|
|
110161
|
+
if (typeof retention === "undefined") {
|
|
110162
|
+
throw new AppwriteException('Missing required parameter: "retention"');
|
|
110163
|
+
}
|
|
110164
|
+
if (typeof schedule === "undefined") {
|
|
110165
|
+
throw new AppwriteException('Missing required parameter: "schedule"');
|
|
110166
|
+
}
|
|
110167
|
+
const apiPath = "/backups/policies";
|
|
110168
|
+
const payload = {};
|
|
110169
|
+
if (typeof policyId !== "undefined") {
|
|
110170
|
+
payload["policyId"] = policyId;
|
|
110171
|
+
}
|
|
110172
|
+
if (typeof name !== "undefined") {
|
|
110173
|
+
payload["name"] = name;
|
|
110174
|
+
}
|
|
110175
|
+
if (typeof services !== "undefined") {
|
|
110176
|
+
payload["services"] = services;
|
|
110177
|
+
}
|
|
110178
|
+
if (typeof resourceId !== "undefined") {
|
|
110179
|
+
payload["resourceId"] = resourceId;
|
|
110180
|
+
}
|
|
110181
|
+
if (typeof enabled !== "undefined") {
|
|
110182
|
+
payload["enabled"] = enabled;
|
|
110183
|
+
}
|
|
110184
|
+
if (typeof retention !== "undefined") {
|
|
110185
|
+
payload["retention"] = retention;
|
|
110186
|
+
}
|
|
110187
|
+
if (typeof schedule !== "undefined") {
|
|
110188
|
+
payload["schedule"] = schedule;
|
|
110189
|
+
}
|
|
110190
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
110191
|
+
const apiHeaders = {
|
|
110192
|
+
"content-type": "application/json"
|
|
110193
|
+
};
|
|
110194
|
+
return this.client.call("post", uri, apiHeaders, payload);
|
|
110195
|
+
}
|
|
110196
|
+
getPolicy(paramsOrFirst) {
|
|
110197
|
+
let params;
|
|
110198
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
110199
|
+
params = paramsOrFirst || {};
|
|
110200
|
+
} else {
|
|
110201
|
+
params = {
|
|
110202
|
+
policyId: paramsOrFirst
|
|
110203
|
+
};
|
|
110204
|
+
}
|
|
110205
|
+
const policyId = params.policyId;
|
|
110206
|
+
if (typeof policyId === "undefined") {
|
|
110207
|
+
throw new AppwriteException('Missing required parameter: "policyId"');
|
|
110208
|
+
}
|
|
110209
|
+
const apiPath = "/backups/policies/{policyId}".replace("{policyId}", policyId);
|
|
110210
|
+
const payload = {};
|
|
110211
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
110212
|
+
const apiHeaders = {};
|
|
110213
|
+
return this.client.call("get", uri, apiHeaders, payload);
|
|
110214
|
+
}
|
|
110215
|
+
updatePolicy(paramsOrFirst, ...rest) {
|
|
110216
|
+
let params;
|
|
110217
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
110218
|
+
params = paramsOrFirst || {};
|
|
110219
|
+
} else {
|
|
110220
|
+
params = {
|
|
110221
|
+
policyId: paramsOrFirst,
|
|
110222
|
+
name: rest[0],
|
|
110223
|
+
retention: rest[1],
|
|
110224
|
+
schedule: rest[2],
|
|
110225
|
+
enabled: rest[3]
|
|
110226
|
+
};
|
|
110227
|
+
}
|
|
110228
|
+
const policyId = params.policyId;
|
|
110229
|
+
const name = params.name;
|
|
110230
|
+
const retention = params.retention;
|
|
110231
|
+
const schedule = params.schedule;
|
|
110232
|
+
const enabled = params.enabled;
|
|
110233
|
+
if (typeof policyId === "undefined") {
|
|
110234
|
+
throw new AppwriteException('Missing required parameter: "policyId"');
|
|
110235
|
+
}
|
|
110236
|
+
const apiPath = "/backups/policies/{policyId}".replace("{policyId}", policyId);
|
|
110237
|
+
const payload = {};
|
|
110238
|
+
if (typeof name !== "undefined") {
|
|
110239
|
+
payload["name"] = name;
|
|
110240
|
+
}
|
|
110241
|
+
if (typeof retention !== "undefined") {
|
|
110242
|
+
payload["retention"] = retention;
|
|
110243
|
+
}
|
|
110244
|
+
if (typeof schedule !== "undefined") {
|
|
110245
|
+
payload["schedule"] = schedule;
|
|
110246
|
+
}
|
|
110247
|
+
if (typeof enabled !== "undefined") {
|
|
110248
|
+
payload["enabled"] = enabled;
|
|
110249
|
+
}
|
|
110250
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
110251
|
+
const apiHeaders = {
|
|
110252
|
+
"content-type": "application/json"
|
|
110253
|
+
};
|
|
110254
|
+
return this.client.call("patch", uri, apiHeaders, payload);
|
|
110255
|
+
}
|
|
110256
|
+
deletePolicy(paramsOrFirst) {
|
|
110257
|
+
let params;
|
|
110258
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
110259
|
+
params = paramsOrFirst || {};
|
|
110260
|
+
} else {
|
|
110261
|
+
params = {
|
|
110262
|
+
policyId: paramsOrFirst
|
|
110263
|
+
};
|
|
110264
|
+
}
|
|
110265
|
+
const policyId = params.policyId;
|
|
110266
|
+
if (typeof policyId === "undefined") {
|
|
110267
|
+
throw new AppwriteException('Missing required parameter: "policyId"');
|
|
110268
|
+
}
|
|
110269
|
+
const apiPath = "/backups/policies/{policyId}".replace("{policyId}", policyId);
|
|
110270
|
+
const payload = {};
|
|
110271
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
110272
|
+
const apiHeaders = {
|
|
110273
|
+
"content-type": "application/json"
|
|
110274
|
+
};
|
|
110275
|
+
return this.client.call("delete", uri, apiHeaders, payload);
|
|
110276
|
+
}
|
|
110277
|
+
createRestoration(paramsOrFirst, ...rest) {
|
|
110278
|
+
let params;
|
|
110279
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
110280
|
+
params = paramsOrFirst || {};
|
|
110281
|
+
} else {
|
|
110282
|
+
params = {
|
|
110283
|
+
archiveId: paramsOrFirst,
|
|
110284
|
+
services: rest[0],
|
|
110285
|
+
newResourceId: rest[1],
|
|
110286
|
+
newResourceName: rest[2]
|
|
110287
|
+
};
|
|
110288
|
+
}
|
|
110289
|
+
const archiveId = params.archiveId;
|
|
110290
|
+
const services = params.services;
|
|
110291
|
+
const newResourceId = params.newResourceId;
|
|
110292
|
+
const newResourceName = params.newResourceName;
|
|
110293
|
+
if (typeof archiveId === "undefined") {
|
|
110294
|
+
throw new AppwriteException('Missing required parameter: "archiveId"');
|
|
110295
|
+
}
|
|
110296
|
+
if (typeof services === "undefined") {
|
|
110297
|
+
throw new AppwriteException('Missing required parameter: "services"');
|
|
110298
|
+
}
|
|
110299
|
+
const apiPath = "/backups/restoration";
|
|
110300
|
+
const payload = {};
|
|
110301
|
+
if (typeof archiveId !== "undefined") {
|
|
110302
|
+
payload["archiveId"] = archiveId;
|
|
110303
|
+
}
|
|
110304
|
+
if (typeof services !== "undefined") {
|
|
110305
|
+
payload["services"] = services;
|
|
110306
|
+
}
|
|
110307
|
+
if (typeof newResourceId !== "undefined") {
|
|
110308
|
+
payload["newResourceId"] = newResourceId;
|
|
110309
|
+
}
|
|
110310
|
+
if (typeof newResourceName !== "undefined") {
|
|
110311
|
+
payload["newResourceName"] = newResourceName;
|
|
110312
|
+
}
|
|
110313
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
110314
|
+
const apiHeaders = {
|
|
110315
|
+
"content-type": "application/json"
|
|
110316
|
+
};
|
|
110317
|
+
return this.client.call("post", uri, apiHeaders, payload);
|
|
110318
|
+
}
|
|
110319
|
+
listRestorations(paramsOrFirst) {
|
|
110320
|
+
let params;
|
|
110321
|
+
if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
110322
|
+
params = paramsOrFirst || {};
|
|
110323
|
+
} else {
|
|
110324
|
+
params = {
|
|
110325
|
+
queries: paramsOrFirst
|
|
110326
|
+
};
|
|
110327
|
+
}
|
|
110328
|
+
const queries = params.queries;
|
|
110329
|
+
const apiPath = "/backups/restorations";
|
|
110330
|
+
const payload = {};
|
|
110331
|
+
if (typeof queries !== "undefined") {
|
|
110332
|
+
payload["queries"] = queries;
|
|
110333
|
+
}
|
|
110334
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
110335
|
+
const apiHeaders = {};
|
|
110336
|
+
return this.client.call("get", uri, apiHeaders, payload);
|
|
110337
|
+
}
|
|
110338
|
+
getRestoration(paramsOrFirst) {
|
|
110339
|
+
let params;
|
|
110340
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
110341
|
+
params = paramsOrFirst || {};
|
|
110342
|
+
} else {
|
|
110343
|
+
params = {
|
|
110344
|
+
restorationId: paramsOrFirst
|
|
110345
|
+
};
|
|
110346
|
+
}
|
|
110347
|
+
const restorationId = params.restorationId;
|
|
110348
|
+
if (typeof restorationId === "undefined") {
|
|
110349
|
+
throw new AppwriteException('Missing required parameter: "restorationId"');
|
|
110350
|
+
}
|
|
110351
|
+
const apiPath = "/backups/restorations/{restorationId}".replace("{restorationId}", restorationId);
|
|
110352
|
+
const payload = {};
|
|
110353
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
110354
|
+
const apiHeaders = {};
|
|
110355
|
+
return this.client.call("get", uri, apiHeaders, payload);
|
|
110356
|
+
}
|
|
110357
|
+
};
|
|
109926
110358
|
var Console = class {
|
|
109927
110359
|
constructor(client2) {
|
|
109928
110360
|
this.client = client2;
|
|
@@ -119757,21 +120189,26 @@ var Organizations = class {
|
|
|
119757
120189
|
const apiHeaders = {};
|
|
119758
120190
|
return this.client.call("get", uri, apiHeaders, payload);
|
|
119759
120191
|
}
|
|
119760
|
-
getScopes(paramsOrFirst) {
|
|
120192
|
+
getScopes(paramsOrFirst, ...rest) {
|
|
119761
120193
|
let params;
|
|
119762
120194
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
119763
120195
|
params = paramsOrFirst || {};
|
|
119764
120196
|
} else {
|
|
119765
120197
|
params = {
|
|
119766
|
-
organizationId: paramsOrFirst
|
|
120198
|
+
organizationId: paramsOrFirst,
|
|
120199
|
+
projectId: rest[0]
|
|
119767
120200
|
};
|
|
119768
120201
|
}
|
|
119769
120202
|
const organizationId = params.organizationId;
|
|
120203
|
+
const projectId = params.projectId;
|
|
119770
120204
|
if (typeof organizationId === "undefined") {
|
|
119771
120205
|
throw new AppwriteException('Missing required parameter: "organizationId"');
|
|
119772
120206
|
}
|
|
119773
120207
|
const apiPath = "/organizations/{organizationId}/roles".replace("{organizationId}", organizationId);
|
|
119774
120208
|
const payload = {};
|
|
120209
|
+
if (typeof projectId !== "undefined") {
|
|
120210
|
+
payload["projectId"] = projectId;
|
|
120211
|
+
}
|
|
119775
120212
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
119776
120213
|
const apiHeaders = {};
|
|
119777
120214
|
return this.client.call("get", uri, apiHeaders, payload);
|
|
@@ -131840,6 +132277,22 @@ var cliConfig = {
|
|
|
131840
132277
|
report: false,
|
|
131841
132278
|
reportData: {}
|
|
131842
132279
|
};
|
|
132280
|
+
var toJsonObject = (value) => {
|
|
132281
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
132282
|
+
return value;
|
|
132283
|
+
}
|
|
132284
|
+
return null;
|
|
132285
|
+
};
|
|
132286
|
+
var extractReportCommandArgs = (value) => {
|
|
132287
|
+
if (!value || typeof value !== "object") {
|
|
132288
|
+
return [];
|
|
132289
|
+
}
|
|
132290
|
+
const reportData = value;
|
|
132291
|
+
if (!Array.isArray(reportData.data?.args)) {
|
|
132292
|
+
return [];
|
|
132293
|
+
}
|
|
132294
|
+
return reportData.data.args;
|
|
132295
|
+
};
|
|
131843
132296
|
var parse3 = (data) => {
|
|
131844
132297
|
if (cliConfig.json) {
|
|
131845
132298
|
drawJSON(data);
|
|
@@ -131860,7 +132313,8 @@ var parse3 = (data) => {
|
|
|
131860
132313
|
console.log(`${import_chalk.default.yellow.bold(key)} : ${data[key]}`);
|
|
131861
132314
|
} else {
|
|
131862
132315
|
console.log(`${import_chalk.default.yellow.bold.underline(key)}`);
|
|
131863
|
-
|
|
132316
|
+
const tableRow = toJsonObject(data[key]) ?? {};
|
|
132317
|
+
drawTable([tableRow]);
|
|
131864
132318
|
}
|
|
131865
132319
|
} else {
|
|
131866
132320
|
console.log(`${import_chalk.default.yellow.bold(key)} : ${data[key]}`);
|
|
@@ -131872,9 +132326,7 @@ var drawTable = (data) => {
|
|
|
131872
132326
|
console.log("[]");
|
|
131873
132327
|
return;
|
|
131874
132328
|
}
|
|
131875
|
-
const rows = data.map(
|
|
131876
|
-
(item) => item && typeof item === "object" && !Array.isArray(item) ? item : {}
|
|
131877
|
-
);
|
|
132329
|
+
const rows = data.map((item) => toJsonObject(item) ?? {});
|
|
131878
132330
|
const obj = rows.reduce((res, item) => ({ ...res, ...item }), {});
|
|
131879
132331
|
const keys = Object.keys(obj);
|
|
131880
132332
|
if (keys.length === 0) {
|
|
@@ -131917,7 +132369,7 @@ var drawTable = (data) => {
|
|
|
131917
132369
|
} else if (typeof row[key] === "object") {
|
|
131918
132370
|
rowValues.push(JSON.stringify(row[key]));
|
|
131919
132371
|
} else {
|
|
131920
|
-
rowValues.push(row[key]);
|
|
132372
|
+
rowValues.push(String(row[key]));
|
|
131921
132373
|
}
|
|
131922
132374
|
}
|
|
131923
132375
|
table.push(rowValues);
|
|
@@ -131929,7 +132381,7 @@ var drawJSON = (data) => {
|
|
|
131929
132381
|
};
|
|
131930
132382
|
var parseError = (err) => {
|
|
131931
132383
|
if (cliConfig.report) {
|
|
131932
|
-
(async () => {
|
|
132384
|
+
void (async () => {
|
|
131933
132385
|
let appwriteVersion = "unknown";
|
|
131934
132386
|
const endpoint = globalConfig2.getEndpoint();
|
|
131935
132387
|
try {
|
|
@@ -131942,7 +132394,8 @@ var parseError = (err) => {
|
|
|
131942
132394
|
} catch {
|
|
131943
132395
|
}
|
|
131944
132396
|
const version4 = SDK_VERSION;
|
|
131945
|
-
const
|
|
132397
|
+
const commandArgs = extractReportCommandArgs(cliConfig.reportData);
|
|
132398
|
+
const stepsToReproduce = `Running \`${EXECUTABLE_NAME} ${commandArgs.join(" ")}\``;
|
|
131946
132399
|
const yourEnvironment = `CLI version: ${version4}
|
|
131947
132400
|
Operation System: ${import_os2.default.type()}
|
|
131948
132401
|
Appwrite version: ${appwriteVersion}
|
|
@@ -131994,7 +132447,7 @@ var actionRunner = (fn) => {
|
|
|
131994
132447
|
error48(`The '--all' and '--id' flags cannot be used together.`);
|
|
131995
132448
|
process.exit(1);
|
|
131996
132449
|
}
|
|
131997
|
-
return fn(...args).catch(parseError);
|
|
132450
|
+
return fn(...args).then(() => void 0).catch(parseError);
|
|
131998
132451
|
};
|
|
131999
132452
|
};
|
|
132000
132453
|
var parseInteger = (value) => {
|
|
@@ -132180,19 +132633,22 @@ async function paginate(action, args = {}, limit = 100, wrapper = "", queries =
|
|
|
132180
132633
|
]
|
|
132181
132634
|
});
|
|
132182
132635
|
if (wrapper === "") {
|
|
132183
|
-
|
|
132636
|
+
const listResponse = response;
|
|
132637
|
+
if (listResponse.length === 0) {
|
|
132184
132638
|
break;
|
|
132185
132639
|
}
|
|
132186
|
-
results = results.concat(
|
|
132640
|
+
results = results.concat(listResponse);
|
|
132187
132641
|
} else {
|
|
132188
|
-
|
|
132642
|
+
const wrappedResponse = response;
|
|
132643
|
+
const wrappedResults = wrappedResponse[wrapper] ?? [];
|
|
132644
|
+
if (wrappedResults.length === 0) {
|
|
132645
|
+
break;
|
|
132646
|
+
}
|
|
132647
|
+
results = results.concat(wrappedResults);
|
|
132648
|
+
total = wrappedResponse.total;
|
|
132649
|
+
if (results.length >= total) {
|
|
132189
132650
|
break;
|
|
132190
132651
|
}
|
|
132191
|
-
results = results.concat(response[wrapper]);
|
|
132192
|
-
}
|
|
132193
|
-
total = response.total;
|
|
132194
|
-
if (results.length >= total) {
|
|
132195
|
-
break;
|
|
132196
132652
|
}
|
|
132197
132653
|
pageNumber++;
|
|
132198
132654
|
}
|
|
@@ -132379,7 +132835,7 @@ var questionsInitProject = [
|
|
|
132379
132835
|
name: "organization",
|
|
132380
132836
|
message: "Choose your organization",
|
|
132381
132837
|
choices: async () => {
|
|
132382
|
-
|
|
132838
|
+
const client2 = await sdkForConsole(true);
|
|
132383
132839
|
const { teams: teams2 } = isCloud() ? await paginate(
|
|
132384
132840
|
async (opts = {}) => (await getOrganizationsService(opts.sdk)).list(),
|
|
132385
132841
|
{ sdk: client2 },
|
|
@@ -132391,7 +132847,7 @@ var questionsInitProject = [
|
|
|
132391
132847
|
100,
|
|
132392
132848
|
"teams"
|
|
132393
132849
|
);
|
|
132394
|
-
|
|
132850
|
+
const choices = teams2.map((team, _idx) => {
|
|
132395
132851
|
return {
|
|
132396
132852
|
name: `${team.name} (${team["$id"]})`,
|
|
132397
132853
|
value: team["$id"]
|
|
@@ -132440,7 +132896,7 @@ var questionsInitProject = [
|
|
|
132440
132896
|
"projects",
|
|
132441
132897
|
queries
|
|
132442
132898
|
);
|
|
132443
|
-
|
|
132899
|
+
const choices = projects2.map((project2) => {
|
|
132444
132900
|
return {
|
|
132445
132901
|
name: `${project2.name} (${project2["$id"]})`,
|
|
132446
132902
|
value: {
|
|
@@ -132461,13 +132917,13 @@ var questionsInitProject = [
|
|
|
132461
132917
|
name: "region",
|
|
132462
132918
|
message: `Select your ${SDK_TITLE} Cloud region`,
|
|
132463
132919
|
choices: async () => {
|
|
132464
|
-
|
|
132920
|
+
const client2 = await sdkForConsole(true);
|
|
132465
132921
|
const endpoint = globalConfig2.getEndpoint() || DEFAULT_ENDPOINT;
|
|
132466
|
-
|
|
132922
|
+
const response = await client2.call(
|
|
132467
132923
|
"GET",
|
|
132468
132924
|
new URL(endpoint + "/console/regions")
|
|
132469
132925
|
);
|
|
132470
|
-
|
|
132926
|
+
const regions = response.regions || [];
|
|
132471
132927
|
if (!regions.length) {
|
|
132472
132928
|
throw new Error(
|
|
132473
132929
|
"No regions found. Please check your network or Appwrite Cloud availability."
|
|
@@ -132609,9 +133065,9 @@ var questionsCreateFunction = [
|
|
|
132609
133065
|
name: "runtime",
|
|
132610
133066
|
message: "What runtime would you like to use?",
|
|
132611
133067
|
choices: async () => {
|
|
132612
|
-
|
|
132613
|
-
|
|
132614
|
-
|
|
133068
|
+
const response = await (await getFunctionsService()).listRuntimes();
|
|
133069
|
+
const runtimes = response["runtimes"];
|
|
133070
|
+
const choices = runtimes.map((runtime, _idx) => {
|
|
132615
133071
|
return {
|
|
132616
133072
|
name: `${runtime.name} (${runtime["$id"]})`,
|
|
132617
133073
|
value: {
|
|
@@ -132631,9 +133087,9 @@ var questionsCreateFunction = [
|
|
|
132631
133087
|
name: "specification",
|
|
132632
133088
|
message: "What specification would you like to use?",
|
|
132633
133089
|
choices: async () => {
|
|
132634
|
-
|
|
132635
|
-
|
|
132636
|
-
|
|
133090
|
+
const response = await (await getFunctionsService()).listSpecifications();
|
|
133091
|
+
const specifications = response["specifications"];
|
|
133092
|
+
const choices = specifications.map((spec, _idx) => {
|
|
132637
133093
|
return {
|
|
132638
133094
|
name: `${spec.cpus} CPU, ${spec.memory}MB RAM`,
|
|
132639
133095
|
value: spec.slug,
|
|
@@ -132710,7 +133166,7 @@ var questionsCreateCollection = [
|
|
|
132710
133166
|
message: "Choose the collection database",
|
|
132711
133167
|
choices: async () => {
|
|
132712
133168
|
const databases2 = localConfig.getDatabases();
|
|
132713
|
-
|
|
133169
|
+
const choices = databases2.map((database, _idx) => {
|
|
132714
133170
|
return {
|
|
132715
133171
|
name: `${database.name} (${database.$id})`,
|
|
132716
133172
|
value: database.$id
|
|
@@ -132774,7 +133230,7 @@ var questionsCreateTable = [
|
|
|
132774
133230
|
message: "Choose the table database",
|
|
132775
133231
|
choices: async () => {
|
|
132776
133232
|
const databases2 = localConfig.getTablesDBs();
|
|
132777
|
-
|
|
133233
|
+
const choices = databases2.map((database, _idx) => {
|
|
132778
133234
|
return {
|
|
132779
133235
|
name: `${database.name} (${database.$id})`,
|
|
132780
133236
|
value: database.$id
|
|
@@ -132908,9 +133364,9 @@ var questionGetEndpoint = [
|
|
|
132908
133364
|
if (!value) {
|
|
132909
133365
|
return "Please enter a valid endpoint.";
|
|
132910
133366
|
}
|
|
132911
|
-
|
|
133367
|
+
const client2 = new Client().setEndpoint(value);
|
|
132912
133368
|
try {
|
|
132913
|
-
|
|
133369
|
+
const response = await client2.call(
|
|
132914
133370
|
"get",
|
|
132915
133371
|
new URL(value + "/health/version")
|
|
132916
133372
|
);
|
|
@@ -132919,7 +133375,7 @@ var questionGetEndpoint = [
|
|
|
132919
133375
|
} else {
|
|
132920
133376
|
throw new Error();
|
|
132921
133377
|
}
|
|
132922
|
-
} catch (
|
|
133378
|
+
} catch (_error) {
|
|
132923
133379
|
return "Invalid endpoint or your Appwrite server is not running as expected.";
|
|
132924
133380
|
}
|
|
132925
133381
|
}
|
|
@@ -132997,9 +133453,9 @@ var questionsPushSites = [
|
|
|
132997
133453
|
validate: (value) => validateRequired("site", value),
|
|
132998
133454
|
when: () => localConfig.getSites().length > 0,
|
|
132999
133455
|
choices: () => {
|
|
133000
|
-
|
|
133456
|
+
const sites2 = localConfig.getSites();
|
|
133001
133457
|
checkDeployConditions(localConfig);
|
|
133002
|
-
|
|
133458
|
+
const choices = sites2.map((site, _idx) => {
|
|
133003
133459
|
return {
|
|
133004
133460
|
name: `${site.name} (${site.$id})`,
|
|
133005
133461
|
value: site.$id
|
|
@@ -133017,9 +133473,9 @@ var questionsPushFunctions = [
|
|
|
133017
133473
|
validate: (value) => validateRequired("function", value),
|
|
133018
133474
|
when: () => localConfig.getFunctions().length > 0,
|
|
133019
133475
|
choices: () => {
|
|
133020
|
-
|
|
133476
|
+
const functions2 = localConfig.getFunctions();
|
|
133021
133477
|
checkDeployConditions(localConfig);
|
|
133022
|
-
|
|
133478
|
+
const choices = functions2.map((func, _idx) => {
|
|
133023
133479
|
return {
|
|
133024
133480
|
name: `${func.name} (${func.$id})`,
|
|
133025
133481
|
value: func.$id
|
|
@@ -133037,7 +133493,7 @@ var questionsPushCollections = [
|
|
|
133037
133493
|
validate: (value) => validateRequired("collection", value),
|
|
133038
133494
|
when: () => localConfig.getCollections().length > 0,
|
|
133039
133495
|
choices: () => {
|
|
133040
|
-
|
|
133496
|
+
const collections = localConfig.getCollections();
|
|
133041
133497
|
checkDeployConditions(localConfig);
|
|
133042
133498
|
return collections.map((collection) => {
|
|
133043
133499
|
return {
|
|
@@ -133056,7 +133512,7 @@ var questionsPushTables = [
|
|
|
133056
133512
|
validate: (value) => validateRequired("table", value),
|
|
133057
133513
|
when: () => localConfig.getTables().length > 0,
|
|
133058
133514
|
choices: () => {
|
|
133059
|
-
|
|
133515
|
+
const tables = localConfig.getTables();
|
|
133060
133516
|
checkDeployConditions(localConfig);
|
|
133061
133517
|
return tables.map((table) => {
|
|
133062
133518
|
return {
|
|
@@ -133089,7 +133545,7 @@ var questionsPushBuckets = [
|
|
|
133089
133545
|
validate: (value) => validateRequired("bucket", value),
|
|
133090
133546
|
when: () => localConfig.getBuckets().length > 0,
|
|
133091
133547
|
choices: () => {
|
|
133092
|
-
|
|
133548
|
+
const buckets = localConfig.getBuckets();
|
|
133093
133549
|
checkDeployConditions(localConfig);
|
|
133094
133550
|
return buckets.map((bucket) => {
|
|
133095
133551
|
return {
|
|
@@ -133108,7 +133564,7 @@ var questionsPushMessagingTopics = [
|
|
|
133108
133564
|
validate: (value) => validateRequired("topics", value),
|
|
133109
133565
|
when: () => localConfig.getMessagingTopics().length > 0,
|
|
133110
133566
|
choices: () => {
|
|
133111
|
-
|
|
133567
|
+
const topics = localConfig.getMessagingTopics();
|
|
133112
133568
|
return topics.map((topic) => {
|
|
133113
133569
|
return {
|
|
133114
133570
|
name: `${topic.name} (${topic["$id"]})`,
|
|
@@ -133139,7 +133595,7 @@ var questionsPushTeams = [
|
|
|
133139
133595
|
validate: (value) => validateRequired("team", value),
|
|
133140
133596
|
when: () => localConfig.getTeams().length > 0,
|
|
133141
133597
|
choices: () => {
|
|
133142
|
-
|
|
133598
|
+
const teams2 = localConfig.getTeams();
|
|
133143
133599
|
checkDeployConditions(localConfig);
|
|
133144
133600
|
return teams2.map((team) => {
|
|
133145
133601
|
return {
|
|
@@ -133156,7 +133612,7 @@ var questionsListFactors = [
|
|
|
133156
133612
|
name: "factor",
|
|
133157
133613
|
message: "Your account is protected by multi-factor authentication. Please choose one for verification.",
|
|
133158
133614
|
choices: async () => {
|
|
133159
|
-
|
|
133615
|
+
const client2 = await sdkForConsole(false);
|
|
133160
133616
|
const accountClient2 = new Account(client2);
|
|
133161
133617
|
const factors = await accountClient2.listMfaFactors();
|
|
133162
133618
|
const choices = [
|
|
@@ -133201,13 +133657,13 @@ var questionsRunFunctions = [
|
|
|
133201
133657
|
message: "Which function would you like to develop locally?",
|
|
133202
133658
|
validate: (value) => validateRequired("function", value),
|
|
133203
133659
|
choices: () => {
|
|
133204
|
-
|
|
133660
|
+
const functions2 = localConfig.getFunctions();
|
|
133205
133661
|
if (functions2.length === 0) {
|
|
133206
133662
|
throw new Error(
|
|
133207
133663
|
`No functions found. Use '${EXECUTABLE_NAME} pull functions' to synchronize existing one, or use '${EXECUTABLE_NAME} init function' to create a new one.`
|
|
133208
133664
|
);
|
|
133209
133665
|
}
|
|
133210
|
-
|
|
133666
|
+
const choices = functions2.map((func, _idx) => {
|
|
133211
133667
|
return {
|
|
133212
133668
|
name: `${func.name} (${func.$id})`,
|
|
133213
133669
|
value: func.$id
|
|
@@ -133235,9 +133691,9 @@ var questionsCreateSite = [
|
|
|
133235
133691
|
name: "framework",
|
|
133236
133692
|
message: "What framework would you like to use?",
|
|
133237
133693
|
choices: async () => {
|
|
133238
|
-
|
|
133239
|
-
|
|
133240
|
-
|
|
133694
|
+
const response = await (await getSitesService()).listFrameworks();
|
|
133695
|
+
const frameworks = response["frameworks"];
|
|
133696
|
+
const choices = frameworks.map((framework) => {
|
|
133241
133697
|
return {
|
|
133242
133698
|
name: `${framework.name} (${framework.key})`,
|
|
133243
133699
|
value: framework
|
|
@@ -133251,9 +133707,9 @@ var questionsCreateSite = [
|
|
|
133251
133707
|
name: "specification",
|
|
133252
133708
|
message: "What specification would you like to use?",
|
|
133253
133709
|
choices: async () => {
|
|
133254
|
-
|
|
133255
|
-
|
|
133256
|
-
|
|
133710
|
+
const response = await (await getSitesService()).listSpecifications();
|
|
133711
|
+
const specifications = response["specifications"];
|
|
133712
|
+
const choices = specifications.map((spec) => {
|
|
133257
133713
|
return {
|
|
133258
133714
|
name: `${spec.cpus} CPU, ${spec.memory}MB RAM`,
|
|
133259
133715
|
value: spec.slug,
|
|
@@ -133437,7 +133893,7 @@ var Client3 = class _Client {
|
|
|
133437
133893
|
let json3 = void 0;
|
|
133438
133894
|
try {
|
|
133439
133895
|
json3 = JSON.parse(text2);
|
|
133440
|
-
} catch (
|
|
133896
|
+
} catch (_error) {
|
|
133441
133897
|
throw new AppwriteException(text2, response.status, "", text2);
|
|
133442
133898
|
}
|
|
133443
133899
|
if (path16 !== "/account" && json3.code === 401 && json3.type === "user_more_factors_required") {
|
|
@@ -133471,7 +133927,7 @@ var Client3 = class _Client {
|
|
|
133471
133927
|
let json2 = void 0;
|
|
133472
133928
|
try {
|
|
133473
133929
|
json2 = JSONBig.parse(text);
|
|
133474
|
-
} catch (
|
|
133930
|
+
} catch (_error) {
|
|
133475
133931
|
return text;
|
|
133476
133932
|
}
|
|
133477
133933
|
return json2;
|
|
@@ -133542,11 +133998,11 @@ var completeMfaLogin = async ({
|
|
|
133542
133998
|
};
|
|
133543
133999
|
var deleteServerSession = async (sessionId) => {
|
|
133544
134000
|
try {
|
|
133545
|
-
|
|
133546
|
-
|
|
134001
|
+
const client2 = await sdkForConsole();
|
|
134002
|
+
const accountClient2 = new Account(client2);
|
|
133547
134003
|
await accountClient2.deleteSession(sessionId);
|
|
133548
134004
|
return true;
|
|
133549
|
-
} catch (
|
|
134005
|
+
} catch (_e) {
|
|
133550
134006
|
return false;
|
|
133551
134007
|
}
|
|
133552
134008
|
};
|
|
@@ -133631,7 +134087,7 @@ var loginCommand = async ({
|
|
|
133631
134087
|
globalConfig2.setEndpoint(configEndpoint);
|
|
133632
134088
|
globalConfig2.setEmail(answers.email);
|
|
133633
134089
|
const legacyClient = createLegacyConsoleClient(configEndpoint);
|
|
133634
|
-
|
|
134090
|
+
const client2 = await sdkForConsole(false);
|
|
133635
134091
|
let accountClient2 = new Account(client2);
|
|
133636
134092
|
let account2;
|
|
133637
134093
|
try {
|
|
@@ -133681,8 +134137,8 @@ var whoami = new Command("whoami").description(commandDescriptions["whoami"]).ac
|
|
|
133681
134137
|
error48("No user is signed in. To sign in, run 'appwrite login'");
|
|
133682
134138
|
return;
|
|
133683
134139
|
}
|
|
133684
|
-
|
|
133685
|
-
|
|
134140
|
+
const client2 = await sdkForConsole(false);
|
|
134141
|
+
const accountClient2 = new Account(client2);
|
|
133686
134142
|
let account2;
|
|
133687
134143
|
try {
|
|
133688
134144
|
account2 = await accountClient2.get();
|
|
@@ -133806,7 +134262,7 @@ var client = new Command("client").description(commandDescriptions["client"]).co
|
|
|
133806
134262
|
const tail = cookieValue.length > 8 ? cookieValue.slice(-8) : cookieValue || "********";
|
|
133807
134263
|
maskedCookie = `${cookieName}=...${tail}`;
|
|
133808
134264
|
}
|
|
133809
|
-
|
|
134265
|
+
const config2 = {
|
|
133810
134266
|
endpoint: globalConfig2.getEndpoint(),
|
|
133811
134267
|
key: maskedKey,
|
|
133812
134268
|
cookie: maskedCookie,
|
|
@@ -133819,16 +134275,16 @@ var client = new Command("client").description(commandDescriptions["client"]).co
|
|
|
133819
134275
|
if (endpoint !== void 0) {
|
|
133820
134276
|
try {
|
|
133821
134277
|
const id = id_default2.unique();
|
|
133822
|
-
|
|
134278
|
+
const url2 = new URL(endpoint);
|
|
133823
134279
|
if (url2.protocol !== "http:" && url2.protocol !== "https:") {
|
|
133824
134280
|
throw new Error();
|
|
133825
134281
|
}
|
|
133826
|
-
|
|
134282
|
+
const clientInstance = new Client().setEndpoint(endpoint);
|
|
133827
134283
|
clientInstance.setProject("console");
|
|
133828
134284
|
if (selfSigned || globalConfig2.getSelfSigned()) {
|
|
133829
134285
|
clientInstance.setSelfSigned(true);
|
|
133830
134286
|
}
|
|
133831
|
-
|
|
134287
|
+
const response = await clientInstance.call(
|
|
133832
134288
|
"GET",
|
|
133833
134289
|
new URL(endpoint + "/health/version")
|
|
133834
134290
|
);
|
|
@@ -133979,6 +134435,9 @@ async function downloadDeploymentCode(params) {
|
|
|
133979
134435
|
{},
|
|
133980
134436
|
"arrayBuffer"
|
|
133981
134437
|
);
|
|
134438
|
+
if (!(downloadBuffer instanceof ArrayBuffer)) {
|
|
134439
|
+
throw new Error("Failed to download deployment archive as ArrayBuffer.");
|
|
134440
|
+
}
|
|
133982
134441
|
try {
|
|
133983
134442
|
import_fs3.default.writeFileSync(compressedFileName, Buffer.from(downloadBuffer));
|
|
133984
134443
|
} catch (err) {
|
|
@@ -134057,7 +134516,7 @@ var getConfirmation = async () => {
|
|
|
134057
134516
|
}
|
|
134058
134517
|
return answers2.changes;
|
|
134059
134518
|
}
|
|
134060
|
-
|
|
134519
|
+
const answers = await import_inquirer2.default.prompt(questionPushChanges);
|
|
134061
134520
|
if (answers.changes !== "YES" && answers.changes !== "NO") {
|
|
134062
134521
|
answers.changes = await fixConfirmation();
|
|
134063
134522
|
}
|
|
@@ -134107,7 +134566,7 @@ var approveChanges = async (resource, resourceGetFunction, keys, resourceName, r
|
|
|
134107
134566
|
options[secondResourceName] = localResource[secondId];
|
|
134108
134567
|
}
|
|
134109
134568
|
const remoteResource = await resourceGetFunction(options);
|
|
134110
|
-
for (
|
|
134569
|
+
for (const [key, value] of Object.entries(
|
|
134111
134570
|
whitelistKeys(remoteResource, keys)
|
|
134112
134571
|
)) {
|
|
134113
134572
|
if (skipKeys.includes(key)) {
|
|
@@ -134116,28 +134575,30 @@ var approveChanges = async (resource, resourceGetFunction, keys, resourceName, r
|
|
|
134116
134575
|
if (isEmpty(value) && isEmpty(localResource[key])) {
|
|
134117
134576
|
continue;
|
|
134118
134577
|
}
|
|
134119
|
-
|
|
134120
|
-
|
|
134578
|
+
const localValue = localResource[key];
|
|
134579
|
+
if (Array.isArray(value) && Array.isArray(localValue)) {
|
|
134580
|
+
if (JSON.stringify(value) !== JSON.stringify(localValue)) {
|
|
134121
134581
|
changes.push({
|
|
134122
134582
|
id: localResource["$id"],
|
|
134123
134583
|
key,
|
|
134124
134584
|
remote: import_chalk4.default.red(value.join("\n")),
|
|
134125
|
-
local: import_chalk4.default.green(
|
|
134585
|
+
local: import_chalk4.default.green(
|
|
134586
|
+
localValue.map((entry) => String(entry)).join("\n")
|
|
134587
|
+
)
|
|
134126
134588
|
});
|
|
134127
134589
|
}
|
|
134128
|
-
} else if (value !==
|
|
134590
|
+
} else if (value !== localValue) {
|
|
134129
134591
|
changes.push({
|
|
134130
134592
|
id: localResource["$id"],
|
|
134131
134593
|
key,
|
|
134132
|
-
remote: import_chalk4.default.red(value),
|
|
134133
|
-
local: import_chalk4.default.green(
|
|
134594
|
+
remote: import_chalk4.default.red(String(value ?? "")),
|
|
134595
|
+
local: import_chalk4.default.green(String(localValue ?? ""))
|
|
134134
134596
|
});
|
|
134135
134597
|
}
|
|
134136
134598
|
}
|
|
134137
134599
|
} catch (e) {
|
|
134138
|
-
|
|
134139
|
-
|
|
134140
|
-
}
|
|
134600
|
+
const isNotFound = e instanceof AppwriteException && Number(e.code) === 404;
|
|
134601
|
+
if (!isNotFound) throw e;
|
|
134141
134602
|
}
|
|
134142
134603
|
})
|
|
134143
134604
|
);
|
|
@@ -134159,8 +134620,8 @@ async function createPullInstance(options = {
|
|
|
134159
134620
|
}) {
|
|
134160
134621
|
const { silent, requiresConsoleAuth } = options;
|
|
134161
134622
|
const projectClient2 = await sdkForProject();
|
|
134162
|
-
const
|
|
134163
|
-
const pullInstance = new Pull(projectClient2,
|
|
134623
|
+
const consoleClient = await sdkForConsole(requiresConsoleAuth);
|
|
134624
|
+
const pullInstance = new Pull(projectClient2, consoleClient, silent);
|
|
134164
134625
|
pullInstance.setConfigDirectoryPath(localConfig.configDirectoryPath);
|
|
134165
134626
|
return pullInstance;
|
|
134166
134627
|
}
|
|
@@ -134169,9 +134630,9 @@ var Pull = class {
|
|
|
134169
134630
|
consoleClient;
|
|
134170
134631
|
configDirectoryPath;
|
|
134171
134632
|
silent;
|
|
134172
|
-
constructor(projectClient2,
|
|
134633
|
+
constructor(projectClient2, consoleClient, silent = false) {
|
|
134173
134634
|
this.projectClient = projectClient2;
|
|
134174
|
-
this.consoleClient =
|
|
134635
|
+
this.consoleClient = consoleClient;
|
|
134175
134636
|
this.configDirectoryPath = process.cwd();
|
|
134176
134637
|
this.silent = silent;
|
|
134177
134638
|
}
|
|
@@ -134660,7 +135121,7 @@ var pullResources = async ({
|
|
|
134660
135121
|
delete actions.collections;
|
|
134661
135122
|
}
|
|
134662
135123
|
if (cliConfig.all) {
|
|
134663
|
-
for (
|
|
135124
|
+
for (const action of Object.values(actions)) {
|
|
134664
135125
|
cliConfig.all = true;
|
|
134665
135126
|
await action({ returnOnZero: true });
|
|
134666
135127
|
}
|
|
@@ -134899,7 +135360,6 @@ var initProject = async ({
|
|
|
134899
135360
|
projectId,
|
|
134900
135361
|
projectName
|
|
134901
135362
|
} = {}) => {
|
|
134902
|
-
let response = {};
|
|
134903
135363
|
try {
|
|
134904
135364
|
if (globalConfig2.getEndpoint() === "" || globalConfig2.getCookie() === "") {
|
|
134905
135365
|
throw new Error(
|
|
@@ -134909,33 +135369,39 @@ var initProject = async ({
|
|
|
134909
135369
|
const client2 = await sdkForConsole();
|
|
134910
135370
|
const accountClient2 = new Account(client2);
|
|
134911
135371
|
await accountClient2.get();
|
|
134912
|
-
} catch (
|
|
135372
|
+
} catch (_e) {
|
|
134913
135373
|
error48(
|
|
134914
135374
|
`Error Session not found. Please run '${EXECUTABLE_NAME} login' to create a session`
|
|
134915
135375
|
);
|
|
134916
135376
|
process.exit(1);
|
|
134917
135377
|
}
|
|
134918
|
-
let answers
|
|
135378
|
+
let answers;
|
|
134919
135379
|
if (!organizationId && !projectId && !projectName) {
|
|
134920
135380
|
answers = await import_inquirer4.default.prompt(questionsInitProject);
|
|
134921
135381
|
if (answers.override === false) {
|
|
134922
135382
|
process.exit(1);
|
|
134923
135383
|
}
|
|
134924
135384
|
} else {
|
|
134925
|
-
|
|
134926
|
-
|
|
134927
|
-
|
|
134928
|
-
answers
|
|
134929
|
-
|
|
134930
|
-
|
|
135385
|
+
const selectedOrganization = organizationId ?? (await import_inquirer4.default.prompt([questionsInitProject[2]])).organization;
|
|
135386
|
+
const selectedProjectName = projectName ?? (await import_inquirer4.default.prompt([questionsInitProject[3]])).project;
|
|
135387
|
+
const selectedProjectId = projectId ?? (await import_inquirer4.default.prompt([questionsInitProject[4]])).id;
|
|
135388
|
+
answers = {
|
|
135389
|
+
start: "existing",
|
|
135390
|
+
project: selectedProjectId,
|
|
135391
|
+
organization: selectedOrganization
|
|
135392
|
+
};
|
|
134931
135393
|
try {
|
|
134932
135394
|
const projectsService = await getProjectsService();
|
|
134933
|
-
await projectsService.get(
|
|
135395
|
+
const existingProject = await projectsService.get(selectedProjectId);
|
|
135396
|
+
answers.project = existingProject;
|
|
134934
135397
|
} catch (e) {
|
|
134935
|
-
if (e.code === 404) {
|
|
134936
|
-
answers
|
|
134937
|
-
|
|
134938
|
-
|
|
135398
|
+
if (e instanceof AppwriteException && e.code === 404) {
|
|
135399
|
+
answers = {
|
|
135400
|
+
start: "new",
|
|
135401
|
+
id: selectedProjectId,
|
|
135402
|
+
project: selectedProjectName,
|
|
135403
|
+
organization: selectedOrganization
|
|
135404
|
+
};
|
|
134939
135405
|
} else {
|
|
134940
135406
|
throw e;
|
|
134941
135407
|
}
|
|
@@ -134944,10 +135410,26 @@ var initProject = async ({
|
|
|
134944
135410
|
localConfig.clear();
|
|
134945
135411
|
const url2 = new URL(DEFAULT_ENDPOINT);
|
|
134946
135412
|
if (answers.start === "new") {
|
|
135413
|
+
let projectIdToCreate;
|
|
135414
|
+
let projectNameToCreate;
|
|
135415
|
+
switch (typeof answers.project) {
|
|
135416
|
+
case "string":
|
|
135417
|
+
projectIdToCreate = answers.id ?? answers.project;
|
|
135418
|
+
projectNameToCreate = answers.project;
|
|
135419
|
+
break;
|
|
135420
|
+
case "object":
|
|
135421
|
+
projectIdToCreate = answers.id ?? answers.project.$id;
|
|
135422
|
+
projectNameToCreate = answers.project.name ?? answers.project.$id;
|
|
135423
|
+
break;
|
|
135424
|
+
default:
|
|
135425
|
+
projectIdToCreate = answers.id;
|
|
135426
|
+
projectNameToCreate = "";
|
|
135427
|
+
break;
|
|
135428
|
+
}
|
|
134947
135429
|
const projectsService = await getProjectsService();
|
|
134948
|
-
response = await projectsService.create(
|
|
134949
|
-
|
|
134950
|
-
|
|
135430
|
+
const response = await projectsService.create(
|
|
135431
|
+
projectIdToCreate,
|
|
135432
|
+
projectNameToCreate,
|
|
134951
135433
|
answers.organization,
|
|
134952
135434
|
answers.region
|
|
134953
135435
|
);
|
|
@@ -134958,10 +135440,22 @@ var initProject = async ({
|
|
|
134958
135440
|
);
|
|
134959
135441
|
}
|
|
134960
135442
|
} else {
|
|
134961
|
-
|
|
134962
|
-
|
|
135443
|
+
let selectedProject;
|
|
135444
|
+
switch (typeof answers.project) {
|
|
135445
|
+
case "string":
|
|
135446
|
+
selectedProject = { $id: answers.project };
|
|
135447
|
+
break;
|
|
135448
|
+
case "object":
|
|
135449
|
+
selectedProject = answers.project;
|
|
135450
|
+
break;
|
|
135451
|
+
default:
|
|
135452
|
+
selectedProject = { $id: "" };
|
|
135453
|
+
break;
|
|
135454
|
+
}
|
|
135455
|
+
localConfig.setProject(selectedProject.$id);
|
|
135456
|
+
if (isCloud() && selectedProject.region) {
|
|
134963
135457
|
localConfig.setEndpoint(
|
|
134964
|
-
`https://${
|
|
135458
|
+
`https://${selectedProject.region}.${url2.host}${url2.pathname}`
|
|
134965
135459
|
);
|
|
134966
135460
|
}
|
|
134967
135461
|
}
|
|
@@ -134969,8 +135463,10 @@ var initProject = async ({
|
|
|
134969
135463
|
`Project successfully ${answers.start === "existing" ? "linked" : "created"}. Details are now stored in appwrite.config.json file.`
|
|
134970
135464
|
);
|
|
134971
135465
|
if (answers.start === "existing") {
|
|
134972
|
-
|
|
134973
|
-
|
|
135466
|
+
const autopullAnswers = await import_inquirer4.default.prompt(
|
|
135467
|
+
questionsInitProjectAutopull
|
|
135468
|
+
);
|
|
135469
|
+
if (autopullAnswers.autopull) {
|
|
134974
135470
|
cliConfig.all = true;
|
|
134975
135471
|
cliConfig.force = true;
|
|
134976
135472
|
await pullResources({
|
|
@@ -135110,7 +135606,6 @@ var initFunction = async () => {
|
|
|
135110
135606
|
import_fs5.default.mkdirSync(functionDir, { mode: 511 });
|
|
135111
135607
|
import_fs5.default.mkdirSync(templatesDir, { mode: 511 });
|
|
135112
135608
|
const repo = "https://github.com/appwrite/templates";
|
|
135113
|
-
const api = `https://api.github.com/repos/appwrite/templates/contents/${answers.runtime.name}`;
|
|
135114
135609
|
let selected = { template: "starter" };
|
|
135115
135610
|
const sparse = (selected ? `${answers.runtime.name}/${selected.template}` : answers.runtime.name).toLowerCase();
|
|
135116
135611
|
let gitInitCommands = `git clone --single-branch --depth 1 --sparse ${repo} .`;
|
|
@@ -135129,17 +135624,18 @@ var initFunction = async () => {
|
|
|
135129
135624
|
cwd: templatesDir
|
|
135130
135625
|
});
|
|
135131
135626
|
} catch (err) {
|
|
135132
|
-
|
|
135627
|
+
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
135628
|
+
if (errorMessage.includes("error: unknown option")) {
|
|
135133
135629
|
throw new Error(
|
|
135134
|
-
`${
|
|
135630
|
+
`${errorMessage}
|
|
135135
135631
|
|
|
135136
135632
|
Suggestion: Try updating your git to the latest version, then trying to run this command again.`
|
|
135137
135633
|
);
|
|
135138
|
-
} else if (
|
|
135634
|
+
} else if (errorMessage.includes(
|
|
135139
135635
|
"is not recognized as an internal or external command,"
|
|
135140
|
-
) ||
|
|
135636
|
+
) || errorMessage.includes("command not found")) {
|
|
135141
135637
|
throw new Error(
|
|
135142
|
-
`${
|
|
135638
|
+
`${errorMessage}
|
|
135143
135639
|
|
|
135144
135640
|
Suggestion: It appears that git is not installed, try installing git then trying to run this command again.`
|
|
135145
135641
|
);
|
|
@@ -135161,9 +135657,9 @@ Suggestion: It appears that git is not installed, try installing git then trying
|
|
|
135161
135657
|
}
|
|
135162
135658
|
}
|
|
135163
135659
|
const copyRecursiveSync = (src, dest) => {
|
|
135164
|
-
|
|
135165
|
-
|
|
135166
|
-
|
|
135660
|
+
const exists = import_fs5.default.existsSync(src);
|
|
135661
|
+
const stats = exists && import_fs5.default.statSync(src);
|
|
135662
|
+
const isDirectory = exists && stats && stats.isDirectory();
|
|
135167
135663
|
if (isDirectory) {
|
|
135168
135664
|
if (!import_fs5.default.existsSync(dest)) {
|
|
135169
135665
|
import_fs5.default.mkdirSync(dest);
|
|
@@ -135191,7 +135687,7 @@ Suggestion: It appears that git is not installed, try installing git then trying
|
|
|
135191
135687
|
newReadmeFile[0] = `# ${answers.name}`;
|
|
135192
135688
|
newReadmeFile.splice(1, 2);
|
|
135193
135689
|
import_fs5.default.writeFileSync(readmePath, newReadmeFile.join("\n"));
|
|
135194
|
-
|
|
135690
|
+
const data = {
|
|
135195
135691
|
$id: functionId,
|
|
135196
135692
|
name: answers.name,
|
|
135197
135693
|
runtime: answers.runtime.id,
|
|
@@ -135247,14 +135743,15 @@ var initSite = async () => {
|
|
|
135247
135743
|
}
|
|
135248
135744
|
templateDetails = response.templates[0];
|
|
135249
135745
|
} catch (err) {
|
|
135746
|
+
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
135250
135747
|
throw new Error(
|
|
135251
|
-
`Failed to fetch template for framework ${answers.framework.key}: ${
|
|
135748
|
+
`Failed to fetch template for framework ${answers.framework.key}: ${errorMessage}`
|
|
135252
135749
|
);
|
|
135253
135750
|
}
|
|
135254
135751
|
import_fs5.default.mkdirSync(siteDir, { mode: 511 });
|
|
135255
135752
|
import_fs5.default.mkdirSync(templatesDir, { mode: 511 });
|
|
135256
135753
|
const repo = `https://github.com/${templateDetails.providerOwner}/${templateDetails.providerRepositoryId}`;
|
|
135257
|
-
|
|
135754
|
+
const selected = {
|
|
135258
135755
|
template: templateDetails.frameworks[0].providerRootDirectory
|
|
135259
135756
|
};
|
|
135260
135757
|
let dirSetupCommands = "";
|
|
@@ -135279,12 +135776,12 @@ var initSite = async () => {
|
|
|
135279
135776
|
git config remote.origin.tagopt --no-tags
|
|
135280
135777
|
`.trim();
|
|
135281
135778
|
}
|
|
135282
|
-
|
|
135779
|
+
const windowsGitCloneCommands = `
|
|
135283
135780
|
$tag = (git ls-remote --tags origin "${templateDetails.providerVersion}" | Select-Object -Last 1) -replace '.*refs/tags/', ''
|
|
135284
135781
|
git fetch --depth=1 origin "refs/tags/$tag"
|
|
135285
135782
|
git checkout FETCH_HEAD
|
|
135286
135783
|
`.trim();
|
|
135287
|
-
|
|
135784
|
+
const unixGitCloneCommands = `
|
|
135288
135785
|
git fetch --depth=1 origin refs/tags/$(git ls-remote --tags origin "${templateDetails.providerVersion}" | tail -n 1 | awk -F '/' '{print $3}')
|
|
135289
135786
|
git checkout FETCH_HEAD
|
|
135290
135787
|
`.trim();
|
|
@@ -135302,17 +135799,18 @@ var initSite = async () => {
|
|
|
135302
135799
|
shell: usedShell
|
|
135303
135800
|
});
|
|
135304
135801
|
} catch (err) {
|
|
135305
|
-
|
|
135802
|
+
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
135803
|
+
if (errorMessage.includes("error: unknown option")) {
|
|
135306
135804
|
throw new Error(
|
|
135307
|
-
`${
|
|
135805
|
+
`${errorMessage}
|
|
135308
135806
|
|
|
135309
135807
|
Suggestion: Try updating your git to the latest version, then trying to run this command again.`
|
|
135310
135808
|
);
|
|
135311
|
-
} else if (
|
|
135809
|
+
} else if (errorMessage.includes(
|
|
135312
135810
|
"is not recognized as an internal or external command,"
|
|
135313
|
-
) ||
|
|
135811
|
+
) || errorMessage.includes("command not found")) {
|
|
135314
135812
|
throw new Error(
|
|
135315
|
-
`${
|
|
135813
|
+
`${errorMessage}
|
|
135316
135814
|
|
|
135317
135815
|
Suggestion: It appears that git is not installed, try installing git then trying to run this command again.`
|
|
135318
135816
|
);
|
|
@@ -135333,24 +135831,22 @@ Suggestion: It appears that git is not installed, try installing git then trying
|
|
|
135333
135831
|
newReadmeFile[0] = `# ${answers.name}`;
|
|
135334
135832
|
newReadmeFile.splice(1, 2);
|
|
135335
135833
|
import_fs5.default.writeFileSync(readmePath, newReadmeFile.join("\n"));
|
|
135336
|
-
|
|
135337
|
-
|
|
135834
|
+
const vars = {};
|
|
135835
|
+
for (const variable of templateDetails.variables ?? []) {
|
|
135836
|
+
let value = variable.value ?? "";
|
|
135338
135837
|
const replacements = {
|
|
135339
135838
|
"{apiEndpoint}": globalConfig2.getEndpoint(),
|
|
135340
|
-
"{projectId}": localConfig.getProject().projectId,
|
|
135341
|
-
"{projectName}": localConfig.getProject().projectName
|
|
135839
|
+
"{projectId}": localConfig.getProject().projectId ?? "",
|
|
135840
|
+
"{projectName}": localConfig.getProject().projectName ?? ""
|
|
135342
135841
|
};
|
|
135343
135842
|
for (const placeholder in replacements) {
|
|
135344
|
-
if (value
|
|
135843
|
+
if (value.includes(placeholder)) {
|
|
135345
135844
|
value = value.replace(placeholder, replacements[placeholder]);
|
|
135346
135845
|
}
|
|
135347
135846
|
}
|
|
135348
|
-
|
|
135349
|
-
|
|
135350
|
-
|
|
135351
|
-
};
|
|
135352
|
-
});
|
|
135353
|
-
let data = {
|
|
135847
|
+
vars[variable.name] = value;
|
|
135848
|
+
}
|
|
135849
|
+
const data = {
|
|
135354
135850
|
$id: siteId,
|
|
135355
135851
|
name: answers.name,
|
|
135356
135852
|
framework: answers.framework.key,
|
|
@@ -136817,12 +137313,10 @@ var typesCommand = actionRunner(
|
|
|
136817
137313
|
log(`Directory: ${outputDirectory} does not exist, creating...`);
|
|
136818
137314
|
import_fs9.default.mkdirSync(outputDirectory, { recursive: true });
|
|
136819
137315
|
}
|
|
136820
|
-
|
|
137316
|
+
const tables = localConfig.getTables();
|
|
136821
137317
|
let collections = [];
|
|
136822
|
-
let dataSource = "tables";
|
|
136823
137318
|
if (tables.length === 0) {
|
|
136824
137319
|
collections = localConfig.getCollections();
|
|
136825
|
-
dataSource = "collections";
|
|
136826
137320
|
if (collections.length === 0) {
|
|
136827
137321
|
const configFileName = import_path9.default.basename(localConfig.path);
|
|
136828
137322
|
throw new Error(
|
|
@@ -136994,9 +137488,9 @@ var JwtManager = {
|
|
|
136994
137488
|
timerWarn: null,
|
|
136995
137489
|
timerError: null,
|
|
136996
137490
|
async setup(userId = null, projectScopes = []) {
|
|
136997
|
-
const
|
|
136998
|
-
const usersClient2 = new Users(
|
|
136999
|
-
const projectsClient2 = new Projects(
|
|
137491
|
+
const consoleClient = await sdkForConsole();
|
|
137492
|
+
const usersClient2 = new Users(consoleClient);
|
|
137493
|
+
const projectsClient2 = new Projects(consoleClient);
|
|
137000
137494
|
if (this.timerWarn) {
|
|
137001
137495
|
clearTimeout(this.timerWarn);
|
|
137002
137496
|
}
|
|
@@ -137277,9 +137771,8 @@ async function dockerStart(func, variables, port) {
|
|
|
137277
137771
|
try {
|
|
137278
137772
|
await waitUntilPortOpen(port);
|
|
137279
137773
|
} catch (err) {
|
|
137280
|
-
|
|
137281
|
-
|
|
137282
|
-
);
|
|
137774
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
137775
|
+
error48(`Failed to start function with error: ${message}`);
|
|
137283
137776
|
return;
|
|
137284
137777
|
}
|
|
137285
137778
|
success2(`Visit http://localhost:${port}/ to execute your function.`);
|
|
@@ -137446,7 +137939,7 @@ var runFunction = async ({
|
|
|
137446
137939
|
});
|
|
137447
137940
|
} catch (err) {
|
|
137448
137941
|
warn(
|
|
137449
|
-
"Remote variables not fetched. Production environment variables will not be available. Reason: " + err
|
|
137942
|
+
"Remote variables not fetched. Production environment variables will not be available. Reason: " + getErrorMessage(err)
|
|
137450
137943
|
);
|
|
137451
137944
|
}
|
|
137452
137945
|
}
|
|
@@ -137470,7 +137963,7 @@ var runFunction = async ({
|
|
|
137470
137963
|
await JwtManager.setup(userId, func.scopes ?? []);
|
|
137471
137964
|
} catch (err) {
|
|
137472
137965
|
warn(
|
|
137473
|
-
"Dynamic API key not generated. Header x-appwrite-key will not be set. Reason: " + err
|
|
137966
|
+
"Dynamic API key not generated. Header x-appwrite-key will not be set. Reason: " + getErrorMessage(err)
|
|
137474
137967
|
);
|
|
137475
137968
|
}
|
|
137476
137969
|
const headers = {};
|
|
@@ -137970,7 +138463,7 @@ var Spinner = class _Spinner {
|
|
|
137970
138463
|
static stop() {
|
|
137971
138464
|
_Spinner.updatesBar.stop();
|
|
137972
138465
|
}
|
|
137973
|
-
static formatter(
|
|
138466
|
+
static formatter(_options, _params, payload) {
|
|
137974
138467
|
const status = payload.status.padEnd(12);
|
|
137975
138468
|
const middle = `${payload.resource} (${payload.id})`.padEnd(40);
|
|
137976
138469
|
let prefix = import_chalk8.default.cyan(payload.prefix ?? "\u29D7");
|
|
@@ -138055,7 +138548,7 @@ var Pools = class {
|
|
|
138055
138548
|
return true;
|
|
138056
138549
|
}
|
|
138057
138550
|
if (this.pollMaxDebounces === this.POLL_DEFAULT_VALUE) {
|
|
138058
|
-
|
|
138551
|
+
const steps = Math.max(1, Math.ceil(Number(total) / this.STEP_SIZE));
|
|
138059
138552
|
if (steps > 1 && iteration === 1) {
|
|
138060
138553
|
this.pollMaxDebounces *= steps;
|
|
138061
138554
|
log(
|
|
@@ -138081,7 +138574,7 @@ var Pools = class {
|
|
|
138081
138574
|
return true;
|
|
138082
138575
|
}
|
|
138083
138576
|
if (this.pollMaxDebounces === this.POLL_DEFAULT_VALUE) {
|
|
138084
|
-
|
|
138577
|
+
const steps = Math.max(1, Math.ceil(Number(total) / this.STEP_SIZE));
|
|
138085
138578
|
if (steps > 1 && iteration === 1) {
|
|
138086
138579
|
this.pollMaxDebounces *= steps;
|
|
138087
138580
|
log(
|
|
@@ -138097,7 +138590,10 @@ var Pools = class {
|
|
|
138097
138590
|
return false;
|
|
138098
138591
|
}
|
|
138099
138592
|
if (this.pollMaxDebounces === this.POLL_DEFAULT_VALUE) {
|
|
138100
|
-
|
|
138593
|
+
const steps = Math.max(
|
|
138594
|
+
1,
|
|
138595
|
+
Math.ceil(attributeKeys.length / this.STEP_SIZE)
|
|
138596
|
+
);
|
|
138101
138597
|
if (steps > 1 && iteration === 1) {
|
|
138102
138598
|
this.pollMaxDebounces *= steps;
|
|
138103
138599
|
log(
|
|
@@ -138140,7 +138636,10 @@ var Pools = class {
|
|
|
138140
138636
|
return false;
|
|
138141
138637
|
}
|
|
138142
138638
|
if (this.pollMaxDebounces === this.POLL_DEFAULT_VALUE) {
|
|
138143
|
-
|
|
138639
|
+
const steps = Math.max(
|
|
138640
|
+
1,
|
|
138641
|
+
Math.ceil(attributeKeys.length / this.STEP_SIZE)
|
|
138642
|
+
);
|
|
138144
138643
|
if (steps > 1 && iteration === 1) {
|
|
138145
138644
|
this.pollMaxDebounces *= steps;
|
|
138146
138645
|
log(
|
|
@@ -138189,7 +138688,7 @@ var Pools = class {
|
|
|
138189
138688
|
return false;
|
|
138190
138689
|
}
|
|
138191
138690
|
if (this.pollMaxDebounces === this.POLL_DEFAULT_VALUE) {
|
|
138192
|
-
|
|
138691
|
+
const steps = Math.max(1, Math.ceil(indexKeys.length / this.STEP_SIZE));
|
|
138193
138692
|
if (steps > 1 && iteration === 1) {
|
|
138194
138693
|
this.pollMaxDebounces *= steps;
|
|
138195
138694
|
log(
|
|
@@ -138282,7 +138781,7 @@ var Attributes = class {
|
|
|
138282
138781
|
}
|
|
138283
138782
|
return answers2.changes;
|
|
138284
138783
|
}
|
|
138285
|
-
|
|
138784
|
+
const answers = await import_inquirer6.default.prompt(questionPushChanges2);
|
|
138286
138785
|
if (answers.changes !== "YES" && answers.changes !== "NO") {
|
|
138287
138786
|
answers.changes = await fixConfirmation();
|
|
138288
138787
|
}
|
|
@@ -138325,8 +138824,8 @@ var Attributes = class {
|
|
|
138325
138824
|
const keyName = `${import_chalk9.default.yellow(local.key)} in ${collection.name} (${collection["$id"]})`;
|
|
138326
138825
|
const action = import_chalk9.default.cyan(recreating ? "recreating" : "changing");
|
|
138327
138826
|
let reason = "";
|
|
138328
|
-
|
|
138329
|
-
for (
|
|
138827
|
+
const attribute = recreating ? remote : local;
|
|
138828
|
+
for (const key of Object.keys(remote)) {
|
|
138330
138829
|
if (!KeysAttributes.has(key)) {
|
|
138331
138830
|
continue;
|
|
138332
138831
|
}
|
|
@@ -138836,7 +139335,7 @@ var Attributes = class {
|
|
|
138836
139335
|
createIndexes = async (indexes, collection) => {
|
|
138837
139336
|
log(`Creating indexes ...`);
|
|
138838
139337
|
const databasesService = await getDatabasesService(this.client);
|
|
138839
|
-
for (
|
|
139338
|
+
for (const index of indexes) {
|
|
138840
139339
|
await databasesService.createIndex({
|
|
138841
139340
|
databaseId: collection["databaseId"],
|
|
138842
139341
|
collectionId: collection["$id"],
|
|
@@ -138860,7 +139359,7 @@ var Attributes = class {
|
|
|
138860
139359
|
};
|
|
138861
139360
|
createAttributes = async (attributes, collection) => {
|
|
138862
139361
|
log(`Creating attributes ...`);
|
|
138863
|
-
for (
|
|
139362
|
+
for (const attribute of attributes) {
|
|
138864
139363
|
if (attribute.side !== "child") {
|
|
138865
139364
|
await this.createAttribute(
|
|
138866
139365
|
collection["databaseId"],
|
|
@@ -138884,7 +139383,7 @@ var Attributes = class {
|
|
|
138884
139383
|
};
|
|
138885
139384
|
createColumns = async (columns, table) => {
|
|
138886
139385
|
log(`Creating columns ...`);
|
|
138887
|
-
for (
|
|
139386
|
+
for (const column of columns) {
|
|
138888
139387
|
if (column.side !== "child") {
|
|
138889
139388
|
await this.createAttribute(table["databaseId"], table["$id"], column);
|
|
138890
139389
|
}
|
|
@@ -138906,18 +139405,37 @@ var Attributes = class {
|
|
|
138906
139405
|
|
|
138907
139406
|
// lib/commands/utils/database-sync.ts
|
|
138908
139407
|
var import_chalk10 = __toESM(require_source(), 1);
|
|
139408
|
+
var isTablesDBResource = (value) => {
|
|
139409
|
+
if (!value || typeof value !== "object") {
|
|
139410
|
+
return false;
|
|
139411
|
+
}
|
|
139412
|
+
return "$id" in value && typeof value.$id === "string" && "name" in value && typeof value.name === "string" && "enabled" in value && typeof value.enabled === "boolean";
|
|
139413
|
+
};
|
|
139414
|
+
var getSyncErrorMessage = (err) => {
|
|
139415
|
+
if (err instanceof AppwriteException) {
|
|
139416
|
+
return err.message;
|
|
139417
|
+
}
|
|
139418
|
+
if (err instanceof Error) {
|
|
139419
|
+
return err.message;
|
|
139420
|
+
}
|
|
139421
|
+
return String(err);
|
|
139422
|
+
};
|
|
138909
139423
|
var checkAndApplyTablesDBChanges = async () => {
|
|
138910
139424
|
log("Checking for tablesDB changes ...");
|
|
138911
139425
|
const localTablesDBs = localConfig.getTablesDBs();
|
|
138912
|
-
const
|
|
139426
|
+
const paginatedResult = await paginate(
|
|
138913
139427
|
async (args) => {
|
|
138914
139428
|
const tablesDBService = await getTablesDBService();
|
|
138915
|
-
|
|
139429
|
+
const queries = Array.isArray(args.queries) ? args.queries.filter(
|
|
139430
|
+
(query) => typeof query === "string"
|
|
139431
|
+
) : [];
|
|
139432
|
+
return await tablesDBService.list(queries);
|
|
138916
139433
|
},
|
|
138917
139434
|
{},
|
|
138918
139435
|
100,
|
|
138919
139436
|
"databases"
|
|
138920
139437
|
);
|
|
139438
|
+
const remoteTablesDBs = Array.isArray(paginatedResult.databases) ? paginatedResult.databases.filter(isTablesDBResource) : [];
|
|
138921
139439
|
if (localTablesDBs.length === 0 && remoteTablesDBs.length === 0) {
|
|
138922
139440
|
return { applied: false, resyncNeeded: false };
|
|
138923
139441
|
}
|
|
@@ -138939,9 +139457,7 @@ var checkAndApplyTablesDBChanges = async () => {
|
|
|
138939
139457
|
}
|
|
138940
139458
|
}
|
|
138941
139459
|
for (const localDB of localTablesDBs) {
|
|
138942
|
-
const remoteDB = remoteTablesDBs.find(
|
|
138943
|
-
(db) => db.$id === localDB.$id
|
|
138944
|
-
);
|
|
139460
|
+
const remoteDB = remoteTablesDBs.find((db) => db.$id === localDB.$id);
|
|
138945
139461
|
if (!remoteDB) {
|
|
138946
139462
|
toCreate.push(localDB);
|
|
138947
139463
|
changes.push({
|
|
@@ -139008,7 +139524,7 @@ var checkAndApplyTablesDBChanges = async () => {
|
|
|
139008
139524
|
needsResync = true;
|
|
139009
139525
|
} catch (e) {
|
|
139010
139526
|
error48(
|
|
139011
|
-
`Failed to delete database ${db.name} ( ${db.$id} ): ${e
|
|
139527
|
+
`Failed to delete database ${db.name} ( ${db.$id} ): ${getSyncErrorMessage(e)}`
|
|
139012
139528
|
);
|
|
139013
139529
|
throw new Error(
|
|
139014
139530
|
`Database sync failed during deletion of ${db.$id}. Some changes may have been applied.`
|
|
@@ -139023,7 +139539,7 @@ var checkAndApplyTablesDBChanges = async () => {
|
|
|
139023
139539
|
success2(`Created ${db.name} ( ${db.$id} )`);
|
|
139024
139540
|
} catch (e) {
|
|
139025
139541
|
error48(
|
|
139026
|
-
`Failed to create database ${db.name} ( ${db.$id} ): ${e
|
|
139542
|
+
`Failed to create database ${db.name} ( ${db.$id} ): ${getSyncErrorMessage(e)}`
|
|
139027
139543
|
);
|
|
139028
139544
|
throw new Error(
|
|
139029
139545
|
`Database sync failed during creation of ${db.$id}. Some changes may have been applied.`
|
|
@@ -139038,7 +139554,7 @@ var checkAndApplyTablesDBChanges = async () => {
|
|
|
139038
139554
|
success2(`Updated ${db.name} ( ${db.$id} )`);
|
|
139039
139555
|
} catch (e) {
|
|
139040
139556
|
error48(
|
|
139041
|
-
`Failed to update database ${db.name} ( ${db.$id} ): ${e
|
|
139557
|
+
`Failed to update database ${db.name} ( ${db.$id} ): ${getSyncErrorMessage(e)}`
|
|
139042
139558
|
);
|
|
139043
139559
|
throw new Error(
|
|
139044
139560
|
`Database sync failed during update of ${db.$id}. Some changes may have been applied.`
|
|
@@ -139056,9 +139572,9 @@ var Push = class {
|
|
|
139056
139572
|
projectClient;
|
|
139057
139573
|
consoleClient;
|
|
139058
139574
|
silent;
|
|
139059
|
-
constructor(projectClient2,
|
|
139575
|
+
constructor(projectClient2, consoleClient, silent = false) {
|
|
139060
139576
|
this.projectClient = projectClient2;
|
|
139061
|
-
this.consoleClient =
|
|
139577
|
+
this.consoleClient = consoleClient;
|
|
139062
139578
|
this.silent = silent;
|
|
139063
139579
|
}
|
|
139064
139580
|
/**
|
|
@@ -139272,7 +139788,7 @@ var Push = class {
|
|
|
139272
139788
|
}
|
|
139273
139789
|
if (settings.services) {
|
|
139274
139790
|
this.log("Applying service statuses ...");
|
|
139275
|
-
for (
|
|
139791
|
+
for (const [service, status] of Object.entries(settings.services)) {
|
|
139276
139792
|
await projectsService.updateServiceStatus({
|
|
139277
139793
|
projectId,
|
|
139278
139794
|
service,
|
|
@@ -139318,7 +139834,7 @@ var Push = class {
|
|
|
139318
139834
|
}
|
|
139319
139835
|
if (settings.auth.methods) {
|
|
139320
139836
|
this.log("Applying auth methods statuses ...");
|
|
139321
|
-
for (
|
|
139837
|
+
for (const [method, status] of Object.entries(settings.auth.methods)) {
|
|
139322
139838
|
await projectsService.updateAuthStatus({
|
|
139323
139839
|
projectId,
|
|
139324
139840
|
method,
|
|
@@ -139622,7 +140138,7 @@ var Push = class {
|
|
|
139622
140138
|
([key, value]) => ({ key, value })
|
|
139623
140139
|
);
|
|
139624
140140
|
}
|
|
139625
|
-
} catch (
|
|
140141
|
+
} catch (_error) {
|
|
139626
140142
|
envVariables = [];
|
|
139627
140143
|
}
|
|
139628
140144
|
await Promise.all(
|
|
@@ -139919,7 +140435,7 @@ var Push = class {
|
|
|
139919
140435
|
([key, value]) => ({ key, value })
|
|
139920
140436
|
);
|
|
139921
140437
|
}
|
|
139922
|
-
} catch (
|
|
140438
|
+
} catch (_error) {
|
|
139923
140439
|
envVariables = [];
|
|
139924
140440
|
}
|
|
139925
140441
|
await Promise.all(
|
|
@@ -140086,7 +140602,7 @@ var Push = class {
|
|
|
140086
140602
|
skipConfirmation,
|
|
140087
140603
|
this.projectClient
|
|
140088
140604
|
);
|
|
140089
|
-
|
|
140605
|
+
const tablesChanged = /* @__PURE__ */ new Set();
|
|
140090
140606
|
const errors = [];
|
|
140091
140607
|
await Promise.all(
|
|
140092
140608
|
tables.map(async (table) => {
|
|
@@ -140140,7 +140656,7 @@ var Push = class {
|
|
|
140140
140656
|
}
|
|
140141
140657
|
})
|
|
140142
140658
|
);
|
|
140143
|
-
for (
|
|
140659
|
+
for (const table of tables) {
|
|
140144
140660
|
let columns = table.columns;
|
|
140145
140661
|
let indexes = table.indexes;
|
|
140146
140662
|
let hadChanges = false;
|
|
@@ -140341,8 +140857,8 @@ async function createPushInstance(options = {
|
|
|
140341
140857
|
}) {
|
|
140342
140858
|
const { silent, requiresConsoleAuth } = options;
|
|
140343
140859
|
const projectClient2 = await sdkForProject();
|
|
140344
|
-
const
|
|
140345
|
-
return new Push(projectClient2,
|
|
140860
|
+
const consoleClient = await sdkForConsole(requiresConsoleAuth);
|
|
140861
|
+
return new Push(projectClient2, consoleClient, silent);
|
|
140346
140862
|
}
|
|
140347
140863
|
var pushResources = async ({
|
|
140348
140864
|
skipDeprecated = false
|
|
@@ -140419,7 +140935,7 @@ var pushSettings = async () => {
|
|
|
140419
140935
|
checkDeployConditions(localConfig);
|
|
140420
140936
|
try {
|
|
140421
140937
|
const projectsService = await getProjectsService();
|
|
140422
|
-
|
|
140938
|
+
const response = await projectsService.get(
|
|
140423
140939
|
localConfig.getProject().projectId
|
|
140424
140940
|
);
|
|
140425
140941
|
const remoteSettings = createSettingsObject(response);
|
|
@@ -140452,7 +140968,7 @@ var pushSettings = async () => {
|
|
|
140452
140968
|
return;
|
|
140453
140969
|
}
|
|
140454
140970
|
}
|
|
140455
|
-
} catch (
|
|
140971
|
+
} catch (_e) {
|
|
140456
140972
|
}
|
|
140457
140973
|
try {
|
|
140458
140974
|
log("Pushing project settings ...");
|
|
@@ -140502,7 +141018,7 @@ var pushSite = async ({
|
|
|
140502
141018
|
);
|
|
140503
141019
|
return;
|
|
140504
141020
|
}
|
|
140505
|
-
|
|
141021
|
+
const sites2 = siteIds.map((id) => {
|
|
140506
141022
|
const sites3 = localConfig.getSites();
|
|
140507
141023
|
const site = sites3.find((s) => s.$id === id);
|
|
140508
141024
|
if (!site) {
|
|
@@ -140511,7 +141027,7 @@ var pushSite = async ({
|
|
|
140511
141027
|
return site;
|
|
140512
141028
|
});
|
|
140513
141029
|
log("Validating sites ...");
|
|
140514
|
-
for (
|
|
141030
|
+
for (const site of sites2) {
|
|
140515
141031
|
if (!site.buildCommand) {
|
|
140516
141032
|
log(`Site ${site.name} is missing build command.`);
|
|
140517
141033
|
const answers = await import_inquirer7.default.prompt(questionsGetEntrypoint);
|
|
@@ -140622,7 +141138,7 @@ var pushFunction = async ({
|
|
|
140622
141138
|
);
|
|
140623
141139
|
return;
|
|
140624
141140
|
}
|
|
140625
|
-
|
|
141141
|
+
const functions2 = functionIds.map((id) => {
|
|
140626
141142
|
const functions3 = localConfig.getFunctions();
|
|
140627
141143
|
const func = functions3.find((f) => f.$id === id);
|
|
140628
141144
|
if (!func) {
|
|
@@ -140631,7 +141147,7 @@ var pushFunction = async ({
|
|
|
140631
141147
|
return func;
|
|
140632
141148
|
});
|
|
140633
141149
|
log("Validating functions ...");
|
|
140634
|
-
for (
|
|
141150
|
+
for (const func of functions2) {
|
|
140635
141151
|
if (!func.entrypoint) {
|
|
140636
141152
|
log(`Function ${func.name} is missing an entrypoint.`);
|
|
140637
141153
|
const answers = await import_inquirer7.default.prompt(questionsGetEntrypoint);
|
|
@@ -140772,7 +141288,7 @@ var pushTable = async ({
|
|
|
140772
141288
|
});
|
|
140773
141289
|
}
|
|
140774
141290
|
}
|
|
140775
|
-
} catch (
|
|
141291
|
+
} catch (_e) {
|
|
140776
141292
|
}
|
|
140777
141293
|
}
|
|
140778
141294
|
if (tablesToDelete.length > 0) {
|
|
@@ -140919,7 +141435,7 @@ var pushCollection = async () => {
|
|
|
140919
141435
|
}
|
|
140920
141436
|
};
|
|
140921
141437
|
var pushBucket = async () => {
|
|
140922
|
-
|
|
141438
|
+
const bucketIds = [];
|
|
140923
141439
|
const configBuckets = localConfig.getBuckets();
|
|
140924
141440
|
if (cliConfig.all) {
|
|
140925
141441
|
checkDeployConditions(localConfig);
|
|
@@ -140938,7 +141454,7 @@ var pushBucket = async () => {
|
|
|
140938
141454
|
);
|
|
140939
141455
|
return;
|
|
140940
141456
|
}
|
|
140941
|
-
|
|
141457
|
+
const buckets = [];
|
|
140942
141458
|
for (const bucketId of bucketIds) {
|
|
140943
141459
|
const idBuckets = configBuckets.filter((b) => b.$id === bucketId);
|
|
140944
141460
|
buckets.push(...idBuckets);
|
|
@@ -140969,7 +141485,7 @@ var pushBucket = async () => {
|
|
|
140969
141485
|
}
|
|
140970
141486
|
};
|
|
140971
141487
|
var pushTeam = async () => {
|
|
140972
|
-
|
|
141488
|
+
const teamIds = [];
|
|
140973
141489
|
const configTeams = localConfig.getTeams();
|
|
140974
141490
|
if (cliConfig.all) {
|
|
140975
141491
|
checkDeployConditions(localConfig);
|
|
@@ -140988,7 +141504,7 @@ var pushTeam = async () => {
|
|
|
140988
141504
|
);
|
|
140989
141505
|
return;
|
|
140990
141506
|
}
|
|
140991
|
-
|
|
141507
|
+
const teams2 = [];
|
|
140992
141508
|
for (const teamId of teamIds) {
|
|
140993
141509
|
const idTeams = configTeams.filter((t) => t.$id === teamId);
|
|
140994
141510
|
teams2.push(...idTeams);
|
|
@@ -141019,7 +141535,7 @@ var pushTeam = async () => {
|
|
|
141019
141535
|
}
|
|
141020
141536
|
};
|
|
141021
141537
|
var pushMessagingTopic = async () => {
|
|
141022
|
-
|
|
141538
|
+
const topicsIds = [];
|
|
141023
141539
|
const configTopics = localConfig.getMessagingTopics();
|
|
141024
141540
|
if (cliConfig.all) {
|
|
141025
141541
|
checkDeployConditions(localConfig);
|
|
@@ -141038,7 +141554,7 @@ var pushMessagingTopic = async () => {
|
|
|
141038
141554
|
);
|
|
141039
141555
|
return;
|
|
141040
141556
|
}
|
|
141041
|
-
|
|
141557
|
+
const topics = [];
|
|
141042
141558
|
for (const topicId of topicsIds) {
|
|
141043
141559
|
const idTopic = configTopics.filter((b) => b.$id === topicId);
|
|
141044
141560
|
topics.push(...idTopic);
|
|
@@ -141114,7 +141630,7 @@ var isInstalledViaNpm = () => {
|
|
|
141114
141630
|
return true;
|
|
141115
141631
|
}
|
|
141116
141632
|
return false;
|
|
141117
|
-
} catch (
|
|
141633
|
+
} catch (_e) {
|
|
141118
141634
|
return false;
|
|
141119
141635
|
}
|
|
141120
141636
|
};
|
|
@@ -141122,7 +141638,7 @@ var isInstalledViaHomebrew = () => {
|
|
|
141122
141638
|
try {
|
|
141123
141639
|
const scriptPath = process.argv[1];
|
|
141124
141640
|
return scriptPath.includes("/opt/homebrew/") || scriptPath.includes("/usr/local/Cellar/");
|
|
141125
|
-
} catch (
|
|
141641
|
+
} catch (_e) {
|
|
141126
141642
|
return false;
|
|
141127
141643
|
}
|
|
141128
141644
|
};
|
|
@@ -141152,13 +141668,14 @@ var updateViaNpm = async () => {
|
|
|
141152
141668
|
success2("Updated to latest version via npm!");
|
|
141153
141669
|
hint("Run 'appwrite --version' to verify the new version.");
|
|
141154
141670
|
} catch (e) {
|
|
141155
|
-
|
|
141671
|
+
const message = getErrorMessage(e);
|
|
141672
|
+
if (message.includes("EEXIST") || message.includes("file already exists")) {
|
|
141156
141673
|
console.log("");
|
|
141157
141674
|
success2("Latest version is already installed via npm!");
|
|
141158
141675
|
hint("The CLI is up to date. Run 'appwrite --version' to verify.");
|
|
141159
141676
|
} else {
|
|
141160
141677
|
console.log("");
|
|
141161
|
-
error48(`Failed to update via npm: ${
|
|
141678
|
+
error48(`Failed to update via npm: ${message}`);
|
|
141162
141679
|
hint(`Try running: npm install -g ${NPM_PACKAGE_NAME}@latest --force`);
|
|
141163
141680
|
}
|
|
141164
141681
|
}
|
|
@@ -141170,13 +141687,14 @@ var updateViaHomebrew = async () => {
|
|
|
141170
141687
|
success2("Updated to latest version via Homebrew!");
|
|
141171
141688
|
hint("Run 'appwrite --version' to verify the new version.");
|
|
141172
141689
|
} catch (e) {
|
|
141173
|
-
|
|
141690
|
+
const message = getErrorMessage(e);
|
|
141691
|
+
if (message.includes("already installed") || message.includes("up-to-date")) {
|
|
141174
141692
|
console.log("");
|
|
141175
141693
|
success2("Latest version is already installed via Homebrew!");
|
|
141176
141694
|
hint("The CLI is up to date. Run 'appwrite --version' to verify.");
|
|
141177
141695
|
} else {
|
|
141178
141696
|
console.log("");
|
|
141179
|
-
error48(`Failed to update via Homebrew: ${
|
|
141697
|
+
error48(`Failed to update via Homebrew: ${message}`);
|
|
141180
141698
|
hint("Try running: brew upgrade appwrite");
|
|
141181
141699
|
}
|
|
141182
141700
|
}
|
|
@@ -141251,8 +141769,9 @@ var updateCli = async ({ manual } = {}) => {
|
|
|
141251
141769
|
await chooseUpdateMethod(latestVersion);
|
|
141252
141770
|
}
|
|
141253
141771
|
} catch (e) {
|
|
141772
|
+
const message = getErrorMessage(e);
|
|
141254
141773
|
console.log("");
|
|
141255
|
-
error48(`Failed to check for updates: ${
|
|
141774
|
+
error48(`Failed to check for updates: ${message}`);
|
|
141256
141775
|
hint(`You can manually check for updates at: ${GITHUB_RELEASES_URL}`);
|
|
141257
141776
|
}
|
|
141258
141777
|
};
|
|
@@ -141425,7 +141944,7 @@ var BaseDatabasesGenerator = class {
|
|
|
141425
141944
|
var types_ts_default = "import { type Models } from '{{appwriteDep}}';\n\n{{{ENUMS}}}{{{TYPES}}}\ndeclare const __roleStringBrand: unique symbol;\nexport type RoleString = string & { readonly [__roleStringBrand]: never };\n\nexport type RoleBuilder = {\n any: () => RoleString;\n user: (userId: string, status?: string) => RoleString;\n users: (status?: string) => RoleString;\n guests: () => RoleString;\n team: (teamId: string, role?: string) => RoleString;\n member: (memberId: string) => RoleString;\n label: (label: string) => RoleString;\n}\n\nexport type PermissionBuilder = {\n read: (role: RoleString) => string;\n write: (role: RoleString) => string;\n create: (role: RoleString) => string;\n update: (role: RoleString) => string;\n delete: (role: RoleString) => string;\n}\n\nexport type PermissionCallback = (permission: PermissionBuilder, role: RoleBuilder) => string[];\n\nexport type QueryValue = string | number | boolean;\n\nexport type ExtractQueryValue<T> = T extends (infer U)[]\n ? U extends QueryValue ? U : never\n : T extends QueryValue | null ? NonNullable<T> : never;\n\nexport type QueryableKeys<T> = {\n [K in keyof T]: ExtractQueryValue<T[K]> extends never ? never : K;\n}[keyof T];\n\nexport type QueryBuilder<T> = {\n equal: <K extends QueryableKeys<T>>(field: K, value: ExtractQueryValue<T[K]>) => string;\n notEqual: <K extends QueryableKeys<T>>(field: K, value: ExtractQueryValue<T[K]>) => string;\n lessThan: <K extends QueryableKeys<T>>(field: K, value: ExtractQueryValue<T[K]>) => string;\n lessThanEqual: <K extends QueryableKeys<T>>(field: K, value: ExtractQueryValue<T[K]>) => string;\n greaterThan: <K extends QueryableKeys<T>>(field: K, value: ExtractQueryValue<T[K]>) => string;\n greaterThanEqual: <K extends QueryableKeys<T>>(field: K, value: ExtractQueryValue<T[K]>) => string;\n contains: <K extends QueryableKeys<T>>(field: K, value: ExtractQueryValue<T[K]>) => string;\n search: <K extends QueryableKeys<T>>(field: K, value: string) => string;\n isNull: <K extends QueryableKeys<T>>(field: K) => string;\n isNotNull: <K extends QueryableKeys<T>>(field: K) => string;\n startsWith: <K extends QueryableKeys<T>>(field: K, value: string) => string;\n endsWith: <K extends QueryableKeys<T>>(field: K, value: string) => string;\n between: <K extends QueryableKeys<T>>(field: K, start: ExtractQueryValue<T[K]>, end: ExtractQueryValue<T[K]>) => string;\n select: <K extends keyof T>(fields: K[]) => string;\n orderAsc: <K extends keyof T>(field: K) => string;\n orderDesc: <K extends keyof T>(field: K) => string;\n limit: (value: number) => string;\n offset: (value: number) => string;\n cursorAfter: (documentId: string) => string;\n cursorBefore: (documentId: string) => string;\n or: (...queries: string[]) => string;\n and: (...queries: string[]) => string;\n}\n\nexport type DatabaseId = {{{databaseIdType}}};\n\n{{{DATABASE_TABLES_TYPE}}}\n";
|
|
141426
141945
|
|
|
141427
141946
|
// lib/commands/generators/typescript/templates/databases.ts.hbs
|
|
141428
|
-
var databases_ts_default = 'import { Client, TablesDB, ID, Query, type Models, Permission, Role } from \'{{appwriteDep}}\';\nimport type { DatabaseHandle, DatabaseId, DatabaseTableMap, DatabaseTables, QueryBuilder, PermissionBuilder, RoleBuilder, RoleString } from \'./types{{importExt}}\';\n{{#if supportsServerSide}}\nimport { PROJECT_ID, ENDPOINT, API_KEY } from \'./constants{{importExt}}\';\n{{else}}\nimport { PROJECT_ID, ENDPOINT } from \'./constants{{importExt}}\';\n{{/if}}\n\nconst createQueryBuilder = <T>(): QueryBuilder<T> => ({\n equal: (field, value) => Query.equal(String(field), value as any),\n notEqual: (field, value) => Query.notEqual(String(field), value as any),\n lessThan: (field, value) => Query.lessThan(String(field), value as any),\n lessThanEqual: (field, value) => Query.lessThanEqual(String(field), value as any),\n greaterThan: (field, value) => Query.greaterThan(String(field), value as any),\n greaterThanEqual: (field, value) => Query.greaterThanEqual(String(field), value as any),\n contains: (field, value) => Query.contains(String(field), value as any),\n search: (field, value) => Query.search(String(field), value),\n isNull: (field) => Query.isNull(String(field)),\n isNotNull: (field) => Query.isNotNull(String(field)),\n startsWith: (field, value) => Query.startsWith(String(field), value),\n endsWith: (field, value) => Query.endsWith(String(field), value),\n between: (field, start, end) => Query.between(String(field), start as any, end as any),\n select: (fields) => Query.select(fields.map(String)),\n orderAsc: (field) => Query.orderAsc(String(field)),\n orderDesc: (field) => Query.orderDesc(String(field)),\n limit: (value) => Query.limit(value),\n offset: (value) => Query.offset(value),\n cursorAfter: (documentId) => Query.cursorAfter(documentId),\n cursorBefore: (documentId) => Query.cursorBefore(documentId),\n or: (...queries) => Query.or(queries),\n and: (...queries) => Query.and(queries),\n});\n\n{{{TABLE_ID_MAP}}}\n\n{{{TABLES_WITH_RELATIONSHIPS}}}\n\nconst roleBuilder: RoleBuilder = {\n any: () => Role.any() as RoleString,\n user: (userId, status?) => Role.user(userId, status) as RoleString,\n users: (status?) => Role.users(status) as RoleString,\n guests: () => Role.guests() as RoleString,\n team: (teamId, role?) => Role.team(teamId, role) as RoleString,\n member: (memberId) => Role.member(memberId) as RoleString,\n label: (label) => Role.label(label) as RoleString,\n};\n\nconst permissionBuilder: PermissionBuilder = {\n read: (role) => Permission.read(role),\n write: (role) => Permission.write(role),\n create: (role) => Permission.create(role),\n update: (role) => Permission.update(role),\n delete: (role) => Permission.delete(role),\n};\n\nconst resolvePermissions = (callback?: (permission: { read: (role: RoleString) => string; write: (role: RoleString) => string; create: (role: RoleString) => string; update: (role: RoleString) => string; delete: (role: RoleString) => string }, role: { any: () => RoleString; user: (userId: string, status?: string) => RoleString; users: (status?: string) => RoleString; guests: () => RoleString; team: (teamId: string, role?: string) => RoleString; member: (memberId: string) => RoleString; label: (label: string) => RoleString }) => string[]): string[] | undefined =>\n callback?.(permissionBuilder, roleBuilder);\n\nfunction createTableApi<T extends Models.Row>(\n tablesDB: TablesDB,\n databaseId: string,\n tableId: string,\n) {\n return {\n create: (data: any, options?: { rowId?: string; permissions?: (permission: { read: (role: RoleString) => string; write: (role: RoleString) => string; create: (role: RoleString) => string; update: (role: RoleString) => string; delete: (role: RoleString) => string }, role: { any: () => RoleString; user: (userId: string, status?: string) => RoleString; users: (status?: string) => RoleString; guests: () => RoleString; team: (teamId: string, role?: string) => RoleString; member: (memberId: string) => RoleString; label: (label: string) => RoleString }) => string[]; transactionId?: string }) =>\n tablesDB.createRow<T>({\n databaseId,\n tableId,\n rowId: options?.rowId ?? ID.unique(),\n data,\n permissions: resolvePermissions(options?.permissions),\n transactionId: options?.transactionId,\n }),\n get: (id: string) =>\n tablesDB.getRow<T>({\n databaseId,\n tableId,\n rowId: id,\n }),\n update: (id: string, data: any, options?: { permissions?: (permission: { read: (role: RoleString) => string; write: (role: RoleString) => string; create: (role: RoleString) => string; update: (role: RoleString) => string; delete: (role: RoleString) => string }, role: { any: () => RoleString; user: (userId: string, status?: string) => RoleString; users: (status?: string) => RoleString; guests: () => RoleString; team: (teamId: string, role?: string) => RoleString; member: (memberId: string) => RoleString; label: (label: string) => RoleString }) => string[]; transactionId?: string }) =>\n tablesDB.updateRow<T>({\n databaseId,\n tableId,\n rowId: id,\n data,\n ...(options?.permissions ? { permissions: resolvePermissions(options.permissions) } : {}),\n transactionId: options?.transactionId,\n }),\n delete: async (id: string, options?: { transactionId?: string }) => {\n await tablesDB.deleteRow({\n databaseId,\n tableId,\n rowId: id,\n transactionId: options?.transactionId,\n });\n },\n list: (options?: { queries?: (q: any) => string[] }) =>\n tablesDB.listRows<T>({\n databaseId,\n tableId,\n queries: options?.queries?.(createQueryBuilder<T>()),\n }),{{{BULK_METHODS}}}\n };\n}\n\n{{{BULK_CHECK}}}\nconst hasOwn = (obj: unknown, key: string): boolean =>\n obj != null && Object.prototype.hasOwnProperty.call(obj, key);\n\nfunction createDatabaseHandle<D extends DatabaseId>(\n tablesDB: TablesDB,\n databaseId: D,\n): DatabaseHandle<D> {\n const tableApiCache = new Map<string, unknown>();\n const dbMap = tableIdMap[databaseId];\n\n return {\n use: <T extends keyof DatabaseTableMap[D] & string>(tableId: T): DatabaseTableMap[D][T] => {\n if (!hasOwn(dbMap, tableId)) {\n throw new Error(`Unknown table "${tableId}" in database "${databaseId}"`);\n }\n\n if (!tableApiCache.has(tableId)) {\n const resolvedTableId = dbMap[tableId];\n const api = createTableApi(tablesDB, databaseId, resolvedTableId);\n {{{BULK_REMOVAL}}}\n tableApiCache.set(tableId, api);\n }\n return tableApiCache.get(tableId) as DatabaseTableMap[D][T];\n },\n{{#if supportsServerSide}}\n create: (tableId: string, name: string, options?: { permissions?: (permission: { read: (role: RoleString) => string; write: (role: RoleString) => string; create: (role: RoleString) => string; update: (role: RoleString) => string; delete: (role: RoleString) => string }, role: { any: () => RoleString; user: (userId: string, status?: string) => RoleString; users: (status?: string) => RoleString; guests: () => RoleString; team: (teamId: string, role?: string) => RoleString; member: (memberId: string) => RoleString; label: (label: string) => RoleString }) => string[]; rowSecurity?: boolean; enabled?: boolean; columns?: any[]; indexes?: any[] }) =>\n tablesDB.createTable({\n databaseId,\n tableId,\n name,\n permissions: resolvePermissions(options?.permissions),\n rowSecurity: options?.rowSecurity,\n enabled: options?.enabled,\n columns: options?.columns,\n indexes: options?.indexes,\n }),\n update: (tableId: string, options?: { name?: string; permissions?: (permission: { read: (role: RoleString) => string; write: (role: RoleString) => string; create: (role: RoleString) => string; update: (role: RoleString) => string; delete: (role: RoleString) => string }, role: { any: () => RoleString; user: (userId: string, status?: string) => RoleString; users: (status?: string) => RoleString; guests: () => RoleString; team: (teamId: string, role?: string) => RoleString; member: (memberId: string) => RoleString; label: (label: string) => RoleString }) => string[]; rowSecurity?: boolean; enabled?: boolean }) => {\n if (!hasOwn(dbMap, tableId)) {\n throw new Error(`Unknown table "${tableId}" in database "${databaseId}"`);\n }\n const resolvedTableId = dbMap[tableId];\n return tablesDB.updateTable({\n databaseId,\n tableId: resolvedTableId,\n name: options?.name ?? tableId, // TODO: remove this fallback once fixed in other SDKs\n permissions: resolvePermissions(options?.permissions),\n rowSecurity: options?.rowSecurity,\n enabled: options?.enabled,\n });\n },\n delete: async (tableId: string) => {\n if (!hasOwn(dbMap, tableId)) {\n throw new Error(`Unknown table "${tableId}" in database "${databaseId}"`);\n }\n const resolvedTableId = dbMap[tableId];\n await tablesDB.deleteTable({\n databaseId,\n tableId: resolvedTableId,\n });\n },\n{{/if}}\n };\n}\n\nfunction createDatabasesApi(tablesDB: TablesDB): DatabaseTables {\n const dbCache = new Map<DatabaseId, ReturnType<typeof createDatabaseHandle>>();\n\n return {\n use: (databaseId: DatabaseId) => {\n if (!hasOwn(tableIdMap, databaseId)) {\n throw new Error(`Unknown database "${databaseId}"`);\n }\n\n if (!dbCache.has(databaseId)) {\n dbCache.set(databaseId, createDatabaseHandle(tablesDB, databaseId));\n }\n return dbCache.get(databaseId);\n },\n{{#if supportsServerSide}}\n create: (databaseId: string, name: string, options?: { enabled?: boolean }) =>\n tablesDB.create({\n databaseId,\n name,\n enabled: options?.enabled,\n }),\n update: (databaseId: DatabaseId, options?: { name?: string; enabled?: boolean }) => {\n return tablesDB.update({\n databaseId,\n name: options?.name ?? databaseId,\n enabled: options?.enabled,\n });\n },\n delete: async (databaseId: DatabaseId) => {\n await tablesDB.delete({\n databaseId,\n });\n },\n{{/if}}\n } as DatabaseTables;\n}\n\n// Initialize client\nconst client = new Client()\n .setEndpoint(ENDPOINT)\n .setProject(PROJECT_ID){{#if supportsServerSide}}\n .setKey(API_KEY){{/if}};\n\nconst tablesDB = new TablesDB(client);\n\nexport const databases: DatabaseTables = createDatabasesApi(tablesDB);\n';
|
|
141947
|
+
var databases_ts_default = 'import { Client, TablesDB, ID, Query, type Models, Permission, Role } from \'{{appwriteDep}}\';\nimport type { DatabaseHandle, DatabaseId, DatabaseTableMap, DatabaseTables, QueryBuilder, QueryValue, PermissionBuilder, RoleBuilder, RoleString } from \'./types{{importExt}}\';\n{{#if supportsServerSide}}\nimport { PROJECT_ID, ENDPOINT, API_KEY } from \'./constants{{importExt}}\';\n{{else}}\nimport { PROJECT_ID, ENDPOINT } from \'./constants{{importExt}}\';\n{{/if}}\n\nconst createQueryBuilder = <T>(): QueryBuilder<T> => ({\n equal: (field, value) => Query.equal(String(field), value as QueryValue),\n notEqual: (field, value) => Query.notEqual(String(field), value as QueryValue),\n lessThan: (field, value) => Query.lessThan(String(field), value as QueryValue),\n lessThanEqual: (field, value) => Query.lessThanEqual(String(field), value as QueryValue),\n greaterThan: (field, value) => Query.greaterThan(String(field), value as QueryValue),\n greaterThanEqual: (field, value) => Query.greaterThanEqual(String(field), value as QueryValue),\n contains: (field, value) => Query.contains(String(field), value as string | QueryValue[]),\n search: (field, value) => Query.search(String(field), value),\n isNull: (field) => Query.isNull(String(field)),\n isNotNull: (field) => Query.isNotNull(String(field)),\n startsWith: (field, value) => Query.startsWith(String(field), value),\n endsWith: (field, value) => Query.endsWith(String(field), value),\n between: (field, start, end) => Query.between(String(field), start as string | number, end as string | number),\n select: (fields) => Query.select(fields.map(String)),\n orderAsc: (field) => Query.orderAsc(String(field)),\n orderDesc: (field) => Query.orderDesc(String(field)),\n limit: (value) => Query.limit(value),\n offset: (value) => Query.offset(value),\n cursorAfter: (documentId) => Query.cursorAfter(documentId),\n cursorBefore: (documentId) => Query.cursorBefore(documentId),\n or: (...queries) => Query.or(queries),\n and: (...queries) => Query.and(queries),\n});\n\n{{{TABLE_ID_MAP}}}\n\n{{{TABLES_WITH_RELATIONSHIPS}}}\n\nconst roleBuilder: RoleBuilder = {\n any: () => Role.any() as RoleString,\n user: (userId, status?) => Role.user(userId, status) as RoleString,\n users: (status?) => Role.users(status) as RoleString,\n guests: () => Role.guests() as RoleString,\n team: (teamId, role?) => Role.team(teamId, role) as RoleString,\n member: (memberId) => Role.member(memberId) as RoleString,\n label: (label) => Role.label(label) as RoleString,\n};\n\nconst permissionBuilder: PermissionBuilder = {\n read: (role) => Permission.read(role),\n write: (role) => Permission.write(role),\n create: (role) => Permission.create(role),\n update: (role) => Permission.update(role),\n delete: (role) => Permission.delete(role),\n};\n\nconst resolvePermissions = (callback?: (permission: { read: (role: RoleString) => string; write: (role: RoleString) => string; create: (role: RoleString) => string; update: (role: RoleString) => string; delete: (role: RoleString) => string }, role: { any: () => RoleString; user: (userId: string, status?: string) => RoleString; users: (status?: string) => RoleString; guests: () => RoleString; team: (teamId: string, role?: string) => RoleString; member: (memberId: string) => RoleString; label: (label: string) => RoleString }) => string[]): string[] | undefined =>\n callback?.(permissionBuilder, roleBuilder);\n\nfunction createTableApi<T extends Models.Row>(\n tablesDB: TablesDB,\n databaseId: string,\n tableId: string,\n) {\n return {\n create: (data: Omit<T, keyof Models.Row>, options?: { rowId?: string; permissions?: (permission: { read: (role: RoleString) => string; write: (role: RoleString) => string; create: (role: RoleString) => string; update: (role: RoleString) => string; delete: (role: RoleString) => string }, role: { any: () => RoleString; user: (userId: string, status?: string) => RoleString; users: (status?: string) => RoleString; guests: () => RoleString; team: (teamId: string, role?: string) => RoleString; member: (memberId: string) => RoleString; label: (label: string) => RoleString }) => string[]; transactionId?: string }) =>\n tablesDB.createRow<T>({\n databaseId,\n tableId,\n rowId: options?.rowId ?? ID.unique(),\n data: data as T extends Models.DefaultRow ? Partial<Models.Row> & Record<string, unknown> : Partial<Models.Row> & Omit<T, keyof Models.Row>,\n permissions: resolvePermissions(options?.permissions),\n transactionId: options?.transactionId,\n }),\n get: (id: string) =>\n tablesDB.getRow<T>({\n databaseId,\n tableId,\n rowId: id,\n }),\n update: (id: string, data: Partial<Omit<T, keyof Models.Row>>, options?: { permissions?: (permission: { read: (role: RoleString) => string; write: (role: RoleString) => string; create: (role: RoleString) => string; update: (role: RoleString) => string; delete: (role: RoleString) => string }, role: { any: () => RoleString; user: (userId: string, status?: string) => RoleString; users: (status?: string) => RoleString; guests: () => RoleString; team: (teamId: string, role?: string) => RoleString; member: (memberId: string) => RoleString; label: (label: string) => RoleString }) => string[]; transactionId?: string }) =>\n tablesDB.updateRow<T>({\n databaseId,\n tableId,\n rowId: id,\n data: data as T extends Models.DefaultRow ? Partial<Models.Row> & Record<string, unknown> : Partial<Models.Row> & Partial<Omit<T, keyof Models.Row>>,\n ...(options?.permissions ? { permissions: resolvePermissions(options.permissions) } : {}),\n transactionId: options?.transactionId,\n }),\n delete: async (id: string, options?: { transactionId?: string }) => {\n await tablesDB.deleteRow({\n databaseId,\n tableId,\n rowId: id,\n transactionId: options?.transactionId,\n });\n },\n list: (options?: { queries?: (q: QueryBuilder<T>) => string[] }) =>\n tablesDB.listRows<T>({\n databaseId,\n tableId,\n queries: options?.queries?.(createQueryBuilder<T>()),\n }),{{{BULK_METHODS}}}\n };\n}\n\n{{{BULK_CHECK}}}\nconst hasOwn = (obj: unknown, key: string): boolean =>\n obj != null && Object.prototype.hasOwnProperty.call(obj, key);\n\nfunction createDatabaseHandle<D extends DatabaseId>(\n tablesDB: TablesDB,\n databaseId: D,\n): DatabaseHandle<D> {\n const tableApiCache = new Map<string, unknown>();\n const dbMap = tableIdMap[databaseId];\n\n return {\n use: <T extends keyof DatabaseTableMap[D] & string>(tableId: T): DatabaseTableMap[D][T] => {\n if (!hasOwn(dbMap, tableId)) {\n throw new Error(`Unknown table "${tableId}" in database "${databaseId}"`);\n }\n\n if (!tableApiCache.has(tableId)) {\n const resolvedTableId = dbMap[tableId];\n const api = createTableApi(tablesDB, databaseId, resolvedTableId);\n {{{BULK_REMOVAL}}}\n tableApiCache.set(tableId, api);\n }\n return tableApiCache.get(tableId) as DatabaseTableMap[D][T];\n },\n{{#if supportsServerSide}}\n create: (tableId: string, name: string, options?: { permissions?: (permission: { read: (role: RoleString) => string; write: (role: RoleString) => string; create: (role: RoleString) => string; update: (role: RoleString) => string; delete: (role: RoleString) => string }, role: { any: () => RoleString; user: (userId: string, status?: string) => RoleString; users: (status?: string) => RoleString; guests: () => RoleString; team: (teamId: string, role?: string) => RoleString; member: (memberId: string) => RoleString; label: (label: string) => RoleString }) => string[]; rowSecurity?: boolean; enabled?: boolean; columns?: object[]; indexes?: object[] }) =>\n tablesDB.createTable({\n databaseId,\n tableId,\n name,\n permissions: resolvePermissions(options?.permissions),\n rowSecurity: options?.rowSecurity,\n enabled: options?.enabled,\n columns: options?.columns,\n indexes: options?.indexes,\n }),\n update: (tableId: string, options?: { name?: string; permissions?: (permission: { read: (role: RoleString) => string; write: (role: RoleString) => string; create: (role: RoleString) => string; update: (role: RoleString) => string; delete: (role: RoleString) => string }, role: { any: () => RoleString; user: (userId: string, status?: string) => RoleString; users: (status?: string) => RoleString; guests: () => RoleString; team: (teamId: string, role?: string) => RoleString; member: (memberId: string) => RoleString; label: (label: string) => RoleString }) => string[]; rowSecurity?: boolean; enabled?: boolean }) => {\n if (!hasOwn(dbMap, tableId)) {\n throw new Error(`Unknown table "${tableId}" in database "${databaseId}"`);\n }\n const resolvedTableId = dbMap[tableId];\n return tablesDB.updateTable({\n databaseId,\n tableId: resolvedTableId,\n name: options?.name,\n permissions: resolvePermissions(options?.permissions),\n rowSecurity: options?.rowSecurity,\n enabled: options?.enabled,\n });\n },\n delete: async (tableId: string) => {\n if (!hasOwn(dbMap, tableId)) {\n throw new Error(`Unknown table "${tableId}" in database "${databaseId}"`);\n }\n const resolvedTableId = dbMap[tableId];\n await tablesDB.deleteTable({\n databaseId,\n tableId: resolvedTableId,\n });\n },\n{{/if}}\n };\n}\n\nfunction createDatabasesApi(tablesDB: TablesDB): DatabaseTables {\n const dbCache = new Map<DatabaseId, ReturnType<typeof createDatabaseHandle>>();\n\n return {\n use: (databaseId: DatabaseId) => {\n if (!hasOwn(tableIdMap, databaseId)) {\n throw new Error(`Unknown database "${databaseId}"`);\n }\n\n if (!dbCache.has(databaseId)) {\n dbCache.set(databaseId, createDatabaseHandle(tablesDB, databaseId));\n }\n return dbCache.get(databaseId);\n },\n{{#if supportsServerSide}}\n create: (databaseId: string, name: string, options?: { enabled?: boolean }) =>\n tablesDB.create({\n databaseId,\n name,\n enabled: options?.enabled,\n }),\n update: (databaseId: DatabaseId, options?: { name?: string; enabled?: boolean }) => {\n return tablesDB.update({\n databaseId,\n name: options?.name ?? databaseId,\n enabled: options?.enabled,\n });\n },\n delete: async (databaseId: DatabaseId) => {\n await tablesDB.delete({\n databaseId,\n });\n },\n{{/if}}\n } as DatabaseTables;\n}\n\n// Initialize client\nconst client = new Client()\n .setEndpoint(ENDPOINT)\n .setProject(PROJECT_ID){{#if supportsServerSide}}\n .setKey(API_KEY){{/if}};\n\nconst tablesDB = new TablesDB(client);\n\nexport const databases: DatabaseTables = createDatabasesApi(tablesDB);\n';
|
|
141429
141948
|
|
|
141430
141949
|
// lib/commands/generators/typescript/templates/index.ts.hbs
|
|
141431
141950
|
var index_ts_default = '/**\n * {{sdkTitle}} Generated SDK\n *\n * This file is auto-generated. Do not edit manually.\n * Re-run `{{executableName}} generate` to regenerate.\n */\n\nexport { databases } from "./databases{{importExt}}";\nexport * from "./types{{importExt}}";\n';
|
|
@@ -141592,7 +142111,7 @@ ${dbReturnTypes}
|
|
|
141592
142111
|
|
|
141593
142112
|
export type DatabaseHandle<D extends DatabaseId> = {
|
|
141594
142113
|
use: <T extends keyof DatabaseTableMap[D] & string>(tableId: T) => DatabaseTableMap[D][T];
|
|
141595
|
-
${supportsServerSide ? ` create: (tableId: string, name: string, options?: { permissions?: ${PERMISSION_CALLBACK_INLINE}; rowSecurity?: boolean; enabled?: boolean; columns?:
|
|
142114
|
+
${supportsServerSide ? ` create: (tableId: string, name: string, options?: { permissions?: ${PERMISSION_CALLBACK_INLINE}; rowSecurity?: boolean; enabled?: boolean; columns?: object[]; indexes?: object[] }) => Promise<Models.Table>;
|
|
141596
142115
|
update: <T extends keyof DatabaseTableMap[D] & string>(tableId: T, options?: { name?: string; permissions?: ${PERMISSION_CALLBACK_INLINE}; rowSecurity?: boolean; enabled?: boolean }) => Promise<Models.Table>;
|
|
141597
142116
|
delete: <T extends keyof DatabaseTableMap[D] & string>(tableId: T) => Promise<void>;` : ""}
|
|
141598
142117
|
};
|
|
@@ -141659,26 +142178,26 @@ ${supportsServerSide ? ` create: (databaseId: string, name: string, options?: {
|
|
|
141659
142178
|
generateBulkMethods(supportsBulk) {
|
|
141660
142179
|
if (!supportsBulk) return "";
|
|
141661
142180
|
return `
|
|
141662
|
-
createMany: (rows:
|
|
142181
|
+
createMany: (rows: object[], options?: { transactionId?: string }) =>
|
|
141663
142182
|
tablesDB.createRows({
|
|
141664
142183
|
databaseId,
|
|
141665
142184
|
tableId,
|
|
141666
142185
|
rows,
|
|
141667
142186
|
transactionId: options?.transactionId,
|
|
141668
142187
|
}),
|
|
141669
|
-
updateMany: (data:
|
|
142188
|
+
updateMany: (data: object, options?: { queries?: (q: QueryBuilder<T>) => string[]; transactionId?: string }) =>
|
|
141670
142189
|
tablesDB.updateRows({
|
|
141671
142190
|
databaseId,
|
|
141672
142191
|
tableId,
|
|
141673
142192
|
data,
|
|
141674
|
-
queries: options?.queries?.(createQueryBuilder()),
|
|
142193
|
+
queries: options?.queries?.(createQueryBuilder<T>()),
|
|
141675
142194
|
transactionId: options?.transactionId,
|
|
141676
142195
|
}),
|
|
141677
|
-
deleteMany: (options?: { queries?: (q:
|
|
142196
|
+
deleteMany: (options?: { queries?: (q: QueryBuilder<T>) => string[]; transactionId?: string }) =>
|
|
141678
142197
|
tablesDB.deleteRows({
|
|
141679
142198
|
databaseId,
|
|
141680
142199
|
tableId,
|
|
141681
|
-
queries: options?.queries?.(createQueryBuilder()),
|
|
142200
|
+
queries: options?.queries?.(createQueryBuilder<T>()),
|
|
141682
142201
|
transactionId: options?.transactionId,
|
|
141683
142202
|
}),`;
|
|
141684
142203
|
}
|
|
@@ -141692,9 +142211,9 @@ ${supportsServerSide ? ` create: (databaseId: string, name: string, options?: {
|
|
|
141692
142211
|
return `
|
|
141693
142212
|
// Remove bulk methods for tables with relationships
|
|
141694
142213
|
if (!hasBulkMethods(databaseId, tableId)) {
|
|
141695
|
-
delete (api as
|
|
141696
|
-
delete (api as
|
|
141697
|
-
delete (api as
|
|
142214
|
+
delete (api as Record<string, unknown>).createMany;
|
|
142215
|
+
delete (api as Record<string, unknown>).updateMany;
|
|
142216
|
+
delete (api as Record<string, unknown>).deleteMany;
|
|
141698
142217
|
}`;
|
|
141699
142218
|
}
|
|
141700
142219
|
generateDatabasesFile(config2, importExt) {
|
|
@@ -141841,8 +142360,9 @@ var generateAction = async (options) => {
|
|
|
141841
142360
|
}
|
|
141842
142361
|
} catch (err) {
|
|
141843
142362
|
const supported = getSupportedLanguages().join(", ");
|
|
142363
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
141844
142364
|
error48(
|
|
141845
|
-
`${
|
|
142365
|
+
`${message}
|
|
141846
142366
|
Use --language to specify the target language. Supported: ${supported}`
|
|
141847
142367
|
);
|
|
141848
142368
|
process.exit(1);
|
|
@@ -141897,7 +142417,8 @@ Use --language to specify the target language. Supported: ${supported}`
|
|
|
141897
142417
|
);
|
|
141898
142418
|
}
|
|
141899
142419
|
} catch (err) {
|
|
141900
|
-
|
|
142420
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
142421
|
+
error48(`Failed to generate SDK: ${message}`);
|
|
141901
142422
|
process.exit(1);
|
|
141902
142423
|
}
|
|
141903
142424
|
};
|
|
@@ -141956,6 +142477,36 @@ account.command(`delete`).description(`Delete the currently logged in user.`).ac
|
|
|
141956
142477
|
async () => parse3(await (await getAccountClient()).delete())
|
|
141957
142478
|
)
|
|
141958
142479
|
);
|
|
142480
|
+
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(
|
|
142481
|
+
actionRunner(
|
|
142482
|
+
async ({ queries }) => parse3(await (await getAccountClient()).listBillingAddresses(queries))
|
|
142483
|
+
)
|
|
142484
|
+
);
|
|
142485
|
+
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(
|
|
142486
|
+
actionRunner(
|
|
142487
|
+
async ({ country, city, streetAddress, addressLine2, state, postalCode }) => parse3(await (await getAccountClient()).createBillingAddress(country, city, streetAddress, addressLine2, state, postalCode))
|
|
142488
|
+
)
|
|
142489
|
+
);
|
|
142490
|
+
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(
|
|
142491
|
+
actionRunner(
|
|
142492
|
+
async ({ billingAddressId }) => parse3(await (await getAccountClient()).getBillingAddress(billingAddressId))
|
|
142493
|
+
)
|
|
142494
|
+
);
|
|
142495
|
+
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(
|
|
142496
|
+
actionRunner(
|
|
142497
|
+
async ({ billingAddressId, country, city, streetAddress, addressLine2, state, postalCode }) => parse3(await (await getAccountClient()).updateBillingAddress(billingAddressId, country, city, streetAddress, addressLine2, state, postalCode))
|
|
142498
|
+
)
|
|
142499
|
+
);
|
|
142500
|
+
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(
|
|
142501
|
+
actionRunner(
|
|
142502
|
+
async ({ billingAddressId }) => parse3(await (await getAccountClient()).deleteBillingAddress(billingAddressId))
|
|
142503
|
+
)
|
|
142504
|
+
);
|
|
142505
|
+
account.command(`get-coupon`).description(`Get coupon details for an account.`).requiredOption(`--coupon-id <coupon-id>`, `ID of the coupon`).action(
|
|
142506
|
+
actionRunner(
|
|
142507
|
+
async ({ couponId }) => parse3(await (await getAccountClient()).getCoupon(couponId))
|
|
142508
|
+
)
|
|
142509
|
+
);
|
|
141959
142510
|
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.
|
|
141960
142511
|
This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.
|
|
141961
142512
|
`).requiredOption(`--email <email>`, `User email.`).requiredOption(`--password <password>`, `User password. Must be at least 8 chars.`).action(
|
|
@@ -141977,11 +142528,45 @@ account.command(`delete-identity`).description(`Delete an identity by its unique
|
|
|
141977
142528
|
async ({ identityId }) => parse3(await (await getAccountClient()).deleteIdentity(identityId))
|
|
141978
142529
|
)
|
|
141979
142530
|
);
|
|
142531
|
+
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(
|
|
142532
|
+
actionRunner(
|
|
142533
|
+
async ({ queries }) => parse3(await (await getAccountClient()).listInvoices(queries))
|
|
142534
|
+
)
|
|
142535
|
+
);
|
|
141980
142536
|
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(
|
|
141981
142537
|
actionRunner(
|
|
141982
142538
|
async ({ duration: duration3 }) => parse3(await (await getAccountClient()).createJWT(duration3))
|
|
141983
142539
|
)
|
|
141984
142540
|
);
|
|
142541
|
+
account.command(`list-keys`).description(`Get a list of all API keys from the current account. `).option(
|
|
142542
|
+
`--total [value]`,
|
|
142543
|
+
`When set to false, the total count returned will be 0 and will not be calculated.`,
|
|
142544
|
+
(value) => value === void 0 ? true : parseBool(value)
|
|
142545
|
+
).action(
|
|
142546
|
+
actionRunner(
|
|
142547
|
+
async ({ total }) => parse3(await (await getAccountClient()).listKeys(total))
|
|
142548
|
+
)
|
|
142549
|
+
);
|
|
142550
|
+
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(
|
|
142551
|
+
actionRunner(
|
|
142552
|
+
async ({ name, scopes, expire }) => parse3(await (await getAccountClient()).createKey(name, scopes, expire))
|
|
142553
|
+
)
|
|
142554
|
+
);
|
|
142555
|
+
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(
|
|
142556
|
+
actionRunner(
|
|
142557
|
+
async ({ keyId }) => parse3(await (await getAccountClient()).getKey(keyId))
|
|
142558
|
+
)
|
|
142559
|
+
);
|
|
142560
|
+
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(
|
|
142561
|
+
actionRunner(
|
|
142562
|
+
async ({ keyId, name, scopes, expire }) => parse3(await (await getAccountClient()).updateKey(keyId, name, scopes, expire))
|
|
142563
|
+
)
|
|
142564
|
+
);
|
|
142565
|
+
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(
|
|
142566
|
+
actionRunner(
|
|
142567
|
+
async ({ keyId }) => parse3(await (await getAccountClient()).deleteKey(keyId))
|
|
142568
|
+
)
|
|
142569
|
+
);
|
|
141985
142570
|
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(
|
|
141986
142571
|
`--total [value]`,
|
|
141987
142572
|
`When set to false, the total count returned will be 0 and will not be calculated.`,
|
|
@@ -142051,6 +142636,41 @@ account.command(`update-password`).description(`Update currently logged in user
|
|
|
142051
142636
|
async ({ password, oldPassword }) => parse3(await (await getAccountClient()).updatePassword(password, oldPassword))
|
|
142052
142637
|
)
|
|
142053
142638
|
);
|
|
142639
|
+
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(
|
|
142640
|
+
actionRunner(
|
|
142641
|
+
async ({ queries }) => parse3(await (await getAccountClient()).listPaymentMethods(queries))
|
|
142642
|
+
)
|
|
142643
|
+
);
|
|
142644
|
+
account.command(`create-payment-method`).description(`Create a new payment method for the current user account.`).action(
|
|
142645
|
+
actionRunner(
|
|
142646
|
+
async () => parse3(await (await getAccountClient()).createPaymentMethod())
|
|
142647
|
+
)
|
|
142648
|
+
);
|
|
142649
|
+
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(
|
|
142650
|
+
actionRunner(
|
|
142651
|
+
async ({ paymentMethodId }) => parse3(await (await getAccountClient()).getPaymentMethod(paymentMethodId))
|
|
142652
|
+
)
|
|
142653
|
+
);
|
|
142654
|
+
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(
|
|
142655
|
+
actionRunner(
|
|
142656
|
+
async ({ paymentMethodId, expiryMonth, expiryYear, state }) => parse3(await (await getAccountClient()).updatePaymentMethod(paymentMethodId, expiryMonth, expiryYear, state))
|
|
142657
|
+
)
|
|
142658
|
+
);
|
|
142659
|
+
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(
|
|
142660
|
+
actionRunner(
|
|
142661
|
+
async ({ paymentMethodId }) => parse3(await (await getAccountClient()).deletePaymentMethod(paymentMethodId))
|
|
142662
|
+
)
|
|
142663
|
+
);
|
|
142664
|
+
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(
|
|
142665
|
+
actionRunner(
|
|
142666
|
+
async ({ paymentMethodId, providerMethodId, name, state }) => parse3(await (await getAccountClient()).updatePaymentMethodProvider(paymentMethodId, providerMethodId, name, state))
|
|
142667
|
+
)
|
|
142668
|
+
);
|
|
142669
|
+
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(
|
|
142670
|
+
actionRunner(
|
|
142671
|
+
async ({ paymentMethodId }) => parse3(await (await getAccountClient()).updatePaymentMethodMandateOptions(paymentMethodId))
|
|
142672
|
+
)
|
|
142673
|
+
);
|
|
142054
142674
|
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(
|
|
142055
142675
|
actionRunner(
|
|
142056
142676
|
async ({ phone, password }) => parse3(await (await getAccountClient()).updatePhone(phone, password))
|
|
@@ -142112,8 +142732,8 @@ If there is already an active session, the new session will be attached to the l
|
|
|
142112
142732
|
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).
|
|
142113
142733
|
`).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(
|
|
142114
142734
|
actionRunner(
|
|
142115
|
-
async ({ provider, success:
|
|
142116
|
-
const url2 = (await getAccountClient()).createOAuth2Session(provider,
|
|
142735
|
+
async ({ provider, success: success20, failure, scopes }) => {
|
|
142736
|
+
const url2 = (await getAccountClient()).createOAuth2Session(provider, success20, failure, scopes);
|
|
142117
142737
|
if (url2) console.log(url2);
|
|
142118
142738
|
}
|
|
142119
142739
|
)
|
|
@@ -142193,8 +142813,8 @@ If authentication succeeds, \`userId\` and \`secret\` of a token will be appende
|
|
|
142193
142813
|
|
|
142194
142814
|
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(
|
|
142195
142815
|
actionRunner(
|
|
142196
|
-
async ({ provider, success:
|
|
142197
|
-
const url2 = (await getAccountClient()).createOAuth2Token(provider,
|
|
142816
|
+
async ({ provider, success: success20, failure, scopes }) => {
|
|
142817
|
+
const url2 = (await getAccountClient()).createOAuth2Token(provider, success20, failure, scopes);
|
|
142198
142818
|
if (url2) console.log(url2);
|
|
142199
142819
|
}
|
|
142200
142820
|
)
|
|
@@ -142243,26 +142863,108 @@ account.command(`update-phone-verification`).description(`Use this endpoint to c
|
|
|
142243
142863
|
)
|
|
142244
142864
|
);
|
|
142245
142865
|
|
|
142246
|
-
// lib/commands/services/
|
|
142247
|
-
var
|
|
142248
|
-
var
|
|
142249
|
-
if (!
|
|
142866
|
+
// lib/commands/services/activities.ts
|
|
142867
|
+
var activitiesClient = null;
|
|
142868
|
+
var getActivitiesClient = async () => {
|
|
142869
|
+
if (!activitiesClient) {
|
|
142870
|
+
const sdkClient = await sdkForProject();
|
|
142871
|
+
activitiesClient = new Activities(sdkClient);
|
|
142872
|
+
}
|
|
142873
|
+
return activitiesClient;
|
|
142874
|
+
};
|
|
142875
|
+
var activities = new Command("activities").description(commandDescriptions["activities"] ?? "").configureHelp({
|
|
142876
|
+
helpWidth: process.stdout.columns || 80
|
|
142877
|
+
});
|
|
142878
|
+
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(
|
|
142879
|
+
actionRunner(
|
|
142880
|
+
async ({ queries }) => parse3(await (await getActivitiesClient()).listEvents(queries))
|
|
142881
|
+
)
|
|
142882
|
+
);
|
|
142883
|
+
activities.command(`get-event`).description(`Get event by ID.
|
|
142884
|
+
`).requiredOption(`--event-id <event-id>`, `Event ID.`).action(
|
|
142885
|
+
actionRunner(
|
|
142886
|
+
async ({ eventId }) => parse3(await (await getActivitiesClient()).getEvent(eventId))
|
|
142887
|
+
)
|
|
142888
|
+
);
|
|
142889
|
+
|
|
142890
|
+
// lib/commands/services/backups.ts
|
|
142891
|
+
var backupsClient = null;
|
|
142892
|
+
var getBackupsClient = async () => {
|
|
142893
|
+
if (!backupsClient) {
|
|
142250
142894
|
const sdkClient = await sdkForProject();
|
|
142251
|
-
|
|
142895
|
+
backupsClient = new Backups(sdkClient);
|
|
142252
142896
|
}
|
|
142253
|
-
return
|
|
142897
|
+
return backupsClient;
|
|
142254
142898
|
};
|
|
142255
|
-
var
|
|
142899
|
+
var backups = new Command("backups").description(commandDescriptions["backups"] ?? "").configureHelp({
|
|
142256
142900
|
helpWidth: process.stdout.columns || 80
|
|
142257
142901
|
});
|
|
142258
|
-
|
|
142902
|
+
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(
|
|
142903
|
+
actionRunner(
|
|
142904
|
+
async ({ queries }) => parse3(await (await getBackupsClient()).listArchives(queries))
|
|
142905
|
+
)
|
|
142906
|
+
);
|
|
142907
|
+
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(
|
|
142908
|
+
actionRunner(
|
|
142909
|
+
async ({ services, resourceId }) => parse3(await (await getBackupsClient()).createArchive(services, resourceId))
|
|
142910
|
+
)
|
|
142911
|
+
);
|
|
142912
|
+
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(
|
|
142913
|
+
actionRunner(
|
|
142914
|
+
async ({ archiveId }) => parse3(await (await getBackupsClient()).getArchive(archiveId))
|
|
142915
|
+
)
|
|
142916
|
+
);
|
|
142917
|
+
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(
|
|
142918
|
+
actionRunner(
|
|
142919
|
+
async ({ archiveId }) => parse3(await (await getBackupsClient()).deleteArchive(archiveId))
|
|
142920
|
+
)
|
|
142921
|
+
);
|
|
142922
|
+
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(
|
|
142923
|
+
actionRunner(
|
|
142924
|
+
async ({ queries }) => parse3(await (await getBackupsClient()).listPolicies(queries))
|
|
142925
|
+
)
|
|
142926
|
+
);
|
|
142927
|
+
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(
|
|
142928
|
+
`--enabled [value]`,
|
|
142929
|
+
`Is policy enabled? When set to 'disabled', no backups will be taken`,
|
|
142930
|
+
(value) => value === void 0 ? true : parseBool(value)
|
|
142931
|
+
).action(
|
|
142932
|
+
actionRunner(
|
|
142933
|
+
async ({ policyId, services, retention, schedule, name, resourceId, enabled }) => parse3(await (await getBackupsClient()).createPolicy(policyId, services, retention, schedule, name, resourceId, enabled))
|
|
142934
|
+
)
|
|
142935
|
+
);
|
|
142936
|
+
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(
|
|
142937
|
+
actionRunner(
|
|
142938
|
+
async ({ policyId }) => parse3(await (await getBackupsClient()).getPolicy(policyId))
|
|
142939
|
+
)
|
|
142940
|
+
);
|
|
142941
|
+
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(
|
|
142942
|
+
`--enabled [value]`,
|
|
142943
|
+
`Is Backup enabled? When set to 'disabled', No backup will be taken`,
|
|
142944
|
+
(value) => value === void 0 ? true : parseBool(value)
|
|
142945
|
+
).action(
|
|
142946
|
+
actionRunner(
|
|
142947
|
+
async ({ policyId, name, retention, schedule, enabled }) => parse3(await (await getBackupsClient()).updatePolicy(policyId, name, retention, schedule, enabled))
|
|
142948
|
+
)
|
|
142949
|
+
);
|
|
142950
|
+
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(
|
|
142259
142951
|
actionRunner(
|
|
142260
|
-
async ({
|
|
142952
|
+
async ({ policyId }) => parse3(await (await getBackupsClient()).deletePolicy(policyId))
|
|
142261
142953
|
)
|
|
142262
142954
|
);
|
|
142263
|
-
|
|
142955
|
+
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(
|
|
142264
142956
|
actionRunner(
|
|
142265
|
-
async () => parse3(await (await
|
|
142957
|
+
async ({ archiveId, services, newResourceId, newResourceName }) => parse3(await (await getBackupsClient()).createRestoration(archiveId, services, newResourceId, newResourceName))
|
|
142958
|
+
)
|
|
142959
|
+
);
|
|
142960
|
+
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(
|
|
142961
|
+
actionRunner(
|
|
142962
|
+
async ({ queries }) => parse3(await (await getBackupsClient()).listRestorations(queries))
|
|
142963
|
+
)
|
|
142964
|
+
);
|
|
142965
|
+
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(
|
|
142966
|
+
actionRunner(
|
|
142967
|
+
async ({ restorationId }) => parse3(await (await getBackupsClient()).getRestoration(restorationId))
|
|
142266
142968
|
)
|
|
142267
142969
|
);
|
|
142268
142970
|
|
|
@@ -143122,11 +143824,26 @@ health.command(`get-queue-audits`).description(`Get the number of audit logs tha
|
|
|
143122
143824
|
async ({ threshold }) => parse3(await (await getHealthClient()).getQueueAudits(threshold))
|
|
143123
143825
|
)
|
|
143124
143826
|
);
|
|
143827
|
+
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(
|
|
143828
|
+
actionRunner(
|
|
143829
|
+
async ({ threshold }) => parse3(await (await getHealthClient()).getQueueBillingProjectAggregation(threshold))
|
|
143830
|
+
)
|
|
143831
|
+
);
|
|
143832
|
+
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(
|
|
143833
|
+
actionRunner(
|
|
143834
|
+
async ({ threshold }) => parse3(await (await getHealthClient()).getQueueBillingTeamAggregation(threshold))
|
|
143835
|
+
)
|
|
143836
|
+
);
|
|
143125
143837
|
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(
|
|
143126
143838
|
actionRunner(
|
|
143127
143839
|
async ({ threshold }) => parse3(await (await getHealthClient()).getQueueBuilds(threshold))
|
|
143128
143840
|
)
|
|
143129
143841
|
);
|
|
143842
|
+
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(
|
|
143843
|
+
actionRunner(
|
|
143844
|
+
async ({ threshold }) => parse3(await (await getHealthClient()).getQueuePriorityBuilds(threshold))
|
|
143845
|
+
)
|
|
143846
|
+
);
|
|
143130
143847
|
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(
|
|
143131
143848
|
actionRunner(
|
|
143132
143849
|
async ({ threshold }) => parse3(await (await getHealthClient()).getQueueCertificates(threshold))
|
|
@@ -143173,6 +143890,11 @@ health.command(`get-queue-migrations`).description(`Get the number of migrations
|
|
|
143173
143890
|
async ({ threshold }) => parse3(await (await getHealthClient()).getQueueMigrations(threshold))
|
|
143174
143891
|
)
|
|
143175
143892
|
);
|
|
143893
|
+
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(
|
|
143894
|
+
actionRunner(
|
|
143895
|
+
async ({ threshold }) => parse3(await (await getHealthClient()).getQueueRegionManager(threshold))
|
|
143896
|
+
)
|
|
143897
|
+
);
|
|
143176
143898
|
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(
|
|
143177
143899
|
actionRunner(
|
|
143178
143900
|
async ({ threshold }) => parse3(await (await getHealthClient()).getQueueStatsResources(threshold))
|
|
@@ -143183,6 +143905,11 @@ health.command(`get-queue-usage`).description(`Get the number of metrics that ar
|
|
|
143183
143905
|
async ({ threshold }) => parse3(await (await getHealthClient()).getQueueUsage(threshold))
|
|
143184
143906
|
)
|
|
143185
143907
|
);
|
|
143908
|
+
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(
|
|
143909
|
+
actionRunner(
|
|
143910
|
+
async ({ threshold }) => parse3(await (await getHealthClient()).getQueueThreats(threshold))
|
|
143911
|
+
)
|
|
143912
|
+
);
|
|
143186
143913
|
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(
|
|
143187
143914
|
actionRunner(
|
|
143188
143915
|
async ({ threshold }) => parse3(await (await getHealthClient()).getQueueWebhooks(threshold))
|
|
@@ -144083,7 +144810,7 @@ projects.command(`list-schedules`).description(`Get a list of all the project's
|
|
|
144083
144810
|
async ({ projectId, queries, total }) => parse3(await (await getProjectsClient()).listSchedules(projectId, queries, total))
|
|
144084
144811
|
)
|
|
144085
144812
|
);
|
|
144086
|
-
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.`).requiredOption(`--resource-id <resource-id>`, `The resource ID to associate with this schedule.`).requiredOption(`--schedule <schedule>`, `Schedule CRON expression.`).option(
|
|
144813
|
+
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(
|
|
144087
144814
|
`--active [value]`,
|
|
144088
144815
|
`Whether the schedule is active.`,
|
|
144089
144816
|
(value) => value === void 0 ? true : parseBool(value)
|
|
@@ -144503,7 +145230,7 @@ storage.command(`create-bucket`).description(`Create a new storage bucket.`).req
|
|
|
144503
145230
|
`--enabled [value]`,
|
|
144504
145231
|
`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.`,
|
|
144505
145232
|
(value) => value === void 0 ? true : parseBool(value)
|
|
144506
|
-
).option(`--maximum-file-size <maximum-file-size>`, `Maximum file size allowed in bytes. Maximum allowed value is
|
|
145233
|
+
).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(
|
|
144507
145234
|
`--encryption [value]`,
|
|
144508
145235
|
`Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled`,
|
|
144509
145236
|
(value) => value === void 0 ? true : parseBool(value)
|
|
@@ -144533,7 +145260,7 @@ storage.command(`update-bucket`).description(`Update a storage bucket by its uni
|
|
|
144533
145260
|
`--enabled [value]`,
|
|
144534
145261
|
`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.`,
|
|
144535
145262
|
(value) => value === void 0 ? true : parseBool(value)
|
|
144536
|
-
).option(`--maximum-file-size <maximum-file-size>`, `Maximum file size allowed in bytes. Maximum allowed value is
|
|
145263
|
+
).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(
|
|
144537
145264
|
`--encryption [value]`,
|
|
144538
145265
|
`Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled`,
|
|
144539
145266
|
(value) => value === void 0 ? true : parseBool(value)
|
|
@@ -145679,12 +146406,12 @@ async function checkVersion() {
|
|
|
145679
146406
|
} else {
|
|
145680
146407
|
process.stdout.write(import_chalk13.default.blue("\n\u{1F680} You are running a pre-release or development version.") + "\n");
|
|
145681
146408
|
}
|
|
145682
|
-
} catch (
|
|
146409
|
+
} catch (_error) {
|
|
145683
146410
|
process.stdout.write(import_chalk13.default.gray("\n(Unable to check for updates)") + "\n");
|
|
145684
146411
|
}
|
|
145685
146412
|
}
|
|
145686
146413
|
if (process.argv.includes("-v") || process.argv.includes("--version")) {
|
|
145687
|
-
(async () => {
|
|
146414
|
+
void (async () => {
|
|
145688
146415
|
await checkVersion();
|
|
145689
146416
|
process.exit(0);
|
|
145690
146417
|
})();
|
|
@@ -145705,11 +146432,14 @@ if (process.argv.includes("-v") || process.argv.includes("--version")) {
|
|
|
145705
146432
|
cliConfig.all = true;
|
|
145706
146433
|
}).on("option:id", function() {
|
|
145707
146434
|
cliConfig.ids = this.opts().id;
|
|
145708
|
-
}).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(
|
|
146435
|
+
}).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);
|
|
145709
146436
|
process.stdout.columns = oldWidth;
|
|
145710
146437
|
}
|
|
145711
146438
|
/*! Bundled license information:
|
|
145712
146439
|
|
|
146440
|
+
safe-buffer/index.js:
|
|
146441
|
+
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
146442
|
+
|
|
145713
146443
|
undici/lib/fetch/body.js:
|
|
145714
146444
|
(*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> *)
|
|
145715
146445
|
|