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
package/dist/index.js CHANGED
@@ -69357,7 +69357,7 @@ var id_default = ID;
69357
69357
  // lib/constants.ts
69358
69358
  var SDK_TITLE = "Appwrite";
69359
69359
  var SDK_TITLE_LOWER = "appwrite";
69360
- var SDK_VERSION = "13.6.1";
69360
+ var SDK_VERSION = "14.0.0";
69361
69361
  var SDK_LOGO = "\n _ _ _ ___ __ _____\n /_\\ _ __ _ ____ ___ __(_) |_ ___ / __\\ / / \\_ \\\n //_\\\\| '_ \\| '_ \\ \\ /\\ / / '__| | __/ _ \\ / / / / / /\\/\n / _ \\ |_) | |_) \\ V V /| | | | || __/ / /___/ /___/\\/ /_\n \\_/ \\_/ .__/| .__/ \\_/\\_/ |_| |_|\\__\\___| \\____/\\____/\\____/\n |_| |_|\n\n";
69362
69362
  var EXECUTABLE_NAME = "appwrite";
69363
69363
  var NPM_PACKAGE_NAME = "appwrite-cli";
@@ -84938,7 +84938,7 @@ var Client = class _Client {
84938
84938
  "x-sdk-name": "Console",
84939
84939
  "x-sdk-platform": "console",
84940
84940
  "x-sdk-language": "web",
84941
- "x-sdk-version": "3.1.0",
84941
+ "x-sdk-version": "4.0.0",
84942
84942
  "X-Appwrite-Response-Format": "1.8.0"
84943
84943
  };
84944
84944
  this.realtime = {
@@ -87676,6 +87676,47 @@ var Databases = class {
87676
87676
  };
87677
87677
  return this.client.call("post", uri, apiHeaders, payload);
87678
87678
  }
87679
+ updateRelationshipAttribute(paramsOrFirst, ...rest) {
87680
+ let params;
87681
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
87682
+ params = paramsOrFirst || {};
87683
+ } else {
87684
+ params = {
87685
+ databaseId: paramsOrFirst,
87686
+ collectionId: rest[0],
87687
+ key: rest[1],
87688
+ onDelete: rest[2],
87689
+ newKey: rest[3]
87690
+ };
87691
+ }
87692
+ const databaseId = params.databaseId;
87693
+ const collectionId = params.collectionId;
87694
+ const key = params.key;
87695
+ const onDelete = params.onDelete;
87696
+ const newKey = params.newKey;
87697
+ if (typeof databaseId === "undefined") {
87698
+ throw new AppwriteException('Missing required parameter: "databaseId"');
87699
+ }
87700
+ if (typeof collectionId === "undefined") {
87701
+ throw new AppwriteException('Missing required parameter: "collectionId"');
87702
+ }
87703
+ if (typeof key === "undefined") {
87704
+ throw new AppwriteException('Missing required parameter: "key"');
87705
+ }
87706
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/relationship/{key}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{key}", key);
87707
+ const payload = {};
87708
+ if (typeof onDelete !== "undefined") {
87709
+ payload["onDelete"] = onDelete;
87710
+ }
87711
+ if (typeof newKey !== "undefined") {
87712
+ payload["newKey"] = newKey;
87713
+ }
87714
+ const uri = new URL(this.client.config.endpoint + apiPath);
87715
+ const apiHeaders = {
87716
+ "content-type": "application/json"
87717
+ };
87718
+ return this.client.call("patch", uri, apiHeaders, payload);
87719
+ }
87679
87720
  createStringAttribute(paramsOrFirst, ...rest) {
87680
87721
  let params;
87681
87722
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -88193,47 +88234,6 @@ var Databases = class {
88193
88234
  };
88194
88235
  return this.client.call("delete", uri, apiHeaders, payload);
88195
88236
  }
