appwrite-cli 13.6.1 → 14.0.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 (35) hide show
  1. package/.github/workflows/ci.yml +66 -0
  2. package/CHANGELOG.md +10 -0
  3. package/README.md +2 -2
  4. package/dist/bundle-win-arm64.mjs +274 -100
  5. package/dist/cli.cjs +274 -100
  6. package/dist/index.cjs +200 -81
  7. package/dist/index.js +200 -81
  8. package/dist/lib/commands/generate.d.ts +2 -0
  9. package/dist/lib/commands/generate.d.ts.map +1 -1
  10. package/dist/lib/commands/generators/base.d.ts +20 -2
  11. package/dist/lib/commands/generators/base.d.ts.map +1 -1
  12. package/dist/lib/commands/generators/index.d.ts +1 -1
  13. package/dist/lib/commands/generators/index.d.ts.map +1 -1
  14. package/dist/lib/commands/generators/typescript/databases.d.ts +2 -2
  15. package/dist/lib/commands/generators/typescript/databases.d.ts.map +1 -1
  16. package/dist/lib/constants.d.ts +1 -1
  17. package/docs/examples/projects/update-status.md +5 -0
  18. package/docs/examples/sites/create-deployment.md +1 -2
  19. package/install.ps1 +2 -2
  20. package/install.sh +1 -1
  21. package/lib/commands/generate.ts +15 -2
  22. package/lib/commands/generators/base.ts +27 -2
  23. package/lib/commands/generators/index.ts +1 -0
  24. package/lib/commands/generators/typescript/databases.ts +22 -12
  25. package/lib/commands/services/account.ts +1 -1
  26. package/lib/commands/services/databases.ts +20 -19
  27. package/lib/commands/services/health.ts +13 -0
  28. package/lib/commands/services/messaging.ts +1 -1
  29. package/lib/commands/services/projects.ts +25 -0
  30. package/lib/commands/services/sites.ts +8 -3
  31. package/lib/commands/services/tables-db.ts +3 -2
  32. package/lib/commands/services/teams.ts +2 -2
  33. package/lib/constants.ts +1 -1
  34. package/package.json +2 -2
  35. package/scoop/appwrite.config.json +3 -3
@@ -92095,7 +92095,7 @@ var package_default = {
92095
92095
  type: "module",
92096
92096
  homepage: "https://appwrite.io/support",
92097
92097
  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",
92098
- version: "13.6.1",
92098
+ version: "14.0.0",
92099
92099
  license: "BSD-3-Clause",
92100
92100
  main: "dist/index.cjs",
92101
92101
  module: "dist/index.js",
@@ -92139,7 +92139,7 @@ var package_default = {
92139
92139
  "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"
92140
92140
  },
92141
92141
  dependencies: {
92142
- "@appwrite.io/console": "^3.1.0",
92142
+ "@appwrite.io/console": "^4.0.0",
92143
92143
  chalk: "4.1.2",
92144
92144
  chokidar: "^3.6.0",
92145
92145
  "cli-progress": "^3.12.0",
@@ -106378,7 +106378,7 @@ import childProcess from "child_process";
106378
106378
  // lib/constants.ts
106379
106379
  var SDK_TITLE = "Appwrite";
106380
106380
  var SDK_TITLE_LOWER = "appwrite";
106381
- var SDK_VERSION = "13.6.1";
106381
+ var SDK_VERSION = "14.0.0";
106382
106382
  var SDK_NAME = "Command Line";
106383
106383
  var SDK_PLATFORM = "console";
106384
106384
  var SDK_LANGUAGE = "cli";
@@ -107417,7 +107417,7 @@ var Client = class _Client {
107417
107417
  "x-sdk-name": "Console",
107418
107418
  "x-sdk-platform": "console",
107419
107419
  "x-sdk-language": "web",
107420
- "x-sdk-version": "3.1.0",
107420
+ "x-sdk-version": "4.0.0",
107421
107421
  "X-Appwrite-Response-Format": "1.8.0"
107422
107422
  };
107423
107423
  this.realtime = {
@@ -112539,6 +112539,47 @@ var Databases = class {
112539
112539
  };
112540
112540
  return this.client.call("post", uri, apiHeaders, payload);
112541
112541
  }
112542
+ updateRelationshipAttribute(paramsOrFirst, ...rest) {
112543
+ let params;
112544
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
112545
+ params = paramsOrFirst || {};
112546
+ } else {
112547
+ params = {
112548
+ databaseId: paramsOrFirst,
112549
+ collectionId: rest[0],
112550
+ key: rest[1],
112551
+ onDelete: rest[2],
112552
+ newKey: rest[3]
112553
+ };
112554
+ }
112555
+ const databaseId = params.databaseId;
112556
+ const collectionId = params.collectionId;
112557
+ const key = params.key;
112558
+ const onDelete = params.onDelete;
112559
+ const newKey = params.newKey;
112560
+ if (typeof databaseId === "undefined") {
112561
+ throw new AppwriteException('Missing required parameter: "databaseId"');
112562
+ }
112563
+ if (typeof collectionId === "undefined") {
112564
+ throw new AppwriteException('Missing required parameter: "collectionId"');
112565
+ }
112566
+ if (typeof key === "undefined") {
112567
+ throw new AppwriteException('Missing required parameter: "key"');
112568
+ }
112569
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/relationship/{key}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{key}", key);
112570
+ const payload = {};
112571
+ if (typeof onDelete !== "undefined") {
112572
+ payload["onDelete"] = onDelete;
112573
+ }
112574
+ if (typeof newKey !== "undefined") {
112575
+ payload["newKey"] = newKey;
112576
+ }
112577
+ const uri = new URL(this.client.config.endpoint + apiPath);
112578
+ const apiHeaders = {
112579
+ "content-type": "application/json"
112580
+ };
112581
+ return this.client.call("patch", uri, apiHeaders, payload);
112582
+ }
112542
112583
  createStringAttribute(paramsOrFirst, ...rest) {
112543
112584
  let params;
112544
112585
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -113056,47 +113097,6 @@ var Databases = class {
113056
113097
  };
113057
113098
  return this.client.call("delete", uri, apiHeaders, payload);
113058
113099
  }
113059
- updateRelationshipAttribute(paramsOrFirst, ...rest) {
113060
- let params;
113061
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
113062
- params = paramsOrFirst || {};
113063
- } else {
113064
- params = {
113065
- databaseId: paramsOrFirst,
113066
- collectionId: rest[0],
113067
- key: rest[1],
113068
- onDelete: rest[2],
113069
- newKey: rest[3]
113070
- };
113071
- }
113072
- const databaseId = params.databaseId;
113073
- const collectionId = params.collectionId;
113074
- const key = params.key;
113075
- const onDelete = params.onDelete;
113076
- const newKey = params.newKey;
113077
- if (typeof databaseId === "undefined") {
113078
- throw new AppwriteException('Missing required parameter: "databaseId"');
113079
- }
113080
- if (typeof collectionId === "undefined") {
113081
- throw new AppwriteException('Missing required parameter: "collectionId"');
113082
- }
113083
- if (typeof key === "undefined") {
113084
- throw new AppwriteException('Missing required parameter: "key"');
113085
- }
113086
- const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{key}", key);
113087
- const payload = {};
113088
- if (typeof onDelete !== "undefined") {
113089
- payload["onDelete"] = onDelete;
113090
- }
113091
- if (typeof newKey !== "undefined") {
113092
- payload["newKey"] = newKey;
113093
- }
113094
- const uri = new URL(this.client.config.endpoint + apiPath);
113095
- const apiHeaders = {
113096
- "content-type": "application/json"
113097
- };
113098
- return this.client.call("patch", uri, apiHeaders, payload);
113099
- }
113100
113100
  listDocuments(paramsOrFirst, ...rest) {
113101
113101
  let params;
113102
113102
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -113107,7 +113107,8 @@ var Databases = class {
113107
113107
  collectionId: rest[0],
113108
113108
  queries: rest[1],
113109
113109
  transactionId: rest[2],
113110
- total: rest[3]
113110
+ total: rest[3],
113111
+ ttl: rest[4]
113111
113112
  };
113112
113113
  }
