appwrite-cli 0.18.3 → 1.0.0-RC2

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 (65) hide show
  1. package/.github/workflows/npm-publish.yml +8 -1
  2. package/LICENSE.md +1 -1
  3. package/README.md +4 -4
  4. package/docs/examples/account/create-phone-session.md +1 -1
  5. package/docs/examples/account/get-logs.md +0 -1
  6. package/docs/examples/account/update-phone.md +1 -1
  7. package/docs/examples/avatars/get-initials.md +0 -1
  8. package/docs/examples/databases/create-collection.md +2 -3
  9. package/docs/examples/databases/create-datetime-attribute.md +7 -0
  10. package/docs/examples/databases/create-document.md +0 -1
  11. package/docs/examples/databases/list-collection-logs.md +0 -1
  12. package/docs/examples/databases/list-collections.md +0 -4
  13. package/docs/examples/databases/list-document-logs.md +0 -1
  14. package/docs/examples/databases/list-documents.md +0 -6
  15. package/docs/examples/databases/list-logs.md +0 -1
  16. package/docs/examples/databases/list.md +0 -4
  17. package/docs/examples/databases/update-collection.md +0 -1
  18. package/docs/examples/databases/update-document.md +0 -1
  19. package/docs/examples/functions/create-variable.md +4 -0
  20. package/docs/examples/functions/create.md +1 -2
  21. package/docs/examples/functions/delete-variable.md +3 -0
  22. package/docs/examples/functions/get-function-usage.md +3 -0
  23. package/docs/examples/functions/get-usage.md +0 -1
  24. package/docs/examples/functions/get-variable.md +3 -0
  25. package/docs/examples/functions/list-deployments.md +0 -4
  26. package/docs/examples/functions/list-executions.md +0 -3
  27. package/docs/examples/functions/list-variables.md +4 -0
  28. package/docs/examples/functions/list.md +0 -4
  29. package/docs/examples/functions/update-variable.md +5 -0
  30. package/docs/examples/functions/update.md +1 -2
  31. package/docs/examples/projects/list.md +0 -4
  32. package/docs/examples/storage/create-bucket.md +1 -1
  33. package/docs/examples/storage/create-file.md +0 -1
  34. package/docs/examples/storage/list-buckets.md +0 -4
  35. package/docs/examples/storage/list-files.md +0 -4
  36. package/docs/examples/storage/update-bucket.md +1 -1
  37. package/docs/examples/storage/update-file.md +0 -1
  38. package/docs/examples/teams/get-memberships.md +0 -4
  39. package/docs/examples/teams/list-logs.md +0 -1
  40. package/docs/examples/teams/list.md +0 -4
  41. package/docs/examples/users/create-argon2user.md +5 -0
  42. package/docs/examples/users/create-bcrypt-user.md +5 -0
  43. package/docs/examples/users/create-m-d5user.md +5 -0
  44. package/docs/examples/users/create-p-h-pass-user.md +5 -0
  45. package/docs/examples/users/create-s-h-a-user.md +6 -0
  46. package/docs/examples/users/create-scrypt-modified-user.md +8 -0
  47. package/docs/examples/users/create-scrypt-user.md +10 -0
  48. package/docs/examples/users/create.md +3 -2
  49. package/docs/examples/users/get-logs.md +0 -1
  50. package/docs/examples/users/list.md +0 -4
  51. package/install.ps1 +2 -2
  52. package/install.sh +1 -1
  53. package/lib/client.js +6 -3
  54. package/lib/commands/account.js +18 -23
  55. package/lib/commands/avatars.js +2 -7
  56. package/lib/commands/databases.js +154 -210
  57. package/lib/commands/functions.js +226 -92
  58. package/lib/commands/generic.js +3 -3
  59. package/lib/commands/init.js +57 -15
  60. package/lib/commands/projects.js +10 -30
  61. package/lib/commands/storage.js +53 -105
  62. package/lib/commands/teams.js +17 -62
  63. package/lib/commands/users.js +414 -36
  64. package/lib/questions.js +1 -1
  65. package/package.json +1 -1
@@ -31,7 +31,14 @@ jobs:
31
31
  npm run mac-x64
32
32
  npm run mac-arm64
33
33
  - name: Publish NPM library
