appwrite-cli 6.0.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.
Files changed (40) hide show
  1. package/.github/workflows/npm-publish.yml +2 -1
  2. package/LICENSE.md +1 -1
  3. package/README.md +3 -3
  4. package/docs/examples/databases/update-boolean-attribute.md +2 -1
  5. package/docs/examples/databases/update-datetime-attribute.md +2 -1
  6. package/docs/examples/databases/update-email-attribute.md +2 -1
  7. package/docs/examples/databases/update-enum-attribute.md +2 -1
  8. package/docs/examples/databases/update-float-attribute.md +2 -1
  9. package/docs/examples/databases/update-integer-attribute.md +2 -1
  10. package/docs/examples/databases/update-ip-attribute.md +2 -1
  11. package/docs/examples/databases/update-relationship-attribute.md +1 -0
  12. package/docs/examples/databases/update-string-attribute.md +3 -1
  13. package/docs/examples/databases/update-url-attribute.md +2 -1
  14. package/docs/examples/messaging/create-push.md +5 -2
  15. package/docs/examples/messaging/update-push.md +3 -0
  16. package/docs/examples/projects/update-memberships-privacy.md +5 -0
  17. package/install.ps1 +2 -2
  18. package/install.sh +1 -1
  19. package/lib/client.js +2 -2
  20. package/lib/commands/account.js +1 -1
  21. package/lib/commands/databases.js +65 -10
  22. package/lib/commands/generic.js +1 -1
  23. package/lib/commands/init.js +1 -0
  24. package/lib/commands/messaging.js +40 -10
  25. package/lib/commands/migrations.js +2 -167
  26. package/lib/commands/projects.js +53 -0
  27. package/lib/commands/push.js +3 -0
  28. package/lib/commands/run.js +4 -4
  29. package/lib/commands/teams.js +2 -2
  30. package/lib/config.js +5 -1
  31. package/lib/emulation/docker.js +6 -6
  32. package/lib/emulation/utils.js +13 -13
  33. package/lib/parser.js +1 -1
  34. package/lib/questions.js +21 -2
  35. package/package.json +1 -1
  36. package/scoop/appwrite.json +3 -3
  37. package/docs/examples/migrations/create-firebase-o-auth-migration.md +0 -3
  38. package/docs/examples/migrations/delete-firebase-auth.md +0 -1
  39. package/docs/examples/migrations/get-firebase-report-o-auth.md +0 -3
  40. package/docs/examples/migrations/list-firebase-projects.md +0 -1
@@ -13,7 +13,8 @@ jobs:
13
13
  registry-url: 'https://registry.npmjs.org'
14
14
  - name: Setup binfmt with QEMU
15
15
  run: |
16
- sudo apt install qemu binfmt-support qemu-user-static
16
+ sudo apt update
17
+ sudo apt install qemu-system binfmt-support qemu-user-static
17
18
  update-binfmts --display
18
19
  - name: Setup ldid
