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.
@@ -1717,7 +1717,7 @@ users
1717
1717
  users
1718
1718
  .command(`create`)
1719
1719
  .description(`Create a new user.`)
1720
- .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.`)
1720
+ .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.`)
1721
1721
  .option(`--email <email>`, `User email.`)
1722
1722
  .option(`--phone <phone>`, `Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`)
1723
1723
  .option(`--password <password>`, `Plain text user password. Must be at least 8 chars.`)
@@ -1725,92 +1725,92 @@ users
1725
1725
  .action(actionRunner(usersCreate))
1726
1726
 
1727
1727
  users
1728
- .command(`createArgon2User`)
1728
+ .command(`create-argon-2-user`)
1729
1729
  .description(`Create a new user. Password provided must be hashed with the [Argon2](https://en.wikipedia.org/wiki/Argon2) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.`)
1730
- .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.`)
1730
+ .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.`)
1731
1731
  .requiredOption(`--email <email>`, `User email.`)
1732
1732
  .requiredOption(`--password <password>`, `User password hashed using Argon2.`)
1733
1733
  .option(`--name <name>`, `User name. Max length: 128 chars.`)
1734
1734
  .action(actionRunner(usersCreateArgon2User))
1735
1735
 
1736
1736
  users
1737
- .command(`createBcryptUser`)
1737
+ .command(`create-bcrypt-user`)
1738
1738
  .description(`Create a new user. Password provided must be hashed with the [Bcrypt](https://en.wikipedia.org/wiki/Bcrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.`)
1739
- .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.`)
1739
+ .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.`)
1740
1740
  .requiredOption(`--email <email>`, `User email.`)
1741
1741
  .requiredOption(`--password <password>`, `User password hashed using Bcrypt.`)
1742
1742
  .option(`--name <name>`, `User name. Max length: 128 chars.`)
1743
1743
  .action(actionRunner(usersCreateBcryptUser))
1744
1744
 
1745
1745
  users
1746
- .command(`listIdentities`)
1746
+ .command(`list-identities`)
1747
1747
  .description(`Get identities for all users.`)
1748
1748
  .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`)
1749
1749
  .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
1750
1750
  .action(actionRunner(usersListIdentities))
1751
1751
 
1752
1752
  users
1753
- .command(`deleteIdentity`)
1753
+ .command(`delete-identity`)
1754
1754
  .description(`Delete an identity by its unique ID.`)
1755
- .requiredOption(`--identityId <identityId>`, `Identity ID.`)
1755
+ .requiredOption(`--identity-id <identity-id>`, `Identity ID.`)
1756
1756
  .action(actionRunner(usersDeleteIdentity))
1757
1757
 
1758
1758
  users
1759
- .command(`createMD5User`)
1759
+ .command(`create-md-5-user`)
1760
1760
  .description(`Create a new user. Password provided must be hashed with the [MD5](https://en.wikipedia.org/wiki/MD5) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.`)
1761
- .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.`)
1761
+ .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.`)
1762
1762
  .requiredOption(`--email <email>`, `User email.`)
1763
1763
  .requiredOption(`--password <password>`, `User password hashed using MD5.`)
1764
1764
  .option(`--name <name>`, `User name. Max length: 128 chars.`)
1765
1765
  .action(actionRunner(usersCreateMD5User))
1766
1766
 
1767
1767
  users
1768
- .command(`createPHPassUser`)
1768
+ .command(`create-ph-pass-user`)
1769
1769
  .description(`Create a new user. Password provided must be hashed with the [PHPass](https://www.openwall.com/phpass/) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.`)
1770
- .requiredOption(`--userId <userId>`, `User ID. Choose a custom ID or pass the string 'ID.unique()'to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
1770
+ .requiredOption(`--user-id <user-id>`, `User ID. Choose a custom ID or pass the string 'ID.unique()'to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
1771
1771
  .requiredOption(`--email <email>`, `User email.`)
1772
1772
  .requiredOption(`--password <password>`, `User password hashed using PHPass.`)
1773
1773
  .option(`--name <name>`, `User name. Max length: 128 chars.`)
1774
1774
  .action(actionRunner(usersCreatePHPassUser))
1775
1775
 
1776
1776
  users
1777
- .command(`createScryptUser`)
1777
+ .command(`create-scrypt-user`)
1778
1778
  .description(`Create a new user. Password provided must be hashed with the [Scrypt](https://github.com/Tarsnap/scrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.`)
1779
- .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.`)
1779
+ .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.`)
1780
1780
  .requiredOption(`--email <email>`, `User email.`)
