appwrite-cli 17.1.0 → 17.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/.github/workflows/ci.yml +1 -1
  2. package/.github/workflows/publish.yml +1 -1
  3. package/CHANGELOG.md +14 -0
  4. package/README.md +2 -2
  5. package/bun.lock +783 -0
  6. package/cli.ts +14 -2
  7. package/dist/bundle-win-arm64.mjs +1137 -733
  8. package/dist/cli.cjs +1137 -733
  9. package/dist/index.cjs +193 -79
  10. package/dist/index.js +193 -79
  11. package/dist/lib/client.d.ts +9 -0
  12. package/dist/lib/client.d.ts.map +1 -1
  13. package/dist/lib/commands/init.d.ts.map +1 -1
  14. package/dist/lib/constants.d.ts +1 -1
  15. package/dist/lib/emulation/docker.d.ts.map +1 -1
  16. package/dist/lib/parser.d.ts.map +1 -1
  17. package/dist/lib/questions.d.ts.map +1 -1
  18. package/dist/lib/types.d.ts +2 -0
  19. package/dist/lib/types.d.ts.map +1 -1
  20. package/dist/lib/utils.d.ts +12 -0
  21. package/dist/lib/utils.d.ts.map +1 -1
  22. package/install.ps1 +2 -2
  23. package/install.sh +1 -1
  24. package/lib/client.ts +12 -0
  25. package/lib/commands/init.ts +109 -2
  26. package/lib/commands/services/account.ts +110 -55
  27. package/lib/commands/services/activities.ts +4 -2
  28. package/lib/commands/services/backups.ts +24 -12
  29. package/lib/commands/services/databases.ts +150 -75
  30. package/lib/commands/services/functions.ts +60 -30
  31. package/lib/commands/services/graphql.ts +4 -2
  32. package/lib/commands/services/health.ts +46 -23
  33. package/lib/commands/services/locale.ts +16 -8
  34. package/lib/commands/services/messaging.ts +96 -48
  35. package/lib/commands/services/migrations.ts +28 -14
  36. package/lib/commands/services/organizations.ts +76 -38
  37. package/lib/commands/services/project.ts +12 -6
  38. package/lib/commands/services/projects.ts +103 -51
  39. package/lib/commands/services/proxy.ts +16 -8
  40. package/lib/commands/services/sites.ts +58 -29
  41. package/lib/commands/services/storage.ts +30 -15
  42. package/lib/commands/services/tables-db.ts +148 -74
  43. package/lib/commands/services/teams.ts +28 -14
  44. package/lib/commands/services/tokens.ts +10 -5
  45. package/lib/commands/services/users.ts +88 -44
  46. package/lib/commands/services/vcs.ts +20 -10
  47. package/lib/commands/services/webhooks.ts +12 -6
  48. package/lib/constants.ts +1 -1
  49. package/lib/emulation/docker.ts +1 -0
  50. package/lib/parser.ts +279 -122
  51. package/lib/questions.ts +8 -3
  52. package/lib/sdks.ts +0 -1
  53. package/lib/types.ts +2 -0
  54. package/lib/utils.ts +234 -0
  55. package/package.json +1 -1
  56. package/scoop/appwrite.config.json +3 -3
@@ -28,7 +28,7 @@ export const sites = new Command("sites")
28
28
  helpWidth: process.stdout.columns || 80,
29
29
  });
30
30
 
31
- sites
31
+ const sitesListCommand = sites
32
32
  .command(`list`)
33
33
  .description(`Get a list of all the project's sites. You can use the query params to filter your results.`)
