@appwrite.io/console 0.5.0 → 0.6.0-rc.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/cjs/sdk.js +3770 -355
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +3770 -356
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +3770 -355
- package/docs/examples/account/{update-phone-session.md → add-authenticator.md} +2 -2
- package/docs/examples/account/create-anonymous-session.md +1 -1
- package/docs/examples/account/create-email-password-session.md +18 -0
- package/docs/examples/account/{create-email-session.md → create-email-token.md} +2 -2
- package/docs/examples/account/create-j-w-t.md +1 -1
- package/docs/examples/account/{create-magic-u-r-l-session.md → create-magic-u-r-l-token.md} +2 -2
- package/docs/examples/account/create-o-auth2session.md +2 -2
- package/docs/examples/account/{create-phone-session.md → create-phone-token.md} +2 -2
- package/docs/examples/account/create-phone-verification.md +1 -1
- package/docs/examples/account/create-push-target.md +18 -0
- package/docs/examples/account/create-recovery.md +1 -1
- package/docs/examples/account/create-session.md +18 -0
- package/docs/examples/account/create-verification.md +1 -1
- package/docs/examples/account/create.md +1 -1
- package/docs/examples/account/create2f-a-challenge.md +18 -0
- package/docs/examples/account/delete-authenticator.md +18 -0
- package/docs/examples/account/delete-identity.md +1 -1
- package/docs/examples/account/delete-push-target.md +18 -0
- package/docs/examples/account/delete-session.md +1 -1
- package/docs/examples/account/delete-sessions.md +1 -1
- package/docs/examples/account/delete.md +1 -1
- package/docs/examples/account/get-prefs.md +1 -1
- package/docs/examples/account/get-session.md +1 -1
- package/docs/examples/account/get.md +1 -1
- package/docs/examples/account/list-factors.md +18 -0
- package/docs/examples/account/list-identities.md +1 -1
- package/docs/examples/account/list-logs.md +1 -1
- package/docs/examples/account/list-sessions.md +1 -1
- package/docs/examples/account/update-challenge.md +18 -0
- package/docs/examples/account/update-email.md +1 -1
- package/docs/examples/account/update-m-f-a.md +18 -0
- package/docs/examples/account/update-magic-u-r-l-session.md +1 -1
- package/docs/examples/account/update-name.md +1 -1
- package/docs/examples/account/update-password.md +1 -1
- package/docs/examples/account/update-phone-verification.md +1 -1
- package/docs/examples/account/update-phone.md +1 -1
- package/docs/examples/account/update-prefs.md +1 -1
- package/docs/examples/account/update-push-target.md +18 -0
- package/docs/examples/account/update-recovery.md +2 -2
- package/docs/examples/account/update-session.md +1 -1
- package/docs/examples/account/update-status.md +1 -1
- package/docs/examples/account/update-verification.md +1 -1
- package/docs/examples/account/verify-authenticator.md +18 -0
- package/docs/examples/assistant/chat.md +1 -1
- package/docs/examples/avatars/get-browser.md +2 -2
- package/docs/examples/avatars/get-credit-card.md +2 -2
- package/docs/examples/avatars/get-favicon.md +1 -1
- package/docs/examples/avatars/get-flag.md +2 -2
- package/docs/examples/avatars/get-image.md +1 -1
- package/docs/examples/avatars/get-initials.md +1 -1
- package/docs/examples/avatars/get-q-r.md +1 -1
- package/docs/examples/console/variables.md +1 -1
- package/docs/examples/databases/create-boolean-attribute.md +1 -1
- package/docs/examples/databases/create-collection.md +1 -1
- package/docs/examples/databases/create-datetime-attribute.md +1 -1
- package/docs/examples/databases/create-document.md +1 -1
- package/docs/examples/databases/create-email-attribute.md +1 -1
- package/docs/examples/databases/create-enum-attribute.md +1 -1
- package/docs/examples/databases/create-float-attribute.md +1 -1
- package/docs/examples/databases/create-index.md +2 -2
- package/docs/examples/databases/create-integer-attribute.md +1 -1
- package/docs/examples/databases/create-ip-attribute.md +1 -1
- package/docs/examples/databases/create-relationship-attribute.md +2 -2
- package/docs/examples/databases/create-string-attribute.md +1 -1
- package/docs/examples/databases/create-url-attribute.md +1 -1
- package/docs/examples/databases/create.md +1 -1
- package/docs/examples/databases/delete-attribute.md +1 -1
- package/docs/examples/databases/delete-collection.md +1 -1
- package/docs/examples/databases/delete-document.md +1 -1
- package/docs/examples/databases/delete-index.md +1 -1
- package/docs/examples/databases/delete.md +1 -1
- package/docs/examples/databases/get-attribute.md +1 -1
- package/docs/examples/databases/get-collection-usage.md +1 -1
- package/docs/examples/databases/get-collection.md +1 -1
- package/docs/examples/databases/get-database-usage.md +1 -1
- package/docs/examples/databases/get-document.md +1 -1
- package/docs/examples/databases/get-index.md +1 -1
- package/docs/examples/databases/get-usage.md +1 -1
- package/docs/examples/databases/get.md +1 -1
- package/docs/examples/databases/list-attributes.md +1 -1
- package/docs/examples/databases/list-collection-logs.md +1 -1
- package/docs/examples/databases/list-collections.md +1 -1
- package/docs/examples/databases/list-document-logs.md +1 -1
- package/docs/examples/databases/list-documents.md +1 -1
- package/docs/examples/databases/list-indexes.md +1 -1
- package/docs/examples/databases/list-logs.md +1 -1
- package/docs/examples/databases/list.md +1 -1
- package/docs/examples/databases/update-boolean-attribute.md +1 -1
- package/docs/examples/databases/update-collection.md +1 -1
- package/docs/examples/databases/update-datetime-attribute.md +1 -1
- package/docs/examples/databases/update-document.md +1 -1
- package/docs/examples/databases/update-email-attribute.md +1 -1
- package/docs/examples/databases/update-enum-attribute.md +1 -1
- package/docs/examples/databases/update-float-attribute.md +1 -1
- package/docs/examples/databases/update-integer-attribute.md +1 -1
- package/docs/examples/databases/update-ip-attribute.md +1 -1
- package/docs/examples/databases/update-relationship-attribute.md +1 -1
- package/docs/examples/databases/update-string-attribute.md +1 -1
- package/docs/examples/databases/update-url-attribute.md +1 -1
- package/docs/examples/databases/update.md +1 -1
- package/docs/examples/functions/create-build.md +1 -1
- 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 +1 -1
- package/docs/examples/functions/create.md +2 -2
- package/docs/examples/functions/delete-deployment.md +1 -1
- package/docs/examples/functions/delete-variable.md +1 -1
- package/docs/examples/functions/delete.md +1 -1
- package/docs/examples/functions/download-deployment.md +1 -1
- package/docs/examples/functions/get-deployment.md +1 -1
- package/docs/examples/functions/get-execution.md +1 -1
- package/docs/examples/functions/get-function-usage.md +1 -1
- package/docs/examples/functions/get-usage.md +1 -1
- package/docs/examples/functions/get-variable.md +1 -1
- 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-runtimes.md +1 -1
- package/docs/examples/functions/list-variables.md +1 -1
- package/docs/examples/functions/list.md +1 -1
- package/docs/examples/functions/update-deployment.md +1 -1
- package/docs/examples/functions/update-variable.md +1 -1
- package/docs/examples/functions/update.md +1 -1
- package/docs/examples/graphql/mutation.md +1 -1
- package/docs/examples/graphql/query.md +1 -1
- package/docs/examples/health/get-antivirus.md +1 -1
- package/docs/examples/health/get-cache.md +1 -1
- package/docs/examples/health/get-certificate.md +18 -0
- package/docs/examples/health/get-d-b.md +1 -1
- package/docs/examples/health/get-failed-jobs.md +18 -0
- package/docs/examples/health/get-pub-sub.md +1 -1
- package/docs/examples/health/get-queue-builds.md +1 -1
- package/docs/examples/health/get-queue-certificates.md +1 -1
- package/docs/examples/health/get-queue-databases.md +1 -1
- package/docs/examples/health/get-queue-deletes.md +1 -1
- package/docs/examples/health/get-queue-functions.md +1 -1
- package/docs/examples/health/get-queue-logs.md +1 -1
- package/docs/examples/health/get-queue-mails.md +1 -1
- package/docs/examples/health/get-queue-messaging.md +1 -1
- package/docs/examples/health/get-queue-migrations.md +1 -1
- package/docs/examples/health/get-queue-webhooks.md +1 -1
- package/docs/examples/health/get-queue.md +1 -1
- package/docs/examples/health/get-storage-local.md +1 -1
- package/docs/examples/health/get-time.md +1 -1
- package/docs/examples/health/get.md +1 -1
- package/docs/examples/locale/get.md +1 -1
- package/docs/examples/locale/list-codes.md +1 -1
- package/docs/examples/locale/list-continents.md +1 -1
- package/docs/examples/locale/list-countries-e-u.md +1 -1
- package/docs/examples/locale/list-countries-phones.md +1 -1
- package/docs/examples/locale/list-countries.md +1 -1
- package/docs/examples/locale/list-currencies.md +1 -1
- package/docs/examples/locale/list-languages.md +1 -1
- package/docs/examples/messaging/create-a-p-n-s-provider.md +18 -0
- package/docs/examples/messaging/create-email.md +18 -0
- package/docs/examples/messaging/create-f-c-m-provider.md +18 -0
- package/docs/examples/messaging/create-mailgun-provider.md +18 -0
- package/docs/examples/messaging/create-msg91provider.md +18 -0
- package/docs/examples/messaging/create-push.md +18 -0
- package/docs/examples/messaging/create-s-m-s.md +18 -0
- package/docs/examples/messaging/create-s-m-t-p-provider.md +18 -0
- package/docs/examples/messaging/create-sendgrid-provider.md +18 -0
- package/docs/examples/messaging/create-subscriber.md +18 -0
- package/docs/examples/messaging/create-telesign-provider.md +18 -0
- package/docs/examples/messaging/create-textmagic-provider.md +18 -0
- package/docs/examples/messaging/create-topic.md +18 -0
- package/docs/examples/messaging/create-twilio-provider.md +18 -0
- package/docs/examples/messaging/create-vonage-provider.md +18 -0
- package/docs/examples/messaging/delete-provider.md +18 -0
- package/docs/examples/messaging/delete-subscriber.md +18 -0
- package/docs/examples/messaging/delete-topic.md +18 -0
- package/docs/examples/messaging/delete.md +18 -0
- package/docs/examples/messaging/get-message.md +18 -0
- package/docs/examples/messaging/get-provider.md +18 -0
- package/docs/examples/messaging/get-subscriber.md +18 -0
- package/docs/examples/messaging/get-topic.md +18 -0
- package/docs/examples/messaging/list-message-logs.md +18 -0
- package/docs/examples/messaging/list-messages.md +18 -0
- package/docs/examples/messaging/list-provider-logs.md +18 -0
- package/docs/examples/messaging/list-providers.md +18 -0
- package/docs/examples/messaging/list-subscriber-logs.md +18 -0
- package/docs/examples/messaging/list-subscribers.md +18 -0
- package/docs/examples/messaging/list-targets.md +18 -0
- package/docs/examples/messaging/list-topic-logs.md +18 -0
- package/docs/examples/messaging/list-topics.md +18 -0
- package/docs/examples/messaging/update-a-p-n-s-provider.md +18 -0
- package/docs/examples/messaging/update-email.md +18 -0
- package/docs/examples/messaging/update-f-c-m-provider.md +18 -0
- package/docs/examples/messaging/update-mailgun-provider.md +18 -0
- package/docs/examples/messaging/update-msg91provider.md +18 -0
- package/docs/examples/messaging/update-push.md +18 -0
- package/docs/examples/messaging/update-s-m-s.md +18 -0
- package/docs/examples/messaging/update-s-m-t-p-provider.md +18 -0
- package/docs/examples/messaging/update-sendgrid-provider.md +18 -0
- package/docs/examples/messaging/update-telesign-provider.md +18 -0
- package/docs/examples/messaging/update-textmagic-provider.md +18 -0
- package/docs/examples/messaging/update-topic.md +18 -0
- package/docs/examples/messaging/update-twilio-provider.md +18 -0
- package/docs/examples/messaging/update-vonage-provider.md +18 -0
- package/docs/examples/migrations/create-appwrite-migration.md +1 -1
- 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 +1 -1
- package/docs/examples/migrations/create-supabase-migration.md +1 -1
- package/docs/examples/migrations/delete-firebase-auth.md +1 -1
- package/docs/examples/migrations/delete.md +1 -1
- package/docs/examples/migrations/get-appwrite-report.md +1 -1
- 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 +1 -1
- package/docs/examples/migrations/get-supabase-report.md +1 -1
- package/docs/examples/migrations/get.md +1 -1
- package/docs/examples/migrations/list-firebase-projects.md +1 -1
- package/docs/examples/migrations/list.md +1 -1
- package/docs/examples/migrations/retry.md +1 -1
- package/docs/examples/project/create-variable.md +1 -1
- package/docs/examples/project/delete-variable.md +1 -1
- package/docs/examples/project/get-usage.md +1 -1
- package/docs/examples/project/get-variable.md +1 -1
- package/docs/examples/project/list-variables.md +1 -1
- package/docs/examples/project/update-variable.md +1 -1
- package/docs/examples/projects/create-key.md +1 -1
- package/docs/examples/projects/create-platform.md +2 -2
- package/docs/examples/projects/create-smtp-test.md +18 -0
- package/docs/examples/projects/create-webhook.md +2 -2
- package/docs/examples/projects/create.md +1 -1
- package/docs/examples/projects/delete-email-template.md +2 -2
- package/docs/examples/projects/delete-key.md +1 -1
- package/docs/examples/projects/delete-platform.md +1 -1
- package/docs/examples/projects/delete-sms-template.md +2 -2
- package/docs/examples/projects/delete-webhook.md +1 -1
- package/docs/examples/projects/delete.md +1 -1
- package/docs/examples/projects/get-email-template.md +2 -2
- package/docs/examples/projects/get-key.md +1 -1
- package/docs/examples/projects/get-platform.md +1 -1
- package/docs/examples/projects/get-sms-template.md +2 -2
- package/docs/examples/projects/get-webhook.md +1 -1
- 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/list.md +1 -1
- 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 +2 -2
- package/docs/examples/projects/update-email-template.md +2 -2
- package/docs/examples/projects/update-key.md +1 -1
- package/docs/examples/projects/update-o-auth2.md +2 -2
- package/docs/examples/projects/update-personal-data-check.md +1 -1
- package/docs/examples/projects/update-platform.md +1 -1
- package/docs/examples/projects/update-service-status-all.md +1 -1
- package/docs/examples/projects/update-service-status.md +2 -2
- package/docs/examples/projects/update-sms-template.md +2 -2
- package/docs/examples/projects/{update-smtp-configuration.md → update-smtp.md} +2 -2
- package/docs/examples/projects/update-team.md +1 -1
- package/docs/examples/projects/update-webhook-signature.md +1 -1
- package/docs/examples/projects/update-webhook.md +2 -2
- package/docs/examples/projects/update.md +1 -1
- package/docs/examples/proxy/create-rule.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/list-rules.md +1 -1
- package/docs/examples/proxy/update-rule-verification.md +1 -1
- package/docs/examples/storage/create-bucket.md +1 -1
- package/docs/examples/storage/create-file.md +1 -1
- package/docs/examples/storage/delete-bucket.md +1 -1
- package/docs/examples/storage/delete-file.md +1 -1
- 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 +1 -1
- package/docs/examples/storage/get-file-preview.md +1 -1
- package/docs/examples/storage/get-file-view.md +1 -1
- package/docs/examples/storage/get-file.md +1 -1
- package/docs/examples/storage/get-usage.md +1 -1
- package/docs/examples/storage/list-buckets.md +1 -1
- package/docs/examples/storage/list-files.md +1 -1
- package/docs/examples/storage/update-bucket.md +1 -1
- package/docs/examples/storage/update-file.md +1 -1
- package/docs/examples/teams/create-membership.md +1 -1
- package/docs/examples/teams/create.md +1 -1
- package/docs/examples/teams/delete-membership.md +1 -1
- package/docs/examples/teams/delete.md +1 -1
- package/docs/examples/teams/get-membership.md +1 -1
- 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/list.md +1 -1
- package/docs/examples/teams/update-membership-status.md +1 -1
- package/docs/examples/teams/update-membership.md +1 -1
- package/docs/examples/teams/update-name.md +1 -1
- 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-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 +1 -1
- package/docs/examples/users/create-scrypt-user.md +1 -1
- package/docs/examples/users/create-session.md +18 -0
- package/docs/examples/users/create-target.md +18 -0
- package/docs/examples/users/create-token.md +18 -0
- package/docs/examples/users/create.md +1 -1
- package/docs/examples/users/delete-authenticator.md +18 -0
- package/docs/examples/users/delete-identity.md +1 -1
- package/docs/examples/users/delete-session.md +1 -1
- package/docs/examples/users/delete-sessions.md +1 -1
- package/docs/examples/users/delete-target.md +18 -0
- package/docs/examples/users/delete.md +1 -1
- package/docs/examples/users/get-prefs.md +1 -1
- package/docs/examples/users/get-target.md +18 -0
- package/docs/examples/users/get-usage.md +1 -1
- package/docs/examples/users/get.md +1 -1
- package/docs/examples/users/list-factors.md +18 -0
- package/docs/examples/users/list-identities.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-sessions.md +1 -1
- package/docs/examples/users/list-targets.md +18 -0
- package/docs/examples/users/list.md +1 -1
- 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.md +18 -0
- package/docs/examples/users/update-name.md +1 -1
- 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 +18 -0
- package/docs/examples/vcs/create-repository-detection.md +1 -1
- package/docs/examples/vcs/create-repository.md +1 -1
- 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 +1 -1
- package/docs/examples/vcs/list-installations.md +1 -1
- package/docs/examples/vcs/list-repositories.md +1 -1
- package/docs/examples/vcs/list-repository-branches.md +1 -1
- package/docs/examples/vcs/update-external-deployments.md +1 -1
- package/package.json +1 -1
- package/src/client.ts +2 -2
- package/src/enums/a-p-i-service.ts +13 -0
- package/src/enums/auth-method.ts +9 -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 +6 -0
- package/src/enums/execution-method.ts +8 -0
- package/src/enums/factor.ts +5 -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 +6 -0
- package/src/enums/message-status.ts +5 -0
- package/src/enums/messaging-provider-type.ts +5 -0
- package/src/enums/name.ts +14 -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 +3 -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 +6 -0
- package/src/enums/s-m-s-template-locale.ts +133 -0
- package/src/enums/s-m-s-template-type.ts +5 -0
- package/src/enums/s-m-t-p-encryption.ts +5 -0
- package/src/enums/s-m-t-p-secure.ts +3 -0
- package/src/enums/storage-usage-range.ts +5 -0
- package/src/enums/type.ts +3 -0
- package/src/enums/user-usage-range.ts +5 -0
- package/src/index.ts +36 -1
- package/src/models.ts +417 -7
- package/src/query.ts +61 -34
- package/src/service.ts +7 -7
- package/src/services/account.ts +468 -143
- package/src/services/assistant.ts +1 -0
- package/src/services/avatars.ts +10 -6
- package/src/services/console.ts +1 -0
- package/src/services/databases.ts +18 -13
- package/src/services/functions.ts +14 -10
- package/src/services/graphql.ts +1 -0
- package/src/services/health.ts +54 -0
- package/src/services/locale.ts +1 -0
- package/src/services/messaging.ts +2176 -0
- package/src/services/migrations.ts +3 -2
- package/src/services/project.ts +4 -2
- package/src/services/projects.ts +137 -33
- package/src/services/proxy.ts +4 -2
- package/src/services/storage.ts +16 -11
- package/src/services/teams.ts +1 -0
- package/src/services/users.ts +348 -7
- package/src/services/vcs.ts +1 -0
- package/types/enums/a-p-i-service.d.ts +13 -0
- package/types/enums/auth-method.d.ts +9 -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 +6 -0
- package/types/enums/execution-method.d.ts +8 -0
- package/types/enums/factor.d.ts +5 -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 +6 -0
- package/types/enums/message-status.d.ts +5 -0
- package/types/enums/messaging-provider-type.d.ts +5 -0
- package/types/enums/name.d.ts +14 -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 +3 -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 +6 -0
- package/types/enums/s-m-s-template-locale.d.ts +133 -0
- package/types/enums/s-m-s-template-type.d.ts +5 -0
- package/types/enums/s-m-t-p-encryption.d.ts +5 -0
- package/types/enums/s-m-t-p-secure.d.ts +3 -0
- package/types/enums/storage-usage-range.d.ts +5 -0
- package/types/enums/type.d.ts +3 -0
- package/types/enums/user-usage-range.d.ts +5 -0
- package/types/index.d.ts +35 -0
- package/types/models.d.ts +417 -7
- package/types/query.d.ts +10 -3
- package/types/services/account.d.ts +188 -79
- package/types/services/avatars.d.ts +9 -6
- package/types/services/databases.d.ts +17 -13
- package/types/services/functions.d.ts +13 -10
- package/types/services/health.d.ts +23 -0
- package/types/services/messaging.d.ts +627 -0
- package/types/services/migrations.d.ts +2 -2
- package/types/services/project.d.ts +3 -2
- package/types/services/projects.d.ts +63 -33
- package/types/services/proxy.d.ts +3 -2
- package/types/services/storage.d.ts +15 -11
- package/types/services/users.d.ts +129 -7
|
@@ -0,0 +1,2176 @@
|
|
|
1
|
+
import { Service } from '../service';
|
|
2
|
+
import { AppwriteException, Client } from '../client';
|
|
3
|
+
import type { Models } from '../models';
|
|
4
|
+
import type { UploadProgress, Payload } from '../client';
|
|
5
|
+
import { Query } from '../query';
|
|
6
|
+
import { MessageStatus } from '../enums/message-status';
|
|
7
|
+
import { SMTPEncryption } from '../enums/s-m-t-p-encryption';
|
|
8
|
+
|
|
9
|
+
export class Messaging extends Service {
|
|
10
|
+
|
|
11
|
+
constructor(client: Client)
|
|
12
|
+
{
|
|
13
|
+
super(client);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* List messages
|
|
18
|
+
*
|
|
19
|
+
*
|
|
20
|
+
* @param {string[]} queries
|
|
21
|
+
* @param {string} search
|
|
22
|
+
* @throws {AppwriteException}
|
|
23
|
+
* @returns {Promise}
|
|
24
|
+
*/
|
|
25
|
+
async listMessages(queries?: string[], search?: string): Promise<Models.MessageList> {
|
|
26
|
+
const apiPath = '/messaging/messages';
|
|
27
|
+
const payload: Payload = {};
|
|
28
|
+
|
|
29
|
+
if (typeof queries !== 'undefined') {
|
|
30
|
+
payload['queries'] = queries;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (typeof search !== 'undefined') {
|
|
34
|
+
payload['search'] = search;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
38
|
+
return await this.client.call('get', uri, {
|
|
39
|
+
'content-type': 'application/json',
|
|
40
|
+
}, payload);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Create an email.
|
|
45
|
+
*
|
|
46
|
+
*
|
|
47
|
+
* @param {string} messageId
|
|
48
|
+
* @param {string} subject
|
|
49
|
+
* @param {string} content
|
|
50
|
+
* @param {string[]} topics
|
|
51
|
+
* @param {string[]} users
|
|
52
|
+
* @param {string[]} targets
|
|
53
|
+
* @param {string[]} cc
|
|
54
|
+
* @param {string[]} bcc
|
|
55
|
+
* @param {MessageStatus} status
|
|
56
|
+
* @param {boolean} html
|
|
57
|
+
* @param {string} scheduledAt
|
|
58
|
+
* @throws {AppwriteException}
|
|
59
|
+
* @returns {Promise}
|
|
60
|
+
*/
|
|
61
|
+
async createEmail(messageId: string, subject: string, content: string, topics?: string[], users?: string[], targets?: string[], cc?: string[], bcc?: string[], status?: MessageStatus, html?: boolean, scheduledAt?: string): Promise<Models.Message> {
|
|
62
|
+
if (typeof messageId === 'undefined') {
|
|
63
|
+
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (typeof subject === 'undefined') {
|
|
67
|
+
throw new AppwriteException('Missing required parameter: "subject"');
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (typeof content === 'undefined') {
|
|
71
|
+
throw new AppwriteException('Missing required parameter: "content"');
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const apiPath = '/messaging/messages/email';
|
|
75
|
+
const payload: Payload = {};
|
|
76
|
+
|
|
77
|
+
if (typeof messageId !== 'undefined') {
|
|
78
|
+
payload['messageId'] = messageId;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (typeof subject !== 'undefined') {
|
|
82
|
+
payload['subject'] = subject;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (typeof content !== 'undefined') {
|
|
86
|
+
payload['content'] = content;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (typeof topics !== 'undefined') {
|
|
90
|
+
payload['topics'] = topics;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (typeof users !== 'undefined') {
|
|
94
|
+
payload['users'] = users;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (typeof targets !== 'undefined') {
|
|
98
|
+
payload['targets'] = targets;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (typeof cc !== 'undefined') {
|
|
102
|
+
payload['cc'] = cc;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (typeof bcc !== 'undefined') {
|
|
106
|
+
payload['bcc'] = bcc;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (typeof status !== 'undefined') {
|
|
110
|
+
payload['status'] = status;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (typeof html !== 'undefined') {
|
|
114
|
+
payload['html'] = html;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if (typeof scheduledAt !== 'undefined') {
|
|
118
|
+
payload['scheduledAt'] = scheduledAt;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
122
|
+
return await this.client.call('post', uri, {
|
|
123
|
+
'content-type': 'application/json',
|
|
124
|
+
}, payload);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Update an email.
|
|
129
|
+
*
|
|
130
|
+
*
|
|
131
|
+
* @param {string} messageId
|
|
132
|
+
* @param {string[]} topics
|
|
133
|
+
* @param {string[]} users
|
|
134
|
+
* @param {string[]} targets
|
|
135
|
+
* @param {string} subject
|
|
136
|
+
* @param {string} content
|
|
137
|
+
* @param {MessageStatus} status
|
|
138
|
+
* @param {boolean} html
|
|
139
|
+
* @param {string[]} cc
|
|
140
|
+
* @param {string[]} bcc
|
|
141
|
+
* @param {string} scheduledAt
|
|
142
|
+
* @throws {AppwriteException}
|
|
143
|
+
* @returns {Promise}
|
|
144
|
+
*/
|
|
145
|
+
async updateEmail(messageId: string, topics?: string[], users?: string[], targets?: string[], subject?: string, content?: string, status?: MessageStatus, html?: boolean, cc?: string[], bcc?: string[], scheduledAt?: string): Promise<Models.Message> {
|
|
146
|
+
if (typeof messageId === 'undefined') {
|
|
147
|
+
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
const apiPath = '/messaging/messages/email/{messageId}'.replace('{messageId}', messageId);
|
|
151
|
+
const payload: Payload = {};
|
|
152
|
+
|
|
153
|
+
if (typeof topics !== 'undefined') {
|
|
154
|
+
payload['topics'] = topics;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
if (typeof users !== 'undefined') {
|
|
158
|
+
payload['users'] = users;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
if (typeof targets !== 'undefined') {
|
|
162
|
+
payload['targets'] = targets;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
if (typeof subject !== 'undefined') {
|
|
166
|
+
payload['subject'] = subject;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
if (typeof content !== 'undefined') {
|
|
170
|
+
payload['content'] = content;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
if (typeof status !== 'undefined') {
|
|
174
|
+
payload['status'] = status;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
if (typeof html !== 'undefined') {
|
|
178
|
+
payload['html'] = html;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
if (typeof cc !== 'undefined') {
|
|
182
|
+
payload['cc'] = cc;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
if (typeof bcc !== 'undefined') {
|
|
186
|
+
payload['bcc'] = bcc;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
if (typeof scheduledAt !== 'undefined') {
|
|
190
|
+
payload['scheduledAt'] = scheduledAt;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
194
|
+
return await this.client.call('patch', uri, {
|
|
195
|
+
'content-type': 'application/json',
|
|
196
|
+
}, payload);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Create a push notification.
|
|
201
|
+
*
|
|
202
|
+
*
|
|
203
|
+
* @param {string} messageId
|
|
204
|
+
* @param {string} title
|
|
205
|
+
* @param {string} body
|
|
206
|
+
* @param {string[]} topics
|
|
207
|
+
* @param {string[]} users
|
|
208
|
+
* @param {string[]} targets
|
|
209
|
+
* @param {object} data
|
|
210
|
+
* @param {string} action
|
|
211
|
+
* @param {string} icon
|
|
212
|
+
* @param {string} sound
|
|
213
|
+
* @param {string} color
|
|
214
|
+
* @param {string} tag
|
|
215
|
+
* @param {string} badge
|
|
216
|
+
* @param {MessageStatus} status
|
|
217
|
+
* @param {string} scheduledAt
|
|
218
|
+
* @throws {AppwriteException}
|
|
219
|
+
* @returns {Promise}
|
|
220
|
+
*/
|
|
221
|
+
async createPush(messageId: string, title: string, body: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: string, status?: MessageStatus, scheduledAt?: string): Promise<Models.Message> {
|
|
222
|
+
if (typeof messageId === 'undefined') {
|
|
223
|
+
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
if (typeof title === 'undefined') {
|
|
227
|
+
throw new AppwriteException('Missing required parameter: "title"');
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
if (typeof body === 'undefined') {
|
|
231
|
+
throw new AppwriteException('Missing required parameter: "body"');
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
const apiPath = '/messaging/messages/push';
|
|
235
|
+
const payload: Payload = {};
|
|
236
|
+
|
|
237
|
+
if (typeof messageId !== 'undefined') {
|
|
238
|
+
payload['messageId'] = messageId;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
if (typeof title !== 'undefined') {
|
|
242
|
+
payload['title'] = title;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
if (typeof body !== 'undefined') {
|
|
246
|
+
payload['body'] = body;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
if (typeof topics !== 'undefined') {
|
|
250
|
+
payload['topics'] = topics;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
if (typeof users !== 'undefined') {
|
|
254
|
+
payload['users'] = users;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
if (typeof targets !== 'undefined') {
|
|
258
|
+
payload['targets'] = targets;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
if (typeof data !== 'undefined') {
|
|
262
|
+
payload['data'] = data;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
if (typeof action !== 'undefined') {
|
|
266
|
+
payload['action'] = action;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
if (typeof icon !== 'undefined') {
|
|
270
|
+
payload['icon'] = icon;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
if (typeof sound !== 'undefined') {
|
|
274
|
+
payload['sound'] = sound;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
if (typeof color !== 'undefined') {
|
|
278
|
+
payload['color'] = color;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
if (typeof tag !== 'undefined') {
|
|
282
|
+
payload['tag'] = tag;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
if (typeof badge !== 'undefined') {
|
|
286
|
+
payload['badge'] = badge;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
if (typeof status !== 'undefined') {
|
|
290
|
+
payload['status'] = status;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
if (typeof scheduledAt !== 'undefined') {
|
|
294
|
+
payload['scheduledAt'] = scheduledAt;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
298
|
+
return await this.client.call('post', uri, {
|
|
299
|
+
'content-type': 'application/json',
|
|
300
|
+
}, payload);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Update a push notification.
|
|
305
|
+
*
|
|
306
|
+
*
|
|
307
|
+
* @param {string} messageId
|
|
308
|
+
* @param {string[]} topics
|
|
309
|
+
* @param {string[]} users
|
|
310
|
+
* @param {string[]} targets
|
|
311
|
+
* @param {string} title
|
|
312
|
+
* @param {string} body
|
|
313
|
+
* @param {object} data
|
|
314
|
+
* @param {string} action
|
|
315
|
+
* @param {string} icon
|
|
316
|
+
* @param {string} sound
|
|
317
|
+
* @param {string} color
|
|
318
|
+
* @param {string} tag
|
|
319
|
+
* @param {number} badge
|
|
320
|
+
* @param {MessageStatus} status
|
|
321
|
+
* @param {string} scheduledAt
|
|
322
|
+
* @throws {AppwriteException}
|
|
323
|
+
* @returns {Promise}
|
|
324
|
+
*/
|
|
325
|
+
async updatePush(messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, status?: MessageStatus, scheduledAt?: string): Promise<Models.Message> {
|
|
326
|
+
if (typeof messageId === 'undefined') {
|
|
327
|
+
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
const apiPath = '/messaging/messages/push/{messageId}'.replace('{messageId}', messageId);
|
|
331
|
+
const payload: Payload = {};
|
|
332
|
+
|
|
333
|
+
if (typeof topics !== 'undefined') {
|
|
334
|
+
payload['topics'] = topics;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
if (typeof users !== 'undefined') {
|
|
338
|
+
payload['users'] = users;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
if (typeof targets !== 'undefined') {
|
|
342
|
+
payload['targets'] = targets;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
if (typeof title !== 'undefined') {
|
|
346
|
+
payload['title'] = title;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
if (typeof body !== 'undefined') {
|
|
350
|
+
payload['body'] = body;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
if (typeof data !== 'undefined') {
|
|
354
|
+
payload['data'] = data;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
if (typeof action !== 'undefined') {
|
|
358
|
+
payload['action'] = action;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
if (typeof icon !== 'undefined') {
|
|
362
|
+
payload['icon'] = icon;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
if (typeof sound !== 'undefined') {
|
|
366
|
+
payload['sound'] = sound;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
if (typeof color !== 'undefined') {
|
|
370
|
+
payload['color'] = color;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
if (typeof tag !== 'undefined') {
|
|
374
|
+
payload['tag'] = tag;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
if (typeof badge !== 'undefined') {
|
|
378
|
+
payload['badge'] = badge;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
if (typeof status !== 'undefined') {
|
|
382
|
+
payload['status'] = status;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
if (typeof scheduledAt !== 'undefined') {
|
|
386
|
+
payload['scheduledAt'] = scheduledAt;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
390
|
+
return await this.client.call('patch', uri, {
|
|
391
|
+
'content-type': 'application/json',
|
|
392
|
+
}, payload);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Create an SMS.
|
|
397
|
+
*
|
|
398
|
+
*
|
|
399
|
+
* @param {string} messageId
|
|
400
|
+
* @param {string} content
|
|
401
|
+
* @param {string[]} topics
|
|
402
|
+
* @param {string[]} users
|
|
403
|
+
* @param {string[]} targets
|
|
404
|
+
* @param {MessageStatus} status
|
|
405
|
+
* @param {string} scheduledAt
|
|
406
|
+
* @throws {AppwriteException}
|
|
407
|
+
* @returns {Promise}
|
|
408
|
+
*/
|
|
409
|
+
async createSMS(messageId: string, content: string, topics?: string[], users?: string[], targets?: string[], status?: MessageStatus, scheduledAt?: string): Promise<Models.Message> {
|
|
410
|
+
if (typeof messageId === 'undefined') {
|
|
411
|
+
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
if (typeof content === 'undefined') {
|
|
415
|
+
throw new AppwriteException('Missing required parameter: "content"');
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
const apiPath = '/messaging/messages/sms';
|
|
419
|
+
const payload: Payload = {};
|
|
420
|
+
|
|
421
|
+
if (typeof messageId !== 'undefined') {
|
|
422
|
+
payload['messageId'] = messageId;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
if (typeof content !== 'undefined') {
|
|
426
|
+
payload['content'] = content;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
if (typeof topics !== 'undefined') {
|
|
430
|
+
payload['topics'] = topics;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
if (typeof users !== 'undefined') {
|
|
434
|
+
payload['users'] = users;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
if (typeof targets !== 'undefined') {
|
|
438
|
+
payload['targets'] = targets;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
if (typeof status !== 'undefined') {
|
|
442
|
+
payload['status'] = status;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
if (typeof scheduledAt !== 'undefined') {
|
|
446
|
+
payload['scheduledAt'] = scheduledAt;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
450
|
+
return await this.client.call('post', uri, {
|
|
451
|
+
'content-type': 'application/json',
|
|
452
|
+
}, payload);
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* Update an SMS.
|
|
457
|
+
*
|
|
458
|
+
*
|
|
459
|
+
* @param {string} messageId
|
|
460
|
+
* @param {string[]} topics
|
|
461
|
+
* @param {string[]} users
|
|
462
|
+
* @param {string[]} targets
|
|
463
|
+
* @param {string} content
|
|
464
|
+
* @param {MessageStatus} status
|
|
465
|
+
* @param {string} scheduledAt
|
|
466
|
+
* @throws {AppwriteException}
|
|
467
|
+
* @returns {Promise}
|
|
468
|
+
*/
|
|
469
|
+
async updateSMS(messageId: string, topics?: string[], users?: string[], targets?: string[], content?: string, status?: MessageStatus, scheduledAt?: string): Promise<Models.Message> {
|
|
470
|
+
if (typeof messageId === 'undefined') {
|
|
471
|
+
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
const apiPath = '/messaging/messages/sms/{messageId}'.replace('{messageId}', messageId);
|
|
475
|
+
const payload: Payload = {};
|
|
476
|
+
|
|
477
|
+
if (typeof topics !== 'undefined') {
|
|
478
|
+
payload['topics'] = topics;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
if (typeof users !== 'undefined') {
|
|
482
|
+
payload['users'] = users;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
if (typeof targets !== 'undefined') {
|
|
486
|
+
payload['targets'] = targets;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
if (typeof content !== 'undefined') {
|
|
490
|
+
payload['content'] = content;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
if (typeof status !== 'undefined') {
|
|
494
|
+
payload['status'] = status;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
if (typeof scheduledAt !== 'undefined') {
|
|
498
|
+
payload['scheduledAt'] = scheduledAt;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
502
|
+
return await this.client.call('patch', uri, {
|
|
503
|
+
'content-type': 'application/json',
|
|
504
|
+
}, payload);
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* Get a message
|
|
509
|
+
*
|
|
510
|
+
*
|
|
511
|
+
* @param {string} messageId
|
|
512
|
+
* @throws {AppwriteException}
|
|
513
|
+
* @returns {Promise}
|
|
514
|
+
*/
|
|
515
|
+
async getMessage(messageId: string): Promise<Models.Message> {
|
|
516
|
+
if (typeof messageId === 'undefined') {
|
|
517
|
+
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
const apiPath = '/messaging/messages/{messageId}'.replace('{messageId}', messageId);
|
|
521
|
+
const payload: Payload = {};
|
|
522
|
+
|
|
523
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
524
|
+
return await this.client.call('get', uri, {
|
|
525
|
+
'content-type': 'application/json',
|
|
526
|
+
}, payload);
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* Delete a message
|
|
531
|
+
*
|
|
532
|
+
*
|
|
533
|
+
* @param {string} messageId
|
|
534
|
+
* @throws {AppwriteException}
|
|
535
|
+
* @returns {Promise}
|
|
536
|
+
*/
|
|
537
|
+
async delete(messageId: string): Promise<{}> {
|
|
538
|
+
if (typeof messageId === 'undefined') {
|
|
539
|
+
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
const apiPath = '/messaging/messages/{messageId}'.replace('{messageId}', messageId);
|
|
543
|
+
const payload: Payload = {};
|
|
544
|
+
|
|
545
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
546
|
+
return await this.client.call('delete', uri, {
|
|
547
|
+
'content-type': 'application/json',
|
|
548
|
+
}, payload);
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
/**
|
|
552
|
+
* List message logs
|
|
553
|
+
*
|
|
554
|
+
*
|
|
555
|
+
* @param {string} messageId
|
|
556
|
+
* @param {string[]} queries
|
|
557
|
+
* @throws {AppwriteException}
|
|
558
|
+
* @returns {Promise}
|
|
559
|
+
*/
|
|
560
|
+
async listMessageLogs(messageId: string, queries?: string[]): Promise<Models.LogList> {
|
|
561
|
+
if (typeof messageId === 'undefined') {
|
|
562
|
+
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
const apiPath = '/messaging/messages/{messageId}/logs'.replace('{messageId}', messageId);
|
|
566
|
+
const payload: Payload = {};
|
|
567
|
+
|
|
568
|
+
if (typeof queries !== 'undefined') {
|
|
569
|
+
payload['queries'] = queries;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
573
|
+
return await this.client.call('get', uri, {
|
|
574
|
+
'content-type': 'application/json',
|
|
575
|
+
}, payload);
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
/**
|
|
579
|
+
* List message targets
|
|
580
|
+
*
|
|
581
|
+
* List the targets associated with a message as set via the targets
|
|
582
|
+
* attribute.
|
|
583
|
+
*
|
|
584
|
+
* @param {string} messageId
|
|
585
|
+
* @param {string[]} queries
|
|
586
|
+
* @throws {AppwriteException}
|
|
587
|
+
* @returns {Promise}
|
|
588
|
+
*/
|
|
589
|
+
async listTargets(messageId: string, queries?: string[]): Promise<Models.TargetList> {
|
|
590
|
+
if (typeof messageId === 'undefined') {
|
|
591
|
+
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
const apiPath = '/messaging/messages/{messageId}/targets'.replace('{messageId}', messageId);
|
|
595
|
+
const payload: Payload = {};
|
|
596
|
+
|
|
597
|
+
if (typeof queries !== 'undefined') {
|
|
598
|
+
payload['queries'] = queries;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
602
|
+
return await this.client.call('get', uri, {
|
|
603
|
+
'content-type': 'application/json',
|
|
604
|
+
}, payload);
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
/**
|
|
608
|
+
* List providers
|
|
609
|
+
*
|
|
610
|
+
*
|
|
611
|
+
* @param {string[]} queries
|
|
612
|
+
* @param {string} search
|
|
613
|
+
* @throws {AppwriteException}
|
|
614
|
+
* @returns {Promise}
|
|
615
|
+
*/
|
|
616
|
+
async listProviders(queries?: string[], search?: string): Promise<Models.ProviderList> {
|
|
617
|
+
const apiPath = '/messaging/providers';
|
|
618
|
+
const payload: Payload = {};
|
|
619
|
+
|
|
620
|
+
if (typeof queries !== 'undefined') {
|
|
621
|
+
payload['queries'] = queries;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
if (typeof search !== 'undefined') {
|
|
625
|
+
payload['search'] = search;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
629
|
+
return await this.client.call('get', uri, {
|
|
630
|
+
'content-type': 'application/json',
|
|
631
|
+
}, payload);
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
/**
|
|
635
|
+
* Create APNS provider
|
|
636
|
+
*
|
|
637
|
+
*
|
|
638
|
+
* @param {string} providerId
|
|
639
|
+
* @param {string} name
|
|
640
|
+
* @param {string} authKey
|
|
641
|
+
* @param {string} authKeyId
|
|
642
|
+
* @param {string} teamId
|
|
643
|
+
* @param {string} bundleId
|
|
644
|
+
* @param {boolean} enabled
|
|
645
|
+
* @throws {AppwriteException}
|
|
646
|
+
* @returns {Promise}
|
|
647
|
+
*/
|
|
648
|
+
async createAPNSProvider(providerId: string, name: string, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, enabled?: boolean): Promise<Models.Provider> {
|
|
649
|
+
if (typeof providerId === 'undefined') {
|
|
650
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
if (typeof name === 'undefined') {
|
|
654
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
const apiPath = '/messaging/providers/apns';
|
|
658
|
+
const payload: Payload = {};
|
|
659
|
+
|
|
660
|
+
if (typeof providerId !== 'undefined') {
|
|
661
|
+
payload['providerId'] = providerId;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
if (typeof name !== 'undefined') {
|
|
665
|
+
payload['name'] = name;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
if (typeof authKey !== 'undefined') {
|
|
669
|
+
payload['authKey'] = authKey;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
if (typeof authKeyId !== 'undefined') {
|
|
673
|
+
payload['authKeyId'] = authKeyId;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
if (typeof teamId !== 'undefined') {
|
|
677
|
+
payload['teamId'] = teamId;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
if (typeof bundleId !== 'undefined') {
|
|
681
|
+
payload['bundleId'] = bundleId;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
if (typeof enabled !== 'undefined') {
|
|
685
|
+
payload['enabled'] = enabled;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
689
|
+
return await this.client.call('post', uri, {
|
|
690
|
+
'content-type': 'application/json',
|
|
691
|
+
}, payload);
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
/**
|
|
695
|
+
* Update APNS provider
|
|
696
|
+
*
|
|
697
|
+
*
|
|
698
|
+
* @param {string} providerId
|
|
699
|
+
* @param {string} name
|
|
700
|
+
* @param {boolean} enabled
|
|
701
|
+
* @param {string} authKey
|
|
702
|
+
* @param {string} authKeyId
|
|
703
|
+
* @param {string} teamId
|
|
704
|
+
* @param {string} bundleId
|
|
705
|
+
* @throws {AppwriteException}
|
|
706
|
+
* @returns {Promise}
|
|
707
|
+
*/
|
|
708
|
+
async updateAPNSProvider(providerId: string, name?: string, enabled?: boolean, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string): Promise<Models.Provider> {
|
|
709
|
+
if (typeof providerId === 'undefined') {
|
|
710
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
const apiPath = '/messaging/providers/apns/{providerId}'.replace('{providerId}', providerId);
|
|
714
|
+
const payload: Payload = {};
|
|
715
|
+
|
|
716
|
+
if (typeof name !== 'undefined') {
|
|
717
|
+
payload['name'] = name;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
if (typeof enabled !== 'undefined') {
|
|
721
|
+
payload['enabled'] = enabled;
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
if (typeof authKey !== 'undefined') {
|
|
725
|
+
payload['authKey'] = authKey;
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
if (typeof authKeyId !== 'undefined') {
|
|
729
|
+
payload['authKeyId'] = authKeyId;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
if (typeof teamId !== 'undefined') {
|
|
733
|
+
payload['teamId'] = teamId;
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
if (typeof bundleId !== 'undefined') {
|
|
737
|
+
payload['bundleId'] = bundleId;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
741
|
+
return await this.client.call('patch', uri, {
|
|
742
|
+
'content-type': 'application/json',
|
|
743
|
+
}, payload);
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
/**
|
|
747
|
+
* Create FCM provider
|
|
748
|
+
*
|
|
749
|
+
*
|
|
750
|
+
* @param {string} providerId
|
|
751
|
+
* @param {string} name
|
|
752
|
+
* @param {object} serviceAccountJSON
|
|
753
|
+
* @param {boolean} enabled
|
|
754
|
+
* @throws {AppwriteException}
|
|
755
|
+
* @returns {Promise}
|
|
756
|
+
*/
|
|
757
|
+
async createFCMProvider(providerId: string, name: string, serviceAccountJSON?: object, enabled?: boolean): Promise<Models.Provider> {
|
|
758
|
+
if (typeof providerId === 'undefined') {
|
|
759
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
if (typeof name === 'undefined') {
|
|
763
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
const apiPath = '/messaging/providers/fcm';
|
|
767
|
+
const payload: Payload = {};
|
|
768
|
+
|
|
769
|
+
if (typeof providerId !== 'undefined') {
|
|
770
|
+
payload['providerId'] = providerId;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
if (typeof name !== 'undefined') {
|
|
774
|
+
payload['name'] = name;
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
if (typeof serviceAccountJSON !== 'undefined') {
|
|
778
|
+
payload['serviceAccountJSON'] = serviceAccountJSON;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
if (typeof enabled !== 'undefined') {
|
|
782
|
+
payload['enabled'] = enabled;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
786
|
+
return await this.client.call('post', uri, {
|
|
787
|
+
'content-type': 'application/json',
|
|
788
|
+
}, payload);
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
/**
|
|
792
|
+
* Update FCM provider
|
|
793
|
+
*
|
|
794
|
+
*
|
|
795
|
+
* @param {string} providerId
|
|
796
|
+
* @param {string} name
|
|
797
|
+
* @param {boolean} enabled
|
|
798
|
+
* @param {object} serviceAccountJSON
|
|
799
|
+
* @throws {AppwriteException}
|
|
800
|
+
* @returns {Promise}
|
|
801
|
+
*/
|
|
802
|
+
async updateFCMProvider(providerId: string, name?: string, enabled?: boolean, serviceAccountJSON?: object): Promise<Models.Provider> {
|
|
803
|
+
if (typeof providerId === 'undefined') {
|
|
804
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
const apiPath = '/messaging/providers/fcm/{providerId}'.replace('{providerId}', providerId);
|
|
808
|
+
const payload: Payload = {};
|
|
809
|
+
|
|
810
|
+
if (typeof name !== 'undefined') {
|
|
811
|
+
payload['name'] = name;
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
if (typeof enabled !== 'undefined') {
|
|
815
|
+
payload['enabled'] = enabled;
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
if (typeof serviceAccountJSON !== 'undefined') {
|
|
819
|
+
payload['serviceAccountJSON'] = serviceAccountJSON;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
823
|
+
return await this.client.call('patch', uri, {
|
|
824
|
+
'content-type': 'application/json',
|
|
825
|
+
}, payload);
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
/**
|
|
829
|
+
* Create Mailgun provider
|
|
830
|
+
*
|
|
831
|
+
*
|
|
832
|
+
* @param {string} providerId
|
|
833
|
+
* @param {string} name
|
|
834
|
+
* @param {string} apiKey
|
|
835
|
+
* @param {string} domain
|
|
836
|
+
* @param {boolean} isEuRegion
|
|
837
|
+
* @param {string} fromName
|
|
838
|
+
* @param {string} fromEmail
|
|
839
|
+
* @param {string} replyToName
|
|
840
|
+
* @param {string} replyToEmail
|
|
841
|
+
* @param {boolean} enabled
|
|
842
|
+
* @throws {AppwriteException}
|
|
843
|
+
* @returns {Promise}
|
|
844
|
+
*/
|
|
845
|
+
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> {
|
|
846
|
+
if (typeof providerId === 'undefined') {
|
|
847
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
if (typeof name === 'undefined') {
|
|
851
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
const apiPath = '/messaging/providers/mailgun';
|
|
855
|
+
const payload: Payload = {};
|
|
856
|
+
|
|
857
|
+
if (typeof providerId !== 'undefined') {
|
|
858
|
+
payload['providerId'] = providerId;
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
if (typeof name !== 'undefined') {
|
|
862
|
+
payload['name'] = name;
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
if (typeof apiKey !== 'undefined') {
|
|
866
|
+
payload['apiKey'] = apiKey;
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
if (typeof domain !== 'undefined') {
|
|
870
|
+
payload['domain'] = domain;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
if (typeof isEuRegion !== 'undefined') {
|
|
874
|
+
payload['isEuRegion'] = isEuRegion;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
if (typeof fromName !== 'undefined') {
|
|
878
|
+
payload['fromName'] = fromName;
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
if (typeof fromEmail !== 'undefined') {
|
|
882
|
+
payload['fromEmail'] = fromEmail;
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
if (typeof replyToName !== 'undefined') {
|
|
886
|
+
payload['replyToName'] = replyToName;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
if (typeof replyToEmail !== 'undefined') {
|
|
890
|
+
payload['replyToEmail'] = replyToEmail;
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
if (typeof enabled !== 'undefined') {
|
|
894
|
+
payload['enabled'] = enabled;
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
898
|
+
return await this.client.call('post', uri, {
|
|
899
|
+
'content-type': 'application/json',
|
|
900
|
+
}, payload);
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
/**
|
|
904
|
+
* Update Mailgun provider
|
|
905
|
+
*
|
|
906
|
+
*
|
|
907
|
+
* @param {string} providerId
|
|
908
|
+
* @param {string} name
|
|
909
|
+
* @param {string} apiKey
|
|
910
|
+
* @param {string} domain
|
|
911
|
+
* @param {boolean} isEuRegion
|
|
912
|
+
* @param {boolean} enabled
|
|
913
|
+
* @param {string} fromName
|
|
914
|
+
* @param {string} fromEmail
|
|
915
|
+
* @param {string} replyToName
|
|
916
|
+
* @param {string} replyToEmail
|
|
917
|
+
* @throws {AppwriteException}
|
|
918
|
+
* @returns {Promise}
|
|
919
|
+
*/
|
|
920
|
+
async updateMailgunProvider(providerId: string, name?: string, apiKey?: string, domain?: string, isEuRegion?: boolean, enabled?: boolean, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string): Promise<Models.Provider> {
|
|
921
|
+
if (typeof providerId === 'undefined') {
|
|
922
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
const apiPath = '/messaging/providers/mailgun/{providerId}'.replace('{providerId}', providerId);
|
|
926
|
+
const payload: Payload = {};
|
|
927
|
+
|
|
928
|
+
if (typeof name !== 'undefined') {
|
|
929
|
+
payload['name'] = name;
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
if (typeof apiKey !== 'undefined') {
|
|
933
|
+
payload['apiKey'] = apiKey;
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
if (typeof domain !== 'undefined') {
|
|
937
|
+
payload['domain'] = domain;
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
if (typeof isEuRegion !== 'undefined') {
|
|
941
|
+
payload['isEuRegion'] = isEuRegion;
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
if (typeof enabled !== 'undefined') {
|
|
945
|
+
payload['enabled'] = enabled;
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
if (typeof fromName !== 'undefined') {
|
|
949
|
+
payload['fromName'] = fromName;
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
if (typeof fromEmail !== 'undefined') {
|
|
953
|
+
payload['fromEmail'] = fromEmail;
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
if (typeof replyToName !== 'undefined') {
|
|
957
|
+
payload['replyToName'] = replyToName;
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
if (typeof replyToEmail !== 'undefined') {
|
|
961
|
+
payload['replyToEmail'] = replyToEmail;
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
965
|
+
return await this.client.call('patch', uri, {
|
|
966
|
+
'content-type': 'application/json',
|
|
967
|
+
}, payload);
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
/**
|
|
971
|
+
* Create Msg91 provider
|
|
972
|
+
*
|
|
973
|
+
*
|
|
974
|
+
* @param {string} providerId
|
|
975
|
+
* @param {string} name
|
|
976
|
+
* @param {string} from
|
|
977
|
+
* @param {string} senderId
|
|
978
|
+
* @param {string} authKey
|
|
979
|
+
* @param {boolean} enabled
|
|
980
|
+
* @throws {AppwriteException}
|
|
981
|
+
* @returns {Promise}
|
|
982
|
+
*/
|
|
983
|
+
async createMsg91Provider(providerId: string, name: string, from?: string, senderId?: string, authKey?: string, enabled?: boolean): Promise<Models.Provider> {
|
|
984
|
+
if (typeof providerId === 'undefined') {
|
|
985
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
if (typeof name === 'undefined') {
|
|
989
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
const apiPath = '/messaging/providers/msg91';
|
|
993
|
+
const payload: Payload = {};
|
|
994
|
+
|
|
995
|
+
if (typeof providerId !== 'undefined') {
|
|
996
|
+
payload['providerId'] = providerId;
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
if (typeof name !== 'undefined') {
|
|
1000
|
+
payload['name'] = name;
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
if (typeof from !== 'undefined') {
|
|
1004
|
+
payload['from'] = from;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
if (typeof senderId !== 'undefined') {
|
|
1008
|
+
payload['senderId'] = senderId;
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
if (typeof authKey !== 'undefined') {
|
|
1012
|
+
payload['authKey'] = authKey;
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
if (typeof enabled !== 'undefined') {
|
|
1016
|
+
payload['enabled'] = enabled;
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1020
|
+
return await this.client.call('post', uri, {
|
|
1021
|
+
'content-type': 'application/json',
|
|
1022
|
+
}, payload);
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
/**
|
|
1026
|
+
* Update Msg91 provider
|
|
1027
|
+
*
|
|
1028
|
+
*
|
|
1029
|
+
* @param {string} providerId
|
|
1030
|
+
* @param {string} name
|
|
1031
|
+
* @param {boolean} enabled
|
|
1032
|
+
* @param {string} senderId
|
|
1033
|
+
* @param {string} authKey
|
|
1034
|
+
* @param {string} from
|
|
1035
|
+
* @throws {AppwriteException}
|
|
1036
|
+
* @returns {Promise}
|
|
1037
|
+
*/
|
|
1038
|
+
async updateMsg91Provider(providerId: string, name?: string, enabled?: boolean, senderId?: string, authKey?: string, from?: string): Promise<Models.Provider> {
|
|
1039
|
+
if (typeof providerId === 'undefined') {
|
|
1040
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
const apiPath = '/messaging/providers/msg91/{providerId}'.replace('{providerId}', providerId);
|
|
1044
|
+
const payload: Payload = {};
|
|
1045
|
+
|
|
1046
|
+
if (typeof name !== 'undefined') {
|
|
1047
|
+
payload['name'] = name;
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
if (typeof enabled !== 'undefined') {
|
|
1051
|
+
payload['enabled'] = enabled;
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
if (typeof senderId !== 'undefined') {
|
|
1055
|
+
payload['senderId'] = senderId;
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
if (typeof authKey !== 'undefined') {
|
|
1059
|
+
payload['authKey'] = authKey;
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
if (typeof from !== 'undefined') {
|
|
1063
|
+
payload['from'] = from;
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1067
|
+
return await this.client.call('patch', uri, {
|
|
1068
|
+
'content-type': 'application/json',
|
|
1069
|
+
}, payload);
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
/**
|
|
1073
|
+
* Create Sendgrid provider
|
|
1074
|
+
*
|
|
1075
|
+
*
|
|
1076
|
+
* @param {string} providerId
|
|
1077
|
+
* @param {string} name
|
|
1078
|
+
* @param {string} apiKey
|
|
1079
|
+
* @param {string} fromName
|
|
1080
|
+
* @param {string} fromEmail
|
|
1081
|
+
* @param {string} replyToName
|
|
1082
|
+
* @param {string} replyToEmail
|
|
1083
|
+
* @param {boolean} enabled
|
|
1084
|
+
* @throws {AppwriteException}
|
|
1085
|
+
* @returns {Promise}
|
|
1086
|
+
*/
|
|
1087
|
+
async createSendgridProvider(providerId: string, name: string, apiKey?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise<Models.Provider> {
|
|
1088
|
+
if (typeof providerId === 'undefined') {
|
|
1089
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
if (typeof name === 'undefined') {
|
|
1093
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
const apiPath = '/messaging/providers/sendgrid';
|
|
1097
|
+
const payload: Payload = {};
|
|
1098
|
+
|
|
1099
|
+
if (typeof providerId !== 'undefined') {
|
|
1100
|
+
payload['providerId'] = providerId;
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
if (typeof name !== 'undefined') {
|
|
1104
|
+
payload['name'] = name;
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
if (typeof apiKey !== 'undefined') {
|
|
1108
|
+
payload['apiKey'] = apiKey;
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
if (typeof fromName !== 'undefined') {
|
|
1112
|
+
payload['fromName'] = fromName;
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
if (typeof fromEmail !== 'undefined') {
|
|
1116
|
+
payload['fromEmail'] = fromEmail;
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
if (typeof replyToName !== 'undefined') {
|
|
1120
|
+
payload['replyToName'] = replyToName;
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
if (typeof replyToEmail !== 'undefined') {
|
|
1124
|
+
payload['replyToEmail'] = replyToEmail;
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
if (typeof enabled !== 'undefined') {
|
|
1128
|
+
payload['enabled'] = enabled;
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1132
|
+
return await this.client.call('post', uri, {
|
|
1133
|
+
'content-type': 'application/json',
|
|
1134
|
+
}, payload);
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
/**
|
|
1138
|
+
* Update Sendgrid provider
|
|
1139
|
+
*
|
|
1140
|
+
*
|
|
1141
|
+
* @param {string} providerId
|
|
1142
|
+
* @param {string} name
|
|
1143
|
+
* @param {boolean} enabled
|
|
1144
|
+
* @param {string} apiKey
|
|
1145
|
+
* @param {string} fromName
|
|
1146
|
+
* @param {string} fromEmail
|
|
1147
|
+
* @param {string} replyToName
|
|
1148
|
+
* @param {string} replyToEmail
|
|
1149
|
+
* @throws {AppwriteException}
|
|
1150
|
+
* @returns {Promise}
|
|
1151
|
+
*/
|
|
1152
|
+
async updateSendgridProvider(providerId: string, name?: string, enabled?: boolean, apiKey?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string): Promise<Models.Provider> {
|
|
1153
|
+
if (typeof providerId === 'undefined') {
|
|
1154
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
const apiPath = '/messaging/providers/sendgrid/{providerId}'.replace('{providerId}', providerId);
|
|
1158
|
+
const payload: Payload = {};
|
|
1159
|
+
|
|
1160
|
+
if (typeof name !== 'undefined') {
|
|
1161
|
+
payload['name'] = name;
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
if (typeof enabled !== 'undefined') {
|
|
1165
|
+
payload['enabled'] = enabled;
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
if (typeof apiKey !== 'undefined') {
|
|
1169
|
+
payload['apiKey'] = apiKey;
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
if (typeof fromName !== 'undefined') {
|
|
1173
|
+
payload['fromName'] = fromName;
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
if (typeof fromEmail !== 'undefined') {
|
|
1177
|
+
payload['fromEmail'] = fromEmail;
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
if (typeof replyToName !== 'undefined') {
|
|
1181
|
+
payload['replyToName'] = replyToName;
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
if (typeof replyToEmail !== 'undefined') {
|
|
1185
|
+
payload['replyToEmail'] = replyToEmail;
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1189
|
+
return await this.client.call('patch', uri, {
|
|
1190
|
+
'content-type': 'application/json',
|
|
1191
|
+
}, payload);
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
/**
|
|
1195
|
+
* Create SMTP provider
|
|
1196
|
+
*
|
|
1197
|
+
*
|
|
1198
|
+
* @param {string} providerId
|
|
1199
|
+
* @param {string} name
|
|
1200
|
+
* @param {string} host
|
|
1201
|
+
* @param {number} port
|
|
1202
|
+
* @param {string} username
|
|
1203
|
+
* @param {string} password
|
|
1204
|
+
* @param {SMTPEncryption} encryption
|
|
1205
|
+
* @param {boolean} autoTLS
|
|
1206
|
+
* @param {string} mailer
|
|
1207
|
+
* @param {string} fromName
|
|
1208
|
+
* @param {string} fromEmail
|
|
1209
|
+
* @param {string} replyToName
|
|
1210
|
+
* @param {string} replyToEmail
|
|
1211
|
+
* @param {boolean} enabled
|
|
1212
|
+
* @throws {AppwriteException}
|
|
1213
|
+
* @returns {Promise}
|
|
1214
|
+
*/
|
|
1215
|
+
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> {
|
|
1216
|
+
if (typeof providerId === 'undefined') {
|
|
1217
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
if (typeof name === 'undefined') {
|
|
1221
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
if (typeof host === 'undefined') {
|
|
1225
|
+
throw new AppwriteException('Missing required parameter: "host"');
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
const apiPath = '/messaging/providers/smtp';
|
|
1229
|
+
const payload: Payload = {};
|
|
1230
|
+
|
|
1231
|
+
if (typeof providerId !== 'undefined') {
|
|
1232
|
+
payload['providerId'] = providerId;
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
if (typeof name !== 'undefined') {
|
|
1236
|
+
payload['name'] = name;
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
if (typeof host !== 'undefined') {
|
|
1240
|
+
payload['host'] = host;
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
if (typeof port !== 'undefined') {
|
|
1244
|
+
payload['port'] = port;
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1247
|
+
if (typeof username !== 'undefined') {
|
|
1248
|
+
payload['username'] = username;
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
if (typeof password !== 'undefined') {
|
|
1252
|
+
payload['password'] = password;
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
if (typeof encryption !== 'undefined') {
|
|
1256
|
+
payload['encryption'] = encryption;
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
if (typeof autoTLS !== 'undefined') {
|
|
1260
|
+
payload['autoTLS'] = autoTLS;
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
if (typeof mailer !== 'undefined') {
|
|
1264
|
+
payload['mailer'] = mailer;
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
if (typeof fromName !== 'undefined') {
|
|
1268
|
+
payload['fromName'] = fromName;
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
if (typeof fromEmail !== 'undefined') {
|
|
1272
|
+
payload['fromEmail'] = fromEmail;
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
if (typeof replyToName !== 'undefined') {
|
|
1276
|
+
payload['replyToName'] = replyToName;
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
if (typeof replyToEmail !== 'undefined') {
|
|
1280
|
+
payload['replyToEmail'] = replyToEmail;
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
if (typeof enabled !== 'undefined') {
|
|
1284
|
+
payload['enabled'] = enabled;
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1288
|
+
return await this.client.call('post', uri, {
|
|
1289
|
+
'content-type': 'application/json',
|
|
1290
|
+
}, payload);
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
/**
|
|
1294
|
+
* Update SMTP provider
|
|
1295
|
+
*
|
|
1296
|
+
*
|
|
1297
|
+
* @param {string} providerId
|
|
1298
|
+
* @param {string} name
|
|
1299
|
+
* @param {string} host
|
|
1300
|
+
* @param {number} port
|
|
1301
|
+
* @param {string} username
|
|
1302
|
+
* @param {string} password
|
|
1303
|
+
* @param {SMTPEncryption} encryption
|
|
1304
|
+
* @param {boolean} autoTLS
|
|
1305
|
+
* @param {string} mailer
|
|
1306
|
+
* @param {string} fromName
|
|
1307
|
+
* @param {string} fromEmail
|
|
1308
|
+
* @param {string} replyToName
|
|
1309
|
+
* @param {string} replyToEmail
|
|
1310
|
+
* @param {boolean} enabled
|
|
1311
|
+
* @throws {AppwriteException}
|
|
1312
|
+
* @returns {Promise}
|
|
1313
|
+
*/
|
|
1314
|
+
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> {
|
|
1315
|
+
if (typeof providerId === 'undefined') {
|
|
1316
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1319
|
+
const apiPath = '/messaging/providers/smtp/{providerId}'.replace('{providerId}', providerId);
|
|
1320
|
+
const payload: Payload = {};
|
|
1321
|
+
|
|
1322
|
+
if (typeof name !== 'undefined') {
|
|
1323
|
+
payload['name'] = name;
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
if (typeof host !== 'undefined') {
|
|
1327
|
+
payload['host'] = host;
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
if (typeof port !== 'undefined') {
|
|
1331
|
+
payload['port'] = port;
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
if (typeof username !== 'undefined') {
|
|
1335
|
+
payload['username'] = username;
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
if (typeof password !== 'undefined') {
|
|
1339
|
+
payload['password'] = password;
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
if (typeof encryption !== 'undefined') {
|
|
1343
|
+
payload['encryption'] = encryption;
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
if (typeof autoTLS !== 'undefined') {
|
|
1347
|
+
payload['autoTLS'] = autoTLS;
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
if (typeof mailer !== 'undefined') {
|
|
1351
|
+
payload['mailer'] = mailer;
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
if (typeof fromName !== 'undefined') {
|
|
1355
|
+
payload['fromName'] = fromName;
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
if (typeof fromEmail !== 'undefined') {
|
|
1359
|
+
payload['fromEmail'] = fromEmail;
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
if (typeof replyToName !== 'undefined') {
|
|
1363
|
+
payload['replyToName'] = replyToName;
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
if (typeof replyToEmail !== 'undefined') {
|
|
1367
|
+
payload['replyToEmail'] = replyToEmail;
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
if (typeof enabled !== 'undefined') {
|
|
1371
|
+
payload['enabled'] = enabled;
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1375
|
+
return await this.client.call('patch', uri, {
|
|
1376
|
+
'content-type': 'application/json',
|
|
1377
|
+
}, payload);
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1380
|
+
/**
|
|
1381
|
+
* Create Telesign provider
|
|
1382
|
+
*
|
|
1383
|
+
*
|
|
1384
|
+
* @param {string} providerId
|
|
1385
|
+
* @param {string} name
|
|
1386
|
+
* @param {string} from
|
|
1387
|
+
* @param {string} customerId
|
|
1388
|
+
* @param {string} apiKey
|
|
1389
|
+
* @param {boolean} enabled
|
|
1390
|
+
* @throws {AppwriteException}
|
|
1391
|
+
* @returns {Promise}
|
|
1392
|
+
*/
|
|
1393
|
+
async createTelesignProvider(providerId: string, name: string, from?: string, customerId?: string, apiKey?: string, enabled?: boolean): Promise<Models.Provider> {
|
|
1394
|
+
if (typeof providerId === 'undefined') {
|
|
1395
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
if (typeof name === 'undefined') {
|
|
1399
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1402
|
+
const apiPath = '/messaging/providers/telesign';
|
|
1403
|
+
const payload: Payload = {};
|
|
1404
|
+
|
|
1405
|
+
if (typeof providerId !== 'undefined') {
|
|
1406
|
+
payload['providerId'] = providerId;
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1409
|
+
if (typeof name !== 'undefined') {
|
|
1410
|
+
payload['name'] = name;
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
if (typeof from !== 'undefined') {
|
|
1414
|
+
payload['from'] = from;
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
if (typeof customerId !== 'undefined') {
|
|
1418
|
+
payload['customerId'] = customerId;
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
if (typeof apiKey !== 'undefined') {
|
|
1422
|
+
payload['apiKey'] = apiKey;
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
if (typeof enabled !== 'undefined') {
|
|
1426
|
+
payload['enabled'] = enabled;
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1430
|
+
return await this.client.call('post', uri, {
|
|
1431
|
+
'content-type': 'application/json',
|
|
1432
|
+
}, payload);
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1435
|
+
/**
|
|
1436
|
+
* Update Telesign provider
|
|
1437
|
+
*
|
|
1438
|
+
*
|
|
1439
|
+
* @param {string} providerId
|
|
1440
|
+
* @param {string} name
|
|
1441
|
+
* @param {boolean} enabled
|
|
1442
|
+
* @param {string} customerId
|
|
1443
|
+
* @param {string} apiKey
|
|
1444
|
+
* @param {string} from
|
|
1445
|
+
* @throws {AppwriteException}
|
|
1446
|
+
* @returns {Promise}
|
|
1447
|
+
*/
|
|
1448
|
+
async updateTelesignProvider(providerId: string, name?: string, enabled?: boolean, customerId?: string, apiKey?: string, from?: string): Promise<Models.Provider> {
|
|
1449
|
+
if (typeof providerId === 'undefined') {
|
|
1450
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
const apiPath = '/messaging/providers/telesign/{providerId}'.replace('{providerId}', providerId);
|
|
1454
|
+
const payload: Payload = {};
|
|
1455
|
+
|
|
1456
|
+
if (typeof name !== 'undefined') {
|
|
1457
|
+
payload['name'] = name;
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
if (typeof enabled !== 'undefined') {
|
|
1461
|
+
payload['enabled'] = enabled;
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
if (typeof customerId !== 'undefined') {
|
|
1465
|
+
payload['customerId'] = customerId;
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1468
|
+
if (typeof apiKey !== 'undefined') {
|
|
1469
|
+
payload['apiKey'] = apiKey;
|
|
1470
|
+
}
|
|
1471
|
+
|
|
1472
|
+
if (typeof from !== 'undefined') {
|
|
1473
|
+
payload['from'] = from;
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1477
|
+
return await this.client.call('patch', uri, {
|
|
1478
|
+
'content-type': 'application/json',
|
|
1479
|
+
}, payload);
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
/**
|
|
1483
|
+
* Create Textmagic provider
|
|
1484
|
+
*
|
|
1485
|
+
*
|
|
1486
|
+
* @param {string} providerId
|
|
1487
|
+
* @param {string} name
|
|
1488
|
+
* @param {string} from
|
|
1489
|
+
* @param {string} username
|
|
1490
|
+
* @param {string} apiKey
|
|
1491
|
+
* @param {boolean} enabled
|
|
1492
|
+
* @throws {AppwriteException}
|
|
1493
|
+
* @returns {Promise}
|
|
1494
|
+
*/
|
|
1495
|
+
async createTextmagicProvider(providerId: string, name: string, from?: string, username?: string, apiKey?: string, enabled?: boolean): Promise<Models.Provider> {
|
|
1496
|
+
if (typeof providerId === 'undefined') {
|
|
1497
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1500
|
+
if (typeof name === 'undefined') {
|
|
1501
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1504
|
+
const apiPath = '/messaging/providers/textmagic';
|
|
1505
|
+
const payload: Payload = {};
|
|
1506
|
+
|
|
1507
|
+
if (typeof providerId !== 'undefined') {
|
|
1508
|
+
payload['providerId'] = providerId;
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
if (typeof name !== 'undefined') {
|
|
1512
|
+
payload['name'] = name;
|
|
1513
|
+
}
|
|
1514
|
+
|
|
1515
|
+
if (typeof from !== 'undefined') {
|
|
1516
|
+
payload['from'] = from;
|
|
1517
|
+
}
|
|
1518
|
+
|
|
1519
|
+
if (typeof username !== 'undefined') {
|
|
1520
|
+
payload['username'] = username;
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1523
|
+
if (typeof apiKey !== 'undefined') {
|
|
1524
|
+
payload['apiKey'] = apiKey;
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
if (typeof enabled !== 'undefined') {
|
|
1528
|
+
payload['enabled'] = enabled;
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1532
|
+
return await this.client.call('post', uri, {
|
|
1533
|
+
'content-type': 'application/json',
|
|
1534
|
+
}, payload);
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1537
|
+
/**
|
|
1538
|
+
* Update Textmagic provider
|
|
1539
|
+
*
|
|
1540
|
+
*
|
|
1541
|
+
* @param {string} providerId
|
|
1542
|
+
* @param {string} name
|
|
1543
|
+
* @param {boolean} enabled
|
|
1544
|
+
* @param {string} username
|
|
1545
|
+
* @param {string} apiKey
|
|
1546
|
+
* @param {string} from
|
|
1547
|
+
* @throws {AppwriteException}
|
|
1548
|
+
* @returns {Promise}
|
|
1549
|
+
*/
|
|
1550
|
+
async updateTextmagicProvider(providerId: string, name?: string, enabled?: boolean, username?: string, apiKey?: string, from?: string): Promise<Models.Provider> {
|
|
1551
|
+
if (typeof providerId === 'undefined') {
|
|
1552
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
const apiPath = '/messaging/providers/textmagic/{providerId}'.replace('{providerId}', providerId);
|
|
1556
|
+
const payload: Payload = {};
|
|
1557
|
+
|
|
1558
|
+
if (typeof name !== 'undefined') {
|
|
1559
|
+
payload['name'] = name;
|
|
1560
|
+
}
|
|
1561
|
+
|
|
1562
|
+
if (typeof enabled !== 'undefined') {
|
|
1563
|
+
payload['enabled'] = enabled;
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
if (typeof username !== 'undefined') {
|
|
1567
|
+
payload['username'] = username;
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
if (typeof apiKey !== 'undefined') {
|
|
1571
|
+
payload['apiKey'] = apiKey;
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
if (typeof from !== 'undefined') {
|
|
1575
|
+
payload['from'] = from;
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1579
|
+
return await this.client.call('patch', uri, {
|
|
1580
|
+
'content-type': 'application/json',
|
|
1581
|
+
}, payload);
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
/**
|
|
1585
|
+
* Create Twilio provider
|
|
1586
|
+
*
|
|
1587
|
+
*
|
|
1588
|
+
* @param {string} providerId
|
|
1589
|
+
* @param {string} name
|
|
1590
|
+
* @param {string} from
|
|
1591
|
+
* @param {string} accountSid
|
|
1592
|
+
* @param {string} authToken
|
|
1593
|
+
* @param {boolean} enabled
|
|
1594
|
+
* @throws {AppwriteException}
|
|
1595
|
+
* @returns {Promise}
|
|
1596
|
+
*/
|
|
1597
|
+
async createTwilioProvider(providerId: string, name: string, from?: string, accountSid?: string, authToken?: string, enabled?: boolean): Promise<Models.Provider> {
|
|
1598
|
+
if (typeof providerId === 'undefined') {
|
|
1599
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1600
|
+
}
|
|
1601
|
+
|
|
1602
|
+
if (typeof name === 'undefined') {
|
|
1603
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1606
|
+
const apiPath = '/messaging/providers/twilio';
|
|
1607
|
+
const payload: Payload = {};
|
|
1608
|
+
|
|
1609
|
+
if (typeof providerId !== 'undefined') {
|
|
1610
|
+
payload['providerId'] = providerId;
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1613
|
+
if (typeof name !== 'undefined') {
|
|
1614
|
+
payload['name'] = name;
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
if (typeof from !== 'undefined') {
|
|
1618
|
+
payload['from'] = from;
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1621
|
+
if (typeof accountSid !== 'undefined') {
|
|
1622
|
+
payload['accountSid'] = accountSid;
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
if (typeof authToken !== 'undefined') {
|
|
1626
|
+
payload['authToken'] = authToken;
|
|
1627
|
+
}
|
|
1628
|
+
|
|
1629
|
+
if (typeof enabled !== 'undefined') {
|
|
1630
|
+
payload['enabled'] = enabled;
|
|
1631
|
+
}
|
|
1632
|
+
|
|
1633
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1634
|
+
return await this.client.call('post', uri, {
|
|
1635
|
+
'content-type': 'application/json',
|
|
1636
|
+
}, payload);
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1639
|
+
/**
|
|
1640
|
+
* Update Twilio provider
|
|
1641
|
+
*
|
|
1642
|
+
*
|
|
1643
|
+
* @param {string} providerId
|
|
1644
|
+
* @param {string} name
|
|
1645
|
+
* @param {boolean} enabled
|
|
1646
|
+
* @param {string} accountSid
|
|
1647
|
+
* @param {string} authToken
|
|
1648
|
+
* @param {string} from
|
|
1649
|
+
* @throws {AppwriteException}
|
|
1650
|
+
* @returns {Promise}
|
|
1651
|
+
*/
|
|
1652
|
+
async updateTwilioProvider(providerId: string, name?: string, enabled?: boolean, accountSid?: string, authToken?: string, from?: string): Promise<Models.Provider> {
|
|
1653
|
+
if (typeof providerId === 'undefined') {
|
|
1654
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1655
|
+
}
|
|
1656
|
+
|
|
1657
|
+
const apiPath = '/messaging/providers/twilio/{providerId}'.replace('{providerId}', providerId);
|
|
1658
|
+
const payload: Payload = {};
|
|
1659
|
+
|
|
1660
|
+
if (typeof name !== 'undefined') {
|
|
1661
|
+
payload['name'] = name;
|
|
1662
|
+
}
|
|
1663
|
+
|
|
1664
|
+
if (typeof enabled !== 'undefined') {
|
|
1665
|
+
payload['enabled'] = enabled;
|
|
1666
|
+
}
|
|
1667
|
+
|
|
1668
|
+
if (typeof accountSid !== 'undefined') {
|
|
1669
|
+
payload['accountSid'] = accountSid;
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1672
|
+
if (typeof authToken !== 'undefined') {
|
|
1673
|
+
payload['authToken'] = authToken;
|
|
1674
|
+
}
|
|
1675
|
+
|
|
1676
|
+
if (typeof from !== 'undefined') {
|
|
1677
|
+
payload['from'] = from;
|
|
1678
|
+
}
|
|
1679
|
+
|
|
1680
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1681
|
+
return await this.client.call('patch', uri, {
|
|
1682
|
+
'content-type': 'application/json',
|
|
1683
|
+
}, payload);
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1686
|
+
/**
|
|
1687
|
+
* Create Vonage provider
|
|
1688
|
+
*
|
|
1689
|
+
*
|
|
1690
|
+
* @param {string} providerId
|
|
1691
|
+
* @param {string} name
|
|
1692
|
+
* @param {string} from
|
|
1693
|
+
* @param {string} apiKey
|
|
1694
|
+
* @param {string} apiSecret
|
|
1695
|
+
* @param {boolean} enabled
|
|
1696
|
+
* @throws {AppwriteException}
|
|
1697
|
+
* @returns {Promise}
|
|
1698
|
+
*/
|
|
1699
|
+
async createVonageProvider(providerId: string, name: string, from?: string, apiKey?: string, apiSecret?: string, enabled?: boolean): Promise<Models.Provider> {
|
|
1700
|
+
if (typeof providerId === 'undefined') {
|
|
1701
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1702
|
+
}
|
|
1703
|
+
|
|
1704
|
+
if (typeof name === 'undefined') {
|
|
1705
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
1706
|
+
}
|
|
1707
|
+
|
|
1708
|
+
const apiPath = '/messaging/providers/vonage';
|
|
1709
|
+
const payload: Payload = {};
|
|
1710
|
+
|
|
1711
|
+
if (typeof providerId !== 'undefined') {
|
|
1712
|
+
payload['providerId'] = providerId;
|
|
1713
|
+
}
|
|
1714
|
+
|
|
1715
|
+
if (typeof name !== 'undefined') {
|
|
1716
|
+
payload['name'] = name;
|
|
1717
|
+
}
|
|
1718
|
+
|
|
1719
|
+
if (typeof from !== 'undefined') {
|
|
1720
|
+
payload['from'] = from;
|
|
1721
|
+
}
|
|
1722
|
+
|
|
1723
|
+
if (typeof apiKey !== 'undefined') {
|
|
1724
|
+
payload['apiKey'] = apiKey;
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1727
|
+
if (typeof apiSecret !== 'undefined') {
|
|
1728
|
+
payload['apiSecret'] = apiSecret;
|
|
1729
|
+
}
|
|
1730
|
+
|
|
1731
|
+
if (typeof enabled !== 'undefined') {
|
|
1732
|
+
payload['enabled'] = enabled;
|
|
1733
|
+
}
|
|
1734
|
+
|
|
1735
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1736
|
+
return await this.client.call('post', uri, {
|
|
1737
|
+
'content-type': 'application/json',
|
|
1738
|
+
}, payload);
|
|
1739
|
+
}
|
|
1740
|
+
|
|
1741
|
+
/**
|
|
1742
|
+
* Update Vonage provider
|
|
1743
|
+
*
|
|
1744
|
+
*
|
|
1745
|
+
* @param {string} providerId
|
|
1746
|
+
* @param {string} name
|
|
1747
|
+
* @param {boolean} enabled
|
|
1748
|
+
* @param {string} apiKey
|
|
1749
|
+
* @param {string} apiSecret
|
|
1750
|
+
* @param {string} from
|
|
1751
|
+
* @throws {AppwriteException}
|
|
1752
|
+
* @returns {Promise}
|
|
1753
|
+
*/
|
|
1754
|
+
async updateVonageProvider(providerId: string, name?: string, enabled?: boolean, apiKey?: string, apiSecret?: string, from?: string): Promise<Models.Provider> {
|
|
1755
|
+
if (typeof providerId === 'undefined') {
|
|
1756
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1759
|
+
const apiPath = '/messaging/providers/vonage/{providerId}'.replace('{providerId}', providerId);
|
|
1760
|
+
const payload: Payload = {};
|
|
1761
|
+
|
|
1762
|
+
if (typeof name !== 'undefined') {
|
|
1763
|
+
payload['name'] = name;
|
|
1764
|
+
}
|
|
1765
|
+
|
|
1766
|
+
if (typeof enabled !== 'undefined') {
|
|
1767
|
+
payload['enabled'] = enabled;
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
if (typeof apiKey !== 'undefined') {
|
|
1771
|
+
payload['apiKey'] = apiKey;
|
|
1772
|
+
}
|
|
1773
|
+
|
|
1774
|
+
if (typeof apiSecret !== 'undefined') {
|
|
1775
|
+
payload['apiSecret'] = apiSecret;
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
if (typeof from !== 'undefined') {
|
|
1779
|
+
payload['from'] = from;
|
|
1780
|
+
}
|
|
1781
|
+
|
|
1782
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1783
|
+
return await this.client.call('patch', uri, {
|
|
1784
|
+
'content-type': 'application/json',
|
|
1785
|
+
}, payload);
|
|
1786
|
+
}
|
|
1787
|
+
|
|
1788
|
+
/**
|
|
1789
|
+
* Get provider
|
|
1790
|
+
*
|
|
1791
|
+
*
|
|
1792
|
+
* @param {string} providerId
|
|
1793
|
+
* @throws {AppwriteException}
|
|
1794
|
+
* @returns {Promise}
|
|
1795
|
+
*/
|
|
1796
|
+
async getProvider(providerId: string): Promise<Models.Provider> {
|
|
1797
|
+
if (typeof providerId === 'undefined') {
|
|
1798
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1799
|
+
}
|
|
1800
|
+
|
|
1801
|
+
const apiPath = '/messaging/providers/{providerId}'.replace('{providerId}', providerId);
|
|
1802
|
+
const payload: Payload = {};
|
|
1803
|
+
|
|
1804
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1805
|
+
return await this.client.call('get', uri, {
|
|
1806
|
+
'content-type': 'application/json',
|
|
1807
|
+
}, payload);
|
|
1808
|
+
}
|
|
1809
|
+
|
|
1810
|
+
/**
|
|
1811
|
+
* Delete provider
|
|
1812
|
+
*
|
|
1813
|
+
*
|
|
1814
|
+
* @param {string} providerId
|
|
1815
|
+
* @throws {AppwriteException}
|
|
1816
|
+
* @returns {Promise}
|
|
1817
|
+
*/
|
|
1818
|
+
async deleteProvider(providerId: string): Promise<{}> {
|
|
1819
|
+
if (typeof providerId === 'undefined') {
|
|
1820
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1821
|
+
}
|
|
1822
|
+
|
|
1823
|
+
const apiPath = '/messaging/providers/{providerId}'.replace('{providerId}', providerId);
|
|
1824
|
+
const payload: Payload = {};
|
|
1825
|
+
|
|
1826
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1827
|
+
return await this.client.call('delete', uri, {
|
|
1828
|
+
'content-type': 'application/json',
|
|
1829
|
+
}, payload);
|
|
1830
|
+
}
|
|
1831
|
+
|
|
1832
|
+
/**
|
|
1833
|
+
* List provider logs
|
|
1834
|
+
*
|
|
1835
|
+
*
|
|
1836
|
+
* @param {string} providerId
|
|
1837
|
+
* @param {string[]} queries
|
|
1838
|
+
* @throws {AppwriteException}
|
|
1839
|
+
* @returns {Promise}
|
|
1840
|
+
*/
|
|
1841
|
+
async listProviderLogs(providerId: string, queries?: string[]): Promise<Models.LogList> {
|
|
1842
|
+
if (typeof providerId === 'undefined') {
|
|
1843
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1844
|
+
}
|
|
1845
|
+
|
|
1846
|
+
const apiPath = '/messaging/providers/{providerId}/logs'.replace('{providerId}', providerId);
|
|
1847
|
+
const payload: Payload = {};
|
|
1848
|
+
|
|
1849
|
+
if (typeof queries !== 'undefined') {
|
|
1850
|
+
payload['queries'] = queries;
|
|
1851
|
+
}
|
|
1852
|
+
|
|
1853
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1854
|
+
return await this.client.call('get', uri, {
|
|
1855
|
+
'content-type': 'application/json',
|
|
1856
|
+
}, payload);
|
|
1857
|
+
}
|
|
1858
|
+
|
|
1859
|
+
/**
|
|
1860
|
+
* List subscriber logs
|
|
1861
|
+
*
|
|
1862
|
+
*
|
|
1863
|
+
* @param {string} subscriberId
|
|
1864
|
+
* @param {string[]} queries
|
|
1865
|
+
* @throws {AppwriteException}
|
|
1866
|
+
* @returns {Promise}
|
|
1867
|
+
*/
|
|
1868
|
+
async listSubscriberLogs(subscriberId: string, queries?: string[]): Promise<Models.LogList> {
|
|
1869
|
+
if (typeof subscriberId === 'undefined') {
|
|
1870
|
+
throw new AppwriteException('Missing required parameter: "subscriberId"');
|
|
1871
|
+
}
|
|
1872
|
+
|
|
1873
|
+
const apiPath = '/messaging/subscribers/{subscriberId}/logs'.replace('{subscriberId}', subscriberId);
|
|
1874
|
+
const payload: Payload = {};
|
|
1875
|
+
|
|
1876
|
+
if (typeof queries !== 'undefined') {
|
|
1877
|
+
payload['queries'] = queries;
|
|
1878
|
+
}
|
|
1879
|
+
|
|
1880
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1881
|
+
return await this.client.call('get', uri, {
|
|
1882
|
+
'content-type': 'application/json',
|
|
1883
|
+
}, payload);
|
|
1884
|
+
}
|
|
1885
|
+
|
|
1886
|
+
/**
|
|
1887
|
+
* List topics.
|
|
1888
|
+
*
|
|
1889
|
+
*
|
|
1890
|
+
* @param {string[]} queries
|
|
1891
|
+
* @param {string} search
|
|
1892
|
+
* @throws {AppwriteException}
|
|
1893
|
+
* @returns {Promise}
|
|
1894
|
+
*/
|
|
1895
|
+
async listTopics(queries?: string[], search?: string): Promise<Models.TopicList> {
|
|
1896
|
+
const apiPath = '/messaging/topics';
|
|
1897
|
+
const payload: Payload = {};
|
|
1898
|
+
|
|
1899
|
+
if (typeof queries !== 'undefined') {
|
|
1900
|
+
payload['queries'] = queries;
|
|
1901
|
+
}
|
|
1902
|
+
|
|
1903
|
+
if (typeof search !== 'undefined') {
|
|
1904
|
+
payload['search'] = search;
|
|
1905
|
+
}
|
|
1906
|
+
|
|
1907
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1908
|
+
return await this.client.call('get', uri, {
|
|
1909
|
+
'content-type': 'application/json',
|
|
1910
|
+
}, payload);
|
|
1911
|
+
}
|
|
1912
|
+
|
|
1913
|
+
/**
|
|
1914
|
+
* Create a topic.
|
|
1915
|
+
*
|
|
1916
|
+
*
|
|
1917
|
+
* @param {string} topicId
|
|
1918
|
+
* @param {string} name
|
|
1919
|
+
* @param {string[]} subscribe
|
|
1920
|
+
* @throws {AppwriteException}
|
|
1921
|
+
* @returns {Promise}
|
|
1922
|
+
*/
|
|
1923
|
+
async createTopic(topicId: string, name: string, subscribe?: string[]): Promise<Models.Topic> {
|
|
1924
|
+
if (typeof topicId === 'undefined') {
|
|
1925
|
+
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
1926
|
+
}
|
|
1927
|
+
|
|
1928
|
+
if (typeof name === 'undefined') {
|
|
1929
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
1930
|
+
}
|
|
1931
|
+
|
|
1932
|
+
const apiPath = '/messaging/topics';
|
|
1933
|
+
const payload: Payload = {};
|
|
1934
|
+
|
|
1935
|
+
if (typeof topicId !== 'undefined') {
|
|
1936
|
+
payload['topicId'] = topicId;
|
|
1937
|
+
}
|
|
1938
|
+
|
|
1939
|
+
if (typeof name !== 'undefined') {
|
|
1940
|
+
payload['name'] = name;
|
|
1941
|
+
}
|
|
1942
|
+
|
|
1943
|
+
if (typeof subscribe !== 'undefined') {
|
|
1944
|
+
payload['subscribe'] = subscribe;
|
|
1945
|
+
}
|
|
1946
|
+
|
|
1947
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1948
|
+
return await this.client.call('post', uri, {
|
|
1949
|
+
'content-type': 'application/json',
|
|
1950
|
+
}, payload);
|
|
1951
|
+
}
|
|
1952
|
+
|
|
1953
|
+
/**
|
|
1954
|
+
* Get a topic.
|
|
1955
|
+
*
|
|
1956
|
+
*
|
|
1957
|
+
* @param {string} topicId
|
|
1958
|
+
* @throws {AppwriteException}
|
|
1959
|
+
* @returns {Promise}
|
|
1960
|
+
*/
|
|
1961
|
+
async getTopic(topicId: string): Promise<Models.Topic> {
|
|
1962
|
+
if (typeof topicId === 'undefined') {
|
|
1963
|
+
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
1964
|
+
}
|
|
1965
|
+
|
|
1966
|
+
const apiPath = '/messaging/topics/{topicId}'.replace('{topicId}', topicId);
|
|
1967
|
+
const payload: Payload = {};
|
|
1968
|
+
|
|
1969
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1970
|
+
return await this.client.call('get', uri, {
|
|
1971
|
+
'content-type': 'application/json',
|
|
1972
|
+
}, payload);
|
|
1973
|
+
}
|
|
1974
|
+
|
|
1975
|
+
/**
|
|
1976
|
+
* Update a topic.
|
|
1977
|
+
*
|
|
1978
|
+
*
|
|
1979
|
+
* @param {string} topicId
|
|
1980
|
+
* @param {string} name
|
|
1981
|
+
* @throws {AppwriteException}
|
|
1982
|
+
* @returns {Promise}
|
|
1983
|
+
*/
|
|
1984
|
+
async updateTopic(topicId: string, name?: string): Promise<Models.Topic> {
|
|
1985
|
+
if (typeof topicId === 'undefined') {
|
|
1986
|
+
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
1987
|
+
}
|
|
1988
|
+
|
|
1989
|
+
const apiPath = '/messaging/topics/{topicId}'.replace('{topicId}', topicId);
|
|
1990
|
+
const payload: Payload = {};
|
|
1991
|
+
|
|
1992
|
+
if (typeof name !== 'undefined') {
|
|
1993
|
+
payload['name'] = name;
|
|
1994
|
+
}
|
|
1995
|
+
|
|
1996
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1997
|
+
return await this.client.call('patch', uri, {
|
|
1998
|
+
'content-type': 'application/json',
|
|
1999
|
+
}, payload);
|
|
2000
|
+
}
|
|
2001
|
+
|
|
2002
|
+
/**
|
|
2003
|
+
* Delete a topic.
|
|
2004
|
+
*
|
|
2005
|
+
*
|
|
2006
|
+
* @param {string} topicId
|
|
2007
|
+
* @throws {AppwriteException}
|
|
2008
|
+
* @returns {Promise}
|
|
2009
|
+
*/
|
|
2010
|
+
async deleteTopic(topicId: string): Promise<{}> {
|
|
2011
|
+
if (typeof topicId === 'undefined') {
|
|
2012
|
+
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
2013
|
+
}
|
|
2014
|
+
|
|
2015
|
+
const apiPath = '/messaging/topics/{topicId}'.replace('{topicId}', topicId);
|
|
2016
|
+
const payload: Payload = {};
|
|
2017
|
+
|
|
2018
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2019
|
+
return await this.client.call('delete', uri, {
|
|
2020
|
+
'content-type': 'application/json',
|
|
2021
|
+
}, payload);
|
|
2022
|
+
}
|
|
2023
|
+
|
|
2024
|
+
/**
|
|
2025
|
+
* List topic logs
|
|
2026
|
+
*
|
|
2027
|
+
*
|
|
2028
|
+
* @param {string} topicId
|
|
2029
|
+
* @param {string[]} queries
|
|
2030
|
+
* @throws {AppwriteException}
|
|
2031
|
+
* @returns {Promise}
|
|
2032
|
+
*/
|
|
2033
|
+
async listTopicLogs(topicId: string, queries?: string[]): Promise<Models.LogList> {
|
|
2034
|
+
if (typeof topicId === 'undefined') {
|
|
2035
|
+
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
2036
|
+
}
|
|
2037
|
+
|
|
2038
|
+
const apiPath = '/messaging/topics/{topicId}/logs'.replace('{topicId}', topicId);
|
|
2039
|
+
const payload: Payload = {};
|
|
2040
|
+
|
|
2041
|
+
if (typeof queries !== 'undefined') {
|
|
2042
|
+
payload['queries'] = queries;
|
|
2043
|
+
}
|
|
2044
|
+
|
|
2045
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2046
|
+
return await this.client.call('get', uri, {
|
|
2047
|
+
'content-type': 'application/json',
|
|
2048
|
+
}, payload);
|
|
2049
|
+
}
|
|
2050
|
+
|
|
2051
|
+
/**
|
|
2052
|
+
* List subscribers.
|
|
2053
|
+
*
|
|
2054
|
+
*
|
|
2055
|
+
* @param {string} topicId
|
|
2056
|
+
* @param {string[]} queries
|
|
2057
|
+
* @param {string} search
|
|
2058
|
+
* @throws {AppwriteException}
|
|
2059
|
+
* @returns {Promise}
|
|
2060
|
+
*/
|
|
2061
|
+
async listSubscribers(topicId: string, queries?: string[], search?: string): Promise<Models.SubscriberList> {
|
|
2062
|
+
if (typeof topicId === 'undefined') {
|
|
2063
|
+
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
2064
|
+
}
|
|
2065
|
+
|
|
2066
|
+
const apiPath = '/messaging/topics/{topicId}/subscribers'.replace('{topicId}', topicId);
|
|
2067
|
+
const payload: Payload = {};
|
|
2068
|
+
|
|
2069
|
+
if (typeof queries !== 'undefined') {
|
|
2070
|
+
payload['queries'] = queries;
|
|
2071
|
+
}
|
|
2072
|
+
|
|
2073
|
+
if (typeof search !== 'undefined') {
|
|
2074
|
+
payload['search'] = search;
|
|
2075
|
+
}
|
|
2076
|
+
|
|
2077
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2078
|
+
return await this.client.call('get', uri, {
|
|
2079
|
+
'content-type': 'application/json',
|
|
2080
|
+
}, payload);
|
|
2081
|
+
}
|
|
2082
|
+
|
|
2083
|
+
/**
|
|
2084
|
+
* Create a subscriber.
|
|
2085
|
+
*
|
|
2086
|
+
*
|
|
2087
|
+
* @param {string} topicId
|
|
2088
|
+
* @param {string} subscriberId
|
|
2089
|
+
* @param {string} targetId
|
|
2090
|
+
* @throws {AppwriteException}
|
|
2091
|
+
* @returns {Promise}
|
|
2092
|
+
*/
|
|
2093
|
+
async createSubscriber(topicId: string, subscriberId: string, targetId: string): Promise<Models.Subscriber> {
|
|
2094
|
+
if (typeof topicId === 'undefined') {
|
|
2095
|
+
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
2096
|
+
}
|
|
2097
|
+
|
|
2098
|
+
if (typeof subscriberId === 'undefined') {
|
|
2099
|
+
throw new AppwriteException('Missing required parameter: "subscriberId"');
|
|
2100
|
+
}
|
|
2101
|
+
|
|
2102
|
+
if (typeof targetId === 'undefined') {
|
|
2103
|
+
throw new AppwriteException('Missing required parameter: "targetId"');
|
|
2104
|
+
}
|
|
2105
|
+
|
|
2106
|
+
const apiPath = '/messaging/topics/{topicId}/subscribers'.replace('{topicId}', topicId);
|
|
2107
|
+
const payload: Payload = {};
|
|
2108
|
+
|
|
2109
|
+
if (typeof subscriberId !== 'undefined') {
|
|
2110
|
+
payload['subscriberId'] = subscriberId;
|
|
2111
|
+
}
|
|
2112
|
+
|
|
2113
|
+
if (typeof targetId !== 'undefined') {
|
|
2114
|
+
payload['targetId'] = targetId;
|
|
2115
|
+
}
|
|
2116
|
+
|
|
2117
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2118
|
+
return await this.client.call('post', uri, {
|
|
2119
|
+
'content-type': 'application/json',
|
|
2120
|
+
}, payload);
|
|
2121
|
+
}
|
|
2122
|
+
|
|
2123
|
+
/**
|
|
2124
|
+
* Get a subscriber.
|
|
2125
|
+
*
|
|
2126
|
+
*
|
|
2127
|
+
* @param {string} topicId
|
|
2128
|
+
* @param {string} subscriberId
|
|
2129
|
+
* @throws {AppwriteException}
|
|
2130
|
+
* @returns {Promise}
|
|
2131
|
+
*/
|
|
2132
|
+
async getSubscriber(topicId: string, subscriberId: string): Promise<Models.Subscriber> {
|
|
2133
|
+
if (typeof topicId === 'undefined') {
|
|
2134
|
+
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
2135
|
+
}
|
|
2136
|
+
|
|
2137
|
+
if (typeof subscriberId === 'undefined') {
|
|
2138
|
+
throw new AppwriteException('Missing required parameter: "subscriberId"');
|
|
2139
|
+
}
|
|
2140
|
+
|
|
2141
|
+
const apiPath = '/messaging/topics/{topicId}/subscribers/{subscriberId}'.replace('{topicId}', topicId).replace('{subscriberId}', subscriberId);
|
|
2142
|
+
const payload: Payload = {};
|
|
2143
|
+
|
|
2144
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2145
|
+
return await this.client.call('get', uri, {
|
|
2146
|
+
'content-type': 'application/json',
|
|
2147
|
+
}, payload);
|
|
2148
|
+
}
|
|
2149
|
+
|
|
2150
|
+
/**
|
|
2151
|
+
* Delete a subscriber.
|
|
2152
|
+
*
|
|
2153
|
+
*
|
|
2154
|
+
* @param {string} topicId
|
|
2155
|
+
* @param {string} subscriberId
|
|
2156
|
+
* @throws {AppwriteException}
|
|
2157
|
+
* @returns {Promise}
|
|
2158
|
+
*/
|
|
2159
|
+
async deleteSubscriber(topicId: string, subscriberId: string): Promise<{}> {
|
|
2160
|
+
if (typeof topicId === 'undefined') {
|
|
2161
|
+
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
2162
|
+
}
|
|
2163
|
+
|
|
2164
|
+
if (typeof subscriberId === 'undefined') {
|
|
2165
|
+
throw new AppwriteException('Missing required parameter: "subscriberId"');
|
|
2166
|
+
}
|
|
2167
|
+
|
|
2168
|
+
const apiPath = '/messaging/topics/{topicId}/subscribers/{subscriberId}'.replace('{topicId}', topicId).replace('{subscriberId}', subscriberId);
|
|
2169
|
+
const payload: Payload = {};
|
|
2170
|
+
|
|
2171
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2172
|
+
return await this.client.call('delete', uri, {
|
|
2173
|
+
'content-type': 'application/json',
|
|
2174
|
+
}, payload);
|
|
2175
|
+
}
|
|
2176
|
+
};
|