appwrite-cli 17.0.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 (98) hide show
  1. package/.github/workflows/ci.yml +1 -1
  2. package/.github/workflows/publish.yml +1 -1
  3. package/CHANGELOG.md +20 -0
  4. package/README.md +2 -2
  5. package/bun.lock +783 -0
  6. package/cli.ts +19 -1
  7. package/dist/bundle-win-arm64.mjs +1515 -744
  8. package/dist/cli.cjs +1515 -744
  9. package/dist/index.cjs +322 -118
  10. package/dist/index.js +322 -118
  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/commands/services/organizations.d.ts +3 -0
  15. package/dist/lib/commands/services/organizations.d.ts.map +1 -0
  16. package/dist/lib/commands/services/teams.d.ts.map +1 -1
  17. package/dist/lib/constants.d.ts +1 -1
  18. package/dist/lib/emulation/docker.d.ts.map +1 -1
  19. package/dist/lib/emulation/utils.d.ts.map +1 -1
  20. package/dist/lib/parser.d.ts.map +1 -1
  21. package/dist/lib/questions.d.ts.map +1 -1
  22. package/dist/lib/types.d.ts +3 -0
  23. package/dist/lib/types.d.ts.map +1 -1
  24. package/dist/lib/utils.d.ts +12 -0
  25. package/dist/lib/utils.d.ts.map +1 -1
  26. package/docs/examples/organizations/add-credit.md +5 -0
  27. package/docs/examples/organizations/cancel-downgrade.md +4 -0
  28. package/docs/examples/organizations/create-downgrade-feedback.md +8 -0
  29. package/docs/examples/organizations/create-invoice-payment.md +6 -0
  30. package/docs/examples/organizations/create-key.md +6 -0
  31. package/docs/examples/organizations/create.md +6 -0
  32. package/docs/examples/organizations/delete-backup-payment-method.md +4 -0
  33. package/docs/examples/organizations/delete-default-payment-method.md +4 -0
  34. package/docs/examples/organizations/delete-key.md +5 -0
  35. package/docs/examples/organizations/delete.md +4 -0
  36. package/docs/examples/organizations/estimation-create-organization.md +4 -0
  37. package/docs/examples/organizations/estimation-delete-organization.md +4 -0
  38. package/docs/examples/organizations/estimation-update-plan.md +5 -0
  39. package/docs/examples/organizations/get-aggregation.md +5 -0
  40. package/docs/examples/organizations/get-available-credits.md +4 -0
  41. package/docs/examples/organizations/get-credit.md +5 -0
  42. package/docs/examples/organizations/get-invoice-download.md +5 -0
  43. package/docs/examples/organizations/get-invoice-view.md +5 -0
  44. package/docs/examples/organizations/get-invoice.md +5 -0
  45. package/docs/examples/organizations/get-key.md +5 -0
  46. package/docs/examples/organizations/get-plan.md +4 -0
  47. package/docs/examples/organizations/get-scopes.md +4 -0
  48. package/docs/examples/organizations/get-usage.md +4 -0
  49. package/docs/examples/organizations/list-aggregations.md +4 -0
  50. package/docs/examples/organizations/list-credits.md +4 -0
  51. package/docs/examples/organizations/list-keys.md +4 -0
  52. package/docs/examples/organizations/list-regions.md +4 -0
  53. package/docs/examples/organizations/list.md +3 -0
  54. package/docs/examples/organizations/set-backup-payment-method.md +5 -0
  55. package/docs/examples/organizations/set-billing-address.md +5 -0
  56. package/docs/examples/organizations/set-billing-email.md +5 -0
  57. package/docs/examples/organizations/set-billing-tax-id.md +5 -0
  58. package/docs/examples/organizations/set-default-payment-method.md +5 -0
  59. package/docs/examples/organizations/update-budget.md +5 -0
  60. package/docs/examples/organizations/update-key.md +7 -0
  61. package/docs/examples/organizations/update-plan.md +5 -0
  62. package/docs/examples/organizations/validate-invoice.md +5 -0
  63. package/docs/examples/organizations/validate-payment.md +4 -0
  64. package/install.ps1 +2 -2
  65. package/install.sh +1 -1
  66. package/lib/client.ts +12 -0
  67. package/lib/commands/init.ts +109 -2
  68. package/lib/commands/services/account.ts +110 -55
  69. package/lib/commands/services/activities.ts +4 -2
  70. package/lib/commands/services/backups.ts +24 -12
  71. package/lib/commands/services/databases.ts +150 -75
  72. package/lib/commands/services/functions.ts +60 -30
  73. package/lib/commands/services/graphql.ts +4 -2
  74. package/lib/commands/services/health.ts +46 -23
  75. package/lib/commands/services/locale.ts +16 -8
  76. package/lib/commands/services/messaging.ts +96 -48
  77. package/lib/commands/services/migrations.ts +30 -16
  78. package/lib/commands/services/organizations.ts +555 -0
  79. package/lib/commands/services/project.ts +12 -6
  80. package/lib/commands/services/projects.ts +105 -53
  81. package/lib/commands/services/proxy.ts +18 -10
  82. package/lib/commands/services/sites.ts +58 -29
  83. package/lib/commands/services/storage.ts +30 -15
  84. package/lib/commands/services/tables-db.ts +148 -74
  85. package/lib/commands/services/teams.ts +38 -15
  86. package/lib/commands/services/tokens.ts +10 -5
  87. package/lib/commands/services/users.ts +88 -44
  88. package/lib/commands/services/vcs.ts +22 -12
  89. package/lib/commands/services/webhooks.ts +12 -6
  90. package/lib/constants.ts +1 -1
  91. package/lib/emulation/docker.ts +1 -0
  92. package/lib/emulation/utils.ts +3 -2
  93. package/lib/parser.ts +356 -77
  94. package/lib/questions.ts +8 -3
  95. package/lib/types.ts +3 -0
  96. package/lib/utils.ts +234 -0
  97. package/package.json +1 -1
  98. package/scoop/appwrite.config.json +3 -3