34
34
  .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, enabled, framework, deploymentId, buildCommand, installCommand, outputDirectory, installationId`)
@@ -46,7 +46,8 @@ sites
46
46
  ),
47
47
  );
48
48
 
49
- sites
49
+
50
+ const sitesCreateCommand = sites
50
51
  .command(`create`)
51
52
  .description(`Create a new site.`)
52
53
  .requiredOption(`--site-id <site-id>`, `Site 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.`)
@@ -92,7 +93,8 @@ sites
92
93
  ),
93
94
  );
94
95
 
95
- sites
96
+
97
+ const sitesListFrameworksCommand = sites
96
98
  .command(`list-frameworks`)
97
99
  .description(`Get a list of all frameworks that are currently available on the server instance.`)
98
100
  .action(
@@ -101,7 +103,8 @@ sites
101
103
  ),
102
104
  );
103
105
 
104
- sites
106
+
107
+ const sitesListSpecificationsCommand = sites
105
108
  .command(`list-specifications`)
106
109
  .description(`List allowed site specifications for this instance.`)
107
110
  .action(
@@ -110,7 +113,8 @@ sites
110
113
  ),
111
114
  );
112
115
 
113
- sites
116
+
117
+ const sitesListTemplatesCommand = sites
114
118
  .command(`list-templates`)
115
119
  .description(`List available site templates. You can use template details in [createSite](/docs/references/cloud/server-nodejs/sites#create) method.`)
116
120
  .option(`--frameworks [frameworks...]`, `List of frameworks allowed for filtering site templates. Maximum of 100 frameworks are allowed.`)
@@ -124,7 +128,8 @@ sites
124
128
  ),
125
129
  );
126
130
 
127
- sites
131
+
132
+ const sitesGetTemplateCommand = sites
128
133
  .command(`get-template`)
129
134
  .description(`Get a site template using ID. You can use template details in [createSite](/docs/references/cloud/server-nodejs/sites#create) method.`)
130
135
  .requiredOption(`--template-id <template-id>`, `Template ID.`)
@@ -135,7 +140,8 @@ sites
135
140
  ),
136
141
  );
137
142
 
138
- sites
143
+
144
+ const sitesListUsageCommand = sites
139
145
  .command(`list-usage`)
140
146
  .description(`Get usage metrics and statistics for all sites in the project. View statistics including total deployments, builds, logs, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.`)
141
147
  .option(`--range <range>`, `Date range.`)
@@ -146,7 +152,8 @@ sites
146
152
  ),
147
153
  );
148
154
 
149
- sites
155
+
156
+ const sitesGetCommand = sites
150
157
  .command(`get`)
151
158
  .description(`Get a site by its unique ID.`)
152
159
  .requiredOption(`--site-id <site-id>`, `Site ID.`)
@@ -157,7 +164,8 @@ sites
157
164
  ),
158
165
  );
159
166
 
160
- sites
167
+
168
+ const sitesUpdateCommand = sites
161
169
  .command(`update`)
162
170
  .description(`Update site by its unique ID.`)
163
171
  .requiredOption(`--site-id <site-id>`, `Site ID.`)
@@ -203,7 +211,8 @@ sites
203
211
  ),
204
212
  );
205
213
 
206
- sites
214
+
215
+ const sitesDeleteCommand = sites
207
216
  .command(`delete`)
208
217
  .description(`Delete a site by its unique ID.`)
209
218
  .requiredOption(`--site-id <site-id>`, `Site ID.`)
@@ -214,7 +223,8 @@ sites
214
223
  ),
215
224
  );
216
225
 
217
- sites
226
+
227
+ const sitesUpdateSiteDeploymentCommand = sites
218
228
  .command(`update-site-deployment`)
219
229
  .description(`Update the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.`)
220
230
  .requiredOption(`--site-id <site-id>`, `Site ID.`)
@@ -226,7 +236,8 @@ sites
226
236
  ),
227
237
  );
228
238
 
229
- sites
239
+
240
+ const sitesListDeploymentsCommand = sites
230
241
  .command(`list-deployments`)
231
242
  .description(`Get a list of all the site's code deployments. You can use the query params to filter your results.`)
232
243
  .requiredOption(`--site-id <site-id>`, `Site ID.`)
@@ -245,7 +256,8 @@ sites
245
256
  ),
246
257
  );
247
258
 
