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
@@ -21962,9 +21962,9 @@ var require_stream_duplex = __commonJS({
21962
21962
  }
21963
21963
  });
21964
21964
 
21965
- // node_modules/safe-buffer/index.js
21965
+ // node_modules/string_decoder/node_modules/safe-buffer/index.js
21966
21966
  var require_safe_buffer = __commonJS({
21967
- "node_modules/safe-buffer/index.js"(exports, module) {
21967
+ "node_modules/string_decoder/node_modules/safe-buffer/index.js"(exports, module) {
21968
21968
  var buffer = __require("buffer");
21969
21969
  var Buffer2 = buffer.Buffer;
21970
21970
  function copyProps(src, dst) {
@@ -21981,6 +21981,7 @@ var require_safe_buffer = __commonJS({
21981
21981
  function SafeBuffer(arg, encodingOrOffset, length) {
21982
21982
  return Buffer2(arg, encodingOrOffset, length);
21983
21983
  }
21984
+ SafeBuffer.prototype = Object.create(Buffer2.prototype);
21984
21985
  copyProps(Buffer2, SafeBuffer);
21985
21986
  SafeBuffer.from = function(arg, encodingOrOffset, length) {
21986
21987
  if (typeof arg === "number") {
@@ -24523,16 +24524,16 @@ var require_base = __commonJS({
24523
24524
  }),
24524
24525
  share()
24525
24526
  );
24526
- const success19 = validation.pipe(
24527
+ const success20 = validation.pipe(
24527
24528
  filter((state) => state.isValid === true),
24528
24529
  take(1)
24529
24530
  );
24530
24531
  const error49 = validation.pipe(
24531
24532
  filter((state) => state.isValid !== true),
24532
- takeUntil(success19)
24533
+ takeUntil(success20)
24533
24534
  );
24534
24535
  return {
24535
- success: success19,
24536
+ success: success20,
24536
24537
  error: error49
24537
24538
  };
24538
24539
  }
@@ -63430,14 +63431,14 @@ var require_base2 = __commonJS({
63430
63431
  return { isValid: err };
63431
63432
  });
63432
63433
  }).share();
63433
- var success19 = validation.filter(function(state) {
63434
+ var success20 = validation.filter(function(state) {
63434
63435
  return state.isValid === true;
63435
63436
  }).take(1);
63436
63437
  var error49 = validation.filter(function(state) {
63437
63438
  return state.isValid !== true;
63438
- }).takeUntil(success19);
63439
+ }).takeUntil(success20);
63439
63440
  return {
63440
- success: success19,
63441
+ success: success20,
63441
63442
  error: error49
63442
63443
  };
63443
63444
  };
@@ -92066,7 +92067,7 @@ var package_default = {
92066
92067
  type: "module",
92067
92068
  homepage: "https://appwrite.io/support",
92068
92069
  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",
92069
- version: "13.5.0",
92070
+ version: "13.6.0",
92070
92071
  license: "BSD-3-Clause",
92071
92072
  main: "dist/index.cjs",
92072
92073
  module: "dist/index.js",
@@ -92109,7 +92110,7 @@ var package_default = {
92109
92110
  "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"
92110
92111
  },
92111
92112
  dependencies: {
92112
- "@appwrite.io/console": "^3.0.0",
92113
+ "@appwrite.io/console": "^3.1.0",
92113
92114
  chalk: "4.1.2",
92114
92115
  chokidar: "^3.6.0",
92115
92116
  "cli-progress": "^3.12.0",
@@ -106343,7 +106344,7 @@ import childProcess from "child_process";
106343
106344
  // lib/constants.ts
106344
106345
  var SDK_TITLE = "Appwrite";
106345
106346
  var SDK_TITLE_LOWER = "appwrite";
106346
- var SDK_VERSION = "13.5.0";
106347
+ var SDK_VERSION = "13.6.0";
106347
106348
  var SDK_NAME = "Command Line";
106348
106349
  var SDK_PLATFORM = "console";
106349
106350
  var SDK_LANGUAGE = "cli";
@@ -106506,6 +106507,8 @@ var JSONbigParser = (0, import_json_bigint.default)({ storeAsString: false });
106506
106507
  var JSONbigSerializer = (0, import_json_bigint.default)({ useNativeBigInt: true });
106507
106508
  var MAX_SAFE = BigInt(Number.MAX_SAFE_INTEGER);
106508
106509
  var MIN_SAFE = BigInt(Number.MIN_SAFE_INTEGER);
106510
+ var MAX_INT64 = BigInt("9223372036854775807");
106511
+ var MIN_INT64 = BigInt("-9223372036854775808");
106509
106512
  function isBigNumber(value) {
106510
106513
  return value !== null && typeof value === "object" && value._isBigNumber === true && typeof value.isInteger === "function" && typeof value.toFixed === "function" && typeof value.toNumber === "function";
106511
106514
  }
@@ -106517,7 +106520,10 @@ function reviver(_key, value) {
106517
106520
  if (bi >= MIN_SAFE && bi <= MAX_SAFE) {
106518
106521
  return Number(str);
106519
106522
  }
106520
- return bi;
106523
+ if (bi >= MIN_INT64 && bi <= MAX_INT64) {
106524
+ return bi;
106525
+ }
106526
+ return value.toNumber();
106521
106527
  }
106522
106528
  return value.toNumber();
106523
106529
  }
@@ -107276,6 +107282,8 @@ Query.cursorBefore = (documentId) => new Query("cursorBefore", void 0, documentI
107276
107282
  Query.limit = (limit) => new Query("limit", void 0, limit).toString();
107277
107283
  Query.offset = (offset) => new Query("offset", void 0, offset).toString();
107278
107284
  Query.contains = (attribute, value) => new Query("contains", attribute, value).toString();
107285
+ Query.containsAny = (attribute, value) => new Query("containsAny", attribute, value).toString();
107286
+ Query.containsAll = (attribute, value) => new Query("containsAll", attribute, value).toString();
107279
107287
  Query.notContains = (attribute, value) => new Query("notContains", attribute, value).toString();
107280
107288
  Query.notSearch = (attribute, value) => new Query("notSearch", attribute, value).toString();
107281
107289
  Query.notBetween = (attribute, start, end) => new Query("notBetween", attribute, [start, end]).toString();
@@ -107306,6 +107314,8 @@ var JSONbigParser2 = (0, import_json_bigint2.default)({ storeAsString: false });
107306
107314
  var JSONbigSerializer2 = (0, import_json_bigint2.default)({ useNativeBigInt: true });
107307
107315
  var MAX_SAFE2 = BigInt(Number.MAX_SAFE_INTEGER);
107308
107316
  var MIN_SAFE2 = BigInt(Number.MIN_SAFE_INTEGER);
107317
+ var MAX_INT642 = BigInt("9223372036854775807");
107318
+ var MIN_INT642 = BigInt("-9223372036854775808");
107309
107319
  function isBigNumber2(value) {
107310
107320
  return value !== null && typeof value === "object" && value._isBigNumber === true && typeof value.isInteger === "function" && typeof value.toFixed === "function" && typeof value.toNumber === "function";
107311
107321
  }
@@ -107317,7 +107327,10 @@ function reviver2(_key, value) {
107317
107327
  if (bi >= MIN_SAFE2 && bi <= MAX_SAFE2) {
107318
107328
  return Number(str);
107319
107329
  }
107320
- return bi;
107330
+ if (bi >= MIN_INT642 && bi <= MAX_INT642) {
107331
+ return bi;
107332
+ }
107333
+ return value.toNumber();
107321
107334
  }
107322
107335
  return value.toNumber();
107323
107336
  }
@@ -107364,7 +107377,7 @@ var Client = class _Client {
107364
107377
  "x-sdk-name": "Console",
107365
107378
  "x-sdk-platform": "console",
107366
107379
  "x-sdk-language": "web",
107367
- "x-sdk-version": "3.0.0",
107380
+ "x-sdk-version": "3.1.0",
107368
107381
  "X-Appwrite-Response-Format": "1.8.0"
107369
107382
  };
107370
107383
  this.realtime = {
@@ -109360,7 +109373,7 @@ var Account = class {
109360
109373
  };
109361
109374
  }
109362
109375
  const provider = params.provider;
109363
- const success19 = params.success;
109376
+ const success20 = params.success;
109364
109377
  const failure = params.failure;
109365
109378
  const scopes = params.scopes;
109366
109379
  if (typeof provider === "undefined") {
@@ -109368,8 +109381,8 @@ var Account = class {
109368
109381
  }
109369
109382
  const apiPath = "/account/sessions/oauth2/{provider}".replace("{provider}", provider);
109370
109383
  const payload = {};
109371
- if (typeof success19 !== "undefined") {
109372
- payload["success"] = success19;
109384
+ if (typeof success20 !== "undefined") {
109385
+ payload["success"] = success20;
109373
109386
  }
109374
109387
  if (typeof failure !== "undefined") {
109375
109388
  payload["failure"] = failure;
@@ -109708,7 +109721,7 @@ var Account = class {
109708
109721
  };
109709
109722
  }
109710
109723
  const provider = params.provider;
109711
- const success19 = params.success;
109724
+ const success20 = params.success;
109712
109725
  const failure = params.failure;
109713
109726
  const scopes = params.scopes;
109714
109727
  if (typeof provider === "undefined") {
@@ -109716,8 +109729,8 @@ var Account = class {
109716
109729
  }
109717
109730
  const apiPath = "/account/tokens/oauth2/{provider}".replace("{provider}", provider);
109718
109731
  const payload = {};
109719
- if (typeof success19 !== "undefined") {
109720
- payload["success"] = success19;
109732
+ if (typeof success20 !== "undefined") {
109733
+ payload["success"] = success20;
109721
109734
  }
109722
109735
  if (typeof failure !== "undefined") {
109723
109736
  payload["failure"] = failure;
@@ -109929,6 +109942,385 @@ var Account = class {
109929
109942
  return this.client.call("put", uri, apiHeaders, payload);
109930
109943
  }
109931
109944
  };
109945
+ var Activities = class {
109946
+ constructor(client2) {
109947
+ this.client = client2;
109948
+ }
109949
+ listEvents(paramsOrFirst) {
109950
+ let params;
109951
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
109952
+ params = paramsOrFirst || {};
109953
+ } else {
109954
+ params = {
109955
+ queries: paramsOrFirst
109956
+ };
109957
+ }
109958
+ const queries = params.queries;
109959
+ const apiPath = "/activities/events";
109960
+ const payload = {};
109961
+ if (typeof queries !== "undefined") {
109962
+ payload["queries"] = queries;
109963
+ }
109964
+ const uri = new URL(this.client.config.endpoint + apiPath);
109965
+ const apiHeaders = {};
109966
+ return this.client.call("get", uri, apiHeaders, payload);
109967
+ }
109968
+ getEvent(paramsOrFirst) {
109969
+ let params;
109970
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
109971
+ params = paramsOrFirst || {};
109972
+ } else {
109973
+ params = {
109974
+ eventId: paramsOrFirst
109975
+ };
109976
+ }
109977
+ const eventId = params.eventId;
109978
+ if (typeof eventId === "undefined") {
109979
+ throw new AppwriteException('Missing required parameter: "eventId"');
109980
+ }
109981
+ const apiPath = "/activities/events/{eventId}".replace("{eventId}", eventId);
109982
+ const payload = {};
109983
+ const uri = new URL(this.client.config.endpoint + apiPath);
109984
+ const apiHeaders = {};
109985
+ return this.client.call("get", uri, apiHeaders, payload);
109986
+ }
109987
+ };
109988
+ var Backups = class {
109989
+ constructor(client2) {
109990
+ this.client = client2;
109991
+ }
109992
+ listArchives(paramsOrFirst) {
109993
+ let params;
109994
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
109995
+ params = paramsOrFirst || {};
109996
+ } else {
109997
+ params = {
109998
+ queries: paramsOrFirst
109999
+ };
110000
+ }
110001
+ const queries = params.queries;
110002
+ const apiPath = "/backups/archives";
110003
+ const payload = {};
110004
+ if (typeof queries !== "undefined") {
110005
+ payload["queries"] = queries;
110006
+ }
110007
+ const uri = new URL(this.client.config.endpoint + apiPath);
110008
+ const apiHeaders = {};
110009
+ return this.client.call("get", uri, apiHeaders, payload);
110010
+ }
110011
+ createArchive(paramsOrFirst, ...rest) {
110012
+ let params;
110013
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && ("services" in paramsOrFirst || "resourceId" in paramsOrFirst)) {
110014
+ params = paramsOrFirst || {};
110015
+ } else {
110016
+ params = {
110017
+ services: paramsOrFirst,
110018
+ resourceId: rest[0]
110019
+ };
110020
+ }
110021
+ const services = params.services;
110022
+ const resourceId = params.resourceId;
110023
+ if (typeof services === "undefined") {
110024
+ throw new AppwriteException('Missing required parameter: "services"');
110025
+ }
110026
+ const apiPath = "/backups/archives";
110027
+ const payload = {};
110028
+ if (typeof services !== "undefined") {
110029
+ payload["services"] = services;
110030
+ }
110031
+ if (typeof resourceId !== "undefined") {
110032
+ payload["resourceId"] = resourceId;
110033
+ }
110034
+ const uri = new URL(this.client.config.endpoint + apiPath);
110035
+ const apiHeaders = {
110036
+ "content-type": "application/json"
110037
+ };
110038
+ return this.client.call("post", uri, apiHeaders, payload);
110039
+ }
110040
+ getArchive(paramsOrFirst) {
110041
+ let params;
110042
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
110043
+ params = paramsOrFirst || {};
110044
+ } else {
110045
+ params = {
110046
+ archiveId: paramsOrFirst
110047
+ };
110048
+ }
110049
+ const archiveId = params.archiveId;
110050
+ if (typeof archiveId === "undefined") {
110051
+ throw new AppwriteException('Missing required parameter: "archiveId"');
110052
+ }
110053
+ const apiPath = "/backups/archives/{archiveId}".replace("{archiveId}", archiveId);
110054
+ const payload = {};
110055
+ const uri = new URL(this.client.config.endpoint + apiPath);
110056
+ const apiHeaders = {};
110057
+ return this.client.call("get", uri, apiHeaders, payload);
110058
+ }
110059
+ deleteArchive(paramsOrFirst) {
110060
+ let params;
110061
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
110062
+ params = paramsOrFirst || {};
110063
+ } else {
110064
+ params = {
110065
+ archiveId: paramsOrFirst
110066
+ };
110067
+ }
110068
+ const archiveId = params.archiveId;
110069
+ if (typeof archiveId === "undefined") {
110070
+ throw new AppwriteException('Missing required parameter: "archiveId"');
110071
+ }
110072
+ const apiPath = "/backups/archives/{archiveId}".replace("{archiveId}", archiveId);
110073
+ const payload = {};
110074
+ const uri = new URL(this.client.config.endpoint + apiPath);
110075
+ const apiHeaders = {
110076
+ "content-type": "application/json"
110077
+ };
110078
+ return this.client.call("delete", uri, apiHeaders, payload);
110079
+ }
110080
+ listPolicies(paramsOrFirst) {
110081
+ let params;
110082
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
110083
+ params = paramsOrFirst || {};
110084
+ } else {
110085
+ params = {
110086
+ queries: paramsOrFirst
110087
+ };
110088
+ }
110089
+ const queries = params.queries;
110090
+ const apiPath = "/backups/policies";
110091
+ const payload = {};
110092
+ if (typeof queries !== "undefined") {
110093
+ payload["queries"] = queries;
110094
+ }
110095
+ const uri = new URL(this.client.config.endpoint + apiPath);
110096
+ const apiHeaders = {};
110097
+ return this.client.call("get", uri, apiHeaders, payload);
110098
+ }
110099
+ createPolicy(paramsOrFirst, ...rest) {
110100
+ let params;
110101
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
110102
+ params = paramsOrFirst || {};
110103
+ } else {
110104
+ params = {
110105
+ policyId: paramsOrFirst,
110106
+ services: rest[0],
110107
+ retention: rest[1],
110108
+ schedule: rest[2],
110109
+ name: rest[3],
110110
+ resourceId: rest[4],
110111
+ enabled: rest[5]
110112
+ };
110113
+ }
110114
+ const policyId = params.policyId;
110115
+ const services = params.services;
110116
+ const retention = params.retention;
110117
+ const schedule = params.schedule;
110118
+ const name = params.name;
110119
+ const resourceId = params.resourceId;
110120
+ const enabled = params.enabled;
110121
+ if (typeof policyId === "undefined") {
110122
+ throw new AppwriteException('Missing required parameter: "policyId"');
110123
+ }
110124
+ if (typeof services === "undefined") {
110125
+ throw new AppwriteException('Missing required parameter: "services"');
110126
+ }
110127
+ if (typeof retention === "undefined") {
110128
+ throw new AppwriteException('Missing required parameter: "retention"');
110129
+ }
110130
+ if (typeof schedule === "undefined") {
110131
+ throw new AppwriteException('Missing required parameter: "schedule"');
110132
+ }
110133
+ const apiPath = "/backups/policies";
110134
+ const payload = {};
110135
+ if (typeof policyId !== "undefined") {
110136
+ payload["policyId"] = policyId;
110137
+ }
110138
+ if (typeof name !== "undefined") {
110139
+ payload["name"] = name;
110140
+ }
110141
+ if (typeof services !== "undefined") {
110142
+ payload["services"] = services;
110143
+ }
110144
+ if (typeof resourceId !== "undefined") {
110145
+ payload["resourceId"] = resourceId;
110146
+ }
110147
+ if (typeof enabled !== "undefined") {
110148
+ payload["enabled"] = enabled;
110149
+ }
110150
+ if (typeof retention !== "undefined") {
110151
+ payload["retention"] = retention;
110152
+ }
110153
+ if (typeof schedule !== "undefined") {
110154
+ payload["schedule"] = schedule;
110155
+ }
110156
+ const uri = new URL(this.client.config.endpoint + apiPath);
110157
+ const apiHeaders = {
110158
+ "content-type": "application/json"
110159
+ };
110160
+ return this.client.call("post", uri, apiHeaders, payload);
110161
+ }
110162
+ getPolicy(paramsOrFirst) {
110163
+ let params;
110164
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
110165
+ params = paramsOrFirst || {};
110166
+ } else {
110167
+ params = {
110168
+ policyId: paramsOrFirst
110169
+ };
110170
+ }
110171
+ const policyId = params.policyId;
110172
+ if (typeof policyId === "undefined") {
110173
+ throw new AppwriteException('Missing required parameter: "policyId"');
110174
+ }
110175
+ const apiPath = "/backups/policies/{policyId}".replace("{policyId}", policyId);
110176
+ const payload = {};
110177
+ const uri = new URL(this.client.config.endpoint + apiPath);
110178
+ const apiHeaders = {};
110179
+ return this.client.call("get", uri, apiHeaders, payload);
110180
+ }
110181
+ updatePolicy(paramsOrFirst, ...rest) {
110182
+ let params;
110183
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
110184
+ params = paramsOrFirst || {};
110185
+ } else {
110186
+ params = {
110187
+ policyId: paramsOrFirst,
110188
+ name: rest[0],
110189
+ retention: rest[1],
110190
+ schedule: rest[2],
110191
+ enabled: rest[3]
110192
+ };
110193
+ }
110194
+ const policyId = params.policyId;
110195
+ const name = params.name;
110196
+ const retention = params.retention;
110197
+ const schedule = params.schedule;
110198
+ const enabled = params.enabled;
110199
+ if (typeof policyId === "undefined") {
110200
+ throw new AppwriteException('Missing required parameter: "policyId"');
110201
+ }
110202
+ const apiPath = "/backups/policies/{policyId}".replace("{policyId}", policyId);
110203
+ const payload = {};
110204
+ if (typeof name !== "undefined") {
110205
+ payload["name"] = name;
110206
+ }
110207
+ if (typeof retention !== "undefined") {
110208
+ payload["retention"] = retention;
110209
+ }
110210
+ if (typeof schedule !== "undefined") {
110211
+ payload["schedule"] = schedule;
110212
+ }
110213
+ if (typeof enabled !== "undefined") {
110214
+ payload["enabled"] = enabled;
110215
+ }
110216
+ const uri = new URL(this.client.config.endpoint + apiPath);
110217
+ const apiHeaders = {
110218
+ "content-type": "application/json"
110219
+ };
110220
+ return this.client.call("patch", uri, apiHeaders, payload);
110221
+ }
110222
+ deletePolicy(paramsOrFirst) {
110223
+ let params;
110224
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
110225
+ params = paramsOrFirst || {};
110226
+ } else {
110227
+ params = {
110228
+ policyId: paramsOrFirst
110229
+ };
110230
+ }
110231
+ const policyId = params.policyId;
110232
+ if (typeof policyId === "undefined") {
110233
+ throw new AppwriteException('Missing required parameter: "policyId"');
110234
+ }
110235
+ const apiPath = "/backups/policies/{policyId}".replace("{policyId}", policyId);
110236
+ const payload = {};
110237
+ const uri = new URL(this.client.config.endpoint + apiPath);
110238
+ const apiHeaders = {
110239
+ "content-type": "application/json"
110240
+ };
110241
+ return this.client.call("delete", uri, apiHeaders, payload);
110242
+ }
110243
+ createRestoration(paramsOrFirst, ...rest) {
110244
+ let params;
110245
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
110246
+ params = paramsOrFirst || {};
110247
+ } else {
110248
+ params = {
110249
+ archiveId: paramsOrFirst,
110250
+ services: rest[0],
110251
+ newResourceId: rest[1],
110252
+ newResourceName: rest[2]
110253
+ };
110254
+ }
110255
+ const archiveId = params.archiveId;
110256
+ const services = params.services;
110257
+ const newResourceId = params.newResourceId;
110258
+ const newResourceName = params.newResourceName;
110259
+ if (typeof archiveId === "undefined") {
110260
+ throw new AppwriteException('Missing required parameter: "archiveId"');
110261
+ }
110262
+ if (typeof services === "undefined") {
110263
+ throw new AppwriteException('Missing required parameter: "services"');
110264
+ }
110265
+ const apiPath = "/backups/restoration";
110266
+ const payload = {};
110267
+ if (typeof archiveId !== "undefined") {
110268
+ payload["archiveId"] = archiveId;
110269
+ }
110270
+ if (typeof services !== "undefined") {
110271
+ payload["services"] = services;
110272
+ }
110273
+ if (typeof newResourceId !== "undefined") {
110274
+ payload["newResourceId"] = newResourceId;
110275
+ }
110276
+ if (typeof newResourceName !== "undefined") {
110277
+ payload["newResourceName"] = newResourceName;
110278
+ }
110279
+ const uri = new URL(this.client.config.endpoint + apiPath);
110280
+ const apiHeaders = {
110281
+ "content-type": "application/json"
110282
+ };
110283
+ return this.client.call("post", uri, apiHeaders, payload);
110284
+ }
110285
+ listRestorations(paramsOrFirst) {
110286
+ let params;
110287
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
110288
+ params = paramsOrFirst || {};
110289
+ } else {
110290
+ params = {
110291
+ queries: paramsOrFirst
110292
+ };
110293
+ }
110294
+ const queries = params.queries;
110295
+ const apiPath = "/backups/restorations";
110296
+ const payload = {};
110297
+ if (typeof queries !== "undefined") {
110298
+ payload["queries"] = queries;
110299
+ }
110300
+ const uri = new URL(this.client.config.endpoint + apiPath);
110301
+ const apiHeaders = {};
110302
+ return this.client.call("get", uri, apiHeaders, payload);
110303
+ }
110304
+ getRestoration(paramsOrFirst) {
110305
+ let params;
110306
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
110307
+ params = paramsOrFirst || {};
110308
+ } else {
110309
+ params = {
110310
+ restorationId: paramsOrFirst
110311
+ };
110312
+ }
110313
+ const restorationId = params.restorationId;
110314
+ if (typeof restorationId === "undefined") {
110315
+ throw new AppwriteException('Missing required parameter: "restorationId"');
110316
+ }
110317
+ const apiPath = "/backups/restorations/{restorationId}".replace("{restorationId}", restorationId);
110318
+ const payload = {};
110319
+ const uri = new URL(this.client.config.endpoint + apiPath);
110320
+ const apiHeaders = {};
110321
+ return this.client.call("get", uri, apiHeaders, payload);
110322
+ }
110323
+ };
109932
110324
  var Console = class {
109933
110325
  constructor(client2) {
109934
110326
  this.client = client2;
@@ -119763,21 +120155,26 @@ var Organizations = class {
119763
120155
  const apiHeaders = {};
119764
120156
  return this.client.call("get", uri, apiHeaders, payload);
119765
120157
  }
119766
- getScopes(paramsOrFirst) {
120158
+ getScopes(paramsOrFirst, ...rest) {
119767
120159
  let params;
119768
120160
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
119769
120161
  params = paramsOrFirst || {};
119770
120162
  } else {
119771
120163
  params = {
119772
- organizationId: paramsOrFirst
120164
+ organizationId: paramsOrFirst,
120165
+ projectId: rest[0]
119773
120166
  };
119774
120167
  }
119775
120168
  const organizationId = params.organizationId;
120169
+ const projectId = params.projectId;
119776
120170
  if (typeof organizationId === "undefined") {
119777
120171
  throw new AppwriteException('Missing required parameter: "organizationId"');
119778
120172
  }
119779
120173
  const apiPath = "/organizations/{organizationId}/roles".replace("{organizationId}", organizationId);
119780
120174
  const payload = {};
120175
+ if (typeof projectId !== "undefined") {
120176
+ payload["projectId"] = projectId;
120177
+ }
119781
120178
  const uri = new URL(this.client.config.endpoint + apiPath);
119782
120179
  const apiHeaders = {};
119783
120180
  return this.client.call("get", uri, apiHeaders, payload);
@@ -134165,8 +134562,8 @@ async function createPullInstance(options = {
134165
134562
  }) {
134166
134563
  const { silent, requiresConsoleAuth } = options;
134167
134564
  const projectClient2 = await sdkForProject();
134168
- const consoleClient2 = await sdkForConsole(requiresConsoleAuth);
134169
- const pullInstance = new Pull(projectClient2, consoleClient2, silent);
134565
+ const consoleClient = await sdkForConsole(requiresConsoleAuth);
134566
+ const pullInstance = new Pull(projectClient2, consoleClient, silent);
134170
134567
  pullInstance.setConfigDirectoryPath(localConfig.configDirectoryPath);
134171
134568
  return pullInstance;
134172
134569
  }
@@ -134175,9 +134572,9 @@ var Pull = class {
134175
134572
  consoleClient;
134176
134573
  configDirectoryPath;
134177
134574
  silent;
134178
- constructor(projectClient2, consoleClient2, silent = false) {
134575
+ constructor(projectClient2, consoleClient, silent = false) {
134179
134576
  this.projectClient = projectClient2;
134180
- this.consoleClient = consoleClient2;
134577
+ this.consoleClient = consoleClient;
134181
134578
  this.configDirectoryPath = process.cwd();
134182
134579
  this.silent = silent;
134183
134580
  }
@@ -137000,9 +137397,9 @@ var JwtManager = {
137000
137397
  timerWarn: null,
137001
137398
  timerError: null,
137002
137399
  async setup(userId = null, projectScopes = []) {
137003
- const consoleClient2 = await sdkForConsole();
137004
- const usersClient2 = new Users(consoleClient2);
137005
- const projectsClient2 = new Projects(consoleClient2);
137400
+ const consoleClient = await sdkForConsole();
137401
+ const usersClient2 = new Users(consoleClient);
137402
+ const projectsClient2 = new Projects(consoleClient);
137006
137403
  if (this.timerWarn) {
137007
137404
  clearTimeout(this.timerWarn);
137008
137405
  }
@@ -139062,9 +139459,9 @@ var Push = class {
139062
139459
  projectClient;
139063
139460
  consoleClient;
139064
139461
  silent;
139065
- constructor(projectClient2, consoleClient2, silent = false) {
139462
+ constructor(projectClient2, consoleClient, silent = false) {
139066
139463
  this.projectClient = projectClient2;
139067
- this.consoleClient = consoleClient2;
139464
+ this.consoleClient = consoleClient;
139068
139465
  this.silent = silent;
139069
139466
  }
139070
139467
  /**
@@ -140347,8 +140744,8 @@ async function createPushInstance(options = {
140347
140744
  }) {
140348
140745
  const { silent, requiresConsoleAuth } = options;
140349
140746
  const projectClient2 = await sdkForProject();
140350
- const consoleClient2 = await sdkForConsole(requiresConsoleAuth);
140351
- return new Push(projectClient2, consoleClient2, silent);
140747
+ const consoleClient = await sdkForConsole(requiresConsoleAuth);
140748
+ return new Push(projectClient2, consoleClient, silent);
140352
140749
  }
140353
140750
  var pushResources = async ({
140354
140751
  skipDeprecated = false
@@ -141962,6 +142359,36 @@ account.command(`delete`).description(`Delete the currently logged in user.`).ac
141962
142359
  async () => parse3(await (await getAccountClient()).delete())
141963
142360
  )
141964
142361
  );
142362
+ 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(
142363
+ actionRunner(
142364
+ async ({ queries }) => parse3(await (await getAccountClient()).listBillingAddresses(queries))
142365
+ )
142366
+ );
142367
+ 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(
142368
+ actionRunner(
142369
+ async ({ country, city, streetAddress, addressLine2, state, postalCode }) => parse3(await (await getAccountClient()).createBillingAddress(country, city, streetAddress, addressLine2, state, postalCode))
142370
+ )
142371
+ );
142372
+ 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(
142373
+ actionRunner(
142374
+ async ({ billingAddressId }) => parse3(await (await getAccountClient()).getBillingAddress(billingAddressId))
142375
+ )
142376
+ );
142377
+ 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(
142378
+ actionRunner(
142379
+ async ({ billingAddressId, country, city, streetAddress, addressLine2, state, postalCode }) => parse3(await (await getAccountClient()).updateBillingAddress(billingAddressId, country, city, streetAddress, addressLine2, state, postalCode))
142380
+ )
142381
+ );
142382
+ 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(
142383
+ actionRunner(
142384
+ async ({ billingAddressId }) => parse3(await (await getAccountClient()).deleteBillingAddress(billingAddressId))
142385
+ )
142386
+ );
142387
+ account.command(`get-coupon`).description(`Get coupon details for an account.`).requiredOption(`--coupon-id <coupon-id>`, `ID of the coupon`).action(
142388
+ actionRunner(
142389
+ async ({ couponId }) => parse3(await (await getAccountClient()).getCoupon(couponId))
142390
+ )
142391
+ );
141965
142392
  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.
141966
142393
  This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.
141967
142394
  `).requiredOption(`--email <email>`, `User email.`).requiredOption(`--password <password>`, `User password. Must be at least 8 chars.`).action(
@@ -141983,11 +142410,45 @@ account.command(`delete-identity`).description(`Delete an identity by its unique
141983
142410
  async ({ identityId }) => parse3(await (await getAccountClient()).deleteIdentity(identityId))
141984
142411
  )
141985
142412
  );
142413
+ 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(
142414
+ actionRunner(
142415
+ async ({ queries }) => parse3(await (await getAccountClient()).listInvoices(queries))
142416
+ )
142417
+ );
141986
142418
  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(
141987
142419
  actionRunner(
141988
142420
  async ({ duration: duration3 }) => parse3(await (await getAccountClient()).createJWT(duration3))
141989
142421
  )
141990
142422
  );
142423
+ account.command(`list-keys`).description(`Get a list of all API keys from the current account. `).option(
142424
+ `--total [value]`,
142425
+ `When set to false, the total count returned will be 0 and will not be calculated.`,
142426
+ (value) => value === void 0 ? true : parseBool(value)
142427
+ ).action(
142428
+ actionRunner(
142429
+ async ({ total }) => parse3(await (await getAccountClient()).listKeys(total))
142430
+ )
142431
+ );
142432
+ 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(
142433
+ actionRunner(
142434
+ async ({ name, scopes, expire }) => parse3(await (await getAccountClient()).createKey(name, scopes, expire))
142435
+ )
142436
+ );
142437
+ 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(
142438
+ actionRunner(
142439
+ async ({ keyId }) => parse3(await (await getAccountClient()).getKey(keyId))
142440
+ )
142441
+ );
142442
+ 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(
142443
+ actionRunner(
142444
+ async ({ keyId, name, scopes, expire }) => parse3(await (await getAccountClient()).updateKey(keyId, name, scopes, expire))
142445
+ )
142446
+ );
142447
+ 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(
142448
+ actionRunner(
142449
+ async ({ keyId }) => parse3(await (await getAccountClient()).deleteKey(keyId))
142450
+ )
142451
+ );
141991
142452
  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(
141992
142453
  `--total [value]`,
141993
142454
  `When set to false, the total count returned will be 0 and will not be calculated.`,
@@ -142057,6 +142518,41 @@ account.command(`update-password`).description(`Update currently logged in user
142057
142518
  async ({ password, oldPassword }) => parse3(await (await getAccountClient()).updatePassword(password, oldPassword))
142058
142519
  )
142059
142520
  );
142521
+ 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(
142522
+ actionRunner(
142523
+ async ({ queries }) => parse3(await (await getAccountClient()).listPaymentMethods(queries))
142524
+ )
142525
+ );
142526
+ account.command(`create-payment-method`).description(`Create a new payment method for the current user account.`).action(
142527
+ actionRunner(
142528
+ async () => parse3(await (await getAccountClient()).createPaymentMethod())
142529
+ )
142530
+ );
142531
+ 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(
142532
+ actionRunner(
142533
+ async ({ paymentMethodId }) => parse3(await (await getAccountClient()).getPaymentMethod(paymentMethodId))
142534
+ )
142535
+ );
142536
+ 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(
142537
+ actionRunner(
142538
+ async ({ paymentMethodId, expiryMonth, expiryYear, state }) => parse3(await (await getAccountClient()).updatePaymentMethod(paymentMethodId, expiryMonth, expiryYear, state))
142539
+ )
142540
+ );
142541
+ 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(
142542
+ actionRunner(
142543
+ async ({ paymentMethodId }) => parse3(await (await getAccountClient()).deletePaymentMethod(paymentMethodId))
142544
+ )
142545
+ );
142546
+ 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(
142547
+ actionRunner(
142548
+ async ({ paymentMethodId, providerMethodId, name, state }) => parse3(await (await getAccountClient()).updatePaymentMethodProvider(paymentMethodId, providerMethodId, name, state))
142549
+ )
142550
+ );
142551
+ 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(
142552
+ actionRunner(
142553
+ async ({ paymentMethodId }) => parse3(await (await getAccountClient()).updatePaymentMethodMandateOptions(paymentMethodId))
142554
+ )
142555
+ );
142060
142556
  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(
142061
142557
  actionRunner(
142062
142558
  async ({ phone, password }) => parse3(await (await getAccountClient()).updatePhone(phone, password))
@@ -142118,8 +142614,8 @@ If there is already an active session, the new session will be attached to the l
142118
142614
  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).
142119
142615
  `).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(
142120
142616
  actionRunner(
142121
- async ({ provider, success: success19, failure, scopes }) => {
142122
- const url2 = (await getAccountClient()).createOAuth2Session(provider, success19, failure, scopes);
142617
+ async ({ provider, success: success20, failure, scopes }) => {
142618
+ const url2 = (await getAccountClient()).createOAuth2Session(provider, success20, failure, scopes);
142123
142619
  if (url2) console.log(url2);
142124
142620
  }
142125
142621
  )
@@ -142199,8 +142695,8 @@ If authentication succeeds, \`userId\` and \`secret\` of a token will be appende
142199
142695
 
142200
142696
  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(
142201
142697
  actionRunner(
142202
- async ({ provider, success: success19, failure, scopes }) => {
142203
- const url2 = (await getAccountClient()).createOAuth2Token(provider, success19, failure, scopes);
142698
+ async ({ provider, success: success20, failure, scopes }) => {
142699
+ const url2 = (await getAccountClient()).createOAuth2Token(provider, success20, failure, scopes);
142204
142700
  if (url2) console.log(url2);
142205
142701
  }
142206
142702
  )
@@ -142249,26 +142745,108 @@ account.command(`update-phone-verification`).description(`Use this endpoint to c
142249
142745
  )
142250
142746
  );
142251
142747
 
142252
- // lib/commands/services/console.ts
142253
- var consoleClient = null;
142254
- var getConsoleClient = async () => {
142255
- if (!consoleClient) {
142748
+ // lib/commands/services/activities.ts
142749
+ var activitiesClient = null;
142750
+ var getActivitiesClient = async () => {
142751
+ if (!activitiesClient) {
142256
142752
  const sdkClient = await sdkForProject();
142257
- consoleClient = new Console(sdkClient);
142753
+ activitiesClient = new Activities(sdkClient);
142258
142754
  }
142259
- return consoleClient;
142755
+ return activitiesClient;
142260
142756
  };
142261
- var console2 = new Command("console").description(commandDescriptions["console"] ?? "").configureHelp({
142757
+ var activities = new Command("activities").description(commandDescriptions["activities"] ?? "").configureHelp({
142262
142758
  helpWidth: process.stdout.columns || 80
142263
142759
  });
142264
- console2.command(`get-resource`).description(`Check if a resource ID is available.`).requiredOption(`--value <value>`, `Resource value.`).requiredOption(`--type <type>`, `Resource type.`).action(
142760
+ 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(
142761
+ actionRunner(
142762
+ async ({ queries }) => parse3(await (await getActivitiesClient()).listEvents(queries))
142763
+ )
142764
+ );
142765
+ activities.command(`get-event`).description(`Get event by ID.
142766
+ `).requiredOption(`--event-id <event-id>`, `Event ID.`).action(
142767
+ actionRunner(
142768
+ async ({ eventId }) => parse3(await (await getActivitiesClient()).getEvent(eventId))
142769
+ )
142770
+ );
142771
+
142772
+ // lib/commands/services/backups.ts
142773
+ var backupsClient = null;
142774
+ var getBackupsClient = async () => {
142775
+ if (!backupsClient) {
142776
+ const sdkClient = await sdkForProject();
142777
+ backupsClient = new Backups(sdkClient);
142778
+ }
142779
+ return backupsClient;
142780
+ };
142781
+ var backups = new Command("backups").description(commandDescriptions["backups"] ?? "").configureHelp({
142782
+ helpWidth: process.stdout.columns || 80
142783
+ });
142784
+ 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(
142785
+ actionRunner(
142786
+ async ({ queries }) => parse3(await (await getBackupsClient()).listArchives(queries))
142787
+ )
142788
+ );
142789
+ 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(
142790
+ actionRunner(
142791
+ async ({ services, resourceId }) => parse3(await (await getBackupsClient()).createArchive(services, resourceId))
142792
+ )
142793
+ );
142794
+ 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(
142795
+ actionRunner(
142796
+ async ({ archiveId }) => parse3(await (await getBackupsClient()).getArchive(archiveId))
142797
+ )
142798
+ );
142799
+ 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(
142800
+ actionRunner(
142801
+ async ({ archiveId }) => parse3(await (await getBackupsClient()).deleteArchive(archiveId))
142802
+ )
142803
+ );
142804
+ 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(
142805
+ actionRunner(
142806
+ async ({ queries }) => parse3(await (await getBackupsClient()).listPolicies(queries))
142807
+ )
142808
+ );
142809
+ 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(
142810
+ `--enabled [value]`,
142811
+ `Is policy enabled? When set to 'disabled', no backups will be taken`,
142812
+ (value) => value === void 0 ? true : parseBool(value)
142813
+ ).action(
142814
+ actionRunner(
142815
+ async ({ policyId, services, retention, schedule, name, resourceId, enabled }) => parse3(await (await getBackupsClient()).createPolicy(policyId, services, retention, schedule, name, resourceId, enabled))
142816
+ )
142817
+ );
142818
+ 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(
142819
+ actionRunner(
142820
+ async ({ policyId }) => parse3(await (await getBackupsClient()).getPolicy(policyId))
142821
+ )
142822
+ );
142823
+ 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(
142824
+ `--enabled [value]`,
142825
+ `Is Backup enabled? When set to 'disabled', No backup will be taken`,
142826
+ (value) => value === void 0 ? true : parseBool(value)
142827
+ ).action(
142265
142828
  actionRunner(
142266
- async ({ value, type }) => parse3(await (await getConsoleClient()).getResource(value, type))
142829
+ async ({ policyId, name, retention, schedule, enabled }) => parse3(await (await getBackupsClient()).updatePolicy(policyId, name, retention, schedule, enabled))
142267
142830
  )
142268
142831
  );
142269
- console2.command(`variables`).description(`Get all Environment Variables that are relevant for the console.`).action(
142832
+ 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(
142270
142833
  actionRunner(
142271
- async () => parse3(await (await getConsoleClient()).variables())
142834
+ async ({ policyId }) => parse3(await (await getBackupsClient()).deletePolicy(policyId))
142835
+ )
142836
+ );
142837
+ 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(
142838
+ actionRunner(
142839
+ async ({ archiveId, services, newResourceId, newResourceName }) => parse3(await (await getBackupsClient()).createRestoration(archiveId, services, newResourceId, newResourceName))
142840
+ )
142841
+ );
142842
+ 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(
142843
+ actionRunner(
142844
+ async ({ queries }) => parse3(await (await getBackupsClient()).listRestorations(queries))
142845
+ )
142846
+ );
142847
+ 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(
142848
+ actionRunner(
142849
+ async ({ restorationId }) => parse3(await (await getBackupsClient()).getRestoration(restorationId))
142272
142850
  )
142273
142851
  );
142274
142852
 
@@ -143128,11 +143706,26 @@ health.command(`get-queue-audits`).description(`Get the number of audit logs tha
143128
143706
  async ({ threshold }) => parse3(await (await getHealthClient()).getQueueAudits(threshold))
143129
143707
  )
143130
143708
  );
143709
+ 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(
143710
+ actionRunner(
143711
+ async ({ threshold }) => parse3(await (await getHealthClient()).getQueueBillingProjectAggregation(threshold))
143712
+ )
143713
+ );
143714
+ 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(
143715
+ actionRunner(
143716
+ async ({ threshold }) => parse3(await (await getHealthClient()).getQueueBillingTeamAggregation(threshold))
143717
+ )
143718
+ );
143131
143719
  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(
143132
143720
  actionRunner(
143133
143721
  async ({ threshold }) => parse3(await (await getHealthClient()).getQueueBuilds(threshold))
143134
143722
  )
143135
143723
  );
143724
+ 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(
143725
+ actionRunner(
143726
+ async ({ threshold }) => parse3(await (await getHealthClient()).getQueuePriorityBuilds(threshold))
143727
+ )
143728
+ );
143136
143729
  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(
143137
143730
  actionRunner(
143138
143731
  async ({ threshold }) => parse3(await (await getHealthClient()).getQueueCertificates(threshold))
@@ -143179,6 +143772,11 @@ health.command(`get-queue-migrations`).description(`Get the number of migrations
143179
143772
  async ({ threshold }) => parse3(await (await getHealthClient()).getQueueMigrations(threshold))
143180
143773
  )
143181
143774
  );
143775
+ 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(
143776
+ actionRunner(
143777
+ async ({ threshold }) => parse3(await (await getHealthClient()).getQueueRegionManager(threshold))
143778
+ )
143779
+ );
143182
143780
  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(
143183
143781
  actionRunner(
143184
143782
  async ({ threshold }) => parse3(await (await getHealthClient()).getQueueStatsResources(threshold))
@@ -143189,6 +143787,11 @@ health.command(`get-queue-usage`).description(`Get the number of metrics that ar
143189
143787
  async ({ threshold }) => parse3(await (await getHealthClient()).getQueueUsage(threshold))
143190
143788
  )
143191
143789
  );
143790
+ 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(
143791
+ actionRunner(
143792
+ async ({ threshold }) => parse3(await (await getHealthClient()).getQueueThreats(threshold))
143793
+ )
143794
+ );
143192
143795
  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(
143193
143796
  actionRunner(
143194
143797
  async ({ threshold }) => parse3(await (await getHealthClient()).getQueueWebhooks(threshold))
@@ -144089,7 +144692,7 @@ projects.command(`list-schedules`).description(`Get a list of all the project's
144089
144692
  async ({ projectId, queries, total }) => parse3(await (await getProjectsClient()).listSchedules(projectId, queries, total))
144090
144693
  )
144091
144694
  );
144092
- 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(
144695
+ 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(
144093
144696
  `--active [value]`,
144094
144697
  `Whether the schedule is active.`,
144095
144698
  (value) => value === void 0 ? true : parseBool(value)
@@ -144509,7 +145112,7 @@ storage.command(`create-bucket`).description(`Create a new storage bucket.`).req
144509
145112
  `--enabled [value]`,
144510
145113
  `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.`,
144511
145114
  (value) => value === void 0 ? true : parseBool(value)
144512
- ).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(
145115
+ ).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(
144513
145116
  `--encryption [value]`,
144514
145117
  `Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled`,
144515
145118
  (value) => value === void 0 ? true : parseBool(value)
@@ -144539,7 +145142,7 @@ storage.command(`update-bucket`).description(`Update a storage bucket by its uni
144539
145142
  `--enabled [value]`,
144540
145143
  `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.`,
144541
145144
  (value) => value === void 0 ? true : parseBool(value)
144542
- ).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(
145145
+ ).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(
144543
145146
  `--encryption [value]`,
144544
145147
  `Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled`,
144545
145148
  (value) => value === void 0 ? true : parseBool(value)
@@ -145711,11 +146314,14 @@ if (process.argv.includes("-v") || process.argv.includes("--version")) {
145711
146314
  cliConfig.all = true;
145712
146315
  }).on("option:id", function() {
145713
146316
  cliConfig.ids = this.opts().id;
145714
- }).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);
146317
+ }).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);
145715
146318
  process.stdout.columns = oldWidth;
145716
146319
  }
145717
146320
  /*! Bundled license information:
145718
146321
 
146322
+ safe-buffer/index.js:
146323
+ (*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
146324
+
145719
146325
  undici/lib/fetch/body.js:
145720
146326
  (*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> *)
145721
146327