@@ -26,7 +26,7 @@ export const account = new Command("account")
26
26
  helpWidth: process.stdout.columns || 80,
27
27
  });
28
28
 
29
- account
29
+ const accountGetCommand = account
30
30
  .command(`get`)
31
31
  .description(`Get the currently logged in user.`)
32
32
  .action(
@@ -35,7 +35,8 @@ account
35
35
  ),
36
36
  );
37
37
 
38
- account
38
+
39
+ const accountCreateCommand = account
39
40
  .command(`create`)
40
41
  .description(`Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [/account/verfication](https://appwrite.io/docs/references/cloud/client-web/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https://appwrite.io/docs/references/cloud/client-web/account#createEmailSession).`)
41
42
  .requiredOption(`--user-id <user-id>`, `User 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.`)
@@ -49,7 +50,8 @@ account
49
50
  ),
50
51
  );
51
52
 
52
- account
53
+
54
+ const accountDeleteCommand = account
53
55
  .command(`delete`)
54
56
  .description(`Delete the currently logged in user.`)
55
57
  .action(
@@ -58,7 +60,8 @@ account
58
60
  ),
59
61
  );
60
62
 
61
- account
63
+
64
+ const accountUpdateEmailCommand = account
62
65
  .command(`update-email`)
63
66
  .description(`Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.
64
67
  This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.
@@ -72,7 +75,8 @@ This endpoint can also be used to convert an anonymous account to a normal one,
72
75
  ),
73
76
  );
74
77
 
75
- account
78
+
79
+ const accountListIdentitiesCommand = account
76
80
  .command(`list-identities`)
77
81
  .description(`Get the list of identities for the currently logged in user.`)
78
82
  .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: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry`)
@@ -89,7 +93,8 @@ account
89
93
  ),
90
94
  );
91
95
 
92
- account
96
+
97
+ const accountDeleteIdentityCommand = account
93
98
  .command(`delete-identity`)
94
99
  .description(`Delete an identity by its unique ID.`)
95
100
  .requiredOption(`--identity-id <identity-id>`, `Identity ID.`)
@@ -100,7 +105,8 @@ account
100
105
  ),
101
106
  );
102
107
 
103
- account
108
+
109
+ const accountCreateJWTCommand = account
104
110
  .command(`create-jwt`)
105
111
  .description(`Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.`)
106
112
  .option(`--duration <duration>`, `Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.`, parseInteger)
@@ -111,7 +117,8 @@ account
111
117
  ),
112
118
  );
113
119
 
114
- account
120
+
121
+ const accountListKeysCommand = account
115
122
  .command(`list-keys`)
116
123
  .description(`Get a list of all API keys from the current account.`)
117
124
  .option(
@@ -127,7 +134,8 @@ account
127
134
  ),