248
- sites
259
+
260
+ const sitesCreateDeploymentCommand = sites
249
261
  .command(`create-deployment`)
250
262
  .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.`)
251
263
  .requiredOption(`--site-id <site-id>`, `Site ID.`)
@@ -266,7 +278,8 @@ sites
266
278
  ),
267
279
  );
268
280
 
269
- sites
281
+
282
+ const sitesCreateDuplicateDeploymentCommand = sites
270
283
  .command(`create-duplicate-deployment`)
271
284
  .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.`)
272
285
  .requiredOption(`--site-id <site-id>`, `Site ID.`)
@@ -278,7 +291,8 @@ sites
278
291
  ),
279
292
  );
280
293
 
281
- sites
294
+
295
+ const sitesCreateTemplateDeploymentCommand = sites
282
296
  .command(`create-template-deployment`)
283
297
  .description(`Create a deployment based on a template.
284
298
 
@@ -302,7 +316,8 @@ Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/p
302
316
  ),
303
317
  );
304
318
 
305
- sites
319
+
320
+ const sitesCreateVcsDeploymentCommand = sites
306
321
  .command(`create-vcs-deployment`)
307
322
  .description(`Create a deployment when a site is connected to VCS.
308
323
 
@@ -323,7 +338,8 @@ This endpoint lets you create deployment from a branch, commit, or a tag.`)
323
338
  ),
324
339
  );
325
340
 
326
- sites
341
+
342
+ const sitesGetDeploymentCommand = sites
327
343
  .command(`get-deployment`)
328
344
  .description(`Get a site deployment by its unique ID.`)
329
345
  .requiredOption(`--site-id <site-id>`, `Site ID.`)
@@ -335,7 +351,8 @@ sites
335
351
  ),
336
352
  );
337
353
 
338
- sites
354
+
355
+ const sitesDeleteDeploymentCommand = sites
339
356
  .command(`delete-deployment`)
340
357
  .description(`Delete a site deployment by its unique ID.`)
341
358
  .requiredOption(`--site-id <site-id>`, `Site ID.`)
@@ -347,7 +364,8 @@ sites
347
364
  ),
348
365
  );
349
366
 
350
- sites
367
+
368
+ const sitesGetDeploymentDownloadCommand = sites
351
369
  .command(`get-deployment-download`)
352
370
  .description(`Get a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.`)
353
371
  .requiredOption(`--site-id <site-id>`, `Site ID.`)
@@ -366,7 +384,8 @@ sites
366
384
  ),
367
385
  );
368
386
 
369
- sites
387
+
388
+ const sitesUpdateDeploymentStatusCommand = sites
370
389
  .command(`update-deployment-status`)
371
390
  .description(`Cancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.`)
372
391
  .requiredOption(`--site-id <site-id>`, `Site ID.`)
@@ -378,7 +397,8 @@ sites
378
397
  ),
379
398
  );
380
399
 
381
- sites
400
+
401
+ const sitesListLogsCommand = sites
382
402
  .command(`list-logs`)
383
403
  .description(`Get a list of all site logs. You can use the query params to filter your results.`)
384
404
  .requiredOption(`--site-id <site-id>`, `Site ID.`)
@@ -396,7 +416,8 @@ sites
396
416
  ),
397
417
  );
398
418
 
399
- sites
419
+
420
+ const sitesGetLogCommand = sites
400
421
  .command(`get-log`)
401
422
  .description(`Get a site request log by its unique ID.`)
402
423
  .requiredOption(`--site-id <site-id>`, `Site ID.`)
@@ -408,7 +429,8 @@ sites
408
429
  ),
409
430
  );
410
431
 
411
- sites
432
+
433
+ const sitesDeleteLogCommand = sites
412
434
  .command(`delete-log`)
413
435
  .description(`Delete a site log by its unique ID.`)
414
436
  .requiredOption(`--site-id <site-id>`, `Site ID.`)
@@ -420,7 +442,8 @@ sites
420
442
  ),
421
443
  );
422
444
 
423
- sites
445
+
446
+ const sitesGetUsageCommand = sites
424
447
  .command(`get-usage`)
425
448
  .description(`Get usage metrics and statistics for a for a specific site. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.`)
426
449
  .requiredOption(`--site-id <site-id>`, `Site ID.`)
@@ -432,7 +455,8 @@ sites
432
455
  ),
433
456
  );
434
457
 
435
- sites
458
+
459
+ const sitesListVariablesCommand = sites
436
460
  .command(`list-variables`)
437
461
  .description(`Get a list of all variables of a specific site.`)
438
462
  .requiredOption(`--site-id <site-id>`, `Site unique ID.`)
@@ -443,7 +467,8 @@ sites
443
467
  ),
444
468
  );
445
469
 
446
- sites
470
+
471
+ const sitesCreateVariableCommand = sites
447
472
  .command(`create-variable`)
448
473
  .description(`Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.`)
449
474
  .requiredOption(`--site-id <site-id>`, `Site unique ID.`)
@@ -462,7 +487,8 @@ sites
462
487
  ),
463
488
  );
464
489
 
465
- sites
490
+
491
+ const sitesGetVariableCommand = sites
466
492
  .command(`get-variable`)
467
493
  .description(`Get a variable by its unique ID.`)
468
494
  .requiredOption(`--site-id <site-id>`, `Site unique ID.`)
@@ -474,7 +500,8 @@ sites
474
500
  ),
475
501
  );
476
502
 
477
- sites
503
+
504
+ const sitesUpdateVariableCommand = sites
478
505
  .command(`update-variable`)
479
506
  .description(`Update variable by its unique ID.`)
480
507
  .requiredOption(`--site-id <site-id>`, `Site unique ID.`)
@@ -494,7 +521,8 @@ sites
494
521
  ),
495
522
  );
496
523
 
497
- sites
524
+
525
+ const sitesDeleteVariableCommand = sites
498
526
  .command(`delete-variable`)
499
527
  .description(`Delete a variable by its unique ID.`)
500
528
  .requiredOption(`--site-id <site-id>`, `Site unique ID.`)
@@ -506,3 +534,4 @@ sites
506
534
  ),
507
535
  );
508
536
 
537
+
@@ -28,7 +28,7 @@ export const storage = new Command("storage")
28
28
  helpWidth: process.stdout.columns || 80,
29
29
  });
30
30
 
31
- storage
31
+ const storageListBucketsCommand = storage
32
32
  .command(`list-buckets`)
33
33
  .description(`Get a list of all the storage buckets. You can use the query params to filter your results.`)
34
34
  .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: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus, transformations`)