19
20
  run: |
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.0.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.0.0
63
+ 6.2.0
64
64
  ```
65
65
 
66
66
  ## Getting Started
@@ -3,4 +3,5 @@ appwrite databases updateBooleanAttribute \
3
3
  --collectionId <COLLECTION_ID> \
4
4
  --key '' \
5
5
  --required false \
6
- --default false
6
+ --default false \
7
+
@@ -3,4 +3,5 @@ appwrite databases updateDatetimeAttribute \
3
3
  --collectionId <COLLECTION_ID> \
4
4
  --key '' \
5
5
  --required false \
6
- --default ''
6
+ --default '' \
7
+
@@ -3,4 +3,5 @@ appwrite databases updateEmailAttribute \
3
3
  --collectionId <COLLECTION_ID> \
4
4
  --key '' \
5
5
  --required false \
6
- --default email@example.com
6
+ --default email@example.com \
7
+
@@ -4,4 +4,5 @@ appwrite databases updateEnumAttribute \
4
4
  --key '' \
5
5
  --elements one two three \
6
6
  --required false \
7
- --default <DEFAULT>
7
+ --default <DEFAULT> \
8
+
@@ -5,4 +5,5 @@ appwrite databases updateFloatAttribute \
5
5
  --required false \
6
6
  --min null \
7
7
  --max null \
8
- --default null
8
+ --default null \
9
+
@@ -5,4 +5,5 @@ appwrite databases updateIntegerAttribute \
5
5
  --required false \
6
6
  --min null \
7
7
  --max null \
8
- --default null
8
+ --default null \
9
+
@@ -3,4 +3,5 @@ appwrite databases updateIpAttribute \
3
3
  --collectionId <COLLECTION_ID> \
4
4
  --key '' \
5
5
  --required false \
6
- --default ''
6
+ --default '' \
7
+
@@ -3,3 +3,4 @@ appwrite databases updateRelationshipAttribute \
3
3
  --collectionId <COLLECTION_ID> \
4
4
  --key '' \
5
5
 
6
+
@@ -3,4 +3,6 @@ appwrite databases updateStringAttribute \
3
3
  --collectionId <COLLECTION_ID> \
4
4
  --key '' \
5
5
  --required false \
6
- --default <DEFAULT>
6
+ --default <DEFAULT> \
7
+
8
+
@@ -3,4 +3,5 @@ appwrite databases updateUrlAttribute \
3
3
  --collectionId <COLLECTION_ID> \
4
4
  --key '' \
5
5
  --required false \
6
- --default https://example.com
6
+ --default https://example.com \
7
+
@@ -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.0.0/appwrite-cli-win-x64.exe"
17
- $GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/6.0.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.0.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.0.0',
20
- 'user-agent' : `AppwriteCLI/6.0.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.`)
@@ -569,6 +569,7 @@ const databasesCreateBooleanAttribute = async ({databaseId,collectionId,key,requ
569
569
  * @property {string} key Attribute Key.
570
570
  * @property {boolean} required Is attribute required?
571
571
  * @property {boolean} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
572
+ * @property {string} newKey New attribute key.
572
573
  * @property {boolean} overrideForCli
573
574
  * @property {boolean} parseOutput
574
575
  * @property {libClient | undefined} sdk
@@ -577,7 +578,7 @@ const databasesCreateBooleanAttribute = async ({databaseId,collectionId,key,requ
577
578
  /**
578
579
  * @param {DatabasesUpdateBooleanAttributeRequestParams} params
579
580
  */
580
- const databasesUpdateBooleanAttribute = async ({databaseId,collectionId,key,required,xdefault,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
581
+ const databasesUpdateBooleanAttribute = async ({databaseId,collectionId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
581
582
  let client = !sdk ? await sdkForProject() :
582
583
  sdk;
583
584
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
@@ -588,6 +589,9 @@ const databasesUpdateBooleanAttribute = async ({databaseId,collectionId,key,requ
588
589
  if (typeof xdefault !== 'undefined') {
589
590
  payload['default'] = xdefault;
590
591
  }
592
+ if (typeof newKey !== 'undefined') {
593
+ payload['newKey'] = newKey;
594
+ }
591
595
 
592
596
  let response = undefined;
593
597
 
@@ -658,6 +662,7 @@ const databasesCreateDatetimeAttribute = async ({databaseId,collectionId,key,req
658
662
  * @property {string} key Attribute Key.
659
663
  * @property {boolean} required Is attribute required?
660
664
  * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
665
+ * @property {string} newKey New attribute key.
661
666
  * @property {boolean} overrideForCli
662
667
  * @property {boolean} parseOutput
663
668
  * @property {libClient | undefined} sdk
@@ -666,7 +671,7 @@ const databasesCreateDatetimeAttribute = async ({databaseId,collectionId,key,req
666
671
  /**
667
672
  * @param {DatabasesUpdateDatetimeAttributeRequestParams} params
668
673
  */
669
- const databasesUpdateDatetimeAttribute = async ({databaseId,collectionId,key,required,xdefault,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
674
+ const databasesUpdateDatetimeAttribute = async ({databaseId,collectionId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
670
675
  let client = !sdk ? await sdkForProject() :
671
676
  sdk;
672
677
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
@@ -677,6 +682,9 @@ const databasesUpdateDatetimeAttribute = async ({databaseId,collectionId,key,req
677
682
  if (typeof xdefault !== 'undefined') {
678
683
  payload['default'] = xdefault;
679
684
  }
685
+ if (typeof newKey !== 'undefined') {
686
+ payload['newKey'] = newKey;
687
+ }
680
688
 
681
689
  let response = undefined;
682
690
 
@@ -747,6 +755,7 @@ const databasesCreateEmailAttribute = async ({databaseId,collectionId,key,requir
747
755
  * @property {string} key Attribute Key.
748
756
  * @property {boolean} required Is attribute required?
749
757
  * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
758
+ * @property {string} newKey New attribute key.
750
759
  * @property {boolean} overrideForCli
751
760
  * @property {boolean} parseOutput
752
761
  * @property {libClient | undefined} sdk
@@ -755,7 +764,7 @@ const databasesCreateEmailAttribute = async ({databaseId,collectionId,key,requir
755
764
  /**
756
765
  * @param {DatabasesUpdateEmailAttributeRequestParams} params
757
766
  */
758
- const databasesUpdateEmailAttribute = async ({databaseId,collectionId,key,required,xdefault,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
767
+ const databasesUpdateEmailAttribute = async ({databaseId,collectionId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
759
768
  let client = !sdk ? await sdkForProject() :
760
769
  sdk;
761
770
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/email/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
@@ -766,6 +775,9 @@ const databasesUpdateEmailAttribute = async ({databaseId,collectionId,key,requir
766
775
  if (typeof xdefault !== 'undefined') {
767
776
  payload['default'] = xdefault;
768
777
  }
778
+ if (typeof newKey !== 'undefined') {
779
+ payload['newKey'] = newKey;
780
+ }
769
781
 
770
782
  let response = undefined;
771
783
 
@@ -842,6 +854,7 @@ const databasesCreateEnumAttribute = async ({databaseId,collectionId,key,element
842
854
  * @property {string[]} elements Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long.
843
855
  * @property {boolean} required Is attribute required?
844
856
  * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
857
+ * @property {string} newKey New attribute key.
845
858
  * @property {boolean} overrideForCli
846
859
  * @property {boolean} parseOutput
847
860
  * @property {libClient | undefined} sdk
@@ -850,7 +863,7 @@ const databasesCreateEnumAttribute = async ({databaseId,collectionId,key,element
850
863
  /**
851
864
  * @param {DatabasesUpdateEnumAttributeRequestParams} params
852
865
  */
853
- const databasesUpdateEnumAttribute = async ({databaseId,collectionId,key,elements,required,xdefault,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
866
+ const databasesUpdateEnumAttribute = async ({databaseId,collectionId,key,elements,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
854
867
  let client = !sdk ? await sdkForProject() :
855
868
  sdk;
856
869
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
@@ -865,6 +878,9 @@ const databasesUpdateEnumAttribute = async ({databaseId,collectionId,key,element
865
878
  if (typeof xdefault !== 'undefined') {
866
879
  payload['default'] = xdefault;
867
880
  }
881
+ if (typeof newKey !== 'undefined') {
882
+ payload['newKey'] = newKey;
883
+ }
868
884
 
869
885
  let response = undefined;
870
886
 
@@ -945,6 +961,7 @@ const databasesCreateFloatAttribute = async ({databaseId,collectionId,key,requir
945
961
  * @property {number} min Minimum value to enforce on new documents
946
962
  * @property {number} max Maximum value to enforce on new documents
947
963
  * @property {number} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
964
+ * @property {string} newKey New attribute key.
948
965
  * @property {boolean} overrideForCli
949
966
  * @property {boolean} parseOutput
950
967
  * @property {libClient | undefined} sdk
@@ -953,7 +970,7 @@ const databasesCreateFloatAttribute = async ({databaseId,collectionId,key,requir
953
970
  /**
954
971
  * @param {DatabasesUpdateFloatAttributeRequestParams} params
955
972
  */
956
- const databasesUpdateFloatAttribute = async ({databaseId,collectionId,key,required,min,max,xdefault,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
973
+ const databasesUpdateFloatAttribute = async ({databaseId,collectionId,key,required,min,max,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
957
974
  let client = !sdk ? await sdkForProject() :
958
975
  sdk;
959
976
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/float/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
@@ -970,6 +987,9 @@ const databasesUpdateFloatAttribute = async ({databaseId,collectionId,key,requir
970
987
  if (typeof xdefault !== 'undefined') {
971
988
  payload['default'] = xdefault;
972
989
  }
990
+ if (typeof newKey !== 'undefined') {
991
+ payload['newKey'] = newKey;
992
+ }
973
993
 
974
994
  let response = undefined;
975
995
 
@@ -1050,6 +1070,7 @@ const databasesCreateIntegerAttribute = async ({databaseId,collectionId,key,requ
1050
1070
  * @property {number} min Minimum value to enforce on new documents
1051
1071
  * @property {number} max Maximum value to enforce on new documents
1052
1072
  * @property {number} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
1073
+ * @property {string} newKey New attribute key.
1053
1074
  * @property {boolean} overrideForCli
1054
1075
  * @property {boolean} parseOutput
1055
1076
  * @property {libClient | undefined} sdk
@@ -1058,7 +1079,7 @@ const databasesCreateIntegerAttribute = async ({databaseId,collectionId,key,requ
1058
1079
  /**
1059
1080
  * @param {DatabasesUpdateIntegerAttributeRequestParams} params
1060
1081
  */
1061
- const databasesUpdateIntegerAttribute = async ({databaseId,collectionId,key,required,min,max,xdefault,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1082
+ const databasesUpdateIntegerAttribute = async ({databaseId,collectionId,key,required,min,max,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1062
1083
  let client = !sdk ? await sdkForProject() :
1063
1084
  sdk;
1064
1085
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/integer/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
@@ -1075,6 +1096,9 @@ const databasesUpdateIntegerAttribute = async ({databaseId,collectionId,key,requ
1075
1096
  if (typeof xdefault !== 'undefined') {
1076
1097
  payload['default'] = xdefault;
1077
1098
  }
1099
+ if (typeof newKey !== 'undefined') {
1100
+ payload['newKey'] = newKey;
1101
+ }
1078
1102
 
1079
1103
  let response = undefined;
1080
1104
 
@@ -1145,6 +1169,7 @@ const databasesCreateIpAttribute = async ({databaseId,collectionId,key,required,
1145
1169
  * @property {string} key Attribute Key.
1146
1170
  * @property {boolean} required Is attribute required?
1147
1171
  * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
1172
+ * @property {string} newKey New attribute key.
1148
1173
  * @property {boolean} overrideForCli
1149
1174
  * @property {boolean} parseOutput
1150
1175
  * @property {libClient | undefined} sdk
@@ -1153,7 +1178,7 @@ const databasesCreateIpAttribute = async ({databaseId,collectionId,key,required,
1153
1178
  /**
1154
1179
  * @param {DatabasesUpdateIpAttributeRequestParams} params
1155
1180
  */
1156
- const databasesUpdateIpAttribute = async ({databaseId,collectionId,key,required,xdefault,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1181
+ const databasesUpdateIpAttribute = async ({databaseId,collectionId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1157
1182
  let client = !sdk ? await sdkForProject() :
1158
1183
  sdk;
1159
1184
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/ip/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
@@ -1164,6 +1189,9 @@ const databasesUpdateIpAttribute = async ({databaseId,collectionId,key,required,
1164
1189
  if (typeof xdefault !== 'undefined') {
1165
1190
  payload['default'] = xdefault;
1166
1191
  }
1192
+ if (typeof newKey !== 'undefined') {
1193
+ payload['newKey'] = newKey;
1194
+ }
1167
1195
 
1168
1196
  let response = undefined;
1169
1197
 
@@ -1298,6 +1326,8 @@ const databasesCreateStringAttribute = async ({databaseId,collectionId,key,size,
1298
1326
  * @property {string} key Attribute Key.
1299
1327
  * @property {boolean} required Is attribute required?
1300
1328
  * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
1329
+ * @property {number} size Maximum size of the string attribute.
1330
+ * @property {string} newKey New attribute key.
1301
1331
  * @property {boolean} overrideForCli
1302
1332
  * @property {boolean} parseOutput
1303
1333
  * @property {libClient | undefined} sdk
@@ -1306,7 +1336,7 @@ const databasesCreateStringAttribute = async ({databaseId,collectionId,key,size,
1306
1336
  /**
1307
1337
  * @param {DatabasesUpdateStringAttributeRequestParams} params
1308
1338
  */
1309
- const databasesUpdateStringAttribute = async ({databaseId,collectionId,key,required,xdefault,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1339
+ const databasesUpdateStringAttribute = async ({databaseId,collectionId,key,required,xdefault,size,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1310
1340
  let client = !sdk ? await sdkForProject() :
1311
1341
  sdk;
1312
1342
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/string/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
@@ -1317,6 +1347,12 @@ const databasesUpdateStringAttribute = async ({databaseId,collectionId,key,requi
1317
1347
  if (typeof xdefault !== 'undefined') {
1318
1348
  payload['default'] = xdefault;
1319
1349
  }
1350
+ if (typeof size !== 'undefined') {
1351
+ payload['size'] = size;
1352
+ }
1353
+ if (typeof newKey !== 'undefined') {
1354
+ payload['newKey'] = newKey;
1355
+ }
1320
1356
 
1321
1357
  let response = undefined;
1322
1358
 
@@ -1387,6 +1423,7 @@ const databasesCreateUrlAttribute = async ({databaseId,collectionId,key,required
1387
1423
  * @property {string} key Attribute Key.
1388
1424
  * @property {boolean} required Is attribute required?
1389
1425
  * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
1426
+ * @property {string} newKey New attribute key.
1390
1427
  * @property {boolean} overrideForCli
1391
1428
  * @property {boolean} parseOutput
1392
1429
  * @property {libClient | undefined} sdk
@@ -1395,7 +1432,7 @@ const databasesCreateUrlAttribute = async ({databaseId,collectionId,key,required
1395
1432
  /**
1396
1433
  * @param {DatabasesUpdateUrlAttributeRequestParams} params
1397
1434
  */
1398
- const databasesUpdateUrlAttribute = async ({databaseId,collectionId,key,required,xdefault,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1435
+ const databasesUpdateUrlAttribute = async ({databaseId,collectionId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1399
1436
  let client = !sdk ? await sdkForProject() :
1400
1437
  sdk;
1401
1438
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/url/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
@@ -1406,6 +1443,9 @@ const databasesUpdateUrlAttribute = async ({databaseId,collectionId,key,required
1406
1443
  if (typeof xdefault !== 'undefined') {
1407
1444
  payload['default'] = xdefault;
1408
1445
  }
1446
+ if (typeof newKey !== 'undefined') {
1447
+ payload['newKey'] = newKey;
1448
+ }
1409
1449
 
1410
1450
  let response = undefined;
1411
1451
 
@@ -1493,6 +1533,7 @@ const databasesDeleteAttribute = async ({databaseId,collectionId,key,parseOutput
1493
1533
  * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1494
1534
  * @property {string} key Attribute Key.
1495
1535
  * @property {RelationMutate} onDelete Constraints option
1536
+ * @property {string} newKey New attribute key.
1496
1537
  * @property {boolean} overrideForCli
1497
1538
  * @property {boolean} parseOutput
1498
1539
  * @property {libClient | undefined} sdk
@@ -1501,7 +1542,7 @@ const databasesDeleteAttribute = async ({databaseId,collectionId,key,parseOutput
1501
1542
  /**
1502
1543
  * @param {DatabasesUpdateRelationshipAttributeRequestParams} params
1503
1544
  */
1504
- const databasesUpdateRelationshipAttribute = async ({databaseId,collectionId,key,onDelete,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1545
+ const databasesUpdateRelationshipAttribute = async ({databaseId,collectionId,key,onDelete,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1505
1546
  let client = !sdk ? await sdkForProject() :
1506
1547
  sdk;
1507
1548
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
@@ -1509,6 +1550,9 @@ const databasesUpdateRelationshipAttribute = async ({databaseId,collectionId,key
1509
1550
  if (typeof onDelete !== 'undefined') {
1510
1551
  payload['onDelete'] = onDelete;
1511
1552
  }
1553
+ if (typeof newKey !== 'undefined') {
1554
+ payload['newKey'] = newKey;
1555
+ }
1512
1556
 
1513
1557
  let response = undefined;
1514
1558
 
@@ -2181,6 +2225,7 @@ databases
2181
2225
  .requiredOption(`--key <key>`, `Attribute Key.`)
2182
2226
  .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
2183
2227
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`, parseBool)
2228
+ .option(`--new-key <new-key>`, `New attribute key.`)
2184
2229
  .action(actionRunner(databasesUpdateBooleanAttribute))