1781
1781
  .requiredOption(`--password <password>`, `User password hashed using Scrypt.`)
1782
- .requiredOption(`--passwordSalt <passwordSalt>`, `Optional salt used to hash password.`)
1783
- .requiredOption(`--passwordCpu <passwordCpu>`, `Optional CPU cost used to hash password.`, parseInteger)
1784
- .requiredOption(`--passwordMemory <passwordMemory>`, `Optional memory cost used to hash password.`, parseInteger)
1785
- .requiredOption(`--passwordParallel <passwordParallel>`, `Optional parallelization cost used to hash password.`, parseInteger)
1786
- .requiredOption(`--passwordLength <passwordLength>`, `Optional hash length used to hash password.`, parseInteger)
1782
+ .requiredOption(`--password-salt <password-salt>`, `Optional salt used to hash password.`)
1783
+ .requiredOption(`--password-cpu <password-cpu>`, `Optional CPU cost used to hash password.`, parseInteger)
1784
+ .requiredOption(`--password-memory <password-memory>`, `Optional memory cost used to hash password.`, parseInteger)
1785
+ .requiredOption(`--password-parallel <password-parallel>`, `Optional parallelization cost used to hash password.`, parseInteger)
1786
+ .requiredOption(`--password-length <password-length>`, `Optional hash length used to hash password.`, parseInteger)
1787
1787
  .option(`--name <name>`, `User name. Max length: 128 chars.`)
1788
1788
  .action(actionRunner(usersCreateScryptUser))
1789
1789
 
1790
1790
  users
1791
- .command(`createScryptModifiedUser`)
1791
+ .command(`create-scrypt-modified-user`)
1792
1792
  .description(`Create a new user. Password provided must be hashed with the [Scrypt Modified](https://gist.github.com/Meldiron/eecf84a0225eccb5a378d45bb27462cc) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.`)
1793
- .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.`)
1793
+ .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.`)
1794
1794
  .requiredOption(`--email <email>`, `User email.`)
1795
1795
  .requiredOption(`--password <password>`, `User password hashed using Scrypt Modified.`)
1796
- .requiredOption(`--passwordSalt <passwordSalt>`, `Salt used to hash password.`)
1797
- .requiredOption(`--passwordSaltSeparator <passwordSaltSeparator>`, `Salt separator used to hash password.`)
1798
- .requiredOption(`--passwordSignerKey <passwordSignerKey>`, `Signer key used to hash password.`)
1796
+ .requiredOption(`--password-salt <password-salt>`, `Salt used to hash password.`)
1797
+ .requiredOption(`--password-salt-separator <password-salt-separator>`, `Salt separator used to hash password.`)
1798
+ .requiredOption(`--password-signer-key <password-signer-key>`, `Signer key used to hash password.`)
1799
1799
  .option(`--name <name>`, `User name. Max length: 128 chars.`)
1800
1800
  .action(actionRunner(usersCreateScryptModifiedUser))
1801
1801
 
1802
1802
  users
1803
- .command(`createSHAUser`)
1803
+ .command(`create-sha-user`)
1804
1804
  .description(`Create a new user. Password provided must be hashed with the [SHA](https://en.wikipedia.org/wiki/Secure_Hash_Algorithm) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.`)
1805
- .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.`)
1805
+ .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.`)
1806
1806
  .requiredOption(`--email <email>`, `User email.`)
1807
1807
  .requiredOption(`--password <password>`, `User password hashed using SHA.`)
1808
- .option(`--passwordVersion <passwordVersion>`, `Optional SHA version used to hash password. Allowed values are: 'sha1', 'sha224', 'sha256', 'sha384', 'sha512/224', 'sha512/256', 'sha512', 'sha3-224', 'sha3-256', 'sha3-384', 'sha3-512'`)
1808
+ .option(`--password-version <password-version>`, `Optional SHA version used to hash password. Allowed values are: 'sha1', 'sha224', 'sha256', 'sha384', 'sha512/224', 'sha512/256', 'sha512', 'sha3-224', 'sha3-256', 'sha3-384', 'sha3-512'`)
1809
1809
  .option(`--name <name>`, `User name. Max length: 128 chars.`)
1810
1810
  .action(actionRunner(usersCreateSHAUser))
1811
1811
 