34
- run: npm publish
34
+ run: |
35
+ if ${{ contains(github.event.release.tag_name, '-RC') }}; then
36
+ echo "Publishing Release Candidate ${{ github.event.release.tag_name}} to NPM"
37
+ npm publish --tag next
38
+ else
39
+ echo "Publishing ${{ github.event.release.tag_name}} to NPM"
40
+ npm publish
41
+ fi
35
42
  env:
36
43
  NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
37
44
  - uses: fnkr/github-action-ghr@v1
package/LICENSE.md CHANGED
@@ -9,4 +9,4 @@ Redistribution and use in source and binary forms, with or without modification,
9
9
 
10
10
  3. Neither the name Appwrite nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
11
11
 
12
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
12
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/README.md CHANGED
@@ -1,12 +1,12 @@
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-0.15.1-blue.svg?style=flat-square)
4
+ ![Version](https://img.shields.io/badge/api%20version-1.0.0-RC1-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)
8
8
 
9
- **This SDK is compatible with Appwrite server version 0.15.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-cli/releases).**
9
+ **This SDK is compatible with Appwrite server version 1.0.0-RC1. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-cli/releases).**
10
10
 
11
11
  Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Command Line SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
12
12
 
@@ -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
- 0.18.3
32
+ 1.0.0-RC2
33
33
  ```
34
34
 
35
35
  ### Install using prebuilt binaries
@@ -58,7 +58,7 @@ $ iwr -useb https://appwrite.io/cli/install.ps1 | iex
58
58
  Once the installation completes, you can verify your install using
59
59
  ```
60
60
  $ appwrite -v