128
135
  );
129
136
 
130
- account
137
+
138
+ const accountCreateKeyCommand = account
131
139
  .command(`create-key`)
132
140
  .description(`Create a new account API key.`)
133
141
  .requiredOption(`--name <name>`, `Key name. Max length: 128 chars.`)
@@ -140,7 +148,8 @@ account
140
148
  ),
141
149
  );
142
150
 
143
- account
151
+
152
+ const accountGetKeyCommand = account
144
153
  .command(`get-key`)
145
154
  .description(`Get a key by its unique ID. This endpoint returns details about a specific API key in your account including it's scopes.`)
146
155
  .requiredOption(`--key-id <key-id>`, `Key unique ID.`)
@@ -151,7 +160,8 @@ account
151
160
  ),
152
161
  );
153
162
 
154
- account
163
+
164
+ const accountUpdateKeyCommand = account
155
165
  .command(`update-key`)
156
166
  .description(`Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key.`)
157
167
  .requiredOption(`--key-id <key-id>`, `Key unique ID.`)
@@ -165,7 +175,8 @@ account
165
175
  ),
166
176
  );
167
177
 
168
- account
178
+
179
+ const accountDeleteKeyCommand = account
169
180
  .command(`delete-key`)
170
181
  .description(`Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls.`)
171
182
  .requiredOption(`--key-id <key-id>`, `Key unique ID.`)
@@ -176,7 +187,8 @@ account
176
187
  ),
177
188
  );
178
189
 
179
- account
190
+
191
+ const accountListLogsCommand = account
180
192
  .command(`list-logs`)
181
193
  .description(`Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log.`)
182
194
  .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset`)
@@ -193,7 +205,8 @@ account
193
205
  ),
194
206
  );
195
207
 
196
- account
208
+
209
+ const accountUpdateMFACommand = account
197
210
  .command(`update-mfa`)
198
211
  .description(`Enable or disable MFA on an account.`)
199
212
  .requiredOption(`--mfa <mfa>`, `Enable or disable MFA.`, parseBool)
@@ -204,7 +217,8 @@ account
204
217
  ),
205
218
  );
206
219
 
207
- account
220
+
221
+ const accountCreateMfaAuthenticatorCommand = account
208
222
  .command(`create-mfa-authenticator`)
209
223
  .description(`Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator) method.`)
210
224
  .requiredOption(`--type <type>`, `Type of authenticator. Must be \`totp\``)
@@ -215,7 +229,8 @@ account
215
229
  ),
216
230
  );
217
231
 
218
- account
232
+
233
+ const accountUpdateMfaAuthenticatorCommand = account
219
234
  .command(`update-mfa-authenticator`)
220
235
  .description(`Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method.`)
221
236
  .requiredOption(`--type <type>`, `Type of authenticator.`)
@@ -227,7 +242,8 @@ account
227
242
  ),
228
243
  );
229
244
 
230
- account
245
+
246
+ const accountDeleteMfaAuthenticatorCommand = account
231
247
  .command(`delete-mfa-authenticator`)
232
248
  .description(`Delete an authenticator for a user by ID.`)
233
249
  .requiredOption(`--type <type>`, `Type of authenticator.`)
@@ -238,7 +254,8 @@ account
238
254
  ),
239
255
  );
240
256
 
241
- account
257
+
258
+ const accountCreateMfaChallengeCommand = account
242
259
  .command(`create-mfa-challenge`)
243
260
  .description(`Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method.`)
244
261
  .requiredOption(`--factor <factor>`, `Factor used for verification. Must be one of following: \`email\`, \`phone\`, \`totp\`, \`recoveryCode\`.`)
@@ -249,7 +266,8 @@ account
249
266
  ),
250
267
  );
251
268
 
252
- account
269
+
270
+ const accountUpdateMfaChallengeCommand = account
253
271
  .command(`update-mfa-challenge`)
254
272
  .description(`Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method.`)
255
273
  .requiredOption(`--challenge-id <challenge-id>`, `ID of the challenge.`)
@@ -261,7 +279,8 @@ account
261
279
  ),
262
280
  );
263
281
 
264
- account
282
+
283
+ const accountListMfaFactorsCommand = account
265
284
  .command(`list-mfa-factors`)
266
285
  .description(`List the factors available on the account to be used as a MFA challange.`)
267
286
  .action(
@@ -270,7 +289,8 @@ account
270
289
  ),