1812
1812
  users
1813
- .command(`getUsage`)
1813
+ .command(`get-usage`)
1814
1814
  .description(``)
1815
1815
  .option(`--range <range>`, `Date range.`)
1816
1816
  .action(actionRunner(usersGetUsage))
@@ -1818,218 +1818,218 @@ users
1818
1818
  users
1819
1819
  .command(`get`)
1820
1820
  .description(`Get a user by its unique ID.`)
1821
- .requiredOption(`--userId <userId>`, `User ID.`)
1821
+ .requiredOption(`--user-id <user-id>`, `User ID.`)
1822
1822
  .option(`--console`, `Get the resource console url`)
1823
1823
  .action(actionRunner(usersGet))
1824
1824
 
1825
1825
  users
1826
1826
  .command(`delete`)
1827
1827
  .description(`Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](https://appwrite.io/docs/server/users#usersUpdateStatus) endpoint instead.`)
1828
- .requiredOption(`--userId <userId>`, `User ID.`)
1828
+ .requiredOption(`--user-id <user-id>`, `User ID.`)
1829
1829
  .action(actionRunner(usersDelete))
1830
1830
 
1831
1831
  users
1832
- .command(`updateEmail`)
1832
+ .command(`update-email`)
1833
1833
  .description(`Update the user email by its unique ID.`)
1834
- .requiredOption(`--userId <userId>`, `User ID.`)
1834
+ .requiredOption(`--user-id <user-id>`, `User ID.`)
1835
1835
  .requiredOption(`--email <email>`, `User email.`)
1836
1836
  .action(actionRunner(usersUpdateEmail))
1837
1837
 
1838
1838
  users
1839
- .command(`createJWT`)
1839
+ .command(`create-jwt`)
1840
1840
  .description(`Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted.`)
1841
- .requiredOption(`--userId <userId>`, `User ID.`)
1842
- .option(`--sessionId <sessionId>`, `Session ID. Use the string 'recent' to use the most recent session. Defaults to the most recent session.`)
1841
+ .requiredOption(`--user-id <user-id>`, `User ID.`)
1842
+ .option(`--session-id <session-id>`, `Session ID. Use the string 'recent' to use the most recent session. Defaults to the most recent session.`)
1843
1843
  .option(`--duration <duration>`, `Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.`, parseInteger)
1844
1844
  .action(actionRunner(usersCreateJWT))
1845
1845
 
1846
1846
  users
1847
- .command(`updateLabels`)
1847
+ .command(`update-labels`)
1848
1848
  .description(`Update the user labels by its unique ID. Labels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https://appwrite.io/docs/permissions) for more info.`)
1849
- .requiredOption(`--userId <userId>`, `User ID.`)
1849
+ .requiredOption(`--user-id <user-id>`, `User ID.`)
1850
1850
  .requiredOption(`--labels [labels...]`, `Array of user labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long.`)
1851
1851
  .action(actionRunner(usersUpdateLabels))
1852
1852
 
1853
1853
  users
1854
- .command(`listLogs`)
1854
+ .command(`list-logs`)
1855
1855
  .description(`Get the user activity logs list by its unique ID.`)
