appwrite-cli 13.5.0 → 13.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +2 -2
  3. package/cli.ts +4 -2
  4. package/dist/bundle-win-arm64.mjs +658 -52
  5. package/dist/cli.cjs +658 -52
  6. package/dist/index.cjs +33 -14
  7. package/dist/index.js +33 -14
  8. package/dist/lib/commands/schema.d.ts.map +1 -1
  9. package/dist/lib/commands/services/activities.d.ts +3 -0
  10. package/dist/lib/commands/services/activities.d.ts.map +1 -0
  11. package/dist/lib/commands/services/backups.d.ts +3 -0
  12. package/dist/lib/commands/services/backups.d.ts.map +1 -0
  13. package/dist/lib/constants.d.ts +1 -1
  14. package/dist/lib/json.d.ts.map +1 -1
  15. package/docs/examples/account/create-key.md +5 -0
  16. package/docs/examples/account/delete-key.md +4 -0
  17. package/docs/examples/account/get-key.md +4 -0
  18. package/docs/examples/account/list-keys.md +3 -0
  19. package/docs/examples/account/update-key.md +6 -0
  20. package/docs/examples/activities/get-event.md +4 -0
  21. package/docs/examples/activities/list-events.md +3 -0
  22. package/docs/examples/backups/create-archive.md +4 -0
  23. package/docs/examples/backups/create-policy.md +7 -0
  24. package/docs/examples/backups/create-restoration.md +5 -0
  25. package/docs/examples/backups/delete-archive.md +4 -0
  26. package/docs/examples/backups/delete-policy.md +4 -0
  27. package/docs/examples/backups/get-archive.md +4 -0
  28. package/docs/examples/backups/get-policy.md +4 -0
  29. package/docs/examples/backups/get-restoration.md +4 -0
  30. package/docs/examples/backups/list-archives.md +3 -0
  31. package/docs/examples/backups/list-policies.md +3 -0
  32. package/docs/examples/backups/list-restorations.md +3 -0
  33. package/docs/examples/backups/update-policy.md +4 -0
  34. package/install.ps1 +2 -2
  35. package/install.sh +1 -1
  36. package/lib/commands/schema.ts +1 -3
  37. package/lib/commands/services/account.ts +234 -0
  38. package/lib/commands/services/activities.ts +51 -0
  39. package/lib/commands/services/backups.ts +184 -0
  40. package/lib/commands/services/health.ts +55 -0
  41. package/lib/commands/services/projects.ts +1 -1
  42. package/lib/commands/services/storage.ts +2 -2
  43. package/lib/constants.ts +1 -1
  44. package/lib/json.ts +6 -1
  45. package/package.json +2 -2
  46. package/scoop/appwrite.config.json +3 -3
  47. package/dist/lib/commands/services/console.d.ts +0 -3
  48. package/dist/lib/commands/services/console.d.ts.map +0 -1
  49. package/docs/examples/console/get-resource.md +0 -5
  50. package/docs/examples/console/variables.md +0 -3
  51. package/lib/commands/services/console.ts +0 -49
package/dist/cli.cjs CHANGED
@@ -21956,9 +21956,9 @@ var require_stream_duplex = __commonJS({
21956
21956
  }
21957
21957
  });
21958
21958
 