271
290
  );
272
291
 
273
- account
292
+
293
+ const accountGetMfaRecoveryCodesCommand = account
274
294
  .command(`get-mfa-recovery-codes`)
275
295
  .description(`Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.`)
276
296
  .action(
@@ -279,7 +299,8 @@ account
279
299
  ),
280
300
  );
281
301
 
282
- account
302
+
303
+ const accountCreateMfaRecoveryCodesCommand = account
283
304
  .command(`create-mfa-recovery-codes`)
284
305
  .description(`Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method.`)
285
306
  .action(
@@ -288,7 +309,8 @@ account
288
309
  ),
289
310
  );
290
311
 
291
- account
312
+
313
+ const accountUpdateMfaRecoveryCodesCommand = account
292
314
  .command(`update-mfa-recovery-codes`)
293
315
  .description(`Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.`)
294
316
  .action(
@@ -297,7 +319,8 @@ account
297
319
  ),
298
320
  );
299
321
 
300
- account
322
+
323
+ const accountUpdateNameCommand = account
301
324
  .command(`update-name`)
302
325
  .description(`Update currently logged in user account name.`)
303
326
  .requiredOption(`--name <name>`, `User name. Max length: 128 chars.`)
@@ -308,7 +331,8 @@ account
308
331
  ),
309
332
  );
310
333
 
311
- account
334
+
335
+ const accountUpdatePasswordCommand = account
312
336
  .command(`update-password`)
313
337
  .description(`Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional.`)
314
338
  .requiredOption(`--password <password>`, `New user password. Must be at least 8 chars.`)
@@ -320,7 +344,8 @@ account
320
344
  ),
321
345
  );
322
346
 
323
- account
347
+
348
+ const accountUpdatePhoneCommand = account
324
349
  .command(`update-phone`)
325
350
  .description(`Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification) endpoint to send a confirmation SMS.`)
326
351
  .requiredOption(`--phone <phone>`, `Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`)
@@ -332,7 +357,8 @@ account
332
357
  ),
333
358
  );
334
359
 
335
- account
360
+
361
+ const accountGetPrefsCommand = account
336
362
  .command(`get-prefs`)
337
363
  .description(`Get the preferences as a key-value object for the currently logged in user.`)
338
364
  .action(
@@ -341,7 +367,8 @@ account
341
367
  ),
342
368
  );
343
369
 
344
- account
370
+
371
+ const accountUpdatePrefsCommand = account
345
372
  .command(`update-prefs`)
346
373
  .description(`Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.`)
347
374
  .requiredOption(`--prefs <prefs>`, `Prefs key-value JSON object.`)
@@ -352,7 +379,8 @@ account
352
379
  ),
353
380
  );
354
381
 
355
- account
382
+
383
+ const accountCreateRecoveryCommand = account
356
384
  .command(`create-recovery`)
357
385
  .description(`Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour.`)
358
386
  .requiredOption(`--email <email>`, `User email.`)
@@ -364,7 +392,8 @@ account
364
392
  ),
365
393
  );
366
394
 
367
- account
395
+
396
+ const accountUpdateRecoveryCommand = account
368
397
  .command(`update-recovery`)
369
398
  .description(`Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#createRecovery) endpoint.
370
399
 
@@ -379,7 +408,8 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
379
408
  ),
380
409
  );
381
410
 
382
- account
411
+
412
+ const accountListSessionsCommand = account
383
413
  .command(`list-sessions`)
384
414
  .description(`Get the list of active sessions across different devices for the currently logged in user.`)
385
415
  .action(
@@ -388,7 +418,8 @@ account
388
418
  ),
389
419
  );
390
420
 
391
- account
421
+
422
+ const accountDeleteSessionsCommand = account
392
423
  .command(`delete-sessions`)
393
424
  .description(`Delete all sessions from the user account and remove any sessions cookies from the end client.`)
394
425
  .action(
@@ -397,7 +428,8 @@ account
397
428
  ),
398
429
  );
399
430
 
400
- account
431
+
432
+ const accountCreateAnonymousSessionCommand = account
401
433
  .command(`create-anonymous-session`)
402
434
  .description(`Use this endpoint to allow a new user to register an anonymous account in your project. This route will also create a new session for the user. To allow the new user to convert an anonymous account to a normal account, you need to update its [email and password](https://appwrite.io/docs/references/cloud/client-web/account#updateEmail) or create an [OAuth2 session](https://appwrite.io/docs/references/cloud/client-web/account#CreateOAuth2Session).`)
403
435
  .action(
@@ -406,7 +438,8 @@ account
406
438
  ),
407
439
  );
408
440
 
409
- account
441
+
442
+ const accountCreateEmailPasswordSessionCommand = account
410
443
  .command(`create-email-password-session`)
411
444
  .description(`Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.
412
445
 
@@ -420,7 +453,8 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
420
453
  ),
421
454
  );
422
455
 
423
- account
456
+
457
+ const accountUpdateMagicURLSessionCommand = account
424
458
  .command(`update-magic-url-session`)
425
459
  .description(`Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.`)
426
460
  .requiredOption(`--user-id <user-id>`, `User 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.`)
@@ -432,7 +466,8 @@ account
432
466
  ),
433
467
  );
434
468
 
435
- account
469
+
470
+ const accountCreateOAuth2SessionCommand = account
436
471
  .command(`create-o-auth-2-session`)
437
472
  .description(`Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.
438
473
 
@@ -453,7 +488,8 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
453
488
  ),
454
489
  );