88196
- updateRelationshipAttribute(paramsOrFirst, ...rest) {
88197
- let params;
88198
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
88199
- params = paramsOrFirst || {};
88200
- } else {
88201
- params = {
88202
- databaseId: paramsOrFirst,
88203
- collectionId: rest[0],
88204
- key: rest[1],
88205
- onDelete: rest[2],
88206
- newKey: rest[3]
88207
- };
88208
- }
88209
- const databaseId = params.databaseId;
88210
- const collectionId = params.collectionId;
88211
- const key = params.key;
88212
- const onDelete = params.onDelete;
88213
- const newKey = params.newKey;
88214
- if (typeof databaseId === "undefined") {
88215
- throw new AppwriteException('Missing required parameter: "databaseId"');
88216
- }
88217
- if (typeof collectionId === "undefined") {
88218
- throw new AppwriteException('Missing required parameter: "collectionId"');
88219
- }
88220
- if (typeof key === "undefined") {
88221
- throw new AppwriteException('Missing required parameter: "key"');
88222
- }
88223
- const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{key}", key);
88224
- const payload = {};
88225
- if (typeof onDelete !== "undefined") {
88226
- payload["onDelete"] = onDelete;
88227
- }
88228
- if (typeof newKey !== "undefined") {
88229
- payload["newKey"] = newKey;
88230
- }
88231
- const uri = new URL(this.client.config.endpoint + apiPath);
88232
- const apiHeaders = {
88233
- "content-type": "application/json"
88234
- };
88235
- return this.client.call("patch", uri, apiHeaders, payload);
88236
- }
88237
88237
  listDocuments(paramsOrFirst, ...rest) {
88238
88238
  let params;
88239
88239
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -88244,7 +88244,8 @@ var Databases = class {
88244
88244
  collectionId: rest[0],
88245
88245
  queries: rest[1],
88246
88246
  transactionId: rest[2],
88247
- total: rest[3]
88247
+ total: rest[3],
88248
+ ttl: rest[4]
88248
88249
  };
88249
88250
  }
88250
88251
  const databaseId = params.databaseId;
@@ -88252,6 +88253,7 @@ var Databases = class {
88252
88253
  const queries = params.queries;
88253
88254
  const transactionId = params.transactionId;
88254
88255
  const total = params.total;
88256
+ const ttl = params.ttl;
88255
88257
  if (typeof databaseId === "undefined") {
88256
88258
  throw new AppwriteException('Missing required parameter: "databaseId"');
88257
88259
  }
@@ -88269,6 +88271,9 @@ var Databases = class {
88269
88271
  if (typeof total !== "undefined") {
88270
88272
  payload["total"] = total;
88271
88273
  }
88274
+ if (typeof ttl !== "undefined") {
88275
+ payload["ttl"] = ttl;
88276
+ }
88272
88277
  const uri = new URL(this.client.config.endpoint + apiPath);
88273
88278
  const apiHeaders = {};
88274
88279
  return this.client.call("get", uri, apiHeaders, payload);
@@ -94834,6 +94839,27 @@ var Projects = class {
94834
94839
  };
94835
94840
  return this.client.call("patch", uri, apiHeaders, payload);
94836
94841
  }
94842
+ updateConsoleAccess(paramsOrFirst) {
94843
+ let params;
94844
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
94845
+ params = paramsOrFirst || {};
94846
+ } else {
94847
+ params = {
94848
+ projectId: paramsOrFirst
94849
+ };
94850
+ }
94851
+ const projectId = params.projectId;
94852
+ if (typeof projectId === "undefined") {
94853
+ throw new AppwriteException('Missing required parameter: "projectId"');
94854
+ }
94855
+ const apiPath = "/projects/{projectId}/console-access".replace("{projectId}", projectId);
94856
+ const payload = {};
94857
+ const uri = new URL(this.client.config.endpoint + apiPath);
94858
+ const apiHeaders = {
94859
+ "content-type": "application/json"
94860
+ };
94861
+ return this.client.call("patch", uri, apiHeaders, payload);
94862
+ }
94837
94863
  listDevKeys(paramsOrFirst, ...rest) {
94838
94864
  let params;
94839
94865
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -95910,6 +95936,35 @@ var Projects = class {
95910
95936
  };
95911
95937
  return this.client.call("post", uri, apiHeaders, payload);
95912
95938
  }