21959
- // node_modules/safe-buffer/index.js
21959
+ // node_modules/string_decoder/node_modules/safe-buffer/index.js
21960
21960
  var require_safe_buffer = __commonJS({
21961
- "node_modules/safe-buffer/index.js"(exports2, module2) {
21961
+ "node_modules/string_decoder/node_modules/safe-buffer/index.js"(exports2, module2) {
21962
21962
  var buffer = require("buffer");
21963
21963
  var Buffer2 = buffer.Buffer;
21964
21964
  function copyProps(src, dst) {
@@ -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 success19 = validation.pipe(
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(success19)
24527
+ takeUntil(success20)
24527
24528
  );
24528
24529
  return {
24529
- success: success19,
24530
+ success: success20,
24530
24531
  error: error49
24531
24532
  };
24532
24533
  }
@@ -63424,14 +63425,14 @@ var require_base2 = __commonJS({
63424
63425
  return { isValid: err };
63425
63426
  });
63426
63427
  }).share();
63427
- var success19 = validation.filter(function(state) {
63428
+ var success20 = validation.filter(function(state) {
63428
63429
  return state.isValid === true;
63429
63430
  }).take(1);
63430
63431
  var error49 = validation.filter(function(state) {
63431
63432
  return state.isValid !== true;
63432
- }).takeUntil(success19);
63433
+ }).takeUntil(success20);
63433
63434
  return {
63434
- success: success19,
63435
+ success: success20,
63435
63436
  error: error49
63436
63437
  };
63437
63438
  };
@@ -92060,7 +92061,7 @@ var package_default = {
92060
92061
  type: "module",
92061
92062
  homepage: "https://appwrite.io/support",
92062
92063
  description: "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API",
92063
- version: "13.5.0",
92064
+ version: "13.6.0",
92064
92065
  license: "BSD-3-Clause",
92065
92066
  main: "dist/index.cjs",
92066
92067
  module: "dist/index.js",
@@ -92103,7 +92104,7 @@ var package_default = {
92103
92104
  "windows-arm64": "esbuild cli.ts --bundle --loader:.hbs=text --platform=node --target=node18 --format=esm --external:fsevents --outfile=dist/bundle-win-arm64.mjs && pkg dist/bundle-win-arm64.mjs -t node18-win-arm64 -o build/appwrite-cli-win-arm64.exe"
92104
92105
  },
92105
92106
  dependencies: {
92106
- "@appwrite.io/console": "^3.0.0",
92107
+ "@appwrite.io/console": "^3.1.0",
92107
92108
  chalk: "4.1.2",
92108
92109
  chokidar: "^3.6.0",
92109
92110
  "cli-progress": "^3.12.0",
@@ -106337,7 +106338,7 @@ var import_undici = __toESM(require_undici(), 1);
106337
106338
  // lib/constants.ts
106338
106339
  var SDK_TITLE = "Appwrite";
106339
106340
  var SDK_TITLE_LOWER = "appwrite";
106340
- var SDK_VERSION = "13.5.0";
106341
+ var SDK_VERSION = "13.6.0";
106341
106342
  var SDK_NAME = "Command Line";
106342
106343
  var SDK_PLATFORM = "console";
106343
106344
  var SDK_LANGUAGE = "cli";
@@ -106500,6 +106501,8 @@ var JSONbigParser = (0, import_json_bigint.default)({ storeAsString: false });
106500
106501
  var JSONbigSerializer = (0, import_json_bigint.default)({ useNativeBigInt: true });
106501
106502
  var MAX_SAFE = BigInt(Number.MAX_SAFE_INTEGER);
106502
106503
  var MIN_SAFE = BigInt(Number.MIN_SAFE_INTEGER);
106504
+ var MAX_INT64 = BigInt("9223372036854775807");
106505
+ var MIN_INT64 = BigInt("-9223372036854775808");
106503
106506
  function isBigNumber(value) {
106504
106507
  return value !== null && typeof value === "object" && value._isBigNumber === true && typeof value.isInteger === "function" && typeof value.toFixed === "function" && typeof value.toNumber === "function";
106505
106508
  }
@@ -106511,7 +106514,10 @@ function reviver(_key, value) {
106511
106514
  if (bi >= MIN_SAFE && bi <= MAX_SAFE) {
106512
106515
  return Number(str);
106513
106516
  }
106514
- return bi;
106517
+ if (bi >= MIN_INT64 && bi <= MAX_INT64) {
106518
+ return bi;
106519
+ }
106520
+ return value.toNumber();
106515
106521
  }
106516
106522
  return value.toNumber();
106517
106523
  }
@@ -107270,6 +107276,8 @@ Query.cursorBefore = (documentId) => new Query("cursorBefore", void 0, documentI
107270
107276
  Query.limit = (limit) => new Query("limit", void 0, limit).toString();
107271
107277
  Query.offset = (offset) => new Query("offset", void 0, offset).toString();
107272
107278
  Query.contains = (attribute, value) => new Query("contains", attribute, value).toString();
107279
+ Query.containsAny = (attribute, value) => new Query("containsAny", attribute, value).toString();
107280
+ Query.containsAll = (attribute, value) => new Query("containsAll", attribute, value).toString();
107273
107281
  Query.notContains = (attribute, value) => new Query("notContains", attribute, value).toString();
107274
107282
  Query.notSearch = (attribute, value) => new Query("notSearch", attribute, value).toString();
107275
107283
  Query.notBetween = (attribute, start, end) => new Query("notBetween", attribute, [start, end]).toString();
@@ -107300,6 +107308,8 @@ var JSONbigParser2 = (0, import_json_bigint2.default)({ storeAsString: false });
107300
107308
  var JSONbigSerializer2 = (0, import_json_bigint2.default)({ useNativeBigInt: true });
107301
107309
  var MAX_SAFE2 = BigInt(Number.MAX_SAFE_INTEGER);
107302
107310
  var MIN_SAFE2 = BigInt(Number.MIN_SAFE_INTEGER);
107311
+ var MAX_INT642 = BigInt("9223372036854775807");
107312
+ var MIN_INT642 = BigInt("-9223372036854775808");
107303
107313
  function isBigNumber2(value) {
107304
107314
  return value !== null && typeof value === "object" && value._isBigNumber === true && typeof value.isInteger === "function" && typeof value.toFixed === "function" && typeof value.toNumber === "function";
107305
107315
  }
@@ -107311,7 +107321,10 @@ function reviver2(_key, value) {
107311
107321
  if (bi >= MIN_SAFE2 && bi <= MAX_SAFE2) {
107312
107322
  return Number(str);
107313
107323
  }
107314
- return bi;
107324
+ if (bi >= MIN_INT642 && bi <= MAX_INT642) {
107325
+ return bi;
107326
+ }
107327
+ return value.toNumber();
107315
107328
  }
107316
107329
  return value.toNumber();
107317
107330
  }
@@ -107358,7 +107371,7 @@ var Client = class _Client {
107358
107371
  "x-sdk-name": "Console",
107359
107372
  "x-sdk-platform": "console",
107360
107373
  "x-sdk-language": "web",
107361
- "x-sdk-version": "3.0.0",
107374
+ "x-sdk-version": "3.1.0",
107362
107375
  "X-Appwrite-Response-Format": "1.8.0"
107363
107376
  };
107364
107377
  this.realtime = {
@@ -109354,7 +109367,7 @@ var Account = class {
109354
109367
  };
109355
109368
  }
109356
109369
  const provider = params.provider;
109357
- const success19 = params.success;
109370
+ const success20 = params.success;
109358
109371
  const failure = params.failure;
109359
109372
  const scopes = params.scopes;
109360
109373
  if (typeof provider === "undefined") {
@@ -109362,8 +109375,8 @@ var Account = class {
109362
109375
  }
109363
109376
  const apiPath = "/account/sessions/oauth2/{provider}".replace("{provider}", provider);
109364
109377
  const payload = {};
109365
- if (typeof success19 !== "undefined") {
109366
- payload["success"] = success19;
109378
+ if (typeof success20 !== "undefined") {
109379
+ payload["success"] = success20;
109367
109380
  }
109368
109381
  if (typeof failure !== "undefined") {
109369
109382
  payload["failure"] = failure;
@@ -109702,7 +109715,7 @@ var Account = class {
109702
109715
  };
109703
109716
  }
109704
109717
  const provider = params.provider;
109705
- const success19 = params.success;
109718
+ const success20 = params.success;
109706
109719
  const failure = params.failure;
109707
109720
  const scopes = params.scopes;
109708
109721
  if (typeof provider === "undefined") {
@@ -109710,8 +109723,8 @@ var Account = class {
109710
109723
  }
109711
109724
  const apiPath = "/account/tokens/oauth2/{provider}".replace("{provider}", provider);
109712
109725
  const payload = {};
109713
- if (typeof success19 !== "undefined") {
109714
- payload["success"] = success19;
109726
+ if (typeof success20 !== "undefined") {
109727
+ payload["success"] = success20;
109715
109728
  }
109716
109729
  if (typeof failure !== "undefined") {
109717
109730
  payload["failure"] = failure;
@@ -109923,6 +109936,385 @@ var Account = class {
109923
109936
  return this.client.call("put", uri, apiHeaders, payload);
109924
109937
  }
109925
109938
  };
109939
+ var Activities = class {
109940
+ constructor(client2) {
109941
+ this.client = client2;
109942
+ }
109943
+ listEvents(paramsOrFirst) {
109944
+ let params;
109945
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
109946
+ params = paramsOrFirst || {};
109947
+ } else {
109948
+ params = {
109949
+ queries: paramsOrFirst
109950
+ };
109951
+ }
109952
+ const queries = params.queries;
109953
+ const apiPath = "/activities/events";
109954
+ const payload = {};
109955
+ if (typeof queries !== "undefined") {
109956
+ payload["queries"] = queries;
109957
+ }
109958
+ const uri = new URL(this.client.config.endpoint + apiPath);
109959
+ const apiHeaders = {};
109960
+ return this.client.call("get", uri, apiHeaders, payload);
109961
+ }
109962
+ getEvent(paramsOrFirst) {
109963
+ let params;
109964
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
109965
+ params = paramsOrFirst || {};
109966
+ } else {
109967
+ params = {
109968
+ eventId: paramsOrFirst
109969
+ };
109970
+ }
109971
+ const eventId = params.eventId;
109972
+ if (typeof eventId === "undefined") {
109973
+ throw new AppwriteException('Missing required parameter: "eventId"');
109974
+ }
109975
+ const apiPath = "/activities/events/{eventId}".replace("{eventId}", eventId);
109976
+ const payload = {};
109977
+ const uri = new URL(this.client.config.endpoint + apiPath);
109978
+ const apiHeaders = {};
109979
+ return this.client.call("get", uri, apiHeaders, payload);
109980
+ }
109981
+ };
109982
+ var Backups = class {
109983
+ constructor(client2) {
109984
+ this.client = client2;
109985
+ }
109986
+ listArchives(paramsOrFirst) {
109987
+ let params;
109988
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
109989
+ params = paramsOrFirst || {};
109990
+ } else {
109991
+ params = {
109992
+ queries: paramsOrFirst
109993
+ };
109994
+ }
109995
+ const queries = params.queries;
109996
+ const apiPath = "/backups/archives";
109997
+ const payload = {};
109998
+ if (typeof queries !== "undefined") {
109999
+ payload["queries"] = queries;
110000
+ }
110001
+ const uri = new URL(this.client.config.endpoint + apiPath);
110002
+ const apiHeaders = {};
110003
+ return this.client.call("get", uri, apiHeaders, payload);
110004
+ }
110005
+ createArchive(paramsOrFirst, ...rest) {
110006
+ let params;
110007
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && ("services" in paramsOrFirst || "resourceId" in paramsOrFirst)) {
110008
+ params = paramsOrFirst || {};
110009
+ } else {
110010
+ params = {
110011
+ services: paramsOrFirst,
110012
+ resourceId: rest[0]
110013
+ };
110014
+ }
110015
+ const services = params.services;
110016
+ const resourceId = params.resourceId;
110017
+ if (typeof services === "undefined") {
110018
+ throw new AppwriteException('Missing required parameter: "services"');
110019
+ }
110020
+ const apiPath = "/backups/archives";
110021
+ const payload = {};
110022
+ if (typeof services !== "undefined") {
110023
+ payload["services"] = services;
110024
+ }
110025
+ if (typeof resourceId !== "undefined") {
110026
+ payload["resourceId"] = resourceId;
110027
+ }
110028
+ const uri = new URL(this.client.config.endpoint + apiPath);
110029
+ const apiHeaders = {
110030
+ "content-type": "application/json"
110031
+ };
110032
+ return this.client.call("post", uri, apiHeaders, payload);
110033
+ }
110034
+ getArchive(paramsOrFirst) {
110035
+ let params;
110036
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
110037
+ params = paramsOrFirst || {};
110038
+ } else {
110039
+ params = {
110040
+ archiveId: paramsOrFirst
110041
+ };
110042
+ }
110043
+ const archiveId = params.archiveId;
110044
+ if (typeof archiveId === "undefined") {
110045
+ throw new AppwriteException('Missing required parameter: "archiveId"');
110046
+ }
110047
+ const apiPath = "/backups/archives/{archiveId}".replace("{archiveId}", archiveId);
110048
+ const payload = {};
110049
+ const uri = new URL(this.client.config.endpoint + apiPath);
110050
+ const apiHeaders = {};
110051
+ return this.client.call("get", uri, apiHeaders, payload);
110052
+ }
110053
+ deleteArchive(paramsOrFirst) {
110054
+ let params;
110055
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
110056
+ params = paramsOrFirst || {};
110057
+ } else {
110058
+ params = {
110059
+ archiveId: paramsOrFirst
110060
+ };
110061
+ }
110062
+ const archiveId = params.archiveId;
110063
+ if (typeof archiveId === "undefined") {
110064
+ throw new AppwriteException('Missing required parameter: "archiveId"');
110065
+ }
110066
+ const apiPath = "/backups/archives/{archiveId}".replace("{archiveId}", archiveId);
110067
+ const payload = {};
110068
+ const uri = new URL(this.client.config.endpoint + apiPath);
110069
+ const apiHeaders = {
110070
+ "content-type": "application/json"
110071
+ };
110072
+ return this.client.call("delete", uri, apiHeaders, payload);
110073
+ }
110074
+ listPolicies(paramsOrFirst) {
110075
+ let params;
110076
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
110077
+ params = paramsOrFirst || {};
110078
+ } else {
110079
+ params = {
110080
+ queries: paramsOrFirst
110081
+ };
110082
+ }
110083
+ const queries = params.queries;
110084
+ const apiPath = "/backups/policies";
110085
+ const payload = {};
110086
+ if (typeof queries !== "undefined") {
110087
+ payload["queries"] = queries;
110088
+ }
110089
+ const uri = new URL(this.client.config.endpoint + apiPath);
110090
+ const apiHeaders = {};
110091
+ return this.client.call("get", uri, apiHeaders, payload);
110092
+ }
110093
+ createPolicy(paramsOrFirst, ...rest) {
110094
+ let params;
110095
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
110096
+ params = paramsOrFirst || {};
110097
+ } else {
110098
+ params = {
110099
+ policyId: paramsOrFirst,
110100
+ services: rest[0],
110101
+ retention: rest[1],
110102
+ schedule: rest[2],
110103
+ name: rest[3],
110104
+ resourceId: rest[4],
110105
+ enabled: rest[5]
110106
+ };
110107
+ }
110108
+ const policyId = params.policyId;
110109
+ const services = params.services;
110110
+ const retention = params.retention;
110111
+ const schedule = params.schedule;
110112
+ const name = params.name;
110113
+ const resourceId = params.resourceId;
110114
+ const enabled = params.enabled;
110115
+ if (typeof policyId === "undefined") {
110116
+ throw new AppwriteException('Missing required parameter: "policyId"');
110117
+ }
110118
+ if (typeof services === "undefined") {
110119
+ throw new AppwriteException('Missing required parameter: "services"');
110120
+ }
110121
+ if (typeof retention === "undefined") {
110122
+ throw new AppwriteException('Missing required parameter: "retention"');
110123
+ }
110124
+ if (typeof schedule === "undefined") {
110125
+ throw new AppwriteException('Missing required parameter: "schedule"');
110126
+ }
110127
+ const apiPath = "/backups/policies";
110128
+ const payload = {};
110129
+ if (typeof policyId !== "undefined") {
110130
+ payload["policyId"] = policyId;
110131
+ }
110132
+ if (typeof name !== "undefined") {
110133
+ payload["name"] = name;
110134
+ }
110135
+ if (typeof services !== "undefined") {
110136
+ payload["services"] = services;
110137
+ }
110138
+ if (typeof resourceId !== "undefined") {
110139
+ payload["resourceId"] = resourceId;
110140
+ }
110141
+ if (typeof enabled !== "undefined") {
110142
+ payload["enabled"] = enabled;
110143
+ }
110144
+ if (typeof retention !== "undefined") {
110145
+ payload["retention"] = retention;
110146
+ }
110147
+ if (typeof schedule !== "undefined") {
110148
+ payload["schedule"] = schedule;
110149
+ }
110150
+ const uri = new URL(this.client.config.endpoint + apiPath);
110151
+ const apiHeaders = {
110152
+ "content-type": "application/json"
110153
+ };
110154
+ return this.client.call("post", uri, apiHeaders, payload);
110155
+ }
110156
+ getPolicy(paramsOrFirst) {
110157
+ let params;
110158
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
110159
+ params = paramsOrFirst || {};
110160
+ } else {
110161
+ params = {
110162
+ policyId: paramsOrFirst
110163
+ };
110164
+ }
110165
+ const policyId = params.policyId;
110166
+ if (typeof policyId === "undefined") {
110167
+ throw new AppwriteException('Missing required parameter: "policyId"');
110168
+ }
110169
+ const apiPath = "/backups/policies/{policyId}".replace("{policyId}", policyId);
110170
+ const payload = {};
110171
+ const uri = new URL(this.client.config.endpoint + apiPath);
110172
+ const apiHeaders = {};
110173
+ return this.client.call("get", uri, apiHeaders, payload);
110174
+ }
110175
+ updatePolicy(paramsOrFirst, ...rest) {
110176
+ let params;
110177
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
110178
+ params = paramsOrFirst || {};
110179
+ } else {
110180
+ params = {
110181
+ policyId: paramsOrFirst,
110182
+ name: rest[0],
110183
+ retention: rest[1],
110184
+ schedule: rest[2],
110185
+ enabled: rest[3]
110186
+ };
110187
+ }
110188
+ const policyId = params.policyId;
110189
+ const name = params.name;
110190
+ const retention = params.retention;
110191
+ const schedule = params.schedule;
110192
+ const enabled = params.enabled;
110193
+ if (typeof policyId === "undefined") {
110194
+ throw new AppwriteException('Missing required parameter: "policyId"');
110195
+ }
110196
+ const apiPath = "/backups/policies/{policyId}".replace("{policyId}", policyId);
110197
+ const payload = {};
110198
+ if (typeof name !== "undefined") {
110199
+ payload["name"] = name;
110200
+ }
110201
+ if (typeof retention !== "undefined") {
110202
+ payload["retention"] = retention;
110203
+ }
110204
+ if (typeof schedule !== "undefined") {
110205
+ payload["schedule"] = schedule;
110206
+ }
110207
+ if (typeof enabled !== "undefined") {
110208
+ payload["enabled"] = enabled;
110209
+ }
110210
+ const uri = new URL(this.client.config.endpoint + apiPath);
110211
+ const apiHeaders = {
110212
+ "content-type": "application/json"
110213
+ };
110214
+ return this.client.call("patch", uri, apiHeaders, payload);
110215
+ }
110216
+ deletePolicy(paramsOrFirst) {
110217
+ let params;
110218
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
110219
+ params = paramsOrFirst || {};
110220
+ } else {
110221
+ params = {
110222
+ policyId: paramsOrFirst
110223
+ };
110224
+ }
110225
+ const policyId = params.policyId;
110226
+ if (typeof policyId === "undefined") {
110227
+ throw new AppwriteException('Missing required parameter: "policyId"');
110228
+ }
110229
+ const apiPath = "/backups/policies/{policyId}".replace("{policyId}", policyId);
110230
+ const payload = {};
110231
+ const uri = new URL(this.client.config.endpoint + apiPath);
110232
+ const apiHeaders = {
110233
+ "content-type": "application/json"
110234
+ };
110235
+ return this.client.call("delete", uri, apiHeaders, payload);
110236
+ }
110237
+ createRestoration(paramsOrFirst, ...rest) {
110238
+ let params;
110239
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
110240
+ params = paramsOrFirst || {};
110241
+ } else {
110242
+ params = {
110243
+ archiveId: paramsOrFirst,
110244
+ services: rest[0],
110245
+ newResourceId: rest[1],
110246
+ newResourceName: rest[2]
110247
+ };
110248
+ }
110249
+ const archiveId = params.archiveId;
110250
+ const services = params.services;
110251
+ const newResourceId = params.newResourceId;
110252
+ const newResourceName = params.newResourceName;
110253
+ if (typeof archiveId === "undefined") {
110254
+ throw new AppwriteException('Missing required parameter: "archiveId"');
110255
+ }
110256
+ if (typeof services === "undefined") {
110257
+ throw new AppwriteException('Missing required parameter: "services"');
110258
+ }
110259
+ const apiPath = "/backups/restoration";
110260
+ const payload = {};
110261
+ if (typeof archiveId !== "undefined") {
110262
+ payload["archiveId"] = archiveId;
110263
+ }
110264
+ if (typeof services !== "undefined") {
110265
+ payload["services"] = services;
110266
+ }
110267
+ if (typeof newResourceId !== "undefined") {
110268
+ payload["newResourceId"] = newResourceId;
110269
+ }
110270
+ if (typeof newResourceName !== "undefined") {
110271
+ payload["newResourceName"] = newResourceName;
110272
+ }
110273
+ const uri = new URL(this.client.config.endpoint + apiPath);
110274
+ const apiHeaders = {
110275
+ "content-type": "application/json"
110276
+ };
110277
+ return this.client.call("post", uri, apiHeaders, payload);
110278
+ }
110279
+ listRestorations(paramsOrFirst) {
110280
+ let params;
110281
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
110282
+ params = paramsOrFirst || {};
110283
+ } else {
110284
+ params = {
110285
+ queries: paramsOrFirst
110286
+ };
110287
+ }
110288
+ const queries = params.queries;
110289
+ const apiPath = "/backups/restorations";
110290
+ const payload = {};
110291
+ if (typeof queries !== "undefined") {
110292
+ payload["queries"] = queries;
110293
+ }
110294
+ const uri = new URL(this.client.config.endpoint + apiPath);
110295
+ const apiHeaders = {};
110296
+ return this.client.call("get", uri, apiHeaders, payload);
110297
+ }
110298
+ getRestoration(paramsOrFirst) {
110299
+ let params;
110300
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
110301
+ params = paramsOrFirst || {};
110302
+ } else {
110303
+ params = {
110304
+ restorationId: paramsOrFirst
110305
+ };
110306
+ }
110307
+ const restorationId = params.restorationId;
110308
+ if (typeof restorationId === "undefined") {
110309
+ throw new AppwriteException('Missing required parameter: "restorationId"');
110310
+ }
110311
+ const apiPath = "/backups/restorations/{restorationId}".replace("{restorationId}", restorationId);
110312
+ const payload = {};
110313
+ const uri = new URL(this.client.config.endpoint + apiPath);
110314
+ const apiHeaders = {};
110315
+ return this.client.call("get", uri, apiHeaders, payload);
110316
+ }
110317
+ };
109926
110318
  var Console = class {
109927
110319
  constructor(client2) {
109928
110320
  this.client = client2;
@@ -119757,21 +120149,26 @@ var Organizations = class {
119757
120149
  const apiHeaders = {};
119758
120150
  return this.client.call("get", uri, apiHeaders, payload);
119759
120151
  }
119760
- getScopes(paramsOrFirst) {
120152
+ getScopes(paramsOrFirst, ...rest) {
119761
120153
  let params;
119762
120154
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
119763
120155
  params = paramsOrFirst || {};
119764
120156
  } else {
119765
120157
  params = {
119766
- organizationId: paramsOrFirst
120158
+ organizationId: paramsOrFirst,
120159
+ projectId: rest[0]
119767
120160
  };
119768
120161
  }
119769
120162
  const organizationId = params.organizationId;
120163
+ const projectId = params.projectId;
119770
120164
  if (typeof organizationId === "undefined") {
119771
120165
  throw new AppwriteException('Missing required parameter: "organizationId"');
119772
120166
  }
119773
120167
  const apiPath = "/organizations/{organizationId}/roles".replace("{organizationId}", organizationId);
119774
120168
  const payload = {};
120169
+ if (typeof projectId !== "undefined") {
120170
+ payload["projectId"] = projectId;
120171
+ }
119775
120172
  const uri = new URL(this.client.config.endpoint + apiPath);
119776
120173
  const apiHeaders = {};
119777
120174
  return this.client.call("get", uri, apiHeaders, payload);
@@ -134159,8 +134556,8 @@ async function createPullInstance(options = {
134159
134556
  }) {
134160
134557
  const { silent, requiresConsoleAuth } = options;
134161
134558
  const projectClient2 = await sdkForProject();
134162
- const consoleClient2 = await sdkForConsole(requiresConsoleAuth);
134163
- const pullInstance = new Pull(projectClient2, consoleClient2, silent);
134559
+ const consoleClient = await sdkForConsole(requiresConsoleAuth);
134560
+ const pullInstance = new Pull(projectClient2, consoleClient, silent);
134164
134561
  pullInstance.setConfigDirectoryPath(localConfig.configDirectoryPath);
134165
134562
  return pullInstance;
134166
134563
  }
@@ -134169,9 +134566,9 @@ var Pull = class {
134169
134566
  consoleClient;
134170
134567
  configDirectoryPath;
134171
134568
  silent;
134172
- constructor(projectClient2, consoleClient2, silent = false) {
134569
+ constructor(projectClient2, consoleClient, silent = false) {
134173
134570
  this.projectClient = projectClient2;
134174
- this.consoleClient = consoleClient2;
134571
+ this.consoleClient = consoleClient;
134175
134572
  this.configDirectoryPath = process.cwd();
134176
134573
  this.silent = silent;
134177
134574
  }
@@ -136994,9 +137391,9 @@ var JwtManager = {
136994
137391
  timerWarn: null,
136995
137392
  timerError: null,
136996
137393
  async setup(userId = null, projectScopes = []) {
136997
- const consoleClient2 = await sdkForConsole();
136998
- const usersClient2 = new Users(consoleClient2);
136999
- const projectsClient2 = new Projects(consoleClient2);
137394
+ const consoleClient = await sdkForConsole();
137395
+ const usersClient2 = new Users(consoleClient);
137396
+ const projectsClient2 = new Projects(consoleClient);
137000
137397
  if (this.timerWarn) {
137001
137398
  clearTimeout(this.timerWarn);
137002
137399
  }
@@ -139056,9 +139453,9 @@ var Push = class {
139056
139453
  projectClient;
139057
139454
  consoleClient;
139058
139455
  silent;
139059
- constructor(projectClient2, consoleClient2, silent = false) {
139456
+ constructor(projectClient2, consoleClient, silent = false) {
139060
139457
  this.projectClient = projectClient2;
139061
- this.consoleClient = consoleClient2;
139458
+ this.consoleClient = consoleClient;
139062
139459
  this.silent = silent;
139063
139460
  }
139064
139461
  /**
@@ -140341,8 +140738,8 @@ async function createPushInstance(options = {
140341
140738
  }) {
140342
140739
  const { silent, requiresConsoleAuth } = options;
140343
140740
  const projectClient2 = await sdkForProject();
140344
- const consoleClient2 = await sdkForConsole(requiresConsoleAuth);
140345
- return new Push(projectClient2, consoleClient2, silent);
140741
+ const consoleClient = await sdkForConsole(requiresConsoleAuth);
140742
+ return new Push(projectClient2, consoleClient, silent);
140346
140743
  }
140347
140744
  var pushResources = async ({
140348
140745
  skipDeprecated = false
@@ -141956,6 +142353,36 @@ account.command(`delete`).description(`Delete the currently logged in user.`).ac
141956
142353
  async () => parse3(await (await getAccountClient()).delete())
141957
142354
  )
141958
142355
  );
142356
+ account.command(`list-billing-addresses`).description(`List all billing addresses for a user.`).option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, expired, failed`).action(
142357
+ actionRunner(
142358
+ async ({ queries }) => parse3(await (await getAccountClient()).listBillingAddresses(queries))
142359
+ )
142360
+ );
142361
+ account.command(`create-billing-address`).description(`Add a new billing address to a user's account.`).requiredOption(`--country <country>`, `Country`).requiredOption(`--city <city>`, `City`).requiredOption(`--street-address <street-address>`, `Street address`).option(`--address-line-2 <address-line-2>`, `Address line 2`).option(`--state <state>`, `State or province`).option(`--postal-code <postal-code>`, `Postal code`).action(
142362
+ actionRunner(
142363
+ async ({ country, city, streetAddress, addressLine2, state, postalCode }) => parse3(await (await getAccountClient()).createBillingAddress(country, city, streetAddress, addressLine2, state, postalCode))
142364
+ )
142365
+ );
142366
+ account.command(`get-billing-address`).description(`Get a specific billing address for a user using it's ID.`).requiredOption(`--billing-address-id <billing-address-id>`, `Unique ID of billing address`).action(
142367
+ actionRunner(
142368
+ async ({ billingAddressId }) => parse3(await (await getAccountClient()).getBillingAddress(billingAddressId))
142369
+ )
142370
+ );
142371
+ account.command(`update-billing-address`).description(`Update a specific billing address using it's ID.`).requiredOption(`--billing-address-id <billing-address-id>`, `Unique ID of billing address`).requiredOption(`--country <country>`, `Country`).requiredOption(`--city <city>`, `City`).requiredOption(`--street-address <street-address>`, `Street address`).option(`--address-line-2 <address-line-2>`, `Address line 2`).option(`--state <state>`, `State or province`).option(`--postal-code <postal-code>`, `Postal code`).action(
142372
+ actionRunner(
142373
+ async ({ billingAddressId, country, city, streetAddress, addressLine2, state, postalCode }) => parse3(await (await getAccountClient()).updateBillingAddress(billingAddressId, country, city, streetAddress, addressLine2, state, postalCode))
142374
+ )
142375
+ );
142376
+ account.command(`delete-billing-address`).description(`Delete a specific billing address using it's ID.`).requiredOption(`--billing-address-id <billing-address-id>`, `Billing address unique ID`).action(
142377
+ actionRunner(
142378
+ async ({ billingAddressId }) => parse3(await (await getAccountClient()).deleteBillingAddress(billingAddressId))
142379
+ )
142380
+ );
142381
+ account.command(`get-coupon`).description(`Get coupon details for an account.`).requiredOption(`--coupon-id <coupon-id>`, `ID of the coupon`).action(
142382
+ actionRunner(
142383
+ async ({ couponId }) => parse3(await (await getAccountClient()).getCoupon(couponId))
142384
+ )
142385
+ );
141959
142386
  account.command(`update-email`).description(`Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.
141960
142387
  This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.
141961
142388
  `).requiredOption(`--email <email>`, `User email.`).requiredOption(`--password <password>`, `User password. Must be at least 8 chars.`).action(
@@ -141977,11 +142404,45 @@ account.command(`delete-identity`).description(`Delete an identity by its unique
141977
142404
  async ({ identityId }) => parse3(await (await getAccountClient()).deleteIdentity(identityId))
141978
142405
  )
141979
142406
  );
142407
+ account.command(`list-invoices`).description(`List all invoices tied to an account.`).option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: teamId, aggregationId, amount, currency, from, to, dueAt, attempts, status, grossAmount`).action(
142408
+ actionRunner(
142409
+ async ({ queries }) => parse3(await (await getAccountClient()).listInvoices(queries))
142410
+ )
142411
+ );
141980
142412
  account.command(`create-jwt`).description(`Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.`).option(`--duration <duration>`, `Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.`, parseInteger).action(
141981
142413
  actionRunner(
141982
142414
  async ({ duration: duration3 }) => parse3(await (await getAccountClient()).createJWT(duration3))
141983
142415
  )
141984
142416
  );
142417
+ account.command(`list-keys`).description(`Get a list of all API keys from the current account. `).option(
142418
+ `--total [value]`,
142419
+ `When set to false, the total count returned will be 0 and will not be calculated.`,
142420
+ (value) => value === void 0 ? true : parseBool(value)
142421
+ ).action(
142422
+ actionRunner(
142423
+ async ({ total }) => parse3(await (await getAccountClient()).listKeys(total))
142424
+ )
142425
+ );
142426
+ account.command(`create-key`).description(`Create a new account API key.`).requiredOption(`--name <name>`, `Key name. Max length: 128 chars.`).requiredOption(`--scopes [scopes...]`, `Key scopes list. Maximum of 100 scopes are allowed.`).option(`--expire <expire>`, `Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.`).action(
142427
+ actionRunner(
142428
+ async ({ name, scopes, expire }) => parse3(await (await getAccountClient()).createKey(name, scopes, expire))
142429
+ )
142430
+ );
142431
+ account.command(`get-key`).description(`Get a key by its unique ID. This endpoint returns details about a specific API key in your account including it's scopes.`).requiredOption(`--key-id <key-id>`, `Key unique ID.`).action(
142432
+ actionRunner(
142433
+ async ({ keyId }) => parse3(await (await getAccountClient()).getKey(keyId))
142434
+ )
142435
+ );
142436
+ account.command(`update-key`).description(`Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key.`).requiredOption(`--key-id <key-id>`, `Key unique ID.`).requiredOption(`--name <name>`, `Key name. Max length: 128 chars.`).requiredOption(`--scopes [scopes...]`, `Key scopes list. Maximum of 100 scopes are allowed.`).option(`--expire <expire>`, `Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.`).action(
142437
+ actionRunner(
142438
+ async ({ keyId, name, scopes, expire }) => parse3(await (await getAccountClient()).updateKey(keyId, name, scopes, expire))
142439
+ )
142440
+ );
142441
+ account.command(`delete-key`).description(`Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls.`).requiredOption(`--key-id <key-id>`, `Key unique ID.`).action(
142442
+ actionRunner(
142443
+ async ({ keyId }) => parse3(await (await getAccountClient()).deleteKey(keyId))
142444
+ )
142445
+ );
141985
142446
  account.command(`list-logs`).description(`Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log.`).option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset`).option(
141986
142447
  `--total [value]`,
141987
142448
  `When set to false, the total count returned will be 0 and will not be calculated.`,
@@ -142051,6 +142512,41 @@ account.command(`update-password`).description(`Update currently logged in user
142051
142512
  async ({ password, oldPassword }) => parse3(await (await getAccountClient()).updatePassword(password, oldPassword))
142052
142513
  )
142053
142514
  );
142515
+ account.command(`list-payment-methods`).description(`List payment methods for this account.`).option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, expired, failed`).action(
142516
+ actionRunner(
142517
+ async ({ queries }) => parse3(await (await getAccountClient()).listPaymentMethods(queries))
142518
+ )
142519
+ );
142520
+ account.command(`create-payment-method`).description(`Create a new payment method for the current user account.`).action(
142521
+ actionRunner(
142522
+ async () => parse3(await (await getAccountClient()).createPaymentMethod())
142523
+ )
142524
+ );
142525
+ account.command(`get-payment-method`).description(`Get a specific payment method for the user.`).requiredOption(`--payment-method-id <payment-method-id>`, `Unique ID of payment method`).action(
142526
+ actionRunner(
142527
+ async ({ paymentMethodId }) => parse3(await (await getAccountClient()).getPaymentMethod(paymentMethodId))
142528
+ )
142529
+ );
142530
+ account.command(`update-payment-method`).description(`Update a new payment method for the current user account.`).requiredOption(`--payment-method-id <payment-method-id>`, `Unique ID of payment method`).requiredOption(`--expiry-month <expiry-month>`, `Payment expiry month`, parseInteger).requiredOption(`--expiry-year <expiry-year>`, `Expiry year`, parseInteger).option(`--state <state>`, `State of the payment method country`).action(
142531
+ actionRunner(
142532
+ async ({ paymentMethodId, expiryMonth, expiryYear, state }) => parse3(await (await getAccountClient()).updatePaymentMethod(paymentMethodId, expiryMonth, expiryYear, state))
142533
+ )
142534
+ );
142535
+ account.command(`delete-payment-method`).description(`Delete a specific payment method from a user's account.`).requiredOption(`--payment-method-id <payment-method-id>`, `Unique ID of payment method`).action(
142536
+ actionRunner(
142537
+ async ({ paymentMethodId }) => parse3(await (await getAccountClient()).deletePaymentMethod(paymentMethodId))
142538
+ )
142539
+ );
142540
+ account.command(`update-payment-method-provider`).description(`Update payment method provider.`).requiredOption(`--payment-method-id <payment-method-id>`, `Unique ID of payment method`).requiredOption(`--provider-method-id <provider-method-id>`, `Payment method ID from the payment provider`).requiredOption(`--name <name>`, `Name in the payment method`).option(`--state <state>`, `State of the payment method country`).action(
142541
+ actionRunner(
142542
+ async ({ paymentMethodId, providerMethodId, name, state }) => parse3(await (await getAccountClient()).updatePaymentMethodProvider(paymentMethodId, providerMethodId, name, state))
142543
+ )
142544
+ );
142545
+ account.command(`update-payment-method-mandate-options`).description(`Update payment method mandate options.`).requiredOption(`--payment-method-id <payment-method-id>`, `Unique ID of payment method`).action(
142546
+ actionRunner(
142547
+ async ({ paymentMethodId }) => parse3(await (await getAccountClient()).updatePaymentMethodMandateOptions(paymentMethodId))
142548
+ )
142549
+ );
142054
142550
  account.command(`update-phone`).description(`Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification) endpoint to send a confirmation SMS.`).requiredOption(`--phone <phone>`, `Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`).requiredOption(`--password <password>`, `User password. Must be at least 8 chars.`).action(
142055
142551
  actionRunner(
142056
142552
  async ({ phone, password }) => parse3(await (await getAccountClient()).updatePhone(phone, password))
@@ -142112,8 +142608,8 @@ If there is already an active session, the new session will be attached to the l
142112
142608
  A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
142113
142609
  `).requiredOption(`--provider <provider>`, `OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.`).option(`--success <success>`, `URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.`).option(`--failure <failure>`, `URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.`).option(`--scopes [scopes...]`, `A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.`).action(
142114
142610
  actionRunner(
142115
- async ({ provider, success: success19, failure, scopes }) => {
142116
- const url2 = (await getAccountClient()).createOAuth2Session(provider, success19, failure, scopes);
142611
+ async ({ provider, success: success20, failure, scopes }) => {
142612
+ const url2 = (await getAccountClient()).createOAuth2Session(provider, success20, failure, scopes);
142117
142613
  if (url2) console.log(url2);
142118
142614
  }
142119
142615
  )
@@ -142193,8 +142689,8 @@ If authentication succeeds, \`userId\` and \`secret\` of a token will be appende
142193
142689
 
142194
142690
  A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).`).requiredOption(`--provider <provider>`, `OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.`).option(`--success <success>`, `URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.`).option(`--failure <failure>`, `URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.`).option(`--scopes [scopes...]`, `A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.`).action(
142195
142691
  actionRunner(
142196
- async ({ provider, success: success19, failure, scopes }) => {
142197
- const url2 = (await getAccountClient()).createOAuth2Token(provider, success19, failure, scopes);
142692
+ async ({ provider, success: success20, failure, scopes }) => {
142693
+ const url2 = (await getAccountClient()).createOAuth2Token(provider, success20, failure, scopes);
142198
142694
  if (url2) console.log(url2);
142199
142695
  }
142200
142696
  )
@@ -142243,26 +142739,108 @@ account.command(`update-phone-verification`).description(`Use this endpoint to c
142243
142739
  )
142244
142740
  );
142245
142741
 
142246
- // lib/commands/services/console.ts
142247
- var consoleClient = null;
142248
- var getConsoleClient = async () => {
142249
- if (!consoleClient) {
142742
+ // lib/commands/services/activities.ts
142743
+ var activitiesClient = null;
142744
+ var getActivitiesClient = async () => {
142745
+ if (!activitiesClient) {
142250
142746
  const sdkClient = await sdkForProject();
142251
- consoleClient = new Console(sdkClient);
142747
+ activitiesClient = new Activities(sdkClient);
142252
142748
  }
142253
- return consoleClient;
142749
+ return activitiesClient;
142254
142750
  };
142255
- var console2 = new Command("console").description(commandDescriptions["console"] ?? "").configureHelp({
142751
+ var activities = new Command("activities").description(commandDescriptions["activities"] ?? "").configureHelp({
142256
142752
  helpWidth: process.stdout.columns || 80
142257
142753
  });
142258
- console2.command(`get-resource`).description(`Check if a resource ID is available.`).requiredOption(`--value <value>`, `Resource value.`).requiredOption(`--type <type>`, `Resource type.`).action(
142754
+ activities.command(`list-events`).description(`List all events for selected filters.`).option(`--queries <queries>`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on attributes such as userId, teamId, etc.`).action(
142755
+ actionRunner(
142756
+ async ({ queries }) => parse3(await (await getActivitiesClient()).listEvents(queries))
142757
+ )
142758
+ );
142759
+ activities.command(`get-event`).description(`Get event by ID.
142760
+ `).requiredOption(`--event-id <event-id>`, `Event ID.`).action(
142761
+ actionRunner(
142762
+ async ({ eventId }) => parse3(await (await getActivitiesClient()).getEvent(eventId))
142763
+ )
142764
+ );
142765
+
142766
+ // lib/commands/services/backups.ts
142767
+ var backupsClient = null;
142768
+ var getBackupsClient = async () => {
142769
+ if (!backupsClient) {
142770
+ const sdkClient = await sdkForProject();
142771
+ backupsClient = new Backups(sdkClient);
142772
+ }
142773
+ return backupsClient;
142774
+ };
142775
+ var backups = new Command("backups").description(commandDescriptions["backups"] ?? "").configureHelp({
142776
+ helpWidth: process.stdout.columns || 80
142777
+ });
142778
+ backups.command(`list-archives`).description(`List all archives for a project.`).option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.`).action(
142779
+ actionRunner(
142780
+ async ({ queries }) => parse3(await (await getBackupsClient()).listArchives(queries))
142781
+ )
142782
+ );
142783
+ backups.command(`create-archive`).description(`Create a new archive asynchronously for a project.`).requiredOption(`--services [services...]`, `Array of services to backup`).option(`--resource-id <resource-id>`, `Resource ID. When set, only this single resource will be backed up.`).action(
142784
+ actionRunner(
142785
+ async ({ services, resourceId }) => parse3(await (await getBackupsClient()).createArchive(services, resourceId))
142786
+ )
142787
+ );
142788
+ backups.command(`get-archive`).description(`Get a backup archive using it's ID.`).requiredOption(`--archive-id <archive-id>`, `Archive ID. Choose a custom ID\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`).action(
142789
+ actionRunner(
142790
+ async ({ archiveId }) => parse3(await (await getBackupsClient()).getArchive(archiveId))
142791
+ )
142792
+ );
142793
+ backups.command(`delete-archive`).description(`Delete an existing archive for a project.`).requiredOption(`--archive-id <archive-id>`, `Policy ID. Choose a custom ID or generate a random ID with \`ID.unique()\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`).action(
142794
+ actionRunner(
142795
+ async ({ archiveId }) => parse3(await (await getBackupsClient()).deleteArchive(archiveId))
142796
+ )
142797
+ );
142798
+ backups.command(`list-policies`).description(`List all policies for a project.`).option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.`).action(
142799
+ actionRunner(
142800
+ async ({ queries }) => parse3(await (await getBackupsClient()).listPolicies(queries))
142801
+ )
142802
+ );
142803
+ backups.command(`create-policy`).description(`Create a new backup policy.`).requiredOption(`--policy-id <policy-id>`, `Policy ID. Choose a custom ID or generate a random ID with \`ID.unique()\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`).requiredOption(`--services [services...]`, `Array of services to backup`).requiredOption(`--retention <retention>`, `Days to keep backups before deletion`, parseInteger).requiredOption(`--schedule <schedule>`, `Schedule CRON syntax.`).option(`--name <name>`, `Policy name. Max length: 128 chars.`).option(`--resource-id <resource-id>`, `Resource ID. When set, only this single resource will be backed up.`).option(
142804
+ `--enabled [value]`,
142805
+ `Is policy enabled? When set to 'disabled', no backups will be taken`,
142806
+ (value) => value === void 0 ? true : parseBool(value)
142807
+ ).action(
142808
+ actionRunner(
142809
+ async ({ policyId, services, retention, schedule, name, resourceId, enabled }) => parse3(await (await getBackupsClient()).createPolicy(policyId, services, retention, schedule, name, resourceId, enabled))
142810
+ )
142811
+ );
142812
+ backups.command(`get-policy`).description(`Get a backup policy using it's ID.`).requiredOption(`--policy-id <policy-id>`, `Policy ID. Choose a custom ID\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`).action(
142813
+ actionRunner(
142814
+ async ({ policyId }) => parse3(await (await getBackupsClient()).getPolicy(policyId))
142815
+ )
142816
+ );
142817
+ backups.command(`update-policy`).description(`Update an existing policy using it's ID.`).requiredOption(`--policy-id <policy-id>`, `Policy ID. Choose a custom ID\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`).option(`--name <name>`, `Policy name. Max length: 128 chars.`).option(`--retention <retention>`, `Days to keep backups before deletion`, parseInteger).option(`--schedule <schedule>`, `Cron expression`).option(
142818
+ `--enabled [value]`,
142819
+ `Is Backup enabled? When set to 'disabled', No backup will be taken`,
142820
+ (value) => value === void 0 ? true : parseBool(value)
142821
+ ).action(
142259
142822
  actionRunner(
142260
- async ({ value, type }) => parse3(await (await getConsoleClient()).getResource(value, type))
142823
+ async ({ policyId, name, retention, schedule, enabled }) => parse3(await (await getBackupsClient()).updatePolicy(policyId, name, retention, schedule, enabled))
142261
142824
  )
142262
142825
  );
142263
- console2.command(`variables`).description(`Get all Environment Variables that are relevant for the console.`).action(
142826
+ backups.command(`delete-policy`).description(`Delete a policy using it's ID.`).requiredOption(`--policy-id <policy-id>`, `Policy ID. Choose a custom ID or generate a random ID with \`ID.unique()\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`).action(
142264
142827
  actionRunner(
142265
- async () => parse3(await (await getConsoleClient()).variables())
142828
+ async ({ policyId }) => parse3(await (await getBackupsClient()).deletePolicy(policyId))
142829
+ )
142830
+ );
142831
+ backups.command(`create-restoration`).description(`Create and trigger a new restoration for a backup on a project.`).requiredOption(`--archive-id <archive-id>`, `Backup archive ID to restore`).requiredOption(`--services [services...]`, `Array of services to restore`).option(`--new-resource-id <new-resource-id>`, `Unique Id. Choose a custom ID or generate a random ID with \`ID.unique()\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`).option(`--new-resource-name <new-resource-name>`, `Database name. Max length: 128 chars.`).action(
142832
+ actionRunner(
142833
+ async ({ archiveId, services, newResourceId, newResourceName }) => parse3(await (await getBackupsClient()).createRestoration(archiveId, services, newResourceId, newResourceName))
142834
+ )
142835
+ );
142836
+ backups.command(`list-restorations`).description(`List all backup restorations for a project.`).option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.`).action(
142837
+ actionRunner(
142838
+ async ({ queries }) => parse3(await (await getBackupsClient()).listRestorations(queries))
142839
+ )
142840
+ );
142841
+ backups.command(`get-restoration`).description(`Get the current status of a backup restoration.`).requiredOption(`--restoration-id <restoration-id>`, `Restoration ID. Choose a custom ID\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`).action(
142842
+ actionRunner(
142843
+ async ({ restorationId }) => parse3(await (await getBackupsClient()).getRestoration(restorationId))
142266
142844
  )
142267
142845
  );
142268
142846
 
@@ -143122,11 +143700,26 @@ health.command(`get-queue-audits`).description(`Get the number of audit logs tha
143122
143700
  async ({ threshold }) => parse3(await (await getHealthClient()).getQueueAudits(threshold))
143123
143701
  )
143124
143702
  );
143703
+ health.command(`get-queue-billing-project-aggregation`).description(`Get billing project aggregation queue.`).option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger).action(
143704
+ actionRunner(
143705
+ async ({ threshold }) => parse3(await (await getHealthClient()).getQueueBillingProjectAggregation(threshold))
143706
+ )
143707
+ );
143708
+ health.command(`get-queue-billing-team-aggregation`).description(`Get billing team aggregation queue.`).option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger).action(
143709
+ actionRunner(
143710
+ async ({ threshold }) => parse3(await (await getHealthClient()).getQueueBillingTeamAggregation(threshold))
143711
+ )
143712
+ );
143125
143713
  health.command(`get-queue-builds`).description(`Get the number of builds that are waiting to be processed in the Appwrite internal queue server.`).option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger).action(
143126
143714
  actionRunner(
143127
143715
  async ({ threshold }) => parse3(await (await getHealthClient()).getQueueBuilds(threshold))
143128
143716
  )
143129
143717
  );
143718
+ health.command(`get-queue-priority-builds`).description(`Get the priority builds queue size.`).option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 500.`, parseInteger).action(
143719
+ actionRunner(
143720
+ async ({ threshold }) => parse3(await (await getHealthClient()).getQueuePriorityBuilds(threshold))
143721
+ )
143722
+ );
143130
143723
  health.command(`get-queue-certificates`).description(`Get the number of certificates that are waiting to be issued against [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue server.`).option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger).action(
143131
143724
  actionRunner(
143132
143725
  async ({ threshold }) => parse3(await (await getHealthClient()).getQueueCertificates(threshold))
@@ -143173,6 +143766,11 @@ health.command(`get-queue-migrations`).description(`Get the number of migrations
143173
143766
  async ({ threshold }) => parse3(await (await getHealthClient()).getQueueMigrations(threshold))
143174
143767
  )
143175
143768
  );
143769
+ health.command(`get-queue-region-manager`).description(`Get region manager queue.`).option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 100.`, parseInteger).action(
143770
+ actionRunner(
143771
+ async ({ threshold }) => parse3(await (await getHealthClient()).getQueueRegionManager(threshold))
143772
+ )
143773
+ );
143176
143774
  health.command(`get-queue-stats-resources`).description(`Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue.`).option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger).action(
143177
143775
  actionRunner(
143178
143776
  async ({ threshold }) => parse3(await (await getHealthClient()).getQueueStatsResources(threshold))
@@ -143183,6 +143781,11 @@ health.command(`get-queue-usage`).description(`Get the number of metrics that ar
143183
143781
  async ({ threshold }) => parse3(await (await getHealthClient()).getQueueUsage(threshold))
143184
143782
  )
143185
143783
  );
143784
+ health.command(`get-queue-threats`).description(`Get threats queue.`).option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 100.`, parseInteger).action(
143785
+ actionRunner(
143786
+ async ({ threshold }) => parse3(await (await getHealthClient()).getQueueThreats(threshold))
143787
+ )
143788
+ );
143186
143789
  health.command(`get-queue-webhooks`).description(`Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.`).option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger).action(
143187
143790
  actionRunner(
143188
143791
  async ({ threshold }) => parse3(await (await getHealthClient()).getQueueWebhooks(threshold))
@@ -144083,7 +144686,7 @@ projects.command(`list-schedules`).description(`Get a list of all the project's
144083
144686
  async ({ projectId, queries, total }) => parse3(await (await getProjectsClient()).listSchedules(projectId, queries, total))
144084
144687
  )
144085
144688
  );
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(
144689
+ projects.command(`create-schedule`).description(`Create a new schedule for a resource.`).requiredOption(`--project-id <project-id>`, `Project unique ID.`).requiredOption(`--resource-type <resource-type>`, `The resource type for the schedule. Possible values: function, execution, message, backup.`).requiredOption(`--resource-id <resource-id>`, `The resource ID to associate with this schedule.`).requiredOption(`--schedule <schedule>`, `Schedule CRON expression.`).option(
144087
144690
  `--active [value]`,
144088
144691
  `Whether the schedule is active.`,
144089
144692
  (value) => value === void 0 ? true : parseBool(value)
@@ -144503,7 +145106,7 @@ storage.command(`create-bucket`).description(`Create a new storage bucket.`).req
144503
145106
  `--enabled [value]`,
144504
145107
  `Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.`,
144505
145108
  (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 30MB.`, 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(
145109
+ ).option(`--maximum-file-size <maximum-file-size>`, `Maximum file size allowed in bytes. Maximum allowed value is 5GB.`, parseInteger).option(`--allowed-file-extensions [allowed-file-extensions...]`, `Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.`).option(`--compression <compression>`, `Compression algorithm chosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled`).option(
144507
145110
  `--encryption [value]`,
144508
145111
  `Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled`,
144509
145112
  (value) => value === void 0 ? true : parseBool(value)
@@ -144533,7 +145136,7 @@ storage.command(`update-bucket`).description(`Update a storage bucket by its uni
144533
145136
  `--enabled [value]`,
144534
145137
  `Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.`,
144535
145138
  (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 30MB.`, 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(
145139
+ ).option(`--maximum-file-size <maximum-file-size>`, `Maximum file size allowed in bytes. Maximum allowed value is 5GB.`, parseInteger).option(`--allowed-file-extensions [allowed-file-extensions...]`, `Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.`).option(`--compression <compression>`, `Compression algorithm chosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled`).option(
144537
145140
  `--encryption [value]`,
144538
145141
  `Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled`,
144539
145142
  (value) => value === void 0 ? true : parseBool(value)
@@ -145705,11 +146308,14 @@ if (process.argv.includes("-v") || process.argv.includes("--version")) {
145705
146308
  cliConfig.all = true;
145706
146309
  }).on("option:id", function() {
145707
146310
  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(console2).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);
146311
+ }).showSuggestionAfterError().addCommand(whoami).addCommand(register).addCommand(login).addCommand(init).addCommand(pull).addCommand(push).addCommand(types).addCommand(deploy).addCommand(run).addCommand(update).addCommand(generate).addCommand(logout).addCommand(account).addCommand(activities).addCommand(backups).addCommand(databases).addCommand(functions).addCommand(graphql).addCommand(health).addCommand(locale).addCommand(messaging).addCommand(migrations).addCommand(project).addCommand(projects).addCommand(proxy).addCommand(sites).addCommand(storage).addCommand(tablesDB).addCommand(teams).addCommand(tokens).addCommand(users).addCommand(vcs).addCommand(client).parse(process.argv);
145709
146312
  process.stdout.columns = oldWidth;
145710
146313
  }
145711
146314
  /*! Bundled license information:
145712
146315
 
146316
+ safe-buffer/index.js:
146317
+ (*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
146318
+
145713
146319
  undici/lib/fetch/body.js:
145714
146320
  (*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> *)
145715
146321