1856
- .requiredOption(`--userId <userId>`, `User ID.`)
1856
+ .requiredOption(`--user-id <user-id>`, `User ID.`)
1857
1857
  .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`)
1858
1858
  .action(actionRunner(usersListLogs))
1859
1859
 
1860
1860
  users
1861
- .command(`listMemberships`)
1861
+ .command(`list-memberships`)
1862
1862
  .description(`Get the user membership list by its unique ID.`)
1863
- .requiredOption(`--userId <userId>`, `User ID.`)
1863
+ .requiredOption(`--user-id <user-id>`, `User ID.`)
1864
1864
  .action(actionRunner(usersListMemberships))
1865
1865
 
1866
1866
  users
1867
- .command(`updateMfa`)
1867
+ .command(`update-mfa`)
1868
1868
  .description(`Enable or disable MFA on a user account.`)
1869
- .requiredOption(`--userId <userId>`, `User ID.`)
1869
+ .requiredOption(`--user-id <user-id>`, `User ID.`)
1870
1870
  .requiredOption(`--mfa <mfa>`, `Enable or disable MFA.`, parseBool)
1871
1871
  .action(actionRunner(usersUpdateMfa))
1872
1872
 
1873
1873
  users
1874
- .command(`deleteMfaAuthenticator`)
1874
+ .command(`delete-mfa-authenticator`)
1875
1875
  .description(`Delete an authenticator app.`)
1876
- .requiredOption(`--userId <userId>`, `User ID.`)
1876
+ .requiredOption(`--user-id <user-id>`, `User ID.`)
1877
1877
  .requiredOption(`--type <type>`, `Type of authenticator.`)
1878
1878
  .action(actionRunner(usersDeleteMfaAuthenticator))
1879
1879
 
1880
1880
  users
1881
- .command(`listMfaFactors`)
1881
+ .command(`list-mfa-factors`)
1882
1882
  .description(`List the factors available on the account to be used as a MFA challange.`)
1883
- .requiredOption(`--userId <userId>`, `User ID.`)
1883
+ .requiredOption(`--user-id <user-id>`, `User ID.`)
1884
1884
  .action(actionRunner(usersListMfaFactors))
1885
1885
 
1886
1886
  users
1887
- .command(`getMfaRecoveryCodes`)
1887
+ .command(`get-mfa-recovery-codes`)
1888
1888
  .description(`Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method.`)
1889
- .requiredOption(`--userId <userId>`, `User ID.`)
1889
+ .requiredOption(`--user-id <user-id>`, `User ID.`)
1890
1890
  .action(actionRunner(usersGetMfaRecoveryCodes))
1891
1891
 
1892
1892
  users
1893
- .command(`updateMfaRecoveryCodes`)
1893
+ .command(`update-mfa-recovery-codes`)
1894
1894
  .description(`Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method.`)
1895
- .requiredOption(`--userId <userId>`, `User ID.`)
1895
+ .requiredOption(`--user-id <user-id>`, `User ID.`)
1896
1896
  .action(actionRunner(usersUpdateMfaRecoveryCodes))
1897
1897
 
1898
1898
  users
1899
- .command(`createMfaRecoveryCodes`)
1899
+ .command(`create-mfa-recovery-codes`)
1900
1900
  .description(`Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method by client SDK.`)
1901
- .requiredOption(`--userId <userId>`, `User ID.`)
1901
+ .requiredOption(`--user-id <user-id>`, `User ID.`)
1902
1902
  .action(actionRunner(usersCreateMfaRecoveryCodes))
1903
1903
 
1904
1904
  users
1905
- .command(`updateName`)
1905
+ .command(`update-name`)
1906
1906
  .description(`Update the user name by its unique ID.`)
1907
- .requiredOption(`--userId <userId>`, `User ID.`)
1907
+ .requiredOption(`--user-id <user-id>`, `User ID.`)
1908
1908
  .requiredOption(`--name <name>`, `User name. Max length: 128 chars.`)
1909
1909
  .action(actionRunner(usersUpdateName))
1910
1910
 
1911
1911
  users
1912
- .command(`updatePassword`)
1912
+ .command(`update-password`)
1913
1913
  .description(`Update the user password by its unique ID.`)
1914
- .requiredOption(`--userId <userId>`, `User ID.`)
1914
+ .requiredOption(`--user-id <user-id>`, `User ID.`)
1915
1915
  .requiredOption(`--password <password>`, `New user password. Must be at least 8 chars.`)
1916
1916
  .action(actionRunner(usersUpdatePassword))
1917
1917
 
1918
1918
  users
1919
- .command(`updatePhone`)
1919
+ .command(`update-phone`)
1920
1920
  .description(`Update the user phone by its unique ID.`)
1921
- .requiredOption(`--userId <userId>`, `User ID.`)
1921
+ .requiredOption(`--user-id <user-id>`, `User ID.`)
1922
1922
  .requiredOption(`--number <number>`, `User phone number.`)
1923
1923
  .action(actionRunner(usersUpdatePhone))
1924
1924
 
1925
1925
  users
1926
- .command(`getPrefs`)
1926
+ .command(`get-prefs`)
1927
1927
  .description(`Get the user preferences by its unique ID.`)
1928
- .requiredOption(`--userId <userId>`, `User ID.`)
1928
+ .requiredOption(`--user-id <user-id>`, `User ID.`)
1929
1929
  .action(actionRunner(usersGetPrefs))
1930
1930
 
1931
1931
  users
1932
- .command(`updatePrefs`)
1932
+ .command(`update-prefs`)
1933
1933
  .description(`Update the user preferences by its unique ID. 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.`)
1934
- .requiredOption(`--userId <userId>`, `User ID.`)
1934
+ .requiredOption(`--user-id <user-id>`, `User ID.`)
1935
1935
  .requiredOption(`--prefs <prefs>`, `Prefs key-value JSON object.`)
1936
1936
  .action(actionRunner(usersUpdatePrefs))
1937
1937
 
1938
1938
  users
1939
- .command(`listSessions`)
1939
+ .command(`list-sessions`)
1940
1940
  .description(`Get the user sessions list by its unique ID.`)
1941
- .requiredOption(`--userId <userId>`, `User ID.`)
1941
+ .requiredOption(`--user-id <user-id>`, `User ID.`)
1942
1942
  .option(`--console`, `Get the resource console url`)
1943
1943
  .action(actionRunner(usersListSessions))
1944
1944
 
1945
1945
  users
1946
- .command(`createSession`)
1946
+ .command(`create-session`)
1947
1947
  .description(`Creates a session for a user. Returns an immediately usable session object. If you want to generate a token for a custom authentication flow, use the [POST /users/{userId}/tokens](https://appwrite.io/docs/server/users#createToken) endpoint.`)
1948
- .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.`)
1948
+ .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.`)
1949
1949
  .action(actionRunner(usersCreateSession))