61
- 0.18.3
61
+ 1.0.0-RC2
62
62
  ```
63
63
 
64
64
  ## Getting Started
@@ -1,3 +1,3 @@
1
1
  appwrite account createPhoneSession \
2
2
  --userId [USER_ID] \
3
- --number ''
3
+ --phone ''
@@ -1,3 +1,2 @@
1
1
  appwrite account getLogs \
2
2
 
3
-
@@ -1,3 +1,3 @@
1
1
  appwrite account updatePhone \
2
- --number '' \
2
+ --phone '' \
3
3
  --password password
@@ -3,4 +3,3 @@ appwrite avatars getInitials \
3
3
 
4
4
 
5
5
 
6
-
@@ -2,6 +2,5 @@ appwrite databases createCollection \
2
2
  --databaseId [DATABASE_ID] \
3
3
  --collectionId [COLLECTION_ID] \
4
4
  --name [NAME] \
5
- --permission document \
6
- --read "role:all" \
7
- --write "role:all"
5
+
6
+
@@ -0,0 +1,7 @@
1
+ appwrite databases createDatetimeAttribute \
2
+ --databaseId [DATABASE_ID] \
3
+ --collectionId [COLLECTION_ID] \
4
+ --key '' \
5
+ --required false \
6
+
7
+
@@ -4,4 +4,3 @@ appwrite databases createDocument \
4
4
  --documentId [DOCUMENT_ID] \
5
5
  --data '{ "key": "value" }' \
6
6
 
7
-
@@ -2,4 +2,3 @@ appwrite databases listCollectionLogs \
2
2
  --databaseId [DATABASE_ID] \
3
3
  --collectionId [COLLECTION_ID] \
4
4
 
5
-
@@ -2,7 +2,3 @@ appwrite databases listCollections \
2
2
  --databaseId [DATABASE_ID] \
3
3
 
4
4
 
5
-
6
-
7
-
8
-
@@ -3,4 +3,3 @@ appwrite databases listDocumentLogs \
3
3
  --collectionId [COLLECTION_ID] \
4
4
  --documentId [DOCUMENT_ID] \
5
5
 
6
-
@@ -2,9 +2,3 @@ appwrite databases listDocuments \
2
2
  --databaseId [DATABASE_ID] \
3
3
  --collectionId [COLLECTION_ID] \
4
4
 
5
-
6
-
7
-
8
-
9
-
10
-
@@ -1,4 +1,3 @@
1
1
  appwrite databases listLogs \
2
2
  --databaseId [DATABASE_ID] \
3
3
 
4
-
@@ -1,7 +1,3 @@
1
1
  appwrite databases list \
2
2
 
3
3
 
4
-
5
-
6
-
7
-
@@ -2,7 +2,6 @@ appwrite databases updateCollection \
2
2
  --databaseId [DATABASE_ID] \
3
3
  --collectionId [COLLECTION_ID] \
4
4
  --name [NAME] \
5
- --permission document \
6
5
 
7
6
 
8
7
 
@@ -4,4 +4,3 @@ appwrite databases updateDocument \
4
4
  --documentId [DOCUMENT_ID] \
5
5
 
6
6
 
7
-
@@ -0,0 +1,4 @@
1
+ appwrite functions createVariable \
2
+ --functionId [FUNCTION_ID] \
3
+ --key [KEY] \
4
+ --value [VALUE]
@@ -1,9 +1,8 @@
1
1
  appwrite functions create \
2
2
  --functionId [FUNCTION_ID] \
3
3
  --name [NAME] \
4
- --execute one two three \
4
+ --execute "any" \
5
5
  --runtime node-14.5 \
6
6
 
7
7
 
8
8
 
9
-
@@ -0,0 +1,3 @@
1
+ appwrite functions deleteVariable \
2
+ --functionId [FUNCTION_ID] \
3
+ --variableId [VARIABLE_ID]
@@ -0,0 +1,3 @@
1
+ appwrite functions getFunctionUsage \
2
+ --functionId [FUNCTION_ID] \
3
+
@@ -1,3 +1,2 @@
1
1
  appwrite functions getUsage \
2
- --functionId [FUNCTION_ID] \
3
2
 
@@ -0,0 +1,3 @@
1
+ appwrite functions getVariable \
2
+ --functionId [FUNCTION_ID] \
3
+ --variableId [VARIABLE_ID]
@@ -2,7 +2,3 @@ appwrite functions listDeployments \
2
2
  --functionId [FUNCTION_ID] \
3
3
 
4
4
 
5
-
6
-
7
-
8
-
@@ -2,6 +2,3 @@ appwrite functions listExecutions \
2
2
  --functionId [FUNCTION_ID] \
3
3
 
4
4
 
5
-
6
-
7
-
@@ -0,0 +1,4 @@
1
+ appwrite functions listVariables \
2
+ --functionId [FUNCTION_ID] \
3
+
4
+
@@ -1,7 +1,3 @@
1
1
  appwrite functions list \
2
2
 
3
3
 
4
-
5
-
6
-
7
-
@@ -0,0 +1,5 @@
1
+ appwrite functions updateVariable \
2
+ --functionId [FUNCTION_ID] \
3
+ --variableId [VARIABLE_ID] \
4
+ --key [KEY] \
5
+
@@ -1,8 +1,7 @@
1
1
  appwrite functions update \
2
2
  --functionId [FUNCTION_ID] \
3
3
  --name [NAME] \
4
- --execute one two three \
5
-
4
+ --execute "any" \
6
5
 
7
6
 
8
7
 
@@ -1,7 +1,3 @@
1
1
  appwrite projects list \
2
2
 
3
3
 
4
-
5
-
6
-
7
-
@@ -1,7 +1,7 @@
1
1
  appwrite storage createBucket \
2
2
  --bucketId [BUCKET_ID] \
3
3
  --name [NAME] \
4
- --permission file \
4
+
5
5
 
6
6
 
7
7
 
@@ -3,4 +3,3 @@ appwrite storage createFile \
3
3
  --fileId [FILE_ID] \
4
4
  --file 'path/to/file.png' \
5
5
 
6
-
@@ -1,7 +1,3 @@
1
1
  appwrite storage listBuckets \
2
2
 
3
3
 
4
-
5
-
6
-
7
-
@@ -2,7 +2,3 @@ appwrite storage listFiles \
2
2
  --bucketId [BUCKET_ID] \
3
3
 
4
4
 
5
-
6
-
7
-
8
-
@@ -1,7 +1,7 @@
1
1
  appwrite storage updateBucket \
2
2
  --bucketId [BUCKET_ID] \
3
3
  --name [NAME] \
4
- --permission file \
4
+
5
5
 
6
6
 
7
7
 
@@ -2,4 +2,3 @@ appwrite storage updateFile \
2
2
  --bucketId [BUCKET_ID] \
3
3
  --fileId [FILE_ID] \
4
4
 
5
-
@@ -2,7 +2,3 @@ appwrite teams getMemberships \
2
2
  --teamId [TEAM_ID] \
3
3
 
4
4
 
5
-
6
-
7
-
8
-
@@ -1,4 +1,3 @@
1
1
  appwrite teams listLogs \
2
2
  --teamId [TEAM_ID] \
3
3
 
4
-
@@ -1,7 +1,3 @@
1
1
  appwrite teams list \
2
2
 
3
3
 
4
-
5
-
6
-
7
-
@@ -0,0 +1,5 @@
1
+ appwrite users createArgon2User \
2
+ --userId [USER_ID] \
3
+ --email email@example.com \
4
+ --password password \
5
+
@@ -0,0 +1,5 @@
1
+ appwrite users createBcryptUser \
2
+ --userId [USER_ID] \
3
+ --email email@example.com \
4
+ --password password \
5
+
@@ -0,0 +1,5 @@
1
+ appwrite users createMD5User \
2
+ --userId [USER_ID] \
3
+ --email email@example.com \
4
+ --password password \
5
+
@@ -0,0 +1,5 @@
1
+ appwrite users createPHPassUser \
2
+ --userId [USER_ID] \
3
+ --email email@example.com \
4
+ --password password \
5
+
@@ -0,0 +1,6 @@
1
+ appwrite users createSHAUser \
2
+ --userId [USER_ID] \
3
+ --email email@example.com \
4
+ --password password \
5
+
6
+
@@ -0,0 +1,8 @@
1
+ appwrite users createScryptModifiedUser \
2
+ --userId [USER_ID] \
3
+ --email email@example.com \
4
+ --password password \
5
+ --passwordSalt [PASSWORD_SALT] \
6
+ --passwordSaltSeparator [PASSWORD_SALT_SEPARATOR] \
7
+ --passwordSignerKey [PASSWORD_SIGNER_KEY] \
8
+
@@ -0,0 +1,10 @@
1
+ appwrite users createScryptUser \
2
+ --userId [USER_ID] \
3
+ --email email@example.com \
4
+ --password password \
5
+ --passwordSalt [PASSWORD_SALT] \
6
+ --passwordCpu null \
7
+ --passwordMemory null \
8
+ --passwordParallel null \
9
+ --passwordLength null \
10
+
@@ -1,5 +1,6 @@
1
1
  appwrite users create \
2
2
  --userId [USER_ID] \
3
- --email email@example.com \
4
- --password password \
3
+
4
+
5
+
5
6
 
@@ -1,4 +1,3 @@
1
1
  appwrite users getLogs \
2
2
  --userId [USER_ID] \
3
3
 
4
-
@@ -1,7 +1,3 @@
1
1
  appwrite users list \
2
2
 
3
3
 
4
-
5
-
6
-
7
-
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/0.18.3/appwrite-cli-win-x64.exe"
17
- $GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/0.18.3/appwrite-cli-win-arm64.exe"
16
+ $GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/1.0.0-RC2/appwrite-cli-win-x64.exe"
17
+ $GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/1.0.0-RC2/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="0.18.3"
100
+ GITHUB_LATEST_VERSION="1.0.0-RC2"
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
@@ -12,9 +12,12 @@ class Client {
12
12
  this.endpoint = 'https://HOSTNAME/v1';
13
13
  this.headers = {
14
14
  'content-type': '',
15
- 'x-sdk-version': 'appwrite:cli:0.18.3',
16
- 'User-Agent' : `AppwriteCLI/0.18.3 (${os.type()} ${os.version()}; ${os.arch()})`,
17
- 'X-Appwrite-Response-Format' : '0.15.0',
15
+ 'x-sdk-name': 'Command Line',
16
+ 'x-sdk-platform': 'console',
17
+ 'x-sdk-language': 'cli',
18
+ 'x-sdk-version': '1.0.0-RC2',
19
+ 'user-agent' : `AppwriteCLI/1.0.0-RC2 (${os.type()} ${os.version()}; ${os.arch()})`,
20
+ 'X-Appwrite-Response-Format' : '1.0.0-RC1',
18
21
  };
19
22
  }
20
23
 
@@ -114,20 +114,16 @@ const accountCreateJWT = async ({ parseOutput = true, sdk = undefined}) => {
114
114
  return response;
115
115
  }
116
116
 
117
- const accountGetLogs = async ({ limit, offset, parseOutput = true, sdk = undefined}) => {
118
- /* @param {number} limit */
119
- /* @param {number} offset */
117
+ const accountGetLogs = async ({ queries, parseOutput = true, sdk = undefined}) => {
118
+ /* @param {string[]} queries */
120
119
 
121
120
  let client = !sdk ? await sdkForProject() : sdk;
122
121
  let path = '/account/logs';
123
122
  let payload = {};
124
123
 
125
124
  /** Query Params */
126
- if (typeof limit !== 'undefined') {
127
- payload['limit'] = limit;
128
- }
129
- if (typeof offset !== 'undefined') {
130
- payload['offset'] = offset;
125
+ if (typeof queries !== 'undefined') {
126
+ payload['queries'] = queries;
131
127
  }
132
128
  let response = undefined;
133
129
  response = await client.call('get', path, {
@@ -194,8 +190,8 @@ const accountUpdatePassword = async ({ password, oldPassword, parseOutput = true
194
190
  return response;
195
191
  }
196
192
 
197
- const accountUpdatePhone = async ({ number, password, parseOutput = true, sdk = undefined}) => {
198
- /* @param {string} number */
193
+ const accountUpdatePhone = async ({ phone, password, parseOutput = true, sdk = undefined}) => {
194
+ /* @param {string} phone */
199
195
  /* @param {string} password */
200
196
 
201
197
  let client = !sdk ? await sdkForProject() : sdk;
@@ -203,8 +199,8 @@ const accountUpdatePhone = async ({ number, password, parseOutput = true, sdk =
203
199
  let payload = {};
204
200
 
205
201
  /** Body Params */
206
- if (typeof number !== 'undefined') {
207
- payload['number'] = number;
202
+ if (typeof phone !== 'undefined') {
203
+ payload['phone'] = phone;
208
204
  }
209
205
 
210
206
  if (typeof password !== 'undefined') {
@@ -507,9 +503,9 @@ const accountCreateOAuth2Session = async ({ provider, success, failure, scopes,
507
503
  return response;
508
504
  }
509
505
 
510
- const accountCreatePhoneSession = async ({ userId, number, parseOutput = true, sdk = undefined}) => {
506
+ const accountCreatePhoneSession = async ({ userId, phone, parseOutput = true, sdk = undefined}) => {
511
507
  /* @param {string} userId */
512
- /* @param {string} number */
508
+ /* @param {string} phone */
513
509
 
514
510
  let client = !sdk ? await sdkForProject() : sdk;
515
511
  let path = '/account/sessions/phone';
@@ -520,8 +516,8 @@ const accountCreatePhoneSession = async ({ userId, number, parseOutput = true, s
520
516
  payload['userId'] = userId;
521
517
  }
522
518
 
523
- if (typeof number !== 'undefined') {
524
- payload['number'] = number;
519
+ if (typeof phone !== 'undefined') {
520
+ payload['phone'] = phone;
525
521
  }
526
522
 
527
523
  let response = undefined;
@@ -765,8 +761,7 @@ account
765
761
  account
766
762
  .command(`getLogs`)
767
763
  .description(`Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log.`)
768
- .option(`--limit <limit>`, `Maximum number of logs to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request.`, parseInteger)
769
- .option(`--offset <offset>`, `Offset value. The default value is 0. Use this value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)`, parseInteger)
764
+ .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). Only supported methods are limit and offset`)
770
765
  .action(actionRunner(accountGetLogs))
