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