113113
113114
  const databaseId = params.databaseId;
@@ -113115,6 +113116,7 @@ var Databases = class {
113115
113116
  const queries = params.queries;
113116
113117
  const transactionId = params.transactionId;
113117
113118
  const total = params.total;
113119
+ const ttl = params.ttl;
113118
113120
  if (typeof databaseId === "undefined") {
113119
113121
  throw new AppwriteException('Missing required parameter: "databaseId"');
113120
113122
  }
@@ -113132,6 +113134,9 @@ var Databases = class {
113132
113134
  if (typeof total !== "undefined") {
113133
113135
  payload["total"] = total;
113134
113136
  }
113137
+ if (typeof ttl !== "undefined") {
113138
+ payload["ttl"] = ttl;
113139
+ }
113135
113140
  const uri = new URL(this.client.config.endpoint + apiPath);
113136
113141
  const apiHeaders = {};
113137
113142
  return this.client.call("get", uri, apiHeaders, payload);
@@ -115097,6 +115102,30 @@ var Health = class {
115097
115102
  const apiHeaders = {};
115098
115103
  return this.client.call("get", uri, apiHeaders, payload);
115099
115104
  }
115105
+ getConsolePausing(paramsOrFirst, ...rest) {
115106
+ let params;
115107
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
115108
+ params = paramsOrFirst || {};
115109
+ } else {
115110
+ params = {
115111
+ threshold: paramsOrFirst,
115112
+ inactivityDays: rest[0]
115113
+ };
115114
+ }
115115
+ const threshold = params.threshold;
115116
+ const inactivityDays = params.inactivityDays;
115117
+ const apiPath = "/health/console-pausing";
115118
+ const payload = {};
115119
+ if (typeof threshold !== "undefined") {
115120
+ payload["threshold"] = threshold;
115121
+ }
115122
+ if (typeof inactivityDays !== "undefined") {
115123
+ payload["inactivityDays"] = inactivityDays;
115124
+ }
115125
+ const uri = new URL(this.client.config.endpoint + apiPath);
115126
+ const apiHeaders = {};
115127
+ return this.client.call("get", uri, apiHeaders, payload);
115128
+ }
115100
115129
  /**
115101
115130
  * Check the Appwrite database servers are up and connection is successful.
115102
115131
  *
@@ -121182,6 +121211,27 @@ var Projects = class {
121182
121211
  };
121183
121212
  return this.client.call("patch", uri, apiHeaders, payload);
121184
121213
  }
121214
+ updateConsoleAccess(paramsOrFirst) {
121215
+ let params;
121216
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
121217
+ params = paramsOrFirst || {};
121218
+ } else {
121219
+ params = {
121220
+ projectId: paramsOrFirst
121221
+ };
121222
+ }
121223
+ const projectId = params.projectId;
121224
+ if (typeof projectId === "undefined") {
121225
+ throw new AppwriteException('Missing required parameter: "projectId"');
121226
+ }
121227
+ const apiPath = "/projects/{projectId}/console-access".replace("{projectId}", projectId);
121228
+ const payload = {};
121229
+ const uri = new URL(this.client.config.endpoint + apiPath);
121230
+ const apiHeaders = {
121231
+ "content-type": "application/json"
121232
+ };
121233
+ return this.client.call("patch", uri, apiHeaders, payload);
121234
+ }
121185
121235
  listDevKeys(paramsOrFirst, ...rest) {
121186
121236
  let params;
121187
121237
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -122258,6 +122308,35 @@ var Projects = class {
122258
122308
  };
122259
122309
  return this.client.call("post", uri, apiHeaders, payload);
122260
122310
  }
122311
+ updateStatus(paramsOrFirst, ...rest) {
122312
+ let params;
122313
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
122314
+ params = paramsOrFirst || {};
122315
+ } else {
122316
+ params = {
122317
+ projectId: paramsOrFirst,
122318
+ status: rest[0]
122319
+ };
122320
+ }
122321
+ const projectId = params.projectId;
122322
+ const status = params.status;
122323
+ if (typeof projectId === "undefined") {
122324
+ throw new AppwriteException('Missing required parameter: "projectId"');
122325
+ }
122326
+ if (typeof status === "undefined") {
122327
+ throw new AppwriteException('Missing required parameter: "status"');
122328
+ }
122329
+ const apiPath = "/projects/{projectId}/status".replace("{projectId}", projectId);
122330
+ const payload = {};
122331
+ if (typeof status !== "undefined") {
122332
+ payload["status"] = status;
122333
+ }
122334
+ const uri = new URL(this.client.config.endpoint + apiPath);
122335
+ const apiHeaders = {
122336
+ "content-type": "application/json"
122337
+ };
122338
+ return this.client.call("patch", uri, apiHeaders, payload);
122339
+ }
122261
122340
  updateTeam(paramsOrFirst, ...rest) {
122262
122341
  let params;
122263
122342
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -123572,28 +123651,25 @@ var Sites = class {
123572
123651
  params = {
123573
123652
  siteId: paramsOrFirst,
123574
123653
  code: rest[0],
123575
- activate: rest[1],
123576
- installCommand: rest[2],
123577
- buildCommand: rest[3],
123578
- outputDirectory: rest[4]
123654
+ installCommand: rest[1],
123655
+ buildCommand: rest[2],
123656
+ outputDirectory: rest[3],
123657
+ activate: rest[4]
123579
123658
  };
123580
123659
  onProgress = rest[5];
123581
123660
  }
123582
123661
  const siteId = params.siteId;
123583
123662
  const code = params.code;
123584
- const activate = params.activate;
123585
123663
  const installCommand = params.installCommand;
123586
123664
  const buildCommand = params.buildCommand;
123587
123665
  const outputDirectory = params.outputDirectory;
123666
+ const activate = params.activate;
123588
123667
  if (typeof siteId === "undefined") {
123589
123668
  throw new AppwriteException('Missing required parameter: "siteId"');
123590
123669
  }
123591
123670
  if (typeof code === "undefined") {
123592
123671
  throw new AppwriteException('Missing required parameter: "code"');
123593
123672
  }
123594
- if (typeof activate === "undefined") {
123595
- throw new AppwriteException('Missing required parameter: "activate"');
123596
- }
123597
123673
  const apiPath = "/sites/{siteId}/deployments".replace("{siteId}", siteId);
123598
123674
  const payload = {};
123599
123675
  if (typeof installCommand !== "undefined") {
@@ -127331,7 +127407,8 @@ var TablesDB = class {
127331
127407
  tableId: rest[0],
127332
127408
  queries: rest[1],
127333
127409
  transactionId: rest[2],
127334
- total: rest[3]
127410
+ total: rest[3],
127411
+ ttl: rest[4]
127335
127412
  };
127336
127413
  }
127337
127414
  const databaseId = params.databaseId;
@@ -127339,6 +127416,7 @@ var TablesDB = class {
127339
127416
  const queries = params.queries;
127340
127417
  const transactionId = params.transactionId;
127341
127418
  const total = params.total;
127419
+ const ttl = params.ttl;
127342
127420
  if (typeof databaseId === "undefined") {
127343
127421
  throw new AppwriteException('Missing required parameter: "databaseId"');
127344
127422
  }
@@ -127356,6 +127434,9 @@ var TablesDB = class {
127356
127434
  if (typeof total !== "undefined") {
127357
127435
  payload["total"] = total;
127358
127436
  }
127437
+ if (typeof ttl !== "undefined") {
127438
+ payload["ttl"] = ttl;
127439
+ }
127359
127440
  const uri = new URL(this.client.config.endpoint + apiPath);
127360
127441
  const apiHeaders = {};
127361
127442
  return this.client.call("get", uri, apiHeaders, payload);
@@ -131622,20 +131703,69 @@ var SmtpEncryption;
131622
131703
  SmtpEncryption2["Ssl"] = "ssl";
131623
131704
  SmtpEncryption2["Tls"] = "tls";
131624
131705
  })(SmtpEncryption || (SmtpEncryption = {}));
131625
- var Resources;
131626
- (function(Resources2) {
131627
- Resources2["User"] = "user";
131628
- Resources2["Database"] = "database";
131629
- Resources2["Table"] = "table";
131630
- Resources2["Column"] = "column";
131631
- Resources2["Index"] = "index";
131632
- Resources2["Row"] = "row";
131633
- Resources2["Document"] = "document";
131634
- Resources2["Attribute"] = "attribute";
131635
- Resources2["Collection"] = "collection";
131636
- Resources2["Bucket"] = "bucket";
131637
- Resources2["File"] = "file";
131638
- })(Resources || (Resources = {}));
131706
+ var AppwriteMigrationResource;
131707
+ (function(AppwriteMigrationResource2) {
131708
+ AppwriteMigrationResource2["User"] = "user";
131709
+ AppwriteMigrationResource2["Team"] = "team";
131710
+ AppwriteMigrationResource2["Membership"] = "membership";
131711
+ AppwriteMigrationResource2["Database"] = "database";
131712
+ AppwriteMigrationResource2["Table"] = "table";
131713
+ AppwriteMigrationResource2["Column"] = "column";
131714
+ AppwriteMigrationResource2["Index"] = "index";
131715
+ AppwriteMigrationResource2["Row"] = "row";
131716
+ AppwriteMigrationResource2["Document"] = "document";
131717
+ AppwriteMigrationResource2["Attribute"] = "attribute";
131718
+ AppwriteMigrationResource2["Collection"] = "collection";
131719
+ AppwriteMigrationResource2["Bucket"] = "bucket";
131720
+ AppwriteMigrationResource2["File"] = "file";
131721
+ AppwriteMigrationResource2["Function"] = "function";
131722
+ AppwriteMigrationResource2["Deployment"] = "deployment";
131723
+ AppwriteMigrationResource2["Environmentvariable"] = "environment-variable";
131724
+ AppwriteMigrationResource2["Site"] = "site";
131725
+ AppwriteMigrationResource2["Sitedeployment"] = "site-deployment";
131726
+ AppwriteMigrationResource2["Sitevariable"] = "site-variable";
131727
+ })(AppwriteMigrationResource || (AppwriteMigrationResource = {}));
131728
+ var FirebaseMigrationResource;
131729
+ (function(FirebaseMigrationResource2) {
131730
+ FirebaseMigrationResource2["User"] = "user";
131731
+ FirebaseMigrationResource2["Database"] = "database";
131732
+ FirebaseMigrationResource2["Table"] = "table";
131733
+ FirebaseMigrationResource2["Column"] = "column";
131734
+ FirebaseMigrationResource2["Row"] = "row";
131735
+ FirebaseMigrationResource2["Document"] = "document";
131736
+ FirebaseMigrationResource2["Attribute"] = "attribute";
131737
+ FirebaseMigrationResource2["Collection"] = "collection";
131738
+ FirebaseMigrationResource2["Bucket"] = "bucket";
131739
+ FirebaseMigrationResource2["File"] = "file";
131740
+ })(FirebaseMigrationResource || (FirebaseMigrationResource = {}));
131741
+ var NHostMigrationResource;
131742
+ (function(NHostMigrationResource2) {
131743
+ NHostMigrationResource2["User"] = "user";
131744
+ NHostMigrationResource2["Database"] = "database";
131745
+ NHostMigrationResource2["Table"] = "table";
131746
+ NHostMigrationResource2["Column"] = "column";
131747
+ NHostMigrationResource2["Index"] = "index";
131748
+ NHostMigrationResource2["Row"] = "row";
131749
+ NHostMigrationResource2["Document"] = "document";
131750
+ NHostMigrationResource2["Attribute"] = "attribute";
131751
+ NHostMigrationResource2["Collection"] = "collection";
131752
+ NHostMigrationResource2["Bucket"] = "bucket";
131753
+ NHostMigrationResource2["File"] = "file";
131754
+ })(NHostMigrationResource || (NHostMigrationResource = {}));
131755
+ var SupabaseMigrationResource;
131756
+ (function(SupabaseMigrationResource2) {
131757
+ SupabaseMigrationResource2["User"] = "user";
131758
+ SupabaseMigrationResource2["Database"] = "database";
131759
+ SupabaseMigrationResource2["Table"] = "table";
131760
+ SupabaseMigrationResource2["Column"] = "column";
131761
+ SupabaseMigrationResource2["Index"] = "index";
131762
+ SupabaseMigrationResource2["Row"] = "row";
131763
+ SupabaseMigrationResource2["Document"] = "document";
131764
+ SupabaseMigrationResource2["Attribute"] = "attribute";
131765
+ SupabaseMigrationResource2["Collection"] = "collection";
131766
+ SupabaseMigrationResource2["Bucket"] = "bucket";
131767
+ SupabaseMigrationResource2["File"] = "file";
131768
+ })(SupabaseMigrationResource || (SupabaseMigrationResource = {}));
131639
131769
  var ProjectUsageRange;
131640
131770
  (function(ProjectUsageRange2) {
131641
131771
  ProjectUsageRange2["OneHour"] = "1h";
@@ -131712,6 +131842,10 @@ var SMTPSecure;
131712
131842
  SMTPSecure2["Tls"] = "tls";
131713
131843
  SMTPSecure2["Ssl"] = "ssl";
131714
131844
  })(SMTPSecure || (SMTPSecure = {}));
131845
+ var Status;
131846
+ (function(Status2) {
131847
+ Status2["Active"] = "active";
131848
+ })(Status || (Status = {}));
131715
131849
  var EmailTemplateType;
131716
131850
  (function(EmailTemplateType2) {
131717
131851
  EmailTemplateType2["Verification"] = "verification";
@@ -132271,6 +132405,17 @@ var BillingPlanGroup;
132271
132405
  BillingPlanGroup2["Pro"] = "pro";
132272
132406
  BillingPlanGroup2["Scale"] = "scale";
132273
132407
  })(BillingPlanGroup || (BillingPlanGroup = {}));
132408
+ var DomainTransferStatusStatus;
132409
+ (function(DomainTransferStatusStatus2) {
132410
+ DomainTransferStatusStatus2["Transferrable"] = "transferrable";
132411
+ DomainTransferStatusStatus2["NotTransferrable"] = "not_transferrable";
132412
+ DomainTransferStatusStatus2["PendingOwner"] = "pending_owner";
132413
+ DomainTransferStatusStatus2["PendingAdmin"] = "pending_admin";
132414
+ DomainTransferStatusStatus2["PendingRegistry"] = "pending_registry";
132415
+ DomainTransferStatusStatus2["Completed"] = "completed";
132416
+ DomainTransferStatusStatus2["Cancelled"] = "cancelled";
132417
+ DomainTransferStatusStatus2["ServiceUnavailable"] = "service_unavailable";
132418
+ })(DomainTransferStatusStatus || (DomainTransferStatusStatus = {}));
132274
132419
 
132275
132420
  // lib/parser.ts
132276
132421
  var { description } = package_default;
@@ -142129,12 +142274,11 @@ ${supportsServerSide ? ` create: (databaseId: string, name: string, options?: {
142129
142274
  delete: <D extends DatabaseId>(databaseId: D) => Promise<void>;` : ""}
142130
142275
  };`;
142131
142276
  }
142132
- generateTypesFile(config2) {
142277
+ generateTypesFile(config2, appwriteDep) {
142133
142278
  const entities = config2.tables?.length ? config2.tables : config2.collections;
142134
142279
  if (!entities || entities.length === 0) {
142135
142280
  return "// No tables or collections found in configuration\n";
142136
142281
  }
142137
- const appwriteDep = getAppwriteDependency();
142138
142282
  const enums = this.generateEnums(entities);
142139
142283
  const types2 = entities.map((entity) => this.generateTableType(entity, entities)).join("\n\n");
142140
142284
  const entitiesByDb = this.groupEntitiesByDb(entities);
@@ -142222,13 +142366,12 @@ ${supportsServerSide ? ` create: (databaseId: string, name: string, options?: {
142222
142366
  delete (api as Record<string, unknown>).deleteMany;
142223
142367
  }`;
142224
142368
  }
142225
- generateDatabasesFile(config2, importExt) {
142369
+ generateDatabasesFile(config2, importExt, appwriteDep) {
142226
142370
  const entities = config2.tables?.length ? config2.tables : config2.collections;
142227
142371
  if (!entities || entities.length === 0) {
142228
142372
  return "// No tables or collections found in configuration\n";
142229
142373
  }
142230
142374
  const entitiesByDb = this.groupEntitiesByDb(entities);
142231
- const appwriteDep = getAppwriteDependency();
142232
142375
  const supportsServerSide = supportsServerSideMethods(
142233
142376
  appwriteDep,
142234
142377
  this.serverSideOverride
@@ -142251,8 +142394,7 @@ ${supportsServerSide ? ` create: (databaseId: string, name: string, options?: {
142251
142394
  importExt
142252
142395
  });
142253
142396
  }
142254
- generateConstantsFile(config2) {
142255
- const appwriteDep = getAppwriteDependency();
142397
+ generateConstantsFile(config2, appwriteDep) {
142256
142398
  const supportsServerSide = supportsServerSideMethods(
142257
142399
  appwriteDep,
142258
142400
  this.serverSideOverride
@@ -142264,11 +142406,12 @@ ${supportsServerSide ? ` create: (databaseId: string, name: string, options?: {
142264
142406
  requiresApiKey: supportsServerSide
142265
142407
  });
142266
142408
  }
142267
- async generate(config2) {
142409
+ async generate(config2, options) {
142268
142410
  if (!config2.projectId) {
142269
142411
  throw new Error("Project ID is required in configuration");
142270
142412
  }
142271
- const importExt = detectImportExtension();
142413
+ const appwriteDep = options?.appwriteImportSource ?? getAppwriteDependency();
142414
+ const importExt = options?.importExtension ?? detectImportExtension();
142272
142415
  const hasEntities = config2.tables && config2.tables.length > 0 || config2.collections && config2.collections.length > 0;
142273
142416
  if (!hasEntities) {
142274
142417
  console.log(
@@ -142278,14 +142421,14 @@ ${supportsServerSide ? ` create: (databaseId: string, name: string, options?: {
142278
142421
  dbContent: "// No tables or collections found in configuration\n",
142279
142422
  typesContent: "// No tables or collections found in configuration\n",
142280
142423
  indexContent: this.generateIndexFile(importExt),
142281
- constantsContent: this.generateConstantsFile(config2)
142424
+ constantsContent: this.generateConstantsFile(config2, appwriteDep)
142282
142425
  };
142283
142426
  }
142284
142427
  return {
142285
- dbContent: this.generateDatabasesFile(config2, importExt),
142286
- typesContent: this.generateTypesFile(config2),
142428
+ dbContent: this.generateDatabasesFile(config2, importExt, appwriteDep),
142429
+ typesContent: this.generateTypesFile(config2, appwriteDep),
142287
142430
  indexContent: this.generateIndexFile(importExt),
142288
- constantsContent: this.generateConstantsFile(config2)
142431
+ constantsContent: this.generateConstantsFile(config2, appwriteDep)
142289
142432
  };
142290
142433
  }
142291
142434
  };
@@ -142392,7 +142535,10 @@ Use --language to specify the target language. Supported: ${supported}`
142392
142535
  `Generating type-safe ${detectedLanguage} SDK to ${absoluteOutputDir}...`
142393
142536
  );
142394
142537
  try {
142395
- const result = await generator.generate(config2);
142538
+ const result = await generator.generate(config2, {
142539
+ appwriteImportSource: options.appwriteImportSource,
142540
+ importExtension: options.importExtension
142541
+ });
142396
142542
  await generator.writeFiles(absoluteOutputDir, result);
142397
142543
  const generatedFiles = generator.getGeneratedFilePaths(result);
142398
142544
  success2(`Generated files:`);
@@ -142404,7 +142550,7 @@ Use --language to specify the target language. Supported: ${supported}`
142404
142550
  const firstEntity = entities?.[0];
142405
142551
  const dbId = firstEntity?.databaseId ?? "databaseId";
142406
142552
  const tableName = firstEntity?.name ?? "tableName";
142407
- const importExt = detectImportExtension();
142553
+ const importExt = options.importExtension ?? detectImportExtension();
142408
142554
  console.log("");
142409
142555
  log(`Import the generated SDK in your project:`);
142410
142556
  console.log(
@@ -142441,6 +142587,12 @@ var generate = new Command("generate").description(
142441
142587
  "--server <mode>",
142442
142588
  "Override server-side generation (auto|true|false)",
142443
142589
  "auto"
142590
+ ).option(
142591
+ "--appwrite-import-source <source>",
142592
+ "Override Appwrite import source in generated files (e.g. node-appwrite, appwrite, @appwrite.io/console). Auto-detected from package.json/deno.json if not provided."
142593
+ ).option(
142594
+ "--import-extension <ext>",
142595
+ 'Override import file extension in generated files (.js for ESM, empty string for CJS). Auto-detected from package.json "type" field if not provided.'
142444
142596
  ).addHelpText(
142445
142597
  "after",
142446
142598
  `
@@ -142544,7 +142696,7 @@ account.command(`create-jwt`).description(`Use this endpoint to create a JSON We
142544
142696
  async ({ duration: duration3 }) => parse3(await (await getAccountClient()).createJWT(duration3))
142545
142697
  )
142546
142698
  );
142547
- account.command(`list-keys`).description(`Get a list of all API keys from the current account. `).option(
142699
+ account.command(`list-keys`).description(`Get a list of all API keys from the current account.`).option(
142548
142700
  `--total [value]`,
142549
142701
  `When set to false, the total count returned will be 0 and will not be calculated.`,
142550
142702
  (value) => value === void 0 ? true : parseBool(value)
@@ -143122,7 +143274,7 @@ databases.command(`list-attributes`).description(`List attributes in the collect
143122
143274
  )
143123
143275
  );
143124
143276
  databases.command(`create-boolean-attribute`).description(`Create a boolean attribute.
143125
- `).requiredOption(`--database-id <database-id>`, `Database ID.`).requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`).requiredOption(`--key <key>`, `Attribute Key.`).requiredOption(`--required <required>`, `Is attribute required?`, parseBool).option(
143277
+ `).requiredOption(`--database-id <database-id>`, `Database ID.`).requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`).requiredOption(`--key <key>`, `Attribute Key.`).requiredOption(`--required <required>`, `Is attribute required?`, parseBool).option(
143126
143278
  `--xdefault [value]`,
143127
143279
  `Default value for attribute when not provided. Cannot be set when attribute is required.`,
143128
143280
  (value) => value === void 0 ? true : parseBool(value)
@@ -143314,6 +143466,12 @@ databases.command(`create-relationship-attribute`).description(`Create relations
143314
143466
  async ({ databaseId, collectionId, relatedCollectionId, type, twoWay, key, twoWayKey, onDelete }) => parse3(await (await getDatabasesClient()).createRelationshipAttribute(databaseId, collectionId, relatedCollectionId, type, twoWay, key, twoWayKey, onDelete))
143315
143467
  )
143316
143468
  );
143469
+ databases.command(`update-relationship-attribute`).description(`Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
143470
+ `).requiredOption(`--database-id <database-id>`, `Database ID.`).requiredOption(`--collection-id <collection-id>`, `Collection ID.`).requiredOption(`--key <key>`, `Attribute Key.`).option(`--on-delete <on-delete>`, `Constraints option`).option(`--new-key <new-key>`, `New Attribute Key.`).action(
143471
+ actionRunner(
143472
+ async ({ databaseId, collectionId, key, onDelete, newKey }) => parse3(await (await getDatabasesClient()).updateRelationshipAttribute(databaseId, collectionId, key, onDelete, newKey))
143473
+ )
143474
+ );
143317
143475
  databases.command(`create-string-attribute`).description(`Create a string attribute.
143318
143476
  `).requiredOption(`--database-id <database-id>`, `Database ID.`).requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`).requiredOption(`--key <key>`, `Attribute Key.`).requiredOption(`--size <size>`, `Attribute size for text attributes, in number of characters.`, parseInteger).requiredOption(`--required <required>`, `Is attribute required?`, parseBool).option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`).option(
143319
143477
  `--array [value]`,
@@ -143400,19 +143558,13 @@ databases.command(`delete-attribute`).description(`Deletes an attribute.`).requi
143400
143558
  async ({ databaseId, collectionId, key }) => parse3(await (await getDatabasesClient()).deleteAttribute(databaseId, collectionId, key))
143401
143559
  )
143402
143560
  );
143403
- databases.command(`update-relationship-attribute`).description(`Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
143404
- `).requiredOption(`--database-id <database-id>`, `Database ID.`).requiredOption(`--collection-id <collection-id>`, `Collection ID.`).requiredOption(`--key <key>`, `Attribute Key.`).option(`--on-delete <on-delete>`, `Constraints option`).option(`--new-key <new-key>`, `New Attribute Key.`).action(
143405
- actionRunner(
143406
- async ({ databaseId, collectionId, key, onDelete, newKey }) => parse3(await (await getDatabasesClient()).updateRelationshipAttribute(databaseId, collectionId, key, onDelete, newKey))
143407
- )
143408
- );
143409
143561
  databases.command(`list-documents`).description(`Get a list of all the user's documents in a given collection. You can use the query params to filter your results.`).requiredOption(`--database-id <database-id>`, `Database ID.`).requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`).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.`).option(`--transaction-id <transaction-id>`, `Transaction ID to read uncommitted changes within the transaction.`).option(
143410
143562
  `--total [value]`,
143411
143563
  `When set to false, the total count returned will be 0 and will not be calculated.`,
143412
143564
  (value) => value === void 0 ? true : parseBool(value)
143413
- ).action(
143565
+ ).option(`--ttl <ttl>`, `TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).`, parseInteger).action(
143414
143566
  actionRunner(
143415
- async ({ databaseId, collectionId, queries, transactionId, total }) => parse3(await (await getDatabasesClient()).listDocuments(databaseId, collectionId, queries, transactionId, total))
143567
+ async ({ databaseId, collectionId, queries, transactionId, total, ttl }) => parse3(await (await getDatabasesClient()).listDocuments(databaseId, collectionId, queries, transactionId, total, ttl))
143416
143568
  )
143417
143569
  );
143418
143570
  databases.command(`create-document`).description(`Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.`).requiredOption(`--database-id <database-id>`, `Database ID.`).requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.`).requiredOption(`--document-id <document-id>`, `Document 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(`--data <data>`, `Document data as JSON object.`).option(`--permissions [permissions...]`, `An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).`).option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`).action(
@@ -143815,6 +143967,12 @@ health.command(`get-certificate`).description(`Get the SSL certificate for a dom
143815
143967
  async ({ domain: domain2 }) => parse3(await (await getHealthClient()).getCertificate(domain2))
143816
143968
  )
143817
143969
  );
143970
+ health.command(`get-console-pausing`).description(`Get console pausing health status. Monitors projects approaching the pause threshold to detect potential issues with console access tracking.
143971
+ `).option(`--threshold <threshold>`, `Percentage threshold of projects approaching pause. When hit (equal or higher), endpoint returns server error. Default value is 10.`, parseInteger).option(`--inactivity-days <inactivity-days>`, `Number of days of inactivity before a project is paused. Should match the plan's projectInactivityDays setting. Default value is 7.`, parseInteger).action(
143972
+ actionRunner(
143973
+ async ({ threshold, inactivityDays }) => parse3(await (await getHealthClient()).getConsolePausing(threshold, inactivityDays))
143974
+ )
143975
+ );
143818
143976
  health.command(`get-db`).description(`Check the Appwrite database servers are up and connection is successful.`).action(
143819
143977
  actionRunner(
143820
143978
  async () => parse3(await (await getHealthClient()).getDB())
@@ -144423,7 +144581,7 @@ messaging.command(`list-topic-logs`).description(`Get the topic activity logs li
144423
144581
  async ({ topicId, queries, total }) => parse3(await (await getMessagingClient()).listTopicLogs(topicId, queries, total))
144424
144582
  )
144425
144583
  );
144426
- messaging.command(`list-subscribers`).description(`Get a list of all subscribers from the current Appwrite project.`).requiredOption(`--topic-id <topic-id>`, `Topic ID. The topic ID subscribed to.`).option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled`).option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`).option(
144584
+ messaging.command(`list-subscribers`).description(`Get a list of all subscribers from the current Appwrite project.`).requiredOption(`--topic-id <topic-id>`, `Topic ID. The topic ID subscribed to.`).option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: targetId, topicId, userId, providerType`).option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`).option(
144427
144585
  `--total [value]`,
144428
144586
  `When set to false, the total count returned will be 0 and will not be calculated.`,
144429
144587
  (value) => value === void 0 ? true : parseBool(value)
@@ -144705,6 +144863,12 @@ projects.command(`update-auth-status`).description(`Update the status of a speci
144705
144863
  async ({ projectId, method, status }) => parse3(await (await getProjectsClient()).updateAuthStatus(projectId, method, status))
144706
144864
  )
144707
144865
  );
144866
+ projects.command(`update-console-access`).description(`Record console access to a project. This endpoint updates the last accessed timestamp for the project to track console activity.
144867
+ `).requiredOption(`--project-id <project-id>`, `Project ID`).action(
144868
+ actionRunner(
144869
+ async ({ projectId }) => parse3(await (await getProjectsClient()).updateConsoleAccess(projectId))
144870
+ )
144871
+ );
144708
144872
  projects.command(`list-dev-keys`).description(`List all the project's dev keys. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.'`).requiredOption(`--project-id <project-id>`, `Project unique ID.`).option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: accessedAt, expire`).action(
144709
144873
  actionRunner(
144710
144874
  async ({ projectId, queries }) => parse3(await (await getProjectsClient()).listDevKeys(projectId, queries))
@@ -144850,6 +145014,12 @@ projects.command(`create-smtp-test`).description(`Send a test email to verify SM
144850
145014
  async ({ projectId, emails, senderName, senderEmail, host, replyTo, port, username, password, secure }) => parse3(await (await getProjectsClient()).createSmtpTest(projectId, emails, senderName, senderEmail, host, replyTo, port, username, password, secure))
144851
145015
  )
144852
145016
  );
145017
+ projects.command(`update-status`).description(`Update the status of a project. Can be used to archive/restore projects, and to restore paused projects. When restoring a paused project, the console fingerprint header must be provided and the project must not be blocked for any reason other than inactivity.
145018
+ `).requiredOption(`--project-id <project-id>`, `Project ID`).requiredOption(`--status <status>`, `New status for the project`).action(
145019
+ actionRunner(
145020
+ async ({ projectId, status }) => parse3(await (await getProjectsClient()).updateStatus(projectId, status))
145021
+ )
145022
+ );
144853
145023
  projects.command(`update-team`).description(`Update the team ID of a project allowing for it to be transferred to another team.`).requiredOption(`--project-id <project-id>`, `Project unique ID.`).requiredOption(`--team-id <team-id>`, `Team ID of the team to transfer project to.`).action(
144854
145024
  actionRunner(
144855
145025
  async ({ projectId, teamId }) => parse3(await (await getProjectsClient()).updateTeam(projectId, teamId))
@@ -145090,9 +145260,13 @@ sites.command(`list-deployments`).description(`Get a list of all the site's code
145090
145260
  async ({ siteId, queries, search, total }) => parse3(await (await getSitesClient()).listDeployments(siteId, queries, search, total))
145091
145261
  )
145092
145262
  );
145093
- sites.command(`create-deployment`).description(`Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the site's deployment to use your new deployment ID.`).requiredOption(`--site-id <site-id>`, `Site ID.`).requiredOption(`--code <code>`, `Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.`).requiredOption(`--activate <activate>`, `Automatically activate the deployment when it is finished building.`, parseBool).option(`--install-command <install-command>`, `Install Commands.`).option(`--build-command <build-command>`, `Build Commands.`).option(`--output-directory <output-directory>`, `Output Directory.`).action(
145263
+ sites.command(`create-deployment`).description(`Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the site's deployment to use your new deployment ID.`).requiredOption(`--site-id <site-id>`, `Site ID.`).requiredOption(`--code <code>`, `Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.`).option(`--install-command <install-command>`, `Install Commands.`).option(`--build-command <build-command>`, `Build Commands.`).option(`--output-directory <output-directory>`, `Output Directory.`).option(
145264
+ `--activate [value]`,
145265
+ `Automatically activate the deployment when it is finished building.`,
145266
+ (value) => value === void 0 ? true : parseBool(value)
145267
+ ).action(
145094
145268
  actionRunner(
145095
- async ({ siteId, code, activate, installCommand, buildCommand, outputDirectory }) => parse3(await (await getSitesClient()).createDeployment(siteId, code, activate, installCommand, buildCommand, outputDirectory))
145269
+ async ({ siteId, code, installCommand, buildCommand, outputDirectory, activate }) => parse3(await (await getSitesClient()).createDeployment(siteId, code, installCommand, buildCommand, outputDirectory, activate))
145096
145270
  )
145097
145271
  );
145098
145272
  sites.command(`create-duplicate-deployment`).description(`Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.`).requiredOption(`--site-id <site-id>`, `Site ID.`).requiredOption(`--deployment-id <deployment-id>`, `Deployment ID.`).action(
@@ -145835,9 +146009,9 @@ tablesDB.command(`list-rows`).description(`Get a list of all the user's rows in
145835
146009
  `--total [value]`,
145836
146010
  `When set to false, the total count returned will be 0 and will not be calculated.`,
145837
146011
  (value) => value === void 0 ? true : parseBool(value)
145838
- ).action(
146012
+ ).option(`--ttl <ttl>`, `TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours).`, parseInteger).action(
145839
146013
  actionRunner(
145840
- async ({ databaseId, tableId, queries, transactionId, total }) => parse3(await (await getTablesDBClient()).listRows(databaseId, tableId, queries, transactionId, total))
146014
+ async ({ databaseId, tableId, queries, transactionId, total, ttl }) => parse3(await (await getTablesDBClient()).listRows(databaseId, tableId, queries, transactionId, total, ttl))
145841
146015
  )
145842
146016
  );
145843
146017
  tablesDB.command(`create-row`).description(`Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console.`).requiredOption(`--database-id <database-id>`, `Database ID.`).requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). Make sure to define columns before creating rows.`).requiredOption(`--row-id <row-id>`, `Row 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(`--data <data>`, `Row data as JSON object.`).option(`--permissions [permissions...]`, `An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).`).option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`).action(
@@ -145978,7 +146152,7 @@ You only need to provide one of a user ID, email, or phone number. Appwrite will
145978
146152
  Use the \`url\` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.
145979
146153
 
145980
146154
  Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.
145981
- `).requiredOption(`--team-id <team-id>`, `Team ID.`).requiredOption(`--roles [roles...]`, `Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.`).option(`--email <email>`, `Email of the new team member.`).option(`--user-id <user-id>`, `ID of the user to be added to a team.`).option(`--phone <phone>`, `Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`).option(`--url <url>`, `URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. Only URLs from hostnames in your project 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(`--name <name>`, `Name of the new team member. Max length: 128 chars.`).action(
146155
+ `).requiredOption(`--team-id <team-id>`, `Team ID.`).requiredOption(`--roles [roles...]`, `Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 81 characters long.`).option(`--email <email>`, `Email of the new team member.`).option(`--user-id <user-id>`, `ID of the user to be added to a team.`).option(`--phone <phone>`, `Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`).option(`--url <url>`, `URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. Only URLs from hostnames in your project 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(`--name <name>`, `Name of the new team member. Max length: 128 chars.`).action(
145982
146156
  actionRunner(
145983
146157
  async ({ teamId, roles, email: email3, userId, phone, url: url2, name }) => parse3(await (await getTeamsClient()).createMembership(teamId, roles, email3, userId, phone, url2, name))
145984
146158
  )
@@ -145989,7 +146163,7 @@ teams.command(`get-membership`).description(`Get a team member by the membership
145989
146163
  )
145990
146164
  );
145991
146165
  teams.command(`update-membership`).description(`Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https://appwrite.io/docs/permissions).
145992
- `).requiredOption(`--team-id <team-id>`, `Team ID.`).requiredOption(`--membership-id <membership-id>`, `Membership ID.`).requiredOption(`--roles [roles...]`, `An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.`).action(
146166
+ `).requiredOption(`--team-id <team-id>`, `Team ID.`).requiredOption(`--membership-id <membership-id>`, `Membership ID.`).requiredOption(`--roles [roles...]`, `An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 81 characters long.`).action(
145993
146167
  actionRunner(
145994
146168
  async ({ teamId, membershipId, roles }) => parse3(await (await getTeamsClient()).updateMembership(teamId, membershipId, roles))
145995
146169
  )