455
490
 
456
- account
491
+
492
+ const accountUpdatePhoneSessionCommand = account
457
493
  .command(`update-phone-session`)
458
494
  .description(`Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.`)
459
495
  .requiredOption(`--user-id <user-id>`, `User 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.`)
@@ -465,7 +501,8 @@ account
465
501
  ),
466
502
  );
467
503
 
468
- account
504
+
505
+ const accountCreateSessionCommand = account
469
506
  .command(`create-session`)
470
507
  .description(`Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.`)
471
508
  .requiredOption(`--user-id <user-id>`, `User 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.`)
@@ -477,7 +514,8 @@ account
477
514
  ),
478
515
  );
479
516
 
480
- account
517
+
518
+ const accountGetSessionCommand = account
481
519
  .command(`get-session`)
482
520
  .description(`Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.`)
483
521
  .requiredOption(`--session-id <session-id>`, `Session ID. Use the string 'current' to get the current device session.`)
@@ -488,7 +526,8 @@ account
488
526
  ),
489
527
  );
490
528
 
491
- account
529
+
530
+ const accountUpdateSessionCommand = account
492
531
  .command(`update-session`)
493
532
  .description(`Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider.`)
494
533
  .requiredOption(`--session-id <session-id>`, `Session ID. Use the string 'current' to update the current device session.`)
@@ -499,7 +538,8 @@ account
499
538
  ),
500
539
  );
501
540
 
502
- account
541
+
542
+ const accountDeleteSessionCommand = account
503
543
  .command(`delete-session`)
504
544
  .description(`Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https://appwrite.io/docs/references/cloud/client-web/account#deleteSessions) instead.`)
505
545
  .requiredOption(`--session-id <session-id>`, `Session ID. Use the string 'current' to delete the current device session.`)
@@ -510,7 +550,8 @@ account
510
550
  ),
511
551
  );
512
552
 
513
- account
553
+
554
+ const accountUpdateStatusCommand = account
514
555
  .command(`update-status`)
515
556
  .description(`Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.`)
516
557
  .action(
@@ -519,7 +560,8 @@ account
519
560
  ),
520
561
  );
521
562
 
522
- account
563
+
564
+ const accountCreatePushTargetCommand = account
523
565
  .command(`create-push-target`)
524
566
  .description(`Use this endpoint to register a device for push notifications. Provide a target ID (custom or generated using ID.unique()), a device identifier (usually a device token), and optionally specify which provider should send notifications to this target. The target is automatically linked to the current session and includes device information like brand and model.`)
525
567
  .requiredOption(`--target-id <target-id>`, `Target 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.`)
@@ -532,7 +574,8 @@ account
532
574
  ),
533
575
  );
534
576
 
535
- account
577
+
578
+ const accountUpdatePushTargetCommand = account
536
579
  .command(`update-push-target`)
537
580
  .description(`Update the currently logged in user's push notification target. You can modify the target's identifier (device token) and provider ID (token, email, phone etc.). The target must exist and belong to the current user. If you change the provider ID, notifications will be sent through the new messaging provider instead.`)
538
581
  .requiredOption(`--target-id <target-id>`, `Target ID.`)
@@ -544,7 +587,8 @@ account
544
587
  ),
545
588
  );
546
589
 
547
- account
590
+
591
+ const accountDeletePushTargetCommand = account
548
592
  .command(`delete-push-target`)