@@ -46,7 +46,8 @@ storage
46
46
  ),
47
47
  );
48
48
 
49
- storage
49
+
50
+ const storageCreateBucketCommand = storage
50
51
  .command(`create-bucket`)
51
52
  .description(`Create a new storage bucket.`)
52
53
  .requiredOption(`--bucket-id <bucket-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.`)
@@ -92,7 +93,8 @@ storage
92
93
  ),
93
94
  );
94
95
 
95
- storage
96
+
97
+ const storageGetBucketCommand = storage
96
98
  .command(`get-bucket`)
97
99
  .description(`Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.`)
98
100
  .requiredOption(`--bucket-id <bucket-id>`, `Bucket unique ID.`)
@@ -103,7 +105,8 @@ storage
103
105
  ),
104
106
  );
105
107
 
106
- storage
108
+
109
+ const storageUpdateBucketCommand = storage
107
110
  .command(`update-bucket`)
108
111
  .description(`Update a storage bucket by its unique ID.`)
109
112
  .requiredOption(`--bucket-id <bucket-id>`, `Bucket unique ID.`)
@@ -149,7 +152,8 @@ storage
149
152
  ),
150
153
  );
151
154
 
152
- storage
155
+
156
+ const storageDeleteBucketCommand = storage
153
157
  .command(`delete-bucket`)