1950
1950
 
1951
1951
  users
1952
- .command(`deleteSessions`)
1952
+ .command(`delete-sessions`)
1953
1953
  .description(`Delete all user's sessions by using the user's unique ID.`)
1954
- .requiredOption(`--userId <userId>`, `User ID.`)
1954
+ .requiredOption(`--user-id <user-id>`, `User ID.`)
1955
1955
  .action(actionRunner(usersDeleteSessions))
1956
1956
 
1957
1957
  users
1958
- .command(`deleteSession`)
1958
+ .command(`delete-session`)
1959
1959
  .description(`Delete a user sessions by its unique ID.`)
1960
- .requiredOption(`--userId <userId>`, `User ID.`)
1961
- .requiredOption(`--sessionId <sessionId>`, `Session ID.`)
1960
+ .requiredOption(`--user-id <user-id>`, `User ID.`)
1961
+ .requiredOption(`--session-id <session-id>`, `Session ID.`)
1962
1962
  .action(actionRunner(usersDeleteSession))
1963
1963
 
1964
1964
  users
1965
- .command(`updateStatus`)
1965
+ .command(`update-status`)
1966
1966
  .description(`Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved.`)
1967
- .requiredOption(`--userId <userId>`, `User ID.`)
1967
+ .requiredOption(`--user-id <user-id>`, `User ID.`)
1968
1968
  .requiredOption(`--status <status>`, `User Status. To activate the user pass 'true' and to block the user pass 'false'.`, parseBool)
1969
1969
  .action(actionRunner(usersUpdateStatus))
1970
1970
 
1971
1971
  users
1972
- .command(`listTargets`)
1972
+ .command(`list-targets`)
1973
1973
  .description(`List the messaging targets that are associated with a user.`)
1974
- .requiredOption(`--userId <userId>`, `User ID.`)
1974
+ .requiredOption(`--user-id <user-id>`, `User ID.`)
1975
1975
  .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: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels`)
1976
1976
  .action(actionRunner(usersListTargets))
1977
1977
 
1978
1978
  users
1979
- .command(`createTarget`)
1979
+ .command(`create-target`)
1980
1980
  .description(`Create a messaging target.`)
1981
- .requiredOption(`--userId <userId>`, `User ID.`)
1982
- .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.`)
1983
- .requiredOption(`--providerType <providerType>`, `The target provider type. Can be one of the following: 'email', 'sms' or 'push'.`)
1981
+ .requiredOption(`--user-id <user-id>`, `User ID.`)
1982
+ .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.`)
1983
+ .requiredOption(`--provider-type <provider-type>`, `The target provider type. Can be one of the following: 'email', 'sms' or 'push'.`)
1984
1984
  .requiredOption(`--identifier <identifier>`, `The target identifier (token, email, phone etc.)`)
1985
- .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.`)
1985
+ .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.`)
1986
1986
  .option(`--name <name>`, `Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.`)
1987
1987
  .action(actionRunner(usersCreateTarget))
1988
1988
 
1989
1989
  users
1990
- .command(`getTarget`)
1990
+ .command(`get-target`)
1991
1991
  .description(`Get a user's push notification target by ID.`)
