appwrite-cli 6.0.0-rc.4 → 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 +4 -4
- package/install.ps1 +2 -2
- package/install.sh +1 -1
- package/lib/client.js +2 -2
- package/lib/commands/account.js +65 -65
- package/lib/commands/avatars.js +9 -9
- package/lib/commands/databases.js +140 -140
- package/lib/commands/functions.js +69 -69
- package/lib/commands/generic.js +4 -3
- package/lib/commands/health.js +22 -22
- package/lib/commands/init.js +4 -3
- package/lib/commands/locale.js +7 -7
- package/lib/commands/messaging.js +160 -160
- package/lib/commands/migrations.js +28 -28
- package/lib/commands/project.js +11 -11
- package/lib/commands/projects.js +122 -122
- package/lib/commands/proxy.js +10 -10
- package/lib/commands/pull.js +4 -4
- package/lib/commands/push.js +310 -98
- package/lib/commands/run.js +48 -8
- package/lib/commands/storage.js +44 -44
- package/lib/commands/teams.js +29 -29
- package/lib/commands/users.js +99 -99
- package/lib/commands/vcs.js +27 -27
- package/lib/config.js +22 -10
- package/lib/emulation/docker.js +78 -5
- package/lib/parser.js +3 -14
- package/lib/questions.js +16 -20
- package/lib/spinner.js +1 -0
- package/package.json +1 -1
- package/scoop/appwrite.json +3 -3
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Appwrite Command Line SDK
|
|
2
2
|
|
|
3
3
|

|
|
4
|
-

