@appwrite.io/console 0.6.0-rc.8 → 0.6.0
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/.travis.yml +32 -0
- package/README.md +6 -6
- package/dist/cjs/sdk.js +1839 -338
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +1840 -339
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +1839 -338
- package/docs/examples/account/create-anonymous-session.md +5 -12
- package/docs/examples/account/create-email-password-session.md +8 -12
- package/docs/examples/account/create-email-token.md +9 -12
- package/docs/examples/account/create-j-w-t.md +5 -12
- package/docs/examples/account/create-magic-u-r-l-token.md +10 -12
- package/docs/examples/account/create-mfa-authenticator.md +13 -0
- package/docs/examples/account/create-mfa-challenge.md +13 -0
- package/docs/examples/account/create-mfa-recovery-codes.md +11 -0
- package/docs/examples/account/create-o-auth2session.md +10 -9
- package/docs/examples/account/create-o-auth2token.md +15 -0
- package/docs/examples/account/create-phone-token.md +8 -12
- package/docs/examples/account/create-phone-verification.md +5 -12
- package/docs/examples/account/create-push-target.md +9 -12
- package/docs/examples/account/create-recovery.md +8 -12
- package/docs/examples/account/create-session.md +8 -12
- package/docs/examples/account/create-verification.md +7 -12
- package/docs/examples/account/create.md +10 -12
- package/docs/examples/account/delete-identity.md +7 -12
- package/docs/examples/account/delete-mfa-authenticator.md +14 -0
- package/docs/examples/account/delete-push-target.md +13 -0
- package/docs/examples/account/delete-session.md +7 -12
- package/docs/examples/account/delete-sessions.md +5 -12
- package/docs/examples/account/delete.md +5 -12
- package/docs/examples/account/get-mfa-recovery-codes.md +11 -0
- package/docs/examples/account/get-prefs.md +5 -12
- package/docs/examples/account/get-session.md +7 -12
- package/docs/examples/account/get.md +5 -12
- package/docs/examples/account/list-identities.md +7 -12
- package/docs/examples/account/list-logs.md +7 -12
- package/docs/examples/account/list-mfa-factors.md +11 -0
- package/docs/examples/account/list-sessions.md +5 -12
- package/docs/examples/account/update-email.md +8 -12
- package/docs/examples/account/update-m-f-a.md +7 -12
- package/docs/examples/account/update-magic-u-r-l-session.md +8 -12
- package/docs/examples/account/update-mfa-authenticator.md +14 -0
- package/docs/examples/account/update-mfa-challenge.md +14 -0
- package/docs/examples/account/update-mfa-recovery-codes.md +11 -0
- package/docs/examples/account/update-name.md +7 -12
- package/docs/examples/account/update-password.md +8 -12
- package/docs/examples/account/update-phone-session.md +14 -0
- package/docs/examples/account/update-phone-verification.md +8 -12
- package/docs/examples/account/update-phone.md +8 -12
- package/docs/examples/account/update-prefs.md +7 -12
- package/docs/examples/account/update-push-target.md +8 -12
- package/docs/examples/account/update-recovery.md +9 -12
- package/docs/examples/account/update-session.md +7 -12
- package/docs/examples/account/update-status.md +5 -12
- package/docs/examples/account/update-verification.md +8 -12
- package/docs/examples/assistant/chat.md +7 -12
- package/docs/examples/avatars/get-browser.md +11 -9
- package/docs/examples/avatars/get-credit-card.md +11 -9
- package/docs/examples/avatars/get-favicon.md +7 -8
- package/docs/examples/avatars/get-flag.md +11 -9
- package/docs/examples/avatars/get-image.md +9 -8
- package/docs/examples/avatars/get-initials.md +10 -8
- package/docs/examples/avatars/get-q-r.md +10 -8
- package/docs/examples/console/variables.md +5 -12
- package/docs/examples/databases/create-boolean-attribute.md +12 -12
- package/docs/examples/databases/create-collection.md +12 -12
- package/docs/examples/databases/create-datetime-attribute.md +12 -12
- package/docs/examples/databases/create-document.md +11 -12
- package/docs/examples/databases/create-email-attribute.md +12 -12
- package/docs/examples/databases/create-enum-attribute.md +13 -12
- package/docs/examples/databases/create-float-attribute.md +14 -12
- package/docs/examples/databases/create-index.md +13 -13
- package/docs/examples/databases/create-integer-attribute.md +14 -12
- package/docs/examples/databases/create-ip-attribute.md +12 -12
- package/docs/examples/databases/create-relationship-attribute.md +15 -13
- package/docs/examples/databases/create-string-attribute.md +14 -12
- package/docs/examples/databases/create-url-attribute.md +12 -12
- package/docs/examples/databases/create.md +9 -12
- package/docs/examples/databases/delete-attribute.md +9 -12
- package/docs/examples/databases/delete-collection.md +8 -12
- package/docs/examples/databases/delete-document.md +9 -12
- package/docs/examples/databases/delete-index.md +9 -12
- package/docs/examples/databases/delete.md +7 -12
- package/docs/examples/databases/get-attribute.md +9 -12
- package/docs/examples/databases/get-collection-usage.md +10 -13
- package/docs/examples/databases/get-collection.md +8 -12
- package/docs/examples/databases/get-database-usage.md +9 -13
- package/docs/examples/databases/get-document.md +10 -12
- package/docs/examples/databases/get-index.md +9 -12
- package/docs/examples/databases/get-usage.md +8 -13
- package/docs/examples/databases/get.md +7 -12
- package/docs/examples/databases/list-attributes.md +9 -12
- package/docs/examples/databases/list-collection-logs.md +9 -12
- package/docs/examples/databases/list-collections.md +9 -12
- package/docs/examples/databases/list-document-logs.md +10 -12
- package/docs/examples/databases/list-documents.md +9 -12
- package/docs/examples/databases/list-indexes.md +9 -12
- package/docs/examples/databases/list-logs.md +8 -12
- package/docs/examples/databases/list.md +8 -12
- package/docs/examples/databases/update-boolean-attribute.md +11 -12
- package/docs/examples/databases/update-collection.md +12 -12
- package/docs/examples/databases/update-datetime-attribute.md +11 -12
- package/docs/examples/databases/update-document.md +11 -12
- package/docs/examples/databases/update-email-attribute.md +11 -12
- package/docs/examples/databases/update-enum-attribute.md +12 -12
- package/docs/examples/databases/update-float-attribute.md +13 -12
- package/docs/examples/databases/update-integer-attribute.md +13 -12
- package/docs/examples/databases/update-ip-attribute.md +11 -12
- package/docs/examples/databases/update-relationship-attribute.md +11 -13
- package/docs/examples/databases/update-string-attribute.md +11 -12
- package/docs/examples/databases/update-url-attribute.md +11 -12
- package/docs/examples/databases/update.md +9 -12
- package/docs/examples/functions/create-build.md +9 -12
- package/docs/examples/functions/create-deployment.md +11 -12
- package/docs/examples/functions/create-execution.md +13 -13
- package/docs/examples/functions/create-variable.md +9 -12
- package/docs/examples/functions/create.md +27 -13
- package/docs/examples/functions/delete-deployment.md +8 -12
- package/docs/examples/functions/delete-variable.md +8 -12
- package/docs/examples/functions/delete.md +7 -12
- package/docs/examples/functions/download-deployment.md +8 -8
- package/docs/examples/functions/get-deployment.md +8 -12
- package/docs/examples/functions/get-execution.md +8 -12
- package/docs/examples/functions/get-function-usage.md +9 -13
- package/docs/examples/functions/get-usage.md +8 -13
- package/docs/examples/functions/get-variable.md +8 -12
- package/docs/examples/functions/get.md +7 -12
- package/docs/examples/functions/list-deployments.md +9 -12
- package/docs/examples/functions/list-executions.md +9 -12
- package/docs/examples/functions/list-runtimes.md +5 -12
- package/docs/examples/functions/list-variables.md +7 -12
- package/docs/examples/functions/list.md +8 -12
- package/docs/examples/functions/update-deployment.md +8 -12
- package/docs/examples/functions/update-variable.md +10 -12
- package/docs/examples/functions/update.md +23 -13
- package/docs/examples/graphql/mutation.md +7 -12
- package/docs/examples/graphql/query.md +7 -12
- package/docs/examples/health/get-antivirus.md +5 -12
- package/docs/examples/health/get-cache.md +5 -12
- package/docs/examples/health/get-certificate.md +13 -0
- package/docs/examples/health/get-d-b.md +5 -12
- package/docs/examples/health/get-failed-jobs.md +14 -0
- package/docs/examples/health/get-pub-sub.md +5 -12
- package/docs/examples/health/get-queue-builds.md +7 -12
- package/docs/examples/health/get-queue-certificates.md +7 -12
- package/docs/examples/health/get-queue-databases.md +8 -12
- package/docs/examples/health/get-queue-deletes.md +7 -12
- package/docs/examples/health/get-queue-functions.md +7 -12
- package/docs/examples/health/get-queue-logs.md +7 -12
- package/docs/examples/health/get-queue-mails.md +7 -12
- package/docs/examples/health/get-queue-messaging.md +7 -12
- package/docs/examples/health/get-queue-migrations.md +7 -12
- package/docs/examples/health/get-queue-usage-dump.md +13 -0
- package/docs/examples/health/get-queue-usage.md +13 -0
- package/docs/examples/health/get-queue-webhooks.md +7 -12
- package/docs/examples/health/get-queue.md +5 -12
- package/docs/examples/health/get-storage-local.md +5 -12
- package/docs/examples/health/get-storage.md +11 -0
- package/docs/examples/health/get-time.md +5 -12
- package/docs/examples/health/get.md +5 -12
- package/docs/examples/locale/get.md +5 -12
- package/docs/examples/locale/list-codes.md +5 -12
- package/docs/examples/locale/list-continents.md +5 -12
- package/docs/examples/locale/list-countries-e-u.md +5 -12
- package/docs/examples/locale/list-countries-phones.md +5 -12
- package/docs/examples/locale/list-countries.md +5 -12
- package/docs/examples/locale/list-currencies.md +5 -12
- package/docs/examples/locale/list-languages.md +5 -12
- package/docs/examples/messaging/create-apns-provider.md +20 -0
- package/docs/examples/messaging/create-email.md +18 -12
- package/docs/examples/messaging/create-fcm-provider.md +16 -0
- package/docs/examples/messaging/create-mailgun-provider.md +16 -12
- package/docs/examples/messaging/create-msg91provider.md +12 -12
- package/docs/examples/messaging/create-push.md +22 -12
- package/docs/examples/messaging/create-sendgrid-provider.md +14 -12
- package/docs/examples/messaging/create-sms.md +19 -0
- package/docs/examples/messaging/create-smtp-provider.md +26 -0
- package/docs/examples/messaging/create-subscriber.md +9 -12
- package/docs/examples/messaging/create-telesign-provider.md +12 -12
- package/docs/examples/messaging/create-textmagic-provider.md +12 -12
- package/docs/examples/messaging/create-topic.md +9 -12
- package/docs/examples/messaging/create-twilio-provider.md +12 -12
- package/docs/examples/messaging/create-vonage-provider.md +12 -12
- package/docs/examples/messaging/delete-provider.md +7 -12
- package/docs/examples/messaging/delete-subscriber.md +8 -12
- package/docs/examples/messaging/delete-topic.md +7 -12
- package/docs/examples/messaging/delete.md +13 -0
- package/docs/examples/messaging/get-message.md +7 -12
- package/docs/examples/messaging/get-provider.md +7 -12
- package/docs/examples/messaging/get-subscriber.md +8 -12
- package/docs/examples/messaging/get-topic.md +7 -12
- package/docs/examples/messaging/list-message-logs.md +8 -12
- package/docs/examples/messaging/list-messages.md +8 -12
- package/docs/examples/messaging/list-provider-logs.md +8 -12
- package/docs/examples/messaging/list-providers.md +8 -12
- package/docs/examples/messaging/list-subscriber-logs.md +8 -12
- package/docs/examples/messaging/list-subscribers.md +9 -12
- package/docs/examples/messaging/list-targets.md +8 -12
- package/docs/examples/messaging/list-topic-logs.md +8 -12
- package/docs/examples/messaging/list-topics.md +8 -12
- package/docs/examples/messaging/update-apns-provider.md +20 -0
- package/docs/examples/messaging/update-email.md +17 -12
- package/docs/examples/messaging/update-fcm-provider.md +16 -0
- package/docs/examples/messaging/update-mailgun-provider.md +16 -12
- package/docs/examples/messaging/update-msg91provider.md +12 -12
- package/docs/examples/messaging/update-push.md +28 -0
- package/docs/examples/messaging/update-sendgrid-provider.md +14 -12
- package/docs/examples/messaging/update-sms.md +19 -0
- package/docs/examples/messaging/update-smtp-provider.md +26 -0
- package/docs/examples/messaging/update-telesign-provider.md +12 -12
- package/docs/examples/messaging/update-textmagic-provider.md +12 -12
- package/docs/examples/messaging/update-topic.md +9 -12
- package/docs/examples/messaging/update-twilio-provider.md +12 -12
- package/docs/examples/messaging/update-vonage-provider.md +12 -12
- package/docs/examples/migrations/create-appwrite-migration.md +10 -12
- package/docs/examples/migrations/create-firebase-migration.md +8 -12
- package/docs/examples/migrations/create-firebase-o-auth-migration.md +8 -12
- package/docs/examples/migrations/create-n-host-migration.md +14 -12
- package/docs/examples/migrations/create-supabase-migration.md +13 -12
- package/docs/examples/migrations/delete-firebase-auth.md +5 -12
- package/docs/examples/migrations/delete.md +7 -12
- package/docs/examples/migrations/get-appwrite-report.md +10 -12
- package/docs/examples/migrations/get-firebase-report-o-auth.md +8 -12
- package/docs/examples/migrations/get-firebase-report.md +8 -12
- package/docs/examples/migrations/get-n-host-report.md +14 -12
- package/docs/examples/migrations/get-supabase-report.md +13 -12
- package/docs/examples/migrations/get.md +7 -12
- package/docs/examples/migrations/list-firebase-projects.md +5 -12
- package/docs/examples/migrations/list.md +8 -12
- package/docs/examples/migrations/retry.md +7 -12
- package/docs/examples/project/create-variable.md +8 -12
- package/docs/examples/project/delete-variable.md +7 -12
- package/docs/examples/project/get-usage.md +10 -13
- package/docs/examples/project/get-variable.md +7 -12
- package/docs/examples/project/list-variables.md +5 -12
- package/docs/examples/project/update-variable.md +9 -12
- package/docs/examples/projects/create-key.md +10 -12
- package/docs/examples/projects/create-platform.md +13 -13
- package/docs/examples/projects/create-smtp-test.md +17 -13
- package/docs/examples/projects/create-webhook.md +14 -12
- package/docs/examples/projects/create.md +20 -13
- package/docs/examples/projects/delete-email-template.md +10 -13
- package/docs/examples/projects/delete-key.md +8 -12
- package/docs/examples/projects/delete-platform.md +8 -12
- package/docs/examples/projects/delete-sms-template.md +10 -13
- package/docs/examples/projects/delete-webhook.md +8 -12
- package/docs/examples/projects/delete.md +7 -12
- package/docs/examples/projects/get-email-template.md +10 -13
- package/docs/examples/projects/get-key.md +8 -12
- package/docs/examples/projects/get-platform.md +8 -12
- package/docs/examples/projects/get-sms-template.md +10 -13
- package/docs/examples/projects/get-webhook.md +8 -12
- package/docs/examples/projects/get.md +7 -12
- package/docs/examples/projects/list-keys.md +7 -12
- package/docs/examples/projects/list-platforms.md +7 -12
- package/docs/examples/projects/list-webhooks.md +7 -12
- package/docs/examples/projects/list.md +8 -12
- package/docs/examples/projects/update-api-status-all.md +14 -0
- package/docs/examples/projects/update-api-status.md +15 -0
- package/docs/examples/projects/update-auth-duration.md +8 -12
- package/docs/examples/projects/update-auth-limit.md +8 -12
- package/docs/examples/projects/update-auth-password-dictionary.md +8 -12
- package/docs/examples/projects/update-auth-password-history.md +8 -12
- package/docs/examples/projects/update-auth-sessions-limit.md +8 -12
- package/docs/examples/projects/update-auth-status.md +10 -13
- package/docs/examples/projects/update-email-template.md +15 -13
- package/docs/examples/projects/update-key.md +11 -12
- package/docs/examples/projects/update-o-auth2.md +12 -13
- package/docs/examples/projects/update-personal-data-check.md +8 -12
- package/docs/examples/projects/update-platform.md +12 -12
- package/docs/examples/projects/update-service-status-all.md +8 -12
- package/docs/examples/projects/update-service-status.md +10 -13
- package/docs/examples/projects/update-sms-template.md +11 -13
- package/docs/examples/projects/update-smtp.md +17 -13
- package/docs/examples/projects/update-team.md +8 -12
- package/docs/examples/projects/update-webhook-signature.md +8 -12
- package/docs/examples/projects/update-webhook.md +15 -12
- package/docs/examples/projects/update.md +17 -12
- package/docs/examples/proxy/create-rule.md +10 -13
- package/docs/examples/proxy/delete-rule.md +7 -12
- package/docs/examples/proxy/get-rule.md +7 -12
- package/docs/examples/proxy/list-rules.md +8 -12
- package/docs/examples/proxy/update-rule-verification.md +7 -12
- package/docs/examples/storage/create-bucket.md +17 -13
- package/docs/examples/storage/create-file.md +10 -12
- package/docs/examples/storage/delete-bucket.md +7 -12
- package/docs/examples/storage/delete-file.md +8 -12
- package/docs/examples/storage/get-bucket-usage.md +9 -13
- package/docs/examples/storage/get-bucket.md +7 -12
- package/docs/examples/storage/get-file-download.md +8 -8
- package/docs/examples/storage/get-file-preview.md +20 -9
- package/docs/examples/storage/get-file-view.md +8 -8
- package/docs/examples/storage/get-file.md +8 -12
- package/docs/examples/storage/get-usage.md +8 -13
- package/docs/examples/storage/list-buckets.md +8 -12
- package/docs/examples/storage/list-files.md +9 -12
- package/docs/examples/storage/update-bucket.md +17 -13
- package/docs/examples/storage/update-file.md +10 -12
- package/docs/examples/teams/create-membership.md +13 -12
- package/docs/examples/teams/create.md +9 -12
- package/docs/examples/teams/delete-membership.md +8 -12
- package/docs/examples/teams/delete.md +7 -12
- package/docs/examples/teams/get-membership.md +8 -12
- package/docs/examples/teams/get-prefs.md +7 -12
- package/docs/examples/teams/get.md +7 -12
- package/docs/examples/teams/list-logs.md +8 -12
- package/docs/examples/teams/list-memberships.md +9 -12
- package/docs/examples/teams/list.md +8 -12
- package/docs/examples/teams/update-membership-status.md +10 -12
- package/docs/examples/teams/update-membership.md +9 -12
- package/docs/examples/teams/update-name.md +8 -12
- package/docs/examples/teams/update-prefs.md +8 -12
- package/docs/examples/users/create-argon2user.md +10 -12
- package/docs/examples/users/create-bcrypt-user.md +10 -12
- package/docs/examples/users/create-m-d5user.md +10 -12
- package/docs/examples/users/create-mfa-recovery-codes.md +13 -0
- package/docs/examples/users/create-p-h-pass-user.md +10 -12
- package/docs/examples/users/create-s-h-a-user.md +12 -13
- package/docs/examples/users/create-scrypt-modified-user.md +13 -12
- package/docs/examples/users/create-scrypt-user.md +15 -12
- package/docs/examples/users/create-session.md +7 -12
- package/docs/examples/users/create-target.md +13 -13
- package/docs/examples/users/create-token.md +9 -12
- package/docs/examples/users/create.md +11 -12
- package/docs/examples/users/delete-identity.md +7 -12
- package/docs/examples/users/delete-mfa-authenticator.md +14 -0
- package/docs/examples/users/delete-session.md +8 -12
- package/docs/examples/users/delete-sessions.md +7 -12
- package/docs/examples/users/delete-target.md +8 -12
- package/docs/examples/users/delete.md +7 -12
- package/docs/examples/users/get-mfa-recovery-codes.md +13 -0
- package/docs/examples/users/get-prefs.md +7 -12
- package/docs/examples/users/get-target.md +8 -12
- package/docs/examples/users/get-usage.md +8 -13
- package/docs/examples/users/get.md +7 -12
- package/docs/examples/users/list-identities.md +8 -12
- package/docs/examples/users/list-logs.md +8 -12
- package/docs/examples/users/list-memberships.md +7 -12
- package/docs/examples/users/list-mfa-factors.md +13 -0
- package/docs/examples/users/list-sessions.md +7 -12
- package/docs/examples/users/list-targets.md +8 -12
- package/docs/examples/users/list.md +8 -12
- package/docs/examples/users/update-email-verification.md +8 -12
- package/docs/examples/users/update-email.md +8 -12
- package/docs/examples/users/update-labels.md +8 -12
- package/docs/examples/users/update-mfa-recovery-codes.md +13 -0
- package/docs/examples/users/update-mfa.md +8 -12
- package/docs/examples/users/update-name.md +8 -12
- package/docs/examples/users/update-password.md +8 -12
- package/docs/examples/users/update-phone-verification.md +8 -12
- package/docs/examples/users/update-phone.md +8 -12
- package/docs/examples/users/update-prefs.md +8 -12
- package/docs/examples/users/update-status.md +8 -12
- package/docs/examples/users/update-target.md +11 -12
- package/docs/examples/vcs/create-repository-detection.md +9 -12
- package/docs/examples/vcs/create-repository.md +9 -12
- package/docs/examples/vcs/delete-installation.md +7 -12
- package/docs/examples/vcs/get-installation.md +7 -12
- package/docs/examples/vcs/get-repository.md +8 -12
- package/docs/examples/vcs/list-installations.md +8 -12
- package/docs/examples/vcs/list-repositories.md +8 -12
- package/docs/examples/vcs/list-repository-branches.md +8 -12
- package/docs/examples/vcs/update-external-deployments.md +9 -12
- package/package.json +1 -1
- package/src/client.ts +3 -3
- package/src/enums/api-service.ts +13 -0
- package/src/enums/api.ts +5 -0
- package/src/enums/auth-method.ts +9 -0
- package/src/enums/authentication-factor.ts +6 -0
- package/src/enums/authenticator-type.ts +3 -0
- package/src/enums/browser.ts +16 -0
- package/src/enums/compression.ts +5 -0
- package/src/enums/credit-card.ts +18 -0
- package/src/enums/database-usage-range.ts +5 -0
- package/src/enums/email-template-locale.ts +133 -0
- package/src/enums/email-template-type.ts +7 -0
- package/src/enums/execution-method.ts +8 -0
- package/src/enums/flag.ts +196 -0
- package/src/enums/function-usage-range.ts +5 -0
- package/src/enums/image-format.ts +7 -0
- package/src/enums/image-gravity.ts +11 -0
- package/src/enums/index-type.ts +5 -0
- package/src/enums/messaging-provider-type.ts +5 -0
- package/src/enums/name.ts +15 -0
- package/src/enums/o-auth-provider.ts +41 -0
- package/src/enums/password-hash.ts +13 -0
- package/src/enums/platform-type.ts +15 -0
- package/src/enums/project-usage-range.ts +4 -0
- package/src/enums/region.ts +4 -0
- package/src/enums/relation-mutate.ts +5 -0
- package/src/enums/relationship-type.ts +6 -0
- package/src/enums/resource-type.ts +4 -0
- package/src/enums/runtime.ts +46 -0
- package/src/enums/s-m-t-p-secure.ts +3 -0
- package/src/enums/sms-template-locale.ts +133 -0
- package/src/enums/sms-template-type.ts +6 -0
- package/src/enums/smtp-encryption.ts +5 -0
- package/src/enums/storage-usage-range.ts +5 -0
- package/src/enums/user-usage-range.ts +5 -0
- package/src/index.ts +35 -1
- package/src/models.ts +61 -23
- package/src/query.ts +61 -34
- package/src/service.ts +4 -7
- package/src/services/account.ts +274 -75
- package/src/services/avatars.ts +9 -6
- package/src/services/databases.ts +37 -16
- package/src/services/functions.ts +13 -10
- package/src/services/health.ts +121 -0
- package/src/services/messaging.ts +374 -117
- package/src/services/migrations.ts +2 -2
- package/src/services/project.ts +4 -3
- package/src/services/projects.ts +110 -59
- package/src/services/proxy.ts +3 -2
- package/src/services/storage.ts +17 -13
- package/src/services/users.ts +125 -44
- package/types/enums/api-service.d.ts +13 -0
- package/types/enums/api.d.ts +5 -0
- package/types/enums/auth-method.d.ts +9 -0
- package/types/enums/authentication-factor.d.ts +6 -0
- package/types/enums/authenticator-type.d.ts +3 -0
- package/types/enums/browser.d.ts +16 -0
- package/types/enums/compression.d.ts +5 -0
- package/types/enums/credit-card.d.ts +18 -0
- package/types/enums/database-usage-range.d.ts +5 -0
- package/types/enums/email-template-locale.d.ts +133 -0
- package/types/enums/email-template-type.d.ts +7 -0
- package/types/enums/execution-method.d.ts +8 -0
- package/types/enums/flag.d.ts +196 -0
- package/types/enums/function-usage-range.d.ts +5 -0
- package/types/enums/image-format.d.ts +7 -0
- package/types/enums/image-gravity.d.ts +11 -0
- package/types/enums/index-type.d.ts +5 -0
- package/types/enums/messaging-provider-type.d.ts +5 -0
- package/types/enums/name.d.ts +15 -0
- package/types/enums/o-auth-provider.d.ts +41 -0
- package/types/enums/password-hash.d.ts +13 -0
- package/types/enums/platform-type.d.ts +15 -0
- package/types/enums/project-usage-range.d.ts +4 -0
- package/types/enums/region.d.ts +4 -0
- package/types/enums/relation-mutate.d.ts +5 -0
- package/types/enums/relationship-type.d.ts +6 -0
- package/types/enums/resource-type.d.ts +4 -0
- package/types/enums/runtime.d.ts +46 -0
- package/types/enums/s-m-t-p-secure.d.ts +3 -0
- package/types/enums/sms-template-locale.d.ts +133 -0
- package/types/enums/sms-template-type.d.ts +6 -0
- package/types/enums/smtp-encryption.d.ts +5 -0
- package/types/enums/storage-usage-range.d.ts +5 -0
- package/types/enums/user-usage-range.d.ts +5 -0
- package/types/index.d.ts +34 -0
- package/types/models.d.ts +61 -23
- package/types/query.d.ts +10 -3
- package/types/services/account.d.ts +138 -33
- package/types/services/avatars.d.ts +9 -6
- package/types/services/databases.d.ts +37 -16
- package/types/services/functions.d.ts +13 -10
- package/types/services/health.d.ts +56 -0
- package/types/services/messaging.d.ts +170 -64
- package/types/services/migrations.d.ts +2 -2
- package/types/services/project.d.ts +4 -3
- package/types/services/projects.d.ts +64 -42
- package/types/services/proxy.d.ts +3 -2
- package/types/services/storage.d.ts +17 -13
- package/types/services/users.d.ts +73 -23
- package/docs/examples/account/add-authenticator.md +0 -18
- package/docs/examples/account/create-challenge.md +0 -18
- package/docs/examples/account/delete-authenticator.md +0 -18
- package/docs/examples/account/list-providers.md +0 -18
- package/docs/examples/account/update-challenge.md +0 -18
- package/docs/examples/account/verify-authenticator.md +0 -18
- package/docs/examples/messaging/create-a-p-n-s-provider.md +0 -18
- package/docs/examples/messaging/create-f-c-m-provider.md +0 -18
- package/docs/examples/messaging/create-s-m-s.md +0 -18
- package/docs/examples/messaging/update-a-p-n-s-provider.md +0 -18
- package/docs/examples/messaging/update-f-c-m-provider.md +0 -18
- package/docs/examples/messaging/update-push-notification.md +0 -18
- package/docs/examples/messaging/update-s-m-s.md +0 -18
- package/docs/examples/projects/update-auth-mfa-factors.md +0 -18
- package/docs/examples/users/delete-authenticator.md +0 -18
- package/docs/examples/users/list-providers.md +0 -18
|
@@ -2,6 +2,7 @@ import { Service } from '../service';
|
|
|
2
2
|
import { AppwriteException, Client } from '../client';
|
|
3
3
|
import type { Models } from '../models';
|
|
4
4
|
import type { UploadProgress, Payload } from '../client';
|
|
5
|
+
import { SmtpEncryption } from '../enums/smtp-encryption';
|
|
5
6
|
|
|
6
7
|
export class Messaging extends Service {
|
|
7
8
|
|
|
@@ -13,13 +14,14 @@ export class Messaging extends Service {
|
|
|
13
14
|
/**
|
|
14
15
|
* List messages
|
|
15
16
|
*
|
|
17
|
+
* Get a list of all messages from the current Appwrite project.
|
|
16
18
|
*
|
|
17
|
-
* @param {string} queries
|
|
19
|
+
* @param {string[]} queries
|
|
18
20
|
* @param {string} search
|
|
19
21
|
* @throws {AppwriteException}
|
|
20
22
|
* @returns {Promise}
|
|
21
23
|
*/
|
|
22
|
-
async listMessages(queries?: string, search?: string): Promise<Models.MessageList> {
|
|
24
|
+
async listMessages(queries?: string[], search?: string): Promise<Models.MessageList> {
|
|
23
25
|
const apiPath = '/messaging/messages';
|
|
24
26
|
const payload: Payload = {};
|
|
25
27
|
|
|
@@ -38,8 +40,9 @@ export class Messaging extends Service {
|
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
/**
|
|
41
|
-
* Create
|
|
43
|
+
* Create email
|
|
42
44
|
*
|
|
45
|
+
* Create a new email message.
|
|
43
46
|
*
|
|
44
47
|
* @param {string} messageId
|
|
45
48
|
* @param {string} subject
|
|
@@ -49,14 +52,14 @@ export class Messaging extends Service {
|
|
|
49
52
|
* @param {string[]} targets
|
|
50
53
|
* @param {string[]} cc
|
|
51
54
|
* @param {string[]} bcc
|
|
52
|
-
* @param {string}
|
|
53
|
-
* @param {
|
|
55
|
+
* @param {string[]} attachments
|
|
56
|
+
* @param {boolean} draft
|
|
54
57
|
* @param {boolean} html
|
|
55
58
|
* @param {string} scheduledAt
|
|
56
59
|
* @throws {AppwriteException}
|
|
57
60
|
* @returns {Promise}
|
|
58
61
|
*/
|
|
59
|
-
async createEmail(messageId: string, subject: string, content: string, topics?: string[], users?: string[], targets?: string[], cc?: string[], bcc?: string[],
|
|
62
|
+
async createEmail(messageId: string, subject: string, content: string, topics?: string[], users?: string[], targets?: string[], cc?: string[], bcc?: string[], attachments?: string[], draft?: boolean, html?: boolean, scheduledAt?: string): Promise<Models.Message> {
|
|
60
63
|
if (typeof messageId === 'undefined') {
|
|
61
64
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
62
65
|
}
|
|
@@ -104,12 +107,12 @@ export class Messaging extends Service {
|
|
|
104
107
|
payload['bcc'] = bcc;
|
|
105
108
|
}
|
|
106
109
|
|
|
107
|
-
if (typeof
|
|
108
|
-
payload['
|
|
110
|
+
if (typeof attachments !== 'undefined') {
|
|
111
|
+
payload['attachments'] = attachments;
|
|
109
112
|
}
|
|
110
113
|
|
|
111
|
-
if (typeof
|
|
112
|
-
payload['
|
|
114
|
+
if (typeof draft !== 'undefined') {
|
|
115
|
+
payload['draft'] = draft;
|
|
113
116
|
}
|
|
114
117
|
|
|
115
118
|
if (typeof html !== 'undefined') {
|
|
@@ -127,17 +130,18 @@ export class Messaging extends Service {
|
|
|
127
130
|
}
|
|
128
131
|
|
|
129
132
|
/**
|
|
130
|
-
* Update
|
|
133
|
+
* Update email
|
|
131
134
|
*
|
|
135
|
+
* Update an email message by its unique ID.
|
|
136
|
+
*
|
|
132
137
|
*
|
|
133
138
|
* @param {string} messageId
|
|
134
139
|
* @param {string[]} topics
|
|
135
140
|
* @param {string[]} users
|
|
136
141
|
* @param {string[]} targets
|
|
137
142
|
* @param {string} subject
|
|
138
|
-
* @param {string} description
|
|
139
143
|
* @param {string} content
|
|
140
|
-
* @param {
|
|
144
|
+
* @param {boolean} draft
|
|
141
145
|
* @param {boolean} html
|
|
142
146
|
* @param {string[]} cc
|
|
143
147
|
* @param {string[]} bcc
|
|
@@ -145,7 +149,7 @@ export class Messaging extends Service {
|
|
|
145
149
|
* @throws {AppwriteException}
|
|
146
150
|
* @returns {Promise}
|
|
147
151
|
*/
|
|
148
|
-
async updateEmail(messageId: string, topics?: string[], users?: string[], targets?: string[], subject?: string,
|
|
152
|
+
async updateEmail(messageId: string, topics?: string[], users?: string[], targets?: string[], subject?: string, content?: string, draft?: boolean, html?: boolean, cc?: string[], bcc?: string[], scheduledAt?: string): Promise<Models.Message> {
|
|
149
153
|
if (typeof messageId === 'undefined') {
|
|
150
154
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
151
155
|
}
|
|
@@ -169,16 +173,12 @@ export class Messaging extends Service {
|
|
|
169
173
|
payload['subject'] = subject;
|
|
170
174
|
}
|
|
171
175
|
|
|
172
|
-
if (typeof description !== 'undefined') {
|
|
173
|
-
payload['description'] = description;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
176
|
if (typeof content !== 'undefined') {
|
|
177
177
|
payload['content'] = content;
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
-
if (typeof
|
|
181
|
-
payload['
|
|
180
|
+
if (typeof draft !== 'undefined') {
|
|
181
|
+
payload['draft'] = draft;
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
if (typeof html !== 'undefined') {
|
|
@@ -204,8 +204,9 @@ export class Messaging extends Service {
|
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
/**
|
|
207
|
-
* Create
|
|
207
|
+
* Create push notification
|
|
208
208
|
*
|
|
209
|
+
* Create a new push notification.
|
|
209
210
|
*
|
|
210
211
|
* @param {string} messageId
|
|
211
212
|
* @param {string} title
|
|
@@ -213,20 +214,20 @@ export class Messaging extends Service {
|
|
|
213
214
|
* @param {string[]} topics
|
|
214
215
|
* @param {string[]} users
|
|
215
216
|
* @param {string[]} targets
|
|
216
|
-
* @param {string} description
|
|
217
217
|
* @param {object} data
|
|
218
218
|
* @param {string} action
|
|
219
|
+
* @param {string} image
|
|
219
220
|
* @param {string} icon
|
|
220
221
|
* @param {string} sound
|
|
221
222
|
* @param {string} color
|
|
222
223
|
* @param {string} tag
|
|
223
224
|
* @param {string} badge
|
|
224
|
-
* @param {
|
|
225
|
+
* @param {boolean} draft
|
|
225
226
|
* @param {string} scheduledAt
|
|
226
227
|
* @throws {AppwriteException}
|
|
227
228
|
* @returns {Promise}
|
|
228
229
|
*/
|
|
229
|
-
async createPush(messageId: string, title: string, body: string, topics?: string[], users?: string[], targets?: string[],
|
|
230
|
+
async createPush(messageId: string, title: string, body: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: string, draft?: boolean, scheduledAt?: string): Promise<Models.Message> {
|
|
230
231
|
if (typeof messageId === 'undefined') {
|
|
231
232
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
232
233
|
}
|
|
@@ -266,10 +267,6 @@ export class Messaging extends Service {
|
|
|
266
267
|
payload['targets'] = targets;
|
|
267
268
|
}
|
|
268
269
|
|
|
269
|
-
if (typeof description !== 'undefined') {
|
|
270
|
-
payload['description'] = description;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
270
|
if (typeof data !== 'undefined') {
|
|
274
271
|
payload['data'] = data;
|
|
275
272
|
}
|
|
@@ -278,6 +275,10 @@ export class Messaging extends Service {
|
|
|
278
275
|
payload['action'] = action;
|
|
279
276
|
}
|
|
280
277
|
|
|
278
|
+
if (typeof image !== 'undefined') {
|
|
279
|
+
payload['image'] = image;
|
|
280
|
+
}
|
|
281
|
+
|
|
281
282
|
if (typeof icon !== 'undefined') {
|
|
282
283
|
payload['icon'] = icon;
|
|
283
284
|
}
|
|
@@ -298,8 +299,8 @@ export class Messaging extends Service {
|
|
|
298
299
|
payload['badge'] = badge;
|
|
299
300
|
}
|
|
300
301
|
|
|
301
|
-
if (typeof
|
|
302
|
-
payload['
|
|
302
|
+
if (typeof draft !== 'undefined') {
|
|
303
|
+
payload['draft'] = draft;
|
|
303
304
|
}
|
|
304
305
|
|
|
305
306
|
if (typeof scheduledAt !== 'undefined') {
|
|
@@ -313,29 +314,31 @@ export class Messaging extends Service {
|
|
|
313
314
|
}
|
|
314
315
|
|
|
315
316
|
/**
|
|
316
|
-
* Update
|
|
317
|
+
* Update push notification
|
|
317
318
|
*
|
|
319
|
+
* Update a push notification by its unique ID.
|
|
320
|
+
*
|
|
318
321
|
*
|
|
319
322
|
* @param {string} messageId
|
|
320
323
|
* @param {string[]} topics
|
|
321
324
|
* @param {string[]} users
|
|
322
325
|
* @param {string[]} targets
|
|
323
|
-
* @param {string} description
|
|
324
326
|
* @param {string} title
|
|
325
327
|
* @param {string} body
|
|
326
328
|
* @param {object} data
|
|
327
329
|
* @param {string} action
|
|
330
|
+
* @param {string} image
|
|
328
331
|
* @param {string} icon
|
|
329
332
|
* @param {string} sound
|
|
330
333
|
* @param {string} color
|
|
331
334
|
* @param {string} tag
|
|
332
335
|
* @param {number} badge
|
|
333
|
-
* @param {
|
|
336
|
+
* @param {boolean} draft
|
|
334
337
|
* @param {string} scheduledAt
|
|
335
338
|
* @throws {AppwriteException}
|
|
336
339
|
* @returns {Promise}
|
|
337
340
|
*/
|
|
338
|
-
async
|
|
341
|
+
async updatePush(messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string): Promise<Models.Message> {
|
|
339
342
|
if (typeof messageId === 'undefined') {
|
|
340
343
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
341
344
|
}
|
|
@@ -355,10 +358,6 @@ export class Messaging extends Service {
|
|
|
355
358
|
payload['targets'] = targets;
|
|
356
359
|
}
|
|
357
360
|
|
|
358
|
-
if (typeof description !== 'undefined') {
|
|
359
|
-
payload['description'] = description;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
361
|
if (typeof title !== 'undefined') {
|
|
363
362
|
payload['title'] = title;
|
|
364
363
|
}
|
|
@@ -375,6 +374,10 @@ export class Messaging extends Service {
|
|
|
375
374
|
payload['action'] = action;
|
|
376
375
|
}
|
|
377
376
|
|
|
377
|
+
if (typeof image !== 'undefined') {
|
|
378
|
+
payload['image'] = image;
|
|
379
|
+
}
|
|
380
|
+
|
|
378
381
|
if (typeof icon !== 'undefined') {
|
|
379
382
|
payload['icon'] = icon;
|
|
380
383
|
}
|
|
@@ -395,8 +398,8 @@ export class Messaging extends Service {
|
|
|
395
398
|
payload['badge'] = badge;
|
|
396
399
|
}
|
|
397
400
|
|
|
398
|
-
if (typeof
|
|
399
|
-
payload['
|
|
401
|
+
if (typeof draft !== 'undefined') {
|
|
402
|
+
payload['draft'] = draft;
|
|
400
403
|
}
|
|
401
404
|
|
|
402
405
|
if (typeof scheduledAt !== 'undefined') {
|
|
@@ -410,21 +413,21 @@ export class Messaging extends Service {
|
|
|
410
413
|
}
|
|
411
414
|
|
|
412
415
|
/**
|
|
413
|
-
* Create
|
|
416
|
+
* Create SMS
|
|
414
417
|
*
|
|
418
|
+
* Create a new SMS message.
|
|
415
419
|
*
|
|
416
420
|
* @param {string} messageId
|
|
417
421
|
* @param {string} content
|
|
418
422
|
* @param {string[]} topics
|
|
419
423
|
* @param {string[]} users
|
|
420
424
|
* @param {string[]} targets
|
|
421
|
-
* @param {
|
|
422
|
-
* @param {string} status
|
|
425
|
+
* @param {boolean} draft
|
|
423
426
|
* @param {string} scheduledAt
|
|
424
427
|
* @throws {AppwriteException}
|
|
425
428
|
* @returns {Promise}
|
|
426
429
|
*/
|
|
427
|
-
async
|
|
430
|
+
async createSms(messageId: string, content: string, topics?: string[], users?: string[], targets?: string[], draft?: boolean, scheduledAt?: string): Promise<Models.Message> {
|
|
428
431
|
if (typeof messageId === 'undefined') {
|
|
429
432
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
430
433
|
}
|
|
@@ -456,12 +459,8 @@ export class Messaging extends Service {
|
|
|
456
459
|
payload['targets'] = targets;
|
|
457
460
|
}
|
|
458
461
|
|
|
459
|
-
if (typeof
|
|
460
|
-
payload['
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
if (typeof status !== 'undefined') {
|
|
464
|
-
payload['status'] = status;
|
|
462
|
+
if (typeof draft !== 'undefined') {
|
|
463
|
+
payload['draft'] = draft;
|
|
465
464
|
}
|
|
466
465
|
|
|
467
466
|
if (typeof scheduledAt !== 'undefined') {
|
|
@@ -475,21 +474,22 @@ export class Messaging extends Service {
|
|
|
475
474
|
}
|
|
476
475
|
|
|
477
476
|
/**
|
|
478
|
-
* Update
|
|
477
|
+
* Update SMS
|
|
479
478
|
*
|
|
479
|
+
* Update an email message by its unique ID.
|
|
480
|
+
*
|
|
480
481
|
*
|
|
481
482
|
* @param {string} messageId
|
|
482
483
|
* @param {string[]} topics
|
|
483
484
|
* @param {string[]} users
|
|
484
485
|
* @param {string[]} targets
|
|
485
|
-
* @param {string} description
|
|
486
486
|
* @param {string} content
|
|
487
|
-
* @param {
|
|
487
|
+
* @param {boolean} draft
|
|
488
488
|
* @param {string} scheduledAt
|
|
489
489
|
* @throws {AppwriteException}
|
|
490
490
|
* @returns {Promise}
|
|
491
491
|
*/
|
|
492
|
-
async
|
|
492
|
+
async updateSms(messageId: string, topics?: string[], users?: string[], targets?: string[], content?: string, draft?: boolean, scheduledAt?: string): Promise<Models.Message> {
|
|
493
493
|
if (typeof messageId === 'undefined') {
|
|
494
494
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
495
495
|
}
|
|
@@ -509,16 +509,12 @@ export class Messaging extends Service {
|
|
|
509
509
|
payload['targets'] = targets;
|
|
510
510
|
}
|
|
511
511
|
|
|
512
|
-
if (typeof description !== 'undefined') {
|
|
513
|
-
payload['description'] = description;
|
|
514
|
-
}
|
|
515
|
-
|
|
516
512
|
if (typeof content !== 'undefined') {
|
|
517
513
|
payload['content'] = content;
|
|
518
514
|
}
|
|
519
515
|
|
|
520
|
-
if (typeof
|
|
521
|
-
payload['
|
|
516
|
+
if (typeof draft !== 'undefined') {
|
|
517
|
+
payload['draft'] = draft;
|
|
522
518
|
}
|
|
523
519
|
|
|
524
520
|
if (typeof scheduledAt !== 'undefined') {
|
|
@@ -532,8 +528,10 @@ export class Messaging extends Service {
|
|
|
532
528
|
}
|
|
533
529
|
|
|
534
530
|
/**
|
|
535
|
-
* Get
|
|
531
|
+
* Get message
|
|
536
532
|
*
|
|
533
|
+
* Get a message by its unique ID.
|
|
534
|
+
*
|
|
537
535
|
*
|
|
538
536
|
* @param {string} messageId
|
|
539
537
|
* @throws {AppwriteException}
|
|
@@ -553,9 +551,34 @@ export class Messaging extends Service {
|
|
|
553
551
|
}, payload);
|
|
554
552
|
}
|
|
555
553
|
|
|
554
|
+
/**
|
|
555
|
+
* Delete message
|
|
556
|
+
*
|
|
557
|
+
* Delete a message. If the message is not a draft or scheduled, but has been
|
|
558
|
+
* sent, this will not recall the message.
|
|
559
|
+
*
|
|
560
|
+
* @param {string} messageId
|
|
561
|
+
* @throws {AppwriteException}
|
|
562
|
+
* @returns {Promise}
|
|
563
|
+
*/
|
|
564
|
+
async delete(messageId: string): Promise<{}> {
|
|
565
|
+
if (typeof messageId === 'undefined') {
|
|
566
|
+
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
const apiPath = '/messaging/messages/{messageId}'.replace('{messageId}', messageId);
|
|
570
|
+
const payload: Payload = {};
|
|
571
|
+
|
|
572
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
573
|
+
return await this.client.call('delete', uri, {
|
|
574
|
+
'content-type': 'application/json',
|
|
575
|
+
}, payload);
|
|
576
|
+
}
|
|
577
|
+
|
|
556
578
|
/**
|
|
557
579
|
* List message logs
|
|
558
580
|
*
|
|
581
|
+
* Get the message activity logs listed by its unique ID.
|
|
559
582
|
*
|
|
560
583
|
* @param {string} messageId
|
|
561
584
|
* @param {string[]} queries
|
|
@@ -583,15 +606,14 @@ export class Messaging extends Service {
|
|
|
583
606
|
/**
|
|
584
607
|
* List message targets
|
|
585
608
|
*
|
|
586
|
-
*
|
|
587
|
-
* attribute.
|
|
609
|
+
* Get a list of the targets associated with a message.
|
|
588
610
|
*
|
|
589
611
|
* @param {string} messageId
|
|
590
|
-
* @param {string} queries
|
|
612
|
+
* @param {string[]} queries
|
|
591
613
|
* @throws {AppwriteException}
|
|
592
614
|
* @returns {Promise}
|
|
593
615
|
*/
|
|
594
|
-
async listTargets(messageId: string, queries?: string): Promise<Models.TargetList> {
|
|
616
|
+
async listTargets(messageId: string, queries?: string[]): Promise<Models.TargetList> {
|
|
595
617
|
if (typeof messageId === 'undefined') {
|
|
596
618
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
597
619
|
}
|
|
@@ -612,13 +634,14 @@ export class Messaging extends Service {
|
|
|
612
634
|
/**
|
|
613
635
|
* List providers
|
|
614
636
|
*
|
|
637
|
+
* Get a list of all providers from the current Appwrite project.
|
|
615
638
|
*
|
|
616
|
-
* @param {string} queries
|
|
639
|
+
* @param {string[]} queries
|
|
617
640
|
* @param {string} search
|
|
618
641
|
* @throws {AppwriteException}
|
|
619
642
|
* @returns {Promise}
|
|
620
643
|
*/
|
|
621
|
-
async listProviders(queries?: string, search?: string): Promise<Models.ProviderList> {
|
|
644
|
+
async listProviders(queries?: string[], search?: string): Promise<Models.ProviderList> {
|
|
622
645
|
const apiPath = '/messaging/providers';
|
|
623
646
|
const payload: Payload = {};
|
|
624
647
|
|
|
@@ -639,6 +662,7 @@ export class Messaging extends Service {
|
|
|
639
662
|
/**
|
|
640
663
|
* Create APNS provider
|
|
641
664
|
*
|
|
665
|
+
* Create a new Apple Push Notification service provider.
|
|
642
666
|
*
|
|
643
667
|
* @param {string} providerId
|
|
644
668
|
* @param {string} name
|
|
@@ -646,11 +670,12 @@ export class Messaging extends Service {
|
|
|
646
670
|
* @param {string} authKeyId
|
|
647
671
|
* @param {string} teamId
|
|
648
672
|
* @param {string} bundleId
|
|
673
|
+
* @param {boolean} sandbox
|
|
649
674
|
* @param {boolean} enabled
|
|
650
675
|
* @throws {AppwriteException}
|
|
651
676
|
* @returns {Promise}
|
|
652
677
|
*/
|
|
653
|
-
async
|
|
678
|
+
async createApnsProvider(providerId: string, name: string, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, sandbox?: boolean, enabled?: boolean): Promise<Models.Provider> {
|
|
654
679
|
if (typeof providerId === 'undefined') {
|
|
655
680
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
656
681
|
}
|
|
@@ -686,6 +711,10 @@ export class Messaging extends Service {
|
|
|
686
711
|
payload['bundleId'] = bundleId;
|
|
687
712
|
}
|
|
688
713
|
|
|
714
|
+
if (typeof sandbox !== 'undefined') {
|
|
715
|
+
payload['sandbox'] = sandbox;
|
|
716
|
+
}
|
|
717
|
+
|
|
689
718
|
if (typeof enabled !== 'undefined') {
|
|
690
719
|
payload['enabled'] = enabled;
|
|
691
720
|
}
|
|
@@ -699,6 +728,7 @@ export class Messaging extends Service {
|
|
|
699
728
|
/**
|
|
700
729
|
* Update APNS provider
|
|
701
730
|
*
|
|
731
|
+
* Update a Apple Push Notification service provider by its unique ID.
|
|
702
732
|
*
|
|
703
733
|
* @param {string} providerId
|
|
704
734
|
* @param {string} name
|
|
@@ -707,10 +737,11 @@ export class Messaging extends Service {
|
|
|
707
737
|
* @param {string} authKeyId
|
|
708
738
|
* @param {string} teamId
|
|
709
739
|
* @param {string} bundleId
|
|
740
|
+
* @param {boolean} sandbox
|
|
710
741
|
* @throws {AppwriteException}
|
|
711
742
|
* @returns {Promise}
|
|
712
743
|
*/
|
|
713
|
-
async
|
|
744
|
+
async updateApnsProvider(providerId: string, name?: string, enabled?: boolean, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, sandbox?: boolean): Promise<Models.Provider> {
|
|
714
745
|
if (typeof providerId === 'undefined') {
|
|
715
746
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
716
747
|
}
|
|
@@ -742,6 +773,10 @@ export class Messaging extends Service {
|
|
|
742
773
|
payload['bundleId'] = bundleId;
|
|
743
774
|
}
|
|
744
775
|
|
|
776
|
+
if (typeof sandbox !== 'undefined') {
|
|
777
|
+
payload['sandbox'] = sandbox;
|
|
778
|
+
}
|
|
779
|
+
|
|
745
780
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
746
781
|
return await this.client.call('patch', uri, {
|
|
747
782
|
'content-type': 'application/json',
|
|
@@ -751,6 +786,7 @@ export class Messaging extends Service {
|
|
|
751
786
|
/**
|
|
752
787
|
* Create FCM provider
|
|
753
788
|
*
|
|
789
|
+
* Create a new Firebase Cloud Messaging provider.
|
|
754
790
|
*
|
|
755
791
|
* @param {string} providerId
|
|
756
792
|
* @param {string} name
|
|
@@ -759,7 +795,7 @@ export class Messaging extends Service {
|
|
|
759
795
|
* @throws {AppwriteException}
|
|
760
796
|
* @returns {Promise}
|
|
761
797
|
*/
|
|
762
|
-
async
|
|
798
|
+
async createFcmProvider(providerId: string, name: string, serviceAccountJSON?: object, enabled?: boolean): Promise<Models.Provider> {
|
|
763
799
|
if (typeof providerId === 'undefined') {
|
|
764
800
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
765
801
|
}
|
|
@@ -796,6 +832,7 @@ export class Messaging extends Service {
|
|
|
796
832
|
/**
|
|
797
833
|
* Update FCM provider
|
|
798
834
|
*
|
|
835
|
+
* Update a Firebase Cloud Messaging provider by its unique ID.
|
|
799
836
|
*
|
|
800
837
|
* @param {string} providerId
|
|
801
838
|
* @param {string} name
|
|
@@ -804,7 +841,7 @@ export class Messaging extends Service {
|
|
|
804
841
|
* @throws {AppwriteException}
|
|
805
842
|
* @returns {Promise}
|
|
806
843
|
*/
|
|
807
|
-
async
|
|
844
|
+
async updateFcmProvider(providerId: string, name?: string, enabled?: boolean, serviceAccountJSON?: object): Promise<Models.Provider> {
|
|
808
845
|
if (typeof providerId === 'undefined') {
|
|
809
846
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
810
847
|
}
|
|
@@ -833,21 +870,22 @@ export class Messaging extends Service {
|
|
|
833
870
|
/**
|
|
834
871
|
* Create Mailgun provider
|
|
835
872
|
*
|
|
873
|
+
* Create a new Mailgun provider.
|
|
836
874
|
*
|
|
837
875
|
* @param {string} providerId
|
|
838
876
|
* @param {string} name
|
|
839
877
|
* @param {string} apiKey
|
|
840
878
|
* @param {string} domain
|
|
841
879
|
* @param {boolean} isEuRegion
|
|
842
|
-
* @param {boolean} enabled
|
|
843
880
|
* @param {string} fromName
|
|
844
881
|
* @param {string} fromEmail
|
|
845
882
|
* @param {string} replyToName
|
|
846
883
|
* @param {string} replyToEmail
|
|
884
|
+
* @param {boolean} enabled
|
|
847
885
|
* @throws {AppwriteException}
|
|
848
886
|
* @returns {Promise}
|
|
849
887
|
*/
|
|
850
|
-
async createMailgunProvider(providerId: string, name: string, apiKey?: string, domain?: string, isEuRegion?: boolean,
|
|
888
|
+
async createMailgunProvider(providerId: string, name: string, apiKey?: string, domain?: string, isEuRegion?: boolean, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise<Models.Provider> {
|
|
851
889
|
if (typeof providerId === 'undefined') {
|
|
852
890
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
853
891
|
}
|
|
@@ -879,10 +917,6 @@ export class Messaging extends Service {
|
|
|
879
917
|
payload['isEuRegion'] = isEuRegion;
|
|
880
918
|
}
|
|
881
919
|
|
|
882
|
-
if (typeof enabled !== 'undefined') {
|
|
883
|
-
payload['enabled'] = enabled;
|
|
884
|
-
}
|
|
885
|
-
|
|
886
920
|
if (typeof fromName !== 'undefined') {
|
|
887
921
|
payload['fromName'] = fromName;
|
|
888
922
|
}
|
|
@@ -899,6 +933,10 @@ export class Messaging extends Service {
|
|
|
899
933
|
payload['replyToEmail'] = replyToEmail;
|
|
900
934
|
}
|
|
901
935
|
|
|
936
|
+
if (typeof enabled !== 'undefined') {
|
|
937
|
+
payload['enabled'] = enabled;
|
|
938
|
+
}
|
|
939
|
+
|
|
902
940
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
903
941
|
return await this.client.call('post', uri, {
|
|
904
942
|
'content-type': 'application/json',
|
|
@@ -908,6 +946,7 @@ export class Messaging extends Service {
|
|
|
908
946
|
/**
|
|
909
947
|
* Update Mailgun provider
|
|
910
948
|
*
|
|
949
|
+
* Update a Mailgun provider by its unique ID.
|
|
911
950
|
*
|
|
912
951
|
* @param {string} providerId
|
|
913
952
|
* @param {string} name
|
|
@@ -975,6 +1014,7 @@ export class Messaging extends Service {
|
|
|
975
1014
|
/**
|
|
976
1015
|
* Create Msg91 provider
|
|
977
1016
|
*
|
|
1017
|
+
* Create a new MSG91 provider.
|
|
978
1018
|
*
|
|
979
1019
|
* @param {string} providerId
|
|
980
1020
|
* @param {string} name
|
|
@@ -1030,6 +1070,7 @@ export class Messaging extends Service {
|
|
|
1030
1070
|
/**
|
|
1031
1071
|
* Update Msg91 provider
|
|
1032
1072
|
*
|
|
1073
|
+
* Update a MSG91 provider by its unique ID.
|
|
1033
1074
|
*
|
|
1034
1075
|
* @param {string} providerId
|
|
1035
1076
|
* @param {string} name
|
|
@@ -1077,19 +1118,20 @@ export class Messaging extends Service {
|
|
|
1077
1118
|
/**
|
|
1078
1119
|
* Create Sendgrid provider
|
|
1079
1120
|
*
|
|
1121
|
+
* Create a new Sendgrid provider.
|
|
1080
1122
|
*
|
|
1081
1123
|
* @param {string} providerId
|
|
1082
1124
|
* @param {string} name
|
|
1083
1125
|
* @param {string} apiKey
|
|
1084
|
-
* @param {boolean} enabled
|
|
1085
1126
|
* @param {string} fromName
|
|
1086
1127
|
* @param {string} fromEmail
|
|
1087
1128
|
* @param {string} replyToName
|
|
1088
1129
|
* @param {string} replyToEmail
|
|
1130
|
+
* @param {boolean} enabled
|
|
1089
1131
|
* @throws {AppwriteException}
|
|
1090
1132
|
* @returns {Promise}
|
|
1091
1133
|
*/
|
|
1092
|
-
async createSendgridProvider(providerId: string, name: string, apiKey?: string,
|
|
1134
|
+
async createSendgridProvider(providerId: string, name: string, apiKey?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise<Models.Provider> {
|
|
1093
1135
|
if (typeof providerId === 'undefined') {
|
|
1094
1136
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1095
1137
|
}
|
|
@@ -1113,10 +1155,6 @@ export class Messaging extends Service {
|
|
|
1113
1155
|
payload['apiKey'] = apiKey;
|
|
1114
1156
|
}
|
|
1115
1157
|
|
|
1116
|
-
if (typeof enabled !== 'undefined') {
|
|
1117
|
-
payload['enabled'] = enabled;
|
|
1118
|
-
}
|
|
1119
|
-
|
|
1120
1158
|
if (typeof fromName !== 'undefined') {
|
|
1121
1159
|
payload['fromName'] = fromName;
|
|
1122
1160
|
}
|
|
@@ -1133,6 +1171,10 @@ export class Messaging extends Service {
|
|
|
1133
1171
|
payload['replyToEmail'] = replyToEmail;
|
|
1134
1172
|
}
|
|
1135
1173
|
|
|
1174
|
+
if (typeof enabled !== 'undefined') {
|
|
1175
|
+
payload['enabled'] = enabled;
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1136
1178
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1137
1179
|
return await this.client.call('post', uri, {
|
|
1138
1180
|
'content-type': 'application/json',
|
|
@@ -1142,6 +1184,7 @@ export class Messaging extends Service {
|
|
|
1142
1184
|
/**
|
|
1143
1185
|
* Update Sendgrid provider
|
|
1144
1186
|
*
|
|
1187
|
+
* Update a Sendgrid provider by its unique ID.
|
|
1145
1188
|
*
|
|
1146
1189
|
* @param {string} providerId
|
|
1147
1190
|
* @param {string} name
|
|
@@ -1197,19 +1240,28 @@ export class Messaging extends Service {
|
|
|
1197
1240
|
}
|
|
1198
1241
|
|
|
1199
1242
|
/**
|
|
1200
|
-
* Create
|
|
1243
|
+
* Create SMTP provider
|
|
1201
1244
|
*
|
|
1245
|
+
* Create a new SMTP provider.
|
|
1202
1246
|
*
|
|
1203
1247
|
* @param {string} providerId
|
|
1204
1248
|
* @param {string} name
|
|
1205
|
-
* @param {string}
|
|
1249
|
+
* @param {string} host
|
|
1250
|
+
* @param {number} port
|
|
1206
1251
|
* @param {string} username
|
|
1207
1252
|
* @param {string} password
|
|
1253
|
+
* @param {SmtpEncryption} encryption
|
|
1254
|
+
* @param {boolean} autoTLS
|
|
1255
|
+
* @param {string} mailer
|
|
1256
|
+
* @param {string} fromName
|
|
1257
|
+
* @param {string} fromEmail
|
|
1258
|
+
* @param {string} replyToName
|
|
1259
|
+
* @param {string} replyToEmail
|
|
1208
1260
|
* @param {boolean} enabled
|
|
1209
1261
|
* @throws {AppwriteException}
|
|
1210
1262
|
* @returns {Promise}
|
|
1211
1263
|
*/
|
|
1212
|
-
async
|
|
1264
|
+
async createSmtpProvider(providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise<Models.Provider> {
|
|
1213
1265
|
if (typeof providerId === 'undefined') {
|
|
1214
1266
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1215
1267
|
}
|
|
@@ -1218,7 +1270,11 @@ export class Messaging extends Service {
|
|
|
1218
1270
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
1219
1271
|
}
|
|
1220
1272
|
|
|
1221
|
-
|
|
1273
|
+
if (typeof host === 'undefined') {
|
|
1274
|
+
throw new AppwriteException('Missing required parameter: "host"');
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
const apiPath = '/messaging/providers/smtp';
|
|
1222
1278
|
const payload: Payload = {};
|
|
1223
1279
|
|
|
1224
1280
|
if (typeof providerId !== 'undefined') {
|
|
@@ -1229,8 +1285,12 @@ export class Messaging extends Service {
|
|
|
1229
1285
|
payload['name'] = name;
|
|
1230
1286
|
}
|
|
1231
1287
|
|
|
1232
|
-
if (typeof
|
|
1233
|
-
payload['
|
|
1288
|
+
if (typeof host !== 'undefined') {
|
|
1289
|
+
payload['host'] = host;
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
if (typeof port !== 'undefined') {
|
|
1293
|
+
payload['port'] = port;
|
|
1234
1294
|
}
|
|
1235
1295
|
|
|
1236
1296
|
if (typeof username !== 'undefined') {
|
|
@@ -1241,6 +1301,34 @@ export class Messaging extends Service {
|
|
|
1241
1301
|
payload['password'] = password;
|
|
1242
1302
|
}
|
|
1243
1303
|
|
|
1304
|
+
if (typeof encryption !== 'undefined') {
|
|
1305
|
+
payload['encryption'] = encryption;
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
if (typeof autoTLS !== 'undefined') {
|
|
1309
|
+
payload['autoTLS'] = autoTLS;
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
if (typeof mailer !== 'undefined') {
|
|
1313
|
+
payload['mailer'] = mailer;
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
if (typeof fromName !== 'undefined') {
|
|
1317
|
+
payload['fromName'] = fromName;
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
if (typeof fromEmail !== 'undefined') {
|
|
1321
|
+
payload['fromEmail'] = fromEmail;
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
if (typeof replyToName !== 'undefined') {
|
|
1325
|
+
payload['replyToName'] = replyToName;
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1328
|
+
if (typeof replyToEmail !== 'undefined') {
|
|
1329
|
+
payload['replyToEmail'] = replyToEmail;
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1244
1332
|
if (typeof enabled !== 'undefined') {
|
|
1245
1333
|
payload['enabled'] = enabled;
|
|
1246
1334
|
}
|
|
@@ -1252,32 +1340,45 @@ export class Messaging extends Service {
|
|
|
1252
1340
|
}
|
|
1253
1341
|
|
|
1254
1342
|
/**
|
|
1255
|
-
* Update
|
|
1343
|
+
* Update SMTP provider
|
|
1256
1344
|
*
|
|
1345
|
+
* Update a SMTP provider by its unique ID.
|
|
1257
1346
|
*
|
|
1258
1347
|
* @param {string} providerId
|
|
1259
1348
|
* @param {string} name
|
|
1260
|
-
* @param {
|
|
1349
|
+
* @param {string} host
|
|
1350
|
+
* @param {number} port
|
|
1261
1351
|
* @param {string} username
|
|
1262
1352
|
* @param {string} password
|
|
1263
|
-
* @param {
|
|
1353
|
+
* @param {SmtpEncryption} encryption
|
|
1354
|
+
* @param {boolean} autoTLS
|
|
1355
|
+
* @param {string} mailer
|
|
1356
|
+
* @param {string} fromName
|
|
1357
|
+
* @param {string} fromEmail
|
|
1358
|
+
* @param {string} replyToName
|
|
1359
|
+
* @param {string} replyToEmail
|
|
1360
|
+
* @param {boolean} enabled
|
|
1264
1361
|
* @throws {AppwriteException}
|
|
1265
1362
|
* @returns {Promise}
|
|
1266
1363
|
*/
|
|
1267
|
-
async
|
|
1364
|
+
async updateSmtpProvider(providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise<Models.Provider> {
|
|
1268
1365
|
if (typeof providerId === 'undefined') {
|
|
1269
1366
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1270
1367
|
}
|
|
1271
1368
|
|
|
1272
|
-
const apiPath = '/messaging/providers/
|
|
1369
|
+
const apiPath = '/messaging/providers/smtp/{providerId}'.replace('{providerId}', providerId);
|
|
1273
1370
|
const payload: Payload = {};
|
|
1274
1371
|
|
|
1275
1372
|
if (typeof name !== 'undefined') {
|
|
1276
1373
|
payload['name'] = name;
|
|
1277
1374
|
}
|
|
1278
1375
|
|
|
1279
|
-
if (typeof
|
|
1280
|
-
payload['
|
|
1376
|
+
if (typeof host !== 'undefined') {
|
|
1377
|
+
payload['host'] = host;
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1380
|
+
if (typeof port !== 'undefined') {
|
|
1381
|
+
payload['port'] = port;
|
|
1281
1382
|
}
|
|
1282
1383
|
|
|
1283
1384
|
if (typeof username !== 'undefined') {
|
|
@@ -1288,6 +1389,138 @@ export class Messaging extends Service {
|
|
|
1288
1389
|
payload['password'] = password;
|
|
1289
1390
|
}
|
|
1290
1391
|
|
|
1392
|
+
if (typeof encryption !== 'undefined') {
|
|
1393
|
+
payload['encryption'] = encryption;
|
|
1394
|
+
}
|
|
1395
|
+
|
|
1396
|
+
if (typeof autoTLS !== 'undefined') {
|
|
1397
|
+
payload['autoTLS'] = autoTLS;
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
if (typeof mailer !== 'undefined') {
|
|
1401
|
+
payload['mailer'] = mailer;
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
if (typeof fromName !== 'undefined') {
|
|
1405
|
+
payload['fromName'] = fromName;
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
if (typeof fromEmail !== 'undefined') {
|
|
1409
|
+
payload['fromEmail'] = fromEmail;
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1412
|
+
if (typeof replyToName !== 'undefined') {
|
|
1413
|
+
payload['replyToName'] = replyToName;
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
if (typeof replyToEmail !== 'undefined') {
|
|
1417
|
+
payload['replyToEmail'] = replyToEmail;
|
|
1418
|
+
}
|
|
1419
|
+
|
|
1420
|
+
if (typeof enabled !== 'undefined') {
|
|
1421
|
+
payload['enabled'] = enabled;
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1425
|
+
return await this.client.call('patch', uri, {
|
|
1426
|
+
'content-type': 'application/json',
|
|
1427
|
+
}, payload);
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
/**
|
|
1431
|
+
* Create Telesign provider
|
|
1432
|
+
*
|
|
1433
|
+
* Create a new Telesign provider.
|
|
1434
|
+
*
|
|
1435
|
+
* @param {string} providerId
|
|
1436
|
+
* @param {string} name
|
|
1437
|
+
* @param {string} from
|
|
1438
|
+
* @param {string} customerId
|
|
1439
|
+
* @param {string} apiKey
|
|
1440
|
+
* @param {boolean} enabled
|
|
1441
|
+
* @throws {AppwriteException}
|
|
1442
|
+
* @returns {Promise}
|
|
1443
|
+
*/
|
|
1444
|
+
async createTelesignProvider(providerId: string, name: string, from?: string, customerId?: string, apiKey?: string, enabled?: boolean): Promise<Models.Provider> {
|
|
1445
|
+
if (typeof providerId === 'undefined') {
|
|
1446
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
if (typeof name === 'undefined') {
|
|
1450
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
const apiPath = '/messaging/providers/telesign';
|
|
1454
|
+
const payload: Payload = {};
|
|
1455
|
+
|
|
1456
|
+
if (typeof providerId !== 'undefined') {
|
|
1457
|
+
payload['providerId'] = providerId;
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
if (typeof name !== 'undefined') {
|
|
1461
|
+
payload['name'] = name;
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
if (typeof from !== 'undefined') {
|
|
1465
|
+
payload['from'] = from;
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1468
|
+
if (typeof customerId !== 'undefined') {
|
|
1469
|
+
payload['customerId'] = customerId;
|
|
1470
|
+
}
|
|
1471
|
+
|
|
1472
|
+
if (typeof apiKey !== 'undefined') {
|
|
1473
|
+
payload['apiKey'] = apiKey;
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
if (typeof enabled !== 'undefined') {
|
|
1477
|
+
payload['enabled'] = enabled;
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1480
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1481
|
+
return await this.client.call('post', uri, {
|
|
1482
|
+
'content-type': 'application/json',
|
|
1483
|
+
}, payload);
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
/**
|
|
1487
|
+
* Update Telesign provider
|
|
1488
|
+
*
|
|
1489
|
+
* Update a Telesign provider by its unique ID.
|
|
1490
|
+
*
|
|
1491
|
+
* @param {string} providerId
|
|
1492
|
+
* @param {string} name
|
|
1493
|
+
* @param {boolean} enabled
|
|
1494
|
+
* @param {string} customerId
|
|
1495
|
+
* @param {string} apiKey
|
|
1496
|
+
* @param {string} from
|
|
1497
|
+
* @throws {AppwriteException}
|
|
1498
|
+
* @returns {Promise}
|
|
1499
|
+
*/
|
|
1500
|
+
async updateTelesignProvider(providerId: string, name?: string, enabled?: boolean, customerId?: string, apiKey?: string, from?: string): Promise<Models.Provider> {
|
|
1501
|
+
if (typeof providerId === 'undefined') {
|
|
1502
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1505
|
+
const apiPath = '/messaging/providers/telesign/{providerId}'.replace('{providerId}', providerId);
|
|
1506
|
+
const payload: Payload = {};
|
|
1507
|
+
|
|
1508
|
+
if (typeof name !== 'undefined') {
|
|
1509
|
+
payload['name'] = name;
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
if (typeof enabled !== 'undefined') {
|
|
1513
|
+
payload['enabled'] = enabled;
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1516
|
+
if (typeof customerId !== 'undefined') {
|
|
1517
|
+
payload['customerId'] = customerId;
|
|
1518
|
+
}
|
|
1519
|
+
|
|
1520
|
+
if (typeof apiKey !== 'undefined') {
|
|
1521
|
+
payload['apiKey'] = apiKey;
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1291
1524
|
if (typeof from !== 'undefined') {
|
|
1292
1525
|
payload['from'] = from;
|
|
1293
1526
|
}
|
|
@@ -1301,6 +1534,7 @@ export class Messaging extends Service {
|
|
|
1301
1534
|
/**
|
|
1302
1535
|
* Create Textmagic provider
|
|
1303
1536
|
*
|
|
1537
|
+
* Create a new Textmagic provider.
|
|
1304
1538
|
*
|
|
1305
1539
|
* @param {string} providerId
|
|
1306
1540
|
* @param {string} name
|
|
@@ -1356,6 +1590,7 @@ export class Messaging extends Service {
|
|
|
1356
1590
|
/**
|
|
1357
1591
|
* Update Textmagic provider
|
|
1358
1592
|
*
|
|
1593
|
+
* Update a Textmagic provider by its unique ID.
|
|
1359
1594
|
*
|
|
1360
1595
|
* @param {string} providerId
|
|
1361
1596
|
* @param {string} name
|
|
@@ -1403,6 +1638,7 @@ export class Messaging extends Service {
|
|
|
1403
1638
|
/**
|
|
1404
1639
|
* Create Twilio provider
|
|
1405
1640
|
*
|
|
1641
|
+
* Create a new Twilio provider.
|
|
1406
1642
|
*
|
|
1407
1643
|
* @param {string} providerId
|
|
1408
1644
|
* @param {string} name
|
|
@@ -1458,6 +1694,7 @@ export class Messaging extends Service {
|
|
|
1458
1694
|
/**
|
|
1459
1695
|
* Update Twilio provider
|
|
1460
1696
|
*
|
|
1697
|
+
* Update a Twilio provider by its unique ID.
|
|
1461
1698
|
*
|
|
1462
1699
|
* @param {string} providerId
|
|
1463
1700
|
* @param {string} name
|
|
@@ -1505,6 +1742,7 @@ export class Messaging extends Service {
|
|
|
1505
1742
|
/**
|
|
1506
1743
|
* Create Vonage provider
|
|
1507
1744
|
*
|
|
1745
|
+
* Create a new Vonage provider.
|
|
1508
1746
|
*
|
|
1509
1747
|
* @param {string} providerId
|
|
1510
1748
|
* @param {string} name
|
|
@@ -1560,6 +1798,7 @@ export class Messaging extends Service {
|
|
|
1560
1798
|
/**
|
|
1561
1799
|
* Update Vonage provider
|
|
1562
1800
|
*
|
|
1801
|
+
* Update a Vonage provider by its unique ID.
|
|
1563
1802
|
*
|
|
1564
1803
|
* @param {string} providerId
|
|
1565
1804
|
* @param {string} name
|
|
@@ -1607,6 +1846,8 @@ export class Messaging extends Service {
|
|
|
1607
1846
|
/**
|
|
1608
1847
|
* Get provider
|
|
1609
1848
|
*
|
|
1849
|
+
* Get a provider by its unique ID.
|
|
1850
|
+
*
|
|
1610
1851
|
*
|
|
1611
1852
|
* @param {string} providerId
|
|
1612
1853
|
* @throws {AppwriteException}
|
|
@@ -1629,6 +1870,7 @@ export class Messaging extends Service {
|
|
|
1629
1870
|
/**
|
|
1630
1871
|
* Delete provider
|
|
1631
1872
|
*
|
|
1873
|
+
* Delete a provider by its unique ID.
|
|
1632
1874
|
*
|
|
1633
1875
|
* @param {string} providerId
|
|
1634
1876
|
* @throws {AppwriteException}
|
|
@@ -1651,6 +1893,7 @@ export class Messaging extends Service {
|
|
|
1651
1893
|
/**
|
|
1652
1894
|
* List provider logs
|
|
1653
1895
|
*
|
|
1896
|
+
* Get the provider activity logs listed by its unique ID.
|
|
1654
1897
|
*
|
|
1655
1898
|
* @param {string} providerId
|
|
1656
1899
|
* @param {string[]} queries
|
|
@@ -1678,6 +1921,7 @@ export class Messaging extends Service {
|
|
|
1678
1921
|
/**
|
|
1679
1922
|
* List subscriber logs
|
|
1680
1923
|
*
|
|
1924
|
+
* Get the subscriber activity logs listed by its unique ID.
|
|
1681
1925
|
*
|
|
1682
1926
|
* @param {string} subscriberId
|
|
1683
1927
|
* @param {string[]} queries
|
|
@@ -1703,15 +1947,16 @@ export class Messaging extends Service {
|
|
|
1703
1947
|
}
|
|
1704
1948
|
|
|
1705
1949
|
/**
|
|
1706
|
-
* List topics
|
|
1950
|
+
* List topics
|
|
1707
1951
|
*
|
|
1952
|
+
* Get a list of all topics from the current Appwrite project.
|
|
1708
1953
|
*
|
|
1709
|
-
* @param {string} queries
|
|
1954
|
+
* @param {string[]} queries
|
|
1710
1955
|
* @param {string} search
|
|
1711
1956
|
* @throws {AppwriteException}
|
|
1712
1957
|
* @returns {Promise}
|
|
1713
1958
|
*/
|
|
1714
|
-
async listTopics(queries?: string, search?: string): Promise<Models.TopicList> {
|
|
1959
|
+
async listTopics(queries?: string[], search?: string): Promise<Models.TopicList> {
|
|
1715
1960
|
const apiPath = '/messaging/topics';
|
|
1716
1961
|
const payload: Payload = {};
|
|
1717
1962
|
|
|
@@ -1730,16 +1975,17 @@ export class Messaging extends Service {
|
|
|
1730
1975
|
}
|
|
1731
1976
|
|
|
1732
1977
|
/**
|
|
1733
|
-
* Create
|
|
1978
|
+
* Create topic
|
|
1734
1979
|
*
|
|
1980
|
+
* Create a new topic.
|
|
1735
1981
|
*
|
|
1736
1982
|
* @param {string} topicId
|
|
1737
1983
|
* @param {string} name
|
|
1738
|
-
* @param {string}
|
|
1984
|
+
* @param {string[]} subscribe
|
|
1739
1985
|
* @throws {AppwriteException}
|
|
1740
1986
|
* @returns {Promise}
|
|
1741
1987
|
*/
|
|
1742
|
-
async createTopic(topicId: string, name: string,
|
|
1988
|
+
async createTopic(topicId: string, name: string, subscribe?: string[]): Promise<Models.Topic> {
|
|
1743
1989
|
if (typeof topicId === 'undefined') {
|
|
1744
1990
|
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
1745
1991
|
}
|
|
@@ -1759,8 +2005,8 @@ export class Messaging extends Service {
|
|
|
1759
2005
|
payload['name'] = name;
|
|
1760
2006
|
}
|
|
1761
2007
|
|
|
1762
|
-
if (typeof
|
|
1763
|
-
payload['
|
|
2008
|
+
if (typeof subscribe !== 'undefined') {
|
|
2009
|
+
payload['subscribe'] = subscribe;
|
|
1764
2010
|
}
|
|
1765
2011
|
|
|
1766
2012
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -1770,8 +2016,10 @@ export class Messaging extends Service {
|
|
|
1770
2016
|
}
|
|
1771
2017
|
|
|
1772
2018
|
/**
|
|
1773
|
-
* Get
|
|
2019
|
+
* Get topic
|
|
1774
2020
|
*
|
|
2021
|
+
* Get a topic by its unique ID.
|
|
2022
|
+
*
|
|
1775
2023
|
*
|
|
1776
2024
|
* @param {string} topicId
|
|
1777
2025
|
* @throws {AppwriteException}
|
|
@@ -1792,16 +2040,18 @@ export class Messaging extends Service {
|
|
|
1792
2040
|
}
|
|
1793
2041
|
|
|
1794
2042
|
/**
|
|
1795
|
-
* Update
|
|
2043
|
+
* Update topic
|
|
1796
2044
|
*
|
|
2045
|
+
* Update a topic by its unique ID.
|
|
2046
|
+
*
|
|
1797
2047
|
*
|
|
1798
2048
|
* @param {string} topicId
|
|
1799
2049
|
* @param {string} name
|
|
1800
|
-
* @param {string}
|
|
2050
|
+
* @param {string[]} subscribe
|
|
1801
2051
|
* @throws {AppwriteException}
|
|
1802
2052
|
* @returns {Promise}
|
|
1803
2053
|
*/
|
|
1804
|
-
async updateTopic(topicId: string, name?: string,
|
|
2054
|
+
async updateTopic(topicId: string, name?: string, subscribe?: string[]): Promise<Models.Topic> {
|
|
1805
2055
|
if (typeof topicId === 'undefined') {
|
|
1806
2056
|
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
1807
2057
|
}
|
|
@@ -1813,8 +2063,8 @@ export class Messaging extends Service {
|
|
|
1813
2063
|
payload['name'] = name;
|
|
1814
2064
|
}
|
|
1815
2065
|
|
|
1816
|
-
if (typeof
|
|
1817
|
-
payload['
|
|
2066
|
+
if (typeof subscribe !== 'undefined') {
|
|
2067
|
+
payload['subscribe'] = subscribe;
|
|
1818
2068
|
}
|
|
1819
2069
|
|
|
1820
2070
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -1824,8 +2074,9 @@ export class Messaging extends Service {
|
|
|
1824
2074
|
}
|
|
1825
2075
|
|
|
1826
2076
|
/**
|
|
1827
|
-
* Delete
|
|
2077
|
+
* Delete topic
|
|
1828
2078
|
*
|
|
2079
|
+
* Delete a topic by its unique ID.
|
|
1829
2080
|
*
|
|
1830
2081
|
* @param {string} topicId
|
|
1831
2082
|
* @throws {AppwriteException}
|
|
@@ -1848,6 +2099,7 @@ export class Messaging extends Service {
|
|
|
1848
2099
|
/**
|
|
1849
2100
|
* List topic logs
|
|
1850
2101
|
*
|
|
2102
|
+
* Get the topic activity logs listed by its unique ID.
|
|
1851
2103
|
*
|
|
1852
2104
|
* @param {string} topicId
|
|
1853
2105
|
* @param {string[]} queries
|
|
@@ -1873,16 +2125,17 @@ export class Messaging extends Service {
|
|
|
1873
2125
|
}
|
|
1874
2126
|
|
|
1875
2127
|
/**
|
|
1876
|
-
* List subscribers
|
|
2128
|
+
* List subscribers
|
|
1877
2129
|
*
|
|
2130
|
+
* Get a list of all subscribers from the current Appwrite project.
|
|
1878
2131
|
*
|
|
1879
2132
|
* @param {string} topicId
|
|
1880
|
-
* @param {string} queries
|
|
2133
|
+
* @param {string[]} queries
|
|
1881
2134
|
* @param {string} search
|
|
1882
2135
|
* @throws {AppwriteException}
|
|
1883
2136
|
* @returns {Promise}
|
|
1884
2137
|
*/
|
|
1885
|
-
async listSubscribers(topicId: string, queries?: string, search?: string): Promise<Models.SubscriberList> {
|
|
2138
|
+
async listSubscribers(topicId: string, queries?: string[], search?: string): Promise<Models.SubscriberList> {
|
|
1886
2139
|
if (typeof topicId === 'undefined') {
|
|
1887
2140
|
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
1888
2141
|
}
|
|
@@ -1905,8 +2158,9 @@ export class Messaging extends Service {
|
|
|
1905
2158
|
}
|
|
1906
2159
|
|
|
1907
2160
|
/**
|
|
1908
|
-
* Create
|
|
2161
|
+
* Create subscriber
|
|
1909
2162
|
*
|
|
2163
|
+
* Create a new subscriber.
|
|
1910
2164
|
*
|
|
1911
2165
|
* @param {string} topicId
|
|
1912
2166
|
* @param {string} subscriberId
|
|
@@ -1945,8 +2199,10 @@ export class Messaging extends Service {
|
|
|
1945
2199
|
}
|
|
1946
2200
|
|
|
1947
2201
|
/**
|
|
1948
|
-
* Get
|
|
2202
|
+
* Get subscriber
|
|
1949
2203
|
*
|
|
2204
|
+
* Get a subscriber by its unique ID.
|
|
2205
|
+
*
|
|
1950
2206
|
*
|
|
1951
2207
|
* @param {string} topicId
|
|
1952
2208
|
* @param {string} subscriberId
|
|
@@ -1972,8 +2228,9 @@ export class Messaging extends Service {
|
|
|
1972
2228
|
}
|
|
1973
2229
|
|
|
1974
2230
|
/**
|
|
1975
|
-
* Delete
|
|
2231
|
+
* Delete subscriber
|
|
1976
2232
|
*
|
|
2233
|
+
* Delete a subscriber by its unique ID.
|
|
1977
2234
|
*
|
|
1978
2235
|
* @param {string} topicId
|
|
1979
2236
|
* @param {string} subscriberId
|