2185
2230
 
2186
2231
  databases
@@ -2202,6 +2247,7 @@ databases
2202
2247
  .requiredOption(`--key <key>`, `Attribute Key.`)
2203
2248
  .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
2204
2249
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
2250
+ .option(`--new-key <new-key>`, `New attribute key.`)
2205
2251
  .action(actionRunner(databasesUpdateDatetimeAttribute))
2206
2252
 
2207
2253
  databases
@@ -2223,6 +2269,7 @@ databases
2223
2269
  .requiredOption(`--key <key>`, `Attribute Key.`)
2224
2270
  .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
2225
2271
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
2272
+ .option(`--new-key <new-key>`, `New attribute key.`)
2226
2273
  .action(actionRunner(databasesUpdateEmailAttribute))
2227
2274
 
2228
2275
  databases
@@ -2246,6 +2293,7 @@ databases
2246
2293
  .requiredOption(`--elements [elements...]`, `Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long.`)
2247
2294
  .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
2248
2295
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
2296
+ .option(`--new-key <new-key>`, `New attribute key.`)
2249
2297
  .action(actionRunner(databasesUpdateEnumAttribute))
2250
2298
 
2251
2299
  databases
@@ -2271,6 +2319,7 @@ databases
2271
2319
  .requiredOption(`--min <min>`, `Minimum value to enforce on new documents`, parseInteger)
