appwrite-cli 6.0.0-rc.3 → 6.0.0-rc.5

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/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-1.5.7-blue.svg?style=flat-square)
4
+ ![Version](https://img.shields.io/badge/api%20version-1.6.0-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 1.6.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 latest. 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
- 6.0.0-rc.3
32
+ 6.0.0-rc.5
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-rc.3
63
+ 6.0.0-rc.5
64
64
  ```
65
65
 
66
66
  ## Getting Started
@@ -1,3 +1,2 @@
1
1
  appwrite account deleteMfaAuthenticator \
2
- --type totp \
3
- --otp <OTP>
2
+ --type totp
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-rc.3/appwrite-cli-win-x64.exe"
17
- $GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/6.0.0-rc.3/appwrite-cli-win-arm64.exe"
16
+ $GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/6.0.0-rc.5/appwrite-cli-win-x64.exe"
17
+ $GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/6.0.0-rc.5/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-rc.3"
100
+ GITHUB_LATEST_VERSION="6.0.0-rc.5"
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-rc.3',
20
- 'user-agent' : `AppwriteCLI/6.0.0-rc.3 (${os.type()} ${os.version()}; ${os.arch()})`,
19
+ 'x-sdk-version': '6.0.0-rc.5',
20
+ 'user-agent' : `AppwriteCLI/6.0.0-rc.5 (${os.type()} ${os.version()}; ${os.arch()})`,
21
21
  'X-Appwrite-Response-Format' : '1.5.0',
22
22
  };
23
23
  }
@@ -430,7 +430,6 @@ const accountUpdateMfaAuthenticator = async ({type,otp,parseOutput = true, overr
430
430
  /**
431
431
  * @typedef {Object} AccountDeleteMfaAuthenticatorRequestParams
432
432
  * @property {AuthenticatorType} type Type of authenticator.
433
- * @property {string} otp Valid verification token.
434
433
  * @property {boolean} overrideForCli
435
434
  * @property {boolean} parseOutput
436
435
  * @property {libClient | undefined} sdk
@@ -439,14 +438,11 @@ const accountUpdateMfaAuthenticator = async ({type,otp,parseOutput = true, overr
439
438
  /**
440
439
  * @param {AccountDeleteMfaAuthenticatorRequestParams} params
441
440
  */
442
- const accountDeleteMfaAuthenticator = async ({type,otp,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
441
+ const accountDeleteMfaAuthenticator = async ({type,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
443
442
  let client = !sdk ? await sdkForProject() :
444
443
  sdk;
445
444
  let apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type);
446
445
  let payload = {};
447
- if (typeof otp !== 'undefined') {
448
- payload['otp'] = otp;
449
- }
450
446
 
451
447
  let response = undefined;
452
448
 
@@ -1783,7 +1779,7 @@ account
1783
1779
  account
1784
1780
  .command(`create`)
1785
1781
  .description(`Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [/account/verfication](https://appwrite.io/docs/references/cloud/client-web/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https://appwrite.io/docs/references/cloud/client-web/account#createEmailSession).`)
1786
- .requiredOption(`--userId <userId>`, `User ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
1782
+ .requiredOption(`--user-id <user-id>`, `User ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
1787
1783
  .requiredOption(`--email <email>`, `User email.`)
1788
1784
  .requiredOption(`--password <password>`, `New user password. Must be between 8 and 256 chars.`)
1789
1785
  .option(`--name <name>`, `User name. Max length: 128 chars.`)
@@ -1795,172 +1791,171 @@ account
1795
1791
  .action(actionRunner(accountDelete))
1796
1792
 
1797
1793
  account
1798
- .command(`updateEmail`)
1794
+ .command(`update-email`)
1799
1795
  .description(`Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request. This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password. `)
1800
1796
  .requiredOption(`--email <email>`, `User email.`)
1801
1797
  .requiredOption(`--password <password>`, `User password. Must be at least 8 chars.`)
1802
1798
  .action(actionRunner(accountUpdateEmail))
1803
1799
 
1804
1800
  account
1805
- .command(`listIdentities`)
1801
+ .command(`list-identities`)
1806
1802
  .description(`Get the list of identities for the currently logged in user.`)
1807
1803
  .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry`)
1808
1804
  .action(actionRunner(accountListIdentities))
1809
1805
 
1810
1806
  account
1811
- .command(`deleteIdentity`)
1807
+ .command(`delete-identity`)
1812
1808
  .description(`Delete an identity by its unique ID.`)
1813
- .requiredOption(`--identityId <identityId>`, `Identity ID.`)
1809
+ .requiredOption(`--identity-id <identity-id>`, `Identity ID.`)
1814
1810
  .action(actionRunner(accountDeleteIdentity))
1815
1811
 
1816
1812
  account
1817
- .command(`createJWT`)
1813
+ .command(`create-jwt`)
1818
1814
  .description(`Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.`)
1819
1815
  .action(actionRunner(accountCreateJWT))
1820
1816
 
1821
1817
  account
1822
- .command(`listLogs`)
1818
+ .command(`list-logs`)
1823
1819
  .description(`Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log.`)
1824
1820
  .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset`)
1825
1821
  .action(actionRunner(accountListLogs))
1826
1822
 
1827
1823
  account
1828
- .command(`updateMFA`)
1824
+ .command(`update-mfa`)
1829
1825
  .description(`Enable or disable MFA on an account.`)
1830
1826
  .requiredOption(`--mfa <mfa>`, `Enable or disable MFA.`, parseBool)
1831
1827
  .action(actionRunner(accountUpdateMFA))
1832
1828
 
1833
1829
  account
1834
- .command(`createMfaAuthenticator`)
1830
+ .command(`create-mfa-authenticator`)
1835
1831
  .description(`Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator) method.`)
1836
1832
  .requiredOption(`--type <type>`, `Type of authenticator. Must be 'totp'`)
1837
1833
  .action(actionRunner(accountCreateMfaAuthenticator))
1838
1834
 
1839
1835
  account
1840
- .command(`updateMfaAuthenticator`)
1836
+ .command(`update-mfa-authenticator`)
1841
1837
  .description(`Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method.`)
1842
1838
  .requiredOption(`--type <type>`, `Type of authenticator.`)
1843
1839
  .requiredOption(`--otp <otp>`, `Valid verification token.`)
1844
1840
  .action(actionRunner(accountUpdateMfaAuthenticator))
1845
1841
 
1846
1842
  account
1847
- .command(`deleteMfaAuthenticator`)
1843
+ .command(`delete-mfa-authenticator`)
1848
1844
  .description(`Delete an authenticator for a user by ID.`)
1849
1845
  .requiredOption(`--type <type>`, `Type of authenticator.`)
1850
- .requiredOption(`--otp <otp>`, `Valid verification token.`)
1851
1846
  .action(actionRunner(accountDeleteMfaAuthenticator))
1852
1847
 
1853
1848
  account
1854
- .command(`createMfaChallenge`)
1849
+ .command(`create-mfa-challenge`)
1855
1850
  .description(`Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method.`)
1856
1851
  .requiredOption(`--factor <factor>`, `Factor used for verification. Must be one of following: 'email', 'phone', 'totp', 'recoveryCode'.`)
1857
1852
  .action(actionRunner(accountCreateMfaChallenge))
1858
1853
 
1859
1854
  account
1860
- .command(`updateMfaChallenge`)
1855
+ .command(`update-mfa-challenge`)
1861
1856
  .description(`Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method.`)
1862
- .requiredOption(`--challengeId <challengeId>`, `ID of the challenge.`)
1857
+ .requiredOption(`--challenge-id <challenge-id>`, `ID of the challenge.`)
1863
1858
  .requiredOption(`--otp <otp>`, `Valid verification token.`)
1864
1859
  .action(actionRunner(accountUpdateMfaChallenge))
1865
1860
 
1866
1861
  account
1867
- .command(`listMfaFactors`)
1862
+ .command(`list-mfa-factors`)
1868
1863
  .description(`List the factors available on the account to be used as a MFA challange.`)
1869
1864
  .action(actionRunner(accountListMfaFactors))
1870
1865
 
1871
1866
  account
1872
- .command(`getMfaRecoveryCodes`)
1867
+ .command(`get-mfa-recovery-codes`)
1873
1868
  .description(`Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.`)
1874
1869
  .action(actionRunner(accountGetMfaRecoveryCodes))
1875
1870
 
1876
1871
  account
1877
- .command(`createMfaRecoveryCodes`)
1872
+ .command(`create-mfa-recovery-codes`)
1878
1873
  .description(`Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method.`)
1879
1874
  .action(actionRunner(accountCreateMfaRecoveryCodes))
1880
1875
 
1881
1876
  account
1882
- .command(`updateMfaRecoveryCodes`)
1877
+ .command(`update-mfa-recovery-codes`)
1883
1878
  .description(`Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.`)
1884
1879
  .action(actionRunner(accountUpdateMfaRecoveryCodes))
1885
1880
 
1886
1881
  account
1887
- .command(`updateName`)
1882
+ .command(`update-name`)
1888
1883
  .description(`Update currently logged in user account name.`)
1889
1884
  .requiredOption(`--name <name>`, `User name. Max length: 128 chars.`)
1890
1885
  .action(actionRunner(accountUpdateName))
1891
1886
 
1892
1887
  account
1893
- .command(`updatePassword`)
1888
+ .command(`update-password`)
1894
1889
  .description(`Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional.`)
1895
1890
  .requiredOption(`--password <password>`, `New user password. Must be at least 8 chars.`)
1896
- .option(`--oldPassword <oldPassword>`, `Current user password. Must be at least 8 chars.`)
1891
+ .option(`--old-password <old-password>`, `Current user password. Must be at least 8 chars.`)
1897
1892
  .action(actionRunner(accountUpdatePassword))
1898
1893
 
1899
1894
  account
1900
- .command(`updatePhone`)
1895
+ .command(`update-phone`)
1901
1896
  .description(`Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification) endpoint to send a confirmation SMS.`)
1902
1897
  .requiredOption(`--phone <phone>`, `Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`)
1903
1898
  .requiredOption(`--password <password>`, `User password. Must be at least 8 chars.`)
1904
1899
  .action(actionRunner(accountUpdatePhone))
1905
1900
 
1906
1901
  account
1907
- .command(`getPrefs`)
1902
+ .command(`get-prefs`)
1908
1903
  .description(`Get the preferences as a key-value object for the currently logged in user.`)
1909
1904
  .action(actionRunner(accountGetPrefs))
1910
1905
 
1911
1906
  account
1912
- .command(`updatePrefs`)
1907
+ .command(`update-prefs`)
1913
1908
  .description(`Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.`)
1914
1909
  .requiredOption(`--prefs <prefs>`, `Prefs key-value JSON object.`)
1915
1910
  .action(actionRunner(accountUpdatePrefs))
1916
1911
 
1917
1912
  account
1918
- .command(`createRecovery`)
1913
+ .command(`create-recovery`)
1919
1914
  .description(`Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour.`)
1920
1915
  .requiredOption(`--email <email>`, `User email.`)
1921
1916
  .requiredOption(`--url <url>`, `URL to redirect the user back to your app from the recovery email. 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.`)
1922
1917
  .action(actionRunner(accountCreateRecovery))
1923
1918
 
1924
1919
  account
1925
- .command(`updateRecovery`)
1920
+ .command(`update-recovery`)
1926
1921
  .description(`Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#createRecovery) endpoint. Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.`)
1927
- .requiredOption(`--userId <userId>`, `User ID.`)
1922
+ .requiredOption(`--user-id <user-id>`, `User ID.`)
1928
1923
  .requiredOption(`--secret <secret>`, `Valid reset token.`)
1929
1924
  .requiredOption(`--password <password>`, `New user password. Must be between 8 and 256 chars.`)
1930
1925
  .action(actionRunner(accountUpdateRecovery))
1931
1926
 
1932
1927
  account
1933
- .command(`listSessions`)
1928
+ .command(`list-sessions`)
1934
1929
  .description(`Get the list of active sessions across different devices for the currently logged in user.`)
1935
1930
  .option(`--console`, `Get the resource console url`)
1936
1931
  .action(actionRunner(accountListSessions))
1937
1932
 
1938
1933
  account
1939
- .command(`deleteSessions`)
1934
+ .command(`delete-sessions`)
1940
1935
  .description(`Delete all sessions from the user account and remove any sessions cookies from the end client.`)
1941
1936
  .action(actionRunner(accountDeleteSessions))
1942
1937
 
1943
1938
  account
1944
- .command(`createAnonymousSession`)
1939
+ .command(`create-anonymous-session`)
1945
1940
  .description(`Use this endpoint to allow a new user to register an anonymous account in your project. This route will also create a new session for the user. To allow the new user to convert an anonymous account to a normal account, you need to update its [email and password](https://appwrite.io/docs/references/cloud/client-web/account#updateEmail) or create an [OAuth2 session](https://appwrite.io/docs/references/cloud/client-web/account#CreateOAuth2Session).`)
1946
1941
  .action(actionRunner(accountCreateAnonymousSession))
1947
1942
 
1948
1943
  account
1949
- .command(`createEmailPasswordSession`)
1944
+ .command(`create-email-password-session`)
1950
1945
  .description(`Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user. 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).`)
1951
1946
  .requiredOption(`--email <email>`, `User email.`)
1952
1947
  .requiredOption(`--password <password>`, `User password. Must be at least 8 chars.`)
1953
1948
  .action(actionRunner(accountCreateEmailPasswordSession))
1954
1949
 
1955
1950
  account
1956
- .command(`updateMagicURLSession`)
1951
+ .command(`update-magic-url-session`)
1957
1952
  .description(`Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.`)
1958
- .requiredOption(`--userId <userId>`, `User ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
1953
+ .requiredOption(`--user-id <user-id>`, `User ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
1959
1954
  .requiredOption(`--secret <secret>`, `Valid verification token.`)
1960
1955
  .action(actionRunner(accountUpdateMagicURLSession))
1961
1956
 
1962
1957
  account
1963
- .command(`createOAuth2Session`)
1958
+ .command(`create-o-auth-2-session`)
1964
1959
  .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. 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). `)
1965
1960
  .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, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.`)
1966
1961
  .option(`--success <success>`, `URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's 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.`)
@@ -1969,82 +1964,82 @@ account
1969
1964
  .action(actionRunner(accountCreateOAuth2Session))
1970
1965
 
1971
1966
  account
1972
- .command(`updatePhoneSession`)
1967
+ .command(`update-phone-session`)
1973
1968
  .description(`Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.`)
1974
- .requiredOption(`--userId <userId>`, `User ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
1969
+ .requiredOption(`--user-id <user-id>`, `User ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
1975
1970
  .requiredOption(`--secret <secret>`, `Valid verification token.`)
1976
1971
  .action(actionRunner(accountUpdatePhoneSession))
1977
1972
 
1978
1973
  account
1979
- .command(`createSession`)
1974
+ .command(`create-session`)
1980
1975
  .description(`Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.`)
1981
- .requiredOption(`--userId <userId>`, `User ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
1976
+ .requiredOption(`--user-id <user-id>`, `User ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
1982
1977
  .requiredOption(`--secret <secret>`, `Secret of a token generated by login methods. For example, the 'createMagicURLToken' or 'createPhoneToken' methods.`)
1983
1978
  .action(actionRunner(accountCreateSession))
1984
1979
 
1985
1980
  account
1986
- .command(`getSession`)
1981
+ .command(`get-session`)
1987
1982
  .description(`Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.`)
1988
- .requiredOption(`--sessionId <sessionId>`, `Session ID. Use the string 'current' to get the current device session.`)
1983
+ .requiredOption(`--session-id <session-id>`, `Session ID. Use the string 'current' to get the current device session.`)
1989
1984
  .action(actionRunner(accountGetSession))
1990
1985
 
1991
1986
  account
1992
- .command(`updateSession`)
1987
+ .command(`update-session`)
1993
1988
  .description(`Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider.`)
1994
- .requiredOption(`--sessionId <sessionId>`, `Session ID. Use the string 'current' to update the current device session.`)
1989
+ .requiredOption(`--session-id <session-id>`, `Session ID. Use the string 'current' to update the current device session.`)
1995
1990
  .action(actionRunner(accountUpdateSession))
1996
1991
 
1997
1992
  account
1998
- .command(`deleteSession`)
1993
+ .command(`delete-session`)
1999
1994
  .description(`Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https://appwrite.io/docs/references/cloud/client-web/account#deleteSessions) instead.`)
2000
- .requiredOption(`--sessionId <sessionId>`, `Session ID. Use the string 'current' to delete the current device session.`)
1995
+ .requiredOption(`--session-id <session-id>`, `Session ID. Use the string 'current' to delete the current device session.`)
2001
1996
  .action(actionRunner(accountDeleteSession))
2002
1997
 
2003
1998
  account
2004
- .command(`updateStatus`)
1999
+ .command(`update-status`)
2005
2000
  .description(`Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.`)
2006
2001
  .action(actionRunner(accountUpdateStatus))
2007
2002
 
2008
2003
  account
2009
- .command(`createPushTarget`)
2004
+ .command(`create-push-target`)
2010
2005
  .description(``)
2011
- .requiredOption(`--targetId <targetId>`, `Target ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
2006
+ .requiredOption(`--target-id <target-id>`, `Target ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
2012
2007
  .requiredOption(`--identifier <identifier>`, `The target identifier (token, email, phone etc.)`)
2013
- .option(`--providerId <providerId>`, `Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.`)
2008
+ .option(`--provider-id <provider-id>`, `Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.`)
2014
2009
  .action(actionRunner(accountCreatePushTarget))
2015
2010
 
2016
2011
  account
2017
- .command(`updatePushTarget`)
2012
+ .command(`update-push-target`)
2018
2013
  .description(``)
2019
- .requiredOption(`--targetId <targetId>`, `Target ID.`)
2014
+ .requiredOption(`--target-id <target-id>`, `Target ID.`)
2020
2015
  .requiredOption(`--identifier <identifier>`, `The target identifier (token, email, phone etc.)`)
2021
2016
  .action(actionRunner(accountUpdatePushTarget))
2022
2017
 
2023
2018
  account
2024
- .command(`deletePushTarget`)
2019
+ .command(`delete-push-target`)
2025
2020
  .description(``)
2026
- .requiredOption(`--targetId <targetId>`, `Target ID.`)
2021
+ .requiredOption(`--target-id <target-id>`, `Target ID.`)
2027
2022
  .action(actionRunner(accountDeletePushTarget))
2028
2023
 
2029
2024
  account
2030
- .command(`createEmailToken`)
2025
+ .command(`create-email-token`)
2031
2026
  .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. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes. 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).`)
2032
- .requiredOption(`--userId <userId>`, `User ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
2027
+ .requiredOption(`--user-id <user-id>`, `User ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
2033
2028
  .requiredOption(`--email <email>`, `User email.`)
2034
2029
  .option(`--phrase <phrase>`, `Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.`, parseBool)
2035
2030
  .action(actionRunner(accountCreateEmailToken))
2036
2031
 
2037
2032
  account
2038
- .command(`createMagicURLToken`)
2033
+ .command(`create-magic-url-token`)
2039
2034
  .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). `)
2040
- .requiredOption(`--userId <userId>`, `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.`)
2035
+ .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.`)
2041
2036
  .requiredOption(`--email <email>`, `User email.`)
2042
2037
  .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.`)
2043
2038
  .option(`--phrase <phrase>`, `Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.`, parseBool)
2044
2039
  .action(actionRunner(accountCreateMagicURLToken))
2045
2040
 
2046
2041
  account
2047
- .command(`createOAuth2Token`)
2042
+ .command(`create-o-auth-2-token`)
2048
2043
  .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 authentication succeeds, 'userId' and 'secret' of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint. 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).`)
2049
2044
  .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, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.`)
