appwrite-cli 4.2.2 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/npm-publish.yml +1 -1
- package/README.md +6 -9
- package/docs/examples/account/{create-email-session.md → create-email-password-session.md} +1 -1
- package/docs/examples/account/create-email-token.md +4 -0
- package/docs/examples/account/create-magic-u-r-l-token.md +5 -0
- package/docs/examples/account/create-mfa-authenticator.md +2 -0
- package/docs/examples/account/create-mfa-challenge.md +2 -0
- package/docs/examples/account/create-mfa-recovery-codes.md +1 -0
- package/docs/examples/account/create-o-auth2token.md +5 -0
- package/docs/examples/account/create-phone-token.md +3 -0
- package/docs/examples/account/create-push-target.md +4 -0
- package/docs/examples/account/create-session.md +3 -0
- package/docs/examples/account/create.md +1 -1
- package/docs/examples/account/delete-identity.md +1 -1
- package/docs/examples/account/delete-mfa-authenticator.md +3 -0
- package/docs/examples/account/delete-push-target.md +2 -0
- package/docs/examples/account/delete-session.md +1 -1
- package/docs/examples/account/delete.md +1 -0
- package/docs/examples/account/get-mfa-recovery-codes.md +1 -0
- package/docs/examples/account/get-session.md +1 -1
- package/docs/examples/account/list-mfa-factors.md +1 -0
- package/docs/examples/account/update-m-f-a.md +2 -0
- package/docs/examples/account/update-magic-u-r-l-session.md +2 -2
- package/docs/examples/account/update-mfa-authenticator.md +3 -0
- package/docs/examples/account/update-mfa-challenge.md +3 -0
- package/docs/examples/account/update-mfa-recovery-codes.md +1 -0
- package/docs/examples/account/update-name.md +1 -1
- package/docs/examples/account/update-phone-session.md +2 -2
- package/docs/examples/account/update-phone-verification.md +2 -2
- package/docs/examples/account/update-push-target.md +3 -0
- package/docs/examples/account/update-recovery.md +3 -4
- package/docs/examples/account/update-session.md +1 -1
- package/docs/examples/account/update-verification.md +2 -2
- package/docs/examples/assistant/chat.md +1 -1
- package/docs/examples/avatars/get-q-r.md +1 -1
- package/docs/examples/databases/create-boolean-attribute.md +2 -2
- package/docs/examples/databases/create-collection.md +3 -3
- package/docs/examples/databases/create-datetime-attribute.md +2 -2
- package/docs/examples/databases/create-document.md +3 -3
- package/docs/examples/databases/create-email-attribute.md +2 -2
- package/docs/examples/databases/create-enum-attribute.md +2 -2
- package/docs/examples/databases/create-float-attribute.md +2 -2
- package/docs/examples/databases/create-index.md +2 -2
- package/docs/examples/databases/create-integer-attribute.md +2 -2
- package/docs/examples/databases/create-ip-attribute.md +2 -2
- package/docs/examples/databases/create-relationship-attribute.md +3 -3
- package/docs/examples/databases/create-string-attribute.md +2 -2
- package/docs/examples/databases/create-url-attribute.md +2 -2
- package/docs/examples/databases/create.md +2 -2
- package/docs/examples/databases/delete-attribute.md +2 -2
- package/docs/examples/databases/delete-collection.md +2 -2
- package/docs/examples/databases/delete-document.md +3 -3
- package/docs/examples/databases/delete-index.md +2 -2
- package/docs/examples/databases/delete.md +1 -1
- package/docs/examples/databases/get-attribute.md +2 -2
- package/docs/examples/databases/get-collection-usage.md +2 -2
- package/docs/examples/databases/get-collection.md +2 -2
- package/docs/examples/databases/get-database-usage.md +1 -1
- package/docs/examples/databases/get-document.md +3 -3
- package/docs/examples/databases/get-index.md +2 -2
- package/docs/examples/databases/get.md +1 -1
- package/docs/examples/databases/list-attributes.md +2 -2
- package/docs/examples/databases/list-collection-logs.md +2 -2
- package/docs/examples/databases/list-collections.md +1 -1
- package/docs/examples/databases/list-document-logs.md +3 -3
- package/docs/examples/databases/list-documents.md +2 -2
- package/docs/examples/databases/list-indexes.md +2 -2
- package/docs/examples/databases/list-logs.md +1 -1
- package/docs/examples/databases/update-boolean-attribute.md +2 -2
- package/docs/examples/databases/update-collection.md +3 -3
- package/docs/examples/databases/update-datetime-attribute.md +2 -2
- package/docs/examples/databases/update-document.md +3 -3
- package/docs/examples/databases/update-email-attribute.md +2 -2
- package/docs/examples/databases/update-enum-attribute.md +3 -3
- package/docs/examples/databases/update-float-attribute.md +2 -2
- package/docs/examples/databases/update-integer-attribute.md +2 -2
- package/docs/examples/databases/update-ip-attribute.md +2 -2
- package/docs/examples/databases/update-relationship-attribute.md +2 -2
- package/docs/examples/databases/update-string-attribute.md +3 -3
- package/docs/examples/databases/update-url-attribute.md +2 -2
- package/docs/examples/databases/update.md +2 -2
- package/docs/examples/functions/create-build.md +3 -3
- package/docs/examples/functions/create-deployment.md +1 -1
- package/docs/examples/functions/create-execution.md +1 -1
- package/docs/examples/functions/create-variable.md +3 -3
- package/docs/examples/functions/create.md +3 -3
- package/docs/examples/functions/delete-deployment.md +2 -2
- package/docs/examples/functions/delete-variable.md +2 -2
- package/docs/examples/functions/delete.md +1 -1
- package/docs/examples/functions/download-deployment.md +2 -2
- package/docs/examples/functions/get-deployment.md +2 -2
- package/docs/examples/functions/get-execution.md +2 -2
- package/docs/examples/functions/get-function-usage.md +1 -1
- package/docs/examples/functions/get-variable.md +2 -2
- package/docs/examples/functions/get.md +1 -1
- package/docs/examples/functions/list-deployments.md +1 -1
- package/docs/examples/functions/list-executions.md +1 -1
- package/docs/examples/functions/list-variables.md +1 -1
- package/docs/examples/functions/update-deployment.md +2 -2
- package/docs/examples/functions/update-variable.md +3 -3
- package/docs/examples/functions/update.md +2 -2
- package/docs/examples/health/get-certificate.md +2 -0
- package/docs/examples/health/get-failed-jobs.md +3 -0
- package/docs/examples/health/get-queue-usage-dump.md +2 -0
- package/docs/examples/health/get-queue-usage.md +2 -0
- package/docs/examples/health/get-storage.md +1 -0
- package/docs/examples/messaging/create-apns-provider.md +9 -0
- package/docs/examples/messaging/create-email.md +13 -0
- package/docs/examples/messaging/create-fcm-provider.md +5 -0
- package/docs/examples/messaging/create-mailgun-provider.md +11 -0
- package/docs/examples/messaging/create-msg91provider.md +7 -0
- package/docs/examples/messaging/create-push.md +17 -0
- package/docs/examples/messaging/create-sendgrid-provider.md +9 -0
- package/docs/examples/messaging/create-sms.md +8 -0
- package/docs/examples/messaging/create-smtp-provider.md +15 -0
- package/docs/examples/messaging/create-subscriber.md +4 -0
- package/docs/examples/messaging/create-telesign-provider.md +7 -0
- package/docs/examples/messaging/create-textmagic-provider.md +7 -0
- package/docs/examples/messaging/create-topic.md +4 -0
- package/docs/examples/messaging/create-twilio-provider.md +7 -0
- package/docs/examples/messaging/create-vonage-provider.md +7 -0
- package/docs/examples/messaging/delete-provider.md +2 -0
- package/docs/examples/messaging/delete-subscriber.md +3 -0
- package/docs/examples/messaging/delete-topic.md +2 -0
- package/docs/examples/messaging/delete.md +2 -0
- package/docs/examples/messaging/get-message.md +2 -0
- package/docs/examples/messaging/get-provider.md +2 -0
- package/docs/examples/messaging/get-subscriber.md +3 -0
- package/docs/examples/messaging/get-topic.md +2 -0
- package/docs/examples/messaging/list-message-logs.md +3 -0
- package/docs/examples/messaging/list-messages.md +3 -0
- package/docs/examples/messaging/list-provider-logs.md +3 -0
- package/docs/examples/messaging/list-providers.md +3 -0
- package/docs/examples/messaging/list-subscriber-logs.md +3 -0
- package/docs/examples/messaging/list-subscribers.md +4 -0
- package/docs/examples/messaging/list-targets.md +3 -0
- package/docs/examples/messaging/list-topic-logs.md +3 -0
- package/docs/examples/messaging/list-topics.md +3 -0
- package/docs/examples/messaging/update-apns-provider.md +9 -0
- package/docs/examples/messaging/update-email.md +12 -0
- package/docs/examples/messaging/update-fcm-provider.md +5 -0
- package/docs/examples/messaging/update-mailgun-provider.md +11 -0
- package/docs/examples/messaging/update-msg91provider.md +7 -0
- package/docs/examples/messaging/update-push.md +17 -0
- package/docs/examples/messaging/update-sendgrid-provider.md +9 -0
- package/docs/examples/messaging/update-sms.md +8 -0
- package/docs/examples/messaging/update-smtp-provider.md +15 -0
- package/docs/examples/messaging/update-telesign-provider.md +7 -0
- package/docs/examples/messaging/update-textmagic-provider.md +7 -0
- package/docs/examples/messaging/update-topic.md +4 -0
- package/docs/examples/messaging/update-twilio-provider.md +7 -0
- package/docs/examples/messaging/update-vonage-provider.md +7 -0
- package/docs/examples/migrations/create-appwrite-migration.md +2 -2
- package/docs/examples/migrations/create-firebase-migration.md +1 -1
- package/docs/examples/migrations/create-firebase-o-auth-migration.md +1 -1
- package/docs/examples/migrations/create-n-host-migration.md +6 -6
- package/docs/examples/migrations/create-supabase-migration.md +4 -4
- package/docs/examples/migrations/delete.md +1 -1
- package/docs/examples/migrations/get-appwrite-report.md +2 -2
- package/docs/examples/migrations/get-firebase-report-o-auth.md +1 -1
- package/docs/examples/migrations/get-firebase-report.md +1 -1
- package/docs/examples/migrations/get-n-host-report.md +6 -6
- package/docs/examples/migrations/get-supabase-report.md +4 -4
- package/docs/examples/migrations/get.md +1 -1
- package/docs/examples/migrations/retry.md +1 -1
- package/docs/examples/project/create-variable.md +2 -2
- package/docs/examples/project/delete-variable.md +1 -1
- package/docs/examples/project/get-usage.md +2 -0
- package/docs/examples/project/get-variable.md +1 -1
- package/docs/examples/project/update-variable.md +2 -2
- package/docs/examples/projects/create-key.md +2 -2
- package/docs/examples/projects/create-platform.md +2 -2
- package/docs/examples/projects/create-smtp-test.md +11 -0
- package/docs/examples/projects/create-webhook.md +4 -3
- package/docs/examples/projects/create.md +2 -2
- package/docs/examples/projects/delete-email-template.md +1 -1
- package/docs/examples/projects/delete-key.md +2 -2
- package/docs/examples/projects/delete-platform.md +2 -2
- package/docs/examples/projects/delete-sms-template.md +1 -1
- package/docs/examples/projects/delete-webhook.md +2 -2
- package/docs/examples/projects/delete.md +1 -1
- package/docs/examples/projects/get-email-template.md +1 -1
- package/docs/examples/projects/get-key.md +2 -2
- package/docs/examples/projects/get-platform.md +2 -2
- package/docs/examples/projects/get-sms-template.md +1 -1
- package/docs/examples/projects/get-webhook.md +2 -2
- package/docs/examples/projects/get.md +1 -1
- package/docs/examples/projects/list-keys.md +1 -1
- package/docs/examples/projects/list-platforms.md +1 -1
- package/docs/examples/projects/list-webhooks.md +1 -1
- package/docs/examples/projects/update-api-status-all.md +3 -0
- package/docs/examples/projects/update-api-status.md +4 -0
- package/docs/examples/projects/update-auth-duration.md +1 -1
- package/docs/examples/projects/update-auth-limit.md +1 -1
- package/docs/examples/projects/update-auth-password-dictionary.md +1 -1
- package/docs/examples/projects/update-auth-password-history.md +1 -1
- package/docs/examples/projects/update-auth-sessions-limit.md +1 -1
- package/docs/examples/projects/update-auth-status.md +1 -1
- package/docs/examples/projects/update-email-template.md +3 -3
- package/docs/examples/projects/update-key.md +3 -3
- package/docs/examples/projects/update-o-auth2.md +1 -1
- package/docs/examples/projects/update-personal-data-check.md +1 -1
- package/docs/examples/projects/update-platform.md +3 -3
- package/docs/examples/projects/update-service-status-all.md +1 -1
- package/docs/examples/projects/update-service-status.md +1 -1
- package/docs/examples/projects/update-sms-template.md +2 -2
- package/docs/examples/projects/update-smtp.md +11 -0
- package/docs/examples/projects/update-team.md +2 -2
- package/docs/examples/projects/update-webhook-signature.md +2 -2
- package/docs/examples/projects/update-webhook.md +5 -4
- package/docs/examples/projects/update.md +2 -2
- package/docs/examples/proxy/delete-rule.md +1 -1
- package/docs/examples/proxy/get-rule.md +1 -1
- package/docs/examples/proxy/update-rule-verification.md +1 -1
- package/docs/examples/storage/create-bucket.md +2 -2
- package/docs/examples/storage/create-file.md +2 -2
- package/docs/examples/storage/delete-bucket.md +1 -1
- package/docs/examples/storage/delete-file.md +2 -2
- package/docs/examples/storage/get-bucket-usage.md +1 -1
- package/docs/examples/storage/get-bucket.md +1 -1
- package/docs/examples/storage/get-file-download.md +2 -2
- package/docs/examples/storage/get-file-preview.md +2 -2
- package/docs/examples/storage/get-file-view.md +2 -2
- package/docs/examples/storage/get-file.md +2 -2
- package/docs/examples/storage/list-files.md +1 -1
- package/docs/examples/storage/update-bucket.md +2 -2
- package/docs/examples/storage/update-file.md +2 -2
- package/docs/examples/teams/create-membership.md +1 -1
- package/docs/examples/teams/create.md +2 -2
- package/docs/examples/teams/delete-membership.md +2 -2
- package/docs/examples/teams/delete.md +1 -1
- package/docs/examples/teams/get-membership.md +2 -2
- package/docs/examples/teams/get-prefs.md +1 -1
- package/docs/examples/teams/get.md +1 -1
- package/docs/examples/teams/list-logs.md +1 -1
- package/docs/examples/teams/list-memberships.md +1 -1
- package/docs/examples/teams/update-membership-status.md +4 -4
- package/docs/examples/teams/update-membership.md +2 -2
- package/docs/examples/teams/update-name.md +2 -2
- package/docs/examples/teams/update-prefs.md +1 -1
- package/docs/examples/users/create-argon2user.md +1 -1
- package/docs/examples/users/create-bcrypt-user.md +1 -1
- package/docs/examples/users/create-m-d5user.md +1 -1
- package/docs/examples/users/create-mfa-recovery-codes.md +2 -0
- package/docs/examples/users/create-p-h-pass-user.md +1 -1
- package/docs/examples/users/create-s-h-a-user.md +1 -1
- package/docs/examples/users/create-scrypt-modified-user.md +4 -4
- package/docs/examples/users/create-scrypt-user.md +2 -2
- package/docs/examples/users/create-session.md +2 -0
- package/docs/examples/users/create-target.md +7 -0
- package/docs/examples/users/create-token.md +4 -0
- package/docs/examples/users/create.md +1 -1
- package/docs/examples/users/delete-identity.md +1 -1
- package/docs/examples/users/delete-mfa-authenticator.md +3 -0
- package/docs/examples/users/delete-session.md +2 -2
- package/docs/examples/users/delete-sessions.md +1 -1
- package/docs/examples/users/delete-target.md +3 -0
- package/docs/examples/users/delete.md +1 -1
- package/docs/examples/users/get-mfa-recovery-codes.md +2 -0
- package/docs/examples/users/get-prefs.md +1 -1
- package/docs/examples/users/get-target.md +3 -0
- package/docs/examples/users/get-usage.md +0 -1
- package/docs/examples/users/get.md +1 -1
- package/docs/examples/users/list-logs.md +1 -1
- package/docs/examples/users/list-memberships.md +1 -1
- package/docs/examples/users/list-mfa-factors.md +2 -0
- package/docs/examples/users/list-sessions.md +1 -1
- package/docs/examples/users/list-targets.md +3 -0
- package/docs/examples/users/update-email-verification.md +1 -1
- package/docs/examples/users/update-email.md +1 -1
- package/docs/examples/users/update-labels.md +1 -1
- package/docs/examples/users/update-mfa-recovery-codes.md +2 -0
- package/docs/examples/users/update-mfa.md +3 -0
- package/docs/examples/users/update-name.md +2 -2
- package/docs/examples/users/update-password.md +1 -1
- package/docs/examples/users/update-phone-verification.md +1 -1
- package/docs/examples/users/update-phone.md +1 -1
- package/docs/examples/users/update-prefs.md +1 -1
- package/docs/examples/users/update-status.md +1 -1
- package/docs/examples/users/update-target.md +6 -0
- package/docs/examples/vcs/create-repository-detection.md +2 -2
- package/docs/examples/vcs/create-repository.md +2 -2
- package/docs/examples/vcs/delete-installation.md +1 -1
- package/docs/examples/vcs/get-installation.md +1 -1
- package/docs/examples/vcs/get-repository.md +2 -2
- package/docs/examples/vcs/list-repositories.md +1 -1
- package/docs/examples/vcs/list-repository-branches.md +2 -2
- package/docs/examples/vcs/update-external-deployments.md +3 -3
- package/index.js +2 -0
- package/install.ps1 +5 -5
- package/install.sh +4 -4
- package/lib/client.js +4 -4
- package/lib/commands/account.js +906 -226
- package/lib/commands/avatars.js +3 -3
- package/lib/commands/databases.js +22 -22
- package/lib/commands/deploy.js +45 -6
- package/lib/commands/functions.js +5 -5
- package/lib/commands/generic.js +2 -2
- package/lib/commands/health.js +193 -1
- package/lib/commands/messaging.js +2815 -0
- package/lib/commands/migrations.js +2 -2
- package/lib/commands/project.js +15 -5
- package/lib/commands/projects.js +210 -72
- package/lib/commands/proxy.js +1 -1
- package/lib/commands/storage.js +6 -6
- package/lib/commands/teams.js +2 -2
- package/lib/commands/users.js +545 -14
- package/lib/paginate.js +2 -2
- package/lib/parser.js +2 -1
- package/package.json +1 -1
- package/scoop/appwrite.json +3 -3
- package/docs/examples/account/create-magic-u-r-l-session.md +0 -4
- package/docs/examples/account/create-phone-session.md +0 -3
- package/docs/examples/projects/get-usage.md +0 -3
- package/docs/examples/projects/update-smtp-configuration.md +0 -11
package/lib/commands/avatars.js
CHANGED
|
@@ -41,7 +41,7 @@ const avatars = new Command("avatars").description(commandDescriptions['avatars'
|
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* @typedef {Object} AvatarsGetBrowserRequestParams
|
|
44
|
-
* @property {
|
|
44
|
+
* @property {Browser} code Browser Code.
|
|
45
45
|
* @property {number} width Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
|
46
46
|
* @property {number} height Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
|
47
47
|
* @property {number} quality Image quality. Pass an integer between 0 to 100. Defaults to 100.
|
|
@@ -89,7 +89,7 @@ const avatarsGetBrowser = async ({ code, width, height, quality, parseOutput = t
|
|
|
89
89
|
|
|
90
90
|
/**
|
|
91
91
|
* @typedef {Object} AvatarsGetCreditCardRequestParams
|
|
92
|
-
* @property {
|
|
92
|
+
* @property {CreditCard} code Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro.
|
|
93
93
|
* @property {number} width Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
|
94
94
|
* @property {number} height Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
|
95
95
|
* @property {number} quality Image quality. Pass an integer between 0 to 100. Defaults to 100.
|
|
@@ -176,7 +176,7 @@ const avatarsGetFavicon = async ({ url, parseOutput = true, sdk = undefined, des
|
|
|
176
176
|
|
|
177
177
|
/**
|
|
178
178
|
* @typedef {Object} AvatarsGetFlagRequestParams
|
|
179
|
-
* @property {
|
|
179
|
+
* @property {Flag} code Country Code. ISO Alpha-2 country code format.
|
|
180
180
|
* @property {number} width Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
|
181
181
|
* @property {number} height Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
|
182
182
|
* @property {number} quality Image quality. Pass an integer between 0 to 100. Defaults to 100.
|
|
@@ -117,7 +117,7 @@ const databasesCreate = async ({ databaseId, name, enabled, parseOutput = true,
|
|
|
117
117
|
|
|
118
118
|
/**
|
|
119
119
|
* @typedef {Object} DatabasesGetUsageRequestParams
|
|
120
|
-
* @property {
|
|
120
|
+
* @property {DatabaseUsageRange} range 'Date range.
|
|
121
121
|
* @property {boolean} parseOutput
|
|
122
122
|
* @property {libClient | undefined} sdk
|
|
123
123
|
*/
|
|
@@ -561,7 +561,7 @@ const databasesUpdateBooleanAttribute = async ({ databaseId, collectionId, key,
|
|
|
561
561
|
* @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
562
562
|
* @property {string} key Attribute Key.
|
|
563
563
|
* @property {boolean} required Is attribute required?
|
|
564
|
-
* @property {string} xdefault Default value for the attribute in ISO 8601 format. Cannot be set when attribute is required.
|
|
564
|
+
* @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.
|
|
565
565
|
* @property {boolean} array Is attribute an array?
|
|
566
566
|
* @property {boolean} parseOutput
|
|
567
567
|
* @property {libClient | undefined} sdk
|
|
@@ -1112,11 +1112,11 @@ const databasesUpdateIpAttribute = async ({ databaseId, collectionId, key, requi
|
|
|
1112
1112
|
* @property {string} databaseId Database ID.
|
|
1113
1113
|
* @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
1114
1114
|
* @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).
|
|
1115
|
-
* @property {
|
|
1115
|
+
* @property {RelationshipType} type Relation type
|
|
1116
1116
|
* @property {boolean} twoWay Is Two Way?
|
|
1117
1117
|
* @property {string} key Attribute Key.
|
|
1118
1118
|
* @property {string} twoWayKey Two Way Attribute Key.
|
|
1119
|
-
* @property {
|
|
1119
|
+
* @property {RelationMutate} onDelete Constraints option
|
|
1120
1120
|
* @property {boolean} parseOutput
|
|
1121
1121
|
* @property {libClient | undefined} sdk
|
|
1122
1122
|
*/
|
|
@@ -1406,7 +1406,7 @@ const databasesDeleteAttribute = async ({ databaseId, collectionId, key, parseOu
|
|
|
1406
1406
|
* @property {string} databaseId Database ID.
|
|
1407
1407
|
* @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
1408
1408
|
* @property {string} key Attribute Key.
|
|
1409
|
-
* @property {
|
|
1409
|
+
* @property {RelationMutate} onDelete Constraints option
|
|
1410
1410
|
* @property {boolean} parseOutput
|
|
1411
1411
|
* @property {libClient | undefined} sdk
|
|
1412
1412
|
*/
|
|
@@ -1518,7 +1518,7 @@ const databasesCreateDocument = async ({ databaseId, collectionId, documentId, d
|
|
|
1518
1518
|
* @property {string} databaseId Database ID.
|
|
1519
1519
|
* @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
1520
1520
|
* @property {string} documentId Document ID.
|
|
1521
|
-
* @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/
|
|
1521
|
+
* @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.
|
|
1522
1522
|
* @property {boolean} parseOutput
|
|
1523
1523
|
* @property {libClient | undefined} sdk
|
|
1524
1524
|
*/
|
|
@@ -1693,7 +1693,7 @@ const databasesListIndexes = async ({ databaseId, collectionId, queries, parseOu
|
|
|
1693
1693
|
* @property {string} databaseId Database ID.
|
|
1694
1694
|
* @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
1695
1695
|
* @property {string} key Index Key.
|
|
1696
|
-
* @property {
|
|
1696
|
+
* @property {IndexType} type Index type.
|
|
1697
1697
|
* @property {string[]} attributes Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.
|
|
1698
1698
|
* @property {string[]} orders Array of index orders. Maximum of 100 orders are allowed.
|
|
1699
1699
|
* @property {boolean} parseOutput
|
|
@@ -1836,7 +1836,7 @@ const databasesListCollectionLogs = async ({ databaseId, collectionId, queries,
|
|
|
1836
1836
|
* @typedef {Object} DatabasesGetCollectionUsageRequestParams
|
|
1837
1837
|
* @property {string} databaseId Database ID.
|
|
1838
1838
|
* @property {string} collectionId Collection ID.
|
|
1839
|
-
* @property {
|
|
1839
|
+
* @property {DatabaseUsageRange} range Date range.
|
|
1840
1840
|
* @property {boolean} parseOutput
|
|
1841
1841
|
* @property {libClient | undefined} sdk
|
|
1842
1842
|
*/
|
|
@@ -1902,7 +1902,7 @@ const databasesListLogs = async ({ databaseId, queries, parseOutput = true, sdk
|
|
|
1902
1902
|
/**
|
|
1903
1903
|
* @typedef {Object} DatabasesGetDatabaseUsageRequestParams
|
|
1904
1904
|
* @property {string} databaseId Database ID.
|
|
1905
|
-
* @property {
|
|
1905
|
+
* @property {DatabaseUsageRange} range 'Date range.
|
|
1906
1906
|
* @property {boolean} parseOutput
|
|
1907
1907
|
* @property {libClient | undefined} sdk
|
|
1908
1908
|
*/
|
|
@@ -2019,7 +2019,7 @@ databases
|
|
|
2019
2019
|
|
|
2020
2020
|
databases
|
|
2021
2021
|
.command(`listAttributes`)
|
|
2022
|
-
.description(
|
|
2022
|
+
.description(`List attributes in the collection.`)
|
|
2023
2023
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
2024
2024
|
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
|
|
2025
2025
|
.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`)
|
|
@@ -2038,7 +2038,7 @@ databases
|
|
|
2038
2038
|
|
|
2039
2039
|
databases
|
|
2040
2040
|
.command(`updateBooleanAttribute`)
|
|
2041
|
-
.description(
|
|
2041
|
+
.description(`Update a boolean attribute. Changing the 'default' value will not update already existing documents.`)
|
|
2042
2042
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
2043
2043
|
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
|
|
2044
2044
|
.requiredOption(`--key <key>`, `Attribute Key.`)
|
|
@@ -2048,18 +2048,18 @@ databases
|
|
|
2048
2048
|
|
|
2049
2049
|
databases
|
|
2050
2050
|
.command(`createDatetimeAttribute`)
|
|
2051
|
-
.description(
|
|
2051
|
+
.description(`Create a date time attribute according to the ISO 8601 standard.`)
|
|
2052
2052
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
2053
2053
|
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
|
|
2054
2054
|
.requiredOption(`--key <key>`, `Attribute Key.`)
|
|
2055
2055
|
.requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
|
|
2056
|
-
.option(`--xdefault <xdefault>`, `Default value for the attribute in ISO 8601 format. Cannot be set when attribute is required.`)
|
|
2056
|
+
.option(`--xdefault <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.`)
|
|
2057
2057
|
.option(`--array <array>`, `Is attribute an array?`, parseBool)
|
|
2058
2058
|
.action(actionRunner(databasesCreateDatetimeAttribute))
|
|
2059
2059
|
|
|
2060
2060
|
databases
|
|
2061
2061
|
.command(`updateDatetimeAttribute`)
|
|
2062
|
-
.description(
|
|
2062
|
+
.description(`Update a date time attribute. Changing the 'default' value will not update already existing documents.`)
|
|
2063
2063
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
2064
2064
|
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
|
|
2065
2065
|
.requiredOption(`--key <key>`, `Attribute Key.`)
|
|
@@ -2090,7 +2090,7 @@ databases
|
|
|
2090
2090
|
|
|
2091
2091
|
databases
|
|
2092
2092
|
.command(`createEnumAttribute`)
|
|
2093
|
-
.description(
|
|
2093
|
+
.description(`Create an enumeration attribute. The 'elements' param acts as a white-list of accepted values for this attribute. `)
|
|
2094
2094
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
2095
2095
|
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
|
|
2096
2096
|
.requiredOption(`--key <key>`, `Attribute Key.`)
|
|
@@ -2241,7 +2241,7 @@ databases
|
|
|
2241
2241
|
|
|
2242
2242
|
databases
|
|
2243
2243
|
.command(`getAttribute`)
|
|
2244
|
-
.description(
|
|
2244
|
+
.description(`Get attribute by ID.`)
|
|
2245
2245
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
2246
2246
|
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
|
|
2247
2247
|
.requiredOption(`--key <key>`, `Attribute Key.`)
|
|
@@ -2249,7 +2249,7 @@ databases
|
|
|
2249
2249
|
|
|
2250
2250
|
databases
|
|
2251
2251
|
.command(`deleteAttribute`)
|
|
2252
|
-
.description(
|
|
2252
|
+
.description(`Deletes an attribute.`)
|
|
2253
2253
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
2254
2254
|
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
|
|
2255
2255
|
.requiredOption(`--key <key>`, `Attribute Key.`)
|
|
@@ -2288,7 +2288,7 @@ databases
|
|
|
2288
2288
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
2289
2289
|
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
|
|
2290
2290
|
.requiredOption(`--documentId <documentId>`, `Document ID.`)
|
|
2291
|
-
.option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/
|
|
2291
|
+
.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.`)
|
|
2292
2292
|
.action(actionRunner(databasesGetDocument))
|
|
2293
2293
|
|
|
2294
2294
|
databases
|
|
@@ -2320,7 +2320,7 @@ databases
|
|
|
2320
2320
|
|
|
2321
2321
|
databases
|
|
2322
2322
|
.command(`listIndexes`)
|
|
2323
|
-
.description(
|
|
2323
|
+
.description(`List indexes in the collection.`)
|
|
2324
2324
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
2325
2325
|
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
|
|
2326
2326
|
.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`)
|
|
@@ -2328,7 +2328,7 @@ databases
|
|
|
2328
2328
|
|
|
2329
2329
|
databases
|
|
2330
2330
|
.command(`createIndex`)
|
|
2331
|
-
.description(
|
|
2331
|
+
.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'.`)
|
|
2332
2332
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
2333
2333
|
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
|
|
2334
2334
|
.requiredOption(`--key <key>`, `Index Key.`)
|
|
@@ -2339,7 +2339,7 @@ databases
|
|
|
2339
2339
|
|
|
2340
2340
|
databases
|
|
2341
2341
|
.command(`getIndex`)
|
|
2342
|
-
.description(
|
|
2342
|
+
.description(`Get index by ID.`)
|
|
2343
2343
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
2344
2344
|
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
|
|
2345
2345
|
.requiredOption(`--key <key>`, `Index Key.`)
|
|
@@ -2347,7 +2347,7 @@ databases
|
|
|
2347
2347
|
|
|
2348
2348
|
databases
|
|
2349
2349
|
.command(`deleteIndex`)
|
|
2350
|
-
.description(
|
|
2350
|
+
.description(`Delete an index.`)
|
|
2351
2351
|
.requiredOption(`--databaseId <databaseId>`, `Database ID.`)
|
|
2352
2352
|
.requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
|
|
2353
2353
|
.requiredOption(`--key <key>`, `Index Key.`)
|
package/lib/commands/deploy.js
CHANGED
|
@@ -52,7 +52,7 @@ const awaitPools = {
|
|
|
52
52
|
const { total } = await databasesListAttributes({
|
|
53
53
|
databaseId,
|
|
54
54
|
collectionId,
|
|
55
|
-
queries: ['limit
|
|
55
|
+
queries: [JSON.stringify({ method: 'limit', values: [1] })],
|
|
56
56
|
parseOutput: false
|
|
57
57
|
});
|
|
58
58
|
|
|
@@ -83,7 +83,7 @@ const awaitPools = {
|
|
|
83
83
|
const { total } = await databasesListIndexes({
|
|
84
84
|
databaseId,
|
|
85
85
|
collectionId,
|
|
86
|
-
queries: ['limit
|
|
86
|
+
queries: [JSON.stringify({ method: 'limit', values: [1] })],
|
|
87
87
|
parseOutput: false
|
|
88
88
|
});
|
|
89
89
|
|
|
@@ -106,6 +106,35 @@ const awaitPools = {
|
|
|
106
106
|
iteration + 1
|
|
107
107
|
);
|
|
108
108
|
},
|
|
109
|
+
wipeVariables: async (functionId, iteration = 1) => {
|
|
110
|
+
if (iteration > poolMaxDebounces) {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const { total } = await functionsListVariables({
|
|
115
|
+
functionId,
|
|
116
|
+
queries: ['limit(1)'],
|
|
117
|
+
parseOutput: false
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
if (total === 0) {
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
let steps = Math.max(1, Math.ceil(total / STEP_SIZE));
|
|
125
|
+
if (steps > 1 && iteration === 1) {
|
|
126
|
+
poolMaxDebounces *= steps;
|
|
127
|
+
|
|
128
|
+
log('Found a large number of variables, increasing timeout to ' + (poolMaxDebounces * POOL_DEBOUNCE / 1000 / 60) + ' minutes')
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
await new Promise(resolve => setTimeout(resolve, POOL_DEBOUNCE));
|
|
132
|
+
|
|
133
|
+
return await awaitPools.wipeVariables(
|
|
134
|
+
functionId,
|
|
135
|
+
iteration + 1
|
|
136
|
+
);
|
|
137
|
+
},
|
|
109
138
|
expectAttributes: async (databaseId, collectionId, attributeKeys, iteration = 1) => {
|
|
110
139
|
if (iteration > poolMaxDebounces) {
|
|
111
140
|
return false;
|
|
@@ -302,7 +331,7 @@ const deployFunction = async ({ functionId, all, yes } = {}) => {
|
|
|
302
331
|
|
|
303
332
|
const { total } = await functionsListVariables({
|
|
304
333
|
functionId: func['$id'],
|
|
305
|
-
queries: ['limit
|
|
334
|
+
queries: [JSON.stringify({ method: 'limit', values: [1] })],
|
|
306
335
|
parseOutput: false
|
|
307
336
|
});
|
|
308
337
|
|
|
@@ -310,7 +339,7 @@ const deployFunction = async ({ functionId, all, yes } = {}) => {
|
|
|
310
339
|
|
|
311
340
|
if (total === 0) {
|
|
312
341
|
deployVariables = true;
|
|
313
|
-
} else if (
|
|
342
|
+
} else if (total > 0 && !yes) {
|
|
314
343
|
const variableAnswers = await inquirer.prompt(questionsDeployFunctions[1])
|
|
315
344
|
deployVariables = variableAnswers.override.toLowerCase() === "yes";
|
|
316
345
|
}
|
|
@@ -320,13 +349,23 @@ const deployFunction = async ({ functionId, all, yes } = {}) => {
|
|
|
320
349
|
} else {
|
|
321
350
|
log(`Deploying variables for ${func.name} ( ${func['$id']} )`);
|
|
322
351
|
|
|
323
|
-
await
|
|
352
|
+
const { variables } = await paginate(functionsListVariables, {
|
|
353
|
+
functionId: func['$id'],
|
|
354
|
+
parseOutput: false
|
|
355
|
+
}, 100, 'variables');
|
|
356
|
+
|
|
357
|
+
await Promise.all(variables.map(async variable => {
|
|
324
358
|
await functionsDeleteVariable({
|
|
325
359
|
functionId: func['$id'],
|
|
326
|
-
variableId:
|
|
360
|
+
variableId: variable['$id'],
|
|
327
361
|
parseOutput: false
|
|
328
362
|
});
|
|
329
363
|
}));
|
|
364
|
+
|
|
365
|
+
let result = await awaitPools.wipeVariables(func['$id']);
|
|
366
|
+
if (!result) {
|
|
367
|
+
throw new Error("Variable deletion timed out.");
|
|
368
|
+
}
|
|
330
369
|
|
|
331
370
|
// Deploy local variables
|
|
332
371
|
await Promise.all(Object.keys(func.variables).map(async localVariableKey => {
|
|
@@ -79,7 +79,7 @@ const functionsList = async ({ queries, search, parseOutput = true, sdk = undefi
|
|
|
79
79
|
* @typedef {Object} FunctionsCreateRequestParams
|
|
80
80
|
* @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.
|
|
81
81
|
* @property {string} name Function name. Max length: 128 chars.
|
|
82
|
-
* @property {
|
|
82
|
+
* @property {Runtime} runtime Execution runtime.
|
|
83
83
|
* @property {string[]} execute An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
|
|
84
84
|
* @property {string[]} events Events list. Maximum of 100 events are allowed.
|
|
85
85
|
* @property {string} schedule Schedule CRON syntax.
|
|
@@ -215,7 +215,7 @@ const functionsListRuntimes = async ({ parseOutput = true, sdk = undefined}) =>
|
|
|
215
215
|
|
|
216
216
|
/**
|
|
217
217
|
* @typedef {Object} FunctionsGetUsageRequestParams
|
|
218
|
-
* @property {
|
|
218
|
+
* @property {FunctionUsageRange} range Date range.
|
|
219
219
|
* @property {boolean} parseOutput
|
|
220
220
|
* @property {libClient | undefined} sdk
|
|
221
221
|
*/
|
|
@@ -278,7 +278,7 @@ const functionsGet = async ({ functionId, parseOutput = true, sdk = undefined})
|
|
|
278
278
|
* @typedef {Object} FunctionsUpdateRequestParams
|
|
279
279
|
* @property {string} functionId Function ID.
|
|
280
280
|
* @property {string} name Function name. Max length: 128 chars.
|
|
281
|
-
* @property {
|
|
281
|
+
* @property {Runtime} runtime Execution runtime.
|
|
282
282
|
* @property {string[]} execute An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
|
|
283
283
|
* @property {string[]} events Events list. Maximum of 100 events are allowed.
|
|
284
284
|
* @property {string} schedule Schedule CRON syntax.
|
|
@@ -793,7 +793,7 @@ const functionsListExecutions = async ({ functionId, queries, search, parseOutpu
|
|
|
793
793
|
* @property {string} body HTTP body of execution. Default value is empty string.
|
|
794
794
|
* @property {boolean} async Execute code in the background. Default value is false.
|
|
795
795
|
* @property {string} xpath HTTP path of execution. Path can include query params. Default value is /
|
|
796
|
-
* @property {
|
|
796
|
+
* @property {ExecutionMethod} method HTTP method of execution. Default value is GET.
|
|
797
797
|
* @property {object} headers HTTP headers of execution. Defaults to empty.
|
|
798
798
|
* @property {boolean} parseOutput
|
|
799
799
|
* @property {libClient | undefined} sdk
|
|
@@ -869,7 +869,7 @@ const functionsGetExecution = async ({ functionId, executionId, parseOutput = tr
|
|
|
869
869
|
/**
|
|
870
870
|
* @typedef {Object} FunctionsGetFunctionUsageRequestParams
|
|
871
871
|
* @property {string} functionId Function ID.
|
|
872
|
-
* @property {
|
|
872
|
+
* @property {FunctionUsageRange} range Date range.
|
|
873
873
|
* @property {boolean} parseOutput
|
|
874
874
|
* @property {libClient | undefined} sdk
|
|
875
875
|
*/
|
package/lib/commands/generic.js
CHANGED
|
@@ -5,7 +5,7 @@ const { sdkForConsole } = require("../sdks");
|
|
|
5
5
|
const { globalConfig, localConfig } = require("../config");
|
|
6
6
|
const { actionRunner, success, parseBool, commandDescriptions, log, parse } = require("../parser");
|
|
7
7
|
const { questionsLogin } = require("../questions");
|
|
8
|
-
const {
|
|
8
|
+
const { accountCreateEmailPasswordSession, accountDeleteSession } = require("./account");
|
|
9
9
|
|
|
10
10
|
const login = new Command("login")
|
|
11
11
|
.description(commandDescriptions['login'])
|
|
@@ -17,7 +17,7 @@ const login = new Command("login")
|
|
|
17
17
|
|
|
18
18
|
let client = await sdkForConsole(false);
|
|
19
19
|
|
|
20
|
-
await
|
|
20
|
+
await accountCreateEmailPasswordSession({
|
|
21
21
|
email: answers.email,
|
|
22
22
|
password: answers.password,
|
|
23
23
|
parseOutput: false,
|
package/lib/commands/health.js
CHANGED
|
@@ -123,6 +123,38 @@ const healthGetCache = async ({ parseOutput = true, sdk = undefined}) => {
|
|
|
123
123
|
return response;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
+
/**
|
|
127
|
+
* @typedef {Object} HealthGetCertificateRequestParams
|
|
128
|
+
* @property {string} domain string
|
|
129
|
+
* @property {boolean} parseOutput
|
|
130
|
+
* @property {libClient | undefined} sdk
|
|
131
|
+
*/
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* @param {HealthGetCertificateRequestParams} params
|
|
135
|
+
*/
|
|
136
|
+
const healthGetCertificate = async ({ domain, parseOutput = true, sdk = undefined}) => {
|
|
137
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
138
|
+
let apiPath = '/health/certificate';
|
|
139
|
+
let payload = {};
|
|
140
|
+
if (typeof domain !== 'undefined') {
|
|
141
|
+
payload['domain'] = domain;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
let response = undefined;
|
|
145
|
+
|
|
146
|
+
response = await client.call('get', apiPath, {
|
|
147
|
+
'content-type': 'application/json',
|
|
148
|
+
}, payload);
|
|
149
|
+
|
|
150
|
+
if (parseOutput) {
|
|
151
|
+
parse(response)
|
|
152
|
+
success()
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return response;
|
|
156
|
+
}
|
|
157
|
+
|
|
126
158
|
/**
|
|
127
159
|
* @typedef {Object} HealthGetDBRequestParams
|
|
128
160
|
* @property {boolean} parseOutput
|
|
@@ -339,6 +371,39 @@ const healthGetQueueDeletes = async ({ threshold, parseOutput = true, sdk = unde
|
|
|
339
371
|
return response;
|
|
340
372
|
}
|
|
341
373
|
|
|
374
|
+
/**
|
|
375
|
+
* @typedef {Object} HealthGetFailedJobsRequestParams
|
|
376
|
+
* @property {Name} name The name of the queue
|
|
377
|
+
* @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
|
378
|
+
* @property {boolean} parseOutput
|
|
379
|
+
* @property {libClient | undefined} sdk
|
|
380
|
+
*/
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* @param {HealthGetFailedJobsRequestParams} params
|
|
384
|
+
*/
|
|
385
|
+
const healthGetFailedJobs = async ({ name, threshold, parseOutput = true, sdk = undefined}) => {
|
|
386
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
387
|
+
let apiPath = '/health/queue/failed/{name}'.replace('{name}', name);
|
|
388
|
+
let payload = {};
|
|
389
|
+
if (typeof threshold !== 'undefined') {
|
|
390
|
+
payload['threshold'] = threshold;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
let response = undefined;
|
|
394
|
+
|
|
395
|
+
response = await client.call('get', apiPath, {
|
|
396
|
+
'content-type': 'application/json',
|
|
397
|
+
}, payload);
|
|
398
|
+
|
|
399
|
+
if (parseOutput) {
|
|
400
|
+
parse(response)
|
|
401
|
+
success()
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
return response;
|
|
405
|
+
}
|
|
406
|
+
|
|
342
407
|
/**
|
|
343
408
|
* @typedef {Object} HealthGetQueueFunctionsRequestParams
|
|
344
409
|
* @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
|
@@ -499,6 +564,70 @@ const healthGetQueueMigrations = async ({ threshold, parseOutput = true, sdk = u
|
|
|
499
564
|
return response;
|
|
500
565
|
}
|
|
501
566
|
|
|
567
|
+
/**
|
|
568
|
+
* @typedef {Object} HealthGetQueueUsageRequestParams
|
|
569
|
+
* @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
|
570
|
+
* @property {boolean} parseOutput
|
|
571
|
+
* @property {libClient | undefined} sdk
|
|
572
|
+
*/
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* @param {HealthGetQueueUsageRequestParams} params
|
|
576
|
+
*/
|
|
577
|
+
const healthGetQueueUsage = async ({ threshold, parseOutput = true, sdk = undefined}) => {
|
|
578
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
579
|
+
let apiPath = '/health/queue/usage';
|
|
580
|
+
let payload = {};
|
|
581
|
+
if (typeof threshold !== 'undefined') {
|
|
582
|
+
payload['threshold'] = threshold;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
let response = undefined;
|
|
586
|
+
|
|
587
|
+
response = await client.call('get', apiPath, {
|
|
588
|
+
'content-type': 'application/json',
|
|
589
|
+
}, payload);
|
|
590
|
+
|
|
591
|
+
if (parseOutput) {
|
|
592
|
+
parse(response)
|
|
593
|
+
success()
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
return response;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
/**
|
|
600
|
+
* @typedef {Object} HealthGetQueueUsageDumpRequestParams
|
|
601
|
+
* @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
|
602
|
+
* @property {boolean} parseOutput
|
|
603
|
+
* @property {libClient | undefined} sdk
|
|
604
|
+
*/
|
|
605
|
+
|
|
606
|
+
/**
|
|
607
|
+
* @param {HealthGetQueueUsageDumpRequestParams} params
|
|
608
|
+
*/
|
|
609
|
+
const healthGetQueueUsageDump = async ({ threshold, parseOutput = true, sdk = undefined}) => {
|
|
610
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
611
|
+
let apiPath = '/health/queue/usage-dump';
|
|
612
|
+
let payload = {};
|
|
613
|
+
if (typeof threshold !== 'undefined') {
|
|
614
|
+
payload['threshold'] = threshold;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
let response = undefined;
|
|
618
|
+
|
|
619
|
+
response = await client.call('get', apiPath, {
|
|
620
|
+
'content-type': 'application/json',
|
|
621
|
+
}, payload);
|
|
622
|
+
|
|
623
|
+
if (parseOutput) {
|
|
624
|
+
parse(response)
|
|
625
|
+
success()
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
return response;
|
|
629
|
+
}
|
|
630
|
+
|
|
502
631
|
/**
|
|
503
632
|
* @typedef {Object} HealthGetQueueWebhooksRequestParams
|
|
504
633
|
* @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
|
|
@@ -531,6 +660,34 @@ const healthGetQueueWebhooks = async ({ threshold, parseOutput = true, sdk = und
|
|
|
531
660
|
return response;
|
|
532
661
|
}
|
|
533
662
|
|
|
663
|
+
/**
|
|
664
|
+
* @typedef {Object} HealthGetStorageRequestParams
|
|
665
|
+
* @property {boolean} parseOutput
|
|
666
|
+
* @property {libClient | undefined} sdk
|
|
667
|
+
*/
|
|
668
|
+
|
|
669
|
+
/**
|
|
670
|
+
* @param {HealthGetStorageRequestParams} params
|
|
671
|
+
*/
|
|
672
|
+
const healthGetStorage = async ({ parseOutput = true, sdk = undefined}) => {
|
|
673
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
674
|
+
let apiPath = '/health/storage';
|
|
675
|
+
let payload = {};
|
|
676
|
+
|
|
677
|
+
let response = undefined;
|
|
678
|
+
|
|
679
|
+
response = await client.call('get', apiPath, {
|
|
680
|
+
'content-type': 'application/json',
|
|
681
|
+
}, payload);
|
|
682
|
+
|
|
683
|
+
if (parseOutput) {
|
|
684
|
+
parse(response)
|
|
685
|
+
success()
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
return response;
|
|
689
|
+
}
|
|
690
|
+
|
|
534
691
|
/**
|
|
535
692
|
* @typedef {Object} HealthGetStorageLocalRequestParams
|
|
536
693
|
* @property {boolean} parseOutput
|
|
@@ -602,6 +759,12 @@ health
|
|
|
602
759
|
.description(`Check the Appwrite in-memory cache servers are up and connection is successful.`)
|
|
603
760
|
.action(actionRunner(healthGetCache))
|
|
604
761
|
|
|
762
|
+
health
|
|
763
|
+
.command(`getCertificate`)
|
|
764
|
+
.description(`Get the SSL certificate for a domain`)
|
|
765
|
+
.option(`--domain <domain>`, `string`)
|
|
766
|
+
.action(actionRunner(healthGetCertificate))
|
|
767
|
+
|
|
605
768
|
health
|
|
606
769
|
.command(`getDB`)
|
|
607
770
|
.description(`Check the Appwrite database servers are up and connection is successful.`)
|
|
@@ -642,9 +805,16 @@ health
|
|
|
642
805
|
.option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger)
|
|
643
806
|
.action(actionRunner(healthGetQueueDeletes))
|
|
644
807
|
|
|
808
|
+
health
|
|
809
|
+
.command(`getFailedJobs`)
|
|
810
|
+
.description(`Returns the amount of failed jobs in a given queue. `)
|
|
811
|
+
.requiredOption(`--name <name>`, `The name of the queue`)
|
|
812
|
+
.option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger)
|
|
813
|
+
.action(actionRunner(healthGetFailedJobs))
|
|
814
|
+
|
|
645
815
|
health
|
|
646
816
|
.command(`getQueueFunctions`)
|
|
647
|
-
.description(
|
|
817
|
+
.description(`Get the number of function executions that are waiting to be processed in the Appwrite internal queue server.`)
|
|
648
818
|
.option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger)
|
|
649
819
|
.action(actionRunner(healthGetQueueFunctions))
|
|
650
820
|
|
|
@@ -672,12 +842,29 @@ health
|
|
|
672
842
|
.option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger)
|
|
673
843
|
.action(actionRunner(healthGetQueueMigrations))
|
|
674
844
|
|
|
845
|
+
health
|
|
846
|
+
.command(`getQueueUsage`)
|
|
847
|
+
.description(`Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.`)
|
|
848
|
+
.option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger)
|
|
849
|
+
.action(actionRunner(healthGetQueueUsage))
|
|
850
|
+
|
|
851
|
+
health
|
|
852
|
+
.command(`getQueueUsageDump`)
|
|
853
|
+
.description(`Get the number of projects containing metrics that are waiting to be processed in the Appwrite internal queue server.`)
|
|
854
|
+
.option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger)
|
|
855
|
+
.action(actionRunner(healthGetQueueUsageDump))
|
|
856
|
+
|
|
675
857
|
health
|
|
676
858
|
.command(`getQueueWebhooks`)
|
|
677
859
|
.description(`Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.`)
|
|
678
860
|
.option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger)
|
|
679
861
|
.action(actionRunner(healthGetQueueWebhooks))
|
|
680
862
|
|
|
863
|
+
health
|
|
864
|
+
.command(`getStorage`)
|
|
865
|
+
.description(`Check the Appwrite storage device is up and connection is successful.`)
|
|
866
|
+
.action(actionRunner(healthGetStorage))
|
|
867
|
+
|
|
681
868
|
health
|
|
682
869
|
.command(`getStorageLocal`)
|
|
683
870
|
.description(`Check the Appwrite local storage device is up and connection is successful.`)
|
|
@@ -693,6 +880,7 @@ module.exports = {
|
|
|
693
880
|
healthGet,
|
|
694
881
|
healthGetAntivirus,
|
|
695
882
|
healthGetCache,
|
|
883
|
+
healthGetCertificate,
|
|
696
884
|
healthGetDB,
|
|
697
885
|
healthGetPubSub,
|
|
698
886
|
healthGetQueue,
|
|
@@ -700,12 +888,16 @@ module.exports = {
|
|
|
700
888
|
healthGetQueueCertificates,
|
|
701
889
|
healthGetQueueDatabases,
|
|
702
890
|
healthGetQueueDeletes,
|
|
891
|
+
healthGetFailedJobs,
|
|
703
892
|
healthGetQueueFunctions,
|
|
704
893
|
healthGetQueueLogs,
|
|
705
894
|
healthGetQueueMails,
|
|
706
895
|
healthGetQueueMessaging,
|
|
707
896
|
healthGetQueueMigrations,
|
|
897
|
+
healthGetQueueUsage,
|
|
898
|
+
healthGetQueueUsageDump,
|
|
708
899
|
healthGetQueueWebhooks,
|
|
900
|
+
healthGetStorage,
|
|
709
901
|
healthGetStorageLocal,
|
|
710
902
|
healthGetTime
|
|
711
903
|
};
|