154
158
  .description(`Delete a storage bucket by its unique ID.`)
155
159
  .requiredOption(`--bucket-id <bucket-id>`, `Bucket unique ID.`)
@@ -160,7 +164,8 @@ storage
160
164
  ),
161
165
  );
162
166
 
163
- storage
167
+
168
+ const storageListFilesCommand = storage
164
169
  .command(`list-files`)
165
170
  .description(`Get a list of all the user files. You can use the query params to filter your results.`)
166
171
  .requiredOption(`--bucket-id <bucket-id>`, `Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).`)
@@ -179,7 +184,8 @@ storage
179
184
  ),
180
185
  );
181
186
 
182
- storage
187
+
188
+ const storageCreateFileCommand = storage
183
189
  .command(`create-file`)
184
190
  .description(`Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https://appwrite.io/docs/server/storage#storageCreateBucket) API or directly from your Appwrite console.
185
191
 
@@ -200,7 +206,8 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunking l
200
206
  ),
201
207
  );
202
208
 
203
- storage
209
+
210
+ const storageGetFileCommand = storage
204
211
  .command(`get-file`)
205
212
  .description(`Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.`)
206
213
  .requiredOption(`--bucket-id <bucket-id>`, `Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).`)
@@ -212,7 +219,8 @@ storage
212
219
  ),
213
220
  );
214
221
 
215
- storage
222
+
223
+ const storageUpdateFileCommand = storage
216
224
  .command(`update-file`)
217
225
  .description(`Update a file by its unique ID. Only users with write permissions have access to update this resource.`)
218
226
  .requiredOption(`--bucket-id <bucket-id>`, `Bucket unique ID.`)
@@ -226,7 +234,8 @@ storage
226
234
  ),
227
235
  );
228
236
 
229
- storage
237
+
238
+ const storageDeleteFileCommand = storage
230
239
  .command(`delete-file`)
231
240
  .description(`Delete a file by its unique ID. Only users with write permissions have access to delete this resource.`)
232
241
  .requiredOption(`--bucket-id <bucket-id>`, `Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).`)
@@ -238,7 +247,8 @@ storage
238
247
  ),
239
248
  );
240
249
 
241
- storage
250
+
251
+ const storageGetFileDownloadCommand = storage
242
252
  .command(`get-file-download`)
243
253
  .description(`Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.`)
244
254
  .requiredOption(`--bucket-id <bucket-id>`, `Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).`)
@@ -257,7 +267,8 @@ storage
257
267
  ),
258
268
  );
259
269
 
260
- storage
270
+
271
+ const storageGetFilePreviewCommand = storage
261
272
  .command(`get-file-preview`)
262
273
  .description(`Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB.`)
263
274
  .requiredOption(`--bucket-id <bucket-id>`, `Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).`)
@@ -287,7 +298,8 @@ storage
287
298
  ),
288
299
  );
289
300
 
290
- storage
301
+
302
+ const storageGetFileViewCommand = storage
291
303
  .command(`get-file-view`)
292
304
  .description(`Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.`)
293
305
  .requiredOption(`--bucket-id <bucket-id>`, `Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).`)
@@ -306,7 +318,8 @@ storage
306
318
  ),
307
319
  );
308
320
 
309
- storage
321
+
322
+ const storageGetUsageCommand = storage
310
323
  .command(`get-usage`)
311
324
  .description(`Get usage metrics and statistics for all buckets in the project. You can view the total number of buckets, files, storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.
312
325
  `)
@@ -318,7 +331,8 @@ storage
318
331
  ),
319
332
  );
320
333
 
321
- storage
334
+
335
+ const storageGetBucketUsageCommand = storage
322
336
  .command(`get-bucket-usage`)
323
337
  .description(`Get usage metrics and statistics a specific bucket in the project. You can view the total number of files, storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.
324
338
  `)
@@ -331,3 +345,4 @@ storage
331
345
  ),
332
346
  );
333
347
 
348
+