2050
2045
  .option(`--success <success>`, `URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's 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.`)
@@ -2053,34 +2048,34 @@ account
2053
2048
  .action(actionRunner(accountCreateOAuth2Token))
2054
2049
 
2055
2050
  account
2056
- .command(`createPhoneToken`)
2051
+ .command(`create-phone-token`)
2057
2052
  .description(`Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes. 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).`)
2058
- .requiredOption(`--userId <userId>`, `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.`)
2053
+ .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.`)
2059
2054
  .requiredOption(`--phone <phone>`, `Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`)
2060
2055
  .action(actionRunner(accountCreatePhoneToken))
2061
2056
 
2062
2057
  account
2063
- .command(`createVerification`)
2058
+ .command(`create-verification`)
2064
2059
  .description(`Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). The verification link sent to the user's email address is valid for 7 days. Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. `)
2065
2060
  .requiredOption(`--url <url>`, `URL to redirect the user back to your app from the verification email. 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.`)
2066
2061
  .action(actionRunner(accountCreateVerification))
2067
2062
 
2068
2063
  account
2069
- .command(`updateVerification`)
2064
+ .command(`update-verification`)
2070
2065
  .description(`Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.`)
2071
- .requiredOption(`--userId <userId>`, `User ID.`)
2066
+ .requiredOption(`--user-id <user-id>`, `User ID.`)
2072
2067
  .requiredOption(`--secret <secret>`, `Valid verification token.`)