771
766
 
772
767
  account
@@ -785,7 +780,7 @@ account
785
780
  account
786
781
  .command(`updatePhone`)
787
782
  .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](/docs/client/account#accountCreatePhoneVerification) endpoint to send a confirmation SMS.`)
788
- .requiredOption(`--number <number>`, `Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`)
783
+ .requiredOption(`--phone <phone>`, `Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`)
789
784
  .requiredOption(`--password <password>`, `User password. Must be at least 8 chars.`)
790
785
  .action(actionRunner(accountUpdatePhone))
791
786
 
@@ -840,7 +835,7 @@ account
840
835
 
841
836
  account
842
837
  .command(`createMagicURLSession`)
843
- .description(`Sends the user an email with a secret key for creating a session. 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 [PUT /account/sessions/magic-url](/docs/client/account#accountUpdateMagicURLSession) 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.`)
838
+ .description(`Sends the user an email with a secret key for creating a session. If the provided user ID has not be 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 [PUT /account/sessions/magic-url](/docs/client/account#accountUpdateMagicURLSession) 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.`)
844
839
  .requiredOption(`--userId <userId>`, `Unique Id. Choose your own unique ID or pass the string "unique()" to auto generate it. 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.`)
845
840
  .requiredOption(`--email <email>`, `User email.`)
846
841
  .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.`)
@@ -856,7 +851,7 @@ account
856
851
  account
857
852
  .command(`createOAuth2Session`)
858
853
  .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. If there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.. `)
