diff --git a/README.md b/README.md index 8a70dd4..ab30255 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # Appwrite Command Line SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-cli.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.7.4-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.8.0-blue.svg?style=flat-square) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) -**This SDK is compatible with Appwrite server version 1.7.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-cli/releases).** +**This SDK is compatible with Appwrite server version 1.8.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-cli/releases).** 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) @@ -29,7 +29,7 @@ Once the installation is complete, you can verify the install using ```sh $ appwrite -v -8.3.0 +9.0.0 ``` ### Install using prebuilt binaries @@ -54,13 +54,13 @@ $ iwr -useb https://appwrite.io/cli/install.ps1 | iex ``` Via [Scoop](https://scoop.sh) ```powershell -$ scoop install https://raw.githubusercontent.com/appwrite/sdk-for-cli/master/scoop/appwrite.json +$ scoop install https://raw.githubusercontent.com/appwrite/sdk-for-cli/master/scoop/appwrite.config.json ``` Once the installation completes, you can verify your install using ``` $ appwrite -v -8.3.0 +9.0.0 ``` ## Getting Started diff --git a/docs/examples/account/create-anonymous-session.md b/docs/examples/account/create-anonymous-session.md index a7eb9c5..b6f2432 100644 --- a/docs/examples/account/create-anonymous-session.md +++ b/docs/examples/account/create-anonymous-session.md @@ -1 +1 @@ -appwrite account createAnonymousSession +appwrite account create-anonymous-session diff --git a/docs/examples/account/create-email-password-session.md b/docs/examples/account/create-email-password-session.md index 951293b..b13874c 100644 --- a/docs/examples/account/create-email-password-session.md +++ b/docs/examples/account/create-email-password-session.md @@ -1,3 +1,3 @@ -appwrite account createEmailPasswordSession \ - --email email@example.com \ - --password password +appwrite account create-email-password-session \ + --email email@example.com \ + --password password diff --git a/docs/examples/account/create-email-token.md b/docs/examples/account/create-email-token.md index 0aaf247..1902e8b 100644 --- a/docs/examples/account/create-email-token.md +++ b/docs/examples/account/create-email-token.md @@ -1,4 +1,3 @@ -appwrite account createEmailToken \ - --userId \ - --email email@example.com \ - +appwrite account create-email-token \ + --user-id \ + --email email@example.com diff --git a/docs/examples/account/create-j-w-t.md b/docs/examples/account/create-j-w-t.md deleted file mode 100644 index 7b53379..0000000 --- a/docs/examples/account/create-j-w-t.md +++ /dev/null @@ -1 +0,0 @@ -appwrite account createJWT diff --git a/docs/examples/account/create-jwt.md b/docs/examples/account/create-jwt.md new file mode 100644 index 0000000..f2d6569 --- /dev/null +++ b/docs/examples/account/create-jwt.md @@ -0,0 +1 @@ +appwrite account create-jwt diff --git a/docs/examples/account/create-magic-u-r-l-token.md b/docs/examples/account/create-magic-u-r-l-token.md deleted file mode 100644 index 69203b0..0000000 --- a/docs/examples/account/create-magic-u-r-l-token.md +++ /dev/null @@ -1,5 +0,0 @@ -appwrite account createMagicURLToken \ - --userId \ - --email email@example.com \ - - diff --git a/docs/examples/account/create-magic-url-token.md b/docs/examples/account/create-magic-url-token.md new file mode 100644 index 0000000..4f16a8b --- /dev/null +++ b/docs/examples/account/create-magic-url-token.md @@ -0,0 +1,3 @@ +appwrite account create-magic-url-token \ + --user-id \ + --email email@example.com diff --git a/docs/examples/account/create-mfa-authenticator.md b/docs/examples/account/create-mfa-authenticator.md index 7634217..a454276 100644 --- a/docs/examples/account/create-mfa-authenticator.md +++ b/docs/examples/account/create-mfa-authenticator.md @@ -1,2 +1,2 @@ -appwrite account createMfaAuthenticator \ - --type totp +appwrite account create-mfa-authenticator \ + --type totp diff --git a/docs/examples/account/create-mfa-challenge.md b/docs/examples/account/create-mfa-challenge.md index 8696be7..24bab3d 100644 --- a/docs/examples/account/create-mfa-challenge.md +++ b/docs/examples/account/create-mfa-challenge.md @@ -1,2 +1,2 @@ -appwrite account createMfaChallenge \ - --factor email +appwrite account create-mfa-challenge \ + --factor email diff --git a/docs/examples/account/create-mfa-recovery-codes.md b/docs/examples/account/create-mfa-recovery-codes.md index 0ef2544..4f165d9 100644 --- a/docs/examples/account/create-mfa-recovery-codes.md +++ b/docs/examples/account/create-mfa-recovery-codes.md @@ -1 +1 @@ -appwrite account createMfaRecoveryCodes +appwrite account create-mfa-recovery-codes diff --git a/docs/examples/account/create-o-auth-2-session.md b/docs/examples/account/create-o-auth-2-session.md new file mode 100644 index 0000000..fda2faa --- /dev/null +++ b/docs/examples/account/create-o-auth-2-session.md @@ -0,0 +1,2 @@ +appwrite account create-o-auth-2-session \ + --provider amazon diff --git a/docs/examples/account/create-o-auth-2-token.md b/docs/examples/account/create-o-auth-2-token.md new file mode 100644 index 0000000..7fff73f --- /dev/null +++ b/docs/examples/account/create-o-auth-2-token.md @@ -0,0 +1,2 @@ +appwrite account create-o-auth-2-token \ + --provider amazon diff --git a/docs/examples/account/create-o-auth2session.md b/docs/examples/account/create-o-auth2session.md deleted file mode 100644 index 9159b8f..0000000 --- a/docs/examples/account/create-o-auth2session.md +++ /dev/null @@ -1,5 +0,0 @@ -appwrite account createOAuth2Session \ - --provider amazon \ - - - diff --git a/docs/examples/account/create-o-auth2token.md b/docs/examples/account/create-o-auth2token.md deleted file mode 100644 index b36f350..0000000 --- a/docs/examples/account/create-o-auth2token.md +++ /dev/null @@ -1,5 +0,0 @@ -appwrite account createOAuth2Token \ - --provider amazon \ - - - diff --git a/docs/examples/account/create-phone-token.md b/docs/examples/account/create-phone-token.md index 23f7f19..619478c 100644 --- a/docs/examples/account/create-phone-token.md +++ b/docs/examples/account/create-phone-token.md @@ -1,3 +1,3 @@ -appwrite account createPhoneToken \ - --userId \ - --phone +12065550100 +appwrite account create-phone-token \ + --user-id \ + --phone +12065550100 diff --git a/docs/examples/account/create-phone-verification.md b/docs/examples/account/create-phone-verification.md index 3c4402b..b5a95ed 100644 --- a/docs/examples/account/create-phone-verification.md +++ b/docs/examples/account/create-phone-verification.md @@ -1 +1 @@ -appwrite account createPhoneVerification +appwrite account create-phone-verification diff --git a/docs/examples/account/create-push-target.md b/docs/examples/account/create-push-target.md index 41c380b..1ba6fe3 100644 --- a/docs/examples/account/create-push-target.md +++ b/docs/examples/account/create-push-target.md @@ -1,4 +1,3 @@ -appwrite account createPushTarget \ - --targetId \ - --identifier \ - +appwrite account create-push-target \ + --target-id \ + --identifier diff --git a/docs/examples/account/create-recovery.md b/docs/examples/account/create-recovery.md index ea8c145..d6977de 100644 --- a/docs/examples/account/create-recovery.md +++ b/docs/examples/account/create-recovery.md @@ -1,3 +1,3 @@ -appwrite account createRecovery \ - --email email@example.com \ - --url https://example.com +appwrite account create-recovery \ + --email email@example.com \ + --url https://example.com diff --git a/docs/examples/account/create-session.md b/docs/examples/account/create-session.md index 426713e..eefeb35 100644 --- a/docs/examples/account/create-session.md +++ b/docs/examples/account/create-session.md @@ -1,3 +1,3 @@ -appwrite account createSession \ - --userId \ - --secret +appwrite account create-session \ + --user-id \ + --secret diff --git a/docs/examples/account/create-verification.md b/docs/examples/account/create-verification.md index 402038b..6e972f2 100644 --- a/docs/examples/account/create-verification.md +++ b/docs/examples/account/create-verification.md @@ -1,2 +1,2 @@ -appwrite account createVerification \ - --url https://example.com +appwrite account create-verification \ + --url https://example.com diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md index 09686a2..56eca76 100644 --- a/docs/examples/account/create.md +++ b/docs/examples/account/create.md @@ -1,5 +1,4 @@ appwrite account create \ - --userId \ - --email email@example.com \ - --password '' \ - + --user-id \ + --email email@example.com \ + --password '' diff --git a/docs/examples/account/delete-identity.md b/docs/examples/account/delete-identity.md index acd8511..650ab7b 100644 --- a/docs/examples/account/delete-identity.md +++ b/docs/examples/account/delete-identity.md @@ -1,2 +1,2 @@ -appwrite account deleteIdentity \ - --identityId +appwrite account delete-identity \ + --identity-id diff --git a/docs/examples/account/delete-mfa-authenticator.md b/docs/examples/account/delete-mfa-authenticator.md index d466485..e3689b1 100644 --- a/docs/examples/account/delete-mfa-authenticator.md +++ b/docs/examples/account/delete-mfa-authenticator.md @@ -1,2 +1,2 @@ -appwrite account deleteMfaAuthenticator \ - --type totp +appwrite account delete-mfa-authenticator \ + --type totp diff --git a/docs/examples/account/delete-push-target.md b/docs/examples/account/delete-push-target.md index 610ea23..04f94f6 100644 --- a/docs/examples/account/delete-push-target.md +++ b/docs/examples/account/delete-push-target.md @@ -1,2 +1,2 @@ -appwrite account deletePushTarget \ - --targetId +appwrite account delete-push-target \ + --target-id diff --git a/docs/examples/account/delete-session.md b/docs/examples/account/delete-session.md index 9774552..6476fd9 100644 --- a/docs/examples/account/delete-session.md +++ b/docs/examples/account/delete-session.md @@ -1,2 +1,2 @@ -appwrite account deleteSession \ - --sessionId +appwrite account delete-session \ + --session-id diff --git a/docs/examples/account/delete-sessions.md b/docs/examples/account/delete-sessions.md index dd11877..7381069 100644 --- a/docs/examples/account/delete-sessions.md +++ b/docs/examples/account/delete-sessions.md @@ -1 +1 @@ -appwrite account deleteSessions +appwrite account delete-sessions diff --git a/docs/examples/account/get-mfa-recovery-codes.md b/docs/examples/account/get-mfa-recovery-codes.md index 0e61d65..01a2f35 100644 --- a/docs/examples/account/get-mfa-recovery-codes.md +++ b/docs/examples/account/get-mfa-recovery-codes.md @@ -1 +1 @@ -appwrite account getMfaRecoveryCodes +appwrite account get-mfa-recovery-codes diff --git a/docs/examples/account/get-prefs.md b/docs/examples/account/get-prefs.md index 6569925..5796c08 100644 --- a/docs/examples/account/get-prefs.md +++ b/docs/examples/account/get-prefs.md @@ -1 +1 @@ -appwrite account getPrefs +appwrite account get-prefs diff --git a/docs/examples/account/get-session.md b/docs/examples/account/get-session.md index 120dc82..9901eb2 100644 --- a/docs/examples/account/get-session.md +++ b/docs/examples/account/get-session.md @@ -1,2 +1,2 @@ -appwrite account getSession \ - --sessionId +appwrite account get-session \ + --session-id diff --git a/docs/examples/account/list-identities.md b/docs/examples/account/list-identities.md index 877b443..095dcc4 100644 --- a/docs/examples/account/list-identities.md +++ b/docs/examples/account/list-identities.md @@ -1,2 +1 @@ -appwrite account listIdentities \ - +appwrite account list-identities diff --git a/docs/examples/account/list-logs.md b/docs/examples/account/list-logs.md index e92f490..73fb9b6 100644 --- a/docs/examples/account/list-logs.md +++ b/docs/examples/account/list-logs.md @@ -1,2 +1 @@ -appwrite account listLogs \ - +appwrite account list-logs diff --git a/docs/examples/account/list-mfa-factors.md b/docs/examples/account/list-mfa-factors.md index a29f287..6930f34 100644 --- a/docs/examples/account/list-mfa-factors.md +++ b/docs/examples/account/list-mfa-factors.md @@ -1 +1 @@ -appwrite account listMfaFactors +appwrite account list-mfa-factors diff --git a/docs/examples/account/list-sessions.md b/docs/examples/account/list-sessions.md index 87cbab0..1aca27b 100644 --- a/docs/examples/account/list-sessions.md +++ b/docs/examples/account/list-sessions.md @@ -1 +1 @@ -appwrite account listSessions +appwrite account list-sessions diff --git a/docs/examples/account/update-email.md b/docs/examples/account/update-email.md index 81938ff..9753a06 100644 --- a/docs/examples/account/update-email.md +++ b/docs/examples/account/update-email.md @@ -1,3 +1,3 @@ -appwrite account updateEmail \ - --email email@example.com \ - --password password +appwrite account update-email \ + --email email@example.com \ + --password password diff --git a/docs/examples/account/update-m-f-a.md b/docs/examples/account/update-m-f-a.md deleted file mode 100644 index f714d4d..0000000 --- a/docs/examples/account/update-m-f-a.md +++ /dev/null @@ -1,2 +0,0 @@ -appwrite account updateMFA \ - --mfa false diff --git a/docs/examples/account/update-magic-u-r-l-session.md b/docs/examples/account/update-magic-u-r-l-session.md deleted file mode 100644 index 919bd70..0000000 --- a/docs/examples/account/update-magic-u-r-l-session.md +++ /dev/null @@ -1,3 +0,0 @@ -appwrite account updateMagicURLSession \ - --userId \ - --secret diff --git a/docs/examples/account/update-magic-url-session.md b/docs/examples/account/update-magic-url-session.md new file mode 100644 index 0000000..0bf9ed7 --- /dev/null +++ b/docs/examples/account/update-magic-url-session.md @@ -0,0 +1,3 @@ +appwrite account update-magic-url-session \ + --user-id \ + --secret diff --git a/docs/examples/account/update-mfa-authenticator.md b/docs/examples/account/update-mfa-authenticator.md index b51796a..838297b 100644 --- a/docs/examples/account/update-mfa-authenticator.md +++ b/docs/examples/account/update-mfa-authenticator.md @@ -1,3 +1,3 @@ -appwrite account updateMfaAuthenticator \ - --type totp \ - --otp +appwrite account update-mfa-authenticator \ + --type totp \ + --otp diff --git a/docs/examples/account/update-mfa-challenge.md b/docs/examples/account/update-mfa-challenge.md index 37e09ef..4a5c8fb 100644 --- a/docs/examples/account/update-mfa-challenge.md +++ b/docs/examples/account/update-mfa-challenge.md @@ -1,3 +1,3 @@ -appwrite account updateMfaChallenge \ - --challengeId \ - --otp +appwrite account update-mfa-challenge \ + --challenge-id \ + --otp diff --git a/docs/examples/account/update-mfa-recovery-codes.md b/docs/examples/account/update-mfa-recovery-codes.md index a129ca6..9e9ab07 100644 --- a/docs/examples/account/update-mfa-recovery-codes.md +++ b/docs/examples/account/update-mfa-recovery-codes.md @@ -1 +1 @@ -appwrite account updateMfaRecoveryCodes +appwrite account update-mfa-recovery-codes diff --git a/docs/examples/account/update-mfa.md b/docs/examples/account/update-mfa.md new file mode 100644 index 0000000..fa122d9 --- /dev/null +++ b/docs/examples/account/update-mfa.md @@ -0,0 +1,2 @@ +appwrite account update-mfa \ + --mfa false diff --git a/docs/examples/account/update-name.md b/docs/examples/account/update-name.md index 6f3b597..c858d0e 100644 --- a/docs/examples/account/update-name.md +++ b/docs/examples/account/update-name.md @@ -1,2 +1,2 @@ -appwrite account updateName \ - --name +appwrite account update-name \ + --name diff --git a/docs/examples/account/update-password.md b/docs/examples/account/update-password.md index 340baec..e4bbdfc 100644 --- a/docs/examples/account/update-password.md +++ b/docs/examples/account/update-password.md @@ -1,3 +1,2 @@ -appwrite account updatePassword \ - --password '' \ - +appwrite account update-password \ + --password '' diff --git a/docs/examples/account/update-phone-session.md b/docs/examples/account/update-phone-session.md index d70f33f..599a905 100644 --- a/docs/examples/account/update-phone-session.md +++ b/docs/examples/account/update-phone-session.md @@ -1,3 +1,3 @@ -appwrite account updatePhoneSession \ - --userId \ - --secret +appwrite account update-phone-session \ + --user-id \ + --secret diff --git a/docs/examples/account/update-phone-verification.md b/docs/examples/account/update-phone-verification.md index cef2b5a..59dde67 100644 --- a/docs/examples/account/update-phone-verification.md +++ b/docs/examples/account/update-phone-verification.md @@ -1,3 +1,3 @@ -appwrite account updatePhoneVerification \ - --userId \ - --secret +appwrite account update-phone-verification \ + --user-id \ + --secret diff --git a/docs/examples/account/update-phone.md b/docs/examples/account/update-phone.md index 93a619a..5c257c8 100644 --- a/docs/examples/account/update-phone.md +++ b/docs/examples/account/update-phone.md @@ -1,3 +1,3 @@ -appwrite account updatePhone \ - --phone +12065550100 \ - --password password +appwrite account update-phone \ + --phone +12065550100 \ + --password password diff --git a/docs/examples/account/update-prefs.md b/docs/examples/account/update-prefs.md index 568ac66..7b00d7b 100644 --- a/docs/examples/account/update-prefs.md +++ b/docs/examples/account/update-prefs.md @@ -1,2 +1,2 @@ -appwrite account updatePrefs \ - --prefs '{ "key": "value" }' +appwrite account update-prefs \ + --prefs '{ "key": "value" }' diff --git a/docs/examples/account/update-push-target.md b/docs/examples/account/update-push-target.md index f3aa1a9..f71232a 100644 --- a/docs/examples/account/update-push-target.md +++ b/docs/examples/account/update-push-target.md @@ -1,3 +1,3 @@ -appwrite account updatePushTarget \ - --targetId \ - --identifier +appwrite account update-push-target \ + --target-id \ + --identifier diff --git a/docs/examples/account/update-recovery.md b/docs/examples/account/update-recovery.md index 903a99c..c2a97bd 100644 --- a/docs/examples/account/update-recovery.md +++ b/docs/examples/account/update-recovery.md @@ -1,4 +1,4 @@ -appwrite account updateRecovery \ - --userId \ - --secret \ - --password '' +appwrite account update-recovery \ + --user-id \ + --secret \ + --password '' diff --git a/docs/examples/account/update-session.md b/docs/examples/account/update-session.md index 5fb6a2e..36833c4 100644 --- a/docs/examples/account/update-session.md +++ b/docs/examples/account/update-session.md @@ -1,2 +1,2 @@ -appwrite account updateSession \ - --sessionId +appwrite account update-session \ + --session-id diff --git a/docs/examples/account/update-status.md b/docs/examples/account/update-status.md index 8886dbb..d271749 100644 --- a/docs/examples/account/update-status.md +++ b/docs/examples/account/update-status.md @@ -1 +1 @@ -appwrite account updateStatus +appwrite account update-status diff --git a/docs/examples/account/update-verification.md b/docs/examples/account/update-verification.md index afdfaa8..d7276c6 100644 --- a/docs/examples/account/update-verification.md +++ b/docs/examples/account/update-verification.md @@ -1,3 +1,3 @@ -appwrite account updateVerification \ - --userId \ - --secret +appwrite account update-verification \ + --user-id \ + --secret diff --git a/docs/examples/avatars/get-browser.md b/docs/examples/avatars/get-browser.md index 6b4f0b8..b9dce0b 100644 --- a/docs/examples/avatars/get-browser.md +++ b/docs/examples/avatars/get-browser.md @@ -1,5 +1,2 @@ -appwrite avatars getBrowser \ - --code aa \ - - - +appwrite avatars get-browser \ + --code aa diff --git a/docs/examples/avatars/get-credit-card.md b/docs/examples/avatars/get-credit-card.md index 365568b..0a8317a 100644 --- a/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/avatars/get-credit-card.md @@ -1,5 +1,2 @@ -appwrite avatars getCreditCard \ - --code amex \ - - - +appwrite avatars get-credit-card \ + --code amex diff --git a/docs/examples/avatars/get-favicon.md b/docs/examples/avatars/get-favicon.md index c658f1a..c2f4c80 100644 --- a/docs/examples/avatars/get-favicon.md +++ b/docs/examples/avatars/get-favicon.md @@ -1,2 +1,2 @@ -appwrite avatars getFavicon \ - --url https://example.com +appwrite avatars get-favicon \ + --url https://example.com diff --git a/docs/examples/avatars/get-flag.md b/docs/examples/avatars/get-flag.md index 9f11fef..15a3daf 100644 --- a/docs/examples/avatars/get-flag.md +++ b/docs/examples/avatars/get-flag.md @@ -1,5 +1,2 @@ -appwrite avatars getFlag \ - --code af \ - - - +appwrite avatars get-flag \ + --code af diff --git a/docs/examples/avatars/get-image.md b/docs/examples/avatars/get-image.md index 7df1506..942574a 100644 --- a/docs/examples/avatars/get-image.md +++ b/docs/examples/avatars/get-image.md @@ -1,4 +1,2 @@ -appwrite avatars getImage \ - --url https://example.com \ - - +appwrite avatars get-image \ + --url https://example.com diff --git a/docs/examples/avatars/get-initials.md b/docs/examples/avatars/get-initials.md index b0b3da7..f9d5110 100644 --- a/docs/examples/avatars/get-initials.md +++ b/docs/examples/avatars/get-initials.md @@ -1,5 +1 @@ -appwrite avatars getInitials \ - - - - +appwrite avatars get-initials diff --git a/docs/examples/avatars/get-q-r.md b/docs/examples/avatars/get-q-r.md deleted file mode 100644 index 01e5085..0000000 --- a/docs/examples/avatars/get-q-r.md +++ /dev/null @@ -1,5 +0,0 @@ -appwrite avatars getQR \ - --text \ - - - diff --git a/docs/examples/avatars/get-qr.md b/docs/examples/avatars/get-qr.md new file mode 100644 index 0000000..75fb094 --- /dev/null +++ b/docs/examples/avatars/get-qr.md @@ -0,0 +1,2 @@ +appwrite avatars get-qr \ + --text diff --git a/docs/examples/console/get-resource.md b/docs/examples/console/get-resource.md index 3e55163..5251dd6 100644 --- a/docs/examples/console/get-resource.md +++ b/docs/examples/console/get-resource.md @@ -1,3 +1,3 @@ -appwrite console getResource \ - --value \ - --type rules +appwrite console get-resource \ + --value \ + --type rules diff --git a/docs/examples/databases/create-boolean-attribute.md b/docs/examples/databases/create-boolean-attribute.md index 6babbfb..ce4d65f 100644 --- a/docs/examples/databases/create-boolean-attribute.md +++ b/docs/examples/databases/create-boolean-attribute.md @@ -1,7 +1,5 @@ -appwrite databases createBooleanAttribute \ - --databaseId \ - --collectionId \ - --key '' \ - --required false \ - - +appwrite databases create-boolean-attribute \ + --database-id \ + --collection-id \ + --key '' \ + --required false diff --git a/docs/examples/databases/create-collection.md b/docs/examples/databases/create-collection.md index d97c424..89a754c 100644 --- a/docs/examples/databases/create-collection.md +++ b/docs/examples/databases/create-collection.md @@ -1,7 +1,4 @@ -appwrite databases createCollection \ - --databaseId \ - --collectionId \ - --name \ - - - +appwrite databases create-collection \ + --database-id \ + --collection-id \ + --name diff --git a/docs/examples/databases/create-datetime-attribute.md b/docs/examples/databases/create-datetime-attribute.md index f6aaf54..b445d08 100644 --- a/docs/examples/databases/create-datetime-attribute.md +++ b/docs/examples/databases/create-datetime-attribute.md @@ -1,7 +1,5 @@ -appwrite databases createDatetimeAttribute \ - --databaseId \ - --collectionId \ - --key '' \ - --required false \ - - +appwrite databases create-datetime-attribute \ + --database-id \ + --collection-id \ + --key '' \ + --required false diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index 513cfc4..a45335a 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -1,6 +1,5 @@ -appwrite databases createDocument \ - --databaseId \ - --collectionId \ - --documentId \ - --data '{ "key": "value" }' \ - +appwrite databases create-document \ + --database-id \ + --collection-id \ + --document-id \ + --data '{ "key": "value" }' diff --git a/docs/examples/databases/create-documents.md b/docs/examples/databases/create-documents.md index e9e65b5..3512b68 100644 --- a/docs/examples/databases/create-documents.md +++ b/docs/examples/databases/create-documents.md @@ -1,4 +1,4 @@ -appwrite databases createDocuments \ - --databaseId \ - --collectionId \ - --documents one two three +appwrite databases create-documents \ + --database-id \ + --collection-id \ + --documents one two three diff --git a/docs/examples/databases/create-email-attribute.md b/docs/examples/databases/create-email-attribute.md index 5c23f94..e4e9a0b 100644 --- a/docs/examples/databases/create-email-attribute.md +++ b/docs/examples/databases/create-email-attribute.md @@ -1,7 +1,5 @@ -appwrite databases createEmailAttribute \ - --databaseId \ - --collectionId \ - --key '' \ - --required false \ - - +appwrite databases create-email-attribute \ + --database-id \ + --collection-id \ + --key '' \ + --required false diff --git a/docs/examples/databases/create-enum-attribute.md b/docs/examples/databases/create-enum-attribute.md index 5d3c614..2d4c72b 100644 --- a/docs/examples/databases/create-enum-attribute.md +++ b/docs/examples/databases/create-enum-attribute.md @@ -1,8 +1,6 @@ -appwrite databases createEnumAttribute \ - --databaseId \ - --collectionId \ - --key '' \ - --elements one two three \ - --required false \ - - +appwrite databases create-enum-attribute \ + --database-id \ + --collection-id \ + --key '' \ + --elements one two three \ + --required false diff --git a/docs/examples/databases/create-float-attribute.md b/docs/examples/databases/create-float-attribute.md index 5a6ef4e..0b9988b 100644 --- a/docs/examples/databases/create-float-attribute.md +++ b/docs/examples/databases/create-float-attribute.md @@ -1,9 +1,5 @@ -appwrite databases createFloatAttribute \ - --databaseId \ - --collectionId \ - --key '' \ - --required false \ - - - - +appwrite databases create-float-attribute \ + --database-id \ + --collection-id \ + --key '' \ + --required false diff --git a/docs/examples/databases/create-index.md b/docs/examples/databases/create-index.md index 2dc95ea..cd8fc1d 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -1,8 +1,6 @@ -appwrite databases createIndex \ - --databaseId \ - --collectionId \ - --key '' \ - --type key \ - --attributes one two three \ - - +appwrite databases create-index \ + --database-id \ + --collection-id \ + --key '' \ + --type key \ + --attributes one two three diff --git a/docs/examples/databases/create-integer-attribute.md b/docs/examples/databases/create-integer-attribute.md index 791f377..4c2207e 100644 --- a/docs/examples/databases/create-integer-attribute.md +++ b/docs/examples/databases/create-integer-attribute.md @@ -1,9 +1,5 @@ -appwrite databases createIntegerAttribute \ - --databaseId \ - --collectionId \ - --key '' \ - --required false \ - - - - +appwrite databases create-integer-attribute \ + --database-id \ + --collection-id \ + --key '' \ + --required false diff --git a/docs/examples/databases/create-ip-attribute.md b/docs/examples/databases/create-ip-attribute.md index 4f39d84..a1cd44e 100644 --- a/docs/examples/databases/create-ip-attribute.md +++ b/docs/examples/databases/create-ip-attribute.md @@ -1,7 +1,5 @@ -appwrite databases createIpAttribute \ - --databaseId \ - --collectionId \ - --key '' \ - --required false \ - - +appwrite databases create-ip-attribute \ + --database-id \ + --collection-id \ + --key '' \ + --required false diff --git a/docs/examples/databases/create-relationship-attribute.md b/docs/examples/databases/create-relationship-attribute.md index c7d8ae5..7003162 100644 --- a/docs/examples/databases/create-relationship-attribute.md +++ b/docs/examples/databases/create-relationship-attribute.md @@ -1,9 +1,5 @@ -appwrite databases createRelationshipAttribute \ - --databaseId \ - --collectionId \ - --relatedCollectionId \ - --type oneToOne \ - - - - +appwrite databases create-relationship-attribute \ + --database-id \ + --collection-id \ + --related-collection-id \ + --type oneToOne diff --git a/docs/examples/databases/create-string-attribute.md b/docs/examples/databases/create-string-attribute.md index 37b1db6..ed464c5 100644 --- a/docs/examples/databases/create-string-attribute.md +++ b/docs/examples/databases/create-string-attribute.md @@ -1,9 +1,6 @@ -appwrite databases createStringAttribute \ - --databaseId \ - --collectionId \ - --key '' \ - --size 1 \ - --required false \ - - - +appwrite databases create-string-attribute \ + --database-id \ + --collection-id \ + --key '' \ + --size 1 \ + --required false diff --git a/docs/examples/databases/create-url-attribute.md b/docs/examples/databases/create-url-attribute.md index 4406ed7..6968e8c 100644 --- a/docs/examples/databases/create-url-attribute.md +++ b/docs/examples/databases/create-url-attribute.md @@ -1,7 +1,5 @@ -appwrite databases createUrlAttribute \ - --databaseId \ - --collectionId \ - --key '' \ - --required false \ - - +appwrite databases create-url-attribute \ + --database-id \ + --collection-id \ + --key '' \ + --required false diff --git a/docs/examples/databases/create.md b/docs/examples/databases/create.md index 9e75239..47b0438 100644 --- a/docs/examples/databases/create.md +++ b/docs/examples/databases/create.md @@ -1,4 +1,3 @@ appwrite databases create \ - --databaseId \ - --name \ - + --database-id \ + --name diff --git a/docs/examples/databases/decrement-document-attribute.md b/docs/examples/databases/decrement-document-attribute.md index e6607ea..0b9b8a6 100644 --- a/docs/examples/databases/decrement-document-attribute.md +++ b/docs/examples/databases/decrement-document-attribute.md @@ -1,7 +1,5 @@ -appwrite databases decrementDocumentAttribute \ - --databaseId \ - --collectionId \ - --documentId \ - --attribute '' \ - - +appwrite databases decrement-document-attribute \ + --database-id \ + --collection-id \ + --document-id \ + --attribute '' diff --git a/docs/examples/databases/delete-attribute.md b/docs/examples/databases/delete-attribute.md index 88e7df9..0d68358 100644 --- a/docs/examples/databases/delete-attribute.md +++ b/docs/examples/databases/delete-attribute.md @@ -1,4 +1,4 @@ -appwrite databases deleteAttribute \ - --databaseId \ - --collectionId \ - --key '' +appwrite databases delete-attribute \ + --database-id \ + --collection-id \ + --key '' diff --git a/docs/examples/databases/delete-collection.md b/docs/examples/databases/delete-collection.md index 0db185a..d120865 100644 --- a/docs/examples/databases/delete-collection.md +++ b/docs/examples/databases/delete-collection.md @@ -1,3 +1,3 @@ -appwrite databases deleteCollection \ - --databaseId \ - --collectionId +appwrite databases delete-collection \ + --database-id \ + --collection-id diff --git a/docs/examples/databases/delete-document.md b/docs/examples/databases/delete-document.md index 3a96d35..8e90019 100644 --- a/docs/examples/databases/delete-document.md +++ b/docs/examples/databases/delete-document.md @@ -1,4 +1,4 @@ -appwrite databases deleteDocument \ - --databaseId \ - --collectionId \ - --documentId +appwrite databases delete-document \ + --database-id \ + --collection-id \ + --document-id diff --git a/docs/examples/databases/delete-documents.md b/docs/examples/databases/delete-documents.md index 6f3463c..b334ed7 100644 --- a/docs/examples/databases/delete-documents.md +++ b/docs/examples/databases/delete-documents.md @@ -1,4 +1,3 @@ -appwrite databases deleteDocuments \ - --databaseId \ - --collectionId \ - +appwrite databases delete-documents \ + --database-id \ + --collection-id diff --git a/docs/examples/databases/delete-index.md b/docs/examples/databases/delete-index.md index 56485e7..2de11d3 100644 --- a/docs/examples/databases/delete-index.md +++ b/docs/examples/databases/delete-index.md @@ -1,4 +1,4 @@ -appwrite databases deleteIndex \ - --databaseId \ - --collectionId \ - --key '' +appwrite databases delete-index \ + --database-id \ + --collection-id \ + --key '' diff --git a/docs/examples/databases/delete.md b/docs/examples/databases/delete.md index a24a3a0..4743777 100644 --- a/docs/examples/databases/delete.md +++ b/docs/examples/databases/delete.md @@ -1,2 +1,2 @@ appwrite databases delete \ - --databaseId + --database-id diff --git a/docs/examples/databases/get-attribute.md b/docs/examples/databases/get-attribute.md index 8216980..70cee2c 100644 --- a/docs/examples/databases/get-attribute.md +++ b/docs/examples/databases/get-attribute.md @@ -1,4 +1,4 @@ -appwrite databases getAttribute \ - --databaseId \ - --collectionId \ - --key '' +appwrite databases get-attribute \ + --database-id \ + --collection-id \ + --key '' diff --git a/docs/examples/databases/get-collection-usage.md b/docs/examples/databases/get-collection-usage.md index b57e6c9..c9881e2 100644 --- a/docs/examples/databases/get-collection-usage.md +++ b/docs/examples/databases/get-collection-usage.md @@ -1,4 +1,3 @@ -appwrite databases getCollectionUsage \ - --databaseId \ - --collectionId \ - +appwrite databases get-collection-usage \ + --database-id \ + --collection-id diff --git a/docs/examples/databases/get-collection.md b/docs/examples/databases/get-collection.md index e763b5b..17cbdbe 100644 --- a/docs/examples/databases/get-collection.md +++ b/docs/examples/databases/get-collection.md @@ -1,3 +1,3 @@ -appwrite databases getCollection \ - --databaseId \ - --collectionId +appwrite databases get-collection \ + --database-id \ + --collection-id diff --git a/docs/examples/databases/get-database-usage.md b/docs/examples/databases/get-database-usage.md deleted file mode 100644 index 1001e9c..0000000 --- a/docs/examples/databases/get-database-usage.md +++ /dev/null @@ -1,3 +0,0 @@ -appwrite databases getDatabaseUsage \ - --databaseId \ - diff --git a/docs/examples/databases/get-document.md b/docs/examples/databases/get-document.md index 35d9615..beb44c1 100644 --- a/docs/examples/databases/get-document.md +++ b/docs/examples/databases/get-document.md @@ -1,5 +1,4 @@ -appwrite databases getDocument \ - --databaseId \ - --collectionId \ - --documentId \ - +appwrite databases get-document \ + --database-id \ + --collection-id \ + --document-id diff --git a/docs/examples/databases/get-index.md b/docs/examples/databases/get-index.md index 0071834..50b5961 100644 --- a/docs/examples/databases/get-index.md +++ b/docs/examples/databases/get-index.md @@ -1,4 +1,4 @@ -appwrite databases getIndex \ - --databaseId \ - --collectionId \ - --key '' +appwrite databases get-index \ + --database-id \ + --collection-id \ + --key '' diff --git a/docs/examples/databases/get-usage.md b/docs/examples/databases/get-usage.md index 53c85fc..e3c8748 100644 --- a/docs/examples/databases/get-usage.md +++ b/docs/examples/databases/get-usage.md @@ -1,2 +1,2 @@ -appwrite databases getUsage \ - +appwrite databases get-usage \ + --database-id diff --git a/docs/examples/databases/get.md b/docs/examples/databases/get.md index 35480b6..83cec7d 100644 --- a/docs/examples/databases/get.md +++ b/docs/examples/databases/get.md @@ -1,2 +1,2 @@ appwrite databases get \ - --databaseId + --database-id diff --git a/docs/examples/databases/increment-document-attribute.md b/docs/examples/databases/increment-document-attribute.md index 8a5150e..d51e44d 100644 --- a/docs/examples/databases/increment-document-attribute.md +++ b/docs/examples/databases/increment-document-attribute.md @@ -1,7 +1,5 @@ -appwrite databases incrementDocumentAttribute \ - --databaseId \ - --collectionId \ - --documentId \ - --attribute '' \ - - +appwrite databases increment-document-attribute \ + --database-id \ + --collection-id \ + --document-id \ + --attribute '' diff --git a/docs/examples/databases/list-attributes.md b/docs/examples/databases/list-attributes.md index a2382fe..c531111 100644 --- a/docs/examples/databases/list-attributes.md +++ b/docs/examples/databases/list-attributes.md @@ -1,4 +1,3 @@ -appwrite databases listAttributes \ - --databaseId \ - --collectionId \ - +appwrite databases list-attributes \ + --database-id \ + --collection-id diff --git a/docs/examples/databases/list-collection-logs.md b/docs/examples/databases/list-collection-logs.md index eadac47..27f3a9b 100644 --- a/docs/examples/databases/list-collection-logs.md +++ b/docs/examples/databases/list-collection-logs.md @@ -1,4 +1,3 @@ -appwrite databases listCollectionLogs \ - --databaseId \ - --collectionId \ - +appwrite databases list-collection-logs \ + --database-id \ + --collection-id diff --git a/docs/examples/databases/list-collections.md b/docs/examples/databases/list-collections.md index b05c330..55576eb 100644 --- a/docs/examples/databases/list-collections.md +++ b/docs/examples/databases/list-collections.md @@ -1,4 +1,2 @@ -appwrite databases listCollections \ - --databaseId \ - - +appwrite databases list-collections \ + --database-id diff --git a/docs/examples/databases/list-document-logs.md b/docs/examples/databases/list-document-logs.md index 63b5394..9f8fb22 100644 --- a/docs/examples/databases/list-document-logs.md +++ b/docs/examples/databases/list-document-logs.md @@ -1,5 +1,4 @@ -appwrite databases listDocumentLogs \ - --databaseId \ - --collectionId \ - --documentId \ - +appwrite databases list-document-logs \ + --database-id \ + --collection-id \ + --document-id diff --git a/docs/examples/databases/list-documents.md b/docs/examples/databases/list-documents.md index 98e3895..69e921c 100644 --- a/docs/examples/databases/list-documents.md +++ b/docs/examples/databases/list-documents.md @@ -1,4 +1,3 @@ -appwrite databases listDocuments \ - --databaseId \ - --collectionId \ - +appwrite databases list-documents \ + --database-id \ + --collection-id diff --git a/docs/examples/databases/list-indexes.md b/docs/examples/databases/list-indexes.md index 50acb4d..f12c1e9 100644 --- a/docs/examples/databases/list-indexes.md +++ b/docs/examples/databases/list-indexes.md @@ -1,4 +1,3 @@ -appwrite databases listIndexes \ - --databaseId \ - --collectionId \ - +appwrite databases list-indexes \ + --database-id \ + --collection-id diff --git a/docs/examples/databases/list-logs.md b/docs/examples/databases/list-logs.md index 38547c7..293df55 100644 --- a/docs/examples/databases/list-logs.md +++ b/docs/examples/databases/list-logs.md @@ -1,3 +1,2 @@ -appwrite databases listLogs \ - --databaseId \ - +appwrite databases list-logs \ + --database-id diff --git a/docs/examples/databases/list-usage.md b/docs/examples/databases/list-usage.md new file mode 100644 index 0000000..6bff75f --- /dev/null +++ b/docs/examples/databases/list-usage.md @@ -0,0 +1 @@ +appwrite databases list-usage diff --git a/docs/examples/databases/list.md b/docs/examples/databases/list.md index e723bc3..6681edc 100644 --- a/docs/examples/databases/list.md +++ b/docs/examples/databases/list.md @@ -1,3 +1 @@ -appwrite databases list \ - - +appwrite databases list diff --git a/docs/examples/databases/update-boolean-attribute.md b/docs/examples/databases/update-boolean-attribute.md index f5adb49..578a5dc 100644 --- a/docs/examples/databases/update-boolean-attribute.md +++ b/docs/examples/databases/update-boolean-attribute.md @@ -1,7 +1,6 @@ -appwrite databases updateBooleanAttribute \ - --databaseId \ - --collectionId \ - --key '' \ - --required false \ - --default false \ - +appwrite databases update-boolean-attribute \ + --database-id \ + --collection-id \ + --key '' \ + --required false \ + --default false diff --git a/docs/examples/databases/update-collection.md b/docs/examples/databases/update-collection.md index eab3617..0bad485 100644 --- a/docs/examples/databases/update-collection.md +++ b/docs/examples/databases/update-collection.md @@ -1,7 +1,4 @@ -appwrite databases updateCollection \ - --databaseId \ - --collectionId \ - --name \ - - - +appwrite databases update-collection \ + --database-id \ + --collection-id \ + --name diff --git a/docs/examples/databases/update-datetime-attribute.md b/docs/examples/databases/update-datetime-attribute.md index fe4a462..53459e0 100644 --- a/docs/examples/databases/update-datetime-attribute.md +++ b/docs/examples/databases/update-datetime-attribute.md @@ -1,7 +1,6 @@ -appwrite databases updateDatetimeAttribute \ - --databaseId \ - --collectionId \ - --key '' \ - --required false \ - --default '' \ - +appwrite databases update-datetime-attribute \ + --database-id \ + --collection-id \ + --key '' \ + --required false \ + --default '' diff --git a/docs/examples/databases/update-document.md b/docs/examples/databases/update-document.md index a4ac55b..29f1461 100644 --- a/docs/examples/databases/update-document.md +++ b/docs/examples/databases/update-document.md @@ -1,6 +1,4 @@ -appwrite databases updateDocument \ - --databaseId \ - --collectionId \ - --documentId \ - - +appwrite databases update-document \ + --database-id \ + --collection-id \ + --document-id diff --git a/docs/examples/databases/update-documents.md b/docs/examples/databases/update-documents.md index 935f664..f4f85eb 100644 --- a/docs/examples/databases/update-documents.md +++ b/docs/examples/databases/update-documents.md @@ -1,5 +1,3 @@ -appwrite databases updateDocuments \ - --databaseId \ - --collectionId \ - - +appwrite databases update-documents \ + --database-id \ + --collection-id diff --git a/docs/examples/databases/update-email-attribute.md b/docs/examples/databases/update-email-attribute.md index 58510a6..20ea219 100644 --- a/docs/examples/databases/update-email-attribute.md +++ b/docs/examples/databases/update-email-attribute.md @@ -1,7 +1,6 @@ -appwrite databases updateEmailAttribute \ - --databaseId \ - --collectionId \ - --key '' \ - --required false \ - --default email@example.com \ - +appwrite databases update-email-attribute \ + --database-id \ + --collection-id \ + --key '' \ + --required false \ + --default email@example.com diff --git a/docs/examples/databases/update-enum-attribute.md b/docs/examples/databases/update-enum-attribute.md index 21d56d3..dfae8d2 100644 --- a/docs/examples/databases/update-enum-attribute.md +++ b/docs/examples/databases/update-enum-attribute.md @@ -1,8 +1,7 @@ -appwrite databases updateEnumAttribute \ - --databaseId \ - --collectionId \ - --key '' \ - --elements one two three \ - --required false \ - --default \ - +appwrite databases update-enum-attribute \ + --database-id \ + --collection-id \ + --key '' \ + --elements one two three \ + --required false \ + --default diff --git a/docs/examples/databases/update-float-attribute.md b/docs/examples/databases/update-float-attribute.md index a9bba3e..caeaa96 100644 --- a/docs/examples/databases/update-float-attribute.md +++ b/docs/examples/databases/update-float-attribute.md @@ -1,9 +1,6 @@ -appwrite databases updateFloatAttribute \ - --databaseId \ - --collectionId \ - --key '' \ - --required false \ - --default null \ - - - +appwrite databases update-float-attribute \ + --database-id \ + --collection-id \ + --key '' \ + --required false \ + --default null diff --git a/docs/examples/databases/update-integer-attribute.md b/docs/examples/databases/update-integer-attribute.md index 660cd4d..2ab6e12 100644 --- a/docs/examples/databases/update-integer-attribute.md +++ b/docs/examples/databases/update-integer-attribute.md @@ -1,9 +1,6 @@ -appwrite databases updateIntegerAttribute \ - --databaseId \ - --collectionId \ - --key '' \ - --required false \ - --default null \ - - - +appwrite databases update-integer-attribute \ + --database-id \ + --collection-id \ + --key '' \ + --required false \ + --default null diff --git a/docs/examples/databases/update-ip-attribute.md b/docs/examples/databases/update-ip-attribute.md index a400ead..44b4010 100644 --- a/docs/examples/databases/update-ip-attribute.md +++ b/docs/examples/databases/update-ip-attribute.md @@ -1,7 +1,6 @@ -appwrite databases updateIpAttribute \ - --databaseId \ - --collectionId \ - --key '' \ - --required false \ - --default '' \ - +appwrite databases update-ip-attribute \ + --database-id \ + --collection-id \ + --key '' \ + --required false \ + --default '' diff --git a/docs/examples/databases/update-relationship-attribute.md b/docs/examples/databases/update-relationship-attribute.md index 6e2dbd9..d3f27d7 100644 --- a/docs/examples/databases/update-relationship-attribute.md +++ b/docs/examples/databases/update-relationship-attribute.md @@ -1,6 +1,4 @@ -appwrite databases updateRelationshipAttribute \ - --databaseId \ - --collectionId \ - --key '' \ - - +appwrite databases update-relationship-attribute \ + --database-id \ + --collection-id \ + --key '' diff --git a/docs/examples/databases/update-string-attribute.md b/docs/examples/databases/update-string-attribute.md index 526ece0..0e0dd71 100644 --- a/docs/examples/databases/update-string-attribute.md +++ b/docs/examples/databases/update-string-attribute.md @@ -1,8 +1,6 @@ -appwrite databases updateStringAttribute \ - --databaseId \ - --collectionId \ - --key '' \ - --required false \ - --default \ - - +appwrite databases update-string-attribute \ + --database-id \ + --collection-id \ + --key '' \ + --required false \ + --default diff --git a/docs/examples/databases/update-url-attribute.md b/docs/examples/databases/update-url-attribute.md index e6f401b..76e6feb 100644 --- a/docs/examples/databases/update-url-attribute.md +++ b/docs/examples/databases/update-url-attribute.md @@ -1,7 +1,6 @@ -appwrite databases updateUrlAttribute \ - --databaseId \ - --collectionId \ - --key '' \ - --required false \ - --default https://example.com \ - +appwrite databases update-url-attribute \ + --database-id \ + --collection-id \ + --key '' \ + --required false \ + --default https://example.com diff --git a/docs/examples/databases/update.md b/docs/examples/databases/update.md index a1e0a84..e3e1de7 100644 --- a/docs/examples/databases/update.md +++ b/docs/examples/databases/update.md @@ -1,4 +1,3 @@ appwrite databases update \ - --databaseId \ - --name \ - + --database-id \ + --name diff --git a/docs/examples/databases/upsert-document.md b/docs/examples/databases/upsert-document.md index 4093201..558ffeb 100644 --- a/docs/examples/databases/upsert-document.md +++ b/docs/examples/databases/upsert-document.md @@ -1,6 +1,5 @@ -appwrite databases upsertDocument \ - --databaseId \ - --collectionId \ - --documentId \ - --data '{ "key": "value" }' \ - +appwrite databases upsert-document \ + --database-id \ + --collection-id \ + --document-id \ + --data '{ "key": "value" }' diff --git a/docs/examples/databases/upsert-documents.md b/docs/examples/databases/upsert-documents.md index cb1677b..e58c202 100644 --- a/docs/examples/databases/upsert-documents.md +++ b/docs/examples/databases/upsert-documents.md @@ -1,4 +1,4 @@ -appwrite databases upsertDocuments \ - --databaseId \ - --collectionId \ - --documents one two three +appwrite databases upsert-documents \ + --database-id \ + --collection-id \ + --documents one two three diff --git a/docs/examples/functions/create-deployment.md b/docs/examples/functions/create-deployment.md index 6ac80bd..465951c 100644 --- a/docs/examples/functions/create-deployment.md +++ b/docs/examples/functions/create-deployment.md @@ -1,6 +1,4 @@ -appwrite functions createDeployment \ - --functionId \ - --code 'path/to/file.png' \ - --activate false \ - - +appwrite functions create-deployment \ + --function-id \ + --code 'path/to/file.png' \ + --activate false diff --git a/docs/examples/functions/create-duplicate-deployment.md b/docs/examples/functions/create-duplicate-deployment.md index 4839155..7d5c28b 100644 --- a/docs/examples/functions/create-duplicate-deployment.md +++ b/docs/examples/functions/create-duplicate-deployment.md @@ -1,4 +1,3 @@ -appwrite functions createDuplicateDeployment \ - --functionId \ - --deploymentId \ - +appwrite functions create-duplicate-deployment \ + --function-id \ + --deployment-id diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index febe88c..fd3b3dd 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -1,8 +1,2 @@ -appwrite functions createExecution \ - --functionId \ - - - - - - +appwrite functions create-execution \ + --function-id diff --git a/docs/examples/functions/create-template-deployment.md b/docs/examples/functions/create-template-deployment.md index a6164a3..f3c8487 100644 --- a/docs/examples/functions/create-template-deployment.md +++ b/docs/examples/functions/create-template-deployment.md @@ -1,7 +1,6 @@ -appwrite functions createTemplateDeployment \ - --functionId \ - --repository \ - --owner \ - --rootDirectory \ - --version \ - +appwrite functions create-template-deployment \ + --function-id \ + --repository \ + --owner \ + --root-directory \ + --version diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index f35f228..50edcaa 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -1,5 +1,4 @@ -appwrite functions createVariable \ - --functionId \ - --key \ - --value \ - +appwrite functions create-variable \ + --function-id \ + --key \ + --value diff --git a/docs/examples/functions/create-vcs-deployment.md b/docs/examples/functions/create-vcs-deployment.md index 89f4cac..8e84622 100644 --- a/docs/examples/functions/create-vcs-deployment.md +++ b/docs/examples/functions/create-vcs-deployment.md @@ -1,5 +1,4 @@ -appwrite functions createVcsDeployment \ - --functionId \ - --type branch \ - --reference \ - +appwrite functions create-vcs-deployment \ + --function-id \ + --type branch \ + --reference diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index ebca574..bdca30d 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -1,19 +1,4 @@ appwrite functions create \ - --functionId \ - --name \ - --runtime node-14.5 \ - - - - - - - - - - - - - - - + --function-id \ + --name \ + --runtime node-14.5 diff --git a/docs/examples/functions/delete-deployment.md b/docs/examples/functions/delete-deployment.md index 2c9a6aa..4f50b92 100644 --- a/docs/examples/functions/delete-deployment.md +++ b/docs/examples/functions/delete-deployment.md @@ -1,3 +1,3 @@ -appwrite functions deleteDeployment \ - --functionId \ - --deploymentId +appwrite functions delete-deployment \ + --function-id \ + --deployment-id diff --git a/docs/examples/functions/delete-execution.md b/docs/examples/functions/delete-execution.md index 2926b5a..a11c4cb 100644 --- a/docs/examples/functions/delete-execution.md +++ b/docs/examples/functions/delete-execution.md @@ -1,3 +1,3 @@ -appwrite functions deleteExecution \ - --functionId \ - --executionId +appwrite functions delete-execution \ + --function-id \ + --execution-id diff --git a/docs/examples/functions/delete-variable.md b/docs/examples/functions/delete-variable.md index 835d125..aebe857 100644 --- a/docs/examples/functions/delete-variable.md +++ b/docs/examples/functions/delete-variable.md @@ -1,3 +1,3 @@ -appwrite functions deleteVariable \ - --functionId \ - --variableId +appwrite functions delete-variable \ + --function-id \ + --variable-id diff --git a/docs/examples/functions/delete.md b/docs/examples/functions/delete.md index 0eea41c..abf2733 100644 --- a/docs/examples/functions/delete.md +++ b/docs/examples/functions/delete.md @@ -1,2 +1,2 @@ appwrite functions delete \ - --functionId + --function-id diff --git a/docs/examples/functions/get-deployment-download.md b/docs/examples/functions/get-deployment-download.md index 485b608..b9bfcab 100644 --- a/docs/examples/functions/get-deployment-download.md +++ b/docs/examples/functions/get-deployment-download.md @@ -1,4 +1,3 @@ -appwrite functions getDeploymentDownload \ - --functionId \ - --deploymentId \ - +appwrite functions get-deployment-download \ + --function-id \ + --deployment-id diff --git a/docs/examples/functions/get-deployment.md b/docs/examples/functions/get-deployment.md index 3da1605..4a65807 100644 --- a/docs/examples/functions/get-deployment.md +++ b/docs/examples/functions/get-deployment.md @@ -1,3 +1,3 @@ -appwrite functions getDeployment \ - --functionId \ - --deploymentId +appwrite functions get-deployment \ + --function-id \ + --deployment-id diff --git a/docs/examples/functions/get-execution.md b/docs/examples/functions/get-execution.md index d593f07..ac2ad14 100644 --- a/docs/examples/functions/get-execution.md +++ b/docs/examples/functions/get-execution.md @@ -1,3 +1,3 @@ -appwrite functions getExecution \ - --functionId \ - --executionId +appwrite functions get-execution \ + --function-id \ + --execution-id diff --git a/docs/examples/functions/get-template.md b/docs/examples/functions/get-template.md index 15c6068..2ab2afb 100644 --- a/docs/examples/functions/get-template.md +++ b/docs/examples/functions/get-template.md @@ -1,2 +1,2 @@ -appwrite functions getTemplate \ - --templateId +appwrite functions get-template \ + --template-id diff --git a/docs/examples/functions/get-usage.md b/docs/examples/functions/get-usage.md index 469db0f..a3f061d 100644 --- a/docs/examples/functions/get-usage.md +++ b/docs/examples/functions/get-usage.md @@ -1,3 +1,2 @@ -appwrite functions getUsage \ - --functionId \ - +appwrite functions get-usage \ + --function-id diff --git a/docs/examples/functions/get-variable.md b/docs/examples/functions/get-variable.md index 241a91d..06a3a49 100644 --- a/docs/examples/functions/get-variable.md +++ b/docs/examples/functions/get-variable.md @@ -1,3 +1,3 @@ -appwrite functions getVariable \ - --functionId \ - --variableId +appwrite functions get-variable \ + --function-id \ + --variable-id diff --git a/docs/examples/functions/get.md b/docs/examples/functions/get.md index f678ef7..fafa87e 100644 --- a/docs/examples/functions/get.md +++ b/docs/examples/functions/get.md @@ -1,2 +1,2 @@ appwrite functions get \ - --functionId + --function-id diff --git a/docs/examples/functions/list-deployments.md b/docs/examples/functions/list-deployments.md index 2befb86..5bb2c60 100644 --- a/docs/examples/functions/list-deployments.md +++ b/docs/examples/functions/list-deployments.md @@ -1,4 +1,2 @@ -appwrite functions listDeployments \ - --functionId \ - - +appwrite functions list-deployments \ + --function-id diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md index 8d3136e..a008947 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -1,3 +1,2 @@ -appwrite functions listExecutions \ - --functionId \ - +appwrite functions list-executions \ + --function-id diff --git a/docs/examples/functions/list-runtimes.md b/docs/examples/functions/list-runtimes.md index 15dc019..a0430d6 100644 --- a/docs/examples/functions/list-runtimes.md +++ b/docs/examples/functions/list-runtimes.md @@ -1 +1 @@ -appwrite functions listRuntimes +appwrite functions list-runtimes diff --git a/docs/examples/functions/list-specifications.md b/docs/examples/functions/list-specifications.md index 1d64bc6..4fac74e 100644 --- a/docs/examples/functions/list-specifications.md +++ b/docs/examples/functions/list-specifications.md @@ -1 +1 @@ -appwrite functions listSpecifications +appwrite functions list-specifications diff --git a/docs/examples/functions/list-templates.md b/docs/examples/functions/list-templates.md index b48bab5..22209fe 100644 --- a/docs/examples/functions/list-templates.md +++ b/docs/examples/functions/list-templates.md @@ -1,5 +1 @@ -appwrite functions listTemplates \ - - - - +appwrite functions list-templates diff --git a/docs/examples/functions/list-usage.md b/docs/examples/functions/list-usage.md index 8ae7855..de28c5c 100644 --- a/docs/examples/functions/list-usage.md +++ b/docs/examples/functions/list-usage.md @@ -1,2 +1 @@ -appwrite functions listUsage \ - +appwrite functions list-usage diff --git a/docs/examples/functions/list-variables.md b/docs/examples/functions/list-variables.md index 21bf2eb..03e1162 100644 --- a/docs/examples/functions/list-variables.md +++ b/docs/examples/functions/list-variables.md @@ -1,2 +1,2 @@ -appwrite functions listVariables \ - --functionId +appwrite functions list-variables \ + --function-id diff --git a/docs/examples/functions/list.md b/docs/examples/functions/list.md index 3b75512..2d9f0ba 100644 --- a/docs/examples/functions/list.md +++ b/docs/examples/functions/list.md @@ -1,3 +1 @@ -appwrite functions list \ - - +appwrite functions list diff --git a/docs/examples/functions/update-deployment-status.md b/docs/examples/functions/update-deployment-status.md index 06d2dcd..6f0bc1e 100644 --- a/docs/examples/functions/update-deployment-status.md +++ b/docs/examples/functions/update-deployment-status.md @@ -1,3 +1,3 @@ -appwrite functions updateDeploymentStatus \ - --functionId \ - --deploymentId +appwrite functions update-deployment-status \ + --function-id \ + --deployment-id diff --git a/docs/examples/functions/update-function-deployment.md b/docs/examples/functions/update-function-deployment.md index 652bfe8..d3534b4 100644 --- a/docs/examples/functions/update-function-deployment.md +++ b/docs/examples/functions/update-function-deployment.md @@ -1,3 +1,3 @@ -appwrite functions updateFunctionDeployment \ - --functionId \ - --deploymentId +appwrite functions update-function-deployment \ + --function-id \ + --deployment-id diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index a2b1049..c1d87f2 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -1,6 +1,4 @@ -appwrite functions updateVariable \ - --functionId \ - --variableId \ - --key \ - - +appwrite functions update-variable \ + --function-id \ + --variable-id \ + --key diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index 7ac63e0..c436ef0 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -1,19 +1,3 @@ appwrite functions update \ - --functionId \ - --name \ - - - - - - - - - - - - - - - - + --function-id \ + --name diff --git a/docs/examples/graphql/mutation.md b/docs/examples/graphql/mutation.md index f6127a1..678fcc2 100644 --- a/docs/examples/graphql/mutation.md +++ b/docs/examples/graphql/mutation.md @@ -1,2 +1,2 @@ appwrite graphql mutation \ - --query '{ "key": "value" }' + --query '{ "key": "value" }' diff --git a/docs/examples/graphql/query.md b/docs/examples/graphql/query.md index 1d84bca..157115a 100644 --- a/docs/examples/graphql/query.md +++ b/docs/examples/graphql/query.md @@ -1,2 +1,2 @@ appwrite graphql query \ - --query '{ "key": "value" }' + --query '{ "key": "value" }' diff --git a/docs/examples/health/get-antivirus.md b/docs/examples/health/get-antivirus.md index 96dd7e7..2ef8b6f 100644 --- a/docs/examples/health/get-antivirus.md +++ b/docs/examples/health/get-antivirus.md @@ -1 +1 @@ -appwrite health getAntivirus +appwrite health get-antivirus diff --git a/docs/examples/health/get-cache.md b/docs/examples/health/get-cache.md index ad1111c..b1ff131 100644 --- a/docs/examples/health/get-cache.md +++ b/docs/examples/health/get-cache.md @@ -1 +1 @@ -appwrite health getCache +appwrite health get-cache diff --git a/docs/examples/health/get-certificate.md b/docs/examples/health/get-certificate.md index 4659415..1765216 100644 --- a/docs/examples/health/get-certificate.md +++ b/docs/examples/health/get-certificate.md @@ -1,2 +1 @@ -appwrite health getCertificate \ - +appwrite health get-certificate diff --git a/docs/examples/health/get-d-b.md b/docs/examples/health/get-d-b.md deleted file mode 100644 index b0ea2d3..0000000 --- a/docs/examples/health/get-d-b.md +++ /dev/null @@ -1 +0,0 @@ -appwrite health getDB diff --git a/docs/examples/health/get-db.md b/docs/examples/health/get-db.md new file mode 100644 index 0000000..c5e9cb3 --- /dev/null +++ b/docs/examples/health/get-db.md @@ -0,0 +1 @@ +appwrite health get-db diff --git a/docs/examples/health/get-failed-jobs.md b/docs/examples/health/get-failed-jobs.md index 724299e..9704875 100644 --- a/docs/examples/health/get-failed-jobs.md +++ b/docs/examples/health/get-failed-jobs.md @@ -1,3 +1,2 @@ -appwrite health getFailedJobs \ - --name v1-database \ - +appwrite health get-failed-jobs \ + --name v1-database diff --git a/docs/examples/health/get-pub-sub.md b/docs/examples/health/get-pub-sub.md index aa1773b..29e93a2 100644 --- a/docs/examples/health/get-pub-sub.md +++ b/docs/examples/health/get-pub-sub.md @@ -1 +1 @@ -appwrite health getPubSub +appwrite health get-pub-sub diff --git a/docs/examples/health/get-queue-builds.md b/docs/examples/health/get-queue-builds.md index 7204c2c..657b988 100644 --- a/docs/examples/health/get-queue-builds.md +++ b/docs/examples/health/get-queue-builds.md @@ -1,2 +1 @@ -appwrite health getQueueBuilds \ - +appwrite health get-queue-builds diff --git a/docs/examples/health/get-queue-certificates.md b/docs/examples/health/get-queue-certificates.md index 203e865..a7c1c64 100644 --- a/docs/examples/health/get-queue-certificates.md +++ b/docs/examples/health/get-queue-certificates.md @@ -1,2 +1 @@ -appwrite health getQueueCertificates \ - +appwrite health get-queue-certificates diff --git a/docs/examples/health/get-queue-databases.md b/docs/examples/health/get-queue-databases.md index f30b941..17d15ba 100644 --- a/docs/examples/health/get-queue-databases.md +++ b/docs/examples/health/get-queue-databases.md @@ -1,3 +1 @@ -appwrite health getQueueDatabases \ - - +appwrite health get-queue-databases diff --git a/docs/examples/health/get-queue-deletes.md b/docs/examples/health/get-queue-deletes.md index 1d44146..78ddc32 100644 --- a/docs/examples/health/get-queue-deletes.md +++ b/docs/examples/health/get-queue-deletes.md @@ -1,2 +1 @@ -appwrite health getQueueDeletes \ - +appwrite health get-queue-deletes diff --git a/docs/examples/health/get-queue-functions.md b/docs/examples/health/get-queue-functions.md index 4aca467..8109a8e 100644 --- a/docs/examples/health/get-queue-functions.md +++ b/docs/examples/health/get-queue-functions.md @@ -1,2 +1 @@ -appwrite health getQueueFunctions \ - +appwrite health get-queue-functions diff --git a/docs/examples/health/get-queue-logs.md b/docs/examples/health/get-queue-logs.md index 3f1386b..5ff48cc 100644 --- a/docs/examples/health/get-queue-logs.md +++ b/docs/examples/health/get-queue-logs.md @@ -1,2 +1 @@ -appwrite health getQueueLogs \ - +appwrite health get-queue-logs diff --git a/docs/examples/health/get-queue-mails.md b/docs/examples/health/get-queue-mails.md index a41f4c3..e44b1b6 100644 --- a/docs/examples/health/get-queue-mails.md +++ b/docs/examples/health/get-queue-mails.md @@ -1,2 +1 @@ -appwrite health getQueueMails \ - +appwrite health get-queue-mails diff --git a/docs/examples/health/get-queue-messaging.md b/docs/examples/health/get-queue-messaging.md index 11b7ff8..5249c73 100644 --- a/docs/examples/health/get-queue-messaging.md +++ b/docs/examples/health/get-queue-messaging.md @@ -1,2 +1 @@ -appwrite health getQueueMessaging \ - +appwrite health get-queue-messaging diff --git a/docs/examples/health/get-queue-migrations.md b/docs/examples/health/get-queue-migrations.md index 2f17bb5..11b07a1 100644 --- a/docs/examples/health/get-queue-migrations.md +++ b/docs/examples/health/get-queue-migrations.md @@ -1,2 +1 @@ -appwrite health getQueueMigrations \ - +appwrite health get-queue-migrations diff --git a/docs/examples/health/get-queue-stats-resources.md b/docs/examples/health/get-queue-stats-resources.md index 9cce963..2e51186 100644 --- a/docs/examples/health/get-queue-stats-resources.md +++ b/docs/examples/health/get-queue-stats-resources.md @@ -1,2 +1 @@ -appwrite health getQueueStatsResources \ - +appwrite health get-queue-stats-resources diff --git a/docs/examples/health/get-queue-usage.md b/docs/examples/health/get-queue-usage.md index d021a3f..1790e0f 100644 --- a/docs/examples/health/get-queue-usage.md +++ b/docs/examples/health/get-queue-usage.md @@ -1,2 +1 @@ -appwrite health getQueueUsage \ - +appwrite health get-queue-usage diff --git a/docs/examples/health/get-queue-webhooks.md b/docs/examples/health/get-queue-webhooks.md index 471175b..e175334 100644 --- a/docs/examples/health/get-queue-webhooks.md +++ b/docs/examples/health/get-queue-webhooks.md @@ -1,2 +1 @@ -appwrite health getQueueWebhooks \ - +appwrite health get-queue-webhooks diff --git a/docs/examples/health/get-storage-local.md b/docs/examples/health/get-storage-local.md index b5df39f..512d135 100644 --- a/docs/examples/health/get-storage-local.md +++ b/docs/examples/health/get-storage-local.md @@ -1 +1 @@ -appwrite health getStorageLocal +appwrite health get-storage-local diff --git a/docs/examples/health/get-storage.md b/docs/examples/health/get-storage.md index eccd21a..170bcfc 100644 --- a/docs/examples/health/get-storage.md +++ b/docs/examples/health/get-storage.md @@ -1 +1 @@ -appwrite health getStorage +appwrite health get-storage diff --git a/docs/examples/health/get-time.md b/docs/examples/health/get-time.md index 067e5da..feb3901 100644 --- a/docs/examples/health/get-time.md +++ b/docs/examples/health/get-time.md @@ -1 +1 @@ -appwrite health getTime +appwrite health get-time diff --git a/docs/examples/locale/list-codes.md b/docs/examples/locale/list-codes.md index 5586d15..ac96ac1 100644 --- a/docs/examples/locale/list-codes.md +++ b/docs/examples/locale/list-codes.md @@ -1 +1 @@ -appwrite locale listCodes +appwrite locale list-codes diff --git a/docs/examples/locale/list-continents.md b/docs/examples/locale/list-continents.md index 775af5d..1826787 100644 --- a/docs/examples/locale/list-continents.md +++ b/docs/examples/locale/list-continents.md @@ -1 +1 @@ -appwrite locale listContinents +appwrite locale list-continents diff --git a/docs/examples/locale/list-countries-e-u.md b/docs/examples/locale/list-countries-e-u.md deleted file mode 100644 index 43b7eff..0000000 --- a/docs/examples/locale/list-countries-e-u.md +++ /dev/null @@ -1 +0,0 @@ -appwrite locale listCountriesEU diff --git a/docs/examples/locale/list-countries-eu.md b/docs/examples/locale/list-countries-eu.md new file mode 100644 index 0000000..eba8886 --- /dev/null +++ b/docs/examples/locale/list-countries-eu.md @@ -0,0 +1 @@ +appwrite locale list-countries-eu diff --git a/docs/examples/locale/list-countries-phones.md b/docs/examples/locale/list-countries-phones.md index 072516b..ea27155 100644 --- a/docs/examples/locale/list-countries-phones.md +++ b/docs/examples/locale/list-countries-phones.md @@ -1 +1 @@ -appwrite locale listCountriesPhones +appwrite locale list-countries-phones diff --git a/docs/examples/locale/list-countries.md b/docs/examples/locale/list-countries.md index ee7101d..6524461 100644 --- a/docs/examples/locale/list-countries.md +++ b/docs/examples/locale/list-countries.md @@ -1 +1 @@ -appwrite locale listCountries +appwrite locale list-countries diff --git a/docs/examples/locale/list-currencies.md b/docs/examples/locale/list-currencies.md index 01b1b3c..bbc0f36 100644 --- a/docs/examples/locale/list-currencies.md +++ b/docs/examples/locale/list-currencies.md @@ -1 +1 @@ -appwrite locale listCurrencies +appwrite locale list-currencies diff --git a/docs/examples/locale/list-languages.md b/docs/examples/locale/list-languages.md index d47622c..a0cfe91 100644 --- a/docs/examples/locale/list-languages.md +++ b/docs/examples/locale/list-languages.md @@ -1 +1 @@ -appwrite locale listLanguages +appwrite locale list-languages diff --git a/docs/examples/messaging/create-apns-provider.md b/docs/examples/messaging/create-apns-provider.md index 8b369f4..fd5aaa9 100644 --- a/docs/examples/messaging/create-apns-provider.md +++ b/docs/examples/messaging/create-apns-provider.md @@ -1,9 +1,3 @@ -appwrite messaging createApnsProvider \ - --providerId \ - --name \ - - - - - - +appwrite messaging create-apns-provider \ + --provider-id \ + --name diff --git a/docs/examples/messaging/create-email.md b/docs/examples/messaging/create-email.md index 2a8e03b..e8ffc11 100644 --- a/docs/examples/messaging/create-email.md +++ b/docs/examples/messaging/create-email.md @@ -1,13 +1,4 @@ -appwrite messaging createEmail \ - --messageId \ - --subject \ - --content \ - - - - - - - - - +appwrite messaging create-email \ + --message-id \ + --subject \ + --content diff --git a/docs/examples/messaging/create-fcm-provider.md b/docs/examples/messaging/create-fcm-provider.md index a19dcbe..487bb03 100644 --- a/docs/examples/messaging/create-fcm-provider.md +++ b/docs/examples/messaging/create-fcm-provider.md @@ -1,5 +1,3 @@ -appwrite messaging createFcmProvider \ - --providerId \ - --name \ - - +appwrite messaging create-fcm-provider \ + --provider-id \ + --name diff --git a/docs/examples/messaging/create-mailgun-provider.md b/docs/examples/messaging/create-mailgun-provider.md index 6b07359..2616f00 100644 --- a/docs/examples/messaging/create-mailgun-provider.md +++ b/docs/examples/messaging/create-mailgun-provider.md @@ -1,11 +1,3 @@ -appwrite messaging createMailgunProvider \ - --providerId \ - --name \ - - - - - - - - +appwrite messaging create-mailgun-provider \ + --provider-id \ + --name diff --git a/docs/examples/messaging/create-msg-91-provider.md b/docs/examples/messaging/create-msg-91-provider.md new file mode 100644 index 0000000..d4f975d --- /dev/null +++ b/docs/examples/messaging/create-msg-91-provider.md @@ -0,0 +1,3 @@ +appwrite messaging create-msg-91-provider \ + --provider-id \ + --name diff --git a/docs/examples/messaging/create-msg91provider.md b/docs/examples/messaging/create-msg91provider.md deleted file mode 100644 index f687e36..0000000 --- a/docs/examples/messaging/create-msg91provider.md +++ /dev/null @@ -1,7 +0,0 @@ -appwrite messaging createMsg91Provider \ - --providerId \ - --name \ - - - - diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md index 18d8ec5..d5740b9 100644 --- a/docs/examples/messaging/create-push.md +++ b/docs/examples/messaging/create-push.md @@ -1,20 +1,2 @@ -appwrite messaging createPush \ - --messageId \ - - - - - - - - - - - - - - - - - - +appwrite messaging create-push \ + --message-id diff --git a/docs/examples/messaging/create-sendgrid-provider.md b/docs/examples/messaging/create-sendgrid-provider.md index de8d059..2a478fd 100644 --- a/docs/examples/messaging/create-sendgrid-provider.md +++ b/docs/examples/messaging/create-sendgrid-provider.md @@ -1,9 +1,3 @@ -appwrite messaging createSendgridProvider \ - --providerId \ - --name \ - - - - - - +appwrite messaging create-sendgrid-provider \ + --provider-id \ + --name diff --git a/docs/examples/messaging/create-sms.md b/docs/examples/messaging/create-sms.md index dfc9b27..3633d06 100644 --- a/docs/examples/messaging/create-sms.md +++ b/docs/examples/messaging/create-sms.md @@ -1,8 +1,3 @@ -appwrite messaging createSms \ - --messageId \ - --content \ - - - - - +appwrite messaging create-sms \ + --message-id \ + --content diff --git a/docs/examples/messaging/create-smtp-provider.md b/docs/examples/messaging/create-smtp-provider.md index 13f04fe..9a41783 100644 --- a/docs/examples/messaging/create-smtp-provider.md +++ b/docs/examples/messaging/create-smtp-provider.md @@ -1,15 +1,4 @@ -appwrite messaging createSmtpProvider \ - --providerId \ - --name \ - --host \ - - - - - - - - - - - +appwrite messaging create-smtp-provider \ + --provider-id \ + --name \ + --host diff --git a/docs/examples/messaging/create-subscriber.md b/docs/examples/messaging/create-subscriber.md index 5e65c36..5fe7682 100644 --- a/docs/examples/messaging/create-subscriber.md +++ b/docs/examples/messaging/create-subscriber.md @@ -1,4 +1,4 @@ -appwrite messaging createSubscriber \ - --topicId \ - --subscriberId \ - --targetId +appwrite messaging create-subscriber \ + --topic-id \ + --subscriber-id \ + --target-id diff --git a/docs/examples/messaging/create-telesign-provider.md b/docs/examples/messaging/create-telesign-provider.md index 783f759..052028d 100644 --- a/docs/examples/messaging/create-telesign-provider.md +++ b/docs/examples/messaging/create-telesign-provider.md @@ -1,7 +1,3 @@ -appwrite messaging createTelesignProvider \ - --providerId \ - --name \ - - - - +appwrite messaging create-telesign-provider \ + --provider-id \ + --name diff --git a/docs/examples/messaging/create-textmagic-provider.md b/docs/examples/messaging/create-textmagic-provider.md index 77185c7..6ff37b0 100644 --- a/docs/examples/messaging/create-textmagic-provider.md +++ b/docs/examples/messaging/create-textmagic-provider.md @@ -1,7 +1,3 @@ -appwrite messaging createTextmagicProvider \ - --providerId \ - --name \ - - - - +appwrite messaging create-textmagic-provider \ + --provider-id \ + --name diff --git a/docs/examples/messaging/create-topic.md b/docs/examples/messaging/create-topic.md index 1d57e1c..3a28bb1 100644 --- a/docs/examples/messaging/create-topic.md +++ b/docs/examples/messaging/create-topic.md @@ -1,4 +1,3 @@ -appwrite messaging createTopic \ - --topicId \ - --name \ - +appwrite messaging create-topic \ + --topic-id \ + --name diff --git a/docs/examples/messaging/create-twilio-provider.md b/docs/examples/messaging/create-twilio-provider.md index 91fdaae..2b2f00d 100644 --- a/docs/examples/messaging/create-twilio-provider.md +++ b/docs/examples/messaging/create-twilio-provider.md @@ -1,7 +1,3 @@ -appwrite messaging createTwilioProvider \ - --providerId \ - --name \ - - - - +appwrite messaging create-twilio-provider \ + --provider-id \ + --name diff --git a/docs/examples/messaging/create-vonage-provider.md b/docs/examples/messaging/create-vonage-provider.md index 1939d1c..56fb3e6 100644 --- a/docs/examples/messaging/create-vonage-provider.md +++ b/docs/examples/messaging/create-vonage-provider.md @@ -1,7 +1,3 @@ -appwrite messaging createVonageProvider \ - --providerId \ - --name \ - - - - +appwrite messaging create-vonage-provider \ + --provider-id \ + --name diff --git a/docs/examples/messaging/delete-provider.md b/docs/examples/messaging/delete-provider.md index a938855..75671a9 100644 --- a/docs/examples/messaging/delete-provider.md +++ b/docs/examples/messaging/delete-provider.md @@ -1,2 +1,2 @@ -appwrite messaging deleteProvider \ - --providerId +appwrite messaging delete-provider \ + --provider-id diff --git a/docs/examples/messaging/delete-subscriber.md b/docs/examples/messaging/delete-subscriber.md index c535154..d433e3a 100644 --- a/docs/examples/messaging/delete-subscriber.md +++ b/docs/examples/messaging/delete-subscriber.md @@ -1,3 +1,3 @@ -appwrite messaging deleteSubscriber \ - --topicId \ - --subscriberId +appwrite messaging delete-subscriber \ + --topic-id \ + --subscriber-id diff --git a/docs/examples/messaging/delete-topic.md b/docs/examples/messaging/delete-topic.md index 1fa387c..0c2887c 100644 --- a/docs/examples/messaging/delete-topic.md +++ b/docs/examples/messaging/delete-topic.md @@ -1,2 +1,2 @@ -appwrite messaging deleteTopic \ - --topicId +appwrite messaging delete-topic \ + --topic-id diff --git a/docs/examples/messaging/delete.md b/docs/examples/messaging/delete.md index 82ff141..eb5d2a6 100644 --- a/docs/examples/messaging/delete.md +++ b/docs/examples/messaging/delete.md @@ -1,2 +1,2 @@ appwrite messaging delete \ - --messageId + --message-id diff --git a/docs/examples/messaging/get-message.md b/docs/examples/messaging/get-message.md index 0144f79..2de245e 100644 --- a/docs/examples/messaging/get-message.md +++ b/docs/examples/messaging/get-message.md @@ -1,2 +1,2 @@ -appwrite messaging getMessage \ - --messageId +appwrite messaging get-message \ + --message-id diff --git a/docs/examples/messaging/get-provider.md b/docs/examples/messaging/get-provider.md index 9da9f2d..b115c52 100644 --- a/docs/examples/messaging/get-provider.md +++ b/docs/examples/messaging/get-provider.md @@ -1,2 +1,2 @@ -appwrite messaging getProvider \ - --providerId +appwrite messaging get-provider \ + --provider-id diff --git a/docs/examples/messaging/get-subscriber.md b/docs/examples/messaging/get-subscriber.md index 02f8bc0..88c2ab6 100644 --- a/docs/examples/messaging/get-subscriber.md +++ b/docs/examples/messaging/get-subscriber.md @@ -1,3 +1,3 @@ -appwrite messaging getSubscriber \ - --topicId \ - --subscriberId +appwrite messaging get-subscriber \ + --topic-id \ + --subscriber-id diff --git a/docs/examples/messaging/get-topic.md b/docs/examples/messaging/get-topic.md index feb2dc6..7628bed 100644 --- a/docs/examples/messaging/get-topic.md +++ b/docs/examples/messaging/get-topic.md @@ -1,2 +1,2 @@ -appwrite messaging getTopic \ - --topicId +appwrite messaging get-topic \ + --topic-id diff --git a/docs/examples/messaging/list-message-logs.md b/docs/examples/messaging/list-message-logs.md index 91366f3..9cc6dc5 100644 --- a/docs/examples/messaging/list-message-logs.md +++ b/docs/examples/messaging/list-message-logs.md @@ -1,3 +1,2 @@ -appwrite messaging listMessageLogs \ - --messageId \ - +appwrite messaging list-message-logs \ + --message-id diff --git a/docs/examples/messaging/list-messages.md b/docs/examples/messaging/list-messages.md index 6ab04b0..1e8a726 100644 --- a/docs/examples/messaging/list-messages.md +++ b/docs/examples/messaging/list-messages.md @@ -1,3 +1 @@ -appwrite messaging listMessages \ - - +appwrite messaging list-messages diff --git a/docs/examples/messaging/list-provider-logs.md b/docs/examples/messaging/list-provider-logs.md index 0dee2e3..95e514e 100644 --- a/docs/examples/messaging/list-provider-logs.md +++ b/docs/examples/messaging/list-provider-logs.md @@ -1,3 +1,2 @@ -appwrite messaging listProviderLogs \ - --providerId \ - +appwrite messaging list-provider-logs \ + --provider-id diff --git a/docs/examples/messaging/list-providers.md b/docs/examples/messaging/list-providers.md index 0a2ce47..d075be5 100644 --- a/docs/examples/messaging/list-providers.md +++ b/docs/examples/messaging/list-providers.md @@ -1,3 +1 @@ -appwrite messaging listProviders \ - - +appwrite messaging list-providers diff --git a/docs/examples/messaging/list-subscriber-logs.md b/docs/examples/messaging/list-subscriber-logs.md index 4a04ac4..4858c6c 100644 --- a/docs/examples/messaging/list-subscriber-logs.md +++ b/docs/examples/messaging/list-subscriber-logs.md @@ -1,3 +1,2 @@ -appwrite messaging listSubscriberLogs \ - --subscriberId \ - +appwrite messaging list-subscriber-logs \ + --subscriber-id diff --git a/docs/examples/messaging/list-subscribers.md b/docs/examples/messaging/list-subscribers.md index 2eed8bd..c122c68 100644 --- a/docs/examples/messaging/list-subscribers.md +++ b/docs/examples/messaging/list-subscribers.md @@ -1,4 +1,2 @@ -appwrite messaging listSubscribers \ - --topicId \ - - +appwrite messaging list-subscribers \ + --topic-id diff --git a/docs/examples/messaging/list-targets.md b/docs/examples/messaging/list-targets.md index 7efa50e..e161e93 100644 --- a/docs/examples/messaging/list-targets.md +++ b/docs/examples/messaging/list-targets.md @@ -1,3 +1,2 @@ -appwrite messaging listTargets \ - --messageId \ - +appwrite messaging list-targets \ + --message-id diff --git a/docs/examples/messaging/list-topic-logs.md b/docs/examples/messaging/list-topic-logs.md index f23c10a..121f279 100644 --- a/docs/examples/messaging/list-topic-logs.md +++ b/docs/examples/messaging/list-topic-logs.md @@ -1,3 +1,2 @@ -appwrite messaging listTopicLogs \ - --topicId \ - +appwrite messaging list-topic-logs \ + --topic-id diff --git a/docs/examples/messaging/list-topics.md b/docs/examples/messaging/list-topics.md index 1810a7b..0337b3d 100644 --- a/docs/examples/messaging/list-topics.md +++ b/docs/examples/messaging/list-topics.md @@ -1,3 +1 @@ -appwrite messaging listTopics \ - - +appwrite messaging list-topics diff --git a/docs/examples/messaging/update-apns-provider.md b/docs/examples/messaging/update-apns-provider.md index 9e895a0..7bd5db2 100644 --- a/docs/examples/messaging/update-apns-provider.md +++ b/docs/examples/messaging/update-apns-provider.md @@ -1,9 +1,2 @@ -appwrite messaging updateApnsProvider \ - --providerId \ - - - - - - - +appwrite messaging update-apns-provider \ + --provider-id diff --git a/docs/examples/messaging/update-email.md b/docs/examples/messaging/update-email.md index 934fd29..7e318ad 100644 --- a/docs/examples/messaging/update-email.md +++ b/docs/examples/messaging/update-email.md @@ -1,13 +1,2 @@ -appwrite messaging updateEmail \ - --messageId \ - - - - - - - - - - - +appwrite messaging update-email \ + --message-id diff --git a/docs/examples/messaging/update-fcm-provider.md b/docs/examples/messaging/update-fcm-provider.md index 0000223..4d41680 100644 --- a/docs/examples/messaging/update-fcm-provider.md +++ b/docs/examples/messaging/update-fcm-provider.md @@ -1,5 +1,2 @@ -appwrite messaging updateFcmProvider \ - --providerId \ - - - +appwrite messaging update-fcm-provider \ + --provider-id diff --git a/docs/examples/messaging/update-mailgun-provider.md b/docs/examples/messaging/update-mailgun-provider.md index f35c5e9..9d07afe 100644 --- a/docs/examples/messaging/update-mailgun-provider.md +++ b/docs/examples/messaging/update-mailgun-provider.md @@ -1,11 +1,2 @@ -appwrite messaging updateMailgunProvider \ - --providerId \ - - - - - - - - - +appwrite messaging update-mailgun-provider \ + --provider-id diff --git a/docs/examples/messaging/update-msg-91-provider.md b/docs/examples/messaging/update-msg-91-provider.md new file mode 100644 index 0000000..e4bc24b --- /dev/null +++ b/docs/examples/messaging/update-msg-91-provider.md @@ -0,0 +1,2 @@ +appwrite messaging update-msg-91-provider \ + --provider-id diff --git a/docs/examples/messaging/update-msg91provider.md b/docs/examples/messaging/update-msg91provider.md deleted file mode 100644 index 8e2d604..0000000 --- a/docs/examples/messaging/update-msg91provider.md +++ /dev/null @@ -1,7 +0,0 @@ -appwrite messaging updateMsg91Provider \ - --providerId \ - - - - - diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md index 1f4427c..c11d462 100644 --- a/docs/examples/messaging/update-push.md +++ b/docs/examples/messaging/update-push.md @@ -1,20 +1,2 @@ -appwrite messaging updatePush \ - --messageId \ - - - - - - - - - - - - - - - - - - +appwrite messaging update-push \ + --message-id diff --git a/docs/examples/messaging/update-sendgrid-provider.md b/docs/examples/messaging/update-sendgrid-provider.md index 7f2e97d..77e9fcd 100644 --- a/docs/examples/messaging/update-sendgrid-provider.md +++ b/docs/examples/messaging/update-sendgrid-provider.md @@ -1,9 +1,2 @@ -appwrite messaging updateSendgridProvider \ - --providerId \ - - - - - - - +appwrite messaging update-sendgrid-provider \ + --provider-id diff --git a/docs/examples/messaging/update-sms.md b/docs/examples/messaging/update-sms.md index a30ff43..888df62 100644 --- a/docs/examples/messaging/update-sms.md +++ b/docs/examples/messaging/update-sms.md @@ -1,8 +1,2 @@ -appwrite messaging updateSms \ - --messageId \ - - - - - - +appwrite messaging update-sms \ + --message-id diff --git a/docs/examples/messaging/update-smtp-provider.md b/docs/examples/messaging/update-smtp-provider.md index 4e0f7b6..23bb899 100644 --- a/docs/examples/messaging/update-smtp-provider.md +++ b/docs/examples/messaging/update-smtp-provider.md @@ -1,15 +1,2 @@ -appwrite messaging updateSmtpProvider \ - --providerId \ - - - - - - - - - - - - - +appwrite messaging update-smtp-provider \ + --provider-id diff --git a/docs/examples/messaging/update-telesign-provider.md b/docs/examples/messaging/update-telesign-provider.md index 0a92f2c..69eee1f 100644 --- a/docs/examples/messaging/update-telesign-provider.md +++ b/docs/examples/messaging/update-telesign-provider.md @@ -1,7 +1,2 @@ -appwrite messaging updateTelesignProvider \ - --providerId \ - - - - - +appwrite messaging update-telesign-provider \ + --provider-id diff --git a/docs/examples/messaging/update-textmagic-provider.md b/docs/examples/messaging/update-textmagic-provider.md index 79160b2..ff23b82 100644 --- a/docs/examples/messaging/update-textmagic-provider.md +++ b/docs/examples/messaging/update-textmagic-provider.md @@ -1,7 +1,2 @@ -appwrite messaging updateTextmagicProvider \ - --providerId \ - - - - - +appwrite messaging update-textmagic-provider \ + --provider-id diff --git a/docs/examples/messaging/update-topic.md b/docs/examples/messaging/update-topic.md index d10b0ed..ea7bc45 100644 --- a/docs/examples/messaging/update-topic.md +++ b/docs/examples/messaging/update-topic.md @@ -1,4 +1,2 @@ -appwrite messaging updateTopic \ - --topicId \ - - +appwrite messaging update-topic \ + --topic-id diff --git a/docs/examples/messaging/update-twilio-provider.md b/docs/examples/messaging/update-twilio-provider.md index c967d72..25f2910 100644 --- a/docs/examples/messaging/update-twilio-provider.md +++ b/docs/examples/messaging/update-twilio-provider.md @@ -1,7 +1,2 @@ -appwrite messaging updateTwilioProvider \ - --providerId \ - - - - - +appwrite messaging update-twilio-provider \ + --provider-id diff --git a/docs/examples/messaging/update-vonage-provider.md b/docs/examples/messaging/update-vonage-provider.md index 11f7963..7b87a94 100644 --- a/docs/examples/messaging/update-vonage-provider.md +++ b/docs/examples/messaging/update-vonage-provider.md @@ -1,7 +1,2 @@ -appwrite messaging updateVonageProvider \ - --providerId \ - - - - - +appwrite messaging update-vonage-provider \ + --provider-id diff --git a/docs/examples/migrations/create-appwrite-migration.md b/docs/examples/migrations/create-appwrite-migration.md index 73e9ee6..34fee2f 100644 --- a/docs/examples/migrations/create-appwrite-migration.md +++ b/docs/examples/migrations/create-appwrite-migration.md @@ -1,5 +1,5 @@ -appwrite migrations createAppwriteMigration \ - --resources one two three \ - --endpoint https://example.com \ - --projectId \ - --apiKey +appwrite migrations create-appwrite-migration \ + --resources one two three \ + --endpoint https://example.com \ + --project-id \ + --api-key diff --git a/docs/examples/migrations/create-csv-migration.md b/docs/examples/migrations/create-csv-migration.md index 594bc85..4b72b6f 100644 --- a/docs/examples/migrations/create-csv-migration.md +++ b/docs/examples/migrations/create-csv-migration.md @@ -1,4 +1,4 @@ -appwrite migrations createCsvMigration \ - --bucketId \ - --fileId \ - --resourceId [ID1:ID2] +appwrite migrations create-csv-migration \ + --bucket-id \ + --file-id \ + --resource-id [ID1:ID2] diff --git a/docs/examples/migrations/create-firebase-migration.md b/docs/examples/migrations/create-firebase-migration.md index 3dfb3ae..81337b4 100644 --- a/docs/examples/migrations/create-firebase-migration.md +++ b/docs/examples/migrations/create-firebase-migration.md @@ -1,3 +1,3 @@ -appwrite migrations createFirebaseMigration \ - --resources one two three \ - --serviceAccount +appwrite migrations create-firebase-migration \ + --resources one two three \ + --service-account diff --git a/docs/examples/migrations/create-n-host-migration.md b/docs/examples/migrations/create-n-host-migration.md index d959897..2bcba6a 100644 --- a/docs/examples/migrations/create-n-host-migration.md +++ b/docs/examples/migrations/create-n-host-migration.md @@ -1,9 +1,8 @@ -appwrite migrations createNHostMigration \ - --resources one two three \ - --subdomain \ - --region \ - --adminSecret \ - --database \ - --username \ - --password \ - +appwrite migrations create-n-host-migration \ + --resources one two three \ + --subdomain \ + --region \ + --admin-secret \ + --database \ + --username \ + --password diff --git a/docs/examples/migrations/create-supabase-migration.md b/docs/examples/migrations/create-supabase-migration.md index 0620f3b..a186b17 100644 --- a/docs/examples/migrations/create-supabase-migration.md +++ b/docs/examples/migrations/create-supabase-migration.md @@ -1,8 +1,7 @@ -appwrite migrations createSupabaseMigration \ - --resources one two three \ - --endpoint https://example.com \ - --apiKey \ - --databaseHost \ - --username \ - --password \ - +appwrite migrations create-supabase-migration \ + --resources one two three \ + --endpoint https://example.com \ + --api-key \ + --database-host \ + --username \ + --password diff --git a/docs/examples/migrations/delete.md b/docs/examples/migrations/delete.md index 9dac1aa..b7ad0f0 100644 --- a/docs/examples/migrations/delete.md +++ b/docs/examples/migrations/delete.md @@ -1,2 +1,2 @@ appwrite migrations delete \ - --migrationId + --migration-id diff --git a/docs/examples/migrations/get-appwrite-report.md b/docs/examples/migrations/get-appwrite-report.md index 745e9fb..3f54fed 100644 --- a/docs/examples/migrations/get-appwrite-report.md +++ b/docs/examples/migrations/get-appwrite-report.md @@ -1,5 +1,5 @@ -appwrite migrations getAppwriteReport \ - --resources one two three \ - --endpoint https://example.com \ - --projectID \ - --key +appwrite migrations get-appwrite-report \ + --resources one two three \ + --endpoint https://example.com \ + --project-id \ + --key diff --git a/docs/examples/migrations/get-firebase-report.md b/docs/examples/migrations/get-firebase-report.md index 73c7e1c..33e7e73 100644 --- a/docs/examples/migrations/get-firebase-report.md +++ b/docs/examples/migrations/get-firebase-report.md @@ -1,3 +1,3 @@ -appwrite migrations getFirebaseReport \ - --resources one two three \ - --serviceAccount +appwrite migrations get-firebase-report \ + --resources one two three \ + --service-account diff --git a/docs/examples/migrations/get-n-host-report.md b/docs/examples/migrations/get-n-host-report.md index 6b7e2ea..2d1ed04 100644 --- a/docs/examples/migrations/get-n-host-report.md +++ b/docs/examples/migrations/get-n-host-report.md @@ -1,9 +1,8 @@ -appwrite migrations getNHostReport \ - --resources one two three \ - --subdomain \ - --region \ - --adminSecret \ - --database \ - --username \ - --password \ - +appwrite migrations get-n-host-report \ + --resources one two three \ + --subdomain \ + --region \ + --admin-secret \ + --database \ + --username \ + --password diff --git a/docs/examples/migrations/get-supabase-report.md b/docs/examples/migrations/get-supabase-report.md index 9754f38..789c66a 100644 --- a/docs/examples/migrations/get-supabase-report.md +++ b/docs/examples/migrations/get-supabase-report.md @@ -1,8 +1,7 @@ -appwrite migrations getSupabaseReport \ - --resources one two three \ - --endpoint https://example.com \ - --apiKey \ - --databaseHost \ - --username \ - --password \ - +appwrite migrations get-supabase-report \ + --resources one two three \ + --endpoint https://example.com \ + --api-key \ + --database-host \ + --username \ + --password diff --git a/docs/examples/migrations/get.md b/docs/examples/migrations/get.md index 8810646..46959a3 100644 --- a/docs/examples/migrations/get.md +++ b/docs/examples/migrations/get.md @@ -1,2 +1,2 @@ appwrite migrations get \ - --migrationId + --migration-id diff --git a/docs/examples/migrations/list.md b/docs/examples/migrations/list.md index c120a61..659c9fd 100644 --- a/docs/examples/migrations/list.md +++ b/docs/examples/migrations/list.md @@ -1,3 +1 @@ -appwrite migrations list \ - - +appwrite migrations list diff --git a/docs/examples/migrations/retry.md b/docs/examples/migrations/retry.md index 518f86c..d656dd9 100644 --- a/docs/examples/migrations/retry.md +++ b/docs/examples/migrations/retry.md @@ -1,2 +1,2 @@ appwrite migrations retry \ - --migrationId + --migration-id diff --git a/docs/examples/project/create-variable.md b/docs/examples/project/create-variable.md index 253d6dd..113c0ba 100644 --- a/docs/examples/project/create-variable.md +++ b/docs/examples/project/create-variable.md @@ -1,4 +1,3 @@ -appwrite project createVariable \ - --key \ - --value \ - +appwrite project create-variable \ + --key \ + --value diff --git a/docs/examples/project/delete-variable.md b/docs/examples/project/delete-variable.md index 7fdda87..a4213dc 100644 --- a/docs/examples/project/delete-variable.md +++ b/docs/examples/project/delete-variable.md @@ -1,2 +1,2 @@ -appwrite project deleteVariable \ - --variableId +appwrite project delete-variable \ + --variable-id diff --git a/docs/examples/project/get-usage.md b/docs/examples/project/get-usage.md index 9b4c296..75cc4b9 100644 --- a/docs/examples/project/get-usage.md +++ b/docs/examples/project/get-usage.md @@ -1,4 +1,3 @@ -appwrite project getUsage \ - --startDate '' \ - --endDate '' \ - +appwrite project get-usage \ + --start-date '' \ + --end-date '' diff --git a/docs/examples/project/get-variable.md b/docs/examples/project/get-variable.md index b2d4825..2833758 100644 --- a/docs/examples/project/get-variable.md +++ b/docs/examples/project/get-variable.md @@ -1,2 +1,2 @@ -appwrite project getVariable \ - --variableId +appwrite project get-variable \ + --variable-id diff --git a/docs/examples/project/list-variables.md b/docs/examples/project/list-variables.md index bd26c7d..dc6251c 100644 --- a/docs/examples/project/list-variables.md +++ b/docs/examples/project/list-variables.md @@ -1 +1 @@ -appwrite project listVariables +appwrite project list-variables diff --git a/docs/examples/project/update-variable.md b/docs/examples/project/update-variable.md index 4365b64..5f12a12 100644 --- a/docs/examples/project/update-variable.md +++ b/docs/examples/project/update-variable.md @@ -1,5 +1,3 @@ -appwrite project updateVariable \ - --variableId \ - --key \ - - +appwrite project update-variable \ + --variable-id \ + --key diff --git a/docs/examples/projects/create-dev-key.md b/docs/examples/projects/create-dev-key.md index 8b9ec89..b90e0ca 100644 --- a/docs/examples/projects/create-dev-key.md +++ b/docs/examples/projects/create-dev-key.md @@ -1,4 +1,4 @@ -appwrite projects createDevKey \ - --projectId \ - --name \ - --expire '' +appwrite projects create-dev-key \ + --project-id \ + --name \ + --expire '' diff --git a/docs/examples/projects/create-j-w-t.md b/docs/examples/projects/create-j-w-t.md deleted file mode 100644 index d703d36..0000000 --- a/docs/examples/projects/create-j-w-t.md +++ /dev/null @@ -1,4 +0,0 @@ -appwrite projects createJWT \ - --projectId \ - --scopes one two three \ - diff --git a/docs/examples/projects/create-jwt.md b/docs/examples/projects/create-jwt.md new file mode 100644 index 0000000..df708a5 --- /dev/null +++ b/docs/examples/projects/create-jwt.md @@ -0,0 +1,3 @@ +appwrite projects create-jwt \ + --project-id \ + --scopes one two three diff --git a/docs/examples/projects/create-key.md b/docs/examples/projects/create-key.md index fb986dc..0650ccd 100644 --- a/docs/examples/projects/create-key.md +++ b/docs/examples/projects/create-key.md @@ -1,5 +1,4 @@ -appwrite projects createKey \ - --projectId \ - --name \ - --scopes one two three \ - +appwrite projects create-key \ + --project-id \ + --name \ + --scopes one two three diff --git a/docs/examples/projects/create-platform.md b/docs/examples/projects/create-platform.md index 8727d21..94f5234 100644 --- a/docs/examples/projects/create-platform.md +++ b/docs/examples/projects/create-platform.md @@ -1,7 +1,4 @@ -appwrite projects createPlatform \ - --projectId \ - --type web \ - --name \ - - - +appwrite projects create-platform \ + --project-id \ + --type web \ + --name diff --git a/docs/examples/projects/create-smtp-test.md b/docs/examples/projects/create-smtp-test.md index 66ce588..c83aebf 100644 --- a/docs/examples/projects/create-smtp-test.md +++ b/docs/examples/projects/create-smtp-test.md @@ -1,11 +1,6 @@ -appwrite projects createSmtpTest \ - --projectId \ - --emails one two three \ - --senderName \ - --senderEmail email@example.com \ - --host '' \ - - - - - +appwrite projects create-smtp-test \ + --project-id \ + --emails one two three \ + --sender-name \ + --sender-email email@example.com \ + --host '' diff --git a/docs/examples/projects/create-webhook.md b/docs/examples/projects/create-webhook.md index 03ecf41..0983d31 100644 --- a/docs/examples/projects/create-webhook.md +++ b/docs/examples/projects/create-webhook.md @@ -1,9 +1,6 @@ -appwrite projects createWebhook \ - --projectId \ - --name \ - --events one two three \ - --url '' \ - --security false \ - - - +appwrite projects create-webhook \ + --project-id \ + --name \ + --events one two three \ + --url '' \ + --security false diff --git a/docs/examples/projects/create.md b/docs/examples/projects/create.md index 0504785..5bdd1ff 100644 --- a/docs/examples/projects/create.md +++ b/docs/examples/projects/create.md @@ -1,14 +1,4 @@ appwrite projects create \ - --projectId '' \ - --name \ - --teamId \ - - - - - - - - - - + --project-id '' \ + --name \ + --team-id diff --git a/docs/examples/projects/delete-dev-key.md b/docs/examples/projects/delete-dev-key.md index 2859a33..3e911ea 100644 --- a/docs/examples/projects/delete-dev-key.md +++ b/docs/examples/projects/delete-dev-key.md @@ -1,3 +1,3 @@ -appwrite projects deleteDevKey \ - --projectId \ - --keyId +appwrite projects delete-dev-key \ + --project-id \ + --key-id diff --git a/docs/examples/projects/delete-email-template.md b/docs/examples/projects/delete-email-template.md index 01ce0fa..81cf403 100644 --- a/docs/examples/projects/delete-email-template.md +++ b/docs/examples/projects/delete-email-template.md @@ -1,4 +1,4 @@ -appwrite projects deleteEmailTemplate \ - --projectId \ - --type verification \ - --locale af +appwrite projects delete-email-template \ + --project-id \ + --type verification \ + --locale af diff --git a/docs/examples/projects/delete-key.md b/docs/examples/projects/delete-key.md index 6baf057..eccb09b 100644 --- a/docs/examples/projects/delete-key.md +++ b/docs/examples/projects/delete-key.md @@ -1,3 +1,3 @@ -appwrite projects deleteKey \ - --projectId \ - --keyId +appwrite projects delete-key \ + --project-id \ + --key-id diff --git a/docs/examples/projects/delete-platform.md b/docs/examples/projects/delete-platform.md index a85bd86..7f68e7d 100644 --- a/docs/examples/projects/delete-platform.md +++ b/docs/examples/projects/delete-platform.md @@ -1,3 +1,3 @@ -appwrite projects deletePlatform \ - --projectId \ - --platformId +appwrite projects delete-platform \ + --project-id \ + --platform-id diff --git a/docs/examples/projects/delete-sms-template.md b/docs/examples/projects/delete-sms-template.md index 3afcf64..666de54 100644 --- a/docs/examples/projects/delete-sms-template.md +++ b/docs/examples/projects/delete-sms-template.md @@ -1,4 +1,4 @@ -appwrite projects deleteSmsTemplate \ - --projectId \ - --type verification \ - --locale af +appwrite projects delete-sms-template \ + --project-id \ + --type verification \ + --locale af diff --git a/docs/examples/projects/delete-webhook.md b/docs/examples/projects/delete-webhook.md index a67301e..70e6865 100644 --- a/docs/examples/projects/delete-webhook.md +++ b/docs/examples/projects/delete-webhook.md @@ -1,3 +1,3 @@ -appwrite projects deleteWebhook \ - --projectId \ - --webhookId +appwrite projects delete-webhook \ + --project-id \ + --webhook-id diff --git a/docs/examples/projects/delete.md b/docs/examples/projects/delete.md index a4ffc70..3127385 100644 --- a/docs/examples/projects/delete.md +++ b/docs/examples/projects/delete.md @@ -1,2 +1,2 @@ appwrite projects delete \ - --projectId + --project-id diff --git a/docs/examples/projects/get-dev-key.md b/docs/examples/projects/get-dev-key.md index cfc37ed..57b2c22 100644 --- a/docs/examples/projects/get-dev-key.md +++ b/docs/examples/projects/get-dev-key.md @@ -1,3 +1,3 @@ -appwrite projects getDevKey \ - --projectId \ - --keyId +appwrite projects get-dev-key \ + --project-id \ + --key-id diff --git a/docs/examples/projects/get-email-template.md b/docs/examples/projects/get-email-template.md index 6e4c21e..ea6d542 100644 --- a/docs/examples/projects/get-email-template.md +++ b/docs/examples/projects/get-email-template.md @@ -1,4 +1,4 @@ -appwrite projects getEmailTemplate \ - --projectId \ - --type verification \ - --locale af +appwrite projects get-email-template \ + --project-id \ + --type verification \ + --locale af diff --git a/docs/examples/projects/get-key.md b/docs/examples/projects/get-key.md index f69b51b..cfd5013 100644 --- a/docs/examples/projects/get-key.md +++ b/docs/examples/projects/get-key.md @@ -1,3 +1,3 @@ -appwrite projects getKey \ - --projectId \ - --keyId +appwrite projects get-key \ + --project-id \ + --key-id diff --git a/docs/examples/projects/get-platform.md b/docs/examples/projects/get-platform.md index 67648be..6207730 100644 --- a/docs/examples/projects/get-platform.md +++ b/docs/examples/projects/get-platform.md @@ -1,3 +1,3 @@ -appwrite projects getPlatform \ - --projectId \ - --platformId +appwrite projects get-platform \ + --project-id \ + --platform-id diff --git a/docs/examples/projects/get-sms-template.md b/docs/examples/projects/get-sms-template.md index c655953..bbb755b 100644 --- a/docs/examples/projects/get-sms-template.md +++ b/docs/examples/projects/get-sms-template.md @@ -1,4 +1,4 @@ -appwrite projects getSmsTemplate \ - --projectId \ - --type verification \ - --locale af +appwrite projects get-sms-template \ + --project-id \ + --type verification \ + --locale af diff --git a/docs/examples/projects/get-webhook.md b/docs/examples/projects/get-webhook.md index 890bf37..d725bee 100644 --- a/docs/examples/projects/get-webhook.md +++ b/docs/examples/projects/get-webhook.md @@ -1,3 +1,3 @@ -appwrite projects getWebhook \ - --projectId \ - --webhookId +appwrite projects get-webhook \ + --project-id \ + --webhook-id diff --git a/docs/examples/projects/get.md b/docs/examples/projects/get.md index 919321b..0665b37 100644 --- a/docs/examples/projects/get.md +++ b/docs/examples/projects/get.md @@ -1,2 +1,2 @@ appwrite projects get \ - --projectId + --project-id diff --git a/docs/examples/projects/list-dev-keys.md b/docs/examples/projects/list-dev-keys.md index d552cb3..f6f9a84 100644 --- a/docs/examples/projects/list-dev-keys.md +++ b/docs/examples/projects/list-dev-keys.md @@ -1,3 +1,2 @@ -appwrite projects listDevKeys \ - --projectId \ - +appwrite projects list-dev-keys \ + --project-id diff --git a/docs/examples/projects/list-keys.md b/docs/examples/projects/list-keys.md index cc37680..aa70a5c 100644 --- a/docs/examples/projects/list-keys.md +++ b/docs/examples/projects/list-keys.md @@ -1,2 +1,2 @@ -appwrite projects listKeys \ - --projectId +appwrite projects list-keys \ + --project-id diff --git a/docs/examples/projects/list-platforms.md b/docs/examples/projects/list-platforms.md index 5fc2ea4..e7fbfb2 100644 --- a/docs/examples/projects/list-platforms.md +++ b/docs/examples/projects/list-platforms.md @@ -1,2 +1,2 @@ -appwrite projects listPlatforms \ - --projectId +appwrite projects list-platforms \ + --project-id diff --git a/docs/examples/projects/list-webhooks.md b/docs/examples/projects/list-webhooks.md index dcf9953..ab4012a 100644 --- a/docs/examples/projects/list-webhooks.md +++ b/docs/examples/projects/list-webhooks.md @@ -1,2 +1,2 @@ -appwrite projects listWebhooks \ - --projectId +appwrite projects list-webhooks \ + --project-id diff --git a/docs/examples/projects/list.md b/docs/examples/projects/list.md index 0d3dd7a..f84f712 100644 --- a/docs/examples/projects/list.md +++ b/docs/examples/projects/list.md @@ -1,3 +1 @@ -appwrite projects list \ - - +appwrite projects list diff --git a/docs/examples/projects/update-api-status-all.md b/docs/examples/projects/update-api-status-all.md index e5f63c5..bbbec45 100644 --- a/docs/examples/projects/update-api-status-all.md +++ b/docs/examples/projects/update-api-status-all.md @@ -1,3 +1,3 @@ -appwrite projects updateApiStatusAll \ - --projectId \ - --status false +appwrite projects update-api-status-all \ + --project-id \ + --status false diff --git a/docs/examples/projects/update-api-status.md b/docs/examples/projects/update-api-status.md index 0112095..7e269ba 100644 --- a/docs/examples/projects/update-api-status.md +++ b/docs/examples/projects/update-api-status.md @@ -1,4 +1,4 @@ -appwrite projects updateApiStatus \ - --projectId \ - --api rest \ - --status false +appwrite projects update-api-status \ + --project-id \ + --api rest \ + --status false diff --git a/docs/examples/projects/update-auth-duration.md b/docs/examples/projects/update-auth-duration.md index ad6f8ac..07e458e 100644 --- a/docs/examples/projects/update-auth-duration.md +++ b/docs/examples/projects/update-auth-duration.md @@ -1,3 +1,3 @@ -appwrite projects updateAuthDuration \ - --projectId \ - --duration 0 +appwrite projects update-auth-duration \ + --project-id \ + --duration 0 diff --git a/docs/examples/projects/update-auth-limit.md b/docs/examples/projects/update-auth-limit.md index 9d01fa5..5e5d2ad 100644 --- a/docs/examples/projects/update-auth-limit.md +++ b/docs/examples/projects/update-auth-limit.md @@ -1,3 +1,3 @@ -appwrite projects updateAuthLimit \ - --projectId \ - --limit 0 +appwrite projects update-auth-limit \ + --project-id \ + --limit 0 diff --git a/docs/examples/projects/update-auth-password-dictionary.md b/docs/examples/projects/update-auth-password-dictionary.md index f477bba..b4160e3 100644 --- a/docs/examples/projects/update-auth-password-dictionary.md +++ b/docs/examples/projects/update-auth-password-dictionary.md @@ -1,3 +1,3 @@ -appwrite projects updateAuthPasswordDictionary \ - --projectId \ - --enabled false +appwrite projects update-auth-password-dictionary \ + --project-id \ + --enabled false diff --git a/docs/examples/projects/update-auth-password-history.md b/docs/examples/projects/update-auth-password-history.md index 8b9b90a..cffc917 100644 --- a/docs/examples/projects/update-auth-password-history.md +++ b/docs/examples/projects/update-auth-password-history.md @@ -1,3 +1,3 @@ -appwrite projects updateAuthPasswordHistory \ - --projectId \ - --limit 0 +appwrite projects update-auth-password-history \ + --project-id \ + --limit 0 diff --git a/docs/examples/projects/update-auth-sessions-limit.md b/docs/examples/projects/update-auth-sessions-limit.md index 2a1294d..fc205c0 100644 --- a/docs/examples/projects/update-auth-sessions-limit.md +++ b/docs/examples/projects/update-auth-sessions-limit.md @@ -1,3 +1,3 @@ -appwrite projects updateAuthSessionsLimit \ - --projectId \ - --limit 1 +appwrite projects update-auth-sessions-limit \ + --project-id \ + --limit 1 diff --git a/docs/examples/projects/update-auth-status.md b/docs/examples/projects/update-auth-status.md index 848987b..5f38dc9 100644 --- a/docs/examples/projects/update-auth-status.md +++ b/docs/examples/projects/update-auth-status.md @@ -1,4 +1,4 @@ -appwrite projects updateAuthStatus \ - --projectId \ - --method email-password \ - --status false +appwrite projects update-auth-status \ + --project-id \ + --method email-password \ + --status false diff --git a/docs/examples/projects/update-dev-key.md b/docs/examples/projects/update-dev-key.md index cc95030..1e54db3 100644 --- a/docs/examples/projects/update-dev-key.md +++ b/docs/examples/projects/update-dev-key.md @@ -1,5 +1,5 @@ -appwrite projects updateDevKey \ - --projectId \ - --keyId \ - --name \ - --expire '' +appwrite projects update-dev-key \ + --project-id \ + --key-id \ + --name \ + --expire '' diff --git a/docs/examples/projects/update-email-template.md b/docs/examples/projects/update-email-template.md index a3acd06..f8e4919 100644 --- a/docs/examples/projects/update-email-template.md +++ b/docs/examples/projects/update-email-template.md @@ -1,9 +1,6 @@ -appwrite projects updateEmailTemplate \ - --projectId \ - --type verification \ - --locale af \ - --subject \ - --message \ - - - +appwrite projects update-email-template \ + --project-id \ + --type verification \ + --locale af \ + --subject \ + --message diff --git a/docs/examples/projects/update-key.md b/docs/examples/projects/update-key.md index 6d3dc19..8ac173b 100644 --- a/docs/examples/projects/update-key.md +++ b/docs/examples/projects/update-key.md @@ -1,6 +1,5 @@ -appwrite projects updateKey \ - --projectId \ - --keyId \ - --name \ - --scopes one two three \ - +appwrite projects update-key \ + --project-id \ + --key-id \ + --name \ + --scopes one two three diff --git a/docs/examples/projects/update-memberships-privacy.md b/docs/examples/projects/update-memberships-privacy.md index 6c811cc..94582f4 100644 --- a/docs/examples/projects/update-memberships-privacy.md +++ b/docs/examples/projects/update-memberships-privacy.md @@ -1,5 +1,5 @@ -appwrite projects updateMembershipsPrivacy \ - --projectId \ - --userName false \ - --userEmail false \ - --mfa false +appwrite projects update-memberships-privacy \ + --project-id \ + --user-name false \ + --user-email false \ + --mfa false diff --git a/docs/examples/projects/update-mock-numbers.md b/docs/examples/projects/update-mock-numbers.md index 733cc16..774887d 100644 --- a/docs/examples/projects/update-mock-numbers.md +++ b/docs/examples/projects/update-mock-numbers.md @@ -1,3 +1,3 @@ -appwrite projects updateMockNumbers \ - --projectId \ - --numbers one two three +appwrite projects update-mock-numbers \ + --project-id \ + --numbers one two three diff --git a/docs/examples/projects/update-o-auth-2.md b/docs/examples/projects/update-o-auth-2.md new file mode 100644 index 0000000..7f8364d --- /dev/null +++ b/docs/examples/projects/update-o-auth-2.md @@ -0,0 +1,3 @@ +appwrite projects update-o-auth-2 \ + --project-id \ + --provider amazon diff --git a/docs/examples/projects/update-o-auth2.md b/docs/examples/projects/update-o-auth2.md deleted file mode 100644 index 92f6718..0000000 --- a/docs/examples/projects/update-o-auth2.md +++ /dev/null @@ -1,6 +0,0 @@ -appwrite projects updateOAuth2 \ - --projectId \ - --provider amazon \ - - - diff --git a/docs/examples/projects/update-personal-data-check.md b/docs/examples/projects/update-personal-data-check.md index 21dca78..7130dec 100644 --- a/docs/examples/projects/update-personal-data-check.md +++ b/docs/examples/projects/update-personal-data-check.md @@ -1,3 +1,3 @@ -appwrite projects updatePersonalDataCheck \ - --projectId \ - --enabled false +appwrite projects update-personal-data-check \ + --project-id \ + --enabled false diff --git a/docs/examples/projects/update-platform.md b/docs/examples/projects/update-platform.md index 05b1602..170e8a6 100644 --- a/docs/examples/projects/update-platform.md +++ b/docs/examples/projects/update-platform.md @@ -1,7 +1,4 @@ -appwrite projects updatePlatform \ - --projectId \ - --platformId \ - --name \ - - - +appwrite projects update-platform \ + --project-id \ + --platform-id \ + --name diff --git a/docs/examples/projects/update-service-status-all.md b/docs/examples/projects/update-service-status-all.md index 1ffb77e..1d8fab2 100644 --- a/docs/examples/projects/update-service-status-all.md +++ b/docs/examples/projects/update-service-status-all.md @@ -1,3 +1,3 @@ -appwrite projects updateServiceStatusAll \ - --projectId \ - --status false +appwrite projects update-service-status-all \ + --project-id \ + --status false diff --git a/docs/examples/projects/update-service-status.md b/docs/examples/projects/update-service-status.md index 03963a1..ce589bc 100644 --- a/docs/examples/projects/update-service-status.md +++ b/docs/examples/projects/update-service-status.md @@ -1,4 +1,4 @@ -appwrite projects updateServiceStatus \ - --projectId \ - --service account \ - --status false +appwrite projects update-service-status \ + --project-id \ + --service account \ + --status false diff --git a/docs/examples/projects/update-session-alerts.md b/docs/examples/projects/update-session-alerts.md index bd23b74..d25fa96 100644 --- a/docs/examples/projects/update-session-alerts.md +++ b/docs/examples/projects/update-session-alerts.md @@ -1,3 +1,3 @@ -appwrite projects updateSessionAlerts \ - --projectId \ - --alerts false +appwrite projects update-session-alerts \ + --project-id \ + --alerts false diff --git a/docs/examples/projects/update-session-invalidation.md b/docs/examples/projects/update-session-invalidation.md new file mode 100644 index 0000000..17d635e --- /dev/null +++ b/docs/examples/projects/update-session-invalidation.md @@ -0,0 +1,3 @@ +appwrite projects update-session-invalidation \ + --project-id \ + --enabled false diff --git a/docs/examples/projects/update-sms-template.md b/docs/examples/projects/update-sms-template.md index fc8310e..5e10477 100644 --- a/docs/examples/projects/update-sms-template.md +++ b/docs/examples/projects/update-sms-template.md @@ -1,5 +1,5 @@ -appwrite projects updateSmsTemplate \ - --projectId \ - --type verification \ - --locale af \ - --message +appwrite projects update-sms-template \ + --project-id \ + --type verification \ + --locale af \ + --message diff --git a/docs/examples/projects/update-smtp.md b/docs/examples/projects/update-smtp.md index 0afbe9c..f62059a 100644 --- a/docs/examples/projects/update-smtp.md +++ b/docs/examples/projects/update-smtp.md @@ -1,11 +1,3 @@ -appwrite projects updateSmtp \ - --projectId \ - --enabled false \ - - - - - - - - +appwrite projects update-smtp \ + --project-id \ + --enabled false diff --git a/docs/examples/projects/update-team.md b/docs/examples/projects/update-team.md index 49214ad..4cb0a98 100644 --- a/docs/examples/projects/update-team.md +++ b/docs/examples/projects/update-team.md @@ -1,3 +1,3 @@ -appwrite projects updateTeam \ - --projectId \ - --teamId +appwrite projects update-team \ + --project-id \ + --team-id diff --git a/docs/examples/projects/update-webhook-signature.md b/docs/examples/projects/update-webhook-signature.md index 6034ef0..708ff65 100644 --- a/docs/examples/projects/update-webhook-signature.md +++ b/docs/examples/projects/update-webhook-signature.md @@ -1,3 +1,3 @@ -appwrite projects updateWebhookSignature \ - --projectId \ - --webhookId +appwrite projects update-webhook-signature \ + --project-id \ + --webhook-id diff --git a/docs/examples/projects/update-webhook.md b/docs/examples/projects/update-webhook.md index 51c536d..f505e6e 100644 --- a/docs/examples/projects/update-webhook.md +++ b/docs/examples/projects/update-webhook.md @@ -1,10 +1,7 @@ -appwrite projects updateWebhook \ - --projectId \ - --webhookId \ - --name \ - --events one two three \ - --url '' \ - --security false \ - - - +appwrite projects update-webhook \ + --project-id \ + --webhook-id \ + --name \ + --events one two three \ + --url '' \ + --security false diff --git a/docs/examples/projects/update.md b/docs/examples/projects/update.md index d4df289..e3c7eca 100644 --- a/docs/examples/projects/update.md +++ b/docs/examples/projects/update.md @@ -1,12 +1,3 @@ appwrite projects update \ - --projectId \ - --name \ - - - - - - - - - + --project-id \ + --name diff --git a/docs/examples/proxy/create-a-p-i-rule.md b/docs/examples/proxy/create-a-p-i-rule.md deleted file mode 100644 index 5746b94..0000000 --- a/docs/examples/proxy/create-a-p-i-rule.md +++ /dev/null @@ -1,2 +0,0 @@ -appwrite proxy createAPIRule \ - --domain '' diff --git a/docs/examples/proxy/create-api-rule.md b/docs/examples/proxy/create-api-rule.md new file mode 100644 index 0000000..3bd7bb1 --- /dev/null +++ b/docs/examples/proxy/create-api-rule.md @@ -0,0 +1,2 @@ +appwrite proxy create-api-rule \ + --domain '' diff --git a/docs/examples/proxy/create-function-rule.md b/docs/examples/proxy/create-function-rule.md index 380650c..2312f3a 100644 --- a/docs/examples/proxy/create-function-rule.md +++ b/docs/examples/proxy/create-function-rule.md @@ -1,4 +1,3 @@ -appwrite proxy createFunctionRule \ - --domain '' \ - --functionId \ - +appwrite proxy create-function-rule \ + --domain '' \ + --function-id diff --git a/docs/examples/proxy/create-redirect-rule.md b/docs/examples/proxy/create-redirect-rule.md index ec9098a..763f9bc 100644 --- a/docs/examples/proxy/create-redirect-rule.md +++ b/docs/examples/proxy/create-redirect-rule.md @@ -1,6 +1,6 @@ -appwrite proxy createRedirectRule \ - --domain '' \ - --url https://example.com \ - --statusCode 301 \ - --resourceId \ - --resourceType site +appwrite proxy create-redirect-rule \ + --domain '' \ + --url https://example.com \ + --status-code 301 \ + --resource-id \ + --resource-type site diff --git a/docs/examples/proxy/create-site-rule.md b/docs/examples/proxy/create-site-rule.md index eb41bd7..fa7859b 100644 --- a/docs/examples/proxy/create-site-rule.md +++ b/docs/examples/proxy/create-site-rule.md @@ -1,4 +1,3 @@ -appwrite proxy createSiteRule \ - --domain '' \ - --siteId \ - +appwrite proxy create-site-rule \ + --domain '' \ + --site-id diff --git a/docs/examples/proxy/delete-rule.md b/docs/examples/proxy/delete-rule.md index b11b6ca..c676893 100644 --- a/docs/examples/proxy/delete-rule.md +++ b/docs/examples/proxy/delete-rule.md @@ -1,2 +1,2 @@ -appwrite proxy deleteRule \ - --ruleId +appwrite proxy delete-rule \ + --rule-id diff --git a/docs/examples/proxy/get-rule.md b/docs/examples/proxy/get-rule.md index 85d11a5..22ac1de 100644 --- a/docs/examples/proxy/get-rule.md +++ b/docs/examples/proxy/get-rule.md @@ -1,2 +1,2 @@ -appwrite proxy getRule \ - --ruleId +appwrite proxy get-rule \ + --rule-id diff --git a/docs/examples/proxy/list-rules.md b/docs/examples/proxy/list-rules.md index bc654ba..ab53084 100644 --- a/docs/examples/proxy/list-rules.md +++ b/docs/examples/proxy/list-rules.md @@ -1,3 +1 @@ -appwrite proxy listRules \ - - +appwrite proxy list-rules diff --git a/docs/examples/proxy/update-rule-verification.md b/docs/examples/proxy/update-rule-verification.md index 8200d15..b381aa3 100644 --- a/docs/examples/proxy/update-rule-verification.md +++ b/docs/examples/proxy/update-rule-verification.md @@ -1,2 +1,2 @@ -appwrite proxy updateRuleVerification \ - --ruleId +appwrite proxy update-rule-verification \ + --rule-id diff --git a/docs/examples/sites/create-deployment.md b/docs/examples/sites/create-deployment.md index a83d7f3..dda0468 100644 --- a/docs/examples/sites/create-deployment.md +++ b/docs/examples/sites/create-deployment.md @@ -1,7 +1,4 @@ -appwrite sites createDeployment \ - --siteId \ - --code 'path/to/file.png' \ - --activate false \ - - - +appwrite sites create-deployment \ + --site-id \ + --code 'path/to/file.png' \ + --activate false diff --git a/docs/examples/sites/create-duplicate-deployment.md b/docs/examples/sites/create-duplicate-deployment.md index bab63ca..30cf7d5 100644 --- a/docs/examples/sites/create-duplicate-deployment.md +++ b/docs/examples/sites/create-duplicate-deployment.md @@ -1,3 +1,3 @@ -appwrite sites createDuplicateDeployment \ - --siteId \ - --deploymentId +appwrite sites create-duplicate-deployment \ + --site-id \ + --deployment-id diff --git a/docs/examples/sites/create-template-deployment.md b/docs/examples/sites/create-template-deployment.md index 2aaaf44..2eece41 100644 --- a/docs/examples/sites/create-template-deployment.md +++ b/docs/examples/sites/create-template-deployment.md @@ -1,7 +1,6 @@ -appwrite sites createTemplateDeployment \ - --siteId \ - --repository \ - --owner \ - --rootDirectory \ - --version \ - +appwrite sites create-template-deployment \ + --site-id \ + --repository \ + --owner \ + --root-directory \ + --version diff --git a/docs/examples/sites/create-variable.md b/docs/examples/sites/create-variable.md index b640321..af1f470 100644 --- a/docs/examples/sites/create-variable.md +++ b/docs/examples/sites/create-variable.md @@ -1,5 +1,4 @@ -appwrite sites createVariable \ - --siteId \ - --key \ - --value \ - +appwrite sites create-variable \ + --site-id \ + --key \ + --value diff --git a/docs/examples/sites/create-vcs-deployment.md b/docs/examples/sites/create-vcs-deployment.md index 85c96f9..ab9c444 100644 --- a/docs/examples/sites/create-vcs-deployment.md +++ b/docs/examples/sites/create-vcs-deployment.md @@ -1,5 +1,4 @@ -appwrite sites createVcsDeployment \ - --siteId \ - --type branch \ - --reference \ - +appwrite sites create-vcs-deployment \ + --site-id \ + --type branch \ + --reference diff --git a/docs/examples/sites/create.md b/docs/examples/sites/create.md index bd7e86e..6806a10 100644 --- a/docs/examples/sites/create.md +++ b/docs/examples/sites/create.md @@ -1,19 +1,5 @@ appwrite sites create \ - --siteId \ - --name \ - --framework analog \ - --buildRuntime node-14.5 \ - - - - - - - - - - - - - - + --site-id \ + --name \ + --framework analog \ + --build-runtime node-14.5 diff --git a/docs/examples/sites/delete-deployment.md b/docs/examples/sites/delete-deployment.md index c1cbf49..7f7fe2f 100644 --- a/docs/examples/sites/delete-deployment.md +++ b/docs/examples/sites/delete-deployment.md @@ -1,3 +1,3 @@ -appwrite sites deleteDeployment \ - --siteId \ - --deploymentId +appwrite sites delete-deployment \ + --site-id \ + --deployment-id diff --git a/docs/examples/sites/delete-log.md b/docs/examples/sites/delete-log.md index 6769be2..3ea3503 100644 --- a/docs/examples/sites/delete-log.md +++ b/docs/examples/sites/delete-log.md @@ -1,3 +1,3 @@ -appwrite sites deleteLog \ - --siteId \ - --logId +appwrite sites delete-log \ + --site-id \ + --log-id diff --git a/docs/examples/sites/delete-variable.md b/docs/examples/sites/delete-variable.md index 60d9ecf..a7a32b9 100644 --- a/docs/examples/sites/delete-variable.md +++ b/docs/examples/sites/delete-variable.md @@ -1,3 +1,3 @@ -appwrite sites deleteVariable \ - --siteId \ - --variableId +appwrite sites delete-variable \ + --site-id \ + --variable-id diff --git a/docs/examples/sites/delete.md b/docs/examples/sites/delete.md index 9071454..e03eca6 100644 --- a/docs/examples/sites/delete.md +++ b/docs/examples/sites/delete.md @@ -1,2 +1,2 @@ appwrite sites delete \ - --siteId + --site-id diff --git a/docs/examples/sites/get-deployment-download.md b/docs/examples/sites/get-deployment-download.md index 1fae298..e7af5c3 100644 --- a/docs/examples/sites/get-deployment-download.md +++ b/docs/examples/sites/get-deployment-download.md @@ -1,4 +1,3 @@ -appwrite sites getDeploymentDownload \ - --siteId \ - --deploymentId \ - +appwrite sites get-deployment-download \ + --site-id \ + --deployment-id diff --git a/docs/examples/sites/get-deployment.md b/docs/examples/sites/get-deployment.md index 93680ff..28fee04 100644 --- a/docs/examples/sites/get-deployment.md +++ b/docs/examples/sites/get-deployment.md @@ -1,3 +1,3 @@ -appwrite sites getDeployment \ - --siteId \ - --deploymentId +appwrite sites get-deployment \ + --site-id \ + --deployment-id diff --git a/docs/examples/sites/get-log.md b/docs/examples/sites/get-log.md index 7867aba..adba026 100644 --- a/docs/examples/sites/get-log.md +++ b/docs/examples/sites/get-log.md @@ -1,3 +1,3 @@ -appwrite sites getLog \ - --siteId \ - --logId +appwrite sites get-log \ + --site-id \ + --log-id diff --git a/docs/examples/sites/get-template.md b/docs/examples/sites/get-template.md index e04dd2e..64bfd67 100644 --- a/docs/examples/sites/get-template.md +++ b/docs/examples/sites/get-template.md @@ -1,2 +1,2 @@ -appwrite sites getTemplate \ - --templateId +appwrite sites get-template \ + --template-id diff --git a/docs/examples/sites/get-usage.md b/docs/examples/sites/get-usage.md index 6de7d6b..e1f8862 100644 --- a/docs/examples/sites/get-usage.md +++ b/docs/examples/sites/get-usage.md @@ -1,3 +1,2 @@ -appwrite sites getUsage \ - --siteId \ - +appwrite sites get-usage \ + --site-id diff --git a/docs/examples/sites/get-variable.md b/docs/examples/sites/get-variable.md index b60b577..2e96d63 100644 --- a/docs/examples/sites/get-variable.md +++ b/docs/examples/sites/get-variable.md @@ -1,3 +1,3 @@ -appwrite sites getVariable \ - --siteId \ - --variableId +appwrite sites get-variable \ + --site-id \ + --variable-id diff --git a/docs/examples/sites/get.md b/docs/examples/sites/get.md index 7922efa..db34c82 100644 --- a/docs/examples/sites/get.md +++ b/docs/examples/sites/get.md @@ -1,2 +1,2 @@ appwrite sites get \ - --siteId + --site-id diff --git a/docs/examples/sites/list-deployments.md b/docs/examples/sites/list-deployments.md index 5ab2cdc..0c5de05 100644 --- a/docs/examples/sites/list-deployments.md +++ b/docs/examples/sites/list-deployments.md @@ -1,4 +1,2 @@ -appwrite sites listDeployments \ - --siteId \ - - +appwrite sites list-deployments \ + --site-id diff --git a/docs/examples/sites/list-frameworks.md b/docs/examples/sites/list-frameworks.md index 1d9b6b4..7a213b9 100644 --- a/docs/examples/sites/list-frameworks.md +++ b/docs/examples/sites/list-frameworks.md @@ -1 +1 @@ -appwrite sites listFrameworks +appwrite sites list-frameworks diff --git a/docs/examples/sites/list-logs.md b/docs/examples/sites/list-logs.md index f13864f..565bcab 100644 --- a/docs/examples/sites/list-logs.md +++ b/docs/examples/sites/list-logs.md @@ -1,3 +1,2 @@ -appwrite sites listLogs \ - --siteId \ - +appwrite sites list-logs \ + --site-id diff --git a/docs/examples/sites/list-specifications.md b/docs/examples/sites/list-specifications.md index dc1a16c..e8f1a87 100644 --- a/docs/examples/sites/list-specifications.md +++ b/docs/examples/sites/list-specifications.md @@ -1 +1 @@ -appwrite sites listSpecifications +appwrite sites list-specifications diff --git a/docs/examples/sites/list-templates.md b/docs/examples/sites/list-templates.md index 9d93913..bde094f 100644 --- a/docs/examples/sites/list-templates.md +++ b/docs/examples/sites/list-templates.md @@ -1,5 +1 @@ -appwrite sites listTemplates \ - - - - +appwrite sites list-templates diff --git a/docs/examples/sites/list-usage.md b/docs/examples/sites/list-usage.md index a6f43f6..b5b4171 100644 --- a/docs/examples/sites/list-usage.md +++ b/docs/examples/sites/list-usage.md @@ -1,2 +1 @@ -appwrite sites listUsage \ - +appwrite sites list-usage diff --git a/docs/examples/sites/list-variables.md b/docs/examples/sites/list-variables.md index 13a258b..419fe76 100644 --- a/docs/examples/sites/list-variables.md +++ b/docs/examples/sites/list-variables.md @@ -1,2 +1,2 @@ -appwrite sites listVariables \ - --siteId +appwrite sites list-variables \ + --site-id diff --git a/docs/examples/sites/list.md b/docs/examples/sites/list.md index 0cad70e..9d3b883 100644 --- a/docs/examples/sites/list.md +++ b/docs/examples/sites/list.md @@ -1,3 +1 @@ -appwrite sites list \ - - +appwrite sites list diff --git a/docs/examples/sites/update-deployment-status.md b/docs/examples/sites/update-deployment-status.md index 7923b38..9220265 100644 --- a/docs/examples/sites/update-deployment-status.md +++ b/docs/examples/sites/update-deployment-status.md @@ -1,3 +1,3 @@ -appwrite sites updateDeploymentStatus \ - --siteId \ - --deploymentId +appwrite sites update-deployment-status \ + --site-id \ + --deployment-id diff --git a/docs/examples/sites/update-site-deployment.md b/docs/examples/sites/update-site-deployment.md index de877d8..9db9e11 100644 --- a/docs/examples/sites/update-site-deployment.md +++ b/docs/examples/sites/update-site-deployment.md @@ -1,3 +1,3 @@ -appwrite sites updateSiteDeployment \ - --siteId \ - --deploymentId +appwrite sites update-site-deployment \ + --site-id \ + --deployment-id diff --git a/docs/examples/sites/update-variable.md b/docs/examples/sites/update-variable.md index e968771..e7df76a 100644 --- a/docs/examples/sites/update-variable.md +++ b/docs/examples/sites/update-variable.md @@ -1,6 +1,4 @@ -appwrite sites updateVariable \ - --siteId \ - --variableId \ - --key \ - - +appwrite sites update-variable \ + --site-id \ + --variable-id \ + --key diff --git a/docs/examples/sites/update.md b/docs/examples/sites/update.md index 192ee26..6fab0af 100644 --- a/docs/examples/sites/update.md +++ b/docs/examples/sites/update.md @@ -1,19 +1,4 @@ appwrite sites update \ - --siteId \ - --name \ - --framework analog \ - - - - - - - - - - - - - - - + --site-id \ + --name \ + --framework analog diff --git a/docs/examples/storage/create-bucket.md b/docs/examples/storage/create-bucket.md index 878c10d..2e26dc7 100644 --- a/docs/examples/storage/create-bucket.md +++ b/docs/examples/storage/create-bucket.md @@ -1,11 +1,3 @@ -appwrite storage createBucket \ - --bucketId \ - --name \ - - - - - - - - +appwrite storage create-bucket \ + --bucket-id \ + --name diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index 67bd4da..82b4d0a 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -1,5 +1,4 @@ -appwrite storage createFile \ - --bucketId \ - --fileId \ - --file 'path/to/file.png' \ - +appwrite storage create-file \ + --bucket-id \ + --file-id \ + --file 'path/to/file.png' diff --git a/docs/examples/storage/delete-bucket.md b/docs/examples/storage/delete-bucket.md index e51797e..33e520c 100644 --- a/docs/examples/storage/delete-bucket.md +++ b/docs/examples/storage/delete-bucket.md @@ -1,2 +1,2 @@ -appwrite storage deleteBucket \ - --bucketId +appwrite storage delete-bucket \ + --bucket-id diff --git a/docs/examples/storage/delete-file.md b/docs/examples/storage/delete-file.md index 79c03e8..a3006c2 100644 --- a/docs/examples/storage/delete-file.md +++ b/docs/examples/storage/delete-file.md @@ -1,3 +1,3 @@ -appwrite storage deleteFile \ - --bucketId \ - --fileId +appwrite storage delete-file \ + --bucket-id \ + --file-id diff --git a/docs/examples/storage/get-bucket-usage.md b/docs/examples/storage/get-bucket-usage.md index df3659c..794b0ec 100644 --- a/docs/examples/storage/get-bucket-usage.md +++ b/docs/examples/storage/get-bucket-usage.md @@ -1,3 +1,2 @@ -appwrite storage getBucketUsage \ - --bucketId \ - +appwrite storage get-bucket-usage \ + --bucket-id diff --git a/docs/examples/storage/get-bucket.md b/docs/examples/storage/get-bucket.md index cf8725b..6404281 100644 --- a/docs/examples/storage/get-bucket.md +++ b/docs/examples/storage/get-bucket.md @@ -1,2 +1,2 @@ -appwrite storage getBucket \ - --bucketId +appwrite storage get-bucket \ + --bucket-id diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md index 79f3368..12a74ea 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -1,4 +1,3 @@ -appwrite storage getFileDownload \ - --bucketId \ - --fileId \ - +appwrite storage get-file-download \ + --bucket-id \ + --file-id diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index de437af..82f180e 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -1,15 +1,3 @@ -appwrite storage getFilePreview \ - --bucketId \ - --fileId \ - - - - - - - - - - - - +appwrite storage get-file-preview \ + --bucket-id \ + --file-id diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md index 689cf12..5ce6526 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -1,4 +1,3 @@ -appwrite storage getFileView \ - --bucketId \ - --fileId \ - +appwrite storage get-file-view \ + --bucket-id \ + --file-id diff --git a/docs/examples/storage/get-file.md b/docs/examples/storage/get-file.md index 641c20d..8c139e6 100644 --- a/docs/examples/storage/get-file.md +++ b/docs/examples/storage/get-file.md @@ -1,3 +1,3 @@ -appwrite storage getFile \ - --bucketId \ - --fileId +appwrite storage get-file \ + --bucket-id \ + --file-id diff --git a/docs/examples/storage/get-usage.md b/docs/examples/storage/get-usage.md index 29466e0..1d69ffd 100644 --- a/docs/examples/storage/get-usage.md +++ b/docs/examples/storage/get-usage.md @@ -1,2 +1 @@ -appwrite storage getUsage \ - +appwrite storage get-usage diff --git a/docs/examples/storage/list-buckets.md b/docs/examples/storage/list-buckets.md index a5cad19..1bffd0e 100644 --- a/docs/examples/storage/list-buckets.md +++ b/docs/examples/storage/list-buckets.md @@ -1,3 +1 @@ -appwrite storage listBuckets \ - - +appwrite storage list-buckets diff --git a/docs/examples/storage/list-files.md b/docs/examples/storage/list-files.md index 0e1c2f0..29dc20d 100644 --- a/docs/examples/storage/list-files.md +++ b/docs/examples/storage/list-files.md @@ -1,4 +1,2 @@ -appwrite storage listFiles \ - --bucketId \ - - +appwrite storage list-files \ + --bucket-id diff --git a/docs/examples/storage/update-bucket.md b/docs/examples/storage/update-bucket.md index b006a7b..12282f3 100644 --- a/docs/examples/storage/update-bucket.md +++ b/docs/examples/storage/update-bucket.md @@ -1,11 +1,3 @@ -appwrite storage updateBucket \ - --bucketId \ - --name \ - - - - - - - - +appwrite storage update-bucket \ + --bucket-id \ + --name diff --git a/docs/examples/storage/update-file.md b/docs/examples/storage/update-file.md index 593ea65..86a3f3d 100644 --- a/docs/examples/storage/update-file.md +++ b/docs/examples/storage/update-file.md @@ -1,5 +1,3 @@ -appwrite storage updateFile \ - --bucketId \ - --fileId \ - - +appwrite storage update-file \ + --bucket-id \ + --file-id diff --git a/docs/examples/tablesdb/create-boolean-column.md b/docs/examples/tablesdb/create-boolean-column.md new file mode 100644 index 0000000..b191215 --- /dev/null +++ b/docs/examples/tablesdb/create-boolean-column.md @@ -0,0 +1,5 @@ +appwrite tables-db create-boolean-column \ + --database-id \ + --table-id \ + --key '' \ + --required false diff --git a/docs/examples/tablesdb/create-datetime-column.md b/docs/examples/tablesdb/create-datetime-column.md new file mode 100644 index 0000000..7ccaf9e --- /dev/null +++ b/docs/examples/tablesdb/create-datetime-column.md @@ -0,0 +1,5 @@ +appwrite tables-db create-datetime-column \ + --database-id \ + --table-id \ + --key '' \ + --required false diff --git a/docs/examples/tablesdb/create-email-column.md b/docs/examples/tablesdb/create-email-column.md new file mode 100644 index 0000000..54f32b9 --- /dev/null +++ b/docs/examples/tablesdb/create-email-column.md @@ -0,0 +1,5 @@ +appwrite tables-db create-email-column \ + --database-id \ + --table-id \ + --key '' \ + --required false diff --git a/docs/examples/tablesdb/create-enum-column.md b/docs/examples/tablesdb/create-enum-column.md new file mode 100644 index 0000000..4f3e9ce --- /dev/null +++ b/docs/examples/tablesdb/create-enum-column.md @@ -0,0 +1,6 @@ +appwrite tables-db create-enum-column \ + --database-id \ + --table-id \ + --key '' \ + --elements one two three \ + --required false diff --git a/docs/examples/tablesdb/create-float-column.md b/docs/examples/tablesdb/create-float-column.md new file mode 100644 index 0000000..a365cef --- /dev/null +++ b/docs/examples/tablesdb/create-float-column.md @@ -0,0 +1,5 @@ +appwrite tables-db create-float-column \ + --database-id \ + --table-id \ + --key '' \ + --required false diff --git a/docs/examples/tablesdb/create-index.md b/docs/examples/tablesdb/create-index.md new file mode 100644 index 0000000..7100907 --- /dev/null +++ b/docs/examples/tablesdb/create-index.md @@ -0,0 +1,6 @@ +appwrite tables-db create-index \ + --database-id \ + --table-id \ + --key '' \ + --type key \ + --columns one two three diff --git a/docs/examples/tablesdb/create-integer-column.md b/docs/examples/tablesdb/create-integer-column.md new file mode 100644 index 0000000..2dc799b --- /dev/null +++ b/docs/examples/tablesdb/create-integer-column.md @@ -0,0 +1,5 @@ +appwrite tables-db create-integer-column \ + --database-id \ + --table-id \ + --key '' \ + --required false diff --git a/docs/examples/tablesdb/create-ip-column.md b/docs/examples/tablesdb/create-ip-column.md new file mode 100644 index 0000000..2b46013 --- /dev/null +++ b/docs/examples/tablesdb/create-ip-column.md @@ -0,0 +1,5 @@ +appwrite tables-db create-ip-column \ + --database-id \ + --table-id \ + --key '' \ + --required false diff --git a/docs/examples/tablesdb/create-relationship-column.md b/docs/examples/tablesdb/create-relationship-column.md new file mode 100644 index 0000000..d7d58b6 --- /dev/null +++ b/docs/examples/tablesdb/create-relationship-column.md @@ -0,0 +1,5 @@ +appwrite tables-db create-relationship-column \ + --database-id \ + --table-id \ + --related-table-id \ + --type oneToOne diff --git a/docs/examples/tablesdb/create-row.md b/docs/examples/tablesdb/create-row.md new file mode 100644 index 0000000..d15c5ec --- /dev/null +++ b/docs/examples/tablesdb/create-row.md @@ -0,0 +1,5 @@ +appwrite tables-db create-row \ + --database-id \ + --table-id \ + --row-id \ + --data '{ "key": "value" }' diff --git a/docs/examples/tablesdb/create-rows.md b/docs/examples/tablesdb/create-rows.md new file mode 100644 index 0000000..39eb349 --- /dev/null +++ b/docs/examples/tablesdb/create-rows.md @@ -0,0 +1,4 @@ +appwrite tables-db create-rows \ + --database-id \ + --table-id \ + --rows one two three diff --git a/docs/examples/tablesdb/create-string-column.md b/docs/examples/tablesdb/create-string-column.md new file mode 100644 index 0000000..a394ff5 --- /dev/null +++ b/docs/examples/tablesdb/create-string-column.md @@ -0,0 +1,6 @@ +appwrite tables-db create-string-column \ + --database-id \ + --table-id \ + --key '' \ + --size 1 \ + --required false diff --git a/docs/examples/tablesdb/create-table.md b/docs/examples/tablesdb/create-table.md new file mode 100644 index 0000000..1c5a22d --- /dev/null +++ b/docs/examples/tablesdb/create-table.md @@ -0,0 +1,4 @@ +appwrite tables-db create-table \ + --database-id \ + --table-id \ + --name diff --git a/docs/examples/tablesdb/create-url-column.md b/docs/examples/tablesdb/create-url-column.md new file mode 100644 index 0000000..d9b9f2b --- /dev/null +++ b/docs/examples/tablesdb/create-url-column.md @@ -0,0 +1,5 @@ +appwrite tables-db create-url-column \ + --database-id \ + --table-id \ + --key '' \ + --required false diff --git a/docs/examples/tablesdb/create.md b/docs/examples/tablesdb/create.md new file mode 100644 index 0000000..d10c5d6 --- /dev/null +++ b/docs/examples/tablesdb/create.md @@ -0,0 +1,3 @@ +appwrite tables-db create \ + --database-id \ + --name diff --git a/docs/examples/tablesdb/decrement-row-column.md b/docs/examples/tablesdb/decrement-row-column.md new file mode 100644 index 0000000..79e0a51 --- /dev/null +++ b/docs/examples/tablesdb/decrement-row-column.md @@ -0,0 +1,5 @@ +appwrite tables-db decrement-row-column \ + --database-id \ + --table-id \ + --row-id \ + --column '' diff --git a/docs/examples/tablesdb/delete-column.md b/docs/examples/tablesdb/delete-column.md new file mode 100644 index 0000000..4689290 --- /dev/null +++ b/docs/examples/tablesdb/delete-column.md @@ -0,0 +1,4 @@ +appwrite tables-db delete-column \ + --database-id \ + --table-id \ + --key '' diff --git a/docs/examples/tablesdb/delete-index.md b/docs/examples/tablesdb/delete-index.md new file mode 100644 index 0000000..0729f87 --- /dev/null +++ b/docs/examples/tablesdb/delete-index.md @@ -0,0 +1,4 @@ +appwrite tables-db delete-index \ + --database-id \ + --table-id \ + --key '' diff --git a/docs/examples/tablesdb/delete-row.md b/docs/examples/tablesdb/delete-row.md new file mode 100644 index 0000000..03b3562 --- /dev/null +++ b/docs/examples/tablesdb/delete-row.md @@ -0,0 +1,4 @@ +appwrite tables-db delete-row \ + --database-id \ + --table-id \ + --row-id diff --git a/docs/examples/tablesdb/delete-rows.md b/docs/examples/tablesdb/delete-rows.md new file mode 100644 index 0000000..92cd143 --- /dev/null +++ b/docs/examples/tablesdb/delete-rows.md @@ -0,0 +1,3 @@ +appwrite tables-db delete-rows \ + --database-id \ + --table-id diff --git a/docs/examples/tablesdb/delete-table.md b/docs/examples/tablesdb/delete-table.md new file mode 100644 index 0000000..6ec9df4 --- /dev/null +++ b/docs/examples/tablesdb/delete-table.md @@ -0,0 +1,3 @@ +appwrite tables-db delete-table \ + --database-id \ + --table-id diff --git a/docs/examples/tablesdb/delete.md b/docs/examples/tablesdb/delete.md new file mode 100644 index 0000000..52bf4cd --- /dev/null +++ b/docs/examples/tablesdb/delete.md @@ -0,0 +1,2 @@ +appwrite tables-db delete \ + --database-id diff --git a/docs/examples/tablesdb/get-column.md b/docs/examples/tablesdb/get-column.md new file mode 100644 index 0000000..d209c45 --- /dev/null +++ b/docs/examples/tablesdb/get-column.md @@ -0,0 +1,4 @@ +appwrite tables-db get-column \ + --database-id \ + --table-id \ + --key '' diff --git a/docs/examples/tablesdb/get-index.md b/docs/examples/tablesdb/get-index.md new file mode 100644 index 0000000..2035e78 --- /dev/null +++ b/docs/examples/tablesdb/get-index.md @@ -0,0 +1,4 @@ +appwrite tables-db get-index \ + --database-id \ + --table-id \ + --key '' diff --git a/docs/examples/tablesdb/get-row.md b/docs/examples/tablesdb/get-row.md new file mode 100644 index 0000000..c8d06ea --- /dev/null +++ b/docs/examples/tablesdb/get-row.md @@ -0,0 +1,4 @@ +appwrite tables-db get-row \ + --database-id \ + --table-id \ + --row-id diff --git a/docs/examples/tablesdb/get-table-usage.md b/docs/examples/tablesdb/get-table-usage.md new file mode 100644 index 0000000..0e7782f --- /dev/null +++ b/docs/examples/tablesdb/get-table-usage.md @@ -0,0 +1,3 @@ +appwrite tables-db get-table-usage \ + --database-id \ + --table-id diff --git a/docs/examples/tablesdb/get-table.md b/docs/examples/tablesdb/get-table.md new file mode 100644 index 0000000..9e5e038 --- /dev/null +++ b/docs/examples/tablesdb/get-table.md @@ -0,0 +1,3 @@ +appwrite tables-db get-table \ + --database-id \ + --table-id diff --git a/docs/examples/tablesdb/get-usage.md b/docs/examples/tablesdb/get-usage.md new file mode 100644 index 0000000..ff421ce --- /dev/null +++ b/docs/examples/tablesdb/get-usage.md @@ -0,0 +1,2 @@ +appwrite tables-db get-usage \ + --database-id diff --git a/docs/examples/tablesdb/get.md b/docs/examples/tablesdb/get.md new file mode 100644 index 0000000..1b125ec --- /dev/null +++ b/docs/examples/tablesdb/get.md @@ -0,0 +1,2 @@ +appwrite tables-db get \ + --database-id diff --git a/docs/examples/tablesdb/increment-row-column.md b/docs/examples/tablesdb/increment-row-column.md new file mode 100644 index 0000000..a15ab69 --- /dev/null +++ b/docs/examples/tablesdb/increment-row-column.md @@ -0,0 +1,5 @@ +appwrite tables-db increment-row-column \ + --database-id \ + --table-id \ + --row-id \ + --column '' diff --git a/docs/examples/tablesdb/list-columns.md b/docs/examples/tablesdb/list-columns.md new file mode 100644 index 0000000..4c233d5 --- /dev/null +++ b/docs/examples/tablesdb/list-columns.md @@ -0,0 +1,3 @@ +appwrite tables-db list-columns \ + --database-id \ + --table-id diff --git a/docs/examples/tablesdb/list-indexes.md b/docs/examples/tablesdb/list-indexes.md new file mode 100644 index 0000000..4139175 --- /dev/null +++ b/docs/examples/tablesdb/list-indexes.md @@ -0,0 +1,3 @@ +appwrite tables-db list-indexes \ + --database-id \ + --table-id diff --git a/docs/examples/tablesdb/list-row-logs.md b/docs/examples/tablesdb/list-row-logs.md new file mode 100644 index 0000000..dfa2f98 --- /dev/null +++ b/docs/examples/tablesdb/list-row-logs.md @@ -0,0 +1,4 @@ +appwrite tables-db list-row-logs \ + --database-id \ + --table-id \ + --row-id diff --git a/docs/examples/tablesdb/list-rows.md b/docs/examples/tablesdb/list-rows.md new file mode 100644 index 0000000..904350e --- /dev/null +++ b/docs/examples/tablesdb/list-rows.md @@ -0,0 +1,3 @@ +appwrite tables-db list-rows \ + --database-id \ + --table-id diff --git a/docs/examples/tablesdb/list-table-logs.md b/docs/examples/tablesdb/list-table-logs.md new file mode 100644 index 0000000..a803bf4 --- /dev/null +++ b/docs/examples/tablesdb/list-table-logs.md @@ -0,0 +1,3 @@ +appwrite tables-db list-table-logs \ + --database-id \ + --table-id diff --git a/docs/examples/tablesdb/list-tables.md b/docs/examples/tablesdb/list-tables.md new file mode 100644 index 0000000..f7e7930 --- /dev/null +++ b/docs/examples/tablesdb/list-tables.md @@ -0,0 +1,2 @@ +appwrite tables-db list-tables \ + --database-id diff --git a/docs/examples/tablesdb/list-usage.md b/docs/examples/tablesdb/list-usage.md new file mode 100644 index 0000000..9e6b980 --- /dev/null +++ b/docs/examples/tablesdb/list-usage.md @@ -0,0 +1 @@ +appwrite tables-db list-usage diff --git a/docs/examples/tablesdb/list.md b/docs/examples/tablesdb/list.md new file mode 100644 index 0000000..22d7e01 --- /dev/null +++ b/docs/examples/tablesdb/list.md @@ -0,0 +1 @@ +appwrite tables-db list diff --git a/docs/examples/tablesdb/update-boolean-column.md b/docs/examples/tablesdb/update-boolean-column.md new file mode 100644 index 0000000..318ddac --- /dev/null +++ b/docs/examples/tablesdb/update-boolean-column.md @@ -0,0 +1,6 @@ +appwrite tables-db update-boolean-column \ + --database-id \ + --table-id \ + --key '' \ + --required false \ + --default false diff --git a/docs/examples/tablesdb/update-datetime-column.md b/docs/examples/tablesdb/update-datetime-column.md new file mode 100644 index 0000000..b40a825 --- /dev/null +++ b/docs/examples/tablesdb/update-datetime-column.md @@ -0,0 +1,6 @@ +appwrite tables-db update-datetime-column \ + --database-id \ + --table-id \ + --key '' \ + --required false \ + --default '' diff --git a/docs/examples/tablesdb/update-email-column.md b/docs/examples/tablesdb/update-email-column.md new file mode 100644 index 0000000..cd8104b --- /dev/null +++ b/docs/examples/tablesdb/update-email-column.md @@ -0,0 +1,6 @@ +appwrite tables-db update-email-column \ + --database-id \ + --table-id \ + --key '' \ + --required false \ + --default email@example.com diff --git a/docs/examples/tablesdb/update-enum-column.md b/docs/examples/tablesdb/update-enum-column.md new file mode 100644 index 0000000..66bc3e2 --- /dev/null +++ b/docs/examples/tablesdb/update-enum-column.md @@ -0,0 +1,7 @@ +appwrite tables-db update-enum-column \ + --database-id \ + --table-id \ + --key '' \ + --elements one two three \ + --required false \ + --default diff --git a/docs/examples/tablesdb/update-float-column.md b/docs/examples/tablesdb/update-float-column.md new file mode 100644 index 0000000..a3c6e6b --- /dev/null +++ b/docs/examples/tablesdb/update-float-column.md @@ -0,0 +1,6 @@ +appwrite tables-db update-float-column \ + --database-id \ + --table-id \ + --key '' \ + --required false \ + --default null diff --git a/docs/examples/tablesdb/update-integer-column.md b/docs/examples/tablesdb/update-integer-column.md new file mode 100644 index 0000000..f651c5c --- /dev/null +++ b/docs/examples/tablesdb/update-integer-column.md @@ -0,0 +1,6 @@ +appwrite tables-db update-integer-column \ + --database-id \ + --table-id \ + --key '' \ + --required false \ + --default null diff --git a/docs/examples/tablesdb/update-ip-column.md b/docs/examples/tablesdb/update-ip-column.md new file mode 100644 index 0000000..9a1425c --- /dev/null +++ b/docs/examples/tablesdb/update-ip-column.md @@ -0,0 +1,6 @@ +appwrite tables-db update-ip-column \ + --database-id \ + --table-id \ + --key '' \ + --required false \ + --default '' diff --git a/docs/examples/tablesdb/update-relationship-column.md b/docs/examples/tablesdb/update-relationship-column.md new file mode 100644 index 0000000..fb358a3 --- /dev/null +++ b/docs/examples/tablesdb/update-relationship-column.md @@ -0,0 +1,4 @@ +appwrite tables-db update-relationship-column \ + --database-id \ + --table-id \ + --key '' diff --git a/docs/examples/tablesdb/update-row.md b/docs/examples/tablesdb/update-row.md new file mode 100644 index 0000000..31d8866 --- /dev/null +++ b/docs/examples/tablesdb/update-row.md @@ -0,0 +1,4 @@ +appwrite tables-db update-row \ + --database-id \ + --table-id \ + --row-id diff --git a/docs/examples/tablesdb/update-rows.md b/docs/examples/tablesdb/update-rows.md new file mode 100644 index 0000000..eca741f --- /dev/null +++ b/docs/examples/tablesdb/update-rows.md @@ -0,0 +1,3 @@ +appwrite tables-db update-rows \ + --database-id \ + --table-id diff --git a/docs/examples/tablesdb/update-string-column.md b/docs/examples/tablesdb/update-string-column.md new file mode 100644 index 0000000..fadb277 --- /dev/null +++ b/docs/examples/tablesdb/update-string-column.md @@ -0,0 +1,6 @@ +appwrite tables-db update-string-column \ + --database-id \ + --table-id \ + --key '' \ + --required false \ + --default diff --git a/docs/examples/tablesdb/update-table.md b/docs/examples/tablesdb/update-table.md new file mode 100644 index 0000000..92884df --- /dev/null +++ b/docs/examples/tablesdb/update-table.md @@ -0,0 +1,4 @@ +appwrite tables-db update-table \ + --database-id \ + --table-id \ + --name diff --git a/docs/examples/tablesdb/update-url-column.md b/docs/examples/tablesdb/update-url-column.md new file mode 100644 index 0000000..e1bbdbb --- /dev/null +++ b/docs/examples/tablesdb/update-url-column.md @@ -0,0 +1,6 @@ +appwrite tables-db update-url-column \ + --database-id \ + --table-id \ + --key '' \ + --required false \ + --default https://example.com diff --git a/docs/examples/tablesdb/update.md b/docs/examples/tablesdb/update.md new file mode 100644 index 0000000..b8dbec1 --- /dev/null +++ b/docs/examples/tablesdb/update.md @@ -0,0 +1,3 @@ +appwrite tables-db update \ + --database-id \ + --name diff --git a/docs/examples/tablesdb/upsert-row.md b/docs/examples/tablesdb/upsert-row.md new file mode 100644 index 0000000..32c9fd6 --- /dev/null +++ b/docs/examples/tablesdb/upsert-row.md @@ -0,0 +1,4 @@ +appwrite tables-db upsert-row \ + --database-id \ + --table-id \ + --row-id diff --git a/docs/examples/tablesdb/upsert-rows.md b/docs/examples/tablesdb/upsert-rows.md new file mode 100644 index 0000000..85e0bc0 --- /dev/null +++ b/docs/examples/tablesdb/upsert-rows.md @@ -0,0 +1,4 @@ +appwrite tables-db upsert-rows \ + --database-id \ + --table-id \ + --rows one two three diff --git a/docs/examples/teams/create-membership.md b/docs/examples/teams/create-membership.md index 0d0fc8d..6e9d50a 100644 --- a/docs/examples/teams/create-membership.md +++ b/docs/examples/teams/create-membership.md @@ -1,8 +1,3 @@ -appwrite teams createMembership \ - --teamId \ - --roles one two three \ - - - - - +appwrite teams create-membership \ + --team-id \ + --roles one two three diff --git a/docs/examples/teams/create.md b/docs/examples/teams/create.md index e0f9a12..fb8bc3a 100644 --- a/docs/examples/teams/create.md +++ b/docs/examples/teams/create.md @@ -1,4 +1,3 @@ appwrite teams create \ - --teamId \ - --name \ - + --team-id \ + --name diff --git a/docs/examples/teams/delete-membership.md b/docs/examples/teams/delete-membership.md index 58d0adb..c9f1596 100644 --- a/docs/examples/teams/delete-membership.md +++ b/docs/examples/teams/delete-membership.md @@ -1,3 +1,3 @@ -appwrite teams deleteMembership \ - --teamId \ - --membershipId +appwrite teams delete-membership \ + --team-id \ + --membership-id diff --git a/docs/examples/teams/delete.md b/docs/examples/teams/delete.md index 5b01815..04d5e4e 100644 --- a/docs/examples/teams/delete.md +++ b/docs/examples/teams/delete.md @@ -1,2 +1,2 @@ appwrite teams delete \ - --teamId + --team-id diff --git a/docs/examples/teams/get-membership.md b/docs/examples/teams/get-membership.md index 5e6af4c..a832b23 100644 --- a/docs/examples/teams/get-membership.md +++ b/docs/examples/teams/get-membership.md @@ -1,3 +1,3 @@ -appwrite teams getMembership \ - --teamId \ - --membershipId +appwrite teams get-membership \ + --team-id \ + --membership-id diff --git a/docs/examples/teams/get-prefs.md b/docs/examples/teams/get-prefs.md index 2ab1f1d..a2d456a 100644 --- a/docs/examples/teams/get-prefs.md +++ b/docs/examples/teams/get-prefs.md @@ -1,2 +1,2 @@ -appwrite teams getPrefs \ - --teamId +appwrite teams get-prefs \ + --team-id diff --git a/docs/examples/teams/get.md b/docs/examples/teams/get.md index c8e75b7..94f80a9 100644 --- a/docs/examples/teams/get.md +++ b/docs/examples/teams/get.md @@ -1,2 +1,2 @@ appwrite teams get \ - --teamId + --team-id diff --git a/docs/examples/teams/list-logs.md b/docs/examples/teams/list-logs.md index 6614935..cbdf32a 100644 --- a/docs/examples/teams/list-logs.md +++ b/docs/examples/teams/list-logs.md @@ -1,3 +1,2 @@ -appwrite teams listLogs \ - --teamId \ - +appwrite teams list-logs \ + --team-id diff --git a/docs/examples/teams/list-memberships.md b/docs/examples/teams/list-memberships.md index 050ea96..6a1cbca 100644 --- a/docs/examples/teams/list-memberships.md +++ b/docs/examples/teams/list-memberships.md @@ -1,4 +1,2 @@ -appwrite teams listMemberships \ - --teamId \ - - +appwrite teams list-memberships \ + --team-id diff --git a/docs/examples/teams/list.md b/docs/examples/teams/list.md index dfffc4d..90ab82f 100644 --- a/docs/examples/teams/list.md +++ b/docs/examples/teams/list.md @@ -1,3 +1 @@ -appwrite teams list \ - - +appwrite teams list diff --git a/docs/examples/teams/update-membership-status.md b/docs/examples/teams/update-membership-status.md index aa4acf9..9c234f5 100644 --- a/docs/examples/teams/update-membership-status.md +++ b/docs/examples/teams/update-membership-status.md @@ -1,5 +1,5 @@ -appwrite teams updateMembershipStatus \ - --teamId \ - --membershipId \ - --userId \ - --secret +appwrite teams update-membership-status \ + --team-id \ + --membership-id \ + --user-id \ + --secret diff --git a/docs/examples/teams/update-membership.md b/docs/examples/teams/update-membership.md index 6cfda92..f16c776 100644 --- a/docs/examples/teams/update-membership.md +++ b/docs/examples/teams/update-membership.md @@ -1,4 +1,4 @@ -appwrite teams updateMembership \ - --teamId \ - --membershipId \ - --roles one two three +appwrite teams update-membership \ + --team-id \ + --membership-id \ + --roles one two three diff --git a/docs/examples/teams/update-name.md b/docs/examples/teams/update-name.md index 8c73e00..cc803fb 100644 --- a/docs/examples/teams/update-name.md +++ b/docs/examples/teams/update-name.md @@ -1,3 +1,3 @@ -appwrite teams updateName \ - --teamId \ - --name +appwrite teams update-name \ + --team-id \ + --name diff --git a/docs/examples/teams/update-prefs.md b/docs/examples/teams/update-prefs.md index b6fc5a8..a8ce426 100644 --- a/docs/examples/teams/update-prefs.md +++ b/docs/examples/teams/update-prefs.md @@ -1,3 +1,3 @@ -appwrite teams updatePrefs \ - --teamId \ - --prefs '{ "key": "value" }' +appwrite teams update-prefs \ + --team-id \ + --prefs '{ "key": "value" }' diff --git a/docs/examples/tokens/create-file-token.md b/docs/examples/tokens/create-file-token.md index 8de8d7a..3890041 100644 --- a/docs/examples/tokens/create-file-token.md +++ b/docs/examples/tokens/create-file-token.md @@ -1,4 +1,3 @@ -appwrite tokens createFileToken \ - --bucketId \ - --fileId \ - +appwrite tokens create-file-token \ + --bucket-id \ + --file-id diff --git a/docs/examples/tokens/delete.md b/docs/examples/tokens/delete.md index c25ea4a..93c99a9 100644 --- a/docs/examples/tokens/delete.md +++ b/docs/examples/tokens/delete.md @@ -1,2 +1,2 @@ appwrite tokens delete \ - --tokenId + --token-id diff --git a/docs/examples/tokens/get.md b/docs/examples/tokens/get.md index 2c48280..617c112 100644 --- a/docs/examples/tokens/get.md +++ b/docs/examples/tokens/get.md @@ -1,2 +1,2 @@ appwrite tokens get \ - --tokenId + --token-id diff --git a/docs/examples/tokens/list.md b/docs/examples/tokens/list.md index a808e54..95e0df3 100644 --- a/docs/examples/tokens/list.md +++ b/docs/examples/tokens/list.md @@ -1,4 +1,3 @@ appwrite tokens list \ - --bucketId \ - --fileId \ - + --bucket-id \ + --file-id diff --git a/docs/examples/tokens/update.md b/docs/examples/tokens/update.md index 73f2160..ab86424 100644 --- a/docs/examples/tokens/update.md +++ b/docs/examples/tokens/update.md @@ -1,3 +1,2 @@ appwrite tokens update \ - --tokenId \ - + --token-id diff --git a/docs/examples/users/create-argon-2-user.md b/docs/examples/users/create-argon-2-user.md new file mode 100644 index 0000000..fd2a7e4 --- /dev/null +++ b/docs/examples/users/create-argon-2-user.md @@ -0,0 +1,4 @@ +appwrite users create-argon-2-user \ + --user-id \ + --email email@example.com \ + --password password diff --git a/docs/examples/users/create-argon2user.md b/docs/examples/users/create-argon2user.md deleted file mode 100644 index b0c7494..0000000 --- a/docs/examples/users/create-argon2user.md +++ /dev/null @@ -1,5 +0,0 @@ -appwrite users createArgon2User \ - --userId \ - --email email@example.com \ - --password password \ - diff --git a/docs/examples/users/create-bcrypt-user.md b/docs/examples/users/create-bcrypt-user.md index b568672..e05d9e8 100644 --- a/docs/examples/users/create-bcrypt-user.md +++ b/docs/examples/users/create-bcrypt-user.md @@ -1,5 +1,4 @@ -appwrite users createBcryptUser \ - --userId \ - --email email@example.com \ - --password password \ - +appwrite users create-bcrypt-user \ + --user-id \ + --email email@example.com \ + --password password diff --git a/docs/examples/users/create-j-w-t.md b/docs/examples/users/create-j-w-t.md deleted file mode 100644 index 220086b..0000000 --- a/docs/examples/users/create-j-w-t.md +++ /dev/null @@ -1,4 +0,0 @@ -appwrite users createJWT \ - --userId \ - - diff --git a/docs/examples/users/create-jwt.md b/docs/examples/users/create-jwt.md new file mode 100644 index 0000000..508c0f6 --- /dev/null +++ b/docs/examples/users/create-jwt.md @@ -0,0 +1,2 @@ +appwrite users create-jwt \ + --user-id diff --git a/docs/examples/users/create-m-d5user.md b/docs/examples/users/create-m-d5user.md deleted file mode 100644 index ba37a78..0000000 --- a/docs/examples/users/create-m-d5user.md +++ /dev/null @@ -1,5 +0,0 @@ -appwrite users createMD5User \ - --userId \ - --email email@example.com \ - --password password \ - diff --git a/docs/examples/users/create-md-5-user.md b/docs/examples/users/create-md-5-user.md new file mode 100644 index 0000000..f47b949 --- /dev/null +++ b/docs/examples/users/create-md-5-user.md @@ -0,0 +1,4 @@ +appwrite users create-md-5-user \ + --user-id \ + --email email@example.com \ + --password password diff --git a/docs/examples/users/create-mfa-recovery-codes.md b/docs/examples/users/create-mfa-recovery-codes.md index 4dbd98f..c212872 100644 --- a/docs/examples/users/create-mfa-recovery-codes.md +++ b/docs/examples/users/create-mfa-recovery-codes.md @@ -1,2 +1,2 @@ -appwrite users createMfaRecoveryCodes \ - --userId +appwrite users create-mfa-recovery-codes \ + --user-id diff --git a/docs/examples/users/create-p-h-pass-user.md b/docs/examples/users/create-p-h-pass-user.md deleted file mode 100644 index 9dc378d..0000000 --- a/docs/examples/users/create-p-h-pass-user.md +++ /dev/null @@ -1,5 +0,0 @@ -appwrite users createPHPassUser \ - --userId \ - --email email@example.com \ - --password password \ - diff --git a/docs/examples/users/create-ph-pass-user.md b/docs/examples/users/create-ph-pass-user.md new file mode 100644 index 0000000..a404705 --- /dev/null +++ b/docs/examples/users/create-ph-pass-user.md @@ -0,0 +1,4 @@ +appwrite users create-ph-pass-user \ + --user-id \ + --email email@example.com \ + --password password diff --git a/docs/examples/users/create-s-h-a-user.md b/docs/examples/users/create-s-h-a-user.md deleted file mode 100644 index 5748362..0000000 --- a/docs/examples/users/create-s-h-a-user.md +++ /dev/null @@ -1,6 +0,0 @@ -appwrite users createSHAUser \ - --userId \ - --email email@example.com \ - --password password \ - - diff --git a/docs/examples/users/create-scrypt-modified-user.md b/docs/examples/users/create-scrypt-modified-user.md index 25fc60b..df4d651 100644 --- a/docs/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/users/create-scrypt-modified-user.md @@ -1,8 +1,7 @@ -appwrite users createScryptModifiedUser \ - --userId \ - --email email@example.com \ - --password password \ - --passwordSalt \ - --passwordSaltSeparator \ - --passwordSignerKey \ - +appwrite users create-scrypt-modified-user \ + --user-id \ + --email email@example.com \ + --password password \ + --password-salt \ + --password-salt-separator \ + --password-signer-key diff --git a/docs/examples/users/create-scrypt-user.md b/docs/examples/users/create-scrypt-user.md index 3fc56b1..2f911b5 100644 --- a/docs/examples/users/create-scrypt-user.md +++ b/docs/examples/users/create-scrypt-user.md @@ -1,10 +1,9 @@ -appwrite users createScryptUser \ - --userId \ - --email email@example.com \ - --password password \ - --passwordSalt \ - --passwordCpu null \ - --passwordMemory null \ - --passwordParallel null \ - --passwordLength null \ - +appwrite users create-scrypt-user \ + --user-id \ + --email email@example.com \ + --password password \ + --password-salt \ + --password-cpu null \ + --password-memory null \ + --password-parallel null \ + --password-length null diff --git a/docs/examples/users/create-session.md b/docs/examples/users/create-session.md index c8938fa..2644dce 100644 --- a/docs/examples/users/create-session.md +++ b/docs/examples/users/create-session.md @@ -1,2 +1,2 @@ -appwrite users createSession \ - --userId +appwrite users create-session \ + --user-id diff --git a/docs/examples/users/create-sha-user.md b/docs/examples/users/create-sha-user.md new file mode 100644 index 0000000..6965698 --- /dev/null +++ b/docs/examples/users/create-sha-user.md @@ -0,0 +1,4 @@ +appwrite users create-sha-user \ + --user-id \ + --email email@example.com \ + --password password diff --git a/docs/examples/users/create-target.md b/docs/examples/users/create-target.md index 8d9306b..d0775c9 100644 --- a/docs/examples/users/create-target.md +++ b/docs/examples/users/create-target.md @@ -1,7 +1,5 @@ -appwrite users createTarget \ - --userId \ - --targetId \ - --providerType email \ - --identifier \ - - +appwrite users create-target \ + --user-id \ + --target-id \ + --provider-type email \ + --identifier diff --git a/docs/examples/users/create-token.md b/docs/examples/users/create-token.md index 9962e72..30b7812 100644 --- a/docs/examples/users/create-token.md +++ b/docs/examples/users/create-token.md @@ -1,4 +1,2 @@ -appwrite users createToken \ - --userId \ - - +appwrite users create-token \ + --user-id diff --git a/docs/examples/users/create.md b/docs/examples/users/create.md index e828f56..1103eaf 100644 --- a/docs/examples/users/create.md +++ b/docs/examples/users/create.md @@ -1,6 +1,2 @@ appwrite users create \ - --userId \ - - - - + --user-id diff --git a/docs/examples/users/delete-identity.md b/docs/examples/users/delete-identity.md index f3d2d6d..602a7d0 100644 --- a/docs/examples/users/delete-identity.md +++ b/docs/examples/users/delete-identity.md @@ -1,2 +1,2 @@ -appwrite users deleteIdentity \ - --identityId +appwrite users delete-identity \ + --identity-id diff --git a/docs/examples/users/delete-mfa-authenticator.md b/docs/examples/users/delete-mfa-authenticator.md index edc67d0..a0fcc70 100644 --- a/docs/examples/users/delete-mfa-authenticator.md +++ b/docs/examples/users/delete-mfa-authenticator.md @@ -1,3 +1,3 @@ -appwrite users deleteMfaAuthenticator \ - --userId \ - --type totp +appwrite users delete-mfa-authenticator \ + --user-id \ + --type totp diff --git a/docs/examples/users/delete-session.md b/docs/examples/users/delete-session.md index 9f1fbdb..f638b83 100644 --- a/docs/examples/users/delete-session.md +++ b/docs/examples/users/delete-session.md @@ -1,3 +1,3 @@ -appwrite users deleteSession \ - --userId \ - --sessionId +appwrite users delete-session \ + --user-id \ + --session-id diff --git a/docs/examples/users/delete-sessions.md b/docs/examples/users/delete-sessions.md index 4c683d2..eb038cc 100644 --- a/docs/examples/users/delete-sessions.md +++ b/docs/examples/users/delete-sessions.md @@ -1,2 +1,2 @@ -appwrite users deleteSessions \ - --userId +appwrite users delete-sessions \ + --user-id diff --git a/docs/examples/users/delete-target.md b/docs/examples/users/delete-target.md index e978091..e6410dd 100644 --- a/docs/examples/users/delete-target.md +++ b/docs/examples/users/delete-target.md @@ -1,3 +1,3 @@ -appwrite users deleteTarget \ - --userId \ - --targetId +appwrite users delete-target \ + --user-id \ + --target-id diff --git a/docs/examples/users/delete.md b/docs/examples/users/delete.md index 293a5b0..00f8f9c 100644 --- a/docs/examples/users/delete.md +++ b/docs/examples/users/delete.md @@ -1,2 +1,2 @@ appwrite users delete \ - --userId + --user-id diff --git a/docs/examples/users/get-mfa-recovery-codes.md b/docs/examples/users/get-mfa-recovery-codes.md index cefcce6..cbb7582 100644 --- a/docs/examples/users/get-mfa-recovery-codes.md +++ b/docs/examples/users/get-mfa-recovery-codes.md @@ -1,2 +1,2 @@ -appwrite users getMfaRecoveryCodes \ - --userId +appwrite users get-mfa-recovery-codes \ + --user-id diff --git a/docs/examples/users/get-prefs.md b/docs/examples/users/get-prefs.md index 324aa4f..45d01a6 100644 --- a/docs/examples/users/get-prefs.md +++ b/docs/examples/users/get-prefs.md @@ -1,2 +1,2 @@ -appwrite users getPrefs \ - --userId +appwrite users get-prefs \ + --user-id diff --git a/docs/examples/users/get-target.md b/docs/examples/users/get-target.md index b80dbd9..1be3c0e 100644 --- a/docs/examples/users/get-target.md +++ b/docs/examples/users/get-target.md @@ -1,3 +1,3 @@ -appwrite users getTarget \ - --userId \ - --targetId +appwrite users get-target \ + --user-id \ + --target-id diff --git a/docs/examples/users/get-usage.md b/docs/examples/users/get-usage.md index ad7895d..a4d13e7 100644 --- a/docs/examples/users/get-usage.md +++ b/docs/examples/users/get-usage.md @@ -1,2 +1 @@ -appwrite users getUsage \ - +appwrite users get-usage diff --git a/docs/examples/users/get.md b/docs/examples/users/get.md index 47002c5..341844c 100644 --- a/docs/examples/users/get.md +++ b/docs/examples/users/get.md @@ -1,2 +1,2 @@ appwrite users get \ - --userId + --user-id diff --git a/docs/examples/users/list-identities.md b/docs/examples/users/list-identities.md index c6cd6d5..d4fa82f 100644 --- a/docs/examples/users/list-identities.md +++ b/docs/examples/users/list-identities.md @@ -1,3 +1 @@ -appwrite users listIdentities \ - - +appwrite users list-identities diff --git a/docs/examples/users/list-logs.md b/docs/examples/users/list-logs.md index 0b0bc1f..d2b95be 100644 --- a/docs/examples/users/list-logs.md +++ b/docs/examples/users/list-logs.md @@ -1,3 +1,2 @@ -appwrite users listLogs \ - --userId \ - +appwrite users list-logs \ + --user-id diff --git a/docs/examples/users/list-memberships.md b/docs/examples/users/list-memberships.md index 119f446..f027e4a 100644 --- a/docs/examples/users/list-memberships.md +++ b/docs/examples/users/list-memberships.md @@ -1,4 +1,2 @@ -appwrite users listMemberships \ - --userId \ - - +appwrite users list-memberships \ + --user-id diff --git a/docs/examples/users/list-mfa-factors.md b/docs/examples/users/list-mfa-factors.md index e5d111b..d2cadf5 100644 --- a/docs/examples/users/list-mfa-factors.md +++ b/docs/examples/users/list-mfa-factors.md @@ -1,2 +1,2 @@ -appwrite users listMfaFactors \ - --userId +appwrite users list-mfa-factors \ + --user-id diff --git a/docs/examples/users/list-sessions.md b/docs/examples/users/list-sessions.md index cb85d15..761447a 100644 --- a/docs/examples/users/list-sessions.md +++ b/docs/examples/users/list-sessions.md @@ -1,2 +1,2 @@ -appwrite users listSessions \ - --userId +appwrite users list-sessions \ + --user-id diff --git a/docs/examples/users/list-targets.md b/docs/examples/users/list-targets.md index 9b5614b..26330e8 100644 --- a/docs/examples/users/list-targets.md +++ b/docs/examples/users/list-targets.md @@ -1,3 +1,2 @@ -appwrite users listTargets \ - --userId \ - +appwrite users list-targets \ + --user-id diff --git a/docs/examples/users/list.md b/docs/examples/users/list.md index e5fdb9e..94057ad 100644 --- a/docs/examples/users/list.md +++ b/docs/examples/users/list.md @@ -1,3 +1 @@ -appwrite users list \ - - +appwrite users list diff --git a/docs/examples/users/update-email-verification.md b/docs/examples/users/update-email-verification.md index 990436f..9f4788a 100644 --- a/docs/examples/users/update-email-verification.md +++ b/docs/examples/users/update-email-verification.md @@ -1,3 +1,3 @@ -appwrite users updateEmailVerification \ - --userId \ - --emailVerification false +appwrite users update-email-verification \ + --user-id \ + --email-verification false diff --git a/docs/examples/users/update-email.md b/docs/examples/users/update-email.md index cce20e9..f02b79d 100644 --- a/docs/examples/users/update-email.md +++ b/docs/examples/users/update-email.md @@ -1,3 +1,3 @@ -appwrite users updateEmail \ - --userId \ - --email email@example.com +appwrite users update-email \ + --user-id \ + --email email@example.com diff --git a/docs/examples/users/update-labels.md b/docs/examples/users/update-labels.md index ca60c59..5963768 100644 --- a/docs/examples/users/update-labels.md +++ b/docs/examples/users/update-labels.md @@ -1,3 +1,3 @@ -appwrite users updateLabels \ - --userId \ - --labels one two three +appwrite users update-labels \ + --user-id \ + --labels one two three diff --git a/docs/examples/users/update-mfa-recovery-codes.md b/docs/examples/users/update-mfa-recovery-codes.md index 63fb7f2..4f63119 100644 --- a/docs/examples/users/update-mfa-recovery-codes.md +++ b/docs/examples/users/update-mfa-recovery-codes.md @@ -1,2 +1,2 @@ -appwrite users updateMfaRecoveryCodes \ - --userId +appwrite users update-mfa-recovery-codes \ + --user-id diff --git a/docs/examples/users/update-mfa.md b/docs/examples/users/update-mfa.md index 3ccdbd8..1d36d9e 100644 --- a/docs/examples/users/update-mfa.md +++ b/docs/examples/users/update-mfa.md @@ -1,3 +1,3 @@ -appwrite users updateMfa \ - --userId \ - --mfa false +appwrite users update-mfa \ + --user-id \ + --mfa false diff --git a/docs/examples/users/update-name.md b/docs/examples/users/update-name.md index 9bf20eb..2f0d078 100644 --- a/docs/examples/users/update-name.md +++ b/docs/examples/users/update-name.md @@ -1,3 +1,3 @@ -appwrite users updateName \ - --userId \ - --name +appwrite users update-name \ + --user-id \ + --name diff --git a/docs/examples/users/update-password.md b/docs/examples/users/update-password.md index c05197b..ec320c2 100644 --- a/docs/examples/users/update-password.md +++ b/docs/examples/users/update-password.md @@ -1,3 +1,3 @@ -appwrite users updatePassword \ - --userId \ - --password '' +appwrite users update-password \ + --user-id \ + --password '' diff --git a/docs/examples/users/update-phone-verification.md b/docs/examples/users/update-phone-verification.md index b88a282..2cf56b2 100644 --- a/docs/examples/users/update-phone-verification.md +++ b/docs/examples/users/update-phone-verification.md @@ -1,3 +1,3 @@ -appwrite users updatePhoneVerification \ - --userId \ - --phoneVerification false +appwrite users update-phone-verification \ + --user-id \ + --phone-verification false diff --git a/docs/examples/users/update-phone.md b/docs/examples/users/update-phone.md index 118c8e3..d1b7db3 100644 --- a/docs/examples/users/update-phone.md +++ b/docs/examples/users/update-phone.md @@ -1,3 +1,3 @@ -appwrite users updatePhone \ - --userId \ - --number +12065550100 +appwrite users update-phone \ + --user-id \ + --number +12065550100 diff --git a/docs/examples/users/update-prefs.md b/docs/examples/users/update-prefs.md index f3fa995..b4e27cd 100644 --- a/docs/examples/users/update-prefs.md +++ b/docs/examples/users/update-prefs.md @@ -1,3 +1,3 @@ -appwrite users updatePrefs \ - --userId \ - --prefs '{ "key": "value" }' +appwrite users update-prefs \ + --user-id \ + --prefs '{ "key": "value" }' diff --git a/docs/examples/users/update-status.md b/docs/examples/users/update-status.md index b587b70..f7c1bb4 100644 --- a/docs/examples/users/update-status.md +++ b/docs/examples/users/update-status.md @@ -1,3 +1,3 @@ -appwrite users updateStatus \ - --userId \ - --status false +appwrite users update-status \ + --user-id \ + --status false diff --git a/docs/examples/users/update-target.md b/docs/examples/users/update-target.md index d6541a0..1fa4b7a 100644 --- a/docs/examples/users/update-target.md +++ b/docs/examples/users/update-target.md @@ -1,6 +1,3 @@ -appwrite users updateTarget \ - --userId \ - --targetId \ - - - +appwrite users update-target \ + --user-id \ + --target-id diff --git a/docs/examples/vcs/create-repository-detection.md b/docs/examples/vcs/create-repository-detection.md index d12a093..d10eac8 100644 --- a/docs/examples/vcs/create-repository-detection.md +++ b/docs/examples/vcs/create-repository-detection.md @@ -1,5 +1,4 @@ -appwrite vcs createRepositoryDetection \ - --installationId \ - --providerRepositoryId \ - --type runtime \ - +appwrite vcs create-repository-detection \ + --installation-id \ + --provider-repository-id \ + --type runtime diff --git a/docs/examples/vcs/create-repository.md b/docs/examples/vcs/create-repository.md index a4934d5..fa9206c 100644 --- a/docs/examples/vcs/create-repository.md +++ b/docs/examples/vcs/create-repository.md @@ -1,4 +1,4 @@ -appwrite vcs createRepository \ - --installationId \ - --name \ - --private false +appwrite vcs create-repository \ + --installation-id \ + --name \ + --private false diff --git a/docs/examples/vcs/delete-installation.md b/docs/examples/vcs/delete-installation.md index f7d3a92..ae9fd33 100644 --- a/docs/examples/vcs/delete-installation.md +++ b/docs/examples/vcs/delete-installation.md @@ -1,2 +1,2 @@ -appwrite vcs deleteInstallation \ - --installationId +appwrite vcs delete-installation \ + --installation-id diff --git a/docs/examples/vcs/get-installation.md b/docs/examples/vcs/get-installation.md index df51853..e589d60 100644 --- a/docs/examples/vcs/get-installation.md +++ b/docs/examples/vcs/get-installation.md @@ -1,2 +1,2 @@ -appwrite vcs getInstallation \ - --installationId +appwrite vcs get-installation \ + --installation-id diff --git a/docs/examples/vcs/get-repository-contents.md b/docs/examples/vcs/get-repository-contents.md index 3ba8d75..786d220 100644 --- a/docs/examples/vcs/get-repository-contents.md +++ b/docs/examples/vcs/get-repository-contents.md @@ -1,5 +1,3 @@ -appwrite vcs getRepositoryContents \ - --installationId \ - --providerRepositoryId \ - - +appwrite vcs get-repository-contents \ + --installation-id \ + --provider-repository-id diff --git a/docs/examples/vcs/get-repository.md b/docs/examples/vcs/get-repository.md index 9f88e18..10ab555 100644 --- a/docs/examples/vcs/get-repository.md +++ b/docs/examples/vcs/get-repository.md @@ -1,3 +1,3 @@ -appwrite vcs getRepository \ - --installationId \ - --providerRepositoryId +appwrite vcs get-repository \ + --installation-id \ + --provider-repository-id diff --git a/docs/examples/vcs/list-installations.md b/docs/examples/vcs/list-installations.md index a0af28d..92e13bf 100644 --- a/docs/examples/vcs/list-installations.md +++ b/docs/examples/vcs/list-installations.md @@ -1,3 +1 @@ -appwrite vcs listInstallations \ - - +appwrite vcs list-installations diff --git a/docs/examples/vcs/list-repositories.md b/docs/examples/vcs/list-repositories.md index 15c3a64..7a32140 100644 --- a/docs/examples/vcs/list-repositories.md +++ b/docs/examples/vcs/list-repositories.md @@ -1,4 +1,3 @@ -appwrite vcs listRepositories \ - --installationId \ - --type runtime \ - +appwrite vcs list-repositories \ + --installation-id \ + --type runtime diff --git a/docs/examples/vcs/list-repository-branches.md b/docs/examples/vcs/list-repository-branches.md index ea2fbd2..c603673 100644 --- a/docs/examples/vcs/list-repository-branches.md +++ b/docs/examples/vcs/list-repository-branches.md @@ -1,3 +1,3 @@ -appwrite vcs listRepositoryBranches \ - --installationId \ - --providerRepositoryId +appwrite vcs list-repository-branches \ + --installation-id \ + --provider-repository-id diff --git a/docs/examples/vcs/update-external-deployments.md b/docs/examples/vcs/update-external-deployments.md index 417b594..f83891c 100644 --- a/docs/examples/vcs/update-external-deployments.md +++ b/docs/examples/vcs/update-external-deployments.md @@ -1,4 +1,4 @@ -appwrite vcs updateExternalDeployments \ - --installationId \ - --repositoryId \ - --providerPullRequestId +appwrite vcs update-external-deployments \ + --installation-id \ + --repository-id \ + --provider-pull-request-id diff --git a/index.js b/index.js index bac9834..7c717be 100644 --- a/index.js +++ b/index.js @@ -10,6 +10,7 @@ const chalk = require("chalk"); const { version } = require("./package.json"); const { commandDescriptions, cliConfig } = require("./lib/parser"); const { client } = require("./lib/commands/generic"); +const { getLatestVersion, compareVersions } = require("./lib/utils"); const inquirer = require("inquirer"); const { login, logout, whoami, migrate, register } = require("./lib/commands/generic"); const { init } = require("./lib/commands/init"); @@ -17,6 +18,7 @@ const { types } = require("./lib/commands/types"); const { pull } = require("./lib/commands/pull"); const { run } = require("./lib/commands/run"); const { push, deploy } = require("./lib/commands/push"); +const { update } = require("./lib/commands/update"); const { account } = require("./lib/commands/account"); const { avatars } = require("./lib/commands/avatars"); const { console } = require("./lib/commands/console"); @@ -32,6 +34,7 @@ const { projects } = require("./lib/commands/projects"); const { proxy } = require("./lib/commands/proxy"); const { sites } = require("./lib/commands/sites"); const { storage } = require("./lib/commands/storage"); +const { tablesDB } = require("./lib/commands/tables-db"); const { teams } = require("./lib/commands/teams"); const { tokens } = require("./lib/commands/tokens"); const { users } = require("./lib/commands/users"); @@ -39,6 +42,41 @@ const { vcs } = require("./lib/commands/vcs"); inquirer.registerPrompt('search-list', require('inquirer-search-list')); +/** + * Check for updates and show version information + */ +async function checkVersion() { + process.stdout.write(chalk.bold(`appwrite version ${version}`) + '\n'); + + try { + const latestVersion = await getLatestVersion(); + const comparison = compareVersions(version, latestVersion); + + if (comparison > 0) { + // Current version is older than latest + process.stdout.write(chalk.yellow(`\n⚠️ A newer version is available: ${chalk.bold(latestVersion)}`) + '\n'); + process.stdout.write(chalk.cyan(`💡 Run '${chalk.bold('appwrite update')}' to update to the latest version.`) + '\n'); + } else if (comparison === 0) { + process.stdout.write(chalk.green('\n✅ You are running the latest version!') + '\n'); + } else { + // Current version is newer than latest (pre-release/dev) + process.stdout.write(chalk.blue('\n🚀 You are running a pre-release or development version.') + '\n'); + } + } catch (error) { + // Silently fail version check, just show current version + process.stdout.write(chalk.gray('\n(Unable to check for updates)') + '\n'); + } +} + +// Intercept version flag before Commander.js processes it +if (process.argv.includes('-v') || process.argv.includes('--version')) { + (async () => { + await checkVersion(); + process.exit(0); + })(); + return; +} + program .description(commandDescriptions['main']) .configureHelp({ @@ -83,6 +121,7 @@ program .addCommand(types) .addCommand(deploy) .addCommand(run) + .addCommand(update) .addCommand(logout) .addCommand(account) .addCommand(avatars) @@ -99,6 +138,7 @@ program .addCommand(proxy) .addCommand(sites) .addCommand(storage) + .addCommand(tablesdb) .addCommand(teams) .addCommand(tokens) .addCommand(users) diff --git a/install.ps1 b/install.ps1 index 8e49237..d052cbd 100644 --- a/install.ps1 +++ b/install.ps1 @@ -13,8 +13,8 @@ # You can use "View source" of this page to see the full script. # REPO -$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/8.3.0/appwrite-cli-win-x64.exe" -$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/8.3.0/appwrite-cli-win-arm64.exe" +$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/9.0.0/appwrite-cli-win-x64.exe" +$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/9.0.0/appwrite-cli-win-arm64.exe" $APPWRITE_BINARY_NAME = "appwrite.exe" diff --git a/install.sh b/install.sh index e14bc63..1e11ebd 100644 --- a/install.sh +++ b/install.sh @@ -97,7 +97,7 @@ printSuccess() { downloadBinary() { echo "[2/4] Downloading executable for $OS ($ARCH) ..." - GITHUB_LATEST_VERSION="8.3.0" + GITHUB_LATEST_VERSION="9.0.0" GITHUB_FILE="appwrite-cli-${OS}-${ARCH}" GITHUB_URL="https://github.com/$GITHUB_REPOSITORY_NAME/releases/download/$GITHUB_LATEST_VERSION/$GITHUB_FILE" diff --git a/lib/client.js b/lib/client.js index 89c3ccd..8701217 100644 --- a/lib/client.js +++ b/lib/client.js @@ -16,9 +16,9 @@ class Client { 'x-sdk-name': 'Command Line', 'x-sdk-platform': 'console', 'x-sdk-language': 'cli', - 'x-sdk-version': '8.3.0', - 'user-agent' : `AppwriteCLI/8.3.0 (${os.type()} ${os.version()}; ${os.arch()})`, - 'X-Appwrite-Response-Format' : '1.7.0', + 'x-sdk-version': '9.0.0', + 'user-agent' : `AppwriteCLI/9.0.0 (${os.type()} ${os.version()}; ${os.arch()})`, + 'X-Appwrite-Response-Format' : '1.8.0', }; } @@ -186,11 +186,6 @@ class Client { }, }), }); - - const warnings = response.headers.get('x-appwrite-warning'); - if (warnings) { - warnings.split(';').forEach((warning) => console.warn(warning)); - } } catch (error) { throw new AppwriteException(error.message); } diff --git a/lib/commands/account.js b/lib/commands/account.js index 25308c1..ae15e38 100644 --- a/lib/commands/account.js +++ b/lib/commands/account.js @@ -7,7 +7,7 @@ const libClient = require('../client.js'); const { getAllFiles, showConsoleLink } = require('../utils.js'); const { Command } = require('commander'); const { sdkForProject, sdkForConsole } = require('../sdks') -const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log } = require('../parser') +const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log, warn } = require('../parser') const { localConfig, globalConfig } = require("../config"); const { File } = require('undici'); const { ReadableStream } = require('stream/web'); @@ -71,7 +71,6 @@ const accountGet = async ({parseOutput = true, overrideForCli = false, sdk = und return response; } - /** * @typedef {Object} AccountCreateRequestParams * @property {string} 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. @@ -117,7 +116,6 @@ const accountCreate = async ({userId,email,password,name,parseOutput = true, ove return response; } - /** * @typedef {Object} AccountDeleteRequestParams * @property {boolean} overrideForCli @@ -147,7 +145,6 @@ const accountDelete = async ({parseOutput = true, overrideForCli = false, sdk = return response; } - /** * @typedef {Object} AccountUpdateEmailRequestParams * @property {string} email User email. @@ -185,7 +182,6 @@ const accountUpdateEmail = async ({email,password,parseOutput = true, overrideFo return response; } - /** * @typedef {Object} AccountListIdentitiesRequestParams * @property {string[]} 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 @@ -218,7 +214,6 @@ const accountListIdentities = async ({queries,parseOutput = true, overrideForCli return response; } - /** * @typedef {Object} AccountDeleteIdentityRequestParams * @property {string} identityId Identity ID. @@ -249,7 +244,6 @@ const accountDeleteIdentity = async ({identityId,parseOutput = true, overrideFor return response; } - /** * @typedef {Object} AccountCreateJWTRequestParams * @property {boolean} overrideForCli @@ -279,7 +273,6 @@ const accountCreateJWT = async ({parseOutput = true, overrideForCli = false, sdk return response; } - /** * @typedef {Object} AccountListLogsRequestParams * @property {string[]} 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 @@ -312,7 +305,6 @@ const accountListLogs = async ({queries,parseOutput = true, overrideForCli = fal return response; } - /** * @typedef {Object} AccountUpdateMFARequestParams * @property {boolean} mfa Enable or disable MFA. @@ -346,9 +338,8 @@ const accountUpdateMFA = async ({mfa,parseOutput = true, overrideForCli = false, return response; } - /** - * @typedef {Object} AccountCreateMfaAuthenticatorRequestParams + * @typedef {Object} AccountCreateMFAAuthenticatorRequestParams * @property {AuthenticatorType} type Type of authenticator. Must be 'totp' * @property {boolean} overrideForCli * @property {boolean} parseOutput @@ -356,9 +347,9 @@ const accountUpdateMFA = async ({mfa,parseOutput = true, overrideForCli = false, */ /** - * @param {AccountCreateMfaAuthenticatorRequestParams} params + * @param {AccountCreateMFAAuthenticatorRequestParams} params */ -const accountCreateMfaAuthenticator = async ({type,parseOutput = true, overrideForCli = false, sdk = undefined}) => { +const accountCreateMFAAuthenticator = async ({type,parseOutput = true, overrideForCli = false, sdk = undefined}) => { let client = !sdk ? await sdkForProject() : sdk; let apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type); @@ -377,9 +368,8 @@ const accountCreateMfaAuthenticator = async ({type,parseOutput = true, overrideF return response; } - /** - * @typedef {Object} AccountUpdateMfaAuthenticatorRequestParams + * @typedef {Object} AccountUpdateMFAAuthenticatorRequestParams * @property {AuthenticatorType} type Type of authenticator. * @property {string} otp Valid verification token. * @property {boolean} overrideForCli @@ -388,9 +378,9 @@ const accountCreateMfaAuthenticator = async ({type,parseOutput = true, overrideF */ /** - * @param {AccountUpdateMfaAuthenticatorRequestParams} params + * @param {AccountUpdateMFAAuthenticatorRequestParams} params */ -const accountUpdateMfaAuthenticator = async ({type,otp,parseOutput = true, overrideForCli = false, sdk = undefined}) => { +const accountUpdateMFAAuthenticator = async ({type,otp,parseOutput = true, overrideForCli = false, sdk = undefined}) => { let client = !sdk ? await sdkForProject() : sdk; let apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type); @@ -412,9 +402,8 @@ const accountUpdateMfaAuthenticator = async ({type,otp,parseOutput = true, overr return response; } - /** - * @typedef {Object} AccountDeleteMfaAuthenticatorRequestParams + * @typedef {Object} AccountDeleteMFAAuthenticatorRequestParams * @property {AuthenticatorType} type Type of authenticator. * @property {boolean} overrideForCli * @property {boolean} parseOutput @@ -422,9 +411,9 @@ const accountUpdateMfaAuthenticator = async ({type,otp,parseOutput = true, overr */ /** - * @param {AccountDeleteMfaAuthenticatorRequestParams} params + * @param {AccountDeleteMFAAuthenticatorRequestParams} params */ -const accountDeleteMfaAuthenticator = async ({type,parseOutput = true, overrideForCli = false, sdk = undefined}) => { +const accountDeleteMFAAuthenticator = async ({type,parseOutput = true, overrideForCli = false, sdk = undefined}) => { let client = !sdk ? await sdkForProject() : sdk; let apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type); @@ -443,9 +432,8 @@ const accountDeleteMfaAuthenticator = async ({type,parseOutput = true, overrideF return response; } - /** - * @typedef {Object} AccountCreateMfaChallengeRequestParams + * @typedef {Object} AccountCreateMFAChallengeRequestParams * @property {AuthenticationFactor} factor Factor used for verification. Must be one of following: 'email', 'phone', 'totp', 'recoveryCode'. * @property {boolean} overrideForCli * @property {boolean} parseOutput @@ -453,9 +441,9 @@ const accountDeleteMfaAuthenticator = async ({type,parseOutput = true, overrideF */ /** - * @param {AccountCreateMfaChallengeRequestParams} params + * @param {AccountCreateMFAChallengeRequestParams} params */ -const accountCreateMfaChallenge = async ({factor,parseOutput = true, overrideForCli = false, sdk = undefined}) => { +const accountCreateMFAChallenge = async ({factor,parseOutput = true, overrideForCli = false, sdk = undefined}) => { let client = !sdk ? await sdkForProject() : sdk; let apiPath = '/account/mfa/challenge'; @@ -477,9 +465,8 @@ const accountCreateMfaChallenge = async ({factor,parseOutput = true, overrideFor return response; } - /** - * @typedef {Object} AccountUpdateMfaChallengeRequestParams + * @typedef {Object} AccountUpdateMFAChallengeRequestParams * @property {string} challengeId ID of the challenge. * @property {string} otp Valid verification token. * @property {boolean} overrideForCli @@ -488,9 +475,9 @@ const accountCreateMfaChallenge = async ({factor,parseOutput = true, overrideFor */ /** - * @param {AccountUpdateMfaChallengeRequestParams} params + * @param {AccountUpdateMFAChallengeRequestParams} params */ -const accountUpdateMfaChallenge = async ({challengeId,otp,parseOutput = true, overrideForCli = false, sdk = undefined}) => { +const accountUpdateMFAChallenge = async ({challengeId,otp,parseOutput = true, overrideForCli = false, sdk = undefined}) => { let client = !sdk ? await sdkForProject() : sdk; let apiPath = '/account/mfa/challenge'; @@ -515,18 +502,17 @@ const accountUpdateMfaChallenge = async ({challengeId,otp,parseOutput = true, ov return response; } - /** - * @typedef {Object} AccountListMfaFactorsRequestParams + * @typedef {Object} AccountListMFAFactorsRequestParams * @property {boolean} overrideForCli * @property {boolean} parseOutput * @property {libClient | undefined} sdk */ /** - * @param {AccountListMfaFactorsRequestParams} params + * @param {AccountListMFAFactorsRequestParams} params */ -const accountListMfaFactors = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => { +const accountListMFAFactors = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => { let client = !sdk ? await sdkForProject() : sdk; let apiPath = '/account/mfa/factors'; @@ -544,18 +530,17 @@ const accountListMfaFactors = async ({parseOutput = true, overrideForCli = false return response; } - /** - * @typedef {Object} AccountGetMfaRecoveryCodesRequestParams + * @typedef {Object} AccountGetMFARecoveryCodesRequestParams * @property {boolean} overrideForCli * @property {boolean} parseOutput * @property {libClient | undefined} sdk */ /** - * @param {AccountGetMfaRecoveryCodesRequestParams} params + * @param {AccountGetMFARecoveryCodesRequestParams} params */ -const accountGetMfaRecoveryCodes = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => { +const accountGetMFARecoveryCodes = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => { let client = !sdk ? await sdkForProject() : sdk; let apiPath = '/account/mfa/recovery-codes'; @@ -573,18 +558,17 @@ const accountGetMfaRecoveryCodes = async ({parseOutput = true, overrideForCli = return response; } - /** - * @typedef {Object} AccountCreateMfaRecoveryCodesRequestParams + * @typedef {Object} AccountCreateMFARecoveryCodesRequestParams * @property {boolean} overrideForCli * @property {boolean} parseOutput * @property {libClient | undefined} sdk */ /** - * @param {AccountCreateMfaRecoveryCodesRequestParams} params + * @param {AccountCreateMFARecoveryCodesRequestParams} params */ -const accountCreateMfaRecoveryCodes = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => { +const accountCreateMFARecoveryCodes = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => { let client = !sdk ? await sdkForProject() : sdk; let apiPath = '/account/mfa/recovery-codes'; @@ -603,18 +587,17 @@ const accountCreateMfaRecoveryCodes = async ({parseOutput = true, overrideForCli return response; } - /** - * @typedef {Object} AccountUpdateMfaRecoveryCodesRequestParams + * @typedef {Object} AccountUpdateMFARecoveryCodesRequestParams * @property {boolean} overrideForCli * @property {boolean} parseOutput * @property {libClient | undefined} sdk */ /** - * @param {AccountUpdateMfaRecoveryCodesRequestParams} params + * @param {AccountUpdateMFARecoveryCodesRequestParams} params */ -const accountUpdateMfaRecoveryCodes = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => { +const accountUpdateMFARecoveryCodes = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => { let client = !sdk ? await sdkForProject() : sdk; let apiPath = '/account/mfa/recovery-codes'; @@ -633,7 +616,6 @@ const accountUpdateMfaRecoveryCodes = async ({parseOutput = true, overrideForCli return response; } - /** * @typedef {Object} AccountUpdateNameRequestParams * @property {string} name User name. Max length: 128 chars. @@ -667,7 +649,6 @@ const accountUpdateName = async ({name,parseOutput = true, overrideForCli = fals return response; } - /** * @typedef {Object} AccountUpdatePasswordRequestParams * @property {string} password New user password. Must be at least 8 chars. @@ -705,7 +686,6 @@ const accountUpdatePassword = async ({password,oldPassword,parseOutput = true, o return response; } - /** * @typedef {Object} AccountUpdatePhoneRequestParams * @property {string} phone Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. @@ -743,7 +723,6 @@ const accountUpdatePhone = async ({phone,password,parseOutput = true, overrideFo return response; } - /** * @typedef {Object} AccountGetPrefsRequestParams * @property {boolean} overrideForCli @@ -772,7 +751,6 @@ const accountGetPrefs = async ({parseOutput = true, overrideForCli = false, sdk return response; } - /** * @typedef {Object} AccountUpdatePrefsRequestParams * @property {object} prefs Prefs key-value JSON object. @@ -806,7 +784,6 @@ const accountUpdatePrefs = async ({prefs,parseOutput = true, overrideForCli = fa return response; } - /** * @typedef {Object} AccountCreateRecoveryRequestParams * @property {string} email User email. @@ -844,7 +821,6 @@ const accountCreateRecovery = async ({email,url,parseOutput = true, overrideForC return response; } - /** * @typedef {Object} AccountUpdateRecoveryRequestParams * @property {string} userId User ID. @@ -886,7 +862,6 @@ const accountUpdateRecovery = async ({userId,secret,password,parseOutput = true, return response; } - /** * @typedef {Object} AccountListSessionsRequestParams * @property {boolean} overrideForCli @@ -919,7 +894,6 @@ const accountListSessions = async ({parseOutput = true, overrideForCli = false, return response; } - /** * @typedef {Object} AccountDeleteSessionsRequestParams * @property {boolean} overrideForCli @@ -949,7 +923,6 @@ const accountDeleteSessions = async ({parseOutput = true, overrideForCli = false return response; } - /** * @typedef {Object} AccountCreateAnonymousSessionRequestParams * @property {boolean} overrideForCli @@ -979,7 +952,6 @@ const accountCreateAnonymousSession = async ({parseOutput = true, overrideForCli return response; } - /** * @typedef {Object} AccountCreateEmailPasswordSessionRequestParams * @property {string} email User email. @@ -1017,7 +989,6 @@ const accountCreateEmailPasswordSession = async ({email,password,parseOutput = t return response; } - /** * @typedef {Object} AccountUpdateMagicURLSessionRequestParams * @property {string} 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. @@ -1055,7 +1026,6 @@ const accountUpdateMagicURLSession = async ({userId,secret,parseOutput = true, o return response; } - /** * @typedef {Object} AccountCreateOAuth2SessionRequestParams * @property {OAuthProvider} provider OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom. @@ -1097,7 +1067,6 @@ const accountCreateOAuth2Session = async ({provider,success,failure,scopes,parse return response; } - /** * @typedef {Object} AccountUpdatePhoneSessionRequestParams * @property {string} 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. @@ -1135,7 +1104,6 @@ const accountUpdatePhoneSession = async ({userId,secret,parseOutput = true, over return response; } - /** * @typedef {Object} AccountCreateSessionRequestParams * @property {string} 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. @@ -1173,7 +1141,6 @@ const accountCreateSession = async ({userId,secret,parseOutput = true, overrideF return response; } - /** * @typedef {Object} AccountGetSessionRequestParams * @property {string} sessionId Session ID. Use the string 'current' to get the current device session. @@ -1203,7 +1170,6 @@ const accountGetSession = async ({sessionId,parseOutput = true, overrideForCli = return response; } - /** * @typedef {Object} AccountUpdateSessionRequestParams * @property {string} sessionId Session ID. Use the string 'current' to update the current device session. @@ -1234,7 +1200,6 @@ const accountUpdateSession = async ({sessionId,parseOutput = true, overrideForCl return response; } - /** * @typedef {Object} AccountDeleteSessionRequestParams * @property {string} sessionId Session ID. Use the string 'current' to delete the current device session. @@ -1265,7 +1230,6 @@ const accountDeleteSession = async ({sessionId,parseOutput = true, overrideForCl return response; } - /** * @typedef {Object} AccountUpdateStatusRequestParams * @property {boolean} overrideForCli @@ -1295,7 +1259,6 @@ const accountUpdateStatus = async ({parseOutput = true, overrideForCli = false, return response; } - /** * @typedef {Object} AccountCreatePushTargetRequestParams * @property {string} 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. @@ -1337,7 +1300,6 @@ const accountCreatePushTarget = async ({targetId,identifier,providerId,parseOutp return response; } - /** * @typedef {Object} AccountUpdatePushTargetRequestParams * @property {string} targetId Target ID. @@ -1372,7 +1334,6 @@ const accountUpdatePushTarget = async ({targetId,identifier,parseOutput = true, return response; } - /** * @typedef {Object} AccountDeletePushTargetRequestParams * @property {string} targetId Target ID. @@ -1403,10 +1364,9 @@ const accountDeletePushTarget = async ({targetId,parseOutput = true, overrideFor return response; } - /** * @typedef {Object} AccountCreateEmailTokenRequestParams - * @property {string} 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. + * @property {string} 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. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored. * @property {string} email User email. * @property {boolean} 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. * @property {boolean} overrideForCli @@ -1445,10 +1405,9 @@ const accountCreateEmailToken = async ({userId,email,phrase,parseOutput = true, return response; } - /** * @typedef {Object} AccountCreateMagicURLTokenRequestParams - * @property {string} 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. + * @property {string} 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. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored. * @property {string} email User email. * @property {string} 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. * @property {boolean} 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. @@ -1491,7 +1450,6 @@ const accountCreateMagicURLToken = async ({userId,email,url,phrase,parseOutput = return response; } - /** * @typedef {Object} AccountCreateOAuth2TokenRequestParams * @property {OAuthProvider} provider OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom. @@ -1533,10 +1491,9 @@ const accountCreateOAuth2Token = async ({provider,success,failure,scopes,parseOu return response; } - /** * @typedef {Object} AccountCreatePhoneTokenRequestParams - * @property {string} 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. + * @property {string} 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. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored. * @property {string} phone Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. * @property {boolean} overrideForCli * @property {boolean} parseOutput @@ -1571,7 +1528,6 @@ const accountCreatePhoneToken = async ({userId,phone,parseOutput = true, overrid return response; } - /** * @typedef {Object} AccountCreateVerificationRequestParams * @property {string} 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. @@ -1605,7 +1561,6 @@ const accountCreateVerification = async ({url,parseOutput = true, overrideForCli return response; } - /** * @typedef {Object} AccountUpdateVerificationRequestParams * @property {string} userId User ID. @@ -1643,7 +1598,6 @@ const accountUpdateVerification = async ({userId,secret,parseOutput = true, over return response; } - /** * @typedef {Object} AccountCreatePhoneVerificationRequestParams * @property {boolean} overrideForCli @@ -1673,7 +1627,6 @@ const accountCreatePhoneVerification = async ({parseOutput = true, overrideForCl return response; } - /** * @typedef {Object} AccountUpdatePhoneVerificationRequestParams * @property {string} userId User ID. @@ -1711,7 +1664,6 @@ const accountUpdatePhoneVerification = async ({userId,secret,parseOutput = true, return response; } - account .command(`get`) .description(`Get the currently logged in user.`) @@ -1772,53 +1724,53 @@ account .command(`create-mfa-authenticator`) .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.`) .requiredOption(`--type `, `Type of authenticator. Must be 'totp'`) - .action(actionRunner(accountCreateMfaAuthenticator)) + .action(actionRunner(accountCreateMFAAuthenticator)) account .command(`update-mfa-authenticator`) .description(`Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method.`) .requiredOption(`--type `, `Type of authenticator.`) .requiredOption(`--otp `, `Valid verification token.`) - .action(actionRunner(accountUpdateMfaAuthenticator)) + .action(actionRunner(accountUpdateMFAAuthenticator)) account .command(`delete-mfa-authenticator`) .description(`Delete an authenticator for a user by ID.`) .requiredOption(`--type `, `Type of authenticator.`) - .action(actionRunner(accountDeleteMfaAuthenticator)) + .action(actionRunner(accountDeleteMFAAuthenticator)) account .command(`create-mfa-challenge`) .description(`Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method.`) .requiredOption(`--factor `, `Factor used for verification. Must be one of following: 'email', 'phone', 'totp', 'recoveryCode'.`) - .action(actionRunner(accountCreateMfaChallenge)) + .action(actionRunner(accountCreateMFAChallenge)) account .command(`update-mfa-challenge`) .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.`) .requiredOption(`--challenge-id `, `ID of the challenge.`) .requiredOption(`--otp `, `Valid verification token.`) - .action(actionRunner(accountUpdateMfaChallenge)) + .action(actionRunner(accountUpdateMFAChallenge)) account .command(`list-mfa-factors`) .description(`List the factors available on the account to be used as a MFA challange.`) - .action(actionRunner(accountListMfaFactors)) + .action(actionRunner(accountListMFAFactors)) account .command(`get-mfa-recovery-codes`) .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.`) - .action(actionRunner(accountGetMfaRecoveryCodes)) + .action(actionRunner(accountGetMFARecoveryCodes)) account .command(`create-mfa-recovery-codes`) .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.`) - .action(actionRunner(accountCreateMfaRecoveryCodes)) + .action(actionRunner(accountCreateMFARecoveryCodes)) account .command(`update-mfa-recovery-codes`) .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.`) - .action(actionRunner(accountUpdateMfaRecoveryCodes)) + .action(actionRunner(accountUpdateMFARecoveryCodes)) account .command(`update-name`) @@ -1891,7 +1843,7 @@ account account .command(`update-magic-url-session`) - .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.`) + .description(`[**DEPRECATED** - This command is deprecated.] 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.`) .requiredOption(`--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.`) .requiredOption(`--secret `, `Valid verification token.`) .action(actionRunner(accountUpdateMagicURLSession)) @@ -1907,7 +1859,7 @@ account account .command(`update-phone-session`) - .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.`) + .description(`[**DEPRECATED** - This command is deprecated.] 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.`) .requiredOption(`--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.`) .requiredOption(`--secret `, `Valid verification token.`) .action(actionRunner(accountUpdatePhoneSession)) @@ -1965,8 +1917,8 @@ account account .command(`create-email-token`) - .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).`) - .requiredOption(`--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.`) + .description(`Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided 'userId'. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. 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). `) + .requiredOption(`--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. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.`) .requiredOption(`--email `, `User email.`) .option(`--phrase [value]`, `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.`, (value) => value === undefined ? true : parseBool(value)) .action(actionRunner(accountCreateEmailToken)) @@ -1974,7 +1926,7 @@ account account .command(`create-magic-url-token`) .description(`Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). `) - .requiredOption(`--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.`) + .requiredOption(`--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. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.`) .requiredOption(`--email `, `User email.`) .option(`--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.`) .option(`--phrase [value]`, `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.`, (value) => value === undefined ? true : parseBool(value)) @@ -1992,7 +1944,7 @@ account account .command(`create-phone-token`) .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).`) - .requiredOption(`--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.`) + .requiredOption(`--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. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored.`) .requiredOption(`--phone `, `Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`) .action(actionRunner(accountCreatePhoneToken)) @@ -2032,15 +1984,15 @@ module.exports = { accountCreateJWT, accountListLogs, accountUpdateMFA, - accountCreateMfaAuthenticator, - accountUpdateMfaAuthenticator, - accountDeleteMfaAuthenticator, - accountCreateMfaChallenge, - accountUpdateMfaChallenge, - accountListMfaFactors, - accountGetMfaRecoveryCodes, - accountCreateMfaRecoveryCodes, - accountUpdateMfaRecoveryCodes, + accountCreateMFAAuthenticator, + accountUpdateMFAAuthenticator, + accountDeleteMFAAuthenticator, + accountCreateMFAChallenge, + accountUpdateMFAChallenge, + accountListMFAFactors, + accountGetMFARecoveryCodes, + accountCreateMFARecoveryCodes, + accountUpdateMFARecoveryCodes, accountUpdateName, accountUpdatePassword, accountUpdatePhone, diff --git a/lib/commands/avatars.js b/lib/commands/avatars.js index c7abadb..e4818eb 100644 --- a/lib/commands/avatars.js +++ b/lib/commands/avatars.js @@ -7,7 +7,7 @@ const libClient = require('../client.js'); const { getAllFiles, showConsoleLink } = require('../utils.js'); const { Command } = require('commander'); const { sdkForProject, sdkForConsole } = require('../sdks') -const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log } = require('../parser') +const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log, warn } = require('../parser') const { localConfig, globalConfig } = require("../config"); const { File } = require('undici'); const { ReadableStream } = require('stream/web'); @@ -92,7 +92,6 @@ const avatarsGetBrowser = async ({code,width,height,quality,parseOutput = true, return response; } - /** * @typedef {Object} AvatarsGetCreditCardRequestParams * @property {CreditCard} 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, rupay. @@ -146,7 +145,6 @@ const avatarsGetCreditCard = async ({code,width,height,quality,parseOutput = tru return response; } - /** * @typedef {Object} AvatarsGetFaviconRequestParams * @property {string} url Website URL which you want to fetch the favicon from. @@ -191,7 +189,6 @@ const avatarsGetFavicon = async ({url,parseOutput = true, overrideForCli = false return response; } - /** * @typedef {Object} AvatarsGetFlagRequestParams * @property {Flag} code Country Code. ISO Alpha-2 country code format. @@ -245,7 +242,6 @@ const avatarsGetFlag = async ({code,width,height,quality,parseOutput = true, ove return response; } - /** * @typedef {Object} AvatarsGetImageRequestParams * @property {string} url Image URL which you want to crop. @@ -298,7 +294,6 @@ const avatarsGetImage = async ({url,width,height,parseOutput = true, overrideFor return response; } - /** * @typedef {Object} AvatarsGetInitialsRequestParams * @property {string} name Full Name. When empty, current user name or email will be used. Max length: 128 chars. @@ -355,7 +350,6 @@ const avatarsGetInitials = async ({name,width,height,background,parseOutput = tr return response; } - /** * @typedef {Object} AvatarsGetQRRequestParams * @property {string} text Plain text to be converted to QR code image. @@ -412,7 +406,6 @@ const avatarsGetQR = async ({text,size,margin,download,parseOutput = true, overr return response; } - avatars .command(`get-browser`) .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.`) diff --git a/lib/commands/console.js b/lib/commands/console.js index 5b9d210..967d2aa 100644 --- a/lib/commands/console.js +++ b/lib/commands/console.js @@ -7,7 +7,7 @@ const libClient = require('../client.js'); const { getAllFiles, showConsoleLink } = require('../utils.js'); const { Command } = require('commander'); const { sdkForProject, sdkForConsole } = require('../sdks') -const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log } = require('../parser') +const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log, warn } = require('../parser') const { localConfig, globalConfig } = require("../config"); const { File } = require('undici'); const { ReadableStream } = require('stream/web'); @@ -79,7 +79,6 @@ const consoleGetResource = async ({value,type,parseOutput = true, overrideForCli return response; } - /** * @typedef {Object} ConsoleVariablesRequestParams * @property {boolean} overrideForCli @@ -108,7 +107,6 @@ const consoleVariables = async ({parseOutput = true, overrideForCli = false, sdk return response; } - console .command(`get-resource`) .description(`Check if a resource ID is available.`) diff --git a/lib/commands/databases.js b/lib/commands/databases.js index 88c25fe..7308bc0 100644 --- a/lib/commands/databases.js +++ b/lib/commands/databases.js @@ -7,7 +7,7 @@ const libClient = require('../client.js'); const { getAllFiles, showConsoleLink } = require('../utils.js'); const { Command } = require('commander'); const { sdkForProject, sdkForConsole } = require('../sdks') -const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log } = require('../parser') +const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log, warn } = require('../parser') const { localConfig, globalConfig } = require("../config"); const { File } = require('undici'); const { ReadableStream } = require('stream/web'); @@ -79,7 +79,6 @@ const databasesList = async ({queries,search,parseOutput = true, overrideForCli return response; } - /** * @typedef {Object} DatabasesCreateRequestParams * @property {string} databaseId 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. @@ -121,19 +120,18 @@ const databasesCreate = async ({databaseId,name,enabled,parseOutput = true, over return response; } - /** - * @typedef {Object} DatabasesGetUsageRequestParams - * @property {DatabaseUsageRange} range 'Date range. + * @typedef {Object} DatabasesListUsageRequestParams + * @property {UsageRange} range Date range. * @property {boolean} overrideForCli * @property {boolean} parseOutput * @property {libClient | undefined} sdk */ /** - * @param {DatabasesGetUsageRequestParams} params + * @param {DatabasesListUsageRequestParams} params */ -const databasesGetUsage = async ({range,parseOutput = true, overrideForCli = false, sdk = undefined}) => { +const databasesListUsage = async ({range,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => { let client = !sdk ? await sdkForProject() : sdk; let apiPath = '/databases/usage'; @@ -148,13 +146,16 @@ const databasesGetUsage = async ({range,parseOutput = true, overrideForCli = fal }, payload); if (parseOutput) { - parse(response) + if(console) { + showConsoleLink('databases', 'listUsage'); + } else { + parse(response) + } } return response; } - /** * @typedef {Object} DatabasesGetRequestParams * @property {string} databaseId Database ID. @@ -188,7 +189,6 @@ const databasesGet = async ({databaseId,parseOutput = true, overrideForCli = fal return response; } - /** * @typedef {Object} DatabasesUpdateRequestParams * @property {string} databaseId Database ID. @@ -227,7 +227,6 @@ const databasesUpdate = async ({databaseId,name,enabled,parseOutput = true, over return response; } - /** * @typedef {Object} DatabasesDeleteRequestParams * @property {string} databaseId Database ID. @@ -258,7 +257,6 @@ const databasesDelete = async ({databaseId,parseOutput = true, overrideForCli = return response; } - /** * @typedef {Object} DatabasesListCollectionsRequestParams * @property {string} databaseId Database ID. @@ -300,7 +298,6 @@ const databasesListCollections = async ({databaseId,queries,search,parseOutput = return response; } - /** * @typedef {Object} DatabasesCreateCollectionRequestParams * @property {string} databaseId Database ID. @@ -352,7 +349,6 @@ const databasesCreateCollection = async ({databaseId,collectionId,name,permissio return response; } - /** * @typedef {Object} DatabasesGetCollectionRequestParams * @property {string} databaseId Database ID. @@ -387,7 +383,6 @@ const databasesGetCollection = async ({databaseId,collectionId,parseOutput = tru return response; } - /** * @typedef {Object} DatabasesUpdateCollectionRequestParams * @property {string} databaseId Database ID. @@ -436,7 +431,6 @@ const databasesUpdateCollection = async ({databaseId,collectionId,name,permissio return response; } - /** * @typedef {Object} DatabasesDeleteCollectionRequestParams * @property {string} databaseId Database ID. @@ -468,11 +462,10 @@ const databasesDeleteCollection = async ({databaseId,collectionId,parseOutput = return response; } - /** * @typedef {Object} DatabasesListAttributesRequestParams * @property {string} databaseId Database ID. - * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @property {string} collectionId Collection ID. * @property {string[]} 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: key, type, size, required, array, status, error * @property {boolean} overrideForCli * @property {boolean} parseOutput @@ -507,11 +500,10 @@ const databasesListAttributes = async ({databaseId,collectionId,queries,parseOut return response; } - /** * @typedef {Object} DatabasesCreateBooleanAttributeRequestParams * @property {string} databaseId Database ID. - * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @property {string} collectionId Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @property {string} key Attribute Key. * @property {boolean} required Is attribute required? * @property {boolean} xdefault Default value for attribute when not provided. Cannot be set when attribute is required. @@ -555,11 +547,10 @@ const databasesCreateBooleanAttribute = async ({databaseId,collectionId,key,requ return response; } - /** * @typedef {Object} DatabasesUpdateBooleanAttributeRequestParams * @property {string} databaseId Database ID. - * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection). * @property {string} key Attribute Key. * @property {boolean} required Is attribute required? * @property {boolean} xdefault Default value for attribute when not provided. Cannot be set when attribute is required. @@ -600,11 +591,10 @@ const databasesUpdateBooleanAttribute = async ({databaseId,collectionId,key,requ return response; } - /** * @typedef {Object} DatabasesCreateDatetimeAttributeRequestParams * @property {string} databaseId Database ID. - * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection). * @property {string} key Attribute Key. * @property {boolean} required Is attribute required? * @property {string} xdefault Default value for the attribute in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required. @@ -648,11 +638,10 @@ const databasesCreateDatetimeAttribute = async ({databaseId,collectionId,key,req return response; } - /** * @typedef {Object} DatabasesUpdateDatetimeAttributeRequestParams * @property {string} databaseId Database ID. - * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @property {string} collectionId Collection ID. * @property {string} key Attribute Key. * @property {boolean} required Is attribute required? * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required. @@ -693,11 +682,10 @@ const databasesUpdateDatetimeAttribute = async ({databaseId,collectionId,key,req return response; } - /** * @typedef {Object} DatabasesCreateEmailAttributeRequestParams * @property {string} databaseId Database ID. - * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @property {string} collectionId Collection ID. * @property {string} key Attribute Key. * @property {boolean} required Is attribute required? * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required. @@ -741,15 +729,14 @@ const databasesCreateEmailAttribute = async ({databaseId,collectionId,key,requir return response; } - /** * @typedef {Object} DatabasesUpdateEmailAttributeRequestParams * @property {string} databaseId Database ID. - * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @property {string} collectionId Collection ID. * @property {string} key Attribute Key. * @property {boolean} required Is attribute required? * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required. - * @property {string} newKey New attribute key. + * @property {string} newKey New Attribute Key. * @property {boolean} overrideForCli * @property {boolean} parseOutput * @property {libClient | undefined} sdk @@ -786,13 +773,12 @@ const databasesUpdateEmailAttribute = async ({databaseId,collectionId,key,requir return response; } - /** * @typedef {Object} DatabasesCreateEnumAttributeRequestParams * @property {string} databaseId Database ID. - * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @property {string} collectionId Collection ID. * @property {string} key Attribute Key. - * @property {string[]} elements Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long. + * @property {string[]} elements Array of enum values. * @property {boolean} required Is attribute required? * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required. * @property {boolean} array Is attribute an array? @@ -839,16 +825,15 @@ const databasesCreateEnumAttribute = async ({databaseId,collectionId,key,element return response; } - /** * @typedef {Object} DatabasesUpdateEnumAttributeRequestParams * @property {string} databaseId Database ID. - * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @property {string} collectionId Collection ID. * @property {string} key Attribute Key. - * @property {string[]} elements Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long. + * @property {string[]} elements Updated list of enum values. * @property {boolean} required Is attribute required? * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required. - * @property {string} newKey New attribute key. + * @property {string} newKey New Attribute Key. * @property {boolean} overrideForCli * @property {boolean} parseOutput * @property {libClient | undefined} sdk @@ -889,16 +874,15 @@ const databasesUpdateEnumAttribute = async ({databaseId,collectionId,key,element return response; } - /** * @typedef {Object} DatabasesCreateFloatAttributeRequestParams * @property {string} databaseId Database ID. - * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @property {string} collectionId Collection ID. * @property {string} key Attribute Key. * @property {boolean} required Is attribute required? - * @property {number} min Minimum value to enforce on new documents - * @property {number} max Maximum value to enforce on new documents - * @property {number} xdefault Default value for attribute when not provided. Cannot be set when attribute is required. + * @property {number} min Minimum value. + * @property {number} max Maximum value. + * @property {number} xdefault Default value. Cannot be set when required. * @property {boolean} array Is attribute an array? * @property {boolean} overrideForCli * @property {boolean} parseOutput @@ -945,17 +929,16 @@ const databasesCreateFloatAttribute = async ({databaseId,collectionId,key,requir return response; } - /** * @typedef {Object} DatabasesUpdateFloatAttributeRequestParams * @property {string} databaseId Database ID. - * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @property {string} collectionId Collection ID. * @property {string} key Attribute Key. * @property {boolean} required Is attribute required? - * @property {number} xdefault Default value for attribute when not provided. Cannot be set when attribute is required. - * @property {number} min Minimum value to enforce on new documents - * @property {number} max Maximum value to enforce on new documents - * @property {string} newKey New attribute key. + * @property {number} xdefault Default value. Cannot be set when required. + * @property {number} min Minimum value. + * @property {number} max Maximum value. + * @property {string} newKey New Attribute Key. * @property {boolean} overrideForCli * @property {boolean} parseOutput * @property {libClient | undefined} sdk @@ -998,16 +981,15 @@ const databasesUpdateFloatAttribute = async ({databaseId,collectionId,key,requir return response; } - /** * @typedef {Object} DatabasesCreateIntegerAttributeRequestParams * @property {string} databaseId Database ID. - * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @property {string} collectionId Collection ID. * @property {string} key Attribute Key. * @property {boolean} required Is attribute required? - * @property {number} min Minimum value to enforce on new documents - * @property {number} max Maximum value to enforce on new documents - * @property {number} xdefault Default value for attribute when not provided. Cannot be set when attribute is required. + * @property {number} min Minimum value + * @property {number} max Maximum value + * @property {number} xdefault Default value. Cannot be set when attribute is required. * @property {boolean} array Is attribute an array? * @property {boolean} overrideForCli * @property {boolean} parseOutput @@ -1054,17 +1036,16 @@ const databasesCreateIntegerAttribute = async ({databaseId,collectionId,key,requ return response; } - /** * @typedef {Object} DatabasesUpdateIntegerAttributeRequestParams * @property {string} databaseId Database ID. - * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @property {string} collectionId Collection ID. * @property {string} key Attribute Key. * @property {boolean} required Is attribute required? - * @property {number} xdefault Default value for attribute when not provided. Cannot be set when attribute is required. - * @property {number} min Minimum value to enforce on new documents - * @property {number} max Maximum value to enforce on new documents - * @property {string} newKey New attribute key. + * @property {number} xdefault Default value. Cannot be set when attribute is required. + * @property {number} min Minimum value + * @property {number} max Maximum value + * @property {string} newKey New Attribute Key. * @property {boolean} overrideForCli * @property {boolean} parseOutput * @property {libClient | undefined} sdk @@ -1107,14 +1088,13 @@ const databasesUpdateIntegerAttribute = async ({databaseId,collectionId,key,requ return response; } - /** * @typedef {Object} DatabasesCreateIpAttributeRequestParams * @property {string} databaseId Database ID. - * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @property {string} collectionId Collection ID. * @property {string} key Attribute Key. * @property {boolean} required Is attribute required? - * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required. + * @property {string} xdefault Default value. Cannot be set when attribute is required. * @property {boolean} array Is attribute an array? * @property {boolean} overrideForCli * @property {boolean} parseOutput @@ -1155,15 +1135,14 @@ const databasesCreateIpAttribute = async ({databaseId,collectionId,key,required, return response; } - /** * @typedef {Object} DatabasesUpdateIpAttributeRequestParams * @property {string} databaseId Database ID. - * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @property {string} collectionId Collection ID. * @property {string} key Attribute Key. * @property {boolean} required Is attribute required? - * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required. - * @property {string} newKey New attribute key. + * @property {string} xdefault Default value. Cannot be set when attribute is required. + * @property {string} newKey New Attribute Key. * @property {boolean} overrideForCli * @property {boolean} parseOutput * @property {libClient | undefined} sdk @@ -1200,12 +1179,11 @@ const databasesUpdateIpAttribute = async ({databaseId,collectionId,key,required, return response; } - /** * @typedef {Object} DatabasesCreateRelationshipAttributeRequestParams * @property {string} databaseId Database ID. - * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). - * @property {string} relatedCollectionId Related Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @property {string} collectionId Collection ID. + * @property {string} relatedCollectionId Related Collection ID. * @property {RelationshipType} type Relation type * @property {boolean} twoWay Is Two Way? * @property {string} key Attribute Key. @@ -1256,11 +1234,10 @@ const databasesCreateRelationshipAttribute = async ({databaseId,collectionId,rel return response; } - /** * @typedef {Object} DatabasesCreateStringAttributeRequestParams * @property {string} databaseId Database ID. - * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @property {string} collectionId Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @property {string} key Attribute Key. * @property {number} size Attribute size for text attributes, in number of characters. * @property {boolean} required Is attribute required? @@ -1312,16 +1289,15 @@ const databasesCreateStringAttribute = async ({databaseId,collectionId,key,size, return response; } - /** * @typedef {Object} DatabasesUpdateStringAttributeRequestParams * @property {string} databaseId Database ID. - * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @property {string} collectionId Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @property {string} key Attribute Key. * @property {boolean} required Is attribute required? * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required. * @property {number} size Maximum size of the string attribute. - * @property {string} newKey New attribute key. + * @property {string} newKey New Attribute Key. * @property {boolean} overrideForCli * @property {boolean} parseOutput * @property {libClient | undefined} sdk @@ -1361,11 +1337,10 @@ const databasesUpdateStringAttribute = async ({databaseId,collectionId,key,requi return response; } - /** * @typedef {Object} DatabasesCreateUrlAttributeRequestParams * @property {string} databaseId Database ID. - * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @property {string} collectionId Collection ID. * @property {string} key Attribute Key. * @property {boolean} required Is attribute required? * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required. @@ -1409,15 +1384,14 @@ const databasesCreateUrlAttribute = async ({databaseId,collectionId,key,required return response; } - /** * @typedef {Object} DatabasesUpdateUrlAttributeRequestParams * @property {string} databaseId Database ID. - * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @property {string} collectionId Collection ID. * @property {string} key Attribute Key. * @property {boolean} required Is attribute required? * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required. - * @property {string} newKey New attribute key. + * @property {string} newKey New Attribute Key. * @property {boolean} overrideForCli * @property {boolean} parseOutput * @property {libClient | undefined} sdk @@ -1454,11 +1428,10 @@ const databasesUpdateUrlAttribute = async ({databaseId,collectionId,key,required return response; } - /** * @typedef {Object} DatabasesGetAttributeRequestParams * @property {string} databaseId Database ID. - * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @property {string} collectionId Collection ID. * @property {string} key Attribute Key. * @property {boolean} overrideForCli * @property {boolean} parseOutput @@ -1486,11 +1459,10 @@ const databasesGetAttribute = async ({databaseId,collectionId,key,parseOutput = return response; } - /** * @typedef {Object} DatabasesDeleteAttributeRequestParams * @property {string} databaseId Database ID. - * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @property {string} collectionId Collection ID. * @property {string} key Attribute Key. * @property {boolean} overrideForCli * @property {boolean} parseOutput @@ -1519,14 +1491,13 @@ const databasesDeleteAttribute = async ({databaseId,collectionId,key,parseOutput return response; } - /** * @typedef {Object} DatabasesUpdateRelationshipAttributeRequestParams * @property {string} databaseId Database ID. - * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). + * @property {string} collectionId Collection ID. * @property {string} key Attribute Key. * @property {RelationMutate} onDelete Constraints option - * @property {string} newKey New attribute key. + * @property {string} newKey New Attribute Key. * @property {boolean} overrideForCli * @property {boolean} parseOutput * @property {libClient | undefined} sdk @@ -1560,7 +1531,6 @@ const databasesUpdateRelationshipAttribute = async ({databaseId,collectionId,key return response; } - /** * @typedef {Object} DatabasesListDocumentsRequestParams * @property {string} databaseId Database ID. @@ -1599,7 +1569,6 @@ const databasesListDocuments = async ({databaseId,collectionId,queries,parseOutp return response; } - /** * @typedef {Object} DatabasesCreateDocumentRequestParams * @property {string} databaseId Database ID. @@ -1644,7 +1613,6 @@ const databasesCreateDocument = async ({databaseId,collectionId,documentId,data, return response; } - /** * @typedef {Object} DatabasesCreateDocumentsRequestParams * @property {string} databaseId Database ID. @@ -1681,7 +1649,6 @@ const databasesCreateDocuments = async ({databaseId,collectionId,documents,parse return response; } - /** * @typedef {Object} DatabasesUpsertDocumentsRequestParams * @property {string} databaseId Database ID. @@ -1718,7 +1685,6 @@ const databasesUpsertDocuments = async ({databaseId,collectionId,documents,parse return response; } - /** * @typedef {Object} DatabasesUpdateDocumentsRequestParams * @property {string} databaseId Database ID. @@ -1759,7 +1725,6 @@ const databasesUpdateDocuments = async ({databaseId,collectionId,data,queries,pa return response; } - /** * @typedef {Object} DatabasesDeleteDocumentsRequestParams * @property {string} databaseId Database ID. @@ -1796,7 +1761,6 @@ const databasesDeleteDocuments = async ({databaseId,collectionId,queries,parseOu return response; } - /** * @typedef {Object} DatabasesGetDocumentRequestParams * @property {string} databaseId Database ID. @@ -1836,7 +1800,6 @@ const databasesGetDocument = async ({databaseId,collectionId,documentId,queries, return response; } - /** * @typedef {Object} DatabasesUpsertDocumentRequestParams * @property {string} databaseId Database ID. @@ -1878,7 +1841,6 @@ const databasesUpsertDocument = async ({databaseId,collectionId,documentId,data, return response; } - /** * @typedef {Object} DatabasesUpdateDocumentRequestParams * @property {string} databaseId Database ID. @@ -1920,7 +1882,6 @@ const databasesUpdateDocument = async ({databaseId,collectionId,documentId,data, return response; } - /** * @typedef {Object} DatabasesDeleteDocumentRequestParams * @property {string} databaseId Database ID. @@ -1953,7 +1914,6 @@ const databasesDeleteDocument = async ({databaseId,collectionId,documentId,parse return response; } - /** * @typedef {Object} DatabasesListDocumentLogsRequestParams * @property {string} databaseId Database ID. @@ -1989,14 +1949,13 @@ const databasesListDocumentLogs = async ({databaseId,collectionId,documentId,que return response; } - /** * @typedef {Object} DatabasesDecrementDocumentAttributeRequestParams * @property {string} databaseId Database ID. * @property {string} collectionId Collection ID. * @property {string} documentId Document ID. * @property {string} attribute Attribute key. - * @property {number} value Value to decrement the attribute by. The value must be a number. + * @property {number} value Value to increment the attribute by. The value must be a number. * @property {number} min Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown. * @property {boolean} overrideForCli * @property {boolean} parseOutput @@ -2031,7 +1990,6 @@ const databasesDecrementDocumentAttribute = async ({databaseId,collectionId,docu return response; } - /** * @typedef {Object} DatabasesIncrementDocumentAttributeRequestParams * @property {string} databaseId Database ID. @@ -2073,7 +2031,6 @@ const databasesIncrementDocumentAttribute = async ({databaseId,collectionId,docu return response; } - /** * @typedef {Object} DatabasesListIndexesRequestParams * @property {string} databaseId Database ID. @@ -2112,7 +2069,6 @@ const databasesListIndexes = async ({databaseId,collectionId,queries,parseOutput return response; } - /** * @typedef {Object} DatabasesCreateIndexRequestParams * @property {string} databaseId Database ID. @@ -2167,7 +2123,6 @@ const databasesCreateIndex = async ({databaseId,collectionId,key,type,attributes return response; } - /** * @typedef {Object} DatabasesGetIndexRequestParams * @property {string} databaseId Database ID. @@ -2199,7 +2154,6 @@ const databasesGetIndex = async ({databaseId,collectionId,key,parseOutput = true return response; } - /** * @typedef {Object} DatabasesDeleteIndexRequestParams * @property {string} databaseId Database ID. @@ -2232,7 +2186,6 @@ const databasesDeleteIndex = async ({databaseId,collectionId,key,parseOutput = t return response; } - /** * @typedef {Object} DatabasesListCollectionLogsRequestParams * @property {string} databaseId Database ID. @@ -2267,12 +2220,11 @@ const databasesListCollectionLogs = async ({databaseId,collectionId,queries,pars return response; } - /** * @typedef {Object} DatabasesGetCollectionUsageRequestParams * @property {string} databaseId Database ID. * @property {string} collectionId Collection ID. - * @property {DatabaseUsageRange} range Date range. + * @property {UsageRange} range Date range. * @property {boolean} overrideForCli * @property {boolean} parseOutput * @property {libClient | undefined} sdk @@ -2302,7 +2254,6 @@ const databasesGetCollectionUsage = async ({databaseId,collectionId,range,parseO return response; } - /** * @typedef {Object} DatabasesListLogsRequestParams * @property {string} databaseId Database ID. @@ -2336,20 +2287,19 @@ const databasesListLogs = async ({databaseId,queries,parseOutput = true, overrid return response; } - /** - * @typedef {Object} DatabasesGetDatabaseUsageRequestParams + * @typedef {Object} DatabasesGetUsageRequestParams * @property {string} databaseId Database ID. - * @property {DatabaseUsageRange} range 'Date range. + * @property {UsageRange} range Date range. * @property {boolean} overrideForCli * @property {boolean} parseOutput * @property {libClient | undefined} sdk */ /** - * @param {DatabasesGetDatabaseUsageRequestParams} params + * @param {DatabasesGetUsageRequestParams} params */ -const databasesGetDatabaseUsage = async ({databaseId,range,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => { +const databasesGetUsage = async ({databaseId,range,parseOutput = true, overrideForCli = false, sdk = undefined}) => { let client = !sdk ? await sdkForProject() : sdk; let apiPath = '/databases/{databaseId}/usage'.replace('{databaseId}', databaseId); @@ -2364,20 +2314,15 @@ const databasesGetDatabaseUsage = async ({databaseId,range,parseOutput = true, o }, payload); if (parseOutput) { - if(console) { - showConsoleLink('databases', 'getDatabaseUsage', databaseId); - } else { - parse(response) - } + parse(response) } return response; } - databases .command(`list`) - .description(`Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db list' instead] Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.`) .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`) .option(`--search `, `Search term to filter your list results. Max length: 256 chars.`) .option(`--console`, `Get the resource console url`) @@ -2385,28 +2330,29 @@ databases databases .command(`create`) - .description(`Create a new Database. `) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-database' instead] Create a new Database. `) .requiredOption(`--database-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.`) .requiredOption(`--name `, `Database name. Max length: 128 chars.`) .option(`--enabled [value]`, `Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.`, (value) => value === undefined ? true : parseBool(value)) .action(actionRunner(databasesCreate)) databases - .command(`get-usage`) - .description(`Get usage metrics and statistics for all databases in the project. You can view the total number of databases, collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.`) - .option(`--range `, `'Date range.`) - .action(actionRunner(databasesGetUsage)) + .command(`list-usage`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db list-usage' instead] List usage metrics and statistics for all databases in the project. You can view the total number of databases, collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.`) + .option(`--range `, `Date range.`) + .option(`--console`, `Get the resource console url`) + .action(actionRunner(databasesListUsage)) databases .command(`get`) - .description(`Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db get' instead] Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.`) .requiredOption(`--database-id `, `Database ID.`) .option(`--console`, `Get the resource console url`) .action(actionRunner(databasesGet)) databases .command(`update`) - .description(`Update a database by its unique ID.`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db update' instead] Update a database by its unique ID.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--name `, `Database name. Max length: 128 chars.`) .option(`--enabled [value]`, `Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.`, (value) => value === undefined ? true : parseBool(value)) @@ -2414,13 +2360,13 @@ databases databases .command(`delete`) - .description(`Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db delete' instead] Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.`) .requiredOption(`--database-id `, `Database ID.`) .action(actionRunner(databasesDelete)) databases .command(`list-collections`) - .description(`Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results.`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db list-tables' instead] Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results.`) .requiredOption(`--database-id `, `Database ID.`) .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, enabled, documentSecurity`) .option(`--search `, `Search term to filter your list results. Max length: 256 chars.`) @@ -2429,7 +2375,7 @@ databases databases .command(`create-collection`) - .description(`Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-table' instead] Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--collection-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.`) .requiredOption(`--name `, `Collection name. Max length: 128 chars.`) @@ -2440,7 +2386,7 @@ databases databases .command(`get-collection`) - .description(`Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db get-table' instead] Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--collection-id `, `Collection ID.`) .option(`--console`, `Get the resource console url`) @@ -2448,7 +2394,7 @@ databases databases .command(`update-collection`) - .description(`Update a collection by its unique ID.`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db update-table' instead] Update a collection by its unique ID.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--collection-id `, `Collection ID.`) .requiredOption(`--name `, `Collection name. Max length: 128 chars.`) @@ -2459,25 +2405,25 @@ databases databases .command(`delete-collection`) - .description(`Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db delete-table' instead] Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--collection-id `, `Collection ID.`) .action(actionRunner(databasesDeleteCollection)) databases .command(`list-attributes`) - .description(`List attributes in the collection.`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db list-columns' instead] List attributes in the collection.`) .requiredOption(`--database-id `, `Database ID.`) - .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) + .requiredOption(`--collection-id `, `Collection ID.`) .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: key, type, size, required, array, status, error`) .option(`--console`, `Get the resource console url`) .action(actionRunner(databasesListAttributes)) databases .command(`create-boolean-attribute`) - .description(`Create a boolean attribute. `) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-boolean-column' instead] Create a boolean attribute. `) .requiredOption(`--database-id `, `Database ID.`) - .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) + .requiredOption(`--collection-id `, `Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) .requiredOption(`--key `, `Attribute Key.`) .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value)) .option(`--xdefault [value]`, `Default value for attribute when not provided. Cannot be set when attribute is required.`, (value) => value === undefined ? true : parseBool(value)) @@ -2486,9 +2432,9 @@ databases databases .command(`update-boolean-attribute`) - .description(`Update a boolean attribute. Changing the 'default' value will not update already existing documents.`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db update-boolean-column' instead] Update a boolean attribute. Changing the 'default' value will not update already existing documents.`) .requiredOption(`--database-id `, `Database ID.`) - .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) + .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).`) .requiredOption(`--key `, `Attribute Key.`) .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value)) .option(`--xdefault [value]`, `Default value for attribute when not provided. Cannot be set when attribute is required.`, (value) => value === undefined ? true : parseBool(value)) @@ -2497,9 +2443,9 @@ databases databases .command(`create-datetime-attribute`) - .description(`Create a date time attribute according to the ISO 8601 standard.`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-datetime-column' instead] Create a date time attribute according to the ISO 8601 standard.`) .requiredOption(`--database-id `, `Database ID.`) - .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) + .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).`) .requiredOption(`--key `, `Attribute Key.`) .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value)) .option(`--xdefault `, `Default value for the attribute in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required.`) @@ -2508,9 +2454,9 @@ databases databases .command(`update-datetime-attribute`) - .description(`Update a date time attribute. Changing the 'default' value will not update already existing documents.`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db update-datetime-column' instead] Update a date time attribute. Changing the 'default' value will not update already existing documents.`) .requiredOption(`--database-id `, `Database ID.`) - .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) + .requiredOption(`--collection-id `, `Collection ID.`) .requiredOption(`--key `, `Attribute Key.`) .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value)) .option(`--xdefault `, `Default value for attribute when not provided. Cannot be set when attribute is required.`) @@ -2519,9 +2465,9 @@ databases databases .command(`create-email-attribute`) - .description(`Create an email attribute. `) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-email-column' instead] Create an email attribute. `) .requiredOption(`--database-id `, `Database ID.`) - .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) + .requiredOption(`--collection-id `, `Collection ID.`) .requiredOption(`--key `, `Attribute Key.`) .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value)) .option(`--xdefault `, `Default value for attribute when not provided. Cannot be set when attribute is required.`) @@ -2530,22 +2476,22 @@ databases databases .command(`update-email-attribute`) - .description(`Update an email attribute. Changing the 'default' value will not update already existing documents. `) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db update-email-column' instead] Update an email attribute. Changing the 'default' value will not update already existing documents. `) .requiredOption(`--database-id `, `Database ID.`) - .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) + .requiredOption(`--collection-id `, `Collection ID.`) .requiredOption(`--key `, `Attribute Key.`) .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value)) .option(`--xdefault `, `Default value for attribute when not provided. Cannot be set when attribute is required.`) - .option(`--new-key `, `New attribute key.`) + .option(`--new-key `, `New Attribute Key.`) .action(actionRunner(databasesUpdateEmailAttribute)) databases .command(`create-enum-attribute`) - .description(`Create an enumeration attribute. The 'elements' param acts as a white-list of accepted values for this attribute. `) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-enum-column' instead] Create an enum attribute. The 'elements' param acts as a white-list of accepted values for this attribute. `) .requiredOption(`--database-id `, `Database ID.`) - .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) + .requiredOption(`--collection-id `, `Collection ID.`) .requiredOption(`--key `, `Attribute Key.`) - .requiredOption(`--elements [elements...]`, `Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long.`) + .requiredOption(`--elements [elements...]`, `Array of enum values.`) .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value)) .option(`--xdefault `, `Default value for attribute when not provided. Cannot be set when attribute is required.`) .option(`--array [value]`, `Is attribute an array?`, (value) => value === undefined ? true : parseBool(value)) @@ -2553,96 +2499,96 @@ databases databases .command(`update-enum-attribute`) - .description(`Update an enum attribute. Changing the 'default' value will not update already existing documents. `) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db update-enum-column' instead] Update an enum attribute. Changing the 'default' value will not update already existing documents. `) .requiredOption(`--database-id `, `Database ID.`) - .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) + .requiredOption(`--collection-id `, `Collection ID.`) .requiredOption(`--key `, `Attribute Key.`) - .requiredOption(`--elements [elements...]`, `Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long.`) + .requiredOption(`--elements [elements...]`, `Updated list of enum values.`) .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value)) .option(`--xdefault `, `Default value for attribute when not provided. Cannot be set when attribute is required.`) - .option(`--new-key `, `New attribute key.`) + .option(`--new-key `, `New Attribute Key.`) .action(actionRunner(databasesUpdateEnumAttribute)) databases .command(`create-float-attribute`) - .description(`Create a float attribute. Optionally, minimum and maximum values can be provided. `) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-float-column' instead] Create a float attribute. Optionally, minimum and maximum values can be provided. `) .requiredOption(`--database-id `, `Database ID.`) - .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) + .requiredOption(`--collection-id `, `Collection ID.`) .requiredOption(`--key `, `Attribute Key.`) .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value)) - .option(`--min `, `Minimum value to enforce on new documents`, parseInteger) - .option(`--max `, `Maximum value to enforce on new documents`, parseInteger) - .option(`--xdefault `, `Default value for attribute when not provided. Cannot be set when attribute is required.`, parseInteger) + .option(`--min `, `Minimum value.`, parseInteger) + .option(`--max `, `Maximum value.`, parseInteger) + .option(`--xdefault `, `Default value. Cannot be set when required.`, parseInteger) .option(`--array [value]`, `Is attribute an array?`, (value) => value === undefined ? true : parseBool(value)) .action(actionRunner(databasesCreateFloatAttribute)) databases .command(`update-float-attribute`) - .description(`Update a float attribute. Changing the 'default' value will not update already existing documents. `) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db update-float-column' instead] Update a float attribute. Changing the 'default' value will not update already existing documents. `) .requiredOption(`--database-id `, `Database ID.`) - .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) + .requiredOption(`--collection-id `, `Collection ID.`) .requiredOption(`--key `, `Attribute Key.`) .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value)) - .option(`--xdefault `, `Default value for attribute when not provided. Cannot be set when attribute is required.`, parseInteger) - .option(`--min `, `Minimum value to enforce on new documents`, parseInteger) - .option(`--max `, `Maximum value to enforce on new documents`, parseInteger) - .option(`--new-key `, `New attribute key.`) + .option(`--xdefault `, `Default value. Cannot be set when required.`, parseInteger) + .option(`--min `, `Minimum value.`, parseInteger) + .option(`--max `, `Maximum value.`, parseInteger) + .option(`--new-key `, `New Attribute Key.`) .action(actionRunner(databasesUpdateFloatAttribute)) databases .command(`create-integer-attribute`) - .description(`Create an integer attribute. Optionally, minimum and maximum values can be provided. `) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-integer-column' instead] Create an integer attribute. Optionally, minimum and maximum values can be provided. `) .requiredOption(`--database-id `, `Database ID.`) - .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) + .requiredOption(`--collection-id `, `Collection ID.`) .requiredOption(`--key `, `Attribute Key.`) .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value)) - .option(`--min `, `Minimum value to enforce on new documents`, parseInteger) - .option(`--max `, `Maximum value to enforce on new documents`, parseInteger) - .option(`--xdefault `, `Default value for attribute when not provided. Cannot be set when attribute is required.`, parseInteger) + .option(`--min `, `Minimum value`, parseInteger) + .option(`--max `, `Maximum value`, parseInteger) + .option(`--xdefault `, `Default value. Cannot be set when attribute is required.`, parseInteger) .option(`--array [value]`, `Is attribute an array?`, (value) => value === undefined ? true : parseBool(value)) .action(actionRunner(databasesCreateIntegerAttribute)) databases .command(`update-integer-attribute`) - .description(`Update an integer attribute. Changing the 'default' value will not update already existing documents. `) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db update-integer-column' instead] Update an integer attribute. Changing the 'default' value will not update already existing documents. `) .requiredOption(`--database-id `, `Database ID.`) - .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) + .requiredOption(`--collection-id `, `Collection ID.`) .requiredOption(`--key `, `Attribute Key.`) .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value)) - .option(`--xdefault `, `Default value for attribute when not provided. Cannot be set when attribute is required.`, parseInteger) - .option(`--min `, `Minimum value to enforce on new documents`, parseInteger) - .option(`--max `, `Maximum value to enforce on new documents`, parseInteger) - .option(`--new-key `, `New attribute key.`) + .option(`--xdefault `, `Default value. Cannot be set when attribute is required.`, parseInteger) + .option(`--min `, `Minimum value`, parseInteger) + .option(`--max `, `Maximum value`, parseInteger) + .option(`--new-key `, `New Attribute Key.`) .action(actionRunner(databasesUpdateIntegerAttribute)) databases .command(`create-ip-attribute`) - .description(`Create IP address attribute. `) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-ip-column' instead] Create IP address attribute. `) .requiredOption(`--database-id `, `Database ID.`) - .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) + .requiredOption(`--collection-id `, `Collection ID.`) .requiredOption(`--key `, `Attribute Key.`) .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value)) - .option(`--xdefault `, `Default value for attribute when not provided. Cannot be set when attribute is required.`) + .option(`--xdefault `, `Default value. Cannot be set when attribute is required.`) .option(`--array [value]`, `Is attribute an array?`, (value) => value === undefined ? true : parseBool(value)) .action(actionRunner(databasesCreateIpAttribute)) databases .command(`update-ip-attribute`) - .description(`Update an ip attribute. Changing the 'default' value will not update already existing documents. `) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db update-ip-column' instead] Update an ip attribute. Changing the 'default' value will not update already existing documents. `) .requiredOption(`--database-id `, `Database ID.`) - .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) + .requiredOption(`--collection-id `, `Collection ID.`) .requiredOption(`--key `, `Attribute Key.`) .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value)) - .option(`--xdefault `, `Default value for attribute when not provided. Cannot be set when attribute is required.`) - .option(`--new-key `, `New attribute key.`) + .option(`--xdefault `, `Default value. Cannot be set when attribute is required.`) + .option(`--new-key `, `New Attribute Key.`) .action(actionRunner(databasesUpdateIpAttribute)) databases .command(`create-relationship-attribute`) - .description(`Create relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). `) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-relationship-column' instead] Create relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). `) .requiredOption(`--database-id `, `Database ID.`) - .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) - .requiredOption(`--related-collection-id `, `Related Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) + .requiredOption(`--collection-id `, `Collection ID.`) + .requiredOption(`--related-collection-id `, `Related Collection ID.`) .requiredOption(`--type `, `Relation type`) .option(`--two-way [value]`, `Is Two Way?`, (value) => value === undefined ? true : parseBool(value)) .option(`--key `, `Attribute Key.`) @@ -2652,9 +2598,9 @@ databases databases .command(`create-string-attribute`) - .description(`Create a string attribute. `) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-string-column' instead] Create a string attribute. `) .requiredOption(`--database-id `, `Database ID.`) - .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) + .requiredOption(`--collection-id `, `Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) .requiredOption(`--key `, `Attribute Key.`) .requiredOption(`--size `, `Attribute size for text attributes, in number of characters.`, parseInteger) .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value)) @@ -2665,21 +2611,21 @@ databases databases .command(`update-string-attribute`) - .description(`Update a string attribute. Changing the 'default' value will not update already existing documents. `) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db update-string-column' instead] Update a string attribute. Changing the 'default' value will not update already existing documents. `) .requiredOption(`--database-id `, `Database ID.`) - .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) + .requiredOption(`--collection-id `, `Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) .requiredOption(`--key `, `Attribute Key.`) .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value)) .option(`--xdefault `, `Default value for attribute when not provided. Cannot be set when attribute is required.`) .option(`--size `, `Maximum size of the string attribute.`, parseInteger) - .option(`--new-key `, `New attribute key.`) + .option(`--new-key `, `New Attribute Key.`) .action(actionRunner(databasesUpdateStringAttribute)) databases .command(`create-url-attribute`) - .description(`Create a URL attribute. `) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-url-column' instead] Create a URL attribute. `) .requiredOption(`--database-id `, `Database ID.`) - .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) + .requiredOption(`--collection-id `, `Collection ID.`) .requiredOption(`--key `, `Attribute Key.`) .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value)) .option(`--xdefault `, `Default value for attribute when not provided. Cannot be set when attribute is required.`) @@ -2688,44 +2634,44 @@ databases databases .command(`update-url-attribute`) - .description(`Update an url attribute. Changing the 'default' value will not update already existing documents. `) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db update-url-column' instead] Update an url attribute. Changing the 'default' value will not update already existing documents. `) .requiredOption(`--database-id `, `Database ID.`) - .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) + .requiredOption(`--collection-id `, `Collection ID.`) .requiredOption(`--key `, `Attribute Key.`) .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value)) .option(`--xdefault `, `Default value for attribute when not provided. Cannot be set when attribute is required.`) - .option(`--new-key `, `New attribute key.`) + .option(`--new-key `, `New Attribute Key.`) .action(actionRunner(databasesUpdateUrlAttribute)) databases .command(`get-attribute`) - .description(`Get attribute by ID.`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db get-column' instead] Get attribute by ID.`) .requiredOption(`--database-id `, `Database ID.`) - .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) + .requiredOption(`--collection-id `, `Collection ID.`) .requiredOption(`--key `, `Attribute Key.`) .action(actionRunner(databasesGetAttribute)) databases .command(`delete-attribute`) - .description(`Deletes an attribute.`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db delete-column' instead] Deletes an attribute.`) .requiredOption(`--database-id `, `Database ID.`) - .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) + .requiredOption(`--collection-id `, `Collection ID.`) .requiredOption(`--key `, `Attribute Key.`) .action(actionRunner(databasesDeleteAttribute)) databases .command(`update-relationship-attribute`) - .description(`Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). `) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db update-relationship-column' instead] Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). `) .requiredOption(`--database-id `, `Database ID.`) - .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) + .requiredOption(`--collection-id `, `Collection ID.`) .requiredOption(`--key `, `Attribute Key.`) .option(`--on-delete `, `Constraints option`) - .option(`--new-key `, `New attribute key.`) + .option(`--new-key `, `New Attribute Key.`) .action(actionRunner(databasesUpdateRelationshipAttribute)) databases .command(`list-documents`) - .description(`Get a list of all the user's documents in a given collection. You can use the query params to filter your results.`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db list-rows' instead] Get a list of all the user's documents in a given collection. You can use the query params to filter your results.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) .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.`) @@ -2734,7 +2680,7 @@ databases databases .command(`create-document`) - .description(`Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-row' instead] Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.`) .requiredOption(`--document-id `, `Document 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.`) @@ -2744,7 +2690,7 @@ databases databases .command(`create-documents`) - .description(`**WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions. Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-rows' instead] Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.`) .requiredOption(`--documents [documents...]`, `Array of documents data as JSON objects.`) @@ -2752,7 +2698,7 @@ databases databases .command(`upsert-documents`) - .description(`**WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions. Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. `) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db upsert-rows' instead] Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. `) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--collection-id `, `Collection ID.`) .requiredOption(`--documents [documents...]`, `Array of document data as JSON objects. May contain partial documents.`) @@ -2760,7 +2706,7 @@ databases databases .command(`update-documents`) - .description(`**WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions. Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db update-rows' instead] Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--collection-id `, `Collection ID.`) .option(`--data `, `Document data as JSON object. Include only attribute and value pairs to be updated.`) @@ -2769,7 +2715,7 @@ databases databases .command(`delete-documents`) - .description(`**WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions. Bulk delete documents using queries, if no queries are passed then all documents are deleted.`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db delete-rows' instead] Bulk delete documents using queries, if no queries are passed then all documents are deleted.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) .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.`) @@ -2777,7 +2723,7 @@ databases databases .command(`get-document`) - .description(`Get a document by its unique ID. This endpoint response returns a JSON object with the document data.`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db get-row' instead] Get a document by its unique ID. This endpoint response returns a JSON object with the document data.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) .requiredOption(`--document-id `, `Document ID.`) @@ -2787,7 +2733,7 @@ databases databases .command(`upsert-document`) - .description(`**WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions. Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db upsert-row' instead] Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--collection-id `, `Collection ID.`) .requiredOption(`--document-id `, `Document ID.`) @@ -2797,7 +2743,7 @@ databases databases .command(`update-document`) - .description(`Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db update-row' instead] Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--collection-id `, `Collection ID.`) .requiredOption(`--document-id `, `Document ID.`) @@ -2807,7 +2753,7 @@ databases databases .command(`delete-document`) - .description(`Delete a document by its unique ID.`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db delete-row' instead] Delete a document by its unique ID.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) .requiredOption(`--document-id `, `Document ID.`) @@ -2815,7 +2761,7 @@ databases databases .command(`list-document-logs`) - .description(`Get the document activity logs list by its unique ID.`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db list-row-logs' instead] Get the document activity logs list by its unique ID.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--collection-id `, `Collection ID.`) .requiredOption(`--document-id `, `Document ID.`) @@ -2824,18 +2770,18 @@ databases databases .command(`decrement-document-attribute`) - .description(`Decrement a specific attribute of a document by a given value.`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db decrement-row-column' instead] Decrement a specific attribute of a document by a given value.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--collection-id `, `Collection ID.`) .requiredOption(`--document-id `, `Document ID.`) .requiredOption(`--attribute `, `Attribute key.`) - .option(`--value `, `Value to decrement the attribute by. The value must be a number.`, parseInteger) + .option(`--value `, `Value to increment the attribute by. The value must be a number.`, parseInteger) .option(`--min `, `Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.`, parseInteger) .action(actionRunner(databasesDecrementDocumentAttribute)) databases .command(`increment-document-attribute`) - .description(`Increment a specific attribute of a document by a given value.`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db increment-row-column' instead] Increment a specific attribute of a document by a given value.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--collection-id `, `Collection ID.`) .requiredOption(`--document-id `, `Document ID.`) @@ -2846,7 +2792,7 @@ databases databases .command(`list-indexes`) - .description(`List indexes in the collection.`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db list-indexes' instead] List indexes in the collection.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) .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: key, type, status, attributes, error`) @@ -2855,7 +2801,7 @@ databases databases .command(`create-index`) - .description(`Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request. Attributes can be 'key', 'fulltext', and 'unique'.`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-index' instead] Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request. Attributes can be 'key', 'fulltext', and 'unique'.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) .requiredOption(`--key `, `Index Key.`) @@ -2867,7 +2813,7 @@ databases databases .command(`get-index`) - .description(`Get index by ID.`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db get-index' instead] Get index by ID.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) .requiredOption(`--key `, `Index Key.`) @@ -2875,7 +2821,7 @@ databases databases .command(`delete-index`) - .description(`Delete an index.`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db delete-index' instead] Delete an index.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) .requiredOption(`--key `, `Index Key.`) @@ -2883,7 +2829,7 @@ databases databases .command(`list-collection-logs`) - .description(`Get the collection activity logs list by its unique ID.`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db list-table-logs' instead] Get the collection activity logs list by its unique ID.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--collection-id `, `Collection ID.`) .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`) @@ -2891,7 +2837,7 @@ databases databases .command(`get-collection-usage`) - .description(`Get usage metrics and statistics for a collection. Returning the total number of documents. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db get-table-usage' instead] Get usage metrics and statistics for a collection. Returning the total number of documents. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--collection-id `, `Collection ID.`) .option(`--range `, `Date range.`) @@ -2899,24 +2845,23 @@ databases databases .command(`list-logs`) - .description(`Get the database activity logs list by its unique ID.`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db list-database-logs' instead] Get the database activity logs list by its unique ID.`) .requiredOption(`--database-id `, `Database ID.`) .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`) .action(actionRunner(databasesListLogs)) databases - .command(`get-database-usage`) - .description(`Get usage metrics and statistics for a database. You can view the total number of collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.`) + .command(`get-usage`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db get-usage' instead] Get usage metrics and statistics for a database. You can view the total number of collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.`) .requiredOption(`--database-id `, `Database ID.`) - .option(`--range `, `'Date range.`) - .option(`--console`, `Get the resource console url`) - .action(actionRunner(databasesGetDatabaseUsage)) + .option(`--range `, `Date range.`) + .action(actionRunner(databasesGetUsage)) module.exports = { databases, databasesList, databasesCreate, - databasesGetUsage, + databasesListUsage, databasesGet, databasesUpdate, databasesDelete, @@ -2968,5 +2913,5 @@ module.exports = { databasesListCollectionLogs, databasesGetCollectionUsage, databasesListLogs, - databasesGetDatabaseUsage + databasesGetUsage }; diff --git a/lib/commands/functions.js b/lib/commands/functions.js index ffc50fe..cf42c5a 100644 --- a/lib/commands/functions.js +++ b/lib/commands/functions.js @@ -7,7 +7,7 @@ const libClient = require('../client.js'); const { getAllFiles, showConsoleLink } = require('../utils.js'); const { Command } = require('commander'); const { sdkForProject, sdkForConsole } = require('../sdks') -const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log } = require('../parser') +const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log, warn } = require('../parser') const { localConfig, globalConfig } = require("../config"); const { File } = require('undici'); const { ReadableStream } = require('stream/web'); @@ -79,7 +79,6 @@ const functionsList = async ({queries,search,parseOutput = true, overrideForCli return response; } - /** * @typedef {Object} FunctionsCreateRequestParams * @property {string} functionId Function 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. @@ -184,7 +183,6 @@ const functionsCreate = async ({functionId,name,runtime,execute,events,schedule, return response; } - /** * @typedef {Object} FunctionsListRuntimesRequestParams * @property {boolean} overrideForCli @@ -213,7 +211,6 @@ const functionsListRuntimes = async ({parseOutput = true, overrideForCli = false return response; } - /** * @typedef {Object} FunctionsListSpecificationsRequestParams * @property {boolean} overrideForCli @@ -246,7 +243,6 @@ const functionsListSpecifications = async ({parseOutput = true, overrideForCli = return response; } - /** * @typedef {Object} FunctionsListTemplatesRequestParams * @property {string[]} runtimes List of runtimes allowed for filtering function templates. Maximum of 100 runtimes are allowed. @@ -295,7 +291,6 @@ const functionsListTemplates = async ({runtimes,useCases,limit,offset,parseOutpu return response; } - /** * @typedef {Object} FunctionsGetTemplateRequestParams * @property {string} templateId Template ID. @@ -329,10 +324,9 @@ const functionsGetTemplate = async ({templateId,parseOutput = true, overrideForC return response; } - /** * @typedef {Object} FunctionsListUsageRequestParams - * @property {FunctionUsageRange} range Date range. + * @property {UsageRange} range Date range. * @property {boolean} overrideForCli * @property {boolean} parseOutput * @property {libClient | undefined} sdk @@ -366,7 +360,6 @@ const functionsListUsage = async ({range,parseOutput = true, overrideForCli = fa return response; } - /** * @typedef {Object} FunctionsGetRequestParams * @property {string} functionId Function ID. @@ -400,7 +393,6 @@ const functionsGet = async ({functionId,parseOutput = true, overrideForCli = fal return response; } - /** * @typedef {Object} FunctionsUpdateRequestParams * @property {string} functionId Function ID. @@ -502,7 +494,6 @@ const functionsUpdate = async ({functionId,name,runtime,execute,events,schedule, return response; } - /** * @typedef {Object} FunctionsDeleteRequestParams * @property {string} functionId Function ID. @@ -533,7 +524,6 @@ const functionsDelete = async ({functionId,parseOutput = true, overrideForCli = return response; } - /** * @typedef {Object} FunctionsUpdateFunctionDeploymentRequestParams * @property {string} functionId Function ID. @@ -568,7 +558,6 @@ const functionsUpdateFunctionDeployment = async ({functionId,deploymentId,parseO return response; } - /** * @typedef {Object} FunctionsListDeploymentsRequestParams * @property {string} functionId Function ID. @@ -610,7 +599,6 @@ const functionsListDeployments = async ({functionId,queries,search,parseOutput = return response; } - /** * @typedef {Object} FunctionsCreateDeploymentRequestParams * @property {string} functionId Function ID. @@ -775,7 +763,6 @@ const functionsCreateDeployment = async ({functionId,code,activate,entrypoint,co return response; } - /** * @typedef {Object} FunctionsCreateDuplicateDeploymentRequestParams * @property {string} functionId Function ID. @@ -814,7 +801,6 @@ const functionsCreateDuplicateDeployment = async ({functionId,deploymentId,build return response; } - /** * @typedef {Object} FunctionsCreateTemplateDeploymentRequestParams * @property {string} functionId Function ID. @@ -865,7 +851,6 @@ const functionsCreateTemplateDeployment = async ({functionId,repository,owner,ro return response; } - /** * @typedef {Object} FunctionsCreateVcsDeploymentRequestParams * @property {string} functionId Function ID. @@ -908,7 +893,6 @@ const functionsCreateVcsDeployment = async ({functionId,type,reference,activate, return response; } - /** * @typedef {Object} FunctionsGetDeploymentRequestParams * @property {string} functionId Function ID. @@ -943,7 +927,6 @@ const functionsGetDeployment = async ({functionId,deploymentId,parseOutput = tru return response; } - /** * @typedef {Object} FunctionsDeleteDeploymentRequestParams * @property {string} functionId Function ID. @@ -975,7 +958,6 @@ const functionsDeleteDeployment = async ({functionId,deploymentId,parseOutput = return response; } - /** * @typedef {Object} FunctionsGetDeploymentDownloadRequestParams * @property {string} functionId Function ID. @@ -1026,7 +1008,6 @@ const functionsGetDeploymentDownload = async ({functionId,deploymentId,type,pars return response; } - /** * @typedef {Object} FunctionsUpdateDeploymentStatusRequestParams * @property {string} functionId Function ID. @@ -1058,7 +1039,6 @@ const functionsUpdateDeploymentStatus = async ({functionId,deploymentId,parseOut return response; } - /** * @typedef {Object} FunctionsListExecutionsRequestParams * @property {string} functionId Function ID. @@ -1096,7 +1076,6 @@ const functionsListExecutions = async ({functionId,queries,parseOutput = true, o return response; } - /** * @typedef {Object} FunctionsCreateExecutionRequestParams * @property {string} functionId Function ID. @@ -1151,7 +1130,6 @@ const functionsCreateExecution = async ({functionId,body,async,xpath,method,head return response; } - /** * @typedef {Object} FunctionsGetExecutionRequestParams * @property {string} functionId Function ID. @@ -1186,7 +1164,6 @@ const functionsGetExecution = async ({functionId,executionId,parseOutput = true, return response; } - /** * @typedef {Object} FunctionsDeleteExecutionRequestParams * @property {string} functionId Function ID. @@ -1218,11 +1195,10 @@ const functionsDeleteExecution = async ({functionId,executionId,parseOutput = tr return response; } - /** * @typedef {Object} FunctionsGetUsageRequestParams * @property {string} functionId Function ID. - * @property {FunctionUsageRange} range Date range. + * @property {UsageRange} range Date range. * @property {boolean} overrideForCli * @property {boolean} parseOutput * @property {libClient | undefined} sdk @@ -1252,7 +1228,6 @@ const functionsGetUsage = async ({functionId,range,parseOutput = true, overrideF return response; } - /** * @typedef {Object} FunctionsListVariablesRequestParams * @property {string} functionId Function unique ID. @@ -1282,7 +1257,6 @@ const functionsListVariables = async ({functionId,parseOutput = true, overrideFo return response; } - /** * @typedef {Object} FunctionsCreateVariableRequestParams * @property {string} functionId Function unique ID. @@ -1325,7 +1299,6 @@ const functionsCreateVariable = async ({functionId,key,value,secret,parseOutput return response; } - /** * @typedef {Object} FunctionsGetVariableRequestParams * @property {string} functionId Function unique ID. @@ -1356,7 +1329,6 @@ const functionsGetVariable = async ({functionId,variableId,parseOutput = true, o return response; } - /** * @typedef {Object} FunctionsUpdateVariableRequestParams * @property {string} functionId Function unique ID. @@ -1400,7 +1372,6 @@ const functionsUpdateVariable = async ({functionId,variableId,key,value,secret,p return response; } - /** * @typedef {Object} FunctionsDeleteVariableRequestParams * @property {string} functionId Function unique ID. @@ -1432,7 +1403,6 @@ const functionsDeleteVariable = async ({functionId,variableId,parseOutput = true return response; } - functions .command(`list`) .description(`Get a list of all the project's functions. You can use the query params to filter your results.`) diff --git a/lib/commands/graphql.js b/lib/commands/graphql.js index c3c6c0c..b0cf7e4 100644 --- a/lib/commands/graphql.js +++ b/lib/commands/graphql.js @@ -7,7 +7,7 @@ const libClient = require('../client.js'); const { getAllFiles, showConsoleLink } = require('../utils.js'); const { Command } = require('commander'); const { sdkForProject, sdkForConsole } = require('../sdks') -const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log } = require('../parser') +const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log, warn } = require('../parser') const { localConfig, globalConfig } = require("../config"); const { File } = require('undici'); const { ReadableStream } = require('stream/web'); @@ -73,7 +73,6 @@ const graphqlQuery = async ({query,parseOutput = true, overrideForCli = false, s return response; } - /** * @typedef {Object} GraphqlMutationRequestParams * @property {object} query The query or queries to execute. @@ -108,7 +107,6 @@ const graphqlMutation = async ({query,parseOutput = true, overrideForCli = false return response; } - graphql .command(`query`) .description(`Execute a GraphQL mutation.`) diff --git a/lib/commands/health.js b/lib/commands/health.js index 5422e2a..6798870 100644 --- a/lib/commands/health.js +++ b/lib/commands/health.js @@ -7,7 +7,7 @@ const libClient = require('../client.js'); const { getAllFiles, showConsoleLink } = require('../utils.js'); const { Command } = require('commander'); const { sdkForProject, sdkForConsole } = require('../sdks') -const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log } = require('../parser') +const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log, warn } = require('../parser') const { localConfig, globalConfig } = require("../config"); const { File } = require('undici'); const { ReadableStream } = require('stream/web'); @@ -67,7 +67,6 @@ const healthGet = async ({parseOutput = true, overrideForCli = false, sdk = unde return response; } - /** * @typedef {Object} HealthGetAntivirusRequestParams * @property {boolean} overrideForCli @@ -96,7 +95,6 @@ const healthGetAntivirus = async ({parseOutput = true, overrideForCli = false, s return response; } - /** * @typedef {Object} HealthGetCacheRequestParams * @property {boolean} overrideForCli @@ -125,7 +123,6 @@ const healthGetCache = async ({parseOutput = true, overrideForCli = false, sdk = return response; } - /** * @typedef {Object} HealthGetCertificateRequestParams * @property {string} domain string @@ -158,7 +155,6 @@ const healthGetCertificate = async ({domain,parseOutput = true, overrideForCli = return response; } - /** * @typedef {Object} HealthGetDBRequestParams * @property {boolean} overrideForCli @@ -187,7 +183,6 @@ const healthGetDB = async ({parseOutput = true, overrideForCli = false, sdk = un return response; } - /** * @typedef {Object} HealthGetPubSubRequestParams * @property {boolean} overrideForCli @@ -216,7 +211,6 @@ const healthGetPubSub = async ({parseOutput = true, overrideForCli = false, sdk return response; } - /** * @typedef {Object} HealthGetQueueBuildsRequestParams * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. @@ -249,7 +243,6 @@ const healthGetQueueBuilds = async ({threshold,parseOutput = true, overrideForCl return response; } - /** * @typedef {Object} HealthGetQueueCertificatesRequestParams * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. @@ -282,7 +275,6 @@ const healthGetQueueCertificates = async ({threshold,parseOutput = true, overrid return response; } - /** * @typedef {Object} HealthGetQueueDatabasesRequestParams * @property {string} name Queue name for which to check the queue size @@ -319,7 +311,6 @@ const healthGetQueueDatabases = async ({name,threshold,parseOutput = true, overr return response; } - /** * @typedef {Object} HealthGetQueueDeletesRequestParams * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. @@ -352,7 +343,6 @@ const healthGetQueueDeletes = async ({threshold,parseOutput = true, overrideForC return response; } - /** * @typedef {Object} HealthGetFailedJobsRequestParams * @property {Name} name The name of the queue @@ -386,7 +376,6 @@ const healthGetFailedJobs = async ({name,threshold,parseOutput = true, overrideF return response; } - /** * @typedef {Object} HealthGetQueueFunctionsRequestParams * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. @@ -419,7 +408,6 @@ const healthGetQueueFunctions = async ({threshold,parseOutput = true, overrideFo return response; } - /** * @typedef {Object} HealthGetQueueLogsRequestParams * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. @@ -452,7 +440,6 @@ const healthGetQueueLogs = async ({threshold,parseOutput = true, overrideForCli return response; } - /** * @typedef {Object} HealthGetQueueMailsRequestParams * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. @@ -485,7 +472,6 @@ const healthGetQueueMails = async ({threshold,parseOutput = true, overrideForCli return response; } - /** * @typedef {Object} HealthGetQueueMessagingRequestParams * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. @@ -518,7 +504,6 @@ const healthGetQueueMessaging = async ({threshold,parseOutput = true, overrideFo return response; } - /** * @typedef {Object} HealthGetQueueMigrationsRequestParams * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. @@ -551,7 +536,6 @@ const healthGetQueueMigrations = async ({threshold,parseOutput = true, overrideF return response; } - /** * @typedef {Object} HealthGetQueueStatsResourcesRequestParams * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. @@ -584,7 +568,6 @@ const healthGetQueueStatsResources = async ({threshold,parseOutput = true, overr return response; } - /** * @typedef {Object} HealthGetQueueUsageRequestParams * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. @@ -617,7 +600,6 @@ const healthGetQueueUsage = async ({threshold,parseOutput = true, overrideForCli return response; } - /** * @typedef {Object} HealthGetQueueWebhooksRequestParams * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. @@ -650,7 +632,6 @@ const healthGetQueueWebhooks = async ({threshold,parseOutput = true, overrideFor return response; } - /** * @typedef {Object} HealthGetStorageRequestParams * @property {boolean} overrideForCli @@ -679,7 +660,6 @@ const healthGetStorage = async ({parseOutput = true, overrideForCli = false, sdk return response; } - /** * @typedef {Object} HealthGetStorageLocalRequestParams * @property {boolean} overrideForCli @@ -708,7 +688,6 @@ const healthGetStorageLocal = async ({parseOutput = true, overrideForCli = false return response; } - /** * @typedef {Object} HealthGetTimeRequestParams * @property {boolean} overrideForCli @@ -737,7 +716,6 @@ const healthGetTime = async ({parseOutput = true, overrideForCli = false, sdk = return response; } - health .command(`get`) .description(`Check the Appwrite HTTP server is up and responsive.`) diff --git a/lib/commands/init.js b/lib/commands/init.js index b3d8a92..7cbfd43 100644 --- a/lib/commands/init.js +++ b/lib/commands/init.js @@ -117,7 +117,7 @@ const initProject = async ({ organizationId, projectId, projectName } = {}) => { } } - success(`Project successfully ${answers.start === 'existing' ? 'linked' : 'created'}. Details are now stored in appwrite.json file.`); + success(`Project successfully ${answers.start === 'existing' ? 'linked' : 'created'}. Details are now stored in appwrite.config.json file.`); if(answers.start === 'existing') { answers = await inquirer.prompt(questionsInitProjectAutopull); diff --git a/lib/commands/locale.js b/lib/commands/locale.js index 1bd2681..db1a70d 100644 --- a/lib/commands/locale.js +++ b/lib/commands/locale.js @@ -7,7 +7,7 @@ const libClient = require('../client.js'); const { getAllFiles, showConsoleLink } = require('../utils.js'); const { Command } = require('commander'); const { sdkForProject, sdkForConsole } = require('../sdks') -const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log } = require('../parser') +const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log, warn } = require('../parser') const { localConfig, globalConfig } = require("../config"); const { File } = require('undici'); const { ReadableStream } = require('stream/web'); @@ -67,7 +67,6 @@ const localeGet = async ({parseOutput = true, overrideForCli = false, sdk = unde return response; } - /** * @typedef {Object} LocaleListCodesRequestParams * @property {boolean} overrideForCli @@ -96,7 +95,6 @@ const localeListCodes = async ({parseOutput = true, overrideForCli = false, sdk return response; } - /** * @typedef {Object} LocaleListContinentsRequestParams * @property {boolean} overrideForCli @@ -125,7 +123,6 @@ const localeListContinents = async ({parseOutput = true, overrideForCli = false, return response; } - /** * @typedef {Object} LocaleListCountriesRequestParams * @property {boolean} overrideForCli @@ -154,7 +151,6 @@ const localeListCountries = async ({parseOutput = true, overrideForCli = false, return response; } - /** * @typedef {Object} LocaleListCountriesEURequestParams * @property {boolean} overrideForCli @@ -183,7 +179,6 @@ const localeListCountriesEU = async ({parseOutput = true, overrideForCli = false return response; } - /** * @typedef {Object} LocaleListCountriesPhonesRequestParams * @property {boolean} overrideForCli @@ -212,7 +207,6 @@ const localeListCountriesPhones = async ({parseOutput = true, overrideForCli = f return response; } - /** * @typedef {Object} LocaleListCurrenciesRequestParams * @property {boolean} overrideForCli @@ -241,7 +235,6 @@ const localeListCurrencies = async ({parseOutput = true, overrideForCli = false, return response; } - /** * @typedef {Object} LocaleListLanguagesRequestParams * @property {boolean} overrideForCli @@ -270,7 +263,6 @@ const localeListLanguages = async ({parseOutput = true, overrideForCli = false, return response; } - locale .command(`get`) .description(`Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language. ([IP Geolocation by DB-IP](https://db-ip.com))`) diff --git a/lib/commands/messaging.js b/lib/commands/messaging.js index 2949a07..73d6fdc 100644 --- a/lib/commands/messaging.js +++ b/lib/commands/messaging.js @@ -7,7 +7,7 @@ const libClient = require('../client.js'); const { getAllFiles, showConsoleLink } = require('../utils.js'); const { Command } = require('commander'); const { sdkForProject, sdkForConsole } = require('../sdks') -const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log } = require('../parser') +const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log, warn } = require('../parser') const { localConfig, globalConfig } = require("../config"); const { File } = require('undici'); const { ReadableStream } = require('stream/web'); @@ -79,7 +79,6 @@ const messagingListMessages = async ({queries,search,parseOutput = true, overrid return response; } - /** * @typedef {Object} MessagingCreateEmailRequestParams * @property {string} messageId Message 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. @@ -163,7 +162,6 @@ const messagingCreateEmail = async ({messageId,subject,content,topics,users,targ return response; } - /** * @typedef {Object} MessagingUpdateEmailRequestParams * @property {string} messageId Message ID. @@ -244,7 +242,6 @@ const messagingUpdateEmail = async ({messageId,topics,users,targets,subject,cont return response; } - /** * @typedef {Object} MessagingCreatePushRequestParams * @property {string} messageId Message 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. @@ -353,7 +350,6 @@ const messagingCreatePush = async ({messageId,title,body,topics,users,targets,da return response; } - /** * @typedef {Object} MessagingUpdatePushRequestParams * @property {string} messageId Message ID. @@ -459,9 +455,8 @@ const messagingUpdatePush = async ({messageId,topics,users,targets,title,body,da return response; } - /** - * @typedef {Object} MessagingCreateSmsRequestParams + * @typedef {Object} MessagingCreateSMSRequestParams * @property {string} messageId Message 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. * @property {string} content SMS Content. * @property {string[]} topics List of Topic IDs. @@ -475,9 +470,9 @@ const messagingUpdatePush = async ({messageId,topics,users,targets,title,body,da */ /** - * @param {MessagingCreateSmsRequestParams} params + * @param {MessagingCreateSMSRequestParams} params */ -const messagingCreateSms = async ({messageId,content,topics,users,targets,draft,scheduledAt,parseOutput = true, overrideForCli = false, sdk = undefined}) => { +const messagingCreateSMS = async ({messageId,content,topics,users,targets,draft,scheduledAt,parseOutput = true, overrideForCli = false, sdk = undefined}) => { let client = !sdk ? await sdkForProject() : sdk; let apiPath = '/messaging/messages/sms'; @@ -520,9 +515,8 @@ const messagingCreateSms = async ({messageId,content,topics,users,targets,draft, return response; } - /** - * @typedef {Object} MessagingUpdateSmsRequestParams + * @typedef {Object} MessagingUpdateSMSRequestParams * @property {string} messageId Message ID. * @property {string[]} topics List of Topic IDs. * @property {string[]} users List of User IDs. @@ -536,9 +530,9 @@ const messagingCreateSms = async ({messageId,content,topics,users,targets,draft, */ /** - * @param {MessagingUpdateSmsRequestParams} params + * @param {MessagingUpdateSMSRequestParams} params */ -const messagingUpdateSms = async ({messageId,topics,users,targets,content,draft,scheduledAt,parseOutput = true, overrideForCli = false, sdk = undefined}) => { +const messagingUpdateSMS = async ({messageId,topics,users,targets,content,draft,scheduledAt,parseOutput = true, overrideForCli = false, sdk = undefined}) => { let client = !sdk ? await sdkForProject() : sdk; let apiPath = '/messaging/messages/sms/{messageId}'.replace('{messageId}', messageId); @@ -578,7 +572,6 @@ const messagingUpdateSms = async ({messageId,topics,users,targets,content,draft, return response; } - /** * @typedef {Object} MessagingGetMessageRequestParams * @property {string} messageId Message ID. @@ -612,7 +605,6 @@ const messagingGetMessage = async ({messageId,parseOutput = true, overrideForCli return response; } - /** * @typedef {Object} MessagingDeleteRequestParams * @property {string} messageId Message ID. @@ -643,7 +635,6 @@ const messagingDelete = async ({messageId,parseOutput = true, overrideForCli = f return response; } - /** * @typedef {Object} MessagingListMessageLogsRequestParams * @property {string} messageId Message ID. @@ -681,7 +672,6 @@ const messagingListMessageLogs = async ({messageId,queries,parseOutput = true, o return response; } - /** * @typedef {Object} MessagingListTargetsRequestParams * @property {string} messageId Message ID. @@ -715,7 +705,6 @@ const messagingListTargets = async ({messageId,queries,parseOutput = true, overr return response; } - /** * @typedef {Object} MessagingListProvidersRequestParams * @property {string[]} 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, provider, type, enabled @@ -756,9 +745,8 @@ const messagingListProviders = async ({queries,search,parseOutput = true, overri return response; } - /** - * @typedef {Object} MessagingCreateApnsProviderRequestParams + * @typedef {Object} MessagingCreateAPNSProviderRequestParams * @property {string} providerId Provider 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. * @property {string} name Provider name. * @property {string} authKey APNS authentication key. @@ -773,9 +761,9 @@ const messagingListProviders = async ({queries,search,parseOutput = true, overri */ /** - * @param {MessagingCreateApnsProviderRequestParams} params + * @param {MessagingCreateAPNSProviderRequestParams} params */ -const messagingCreateApnsProvider = async ({providerId,name,authKey,authKeyId,teamId,bundleId,sandbox,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => { +const messagingCreateAPNSProvider = async ({providerId,name,authKey,authKeyId,teamId,bundleId,sandbox,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => { let client = !sdk ? await sdkForProject() : sdk; let apiPath = '/messaging/providers/apns'; @@ -818,9 +806,8 @@ const messagingCreateApnsProvider = async ({providerId,name,authKey,authKeyId,te return response; } - /** - * @typedef {Object} MessagingUpdateApnsProviderRequestParams + * @typedef {Object} MessagingUpdateAPNSProviderRequestParams * @property {string} providerId Provider ID. * @property {string} name Provider name. * @property {boolean} enabled Set as enabled. @@ -835,9 +822,9 @@ const messagingCreateApnsProvider = async ({providerId,name,authKey,authKeyId,te */ /** - * @param {MessagingUpdateApnsProviderRequestParams} params + * @param {MessagingUpdateAPNSProviderRequestParams} params */ -const messagingUpdateApnsProvider = async ({providerId,name,enabled,authKey,authKeyId,teamId,bundleId,sandbox,parseOutput = true, overrideForCli = false, sdk = undefined}) => { +const messagingUpdateAPNSProvider = async ({providerId,name,enabled,authKey,authKeyId,teamId,bundleId,sandbox,parseOutput = true, overrideForCli = false, sdk = undefined}) => { let client = !sdk ? await sdkForProject() : sdk; let apiPath = '/messaging/providers/apns/{providerId}'.replace('{providerId}', providerId); @@ -877,9 +864,8 @@ const messagingUpdateApnsProvider = async ({providerId,name,enabled,authKey,auth return response; } - /** - * @typedef {Object} MessagingCreateFcmProviderRequestParams + * @typedef {Object} MessagingCreateFCMProviderRequestParams * @property {string} providerId Provider 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. * @property {string} name Provider name. * @property {object} serviceAccountJSON FCM service account JSON. @@ -890,9 +876,9 @@ const messagingUpdateApnsProvider = async ({providerId,name,enabled,authKey,auth */ /** - * @param {MessagingCreateFcmProviderRequestParams} params + * @param {MessagingCreateFCMProviderRequestParams} params */ -const messagingCreateFcmProvider = async ({providerId,name,serviceAccountJSON,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => { +const messagingCreateFCMProvider = async ({providerId,name,serviceAccountJSON,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => { let client = !sdk ? await sdkForProject() : sdk; let apiPath = '/messaging/providers/fcm'; @@ -923,9 +909,8 @@ const messagingCreateFcmProvider = async ({providerId,name,serviceAccountJSON,en return response; } - /** - * @typedef {Object} MessagingUpdateFcmProviderRequestParams + * @typedef {Object} MessagingUpdateFCMProviderRequestParams * @property {string} providerId Provider ID. * @property {string} name Provider name. * @property {boolean} enabled Set as enabled. @@ -936,9 +921,9 @@ const messagingCreateFcmProvider = async ({providerId,name,serviceAccountJSON,en */ /** - * @param {MessagingUpdateFcmProviderRequestParams} params + * @param {MessagingUpdateFCMProviderRequestParams} params */ -const messagingUpdateFcmProvider = async ({providerId,name,enabled,serviceAccountJSON,parseOutput = true, overrideForCli = false, sdk = undefined}) => { +const messagingUpdateFCMProvider = async ({providerId,name,enabled,serviceAccountJSON,parseOutput = true, overrideForCli = false, sdk = undefined}) => { let client = !sdk ? await sdkForProject() : sdk; let apiPath = '/messaging/providers/fcm/{providerId}'.replace('{providerId}', providerId); @@ -966,7 +951,6 @@ const messagingUpdateFcmProvider = async ({providerId,name,enabled,serviceAccoun return response; } - /** * @typedef {Object} MessagingCreateMailgunProviderRequestParams * @property {string} providerId Provider 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. @@ -1036,7 +1020,6 @@ const messagingCreateMailgunProvider = async ({providerId,name,apiKey,domain,isE return response; } - /** * @typedef {Object} MessagingUpdateMailgunProviderRequestParams * @property {string} providerId Provider ID. @@ -1103,7 +1086,6 @@ const messagingUpdateMailgunProvider = async ({providerId,name,apiKey,domain,isE return response; } - /** * @typedef {Object} MessagingCreateMsg91ProviderRequestParams * @property {string} providerId Provider 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. @@ -1157,7 +1139,6 @@ const messagingCreateMsg91Provider = async ({providerId,name,templateId,senderId return response; } - /** * @typedef {Object} MessagingUpdateMsg91ProviderRequestParams * @property {string} providerId Provider ID. @@ -1208,7 +1189,6 @@ const messagingUpdateMsg91Provider = async ({providerId,name,enabled,templateId, return response; } - /** * @typedef {Object} MessagingCreateSendgridProviderRequestParams * @property {string} providerId Provider 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. @@ -1270,7 +1250,6 @@ const messagingCreateSendgridProvider = async ({providerId,name,apiKey,fromName, return response; } - /** * @typedef {Object} MessagingUpdateSendgridProviderRequestParams * @property {string} providerId Provider ID. @@ -1329,9 +1308,8 @@ const messagingUpdateSendgridProvider = async ({providerId,name,enabled,apiKey,f return response; } - /** - * @typedef {Object} MessagingCreateSmtpProviderRequestParams + * @typedef {Object} MessagingCreateSMTPProviderRequestParams * @property {string} providerId Provider 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. * @property {string} name Provider name. * @property {string} host SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as 'smtp1.example.com:25;smtp2.example.com'. You can also specify encryption type, for example: 'tls://smtp1.example.com:587;ssl://smtp2.example.com:465"'. Hosts will be tried in order. @@ -1352,9 +1330,9 @@ const messagingUpdateSendgridProvider = async ({providerId,name,enabled,apiKey,f */ /** - * @param {MessagingCreateSmtpProviderRequestParams} params + * @param {MessagingCreateSMTPProviderRequestParams} params */ -const messagingCreateSmtpProvider = async ({providerId,name,host,port,username,password,encryption,autoTLS,mailer,fromName,fromEmail,replyToName,replyToEmail,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => { +const messagingCreateSMTPProvider = async ({providerId,name,host,port,username,password,encryption,autoTLS,mailer,fromName,fromEmail,replyToName,replyToEmail,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => { let client = !sdk ? await sdkForProject() : sdk; let apiPath = '/messaging/providers/smtp'; @@ -1415,9 +1393,8 @@ const messagingCreateSmtpProvider = async ({providerId,name,host,port,username,p return response; } - /** - * @typedef {Object} MessagingUpdateSmtpProviderRequestParams + * @typedef {Object} MessagingUpdateSMTPProviderRequestParams * @property {string} providerId Provider ID. * @property {string} name Provider name. * @property {string} host SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as 'smtp1.example.com:25;smtp2.example.com'. You can also specify encryption type, for example: 'tls://smtp1.example.com:587;ssl://smtp2.example.com:465"'. Hosts will be tried in order. @@ -1438,9 +1415,9 @@ const messagingCreateSmtpProvider = async ({providerId,name,host,port,username,p */ /** - * @param {MessagingUpdateSmtpProviderRequestParams} params + * @param {MessagingUpdateSMTPProviderRequestParams} params */ -const messagingUpdateSmtpProvider = async ({providerId,name,host,port,username,password,encryption,autoTLS,mailer,fromName,fromEmail,replyToName,replyToEmail,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => { +const messagingUpdateSMTPProvider = async ({providerId,name,host,port,username,password,encryption,autoTLS,mailer,fromName,fromEmail,replyToName,replyToEmail,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => { let client = !sdk ? await sdkForProject() : sdk; let apiPath = '/messaging/providers/smtp/{providerId}'.replace('{providerId}', providerId); @@ -1498,7 +1475,6 @@ const messagingUpdateSmtpProvider = async ({providerId,name,host,port,username,p return response; } - /** * @typedef {Object} MessagingCreateTelesignProviderRequestParams * @property {string} providerId Provider 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. @@ -1552,7 +1528,6 @@ const messagingCreateTelesignProvider = async ({providerId,name,from,customerId, return response; } - /** * @typedef {Object} MessagingUpdateTelesignProviderRequestParams * @property {string} providerId Provider ID. @@ -1603,7 +1578,6 @@ const messagingUpdateTelesignProvider = async ({providerId,name,enabled,customer return response; } - /** * @typedef {Object} MessagingCreateTextmagicProviderRequestParams * @property {string} providerId Provider 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. @@ -1657,7 +1631,6 @@ const messagingCreateTextmagicProvider = async ({providerId,name,from,username,a return response; } - /** * @typedef {Object} MessagingUpdateTextmagicProviderRequestParams * @property {string} providerId Provider ID. @@ -1708,7 +1681,6 @@ const messagingUpdateTextmagicProvider = async ({providerId,name,enabled,usernam return response; } - /** * @typedef {Object} MessagingCreateTwilioProviderRequestParams * @property {string} providerId Provider 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,7 +1734,6 @@ const messagingCreateTwilioProvider = async ({providerId,name,from,accountSid,au return response; } - /** * @typedef {Object} MessagingUpdateTwilioProviderRequestParams * @property {string} providerId Provider ID. @@ -1813,7 +1784,6 @@ const messagingUpdateTwilioProvider = async ({providerId,name,enabled,accountSid return response; } - /** * @typedef {Object} MessagingCreateVonageProviderRequestParams * @property {string} providerId Provider 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. @@ -1867,7 +1837,6 @@ const messagingCreateVonageProvider = async ({providerId,name,from,apiKey,apiSec return response; } - /** * @typedef {Object} MessagingUpdateVonageProviderRequestParams * @property {string} providerId Provider ID. @@ -1918,7 +1887,6 @@ const messagingUpdateVonageProvider = async ({providerId,name,enabled,apiKey,api return response; } - /** * @typedef {Object} MessagingGetProviderRequestParams * @property {string} providerId Provider ID. @@ -1952,7 +1920,6 @@ const messagingGetProvider = async ({providerId,parseOutput = true, overrideForC return response; } - /** * @typedef {Object} MessagingDeleteProviderRequestParams * @property {string} providerId Provider ID. @@ -1983,7 +1950,6 @@ const messagingDeleteProvider = async ({providerId,parseOutput = true, overrideF return response; } - /** * @typedef {Object} MessagingListProviderLogsRequestParams * @property {string} providerId Provider ID. @@ -2017,7 +1983,6 @@ const messagingListProviderLogs = async ({providerId,queries,parseOutput = true, return response; } - /** * @typedef {Object} MessagingListSubscriberLogsRequestParams * @property {string} subscriberId Subscriber ID. @@ -2051,7 +2016,6 @@ const messagingListSubscriberLogs = async ({subscriberId,queries,parseOutput = t return response; } - /** * @typedef {Object} MessagingListTopicsRequestParams * @property {string[]} 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, description, emailTotal, smsTotal, pushTotal @@ -2092,7 +2056,6 @@ const messagingListTopics = async ({queries,search,parseOutput = true, overrideF return response; } - /** * @typedef {Object} MessagingCreateTopicRequestParams * @property {string} topicId Topic ID. Choose a custom Topic ID or a new Topic ID. @@ -2135,7 +2098,6 @@ const messagingCreateTopic = async ({topicId,name,subscribe,parseOutput = true, return response; } - /** * @typedef {Object} MessagingGetTopicRequestParams * @property {string} topicId Topic ID. @@ -2169,7 +2131,6 @@ const messagingGetTopic = async ({topicId,parseOutput = true, overrideForCli = f return response; } - /** * @typedef {Object} MessagingUpdateTopicRequestParams * @property {string} topicId Topic ID. @@ -2209,7 +2170,6 @@ const messagingUpdateTopic = async ({topicId,name,subscribe,parseOutput = true, return response; } - /** * @typedef {Object} MessagingDeleteTopicRequestParams * @property {string} topicId Topic ID. @@ -2240,7 +2200,6 @@ const messagingDeleteTopic = async ({topicId,parseOutput = true, overrideForCli return response; } - /** * @typedef {Object} MessagingListTopicLogsRequestParams * @property {string} topicId Topic ID. @@ -2274,7 +2233,6 @@ const messagingListTopicLogs = async ({topicId,queries,parseOutput = true, overr return response; } - /** * @typedef {Object} MessagingListSubscribersRequestParams * @property {string} topicId Topic ID. The topic ID subscribed to. @@ -2316,7 +2274,6 @@ const messagingListSubscribers = async ({topicId,queries,search,parseOutput = tr return response; } - /** * @typedef {Object} MessagingCreateSubscriberRequestParams * @property {string} topicId Topic ID. The topic ID to subscribe to. @@ -2355,7 +2312,6 @@ const messagingCreateSubscriber = async ({topicId,subscriberId,targetId,parseOut return response; } - /** * @typedef {Object} MessagingGetSubscriberRequestParams * @property {string} topicId Topic ID. The topic ID subscribed to. @@ -2386,7 +2342,6 @@ const messagingGetSubscriber = async ({topicId,subscriberId,parseOutput = true, return response; } - /** * @typedef {Object} MessagingDeleteSubscriberRequestParams * @property {string} topicId Topic ID. The topic ID subscribed to. @@ -2418,7 +2373,6 @@ const messagingDeleteSubscriber = async ({topicId,subscriberId,parseOutput = tru return response; } - messaging .command(`list-messages`) .description(`Get a list of all messages from the current Appwrite project.`) @@ -2519,7 +2473,7 @@ messaging .option(`--targets [targets...]`, `List of Targets IDs.`) .option(`--draft [value]`, `Is message a draft`, (value) => value === undefined ? true : parseBool(value)) .option(`--scheduled-at `, `Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.`) - .action(actionRunner(messagingCreateSms)) + .action(actionRunner(messagingCreateSMS)) messaging .command(`update-sms`) @@ -2531,7 +2485,7 @@ messaging .option(`--content `, `Email Content.`) .option(`--draft [value]`, `Is message a draft`, (value) => value === undefined ? true : parseBool(value)) .option(`--scheduled-at `, `Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.`) - .action(actionRunner(messagingUpdateSms)) + .action(actionRunner(messagingUpdateSMS)) messaging .command(`get-message`) @@ -2580,7 +2534,7 @@ messaging .option(`--bundle-id `, `APNS bundle ID.`) .option(`--sandbox [value]`, `Use APNS sandbox environment.`, (value) => value === undefined ? true : parseBool(value)) .option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value)) - .action(actionRunner(messagingCreateApnsProvider)) + .action(actionRunner(messagingCreateAPNSProvider)) messaging .command(`update-apns-provider`) @@ -2593,7 +2547,7 @@ messaging .option(`--team-id `, `APNS team ID.`) .option(`--bundle-id `, `APNS bundle ID.`) .option(`--sandbox [value]`, `Use APNS sandbox environment.`, (value) => value === undefined ? true : parseBool(value)) - .action(actionRunner(messagingUpdateApnsProvider)) + .action(actionRunner(messagingUpdateAPNSProvider)) messaging .command(`create-fcm-provider`) @@ -2602,7 +2556,7 @@ messaging .requiredOption(`--name `, `Provider name.`) .option(`--service-account-json `, `FCM service account JSON.`) .option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value)) - .action(actionRunner(messagingCreateFcmProvider)) + .action(actionRunner(messagingCreateFCMProvider)) messaging .command(`update-fcm-provider`) @@ -2611,7 +2565,7 @@ messaging .option(`--name `, `Provider name.`) .option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value)) .option(`--service-account-json `, `FCM service account JSON.`) - .action(actionRunner(messagingUpdateFcmProvider)) + .action(actionRunner(messagingUpdateFCMProvider)) messaging .command(`create-mailgun-provider`) @@ -2708,7 +2662,7 @@ messaging .option(`--reply-to-name `, `Name set in the reply to field for the mail. Default value is sender name.`) .option(`--reply-to-email `, `Email set in the reply to field for the mail. Default value is sender email.`) .option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value)) - .action(actionRunner(messagingCreateSmtpProvider)) + .action(actionRunner(messagingCreateSMTPProvider)) messaging .command(`update-smtp-provider`) @@ -2727,7 +2681,7 @@ messaging .option(`--reply-to-name `, `Name set in the Reply To field for the mail. Default value is Sender Name.`) .option(`--reply-to-email `, `Email set in the Reply To field for the mail. Default value is Sender Email.`) .option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value)) - .action(actionRunner(messagingUpdateSmtpProvider)) + .action(actionRunner(messagingUpdateSMTPProvider)) messaging .command(`create-telesign-provider`) @@ -2926,25 +2880,25 @@ module.exports = { messagingUpdateEmail, messagingCreatePush, messagingUpdatePush, - messagingCreateSms, - messagingUpdateSms, + messagingCreateSMS, + messagingUpdateSMS, messagingGetMessage, messagingDelete, messagingListMessageLogs, messagingListTargets, messagingListProviders, - messagingCreateApnsProvider, - messagingUpdateApnsProvider, - messagingCreateFcmProvider, - messagingUpdateFcmProvider, + messagingCreateAPNSProvider, + messagingUpdateAPNSProvider, + messagingCreateFCMProvider, + messagingUpdateFCMProvider, messagingCreateMailgunProvider, messagingUpdateMailgunProvider, messagingCreateMsg91Provider, messagingUpdateMsg91Provider, messagingCreateSendgridProvider, messagingUpdateSendgridProvider, - messagingCreateSmtpProvider, - messagingUpdateSmtpProvider, + messagingCreateSMTPProvider, + messagingUpdateSMTPProvider, messagingCreateTelesignProvider, messagingUpdateTelesignProvider, messagingCreateTextmagicProvider, diff --git a/lib/commands/migrations.js b/lib/commands/migrations.js index 41d4670..792ec7d 100644 --- a/lib/commands/migrations.js +++ b/lib/commands/migrations.js @@ -7,7 +7,7 @@ const libClient = require('../client.js'); const { getAllFiles, showConsoleLink } = require('../utils.js'); const { Command } = require('commander'); const { sdkForProject, sdkForConsole } = require('../sdks') -const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log } = require('../parser') +const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log, warn } = require('../parser') const { localConfig, globalConfig } = require("../config"); const { File } = require('undici'); const { ReadableStream } = require('stream/web'); @@ -75,7 +75,6 @@ const migrationsList = async ({queries,search,parseOutput = true, overrideForCli return response; } - /** * @typedef {Object} MigrationsCreateAppwriteMigrationRequestParams * @property {string[]} resources List of resources to migrate @@ -122,7 +121,6 @@ const migrationsCreateAppwriteMigration = async ({resources,endpoint,projectId,a return response; } - /** * @typedef {Object} MigrationsGetAppwriteReportRequestParams * @property {string[]} resources List of resources to migrate @@ -167,12 +165,12 @@ const migrationsGetAppwriteReport = async ({resources,endpoint,projectID,key,par return response; } - /** * @typedef {Object} MigrationsCreateCsvMigrationRequestParams * @property {string} bucketId Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). * @property {string} fileId File ID. * @property {string} resourceId Composite ID in the format {databaseId:collectionId}, identifying a collection within a database. + * @property {boolean} internalFile Is the file stored in an internal bucket? * @property {boolean} overrideForCli * @property {boolean} parseOutput * @property {libClient | undefined} sdk @@ -181,7 +179,7 @@ const migrationsGetAppwriteReport = async ({resources,endpoint,projectID,key,par /** * @param {MigrationsCreateCsvMigrationRequestParams} params */ -const migrationsCreateCsvMigration = async ({bucketId,fileId,resourceId,parseOutput = true, overrideForCli = false, sdk = undefined}) => { +const migrationsCreateCsvMigration = async ({bucketId,fileId,resourceId,internalFile,parseOutput = true, overrideForCli = false, sdk = undefined}) => { let client = !sdk ? await sdkForProject() : sdk; let apiPath = '/migrations/csv'; @@ -195,6 +193,9 @@ const migrationsCreateCsvMigration = async ({bucketId,fileId,resourceId,parseOut if (typeof resourceId !== 'undefined') { payload['resourceId'] = resourceId; } + if (typeof internalFile !== 'undefined') { + payload['internalFile'] = internalFile; + } let response = undefined; @@ -209,7 +210,6 @@ const migrationsCreateCsvMigration = async ({bucketId,fileId,resourceId,parseOut return response; } - /** * @typedef {Object} MigrationsCreateFirebaseMigrationRequestParams * @property {string[]} resources List of resources to migrate @@ -248,7 +248,6 @@ const migrationsCreateFirebaseMigration = async ({resources,serviceAccount,parse return response; } - /** * @typedef {Object} MigrationsGetFirebaseReportRequestParams * @property {string[]} resources List of resources to migrate @@ -285,7 +284,6 @@ const migrationsGetFirebaseReport = async ({resources,serviceAccount,parseOutput return response; } - /** * @typedef {Object} MigrationsCreateNHostMigrationRequestParams * @property {string[]} resources List of resources to migrate @@ -348,7 +346,6 @@ const migrationsCreateNHostMigration = async ({resources,subdomain,region,adminS return response; } - /** * @typedef {Object} MigrationsGetNHostReportRequestParams * @property {string[]} resources List of resources to migrate. @@ -409,7 +406,6 @@ const migrationsGetNHostReport = async ({resources,subdomain,region,adminSecret, return response; } - /** * @typedef {Object} MigrationsCreateSupabaseMigrationRequestParams * @property {string[]} resources List of resources to migrate @@ -468,7 +464,6 @@ const migrationsCreateSupabaseMigration = async ({resources,endpoint,apiKey,data return response; } - /** * @typedef {Object} MigrationsGetSupabaseReportRequestParams * @property {string[]} resources List of resources to migrate @@ -525,7 +520,6 @@ const migrationsGetSupabaseReport = async ({resources,endpoint,apiKey,databaseHo return response; } - /** * @typedef {Object} MigrationsGetRequestParams * @property {string} migrationId Migration unique ID. @@ -555,7 +549,6 @@ const migrationsGet = async ({migrationId,parseOutput = true, overrideForCli = f return response; } - /** * @typedef {Object} MigrationsRetryRequestParams * @property {string} migrationId Migration unique ID. @@ -586,7 +579,6 @@ const migrationsRetry = async ({migrationId,parseOutput = true, overrideForCli = return response; } - /** * @typedef {Object} MigrationsDeleteRequestParams * @property {string} migrationId Migration ID. @@ -617,7 +609,6 @@ const migrationsDelete = async ({migrationId,parseOutput = true, overrideForCli return response; } - migrations .command(`list`) .description(`List all migrations in the current project. This endpoint returns a list of all migrations including their status, progress, and any errors that occurred during the migration process.`) @@ -649,6 +640,7 @@ migrations .requiredOption(`--bucket-id `, `Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).`) .requiredOption(`--file-id `, `File ID.`) .requiredOption(`--resource-id `, `Composite ID in the format {databaseId:collectionId}, identifying a collection within a database.`) + .option(`--internal-file [value]`, `Is the file stored in an internal bucket?`, (value) => value === undefined ? true : parseBool(value)) .action(actionRunner(migrationsCreateCsvMigration)) migrations diff --git a/lib/commands/project.js b/lib/commands/project.js index f162089..cb9ebbc 100644 --- a/lib/commands/project.js +++ b/lib/commands/project.js @@ -7,7 +7,7 @@ const libClient = require('../client.js'); const { getAllFiles, showConsoleLink } = require('../utils.js'); const { Command } = require('commander'); const { sdkForProject, sdkForConsole } = require('../sdks') -const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log } = require('../parser') +const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log, warn } = require('../parser') const { localConfig, globalConfig } = require("../config"); const { File } = require('undici'); const { ReadableStream } = require('stream/web'); @@ -79,7 +79,6 @@ const projectGetUsage = async ({startDate,endDate,period,parseOutput = true, ove return response; } - /** * @typedef {Object} ProjectListVariablesRequestParams * @property {boolean} overrideForCli @@ -108,7 +107,6 @@ const projectListVariables = async ({parseOutput = true, overrideForCli = false, return response; } - /** * @typedef {Object} ProjectCreateVariableRequestParams * @property {string} key Variable key. Max length: 255 chars. @@ -150,7 +148,6 @@ const projectCreateVariable = async ({key,value,secret,parseOutput = true, overr return response; } - /** * @typedef {Object} ProjectGetVariableRequestParams * @property {string} variableId Variable unique ID. @@ -180,7 +177,6 @@ const projectGetVariable = async ({variableId,parseOutput = true, overrideForCli return response; } - /** * @typedef {Object} ProjectUpdateVariableRequestParams * @property {string} variableId Variable unique ID. @@ -223,7 +219,6 @@ const projectUpdateVariable = async ({variableId,key,value,secret,parseOutput = return response; } - /** * @typedef {Object} ProjectDeleteVariableRequestParams * @property {string} variableId Variable unique ID. @@ -254,7 +249,6 @@ const projectDeleteVariable = async ({variableId,parseOutput = true, overrideFor return response; } - project .command(`get-usage`) .description(`Get comprehensive usage statistics for your project. View metrics including network requests, bandwidth, storage, function executions, database usage, and user activity. Specify a time range with startDate and endDate, and optionally set the data granularity with period (1h or 1d). The response includes both total counts and detailed breakdowns by resource, along with historical data over the specified period.`) diff --git a/lib/commands/projects.js b/lib/commands/projects.js index bee0765..bda0165 100644 --- a/lib/commands/projects.js +++ b/lib/commands/projects.js @@ -7,7 +7,7 @@ const libClient = require('../client.js'); const { getAllFiles, showConsoleLink } = require('../utils.js'); const { Command } = require('commander'); const { sdkForProject, sdkForConsole } = require('../sdks') -const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log } = require('../parser') +const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log, warn } = require('../parser') const { localConfig, globalConfig } = require("../config"); const { File } = require('undici'); const { ReadableStream } = require('stream/web'); @@ -79,7 +79,6 @@ const projectsList = async ({queries,search,parseOutput = true, overrideForCli = return response; } - /** * @typedef {Object} ProjectsCreateRequestParams * @property {string} projectId Unique Id. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, and hyphen. Can't start with a special char. Max length is 36 chars. @@ -161,7 +160,6 @@ const projectsCreate = async ({projectId,name,teamId,region,description,logo,url return response; } - /** * @typedef {Object} ProjectsGetRequestParams * @property {string} projectId Project unique ID. @@ -195,7 +193,6 @@ const projectsGet = async ({projectId,parseOutput = true, overrideForCli = false return response; } - /** * @typedef {Object} ProjectsUpdateRequestParams * @property {string} projectId Project unique ID. @@ -266,7 +263,6 @@ const projectsUpdate = async ({projectId,name,description,logo,url,legalName,leg return response; } - /** * @typedef {Object} ProjectsDeleteRequestParams * @property {string} projectId Project unique ID. @@ -297,9 +293,8 @@ const projectsDelete = async ({projectId,parseOutput = true, overrideForCli = fa return response; } - /** - * @typedef {Object} ProjectsUpdateApiStatusRequestParams + * @typedef {Object} ProjectsUpdateAPIStatusRequestParams * @property {string} projectId Project unique ID. * @property {Api} api API name. * @property {boolean} status API status. @@ -309,9 +304,9 @@ const projectsDelete = async ({projectId,parseOutput = true, overrideForCli = fa */ /** - * @param {ProjectsUpdateApiStatusRequestParams} params + * @param {ProjectsUpdateAPIStatusRequestParams} params */ -const projectsUpdateApiStatus = async ({projectId,api,status,parseOutput = true, overrideForCli = false, sdk = undefined}) => { +const projectsUpdateAPIStatus = async ({projectId,api,status,parseOutput = true, overrideForCli = false, sdk = undefined}) => { let client = !sdk ? await sdkForConsole() : sdk; let apiPath = '/projects/{projectId}/api'.replace('{projectId}', projectId); @@ -336,9 +331,8 @@ const projectsUpdateApiStatus = async ({projectId,api,status,parseOutput = true, return response; } - /** - * @typedef {Object} ProjectsUpdateApiStatusAllRequestParams + * @typedef {Object} ProjectsUpdateAPIStatusAllRequestParams * @property {string} projectId Project unique ID. * @property {boolean} status API status. * @property {boolean} overrideForCli @@ -347,9 +341,9 @@ const projectsUpdateApiStatus = async ({projectId,api,status,parseOutput = true, */ /** - * @param {ProjectsUpdateApiStatusAllRequestParams} params + * @param {ProjectsUpdateAPIStatusAllRequestParams} params */ -const projectsUpdateApiStatusAll = async ({projectId,status,parseOutput = true, overrideForCli = false, sdk = undefined}) => { +const projectsUpdateAPIStatusAll = async ({projectId,status,parseOutput = true, overrideForCli = false, sdk = undefined}) => { let client = !sdk ? await sdkForConsole() : sdk; let apiPath = '/projects/{projectId}/api/all'.replace('{projectId}', projectId); @@ -371,7 +365,6 @@ const projectsUpdateApiStatusAll = async ({projectId,status,parseOutput = true, return response; } - /** * @typedef {Object} ProjectsUpdateAuthDurationRequestParams * @property {string} projectId Project unique ID. @@ -406,7 +399,6 @@ const projectsUpdateAuthDuration = async ({projectId,duration,parseOutput = true return response; } - /** * @typedef {Object} ProjectsUpdateAuthLimitRequestParams * @property {string} projectId Project unique ID. @@ -441,7 +433,6 @@ const projectsUpdateAuthLimit = async ({projectId,limit,parseOutput = true, over return response; } - /** * @typedef {Object} ProjectsUpdateAuthSessionsLimitRequestParams * @property {string} projectId Project unique ID. @@ -476,7 +467,6 @@ const projectsUpdateAuthSessionsLimit = async ({projectId,limit,parseOutput = tr return response; } - /** * @typedef {Object} ProjectsUpdateMembershipsPrivacyRequestParams * @property {string} projectId Project unique ID. @@ -519,7 +509,6 @@ const projectsUpdateMembershipsPrivacy = async ({projectId,userName,userEmail,mf return response; } - /** * @typedef {Object} ProjectsUpdateMockNumbersRequestParams * @property {string} projectId Project unique ID. @@ -555,7 +544,6 @@ const projectsUpdateMockNumbers = async ({projectId,numbers,parseOutput = true, return response; } - /** * @typedef {Object} ProjectsUpdateAuthPasswordDictionaryRequestParams * @property {string} projectId Project unique ID. @@ -590,7 +578,6 @@ const projectsUpdateAuthPasswordDictionary = async ({projectId,enabled,parseOutp return response; } - /** * @typedef {Object} ProjectsUpdateAuthPasswordHistoryRequestParams * @property {string} projectId Project unique ID. @@ -625,7 +612,6 @@ const projectsUpdateAuthPasswordHistory = async ({projectId,limit,parseOutput = return response; } - /** * @typedef {Object} ProjectsUpdatePersonalDataCheckRequestParams * @property {string} projectId Project unique ID. @@ -660,7 +646,6 @@ const projectsUpdatePersonalDataCheck = async ({projectId,enabled,parseOutput = return response; } - /** * @typedef {Object} ProjectsUpdateSessionAlertsRequestParams * @property {string} projectId Project unique ID. @@ -695,7 +680,40 @@ const projectsUpdateSessionAlerts = async ({projectId,alerts,parseOutput = true, return response; } +/** + * @typedef {Object} ProjectsUpdateSessionInvalidationRequestParams + * @property {string} projectId Project unique ID. + * @property {boolean} enabled Update authentication session invalidation status. Use this endpoint to enable or disable session invalidation on password change + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ +/** + * @param {ProjectsUpdateSessionInvalidationRequestParams} params + */ +const projectsUpdateSessionInvalidation = async ({projectId,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForConsole() : + sdk; + let apiPath = '/projects/{projectId}/auth/session-invalidation'.replace('{projectId}', projectId); + let payload = {}; + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + + let response = undefined; + + response = await client.call('patch', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} /** * @typedef {Object} ProjectsUpdateAuthStatusRequestParams * @property {string} projectId Project unique ID. @@ -731,7 +749,6 @@ const projectsUpdateAuthStatus = async ({projectId,method,status,parseOutput = t return response; } - /** * @typedef {Object} ProjectsListDevKeysRequestParams * @property {string} projectId Project unique ID. @@ -769,7 +786,6 @@ const projectsListDevKeys = async ({projectId,queries,parseOutput = true, overri return response; } - /** * @typedef {Object} ProjectsCreateDevKeyRequestParams * @property {string} projectId Project unique ID. @@ -808,7 +824,6 @@ const projectsCreateDevKey = async ({projectId,name,expire,parseOutput = true, o return response; } - /** * @typedef {Object} ProjectsGetDevKeyRequestParams * @property {string} projectId Project unique ID. @@ -843,7 +858,6 @@ const projectsGetDevKey = async ({projectId,keyId,parseOutput = true, overrideFo return response; } - /** * @typedef {Object} ProjectsUpdateDevKeyRequestParams * @property {string} projectId Project unique ID. @@ -883,7 +897,6 @@ const projectsUpdateDevKey = async ({projectId,keyId,name,expire,parseOutput = t return response; } - /** * @typedef {Object} ProjectsDeleteDevKeyRequestParams * @property {string} projectId Project unique ID. @@ -915,7 +928,6 @@ const projectsDeleteDevKey = async ({projectId,keyId,parseOutput = true, overrid return response; } - /** * @typedef {Object} ProjectsCreateJWTRequestParams * @property {string} projectId Project unique ID. @@ -955,7 +967,6 @@ const projectsCreateJWT = async ({projectId,scopes,duration,parseOutput = true, return response; } - /** * @typedef {Object} ProjectsListKeysRequestParams * @property {string} projectId Project unique ID. @@ -989,7 +1000,6 @@ const projectsListKeys = async ({projectId,parseOutput = true, overrideForCli = return response; } - /** * @typedef {Object} ProjectsCreateKeyRequestParams * @property {string} projectId Project unique ID. @@ -1033,7 +1043,6 @@ const projectsCreateKey = async ({projectId,name,scopes,expire,parseOutput = tru return response; } - /** * @typedef {Object} ProjectsGetKeyRequestParams * @property {string} projectId Project unique ID. @@ -1068,7 +1077,6 @@ const projectsGetKey = async ({projectId,keyId,parseOutput = true, overrideForCl return response; } - /** * @typedef {Object} ProjectsUpdateKeyRequestParams * @property {string} projectId Project unique ID. @@ -1113,7 +1121,6 @@ const projectsUpdateKey = async ({projectId,keyId,name,scopes,expire,parseOutput return response; } - /** * @typedef {Object} ProjectsDeleteKeyRequestParams * @property {string} projectId Project unique ID. @@ -1145,7 +1152,6 @@ const projectsDeleteKey = async ({projectId,keyId,parseOutput = true, overrideFo return response; } - /** * @typedef {Object} ProjectsUpdateOAuth2RequestParams * @property {string} projectId Project unique ID. @@ -1192,7 +1198,6 @@ const projectsUpdateOAuth2 = async ({projectId,provider,appId,secret,enabled,par return response; } - /** * @typedef {Object} ProjectsListPlatformsRequestParams * @property {string} projectId Project unique ID. @@ -1226,7 +1231,6 @@ const projectsListPlatforms = async ({projectId,parseOutput = true, overrideForC return response; } - /** * @typedef {Object} ProjectsCreatePlatformRequestParams * @property {string} projectId Project unique ID. @@ -1277,7 +1281,6 @@ const projectsCreatePlatform = async ({projectId,type,name,key,store,hostname,pa return response; } - /** * @typedef {Object} ProjectsGetPlatformRequestParams * @property {string} projectId Project unique ID. @@ -1312,7 +1315,6 @@ const projectsGetPlatform = async ({projectId,platformId,parseOutput = true, ove return response; } - /** * @typedef {Object} ProjectsUpdatePlatformRequestParams * @property {string} projectId Project unique ID. @@ -1360,7 +1362,6 @@ const projectsUpdatePlatform = async ({projectId,platformId,name,key,store,hostn return response; } - /** * @typedef {Object} ProjectsDeletePlatformRequestParams * @property {string} projectId Project unique ID. @@ -1392,7 +1393,6 @@ const projectsDeletePlatform = async ({projectId,platformId,parseOutput = true, return response; } - /** * @typedef {Object} ProjectsUpdateServiceStatusRequestParams * @property {string} projectId Project unique ID. @@ -1431,7 +1431,6 @@ const projectsUpdateServiceStatus = async ({projectId,service,status,parseOutput return response; } - /** * @typedef {Object} ProjectsUpdateServiceStatusAllRequestParams * @property {string} projectId Project unique ID. @@ -1466,9 +1465,8 @@ const projectsUpdateServiceStatusAll = async ({projectId,status,parseOutput = tr return response; } - /** - * @typedef {Object} ProjectsUpdateSmtpRequestParams + * @typedef {Object} ProjectsUpdateSMTPRequestParams * @property {string} projectId Project unique ID. * @property {boolean} enabled Enable custom SMTP service * @property {string} senderName Name of the email sender @@ -1485,9 +1483,9 @@ const projectsUpdateServiceStatusAll = async ({projectId,status,parseOutput = tr */ /** - * @param {ProjectsUpdateSmtpRequestParams} params + * @param {ProjectsUpdateSMTPRequestParams} params */ -const projectsUpdateSmtp = async ({projectId,enabled,senderName,senderEmail,replyTo,host,port,username,password,secure,parseOutput = true, overrideForCli = false, sdk = undefined}) => { +const projectsUpdateSMTP = async ({projectId,enabled,senderName,senderEmail,replyTo,host,port,username,password,secure,parseOutput = true, overrideForCli = false, sdk = undefined}) => { let client = !sdk ? await sdkForConsole() : sdk; let apiPath = '/projects/{projectId}/smtp'.replace('{projectId}', projectId); @@ -1533,9 +1531,8 @@ const projectsUpdateSmtp = async ({projectId,enabled,senderName,senderEmail,repl return response; } - /** - * @typedef {Object} ProjectsCreateSmtpTestRequestParams + * @typedef {Object} ProjectsCreateSMTPTestRequestParams * @property {string} projectId Project unique ID. * @property {string[]} emails Array of emails to send test email to. Maximum of 10 emails are allowed. * @property {string} senderName Name of the email sender @@ -1552,9 +1549,9 @@ const projectsUpdateSmtp = async ({projectId,enabled,senderName,senderEmail,repl */ /** - * @param {ProjectsCreateSmtpTestRequestParams} params + * @param {ProjectsCreateSMTPTestRequestParams} params */ -const projectsCreateSmtpTest = async ({projectId,emails,senderName,senderEmail,host,replyTo,port,username,password,secure,parseOutput = true, overrideForCli = false, sdk = undefined}) => { +const projectsCreateSMTPTest = async ({projectId,emails,senderName,senderEmail,host,replyTo,port,username,password,secure,parseOutput = true, overrideForCli = false, sdk = undefined}) => { let client = !sdk ? await sdkForConsole() : sdk; let apiPath = '/projects/{projectId}/smtp/tests'.replace('{projectId}', projectId); @@ -1601,7 +1598,6 @@ const projectsCreateSmtpTest = async ({projectId,emails,senderName,senderEmail,h return response; } - /** * @typedef {Object} ProjectsUpdateTeamRequestParams * @property {string} projectId Project unique ID. @@ -1636,7 +1632,6 @@ const projectsUpdateTeam = async ({projectId,teamId,parseOutput = true, override return response; } - /** * @typedef {Object} ProjectsGetEmailTemplateRequestParams * @property {string} projectId Project unique ID. @@ -1668,7 +1663,6 @@ const projectsGetEmailTemplate = async ({projectId,type,locale,parseOutput = tru return response; } - /** * @typedef {Object} ProjectsUpdateEmailTemplateRequestParams * @property {string} projectId Project unique ID. @@ -1721,7 +1715,6 @@ const projectsUpdateEmailTemplate = async ({projectId,type,locale,subject,messag return response; } - /** * @typedef {Object} ProjectsDeleteEmailTemplateRequestParams * @property {string} projectId Project unique ID. @@ -1754,9 +1747,8 @@ const projectsDeleteEmailTemplate = async ({projectId,type,locale,parseOutput = return response; } - /** - * @typedef {Object} ProjectsGetSmsTemplateRequestParams + * @typedef {Object} ProjectsGetSMSTemplateRequestParams * @property {string} projectId Project unique ID. * @property {SmsTemplateType} type Template type * @property {SmsTemplateLocale} locale Template locale @@ -1766,9 +1758,9 @@ const projectsDeleteEmailTemplate = async ({projectId,type,locale,parseOutput = */ /** - * @param {ProjectsGetSmsTemplateRequestParams} params + * @param {ProjectsGetSMSTemplateRequestParams} params */ -const projectsGetSmsTemplate = async ({projectId,type,locale,parseOutput = true, overrideForCli = false, sdk = undefined}) => { +const projectsGetSMSTemplate = async ({projectId,type,locale,parseOutput = true, overrideForCli = false, sdk = undefined}) => { let client = !sdk ? await sdkForConsole() : sdk; let apiPath = '/projects/{projectId}/templates/sms/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale); @@ -1786,9 +1778,8 @@ const projectsGetSmsTemplate = async ({projectId,type,locale,parseOutput = true, return response; } - /** - * @typedef {Object} ProjectsUpdateSmsTemplateRequestParams + * @typedef {Object} ProjectsUpdateSMSTemplateRequestParams * @property {string} projectId Project unique ID. * @property {SmsTemplateType} type Template type * @property {SmsTemplateLocale} locale Template locale @@ -1799,9 +1790,9 @@ const projectsGetSmsTemplate = async ({projectId,type,locale,parseOutput = true, */ /** - * @param {ProjectsUpdateSmsTemplateRequestParams} params + * @param {ProjectsUpdateSMSTemplateRequestParams} params */ -const projectsUpdateSmsTemplate = async ({projectId,type,locale,message,parseOutput = true, overrideForCli = false, sdk = undefined}) => { +const projectsUpdateSMSTemplate = async ({projectId,type,locale,message,parseOutput = true, overrideForCli = false, sdk = undefined}) => { let client = !sdk ? await sdkForConsole() : sdk; let apiPath = '/projects/{projectId}/templates/sms/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale); @@ -1823,9 +1814,8 @@ const projectsUpdateSmsTemplate = async ({projectId,type,locale,message,parseOut return response; } - /** - * @typedef {Object} ProjectsDeleteSmsTemplateRequestParams + * @typedef {Object} ProjectsDeleteSMSTemplateRequestParams * @property {string} projectId Project unique ID. * @property {SmsTemplateType} type Template type * @property {SmsTemplateLocale} locale Template locale @@ -1835,9 +1825,9 @@ const projectsUpdateSmsTemplate = async ({projectId,type,locale,message,parseOut */ /** - * @param {ProjectsDeleteSmsTemplateRequestParams} params + * @param {ProjectsDeleteSMSTemplateRequestParams} params */ -const projectsDeleteSmsTemplate = async ({projectId,type,locale,parseOutput = true, overrideForCli = false, sdk = undefined}) => { +const projectsDeleteSMSTemplate = async ({projectId,type,locale,parseOutput = true, overrideForCli = false, sdk = undefined}) => { let client = !sdk ? await sdkForConsole() : sdk; let apiPath = '/projects/{projectId}/templates/sms/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale); @@ -1856,7 +1846,6 @@ const projectsDeleteSmsTemplate = async ({projectId,type,locale,parseOutput = tr return response; } - /** * @typedef {Object} ProjectsListWebhooksRequestParams * @property {string} projectId Project unique ID. @@ -1890,7 +1879,6 @@ const projectsListWebhooks = async ({projectId,parseOutput = true, overrideForCl return response; } - /** * @typedef {Object} ProjectsCreateWebhookRequestParams * @property {string} projectId Project unique ID. @@ -1950,7 +1938,6 @@ const projectsCreateWebhook = async ({projectId,name,events,url,security,enabled return response; } - /** * @typedef {Object} ProjectsGetWebhookRequestParams * @property {string} projectId Project unique ID. @@ -1985,7 +1972,6 @@ const projectsGetWebhook = async ({projectId,webhookId,parseOutput = true, overr return response; } - /** * @typedef {Object} ProjectsUpdateWebhookRequestParams * @property {string} projectId Project unique ID. @@ -2046,7 +2032,6 @@ const projectsUpdateWebhook = async ({projectId,webhookId,name,events,url,securi return response; } - /** * @typedef {Object} ProjectsDeleteWebhookRequestParams * @property {string} projectId Project unique ID. @@ -2078,7 +2063,6 @@ const projectsDeleteWebhook = async ({projectId,webhookId,parseOutput = true, ov return response; } - /** * @typedef {Object} ProjectsUpdateWebhookSignatureRequestParams * @property {string} projectId Project unique ID. @@ -2110,7 +2094,6 @@ const projectsUpdateWebhookSignature = async ({projectId,webhookId,parseOutput = return response; } - projects .command(`list`) .description(`Get a list of all projects. You can use the query params to filter your results. `) @@ -2172,14 +2155,14 @@ projects .requiredOption(`--project-id `, `Project unique ID.`) .requiredOption(`--api `, `API name.`) .requiredOption(`--status [value]`, `API status.`, (value) => value === undefined ? true : parseBool(value)) - .action(actionRunner(projectsUpdateApiStatus)) + .action(actionRunner(projectsUpdateAPIStatus)) projects .command(`update-api-status-all`) .description(`Update the status of all API types. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime all at once.`) .requiredOption(`--project-id `, `Project unique ID.`) .requiredOption(`--status [value]`, `API status.`, (value) => value === undefined ? true : parseBool(value)) - .action(actionRunner(projectsUpdateApiStatusAll)) + .action(actionRunner(projectsUpdateAPIStatusAll)) projects .command(`update-auth-duration`) @@ -2246,6 +2229,13 @@ projects .requiredOption(`--alerts [value]`, `Set to true to enable session emails.`, (value) => value === undefined ? true : parseBool(value)) .action(actionRunner(projectsUpdateSessionAlerts)) +projects + .command(`update-session-invalidation`) + .description(`Invalidate all existing sessions. An optional auth security setting for projects, and enabled by default for console project.`) + .requiredOption(`--project-id `, `Project unique ID.`) + .requiredOption(`--enabled [value]`, `Update authentication session invalidation status. Use this endpoint to enable or disable session invalidation on password change`, (value) => value === undefined ? true : parseBool(value)) + .action(actionRunner(projectsUpdateSessionInvalidation)) + projects .command(`update-auth-status`) .description(`Update the status of a specific authentication method. Use this endpoint to enable or disable different authentication methods such as email, magic urls or sms in your project. `) @@ -2425,7 +2415,7 @@ projects .option(`--username `, `SMTP server username`) .option(`--password `, `SMTP server password`) .option(`--secure `, `Does SMTP server use secure connection`) - .action(actionRunner(projectsUpdateSmtp)) + .action(actionRunner(projectsUpdateSMTP)) projects .command(`create-smtp-test`) @@ -2440,7 +2430,7 @@ projects .option(`--username `, `SMTP server username`) .option(`--password `, `SMTP server password`) .option(`--secure `, `Does SMTP server use secure connection`) - .action(actionRunner(projectsCreateSmtpTest)) + .action(actionRunner(projectsCreateSMTPTest)) projects .command(`update-team`) @@ -2484,7 +2474,7 @@ projects .requiredOption(`--project-id `, `Project unique ID.`) .requiredOption(`--type `, `Template type`) .requiredOption(`--locale `, `Template locale`) - .action(actionRunner(projectsGetSmsTemplate)) + .action(actionRunner(projectsGetSMSTemplate)) projects .command(`update-sms-template`) @@ -2493,7 +2483,7 @@ projects .requiredOption(`--type `, `Template type`) .requiredOption(`--locale `, `Template locale`) .requiredOption(`--message `, `Template message`) - .action(actionRunner(projectsUpdateSmsTemplate)) + .action(actionRunner(projectsUpdateSMSTemplate)) projects .command(`delete-sms-template`) @@ -2501,7 +2491,7 @@ projects .requiredOption(`--project-id `, `Project unique ID.`) .requiredOption(`--type `, `Template type`) .requiredOption(`--locale `, `Template locale`) - .action(actionRunner(projectsDeleteSmsTemplate)) + .action(actionRunner(projectsDeleteSMSTemplate)) projects .command(`list-webhooks`) @@ -2566,8 +2556,8 @@ module.exports = { projectsGet, projectsUpdate, projectsDelete, - projectsUpdateApiStatus, - projectsUpdateApiStatusAll, + projectsUpdateAPIStatus, + projectsUpdateAPIStatusAll, projectsUpdateAuthDuration, projectsUpdateAuthLimit, projectsUpdateAuthSessionsLimit, @@ -2577,6 +2567,7 @@ module.exports = { projectsUpdateAuthPasswordHistory, projectsUpdatePersonalDataCheck, projectsUpdateSessionAlerts, + projectsUpdateSessionInvalidation, projectsUpdateAuthStatus, projectsListDevKeys, projectsCreateDevKey, @@ -2597,15 +2588,15 @@ module.exports = { projectsDeletePlatform, projectsUpdateServiceStatus, projectsUpdateServiceStatusAll, - projectsUpdateSmtp, - projectsCreateSmtpTest, + projectsUpdateSMTP, + projectsCreateSMTPTest, projectsUpdateTeam, projectsGetEmailTemplate, projectsUpdateEmailTemplate, projectsDeleteEmailTemplate, - projectsGetSmsTemplate, - projectsUpdateSmsTemplate, - projectsDeleteSmsTemplate, + projectsGetSMSTemplate, + projectsUpdateSMSTemplate, + projectsDeleteSMSTemplate, projectsListWebhooks, projectsCreateWebhook, projectsGetWebhook, diff --git a/lib/commands/proxy.js b/lib/commands/proxy.js index 555408d..c8339c9 100644 --- a/lib/commands/proxy.js +++ b/lib/commands/proxy.js @@ -7,7 +7,7 @@ const libClient = require('../client.js'); const { getAllFiles, showConsoleLink } = require('../utils.js'); const { Command } = require('commander'); const { sdkForProject, sdkForConsole } = require('../sdks') -const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log } = require('../parser') +const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log, warn } = require('../parser') const { localConfig, globalConfig } = require("../config"); const { File } = require('undici'); const { ReadableStream } = require('stream/web'); @@ -75,7 +75,6 @@ const proxyListRules = async ({queries,search,parseOutput = true, overrideForCli return response; } - /** * @typedef {Object} ProxyCreateAPIRuleRequestParams * @property {string} domain Domain name. @@ -109,7 +108,6 @@ const proxyCreateAPIRule = async ({domain,parseOutput = true, overrideForCli = f return response; } - /** * @typedef {Object} ProxyCreateFunctionRuleRequestParams * @property {string} domain Domain name. @@ -151,7 +149,6 @@ const proxyCreateFunctionRule = async ({domain,functionId,branch,parseOutput = t return response; } - /** * @typedef {Object} ProxyCreateRedirectRuleRequestParams * @property {string} domain Domain name. @@ -201,7 +198,6 @@ const proxyCreateRedirectRule = async ({domain,url,statusCode,resourceId,resourc return response; } - /** * @typedef {Object} ProxyCreateSiteRuleRequestParams * @property {string} domain Domain name. @@ -243,7 +239,6 @@ const proxyCreateSiteRule = async ({domain,siteId,branch,parseOutput = true, ove return response; } - /** * @typedef {Object} ProxyGetRuleRequestParams * @property {string} ruleId Rule ID. @@ -273,7 +268,6 @@ const proxyGetRule = async ({ruleId,parseOutput = true, overrideForCli = false, return response; } - /** * @typedef {Object} ProxyDeleteRuleRequestParams * @property {string} ruleId Rule ID. @@ -304,7 +298,6 @@ const proxyDeleteRule = async ({ruleId,parseOutput = true, overrideForCli = fals return response; } - /** * @typedef {Object} ProxyUpdateRuleVerificationRequestParams * @property {string} ruleId Rule ID. @@ -335,7 +328,6 @@ const proxyUpdateRuleVerification = async ({ruleId,parseOutput = true, overrideF return response; } - proxy .command(`list-rules`) .description(`Get a list of all the proxy rules. You can use the query params to filter your results.`) diff --git a/lib/commands/pull.js b/lib/commands/pull.js index 573a252..79de142 100644 --- a/lib/commands/pull.js +++ b/lib/commands/pull.js @@ -9,6 +9,7 @@ const { projectsGet } = require("./projects"); const { functionsList, functionsGetDeploymentDownload, functionsListDeployments } = require("./functions"); const { sitesList, sitesGetDeploymentDownload, sitesListDeployments } = require("./sites"); const { databasesGet, databasesListCollections, databasesList } = require("./databases"); +const { gridsListDatabases, gridsGetDatabase, gridsListTables } = require("./grids"); const { storageListBuckets } = require("./storage"); const { localConfig } = require("../config"); const { paginate } = require("../paginate"); @@ -21,6 +22,7 @@ const pullResources = async () => { functions: pullFunctions, sites: pullSites, collections: pullCollection, + tables: pullTable, buckets: pullBucket, teams: pullTeam, messages: pullMessagingTopic @@ -285,6 +287,7 @@ const pullSites = async ({ code, withVariables }) => { } const pullCollection = async () => { + warn("appwrite pull collection has been deprecated. Please consider using 'appwrite pull tables' instead"); log("Fetching collections ..."); let total = 0; @@ -336,6 +339,58 @@ const pullCollection = async () => { success(`Successfully pulled ${chalk.bold(total)} collections.`); } +const pullTable = async () => { + log("Fetching tables ..."); + let total = 0; + + const fetchResponse = await gridsListDatabases({ + queries: [JSON.stringify({ method: 'limit', values: [1] })], + parseOutput: false + }); + if (fetchResponse["databases"].length <= 0) { + log("No tables found."); + success(`Successfully pulled ${chalk.bold(total)} tables.`); + return; + } + + let databases = cliConfig.ids; + + if (databases.length === 0) { + if (cliConfig.all) { + databases = (await paginate(gridsListDatabases, { parseOutput: false }, 100, 'databases')).databases.map(database => database.$id); + } else { + databases = (await inquirer.prompt(questionsPullCollection)).databases; + } + } + + for (const databaseId of databases) { + const database = await gridsGetDatabase({ + databaseId, + parseOutput: false + }); + + total++; + log(`Pulling all tables from ${chalk.bold(database['name'])} database ...`); + + localConfig.addDatabase(database); + + const { tables } = await paginate(gridsListTables, { + databaseId, + parseOutput: false + }, 100, 'tables'); + + for (const table of tables) { + localConfig.addTable({ + ...table, + '$createdAt': undefined, + '$updatedAt': undefined + }); + } + } + + success(`Successfully pulled ${chalk.bold(total)} tables.`); +} + const pullBucket = async () => { log("Fetching buckets ..."); let total = 0; @@ -447,9 +502,15 @@ pull pull .command("collection") .alias("collections") - .description("Pull your Appwrite collections") + .description("Pull your Appwrite collections (deprecated, please use 'pull tables' instead)") .action(actionRunner(pullCollection)) +pull + .command("table") + .alias("tables") + .description("Pull your Appwrite tables") + .action(actionRunner(pullTable)) + pull .command("bucket") .alias("buckets") diff --git a/lib/commands/push.js b/lib/commands/push.js index 03fd7d8..87a7b5f 100644 --- a/lib/commands/push.js +++ b/lib/commands/push.js @@ -6,10 +6,10 @@ const inquirer = require("inquirer"); const JSONbig = require("json-bigint")({ storeAsString: false }); const { Command } = require("commander"); const ID = require("../id"); -const { localConfig, globalConfig, KeysAttributes, KeysFunction, KeysSite, whitelistKeys, KeysTopics, KeysStorage, KeysTeams, KeysCollection } = require("../config"); +const { localConfig, globalConfig, KeysAttributes, KeysFunction, KeysSite, whitelistKeys, KeysTopics, KeysStorage, KeysTeams, KeysCollection, KeysTable } = require("../config"); const { Spinner, SPINNER_ARC, SPINNER_DOTS } = require('../spinner'); const { paginate } = require('../paginate'); -const { questionsPushBuckets, questionsPushTeams, questionsPushFunctions, questionsPushSites, questionsGetEntrypoint, questionsPushCollections, questionPushChanges, questionPushChangesConfirmation, questionsPushMessagingTopics, questionsPushResources } = require("../questions"); +const { questionsPushBuckets, questionsPushTeams, questionsPushFunctions, questionsPushSites, questionsGetEntrypoint, questionsPushCollections, questionsPushTables, questionPushChanges, questionPushChangesConfirmation, questionsPushMessagingTopics, questionsPushResources } = require("../questions"); const { cliConfig, actionRunner, success, warn, log, hint, error, commandDescriptions, drawTable } = require("../parser"); const { proxyCreateFunctionRule, proxyCreateSiteRule, proxyListRules } = require('./proxy'); const { consoleVariables } = require('./console'); @@ -49,6 +49,10 @@ const { databasesListIndexes, databasesUpdateCollection } = require("./databases"); +const { + gridsGetDatabase, + gridsGetTable +} = require("./grids"); const { storageGetBucket, storageUpdateBucket, storageCreateBucket } = require("./storage"); @@ -792,7 +796,7 @@ const generateChangesObject = (attribute, collection, isAdding) => { return { key: `${chalk.yellow(attribute.key)} in ${collection.name} (${collection['$id']})`, attribute: attribute, - reason: isAdding ? 'Field isn\'t present on the remote server' : 'Field isn\'t present on the appwrite.json file', + reason: isAdding ? 'Field isn\'t present on the remote server' : 'Field isn\'t present on the appwrite.config.json file', action: isAdding ? chalk.green('adding') : chalk.red('deleting') }; @@ -919,6 +923,7 @@ const pushResources = async () => { functions: pushFunction, sites: pushSite, collections: pushCollection, + tables: pushTable, buckets: pushBucket, teams: pushTeam, messages: pushMessagingTopic @@ -1094,7 +1099,7 @@ const pushSite = async({ siteId, async, code, withVariables } = { returnOnZero: await Promise.all(sites.map(async (site) => { let response = {}; - const ignore = site.ignore ? 'appwrite.json' : '.gitignore'; + const ignore = site.ignore ? 'appwrite.config.json' : '.gitignore'; let siteExists = false; let deploymentCreated = false; @@ -1109,7 +1114,7 @@ const pushSite = async({ siteId, async, code, withVariables } = { returnOnZero: }); siteExists = true; if (response.framework !== site.framework) { - updaterRow.fail({ errorMessage: `Framework mismatch! (local=${site.framework},remote=${response.framework}) Please delete remote site or update your appwrite.json` }) + updaterRow.fail({ errorMessage: `Framework mismatch! (local=${site.framework},remote=${response.framework}) Please delete remote site or update your appwrite.config.json` }) return; } @@ -1417,7 +1422,7 @@ const pushFunction = async ({ functionId, async, code, withVariables } = { retur await Promise.all(functions.map(async (func) => { let response = {}; - const ignore = func.ignore ? 'appwrite.json' : '.gitignore'; + const ignore = func.ignore ? 'appwrite.config.json' : '.gitignore'; let functionExists = false; let deploymentCreated = false; @@ -1431,7 +1436,7 @@ const pushFunction = async ({ functionId, async, code, withVariables } = { retur }); functionExists = true; if (response.runtime !== func.runtime) { - updaterRow.fail({ errorMessage: `Runtime mismatch! (local=${func.runtime},remote=${response.runtime}) Please delete remote function or update your appwrite.json` }) + updaterRow.fail({ errorMessage: `Runtime mismatch! (local=${func.runtime},remote=${response.runtime}) Please delete remote function or update your appwrite.config.json` }) return; } @@ -1672,7 +1677,150 @@ const pushFunction = async ({ functionId, async, code, withVariables } = { retur } } +const pushTable = async ({ returnOnZero, attempts } = { returnOnZero: false }) => { + const tables = []; + + if (attempts) { + pollMaxDebounces = attempts; + } + + if (cliConfig.all) { + checkDeployConditions(localConfig); + tables.push(...localConfig.getTables()); + } else { + const answers = await inquirer.prompt(questionsPushTables) + if (answers.tables) { + const configTables = new Map(); + localConfig.getTables().forEach((c) => { + configTables.set(`${c['databaseId']}|${c['$id']}`, c); + }); + answers.tables.forEach((a) => { + const table = configTables.get(a); + tables.push(table); + }) + } + } + + if (tables.length === 0) { + log("No tables found."); + hint("Use 'appwrite pull tables' to synchronize existing one, or use 'appwrite init table' to create a new one."); + return; + } + + const databases = Array.from(new Set(tables.map(table => table['databaseId']))); + + // Parallel db actions + await Promise.all(databases.map(async (databaseId) => { + const localDatabase = localConfig.getDatabase(databaseId); + + try { + const database = await gridsGetDatabase({ + databaseId: databaseId, + parseOutput: false, + }); + + if (database.name !== (localDatabase.name ?? databaseId)) { + await databasesUpdate({ + databaseId: databaseId, + name: localDatabase.name ?? databaseId, + parseOutput: false + }) + + success(`Updated ${localDatabase.name} ( ${databaseId} ) name`); + } + } catch (err) { + log(`Database ${databaseId} not found. Creating it now ...`); + + await databasesCreate({ + databaseId: databaseId, + name: localDatabase.name ?? databaseId, + parseOutput: false, + }); + } + })); + + + if (!(await approveChanges(tables, gridsGetTable, KeysTable, 'tableId', 'tables', ['columns', 'indexes'], 'databaseId', 'databaseId',))) { + return; + } + // Parallel collection actions + await Promise.all(tables.map(async (table) => { + try { + const remoteTable = await gridsGetTable({ + databaseId: table['databaseId'], + tableId: table['$id'], + parseOutput: false, + }); + + if (remoteTable.name !== table.name) { + await databasesUpdateTable({ + databaseId: table['databaseId'], + tableId: table['$id'], + name: table.name, + name: table.name, + parseOutput: false + }) + + success(`Updated ${table.name} ( ${table['$id']} ) name`); + } + table.remoteVersion = remoteTable; + + table.isExisted = true; + } catch + (e) { + if (Number(e.code) === 404) { + log(`Table ${table.name} does not exist in the project. Creating ... `); + await databasesCreateTable({ + databaseId: table['databaseId'], + tableId: table['$id'], + name: table.name, + documentSecurity: table.documentSecurity, + permissions: table['$permissions'], + parseOutput: false + }) + } else { + throw e; + } + } + })) + let numberOfTables = 0; + // Serialize attribute actions + for (let table of tables) { + let columns = table.columns; + let indexes = table.indexes; + + if (table.isExisted) { + columns = await attributesToCreate(table.remoteVersion.columns, table.columns, table); + indexes = await attributesToCreate(table.remoteVersion.indexes, table.indexes, table, true); + + if ((Array.isArray(columns) && columns.length <= 0) && (Array.isArray(indexes) && indexes.length <= 0)) { + continue; + } + + } + + log(`Pushing table ${table.name} ( ${table['databaseId']} - ${table['$id']} ) attributes`) + + try { + await createAttributes(columns, table) + } catch (e) { + throw e; + } + + try { + await createIndexes(indexes, table); + } catch (e) { + throw e; + } + numberOfTables++; + success(`Successfully pushed ${table.name} ( ${table['$id']} )`); + } + + success(`Successfully pushed ${numberOfTables} tables`); +} + const pushCollection = async ({ returnOnZero, attempts } = { returnOnZero: false }) => { + warn("appwrite push collection has been deprecated. Please consider using 'appwrite push tables' instead"); const collections = []; if (attempts) { @@ -2083,10 +2231,17 @@ push push .command("collection") .alias("collections") - .description("Push collections in the current project.") + .description("Push collections in the current project. (deprecated, please use 'push tables' instead)") .option(`-a, --attempts `, `Max number of attempts before timing out. default: 30.`) .action(actionRunner(pushCollection)); +push + .command("table") + .alias("tables") + .description("Push tables in the current project.") + .option(`-a, --attempts `, `Max number of attempts before timing out. default: 30.`) + .action(actionRunner(pushTable)); + push .command("bucket") .alias("buckets") diff --git a/lib/commands/run.js b/lib/commands/run.js index 1fae14f..3338bda 100644 --- a/lib/commands/run.js +++ b/lib/commands/run.js @@ -85,7 +85,7 @@ const runFunction = async ({ port, functionId, withVariables, reload, userId } = }; drawTable([settings]); - log("If you wish to change your local settings, update the appwrite.json file and rerun the 'appwrite run' command."); + log("If you wish to change your local settings, update the appwrite.config.json file and rerun the 'appwrite run' command."); hint("Permissions, events, CRON and timeouts dont apply when running locally."); await dockerCleanup(func.$id); diff --git a/lib/commands/sites.js b/lib/commands/sites.js index 681353d..5c0bf63 100644 --- a/lib/commands/sites.js +++ b/lib/commands/sites.js @@ -7,7 +7,7 @@ const libClient = require('../client.js'); const { getAllFiles, showConsoleLink } = require('../utils.js'); const { Command } = require('commander'); const { sdkForProject, sdkForConsole } = require('../sdks') -const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log } = require('../parser') +const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log, warn } = require('../parser') const { localConfig, globalConfig } = require("../config"); const { File } = require('undici'); const { ReadableStream } = require('stream/web'); @@ -79,7 +79,6 @@ const sitesList = async ({queries,search,parseOutput = true, overrideForCli = fa return response; } - /** * @typedef {Object} SitesCreateRequestParams * @property {string} siteId Site 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. @@ -181,7 +180,6 @@ const sitesCreate = async ({siteId,name,framework,buildRuntime,enabled,logging,t return response; } - /** * @typedef {Object} SitesListFrameworksRequestParams * @property {boolean} overrideForCli @@ -214,7 +212,6 @@ const sitesListFrameworks = async ({parseOutput = true, overrideForCli = false, return response; } - /** * @typedef {Object} SitesListSpecificationsRequestParams * @property {boolean} overrideForCli @@ -247,7 +244,6 @@ const sitesListSpecifications = async ({parseOutput = true, overrideForCli = fal return response; } - /** * @typedef {Object} SitesListTemplatesRequestParams * @property {string[]} frameworks List of frameworks allowed for filtering site templates. Maximum of 100 frameworks are allowed. @@ -296,7 +292,6 @@ const sitesListTemplates = async ({frameworks,useCases,limit,offset,parseOutput return response; } - /** * @typedef {Object} SitesGetTemplateRequestParams * @property {string} templateId Template ID. @@ -330,10 +325,9 @@ const sitesGetTemplate = async ({templateId,parseOutput = true, overrideForCli = return response; } - /** * @typedef {Object} SitesListUsageRequestParams - * @property {SiteUsageRange} range Date range. + * @property {UsageRange} range Date range. * @property {boolean} overrideForCli * @property {boolean} parseOutput * @property {libClient | undefined} sdk @@ -367,7 +361,6 @@ const sitesListUsage = async ({range,parseOutput = true, overrideForCli = false, return response; } - /** * @typedef {Object} SitesGetRequestParams * @property {string} siteId Site ID. @@ -401,7 +394,6 @@ const sitesGet = async ({siteId,parseOutput = true, overrideForCli = false, sdk return response; } - /** * @typedef {Object} SitesUpdateRequestParams * @property {string} siteId Site ID. @@ -500,7 +492,6 @@ const sitesUpdate = async ({siteId,name,framework,enabled,logging,timeout,instal return response; } - /** * @typedef {Object} SitesDeleteRequestParams * @property {string} siteId Site ID. @@ -531,7 +522,6 @@ const sitesDelete = async ({siteId,parseOutput = true, overrideForCli = false, s return response; } - /** * @typedef {Object} SitesUpdateSiteDeploymentRequestParams * @property {string} siteId Site ID. @@ -566,7 +556,6 @@ const sitesUpdateSiteDeployment = async ({siteId,deploymentId,parseOutput = true return response; } - /** * @typedef {Object} SitesListDeploymentsRequestParams * @property {string} siteId Site ID. @@ -608,7 +597,6 @@ const sitesListDeployments = async ({siteId,queries,search,parseOutput = true, o return response; } - /** * @typedef {Object} SitesCreateDeploymentRequestParams * @property {string} siteId Site ID. @@ -777,7 +765,6 @@ const sitesCreateDeployment = async ({siteId,code,activate,installCommand,buildC return response; } - /** * @typedef {Object} SitesCreateDuplicateDeploymentRequestParams * @property {string} siteId Site ID. @@ -812,7 +799,6 @@ const sitesCreateDuplicateDeployment = async ({siteId,deploymentId,parseOutput = return response; } - /** * @typedef {Object} SitesCreateTemplateDeploymentRequestParams * @property {string} siteId Site ID. @@ -863,7 +849,6 @@ const sitesCreateTemplateDeployment = async ({siteId,repository,owner,rootDirect return response; } - /** * @typedef {Object} SitesCreateVcsDeploymentRequestParams * @property {string} siteId Site ID. @@ -906,7 +891,6 @@ const sitesCreateVcsDeployment = async ({siteId,type,reference,activate,parseOut return response; } - /** * @typedef {Object} SitesGetDeploymentRequestParams * @property {string} siteId Site ID. @@ -941,7 +925,6 @@ const sitesGetDeployment = async ({siteId,deploymentId,parseOutput = true, overr return response; } - /** * @typedef {Object} SitesDeleteDeploymentRequestParams * @property {string} siteId Site ID. @@ -973,7 +956,6 @@ const sitesDeleteDeployment = async ({siteId,deploymentId,parseOutput = true, ov return response; } - /** * @typedef {Object} SitesGetDeploymentDownloadRequestParams * @property {string} siteId Site ID. @@ -1024,7 +1006,6 @@ const sitesGetDeploymentDownload = async ({siteId,deploymentId,type,parseOutput return response; } - /** * @typedef {Object} SitesUpdateDeploymentStatusRequestParams * @property {string} siteId Site ID. @@ -1056,7 +1037,6 @@ const sitesUpdateDeploymentStatus = async ({siteId,deploymentId,parseOutput = tr return response; } - /** * @typedef {Object} SitesListLogsRequestParams * @property {string} siteId Site ID. @@ -1090,7 +1070,6 @@ const sitesListLogs = async ({siteId,queries,parseOutput = true, overrideForCli return response; } - /** * @typedef {Object} SitesGetLogRequestParams * @property {string} siteId Site ID. @@ -1125,7 +1104,6 @@ const sitesGetLog = async ({siteId,logId,parseOutput = true, overrideForCli = fa return response; } - /** * @typedef {Object} SitesDeleteLogRequestParams * @property {string} siteId Site ID. @@ -1157,11 +1135,10 @@ const sitesDeleteLog = async ({siteId,logId,parseOutput = true, overrideForCli = return response; } - /** * @typedef {Object} SitesGetUsageRequestParams * @property {string} siteId Site ID. - * @property {SiteUsageRange} range Date range. + * @property {UsageRange} range Date range. * @property {boolean} overrideForCli * @property {boolean} parseOutput * @property {libClient | undefined} sdk @@ -1191,7 +1168,6 @@ const sitesGetUsage = async ({siteId,range,parseOutput = true, overrideForCli = return response; } - /** * @typedef {Object} SitesListVariablesRequestParams * @property {string} siteId Site unique ID. @@ -1221,7 +1197,6 @@ const sitesListVariables = async ({siteId,parseOutput = true, overrideForCli = f return response; } - /** * @typedef {Object} SitesCreateVariableRequestParams * @property {string} siteId Site unique ID. @@ -1264,7 +1239,6 @@ const sitesCreateVariable = async ({siteId,key,value,secret,parseOutput = true, return response; } - /** * @typedef {Object} SitesGetVariableRequestParams * @property {string} siteId Site unique ID. @@ -1295,7 +1269,6 @@ const sitesGetVariable = async ({siteId,variableId,parseOutput = true, overrideF return response; } - /** * @typedef {Object} SitesUpdateVariableRequestParams * @property {string} siteId Site unique ID. @@ -1339,7 +1312,6 @@ const sitesUpdateVariable = async ({siteId,variableId,key,value,secret,parseOutp return response; } - /** * @typedef {Object} SitesDeleteVariableRequestParams * @property {string} siteId Site unique ID. @@ -1371,7 +1343,6 @@ const sitesDeleteVariable = async ({siteId,variableId,parseOutput = true, overri return response; } - sites .command(`list`) .description(`Get a list of all the project's sites. You can use the query params to filter your results.`) diff --git a/lib/commands/storage.js b/lib/commands/storage.js index 7b28544..46c93aa 100644 --- a/lib/commands/storage.js +++ b/lib/commands/storage.js @@ -7,7 +7,7 @@ const libClient = require('../client.js'); const { getAllFiles, showConsoleLink } = require('../utils.js'); const { Command } = require('commander'); const { sdkForProject, sdkForConsole } = require('../sdks') -const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log } = require('../parser') +const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log, warn } = require('../parser') const { localConfig, globalConfig } = require("../config"); const { File } = require('undici'); const { ReadableStream } = require('stream/web'); @@ -79,7 +79,6 @@ const storageListBuckets = async ({queries,search,parseOutput = true, overrideFo return response; } - /** * @typedef {Object} StorageCreateBucketRequestParams * @property {string} bucketId 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. @@ -151,7 +150,6 @@ const storageCreateBucket = async ({bucketId,name,permissions,fileSecurity,enabl return response; } - /** * @typedef {Object} StorageGetBucketRequestParams * @property {string} bucketId Bucket unique ID. @@ -185,7 +183,6 @@ const storageGetBucket = async ({bucketId,parseOutput = true, overrideForCli = f return response; } - /** * @typedef {Object} StorageUpdateBucketRequestParams * @property {string} bucketId Bucket unique ID. @@ -254,7 +251,6 @@ const storageUpdateBucket = async ({bucketId,name,permissions,fileSecurity,enabl return response; } - /** * @typedef {Object} StorageDeleteBucketRequestParams * @property {string} bucketId Bucket unique ID. @@ -285,7 +281,6 @@ const storageDeleteBucket = async ({bucketId,parseOutput = true, overrideForCli return response; } - /** * @typedef {Object} StorageListFilesRequestParams * @property {string} bucketId Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). @@ -327,7 +322,6 @@ const storageListFiles = async ({bucketId,queries,search,parseOutput = true, ove return response; } - /** * @typedef {Object} StorageCreateFileRequestParams * @property {string} bucketId Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). @@ -460,7 +454,6 @@ const storageCreateFile = async ({bucketId,fileId,file,permissions,parseOutput = return response; } - /** * @typedef {Object} StorageGetFileRequestParams * @property {string} bucketId Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). @@ -495,7 +488,6 @@ const storageGetFile = async ({bucketId,fileId,parseOutput = true, overrideForCl return response; } - /** * @typedef {Object} StorageUpdateFileRequestParams * @property {string} bucketId Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). @@ -536,7 +528,6 @@ const storageUpdateFile = async ({bucketId,fileId,name,permissions,parseOutput = return response; } - /** * @typedef {Object} StorageDeleteFileRequestParams * @property {string} bucketId Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). @@ -568,7 +559,6 @@ const storageDeleteFile = async ({bucketId,fileId,parseOutput = true, overrideFo return response; } - /** * @typedef {Object} StorageGetFileDownloadRequestParams * @property {string} bucketId Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). @@ -615,7 +605,6 @@ const storageGetFileDownload = async ({bucketId,fileId,token,parseOutput = true, return response; } - /** * @typedef {Object} StorageGetFilePreviewRequestParams * @property {string} bucketId Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). @@ -706,7 +695,6 @@ const storageGetFilePreview = async ({bucketId,fileId,width,height,gravity,quali return response; } - /** * @typedef {Object} StorageGetFileViewRequestParams * @property {string} bucketId Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). @@ -753,10 +741,9 @@ const storageGetFileView = async ({bucketId,fileId,token,parseOutput = true, ove return response; } - /** * @typedef {Object} StorageGetUsageRequestParams - * @property {StorageUsageRange} range Date range. + * @property {UsageRange} range Date range. * @property {boolean} overrideForCli * @property {boolean} parseOutput * @property {libClient | undefined} sdk @@ -786,11 +773,10 @@ const storageGetUsage = async ({range,parseOutput = true, overrideForCli = false return response; } - /** * @typedef {Object} StorageGetBucketUsageRequestParams * @property {string} bucketId Bucket ID. - * @property {StorageUsageRange} range Date range. + * @property {UsageRange} range Date range. * @property {boolean} overrideForCli * @property {boolean} parseOutput * @property {libClient | undefined} sdk @@ -824,7 +810,6 @@ const storageGetBucketUsage = async ({bucketId,range,parseOutput = true, overrid return response; } - storage .command(`list-buckets`) .description(`Get a list of all the storage buckets. You can use the query params to filter your results.`) diff --git a/lib/commands/tables-db.js b/lib/commands/tables-db.js new file mode 100644 index 0000000..46d2280 --- /dev/null +++ b/lib/commands/tables-db.js @@ -0,0 +1,2896 @@ +const fs = require('fs'); +const pathLib = require('path'); +const tar = require("tar"); +const ignore = require("ignore"); +const { promisify } = require('util'); +const libClient = require('../client.js'); +const { getAllFiles, showConsoleLink } = require('../utils.js'); +const { Command } = require('commander'); +const { sdkForProject, sdkForConsole } = require('../sdks') +const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log, warn } = require('../parser') +const { localConfig, globalConfig } = require("../config"); +const { File } = require('undici'); +const { ReadableStream } = require('stream/web'); + +/** + * @param {fs.ReadStream} readStream + * @returns {ReadableStream} + */ +function convertReadStreamToReadableStream(readStream) { + return new ReadableStream({ + start(controller) { + readStream.on("data", (chunk) => { + controller.enqueue(chunk); + }); + readStream.on("end", () => { + controller.close(); + }); + readStream.on("error", (err) => { + controller.error(err); + }); + }, + cancel() { + readStream.destroy(); + }, + }); +} + +const tablesDB = new Command("tables-db").description(commandDescriptions['tables-db'] ?? '').configureHelp({ + helpWidth: process.stdout.columns || 80 +}) + +/** + * @typedef {Object} TablesDBListRequestParams + * @property {string[]} 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 columns: name + * @property {string} search Search term to filter your list results. Max length: 256 chars. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBListRequestParams} params + */ +const tablesDBList = async ({queries,search,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb'; + let payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof search !== 'undefined') { + payload['search'] = search; + } + + let response = undefined; + + response = await client.call('get', apiPath, { + }, payload); + + if (parseOutput) { + if(console) { + showConsoleLink('tablesDB', 'list'); + } else { + parse(response) + } + } + + return response; + +} +/** + * @typedef {Object} TablesDBCreateRequestParams + * @property {string} databaseId 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. + * @property {string} name Database name. Max length: 128 chars. + * @property {boolean} enabled Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBCreateRequestParams} params + */ +const tablesDBCreate = async ({databaseId,name,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb'; + let payload = {}; + if (typeof databaseId !== 'undefined') { + payload['databaseId'] = databaseId; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + + let response = undefined; + + response = await client.call('post', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBListUsageRequestParams + * @property {UsageRange} range Date range. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBListUsageRequestParams} params + */ +const tablesDBListUsage = async ({range,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/usage'; + let payload = {}; + if (typeof range !== 'undefined') { + payload['range'] = range; + } + + let response = undefined; + + response = await client.call('get', apiPath, { + }, payload); + + if (parseOutput) { + if(console) { + showConsoleLink('tablesDB', 'listUsage'); + } else { + parse(response) + } + } + + return response; + +} +/** + * @typedef {Object} TablesDBGetRequestParams + * @property {string} databaseId Database ID. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBGetRequestParams} params + */ +const tablesDBGet = async ({databaseId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}'.replace('{databaseId}', databaseId); + let payload = {}; + + let response = undefined; + + response = await client.call('get', apiPath, { + }, payload); + + if (parseOutput) { + if(console) { + showConsoleLink('tablesDB', 'get', databaseId); + } else { + parse(response) + } + } + + return response; + +} +/** + * @typedef {Object} TablesDBUpdateRequestParams + * @property {string} databaseId Database ID. + * @property {string} name Database name. Max length: 128 chars. + * @property {boolean} enabled Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBUpdateRequestParams} params + */ +const tablesDBUpdate = async ({databaseId,name,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}'.replace('{databaseId}', databaseId); + let payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + + let response = undefined; + + response = await client.call('put', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBDeleteRequestParams + * @property {string} databaseId Database ID. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBDeleteRequestParams} params + */ +const tablesDBDelete = async ({databaseId,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}'.replace('{databaseId}', databaseId); + let payload = {}; + + let response = undefined; + + response = await client.call('delete', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBListTablesRequestParams + * @property {string} databaseId Database ID. + * @property {string[]} 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 columns: name, enabled, rowSecurity + * @property {string} search Search term to filter your list results. Max length: 256 chars. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBListTablesRequestParams} params + */ +const tablesDBListTables = async ({databaseId,queries,search,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables'.replace('{databaseId}', databaseId); + let payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof search !== 'undefined') { + payload['search'] = search; + } + + let response = undefined; + + response = await client.call('get', apiPath, { + }, payload); + + if (parseOutput) { + if(console) { + showConsoleLink('tablesDB', 'listTables', databaseId); + } else { + parse(response) + } + } + + return response; + +} +/** + * @typedef {Object} TablesDBCreateTableRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId 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. + * @property {string} name Table name. Max length: 128 chars. + * @property {string[]} permissions An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @property {boolean} rowSecurity Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @property {boolean} enabled Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBCreateTableRequestParams} params + */ +const tablesDBCreateTable = async ({databaseId,tableId,name,permissions,rowSecurity,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables'.replace('{databaseId}', databaseId); + let payload = {}; + if (typeof tableId !== 'undefined') { + payload['tableId'] = tableId; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + permissions = permissions === true ? [] : permissions; + if (typeof permissions !== 'undefined') { + payload['permissions'] = permissions; + } + if (typeof rowSecurity !== 'undefined') { + payload['rowSecurity'] = rowSecurity; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + + let response = undefined; + + response = await client.call('post', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBGetTableRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBGetTableRequestParams} params + */ +const tablesDBGetTable = async ({databaseId,tableId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + let payload = {}; + + let response = undefined; + + response = await client.call('get', apiPath, { + }, payload); + + if (parseOutput) { + if(console) { + showConsoleLink('tablesDB', 'getTable', databaseId, tableId); + } else { + parse(response) + } + } + + return response; + +} +/** + * @typedef {Object} TablesDBUpdateTableRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. + * @property {string} name Table name. Max length: 128 chars. + * @property {string[]} permissions An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @property {boolean} rowSecurity Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @property {boolean} enabled Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBUpdateTableRequestParams} params + */ +const tablesDBUpdateTable = async ({databaseId,tableId,name,permissions,rowSecurity,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + let payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + permissions = permissions === true ? [] : permissions; + if (typeof permissions !== 'undefined') { + payload['permissions'] = permissions; + } + if (typeof rowSecurity !== 'undefined') { + payload['rowSecurity'] = rowSecurity; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + + let response = undefined; + + response = await client.call('put', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBDeleteTableRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBDeleteTableRequestParams} params + */ +const tablesDBDeleteTable = async ({databaseId,tableId,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + let payload = {}; + + let response = undefined; + + response = await client.call('delete', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBListColumnsRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. + * @property {string[]} 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 columns: key, type, size, required, array, status, error + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBListColumnsRequestParams} params + */ +const tablesDBListColumns = async ({databaseId,tableId,queries,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + let payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + + let response = undefined; + + response = await client.call('get', apiPath, { + }, payload); + + if (parseOutput) { + if(console) { + showConsoleLink('tablesDB', 'listColumns', databaseId, tableId); + } else { + parse(response) + } + } + + return response; + +} +/** + * @typedef {Object} TablesDBCreateBooleanColumnRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @property {string} key Column Key. + * @property {boolean} required Is column required? + * @property {boolean} xdefault Default value for column when not provided. Cannot be set when column is required. + * @property {boolean} array Is column an array? + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBCreateBooleanColumnRequestParams} params + */ +const tablesDBCreateBooleanColumn = async ({databaseId,tableId,key,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/boolean'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + let payload = {}; + if (typeof key !== 'undefined') { + payload['key'] = key; + } + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof array !== 'undefined') { + payload['array'] = array; + } + + let response = undefined; + + response = await client.call('post', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBUpdateBooleanColumnRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @property {string} key Column Key. + * @property {boolean} required Is column required? + * @property {boolean} xdefault Default value for column when not provided. Cannot be set when column is required. + * @property {string} newKey New Column Key. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBUpdateBooleanColumnRequestParams} params + */ +const tablesDBUpdateBooleanColumn = async ({databaseId,tableId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/boolean/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + let payload = {}; + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof newKey !== 'undefined') { + payload['newKey'] = newKey; + } + + let response = undefined; + + response = await client.call('patch', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBCreateDatetimeColumnRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. + * @property {string} key Column Key. + * @property {boolean} required Is column required? + * @property {string} xdefault Default value for the column in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when column is required. + * @property {boolean} array Is column an array? + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBCreateDatetimeColumnRequestParams} params + */ +const tablesDBCreateDatetimeColumn = async ({databaseId,tableId,key,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/datetime'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + let payload = {}; + if (typeof key !== 'undefined') { + payload['key'] = key; + } + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof array !== 'undefined') { + payload['array'] = array; + } + + let response = undefined; + + response = await client.call('post', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBUpdateDatetimeColumnRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. + * @property {string} key Column Key. + * @property {boolean} required Is column required? + * @property {string} xdefault Default value for column when not provided. Cannot be set when column is required. + * @property {string} newKey New Column Key. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBUpdateDatetimeColumnRequestParams} params + */ +const tablesDBUpdateDatetimeColumn = async ({databaseId,tableId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/datetime/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + let payload = {}; + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof newKey !== 'undefined') { + payload['newKey'] = newKey; + } + + let response = undefined; + + response = await client.call('patch', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBCreateEmailColumnRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. + * @property {string} key Column Key. + * @property {boolean} required Is column required? + * @property {string} xdefault Default value for column when not provided. Cannot be set when column is required. + * @property {boolean} array Is column an array? + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBCreateEmailColumnRequestParams} params + */ +const tablesDBCreateEmailColumn = async ({databaseId,tableId,key,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/email'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + let payload = {}; + if (typeof key !== 'undefined') { + payload['key'] = key; + } + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof array !== 'undefined') { + payload['array'] = array; + } + + let response = undefined; + + response = await client.call('post', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBUpdateEmailColumnRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. + * @property {string} key Column Key. + * @property {boolean} required Is column required? + * @property {string} xdefault Default value for column when not provided. Cannot be set when column is required. + * @property {string} newKey New Column Key. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBUpdateEmailColumnRequestParams} params + */ +const tablesDBUpdateEmailColumn = async ({databaseId,tableId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/email/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + let payload = {}; + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof newKey !== 'undefined') { + payload['newKey'] = newKey; + } + + let response = undefined; + + response = await client.call('patch', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBCreateEnumColumnRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. + * @property {string} key Column Key. + * @property {string[]} elements Array of enum values. + * @property {boolean} required Is column required? + * @property {string} xdefault Default value for column when not provided. Cannot be set when column is required. + * @property {boolean} array Is column an array? + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBCreateEnumColumnRequestParams} params + */ +const tablesDBCreateEnumColumn = async ({databaseId,tableId,key,elements,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/enum'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + let payload = {}; + if (typeof key !== 'undefined') { + payload['key'] = key; + } + elements = elements === true ? [] : elements; + if (typeof elements !== 'undefined') { + payload['elements'] = elements; + } + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof array !== 'undefined') { + payload['array'] = array; + } + + let response = undefined; + + response = await client.call('post', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBUpdateEnumColumnRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. + * @property {string} key Column Key. + * @property {string[]} elements Updated list of enum values. + * @property {boolean} required Is column required? + * @property {string} xdefault Default value for column when not provided. Cannot be set when column is required. + * @property {string} newKey New Column Key. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBUpdateEnumColumnRequestParams} params + */ +const tablesDBUpdateEnumColumn = async ({databaseId,tableId,key,elements,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/enum/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + let payload = {}; + elements = elements === true ? [] : elements; + if (typeof elements !== 'undefined') { + payload['elements'] = elements; + } + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof newKey !== 'undefined') { + payload['newKey'] = newKey; + } + + let response = undefined; + + response = await client.call('patch', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBCreateFloatColumnRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. + * @property {string} key Column Key. + * @property {boolean} required Is column required? + * @property {number} min Minimum value + * @property {number} max Maximum value + * @property {number} xdefault Default value. Cannot be set when required. + * @property {boolean} array Is column an array? + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBCreateFloatColumnRequestParams} params + */ +const tablesDBCreateFloatColumn = async ({databaseId,tableId,key,required,min,max,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/float'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + let payload = {}; + if (typeof key !== 'undefined') { + payload['key'] = key; + } + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof min !== 'undefined') { + payload['min'] = min; + } + if (typeof max !== 'undefined') { + payload['max'] = max; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof array !== 'undefined') { + payload['array'] = array; + } + + let response = undefined; + + response = await client.call('post', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBUpdateFloatColumnRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. + * @property {string} key Column Key. + * @property {boolean} required Is column required? + * @property {number} xdefault Default value. Cannot be set when required. + * @property {number} min Minimum value + * @property {number} max Maximum value + * @property {string} newKey New Column Key. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBUpdateFloatColumnRequestParams} params + */ +const tablesDBUpdateFloatColumn = async ({databaseId,tableId,key,required,xdefault,min,max,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/float/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + let payload = {}; + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof min !== 'undefined') { + payload['min'] = min; + } + if (typeof max !== 'undefined') { + payload['max'] = max; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof newKey !== 'undefined') { + payload['newKey'] = newKey; + } + + let response = undefined; + + response = await client.call('patch', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBCreateIntegerColumnRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. + * @property {string} key Column Key. + * @property {boolean} required Is column required? + * @property {number} min Minimum value + * @property {number} max Maximum value + * @property {number} xdefault Default value. Cannot be set when column is required. + * @property {boolean} array Is column an array? + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBCreateIntegerColumnRequestParams} params + */ +const tablesDBCreateIntegerColumn = async ({databaseId,tableId,key,required,min,max,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/integer'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + let payload = {}; + if (typeof key !== 'undefined') { + payload['key'] = key; + } + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof min !== 'undefined') { + payload['min'] = min; + } + if (typeof max !== 'undefined') { + payload['max'] = max; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof array !== 'undefined') { + payload['array'] = array; + } + + let response = undefined; + + response = await client.call('post', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBUpdateIntegerColumnRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. + * @property {string} key Column Key. + * @property {boolean} required Is column required? + * @property {number} xdefault Default value. Cannot be set when column is required. + * @property {number} min Minimum value + * @property {number} max Maximum value + * @property {string} newKey New Column Key. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBUpdateIntegerColumnRequestParams} params + */ +const tablesDBUpdateIntegerColumn = async ({databaseId,tableId,key,required,xdefault,min,max,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/integer/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + let payload = {}; + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof min !== 'undefined') { + payload['min'] = min; + } + if (typeof max !== 'undefined') { + payload['max'] = max; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof newKey !== 'undefined') { + payload['newKey'] = newKey; + } + + let response = undefined; + + response = await client.call('patch', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBCreateIpColumnRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. + * @property {string} key Column Key. + * @property {boolean} required Is column required? + * @property {string} xdefault Default value. Cannot be set when column is required. + * @property {boolean} array Is column an array? + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBCreateIpColumnRequestParams} params + */ +const tablesDBCreateIpColumn = async ({databaseId,tableId,key,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/ip'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + let payload = {}; + if (typeof key !== 'undefined') { + payload['key'] = key; + } + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof array !== 'undefined') { + payload['array'] = array; + } + + let response = undefined; + + response = await client.call('post', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBUpdateIpColumnRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. + * @property {string} key Column Key. + * @property {boolean} required Is column required? + * @property {string} xdefault Default value. Cannot be set when column is required. + * @property {string} newKey New Column Key. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBUpdateIpColumnRequestParams} params + */ +const tablesDBUpdateIpColumn = async ({databaseId,tableId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/ip/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + let payload = {}; + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof newKey !== 'undefined') { + payload['newKey'] = newKey; + } + + let response = undefined; + + response = await client.call('patch', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBCreateRelationshipColumnRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. + * @property {string} relatedTableId Related Table ID. + * @property {RelationshipType} type Relation type + * @property {boolean} twoWay Is Two Way? + * @property {string} key Column Key. + * @property {string} twoWayKey Two Way Column Key. + * @property {RelationMutate} onDelete Constraints option + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBCreateRelationshipColumnRequestParams} params + */ +const tablesDBCreateRelationshipColumn = async ({databaseId,tableId,relatedTableId,type,twoWay,key,twoWayKey,onDelete,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/relationship'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + let payload = {}; + if (typeof relatedTableId !== 'undefined') { + payload['relatedTableId'] = relatedTableId; + } + if (typeof type !== 'undefined') { + payload['type'] = type; + } + if (typeof twoWay !== 'undefined') { + payload['twoWay'] = twoWay; + } + if (typeof key !== 'undefined') { + payload['key'] = key; + } + if (typeof twoWayKey !== 'undefined') { + payload['twoWayKey'] = twoWayKey; + } + if (typeof onDelete !== 'undefined') { + payload['onDelete'] = onDelete; + } + + let response = undefined; + + response = await client.call('post', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBCreateStringColumnRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @property {string} key Column Key. + * @property {number} size Column size for text columns, in number of characters. + * @property {boolean} required Is column required? + * @property {string} xdefault Default value for column when not provided. Cannot be set when column is required. + * @property {boolean} array Is column an array? + * @property {boolean} encrypt Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBCreateStringColumnRequestParams} params + */ +const tablesDBCreateStringColumn = async ({databaseId,tableId,key,size,required,xdefault,array,encrypt,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/string'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + let payload = {}; + if (typeof key !== 'undefined') { + payload['key'] = key; + } + if (typeof size !== 'undefined') { + payload['size'] = size; + } + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof array !== 'undefined') { + payload['array'] = array; + } + if (typeof encrypt !== 'undefined') { + payload['encrypt'] = encrypt; + } + + let response = undefined; + + response = await client.call('post', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBUpdateStringColumnRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @property {string} key Column Key. + * @property {boolean} required Is column required? + * @property {string} xdefault Default value for column when not provided. Cannot be set when column is required. + * @property {number} size Maximum size of the string column. + * @property {string} newKey New Column Key. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBUpdateStringColumnRequestParams} params + */ +const tablesDBUpdateStringColumn = async ({databaseId,tableId,key,required,xdefault,size,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/string/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + let payload = {}; + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof size !== 'undefined') { + payload['size'] = size; + } + if (typeof newKey !== 'undefined') { + payload['newKey'] = newKey; + } + + let response = undefined; + + response = await client.call('patch', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBCreateUrlColumnRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. + * @property {string} key Column Key. + * @property {boolean} required Is column required? + * @property {string} xdefault Default value for column when not provided. Cannot be set when column is required. + * @property {boolean} array Is column an array? + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBCreateUrlColumnRequestParams} params + */ +const tablesDBCreateUrlColumn = async ({databaseId,tableId,key,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/url'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + let payload = {}; + if (typeof key !== 'undefined') { + payload['key'] = key; + } + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof array !== 'undefined') { + payload['array'] = array; + } + + let response = undefined; + + response = await client.call('post', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBUpdateUrlColumnRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. + * @property {string} key Column Key. + * @property {boolean} required Is column required? + * @property {string} xdefault Default value for column when not provided. Cannot be set when column is required. + * @property {string} newKey New Column Key. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBUpdateUrlColumnRequestParams} params + */ +const tablesDBUpdateUrlColumn = async ({databaseId,tableId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/url/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + let payload = {}; + if (typeof required !== 'undefined') { + payload['required'] = required; + } + if (typeof xdefault !== 'undefined') { + payload['default'] = xdefault; + } + if (typeof newKey !== 'undefined') { + payload['newKey'] = newKey; + } + + let response = undefined; + + response = await client.call('patch', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBGetColumnRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. + * @property {string} key Column Key. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBGetColumnRequestParams} params + */ +const tablesDBGetColumn = async ({databaseId,tableId,key,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + let payload = {}; + + let response = undefined; + + response = await client.call('get', apiPath, { + }, payload); + + if (parseOutput) { + if(console) { + showConsoleLink('tablesDB', 'getColumn', databaseId, tableId); + } else { + parse(response) + } + } + + return response; + +} +/** + * @typedef {Object} TablesDBDeleteColumnRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. + * @property {string} key Column Key. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBDeleteColumnRequestParams} params + */ +const tablesDBDeleteColumn = async ({databaseId,tableId,key,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + let payload = {}; + + let response = undefined; + + response = await client.call('delete', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBUpdateRelationshipColumnRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. + * @property {string} key Column Key. + * @property {RelationMutate} onDelete Constraints option + * @property {string} newKey New Column Key. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBUpdateRelationshipColumnRequestParams} params + */ +const tablesDBUpdateRelationshipColumn = async ({databaseId,tableId,key,onDelete,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/{key}/relationship'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + let payload = {}; + if (typeof onDelete !== 'undefined') { + payload['onDelete'] = onDelete; + } + if (typeof newKey !== 'undefined') { + payload['newKey'] = newKey; + } + + let response = undefined; + + response = await client.call('patch', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBListIndexesRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @property {string[]} 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 columns: key, type, status, attributes, error + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBListIndexesRequestParams} params + */ +const tablesDBListIndexes = async ({databaseId,tableId,queries,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/indexes'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + let payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + + let response = undefined; + + response = await client.call('get', apiPath, { + }, payload); + + if (parseOutput) { + if(console) { + showConsoleLink('tablesDB', 'listIndexes', databaseId, tableId); + } else { + parse(response) + } + } + + return response; + +} +/** + * @typedef {Object} TablesDBCreateIndexRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @property {string} key Index Key. + * @property {IndexType} type Index type. + * @property {string[]} columns Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long. + * @property {string[]} orders Array of index orders. Maximum of 100 orders are allowed. + * @property {number[]} lengths Length of index. Maximum of 100 + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBCreateIndexRequestParams} params + */ +const tablesDBCreateIndex = async ({databaseId,tableId,key,type,columns,orders,lengths,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/indexes'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + let payload = {}; + if (typeof key !== 'undefined') { + payload['key'] = key; + } + if (typeof type !== 'undefined') { + payload['type'] = type; + } + columns = columns === true ? [] : columns; + if (typeof columns !== 'undefined') { + payload['columns'] = columns; + } + orders = orders === true ? [] : orders; + if (typeof orders !== 'undefined') { + payload['orders'] = orders; + } + lengths = lengths === true ? [] : lengths; + if (typeof lengths !== 'undefined') { + payload['lengths'] = lengths; + } + + let response = undefined; + + response = await client.call('post', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBGetIndexRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @property {string} key Index Key. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBGetIndexRequestParams} params + */ +const tablesDBGetIndex = async ({databaseId,tableId,key,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + let payload = {}; + + let response = undefined; + + response = await client.call('get', apiPath, { + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBDeleteIndexRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @property {string} key Index Key. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBDeleteIndexRequestParams} params + */ +const tablesDBDeleteIndex = async ({databaseId,tableId,key,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + let payload = {}; + + let response = undefined; + + response = await client.call('delete', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBListTableLogsRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. + * @property {string[]} 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 + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBListTableLogsRequestParams} params + */ +const tablesDBListTableLogs = async ({databaseId,tableId,queries,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/logs'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + let payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + + let response = undefined; + + response = await client.call('get', apiPath, { + }, payload); + + if (parseOutput) { + if(console) { + showConsoleLink('tablesDB', 'listTableLogs', databaseId, tableId); + } else { + parse(response) + } + } + + return response; + +} +/** + * @typedef {Object} TablesDBListRowsRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. You can create a new table using the TableDB service [server integration](https://appwrite.io/docs/server/tablesdbdb#tablesdbCreate). + * @property {string[]} 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. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBListRowsRequestParams} params + */ +const tablesDBListRows = async ({databaseId,tableId,queries,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + let payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + + let response = undefined; + + response = await client.call('get', apiPath, { + }, payload); + + if (parseOutput) { + if(console) { + showConsoleLink('tablesDB', 'listRows', databaseId, tableId); + } else { + parse(response) + } + } + + return response; + +} +/** + * @typedef {Object} TablesDBCreateRowRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). Make sure to define columns before creating rows. + * @property {string} rowId Row 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. + * @property {object} data Row data as JSON object. + * @property {string[]} permissions An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBCreateRowRequestParams} params + */ +const tablesDBCreateRow = async ({databaseId,tableId,rowId,data,permissions,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + let payload = {}; + if (typeof rowId !== 'undefined') { + payload['rowId'] = rowId; + } + if (typeof data !== 'undefined') { + payload['data'] = JSON.parse(data); + } + permissions = permissions === true ? [] : permissions; + if (typeof permissions !== 'undefined') { + payload['permissions'] = permissions; + } + + let response = undefined; + + response = await client.call('post', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBCreateRowsRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). Make sure to define columns before creating rows. + * @property {object[]} rows Array of documents data as JSON objects. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBCreateRowsRequestParams} params + */ +const tablesDBCreateRows = async ({databaseId,tableId,rows,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + let payload = {}; + rows = rows === true ? [] : rows; + if (typeof rows !== 'undefined') { + payload['rows'] = rows; + } + + let response = undefined; + + response = await client.call('post', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBUpsertRowsRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. + * @property {object[]} rows Array of row data as JSON objects. May contain partial rows. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBUpsertRowsRequestParams} params + */ +const tablesDBUpsertRows = async ({databaseId,tableId,rows,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + let payload = {}; + rows = rows === true ? [] : rows; + if (typeof rows !== 'undefined') { + payload['rows'] = rows; + } + + let response = undefined; + + response = await client.call('put', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBUpdateRowsRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. + * @property {object} data Row data as JSON object. Include only column and value pairs to be updated. + * @property {string[]} 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. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBUpdateRowsRequestParams} params + */ +const tablesDBUpdateRows = async ({databaseId,tableId,data,queries,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + let payload = {}; + if (typeof data !== 'undefined') { + payload['data'] = JSON.parse(data); + } + queries = queries === true ? [] : queries; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + + let response = undefined; + + response = await client.call('patch', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBDeleteRowsRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @property {string[]} 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. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBDeleteRowsRequestParams} params + */ +const tablesDBDeleteRows = async ({databaseId,tableId,queries,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + let payload = {}; + queries = queries === true ? [] : queries; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + + let response = undefined; + + response = await client.call('delete', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBGetRowRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @property {string} rowId Row ID. + * @property {string[]} 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. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBGetRowRequestParams} params + */ +const tablesDBGetRow = async ({databaseId,tableId,rowId,queries,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId); + let payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + + let response = undefined; + + response = await client.call('get', apiPath, { + }, payload); + + if (parseOutput) { + if(console) { + showConsoleLink('tablesDB', 'getRow', databaseId, tableId, rowId); + } else { + parse(response) + } + } + + return response; + +} +/** + * @typedef {Object} TablesDBUpsertRowRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. + * @property {string} rowId Row ID. + * @property {object} data Row data as JSON object. Include all required columns of the row to be created or updated. + * @property {string[]} permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBUpsertRowRequestParams} params + */ +const tablesDBUpsertRow = async ({databaseId,tableId,rowId,data,permissions,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId); + let payload = {}; + if (typeof data !== 'undefined') { + payload['data'] = JSON.parse(data); + } + permissions = permissions === true ? [] : permissions; + if (typeof permissions !== 'undefined') { + payload['permissions'] = permissions; + } + + let response = undefined; + + response = await client.call('put', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBUpdateRowRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. + * @property {string} rowId Row ID. + * @property {object} data Row data as JSON object. Include only columns and value pairs to be updated. + * @property {string[]} permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBUpdateRowRequestParams} params + */ +const tablesDBUpdateRow = async ({databaseId,tableId,rowId,data,permissions,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId); + let payload = {}; + if (typeof data !== 'undefined') { + payload['data'] = JSON.parse(data); + } + permissions = permissions === true ? [] : permissions; + if (typeof permissions !== 'undefined') { + payload['permissions'] = permissions; + } + + let response = undefined; + + response = await client.call('patch', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBDeleteRowRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). + * @property {string} rowId Row ID. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBDeleteRowRequestParams} params + */ +const tablesDBDeleteRow = async ({databaseId,tableId,rowId,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId); + let payload = {}; + + let response = undefined; + + response = await client.call('delete', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBListRowLogsRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. + * @property {string} rowId Row ID. + * @property {string[]} 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 + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBListRowLogsRequestParams} params + */ +const tablesDBListRowLogs = async ({databaseId,tableId,rowId,queries,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/logs'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId); + let payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + + let response = undefined; + + response = await client.call('get', apiPath, { + }, payload); + + if (parseOutput) { + if(console) { + showConsoleLink('tablesDB', 'listRowLogs', databaseId, tableId, rowId); + } else { + parse(response) + } + } + + return response; + +} +/** + * @typedef {Object} TablesDBDecrementRowColumnRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. + * @property {string} rowId Row ID. + * @property {string} column Column key. + * @property {number} value Value to increment the column by. The value must be a number. + * @property {number} min Minimum value for the column. If the current value is lesser than this value, an exception will be thrown. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBDecrementRowColumnRequestParams} params + */ +const tablesDBDecrementRowColumn = async ({databaseId,tableId,rowId,column,value,min,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/decrement'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId).replace('{column}', column); + let payload = {}; + if (typeof value !== 'undefined') { + payload['value'] = value; + } + if (typeof min !== 'undefined') { + payload['min'] = min; + } + + let response = undefined; + + response = await client.call('patch', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBIncrementRowColumnRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. + * @property {string} rowId Row ID. + * @property {string} column Column key. + * @property {number} value Value to increment the column by. The value must be a number. + * @property {number} max Maximum value for the column. If the current value is greater than this value, an error will be thrown. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBIncrementRowColumnRequestParams} params + */ +const tablesDBIncrementRowColumn = async ({databaseId,tableId,rowId,column,value,max,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/increment'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId).replace('{column}', column); + let payload = {}; + if (typeof value !== 'undefined') { + payload['value'] = value; + } + if (typeof max !== 'undefined') { + payload['max'] = max; + } + + let response = undefined; + + response = await client.call('patch', apiPath, { + 'content-type': 'application/json', + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +/** + * @typedef {Object} TablesDBGetTableUsageRequestParams + * @property {string} databaseId Database ID. + * @property {string} tableId Table ID. + * @property {UsageRange} range Date range. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBGetTableUsageRequestParams} params + */ +const tablesDBGetTableUsage = async ({databaseId,tableId,range,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/usage'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + let payload = {}; + if (typeof range !== 'undefined') { + payload['range'] = range; + } + + let response = undefined; + + response = await client.call('get', apiPath, { + }, payload); + + if (parseOutput) { + if(console) { + showConsoleLink('tablesDB', 'getTableUsage', databaseId, tableId); + } else { + parse(response) + } + } + + return response; + +} +/** + * @typedef {Object} TablesDBGetUsageRequestParams + * @property {string} databaseId Database ID. + * @property {UsageRange} range Date range. + * @property {boolean} overrideForCli + * @property {boolean} parseOutput + * @property {libClient | undefined} sdk + */ + +/** + * @param {TablesDBGetUsageRequestParams} params + */ +const tablesDBGetUsage = async ({databaseId,range,parseOutput = true, overrideForCli = false, sdk = undefined}) => { + let client = !sdk ? await sdkForProject() : + sdk; + let apiPath = '/tablesdb/{databaseId}/usage'.replace('{databaseId}', databaseId); + let payload = {}; + if (typeof range !== 'undefined') { + payload['range'] = range; + } + + let response = undefined; + + response = await client.call('get', apiPath, { + }, payload); + + if (parseOutput) { + parse(response) + } + + return response; + +} +tablesDB + .command(`list`) + .description(`Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.`) + .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 columns: name`) + .option(`--search `, `Search term to filter your list results. Max length: 256 chars.`) + .option(`--console`, `Get the resource console url`) + .action(actionRunner(tablesDBList)) + +tablesDB + .command(`create`) + .description(`Create a new Database. `) + .requiredOption(`--database-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.`) + .requiredOption(`--name `, `Database name. Max length: 128 chars.`) + .option(`--enabled [value]`, `Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.`, (value) => value === undefined ? true : parseBool(value)) + .action(actionRunner(tablesDBCreate)) + +tablesDB + .command(`list-usage`) + .description(`List usage metrics and statistics for all databases in the project. You can view the total number of databases, tables, rows, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.`) + .option(`--range `, `Date range.`) + .option(`--console`, `Get the resource console url`) + .action(actionRunner(tablesDBListUsage)) + +tablesDB + .command(`get`) + .description(`Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.`) + .requiredOption(`--database-id `, `Database ID.`) + .option(`--console`, `Get the resource console url`) + .action(actionRunner(tablesDBGet)) + +tablesDB + .command(`update`) + .description(`Update a database by its unique ID.`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--name `, `Database name. Max length: 128 chars.`) + .option(`--enabled [value]`, `Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.`, (value) => value === undefined ? true : parseBool(value)) + .action(actionRunner(tablesDBUpdate)) + +tablesDB + .command(`delete`) + .description(`Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.`) + .requiredOption(`--database-id `, `Database ID.`) + .action(actionRunner(tablesDBDelete)) + +tablesDB + .command(`list-tables`) + .description(`Get a list of all tables that belong to the provided databaseId. You can use the search parameter to filter your results.`) + .requiredOption(`--database-id `, `Database ID.`) + .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 columns: name, enabled, rowSecurity`) + .option(`--search `, `Search term to filter your list results. Max length: 256 chars.`) + .option(`--console`, `Get the resource console url`) + .action(actionRunner(tablesDBListTables)) + +tablesDB + .command(`create-table`) + .description(`Create a new Table. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) API or directly from your database console.`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-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.`) + .requiredOption(`--name `, `Table name. Max length: 128 chars.`) + .option(`--permissions [permissions...]`, `An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).`) + .option(`--row-security [value]`, `Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions).`, (value) => value === undefined ? true : parseBool(value)) + .option(`--enabled [value]`, `Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.`, (value) => value === undefined ? true : parseBool(value)) + .action(actionRunner(tablesDBCreateTable)) + +tablesDB + .command(`get-table`) + .description(`Get a table by its unique ID. This endpoint response returns a JSON object with the table metadata.`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID.`) + .option(`--console`, `Get the resource console url`) + .action(actionRunner(tablesDBGetTable)) + +tablesDB + .command(`update-table`) + .description(`Update a table by its unique ID.`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID.`) + .requiredOption(`--name `, `Table name. Max length: 128 chars.`) + .option(`--permissions [permissions...]`, `An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).`) + .option(`--row-security [value]`, `Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions).`, (value) => value === undefined ? true : parseBool(value)) + .option(`--enabled [value]`, `Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.`, (value) => value === undefined ? true : parseBool(value)) + .action(actionRunner(tablesDBUpdateTable)) + +tablesDB + .command(`delete-table`) + .description(`Delete a table by its unique ID. Only users with write permissions have access to delete this resource.`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID.`) + .action(actionRunner(tablesDBDeleteTable)) + +tablesDB + .command(`list-columns`) + .description(`List columns in the table.`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID.`) + .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 columns: key, type, size, required, array, status, error`) + .option(`--console`, `Get the resource console url`) + .action(actionRunner(tablesDBListColumns)) + +tablesDB + .command(`create-boolean-column`) + .description(`Create a boolean column. `) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).`) + .requiredOption(`--key `, `Column Key.`) + .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value)) + .option(`--xdefault [value]`, `Default value for column when not provided. Cannot be set when column is required.`, (value) => value === undefined ? true : parseBool(value)) + .option(`--array [value]`, `Is column an array?`, (value) => value === undefined ? true : parseBool(value)) + .action(actionRunner(tablesDBCreateBooleanColumn)) + +tablesDB + .command(`update-boolean-column`) + .description(`Update a boolean column. Changing the 'default' value will not update already existing rows.`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).`) + .requiredOption(`--key `, `Column Key.`) + .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value)) + .option(`--xdefault [value]`, `Default value for column when not provided. Cannot be set when column is required.`, (value) => value === undefined ? true : parseBool(value)) + .option(`--new-key `, `New Column Key.`) + .action(actionRunner(tablesDBUpdateBooleanColumn)) + +tablesDB + .command(`create-datetime-column`) + .description(`Create a date time column according to the ISO 8601 standard.`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID.`) + .requiredOption(`--key `, `Column Key.`) + .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value)) + .option(`--xdefault `, `Default value for the column in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when column is required.`) + .option(`--array [value]`, `Is column an array?`, (value) => value === undefined ? true : parseBool(value)) + .action(actionRunner(tablesDBCreateDatetimeColumn)) + +tablesDB + .command(`update-datetime-column`) + .description(`Update a date time column. Changing the 'default' value will not update already existing rows.`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID.`) + .requiredOption(`--key `, `Column Key.`) + .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value)) + .option(`--xdefault `, `Default value for column when not provided. Cannot be set when column is required.`) + .option(`--new-key `, `New Column Key.`) + .action(actionRunner(tablesDBUpdateDatetimeColumn)) + +tablesDB + .command(`create-email-column`) + .description(`Create an email column. `) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID.`) + .requiredOption(`--key `, `Column Key.`) + .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value)) + .option(`--xdefault `, `Default value for column when not provided. Cannot be set when column is required.`) + .option(`--array [value]`, `Is column an array?`, (value) => value === undefined ? true : parseBool(value)) + .action(actionRunner(tablesDBCreateEmailColumn)) + +tablesDB + .command(`update-email-column`) + .description(`Update an email column. Changing the 'default' value will not update already existing rows. `) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID.`) + .requiredOption(`--key `, `Column Key.`) + .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value)) + .option(`--xdefault `, `Default value for column when not provided. Cannot be set when column is required.`) + .option(`--new-key `, `New Column Key.`) + .action(actionRunner(tablesDBUpdateEmailColumn)) + +tablesDB + .command(`create-enum-column`) + .description(`Create an enumeration column. The 'elements' param acts as a white-list of accepted values for this column.`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID.`) + .requiredOption(`--key `, `Column Key.`) + .requiredOption(`--elements [elements...]`, `Array of enum values.`) + .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value)) + .option(`--xdefault `, `Default value for column when not provided. Cannot be set when column is required.`) + .option(`--array [value]`, `Is column an array?`, (value) => value === undefined ? true : parseBool(value)) + .action(actionRunner(tablesDBCreateEnumColumn)) + +tablesDB + .command(`update-enum-column`) + .description(`Update an enum column. Changing the 'default' value will not update already existing rows. `) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID.`) + .requiredOption(`--key `, `Column Key.`) + .requiredOption(`--elements [elements...]`, `Updated list of enum values.`) + .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value)) + .option(`--xdefault `, `Default value for column when not provided. Cannot be set when column is required.`) + .option(`--new-key `, `New Column Key.`) + .action(actionRunner(tablesDBUpdateEnumColumn)) + +tablesDB + .command(`create-float-column`) + .description(`Create a float column. Optionally, minimum and maximum values can be provided. `) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID.`) + .requiredOption(`--key `, `Column Key.`) + .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value)) + .option(`--min `, `Minimum value`, parseInteger) + .option(`--max `, `Maximum value`, parseInteger) + .option(`--xdefault `, `Default value. Cannot be set when required.`, parseInteger) + .option(`--array [value]`, `Is column an array?`, (value) => value === undefined ? true : parseBool(value)) + .action(actionRunner(tablesDBCreateFloatColumn)) + +tablesDB + .command(`update-float-column`) + .description(`Update a float column. Changing the 'default' value will not update already existing rows. `) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID.`) + .requiredOption(`--key `, `Column Key.`) + .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value)) + .option(`--xdefault `, `Default value. Cannot be set when required.`, parseInteger) + .option(`--min `, `Minimum value`, parseInteger) + .option(`--max `, `Maximum value`, parseInteger) + .option(`--new-key `, `New Column Key.`) + .action(actionRunner(tablesDBUpdateFloatColumn)) + +tablesDB + .command(`create-integer-column`) + .description(`Create an integer column. Optionally, minimum and maximum values can be provided. `) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID.`) + .requiredOption(`--key `, `Column Key.`) + .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value)) + .option(`--min `, `Minimum value`, parseInteger) + .option(`--max `, `Maximum value`, parseInteger) + .option(`--xdefault `, `Default value. Cannot be set when column is required.`, parseInteger) + .option(`--array [value]`, `Is column an array?`, (value) => value === undefined ? true : parseBool(value)) + .action(actionRunner(tablesDBCreateIntegerColumn)) + +tablesDB + .command(`update-integer-column`) + .description(`Update an integer column. Changing the 'default' value will not update already existing rows. `) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID.`) + .requiredOption(`--key `, `Column Key.`) + .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value)) + .option(`--xdefault `, `Default value. Cannot be set when column is required.`, parseInteger) + .option(`--min `, `Minimum value`, parseInteger) + .option(`--max `, `Maximum value`, parseInteger) + .option(`--new-key `, `New Column Key.`) + .action(actionRunner(tablesDBUpdateIntegerColumn)) + +tablesDB + .command(`create-ip-column`) + .description(`Create IP address column. `) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID.`) + .requiredOption(`--key `, `Column Key.`) + .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value)) + .option(`--xdefault `, `Default value. Cannot be set when column is required.`) + .option(`--array [value]`, `Is column an array?`, (value) => value === undefined ? true : parseBool(value)) + .action(actionRunner(tablesDBCreateIpColumn)) + +tablesDB + .command(`update-ip-column`) + .description(`Update an ip column. Changing the 'default' value will not update already existing rows. `) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID.`) + .requiredOption(`--key `, `Column Key.`) + .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value)) + .option(`--xdefault `, `Default value. Cannot be set when column is required.`) + .option(`--new-key `, `New Column Key.`) + .action(actionRunner(tablesDBUpdateIpColumn)) + +tablesDB + .command(`create-relationship-column`) + .description(`Create relationship column. [Learn more about relationship columns](https://appwrite.io/docs/databases-relationships#relationship-columns). `) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID.`) + .requiredOption(`--related-table-id `, `Related Table ID.`) + .requiredOption(`--type `, `Relation type`) + .option(`--two-way [value]`, `Is Two Way?`, (value) => value === undefined ? true : parseBool(value)) + .option(`--key `, `Column Key.`) + .option(`--two-way-key `, `Two Way Column Key.`) + .option(`--on-delete `, `Constraints option`) + .action(actionRunner(tablesDBCreateRelationshipColumn)) + +tablesDB + .command(`create-string-column`) + .description(`Create a string column. `) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).`) + .requiredOption(`--key `, `Column Key.`) + .requiredOption(`--size `, `Column size for text columns, in number of characters.`, parseInteger) + .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value)) + .option(`--xdefault `, `Default value for column when not provided. Cannot be set when column is required.`) + .option(`--array [value]`, `Is column an array?`, (value) => value === undefined ? true : parseBool(value)) + .option(`--encrypt [value]`, `Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.`, (value) => value === undefined ? true : parseBool(value)) + .action(actionRunner(tablesDBCreateStringColumn)) + +tablesDB + .command(`update-string-column`) + .description(`Update a string column. Changing the 'default' value will not update already existing rows. `) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).`) + .requiredOption(`--key `, `Column Key.`) + .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value)) + .option(`--xdefault `, `Default value for column when not provided. Cannot be set when column is required.`) + .option(`--size `, `Maximum size of the string column.`, parseInteger) + .option(`--new-key `, `New Column Key.`) + .action(actionRunner(tablesDBUpdateStringColumn)) + +tablesDB + .command(`create-url-column`) + .description(`Create a URL column. `) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID.`) + .requiredOption(`--key `, `Column Key.`) + .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value)) + .option(`--xdefault `, `Default value for column when not provided. Cannot be set when column is required.`) + .option(`--array [value]`, `Is column an array?`, (value) => value === undefined ? true : parseBool(value)) + .action(actionRunner(tablesDBCreateUrlColumn)) + +tablesDB + .command(`update-url-column`) + .description(`Update an url column. Changing the 'default' value will not update already existing rows. `) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID.`) + .requiredOption(`--key `, `Column Key.`) + .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value)) + .option(`--xdefault `, `Default value for column when not provided. Cannot be set when column is required.`) + .option(`--new-key `, `New Column Key.`) + .action(actionRunner(tablesDBUpdateUrlColumn)) + +tablesDB + .command(`get-column`) + .description(`Get column by ID.`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID.`) + .requiredOption(`--key `, `Column Key.`) + .option(`--console`, `Get the resource console url`) + .action(actionRunner(tablesDBGetColumn)) + +tablesDB + .command(`delete-column`) + .description(`Deletes a column.`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID.`) + .requiredOption(`--key `, `Column Key.`) + .action(actionRunner(tablesDBDeleteColumn)) + +tablesDB + .command(`update-relationship-column`) + .description(`Update relationship column. [Learn more about relationship columns](https://appwrite.io/docs/databases-relationships#relationship-columns). `) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID.`) + .requiredOption(`--key `, `Column Key.`) + .option(`--on-delete `, `Constraints option`) + .option(`--new-key `, `New Column Key.`) + .action(actionRunner(tablesDBUpdateRelationshipColumn)) + +tablesDB + .command(`list-indexes`) + .description(`List indexes on the table.`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).`) + .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 columns: key, type, status, attributes, error`) + .option(`--console`, `Get the resource console url`) + .action(actionRunner(tablesDBListIndexes)) + +tablesDB + .command(`create-index`) + .description(`Creates an index on the columns listed. Your index should include all the columns you will query in a single request. Type can be 'key', 'fulltext', or 'unique'.`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).`) + .requiredOption(`--key `, `Index Key.`) + .requiredOption(`--type `, `Index type.`) + .requiredOption(`--columns [columns...]`, `Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long.`) + .option(`--orders [orders...]`, `Array of index orders. Maximum of 100 orders are allowed.`) + .option(`--lengths [lengths...]`, `Length of index. Maximum of 100`) + .action(actionRunner(tablesDBCreateIndex)) + +tablesDB + .command(`get-index`) + .description(`Get index by ID.`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).`) + .requiredOption(`--key `, `Index Key.`) + .action(actionRunner(tablesDBGetIndex)) + +tablesDB + .command(`delete-index`) + .description(`Delete an index.`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).`) + .requiredOption(`--key `, `Index Key.`) + .action(actionRunner(tablesDBDeleteIndex)) + +tablesDB + .command(`list-table-logs`) + .description(`Get the table activity logs list by its unique ID.`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID.`) + .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`) + .option(`--console`, `Get the resource console url`) + .action(actionRunner(tablesDBListTableLogs)) + +tablesDB + .command(`list-rows`) + .description(`Get a list of all the user's rows in a given table. You can use the query params to filter your results.`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID. You can create a new table using the TableDB service [server integration](https://appwrite.io/docs/server/tablesdbdb#tablesdbCreate).`) + .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.`) + .option(`--console`, `Get the resource console url`) + .action(actionRunner(tablesDBListRows)) + +tablesDB + .command(`create-row`) + .description(`Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) API or directly from your database console.`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). Make sure to define columns before creating rows.`) + .requiredOption(`--row-id `, `Row 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.`) + .requiredOption(`--data `, `Row data as JSON object.`) + .option(`--permissions [permissions...]`, `An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).`) + .action(actionRunner(tablesDBCreateRow)) + +tablesDB + .command(`create-rows`) + .description(`Create new Rows. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) API or directly from your database console.`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). Make sure to define columns before creating rows.`) + .requiredOption(`--rows [rows...]`, `Array of documents data as JSON objects.`) + .action(actionRunner(tablesDBCreateRows)) + +tablesDB + .command(`upsert-rows`) + .description(`Create or update Rows. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) API or directly from your database console. `) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID.`) + .requiredOption(`--rows [rows...]`, `Array of row data as JSON objects. May contain partial rows.`) + .action(actionRunner(tablesDBUpsertRows)) + +tablesDB + .command(`update-rows`) + .description(`Update all rows that match your queries, if no queries are submitted then all rows are updated. You can pass only specific fields to be updated.`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID.`) + .option(`--data `, `Row data as JSON object. Include only column and value pairs to be updated.`) + .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.`) + .action(actionRunner(tablesDBUpdateRows)) + +tablesDB + .command(`delete-rows`) + .description(`Bulk delete rows using queries, if no queries are passed then all rows are deleted.`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).`) + .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.`) + .action(actionRunner(tablesDBDeleteRows)) + +tablesDB + .command(`get-row`) + .description(`Get a row by its unique ID. This endpoint response returns a JSON object with the row data.`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).`) + .requiredOption(`--row-id `, `Row ID.`) + .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.`) + .option(`--console`, `Get the resource console url`) + .action(actionRunner(tablesDBGetRow)) + +tablesDB + .command(`upsert-row`) + .description(`Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) API or directly from your database console.`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID.`) + .requiredOption(`--row-id `, `Row ID.`) + .option(`--data `, `Row data as JSON object. Include all required columns of the row to be created or updated.`) + .option(`--permissions [permissions...]`, `An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).`) + .action(actionRunner(tablesDBUpsertRow)) + +tablesDB + .command(`update-row`) + .description(`Update a row by its unique ID. Using the patch method you can pass only specific fields that will get updated.`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID.`) + .requiredOption(`--row-id `, `Row ID.`) + .option(`--data `, `Row data as JSON object. Include only columns and value pairs to be updated.`) + .option(`--permissions [permissions...]`, `An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).`) + .action(actionRunner(tablesDBUpdateRow)) + +tablesDB + .command(`delete-row`) + .description(`Delete a row by its unique ID.`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).`) + .requiredOption(`--row-id `, `Row ID.`) + .action(actionRunner(tablesDBDeleteRow)) + +tablesDB + .command(`list-row-logs`) + .description(`Get the row activity logs list by its unique ID.`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID.`) + .requiredOption(`--row-id `, `Row ID.`) + .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`) + .option(`--console`, `Get the resource console url`) + .action(actionRunner(tablesDBListRowLogs)) + +tablesDB + .command(`decrement-row-column`) + .description(`Decrement a specific column of a row by a given value.`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID.`) + .requiredOption(`--row-id `, `Row ID.`) + .requiredOption(`--column `, `Column key.`) + .option(`--value `, `Value to increment the column by. The value must be a number.`, parseInteger) + .option(`--min `, `Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.`, parseInteger) + .action(actionRunner(tablesDBDecrementRowColumn)) + +tablesDB + .command(`increment-row-column`) + .description(`Increment a specific column of a row by a given value.`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID.`) + .requiredOption(`--row-id `, `Row ID.`) + .requiredOption(`--column `, `Column key.`) + .option(`--value `, `Value to increment the column by. The value must be a number.`, parseInteger) + .option(`--max `, `Maximum value for the column. If the current value is greater than this value, an error will be thrown.`, parseInteger) + .action(actionRunner(tablesDBIncrementRowColumn)) + +tablesDB + .command(`get-table-usage`) + .description(`Get usage metrics and statistics for a table. Returning the total number of rows. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.`) + .requiredOption(`--database-id `, `Database ID.`) + .requiredOption(`--table-id `, `Table ID.`) + .option(`--range `, `Date range.`) + .option(`--console`, `Get the resource console url`) + .action(actionRunner(tablesDBGetTableUsage)) + +tablesDB + .command(`get-usage`) + .description(`Get usage metrics and statistics for a database. You can view the total number of tables, rows, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.`) + .requiredOption(`--database-id `, `Database ID.`) + .option(`--range `, `Date range.`) + .action(actionRunner(tablesDBGetUsage)) + +module.exports = { + tablesDB, + tablesDBList, + tablesDBCreate, + tablesDBListUsage, + tablesDBGet, + tablesDBUpdate, + tablesDBDelete, + tablesDBListTables, + tablesDBCreateTable, + tablesDBGetTable, + tablesDBUpdateTable, + tablesDBDeleteTable, + tablesDBListColumns, + tablesDBCreateBooleanColumn, + tablesDBUpdateBooleanColumn, + tablesDBCreateDatetimeColumn, + tablesDBUpdateDatetimeColumn, + tablesDBCreateEmailColumn, + tablesDBUpdateEmailColumn, + tablesDBCreateEnumColumn, + tablesDBUpdateEnumColumn, + tablesDBCreateFloatColumn, + tablesDBUpdateFloatColumn, + tablesDBCreateIntegerColumn, + tablesDBUpdateIntegerColumn, + tablesDBCreateIpColumn, + tablesDBUpdateIpColumn, + tablesDBCreateRelationshipColumn, + tablesDBCreateStringColumn, + tablesDBUpdateStringColumn, + tablesDBCreateUrlColumn, + tablesDBUpdateUrlColumn, + tablesDBGetColumn, + tablesDBDeleteColumn, + tablesDBUpdateRelationshipColumn, + tablesDBListIndexes, + tablesDBCreateIndex, + tablesDBGetIndex, + tablesDBDeleteIndex, + tablesDBListTableLogs, + tablesDBListRows, + tablesDBCreateRow, + tablesDBCreateRows, + tablesDBUpsertRows, + tablesDBUpdateRows, + tablesDBDeleteRows, + tablesDBGetRow, + tablesDBUpsertRow, + tablesDBUpdateRow, + tablesDBDeleteRow, + tablesDBListRowLogs, + tablesDBDecrementRowColumn, + tablesDBIncrementRowColumn, + tablesDBGetTableUsage, + tablesDBGetUsage +}; diff --git a/lib/commands/teams.js b/lib/commands/teams.js index 5e769be..7d500ab 100644 --- a/lib/commands/teams.js +++ b/lib/commands/teams.js @@ -7,7 +7,7 @@ const libClient = require('../client.js'); const { getAllFiles, showConsoleLink } = require('../utils.js'); const { Command } = require('commander'); const { sdkForProject, sdkForConsole } = require('../sdks') -const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log } = require('../parser') +const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log, warn } = require('../parser') const { localConfig, globalConfig } = require("../config"); const { File } = require('undici'); const { ReadableStream } = require('stream/web'); @@ -79,7 +79,6 @@ const teamsList = async ({queries,search,parseOutput = true, overrideForCli = fa return response; } - /** * @typedef {Object} TeamsCreateRequestParams * @property {string} teamId Team 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. @@ -122,7 +121,6 @@ const teamsCreate = async ({teamId,name,roles,parseOutput = true, overrideForCli return response; } - /** * @typedef {Object} TeamsGetRequestParams * @property {string} teamId Team ID. @@ -156,7 +154,6 @@ const teamsGet = async ({teamId,parseOutput = true, overrideForCli = false, sdk return response; } - /** * @typedef {Object} TeamsUpdateNameRequestParams * @property {string} teamId Team ID. @@ -191,7 +188,6 @@ const teamsUpdateName = async ({teamId,name,parseOutput = true, overrideForCli = return response; } - /** * @typedef {Object} TeamsDeleteRequestParams * @property {string} teamId Team ID. @@ -222,7 +218,6 @@ const teamsDelete = async ({teamId,parseOutput = true, overrideForCli = false, s return response; } - /** * @typedef {Object} TeamsListLogsRequestParams * @property {string} teamId Team ID. @@ -256,7 +251,6 @@ const teamsListLogs = async ({teamId,queries,parseOutput = true, overrideForCli return response; } - /** * @typedef {Object} TeamsListMembershipsRequestParams * @property {string} teamId Team ID. @@ -294,7 +288,6 @@ const teamsListMemberships = async ({teamId,queries,search,parseOutput = true, o return response; } - /** * @typedef {Object} TeamsCreateMembershipRequestParams * @property {string} teamId Team ID. @@ -350,7 +343,6 @@ const teamsCreateMembership = async ({teamId,roles,email,userId,phone,url,name,p return response; } - /** * @typedef {Object} TeamsGetMembershipRequestParams * @property {string} teamId Team ID. @@ -381,7 +373,6 @@ const teamsGetMembership = async ({teamId,membershipId,parseOutput = true, overr return response; } - /** * @typedef {Object} TeamsUpdateMembershipRequestParams * @property {string} teamId Team ID. @@ -418,7 +409,6 @@ const teamsUpdateMembership = async ({teamId,membershipId,roles,parseOutput = tr return response; } - /** * @typedef {Object} TeamsDeleteMembershipRequestParams * @property {string} teamId Team ID. @@ -450,7 +440,6 @@ const teamsDeleteMembership = async ({teamId,membershipId,parseOutput = true, ov return response; } - /** * @typedef {Object} TeamsUpdateMembershipStatusRequestParams * @property {string} teamId Team ID. @@ -490,7 +479,6 @@ const teamsUpdateMembershipStatus = async ({teamId,membershipId,userId,secret,pa return response; } - /** * @typedef {Object} TeamsGetPrefsRequestParams * @property {string} teamId Team ID. @@ -520,7 +508,6 @@ const teamsGetPrefs = async ({teamId,parseOutput = true, overrideForCli = false, return response; } - /** * @typedef {Object} TeamsUpdatePrefsRequestParams * @property {string} teamId Team ID. @@ -555,7 +542,6 @@ const teamsUpdatePrefs = async ({teamId,prefs,parseOutput = true, overrideForCli return response; } - teams .command(`list`) .description(`Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.`) diff --git a/lib/commands/tokens.js b/lib/commands/tokens.js index 8e5e147..5449327 100644 --- a/lib/commands/tokens.js +++ b/lib/commands/tokens.js @@ -7,7 +7,7 @@ const libClient = require('../client.js'); const { getAllFiles, showConsoleLink } = require('../utils.js'); const { Command } = require('commander'); const { sdkForProject, sdkForConsole } = require('../sdks') -const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log } = require('../parser') +const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log, warn } = require('../parser') const { localConfig, globalConfig } = require("../config"); const { File } = require('undici'); const { ReadableStream } = require('stream/web'); @@ -77,7 +77,6 @@ const tokensList = async ({bucketId,fileId,queries,parseOutput = true, overrideF return response; } - /** * @typedef {Object} TokensCreateFileTokenRequestParams * @property {string} bucketId Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). @@ -113,7 +112,6 @@ const tokensCreateFileToken = async ({bucketId,fileId,expire,parseOutput = true, return response; } - /** * @typedef {Object} TokensGetRequestParams * @property {string} tokenId Token ID. @@ -147,7 +145,6 @@ const tokensGet = async ({tokenId,parseOutput = true, overrideForCli = false, sd return response; } - /** * @typedef {Object} TokensUpdateRequestParams * @property {string} tokenId Token unique ID. @@ -182,7 +179,6 @@ const tokensUpdate = async ({tokenId,expire,parseOutput = true, overrideForCli = return response; } - /** * @typedef {Object} TokensDeleteRequestParams * @property {string} tokenId Token ID. @@ -213,7 +209,6 @@ const tokensDelete = async ({tokenId,parseOutput = true, overrideForCli = false, return response; } - tokens .command(`list`) .description(`List all the tokens created for a specific file or bucket. You can use the query params to filter your results.`) diff --git a/lib/commands/update.js b/lib/commands/update.js new file mode 100644 index 0000000..2c7cfc5 --- /dev/null +++ b/lib/commands/update.js @@ -0,0 +1,218 @@ +const fs = require("fs"); +const path = require("path"); +const { spawn } = require("child_process"); +const { Command } = require("commander"); +const { fetch } = require("undici"); +const chalk = require("chalk"); +const inquirer = require("inquirer"); +const { success, log, warn, error, hint, actionRunner, commandDescriptions } = require("../parser"); +const { getLatestVersion, compareVersions } = require("../utils"); +const { version } = require("../../package.json"); + +/** + * Check if the CLI was installed via npm + */ +const isInstalledViaNpm = () => { + try { + const scriptPath = process.argv[1]; + + if (scriptPath.includes('node_modules') && scriptPath.includes('appwrite-cli')) { + return true; + } + + if (scriptPath.includes('/usr/local/lib/node_modules/') || + scriptPath.includes('/opt/homebrew/lib/node_modules/') || + scriptPath.includes('/.npm-global/') || + scriptPath.includes('/node_modules/.bin/')) { + return true; + } + + return false; + } catch (e) { + return false; + } +}; + +/** + * Check if the CLI was installed via Homebrew + */ +const isInstalledViaHomebrew = () => { + try { + const scriptPath = process.argv[1]; + return scriptPath.includes('/opt/homebrew/') || scriptPath.includes('/usr/local/Cellar/'); + } catch (e) { + return false; + } +}; + + + +/** + * Execute command and return promise + */ +const execCommand = (command, args = [], options = {}) => { + return new Promise((resolve, reject) => { + const child = spawn(command, args, { + stdio: 'inherit', + shell: true, + ...options + }); + + child.on('close', (code) => { + if (code === 0) { + resolve(); + } else { + reject(new Error(`Command failed with exit code ${code}`)); + } + }); + + child.on('error', (err) => { + reject(err); + }); + }); +}; + +/** + * Update via npm + */ +const updateViaNpm = async () => { + try { + await execCommand('npm', ['install', '-g', 'appwrite-cli@latest']); + console.log(""); + success("Updated to latest version via npm!"); + hint("Run 'appwrite --version' to verify the new version."); + } catch (e) { + if (e.message.includes('EEXIST') || e.message.includes('file already exists')) { + console.log(""); + success("Latest version is already installed via npm!"); + hint("The CLI is up to date. Run 'appwrite --version' to verify."); + } else { + console.log(""); + error(`Failed to update via npm: ${e.message}`); + hint("Try running: npm install -g appwrite-cli@latest --force"); + } + } +}; + +/** + * Update via Homebrew + */ +const updateViaHomebrew = async () => { + try { + await execCommand('brew', ['upgrade', 'appwrite']); + console.log(""); + success("Updated to latest version via Homebrew!"); + hint("Run 'appwrite --version' to verify the new version."); + } catch (e) { + if (e.message.includes('already installed') || e.message.includes('up-to-date')) { + console.log(""); + success("Latest version is already installed via Homebrew!"); + hint("The CLI is up to date. Run 'appwrite --version' to verify."); + } else { + console.log(""); + error(`Failed to update via Homebrew: ${e.message}`); + hint("Try running: brew upgrade appwrite"); + } + } +}; + +/** + * Show manual update instructions + */ +const showManualInstructions = (latestVersion) => { + log("Manual update options:"); + console.log(""); + + log(`${chalk.bold("Option 1: NPM")}`); + console.log(` npm install -g appwrite-cli@latest`); + console.log(""); + + log(`${chalk.bold("Option 2: Homebrew")}`); + console.log(` brew upgrade appwrite`); + console.log(""); + + log(`${chalk.bold("Option 3: Download Binary")}`); + console.log(` Visit: https://github.com/appwrite-cli/releases/tag/${latestVersion}`); +}; + +/** + * Show interactive menu for choosing update method + */ +const chooseUpdateMethod = async (latestVersion) => { + const choices = [ + { name: 'NPM', value: 'npm' }, + { name: 'Homebrew', value: 'homebrew' }, + { name: 'Show manual instructions', value: 'manual' } + ]; + + const { method } = await inquirer.prompt([ + { + type: 'list', + name: 'method', + message: 'Could not detect installation method. How would you like to update?', + choices: choices + } + ]); + + switch (method) { + case 'npm': + await updateViaNpm(); + break; + case 'homebrew': + await updateViaHomebrew(); + break; + case 'manual': + showManualInstructions(latestVersion); + break; + } +}; + +/** + * Main update function + */ +const updateCli = async ({ manual } = {}) => { + try { + const latestVersion = await getLatestVersion(); + + const comparison = compareVersions(version, latestVersion); + + if (comparison === 0) { + success(`You're already running the latest version (${chalk.bold(version)})!`); + return; + } else if (comparison < 0) { + warn(`You're running a newer version (${chalk.bold(version)}) than the latest released version (${chalk.bold(latestVersion)}).`); + hint("This might be a pre-release or development version."); + return; + } + + log(`Updating from ${chalk.blue(version)} to ${chalk.green(latestVersion)}...`); + console.log(""); + + if (manual) { + showManualInstructions(latestVersion); + return; + } + + if (isInstalledViaNpm()) { + await updateViaNpm(); + } else if (isInstalledViaHomebrew()) { + await updateViaHomebrew(); + } else { + await chooseUpdateMethod(latestVersion); + } + + } catch (e) { + console.log(""); + error(`Failed to check for updates: ${e.message}`); + hint("You can manually check for updates at: https://github.com/appwrite-cli/releases"); + } +}; + +const update = new Command("update") + .description("Update the Appwrite CLI to the latest version") + .option("--manual", "Show manual update instructions instead of auto-updating") + .action(actionRunner(updateCli)); + +module.exports = { + update +}; diff --git a/lib/commands/users.js b/lib/commands/users.js index f9eab2a..6fddf9f 100644 --- a/lib/commands/users.js +++ b/lib/commands/users.js @@ -7,7 +7,7 @@ const libClient = require('../client.js'); const { getAllFiles, showConsoleLink } = require('../utils.js'); const { Command } = require('commander'); const { sdkForProject, sdkForConsole } = require('../sdks') -const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log } = require('../parser') +const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log, warn } = require('../parser') const { localConfig, globalConfig } = require("../config"); const { File } = require('undici'); const { ReadableStream } = require('stream/web'); @@ -79,7 +79,6 @@ const usersList = async ({queries,search,parseOutput = true, overrideForCli = fa return response; } - /** * @typedef {Object} UsersCreateRequestParams * @property {string} 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. @@ -129,7 +128,6 @@ const usersCreate = async ({userId,email,phone,password,name,parseOutput = true, return response; } - /** * @typedef {Object} UsersCreateArgon2UserRequestParams * @property {string} 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. @@ -175,7 +173,6 @@ const usersCreateArgon2User = async ({userId,email,password,name,parseOutput = t return response; } - /** * @typedef {Object} UsersCreateBcryptUserRequestParams * @property {string} 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. @@ -221,7 +218,6 @@ const usersCreateBcryptUser = async ({userId,email,password,name,parseOutput = t return response; } - /** * @typedef {Object} UsersListIdentitiesRequestParams * @property {string[]} 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 @@ -258,7 +254,6 @@ const usersListIdentities = async ({queries,search,parseOutput = true, overrideF return response; } - /** * @typedef {Object} UsersDeleteIdentityRequestParams * @property {string} identityId Identity ID. @@ -289,7 +284,6 @@ const usersDeleteIdentity = async ({identityId,parseOutput = true, overrideForCl return response; } - /** * @typedef {Object} UsersCreateMD5UserRequestParams * @property {string} 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. @@ -335,7 +329,6 @@ const usersCreateMD5User = async ({userId,email,password,name,parseOutput = true return response; } - /** * @typedef {Object} UsersCreatePHPassUserRequestParams * @property {string} 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. @@ -381,7 +374,6 @@ const usersCreatePHPassUser = async ({userId,email,password,name,parseOutput = t return response; } - /** * @typedef {Object} UsersCreateScryptUserRequestParams * @property {string} 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. @@ -447,7 +439,6 @@ const usersCreateScryptUser = async ({userId,email,password,passwordSalt,passwor return response; } - /** * @typedef {Object} UsersCreateScryptModifiedUserRequestParams * @property {string} 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. @@ -505,7 +496,6 @@ const usersCreateScryptModifiedUser = async ({userId,email,password,passwordSalt return response; } - /** * @typedef {Object} UsersCreateSHAUserRequestParams * @property {string} 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. @@ -555,10 +545,9 @@ const usersCreateSHAUser = async ({userId,email,password,passwordVersion,name,pa return response; } - /** * @typedef {Object} UsersGetUsageRequestParams - * @property {UserUsageRange} range Date range. + * @property {UsageRange} range Date range. * @property {boolean} overrideForCli * @property {boolean} parseOutput * @property {libClient | undefined} sdk @@ -588,7 +577,6 @@ const usersGetUsage = async ({range,parseOutput = true, overrideForCli = false, return response; } - /** * @typedef {Object} UsersGetRequestParams * @property {string} userId User ID. @@ -622,7 +610,6 @@ const usersGet = async ({userId,parseOutput = true, overrideForCli = false, sdk return response; } - /** * @typedef {Object} UsersDeleteRequestParams * @property {string} userId User ID. @@ -653,7 +640,6 @@ const usersDelete = async ({userId,parseOutput = true, overrideForCli = false, s return response; } - /** * @typedef {Object} UsersUpdateEmailRequestParams * @property {string} userId User ID. @@ -688,7 +674,6 @@ const usersUpdateEmail = async ({userId,email,parseOutput = true, overrideForCli return response; } - /** * @typedef {Object} UsersCreateJWTRequestParams * @property {string} userId User ID. @@ -727,7 +712,6 @@ const usersCreateJWT = async ({userId,sessionId,duration,parseOutput = true, ove return response; } - /** * @typedef {Object} UsersUpdateLabelsRequestParams * @property {string} userId User ID. @@ -763,7 +747,6 @@ const usersUpdateLabels = async ({userId,labels,parseOutput = true, overrideForC return response; } - /** * @typedef {Object} UsersListLogsRequestParams * @property {string} userId User ID. @@ -797,7 +780,6 @@ const usersListLogs = async ({userId,queries,parseOutput = true, overrideForCli return response; } - /** * @typedef {Object} UsersListMembershipsRequestParams * @property {string} userId User ID. @@ -835,9 +817,8 @@ const usersListMemberships = async ({userId,queries,search,parseOutput = true, o return response; } - /** - * @typedef {Object} UsersUpdateMfaRequestParams + * @typedef {Object} UsersUpdateMFARequestParams * @property {string} userId User ID. * @property {boolean} mfa Enable or disable MFA. * @property {boolean} overrideForCli @@ -846,9 +827,9 @@ const usersListMemberships = async ({userId,queries,search,parseOutput = true, o */ /** - * @param {UsersUpdateMfaRequestParams} params + * @param {UsersUpdateMFARequestParams} params */ -const usersUpdateMfa = async ({userId,mfa,parseOutput = true, overrideForCli = false, sdk = undefined}) => { +const usersUpdateMFA = async ({userId,mfa,parseOutput = true, overrideForCli = false, sdk = undefined}) => { let client = !sdk ? await sdkForProject() : sdk; let apiPath = '/users/{userId}/mfa'.replace('{userId}', userId); @@ -870,9 +851,8 @@ const usersUpdateMfa = async ({userId,mfa,parseOutput = true, overrideForCli = f return response; } - /** - * @typedef {Object} UsersDeleteMfaAuthenticatorRequestParams + * @typedef {Object} UsersDeleteMFAAuthenticatorRequestParams * @property {string} userId User ID. * @property {AuthenticatorType} type Type of authenticator. * @property {boolean} overrideForCli @@ -881,9 +861,9 @@ const usersUpdateMfa = async ({userId,mfa,parseOutput = true, overrideForCli = f */ /** - * @param {UsersDeleteMfaAuthenticatorRequestParams} params + * @param {UsersDeleteMFAAuthenticatorRequestParams} params */ -const usersDeleteMfaAuthenticator = async ({userId,type,parseOutput = true, overrideForCli = false, sdk = undefined}) => { +const usersDeleteMFAAuthenticator = async ({userId,type,parseOutput = true, overrideForCli = false, sdk = undefined}) => { let client = !sdk ? await sdkForProject() : sdk; let apiPath = '/users/{userId}/mfa/authenticators/{type}'.replace('{userId}', userId).replace('{type}', type); @@ -902,9 +882,8 @@ const usersDeleteMfaAuthenticator = async ({userId,type,parseOutput = true, over return response; } - /** - * @typedef {Object} UsersListMfaFactorsRequestParams + * @typedef {Object} UsersListMFAFactorsRequestParams * @property {string} userId User ID. * @property {boolean} overrideForCli * @property {boolean} parseOutput @@ -912,9 +891,9 @@ const usersDeleteMfaAuthenticator = async ({userId,type,parseOutput = true, over */ /** - * @param {UsersListMfaFactorsRequestParams} params + * @param {UsersListMFAFactorsRequestParams} params */ -const usersListMfaFactors = async ({userId,parseOutput = true, overrideForCli = false, sdk = undefined}) => { +const usersListMFAFactors = async ({userId,parseOutput = true, overrideForCli = false, sdk = undefined}) => { let client = !sdk ? await sdkForProject() : sdk; let apiPath = '/users/{userId}/mfa/factors'.replace('{userId}', userId); @@ -932,9 +911,8 @@ const usersListMfaFactors = async ({userId,parseOutput = true, overrideForCli = return response; } - /** - * @typedef {Object} UsersGetMfaRecoveryCodesRequestParams + * @typedef {Object} UsersGetMFARecoveryCodesRequestParams * @property {string} userId User ID. * @property {boolean} overrideForCli * @property {boolean} parseOutput @@ -942,9 +920,9 @@ const usersListMfaFactors = async ({userId,parseOutput = true, overrideForCli = */ /** - * @param {UsersGetMfaRecoveryCodesRequestParams} params + * @param {UsersGetMFARecoveryCodesRequestParams} params */ -const usersGetMfaRecoveryCodes = async ({userId,parseOutput = true, overrideForCli = false, sdk = undefined}) => { +const usersGetMFARecoveryCodes = async ({userId,parseOutput = true, overrideForCli = false, sdk = undefined}) => { let client = !sdk ? await sdkForProject() : sdk; let apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId); @@ -962,9 +940,8 @@ const usersGetMfaRecoveryCodes = async ({userId,parseOutput = true, overrideForC return response; } - /** - * @typedef {Object} UsersUpdateMfaRecoveryCodesRequestParams + * @typedef {Object} UsersUpdateMFARecoveryCodesRequestParams * @property {string} userId User ID. * @property {boolean} overrideForCli * @property {boolean} parseOutput @@ -972,9 +949,9 @@ const usersGetMfaRecoveryCodes = async ({userId,parseOutput = true, overrideForC */ /** - * @param {UsersUpdateMfaRecoveryCodesRequestParams} params + * @param {UsersUpdateMFARecoveryCodesRequestParams} params */ -const usersUpdateMfaRecoveryCodes = async ({userId,parseOutput = true, overrideForCli = false, sdk = undefined}) => { +const usersUpdateMFARecoveryCodes = async ({userId,parseOutput = true, overrideForCli = false, sdk = undefined}) => { let client = !sdk ? await sdkForProject() : sdk; let apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId); @@ -993,9 +970,8 @@ const usersUpdateMfaRecoveryCodes = async ({userId,parseOutput = true, overrideF return response; } - /** - * @typedef {Object} UsersCreateMfaRecoveryCodesRequestParams + * @typedef {Object} UsersCreateMFARecoveryCodesRequestParams * @property {string} userId User ID. * @property {boolean} overrideForCli * @property {boolean} parseOutput @@ -1003,9 +979,9 @@ const usersUpdateMfaRecoveryCodes = async ({userId,parseOutput = true, overrideF */ /** - * @param {UsersCreateMfaRecoveryCodesRequestParams} params + * @param {UsersCreateMFARecoveryCodesRequestParams} params */ -const usersCreateMfaRecoveryCodes = async ({userId,parseOutput = true, overrideForCli = false, sdk = undefined}) => { +const usersCreateMFARecoveryCodes = async ({userId,parseOutput = true, overrideForCli = false, sdk = undefined}) => { let client = !sdk ? await sdkForProject() : sdk; let apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId); @@ -1024,7 +1000,6 @@ const usersCreateMfaRecoveryCodes = async ({userId,parseOutput = true, overrideF return response; } - /** * @typedef {Object} UsersUpdateNameRequestParams * @property {string} userId User ID. @@ -1059,7 +1034,6 @@ const usersUpdateName = async ({userId,name,parseOutput = true, overrideForCli = return response; } - /** * @typedef {Object} UsersUpdatePasswordRequestParams * @property {string} userId User ID. @@ -1094,7 +1068,6 @@ const usersUpdatePassword = async ({userId,password,parseOutput = true, override return response; } - /** * @typedef {Object} UsersUpdatePhoneRequestParams * @property {string} userId User ID. @@ -1129,7 +1102,6 @@ const usersUpdatePhone = async ({userId,number,parseOutput = true, overrideForCl return response; } - /** * @typedef {Object} UsersGetPrefsRequestParams * @property {string} userId User ID. @@ -1159,7 +1131,6 @@ const usersGetPrefs = async ({userId,parseOutput = true, overrideForCli = false, return response; } - /** * @typedef {Object} UsersUpdatePrefsRequestParams * @property {string} userId User ID. @@ -1194,7 +1165,6 @@ const usersUpdatePrefs = async ({userId,prefs,parseOutput = true, overrideForCli return response; } - /** * @typedef {Object} UsersListSessionsRequestParams * @property {string} userId User ID. @@ -1228,7 +1198,6 @@ const usersListSessions = async ({userId,parseOutput = true, overrideForCli = fa return response; } - /** * @typedef {Object} UsersCreateSessionRequestParams * @property {string} 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. @@ -1259,7 +1228,6 @@ const usersCreateSession = async ({userId,parseOutput = true, overrideForCli = f return response; } - /** * @typedef {Object} UsersDeleteSessionsRequestParams * @property {string} userId User ID. @@ -1290,7 +1258,6 @@ const usersDeleteSessions = async ({userId,parseOutput = true, overrideForCli = return response; } - /** * @typedef {Object} UsersDeleteSessionRequestParams * @property {string} userId User ID. @@ -1322,7 +1289,6 @@ const usersDeleteSession = async ({userId,sessionId,parseOutput = true, override return response; } - /** * @typedef {Object} UsersUpdateStatusRequestParams * @property {string} userId User ID. @@ -1357,7 +1323,6 @@ const usersUpdateStatus = async ({userId,status,parseOutput = true, overrideForC return response; } - /** * @typedef {Object} UsersListTargetsRequestParams * @property {string} userId User ID. @@ -1391,7 +1356,6 @@ const usersListTargets = async ({userId,queries,parseOutput = true, overrideForC return response; } - /** * @typedef {Object} UsersCreateTargetRequestParams * @property {string} userId User ID. @@ -1442,7 +1406,6 @@ const usersCreateTarget = async ({userId,targetId,providerType,identifier,provid return response; } - /** * @typedef {Object} UsersGetTargetRequestParams * @property {string} userId User ID. @@ -1473,7 +1436,6 @@ const usersGetTarget = async ({userId,targetId,parseOutput = true, overrideForCl return response; } - /** * @typedef {Object} UsersUpdateTargetRequestParams * @property {string} userId User ID. @@ -1517,7 +1479,6 @@ const usersUpdateTarget = async ({userId,targetId,identifier,providerId,name,par return response; } - /** * @typedef {Object} UsersDeleteTargetRequestParams * @property {string} userId User ID. @@ -1549,7 +1510,6 @@ const usersDeleteTarget = async ({userId,targetId,parseOutput = true, overrideFo return response; } - /** * @typedef {Object} UsersCreateTokenRequestParams * @property {string} userId User ID. @@ -1588,7 +1548,6 @@ const usersCreateToken = async ({userId,length,expire,parseOutput = true, overri return response; } - /** * @typedef {Object} UsersUpdateEmailVerificationRequestParams * @property {string} userId User ID. @@ -1623,7 +1582,6 @@ const usersUpdateEmailVerification = async ({userId,emailVerification,parseOutpu return response; } - /** * @typedef {Object} UsersUpdatePhoneVerificationRequestParams * @property {string} userId User ID. @@ -1658,7 +1616,6 @@ const usersUpdatePhoneVerification = async ({userId,phoneVerification,parseOutpu return response; } - users .command(`list`) .description(`Get a list of all the project's users. You can use the query params to filter your results.`) @@ -1823,38 +1780,38 @@ users .description(`Enable or disable MFA on a user account.`) .requiredOption(`--user-id `, `User ID.`) .requiredOption(`--mfa [value]`, `Enable or disable MFA.`, (value) => value === undefined ? true : parseBool(value)) - .action(actionRunner(usersUpdateMfa)) + .action(actionRunner(usersUpdateMFA)) users .command(`delete-mfa-authenticator`) .description(`Delete an authenticator app.`) .requiredOption(`--user-id `, `User ID.`) .requiredOption(`--type `, `Type of authenticator.`) - .action(actionRunner(usersDeleteMfaAuthenticator)) + .action(actionRunner(usersDeleteMFAAuthenticator)) users .command(`list-mfa-factors`) .description(`List the factors available on the account to be used as a MFA challange.`) .requiredOption(`--user-id `, `User ID.`) - .action(actionRunner(usersListMfaFactors)) + .action(actionRunner(usersListMFAFactors)) users .command(`get-mfa-recovery-codes`) .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.`) .requiredOption(`--user-id `, `User ID.`) - .action(actionRunner(usersGetMfaRecoveryCodes)) + .action(actionRunner(usersGetMFARecoveryCodes)) users .command(`update-mfa-recovery-codes`) .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.`) .requiredOption(`--user-id `, `User ID.`) - .action(actionRunner(usersUpdateMfaRecoveryCodes)) + .action(actionRunner(usersUpdateMFARecoveryCodes)) users .command(`create-mfa-recovery-codes`) .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.`) .requiredOption(`--user-id `, `User ID.`) - .action(actionRunner(usersCreateMfaRecoveryCodes)) + .action(actionRunner(usersCreateMFARecoveryCodes)) users .command(`update-name`) @@ -2008,12 +1965,12 @@ module.exports = { usersUpdateLabels, usersListLogs, usersListMemberships, - usersUpdateMfa, - usersDeleteMfaAuthenticator, - usersListMfaFactors, - usersGetMfaRecoveryCodes, - usersUpdateMfaRecoveryCodes, - usersCreateMfaRecoveryCodes, + usersUpdateMFA, + usersDeleteMFAAuthenticator, + usersListMFAFactors, + usersGetMFARecoveryCodes, + usersUpdateMFARecoveryCodes, + usersCreateMFARecoveryCodes, usersUpdateName, usersUpdatePassword, usersUpdatePhone, diff --git a/lib/commands/vcs.js b/lib/commands/vcs.js index 0fe6698..b3aea2c 100644 --- a/lib/commands/vcs.js +++ b/lib/commands/vcs.js @@ -7,7 +7,7 @@ const libClient = require('../client.js'); const { getAllFiles, showConsoleLink } = require('../utils.js'); const { Command } = require('commander'); const { sdkForProject, sdkForConsole } = require('../sdks') -const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log } = require('../parser') +const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log, warn } = require('../parser') const { localConfig, globalConfig } = require("../config"); const { File } = require('undici'); const { ReadableStream } = require('stream/web'); @@ -81,7 +81,6 @@ const vcsCreateRepositoryDetection = async ({installationId,providerRepositoryId return response; } - /** * @typedef {Object} VcsListRepositoriesRequestParams * @property {string} installationId Installation Id @@ -119,7 +118,6 @@ const vcsListRepositories = async ({installationId,type,search,parseOutput = tru return response; } - /** * @typedef {Object} VcsCreateRepositoryRequestParams * @property {string} installationId Installation Id @@ -158,7 +156,6 @@ const vcsCreateRepository = async ({installationId,name,xprivate,parseOutput = t return response; } - /** * @typedef {Object} VcsGetRepositoryRequestParams * @property {string} installationId Installation Id @@ -189,7 +186,6 @@ const vcsGetRepository = async ({installationId,providerRepositoryId,parseOutput return response; } - /** * @typedef {Object} VcsListRepositoryBranchesRequestParams * @property {string} installationId Installation Id @@ -220,7 +216,6 @@ const vcsListRepositoryBranches = async ({installationId,providerRepositoryId,pa return response; } - /** * @typedef {Object} VcsGetRepositoryContentsRequestParams * @property {string} installationId Installation Id @@ -259,7 +254,6 @@ const vcsGetRepositoryContents = async ({installationId,providerRepositoryId,pro return response; } - /** * @typedef {Object} VcsUpdateExternalDeploymentsRequestParams * @property {string} installationId Installation Id @@ -295,7 +289,6 @@ const vcsUpdateExternalDeployments = async ({installationId,repositoryId,provide return response; } - /** * @typedef {Object} VcsListInstallationsRequestParams * @property {string[]} 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 @@ -332,7 +325,6 @@ const vcsListInstallations = async ({queries,search,parseOutput = true, override return response; } - /** * @typedef {Object} VcsGetInstallationRequestParams * @property {string} installationId Installation Id @@ -362,7 +354,6 @@ const vcsGetInstallation = async ({installationId,parseOutput = true, overrideFo return response; } - /** * @typedef {Object} VcsDeleteInstallationRequestParams * @property {string} installationId Installation Id @@ -393,7 +384,6 @@ const vcsDeleteInstallation = async ({installationId,parseOutput = true, overrid return response; } - vcs .command(`create-repository-detection`) .description(`Analyze a GitHub repository to automatically detect the programming language and runtime environment. This endpoint scans the repository's files and language statistics to determine the appropriate runtime settings for your function. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.`) diff --git a/lib/config.js b/lib/config.js index 44cdf31..a67976a 100644 --- a/lib/config.js +++ b/lib/config.js @@ -9,6 +9,7 @@ const KeysSite = new Set(["path", "$id", "name", "enabled", "logging", "timeout" const KeysFunction = new Set(["path", "$id", "execute", "name", "enabled", "logging", "runtime", "specification", "scopes", "events", "schedule", "timeout", "entrypoint", "commands", "vars"]); const KeysDatabase = new Set(["$id", "name", "enabled"]); const KeysCollection = new Set(["$id", "$permissions", "databaseId", "name", "enabled", "documentSecurity", "attributes", "indexes"]); +const KeysTable = new Set(["$id", "$permissions", "databaseId", "name", "enabled", "documentSecurity", "columns", "indexes"]); const KeysStorage = new Set(["$id", "$permissions", "fileSecurity", "name", "enabled", "maximumFileSize", "allowedFileExtensions", "compression", "encryption", "antivirus"]); const KeysTopics = new Set(["$id", "name", "subscribe"]); const KeysTeams = new Set(["$id", "name"]); @@ -39,6 +40,33 @@ const KeysAttributes = new Set([ // Strings "encrypt", ]); +const KeysColumns = new Set([ + "key", + "type", + "required", + "array", + "size", + "default", + // integer and float + "min", + "max", + // email, enum, URL, IP, and datetime + "format", + // enum + "elements", + // relationship + "relatedCollection", + "relationType", + "twoWay", + "twoWayKey", + "onDelete", + "side", + // Indexes + "attributes", + "orders", + // Strings + "encrypt", +]); const KeyIndexes = new Set(["key", "type", "status", "attributes", "orders"]); function whitelistKeys(value, keys, nestedKeys = {}) { @@ -310,6 +338,50 @@ class Local extends Config { this.set("collections", collections); } + getTables() { + if (!this.has("tables")) { + return []; + } + return this.get("tables"); + } + + getTable($id) { + if (!this.has("tables")) { + return {}; + } + + let tables = this.get("tables"); + for (let i = 0; i < tables.length; i++) { + if (tables[i]['$id'] == $id) { + return tables[i]; + } + } + + return {}; + } + + addTable(props) { + props = whitelistKeys(props, KeysTable, { + columns: KeysColumns, + indexes: KeyIndexes + }); + + if (!this.has("tables")) { + this.set("tables", []); + } + + let tables = this.get("tables"); + for (let i = 0; i < tables.length; i++) { + if (tables[i]['$id'] == props['$id'] && tables[i]['databaseId'] == props['databaseId']) { + tables[i] = props; + this.set("tables", tables); + return; + } + } + tables.push(props); + this.set("tables", tables); + } + getBuckets() { if (!this.has("buckets")) { return []; @@ -713,5 +785,6 @@ module.exports = { KeysStorage, KeysTeams, KeysCollection, + KeysTable, whitelistKeys }; diff --git a/lib/parser.js b/lib/parser.js index 35bc491..2b7b8af 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -122,7 +122,7 @@ const parseError = (err) => { } catch { } - const version = '8.3.0'; + const version = '9.0.0'; const stepsToReproduce = `Running \`appwrite ${cliConfig.reportData.data.args.join(' ')}\``; const yourEnvironment = `CLI version: ${version}\nOperation System: ${os.type()}\nAppwrite version: ${appwriteVersion}\nIs Cloud: ${isCloud()}`; @@ -216,6 +216,7 @@ const commandDescriptions = { "sites": `The sites command allows you to view, create and manage your Appwrite Sites.`, "storage": `The storage command allows you to manage your project files.`, "teams": `The teams command allows you to group users of your project to enable them to share read and write access to your project resources.`, + "update": `The update command allows you to update the Appwrite CLI to the latest version.`, "users": `The users command allows you to manage your project users.`, "client": `The client command allows you to configure your CLI`, "login": `The login command allows you to authenticate and manage a user account.`, diff --git a/lib/questions.js b/lib/questions.js index 3075c60..5462e3f 100644 --- a/lib/questions.js +++ b/lib/questions.js @@ -255,10 +255,11 @@ const questionsPullResources = [ choices: [ { name: `Settings ${chalk.blackBright(`(Project)`)}`, value: 'settings' }, { name: `Functions ${chalk.blackBright(`(Deployment)`)}`, value: 'functions' }, - { name: `Collections ${chalk.blackBright(`(Databases)`)}`, value: 'collections' }, + { name: `Tables ${chalk.blackBright(`(Grids)`)}`, value: 'tables' }, { name: `Buckets ${chalk.blackBright(`(Storage)`)}`, value: 'buckets' }, { name: `Teams ${chalk.blackBright(`(Auth)`)}`, value: 'teams' }, - { name: `Topics ${chalk.blackBright(`(Messaging)`)}`, value: 'messages' } + { name: `Topics ${chalk.blackBright(`(Messaging)`)}`, value: 'messages' }, + { name: `Collections ${chalk.blackBright(`(Database)`)}`, value: 'collections' } ] } ] @@ -666,10 +667,11 @@ const questionsPushResources = [ choices: [ { name: `Settings ${chalk.blackBright(`(Project)`)}`, value: 'settings' }, { name: `Functions ${chalk.blackBright(`(Deployment)`)}`, value: 'functions' }, - { name: `Collections ${chalk.blackBright(`(Databases)`)}`, value: 'collections' }, + { name: `Tables ${chalk.blackBright(`(Grids)`)}`, value: 'tables' }, { name: `Buckets ${chalk.blackBright(`(Storage)`)}`, value: 'buckets' }, { name: `Teams ${chalk.blackBright(`(Auth)`)}`, value: 'teams' }, - { name: `Topics ${chalk.blackBright(`(Messaging)`)}`, value: 'messages' } + { name: `Topics ${chalk.blackBright(`(Messaging)`)}`, value: 'messages' }, + { name: `Collections ${chalk.blackBright(`(Database)`)}`, value: 'collections' } ] } ]; @@ -682,10 +684,11 @@ const questionsInitResources = [ choices: [ { name: 'Function', value: 'function' }, { name: 'Site', value: 'site' }, - { name: 'Collection', value: 'collection' }, + { name: 'Table', value: 'table' }, { name: 'Bucket', value: 'bucket' }, { name: 'Team', value: 'team' }, - { name: 'Topic', value: 'message' } + { name: 'Topic', value: 'message' }, + { name: 'Collection', value: 'collection' } ] } ]; @@ -753,6 +756,27 @@ const questionsPushCollections = [ } ]; +const questionsPushTables = [ + { + type: "checkbox", + name: "tables", + message: "Which tables would you like to push?", + validate: (value) => validateRequired('table', value), + when: () => localConfig.getTables().length > 0, + choices: () => { + let tables = localConfig.getTables(); + checkDeployConditions(localConfig) + + return tables.map(table => { + return { + name: `${table.name} (${table['databaseId']} - ${table['$id']})`, + value: `${table['databaseId']}|${table['$id']}` + } + }); + } + } +]; + const questionPushChanges = [ { type: "input", @@ -1002,5 +1026,6 @@ module.exports = { questionsCreateTeam, questionPushChanges, questionPushChangesConfirmation, - questionsCreateSite + questionsCreateSite, + questionsPushTables }; diff --git a/lib/utils.js b/lib/utils.js index 5655b21..ee9f22f 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -3,8 +3,43 @@ const path = require("path"); const net = require("net"); const childProcess = require('child_process'); const chalk = require('chalk'); +const { fetch } = require("undici"); const { localConfig, globalConfig } = require("./config"); +/** + * Get the latest version from npm registry + */ +async function getLatestVersion() { + try { + const response = await fetch('https://registry.npmjs.org/appwrite-cli/latest'); + if (!response.ok) { + throw new Error(`HTTP ${response.status}`); + } + const data = await response.json(); + return data.version; + } catch (e) { + throw new Error(`Failed to fetch latest version: ${e.message}`); + } +} + +/** + * Compare versions using semantic versioning + */ +function compareVersions(current, latest) { + const currentParts = current.split('.').map(Number); + const latestParts = latest.split('.').map(Number); + + for (let i = 0; i < Math.max(currentParts.length, latestParts.length); i++) { + const currentPart = currentParts[i] || 0; + const latestPart = latestParts[i] || 0; + + if (latestPart > currentPart) return 1; // Latest is newer + if (latestPart < currentPart) return -1; // Current is newer + } + + return 0; // Same version +} + function getAllFiles(folder) { const files = []; for (const pathDir of fs.readdirSync(folder)) { @@ -60,7 +95,7 @@ function systemHasCommand(command) { const checkDeployConditions = (localConfig) => { if (Object.keys(localConfig.data).length === 0) { - throw new Error("No appwrite.json file found in the current directory. Please run this command again in the folder containing your appwrite.json file, or run 'appwrite init project' to link current directory to an Appwrite project."); + throw new Error("No appwrite.config.json file found in the current directory. Please run this command again in the folder containing your appwrite.config.json file, or run 'appwrite init project' to link current directory to an Appwrite project."); } } @@ -285,5 +320,7 @@ module.exports = { systemHasCommand, checkDeployConditions, showConsoleLink, - isCloud + isCloud, + getLatestVersion, + compareVersions }; diff --git a/package.json b/package.json index 5b4dc35..470c285 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "appwrite-cli", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API", - "version": "8.3.0", + "version": "9.0.0", "license": "BSD-3-Clause", "main": "index.js", "bin": { diff --git a/scoop/appwrite.json b/scoop/appwrite.config.json similarity index 88% rename from scoop/appwrite.json rename to scoop/appwrite.config.json index 533c04a..a302dac 100644 --- a/scoop/appwrite.json +++ b/scoop/appwrite.config.json @@ -1,12 +1,12 @@ { "$schema": "https://raw.githubusercontent.com/ScoopInstaller/Scoop/master/schema.json", - "version": "8.3.0", + "version": "9.0.0", "description": "The Appwrite CLI is a command-line application that allows you to interact with Appwrite and perform server-side tasks using your terminal.", "homepage": "https://github.com/appwrite/sdk-for-cli", "license": "BSD-3-Clause", "architecture": { "64bit": { - "url": "https://github.com/appwrite/sdk-for-cli/releases/download/8.3.0/appwrite-cli-win-x64.exe", + "url": "https://github.com/appwrite/sdk-for-cli/releases/download/9.0.0/appwrite-cli-win-x64.exe", "bin": [ [ "appwrite-cli-win-x64.exe", @@ -15,7 +15,7 @@ ] }, "arm64": { - "url": "https://github.com/appwrite/sdk-for-cli/releases/download/8.3.0/appwrite-cli-win-arm64.exe", + "url": "https://github.com/appwrite/sdk-for-cli/releases/download/9.0.0/appwrite-cli-win-arm64.exe", "bin": [ [ "appwrite-cli-win-arm64.exe",