2073
2068
  .action(actionRunner(accountUpdateVerification))
2074
2069
 
2075
2070
  account
2076
- .command(`createPhoneVerification`)
2071
+ .command(`create-phone-verification`)
2077
2072
  .description(`Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes.`)
2078
2073
  .action(actionRunner(accountCreatePhoneVerification))
2079
2074
 
2080
2075
  account
2081
- .command(`updatePhoneVerification`)
2076
+ .command(`update-phone-verification`)
2082
2077
  .description(`Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code.`)
2083
- .requiredOption(`--userId <userId>`, `User ID.`)
2078
+ .requiredOption(`--user-id <user-id>`, `User ID.`)
2084
2079
  .requiredOption(`--secret <secret>`, `Valid verification token.`)
2085
2080
  .action(actionRunner(accountUpdatePhoneVerification))
2086
2081
 
@@ -428,7 +428,7 @@ const avatarsGetQR = async ({text,size,margin,download,parseOutput = true, overr
428
428
  }
429
429
 
430
430
  avatars
431
- .command(`getBrowser`)
431
+ .command(`get-browser`)
432
432
  .description(`You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. 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.`)
433
433
  .requiredOption(`--code <code>`, `Browser Code.`)
434
434
  .option(`--width <width>`, `Image width. Pass an integer between 0 to 2000. Defaults to 100.`, parseInteger)
@@ -438,7 +438,7 @@ avatars
438
438
  .action(actionRunner(avatarsGetBrowser))
439
439
 
440
440
  avatars
441
- .command(`getCreditCard`)
441
+ .command(`get-credit-card`)
442
442
  .description(`The credit card endpoint will return you the icon of the credit card provider you need. 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. `)
443
443
  .requiredOption(`--code <code>`, `Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro.`)
444
444
  .option(`--width <width>`, `Image width. Pass an integer between 0 to 2000. Defaults to 100.`, parseInteger)
@@ -448,14 +448,14 @@ avatars
448
448
  .action(actionRunner(avatarsGetCreditCard))
449
449
 
450
450
  avatars
451
- .command(`getFavicon`)
452
- .description(`Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL. `)
451
+ .command(`get-favicon`)
452
+ .description(`Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL. This endpoint does not follow HTTP redirects.`)
453
453
  .requiredOption(`--url <url>`, `Website URL which you want to fetch the favicon from.`)
454
454
  .requiredOption(`--destination <path>`, `output file path.`)
455
455
  .action(actionRunner(avatarsGetFavicon))
456
456
 
457
457
  avatars
458
- .command(`getFlag`)
458
+ .command(`get-flag`)
459
459
  .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](https://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. `)
460
460
  .requiredOption(`--code <code>`, `Country Code. ISO Alpha-2 country code format.`)
461
461
  .option(`--width <width>`, `Image width. Pass an integer between 0 to 2000. Defaults to 100.`, parseInteger)
@@ -465,8 +465,8 @@ avatars
465
465
  .action(actionRunner(avatarsGetFlag))
466
466
 
467
467
  avatars
468
- .command(`getImage`)
469
- .description(`Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol. 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 400x400px. `)
468
+ .command(`get-image`)
469
+ .description(`Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol. 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 400x400px. This endpoint does not follow HTTP redirects.`)
470
470
  .requiredOption(`--url <url>`, `Image URL which you want to crop.`)
471
471
  .option(`--width <width>`, `Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.`, parseInteger)
472
472
  .option(`--height <height>`, `Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.`, parseInteger)
@@ -474,7 +474,7 @@ avatars
474
474
  .action(actionRunner(avatarsGetImage))
475
475
 
476
476
  avatars
477
- .command(`getInitials`)
477
+ .command(`get-initials`)
478
478
  .description(`Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned. You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials. 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. `)
479
479
  .option(`--name <name>`, `Full Name. When empty, current user name or email will be used. Max length: 128 chars.`)
480
480
  .option(`--width <width>`, `Image width. Pass an integer between 0 to 2000. Defaults to 100.`, parseInteger)
@@ -484,7 +484,7 @@ avatars
484
484
  .action(actionRunner(avatarsGetInitials))
485
485
 
486
486
  avatars
487
- .command(`getQR`)
487
+ .command(`get-qr`)
488
488
  .description(`Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image. `)
489
489
  .requiredOption(`--text <text>`, `Plain text to be converted to QR code image.`)
490
490
  .option(`--size <size>`, `QR code size. Pass an integer between 1 to 1000. Defaults to 400.`, parseInteger)