95939
+ updateStatus(paramsOrFirst, ...rest) {
95940
+ let params;
95941
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
95942
+ params = paramsOrFirst || {};
95943
+ } else {
95944
+ params = {
95945
+ projectId: paramsOrFirst,
95946
+ status: rest[0]
95947
+ };
95948
+ }
95949
+ const projectId = params.projectId;
95950
+ const status = params.status;
95951
+ if (typeof projectId === "undefined") {
95952
+ throw new AppwriteException('Missing required parameter: "projectId"');
95953
+ }
95954
+ if (typeof status === "undefined") {
95955
+ throw new AppwriteException('Missing required parameter: "status"');
95956
+ }
95957
+ const apiPath = "/projects/{projectId}/status".replace("{projectId}", projectId);
95958
+ const payload = {};
95959
+ if (typeof status !== "undefined") {
95960
+ payload["status"] = status;
95961
+ }
95962
+ const uri = new URL(this.client.config.endpoint + apiPath);
95963
+ const apiHeaders = {
95964
+ "content-type": "application/json"
95965
+ };
95966
+ return this.client.call("patch", uri, apiHeaders, payload);
95967
+ }
95913
95968
  updateTeam(paramsOrFirst, ...rest) {
95914
95969
  let params;
95915
95970
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -97224,28 +97279,25 @@ var Sites = class {
97224
97279
  params = {
97225
97280
  siteId: paramsOrFirst,
97226
97281
  code: rest[0],
97227
- activate: rest[1],
97228
- installCommand: rest[2],
97229
- buildCommand: rest[3],
97230
- outputDirectory: rest[4]
97282
+ installCommand: rest[1],
97283
+ buildCommand: rest[2],
97284
+ outputDirectory: rest[3],
97285
+ activate: rest[4]
97231
97286
  };
97232
97287
  onProgress = rest[5];
97233
97288
  }
97234
97289
  const siteId = params.siteId;
97235
97290
  const code = params.code;
97236
- const activate = params.activate;
97237
97291
  const installCommand = params.installCommand;
97238
97292
  const buildCommand = params.buildCommand;
97239
97293
  const outputDirectory = params.outputDirectory;
97294
+ const activate = params.activate;
97240
97295
  if (typeof siteId === "undefined") {
97241
97296
  throw new AppwriteException('Missing required parameter: "siteId"');
97242
97297
  }
97243
97298
  if (typeof code === "undefined") {
97244
97299
  throw new AppwriteException('Missing required parameter: "code"');
97245
97300
  }
97246
- if (typeof activate === "undefined") {
97247
- throw new AppwriteException('Missing required parameter: "activate"');
97248
- }
97249
97301
  const apiPath = "/sites/{siteId}/deployments".replace("{siteId}", siteId);
97250
97302
  const payload = {};
97251
97303
  if (typeof installCommand !== "undefined") {
@@ -100983,7 +101035,8 @@ var TablesDB = class {
100983
101035
  tableId: rest[0],
100984
101036
  queries: rest[1],
100985
101037
  transactionId: rest[2],
100986
- total: rest[3]
101038
+ total: rest[3],
101039
+ ttl: rest[4]
100987
101040
  };
100988
101041
  }
100989
101042
  const databaseId = params.databaseId;
@@ -100991,6 +101044,7 @@ var TablesDB = class {
100991
101044
  const queries = params.queries;
100992
101045
  const transactionId = params.transactionId;
100993
101046
  const total = params.total;
101047
+ const ttl = params.ttl;
100994
101048
  if (typeof databaseId === "undefined") {
100995
101049
  throw new AppwriteException('Missing required parameter: "databaseId"');
100996
101050
  }
@@ -101008,6 +101062,9 @@ var TablesDB = class {
101008
101062
  if (typeof total !== "undefined") {
101009
101063
  payload["total"] = total;
101010
101064
  }
101065
+ if (typeof ttl !== "undefined") {
101066
+ payload["ttl"] = ttl;
101067
+ }
101011
101068
  const uri = new URL(this.client.config.endpoint + apiPath);
101012
101069
  const apiHeaders = {};
101013
101070
  return this.client.call("get", uri, apiHeaders, payload);
@@ -103319,20 +103376,69 @@ var SmtpEncryption;
103319
103376
  SmtpEncryption2["Ssl"] = "ssl";
103320
103377
  SmtpEncryption2["Tls"] = "tls";
103321
103378
  })(SmtpEncryption || (SmtpEncryption = {}));
103322
- var Resources;
103323
- (function(Resources2) {
103324
- Resources2["User"] = "user";
103325
- Resources2["Database"] = "database";
103326
- Resources2["Table"] = "table";
103327
- Resources2["Column"] = "column";
103328
- Resources2["Index"] = "index";
103329
- Resources2["Row"] = "row";
103330
- Resources2["Document"] = "document";
103331
- Resources2["Attribute"] = "attribute";
103332
- Resources2["Collection"] = "collection";
103333
- Resources2["Bucket"] = "bucket";
103334
- Resources2["File"] = "file";
103335
- })(Resources || (Resources = {}));
103379
+ var AppwriteMigrationResource;
103380
+ (function(AppwriteMigrationResource2) {
103381
+ AppwriteMigrationResource2["User"] = "user";
103382
+ AppwriteMigrationResource2["Team"] = "team";
103383
+ AppwriteMigrationResource2["Membership"] = "membership";
103384
+ AppwriteMigrationResource2["Database"] = "database";
103385
+ AppwriteMigrationResource2["Table"] = "table";
103386
+ AppwriteMigrationResource2["Column"] = "column";
103387
+ AppwriteMigrationResource2["Index"] = "index";
103388
+ AppwriteMigrationResource2["Row"] = "row";
103389
+ AppwriteMigrationResource2["Document"] = "document";
103390
+ AppwriteMigrationResource2["Attribute"] = "attribute";
103391
+ AppwriteMigrationResource2["Collection"] = "collection";
103392
+ AppwriteMigrationResource2["Bucket"] = "bucket";
103393
+ AppwriteMigrationResource2["File"] = "file";
103394
+ AppwriteMigrationResource2["Function"] = "function";
103395
+ AppwriteMigrationResource2["Deployment"] = "deployment";
103396
+ AppwriteMigrationResource2["Environmentvariable"] = "environment-variable";
103397
+ AppwriteMigrationResource2["Site"] = "site";
103398
+ AppwriteMigrationResource2["Sitedeployment"] = "site-deployment";
103399
+ AppwriteMigrationResource2["Sitevariable"] = "site-variable";
103400
+ })(AppwriteMigrationResource || (AppwriteMigrationResource = {}));
103401
+ var FirebaseMigrationResource;
103402
+ (function(FirebaseMigrationResource2) {
103403
+ FirebaseMigrationResource2["User"] = "user";
103404
+ FirebaseMigrationResource2["Database"] = "database";
103405
+ FirebaseMigrationResource2["Table"] = "table";
103406
+ FirebaseMigrationResource2["Column"] = "column";
103407
+ FirebaseMigrationResource2["Row"] = "row";
103408
+ FirebaseMigrationResource2["Document"] = "document";
103409
+ FirebaseMigrationResource2["Attribute"] = "attribute";
103410
+ FirebaseMigrationResource2["Collection"] = "collection";
103411
+ FirebaseMigrationResource2["Bucket"] = "bucket";
103412
+ FirebaseMigrationResource2["File"] = "file";
103413
+ })(FirebaseMigrationResource || (FirebaseMigrationResource = {}));
103414
+ var NHostMigrationResource;
103415
+ (function(NHostMigrationResource2) {
103416
+ NHostMigrationResource2["User"] = "user";
103417
+ NHostMigrationResource2["Database"] = "database";
103418
+ NHostMigrationResource2["Table"] = "table";
103419
+ NHostMigrationResource2["Column"] = "column";
103420
+ NHostMigrationResource2["Index"] = "index";
103421
+ NHostMigrationResource2["Row"] = "row";
103422
+ NHostMigrationResource2["Document"] = "document";
103423
+ NHostMigrationResource2["Attribute"] = "attribute";
103424
+ NHostMigrationResource2["Collection"] = "collection";
103425
+ NHostMigrationResource2["Bucket"] = "bucket";
103426
+ NHostMigrationResource2["File"] = "file";
103427
+ })(NHostMigrationResource || (NHostMigrationResource = {}));
103428
+ var SupabaseMigrationResource;
103429
+ (function(SupabaseMigrationResource2) {
103430
+ SupabaseMigrationResource2["User"] = "user";
103431
+ SupabaseMigrationResource2["Database"] = "database";
103432
+ SupabaseMigrationResource2["Table"] = "table";
103433
+ SupabaseMigrationResource2["Column"] = "column";
103434
+ SupabaseMigrationResource2["Index"] = "index";
103435
+ SupabaseMigrationResource2["Row"] = "row";
103436
+ SupabaseMigrationResource2["Document"] = "document";
103437
+ SupabaseMigrationResource2["Attribute"] = "attribute";
103438
+ SupabaseMigrationResource2["Collection"] = "collection";
103439
+ SupabaseMigrationResource2["Bucket"] = "bucket";
103440
+ SupabaseMigrationResource2["File"] = "file";
103441
+ })(SupabaseMigrationResource || (SupabaseMigrationResource = {}));
103336
103442
  var ProjectUsageRange;
103337
103443
  (function(ProjectUsageRange2) {
103338
103444
  ProjectUsageRange2["OneHour"] = "1h";
@@ -103409,6 +103515,10 @@ var SMTPSecure;
103409
103515
  SMTPSecure2["Tls"] = "tls";
103410
103516
  SMTPSecure2["Ssl"] = "ssl";
103411
103517
  })(SMTPSecure || (SMTPSecure = {}));
103518
+ var Status;
103519
+ (function(Status2) {
103520
+ Status2["Active"] = "active";
103521
+ })(Status || (Status = {}));
103412
103522
  var EmailTemplateType;
103413
103523
  (function(EmailTemplateType2) {
103414
103524
  EmailTemplateType2["Verification"] = "verification";
@@ -103968,6 +104078,17 @@ var BillingPlanGroup;
103968
104078
  BillingPlanGroup2["Pro"] = "pro";
103969
104079
  BillingPlanGroup2["Scale"] = "scale";
103970
104080
  })(BillingPlanGroup || (BillingPlanGroup = {}));
104081
+ var DomainTransferStatusStatus;
104082
+ (function(DomainTransferStatusStatus2) {
104083
+ DomainTransferStatusStatus2["Transferrable"] = "transferrable";
104084
+ DomainTransferStatusStatus2["NotTransferrable"] = "not_transferrable";
104085
+ DomainTransferStatusStatus2["PendingOwner"] = "pending_owner";
104086
+ DomainTransferStatusStatus2["PendingAdmin"] = "pending_admin";
104087
+ DomainTransferStatusStatus2["PendingRegistry"] = "pending_registry";
104088
+ DomainTransferStatusStatus2["Completed"] = "completed";
104089
+ DomainTransferStatusStatus2["Cancelled"] = "cancelled";
104090
+ DomainTransferStatusStatus2["ServiceUnavailable"] = "service_unavailable";
104091
+ })(DomainTransferStatusStatus || (DomainTransferStatusStatus = {}));
103971
104092
 
103972
104093
  // lib/parser.ts
103973
104094
  var import_chalk2 = __toESM(require_source(), 1);
@@ -103979,7 +104100,7 @@ var package_default = {
103979
104100
  type: "module",
103980
104101
  homepage: "https://appwrite.io/support",
103981
104102
  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",
103982
- version: "13.6.1",
104103
+ version: "14.0.0",
103983
104104
  license: "BSD-3-Clause",
103984
104105
  main: "dist/index.cjs",
103985
104106
  module: "dist/index.js",
@@ -104023,7 +104144,7 @@ var package_default = {
104023
104144
  "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"
104024
104145
  },
104025
104146
  dependencies: {
104026
- "@appwrite.io/console": "^3.1.0",
104147
+ "@appwrite.io/console": "^4.0.0",
104027
104148
  chalk: "4.1.2",
104028
104149
  chokidar: "^3.6.0",
104029
104150
  "cli-progress": "^3.12.0",
@@ -109393,12 +109514,11 @@ ${supportsServerSide ? ` create: (databaseId: string, name: string, options?: {
109393
109514
  delete: <D extends DatabaseId>(databaseId: D) => Promise<void>;` : ""}
109394
109515
  };`;
109395
109516
  }
109396
- generateTypesFile(config2) {
109517
+ generateTypesFile(config2, appwriteDep) {
109397
109518
  const entities = config2.tables?.length ? config2.tables : config2.collections;
109398
109519
  if (!entities || entities.length === 0) {
109399
109520
  return "// No tables or collections found in configuration\n";
109400
109521
  }
109401
- const appwriteDep = getAppwriteDependency();
109402
109522
  const enums = this.generateEnums(entities);
109403
109523
  const types = entities.map((entity) => this.generateTableType(entity, entities)).join("\n\n");
109404
109524
  const entitiesByDb = this.groupEntitiesByDb(entities);
@@ -109486,13 +109606,12 @@ ${supportsServerSide ? ` create: (databaseId: string, name: string, options?: {
109486
109606
  delete (api as Record<string, unknown>).deleteMany;
109487
109607
  }`;
109488
109608
  }
109489
- generateDatabasesFile(config2, importExt) {
109609
+ generateDatabasesFile(config2, importExt, appwriteDep) {
109490
109610
  const entities = config2.tables?.length ? config2.tables : config2.collections;
109491
109611
  if (!entities || entities.length === 0) {
109492
109612
  return "// No tables or collections found in configuration\n";
109493
109613
  }
109494
109614
  const entitiesByDb = this.groupEntitiesByDb(entities);
109495
- const appwriteDep = getAppwriteDependency();
109496
109615
  const supportsServerSide = supportsServerSideMethods(
109497
109616
  appwriteDep,
109498
109617
  this.serverSideOverride
@@ -109515,8 +109634,7 @@ ${supportsServerSide ? ` create: (databaseId: string, name: string, options?: {
109515
109634
  importExt
109516
109635
  });
109517
109636
  }
109518
- generateConstantsFile(config2) {
109519
- const appwriteDep = getAppwriteDependency();
109637
+ generateConstantsFile(config2, appwriteDep) {
109520
109638
  const supportsServerSide = supportsServerSideMethods(
109521
109639
  appwriteDep,
109522
109640
  this.serverSideOverride
@@ -109528,11 +109646,12 @@ ${supportsServerSide ? ` create: (databaseId: string, name: string, options?: {
109528
109646
  requiresApiKey: supportsServerSide
109529
109647
  });
109530
109648
  }
109531
- async generate(config2) {
109649
+ async generate(config2, options) {
109532
109650
  if (!config2.projectId) {
109533
109651
  throw new Error("Project ID is required in configuration");
109534
109652
  }
109535
- const importExt = detectImportExtension();
109653
+ const appwriteDep = options?.appwriteImportSource ?? getAppwriteDependency();
109654
+ const importExt = options?.importExtension ?? detectImportExtension();
109536
109655
  const hasEntities = config2.tables && config2.tables.length > 0 || config2.collections && config2.collections.length > 0;
109537
109656
  if (!hasEntities) {
109538
109657
  console.log(
@@ -109542,14 +109661,14 @@ ${supportsServerSide ? ` create: (databaseId: string, name: string, options?: {
109542
109661
  dbContent: "// No tables or collections found in configuration\n",
109543
109662
  typesContent: "// No tables or collections found in configuration\n",
109544
109663
  indexContent: this.generateIndexFile(importExt),
109545
- constantsContent: this.generateConstantsFile(config2)
109664
+ constantsContent: this.generateConstantsFile(config2, appwriteDep)
109546
109665
  };
109547
109666
  }
109548
109667
  return {
109549
- dbContent: this.generateDatabasesFile(config2, importExt),
109550
- typesContent: this.generateTypesFile(config2),
109668
+ dbContent: this.generateDatabasesFile(config2, importExt, appwriteDep),
109669
+ typesContent: this.generateTypesFile(config2, appwriteDep),
109551
109670
  indexContent: this.generateIndexFile(importExt),
109552
- constantsContent: this.generateConstantsFile(config2)
109671
+ constantsContent: this.generateConstantsFile(config2, appwriteDep)
109553
109672
  };
109554
109673
  }
109555
109674
  };
@@ -4,6 +4,8 @@ export interface GenerateCommandOptions {
4
4
  output: string;
5
5
  language?: string;
6
6
  server?: ServerSideOverride;
7
+ appwriteImportSource?: string;
8
+ importExtension?: string;
7
9
  }
8
10
  export declare const generate: Command;
9
11
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../lib/commands/generate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoBpC,KAAK,kBAAkB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEpD,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B;AAoID,eAAO,MAAM,QAAQ,SAgCkB,CAAC"}
1
+ {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../lib/commands/generate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoBpC,KAAK,kBAAkB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEpD,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAuID,eAAO,MAAM,QAAQ,SAwCkB,CAAC"}
@@ -20,6 +20,23 @@ export interface GenerateResult {
20
20
  indexContent: string;
21
21
  constantsContent: string;
22
22
  }
23
+ /**
24
+ * Options for overriding auto-detected generation settings.
25
+ */
26
+ export interface GenerateOptions {
27
+ /**
28
+ * Override the Appwrite import source used in generated files.
29
+ * Auto-detected from package.json/deno.json if not provided.
30
+ * Examples: "node-appwrite", "appwrite", "@appwrite.io/console"
31
+ */
32
+ appwriteImportSource?: string;
33
+ /**
34
+ * Override the import file extension used in generated files.
35
+ * Auto-detected from package.json "type" field / deno.json if not provided.
36
+ * Use ".js" for ESM projects or "" for CJS/unknown projects.
37
+ */
38
+ importExtension?: string;
39
+ }
23
40
  /**
24
41
  * Base interface for all language-specific database generators.
25
42
  * Implement this interface to add support for new languages.
@@ -36,12 +53,13 @@ export interface IDatabasesGenerator {
36
53
  /**
37
54
  * Generate the SDK files from the configuration.
38
55
  * @param config - The project configuration containing tables/collections
56
+ * @param options - Optional overrides for auto-detected settings (e.g. import source, extension)
39
57
  * @returns Promise resolving to named file contents:
40
58
  * `dbContent` (`databases.ts`), `typesContent` (`types.ts`),
41
59
  * `indexContent` (`index.ts`), and `constantsContent` (`constants.ts`).
42
60
  * Import your generated SDK from `index.ts` (or `index.js` after transpilation).
43
61
  */
44
- generate(config: ConfigType): Promise<GenerateResult>;
62
+ generate(config: ConfigType, options?: GenerateOptions): Promise<GenerateResult>;
45
63
  /**
46
64
  * Write the generated files to disk.
47
65
  * @param outputDir - The base output directory
@@ -67,7 +85,7 @@ export interface IDatabasesGenerator {
67
85
  export declare abstract class BaseDatabasesGenerator implements IDatabasesGenerator {
68
86
  abstract readonly language: SupportedLanguage;
69
87
  abstract readonly fileExtension: string;
70
- abstract generate(config: ConfigType): Promise<GenerateResult>;
88
+ abstract generate(config: ConfigType, options?: GenerateOptions): Promise<GenerateResult>;
71
89
  writeFiles(outputDir: string, result: GenerateResult): Promise<void>;
72
90
  getGeneratedFilePaths(_result: GenerateResult): string[];
73
91
  }
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../lib/commands/generators/base.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC;AAE7C;;;;;;;;;GASG;AACH,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IAErC;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAE/B;;;;;;;OAOG;IACH,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAEtD;;;;OAIG;IACH,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAErE;;;;OAIG;IACH,qBAAqB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,EAAE,CAAC;IAExD;;;OAGG;IACH,qBAAqB,CAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;CACnE;AAED;;;GAGG;AACH,8BAAsB,sBAAuB,YAAW,mBAAmB;IACzE,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IAC9C,QAAQ,CAAC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAExC,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,cAAc,CAAC;IAExD,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IA6B1E,qBAAqB,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,EAAE;CAQzD"}
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../lib/commands/generators/base.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC;AAE7C;;;;;;;;;GASG;AACH,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IAErC;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAE/B;;;;;;;;OAQG;IACH,QAAQ,CACN,MAAM,EAAE,UAAU,EAClB,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,cAAc,CAAC,CAAC;IAE3B;;;;OAIG;IACH,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAErE;;;;OAIG;IACH,qBAAqB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,EAAE,CAAC;IAExD;;;OAGG;IACH,qBAAqB,CAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;CACnE;AAED;;;GAGG;AACH,8BAAsB,sBAAuB,YAAW,mBAAmB;IACzE,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IAC9C,QAAQ,CAAC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAExC,QAAQ,CAAC,QAAQ,CACf,MAAM,EAAE,UAAU,EAClB,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,cAAc,CAAC;IAEpB,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IA6B1E,qBAAqB,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,EAAE;CAQzD"}
@@ -1,6 +1,6 @@
1
1
  import { IDatabasesGenerator, SupportedLanguage } from "./base.js";
2
2
  import { LanguageDetectionResult } from "./language-detector.js";
3
- export { IDatabasesGenerator, SupportedLanguage, GenerateResult, } from "./base.js";
3
+ export { IDatabasesGenerator, SupportedLanguage, GenerateResult, GenerateOptions, } from "./base.js";
4
4
  export { LanguageDetector, LanguageDetectionResult, } from "./language-detector.js";
5
5
  /**
6
6
  * Create a database generator for the specified language.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../lib/commands/generators/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnE,OAAO,EAEL,uBAAuB,EACxB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,wBAAwB,CAAC;AAmBhC;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,iBAAiB,GAC1B,mBAAmB,CASrB;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG;IAC1D,SAAS,EAAE,mBAAmB,CAAC;IAC/B,SAAS,EAAE,uBAAuB,CAAC;CACpC,CAiBA;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,iBAAiB,EAAE,CAE3D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../lib/commands/generators/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnE,OAAO,EAEL,uBAAuB,EACxB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,eAAe,GAChB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,wBAAwB,CAAC;AAmBhC;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,iBAAiB,GAC1B,mBAAmB,CASrB;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG;IAC1D,SAAS,EAAE,mBAAmB,CAAC;IAC/B,SAAS,EAAE,uBAAuB,CAAC;CACpC,CAiBA;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,iBAAiB,EAAE,CAE3D"}
@@ -1,5 +1,5 @@
1
1
  import { ConfigType } from "../../config.js";
2
- import { BaseDatabasesGenerator, GenerateResult, SupportedLanguage } from "../base.js";
2
+ import { BaseDatabasesGenerator, GenerateOptions, GenerateResult, SupportedLanguage } from "../base.js";
3
3
  /**
4
4
  * TypeScript-specific database generator.
5
5
  * Generates type-safe SDK files for TypeScript/JavaScript projects.
@@ -30,6 +30,6 @@ export declare class TypeScriptDatabasesGenerator extends BaseDatabasesGenerator
30
30
  private generateDatabasesFile;
31
31
  private generateIndexFile;
32
32
  private generateConstantsFile;
33
- generate(config: ConfigType): Promise<GenerateResult>;
33
+ generate(config: ConfigType, options?: GenerateOptions): Promise<GenerateResult>;
34
34
  }
35
35
  //# sourceMappingURL=databases.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"databases.d.ts","sourceRoot":"","sources":["../../../../../lib/commands/generators/typescript/databases.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAmB,MAAM,iBAAiB,CAAC;AAI9D,OAAO,EACL,sBAAsB,EACtB,cAAc,EACd,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAiCpB;;;GAGG;AACH,qBAAa,4BAA6B,SAAQ,sBAAsB;IACtE,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAgB;IACpD,QAAQ,CAAC,aAAa,QAAQ;IAC9B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAoB;IACzC,OAAO,CAAC,kBAAkB,CAAqC;IAE/D,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI;IAIhE,OAAO,CAAC,SAAS;IAQjB;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IAM9B,OAAO,CAAC,iBAAiB;IAwCzB,OAAO,CAAC,eAAe;IA6BvB,OAAO,CAAC,aAAa;IA4BrB,OAAO,CAAC,iBAAiB;IAYzB,OAAO,CAAC,0BAA0B;IA6ElC,OAAO,CAAC,iBAAiB;IA4BzB,OAAO,CAAC,kBAAkB;IAiB1B,OAAO,CAAC,+BAA+B;IAsBvC,OAAO,CAAC,mBAAmB;IA4B3B,OAAO,CAAC,iBAAiB;IAKzB,OAAO,CAAC,mBAAmB;IAW3B,OAAO,CAAC,qBAAqB;IA2B7B,OAAO,CAAC,iBAAiB;IAQzB,OAAO,CAAC,qBAAqB;IAevB,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,cAAc,CAAC;CA8B5D"}
1
+ {"version":3,"file":"databases.d.ts","sourceRoot":"","sources":["../../../../../lib/commands/generators/typescript/databases.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAmB,MAAM,iBAAiB,CAAC;AAI9D,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,cAAc,EACd,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAiCpB;;;GAGG;AACH,qBAAa,4BAA6B,SAAQ,sBAAsB;IACtE,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAgB;IACpD,QAAQ,CAAC,aAAa,QAAQ;IAC9B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAoB;IACzC,OAAO,CAAC,kBAAkB,CAAqC;IAE/D,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI;IAIhE,OAAO,CAAC,SAAS;IAQjB;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IAM9B,OAAO,CAAC,iBAAiB;IAwCzB,OAAO,CAAC,eAAe;IA6BvB,OAAO,CAAC,aAAa;IA4BrB,OAAO,CAAC,iBAAiB;IAYzB,OAAO,CAAC,0BAA0B;IA6ElC,OAAO,CAAC,iBAAiB;IA2BzB,OAAO,CAAC,kBAAkB;IAiB1B,OAAO,CAAC,+BAA+B;IAsBvC,OAAO,CAAC,mBAAmB;IA4B3B,OAAO,CAAC,iBAAiB;IAKzB,OAAO,CAAC,mBAAmB;IAW3B,OAAO,CAAC,qBAAqB;IA8B7B,OAAO,CAAC,iBAAiB;IAQzB,OAAO,CAAC,qBAAqB;IAiBvB,QAAQ,CACZ,MAAM,EAAE,UAAU,EAClB,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,cAAc,CAAC;CAgC3B"}
@@ -1,6 +1,6 @@
1
1
  export declare const SDK_TITLE = "Appwrite";
2
2
  export declare const SDK_TITLE_LOWER = "appwrite";
3
- export declare const SDK_VERSION = "13.6.1";
3
+ export declare const SDK_VERSION = "14.0.0";
4
4
  export declare const SDK_NAME = "Command Line";
5
5
  export declare const SDK_PLATFORM = "console";
6
6
  export declare const SDK_LANGUAGE = "cli";
@@ -0,0 +1,5 @@
1
+ ```bash
2
+ appwrite projects update-status \
3
+ --project-id <PROJECT_ID> \
4
+ --status active
5
+ ```
@@ -1,6 +1,5 @@
1
1
  ```bash
2
2
  appwrite sites create-deployment \
3
3
  --site-id <SITE_ID> \
4
- --code 'path/to/file.png' \
5
- --activate false
4
+ --code 'path/to/file.png'
6
5
  ```
package/install.ps1 CHANGED
@@ -13,8 +13,8 @@
13
13
  # You can use "View source" of this page to see the full script.
14
14
 
15
15
  # REPO
16
- $GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/13.6.1/appwrite-cli-win-x64.exe"
17
- $GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/13.6.1/appwrite-cli-win-arm64.exe"
16
+ $GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/14.0.0/appwrite-cli-win-x64.exe"
17
+ $GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/14.0.0/appwrite-cli-win-arm64.exe"
18
18
 
19
19
  $APPWRITE_BINARY_NAME = "appwrite.exe"
20
20
 
package/install.sh CHANGED
@@ -96,7 +96,7 @@ printSuccess() {
96
96
  downloadBinary() {
97
97
  echo "[2/4] Downloading executable for $OS ($ARCH) ..."
98
98
 
99
- GITHUB_LATEST_VERSION="13.6.1"
99
+ GITHUB_LATEST_VERSION="14.0.0"
100
100
  GITHUB_FILE="appwrite-cli-${OS}-${ARCH}"
101
101
  GITHUB_URL="https://github.com/$GITHUB_REPOSITORY_NAME/releases/download/$GITHUB_LATEST_VERSION/$GITHUB_FILE"
102
102