549
593
  .description(`Delete a push notification target for the currently logged in user. After deletion, the device will no longer receive push notifications. The target must exist and belong to the current user.`)
550
594
  .requiredOption(`--target-id <target-id>`, `Target ID.`)
@@ -555,7 +599,8 @@ account
555
599
  ),
556
600
  );
557
601
 
558
- account
602
+
603
+ const accountCreateEmailTokenCommand = account
559
604
  .command(`create-email-token`)
560
605
  .description(`Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided \`userId\`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.
561
606
 
@@ -576,7 +621,8 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
576
621
  ),
577
622
  );
578
623
 
579
- account
624
+
625
+ const accountCreateMagicURLTokenCommand = account
580
626
  .command(`create-magic-url-token`)
581
627
  .description(`Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.
582
628
 
@@ -598,7 +644,8 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
598
644
  ),
599
645
  );
600
646
 
601
- account
647
+
648
+ const accountCreateOAuth2TokenCommand = account
602
649
  .command(`create-o-auth-2-token`)
603
650
  .description(`Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.
604
651
 
@@ -618,7 +665,8 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
618
665
  ),
619
666
  );
620
667
 
621
- account
668
+
669
+ const accountCreatePhoneTokenCommand = account
622
670
  .command(`create-phone-token`)
623
671
  .description(`Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.
624
672
 
@@ -632,7 +680,8 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
632
680
  ),
633
681
  );
634
682
 
635
- account
683
+
684
+ const accountCreateEmailVerificationCommand = account
636
685
  .command(`create-email-verification`)
637
686
  .description(`Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.
638
687
 
@@ -646,7 +695,8 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
646
695
  ),
647
696
  );
648
697
 
649
- account
698
+
699
+ const accountCreateVerificationCommand = account
650
700
  .command(`create-verification`)
651
701
  .description(`Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.
652
702
 
@@ -660,7 +710,8 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
660
710
  ),
661
711
  );
662
712
 
663
- account
713
+
714
+ const accountUpdateEmailVerificationCommand = account
664
715
  .command(`update-email-verification`)
665
716
  .description(`Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.`)
666
717
  .requiredOption(`--user-id <user-id>`, `User ID.`)
@@ -672,7 +723,8 @@ account
672
723
  ),
673
724
  );
674
725
 
675
- account
726
+
727
+ const accountUpdateVerificationCommand = account
676
728
  .command(`update-verification`)
677
729
  .description(`Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.`)
678
730
  .requiredOption(`--user-id <user-id>`, `User ID.`)
@@ -684,7 +736,8 @@ account
684
736
  ),
685
737
  );
686
738
 
687
- account
739
+
740
+ const accountCreatePhoneVerificationCommand = account
688
741
  .command(`create-phone-verification`)
689
742
  .description(`Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes.`)
690
743
  .action(
@@ -693,7 +746,8 @@ account
693
746
  ),
694
747
  );
695
748
 
696
- account
749
+
750
+ const accountUpdatePhoneVerificationCommand = account
697
751
  .command(`update-phone-verification`)
698
752
  .description(`Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code.`)
699
753
  .requiredOption(`--user-id <user-id>`, `User ID.`)
@@ -705,3 +759,4 @@ account
705
759
  ),
706
760
  );
707
761
 
762
+
@@ -26,7 +26,7 @@ export const activities = new Command("activities")
26
26
  helpWidth: process.stdout.columns || 80,
27
27
  });
28
28
 
29
- activities
29
+ const activitiesListEventsCommand = activities
30
30
  .command(`list-events`)
31
31
  .description(`List all events for selected filters.`)
32
32
  .option(`--queries <queries>`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on attributes such as userId, teamId, etc.`)
@@ -37,7 +37,8 @@ activities
37
37
  ),
38
38
  );
39
39
 
40
- activities
40
+
41
+ const activitiesGetEventCommand = activities
41
42
  .command(`get-event`)
42
43
  .description(`Get event by ID.
43
44
  `)
@@ -49,3 +50,4 @@ activities
49
50
  ),
50
51
  );
51
52
 
53
+
@@ -26,7 +26,7 @@ export const backups = new Command("backups")
26
26
  helpWidth: process.stdout.columns || 80,
27
27
  });
28
28
 
29
- backups
29
+ const backupsListArchivesCommand = backups
30
30
  .command(`list-archives`)
31
31
  .description(`List all archives for a project.`)
32
32
  .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.`)