1992
- .requiredOption(`--userId <userId>`, `User ID.`)
1993
- .requiredOption(`--targetId <targetId>`, `Target ID.`)
1992
+ .requiredOption(`--user-id <user-id>`, `User ID.`)
1993
+ .requiredOption(`--target-id <target-id>`, `Target ID.`)
1994
1994
  .action(actionRunner(usersGetTarget))
1995
1995
 
1996
1996
  users
1997
- .command(`updateTarget`)
1997
+ .command(`update-target`)
1998
1998
  .description(`Update a messaging target.`)
1999
- .requiredOption(`--userId <userId>`, `User ID.`)
2000
- .requiredOption(`--targetId <targetId>`, `Target ID.`)
1999
+ .requiredOption(`--user-id <user-id>`, `User ID.`)
2000
+ .requiredOption(`--target-id <target-id>`, `Target ID.`)
2001
2001
  .option(`--identifier <identifier>`, `The target identifier (token, email, phone etc.)`)
2002
- .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.`)
2002
+ .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.`)
2003
2003
  .option(`--name <name>`, `Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.`)
2004
2004
  .action(actionRunner(usersUpdateTarget))
2005
2005
 
2006
2006
  users
2007
- .command(`deleteTarget`)
2007
+ .command(`delete-target`)
2008
2008
  .description(`Delete a messaging target.`)
2009
- .requiredOption(`--userId <userId>`, `User ID.`)
2010
- .requiredOption(`--targetId <targetId>`, `Target ID.`)
2009
+ .requiredOption(`--user-id <user-id>`, `User ID.`)
2010
+ .requiredOption(`--target-id <target-id>`, `Target ID.`)
2011
2011
  .action(actionRunner(usersDeleteTarget))
2012
2012
 
2013
2013
  users
2014
- .command(`createToken`)
2014
+ .command(`create-token`)
2015
2015
  .description(`Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT /account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. `)
2016
- .requiredOption(`--userId <userId>`, `User ID.`)
2016
+ .requiredOption(`--user-id <user-id>`, `User ID.`)
2017
2017
  .option(`--length <length>`, `Token length in characters. The default length is 6 characters`, parseInteger)
2018
2018
  .option(`--expire <expire>`, `Token expiration period in seconds. The default expiration is 15 minutes.`, parseInteger)
2019
2019
  .action(actionRunner(usersCreateToken))
2020
2020
 
2021
2021
  users
2022
- .command(`updateEmailVerification`)
2022
+ .command(`update-email-verification`)
2023
2023
  .description(`Update the user email verification status by its unique ID.`)
2024
- .requiredOption(`--userId <userId>`, `User ID.`)
2025
- .requiredOption(`--emailVerification <emailVerification>`, `User email verification status.`, parseBool)
2024
+ .requiredOption(`--user-id <user-id>`, `User ID.`)
2025
+ .requiredOption(`--email-verification <email-verification>`, `User email verification status.`, parseBool)
2026
2026
  .action(actionRunner(usersUpdateEmailVerification))
2027
2027
 
2028
2028
  users
2029
- .command(`updatePhoneVerification`)
2029
+ .command(`update-phone-verification`)
2030
2030
  .description(`Update the user phone verification status by its unique ID.`)
2031
- .requiredOption(`--userId <userId>`, `User ID.`)
2032
- .requiredOption(`--phoneVerification <phoneVerification>`, `User phone verification status.`, parseBool)
2031
+ .requiredOption(`--user-id <user-id>`, `User ID.`)
2032
+ .requiredOption(`--phone-verification <phone-verification>`, `User phone verification status.`, parseBool)
2033
2033
  .action(actionRunner(usersUpdatePhoneVerification))
2034
2034
 