|
|
5
5
|
[](https://travis-ci.com/appwrite/sdk-generator)
|
|
6
6
|
[](https://twitter.com/appwrite)
|
|
7
7
|
[](https://appwrite.io/discord)
|
|
8
8
|
|
|
9
|
-
**This SDK is compatible with Appwrite server version
|
|
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.
|
|
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.
|
|
63
|
+
6.0.0-rc.5
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
## Getting Started
|
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.
|
|
17
|
-
$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/6.0.0-rc.
|
|
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.
|
|
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.
|
|
20
|
-
'user-agent' : `AppwriteCLI/6.0.0-rc.
|
|
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
|
}
|
package/lib/commands/account.js
CHANGED
|
@@ -1779,7 +1779,7 @@ account
|
|
|
1779
1779
|
account
|
|
1780
1780
|
.command(`create`)
|
|
1781
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).`)
|
|
1782
|
-
.requiredOption(`--
|
|
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.`)
|
|
1783
1783
|
.requiredOption(`--email <email>`, `User email.`)
|
|
1784
1784
|
.requiredOption(`--password <password>`, `New user password. Must be between 8 and 256 chars.`)
|
|
1785
1785
|
.option(`--name <name>`, `User name. Max length: 128 chars.`)
|
|
@@ -1791,171 +1791,171 @@ account
|
|
|
1791
1791
|
.action(actionRunner(accountDelete))
|
|
1792
1792
|
|
|
1793
1793
|
account
|
|
1794
|
-
.command(`
|
|
1794
|
+
.command(`update-email`)
|
|
1795
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. `)
|
|
1796
1796
|
.requiredOption(`--email <email>`, `User email.`)
|
|
1797
1797
|
.requiredOption(`--password <password>`, `User password. Must be at least 8 chars.`)
|
|
1798
1798
|
.action(actionRunner(accountUpdateEmail))
|
|
1799
1799
|
|
|
1800
1800
|
account
|
|
1801
|
-
.command(`
|
|
1801
|
+
.command(`list-identities`)
|
|
1802
1802
|
.description(`Get the list of identities for the currently logged in user.`)
|
|
1803
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`)
|
|
1804
1804
|
.action(actionRunner(accountListIdentities))
|
|
1805
1805
|
|
|
1806
1806
|
account
|
|
1807
|
-
.command(`
|
|
1807
|
+
.command(`delete-identity`)
|
|
1808
1808
|
.description(`Delete an identity by its unique ID.`)
|
|
1809
|
-
.requiredOption(`--
|
|
1809
|
+
.requiredOption(`--identity-id <identity-id>`, `Identity ID.`)
|
|
1810
1810
|
.action(actionRunner(accountDeleteIdentity))
|
|
1811
1811
|
|
|
1812
1812
|
account
|
|
1813
|
-
.command(`
|
|
1813
|
+
.command(`create-jwt`)
|
|
1814
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.`)
|
|
1815
1815
|
.action(actionRunner(accountCreateJWT))
|
|
1816
1816
|
|
|
1817
1817
|
account
|
|
1818
|
-
.command(`
|
|
1818
|
+
.command(`list-logs`)
|
|
1819
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.`)
|
|
1820
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`)
|
|
1821
1821
|
.action(actionRunner(accountListLogs))
|
|
1822
1822
|
|
|
1823
1823
|
account
|
|
1824
|
-
.command(`
|
|
1824
|
+
.command(`update-mfa`)
|
|
1825
1825
|
.description(`Enable or disable MFA on an account.`)
|
|
1826
1826
|
.requiredOption(`--mfa <mfa>`, `Enable or disable MFA.`, parseBool)
|
|
1827
1827
|
.action(actionRunner(accountUpdateMFA))
|
|
1828
1828
|
|
|
1829
1829
|
account
|
|
1830
|
-
.command(`
|
|
1830
|
+
.command(`create-mfa-authenticator`)
|
|
1831
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.`)
|
|
1832
1832
|
.requiredOption(`--type <type>`, `Type of authenticator. Must be 'totp'`)
|
|
1833
1833
|
.action(actionRunner(accountCreateMfaAuthenticator))
|
|
1834
1834
|
|
|
1835
1835
|
account
|
|
1836
|
-
.command(`
|
|
1836
|
+
.command(`update-mfa-authenticator`)
|
|
1837
1837
|
.description(`Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method.`)
|
|
1838
1838
|
.requiredOption(`--type <type>`, `Type of authenticator.`)
|
|
1839
1839
|
.requiredOption(`--otp <otp>`, `Valid verification token.`)
|
|
1840
1840
|
.action(actionRunner(accountUpdateMfaAuthenticator))
|
|
1841
1841
|
|
|
1842
1842
|
account
|
|
1843
|
-
.command(`
|
|
1843
|
+
.command(`delete-mfa-authenticator`)
|
|
1844
1844
|
.description(`Delete an authenticator for a user by ID.`)
|
|
1845
1845
|
.requiredOption(`--type <type>`, `Type of authenticator.`)
|
|
1846
1846
|
.action(actionRunner(accountDeleteMfaAuthenticator))
|
|
1847
1847
|
|
|
1848
1848
|
account
|
|
1849
|
-
.command(`
|
|
1849
|
+
.command(`create-mfa-challenge`)
|
|
1850
1850
|
.description(`Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method.`)
|
|
1851
1851
|
.requiredOption(`--factor <factor>`, `Factor used for verification. Must be one of following: 'email', 'phone', 'totp', 'recoveryCode'.`)
|
|
1852
1852
|
.action(actionRunner(accountCreateMfaChallenge))
|
|
1853
1853
|
|
|
1854
1854
|
account
|
|
1855
|
-
.command(`
|
|
1855
|
+
.command(`update-mfa-challenge`)
|
|
1856
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.`)
|
|
1857
|
-
.requiredOption(`--
|
|
1857
|
+
.requiredOption(`--challenge-id <challenge-id>`, `ID of the challenge.`)
|
|
1858
1858
|
.requiredOption(`--otp <otp>`, `Valid verification token.`)
|
|
1859
1859
|
.action(actionRunner(accountUpdateMfaChallenge))
|
|
1860
1860
|
|
|
1861
1861
|
account
|
|
1862
|
-
.command(`
|
|
1862
|
+
.command(`list-mfa-factors`)
|
|
1863
1863
|
.description(`List the factors available on the account to be used as a MFA challange.`)
|
|
1864
1864
|
.action(actionRunner(accountListMfaFactors))
|
|
1865
1865
|
|
|
1866
1866
|
account
|
|
1867
|
-
.command(`
|
|
1867
|
+
.command(`get-mfa-recovery-codes`)
|
|
1868
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.`)
|
|
1869
1869
|
.action(actionRunner(accountGetMfaRecoveryCodes))
|
|
1870
1870
|
|
|
1871
1871
|
account
|
|
1872
|
-
.command(`
|
|
1872
|
+
.command(`create-mfa-recovery-codes`)
|
|
1873
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.`)
|
|
1874
1874
|
.action(actionRunner(accountCreateMfaRecoveryCodes))
|
|
1875
1875
|
|
|
1876
1876
|
account
|
|
1877
|
-
.command(`
|
|
1877
|
+
.command(`update-mfa-recovery-codes`)
|
|
1878
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.`)
|
|
1879
1879
|
.action(actionRunner(accountUpdateMfaRecoveryCodes))
|
|
1880
1880
|
|
|
1881
1881
|
account
|
|
1882
|
-
.command(`
|
|
1882
|
+
.command(`update-name`)
|
|
1883
1883
|
.description(`Update currently logged in user account name.`)
|
|
1884
1884
|
.requiredOption(`--name <name>`, `User name. Max length: 128 chars.`)
|
|
1885
1885
|
.action(actionRunner(accountUpdateName))
|
|
1886
1886
|
|
|
1887
1887
|
account
|
|
1888
|
-
.command(`
|
|
1888
|
+
.command(`update-password`)
|
|
1889
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.`)
|
|
1890
1890
|
.requiredOption(`--password <password>`, `New user password. Must be at least 8 chars.`)
|
|
1891
|
-
.option(`--
|
|
1891
|
+
.option(`--old-password <old-password>`, `Current user password. Must be at least 8 chars.`)
|
|
1892
1892
|
.action(actionRunner(accountUpdatePassword))
|
|
1893
1893
|
|
|
1894
1894
|
account
|
|
1895
|
-
.command(`
|
|
1895
|
+
.command(`update-phone`)
|
|
1896
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.`)
|
|
1897
1897
|
.requiredOption(`--phone <phone>`, `Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`)
|
|
1898
1898
|
.requiredOption(`--password <password>`, `User password. Must be at least 8 chars.`)
|
|
1899
1899
|
.action(actionRunner(accountUpdatePhone))
|
|
1900
1900
|
|
|
1901
1901
|
account
|
|
1902
|
-
.command(`
|
|
1902
|
+
.command(`get-prefs`)
|
|
1903
1903
|
.description(`Get the preferences as a key-value object for the currently logged in user.`)
|
|
1904
1904
|
.action(actionRunner(accountGetPrefs))
|
|
1905
1905
|
|
|
1906
1906
|
account
|
|
1907
|
-
.command(`
|
|
1907
|
+
.command(`update-prefs`)
|
|
1908
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.`)
|
|
1909
1909
|
.requiredOption(`--prefs <prefs>`, `Prefs key-value JSON object.`)
|
|
1910
1910
|
.action(actionRunner(accountUpdatePrefs))
|
|
1911
1911
|
|
|
1912
1912
|
account
|
|
1913
|
-
.command(`
|
|
1913
|
+
.command(`create-recovery`)
|
|
1914
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.`)
|
|
1915
1915
|
.requiredOption(`--email <email>`, `User email.`)
|
|
1916
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.`)
|
|
1917
1917
|
.action(actionRunner(accountCreateRecovery))
|
|
1918
1918
|
|
|
1919
1919
|
account
|
|
1920
|
-
.command(`
|
|
1920
|
+
.command(`update-recovery`)
|
|
1921
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.`)
|
|
1922
|
-
.requiredOption(`--
|
|
1922
|
+
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
1923
1923
|
.requiredOption(`--secret <secret>`, `Valid reset token.`)
|
|
1924
1924
|
.requiredOption(`--password <password>`, `New user password. Must be between 8 and 256 chars.`)
|
|
1925
1925
|
.action(actionRunner(accountUpdateRecovery))
|
|
1926
1926
|
|
|
1927
1927
|
account
|
|
1928
|
-
.command(`
|
|
1928
|
+
.command(`list-sessions`)
|
|
1929
1929
|
.description(`Get the list of active sessions across different devices for the currently logged in user.`)
|
|
1930
1930
|
.option(`--console`, `Get the resource console url`)
|
|
1931
1931
|
.action(actionRunner(accountListSessions))
|
|
1932
1932
|
|
|
1933
1933
|
account
|
|
1934
|
-
.command(`
|
|
1934
|
+
.command(`delete-sessions`)
|
|
1935
1935
|
.description(`Delete all sessions from the user account and remove any sessions cookies from the end client.`)
|
|
1936
1936
|
.action(actionRunner(accountDeleteSessions))
|
|
1937
1937
|
|
|
1938
1938
|
account
|
|
1939
|
-
.command(`
|
|
1939
|
+
.command(`create-anonymous-session`)
|
|
1940
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).`)
|
|
1941
1941
|
.action(actionRunner(accountCreateAnonymousSession))
|
|
1942
1942
|
|
|
1943
1943
|
account
|
|
1944
|
-
.command(`
|
|
1944
|
+
.command(`create-email-password-session`)
|
|
1945
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).`)
|
|
1946
1946
|
.requiredOption(`--email <email>`, `User email.`)
|
|
1947
1947
|
.requiredOption(`--password <password>`, `User password. Must be at least 8 chars.`)
|
|
1948
1948
|
.action(actionRunner(accountCreateEmailPasswordSession))
|
|
1949
1949
|
|
|
1950
1950
|
account
|
|
1951
|
-
.command(`
|
|
1951
|
+
.command(`update-magic-url-session`)
|
|
1952
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.`)
|
|
1953
|
-
.requiredOption(`--
|
|
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.`)
|
|
1954
1954
|
.requiredOption(`--secret <secret>`, `Valid verification token.`)
|
|
1955
1955
|
.action(actionRunner(accountUpdateMagicURLSession))
|
|
1956
1956
|
|
|
1957
1957
|
account
|
|
1958
|
-
.command(`
|
|
1958
|
+
.command(`create-o-auth-2-session`)
|
|
1959
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). `)
|
|
1960
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.`)
|
|
1961
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.`)
|
|
@@ -1964,82 +1964,82 @@ account
|
|
|
1964
1964
|
.action(actionRunner(accountCreateOAuth2Session))
|
|
1965
1965
|
|
|
1966
1966
|
account
|
|
1967
|
-
.command(`
|
|
1967
|
+
.command(`update-phone-session`)
|
|
1968
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.`)
|
|
1969
|
-
.requiredOption(`--
|
|
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.`)
|
|
1970
1970
|
.requiredOption(`--secret <secret>`, `Valid verification token.`)
|
|
1971
1971
|
.action(actionRunner(accountUpdatePhoneSession))
|
|
1972
1972
|
|
|
1973
1973
|
account
|
|
1974
|
-
.command(`
|
|
1974
|
+
.command(`create-session`)
|
|
1975
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.`)
|
|
1976
|
-
.requiredOption(`--
|
|
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.`)
|
|
1977
1977
|
.requiredOption(`--secret <secret>`, `Secret of a token generated by login methods. For example, the 'createMagicURLToken' or 'createPhoneToken' methods.`)
|
|
1978
1978
|
.action(actionRunner(accountCreateSession))
|
|
1979
1979
|
|
|
1980
1980
|
account
|
|
1981
|
-
.command(`
|
|
1981
|
+
.command(`get-session`)
|
|
1982
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.`)
|
|
1983
|
-
.requiredOption(`--
|
|
1983
|
+
.requiredOption(`--session-id <session-id>`, `Session ID. Use the string 'current' to get the current device session.`)
|
|
1984
1984
|
.action(actionRunner(accountGetSession))
|
|
1985
1985
|
|
|
1986
1986
|
account
|
|
1987
|
-
.command(`
|
|
1987
|
+
.command(`update-session`)
|
|
1988
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.`)
|
|
1989
|
-
.requiredOption(`--
|
|
1989
|
+
.requiredOption(`--session-id <session-id>`, `Session ID. Use the string 'current' to update the current device session.`)
|
|
1990
1990
|
.action(actionRunner(accountUpdateSession))
|
|
1991
1991
|
|
|
1992
1992
|
account
|
|
1993
|
-
.command(`
|
|
1993
|
+
.command(`delete-session`)
|
|
1994
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.`)
|
|
1995
|
-
.requiredOption(`--
|
|
1995
|
+
.requiredOption(`--session-id <session-id>`, `Session ID. Use the string 'current' to delete the current device session.`)
|
|
1996
1996
|
.action(actionRunner(accountDeleteSession))
|
|
1997
1997
|
|
|
1998
1998
|
account
|
|
1999
|
-
.command(`
|
|
1999
|
+
.command(`update-status`)
|
|
2000
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.`)
|
|
2001
2001
|
.action(actionRunner(accountUpdateStatus))
|
|
2002
2002
|
|
|
2003
2003
|
account
|
|
2004
|
-
.command(`
|
|
2004
|
+
.command(`create-push-target`)
|
|
2005
2005
|
.description(``)
|
|
2006
|
-
.requiredOption(`--
|
|
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.`)
|
|
2007
2007
|
.requiredOption(`--identifier <identifier>`, `The target identifier (token, email, phone etc.)`)
|
|
2008
|
-
.option(`--
|
|
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.`)
|
|
2009
2009
|
.action(actionRunner(accountCreatePushTarget))
|
|
2010
2010
|
|
|
2011
2011
|
account
|
|
2012
|
-
.command(`
|
|
2012
|
+
.command(`update-push-target`)
|
|
2013
2013
|
.description(``)
|
|
2014
|
-
.requiredOption(`--
|
|
2014
|
+
.requiredOption(`--target-id <target-id>`, `Target ID.`)
|
|
2015
2015
|
.requiredOption(`--identifier <identifier>`, `The target identifier (token, email, phone etc.)`)
|
|
2016
2016
|
.action(actionRunner(accountUpdatePushTarget))
|
|
2017
2017
|
|
|
2018
2018
|
account
|
|
2019
|
-
.command(`
|
|
2019
|
+
.command(`delete-push-target`)
|
|
2020
2020
|
.description(``)
|
|
2021
|
-
.requiredOption(`--
|
|
2021
|
+
.requiredOption(`--target-id <target-id>`, `Target ID.`)
|
|
2022
2022
|
.action(actionRunner(accountDeletePushTarget))
|
|
2023
2023
|
|
|
2024
2024
|
account
|
|
2025
|
-
.command(`
|
|
2025
|
+
.command(`create-email-token`)
|
|
2026
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).`)
|
|
2027
|
-
.requiredOption(`--
|
|
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.`)
|
|
2028
2028
|
.requiredOption(`--email <email>`, `User email.`)
|
|
2029
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)
|
|
2030
2030
|
.action(actionRunner(accountCreateEmailToken))
|
|
2031
2031
|
|
|
2032
2032
|
account
|
|
2033
|
-
.command(`
|
|
2033
|
+
.command(`create-magic-url-token`)
|
|
2034
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). `)
|
|
2035
|
-
.requiredOption(`--
|
|
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.`)
|
|
2036
2036
|
.requiredOption(`--email <email>`, `User email.`)
|
|
2037
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.`)
|
|
2038
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)
|
|
2039
2039
|
.action(actionRunner(accountCreateMagicURLToken))
|
|
2040
2040
|
|
|
2041
2041
|
account
|
|
2042
|
-
.command(`
|
|
2042
|
+
.command(`create-o-auth-2-token`)
|
|
2043
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).`)
|
|
2044
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.`)
|
|
2045
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.`)
|
|
@@ -2048,34 +2048,34 @@ account
|
|
|
2048
2048
|
.action(actionRunner(accountCreateOAuth2Token))
|
|
2049
2049
|
|
|
2050
2050
|
account
|
|
2051
|
-
.command(`
|
|
2051
|
+
.command(`create-phone-token`)
|
|
2052
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).`)
|
|
2053
|
-
.requiredOption(`--
|
|
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.`)
|
|
2054
2054
|
.requiredOption(`--phone <phone>`, `Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`)
|
|
2055
2055
|
.action(actionRunner(accountCreatePhoneToken))
|
|
2056
2056
|
|
|
2057
2057
|
account
|
|
2058
|
-
.command(`
|
|
2058
|
+
.command(`create-verification`)
|
|
2059
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. `)
|
|
2060
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.`)
|
|
2061
2061
|
.action(actionRunner(accountCreateVerification))
|
|
2062
2062
|
|
|
2063
2063
|
account
|
|
2064
|
-
.command(`
|
|
2064
|
+
.command(`update-verification`)
|
|
2065
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.`)
|
|
2066
|
-
.requiredOption(`--
|
|
2066
|
+
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
2067
2067
|
.requiredOption(`--secret <secret>`, `Valid verification token.`)
|
|
2068
2068
|
.action(actionRunner(accountUpdateVerification))
|
|
2069
2069
|
|
|
2070
2070
|
account
|
|
2071
|
-
.command(`
|
|
2071
|
+
.command(`create-phone-verification`)
|
|
2072
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.`)
|
|
2073
2073
|
.action(actionRunner(accountCreatePhoneVerification))
|
|
2074
2074
|
|
|
2075
2075
|
account
|
|
2076
|
-
.command(`
|
|
2076
|
+
.command(`update-phone-verification`)
|
|
2077
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.`)
|
|
2078
|
-
.requiredOption(`--
|
|
2078
|
+
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
2079
2079
|
.requiredOption(`--secret <secret>`, `Valid verification token.`)
|
|
2080
2080
|
.action(actionRunner(accountUpdatePhoneVerification))
|
|
2081
2081
|
|
package/lib/commands/avatars.js
CHANGED
|
@@ -428,7 +428,7 @@ const avatarsGetQR = async ({text,size,margin,download,parseOutput = true, overr
|
|
|
428
428
|
}
|
|
429
429
|
|
|
430
430
|
avatars
|
|
431
|
-
.command(`
|
|
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(`
|
|
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(`
|
|
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(`
|
|
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(`
|
|
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(`
|
|
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(`
|
|
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)
|