@@ -37,7 +37,8 @@ backups
37
37
  ),
38
38
  );
39
39
 
40
- backups
40
+
41
+ const backupsCreateArchiveCommand = backups
41
42
  .command(`create-archive`)
42
43
  .description(`Create a new archive asynchronously for a project.`)
43
44
  .requiredOption(`--services [services...]`, `Array of services to backup`)
@@ -49,7 +50,8 @@ backups
49
50
  ),
50
51
  );
51
52
 
52
- backups
53
+
54
+ const backupsGetArchiveCommand = backups
53
55
  .command(`get-archive`)
54
56
  .description(`Get a backup archive using it's ID.`)
55
57
  .requiredOption(`--archive-id <archive-id>`, `Archive ID. Choose a custom ID\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
@@ -60,7 +62,8 @@ backups
60
62
  ),
61
63
  );
62
64
 
63
- backups
65
+
66
+ const backupsDeleteArchiveCommand = backups
64
67
  .command(`delete-archive`)
65
68
  .description(`Delete an existing archive for a project.`)
66
69
  .requiredOption(`--archive-id <archive-id>`, `Policy ID. Choose a custom ID or generate a random ID with \`ID.unique()\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
@@ -71,7 +74,8 @@ backups
71
74
  ),
72
75
  );
73
76
 
74
- backups
77
+
78
+ const backupsListPoliciesCommand = backups
75
79
  .command(`list-policies`)
76
80
  .description(`List all policies for a project.`)
77
81
  .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.`)
@@ -82,7 +86,8 @@ backups
82
86
  ),
83
87
  );
84
88
 
85
- backups
89
+
90
+ const backupsCreatePolicyCommand = backups
86
91
  .command(`create-policy`)
87
92
  .description(`Create a new backup policy.`)
88
93
  .requiredOption(`--policy-id <policy-id>`, `Policy ID. Choose a custom ID or generate a random ID with \`ID.unique()\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
@@ -104,7 +109,8 @@ backups
104
109
  ),
105
110
  );
106
111
 
107
- backups
112
+
113
+ const backupsGetPolicyCommand = backups
108
114
  .command(`get-policy`)
109
115
  .description(`Get a backup policy using it's ID.`)
110
116
  .requiredOption(`--policy-id <policy-id>`, `Policy ID. Choose a custom ID\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
@@ -115,7 +121,8 @@ backups
115
121
  ),
116
122
  );
117
123
 
118
- backups
124
+
125
+ const backupsUpdatePolicyCommand = backups
119
126
  .command(`update-policy`)
120
127
  .description(`Update an existing policy using it's ID.`)
121
128
  .requiredOption(`--policy-id <policy-id>`, `Policy ID. Choose a custom ID\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
@@ -135,7 +142,8 @@ backups
135
142
  ),
136
143
  );
137
144
 
138
- backups
145
+
146
+ const backupsDeletePolicyCommand = backups
139
147
  .command(`delete-policy`)
140
148
  .description(`Delete a policy using it's ID.`)
141
149
  .requiredOption(`--policy-id <policy-id>`, `Policy ID. Choose a custom ID or generate a random ID with \`ID.unique()\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
@@ -146,7 +154,8 @@ backups
146
154
  ),
147
155
  );
148
156
 
149
- backups
157
+
158
+ const backupsCreateRestorationCommand = backups
150
159
  .command(`create-restoration`)
151
160
  .description(`Create and trigger a new restoration for a backup on a project.`)
152
161
  .requiredOption(`--archive-id <archive-id>`, `Backup archive ID to restore`)
@@ -160,7 +169,8 @@ backups
160
169
  ),
161
170
  );
162
171
 
163
- backups
172
+
173
+ const backupsListRestorationsCommand = backups
164
174
  .command(`list-restorations`)
165
175
  .description(`List all backup restorations for a project.`)
166
176
  .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.`)
@@ -171,7 +181,8 @@ backups
171
181
  ),
172
182
  );
173
183
 
174
- backups
184
+
185
+ const backupsGetRestorationCommand = backups
175
186
  .command(`get-restoration`)
176
187
  .description(`Get the current status of a backup restoration.`)
177
188
  .requiredOption(`--restoration-id <restoration-id>`, `Restoration ID. Choose a custom ID\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
@@ -182,3 +193,4 @@ backups
182
193
  ),
183
194
  );
184
195
 
196
+