2035
2035
  module.exports = {
@@ -396,75 +396,75 @@ const vcsDeleteInstallation = async ({installationId,parseOutput = true, overrid
396
396
  }
397
397
 
398
398
  vcs
399
- .command(`listRepositories`)
399
+ .command(`list-repositories`)
400
400
  .description(``)
401
- .requiredOption(`--installationId <installationId>`, `Installation Id`)
401
+ .requiredOption(`--installation-id <installation-id>`, `Installation Id`)
402
402
  .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
403
403
  .action(actionRunner(vcsListRepositories))
404
404
 
405
405
  vcs
406
- .command(`createRepository`)
406
+ .command(`create-repository`)
407
407
  .description(``)
408
- .requiredOption(`--installationId <installationId>`, `Installation Id`)
408
+ .requiredOption(`--installation-id <installation-id>`, `Installation Id`)
409
409
  .requiredOption(`--name <name>`, `Repository name (slug)`)
410
410
  .requiredOption(`--xprivate <xprivate>`, `Mark repository public or private`, parseBool)
411
411
  .action(actionRunner(vcsCreateRepository))
412
412
 
413
413
  vcs
414
- .command(`getRepository`)
414
+ .command(`get-repository`)
415
415
  .description(``)
416
- .requiredOption(`--installationId <installationId>`, `Installation Id`)
417
- .requiredOption(`--providerRepositoryId <providerRepositoryId>`, `Repository Id`)
416
+ .requiredOption(`--installation-id <installation-id>`, `Installation Id`)
417
+ .requiredOption(`--provider-repository-id <provider-repository-id>`, `Repository Id`)
418
418
  .action(actionRunner(vcsGetRepository))
419
419
 
420
420
  vcs
421
- .command(`listRepositoryBranches`)
421
+ .command(`list-repository-branches`)
422
422
  .description(``)
423
- .requiredOption(`--installationId <installationId>`, `Installation Id`)
424
- .requiredOption(`--providerRepositoryId <providerRepositoryId>`, `Repository Id`)
423
+ .requiredOption(`--installation-id <installation-id>`, `Installation Id`)
424
+ .requiredOption(`--provider-repository-id <provider-repository-id>`, `Repository Id`)
425
425
  .action(actionRunner(vcsListRepositoryBranches))
426
426
 
427
427
  vcs
428
- .command(`getRepositoryContents`)
428
+ .command(`get-repository-contents`)
429
429
  .description(``)
430
- .requiredOption(`--installationId <installationId>`, `Installation Id`)
431
- .requiredOption(`--providerRepositoryId <providerRepositoryId>`, `Repository Id`)
432
- .option(`--providerRootDirectory <providerRootDirectory>`, `Path to get contents of nested directory`)
430
+ .requiredOption(`--installation-id <installation-id>`, `Installation Id`)
431
+ .requiredOption(`--provider-repository-id <provider-repository-id>`, `Repository Id`)
432
+ .option(`--provider-root-directory <provider-root-directory>`, `Path to get contents of nested directory`)
433
433
  .action(actionRunner(vcsGetRepositoryContents))
434
434
 
435
435
  vcs
436
- .command(`createRepositoryDetection`)
436
+ .command(`create-repository-detection`)
437
437
  .description(``)
438
- .requiredOption(`--installationId <installationId>`, `Installation Id`)
439
- .requiredOption(`--providerRepositoryId <providerRepositoryId>`, `Repository Id`)
440
- .option(`--providerRootDirectory <providerRootDirectory>`, `Path to Root Directory`)
438
+ .requiredOption(`--installation-id <installation-id>`, `Installation Id`)
439
+ .requiredOption(`--provider-repository-id <provider-repository-id>`, `Repository Id`)
440
+ .option(`--provider-root-directory <provider-root-directory>`, `Path to Root Directory`)
441
441
  .action(actionRunner(vcsCreateRepositoryDetection))
442
442
 
443
443
  vcs
444
- .command(`updateExternalDeployments`)
444
+ .command(`update-external-deployments`)
445
445
  .description(``)
446
- .requiredOption(`--installationId <installationId>`, `Installation Id`)
447
- .requiredOption(`--repositoryId <repositoryId>`, `VCS Repository Id`)
448
- .requiredOption(`--providerPullRequestId <providerPullRequestId>`, `GitHub Pull Request Id`)
446
+ .requiredOption(`--installation-id <installation-id>`, `Installation Id`)
447
+ .requiredOption(`--repository-id <repository-id>`, `VCS Repository Id`)
448
+ .requiredOption(`--provider-pull-request-id <provider-pull-request-id>`, `GitHub Pull Request Id`)
449
449
  .action(actionRunner(vcsUpdateExternalDeployments))
450
450
 
451
451
  vcs
452
- .command(`listInstallations`)
452
+ .command(`list-installations`)
453
453
  .description(``)
454
454
  .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: provider, organization`)
455
455
  .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
456
456
  .action(actionRunner(vcsListInstallations))
457
457
 
458
458
  vcs
459
- .command(`getInstallation`)
459
+ .command(`get-installation`)
460
460
  .description(``)
461
- .requiredOption(`--installationId <installationId>`, `Installation Id`)
461
+ .requiredOption(`--installation-id <installation-id>`, `Installation Id`)
462
462
  .action(actionRunner(vcsGetInstallation))
463
463
 
464
464
  vcs
465
- .command(`deleteInstallation`)
465
+ .command(`delete-installation`)
466
466
  .description(``)
467
- .requiredOption(`--installationId <installationId>`, `Installation Id`)
467
+ .requiredOption(`--installation-id <installation-id>`, `Installation Id`)
468
468
  .action(actionRunner(vcsDeleteInstallation))
469
469
 
470
470
  module.exports = {
package/lib/config.js CHANGED
@@ -8,8 +8,9 @@ const KeysFunction = new Set(["path", "$id", "execute", "name", "enabled", "logg
8
8
  const KeysDatabase = new Set(["$id", "name", "enabled"]);
9
9
  const KeysCollection = new Set(["$id", "$permissions", "databaseId", "name", "enabled", "documentSecurity", "attributes", "indexes"]);
10
10
  const KeysStorage = new Set(["$id", "$permissions", "fileSecurity", "name", "enabled", "maximumFileSize", "allowedFileExtensions", "compression", "encryption", "antivirus"]);
11
- const KeyTopics = new Set(["$id", "name", "subscribe"]);
12
- const KeyAttributes = new Set([
11
+ const KeysTopics = new Set(["$id", "name", "subscribe"]);
12
+ const KeysTeams = new Set(["$id", "name"]);
13
+ const KeysAttributes = new Set([
13
14
  "key",
14
15
  "type",
15
16
  "required",
@@ -17,7 +18,7 @@ const KeyAttributes = new Set([
17
18
  "size",
18
19
  "default",
19
20
  // integer and float
20
- "min",
21
+ "min",
21
22
  "max",
22
23
  // email, enum, URL, IP, and datetime
23
24
  "format",
@@ -29,7 +30,10 @@ const KeyAttributes = new Set([
29
30
  "twoWay",
30
31
  "twoWayKey",
31
32
  "onDelete",
32
- "side"
33
+ "side",
34
+ // Indexes
35
+ "attributes",
36
+ "orders"
33
37
  ]);
34
38
  const KeyIndexes = new Set(["key", "type", "status", "attributes", "orders"]);
35
39
 
@@ -193,7 +197,7 @@ class Local extends Config {
193
197
 
194
198
  addCollection(props) {
195
199
  props = whitelistKeys(props, KeysCollection, {
196
- attributes: KeyAttributes,
200
+ attributes: KeysAttributes,
197
201
  indexes: KeyIndexes
198
202
  });
199
203
 
@@ -277,7 +281,7 @@ class Local extends Config {
277
281
  }
278
282
 
279
283
  addMessagingTopic(props) {
280
- props = whitelistKeys(props, KeyTopics);
284
+ props = whitelistKeys(props, KeysTopics);
281
285
 
282
286
  if (!this.has("topics")) {
283
287
  this.set("topics", []);
@@ -359,6 +363,7 @@ class Local extends Config {
359
363
  }
360
364
 
361
365
  addTeam(props) {
366
+ props = whitelistKeys(props, KeysTeams);
362
367
  if (!this.has("teams")) {
363
368
  this.set("teams", []);
364
369
  }
@@ -398,7 +403,11 @@ class Local extends Config {
398
403
  return;
399
404
  }
400
405
 
401
- const settings = {
406
+ this.set('settings', this.createSettingsObject(settings));
407
+ }
408
+
409
+ createSettingsObject(projectSettings) {
410
+ return {
402
411
  services: {
403
412
  account: projectSettings.serviceStatusForAccount,
404
413
  avatars: projectSettings.serviceStatusForAvatars,
@@ -432,10 +441,7 @@ class Local extends Config {
432
441
  }
433
442
  }
434
443
  };
435
-
436
- this.set('settings', settings)
437
444
  }
438
-
439
445
  }
440
446
 
441
447
  class Global extends Config {
@@ -604,4 +610,10 @@ class Global extends Config {
604
610
  module.exports = {
605
611
  localConfig: new Local(),
606
612
  globalConfig: new Global(),
613
+ KeysAttributes,
614
+ KeysFunction,
615
+ KeysTopics,
616
+ KeysStorage,
617
+ KeysTeams,
618
+ whitelistKeys
607
619
  };