appwrite-cli 6.1.0 → 6.2.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.
package/LICENSE.md CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2024 Appwrite (https://appwrite.io) and individual contributors.
1
+ Copyright (c) 2025 Appwrite (https://appwrite.io) and individual contributors.
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Appwrite Command Line SDK
2
2
 
3
3
  ![License](https://img.shields.io/github/license/appwrite/sdk-for-cli.svg?style=flat-square)
4
- ![Version](https://img.shields.io/badge/api%20version-1.6.0-blue.svg?style=flat-square)
4
+ ![Version](https://img.shields.io/badge/api%20version-1.6.1-blue.svg?style=flat-square)
5
5
  [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
6
6
  [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
7
7
  [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
@@ -29,7 +29,7 @@ Once the installation is complete, you can verify the install using
29
29
 
30
30
  ```sh
31
31
  $ appwrite -v
32
- 6.1.0
32
+ 6.2.0
33
33
  ```
34
34
 
35
35
  ### Install using prebuilt binaries
@@ -60,7 +60,7 @@ $ scoop install https://raw.githubusercontent.com/appwrite/sdk-for-cli/master/sc
60
60
  Once the installation completes, you can verify your install using
61
61
  ```
62
62
  $ appwrite -v
63
- 6.1.0
63
+ 6.2.0
64
64
  ```
65
65
 
66
66
  ## Getting Started
@@ -1,7 +1,10 @@
1
1
  appwrite messaging createPush \
2
2
  --messageId <MESSAGE_ID> \
3
- --title <TITLE> \
4
- --body <BODY> \
3
+
4
+
5
+
6
+
7
+
5
8
 
6
9
 
7
10
 
@@ -15,3 +15,6 @@ appwrite messaging updatePush \
15
15
 
16
16
 
17
17
 
18
+
19
+
20
+
@@ -0,0 +1,5 @@
1
+ appwrite projects updateMembershipsPrivacy \
2
+ --projectId <PROJECT_ID> \
3
+ --userName false \
4
+ --userEmail false \
5
+ --mfa false
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/6.1.0/appwrite-cli-win-x64.exe"
17
- $GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/6.1.0/appwrite-cli-win-arm64.exe"
16
+ $GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/6.2.0/appwrite-cli-win-x64.exe"
17
+ $GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/6.2.0/appwrite-cli-win-arm64.exe"
18
18
 
19
19
  $APPWRITE_BINARY_NAME = "appwrite.exe"
20
20
 
package/install.sh CHANGED
@@ -97,7 +97,7 @@ printSuccess() {
97
97
  downloadBinary() {
98
98
  echo "[2/4] Downloading executable for $OS ($ARCH) ..."
99
99
 
100
- GITHUB_LATEST_VERSION="6.1.0"
100
+ GITHUB_LATEST_VERSION="6.2.0"
101
101
  GITHUB_FILE="appwrite-cli-${OS}-${ARCH}"
102
102
  GITHUB_URL="https://github.com/$GITHUB_REPOSITORY_NAME/releases/download/$GITHUB_LATEST_VERSION/$GITHUB_FILE"
103
103
 
package/lib/client.js CHANGED
@@ -16,8 +16,8 @@ class Client {
16
16
  'x-sdk-name': 'Command Line',
17
17
  'x-sdk-platform': 'console',
18
18
  'x-sdk-language': 'cli',
19
- 'x-sdk-version': '6.1.0',
20
- 'user-agent' : `AppwriteCLI/6.1.0 (${os.type()} ${os.version()}; ${os.arch()})`,
19
+ 'x-sdk-version': '6.2.0',
20
+ 'user-agent' : `AppwriteCLI/6.2.0 (${os.type()} ${os.version()}; ${os.arch()})`,
21
21
  'X-Appwrite-Response-Format' : '1.6.0',
22
22
  };
23
23
  }
@@ -1983,7 +1983,7 @@ account
1983
1983
 
1984
1984
  account
1985
1985
  .command(`create-magic-url-token`)
1986
- .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. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default. A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). `)
1986
+ .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. A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). `)
1987
1987
  .requiredOption(`--user-id <user-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.`)
1988
1988
  .requiredOption(`--email <email>`, `User email.`)
1989
1989
  .option(`--url <url>`, `URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.`)
@@ -299,6 +299,7 @@ const initFunction = async () => {
299
299
  $id: functionId,
300
300
  name: answers.name,
301
301
  runtime: answers.runtime.id,
302
+ specification: answers.specification,
302
303
  execute: ["any"],
303
304
  events: [],
304
305
  scopes: ["users.read"],
@@ -254,16 +254,19 @@ const messagingUpdateEmail = async ({messageId,topics,users,targets,subject,cont
254
254
  * @property {string[]} topics List of Topic IDs.
255
255
  * @property {string[]} users List of User IDs.
256
256
  * @property {string[]} targets List of Targets IDs.
257
- * @property {object} data Additional Data for push notification.
257
+ * @property {object} data Additional key-value pair data for push notification.
258
258
  * @property {string} action Action for push notification.
259
259
  * @property {string} image Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as &lt;BUCKET_ID&gt;:&lt;FILE_ID&gt;.
260
260
  * @property {string} icon Icon for push notification. Available only for Android and Web Platform.
261
- * @property {string} sound Sound for push notification. Available only for Android and IOS Platform.
261
+ * @property {string} sound Sound for push notification. Available only for Android and iOS Platform.
262
262
  * @property {string} color Color for push notification. Available only for Android Platform.
263
263
  * @property {string} tag Tag for push notification. Available only for Android Platform.
264
- * @property {string} badge Badge for push notification. Available only for IOS Platform.
264
+ * @property {number} badge Badge for push notification. Available only for iOS Platform.
265
265
  * @property {boolean} draft Is message a draft
266
266
  * @property {string} scheduledAt Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
267
+ * @property {boolean} contentAvailable If set to true, the notification will be delivered in the background. Available only for iOS Platform.
268
+ * @property {boolean} critical If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.
269
+ * @property {MessagePriority} priority Set the notification priority. &quot;normal&quot; will consider device state and may not deliver notifications immediately. &quot;high&quot; will always attempt to immediately deliver the notification.
267
270
  * @property {boolean} overrideForCli
268
271
  * @property {boolean} parseOutput
269
272
  * @property {libClient | undefined} sdk
@@ -272,7 +275,7 @@ const messagingUpdateEmail = async ({messageId,topics,users,targets,subject,cont
272
275
  /**
273
276
  * @param {MessagingCreatePushRequestParams} params
274
277
  */
275
- const messagingCreatePush = async ({messageId,title,body,topics,users,targets,data,action,image,icon,sound,color,tag,badge,draft,scheduledAt,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
278
+ const messagingCreatePush = async ({messageId,title,body,topics,users,targets,data,action,image,icon,sound,color,tag,badge,draft,scheduledAt,contentAvailable,critical,priority,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
276
279
  let client = !sdk ? await sdkForProject() :
277
280
  sdk;
278
281
  let apiPath = '/messaging/messages/push';
@@ -328,6 +331,15 @@ const messagingCreatePush = async ({messageId,title,body,topics,users,targets,da
328
331
  if (typeof scheduledAt !== 'undefined') {
329
332
  payload['scheduledAt'] = scheduledAt;
330
333
  }
334
+ if (typeof contentAvailable !== 'undefined') {
335
+ payload['contentAvailable'] = contentAvailable;
336
+ }
337
+ if (typeof critical !== 'undefined') {
338
+ payload['critical'] = critical;
339
+ }
340
+ if (typeof priority !== 'undefined') {
341
+ payload['priority'] = priority;
342
+ }
331
343
 
332
344
  let response = undefined;
333
345
 
@@ -361,6 +373,9 @@ const messagingCreatePush = async ({messageId,title,body,topics,users,targets,da
361
373
  * @property {number} badge Badge for push notification. Available only for iOS platforms.
362
374
  * @property {boolean} draft Is message a draft
363
375
  * @property {string} scheduledAt Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
376
+ * @property {boolean} contentAvailable If set to true, the notification will be delivered in the background. Available only for iOS Platform.
377
+ * @property {boolean} critical If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.
378
+ * @property {MessagePriority} priority Set the notification priority. &quot;normal&quot; will consider device battery state and may send notifications later. &quot;high&quot; will always attempt to immediately deliver the notification.
364
379
  * @property {boolean} overrideForCli
365
380
  * @property {boolean} parseOutput
366
381
  * @property {libClient | undefined} sdk
@@ -369,7 +384,7 @@ const messagingCreatePush = async ({messageId,title,body,topics,users,targets,da
369
384
  /**
370
385
  * @param {MessagingUpdatePushRequestParams} params
371
386
  */
372
- const messagingUpdatePush = async ({messageId,topics,users,targets,title,body,data,action,image,icon,sound,color,tag,badge,draft,scheduledAt,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
387
+ const messagingUpdatePush = async ({messageId,topics,users,targets,title,body,data,action,image,icon,sound,color,tag,badge,draft,scheduledAt,contentAvailable,critical,priority,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
373
388
  let client = !sdk ? await sdkForProject() :
374
389
  sdk;
375
390
  let apiPath = '/messaging/messages/push/{messageId}'.replace('{messageId}', messageId);
@@ -422,6 +437,15 @@ const messagingUpdatePush = async ({messageId,topics,users,targets,title,body,da
422
437
  if (typeof scheduledAt !== 'undefined') {
423
438
  payload['scheduledAt'] = scheduledAt;
424
439
  }
440
+ if (typeof contentAvailable !== 'undefined') {
441
+ payload['contentAvailable'] = contentAvailable;
442
+ }
443
+ if (typeof critical !== 'undefined') {
444
+ payload['critical'] = critical;
445
+ }
446
+ if (typeof priority !== 'undefined') {
447
+ payload['priority'] = priority;
448
+ }
425
449
 
426
450
  let response = undefined;
427
451
 
@@ -2454,21 +2478,24 @@ messaging
2454
2478
  .command(`create-push`)
2455
2479
  .description(`Create a new push notification.`)
2456
2480
  .requiredOption(`--message-id <message-id>`, `Message 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.`)
2457
- .requiredOption(`--title <title>`, `Title for push notification.`)
2458
- .requiredOption(`--body <body>`, `Body for push notification.`)
2481
+ .option(`--title <title>`, `Title for push notification.`)
2482
+ .option(`--body <body>`, `Body for push notification.`)
2459
2483
  .option(`--topics [topics...]`, `List of Topic IDs.`)
2460
2484
  .option(`--users [users...]`, `List of User IDs.`)
2461
2485
  .option(`--targets [targets...]`, `List of Targets IDs.`)
2462
- .option(`--data <data>`, `Additional Data for push notification.`)
2486
+ .option(`--data <data>`, `Additional key-value pair data for push notification.`)
2463
2487
  .option(`--action <action>`, `Action for push notification.`)
2464
2488
  .option(`--image <image>`, `Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.`)
2465
2489
  .option(`--icon <icon>`, `Icon for push notification. Available only for Android and Web Platform.`)
2466
- .option(`--sound <sound>`, `Sound for push notification. Available only for Android and IOS Platform.`)
2490
+ .option(`--sound <sound>`, `Sound for push notification. Available only for Android and iOS Platform.`)
2467
2491
  .option(`--color <color>`, `Color for push notification. Available only for Android Platform.`)
2468
2492
  .option(`--tag <tag>`, `Tag for push notification. Available only for Android Platform.`)
2469
- .option(`--badge <badge>`, `Badge for push notification. Available only for IOS Platform.`)
2493
+ .option(`--badge <badge>`, `Badge for push notification. Available only for iOS Platform.`, parseInteger)
2470
2494
  .option(`--draft <draft>`, `Is message a draft`, parseBool)
2471
2495
  .option(`--scheduled-at <scheduled-at>`, `Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.`)
2496
+ .option(`--content-available <content-available>`, `If set to true, the notification will be delivered in the background. Available only for iOS Platform.`, parseBool)
2497
+ .option(`--critical <critical>`, `If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.`, parseBool)
2498
+ .option(`--priority <priority>`, `Set the notification priority. "normal" will consider device state and may not deliver notifications immediately. "high" will always attempt to immediately deliver the notification.`)
2472
2499
  .action(actionRunner(messagingCreatePush))
2473
2500
 
2474
2501
  messaging
@@ -2490,6 +2517,9 @@ messaging
2490
2517
  .option(`--badge <badge>`, `Badge for push notification. Available only for iOS platforms.`, parseInteger)
2491
2518
  .option(`--draft <draft>`, `Is message a draft`, parseBool)
2492
2519
  .option(`--scheduled-at <scheduled-at>`, `Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.`)
2520
+ .option(`--content-available <content-available>`, `If set to true, the notification will be delivered in the background. Available only for iOS Platform.`, parseBool)
2521
+ .option(`--critical <critical>`, `If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.`, parseBool)
2522
+ .option(`--priority <priority>`, `Set the notification priority. "normal" will consider device battery state and may send notifications later. "high" will always attempt to immediately deliver the notification.`)
2493
2523
  .action(actionRunner(messagingUpdatePush))
2494
2524
 
2495
2525
  messaging
@@ -41,7 +41,7 @@ const migrations = new Command("migrations").description(commandDescriptions['mi
41
41
 
42
42
  /**
43
43
  * @typedef {Object} MigrationsListRequestParams
44
- * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, stage, source, resources, statusCounters, resourceData, errors
44
+ * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, stage, source, destination, resources, statusCounters, resourceData, errors
45
45
  * @property {string} search Search term to filter your list results. Max length: 256 chars.
46
46
  * @property {boolean} overrideForCli
47
47
  * @property {boolean} parseOutput
@@ -209,105 +209,6 @@ const migrationsCreateFirebaseMigration = async ({resources,serviceAccount,parse
209
209
 
210
210
  }
211
211
 
212
- /**
213
- * @typedef {Object} MigrationsDeleteFirebaseAuthRequestParams
214
- * @property {boolean} overrideForCli
215
- * @property {boolean} parseOutput
216
- * @property {libClient | undefined} sdk
217
- */
218
-
219
- /**
220
- * @param {MigrationsDeleteFirebaseAuthRequestParams} params
221
- */
222
- const migrationsDeleteFirebaseAuth = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
223
- let client = !sdk ? await sdkForProject() :
224
- sdk;
225
- let apiPath = '/migrations/firebase/deauthorize';
226
- let payload = {};
227
-
228
- let response = undefined;
229
-
230
- response = await client.call('get', apiPath, {
231
- 'content-type': 'application/json',
232
- }, payload);
233
-
234
- if (parseOutput) {
235
- parse(response)
236
- }
237
-
238
- return response;
239
-
240
- }
241
-
242
- /**
243
- * @typedef {Object} MigrationsCreateFirebaseOAuthMigrationRequestParams
244
- * @property {string[]} resources List of resources to migrate
245
- * @property {string} projectId Project ID of the Firebase Project
246
- * @property {boolean} overrideForCli
247
- * @property {boolean} parseOutput
248
- * @property {libClient | undefined} sdk
249
- */
250
-
251
- /**
252
- * @param {MigrationsCreateFirebaseOAuthMigrationRequestParams} params
253
- */
254
- const migrationsCreateFirebaseOAuthMigration = async ({resources,projectId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
255
- let client = !sdk ? await sdkForProject() :
256
- sdk;
257
- let apiPath = '/migrations/firebase/oauth';
258
- let payload = {};
259
- resources = resources === true ? [] : resources;
260
- if (typeof resources !== 'undefined') {
261
- payload['resources'] = resources;
262
- }
263
- if (typeof projectId !== 'undefined') {
264
- payload['projectId'] = projectId;
265
- }
266
-
267
- let response = undefined;
268
-
269
- response = await client.call('post', apiPath, {
270
- 'content-type': 'application/json',
271
- }, payload);
272
-
273
- if (parseOutput) {
274
- parse(response)
275
- }
276
-
277
- return response;
278
-
279
- }
280
-
281
- /**
282
- * @typedef {Object} MigrationsListFirebaseProjectsRequestParams
283
- * @property {boolean} overrideForCli
284
- * @property {boolean} parseOutput
285
- * @property {libClient | undefined} sdk
286
- */
287
-
288
- /**
289
- * @param {MigrationsListFirebaseProjectsRequestParams} params
290
- */
291
- const migrationsListFirebaseProjects = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
292
- let client = !sdk ? await sdkForProject() :
293
- sdk;
294
- let apiPath = '/migrations/firebase/projects';
295
- let payload = {};
296
-
297
- let response = undefined;
298
-
299
- response = await client.call('get', apiPath, {
300
- 'content-type': 'application/json',
301
- }, payload);
302
-
303
- if (parseOutput) {
304
- parse(response)
305
- }
306
-
307
- return response;
308
-
309
- }
310
-
311
212
  /**
312
213
  * @typedef {Object} MigrationsGetFirebaseReportRequestParams
313
214
  * @property {string[]} resources List of resources to migrate
@@ -346,44 +247,6 @@ const migrationsGetFirebaseReport = async ({resources,serviceAccount,parseOutput
346
247
 
347
248
  }
348
249
 
349
- /**
350
- * @typedef {Object} MigrationsGetFirebaseReportOAuthRequestParams
351
- * @property {string[]} resources List of resources to migrate
352
- * @property {string} projectId Project ID
353
- * @property {boolean} overrideForCli
354
- * @property {boolean} parseOutput
355
- * @property {libClient | undefined} sdk
356
- */
357
-
358
- /**
359
- * @param {MigrationsGetFirebaseReportOAuthRequestParams} params
360
- */
361
- const migrationsGetFirebaseReportOAuth = async ({resources,projectId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
362
- let client = !sdk ? await sdkForProject() :
363
- sdk;
364
- let apiPath = '/migrations/firebase/report/oauth';
365
- let payload = {};
366
- if (typeof resources !== 'undefined') {
367
- payload['resources'] = resources;
368
- }
369
- if (typeof projectId !== 'undefined') {
370
- payload['projectId'] = projectId;
371
- }
372
-
373
- let response = undefined;
374
-
375
- response = await client.call('get', apiPath, {
376
- 'content-type': 'application/json',
377
- }, payload);
378
-
379
- if (parseOutput) {
380
- parse(response)
381
- }
382
-
383
- return response;
384
-
385
- }
386
-
387
250
  /**
388
251
  * @typedef {Object} MigrationsCreateNHostMigrationRequestParams
389
252
  * @property {string[]} resources List of resources to migrate
@@ -722,7 +585,7 @@ const migrationsDelete = async ({migrationId,parseOutput = true, overrideForCli
722
585
  migrations
723
586
  .command(`list`)
724
587
  .description(``)
725
- .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, stage, source, resources, statusCounters, resourceData, errors`)
588
+ .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, stage, source, destination, resources, statusCounters, resourceData, errors`)
726
589
  .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
727
590
  .action(actionRunner(migrationsList))
728
591
 
@@ -751,23 +614,6 @@ migrations
751
614
  .requiredOption(`--service-account <service-account>`, `JSON of the Firebase service account credentials`)
752
615
  .action(actionRunner(migrationsCreateFirebaseMigration))
753
616
 
754
- migrations
755
- .command(`delete-firebase-auth`)
756
- .description(``)
757
- .action(actionRunner(migrationsDeleteFirebaseAuth))
758
-
759
- migrations
760
- .command(`create-firebase-o-auth-migration`)
761
- .description(``)
762
- .requiredOption(`--resources [resources...]`, `List of resources to migrate`)
763
- .requiredOption(`--project-id <project-id>`, `Project ID of the Firebase Project`)
764
- .action(actionRunner(migrationsCreateFirebaseOAuthMigration))
765
-
766
- migrations
767
- .command(`list-firebase-projects`)
768
- .description(``)
769
- .action(actionRunner(migrationsListFirebaseProjects))
770
-
771
617
  migrations
772
618
  .command(`get-firebase-report`)
773
619
  .description(``)
@@ -775,13 +621,6 @@ migrations
775
621
  .requiredOption(`--service-account <service-account>`, `JSON of the Firebase service account credentials`)
776
622
  .action(actionRunner(migrationsGetFirebaseReport))
777
623
 
778
- migrations
779
- .command(`get-firebase-report-o-auth`)
780
- .description(``)
781
- .requiredOption(`--resources [resources...]`, `List of resources to migrate`)
782
- .requiredOption(`--project-id <project-id>`, `Project ID`)
783
- .action(actionRunner(migrationsGetFirebaseReportOAuth))
784
-
785
624
  migrations
786
625
  .command(`create-n-host-migration`)
787
626
  .description(``)
@@ -856,11 +695,7 @@ module.exports = {
856
695
  migrationsCreateAppwriteMigration,
857
696
  migrationsGetAppwriteReport,
858
697
  migrationsCreateFirebaseMigration,
859
- migrationsDeleteFirebaseAuth,
860
- migrationsCreateFirebaseOAuthMigration,
861
- migrationsListFirebaseProjects,
862
698
  migrationsGetFirebaseReport,
863
- migrationsGetFirebaseReportOAuth,
864
699
  migrationsCreateNHostMigration,
865
700
  migrationsGetNHostReport,
866
701
  migrationsCreateSupabaseMigration,
@@ -479,6 +479,49 @@ const projectsUpdateAuthSessionsLimit = async ({projectId,limit,parseOutput = tr
479
479
 
480
480
  }
481
481
 
482
+ /**
483
+ * @typedef {Object} ProjectsUpdateMembershipsPrivacyRequestParams
484
+ * @property {string} projectId Project unique ID.
485
+ * @property {boolean} userName Set to true to show userName to members of a team.
486
+ * @property {boolean} userEmail Set to true to show email to members of a team.
487
+ * @property {boolean} mfa Set to true to show mfa to members of a team.
488
+ * @property {boolean} overrideForCli
489
+ * @property {boolean} parseOutput
490
+ * @property {libClient | undefined} sdk
491
+ */
492
+
493
+ /**
494
+ * @param {ProjectsUpdateMembershipsPrivacyRequestParams} params
495
+ */
496
+ const projectsUpdateMembershipsPrivacy = async ({projectId,userName,userEmail,mfa,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
497
+ let client = !sdk ? await sdkForConsole() :
498
+ sdk;
499
+ let apiPath = '/projects/{projectId}/auth/memberships-privacy'.replace('{projectId}', projectId);
500
+ let payload = {};
501
+ if (typeof userName !== 'undefined') {
502
+ payload['userName'] = userName;
503
+ }
504
+ if (typeof userEmail !== 'undefined') {
505
+ payload['userEmail'] = userEmail;
506
+ }
507
+ if (typeof mfa !== 'undefined') {
508
+ payload['mfa'] = mfa;
509
+ }
510
+
511
+ let response = undefined;
512
+
513
+ response = await client.call('patch', apiPath, {
514
+ 'content-type': 'application/json',
515
+ }, payload);
516
+
517
+ if (parseOutput) {
518
+ parse(response)
519
+ }
520
+
521
+ return response;
522
+
523
+ }
524
+
482
525
  /**
483
526
  * @typedef {Object} ProjectsUpdateMockNumbersRequestParams
484
527
  * @property {string} projectId Project unique ID.
@@ -1985,6 +2028,15 @@ projects
1985
2028
  .requiredOption(`--limit <limit>`, `Set the max number of users allowed in this project. Value allowed is between 1-100. Default is 10`, parseInteger)
1986
2029
  .action(actionRunner(projectsUpdateAuthSessionsLimit))
1987
2030
 
2031
+ projects
2032
+ .command(`update-memberships-privacy`)
2033
+ .description(``)
2034
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2035
+ .requiredOption(`--user-name <user-name>`, `Set to true to show userName to members of a team.`, parseBool)
2036
+ .requiredOption(`--user-email <user-email>`, `Set to true to show email to members of a team.`, parseBool)
2037
+ .requiredOption(`--mfa <mfa>`, `Set to true to show mfa to members of a team.`, parseBool)
2038
+ .action(actionRunner(projectsUpdateMembershipsPrivacy))
2039
+
1988
2040
  projects
1989
2041
  .command(`update-mock-numbers`)
1990
2042
  .description(``)
@@ -2305,6 +2357,7 @@ module.exports = {
2305
2357
  projectsUpdateAuthDuration,
2306
2358
  projectsUpdateAuthLimit,
2307
2359
  projectsUpdateAuthSessionsLimit,
2360
+ projectsUpdateMembershipsPrivacy,
2308
2361
  projectsUpdateMockNumbers,
2309
2362
  projectsUpdateAuthPasswordDictionary,
2310
2363
  projectsUpdateAuthPasswordHistory,
@@ -1095,6 +1095,7 @@ const pushFunction = async ({ functionId, async, code, withVariables } = { retur
1095
1095
  response = await functionsUpdate({
1096
1096
  functionId: func['$id'],
1097
1097
  name: func.name,
1098
+ specification: func.specification,
1098
1099
  execute: func.execute,
1099
1100
  events: func.events,
1100
1101
  schedule: func.schedule,
@@ -1126,6 +1127,7 @@ const pushFunction = async ({ functionId, async, code, withVariables } = { retur
1126
1127
  functionId: func.$id,
1127
1128
  name: func.name,
1128
1129
  runtime: func.runtime,
1130
+ specification: func.specification,
1129
1131
  execute: func.execute,
1130
1132
  events: func.events,
1131
1133
  schedule: func.schedule,
@@ -1134,6 +1136,7 @@ const pushFunction = async ({ functionId, async, code, withVariables } = { retur
1134
1136
  logging: func.logging,
1135
1137
  entrypoint: func.entrypoint,
1136
1138
  commands: func.commands,
1139
+ scopes: func.scopes,
1137
1140
  vars: JSON.stringify(func.vars),
1138
1141
  parseOutput: false
1139
1142
  });
@@ -607,7 +607,7 @@ teams
607
607
 
608
608
  teams
609
609
  .command(`list-memberships`)
610
- .description(`Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.`)
610
+ .description(`Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.`)
611
611
  .requiredOption(`--team-id <team-id>`, `Team ID.`)
612
612
  .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, teamId, invited, joined, confirm`)
613
613
  .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
@@ -627,7 +627,7 @@ teams
627
627
 
628
628
  teams
629
629
  .command(`get-membership`)
630
- .description(`Get a team member by the membership unique id. All team members have read access for this resource.`)
630
+ .description(`Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.`)
631
631
  .requiredOption(`--team-id <team-id>`, `Team ID.`)
632
632
  .requiredOption(`--membership-id <membership-id>`, `Membership ID.`)
633
633
  .action(actionRunner(teamsGetMembership))
package/lib/config.js CHANGED
@@ -5,7 +5,7 @@ const process = require("process");
5
5
  const JSONbig = require("json-bigint")({ storeAsString: false });
6
6
 
7
7
  const KeysVars = new Set(["key", "value"]);
8
- const KeysFunction = new Set(["path", "$id", "execute", "name", "enabled", "logging", "runtime", "scopes", "events", "schedule", "timeout", "entrypoint", "commands", "vars"]);
8
+ const KeysFunction = new Set(["path", "$id", "execute", "name", "enabled", "logging", "runtime", "specification", "scopes", "events", "schedule", "timeout", "entrypoint", "commands", "vars"]);
9
9
  const KeysDatabase = new Set(["$id", "name", "enabled"]);
10
10
  const KeysCollection = new Set(["$id", "$permissions", "databaseId", "name", "enabled", "documentSecurity", "attributes", "indexes"]);
11
11
  const KeysStorage = new Set(["$id", "$permissions", "fileSecurity", "name", "enabled", "maximumFileSize", "allowedFileExtensions", "compression", "encryption", "antivirus"]);
@@ -25,67 +25,67 @@ const runtimeNames = {
25
25
  const systemTools = {
26
26
  'node': {
27
27
  isCompiled: false,
28
- startCommand: "node src/server.js",
28
+ startCommand: "sh helpers/server.sh",
29
29
  dependencyFiles: [ "package.json", "package-lock.json" ]
30
30
  },
31
31
  'php': {
32
32
  isCompiled: false,
33
- startCommand: "php src/server.php",
33
+ startCommand: "sh helpers/server.sh",
34
34
  dependencyFiles: [ "composer.json", "composer.lock" ]
35
35
  },
36
36
  'ruby': {
37
37
  isCompiled: false,
38
- startCommand: "bundle exec puma -b tcp://0.0.0.0:3000 -e production",
38
+ startCommand: "sh helpers/server.sh",
39
39
  dependencyFiles: [ "Gemfile", "Gemfile.lock" ]
40
40
  },
41
41
  'python': {
42
42
  isCompiled: false,
43
- startCommand: "python3 src/server.py",
43
+ startCommand: "sh helpers/server.sh",
44
44
  dependencyFiles: [ "requirements.txt", "requirements.lock" ]
45
45
  },
46
46
  'python-ml': {
47
47
  isCompiled: false,
48
- startCommand: "python3 src/server.py",
48
+ startCommand: "sh helpers/server.sh",
49
49
  dependencyFiles: [ "requirements.txt", "requirements.lock" ]
50
50
  },
51
51
  'deno': {
52
52
  isCompiled: false,
53
- startCommand: "deno run --allow-run --allow-net --allow-write --allow-read --allow-env src/server.ts",
53
+ startCommand: "sh helpers/server.sh",
54
54
  dependencyFiles: [ ]
55
55
  },
56
56
  'dart': {
57
57
  isCompiled: true,
58
- startCommand: "src/function/server",
58
+ startCommand: "sh helpers/server.sh",
59
59
  dependencyFiles: [ ]
60
60
  },
61
61
  'dotnet': {
62
62
  isCompiled: true,
63
- startCommand: "dotnet src/function/DotNetRuntime.dll",
63
+ startCommand: "sh helpers/server.sh",
64
64
  dependencyFiles: [ ]
65
65
  },
66
66
  'java': {
67
67
  isCompiled: true,
68
- startCommand: "java -jar src/function/java-runtime-1.0.0.jar",
68
+ startCommand: "sh helpers/server.sh",
69
69
  dependencyFiles: [ ]
70
70
  },
71
71
  'swift': {
72
72
  isCompiled: true,
73
- startCommand: "src/function/Runtime serve --env production --hostname 0.0.0.0 --port 3000",
73
+ startCommand: "sh helpers/server.sh",
74
74
  dependencyFiles: [ ]
75
75
  },
76
76
  'kotlin': {
77
77
  isCompiled: true,
78
- startCommand: "java -jar src/function/kotlin-runtime-1.0.0.jar",
78
+ startCommand: "sh helpers/server.sh",
79
79
  dependencyFiles: [ ]
80
80
  },
81
81
  'bun': {
82
82
  isCompiled: false,
83
- startCommand: "bun src/server.ts",
83
+ startCommand: "sh helpers/server.sh",
84
84
  dependencyFiles: [ "package.json", "package-lock.json", "bun.lockb" ]
85
85
  },
86
86
  'go': {
87
87
  isCompiled: true,
88
- startCommand: "src/function/server",
88
+ startCommand: "sh helpers/server.sh",
89
89
  dependencyFiles: [ ]
90
90
  },
91
91
  };
package/lib/parser.js CHANGED
@@ -120,7 +120,7 @@ const parseError = (err) => {
120
120
  } catch {
121
121
  }
122
122
 
123
- const version = '6.1.0';
123
+ const version = '6.2.0';
124
124
  const stepsToReproduce = `Running \`appwrite ${cliConfig.reportData.data.args.join(' ')}\``;
125
125
  const yourEnvironment = `CLI version: ${version}\nOperation System: ${os.type()}\nAppwrite version: ${appwriteVersion}\nIs Cloud: ${isCloud}`;
126
126
 
package/lib/questions.js CHANGED
@@ -3,7 +3,7 @@ const Client = require("./client");
3
3
  const { localConfig, globalConfig } = require('./config');
4
4
  const { projectsList } = require('./commands/projects');
5
5
  const { teamsList } = require('./commands/teams');
6
- const { functionsListRuntimes, functionsList } = require('./commands/functions');
6
+ const { functionsListRuntimes, functionsListSpecifications, functionsList } = require('./commands/functions');
7
7
  const { accountListMfaFactors } = require("./commands/account");
8
8
  const { sdkForConsole } = require("./sdks");
9
9
  const { validateRequired } = require("./validations");
@@ -301,6 +301,25 @@ const questionsCreateFunction = [
301
301
  })
302
302
  return choices;
303
303
  },
304
+ },
305
+ {
306
+ type: "list",
307
+ name: "specification",
308
+ message: "What specification would you like to use?",
309
+ choices: async () => {
310
+ let response = await functionsListSpecifications({
311
+ parseOutput: false
312
+ })
313
+ let specifications = response["specifications"]
314
+ let choices = specifications.map((spec, idx) => {
315
+ return {
316
+ name: `${spec.cpus} CPU, ${spec.memory}MB RAM`,
317
+ value: spec.slug,
318
+ disabled: spec.enabled === false ? 'Upgrade to use' : false
319
+ }
320
+ })
321
+ return choices;
322
+ },
304
323
  }
305
324
  ];
306
325
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "appwrite-cli",
3
3
  "homepage": "https://appwrite.io/support",
4
4
  "description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API",
5
- "version": "6.1.0",
5
+ "version": "6.2.0",
6
6
  "license": "BSD-3-Clause",
7
7
  "main": "index.js",
8
8
  "bin": {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/ScoopInstaller/Scoop/master/schema.json",
3
- "version": "6.1.0",
3
+ "version": "6.2.0",
4
4
  "description": "The Appwrite CLI is a command-line application that allows you to interact with Appwrite and perform server-side tasks using your terminal.",
5
5
  "homepage": "https://github.com/appwrite/sdk-for-cli",
6
6
  "license": "BSD-3-Clause",
7
7
  "architecture": {
8
8
  "64bit": {
9
- "url": "https://github.com/appwrite/sdk-for-cli/releases/download/6.1.0/appwrite-cli-win-x64.exe",
9
+ "url": "https://github.com/appwrite/sdk-for-cli/releases/download/6.2.0/appwrite-cli-win-x64.exe",
10
10
  "bin": [
11
11
  [
12
12
  "appwrite-cli-win-x64.exe",
@@ -15,7 +15,7 @@
15
15
  ]
16
16
  },
17
17
  "arm64": {
18
- "url": "https://github.com/appwrite/sdk-for-cli/releases/download/6.1.0/appwrite-cli-win-arm64.exe",
18
+ "url": "https://github.com/appwrite/sdk-for-cli/releases/download/6.2.0/appwrite-cli-win-arm64.exe",
19
19
  "bin": [
20
20
  [
21
21
  "appwrite-cli-win-arm64.exe",
@@ -1,3 +0,0 @@
1
- appwrite migrations createFirebaseOAuthMigration \
2
- --resources one two three \
3
- --projectId <PROJECT_ID>
@@ -1 +0,0 @@
1
- appwrite migrations deleteFirebaseAuth
@@ -1,3 +0,0 @@
1
- appwrite migrations getFirebaseReportOAuth \
2
- --resources one two three \
3
- --projectId <PROJECT_ID>
@@ -1 +0,0 @@
1
- appwrite migrations listFirebaseProjects