2272
2320
  .requiredOption(`--max <max>`, `Maximum value to enforce on new documents`, parseInteger)
2273
2321
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`, parseInteger)
2322
+ .option(`--new-key <new-key>`, `New attribute key.`)
2274
2323
  .action(actionRunner(databasesUpdateFloatAttribute))
2275
2324
 
2276
2325
  databases
@@ -2296,6 +2345,7 @@ databases
2296
2345
  .requiredOption(`--min <min>`, `Minimum value to enforce on new documents`, parseInteger)
2297
2346
  .requiredOption(`--max <max>`, `Maximum value to enforce on new documents`, parseInteger)
2298
2347
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`, parseInteger)
2348
+ .option(`--new-key <new-key>`, `New attribute key.`)
2299
2349
  .action(actionRunner(databasesUpdateIntegerAttribute))
2300
2350
 
2301
2351
  databases
@@ -2317,6 +2367,7 @@ databases
2317
2367
  .requiredOption(`--key <key>`, `Attribute Key.`)
2318
2368
  .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
2319
2369
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
2370
+ .option(`--new-key <new-key>`, `New attribute key.`)
2320
2371
  .action(actionRunner(databasesUpdateIpAttribute))
2321
2372
 
2322
2373
  databases
@@ -2353,6 +2404,8 @@ databases
2353
2404
  .requiredOption(`--key <key>`, `Attribute Key.`)