859
- .requiredOption(`--provider <provider>`, `OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, autodesk, bitbucket, bitly, box, dailymotion, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, notion, okta, paypal, paypalSandbox, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoom.`)
854
+ .requiredOption(`--provider <provider>`, `OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, github, gitlab, google, linkedin, microsoft, notion, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoom.`)
860
855
  .option(`--success <success>`, `URL to redirect back to your app after a successful login attempt. 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.`)
861
856
  .option(`--failure <failure>`, `URL to redirect back to your app after a failed login attempt. 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.`)
862
857
  .option(`--scopes <scopes...>`, `A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.`)
@@ -864,9 +859,9 @@ account
864
859
 
865
860
  account
866
861
  .command(`createPhoneSession`)
867
- .description(`Sends the user an SMS with a secret key for creating a session. Use the returned user ID and secret and submit a request to the [PUT /account/sessions/phone](/docs/client/account#accountUpdatePhoneSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.`)
862
+ .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 [PUT /account/sessions/phone](/docs/client/account#accountUpdatePhoneSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.`)
868
863
  .requiredOption(`--userId <userId>`, `Unique Id. Choose your own unique ID or pass the string "unique()" to auto generate it. 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.`)
869
- .requiredOption(`--number <number>`, `Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`)
864
+ .requiredOption(`--phone <phone>`, `Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`)
870
865
  .action(actionRunner(accountCreatePhoneSession))
871
866
 
872
867
  account
@@ -187,11 +187,10 @@ const avatarsGetImage = async ({ url, width, height, parseOutput = true, sdk = u
187
187
  }
188
188
  }
189
189
 
190
- const avatarsGetInitials = async ({ name, width, height, color, background, parseOutput = true, sdk = undefined, destination}) => {
190
+ const avatarsGetInitials = async ({ name, width, height, background, parseOutput = true, sdk = undefined, destination}) => {
191
191
  /* @param {string} name */
192
192
  /* @param {number} width */
193
193
  /* @param {number} height */
194
- /* @param {string} color */
195
194
  /* @param {string} background */
196
195
 
197
196
  let client = !sdk ? await sdkForProject() : sdk;
@@ -208,9 +207,6 @@ const avatarsGetInitials = async ({ name, width, height, color, background, pars
208
207
  if (typeof height !== 'undefined') {
209
208
  payload['height'] = height;
210
209
  }
211
- if (typeof color !== 'undefined') {
212
- payload['color'] = color;
213
- }
214
210
  if (typeof background !== 'undefined') {
215
211
  payload['background'] = background;
216
212
  }
@@ -301,7 +297,7 @@ avatars
301
297
 
302
298
  avatars
303
299
  .command(`getFlag`)
304
- .description(`You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. `)
300
+ .description(`You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) standard. When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. `)
305
301
  .requiredOption(`--code <code>`, `Country Code. ISO Alpha-2 country code format.`)
306
302
  .option(`--width <width>`, `Image width. Pass an integer between 0 to 2000. Defaults to 100.`, parseInteger)
307
303
  .option(`--height <height>`, `Image height. Pass an integer between 0 to 2000. Defaults to 100.`, parseInteger)
@@ -324,7 +320,6 @@ avatars
324
320
  .option(`--name <name>`, `Full Name. When empty, current user name or email will be used. Max length: 128 chars.`)
325
321
  .option(`--width <width>`, `Image width. Pass an integer between 0 to 2000. Defaults to 100.`, parseInteger)
326
322
  .option(`--height <height>`, `Image height. Pass an integer between 0 to 2000. Defaults to 100.`, parseInteger)
327
- .option(`--color <color>`, `Changes text color. By default a random color will be picked and stay will persistent to the given name.`)
328
323
  .option(`--background <background>`, `Changes background color. By default a random color will be picked and stay will persistent to the given name.`)
329
324
  .requiredOption(`--destination <path>`, `output file path.`)
330
325
  .action(actionRunner(avatarsGetInitials))