2354
2405
  .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
2355
2406
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
2407
+ .option(`--size <size>`, `Maximum size of the string attribute.`, parseInteger)
2408
+ .option(`--new-key <new-key>`, `New attribute key.`)
2356
2409
  .action(actionRunner(databasesUpdateStringAttribute))
2357
2410
 
2358
2411
  databases
@@ -2374,6 +2427,7 @@ databases
2374
2427
  .requiredOption(`--key <key>`, `Attribute Key.`)
2375
2428
  .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
2376
2429
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
2430
+ .option(`--new-key <new-key>`, `New attribute key.`)
2377
2431
  .action(actionRunner(databasesUpdateUrlAttribute))
2378
2432
 
2379
2433
  databases
@@ -2399,6 +2453,7 @@ databases
2399
2453
  .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2400
2454
  .requiredOption(`--key <key>`, `Attribute Key.`)
2401
2455
  .option(`--on-delete <on-delete>`, `Constraints option`)
2456
+ .option(`--new-key <new-key>`, `New attribute key.`)
2402
2457
  .action(actionRunner(databasesUpdateRelationshipAttribute))
2403
2458
 
2404
2459
  databases
@@ -13,7 +13,7 @@ const DEFAULT_ENDPOINT = 'https://cloud.appwrite.io/v1';
13
13
  const loginCommand = async ({ email, password, endpoint, mfa, code }) => {
14
14
  const oldCurrent = globalConfig.getCurrentSession();
15
15
 
16
- const configEndpoint = endpoint ?? globalConfig.getEndpoint() ?? DEFAULT_ENDPOINT;
16
+ const configEndpoint = (endpoint ?? globalConfig.getEndpoint()) || DEFAULT_ENDPOINT;
17
17
 
18
18
  if (globalConfig.getCurrentSession() !== '') {
19
19
  log('You are currently signed in as ' + globalConfig.getEmail());
@@ -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"],