@appwrite.io/console 1.9.0 → 2.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/.github/workflows/publish.yml +9 -8
- package/CHANGELOG.md +51 -6
- package/LICENSE +1 -1
- package/README.md +84 -4
- package/dist/cjs/sdk.js +15258 -6036
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +15256 -6037
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +15258 -6036
- package/docs/examples/account/create-billing-address.md +8 -8
- package/docs/examples/account/create-email-password-session.md +4 -4
- package/docs/examples/account/create-email-token.md +5 -5
- package/docs/examples/account/{update-magic-u-r-l-session.md → create-email-verification.md} +3 -4
- package/docs/examples/account/{update-m-f-a.md → create-jwt.md} +3 -3
- package/docs/examples/account/{create-magic-u-r-l-token.md → create-magic-url-token.md} +6 -6
- package/docs/examples/account/create-mfa-authenticator.md +3 -3
- package/docs/examples/account/create-mfa-challenge.md +3 -3
- package/docs/examples/account/create-mfa-recovery-codes.md +1 -1
- package/docs/examples/account/{create-o-auth2token.md → create-o-auth-2-session.md} +6 -6
- package/docs/examples/account/{create-o-auth2session.md → create-o-auth-2-token.md} +6 -6
- package/docs/examples/account/create-phone-token.md +4 -4
- package/docs/examples/account/create-push-target.md +5 -5
- package/docs/examples/account/create-recovery.md +4 -4
- package/docs/examples/account/create-session.md +4 -4
- package/docs/examples/account/create-verification.md +3 -3
- package/docs/examples/account/create.md +6 -6
- package/docs/examples/account/delete-billing-address.md +3 -3
- package/docs/examples/account/delete-identity.md +3 -3
- package/docs/examples/account/delete-mfa-authenticator.md +3 -3
- package/docs/examples/account/delete-payment-method.md +3 -3
- package/docs/examples/account/delete-push-target.md +3 -3
- package/docs/examples/account/delete-session.md +3 -3
- package/docs/examples/account/get-billing-address.md +3 -3
- package/docs/examples/account/get-coupon.md +3 -3
- package/docs/examples/account/get-mfa-recovery-codes.md +1 -1
- package/docs/examples/account/get-payment-method.md +3 -3
- package/docs/examples/account/get-session.md +3 -3
- package/docs/examples/account/list-billing-addresses.md +3 -3
- package/docs/examples/account/list-identities.md +4 -3
- package/docs/examples/account/list-invoices.md +3 -3
- package/docs/examples/account/list-logs.md +4 -3
- package/docs/examples/account/list-mfa-factors.md +1 -1
- package/docs/examples/account/list-payment-methods.md +3 -3
- package/docs/examples/account/update-billing-address.md +9 -9
- package/docs/examples/account/update-email-verification.md +14 -0
- package/docs/examples/account/update-email.md +4 -4
- package/docs/examples/account/update-magic-url-session.md +14 -0
- package/docs/examples/account/update-mfa-authenticator.md +4 -4
- package/docs/examples/account/update-mfa-challenge.md +4 -4
- package/docs/examples/account/update-mfa-recovery-codes.md +1 -1
- package/docs/examples/account/{create-j-w-t.md → update-mfa.md} +3 -1
- package/docs/examples/account/update-name.md +3 -3
- package/docs/examples/account/update-password.md +4 -4
- package/docs/examples/account/update-payment-method-mandate-options.md +3 -3
- package/docs/examples/account/update-payment-method-provider.md +6 -5
- package/docs/examples/account/update-payment-method.md +6 -5
- package/docs/examples/account/update-phone-session.md +4 -4
- package/docs/examples/account/update-phone-verification.md +4 -4
- package/docs/examples/account/update-phone.md +4 -4
- package/docs/examples/account/update-prefs.md +7 -3
- package/docs/examples/account/update-push-target.md +4 -4
- package/docs/examples/account/update-recovery.md +5 -5
- package/docs/examples/account/update-session.md +3 -3
- package/docs/examples/account/update-verification.md +4 -4
- package/docs/examples/assistant/chat.md +3 -3
- package/docs/examples/avatars/get-browser.md +6 -6
- package/docs/examples/avatars/get-credit-card.md +6 -6
- package/docs/examples/avatars/get-favicon.md +3 -3
- package/docs/examples/avatars/get-flag.md +6 -6
- package/docs/examples/avatars/get-image.md +5 -5
- package/docs/examples/avatars/get-initials.md +6 -6
- package/docs/examples/avatars/{get-q-r.md → get-qr.md} +6 -6
- package/docs/examples/avatars/get-screenshot.md +35 -0
- package/docs/examples/backups/create-archive.md +4 -4
- package/docs/examples/backups/create-policy.md +9 -9
- package/docs/examples/backups/create-restoration.md +6 -6
- package/docs/examples/backups/delete-archive.md +3 -3
- package/docs/examples/backups/delete-policy.md +3 -3
- package/docs/examples/backups/get-archive.md +3 -3
- package/docs/examples/backups/get-policy.md +3 -3
- package/docs/examples/backups/get-restoration.md +3 -3
- package/docs/examples/backups/list-archives.md +3 -3
- package/docs/examples/backups/list-policies.md +3 -3
- package/docs/examples/backups/list-restorations.md +3 -3
- package/docs/examples/backups/update-policy.md +7 -7
- package/docs/examples/console/create-program-membership.md +3 -3
- package/docs/examples/console/create-source.md +7 -7
- package/docs/examples/console/get-campaign.md +3 -3
- package/docs/examples/console/get-coupon.md +3 -3
- package/docs/examples/console/{plans.md → get-plan.md} +3 -1
- package/docs/examples/console/get-plans.md +13 -0
- package/docs/examples/console/{regions.md → get-program.md} +3 -1
- package/docs/examples/console/get-regions.md +13 -0
- package/docs/examples/console/get-resource.md +4 -4
- package/docs/examples/console/suggest-columns.md +17 -0
- package/docs/examples/console/suggest-indexes.md +16 -0
- package/docs/examples/databases/create-boolean-attribute.md +8 -8
- package/docs/examples/databases/create-collection.md +11 -9
- package/docs/examples/databases/create-datetime-attribute.md +8 -8
- package/docs/examples/databases/create-document.md +16 -11
- package/docs/examples/databases/create-documents.md +7 -6
- package/docs/examples/databases/create-email-attribute.md +8 -8
- package/docs/examples/databases/create-enum-attribute.md +9 -9
- package/docs/examples/databases/create-float-attribute.md +10 -10
- package/docs/examples/databases/create-index.md +9 -9
- package/docs/examples/databases/create-integer-attribute.md +10 -10
- package/docs/examples/databases/create-ip-attribute.md +8 -8
- package/docs/examples/databases/create-line-attribute.md +17 -0
- package/docs/examples/databases/create-operations.md +24 -0
- package/docs/examples/databases/create-point-attribute.md +17 -0
- package/docs/examples/databases/create-polygon-attribute.md +17 -0
- package/docs/examples/databases/create-relationship-attribute.md +10 -10
- package/docs/examples/databases/create-string-attribute.md +10 -10
- package/docs/examples/databases/create-transaction.md +13 -0
- package/docs/examples/databases/create-url-attribute.md +8 -8
- package/docs/examples/databases/create.md +5 -5
- package/docs/examples/databases/decrement-document-attribute.md +9 -8
- package/docs/examples/databases/delete-attribute.md +5 -5
- package/docs/examples/databases/delete-collection.md +4 -4
- package/docs/examples/databases/delete-document.md +6 -5
- package/docs/examples/databases/delete-documents.md +6 -5
- package/docs/examples/databases/delete-index.md +5 -5
- package/docs/examples/databases/{get-database-usage.md → delete-transaction.md} +4 -5
- package/docs/examples/databases/delete.md +3 -3
- package/docs/examples/databases/get-attribute.md +5 -5
- package/docs/examples/databases/get-collection-usage.md +6 -6
- package/docs/examples/databases/get-collection.md +4 -4
- package/docs/examples/databases/get-document.md +7 -6
- package/docs/examples/databases/get-index.md +5 -5
- package/docs/examples/databases/get-transaction.md +13 -0
- package/docs/examples/databases/get-usage.md +5 -4
- package/docs/examples/databases/get.md +3 -3
- package/docs/examples/databases/increment-document-attribute.md +9 -8
- package/docs/examples/databases/list-attributes.md +6 -5
- package/docs/examples/databases/list-collection-logs.md +5 -5
- package/docs/examples/databases/list-collections.md +6 -5
- package/docs/examples/databases/list-document-logs.md +6 -6
- package/docs/examples/databases/list-documents.md +7 -5
- package/docs/examples/databases/list-indexes.md +6 -5
- package/docs/examples/databases/list-logs.md +4 -4
- package/docs/examples/databases/list-transactions.md +13 -0
- package/docs/examples/databases/list-usage.md +13 -0
- package/docs/examples/databases/list.md +5 -4
- package/docs/examples/databases/update-boolean-attribute.md +8 -8
- package/docs/examples/databases/update-collection.md +9 -9
- package/docs/examples/databases/update-datetime-attribute.md +8 -8
- package/docs/examples/databases/update-document.md +15 -8
- package/docs/examples/databases/update-documents.md +13 -6
- package/docs/examples/databases/update-email-attribute.md +8 -8
- package/docs/examples/databases/update-enum-attribute.md +9 -9
- package/docs/examples/databases/update-float-attribute.md +10 -10
- package/docs/examples/databases/update-integer-attribute.md +10 -10
- package/docs/examples/databases/update-ip-attribute.md +8 -8
- package/docs/examples/databases/update-line-attribute.md +18 -0
- package/docs/examples/databases/update-point-attribute.md +18 -0
- package/docs/examples/databases/update-polygon-attribute.md +18 -0
- package/docs/examples/databases/update-relationship-attribute.md +7 -7
- package/docs/examples/databases/update-string-attribute.md +9 -9
- package/docs/examples/databases/update-transaction.md +15 -0
- package/docs/examples/databases/update-url-attribute.md +8 -8
- package/docs/examples/databases/update.md +5 -5
- package/docs/examples/databases/upsert-document.md +15 -8
- package/docs/examples/databases/upsert-documents.md +6 -5
- package/docs/examples/domains/create-preset-google-workspace.md +3 -3
- package/docs/examples/domains/create-preset-i-cloud.md +3 -3
- package/docs/examples/domains/create-preset-mailgun.md +3 -3
- package/docs/examples/domains/create-preset-outlook.md +3 -3
- package/docs/examples/domains/create-preset-proton-mail.md +3 -3
- package/docs/examples/domains/create-preset-zoho.md +3 -3
- package/docs/examples/domains/create-record-a.md +7 -7
- package/docs/examples/domains/{create-record-a-a-a-a.md → create-record-aaaa.md} +7 -7
- package/docs/examples/domains/create-record-alias.md +7 -7
- package/docs/examples/domains/{create-record-n-s.md → create-record-caa.md} +7 -7
- package/docs/examples/domains/{create-record-c-a-a.md → create-record-cname.md} +7 -7
- package/docs/examples/domains/{create-record-h-t-t-p-s.md → create-record-https.md} +7 -7
- package/docs/examples/domains/create-record-mx.md +18 -0
- package/docs/examples/domains/create-record-ns.md +17 -0
- package/docs/examples/domains/create-record-srv.md +20 -0
- package/docs/examples/domains/{create-record-c-n-a-m-e.md → create-record-txt.md} +7 -7
- package/docs/examples/domains/create.md +4 -4
- package/docs/examples/domains/delete-record.md +4 -4
- package/docs/examples/domains/delete.md +3 -3
- package/docs/examples/domains/get-preset-google-workspace.md +3 -3
- package/docs/examples/domains/get-preset-i-cloud.md +3 -3
- package/docs/examples/domains/get-preset-mailgun.md +3 -3
- package/docs/examples/domains/get-preset-outlook.md +3 -3
- package/docs/examples/domains/get-preset-proton-mail.md +3 -3
- package/docs/examples/domains/get-preset-zoho.md +3 -3
- package/docs/examples/domains/get-record.md +4 -4
- package/docs/examples/domains/get-zone.md +3 -3
- package/docs/examples/domains/get.md +3 -3
- package/docs/examples/domains/list-records.md +4 -4
- package/docs/examples/domains/list.md +4 -4
- package/docs/examples/domains/update-nameservers.md +3 -3
- package/docs/examples/domains/update-record-a.md +8 -8
- package/docs/examples/domains/update-record-aaaa.md +18 -0
- package/docs/examples/domains/update-record-alias.md +8 -8
- package/docs/examples/domains/update-record-caa.md +18 -0
- package/docs/examples/domains/update-record-cname.md +18 -0
- package/docs/examples/domains/update-record-https.md +18 -0
- package/docs/examples/domains/update-record-mx.md +19 -0
- package/docs/examples/domains/update-record-ns.md +18 -0
- package/docs/examples/domains/update-record-srv.md +21 -0
- package/docs/examples/domains/update-record-txt.md +18 -0
- package/docs/examples/domains/update-team.md +4 -4
- package/docs/examples/domains/update-zone.md +4 -4
- package/docs/examples/functions/create-deployment.md +7 -7
- package/docs/examples/functions/create-duplicate-deployment.md +5 -5
- package/docs/examples/functions/create-execution.md +9 -9
- package/docs/examples/functions/create-template-deployment.md +10 -9
- package/docs/examples/functions/create-variable.md +6 -6
- package/docs/examples/functions/create-vcs-deployment.md +7 -7
- package/docs/examples/functions/create.md +21 -21
- package/docs/examples/functions/delete-deployment.md +4 -4
- package/docs/examples/functions/delete-execution.md +4 -4
- package/docs/examples/functions/delete-variable.md +4 -4
- package/docs/examples/functions/delete.md +3 -3
- package/docs/examples/functions/get-deployment-download.md +5 -5
- package/docs/examples/functions/get-deployment.md +4 -4
- package/docs/examples/functions/get-execution.md +4 -4
- package/docs/examples/functions/get-template.md +3 -3
- package/docs/examples/functions/get-usage.md +5 -5
- package/docs/examples/functions/get-variable.md +4 -4
- package/docs/examples/functions/get.md +3 -3
- package/docs/examples/functions/list-deployments.md +6 -5
- package/docs/examples/functions/list-executions.md +5 -4
- package/docs/examples/functions/list-templates.md +7 -6
- package/docs/examples/functions/list-usage.md +4 -4
- package/docs/examples/functions/list-variables.md +3 -3
- package/docs/examples/functions/list.md +5 -4
- package/docs/examples/functions/update-deployment-status.md +4 -4
- package/docs/examples/functions/update-function-deployment.md +4 -4
- package/docs/examples/functions/update-variable.md +7 -7
- package/docs/examples/functions/update.md +21 -21
- package/docs/examples/graphql/mutation.md +3 -3
- package/docs/examples/graphql/query.md +3 -3
- package/docs/examples/health/get-certificate.md +3 -3
- package/docs/examples/health/get-failed-jobs.md +5 -5
- package/docs/examples/health/get-queue-billing-project-aggregation.md +3 -3
- package/docs/examples/health/get-queue-billing-team-aggregation.md +3 -3
- package/docs/examples/health/get-queue-builds.md +3 -3
- package/docs/examples/health/get-queue-certificates.md +3 -3
- package/docs/examples/health/get-queue-databases.md +4 -4
- package/docs/examples/health/get-queue-deletes.md +3 -3
- package/docs/examples/health/get-queue-functions.md +3 -3
- package/docs/examples/health/get-queue-logs.md +3 -3
- package/docs/examples/health/get-queue-mails.md +3 -3
- package/docs/examples/health/get-queue-messaging.md +3 -3
- package/docs/examples/health/get-queue-migrations.md +3 -3
- package/docs/examples/health/get-queue-priority-builds.md +3 -3
- package/docs/examples/health/get-queue-region-manager.md +3 -3
- package/docs/examples/health/get-queue-stats-resources.md +3 -3
- package/docs/examples/health/get-queue-threats.md +13 -0
- package/docs/examples/health/get-queue-usage.md +3 -3
- package/docs/examples/health/get-queue-webhooks.md +3 -3
- package/docs/examples/messaging/create-apns-provider.md +10 -10
- package/docs/examples/messaging/create-email.md +14 -14
- package/docs/examples/messaging/create-fcm-provider.md +6 -6
- package/docs/examples/messaging/create-mailgun-provider.md +12 -12
- package/docs/examples/messaging/{create-msg91provider.md → create-msg-91-provider.md} +8 -8
- package/docs/examples/messaging/create-push.md +21 -21
- package/docs/examples/messaging/create-resend-provider.md +20 -0
- package/docs/examples/messaging/create-sendgrid-provider.md +10 -10
- package/docs/examples/messaging/create-sms.md +9 -9
- package/docs/examples/messaging/create-smtp-provider.md +16 -16
- package/docs/examples/messaging/create-subscriber.md +5 -5
- package/docs/examples/messaging/create-telesign-provider.md +8 -8
- package/docs/examples/messaging/create-textmagic-provider.md +8 -8
- package/docs/examples/messaging/create-topic.md +5 -5
- package/docs/examples/messaging/create-twilio-provider.md +8 -8
- package/docs/examples/messaging/create-vonage-provider.md +8 -8
- package/docs/examples/messaging/delete-provider.md +3 -3
- package/docs/examples/messaging/delete-subscriber.md +4 -4
- package/docs/examples/messaging/delete-topic.md +3 -3
- package/docs/examples/messaging/delete.md +3 -3
- package/docs/examples/messaging/get-message.md +3 -3
- package/docs/examples/messaging/get-provider.md +3 -3
- package/docs/examples/messaging/get-subscriber.md +4 -4
- package/docs/examples/messaging/get-topic.md +3 -3
- package/docs/examples/messaging/list-message-logs.md +5 -4
- package/docs/examples/messaging/list-messages.md +5 -4
- package/docs/examples/messaging/list-provider-logs.md +5 -4
- package/docs/examples/messaging/list-providers.md +5 -4
- package/docs/examples/messaging/list-subscriber-logs.md +5 -4
- package/docs/examples/messaging/list-subscribers.md +6 -5
- package/docs/examples/messaging/list-targets.md +5 -4
- package/docs/examples/messaging/list-topic-logs.md +5 -4
- package/docs/examples/messaging/list-topics.md +5 -4
- package/docs/examples/messaging/update-apns-provider.md +10 -10
- package/docs/examples/messaging/update-email.md +14 -14
- package/docs/examples/messaging/update-fcm-provider.md +6 -6
- package/docs/examples/messaging/update-mailgun-provider.md +12 -12
- package/docs/examples/messaging/{update-msg91provider.md → update-msg-91-provider.md} +8 -8
- package/docs/examples/messaging/update-push.md +21 -21
- package/docs/examples/messaging/update-resend-provider.md +20 -0
- package/docs/examples/messaging/update-sendgrid-provider.md +10 -10
- package/docs/examples/messaging/update-sms.md +9 -9
- package/docs/examples/messaging/update-smtp-provider.md +16 -16
- package/docs/examples/messaging/update-telesign-provider.md +8 -8
- package/docs/examples/messaging/update-textmagic-provider.md +8 -8
- package/docs/examples/messaging/update-topic.md +5 -5
- package/docs/examples/messaging/update-twilio-provider.md +8 -8
- package/docs/examples/messaging/update-vonage-provider.md +8 -8
- package/docs/examples/migrations/create-appwrite-migration.md +6 -6
- package/docs/examples/migrations/create-csv-export.md +21 -0
- package/docs/examples/migrations/{create-csv-migration.md → create-csv-import.md} +6 -5
- package/docs/examples/migrations/create-firebase-migration.md +4 -4
- package/docs/examples/migrations/create-n-host-migration.md +10 -10
- package/docs/examples/migrations/create-supabase-migration.md +9 -9
- package/docs/examples/migrations/delete.md +3 -3
- package/docs/examples/migrations/get-appwrite-report.md +6 -6
- package/docs/examples/migrations/get-firebase-report.md +4 -4
- package/docs/examples/migrations/get-n-host-report.md +10 -10
- package/docs/examples/migrations/get-supabase-report.md +9 -9
- package/docs/examples/migrations/get.md +3 -3
- package/docs/examples/migrations/list.md +5 -4
- package/docs/examples/migrations/retry.md +3 -3
- package/docs/examples/organizations/add-credit.md +4 -4
- package/docs/examples/organizations/cancel-downgrade.md +3 -3
- package/docs/examples/organizations/create-downgrade-feedback.md +17 -0
- package/docs/examples/organizations/create-invoice-payment.md +5 -5
- package/docs/examples/organizations/create.md +13 -12
- package/docs/examples/organizations/delete-backup-payment-method.md +3 -3
- package/docs/examples/organizations/delete-billing-address.md +3 -3
- package/docs/examples/organizations/delete-default-payment-method.md +3 -3
- package/docs/examples/organizations/delete.md +3 -3
- package/docs/examples/organizations/estimation-create-organization.md +8 -7
- package/docs/examples/organizations/estimation-delete-organization.md +3 -3
- package/docs/examples/organizations/estimation-update-plan.md +7 -7
- package/docs/examples/organizations/get-aggregation.md +6 -4
- package/docs/examples/organizations/get-available-credits.md +13 -0
- package/docs/examples/organizations/get-billing-address.md +4 -4
- package/docs/examples/organizations/get-credit.md +4 -4
- package/docs/examples/organizations/get-invoice-download.md +4 -4
- package/docs/examples/organizations/get-invoice-view.md +4 -4
- package/docs/examples/organizations/get-invoice.md +4 -4
- package/docs/examples/organizations/get-payment-method.md +4 -4
- package/docs/examples/organizations/get-plan.md +3 -3
- package/docs/examples/organizations/get-scopes.md +3 -3
- package/docs/examples/organizations/get-usage.md +5 -5
- package/docs/examples/organizations/list-aggregations.md +4 -4
- package/docs/examples/organizations/list-credits.md +4 -4
- package/docs/examples/organizations/list-invoices.md +4 -4
- package/docs/examples/organizations/list.md +4 -4
- package/docs/examples/organizations/set-backup-payment-method.md +4 -4
- package/docs/examples/organizations/set-billing-address.md +4 -4
- package/docs/examples/organizations/set-billing-email.md +4 -4
- package/docs/examples/organizations/set-billing-tax-id.md +4 -4
- package/docs/examples/organizations/set-default-payment-method.md +4 -4
- package/docs/examples/organizations/update-budget.md +5 -5
- package/docs/examples/organizations/update-plan.md +11 -11
- package/docs/examples/organizations/update-projects.md +14 -0
- package/docs/examples/organizations/validate-invoice.md +4 -4
- package/docs/examples/organizations/validate-payment.md +4 -4
- package/docs/examples/project/create-variable.md +5 -5
- package/docs/examples/project/delete-variable.md +3 -3
- package/docs/examples/project/get-usage.md +5 -5
- package/docs/examples/project/get-variable.md +3 -3
- package/docs/examples/project/update-variable.md +6 -6
- package/docs/examples/projects/create-dev-key.md +5 -5
- package/docs/examples/projects/{create-j-w-t.md → create-jwt.md} +5 -5
- package/docs/examples/projects/create-key.md +6 -6
- package/docs/examples/projects/create-platform.md +8 -8
- package/docs/examples/projects/create-smtp-test.md +12 -12
- package/docs/examples/projects/create-webhook.md +10 -10
- package/docs/examples/projects/create.md +16 -16
- package/docs/examples/projects/delete-dev-key.md +4 -4
- package/docs/examples/projects/delete-email-template.md +5 -5
- package/docs/examples/projects/delete-key.md +4 -4
- package/docs/examples/projects/delete-platform.md +4 -4
- package/docs/examples/projects/delete-sms-template.md +5 -5
- package/docs/examples/projects/delete-webhook.md +4 -4
- package/docs/examples/projects/delete.md +3 -3
- package/docs/examples/projects/get-dev-key.md +4 -4
- package/docs/examples/projects/get-email-template.md +5 -5
- package/docs/examples/projects/get-key.md +4 -4
- package/docs/examples/projects/get-platform.md +4 -4
- package/docs/examples/projects/get-sms-template.md +5 -5
- package/docs/examples/projects/get-webhook.md +4 -4
- package/docs/examples/projects/get.md +3 -3
- package/docs/examples/projects/list-dev-keys.md +4 -4
- package/docs/examples/projects/list-keys.md +4 -3
- package/docs/examples/projects/list-platforms.md +4 -3
- package/docs/examples/projects/list-webhooks.md +4 -3
- package/docs/examples/projects/list.md +5 -4
- package/docs/examples/projects/update-api-status-all.md +4 -4
- package/docs/examples/projects/update-api-status.md +6 -6
- package/docs/examples/projects/update-auth-duration.md +4 -4
- package/docs/examples/projects/update-auth-limit.md +4 -4
- package/docs/examples/projects/update-auth-password-dictionary.md +4 -4
- package/docs/examples/projects/update-auth-password-history.md +4 -4
- package/docs/examples/projects/update-auth-sessions-limit.md +4 -4
- package/docs/examples/projects/update-auth-status.md +5 -5
- package/docs/examples/projects/update-dev-key.md +6 -6
- package/docs/examples/projects/update-email-template.md +10 -10
- package/docs/examples/projects/update-key.md +7 -7
- package/docs/examples/projects/update-memberships-privacy.md +6 -6
- package/docs/examples/projects/update-mock-numbers.md +4 -4
- package/docs/examples/projects/{update-o-auth2.md → update-o-auth-2.md} +7 -7
- package/docs/examples/projects/update-personal-data-check.md +4 -4
- package/docs/examples/projects/update-platform.md +8 -8
- package/docs/examples/projects/update-service-status-all.md +4 -4
- package/docs/examples/projects/update-service-status.md +5 -5
- package/docs/examples/projects/update-session-alerts.md +4 -4
- package/docs/examples/projects/update-session-invalidation.md +14 -0
- package/docs/examples/projects/update-sms-template.md +6 -6
- package/docs/examples/projects/update-smtp.md +12 -12
- package/docs/examples/projects/update-status.md +14 -0
- package/docs/examples/projects/update-team.md +4 -4
- package/docs/examples/projects/update-webhook-signature.md +4 -4
- package/docs/examples/projects/update-webhook.md +11 -11
- package/docs/examples/projects/update.md +13 -13
- package/docs/examples/proxy/{create-a-p-i-rule.md → create-api-rule.md} +3 -3
- package/docs/examples/proxy/create-function-rule.md +5 -5
- package/docs/examples/proxy/create-redirect-rule.md +8 -8
- package/docs/examples/proxy/create-site-rule.md +5 -5
- package/docs/examples/proxy/delete-rule.md +3 -3
- package/docs/examples/proxy/get-rule.md +3 -3
- package/docs/examples/proxy/list-rules.md +5 -4
- package/docs/examples/proxy/update-rule-verification.md +3 -3
- package/docs/examples/sites/create-deployment.md +8 -8
- package/docs/examples/sites/create-duplicate-deployment.md +4 -4
- package/docs/examples/sites/create-template-deployment.md +10 -9
- package/docs/examples/sites/create-variable.md +6 -6
- package/docs/examples/sites/create-vcs-deployment.md +7 -7
- package/docs/examples/sites/create.md +21 -21
- package/docs/examples/sites/delete-deployment.md +4 -4
- package/docs/examples/sites/delete-log.md +4 -4
- package/docs/examples/sites/delete-variable.md +4 -4
- package/docs/examples/sites/delete.md +3 -3
- package/docs/examples/sites/get-deployment-download.md +5 -5
- package/docs/examples/sites/get-deployment.md +4 -4
- package/docs/examples/sites/get-log.md +4 -4
- package/docs/examples/sites/get-template.md +3 -3
- package/docs/examples/sites/get-usage.md +5 -5
- package/docs/examples/sites/get-variable.md +4 -4
- package/docs/examples/sites/get.md +3 -3
- package/docs/examples/sites/list-deployments.md +6 -5
- package/docs/examples/sites/list-logs.md +5 -4
- package/docs/examples/sites/list-templates.md +6 -6
- package/docs/examples/sites/list-usage.md +4 -4
- package/docs/examples/sites/list-variables.md +3 -3
- package/docs/examples/sites/list.md +5 -4
- package/docs/examples/sites/update-deployment-status.md +4 -4
- package/docs/examples/sites/update-site-deployment.md +4 -4
- package/docs/examples/sites/update-variable.md +7 -7
- package/docs/examples/sites/update.md +21 -21
- package/docs/examples/storage/create-bucket.md +14 -13
- package/docs/examples/storage/create-file.md +7 -7
- package/docs/examples/storage/delete-bucket.md +3 -3
- package/docs/examples/storage/delete-file.md +4 -4
- package/docs/examples/storage/get-bucket-usage.md +5 -5
- package/docs/examples/storage/get-bucket.md +3 -3
- package/docs/examples/storage/get-file-download.md +5 -5
- package/docs/examples/storage/get-file-preview.md +16 -16
- package/docs/examples/storage/get-file-view.md +5 -5
- package/docs/examples/storage/get-file.md +4 -4
- package/docs/examples/storage/get-usage.md +4 -4
- package/docs/examples/storage/list-buckets.md +5 -4
- package/docs/examples/storage/list-files.md +6 -5
- package/docs/examples/storage/update-bucket.md +14 -13
- package/docs/examples/storage/update-file.md +7 -7
- package/docs/examples/tablesdb/create-boolean-column.md +18 -0
- package/docs/examples/tablesdb/create-datetime-column.md +18 -0
- package/docs/examples/tablesdb/create-email-column.md +18 -0
- package/docs/examples/tablesdb/create-enum-column.md +19 -0
- package/docs/examples/tablesdb/create-float-column.md +20 -0
- package/docs/examples/tablesdb/create-index.md +19 -0
- package/docs/examples/tablesdb/create-integer-column.md +20 -0
- package/docs/examples/tablesdb/create-ip-column.md +18 -0
- package/docs/examples/tablesdb/create-line-column.md +17 -0
- package/docs/examples/tablesdb/create-operations.md +24 -0
- package/docs/examples/tablesdb/create-point-column.md +17 -0
- package/docs/examples/tablesdb/create-polygon-column.md +17 -0
- package/docs/examples/tablesdb/create-relationship-column.md +20 -0
- package/docs/examples/tablesdb/create-row.md +24 -0
- package/docs/examples/tablesdb/create-rows.md +16 -0
- package/docs/examples/tablesdb/create-string-column.md +20 -0
- package/docs/examples/tablesdb/create-table.md +20 -0
- package/docs/examples/tablesdb/create-transaction.md +13 -0
- package/docs/examples/tablesdb/create-url-column.md +18 -0
- package/docs/examples/tablesdb/create.md +15 -0
- package/docs/examples/tablesdb/decrement-row-column.md +19 -0
- package/docs/examples/tablesdb/delete-column.md +15 -0
- package/docs/examples/tablesdb/delete-index.md +15 -0
- package/docs/examples/tablesdb/delete-row.md +16 -0
- package/docs/examples/tablesdb/delete-rows.md +16 -0
- package/docs/examples/tablesdb/delete-table.md +14 -0
- package/docs/examples/tablesdb/delete-transaction.md +13 -0
- package/docs/examples/tablesdb/delete.md +13 -0
- package/docs/examples/tablesdb/get-column.md +15 -0
- package/docs/examples/tablesdb/get-index.md +15 -0
- package/docs/examples/tablesdb/get-row.md +17 -0
- package/docs/examples/tablesdb/get-table-usage.md +15 -0
- package/docs/examples/tablesdb/get-table.md +14 -0
- package/docs/examples/tablesdb/get-transaction.md +13 -0
- package/docs/examples/tablesdb/get-usage.md +14 -0
- package/docs/examples/tablesdb/get.md +13 -0
- package/docs/examples/tablesdb/increment-row-column.md +19 -0
- package/docs/examples/tablesdb/list-columns.md +16 -0
- package/docs/examples/tablesdb/list-indexes.md +16 -0
- package/docs/examples/tablesdb/list-row-logs.md +16 -0
- package/docs/examples/tablesdb/list-rows.md +17 -0
- package/docs/examples/tablesdb/list-table-logs.md +15 -0
- package/docs/examples/tablesdb/list-tables.md +16 -0
- package/docs/examples/tablesdb/list-transactions.md +13 -0
- package/docs/examples/tablesdb/list-usage.md +13 -0
- package/docs/examples/tablesdb/list.md +15 -0
- package/docs/examples/tablesdb/update-boolean-column.md +18 -0
- package/docs/examples/tablesdb/update-datetime-column.md +18 -0
- package/docs/examples/tablesdb/update-email-column.md +18 -0
- package/docs/examples/tablesdb/update-enum-column.md +19 -0
- package/docs/examples/tablesdb/update-float-column.md +20 -0
- package/docs/examples/tablesdb/update-integer-column.md +20 -0
- package/docs/examples/tablesdb/update-ip-column.md +18 -0
- package/docs/examples/tablesdb/update-line-column.md +18 -0
- package/docs/examples/tablesdb/update-point-column.md +18 -0
- package/docs/examples/tablesdb/update-polygon-column.md +18 -0
- package/docs/examples/tablesdb/update-relationship-column.md +17 -0
- package/docs/examples/tablesdb/update-row.md +24 -0
- package/docs/examples/tablesdb/update-rows.md +23 -0
- package/docs/examples/tablesdb/update-string-column.md +19 -0
- package/docs/examples/tablesdb/update-table.md +18 -0
- package/docs/examples/tablesdb/update-transaction.md +15 -0
- package/docs/examples/tablesdb/update-url-column.md +18 -0
- package/docs/examples/tablesdb/update.md +15 -0
- package/docs/examples/tablesdb/upsert-row.md +24 -0
- package/docs/examples/tablesdb/upsert-rows.md +16 -0
- package/docs/examples/teams/create-membership.md +9 -9
- package/docs/examples/teams/create.md +5 -5
- package/docs/examples/teams/delete-membership.md +4 -4
- package/docs/examples/teams/delete.md +3 -3
- package/docs/examples/teams/get-membership.md +4 -4
- package/docs/examples/teams/get-prefs.md +3 -3
- package/docs/examples/teams/get.md +3 -3
- package/docs/examples/teams/list-logs.md +5 -4
- package/docs/examples/teams/list-memberships.md +6 -5
- package/docs/examples/teams/list.md +5 -4
- package/docs/examples/teams/update-membership-status.md +6 -6
- package/docs/examples/teams/update-membership.md +5 -5
- package/docs/examples/teams/update-name.md +4 -4
- package/docs/examples/teams/update-prefs.md +4 -4
- package/docs/examples/tokens/create-file-token.md +5 -5
- package/docs/examples/tokens/delete.md +3 -3
- package/docs/examples/tokens/get.md +3 -3
- package/docs/examples/tokens/list.md +6 -5
- package/docs/examples/tokens/update.md +4 -4
- package/docs/examples/users/{create-m-d5user.md → create-argon-2-user.md} +6 -6
- package/docs/examples/users/create-bcrypt-user.md +6 -6
- package/docs/examples/users/{create-j-w-t.md → create-jwt.md} +5 -5
- package/docs/examples/users/{create-argon2user.md → create-md-5-user.md} +6 -6
- package/docs/examples/users/create-mfa-recovery-codes.md +3 -3
- package/docs/examples/users/{create-p-h-pass-user.md → create-ph-pass-user.md} +6 -6
- package/docs/examples/users/create-scrypt-modified-user.md +9 -9
- package/docs/examples/users/create-scrypt-user.md +11 -11
- package/docs/examples/users/create-session.md +3 -3
- package/docs/examples/users/{create-s-h-a-user.md → create-sha-user.md} +7 -7
- package/docs/examples/users/create-target.md +8 -8
- package/docs/examples/users/create-token.md +5 -5
- package/docs/examples/users/create.md +7 -7
- package/docs/examples/users/delete-identity.md +3 -3
- package/docs/examples/users/delete-mfa-authenticator.md +4 -4
- package/docs/examples/users/delete-session.md +4 -4
- package/docs/examples/users/delete-sessions.md +3 -3
- package/docs/examples/users/delete-target.md +4 -4
- package/docs/examples/users/delete.md +3 -3
- package/docs/examples/users/get-mfa-recovery-codes.md +3 -3
- package/docs/examples/users/get-prefs.md +3 -3
- package/docs/examples/users/get-target.md +4 -4
- package/docs/examples/users/get-usage.md +4 -4
- package/docs/examples/users/get.md +3 -3
- package/docs/examples/users/list-identities.md +5 -4
- package/docs/examples/users/list-logs.md +5 -4
- package/docs/examples/users/list-memberships.md +6 -5
- package/docs/examples/users/list-mfa-factors.md +3 -3
- package/docs/examples/users/list-sessions.md +4 -3
- package/docs/examples/users/list-targets.md +5 -4
- package/docs/examples/users/list.md +5 -4
- package/docs/examples/users/update-email-verification.md +4 -4
- package/docs/examples/users/update-email.md +4 -4
- package/docs/examples/users/update-labels.md +4 -4
- package/docs/examples/users/update-mfa-recovery-codes.md +3 -3
- package/docs/examples/users/update-mfa.md +4 -4
- package/docs/examples/users/update-name.md +4 -4
- package/docs/examples/users/update-password.md +4 -4
- package/docs/examples/users/update-phone-verification.md +4 -4
- package/docs/examples/users/update-phone.md +4 -4
- package/docs/examples/users/update-prefs.md +4 -4
- package/docs/examples/users/update-status.md +4 -4
- package/docs/examples/users/update-target.md +7 -7
- package/docs/examples/vcs/create-repository-detection.md +6 -6
- package/docs/examples/vcs/create-repository.md +5 -5
- package/docs/examples/vcs/delete-installation.md +3 -3
- package/docs/examples/vcs/get-installation.md +3 -3
- package/docs/examples/vcs/get-repository-contents.md +6 -5
- package/docs/examples/vcs/get-repository.md +4 -4
- package/docs/examples/vcs/list-installations.md +5 -4
- package/docs/examples/vcs/list-repositories.md +6 -5
- package/docs/examples/vcs/list-repository-branches.md +4 -4
- package/docs/examples/vcs/update-external-deployments.md +5 -5
- package/package.json +4 -4
- package/src/client.ts +42 -7
- package/src/enums/api-service.ts +1 -0
- package/src/enums/attribute-status.ts +7 -0
- package/src/enums/billing-plan-group.ts +5 -0
- package/src/enums/build-runtime.ts +2 -0
- package/src/enums/column-status.ts +7 -0
- package/src/enums/credit-card.ts +1 -1
- package/src/enums/database-type.ts +4 -0
- package/src/enums/deployment-status.ts +7 -0
- package/src/enums/execution-method.ts +1 -0
- package/src/enums/execution-status.ts +7 -0
- package/src/enums/execution-trigger.ts +5 -0
- package/src/enums/framework.ts +1 -0
- package/src/enums/health-antivirus-status.ts +5 -0
- package/src/enums/health-check-status.ts +4 -0
- package/src/enums/index-status.ts +7 -0
- package/src/enums/index-type.ts +1 -0
- package/src/enums/message-status.ts +7 -0
- package/src/enums/o-auth-provider.ts +3 -0
- package/src/enums/platform.ts +4 -0
- package/src/enums/proxy-rule-deployment-resource-type.ts +4 -0
- package/src/enums/proxy-rule-status.ts +6 -0
- package/src/enums/region.ts +3 -0
- package/src/enums/runtime.ts +2 -0
- package/src/enums/status.ts +4 -0
- package/src/enums/template-reference-type.ts +5 -0
- package/src/enums/theme.ts +4 -0
- package/src/enums/timezone.ts +421 -0
- package/src/enums/{user-usage-range.ts → usage-range.ts} +1 -1
- package/src/enums/{v-c-s-deployment-type.ts → vcs-reference-type.ts} +1 -1
- package/src/index.ts +27 -11
- package/src/models.ts +1925 -239
- package/src/operator.ts +308 -0
- package/src/query.ts +246 -2
- package/src/services/account.ts +2278 -235
- package/src/services/assistant.ts +29 -3
- package/src/services/avatars.ts +511 -52
- package/src/services/backups.ts +400 -42
- package/src/services/console.ts +499 -19
- package/src/services/databases.ts +3584 -430
- package/src/services/domains.ts +1795 -266
- package/src/services/functions.ts +1197 -155
- package/src/services/graphql.ts +56 -4
- package/src/services/health.ts +586 -42
- package/src/services/locale.ts +18 -2
- package/src/services/messaging.ts +3418 -386
- package/src/services/migrations.ts +653 -65
- package/src/services/organizations.ts +1411 -126
- package/src/services/project.ts +173 -17
- package/src/services/projects.ts +2808 -282
- package/src/services/proxy.ts +272 -26
- package/src/services/realtime.ts +437 -0
- package/src/services/sites.ts +1129 -143
- package/src/services/storage.ts +672 -89
- package/src/services/tables-db.ts +5439 -0
- package/src/services/teams.ts +535 -65
- package/src/services/tokens.ts +171 -16
- package/src/services/users.ts +1916 -182
- package/src/services/vcs.ts +373 -41
- package/types/client.d.ts +14 -5
- package/types/enums/api-service.d.ts +1 -0
- package/types/enums/attribute-status.d.ts +7 -0
- package/types/enums/billing-plan-group.d.ts +5 -0
- package/types/enums/build-runtime.d.ts +3 -1
- package/types/enums/column-status.d.ts +7 -0
- package/types/enums/credit-card.d.ts +1 -1
- package/types/enums/database-type.d.ts +4 -0
- package/types/enums/deployment-status.d.ts +7 -0
- package/types/enums/execution-method.d.ts +2 -1
- package/types/enums/execution-status.d.ts +7 -0
- package/types/enums/execution-trigger.d.ts +5 -0
- package/types/enums/framework.d.ts +1 -0
- package/types/enums/health-antivirus-status.d.ts +5 -0
- package/types/enums/health-check-status.d.ts +4 -0
- package/types/enums/index-status.d.ts +7 -0
- package/types/enums/index-type.d.ts +2 -1
- package/types/enums/message-status.d.ts +7 -0
- package/types/enums/o-auth-provider.d.ts +4 -1
- package/types/enums/platform.d.ts +4 -0
- package/types/enums/proxy-rule-deployment-resource-type.d.ts +4 -0
- package/types/enums/proxy-rule-status.d.ts +6 -0
- package/types/enums/region.d.ts +4 -1
- package/types/enums/runtime.d.ts +3 -1
- package/types/enums/status.d.ts +4 -0
- package/types/enums/template-reference-type.d.ts +5 -0
- package/types/enums/theme.d.ts +4 -0
- package/types/enums/timezone.d.ts +421 -0
- package/types/enums/{site-usage-range.d.ts → usage-range.d.ts} +1 -1
- package/types/enums/{v-c-s-deployment-type.d.ts → vcs-reference-type.d.ts} +1 -1
- package/types/index.d.ts +27 -11
- package/types/models.d.ts +1877 -422
- package/types/operator.d.ts +180 -0
- package/types/query.d.ts +198 -2
- package/types/services/account.d.ts +1020 -158
- package/types/services/assistant.d.ts +13 -2
- package/types/services/avatars.d.ts +263 -45
- package/types/services/backups.d.ts +190 -30
- package/types/services/console.d.ts +202 -15
- package/types/services/databases.d.ts +1756 -299
- package/types/services/domains.d.ts +971 -219
- package/types/services/functions.d.ts +622 -131
- package/types/services/graphql.d.ts +24 -2
- package/types/services/health.d.ts +246 -24
- package/types/services/locale.d.ts +2 -2
- package/types/services/messaging.d.ts +1670 -281
- package/types/services/migrations.d.ts +319 -53
- package/types/services/organizations.d.ts +664 -109
- package/types/services/project.d.ts +81 -12
- package/types/services/projects.d.ts +1308 -202
- package/types/services/proxy.d.ts +128 -19
- package/types/services/realtime.d.ts +118 -0
- package/types/services/sites.d.ts +580 -119
- package/types/services/storage.d.ts +362 -81
- package/types/services/tables-db.d.ts +2040 -0
- package/types/services/teams.d.ts +277 -61
- package/types/services/tokens.d.ts +80 -12
- package/types/services/users.d.ts +906 -149
- package/types/services/vcs.d.ts +182 -34
- package/docs/examples/domains/create-record-m-x.md +0 -18
- package/docs/examples/domains/create-record-s-r-v.md +0 -20
- package/docs/examples/domains/create-record-t-x-t.md +0 -17
- package/docs/examples/domains/update-record-a-a-a-a.md +0 -18
- package/docs/examples/domains/update-record-c-a-a.md +0 -18
- package/docs/examples/domains/update-record-c-n-a-m-e.md +0 -18
- package/docs/examples/domains/update-record-h-t-t-p-s.md +0 -18
- package/docs/examples/domains/update-record-m-x.md +0 -19
- package/docs/examples/domains/update-record-n-s.md +0 -18
- package/docs/examples/domains/update-record-s-r-v.md +0 -21
- package/docs/examples/domains/update-record-t-x-t.md +0 -18
- package/src/enums/billing-plan.ts +0 -5
- package/src/enums/database-usage-range.ts +0 -5
- package/src/enums/function-usage-range.ts +0 -5
- package/src/enums/site-usage-range.ts +0 -5
- package/src/enums/storage-usage-range.ts +0 -5
- package/types/enums/billing-plan.d.ts +0 -5
- package/types/enums/database-usage-range.d.ts +0 -5
- package/types/enums/function-usage-range.d.ts +0 -5
- package/types/enums/storage-usage-range.d.ts +0 -5
- package/types/enums/user-usage-range.d.ts +0 -5
- /package/docs/examples/health/{get-d-b.md → get-db.md} +0 -0
- /package/docs/examples/locale/{list-countries-e-u.md → list-countries-eu.md} +0 -0
- /package/src/enums/{s-m-t-p-secure.ts → smtp-secure.ts} +0 -0
- /package/src/enums/{v-c-s-detection-type.ts → vcs-detection-type.ts} +0 -0
- /package/types/enums/{s-m-t-p-secure.d.ts → smtp-secure.d.ts} +0 -0
- /package/types/enums/{v-c-s-detection-type.d.ts → vcs-detection-type.d.ts} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Service } from '../service';
|
|
2
2
|
import { AppwriteException, Client, type Payload, UploadProgress } from '../client';
|
|
3
3
|
import type { Models } from '../models';
|
|
4
|
+
|
|
4
5
|
import { MessagePriority } from '../enums/message-priority';
|
|
5
6
|
import { SmtpEncryption } from '../enums/smtp-encryption';
|
|
6
7
|
|
|
@@ -14,12 +15,45 @@ export class Messaging {
|
|
|
14
15
|
/**
|
|
15
16
|
* Get a list of all messages from the current Appwrite project.
|
|
16
17
|
*
|
|
17
|
-
* @param {string[]} queries
|
|
18
|
-
* @param {string} search
|
|
18
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: scheduledAt, deliveredAt, deliveredTotal, status, description, providerType
|
|
19
|
+
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
|
20
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
21
|
+
* @throws {AppwriteException}
|
|
22
|
+
* @returns {Promise<Models.MessageList>}
|
|
23
|
+
*/
|
|
24
|
+
listMessages(params?: { queries?: string[], search?: string, total?: boolean }): Promise<Models.MessageList>;
|
|
25
|
+
/**
|
|
26
|
+
* Get a list of all messages from the current Appwrite project.
|
|
27
|
+
*
|
|
28
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: scheduledAt, deliveredAt, deliveredTotal, status, description, providerType
|
|
29
|
+
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
|
30
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
19
31
|
* @throws {AppwriteException}
|
|
20
32
|
* @returns {Promise<Models.MessageList>}
|
|
33
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
21
34
|
*/
|
|
22
|
-
listMessages(queries?: string[], search?: string): Promise<Models.MessageList
|
|
35
|
+
listMessages(queries?: string[], search?: string, total?: boolean): Promise<Models.MessageList>;
|
|
36
|
+
listMessages(
|
|
37
|
+
paramsOrFirst?: { queries?: string[], search?: string, total?: boolean } | string[],
|
|
38
|
+
...rest: [(string)?, (boolean)?]
|
|
39
|
+
): Promise<Models.MessageList> {
|
|
40
|
+
let params: { queries?: string[], search?: string, total?: boolean };
|
|
41
|
+
|
|
42
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
43
|
+
params = (paramsOrFirst || {}) as { queries?: string[], search?: string, total?: boolean };
|
|
44
|
+
} else {
|
|
45
|
+
params = {
|
|
46
|
+
queries: paramsOrFirst as string[],
|
|
47
|
+
search: rest[0] as string,
|
|
48
|
+
total: rest[1] as boolean
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const queries = params.queries;
|
|
53
|
+
const search = params.search;
|
|
54
|
+
const total = params.total;
|
|
55
|
+
|
|
56
|
+
|
|
23
57
|
const apiPath = '/messaging/messages';
|
|
24
58
|
const payload: Payload = {};
|
|
25
59
|
if (typeof queries !== 'undefined') {
|
|
@@ -28,6 +62,9 @@ export class Messaging {
|
|
|
28
62
|
if (typeof search !== 'undefined') {
|
|
29
63
|
payload['search'] = search;
|
|
30
64
|
}
|
|
65
|
+
if (typeof total !== 'undefined') {
|
|
66
|
+
payload['total'] = total;
|
|
67
|
+
}
|
|
31
68
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
32
69
|
|
|
33
70
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -40,25 +77,84 @@ export class Messaging {
|
|
|
40
77
|
payload
|
|
41
78
|
);
|
|
42
79
|
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Create a new email message.
|
|
83
|
+
*
|
|
84
|
+
* @param {string} params.messageId - Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
85
|
+
* @param {string} params.subject - Email Subject.
|
|
86
|
+
* @param {string} params.content - Email Content.
|
|
87
|
+
* @param {string[]} params.topics - List of Topic IDs.
|
|
88
|
+
* @param {string[]} params.users - List of User IDs.
|
|
89
|
+
* @param {string[]} params.targets - List of Targets IDs.
|
|
90
|
+
* @param {string[]} params.cc - Array of target IDs to be added as CC.
|
|
91
|
+
* @param {string[]} params.bcc - Array of target IDs to be added as BCC.
|
|
92
|
+
* @param {string[]} params.attachments - Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>.
|
|
93
|
+
* @param {boolean} params.draft - Is message a draft
|
|
94
|
+
* @param {boolean} params.html - Is content of type HTML
|
|
95
|
+
* @param {string} params.scheduledAt - Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
|
|
96
|
+
* @throws {AppwriteException}
|
|
97
|
+
* @returns {Promise<Models.Message>}
|
|
98
|
+
*/
|
|
99
|
+
createEmail(params: { messageId: string, subject: string, content: string, topics?: string[], users?: string[], targets?: string[], cc?: string[], bcc?: string[], attachments?: string[], draft?: boolean, html?: boolean, scheduledAt?: string }): Promise<Models.Message>;
|
|
43
100
|
/**
|
|
44
101
|
* Create a new email message.
|
|
45
102
|
*
|
|
46
|
-
* @param {string} messageId
|
|
47
|
-
* @param {string} subject
|
|
48
|
-
* @param {string} content
|
|
49
|
-
* @param {string[]} topics
|
|
50
|
-
* @param {string[]} users
|
|
51
|
-
* @param {string[]} targets
|
|
52
|
-
* @param {string[]} cc
|
|
53
|
-
* @param {string[]} bcc
|
|
54
|
-
* @param {string[]} attachments
|
|
55
|
-
* @param {boolean} draft
|
|
56
|
-
* @param {boolean} html
|
|
57
|
-
* @param {string} scheduledAt
|
|
103
|
+
* @param {string} messageId - Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
104
|
+
* @param {string} subject - Email Subject.
|
|
105
|
+
* @param {string} content - Email Content.
|
|
106
|
+
* @param {string[]} topics - List of Topic IDs.
|
|
107
|
+
* @param {string[]} users - List of User IDs.
|
|
108
|
+
* @param {string[]} targets - List of Targets IDs.
|
|
109
|
+
* @param {string[]} cc - Array of target IDs to be added as CC.
|
|
110
|
+
* @param {string[]} bcc - Array of target IDs to be added as BCC.
|
|
111
|
+
* @param {string[]} attachments - Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>.
|
|
112
|
+
* @param {boolean} draft - Is message a draft
|
|
113
|
+
* @param {boolean} html - Is content of type HTML
|
|
114
|
+
* @param {string} scheduledAt - Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
|
|
58
115
|
* @throws {AppwriteException}
|
|
59
116
|
* @returns {Promise<Models.Message>}
|
|
117
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
60
118
|
*/
|
|
61
|
-
createEmail(messageId: string, subject: string, content: string, topics?: string[], users?: string[], targets?: string[], cc?: string[], bcc?: string[], attachments?: string[], draft?: boolean, html?: boolean, scheduledAt?: string): Promise<Models.Message
|
|
119
|
+
createEmail(messageId: string, subject: string, content: string, topics?: string[], users?: string[], targets?: string[], cc?: string[], bcc?: string[], attachments?: string[], draft?: boolean, html?: boolean, scheduledAt?: string): Promise<Models.Message>;
|
|
120
|
+
createEmail(
|
|
121
|
+
paramsOrFirst: { messageId: string, subject: string, content: string, topics?: string[], users?: string[], targets?: string[], cc?: string[], bcc?: string[], attachments?: string[], draft?: boolean, html?: boolean, scheduledAt?: string } | string,
|
|
122
|
+
...rest: [(string)?, (string)?, (string[])?, (string[])?, (string[])?, (string[])?, (string[])?, (string[])?, (boolean)?, (boolean)?, (string)?]
|
|
123
|
+
): Promise<Models.Message> {
|
|
124
|
+
let params: { messageId: string, subject: string, content: string, topics?: string[], users?: string[], targets?: string[], cc?: string[], bcc?: string[], attachments?: string[], draft?: boolean, html?: boolean, scheduledAt?: string };
|
|
125
|
+
|
|
126
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
127
|
+
params = (paramsOrFirst || {}) as { messageId: string, subject: string, content: string, topics?: string[], users?: string[], targets?: string[], cc?: string[], bcc?: string[], attachments?: string[], draft?: boolean, html?: boolean, scheduledAt?: string };
|
|
128
|
+
} else {
|
|
129
|
+
params = {
|
|
130
|
+
messageId: paramsOrFirst as string,
|
|
131
|
+
subject: rest[0] as string,
|
|
132
|
+
content: rest[1] as string,
|
|
133
|
+
topics: rest[2] as string[],
|
|
134
|
+
users: rest[3] as string[],
|
|
135
|
+
targets: rest[4] as string[],
|
|
136
|
+
cc: rest[5] as string[],
|
|
137
|
+
bcc: rest[6] as string[],
|
|
138
|
+
attachments: rest[7] as string[],
|
|
139
|
+
draft: rest[8] as boolean,
|
|
140
|
+
html: rest[9] as boolean,
|
|
141
|
+
scheduledAt: rest[10] as string
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const messageId = params.messageId;
|
|
146
|
+
const subject = params.subject;
|
|
147
|
+
const content = params.content;
|
|
148
|
+
const topics = params.topics;
|
|
149
|
+
const users = params.users;
|
|
150
|
+
const targets = params.targets;
|
|
151
|
+
const cc = params.cc;
|
|
152
|
+
const bcc = params.bcc;
|
|
153
|
+
const attachments = params.attachments;
|
|
154
|
+
const draft = params.draft;
|
|
155
|
+
const html = params.html;
|
|
156
|
+
const scheduledAt = params.scheduledAt;
|
|
157
|
+
|
|
62
158
|
if (typeof messageId === 'undefined') {
|
|
63
159
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
64
160
|
}
|
|
@@ -68,6 +164,7 @@ export class Messaging {
|
|
|
68
164
|
if (typeof content === 'undefined') {
|
|
69
165
|
throw new AppwriteException('Missing required parameter: "content"');
|
|
70
166
|
}
|
|
167
|
+
|
|
71
168
|
const apiPath = '/messaging/messages/email';
|
|
72
169
|
const payload: Payload = {};
|
|
73
170
|
if (typeof messageId !== 'undefined') {
|
|
@@ -119,29 +216,90 @@ export class Messaging {
|
|
|
119
216
|
payload
|
|
120
217
|
);
|
|
121
218
|
}
|
|
219
|
+
|
|
122
220
|
/**
|
|
123
221
|
* Update an email message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.
|
|
124
|
-
|
|
222
|
+
*
|
|
223
|
+
*
|
|
224
|
+
* @param {string} params.messageId - Message ID.
|
|
225
|
+
* @param {string[]} params.topics - List of Topic IDs.
|
|
226
|
+
* @param {string[]} params.users - List of User IDs.
|
|
227
|
+
* @param {string[]} params.targets - List of Targets IDs.
|
|
228
|
+
* @param {string} params.subject - Email Subject.
|
|
229
|
+
* @param {string} params.content - Email Content.
|
|
230
|
+
* @param {boolean} params.draft - Is message a draft
|
|
231
|
+
* @param {boolean} params.html - Is content of type HTML
|
|
232
|
+
* @param {string[]} params.cc - Array of target IDs to be added as CC.
|
|
233
|
+
* @param {string[]} params.bcc - Array of target IDs to be added as BCC.
|
|
234
|
+
* @param {string} params.scheduledAt - Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
|
|
235
|
+
* @param {string[]} params.attachments - Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>.
|
|
236
|
+
* @throws {AppwriteException}
|
|
237
|
+
* @returns {Promise<Models.Message>}
|
|
238
|
+
*/
|
|
239
|
+
updateEmail(params: { messageId: string, topics?: string[], users?: string[], targets?: string[], subject?: string, content?: string, draft?: boolean, html?: boolean, cc?: string[], bcc?: string[], scheduledAt?: string, attachments?: string[] }): Promise<Models.Message>;
|
|
240
|
+
/**
|
|
241
|
+
* Update an email message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.
|
|
242
|
+
*
|
|
125
243
|
*
|
|
126
|
-
* @param {string} messageId
|
|
127
|
-
* @param {string[]} topics
|
|
128
|
-
* @param {string[]} users
|
|
129
|
-
* @param {string[]} targets
|
|
130
|
-
* @param {string} subject
|
|
131
|
-
* @param {string} content
|
|
132
|
-
* @param {boolean} draft
|
|
133
|
-
* @param {boolean} html
|
|
134
|
-
* @param {string[]} cc
|
|
135
|
-
* @param {string[]} bcc
|
|
136
|
-
* @param {string} scheduledAt
|
|
137
|
-
* @param {string[]} attachments
|
|
244
|
+
* @param {string} messageId - Message ID.
|
|
245
|
+
* @param {string[]} topics - List of Topic IDs.
|
|
246
|
+
* @param {string[]} users - List of User IDs.
|
|
247
|
+
* @param {string[]} targets - List of Targets IDs.
|
|
248
|
+
* @param {string} subject - Email Subject.
|
|
249
|
+
* @param {string} content - Email Content.
|
|
250
|
+
* @param {boolean} draft - Is message a draft
|
|
251
|
+
* @param {boolean} html - Is content of type HTML
|
|
252
|
+
* @param {string[]} cc - Array of target IDs to be added as CC.
|
|
253
|
+
* @param {string[]} bcc - Array of target IDs to be added as BCC.
|
|
254
|
+
* @param {string} scheduledAt - Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
|
|
255
|
+
* @param {string[]} attachments - Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>.
|
|
138
256
|
* @throws {AppwriteException}
|
|
139
257
|
* @returns {Promise<Models.Message>}
|
|
258
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
140
259
|
*/
|
|
141
|
-
updateEmail(messageId: string, topics?: string[], users?: string[], targets?: string[], subject?: string, content?: string, draft?: boolean, html?: boolean, cc?: string[], bcc?: string[], scheduledAt?: string, attachments?: string[]): Promise<Models.Message
|
|
260
|
+
updateEmail(messageId: string, topics?: string[], users?: string[], targets?: string[], subject?: string, content?: string, draft?: boolean, html?: boolean, cc?: string[], bcc?: string[], scheduledAt?: string, attachments?: string[]): Promise<Models.Message>;
|
|
261
|
+
updateEmail(
|
|
262
|
+
paramsOrFirst: { messageId: string, topics?: string[], users?: string[], targets?: string[], subject?: string, content?: string, draft?: boolean, html?: boolean, cc?: string[], bcc?: string[], scheduledAt?: string, attachments?: string[] } | string,
|
|
263
|
+
...rest: [(string[])?, (string[])?, (string[])?, (string)?, (string)?, (boolean)?, (boolean)?, (string[])?, (string[])?, (string)?, (string[])?]
|
|
264
|
+
): Promise<Models.Message> {
|
|
265
|
+
let params: { messageId: string, topics?: string[], users?: string[], targets?: string[], subject?: string, content?: string, draft?: boolean, html?: boolean, cc?: string[], bcc?: string[], scheduledAt?: string, attachments?: string[] };
|
|
266
|
+
|
|
267
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
268
|
+
params = (paramsOrFirst || {}) as { messageId: string, topics?: string[], users?: string[], targets?: string[], subject?: string, content?: string, draft?: boolean, html?: boolean, cc?: string[], bcc?: string[], scheduledAt?: string, attachments?: string[] };
|
|
269
|
+
} else {
|
|
270
|
+
params = {
|
|
271
|
+
messageId: paramsOrFirst as string,
|
|
272
|
+
topics: rest[0] as string[],
|
|
273
|
+
users: rest[1] as string[],
|
|
274
|
+
targets: rest[2] as string[],
|
|
275
|
+
subject: rest[3] as string,
|
|
276
|
+
content: rest[4] as string,
|
|
277
|
+
draft: rest[5] as boolean,
|
|
278
|
+
html: rest[6] as boolean,
|
|
279
|
+
cc: rest[7] as string[],
|
|
280
|
+
bcc: rest[8] as string[],
|
|
281
|
+
scheduledAt: rest[9] as string,
|
|
282
|
+
attachments: rest[10] as string[]
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
const messageId = params.messageId;
|
|
287
|
+
const topics = params.topics;
|
|
288
|
+
const users = params.users;
|
|
289
|
+
const targets = params.targets;
|
|
290
|
+
const subject = params.subject;
|
|
291
|
+
const content = params.content;
|
|
292
|
+
const draft = params.draft;
|
|
293
|
+
const html = params.html;
|
|
294
|
+
const cc = params.cc;
|
|
295
|
+
const bcc = params.bcc;
|
|
296
|
+
const scheduledAt = params.scheduledAt;
|
|
297
|
+
const attachments = params.attachments;
|
|
298
|
+
|
|
142
299
|
if (typeof messageId === 'undefined') {
|
|
143
300
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
144
301
|
}
|
|
302
|
+
|
|
145
303
|
const apiPath = '/messaging/messages/email/{messageId}'.replace('{messageId}', messageId);
|
|
146
304
|
const payload: Payload = {};
|
|
147
305
|
if (typeof topics !== 'undefined') {
|
|
@@ -190,35 +348,116 @@ export class Messaging {
|
|
|
190
348
|
payload
|
|
191
349
|
);
|
|
192
350
|
}
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* Create a new push notification.
|
|
354
|
+
*
|
|
355
|
+
* @param {string} params.messageId - Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
356
|
+
* @param {string} params.title - Title for push notification.
|
|
357
|
+
* @param {string} params.body - Body for push notification.
|
|
358
|
+
* @param {string[]} params.topics - List of Topic IDs.
|
|
359
|
+
* @param {string[]} params.users - List of User IDs.
|
|
360
|
+
* @param {string[]} params.targets - List of Targets IDs.
|
|
361
|
+
* @param {object} params.data - Additional key-value pair data for push notification.
|
|
362
|
+
* @param {string} params.action - Action for push notification.
|
|
363
|
+
* @param {string} params.image - Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.
|
|
364
|
+
* @param {string} params.icon - Icon for push notification. Available only for Android and Web Platform.
|
|
365
|
+
* @param {string} params.sound - Sound for push notification. Available only for Android and iOS Platform.
|
|
366
|
+
* @param {string} params.color - Color for push notification. Available only for Android Platform.
|
|
367
|
+
* @param {string} params.tag - Tag for push notification. Available only for Android Platform.
|
|
368
|
+
* @param {number} params.badge - Badge for push notification. Available only for iOS Platform.
|
|
369
|
+
* @param {boolean} params.draft - Is message a draft
|
|
370
|
+
* @param {string} params.scheduledAt - Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
|
|
371
|
+
* @param {boolean} params.contentAvailable - If set to true, the notification will be delivered in the background. Available only for iOS Platform.
|
|
372
|
+
* @param {boolean} params.critical - If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.
|
|
373
|
+
* @param {MessagePriority} params.priority - Set the notification priority. "normal" will consider device state and may not deliver notifications immediately. "high" will always attempt to immediately deliver the notification.
|
|
374
|
+
* @throws {AppwriteException}
|
|
375
|
+
* @returns {Promise<Models.Message>}
|
|
376
|
+
*/
|
|
377
|
+
createPush(params: { messageId: string, title?: string, body?: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority }): Promise<Models.Message>;
|
|
193
378
|
/**
|
|
194
379
|
* Create a new push notification.
|
|
195
380
|
*
|
|
196
|
-
* @param {string} messageId
|
|
197
|
-
* @param {string} title
|
|
198
|
-
* @param {string} body
|
|
199
|
-
* @param {string[]} topics
|
|
200
|
-
* @param {string[]} users
|
|
201
|
-
* @param {string[]} targets
|
|
202
|
-
* @param {object} data
|
|
203
|
-
* @param {string} action
|
|
204
|
-
* @param {string} image
|
|
205
|
-
* @param {string} icon
|
|
206
|
-
* @param {string} sound
|
|
207
|
-
* @param {string} color
|
|
208
|
-
* @param {string} tag
|
|
209
|
-
* @param {number} badge
|
|
210
|
-
* @param {boolean} draft
|
|
211
|
-
* @param {string} scheduledAt
|
|
212
|
-
* @param {boolean} contentAvailable
|
|
213
|
-
* @param {boolean} critical
|
|
214
|
-
* @param {MessagePriority} priority
|
|
381
|
+
* @param {string} messageId - Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
382
|
+
* @param {string} title - Title for push notification.
|
|
383
|
+
* @param {string} body - Body for push notification.
|
|
384
|
+
* @param {string[]} topics - List of Topic IDs.
|
|
385
|
+
* @param {string[]} users - List of User IDs.
|
|
386
|
+
* @param {string[]} targets - List of Targets IDs.
|
|
387
|
+
* @param {object} data - Additional key-value pair data for push notification.
|
|
388
|
+
* @param {string} action - Action for push notification.
|
|
389
|
+
* @param {string} image - Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.
|
|
390
|
+
* @param {string} icon - Icon for push notification. Available only for Android and Web Platform.
|
|
391
|
+
* @param {string} sound - Sound for push notification. Available only for Android and iOS Platform.
|
|
392
|
+
* @param {string} color - Color for push notification. Available only for Android Platform.
|
|
393
|
+
* @param {string} tag - Tag for push notification. Available only for Android Platform.
|
|
394
|
+
* @param {number} badge - Badge for push notification. Available only for iOS Platform.
|
|
395
|
+
* @param {boolean} draft - Is message a draft
|
|
396
|
+
* @param {string} scheduledAt - Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
|
|
397
|
+
* @param {boolean} contentAvailable - If set to true, the notification will be delivered in the background. Available only for iOS Platform.
|
|
398
|
+
* @param {boolean} critical - If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.
|
|
399
|
+
* @param {MessagePriority} priority - Set the notification priority. "normal" will consider device state and may not deliver notifications immediately. "high" will always attempt to immediately deliver the notification.
|
|
215
400
|
* @throws {AppwriteException}
|
|
216
401
|
* @returns {Promise<Models.Message>}
|
|
402
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
217
403
|
*/
|
|
218
|
-
createPush(messageId: string, title?: string, body?: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority): Promise<Models.Message
|
|
404
|
+
createPush(messageId: string, title?: string, body?: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority): Promise<Models.Message>;
|
|
405
|
+
createPush(
|
|
406
|
+
paramsOrFirst: { messageId: string, title?: string, body?: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority } | string,
|
|
407
|
+
...rest: [(string)?, (string)?, (string[])?, (string[])?, (string[])?, (object)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (number)?, (boolean)?, (string)?, (boolean)?, (boolean)?, (MessagePriority)?]
|
|
408
|
+
): Promise<Models.Message> {
|
|
409
|
+
let params: { messageId: string, title?: string, body?: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority };
|
|
410
|
+
|
|
411
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
412
|
+
params = (paramsOrFirst || {}) as { messageId: string, title?: string, body?: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority };
|
|
413
|
+
} else {
|
|
414
|
+
params = {
|
|
415
|
+
messageId: paramsOrFirst as string,
|
|
416
|
+
title: rest[0] as string,
|
|
417
|
+
body: rest[1] as string,
|
|
418
|
+
topics: rest[2] as string[],
|
|
419
|
+
users: rest[3] as string[],
|
|
420
|
+
targets: rest[4] as string[],
|
|
421
|
+
data: rest[5] as object,
|
|
422
|
+
action: rest[6] as string,
|
|
423
|
+
image: rest[7] as string,
|
|
424
|
+
icon: rest[8] as string,
|
|
425
|
+
sound: rest[9] as string,
|
|
426
|
+
color: rest[10] as string,
|
|
427
|
+
tag: rest[11] as string,
|
|
428
|
+
badge: rest[12] as number,
|
|
429
|
+
draft: rest[13] as boolean,
|
|
430
|
+
scheduledAt: rest[14] as string,
|
|
431
|
+
contentAvailable: rest[15] as boolean,
|
|
432
|
+
critical: rest[16] as boolean,
|
|
433
|
+
priority: rest[17] as MessagePriority
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
const messageId = params.messageId;
|
|
438
|
+
const title = params.title;
|
|
439
|
+
const body = params.body;
|
|
440
|
+
const topics = params.topics;
|
|
441
|
+
const users = params.users;
|
|
442
|
+
const targets = params.targets;
|
|
443
|
+
const data = params.data;
|
|
444
|
+
const action = params.action;
|
|
445
|
+
const image = params.image;
|
|
446
|
+
const icon = params.icon;
|
|
447
|
+
const sound = params.sound;
|
|
448
|
+
const color = params.color;
|
|
449
|
+
const tag = params.tag;
|
|
450
|
+
const badge = params.badge;
|
|
451
|
+
const draft = params.draft;
|
|
452
|
+
const scheduledAt = params.scheduledAt;
|
|
453
|
+
const contentAvailable = params.contentAvailable;
|
|
454
|
+
const critical = params.critical;
|
|
455
|
+
const priority = params.priority;
|
|
456
|
+
|
|
219
457
|
if (typeof messageId === 'undefined') {
|
|
220
458
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
221
459
|
}
|
|
460
|
+
|
|
222
461
|
const apiPath = '/messaging/messages/push';
|
|
223
462
|
const payload: Payload = {};
|
|
224
463
|
if (typeof messageId !== 'undefined') {
|
|
@@ -291,36 +530,118 @@ export class Messaging {
|
|
|
291
530
|
payload
|
|
292
531
|
);
|
|
293
532
|
}
|
|
533
|
+
|
|
294
534
|
/**
|
|
295
535
|
* Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.
|
|
296
|
-
|
|
536
|
+
*
|
|
297
537
|
*
|
|
298
|
-
* @param {string} messageId
|
|
299
|
-
* @param {string[]} topics
|
|
300
|
-
* @param {string[]} users
|
|
301
|
-
* @param {string[]} targets
|
|
302
|
-
* @param {string} title
|
|
303
|
-
* @param {string} body
|
|
304
|
-
* @param {object} data
|
|
305
|
-
* @param {string} action
|
|
306
|
-
* @param {string} image
|
|
307
|
-
* @param {string} icon
|
|
308
|
-
* @param {string} sound
|
|
309
|
-
* @param {string} color
|
|
310
|
-
* @param {string} tag
|
|
311
|
-
* @param {number} badge
|
|
312
|
-
* @param {boolean} draft
|
|
313
|
-
* @param {string} scheduledAt
|
|
314
|
-
* @param {boolean} contentAvailable
|
|
315
|
-
* @param {boolean} critical
|
|
316
|
-
* @param {MessagePriority} priority
|
|
538
|
+
* @param {string} params.messageId - Message ID.
|
|
539
|
+
* @param {string[]} params.topics - List of Topic IDs.
|
|
540
|
+
* @param {string[]} params.users - List of User IDs.
|
|
541
|
+
* @param {string[]} params.targets - List of Targets IDs.
|
|
542
|
+
* @param {string} params.title - Title for push notification.
|
|
543
|
+
* @param {string} params.body - Body for push notification.
|
|
544
|
+
* @param {object} params.data - Additional Data for push notification.
|
|
545
|
+
* @param {string} params.action - Action for push notification.
|
|
546
|
+
* @param {string} params.image - Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.
|
|
547
|
+
* @param {string} params.icon - Icon for push notification. Available only for Android and Web platforms.
|
|
548
|
+
* @param {string} params.sound - Sound for push notification. Available only for Android and iOS platforms.
|
|
549
|
+
* @param {string} params.color - Color for push notification. Available only for Android platforms.
|
|
550
|
+
* @param {string} params.tag - Tag for push notification. Available only for Android platforms.
|
|
551
|
+
* @param {number} params.badge - Badge for push notification. Available only for iOS platforms.
|
|
552
|
+
* @param {boolean} params.draft - Is message a draft
|
|
553
|
+
* @param {string} params.scheduledAt - Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
|
|
554
|
+
* @param {boolean} params.contentAvailable - If set to true, the notification will be delivered in the background. Available only for iOS Platform.
|
|
555
|
+
* @param {boolean} params.critical - If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.
|
|
556
|
+
* @param {MessagePriority} params.priority - Set the notification priority. "normal" will consider device battery state and may send notifications later. "high" will always attempt to immediately deliver the notification.
|
|
317
557
|
* @throws {AppwriteException}
|
|
318
558
|
* @returns {Promise<Models.Message>}
|
|
319
559
|
*/
|
|
320
|
-
updatePush(messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority): Promise<Models.Message
|
|
560
|
+
updatePush(params: { messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority }): Promise<Models.Message>;
|
|
561
|
+
/**
|
|
562
|
+
* Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.
|
|
563
|
+
*
|
|
564
|
+
*
|
|
565
|
+
* @param {string} messageId - Message ID.
|
|
566
|
+
* @param {string[]} topics - List of Topic IDs.
|
|
567
|
+
* @param {string[]} users - List of User IDs.
|
|
568
|
+
* @param {string[]} targets - List of Targets IDs.
|
|
569
|
+
* @param {string} title - Title for push notification.
|
|
570
|
+
* @param {string} body - Body for push notification.
|
|
571
|
+
* @param {object} data - Additional Data for push notification.
|
|
572
|
+
* @param {string} action - Action for push notification.
|
|
573
|
+
* @param {string} image - Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.
|
|
574
|
+
* @param {string} icon - Icon for push notification. Available only for Android and Web platforms.
|
|
575
|
+
* @param {string} sound - Sound for push notification. Available only for Android and iOS platforms.
|
|
576
|
+
* @param {string} color - Color for push notification. Available only for Android platforms.
|
|
577
|
+
* @param {string} tag - Tag for push notification. Available only for Android platforms.
|
|
578
|
+
* @param {number} badge - Badge for push notification. Available only for iOS platforms.
|
|
579
|
+
* @param {boolean} draft - Is message a draft
|
|
580
|
+
* @param {string} scheduledAt - Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
|
|
581
|
+
* @param {boolean} contentAvailable - If set to true, the notification will be delivered in the background. Available only for iOS Platform.
|
|
582
|
+
* @param {boolean} critical - If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.
|
|
583
|
+
* @param {MessagePriority} priority - Set the notification priority. "normal" will consider device battery state and may send notifications later. "high" will always attempt to immediately deliver the notification.
|
|
584
|
+
* @throws {AppwriteException}
|
|
585
|
+
* @returns {Promise<Models.Message>}
|
|
586
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
587
|
+
*/
|
|
588
|
+
updatePush(messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority): Promise<Models.Message>;
|
|
589
|
+
updatePush(
|
|
590
|
+
paramsOrFirst: { messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority } | string,
|
|
591
|
+
...rest: [(string[])?, (string[])?, (string[])?, (string)?, (string)?, (object)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (number)?, (boolean)?, (string)?, (boolean)?, (boolean)?, (MessagePriority)?]
|
|
592
|
+
): Promise<Models.Message> {
|
|
593
|
+
let params: { messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority };
|
|
594
|
+
|
|
595
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
596
|
+
params = (paramsOrFirst || {}) as { messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string, contentAvailable?: boolean, critical?: boolean, priority?: MessagePriority };
|
|
597
|
+
} else {
|
|
598
|
+
params = {
|
|
599
|
+
messageId: paramsOrFirst as string,
|
|
600
|
+
topics: rest[0] as string[],
|
|
601
|
+
users: rest[1] as string[],
|
|
602
|
+
targets: rest[2] as string[],
|
|
603
|
+
title: rest[3] as string,
|
|
604
|
+
body: rest[4] as string,
|
|
605
|
+
data: rest[5] as object,
|
|
606
|
+
action: rest[6] as string,
|
|
607
|
+
image: rest[7] as string,
|
|
608
|
+
icon: rest[8] as string,
|
|
609
|
+
sound: rest[9] as string,
|
|
610
|
+
color: rest[10] as string,
|
|
611
|
+
tag: rest[11] as string,
|
|
612
|
+
badge: rest[12] as number,
|
|
613
|
+
draft: rest[13] as boolean,
|
|
614
|
+
scheduledAt: rest[14] as string,
|
|
615
|
+
contentAvailable: rest[15] as boolean,
|
|
616
|
+
critical: rest[16] as boolean,
|
|
617
|
+
priority: rest[17] as MessagePriority
|
|
618
|
+
};
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
const messageId = params.messageId;
|
|
622
|
+
const topics = params.topics;
|
|
623
|
+
const users = params.users;
|
|
624
|
+
const targets = params.targets;
|
|
625
|
+
const title = params.title;
|
|
626
|
+
const body = params.body;
|
|
627
|
+
const data = params.data;
|
|
628
|
+
const action = params.action;
|
|
629
|
+
const image = params.image;
|
|
630
|
+
const icon = params.icon;
|
|
631
|
+
const sound = params.sound;
|
|
632
|
+
const color = params.color;
|
|
633
|
+
const tag = params.tag;
|
|
634
|
+
const badge = params.badge;
|
|
635
|
+
const draft = params.draft;
|
|
636
|
+
const scheduledAt = params.scheduledAt;
|
|
637
|
+
const contentAvailable = params.contentAvailable;
|
|
638
|
+
const critical = params.critical;
|
|
639
|
+
const priority = params.priority;
|
|
640
|
+
|
|
321
641
|
if (typeof messageId === 'undefined') {
|
|
322
642
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
323
643
|
}
|
|
644
|
+
|
|
324
645
|
const apiPath = '/messaging/messages/push/{messageId}'.replace('{messageId}', messageId);
|
|
325
646
|
const payload: Payload = {};
|
|
326
647
|
if (typeof topics !== 'undefined') {
|
|
@@ -390,26 +711,173 @@ export class Messaging {
|
|
|
390
711
|
payload
|
|
391
712
|
);
|
|
392
713
|
}
|
|
714
|
+
|
|
715
|
+
/**
|
|
716
|
+
* Create a new SMS message.
|
|
717
|
+
*
|
|
718
|
+
* @param {string} params.messageId - Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
719
|
+
* @param {string} params.content - SMS Content.
|
|
720
|
+
* @param {string[]} params.topics - List of Topic IDs.
|
|
721
|
+
* @param {string[]} params.users - List of User IDs.
|
|
722
|
+
* @param {string[]} params.targets - List of Targets IDs.
|
|
723
|
+
* @param {boolean} params.draft - Is message a draft
|
|
724
|
+
* @param {string} params.scheduledAt - Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
|
|
725
|
+
* @throws {AppwriteException}
|
|
726
|
+
* @returns {Promise<Models.Message>}
|
|
727
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `Messaging.createSMS` instead.
|
|
728
|
+
*/
|
|
729
|
+
createSms(params: { messageId: string, content: string, topics?: string[], users?: string[], targets?: string[], draft?: boolean, scheduledAt?: string }): Promise<Models.Message>;
|
|
730
|
+
/**
|
|
731
|
+
* Create a new SMS message.
|
|
732
|
+
*
|
|
733
|
+
* @param {string} messageId - Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
734
|
+
* @param {string} content - SMS Content.
|
|
735
|
+
* @param {string[]} topics - List of Topic IDs.
|
|
736
|
+
* @param {string[]} users - List of User IDs.
|
|
737
|
+
* @param {string[]} targets - List of Targets IDs.
|
|
738
|
+
* @param {boolean} draft - Is message a draft
|
|
739
|
+
* @param {string} scheduledAt - Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
|
|
740
|
+
* @throws {AppwriteException}
|
|
741
|
+
* @returns {Promise<Models.Message>}
|
|
742
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
743
|
+
*/
|
|
744
|
+
createSms(messageId: string, content: string, topics?: string[], users?: string[], targets?: string[], draft?: boolean, scheduledAt?: string): Promise<Models.Message>;
|
|
745
|
+
createSms(
|
|
746
|
+
paramsOrFirst: { messageId: string, content: string, topics?: string[], users?: string[], targets?: string[], draft?: boolean, scheduledAt?: string } | string,
|
|
747
|
+
...rest: [(string)?, (string[])?, (string[])?, (string[])?, (boolean)?, (string)?]
|
|
748
|
+
): Promise<Models.Message> {
|
|
749
|
+
let params: { messageId: string, content: string, topics?: string[], users?: string[], targets?: string[], draft?: boolean, scheduledAt?: string };
|
|
750
|
+
|
|
751
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
752
|
+
params = (paramsOrFirst || {}) as { messageId: string, content: string, topics?: string[], users?: string[], targets?: string[], draft?: boolean, scheduledAt?: string };
|
|
753
|
+
} else {
|
|
754
|
+
params = {
|
|
755
|
+
messageId: paramsOrFirst as string,
|
|
756
|
+
content: rest[0] as string,
|
|
757
|
+
topics: rest[1] as string[],
|
|
758
|
+
users: rest[2] as string[],
|
|
759
|
+
targets: rest[3] as string[],
|
|
760
|
+
draft: rest[4] as boolean,
|
|
761
|
+
scheduledAt: rest[5] as string
|
|
762
|
+
};
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
const messageId = params.messageId;
|
|
766
|
+
const content = params.content;
|
|
767
|
+
const topics = params.topics;
|
|
768
|
+
const users = params.users;
|
|
769
|
+
const targets = params.targets;
|
|
770
|
+
const draft = params.draft;
|
|
771
|
+
const scheduledAt = params.scheduledAt;
|
|
772
|
+
|
|
773
|
+
if (typeof messageId === 'undefined') {
|
|
774
|
+
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
775
|
+
}
|
|
776
|
+
if (typeof content === 'undefined') {
|
|
777
|
+
throw new AppwriteException('Missing required parameter: "content"');
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
const apiPath = '/messaging/messages/sms';
|
|
781
|
+
const payload: Payload = {};
|
|
782
|
+
if (typeof messageId !== 'undefined') {
|
|
783
|
+
payload['messageId'] = messageId;
|
|
784
|
+
}
|
|
785
|
+
if (typeof content !== 'undefined') {
|
|
786
|
+
payload['content'] = content;
|
|
787
|
+
}
|
|
788
|
+
if (typeof topics !== 'undefined') {
|
|
789
|
+
payload['topics'] = topics;
|
|
790
|
+
}
|
|
791
|
+
if (typeof users !== 'undefined') {
|
|
792
|
+
payload['users'] = users;
|
|
793
|
+
}
|
|
794
|
+
if (typeof targets !== 'undefined') {
|
|
795
|
+
payload['targets'] = targets;
|
|
796
|
+
}
|
|
797
|
+
if (typeof draft !== 'undefined') {
|
|
798
|
+
payload['draft'] = draft;
|
|
799
|
+
}
|
|
800
|
+
if (typeof scheduledAt !== 'undefined') {
|
|
801
|
+
payload['scheduledAt'] = scheduledAt;
|
|
802
|
+
}
|
|
803
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
804
|
+
|
|
805
|
+
const apiHeaders: { [header: string]: string } = {
|
|
806
|
+
'content-type': 'application/json',
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
return this.client.call(
|
|
810
|
+
'post',
|
|
811
|
+
uri,
|
|
812
|
+
apiHeaders,
|
|
813
|
+
payload
|
|
814
|
+
);
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
/**
|
|
818
|
+
* Create a new SMS message.
|
|
819
|
+
*
|
|
820
|
+
* @param {string} params.messageId - Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
821
|
+
* @param {string} params.content - SMS Content.
|
|
822
|
+
* @param {string[]} params.topics - List of Topic IDs.
|
|
823
|
+
* @param {string[]} params.users - List of User IDs.
|
|
824
|
+
* @param {string[]} params.targets - List of Targets IDs.
|
|
825
|
+
* @param {boolean} params.draft - Is message a draft
|
|
826
|
+
* @param {string} params.scheduledAt - Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
|
|
827
|
+
* @throws {AppwriteException}
|
|
828
|
+
* @returns {Promise<Models.Message>}
|
|
829
|
+
*/
|
|
830
|
+
createSMS(params: { messageId: string, content: string, topics?: string[], users?: string[], targets?: string[], draft?: boolean, scheduledAt?: string }): Promise<Models.Message>;
|
|
393
831
|
/**
|
|
394
832
|
* Create a new SMS message.
|
|
395
833
|
*
|
|
396
|
-
* @param {string} messageId
|
|
397
|
-
* @param {string} content
|
|
398
|
-
* @param {string[]} topics
|
|
399
|
-
* @param {string[]} users
|
|
400
|
-
* @param {string[]} targets
|
|
401
|
-
* @param {boolean} draft
|
|
402
|
-
* @param {string} scheduledAt
|
|
834
|
+
* @param {string} messageId - Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
835
|
+
* @param {string} content - SMS Content.
|
|
836
|
+
* @param {string[]} topics - List of Topic IDs.
|
|
837
|
+
* @param {string[]} users - List of User IDs.
|
|
838
|
+
* @param {string[]} targets - List of Targets IDs.
|
|
839
|
+
* @param {boolean} draft - Is message a draft
|
|
840
|
+
* @param {string} scheduledAt - Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
|
|
403
841
|
* @throws {AppwriteException}
|
|
404
842
|
* @returns {Promise<Models.Message>}
|
|
843
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
405
844
|
*/
|
|
406
|
-
|
|
845
|
+
createSMS(messageId: string, content: string, topics?: string[], users?: string[], targets?: string[], draft?: boolean, scheduledAt?: string): Promise<Models.Message>;
|
|
846
|
+
createSMS(
|
|
847
|
+
paramsOrFirst: { messageId: string, content: string, topics?: string[], users?: string[], targets?: string[], draft?: boolean, scheduledAt?: string } | string,
|
|
848
|
+
...rest: [(string)?, (string[])?, (string[])?, (string[])?, (boolean)?, (string)?]
|
|
849
|
+
): Promise<Models.Message> {
|
|
850
|
+
let params: { messageId: string, content: string, topics?: string[], users?: string[], targets?: string[], draft?: boolean, scheduledAt?: string };
|
|
851
|
+
|
|
852
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
853
|
+
params = (paramsOrFirst || {}) as { messageId: string, content: string, topics?: string[], users?: string[], targets?: string[], draft?: boolean, scheduledAt?: string };
|
|
854
|
+
} else {
|
|
855
|
+
params = {
|
|
856
|
+
messageId: paramsOrFirst as string,
|
|
857
|
+
content: rest[0] as string,
|
|
858
|
+
topics: rest[1] as string[],
|
|
859
|
+
users: rest[2] as string[],
|
|
860
|
+
targets: rest[3] as string[],
|
|
861
|
+
draft: rest[4] as boolean,
|
|
862
|
+
scheduledAt: rest[5] as string
|
|
863
|
+
};
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
const messageId = params.messageId;
|
|
867
|
+
const content = params.content;
|
|
868
|
+
const topics = params.topics;
|
|
869
|
+
const users = params.users;
|
|
870
|
+
const targets = params.targets;
|
|
871
|
+
const draft = params.draft;
|
|
872
|
+
const scheduledAt = params.scheduledAt;
|
|
873
|
+
|
|
407
874
|
if (typeof messageId === 'undefined') {
|
|
408
875
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
409
876
|
}
|
|
410
877
|
if (typeof content === 'undefined') {
|
|
411
878
|
throw new AppwriteException('Missing required parameter: "content"');
|
|
412
879
|
}
|
|
880
|
+
|
|
413
881
|
const apiPath = '/messaging/messages/sms';
|
|
414
882
|
const payload: Payload = {};
|
|
415
883
|
if (typeof messageId !== 'undefined') {
|
|
@@ -446,24 +914,168 @@ export class Messaging {
|
|
|
446
914
|
payload
|
|
447
915
|
);
|
|
448
916
|
}
|
|
917
|
+
|
|
918
|
+
/**
|
|
919
|
+
* Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.
|
|
920
|
+
*
|
|
921
|
+
*
|
|
922
|
+
* @param {string} params.messageId - Message ID.
|
|
923
|
+
* @param {string[]} params.topics - List of Topic IDs.
|
|
924
|
+
* @param {string[]} params.users - List of User IDs.
|
|
925
|
+
* @param {string[]} params.targets - List of Targets IDs.
|
|
926
|
+
* @param {string} params.content - Email Content.
|
|
927
|
+
* @param {boolean} params.draft - Is message a draft
|
|
928
|
+
* @param {string} params.scheduledAt - Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
|
|
929
|
+
* @throws {AppwriteException}
|
|
930
|
+
* @returns {Promise<Models.Message>}
|
|
931
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `Messaging.updateSMS` instead.
|
|
932
|
+
*/
|
|
933
|
+
updateSms(params: { messageId: string, topics?: string[], users?: string[], targets?: string[], content?: string, draft?: boolean, scheduledAt?: string }): Promise<Models.Message>;
|
|
449
934
|
/**
|
|
450
935
|
* Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.
|
|
936
|
+
*
|
|
937
|
+
*
|
|
938
|
+
* @param {string} messageId - Message ID.
|
|
939
|
+
* @param {string[]} topics - List of Topic IDs.
|
|
940
|
+
* @param {string[]} users - List of User IDs.
|
|
941
|
+
* @param {string[]} targets - List of Targets IDs.
|
|
942
|
+
* @param {string} content - Email Content.
|
|
943
|
+
* @param {boolean} draft - Is message a draft
|
|
944
|
+
* @param {string} scheduledAt - Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
|
|
945
|
+
* @throws {AppwriteException}
|
|
946
|
+
* @returns {Promise<Models.Message>}
|
|
947
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
948
|
+
*/
|
|
949
|
+
updateSms(messageId: string, topics?: string[], users?: string[], targets?: string[], content?: string, draft?: boolean, scheduledAt?: string): Promise<Models.Message>;
|
|
950
|
+
updateSms(
|
|
951
|
+
paramsOrFirst: { messageId: string, topics?: string[], users?: string[], targets?: string[], content?: string, draft?: boolean, scheduledAt?: string } | string,
|
|
952
|
+
...rest: [(string[])?, (string[])?, (string[])?, (string)?, (boolean)?, (string)?]
|
|
953
|
+
): Promise<Models.Message> {
|
|
954
|
+
let params: { messageId: string, topics?: string[], users?: string[], targets?: string[], content?: string, draft?: boolean, scheduledAt?: string };
|
|
955
|
+
|
|
956
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
957
|
+
params = (paramsOrFirst || {}) as { messageId: string, topics?: string[], users?: string[], targets?: string[], content?: string, draft?: boolean, scheduledAt?: string };
|
|
958
|
+
} else {
|
|
959
|
+
params = {
|
|
960
|
+
messageId: paramsOrFirst as string,
|
|
961
|
+
topics: rest[0] as string[],
|
|
962
|
+
users: rest[1] as string[],
|
|
963
|
+
targets: rest[2] as string[],
|
|
964
|
+
content: rest[3] as string,
|
|
965
|
+
draft: rest[4] as boolean,
|
|
966
|
+
scheduledAt: rest[5] as string
|
|
967
|
+
};
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
const messageId = params.messageId;
|
|
971
|
+
const topics = params.topics;
|
|
972
|
+
const users = params.users;
|
|
973
|
+
const targets = params.targets;
|
|
974
|
+
const content = params.content;
|
|
975
|
+
const draft = params.draft;
|
|
976
|
+
const scheduledAt = params.scheduledAt;
|
|
977
|
+
|
|
978
|
+
if (typeof messageId === 'undefined') {
|
|
979
|
+
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
const apiPath = '/messaging/messages/sms/{messageId}'.replace('{messageId}', messageId);
|
|
983
|
+
const payload: Payload = {};
|
|
984
|
+
if (typeof topics !== 'undefined') {
|
|
985
|
+
payload['topics'] = topics;
|
|
986
|
+
}
|
|
987
|
+
if (typeof users !== 'undefined') {
|
|
988
|
+
payload['users'] = users;
|
|
989
|
+
}
|
|
990
|
+
if (typeof targets !== 'undefined') {
|
|
991
|
+
payload['targets'] = targets;
|
|
992
|
+
}
|
|
993
|
+
if (typeof content !== 'undefined') {
|
|
994
|
+
payload['content'] = content;
|
|
995
|
+
}
|
|
996
|
+
if (typeof draft !== 'undefined') {
|
|
997
|
+
payload['draft'] = draft;
|
|
998
|
+
}
|
|
999
|
+
if (typeof scheduledAt !== 'undefined') {
|
|
1000
|
+
payload['scheduledAt'] = scheduledAt;
|
|
1001
|
+
}
|
|
1002
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1003
|
+
|
|
1004
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1005
|
+
'content-type': 'application/json',
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
return this.client.call(
|
|
1009
|
+
'patch',
|
|
1010
|
+
uri,
|
|
1011
|
+
apiHeaders,
|
|
1012
|
+
payload
|
|
1013
|
+
);
|
|
1014
|
+
}
|
|
451
1015
|
|
|
1016
|
+
/**
|
|
1017
|
+
* Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.
|
|
1018
|
+
*
|
|
1019
|
+
*
|
|
1020
|
+
* @param {string} params.messageId - Message ID.
|
|
1021
|
+
* @param {string[]} params.topics - List of Topic IDs.
|
|
1022
|
+
* @param {string[]} params.users - List of User IDs.
|
|
1023
|
+
* @param {string[]} params.targets - List of Targets IDs.
|
|
1024
|
+
* @param {string} params.content - Email Content.
|
|
1025
|
+
* @param {boolean} params.draft - Is message a draft
|
|
1026
|
+
* @param {string} params.scheduledAt - Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
|
|
1027
|
+
* @throws {AppwriteException}
|
|
1028
|
+
* @returns {Promise<Models.Message>}
|
|
1029
|
+
*/
|
|
1030
|
+
updateSMS(params: { messageId: string, topics?: string[], users?: string[], targets?: string[], content?: string, draft?: boolean, scheduledAt?: string }): Promise<Models.Message>;
|
|
1031
|
+
/**
|
|
1032
|
+
* Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.
|
|
1033
|
+
*
|
|
452
1034
|
*
|
|
453
|
-
* @param {string} messageId
|
|
454
|
-
* @param {string[]} topics
|
|
455
|
-
* @param {string[]} users
|
|
456
|
-
* @param {string[]} targets
|
|
457
|
-
* @param {string} content
|
|
458
|
-
* @param {boolean} draft
|
|
459
|
-
* @param {string} scheduledAt
|
|
1035
|
+
* @param {string} messageId - Message ID.
|
|
1036
|
+
* @param {string[]} topics - List of Topic IDs.
|
|
1037
|
+
* @param {string[]} users - List of User IDs.
|
|
1038
|
+
* @param {string[]} targets - List of Targets IDs.
|
|
1039
|
+
* @param {string} content - Email Content.
|
|
1040
|
+
* @param {boolean} draft - Is message a draft
|
|
1041
|
+
* @param {string} scheduledAt - Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
|
|
460
1042
|
* @throws {AppwriteException}
|
|
461
1043
|
* @returns {Promise<Models.Message>}
|
|
1044
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
462
1045
|
*/
|
|
463
|
-
|
|
1046
|
+
updateSMS(messageId: string, topics?: string[], users?: string[], targets?: string[], content?: string, draft?: boolean, scheduledAt?: string): Promise<Models.Message>;
|
|
1047
|
+
updateSMS(
|
|
1048
|
+
paramsOrFirst: { messageId: string, topics?: string[], users?: string[], targets?: string[], content?: string, draft?: boolean, scheduledAt?: string } | string,
|
|
1049
|
+
...rest: [(string[])?, (string[])?, (string[])?, (string)?, (boolean)?, (string)?]
|
|
1050
|
+
): Promise<Models.Message> {
|
|
1051
|
+
let params: { messageId: string, topics?: string[], users?: string[], targets?: string[], content?: string, draft?: boolean, scheduledAt?: string };
|
|
1052
|
+
|
|
1053
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1054
|
+
params = (paramsOrFirst || {}) as { messageId: string, topics?: string[], users?: string[], targets?: string[], content?: string, draft?: boolean, scheduledAt?: string };
|
|
1055
|
+
} else {
|
|
1056
|
+
params = {
|
|
1057
|
+
messageId: paramsOrFirst as string,
|
|
1058
|
+
topics: rest[0] as string[],
|
|
1059
|
+
users: rest[1] as string[],
|
|
1060
|
+
targets: rest[2] as string[],
|
|
1061
|
+
content: rest[3] as string,
|
|
1062
|
+
draft: rest[4] as boolean,
|
|
1063
|
+
scheduledAt: rest[5] as string
|
|
1064
|
+
};
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
const messageId = params.messageId;
|
|
1068
|
+
const topics = params.topics;
|
|
1069
|
+
const users = params.users;
|
|
1070
|
+
const targets = params.targets;
|
|
1071
|
+
const content = params.content;
|
|
1072
|
+
const draft = params.draft;
|
|
1073
|
+
const scheduledAt = params.scheduledAt;
|
|
1074
|
+
|
|
464
1075
|
if (typeof messageId === 'undefined') {
|
|
465
1076
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
466
1077
|
}
|
|
1078
|
+
|
|
467
1079
|
const apiPath = '/messaging/messages/sms/{messageId}'.replace('{messageId}', messageId);
|
|
468
1080
|
const payload: Payload = {};
|
|
469
1081
|
if (typeof topics !== 'undefined') {
|
|
@@ -497,18 +1109,45 @@ export class Messaging {
|
|
|
497
1109
|
payload
|
|
498
1110
|
);
|
|
499
1111
|
}
|
|
1112
|
+
|
|
500
1113
|
/**
|
|
501
1114
|
* Get a message by its unique ID.
|
|
502
|
-
|
|
1115
|
+
*
|
|
1116
|
+
*
|
|
1117
|
+
* @param {string} params.messageId - Message ID.
|
|
1118
|
+
* @throws {AppwriteException}
|
|
1119
|
+
* @returns {Promise<Models.Message>}
|
|
1120
|
+
*/
|
|
1121
|
+
getMessage(params: { messageId: string }): Promise<Models.Message>;
|
|
1122
|
+
/**
|
|
1123
|
+
* Get a message by its unique ID.
|
|
1124
|
+
*
|
|
503
1125
|
*
|
|
504
|
-
* @param {string} messageId
|
|
1126
|
+
* @param {string} messageId - Message ID.
|
|
505
1127
|
* @throws {AppwriteException}
|
|
506
1128
|
* @returns {Promise<Models.Message>}
|
|
1129
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
507
1130
|
*/
|
|
508
|
-
getMessage(messageId: string): Promise<Models.Message
|
|
1131
|
+
getMessage(messageId: string): Promise<Models.Message>;
|
|
1132
|
+
getMessage(
|
|
1133
|
+
paramsOrFirst: { messageId: string } | string
|
|
1134
|
+
): Promise<Models.Message> {
|
|
1135
|
+
let params: { messageId: string };
|
|
1136
|
+
|
|
1137
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1138
|
+
params = (paramsOrFirst || {}) as { messageId: string };
|
|
1139
|
+
} else {
|
|
1140
|
+
params = {
|
|
1141
|
+
messageId: paramsOrFirst as string
|
|
1142
|
+
};
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
const messageId = params.messageId;
|
|
1146
|
+
|
|
509
1147
|
if (typeof messageId === 'undefined') {
|
|
510
1148
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
511
1149
|
}
|
|
1150
|
+
|
|
512
1151
|
const apiPath = '/messaging/messages/{messageId}'.replace('{messageId}', messageId);
|
|
513
1152
|
const payload: Payload = {};
|
|
514
1153
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -523,17 +1162,43 @@ export class Messaging {
|
|
|
523
1162
|
payload
|
|
524
1163
|
);
|
|
525
1164
|
}
|
|
1165
|
+
|
|
526
1166
|
/**
|
|
527
1167
|
* Delete a message. If the message is not a draft or scheduled, but has been sent, this will not recall the message.
|
|
528
1168
|
*
|
|
529
|
-
* @param {string} messageId
|
|
1169
|
+
* @param {string} params.messageId - Message ID.
|
|
530
1170
|
* @throws {AppwriteException}
|
|
531
1171
|
* @returns {Promise<{}>}
|
|
532
1172
|
*/
|
|
533
|
-
delete(messageId: string): Promise<{}
|
|
1173
|
+
delete(params: { messageId: string }): Promise<{}>;
|
|
1174
|
+
/**
|
|
1175
|
+
* Delete a message. If the message is not a draft or scheduled, but has been sent, this will not recall the message.
|
|
1176
|
+
*
|
|
1177
|
+
* @param {string} messageId - Message ID.
|
|
1178
|
+
* @throws {AppwriteException}
|
|
1179
|
+
* @returns {Promise<{}>}
|
|
1180
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1181
|
+
*/
|
|
1182
|
+
delete(messageId: string): Promise<{}>;
|
|
1183
|
+
delete(
|
|
1184
|
+
paramsOrFirst: { messageId: string } | string
|
|
1185
|
+
): Promise<{}> {
|
|
1186
|
+
let params: { messageId: string };
|
|
1187
|
+
|
|
1188
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1189
|
+
params = (paramsOrFirst || {}) as { messageId: string };
|
|
1190
|
+
} else {
|
|
1191
|
+
params = {
|
|
1192
|
+
messageId: paramsOrFirst as string
|
|
1193
|
+
};
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
const messageId = params.messageId;
|
|
1197
|
+
|
|
534
1198
|
if (typeof messageId === 'undefined') {
|
|
535
1199
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
536
1200
|
}
|
|
1201
|
+
|
|
537
1202
|
const apiPath = '/messaging/messages/{messageId}'.replace('{messageId}', messageId);
|
|
538
1203
|
const payload: Payload = {};
|
|
539
1204
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -549,23 +1214,60 @@ export class Messaging {
|
|
|
549
1214
|
payload
|
|
550
1215
|
);
|
|
551
1216
|
}
|
|
1217
|
+
|
|
1218
|
+
/**
|
|
1219
|
+
* Get the message activity logs listed by its unique ID.
|
|
1220
|
+
*
|
|
1221
|
+
* @param {string} params.messageId - Message ID.
|
|
1222
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
|
|
1223
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
1224
|
+
* @throws {AppwriteException}
|
|
1225
|
+
* @returns {Promise<Models.LogList>}
|
|
1226
|
+
*/
|
|
1227
|
+
listMessageLogs(params: { messageId: string, queries?: string[], total?: boolean }): Promise<Models.LogList>;
|
|
552
1228
|
/**
|
|
553
1229
|
* Get the message activity logs listed by its unique ID.
|
|
554
1230
|
*
|
|
555
|
-
* @param {string} messageId
|
|
556
|
-
* @param {string[]} queries
|
|
1231
|
+
* @param {string} messageId - Message ID.
|
|
1232
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
|
|
1233
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
557
1234
|
* @throws {AppwriteException}
|
|
558
1235
|
* @returns {Promise<Models.LogList>}
|
|
1236
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
559
1237
|
*/
|
|
560
|
-
listMessageLogs(messageId: string, queries?: string[]): Promise<Models.LogList
|
|
1238
|
+
listMessageLogs(messageId: string, queries?: string[], total?: boolean): Promise<Models.LogList>;
|
|
1239
|
+
listMessageLogs(
|
|
1240
|
+
paramsOrFirst: { messageId: string, queries?: string[], total?: boolean } | string,
|
|
1241
|
+
...rest: [(string[])?, (boolean)?]
|
|
1242
|
+
): Promise<Models.LogList> {
|
|
1243
|
+
let params: { messageId: string, queries?: string[], total?: boolean };
|
|
1244
|
+
|
|
1245
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1246
|
+
params = (paramsOrFirst || {}) as { messageId: string, queries?: string[], total?: boolean };
|
|
1247
|
+
} else {
|
|
1248
|
+
params = {
|
|
1249
|
+
messageId: paramsOrFirst as string,
|
|
1250
|
+
queries: rest[0] as string[],
|
|
1251
|
+
total: rest[1] as boolean
|
|
1252
|
+
};
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
const messageId = params.messageId;
|
|
1256
|
+
const queries = params.queries;
|
|
1257
|
+
const total = params.total;
|
|
1258
|
+
|
|
561
1259
|
if (typeof messageId === 'undefined') {
|
|
562
1260
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
563
1261
|
}
|
|
1262
|
+
|
|
564
1263
|
const apiPath = '/messaging/messages/{messageId}/logs'.replace('{messageId}', messageId);
|
|
565
1264
|
const payload: Payload = {};
|
|
566
1265
|
if (typeof queries !== 'undefined') {
|
|
567
1266
|
payload['queries'] = queries;
|
|
568
1267
|
}
|
|
1268
|
+
if (typeof total !== 'undefined') {
|
|
1269
|
+
payload['total'] = total;
|
|
1270
|
+
}
|
|
569
1271
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
570
1272
|
|
|
571
1273
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -578,23 +1280,60 @@ export class Messaging {
|
|
|
578
1280
|
payload
|
|
579
1281
|
);
|
|
580
1282
|
}
|
|
1283
|
+
|
|
1284
|
+
/**
|
|
1285
|
+
* Get a list of the targets associated with a message.
|
|
1286
|
+
*
|
|
1287
|
+
* @param {string} params.messageId - Message ID.
|
|
1288
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType
|
|
1289
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
1290
|
+
* @throws {AppwriteException}
|
|
1291
|
+
* @returns {Promise<Models.TargetList>}
|
|
1292
|
+
*/
|
|
1293
|
+
listTargets(params: { messageId: string, queries?: string[], total?: boolean }): Promise<Models.TargetList>;
|
|
581
1294
|
/**
|
|
582
1295
|
* Get a list of the targets associated with a message.
|
|
583
1296
|
*
|
|
584
|
-
* @param {string} messageId
|
|
585
|
-
* @param {string[]} queries
|
|
1297
|
+
* @param {string} messageId - Message ID.
|
|
1298
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType
|
|
1299
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
586
1300
|
* @throws {AppwriteException}
|
|
587
1301
|
* @returns {Promise<Models.TargetList>}
|
|
1302
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
588
1303
|
*/
|
|
589
|
-
listTargets(messageId: string, queries?: string[]): Promise<Models.TargetList
|
|
1304
|
+
listTargets(messageId: string, queries?: string[], total?: boolean): Promise<Models.TargetList>;
|
|
1305
|
+
listTargets(
|
|
1306
|
+
paramsOrFirst: { messageId: string, queries?: string[], total?: boolean } | string,
|
|
1307
|
+
...rest: [(string[])?, (boolean)?]
|
|
1308
|
+
): Promise<Models.TargetList> {
|
|
1309
|
+
let params: { messageId: string, queries?: string[], total?: boolean };
|
|
1310
|
+
|
|
1311
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1312
|
+
params = (paramsOrFirst || {}) as { messageId: string, queries?: string[], total?: boolean };
|
|
1313
|
+
} else {
|
|
1314
|
+
params = {
|
|
1315
|
+
messageId: paramsOrFirst as string,
|
|
1316
|
+
queries: rest[0] as string[],
|
|
1317
|
+
total: rest[1] as boolean
|
|
1318
|
+
};
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
const messageId = params.messageId;
|
|
1322
|
+
const queries = params.queries;
|
|
1323
|
+
const total = params.total;
|
|
1324
|
+
|
|
590
1325
|
if (typeof messageId === 'undefined') {
|
|
591
1326
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
592
1327
|
}
|
|
1328
|
+
|
|
593
1329
|
const apiPath = '/messaging/messages/{messageId}/targets'.replace('{messageId}', messageId);
|
|
594
1330
|
const payload: Payload = {};
|
|
595
1331
|
if (typeof queries !== 'undefined') {
|
|
596
1332
|
payload['queries'] = queries;
|
|
597
1333
|
}
|
|
1334
|
+
if (typeof total !== 'undefined') {
|
|
1335
|
+
payload['total'] = total;
|
|
1336
|
+
}
|
|
598
1337
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
599
1338
|
|
|
600
1339
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -607,15 +1346,49 @@ export class Messaging {
|
|
|
607
1346
|
payload
|
|
608
1347
|
);
|
|
609
1348
|
}
|
|
1349
|
+
|
|
1350
|
+
/**
|
|
1351
|
+
* Get a list of all providers from the current Appwrite project.
|
|
1352
|
+
*
|
|
1353
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled
|
|
1354
|
+
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
|
1355
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
1356
|
+
* @throws {AppwriteException}
|
|
1357
|
+
* @returns {Promise<Models.ProviderList>}
|
|
1358
|
+
*/
|
|
1359
|
+
listProviders(params?: { queries?: string[], search?: string, total?: boolean }): Promise<Models.ProviderList>;
|
|
610
1360
|
/**
|
|
611
1361
|
* Get a list of all providers from the current Appwrite project.
|
|
612
1362
|
*
|
|
613
|
-
* @param {string[]} queries
|
|
614
|
-
* @param {string} search
|
|
1363
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled
|
|
1364
|
+
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
|
1365
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
615
1366
|
* @throws {AppwriteException}
|
|
616
1367
|
* @returns {Promise<Models.ProviderList>}
|
|
1368
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
617
1369
|
*/
|
|
618
|
-
listProviders(queries?: string[], search?: string): Promise<Models.ProviderList
|
|
1370
|
+
listProviders(queries?: string[], search?: string, total?: boolean): Promise<Models.ProviderList>;
|
|
1371
|
+
listProviders(
|
|
1372
|
+
paramsOrFirst?: { queries?: string[], search?: string, total?: boolean } | string[],
|
|
1373
|
+
...rest: [(string)?, (boolean)?]
|
|
1374
|
+
): Promise<Models.ProviderList> {
|
|
1375
|
+
let params: { queries?: string[], search?: string, total?: boolean };
|
|
1376
|
+
|
|
1377
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1378
|
+
params = (paramsOrFirst || {}) as { queries?: string[], search?: string, total?: boolean };
|
|
1379
|
+
} else {
|
|
1380
|
+
params = {
|
|
1381
|
+
queries: paramsOrFirst as string[],
|
|
1382
|
+
search: rest[0] as string,
|
|
1383
|
+
total: rest[1] as boolean
|
|
1384
|
+
};
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
const queries = params.queries;
|
|
1388
|
+
const search = params.search;
|
|
1389
|
+
const total = params.total;
|
|
1390
|
+
|
|
1391
|
+
|
|
619
1392
|
const apiPath = '/messaging/providers';
|
|
620
1393
|
const payload: Payload = {};
|
|
621
1394
|
if (typeof queries !== 'undefined') {
|
|
@@ -624,6 +1397,9 @@ export class Messaging {
|
|
|
624
1397
|
if (typeof search !== 'undefined') {
|
|
625
1398
|
payload['search'] = search;
|
|
626
1399
|
}
|
|
1400
|
+
if (typeof total !== 'undefined') {
|
|
1401
|
+
payload['total'] = total;
|
|
1402
|
+
}
|
|
627
1403
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
628
1404
|
|
|
629
1405
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -636,27 +1412,76 @@ export class Messaging {
|
|
|
636
1412
|
payload
|
|
637
1413
|
);
|
|
638
1414
|
}
|
|
1415
|
+
|
|
1416
|
+
/**
|
|
1417
|
+
* Create a new Apple Push Notification service provider.
|
|
1418
|
+
*
|
|
1419
|
+
* @param {string} params.providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
1420
|
+
* @param {string} params.name - Provider name.
|
|
1421
|
+
* @param {string} params.authKey - APNS authentication key.
|
|
1422
|
+
* @param {string} params.authKeyId - APNS authentication key ID.
|
|
1423
|
+
* @param {string} params.teamId - APNS team ID.
|
|
1424
|
+
* @param {string} params.bundleId - APNS bundle ID.
|
|
1425
|
+
* @param {boolean} params.sandbox - Use APNS sandbox environment.
|
|
1426
|
+
* @param {boolean} params.enabled - Set as enabled.
|
|
1427
|
+
* @throws {AppwriteException}
|
|
1428
|
+
* @returns {Promise<Models.Provider>}
|
|
1429
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `Messaging.createAPNSProvider` instead.
|
|
1430
|
+
*/
|
|
1431
|
+
createApnsProvider(params: { providerId: string, name: string, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, sandbox?: boolean, enabled?: boolean }): Promise<Models.Provider>;
|
|
639
1432
|
/**
|
|
640
1433
|
* Create a new Apple Push Notification service provider.
|
|
641
1434
|
*
|
|
642
|
-
* @param {string} providerId
|
|
643
|
-
* @param {string} name
|
|
644
|
-
* @param {string} authKey
|
|
645
|
-
* @param {string} authKeyId
|
|
646
|
-
* @param {string} teamId
|
|
647
|
-
* @param {string} bundleId
|
|
648
|
-
* @param {boolean} sandbox
|
|
649
|
-
* @param {boolean} enabled
|
|
1435
|
+
* @param {string} providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
1436
|
+
* @param {string} name - Provider name.
|
|
1437
|
+
* @param {string} authKey - APNS authentication key.
|
|
1438
|
+
* @param {string} authKeyId - APNS authentication key ID.
|
|
1439
|
+
* @param {string} teamId - APNS team ID.
|
|
1440
|
+
* @param {string} bundleId - APNS bundle ID.
|
|
1441
|
+
* @param {boolean} sandbox - Use APNS sandbox environment.
|
|
1442
|
+
* @param {boolean} enabled - Set as enabled.
|
|
650
1443
|
* @throws {AppwriteException}
|
|
651
1444
|
* @returns {Promise<Models.Provider>}
|
|
1445
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
652
1446
|
*/
|
|
653
|
-
createApnsProvider(providerId: string, name: string, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, sandbox?: boolean, enabled?: boolean): Promise<Models.Provider
|
|
1447
|
+
createApnsProvider(providerId: string, name: string, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, sandbox?: boolean, enabled?: boolean): Promise<Models.Provider>;
|
|
1448
|
+
createApnsProvider(
|
|
1449
|
+
paramsOrFirst: { providerId: string, name: string, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, sandbox?: boolean, enabled?: boolean } | string,
|
|
1450
|
+
...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?, (boolean)?]
|
|
1451
|
+
): Promise<Models.Provider> {
|
|
1452
|
+
let params: { providerId: string, name: string, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, sandbox?: boolean, enabled?: boolean };
|
|
1453
|
+
|
|
1454
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1455
|
+
params = (paramsOrFirst || {}) as { providerId: string, name: string, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, sandbox?: boolean, enabled?: boolean };
|
|
1456
|
+
} else {
|
|
1457
|
+
params = {
|
|
1458
|
+
providerId: paramsOrFirst as string,
|
|
1459
|
+
name: rest[0] as string,
|
|
1460
|
+
authKey: rest[1] as string,
|
|
1461
|
+
authKeyId: rest[2] as string,
|
|
1462
|
+
teamId: rest[3] as string,
|
|
1463
|
+
bundleId: rest[4] as string,
|
|
1464
|
+
sandbox: rest[5] as boolean,
|
|
1465
|
+
enabled: rest[6] as boolean
|
|
1466
|
+
};
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
const providerId = params.providerId;
|
|
1470
|
+
const name = params.name;
|
|
1471
|
+
const authKey = params.authKey;
|
|
1472
|
+
const authKeyId = params.authKeyId;
|
|
1473
|
+
const teamId = params.teamId;
|
|
1474
|
+
const bundleId = params.bundleId;
|
|
1475
|
+
const sandbox = params.sandbox;
|
|
1476
|
+
const enabled = params.enabled;
|
|
1477
|
+
|
|
654
1478
|
if (typeof providerId === 'undefined') {
|
|
655
1479
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
656
1480
|
}
|
|
657
1481
|
if (typeof name === 'undefined') {
|
|
658
1482
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
659
1483
|
}
|
|
1484
|
+
|
|
660
1485
|
const apiPath = '/messaging/providers/apns';
|
|
661
1486
|
const payload: Payload = {};
|
|
662
1487
|
if (typeof providerId !== 'undefined') {
|
|
@@ -696,32 +1521,83 @@ export class Messaging {
|
|
|
696
1521
|
payload
|
|
697
1522
|
);
|
|
698
1523
|
}
|
|
1524
|
+
|
|
699
1525
|
/**
|
|
700
|
-
*
|
|
1526
|
+
* Create a new Apple Push Notification service provider.
|
|
1527
|
+
*
|
|
1528
|
+
* @param {string} params.providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
1529
|
+
* @param {string} params.name - Provider name.
|
|
1530
|
+
* @param {string} params.authKey - APNS authentication key.
|
|
1531
|
+
* @param {string} params.authKeyId - APNS authentication key ID.
|
|
1532
|
+
* @param {string} params.teamId - APNS team ID.
|
|
1533
|
+
* @param {string} params.bundleId - APNS bundle ID.
|
|
1534
|
+
* @param {boolean} params.sandbox - Use APNS sandbox environment.
|
|
1535
|
+
* @param {boolean} params.enabled - Set as enabled.
|
|
1536
|
+
* @throws {AppwriteException}
|
|
1537
|
+
* @returns {Promise<Models.Provider>}
|
|
1538
|
+
*/
|
|
1539
|
+
createAPNSProvider(params: { providerId: string, name: string, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, sandbox?: boolean, enabled?: boolean }): Promise<Models.Provider>;
|
|
1540
|
+
/**
|
|
1541
|
+
* Create a new Apple Push Notification service provider.
|
|
701
1542
|
*
|
|
702
|
-
* @param {string} providerId
|
|
703
|
-
* @param {string} name
|
|
704
|
-
* @param {
|
|
705
|
-
* @param {string}
|
|
706
|
-
* @param {string}
|
|
707
|
-
* @param {string}
|
|
708
|
-
* @param {
|
|
709
|
-
* @param {boolean}
|
|
1543
|
+
* @param {string} providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
1544
|
+
* @param {string} name - Provider name.
|
|
1545
|
+
* @param {string} authKey - APNS authentication key.
|
|
1546
|
+
* @param {string} authKeyId - APNS authentication key ID.
|
|
1547
|
+
* @param {string} teamId - APNS team ID.
|
|
1548
|
+
* @param {string} bundleId - APNS bundle ID.
|
|
1549
|
+
* @param {boolean} sandbox - Use APNS sandbox environment.
|
|
1550
|
+
* @param {boolean} enabled - Set as enabled.
|
|
710
1551
|
* @throws {AppwriteException}
|
|
711
1552
|
* @returns {Promise<Models.Provider>}
|
|
1553
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
712
1554
|
*/
|
|
713
|
-
|
|
1555
|
+
createAPNSProvider(providerId: string, name: string, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, sandbox?: boolean, enabled?: boolean): Promise<Models.Provider>;
|
|
1556
|
+
createAPNSProvider(
|
|
1557
|
+
paramsOrFirst: { providerId: string, name: string, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, sandbox?: boolean, enabled?: boolean } | string,
|
|
1558
|
+
...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?, (boolean)?]
|
|
1559
|
+
): Promise<Models.Provider> {
|
|
1560
|
+
let params: { providerId: string, name: string, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, sandbox?: boolean, enabled?: boolean };
|
|
1561
|
+
|
|
1562
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1563
|
+
params = (paramsOrFirst || {}) as { providerId: string, name: string, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, sandbox?: boolean, enabled?: boolean };
|
|
1564
|
+
} else {
|
|
1565
|
+
params = {
|
|
1566
|
+
providerId: paramsOrFirst as string,
|
|
1567
|
+
name: rest[0] as string,
|
|
1568
|
+
authKey: rest[1] as string,
|
|
1569
|
+
authKeyId: rest[2] as string,
|
|
1570
|
+
teamId: rest[3] as string,
|
|
1571
|
+
bundleId: rest[4] as string,
|
|
1572
|
+
sandbox: rest[5] as boolean,
|
|
1573
|
+
enabled: rest[6] as boolean
|
|
1574
|
+
};
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
const providerId = params.providerId;
|
|
1578
|
+
const name = params.name;
|
|
1579
|
+
const authKey = params.authKey;
|
|
1580
|
+
const authKeyId = params.authKeyId;
|
|
1581
|
+
const teamId = params.teamId;
|
|
1582
|
+
const bundleId = params.bundleId;
|
|
1583
|
+
const sandbox = params.sandbox;
|
|
1584
|
+
const enabled = params.enabled;
|
|
1585
|
+
|
|
714
1586
|
if (typeof providerId === 'undefined') {
|
|
715
1587
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
716
1588
|
}
|
|
717
|
-
|
|
1589
|
+
if (typeof name === 'undefined') {
|
|
1590
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
const apiPath = '/messaging/providers/apns';
|
|
718
1594
|
const payload: Payload = {};
|
|
1595
|
+
if (typeof providerId !== 'undefined') {
|
|
1596
|
+
payload['providerId'] = providerId;
|
|
1597
|
+
}
|
|
719
1598
|
if (typeof name !== 'undefined') {
|
|
720
1599
|
payload['name'] = name;
|
|
721
1600
|
}
|
|
722
|
-
if (typeof enabled !== 'undefined') {
|
|
723
|
-
payload['enabled'] = enabled;
|
|
724
|
-
}
|
|
725
1601
|
if (typeof authKey !== 'undefined') {
|
|
726
1602
|
payload['authKey'] = authKey;
|
|
727
1603
|
}
|
|
@@ -737,6 +1613,762 @@ export class Messaging {
|
|
|
737
1613
|
if (typeof sandbox !== 'undefined') {
|
|
738
1614
|
payload['sandbox'] = sandbox;
|
|
739
1615
|
}
|
|
1616
|
+
if (typeof enabled !== 'undefined') {
|
|
1617
|
+
payload['enabled'] = enabled;
|
|
1618
|
+
}
|
|
1619
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1620
|
+
|
|
1621
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1622
|
+
'content-type': 'application/json',
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
return this.client.call(
|
|
1626
|
+
'post',
|
|
1627
|
+
uri,
|
|
1628
|
+
apiHeaders,
|
|
1629
|
+
payload
|
|
1630
|
+
);
|
|
1631
|
+
}
|
|
1632
|
+
|
|
1633
|
+
/**
|
|
1634
|
+
* Update a Apple Push Notification service provider by its unique ID.
|
|
1635
|
+
*
|
|
1636
|
+
* @param {string} params.providerId - Provider ID.
|
|
1637
|
+
* @param {string} params.name - Provider name.
|
|
1638
|
+
* @param {boolean} params.enabled - Set as enabled.
|
|
1639
|
+
* @param {string} params.authKey - APNS authentication key.
|
|
1640
|
+
* @param {string} params.authKeyId - APNS authentication key ID.
|
|
1641
|
+
* @param {string} params.teamId - APNS team ID.
|
|
1642
|
+
* @param {string} params.bundleId - APNS bundle ID.
|
|
1643
|
+
* @param {boolean} params.sandbox - Use APNS sandbox environment.
|
|
1644
|
+
* @throws {AppwriteException}
|
|
1645
|
+
* @returns {Promise<Models.Provider>}
|
|
1646
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `Messaging.updateAPNSProvider` instead.
|
|
1647
|
+
*/
|
|
1648
|
+
updateApnsProvider(params: { providerId: string, name?: string, enabled?: boolean, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, sandbox?: boolean }): Promise<Models.Provider>;
|
|
1649
|
+
/**
|
|
1650
|
+
* Update a Apple Push Notification service provider by its unique ID.
|
|
1651
|
+
*
|
|
1652
|
+
* @param {string} providerId - Provider ID.
|
|
1653
|
+
* @param {string} name - Provider name.
|
|
1654
|
+
* @param {boolean} enabled - Set as enabled.
|
|
1655
|
+
* @param {string} authKey - APNS authentication key.
|
|
1656
|
+
* @param {string} authKeyId - APNS authentication key ID.
|
|
1657
|
+
* @param {string} teamId - APNS team ID.
|
|
1658
|
+
* @param {string} bundleId - APNS bundle ID.
|
|
1659
|
+
* @param {boolean} sandbox - Use APNS sandbox environment.
|
|
1660
|
+
* @throws {AppwriteException}
|
|
1661
|
+
* @returns {Promise<Models.Provider>}
|
|
1662
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1663
|
+
*/
|
|
1664
|
+
updateApnsProvider(providerId: string, name?: string, enabled?: boolean, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, sandbox?: boolean): Promise<Models.Provider>;
|
|
1665
|
+
updateApnsProvider(
|
|
1666
|
+
paramsOrFirst: { providerId: string, name?: string, enabled?: boolean, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, sandbox?: boolean } | string,
|
|
1667
|
+
...rest: [(string)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (boolean)?]
|
|
1668
|
+
): Promise<Models.Provider> {
|
|
1669
|
+
let params: { providerId: string, name?: string, enabled?: boolean, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, sandbox?: boolean };
|
|
1670
|
+
|
|
1671
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1672
|
+
params = (paramsOrFirst || {}) as { providerId: string, name?: string, enabled?: boolean, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, sandbox?: boolean };
|
|
1673
|
+
} else {
|
|
1674
|
+
params = {
|
|
1675
|
+
providerId: paramsOrFirst as string,
|
|
1676
|
+
name: rest[0] as string,
|
|
1677
|
+
enabled: rest[1] as boolean,
|
|
1678
|
+
authKey: rest[2] as string,
|
|
1679
|
+
authKeyId: rest[3] as string,
|
|
1680
|
+
teamId: rest[4] as string,
|
|
1681
|
+
bundleId: rest[5] as string,
|
|
1682
|
+
sandbox: rest[6] as boolean
|
|
1683
|
+
};
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1686
|
+
const providerId = params.providerId;
|
|
1687
|
+
const name = params.name;
|
|
1688
|
+
const enabled = params.enabled;
|
|
1689
|
+
const authKey = params.authKey;
|
|
1690
|
+
const authKeyId = params.authKeyId;
|
|
1691
|
+
const teamId = params.teamId;
|
|
1692
|
+
const bundleId = params.bundleId;
|
|
1693
|
+
const sandbox = params.sandbox;
|
|
1694
|
+
|
|
1695
|
+
if (typeof providerId === 'undefined') {
|
|
1696
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
const apiPath = '/messaging/providers/apns/{providerId}'.replace('{providerId}', providerId);
|
|
1700
|
+
const payload: Payload = {};
|
|
1701
|
+
if (typeof name !== 'undefined') {
|
|
1702
|
+
payload['name'] = name;
|
|
1703
|
+
}
|
|
1704
|
+
if (typeof enabled !== 'undefined') {
|
|
1705
|
+
payload['enabled'] = enabled;
|
|
1706
|
+
}
|
|
1707
|
+
if (typeof authKey !== 'undefined') {
|
|
1708
|
+
payload['authKey'] = authKey;
|
|
1709
|
+
}
|
|
1710
|
+
if (typeof authKeyId !== 'undefined') {
|
|
1711
|
+
payload['authKeyId'] = authKeyId;
|
|
1712
|
+
}
|
|
1713
|
+
if (typeof teamId !== 'undefined') {
|
|
1714
|
+
payload['teamId'] = teamId;
|
|
1715
|
+
}
|
|
1716
|
+
if (typeof bundleId !== 'undefined') {
|
|
1717
|
+
payload['bundleId'] = bundleId;
|
|
1718
|
+
}
|
|
1719
|
+
if (typeof sandbox !== 'undefined') {
|
|
1720
|
+
payload['sandbox'] = sandbox;
|
|
1721
|
+
}
|
|
1722
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1723
|
+
|
|
1724
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1725
|
+
'content-type': 'application/json',
|
|
1726
|
+
}
|
|
1727
|
+
|
|
1728
|
+
return this.client.call(
|
|
1729
|
+
'patch',
|
|
1730
|
+
uri,
|
|
1731
|
+
apiHeaders,
|
|
1732
|
+
payload
|
|
1733
|
+
);
|
|
1734
|
+
}
|
|
1735
|
+
|
|
1736
|
+
/**
|
|
1737
|
+
* Update a Apple Push Notification service provider by its unique ID.
|
|
1738
|
+
*
|
|
1739
|
+
* @param {string} params.providerId - Provider ID.
|
|
1740
|
+
* @param {string} params.name - Provider name.
|
|
1741
|
+
* @param {boolean} params.enabled - Set as enabled.
|
|
1742
|
+
* @param {string} params.authKey - APNS authentication key.
|
|
1743
|
+
* @param {string} params.authKeyId - APNS authentication key ID.
|
|
1744
|
+
* @param {string} params.teamId - APNS team ID.
|
|
1745
|
+
* @param {string} params.bundleId - APNS bundle ID.
|
|
1746
|
+
* @param {boolean} params.sandbox - Use APNS sandbox environment.
|
|
1747
|
+
* @throws {AppwriteException}
|
|
1748
|
+
* @returns {Promise<Models.Provider>}
|
|
1749
|
+
*/
|
|
1750
|
+
updateAPNSProvider(params: { providerId: string, name?: string, enabled?: boolean, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, sandbox?: boolean }): Promise<Models.Provider>;
|
|
1751
|
+
/**
|
|
1752
|
+
* Update a Apple Push Notification service provider by its unique ID.
|
|
1753
|
+
*
|
|
1754
|
+
* @param {string} providerId - Provider ID.
|
|
1755
|
+
* @param {string} name - Provider name.
|
|
1756
|
+
* @param {boolean} enabled - Set as enabled.
|
|
1757
|
+
* @param {string} authKey - APNS authentication key.
|
|
1758
|
+
* @param {string} authKeyId - APNS authentication key ID.
|
|
1759
|
+
* @param {string} teamId - APNS team ID.
|
|
1760
|
+
* @param {string} bundleId - APNS bundle ID.
|
|
1761
|
+
* @param {boolean} sandbox - Use APNS sandbox environment.
|
|
1762
|
+
* @throws {AppwriteException}
|
|
1763
|
+
* @returns {Promise<Models.Provider>}
|
|
1764
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1765
|
+
*/
|
|
1766
|
+
updateAPNSProvider(providerId: string, name?: string, enabled?: boolean, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, sandbox?: boolean): Promise<Models.Provider>;
|
|
1767
|
+
updateAPNSProvider(
|
|
1768
|
+
paramsOrFirst: { providerId: string, name?: string, enabled?: boolean, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, sandbox?: boolean } | string,
|
|
1769
|
+
...rest: [(string)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (boolean)?]
|
|
1770
|
+
): Promise<Models.Provider> {
|
|
1771
|
+
let params: { providerId: string, name?: string, enabled?: boolean, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, sandbox?: boolean };
|
|
1772
|
+
|
|
1773
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1774
|
+
params = (paramsOrFirst || {}) as { providerId: string, name?: string, enabled?: boolean, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, sandbox?: boolean };
|
|
1775
|
+
} else {
|
|
1776
|
+
params = {
|
|
1777
|
+
providerId: paramsOrFirst as string,
|
|
1778
|
+
name: rest[0] as string,
|
|
1779
|
+
enabled: rest[1] as boolean,
|
|
1780
|
+
authKey: rest[2] as string,
|
|
1781
|
+
authKeyId: rest[3] as string,
|
|
1782
|
+
teamId: rest[4] as string,
|
|
1783
|
+
bundleId: rest[5] as string,
|
|
1784
|
+
sandbox: rest[6] as boolean
|
|
1785
|
+
};
|
|
1786
|
+
}
|
|
1787
|
+
|
|
1788
|
+
const providerId = params.providerId;
|
|
1789
|
+
const name = params.name;
|
|
1790
|
+
const enabled = params.enabled;
|
|
1791
|
+
const authKey = params.authKey;
|
|
1792
|
+
const authKeyId = params.authKeyId;
|
|
1793
|
+
const teamId = params.teamId;
|
|
1794
|
+
const bundleId = params.bundleId;
|
|
1795
|
+
const sandbox = params.sandbox;
|
|
1796
|
+
|
|
1797
|
+
if (typeof providerId === 'undefined') {
|
|
1798
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1799
|
+
}
|
|
1800
|
+
|
|
1801
|
+
const apiPath = '/messaging/providers/apns/{providerId}'.replace('{providerId}', providerId);
|
|
1802
|
+
const payload: Payload = {};
|
|
1803
|
+
if (typeof name !== 'undefined') {
|
|
1804
|
+
payload['name'] = name;
|
|
1805
|
+
}
|
|
1806
|
+
if (typeof enabled !== 'undefined') {
|
|
1807
|
+
payload['enabled'] = enabled;
|
|
1808
|
+
}
|
|
1809
|
+
if (typeof authKey !== 'undefined') {
|
|
1810
|
+
payload['authKey'] = authKey;
|
|
1811
|
+
}
|
|
1812
|
+
if (typeof authKeyId !== 'undefined') {
|
|
1813
|
+
payload['authKeyId'] = authKeyId;
|
|
1814
|
+
}
|
|
1815
|
+
if (typeof teamId !== 'undefined') {
|
|
1816
|
+
payload['teamId'] = teamId;
|
|
1817
|
+
}
|
|
1818
|
+
if (typeof bundleId !== 'undefined') {
|
|
1819
|
+
payload['bundleId'] = bundleId;
|
|
1820
|
+
}
|
|
1821
|
+
if (typeof sandbox !== 'undefined') {
|
|
1822
|
+
payload['sandbox'] = sandbox;
|
|
1823
|
+
}
|
|
1824
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1825
|
+
|
|
1826
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1827
|
+
'content-type': 'application/json',
|
|
1828
|
+
}
|
|
1829
|
+
|
|
1830
|
+
return this.client.call(
|
|
1831
|
+
'patch',
|
|
1832
|
+
uri,
|
|
1833
|
+
apiHeaders,
|
|
1834
|
+
payload
|
|
1835
|
+
);
|
|
1836
|
+
}
|
|
1837
|
+
|
|
1838
|
+
/**
|
|
1839
|
+
* Create a new Firebase Cloud Messaging provider.
|
|
1840
|
+
*
|
|
1841
|
+
* @param {string} params.providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
1842
|
+
* @param {string} params.name - Provider name.
|
|
1843
|
+
* @param {object} params.serviceAccountJSON - FCM service account JSON.
|
|
1844
|
+
* @param {boolean} params.enabled - Set as enabled.
|
|
1845
|
+
* @throws {AppwriteException}
|
|
1846
|
+
* @returns {Promise<Models.Provider>}
|
|
1847
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `Messaging.createFCMProvider` instead.
|
|
1848
|
+
*/
|
|
1849
|
+
createFcmProvider(params: { providerId: string, name: string, serviceAccountJSON?: object, enabled?: boolean }): Promise<Models.Provider>;
|
|
1850
|
+
/**
|
|
1851
|
+
* Create a new Firebase Cloud Messaging provider.
|
|
1852
|
+
*
|
|
1853
|
+
* @param {string} providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
1854
|
+
* @param {string} name - Provider name.
|
|
1855
|
+
* @param {object} serviceAccountJSON - FCM service account JSON.
|
|
1856
|
+
* @param {boolean} enabled - Set as enabled.
|
|
1857
|
+
* @throws {AppwriteException}
|
|
1858
|
+
* @returns {Promise<Models.Provider>}
|
|
1859
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1860
|
+
*/
|
|
1861
|
+
createFcmProvider(providerId: string, name: string, serviceAccountJSON?: object, enabled?: boolean): Promise<Models.Provider>;
|
|
1862
|
+
createFcmProvider(
|
|
1863
|
+
paramsOrFirst: { providerId: string, name: string, serviceAccountJSON?: object, enabled?: boolean } | string,
|
|
1864
|
+
...rest: [(string)?, (object)?, (boolean)?]
|
|
1865
|
+
): Promise<Models.Provider> {
|
|
1866
|
+
let params: { providerId: string, name: string, serviceAccountJSON?: object, enabled?: boolean };
|
|
1867
|
+
|
|
1868
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1869
|
+
params = (paramsOrFirst || {}) as { providerId: string, name: string, serviceAccountJSON?: object, enabled?: boolean };
|
|
1870
|
+
} else {
|
|
1871
|
+
params = {
|
|
1872
|
+
providerId: paramsOrFirst as string,
|
|
1873
|
+
name: rest[0] as string,
|
|
1874
|
+
serviceAccountJSON: rest[1] as object,
|
|
1875
|
+
enabled: rest[2] as boolean
|
|
1876
|
+
};
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1879
|
+
const providerId = params.providerId;
|
|
1880
|
+
const name = params.name;
|
|
1881
|
+
const serviceAccountJSON = params.serviceAccountJSON;
|
|
1882
|
+
const enabled = params.enabled;
|
|
1883
|
+
|
|
1884
|
+
if (typeof providerId === 'undefined') {
|
|
1885
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1886
|
+
}
|
|
1887
|
+
if (typeof name === 'undefined') {
|
|
1888
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
1889
|
+
}
|
|
1890
|
+
|
|
1891
|
+
const apiPath = '/messaging/providers/fcm';
|
|
1892
|
+
const payload: Payload = {};
|
|
1893
|
+
if (typeof providerId !== 'undefined') {
|
|
1894
|
+
payload['providerId'] = providerId;
|
|
1895
|
+
}
|
|
1896
|
+
if (typeof name !== 'undefined') {
|
|
1897
|
+
payload['name'] = name;
|
|
1898
|
+
}
|
|
1899
|
+
if (typeof serviceAccountJSON !== 'undefined') {
|
|
1900
|
+
payload['serviceAccountJSON'] = serviceAccountJSON;
|
|
1901
|
+
}
|
|
1902
|
+
if (typeof enabled !== 'undefined') {
|
|
1903
|
+
payload['enabled'] = enabled;
|
|
1904
|
+
}
|
|
1905
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1906
|
+
|
|
1907
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1908
|
+
'content-type': 'application/json',
|
|
1909
|
+
}
|
|
1910
|
+
|
|
1911
|
+
return this.client.call(
|
|
1912
|
+
'post',
|
|
1913
|
+
uri,
|
|
1914
|
+
apiHeaders,
|
|
1915
|
+
payload
|
|
1916
|
+
);
|
|
1917
|
+
}
|
|
1918
|
+
|
|
1919
|
+
/**
|
|
1920
|
+
* Create a new Firebase Cloud Messaging provider.
|
|
1921
|
+
*
|
|
1922
|
+
* @param {string} params.providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
1923
|
+
* @param {string} params.name - Provider name.
|
|
1924
|
+
* @param {object} params.serviceAccountJSON - FCM service account JSON.
|
|
1925
|
+
* @param {boolean} params.enabled - Set as enabled.
|
|
1926
|
+
* @throws {AppwriteException}
|
|
1927
|
+
* @returns {Promise<Models.Provider>}
|
|
1928
|
+
*/
|
|
1929
|
+
createFCMProvider(params: { providerId: string, name: string, serviceAccountJSON?: object, enabled?: boolean }): Promise<Models.Provider>;
|
|
1930
|
+
/**
|
|
1931
|
+
* Create a new Firebase Cloud Messaging provider.
|
|
1932
|
+
*
|
|
1933
|
+
* @param {string} providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
1934
|
+
* @param {string} name - Provider name.
|
|
1935
|
+
* @param {object} serviceAccountJSON - FCM service account JSON.
|
|
1936
|
+
* @param {boolean} enabled - Set as enabled.
|
|
1937
|
+
* @throws {AppwriteException}
|
|
1938
|
+
* @returns {Promise<Models.Provider>}
|
|
1939
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1940
|
+
*/
|
|
1941
|
+
createFCMProvider(providerId: string, name: string, serviceAccountJSON?: object, enabled?: boolean): Promise<Models.Provider>;
|
|
1942
|
+
createFCMProvider(
|
|
1943
|
+
paramsOrFirst: { providerId: string, name: string, serviceAccountJSON?: object, enabled?: boolean } | string,
|
|
1944
|
+
...rest: [(string)?, (object)?, (boolean)?]
|
|
1945
|
+
): Promise<Models.Provider> {
|
|
1946
|
+
let params: { providerId: string, name: string, serviceAccountJSON?: object, enabled?: boolean };
|
|
1947
|
+
|
|
1948
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1949
|
+
params = (paramsOrFirst || {}) as { providerId: string, name: string, serviceAccountJSON?: object, enabled?: boolean };
|
|
1950
|
+
} else {
|
|
1951
|
+
params = {
|
|
1952
|
+
providerId: paramsOrFirst as string,
|
|
1953
|
+
name: rest[0] as string,
|
|
1954
|
+
serviceAccountJSON: rest[1] as object,
|
|
1955
|
+
enabled: rest[2] as boolean
|
|
1956
|
+
};
|
|
1957
|
+
}
|
|
1958
|
+
|
|
1959
|
+
const providerId = params.providerId;
|
|
1960
|
+
const name = params.name;
|
|
1961
|
+
const serviceAccountJSON = params.serviceAccountJSON;
|
|
1962
|
+
const enabled = params.enabled;
|
|
1963
|
+
|
|
1964
|
+
if (typeof providerId === 'undefined') {
|
|
1965
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1966
|
+
}
|
|
1967
|
+
if (typeof name === 'undefined') {
|
|
1968
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
1969
|
+
}
|
|
1970
|
+
|
|
1971
|
+
const apiPath = '/messaging/providers/fcm';
|
|
1972
|
+
const payload: Payload = {};
|
|
1973
|
+
if (typeof providerId !== 'undefined') {
|
|
1974
|
+
payload['providerId'] = providerId;
|
|
1975
|
+
}
|
|
1976
|
+
if (typeof name !== 'undefined') {
|
|
1977
|
+
payload['name'] = name;
|
|
1978
|
+
}
|
|
1979
|
+
if (typeof serviceAccountJSON !== 'undefined') {
|
|
1980
|
+
payload['serviceAccountJSON'] = serviceAccountJSON;
|
|
1981
|
+
}
|
|
1982
|
+
if (typeof enabled !== 'undefined') {
|
|
1983
|
+
payload['enabled'] = enabled;
|
|
1984
|
+
}
|
|
1985
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1986
|
+
|
|
1987
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1988
|
+
'content-type': 'application/json',
|
|
1989
|
+
}
|
|
1990
|
+
|
|
1991
|
+
return this.client.call(
|
|
1992
|
+
'post',
|
|
1993
|
+
uri,
|
|
1994
|
+
apiHeaders,
|
|
1995
|
+
payload
|
|
1996
|
+
);
|
|
1997
|
+
}
|
|
1998
|
+
|
|
1999
|
+
/**
|
|
2000
|
+
* Update a Firebase Cloud Messaging provider by its unique ID.
|
|
2001
|
+
*
|
|
2002
|
+
* @param {string} params.providerId - Provider ID.
|
|
2003
|
+
* @param {string} params.name - Provider name.
|
|
2004
|
+
* @param {boolean} params.enabled - Set as enabled.
|
|
2005
|
+
* @param {object} params.serviceAccountJSON - FCM service account JSON.
|
|
2006
|
+
* @throws {AppwriteException}
|
|
2007
|
+
* @returns {Promise<Models.Provider>}
|
|
2008
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `Messaging.updateFCMProvider` instead.
|
|
2009
|
+
*/
|
|
2010
|
+
updateFcmProvider(params: { providerId: string, name?: string, enabled?: boolean, serviceAccountJSON?: object }): Promise<Models.Provider>;
|
|
2011
|
+
/**
|
|
2012
|
+
* Update a Firebase Cloud Messaging provider by its unique ID.
|
|
2013
|
+
*
|
|
2014
|
+
* @param {string} providerId - Provider ID.
|
|
2015
|
+
* @param {string} name - Provider name.
|
|
2016
|
+
* @param {boolean} enabled - Set as enabled.
|
|
2017
|
+
* @param {object} serviceAccountJSON - FCM service account JSON.
|
|
2018
|
+
* @throws {AppwriteException}
|
|
2019
|
+
* @returns {Promise<Models.Provider>}
|
|
2020
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2021
|
+
*/
|
|
2022
|
+
updateFcmProvider(providerId: string, name?: string, enabled?: boolean, serviceAccountJSON?: object): Promise<Models.Provider>;
|
|
2023
|
+
updateFcmProvider(
|
|
2024
|
+
paramsOrFirst: { providerId: string, name?: string, enabled?: boolean, serviceAccountJSON?: object } | string,
|
|
2025
|
+
...rest: [(string)?, (boolean)?, (object)?]
|
|
2026
|
+
): Promise<Models.Provider> {
|
|
2027
|
+
let params: { providerId: string, name?: string, enabled?: boolean, serviceAccountJSON?: object };
|
|
2028
|
+
|
|
2029
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2030
|
+
params = (paramsOrFirst || {}) as { providerId: string, name?: string, enabled?: boolean, serviceAccountJSON?: object };
|
|
2031
|
+
} else {
|
|
2032
|
+
params = {
|
|
2033
|
+
providerId: paramsOrFirst as string,
|
|
2034
|
+
name: rest[0] as string,
|
|
2035
|
+
enabled: rest[1] as boolean,
|
|
2036
|
+
serviceAccountJSON: rest[2] as object
|
|
2037
|
+
};
|
|
2038
|
+
}
|
|
2039
|
+
|
|
2040
|
+
const providerId = params.providerId;
|
|
2041
|
+
const name = params.name;
|
|
2042
|
+
const enabled = params.enabled;
|
|
2043
|
+
const serviceAccountJSON = params.serviceAccountJSON;
|
|
2044
|
+
|
|
2045
|
+
if (typeof providerId === 'undefined') {
|
|
2046
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
2047
|
+
}
|
|
2048
|
+
|
|
2049
|
+
const apiPath = '/messaging/providers/fcm/{providerId}'.replace('{providerId}', providerId);
|
|
2050
|
+
const payload: Payload = {};
|
|
2051
|
+
if (typeof name !== 'undefined') {
|
|
2052
|
+
payload['name'] = name;
|
|
2053
|
+
}
|
|
2054
|
+
if (typeof enabled !== 'undefined') {
|
|
2055
|
+
payload['enabled'] = enabled;
|
|
2056
|
+
}
|
|
2057
|
+
if (typeof serviceAccountJSON !== 'undefined') {
|
|
2058
|
+
payload['serviceAccountJSON'] = serviceAccountJSON;
|
|
2059
|
+
}
|
|
2060
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2061
|
+
|
|
2062
|
+
const apiHeaders: { [header: string]: string } = {
|
|
2063
|
+
'content-type': 'application/json',
|
|
2064
|
+
}
|
|
2065
|
+
|
|
2066
|
+
return this.client.call(
|
|
2067
|
+
'patch',
|
|
2068
|
+
uri,
|
|
2069
|
+
apiHeaders,
|
|
2070
|
+
payload
|
|
2071
|
+
);
|
|
2072
|
+
}
|
|
2073
|
+
|
|
2074
|
+
/**
|
|
2075
|
+
* Update a Firebase Cloud Messaging provider by its unique ID.
|
|
2076
|
+
*
|
|
2077
|
+
* @param {string} params.providerId - Provider ID.
|
|
2078
|
+
* @param {string} params.name - Provider name.
|
|
2079
|
+
* @param {boolean} params.enabled - Set as enabled.
|
|
2080
|
+
* @param {object} params.serviceAccountJSON - FCM service account JSON.
|
|
2081
|
+
* @throws {AppwriteException}
|
|
2082
|
+
* @returns {Promise<Models.Provider>}
|
|
2083
|
+
*/
|
|
2084
|
+
updateFCMProvider(params: { providerId: string, name?: string, enabled?: boolean, serviceAccountJSON?: object }): Promise<Models.Provider>;
|
|
2085
|
+
/**
|
|
2086
|
+
* Update a Firebase Cloud Messaging provider by its unique ID.
|
|
2087
|
+
*
|
|
2088
|
+
* @param {string} providerId - Provider ID.
|
|
2089
|
+
* @param {string} name - Provider name.
|
|
2090
|
+
* @param {boolean} enabled - Set as enabled.
|
|
2091
|
+
* @param {object} serviceAccountJSON - FCM service account JSON.
|
|
2092
|
+
* @throws {AppwriteException}
|
|
2093
|
+
* @returns {Promise<Models.Provider>}
|
|
2094
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2095
|
+
*/
|
|
2096
|
+
updateFCMProvider(providerId: string, name?: string, enabled?: boolean, serviceAccountJSON?: object): Promise<Models.Provider>;
|
|
2097
|
+
updateFCMProvider(
|
|
2098
|
+
paramsOrFirst: { providerId: string, name?: string, enabled?: boolean, serviceAccountJSON?: object } | string,
|
|
2099
|
+
...rest: [(string)?, (boolean)?, (object)?]
|
|
2100
|
+
): Promise<Models.Provider> {
|
|
2101
|
+
let params: { providerId: string, name?: string, enabled?: boolean, serviceAccountJSON?: object };
|
|
2102
|
+
|
|
2103
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2104
|
+
params = (paramsOrFirst || {}) as { providerId: string, name?: string, enabled?: boolean, serviceAccountJSON?: object };
|
|
2105
|
+
} else {
|
|
2106
|
+
params = {
|
|
2107
|
+
providerId: paramsOrFirst as string,
|
|
2108
|
+
name: rest[0] as string,
|
|
2109
|
+
enabled: rest[1] as boolean,
|
|
2110
|
+
serviceAccountJSON: rest[2] as object
|
|
2111
|
+
};
|
|
2112
|
+
}
|
|
2113
|
+
|
|
2114
|
+
const providerId = params.providerId;
|
|
2115
|
+
const name = params.name;
|
|
2116
|
+
const enabled = params.enabled;
|
|
2117
|
+
const serviceAccountJSON = params.serviceAccountJSON;
|
|
2118
|
+
|
|
2119
|
+
if (typeof providerId === 'undefined') {
|
|
2120
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
2121
|
+
}
|
|
2122
|
+
|
|
2123
|
+
const apiPath = '/messaging/providers/fcm/{providerId}'.replace('{providerId}', providerId);
|
|
2124
|
+
const payload: Payload = {};
|
|
2125
|
+
if (typeof name !== 'undefined') {
|
|
2126
|
+
payload['name'] = name;
|
|
2127
|
+
}
|
|
2128
|
+
if (typeof enabled !== 'undefined') {
|
|
2129
|
+
payload['enabled'] = enabled;
|
|
2130
|
+
}
|
|
2131
|
+
if (typeof serviceAccountJSON !== 'undefined') {
|
|
2132
|
+
payload['serviceAccountJSON'] = serviceAccountJSON;
|
|
2133
|
+
}
|
|
2134
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2135
|
+
|
|
2136
|
+
const apiHeaders: { [header: string]: string } = {
|
|
2137
|
+
'content-type': 'application/json',
|
|
2138
|
+
}
|
|
2139
|
+
|
|
2140
|
+
return this.client.call(
|
|
2141
|
+
'patch',
|
|
2142
|
+
uri,
|
|
2143
|
+
apiHeaders,
|
|
2144
|
+
payload
|
|
2145
|
+
);
|
|
2146
|
+
}
|
|
2147
|
+
|
|
2148
|
+
/**
|
|
2149
|
+
* Create a new Mailgun provider.
|
|
2150
|
+
*
|
|
2151
|
+
* @param {string} params.providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
2152
|
+
* @param {string} params.name - Provider name.
|
|
2153
|
+
* @param {string} params.apiKey - Mailgun API Key.
|
|
2154
|
+
* @param {string} params.domain - Mailgun Domain.
|
|
2155
|
+
* @param {boolean} params.isEuRegion - Set as EU region.
|
|
2156
|
+
* @param {string} params.fromName - Sender Name.
|
|
2157
|
+
* @param {string} params.fromEmail - Sender email address.
|
|
2158
|
+
* @param {string} params.replyToName - Name set in the reply to field for the mail. Default value is sender name. Reply to name must have reply to email as well.
|
|
2159
|
+
* @param {string} params.replyToEmail - Email set in the reply to field for the mail. Default value is sender email. Reply to email must have reply to name as well.
|
|
2160
|
+
* @param {boolean} params.enabled - Set as enabled.
|
|
2161
|
+
* @throws {AppwriteException}
|
|
2162
|
+
* @returns {Promise<Models.Provider>}
|
|
2163
|
+
*/
|
|
2164
|
+
createMailgunProvider(params: { providerId: string, name: string, apiKey?: string, domain?: string, isEuRegion?: boolean, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }): Promise<Models.Provider>;
|
|
2165
|
+
/**
|
|
2166
|
+
* Create a new Mailgun provider.
|
|
2167
|
+
*
|
|
2168
|
+
* @param {string} providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
2169
|
+
* @param {string} name - Provider name.
|
|
2170
|
+
* @param {string} apiKey - Mailgun API Key.
|
|
2171
|
+
* @param {string} domain - Mailgun Domain.
|
|
2172
|
+
* @param {boolean} isEuRegion - Set as EU region.
|
|
2173
|
+
* @param {string} fromName - Sender Name.
|
|
2174
|
+
* @param {string} fromEmail - Sender email address.
|
|
2175
|
+
* @param {string} replyToName - Name set in the reply to field for the mail. Default value is sender name. Reply to name must have reply to email as well.
|
|
2176
|
+
* @param {string} replyToEmail - Email set in the reply to field for the mail. Default value is sender email. Reply to email must have reply to name as well.
|
|
2177
|
+
* @param {boolean} enabled - Set as enabled.
|
|
2178
|
+
* @throws {AppwriteException}
|
|
2179
|
+
* @returns {Promise<Models.Provider>}
|
|
2180
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2181
|
+
*/
|
|
2182
|
+
createMailgunProvider(providerId: string, name: string, apiKey?: string, domain?: string, isEuRegion?: boolean, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise<Models.Provider>;
|
|
2183
|
+
createMailgunProvider(
|
|
2184
|
+
paramsOrFirst: { providerId: string, name: string, apiKey?: string, domain?: string, isEuRegion?: boolean, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean } | string,
|
|
2185
|
+
...rest: [(string)?, (string)?, (string)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (boolean)?]
|
|
2186
|
+
): Promise<Models.Provider> {
|
|
2187
|
+
let params: { providerId: string, name: string, apiKey?: string, domain?: string, isEuRegion?: boolean, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean };
|
|
2188
|
+
|
|
2189
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2190
|
+
params = (paramsOrFirst || {}) as { providerId: string, name: string, apiKey?: string, domain?: string, isEuRegion?: boolean, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean };
|
|
2191
|
+
} else {
|
|
2192
|
+
params = {
|
|
2193
|
+
providerId: paramsOrFirst as string,
|
|
2194
|
+
name: rest[0] as string,
|
|
2195
|
+
apiKey: rest[1] as string,
|
|
2196
|
+
domain: rest[2] as string,
|
|
2197
|
+
isEuRegion: rest[3] as boolean,
|
|
2198
|
+
fromName: rest[4] as string,
|
|
2199
|
+
fromEmail: rest[5] as string,
|
|
2200
|
+
replyToName: rest[6] as string,
|
|
2201
|
+
replyToEmail: rest[7] as string,
|
|
2202
|
+
enabled: rest[8] as boolean
|
|
2203
|
+
};
|
|
2204
|
+
}
|
|
2205
|
+
|
|
2206
|
+
const providerId = params.providerId;
|
|
2207
|
+
const name = params.name;
|
|
2208
|
+
const apiKey = params.apiKey;
|
|
2209
|
+
const domain = params.domain;
|
|
2210
|
+
const isEuRegion = params.isEuRegion;
|
|
2211
|
+
const fromName = params.fromName;
|
|
2212
|
+
const fromEmail = params.fromEmail;
|
|
2213
|
+
const replyToName = params.replyToName;
|
|
2214
|
+
const replyToEmail = params.replyToEmail;
|
|
2215
|
+
const enabled = params.enabled;
|
|
2216
|
+
|
|
2217
|
+
if (typeof providerId === 'undefined') {
|
|
2218
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
2219
|
+
}
|
|
2220
|
+
if (typeof name === 'undefined') {
|
|
2221
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
2222
|
+
}
|
|
2223
|
+
|
|
2224
|
+
const apiPath = '/messaging/providers/mailgun';
|
|
2225
|
+
const payload: Payload = {};
|
|
2226
|
+
if (typeof providerId !== 'undefined') {
|
|
2227
|
+
payload['providerId'] = providerId;
|
|
2228
|
+
}
|
|
2229
|
+
if (typeof name !== 'undefined') {
|
|
2230
|
+
payload['name'] = name;
|
|
2231
|
+
}
|
|
2232
|
+
if (typeof apiKey !== 'undefined') {
|
|
2233
|
+
payload['apiKey'] = apiKey;
|
|
2234
|
+
}
|
|
2235
|
+
if (typeof domain !== 'undefined') {
|
|
2236
|
+
payload['domain'] = domain;
|
|
2237
|
+
}
|
|
2238
|
+
if (typeof isEuRegion !== 'undefined') {
|
|
2239
|
+
payload['isEuRegion'] = isEuRegion;
|
|
2240
|
+
}
|
|
2241
|
+
if (typeof fromName !== 'undefined') {
|
|
2242
|
+
payload['fromName'] = fromName;
|
|
2243
|
+
}
|
|
2244
|
+
if (typeof fromEmail !== 'undefined') {
|
|
2245
|
+
payload['fromEmail'] = fromEmail;
|
|
2246
|
+
}
|
|
2247
|
+
if (typeof replyToName !== 'undefined') {
|
|
2248
|
+
payload['replyToName'] = replyToName;
|
|
2249
|
+
}
|
|
2250
|
+
if (typeof replyToEmail !== 'undefined') {
|
|
2251
|
+
payload['replyToEmail'] = replyToEmail;
|
|
2252
|
+
}
|
|
2253
|
+
if (typeof enabled !== 'undefined') {
|
|
2254
|
+
payload['enabled'] = enabled;
|
|
2255
|
+
}
|
|
2256
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2257
|
+
|
|
2258
|
+
const apiHeaders: { [header: string]: string } = {
|
|
2259
|
+
'content-type': 'application/json',
|
|
2260
|
+
}
|
|
2261
|
+
|
|
2262
|
+
return this.client.call(
|
|
2263
|
+
'post',
|
|
2264
|
+
uri,
|
|
2265
|
+
apiHeaders,
|
|
2266
|
+
payload
|
|
2267
|
+
);
|
|
2268
|
+
}
|
|
2269
|
+
|
|
2270
|
+
/**
|
|
2271
|
+
* Update a Mailgun provider by its unique ID.
|
|
2272
|
+
*
|
|
2273
|
+
* @param {string} params.providerId - Provider ID.
|
|
2274
|
+
* @param {string} params.name - Provider name.
|
|
2275
|
+
* @param {string} params.apiKey - Mailgun API Key.
|
|
2276
|
+
* @param {string} params.domain - Mailgun Domain.
|
|
2277
|
+
* @param {boolean} params.isEuRegion - Set as EU region.
|
|
2278
|
+
* @param {boolean} params.enabled - Set as enabled.
|
|
2279
|
+
* @param {string} params.fromName - Sender Name.
|
|
2280
|
+
* @param {string} params.fromEmail - Sender email address.
|
|
2281
|
+
* @param {string} params.replyToName - Name set in the reply to field for the mail. Default value is sender name.
|
|
2282
|
+
* @param {string} params.replyToEmail - Email set in the reply to field for the mail. Default value is sender email.
|
|
2283
|
+
* @throws {AppwriteException}
|
|
2284
|
+
* @returns {Promise<Models.Provider>}
|
|
2285
|
+
*/
|
|
2286
|
+
updateMailgunProvider(params: { providerId: string, name?: string, apiKey?: string, domain?: string, isEuRegion?: boolean, enabled?: boolean, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string }): Promise<Models.Provider>;
|
|
2287
|
+
/**
|
|
2288
|
+
* Update a Mailgun provider by its unique ID.
|
|
2289
|
+
*
|
|
2290
|
+
* @param {string} providerId - Provider ID.
|
|
2291
|
+
* @param {string} name - Provider name.
|
|
2292
|
+
* @param {string} apiKey - Mailgun API Key.
|
|
2293
|
+
* @param {string} domain - Mailgun Domain.
|
|
2294
|
+
* @param {boolean} isEuRegion - Set as EU region.
|
|
2295
|
+
* @param {boolean} enabled - Set as enabled.
|
|
2296
|
+
* @param {string} fromName - Sender Name.
|
|
2297
|
+
* @param {string} fromEmail - Sender email address.
|
|
2298
|
+
* @param {string} replyToName - Name set in the reply to field for the mail. Default value is sender name.
|
|
2299
|
+
* @param {string} replyToEmail - Email set in the reply to field for the mail. Default value is sender email.
|
|
2300
|
+
* @throws {AppwriteException}
|
|
2301
|
+
* @returns {Promise<Models.Provider>}
|
|
2302
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2303
|
+
*/
|
|
2304
|
+
updateMailgunProvider(providerId: string, name?: string, apiKey?: string, domain?: string, isEuRegion?: boolean, enabled?: boolean, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string): Promise<Models.Provider>;
|
|
2305
|
+
updateMailgunProvider(
|
|
2306
|
+
paramsOrFirst: { providerId: string, name?: string, apiKey?: string, domain?: string, isEuRegion?: boolean, enabled?: boolean, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string } | string,
|
|
2307
|
+
...rest: [(string)?, (string)?, (string)?, (boolean)?, (boolean)?, (string)?, (string)?, (string)?, (string)?]
|
|
2308
|
+
): Promise<Models.Provider> {
|
|
2309
|
+
let params: { providerId: string, name?: string, apiKey?: string, domain?: string, isEuRegion?: boolean, enabled?: boolean, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string };
|
|
2310
|
+
|
|
2311
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2312
|
+
params = (paramsOrFirst || {}) as { providerId: string, name?: string, apiKey?: string, domain?: string, isEuRegion?: boolean, enabled?: boolean, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string };
|
|
2313
|
+
} else {
|
|
2314
|
+
params = {
|
|
2315
|
+
providerId: paramsOrFirst as string,
|
|
2316
|
+
name: rest[0] as string,
|
|
2317
|
+
apiKey: rest[1] as string,
|
|
2318
|
+
domain: rest[2] as string,
|
|
2319
|
+
isEuRegion: rest[3] as boolean,
|
|
2320
|
+
enabled: rest[4] as boolean,
|
|
2321
|
+
fromName: rest[5] as string,
|
|
2322
|
+
fromEmail: rest[6] as string,
|
|
2323
|
+
replyToName: rest[7] as string,
|
|
2324
|
+
replyToEmail: rest[8] as string
|
|
2325
|
+
};
|
|
2326
|
+
}
|
|
2327
|
+
|
|
2328
|
+
const providerId = params.providerId;
|
|
2329
|
+
const name = params.name;
|
|
2330
|
+
const apiKey = params.apiKey;
|
|
2331
|
+
const domain = params.domain;
|
|
2332
|
+
const isEuRegion = params.isEuRegion;
|
|
2333
|
+
const enabled = params.enabled;
|
|
2334
|
+
const fromName = params.fromName;
|
|
2335
|
+
const fromEmail = params.fromEmail;
|
|
2336
|
+
const replyToName = params.replyToName;
|
|
2337
|
+
const replyToEmail = params.replyToEmail;
|
|
2338
|
+
|
|
2339
|
+
if (typeof providerId === 'undefined') {
|
|
2340
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
2341
|
+
}
|
|
2342
|
+
|
|
2343
|
+
const apiPath = '/messaging/providers/mailgun/{providerId}'.replace('{providerId}', providerId);
|
|
2344
|
+
const payload: Payload = {};
|
|
2345
|
+
if (typeof name !== 'undefined') {
|
|
2346
|
+
payload['name'] = name;
|
|
2347
|
+
}
|
|
2348
|
+
if (typeof apiKey !== 'undefined') {
|
|
2349
|
+
payload['apiKey'] = apiKey;
|
|
2350
|
+
}
|
|
2351
|
+
if (typeof domain !== 'undefined') {
|
|
2352
|
+
payload['domain'] = domain;
|
|
2353
|
+
}
|
|
2354
|
+
if (typeof isEuRegion !== 'undefined') {
|
|
2355
|
+
payload['isEuRegion'] = isEuRegion;
|
|
2356
|
+
}
|
|
2357
|
+
if (typeof enabled !== 'undefined') {
|
|
2358
|
+
payload['enabled'] = enabled;
|
|
2359
|
+
}
|
|
2360
|
+
if (typeof fromName !== 'undefined') {
|
|
2361
|
+
payload['fromName'] = fromName;
|
|
2362
|
+
}
|
|
2363
|
+
if (typeof fromEmail !== 'undefined') {
|
|
2364
|
+
payload['fromEmail'] = fromEmail;
|
|
2365
|
+
}
|
|
2366
|
+
if (typeof replyToName !== 'undefined') {
|
|
2367
|
+
payload['replyToName'] = replyToName;
|
|
2368
|
+
}
|
|
2369
|
+
if (typeof replyToEmail !== 'undefined') {
|
|
2370
|
+
payload['replyToEmail'] = replyToEmail;
|
|
2371
|
+
}
|
|
740
2372
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
741
2373
|
|
|
742
2374
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -750,24 +2382,68 @@ export class Messaging {
|
|
|
750
2382
|
payload
|
|
751
2383
|
);
|
|
752
2384
|
}
|
|
2385
|
+
|
|
753
2386
|
/**
|
|
754
|
-
* Create a new
|
|
2387
|
+
* Create a new MSG91 provider.
|
|
2388
|
+
*
|
|
2389
|
+
* @param {string} params.providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
2390
|
+
* @param {string} params.name - Provider name.
|
|
2391
|
+
* @param {string} params.templateId - Msg91 template ID
|
|
2392
|
+
* @param {string} params.senderId - Msg91 sender ID.
|
|
2393
|
+
* @param {string} params.authKey - Msg91 auth key.
|
|
2394
|
+
* @param {boolean} params.enabled - Set as enabled.
|
|
2395
|
+
* @throws {AppwriteException}
|
|
2396
|
+
* @returns {Promise<Models.Provider>}
|
|
2397
|
+
*/
|
|
2398
|
+
createMsg91Provider(params: { providerId: string, name: string, templateId?: string, senderId?: string, authKey?: string, enabled?: boolean }): Promise<Models.Provider>;
|
|
2399
|
+
/**
|
|
2400
|
+
* Create a new MSG91 provider.
|
|
755
2401
|
*
|
|
756
|
-
* @param {string} providerId
|
|
757
|
-
* @param {string} name
|
|
758
|
-
* @param {
|
|
759
|
-
* @param {
|
|
2402
|
+
* @param {string} providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
2403
|
+
* @param {string} name - Provider name.
|
|
2404
|
+
* @param {string} templateId - Msg91 template ID
|
|
2405
|
+
* @param {string} senderId - Msg91 sender ID.
|
|
2406
|
+
* @param {string} authKey - Msg91 auth key.
|
|
2407
|
+
* @param {boolean} enabled - Set as enabled.
|
|
760
2408
|
* @throws {AppwriteException}
|
|
761
2409
|
* @returns {Promise<Models.Provider>}
|
|
2410
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
762
2411
|
*/
|
|
763
|
-
|
|
2412
|
+
createMsg91Provider(providerId: string, name: string, templateId?: string, senderId?: string, authKey?: string, enabled?: boolean): Promise<Models.Provider>;
|
|
2413
|
+
createMsg91Provider(
|
|
2414
|
+
paramsOrFirst: { providerId: string, name: string, templateId?: string, senderId?: string, authKey?: string, enabled?: boolean } | string,
|
|
2415
|
+
...rest: [(string)?, (string)?, (string)?, (string)?, (boolean)?]
|
|
2416
|
+
): Promise<Models.Provider> {
|
|
2417
|
+
let params: { providerId: string, name: string, templateId?: string, senderId?: string, authKey?: string, enabled?: boolean };
|
|
2418
|
+
|
|
2419
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2420
|
+
params = (paramsOrFirst || {}) as { providerId: string, name: string, templateId?: string, senderId?: string, authKey?: string, enabled?: boolean };
|
|
2421
|
+
} else {
|
|
2422
|
+
params = {
|
|
2423
|
+
providerId: paramsOrFirst as string,
|
|
2424
|
+
name: rest[0] as string,
|
|
2425
|
+
templateId: rest[1] as string,
|
|
2426
|
+
senderId: rest[2] as string,
|
|
2427
|
+
authKey: rest[3] as string,
|
|
2428
|
+
enabled: rest[4] as boolean
|
|
2429
|
+
};
|
|
2430
|
+
}
|
|
2431
|
+
|
|
2432
|
+
const providerId = params.providerId;
|
|
2433
|
+
const name = params.name;
|
|
2434
|
+
const templateId = params.templateId;
|
|
2435
|
+
const senderId = params.senderId;
|
|
2436
|
+
const authKey = params.authKey;
|
|
2437
|
+
const enabled = params.enabled;
|
|
2438
|
+
|
|
764
2439
|
if (typeof providerId === 'undefined') {
|
|
765
2440
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
766
2441
|
}
|
|
767
2442
|
if (typeof name === 'undefined') {
|
|
768
2443
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
769
2444
|
}
|
|
770
|
-
|
|
2445
|
+
|
|
2446
|
+
const apiPath = '/messaging/providers/msg91';
|
|
771
2447
|
const payload: Payload = {};
|
|
772
2448
|
if (typeof providerId !== 'undefined') {
|
|
773
2449
|
payload['providerId'] = providerId;
|
|
@@ -775,8 +2451,14 @@ export class Messaging {
|
|
|
775
2451
|
if (typeof name !== 'undefined') {
|
|
776
2452
|
payload['name'] = name;
|
|
777
2453
|
}
|
|
778
|
-
if (typeof
|
|
779
|
-
payload['
|
|
2454
|
+
if (typeof templateId !== 'undefined') {
|
|
2455
|
+
payload['templateId'] = templateId;
|
|
2456
|
+
}
|
|
2457
|
+
if (typeof senderId !== 'undefined') {
|
|
2458
|
+
payload['senderId'] = senderId;
|
|
2459
|
+
}
|
|
2460
|
+
if (typeof authKey !== 'undefined') {
|
|
2461
|
+
payload['authKey'] = authKey;
|
|
780
2462
|
}
|
|
781
2463
|
if (typeof enabled !== 'undefined') {
|
|
782
2464
|
payload['enabled'] = enabled;
|
|
@@ -794,21 +2476,65 @@ export class Messaging {
|
|
|
794
2476
|
payload
|
|
795
2477
|
);
|
|
796
2478
|
}
|
|
2479
|
+
|
|
797
2480
|
/**
|
|
798
|
-
* Update a
|
|
2481
|
+
* Update a MSG91 provider by its unique ID.
|
|
799
2482
|
*
|
|
800
|
-
* @param {string} providerId
|
|
801
|
-
* @param {string} name
|
|
802
|
-
* @param {boolean} enabled
|
|
803
|
-
* @param {
|
|
2483
|
+
* @param {string} params.providerId - Provider ID.
|
|
2484
|
+
* @param {string} params.name - Provider name.
|
|
2485
|
+
* @param {boolean} params.enabled - Set as enabled.
|
|
2486
|
+
* @param {string} params.templateId - Msg91 template ID.
|
|
2487
|
+
* @param {string} params.senderId - Msg91 sender ID.
|
|
2488
|
+
* @param {string} params.authKey - Msg91 auth key.
|
|
804
2489
|
* @throws {AppwriteException}
|
|
805
2490
|
* @returns {Promise<Models.Provider>}
|
|
806
2491
|
*/
|
|
807
|
-
|
|
2492
|
+
updateMsg91Provider(params: { providerId: string, name?: string, enabled?: boolean, templateId?: string, senderId?: string, authKey?: string }): Promise<Models.Provider>;
|
|
2493
|
+
/**
|
|
2494
|
+
* Update a MSG91 provider by its unique ID.
|
|
2495
|
+
*
|
|
2496
|
+
* @param {string} providerId - Provider ID.
|
|
2497
|
+
* @param {string} name - Provider name.
|
|
2498
|
+
* @param {boolean} enabled - Set as enabled.
|
|
2499
|
+
* @param {string} templateId - Msg91 template ID.
|
|
2500
|
+
* @param {string} senderId - Msg91 sender ID.
|
|
2501
|
+
* @param {string} authKey - Msg91 auth key.
|
|
2502
|
+
* @throws {AppwriteException}
|
|
2503
|
+
* @returns {Promise<Models.Provider>}
|
|
2504
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2505
|
+
*/
|
|
2506
|
+
updateMsg91Provider(providerId: string, name?: string, enabled?: boolean, templateId?: string, senderId?: string, authKey?: string): Promise<Models.Provider>;
|
|
2507
|
+
updateMsg91Provider(
|
|
2508
|
+
paramsOrFirst: { providerId: string, name?: string, enabled?: boolean, templateId?: string, senderId?: string, authKey?: string } | string,
|
|
2509
|
+
...rest: [(string)?, (boolean)?, (string)?, (string)?, (string)?]
|
|
2510
|
+
): Promise<Models.Provider> {
|
|
2511
|
+
let params: { providerId: string, name?: string, enabled?: boolean, templateId?: string, senderId?: string, authKey?: string };
|
|
2512
|
+
|
|
2513
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2514
|
+
params = (paramsOrFirst || {}) as { providerId: string, name?: string, enabled?: boolean, templateId?: string, senderId?: string, authKey?: string };
|
|
2515
|
+
} else {
|
|
2516
|
+
params = {
|
|
2517
|
+
providerId: paramsOrFirst as string,
|
|
2518
|
+
name: rest[0] as string,
|
|
2519
|
+
enabled: rest[1] as boolean,
|
|
2520
|
+
templateId: rest[2] as string,
|
|
2521
|
+
senderId: rest[3] as string,
|
|
2522
|
+
authKey: rest[4] as string
|
|
2523
|
+
};
|
|
2524
|
+
}
|
|
2525
|
+
|
|
2526
|
+
const providerId = params.providerId;
|
|
2527
|
+
const name = params.name;
|
|
2528
|
+
const enabled = params.enabled;
|
|
2529
|
+
const templateId = params.templateId;
|
|
2530
|
+
const senderId = params.senderId;
|
|
2531
|
+
const authKey = params.authKey;
|
|
2532
|
+
|
|
808
2533
|
if (typeof providerId === 'undefined') {
|
|
809
2534
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
810
2535
|
}
|
|
811
|
-
|
|
2536
|
+
|
|
2537
|
+
const apiPath = '/messaging/providers/msg91/{providerId}'.replace('{providerId}', providerId);
|
|
812
2538
|
const payload: Payload = {};
|
|
813
2539
|
if (typeof name !== 'undefined') {
|
|
814
2540
|
payload['name'] = name;
|
|
@@ -816,8 +2542,14 @@ export class Messaging {
|
|
|
816
2542
|
if (typeof enabled !== 'undefined') {
|
|
817
2543
|
payload['enabled'] = enabled;
|
|
818
2544
|
}
|
|
819
|
-
if (typeof
|
|
820
|
-
payload['
|
|
2545
|
+
if (typeof templateId !== 'undefined') {
|
|
2546
|
+
payload['templateId'] = templateId;
|
|
2547
|
+
}
|
|
2548
|
+
if (typeof senderId !== 'undefined') {
|
|
2549
|
+
payload['senderId'] = senderId;
|
|
2550
|
+
}
|
|
2551
|
+
if (typeof authKey !== 'undefined') {
|
|
2552
|
+
payload['authKey'] = authKey;
|
|
821
2553
|
}
|
|
822
2554
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
823
2555
|
|
|
@@ -832,30 +2564,76 @@ export class Messaging {
|
|
|
832
2564
|
payload
|
|
833
2565
|
);
|
|
834
2566
|
}
|
|
2567
|
+
|
|
835
2568
|
/**
|
|
836
|
-
* Create a new
|
|
2569
|
+
* Create a new Resend provider.
|
|
2570
|
+
*
|
|
2571
|
+
* @param {string} params.providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
2572
|
+
* @param {string} params.name - Provider name.
|
|
2573
|
+
* @param {string} params.apiKey - Resend API key.
|
|
2574
|
+
* @param {string} params.fromName - Sender Name.
|
|
2575
|
+
* @param {string} params.fromEmail - Sender email address.
|
|
2576
|
+
* @param {string} params.replyToName - Name set in the reply to field for the mail. Default value is sender name.
|
|
2577
|
+
* @param {string} params.replyToEmail - Email set in the reply to field for the mail. Default value is sender email.
|
|
2578
|
+
* @param {boolean} params.enabled - Set as enabled.
|
|
2579
|
+
* @throws {AppwriteException}
|
|
2580
|
+
* @returns {Promise<Models.Provider>}
|
|
2581
|
+
*/
|
|
2582
|
+
createResendProvider(params: { providerId: string, name: string, apiKey?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }): Promise<Models.Provider>;
|
|
2583
|
+
/**
|
|
2584
|
+
* Create a new Resend provider.
|
|
837
2585
|
*
|
|
838
|
-
* @param {string} providerId
|
|
839
|
-
* @param {string} name
|
|
840
|
-
* @param {string} apiKey
|
|
841
|
-
* @param {string}
|
|
842
|
-
* @param {
|
|
843
|
-
* @param {string}
|
|
844
|
-
* @param {string}
|
|
845
|
-
* @param {
|
|
846
|
-
* @param {string} replyToEmail
|
|
847
|
-
* @param {boolean} enabled
|
|
2586
|
+
* @param {string} providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
2587
|
+
* @param {string} name - Provider name.
|
|
2588
|
+
* @param {string} apiKey - Resend API key.
|
|
2589
|
+
* @param {string} fromName - Sender Name.
|
|
2590
|
+
* @param {string} fromEmail - Sender email address.
|
|
2591
|
+
* @param {string} replyToName - Name set in the reply to field for the mail. Default value is sender name.
|
|
2592
|
+
* @param {string} replyToEmail - Email set in the reply to field for the mail. Default value is sender email.
|
|
2593
|
+
* @param {boolean} enabled - Set as enabled.
|
|
848
2594
|
* @throws {AppwriteException}
|
|
849
2595
|
* @returns {Promise<Models.Provider>}
|
|
2596
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
850
2597
|
*/
|
|
851
|
-
|
|
2598
|
+
createResendProvider(providerId: string, name: string, apiKey?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise<Models.Provider>;
|
|
2599
|
+
createResendProvider(
|
|
2600
|
+
paramsOrFirst: { providerId: string, name: string, apiKey?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean } | string,
|
|
2601
|
+
...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?]
|
|
2602
|
+
): Promise<Models.Provider> {
|
|
2603
|
+
let params: { providerId: string, name: string, apiKey?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean };
|
|
2604
|
+
|
|
2605
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2606
|
+
params = (paramsOrFirst || {}) as { providerId: string, name: string, apiKey?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean };
|
|
2607
|
+
} else {
|
|
2608
|
+
params = {
|
|
2609
|
+
providerId: paramsOrFirst as string,
|
|
2610
|
+
name: rest[0] as string,
|
|
2611
|
+
apiKey: rest[1] as string,
|
|
2612
|
+
fromName: rest[2] as string,
|
|
2613
|
+
fromEmail: rest[3] as string,
|
|
2614
|
+
replyToName: rest[4] as string,
|
|
2615
|
+
replyToEmail: rest[5] as string,
|
|
2616
|
+
enabled: rest[6] as boolean
|
|
2617
|
+
};
|
|
2618
|
+
}
|
|
2619
|
+
|
|
2620
|
+
const providerId = params.providerId;
|
|
2621
|
+
const name = params.name;
|
|
2622
|
+
const apiKey = params.apiKey;
|
|
2623
|
+
const fromName = params.fromName;
|
|
2624
|
+
const fromEmail = params.fromEmail;
|
|
2625
|
+
const replyToName = params.replyToName;
|
|
2626
|
+
const replyToEmail = params.replyToEmail;
|
|
2627
|
+
const enabled = params.enabled;
|
|
2628
|
+
|
|
852
2629
|
if (typeof providerId === 'undefined') {
|
|
853
2630
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
854
2631
|
}
|
|
855
2632
|
if (typeof name === 'undefined') {
|
|
856
2633
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
857
2634
|
}
|
|
858
|
-
|
|
2635
|
+
|
|
2636
|
+
const apiPath = '/messaging/providers/resend';
|
|
859
2637
|
const payload: Payload = {};
|
|
860
2638
|
if (typeof providerId !== 'undefined') {
|
|
861
2639
|
payload['providerId'] = providerId;
|
|
@@ -866,12 +2644,6 @@ export class Messaging {
|
|
|
866
2644
|
if (typeof apiKey !== 'undefined') {
|
|
867
2645
|
payload['apiKey'] = apiKey;
|
|
868
2646
|
}
|
|
869
|
-
if (typeof domain !== 'undefined') {
|
|
870
|
-
payload['domain'] = domain;
|
|
871
|
-
}
|
|
872
|
-
if (typeof isEuRegion !== 'undefined') {
|
|
873
|
-
payload['isEuRegion'] = isEuRegion;
|
|
874
|
-
}
|
|
875
2647
|
if (typeof fromName !== 'undefined') {
|
|
876
2648
|
payload['fromName'] = fromName;
|
|
877
2649
|
}
|
|
@@ -900,43 +2672,83 @@ export class Messaging {
|
|
|
900
2672
|
payload
|
|
901
2673
|
);
|
|
902
2674
|
}
|
|
2675
|
+
|
|
903
2676
|
/**
|
|
904
|
-
* Update a
|
|
2677
|
+
* Update a Resend provider by its unique ID.
|
|
2678
|
+
*
|
|
2679
|
+
* @param {string} params.providerId - Provider ID.
|
|
2680
|
+
* @param {string} params.name - Provider name.
|
|
2681
|
+
* @param {boolean} params.enabled - Set as enabled.
|
|
2682
|
+
* @param {string} params.apiKey - Resend API key.
|
|
2683
|
+
* @param {string} params.fromName - Sender Name.
|
|
2684
|
+
* @param {string} params.fromEmail - Sender email address.
|
|
2685
|
+
* @param {string} params.replyToName - Name set in the Reply To field for the mail. Default value is Sender Name.
|
|
2686
|
+
* @param {string} params.replyToEmail - Email set in the Reply To field for the mail. Default value is Sender Email.
|
|
2687
|
+
* @throws {AppwriteException}
|
|
2688
|
+
* @returns {Promise<Models.Provider>}
|
|
2689
|
+
*/
|
|
2690
|
+
updateResendProvider(params: { providerId: string, name?: string, enabled?: boolean, apiKey?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string }): Promise<Models.Provider>;
|
|
2691
|
+
/**
|
|
2692
|
+
* Update a Resend provider by its unique ID.
|
|
905
2693
|
*
|
|
906
|
-
* @param {string} providerId
|
|
907
|
-
* @param {string} name
|
|
908
|
-
* @param {
|
|
909
|
-
* @param {string}
|
|
910
|
-
* @param {
|
|
911
|
-
* @param {
|
|
912
|
-
* @param {string}
|
|
913
|
-
* @param {string}
|
|
914
|
-
* @param {string} replyToName
|
|
915
|
-
* @param {string} replyToEmail
|
|
2694
|
+
* @param {string} providerId - Provider ID.
|
|
2695
|
+
* @param {string} name - Provider name.
|
|
2696
|
+
* @param {boolean} enabled - Set as enabled.
|
|
2697
|
+
* @param {string} apiKey - Resend API key.
|
|
2698
|
+
* @param {string} fromName - Sender Name.
|
|
2699
|
+
* @param {string} fromEmail - Sender email address.
|
|
2700
|
+
* @param {string} replyToName - Name set in the Reply To field for the mail. Default value is Sender Name.
|
|
2701
|
+
* @param {string} replyToEmail - Email set in the Reply To field for the mail. Default value is Sender Email.
|
|
916
2702
|
* @throws {AppwriteException}
|
|
917
2703
|
* @returns {Promise<Models.Provider>}
|
|
2704
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
918
2705
|
*/
|
|
919
|
-
|
|
2706
|
+
updateResendProvider(providerId: string, name?: string, enabled?: boolean, apiKey?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string): Promise<Models.Provider>;
|
|
2707
|
+
updateResendProvider(
|
|
2708
|
+
paramsOrFirst: { providerId: string, name?: string, enabled?: boolean, apiKey?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string } | string,
|
|
2709
|
+
...rest: [(string)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (string)?]
|
|
2710
|
+
): Promise<Models.Provider> {
|
|
2711
|
+
let params: { providerId: string, name?: string, enabled?: boolean, apiKey?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string };
|
|
2712
|
+
|
|
2713
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2714
|
+
params = (paramsOrFirst || {}) as { providerId: string, name?: string, enabled?: boolean, apiKey?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string };
|
|
2715
|
+
} else {
|
|
2716
|
+
params = {
|
|
2717
|
+
providerId: paramsOrFirst as string,
|
|
2718
|
+
name: rest[0] as string,
|
|
2719
|
+
enabled: rest[1] as boolean,
|
|
2720
|
+
apiKey: rest[2] as string,
|
|
2721
|
+
fromName: rest[3] as string,
|
|
2722
|
+
fromEmail: rest[4] as string,
|
|
2723
|
+
replyToName: rest[5] as string,
|
|
2724
|
+
replyToEmail: rest[6] as string
|
|
2725
|
+
};
|
|
2726
|
+
}
|
|
2727
|
+
|
|
2728
|
+
const providerId = params.providerId;
|
|
2729
|
+
const name = params.name;
|
|
2730
|
+
const enabled = params.enabled;
|
|
2731
|
+
const apiKey = params.apiKey;
|
|
2732
|
+
const fromName = params.fromName;
|
|
2733
|
+
const fromEmail = params.fromEmail;
|
|
2734
|
+
const replyToName = params.replyToName;
|
|
2735
|
+
const replyToEmail = params.replyToEmail;
|
|
2736
|
+
|
|
920
2737
|
if (typeof providerId === 'undefined') {
|
|
921
2738
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
922
2739
|
}
|
|
923
|
-
|
|
2740
|
+
|
|
2741
|
+
const apiPath = '/messaging/providers/resend/{providerId}'.replace('{providerId}', providerId);
|
|
924
2742
|
const payload: Payload = {};
|
|
925
2743
|
if (typeof name !== 'undefined') {
|
|
926
2744
|
payload['name'] = name;
|
|
927
2745
|
}
|
|
928
|
-
if (typeof apiKey !== 'undefined') {
|
|
929
|
-
payload['apiKey'] = apiKey;
|
|
930
|
-
}
|
|
931
|
-
if (typeof domain !== 'undefined') {
|
|
932
|
-
payload['domain'] = domain;
|
|
933
|
-
}
|
|
934
|
-
if (typeof isEuRegion !== 'undefined') {
|
|
935
|
-
payload['isEuRegion'] = isEuRegion;
|
|
936
|
-
}
|
|
937
2746
|
if (typeof enabled !== 'undefined') {
|
|
938
2747
|
payload['enabled'] = enabled;
|
|
939
2748
|
}
|
|
2749
|
+
if (typeof apiKey !== 'undefined') {
|
|
2750
|
+
payload['apiKey'] = apiKey;
|
|
2751
|
+
}
|
|
940
2752
|
if (typeof fromName !== 'undefined') {
|
|
941
2753
|
payload['fromName'] = fromName;
|
|
942
2754
|
}
|
|
@@ -962,26 +2774,76 @@ export class Messaging {
|
|
|
962
2774
|
payload
|
|
963
2775
|
);
|
|
964
2776
|
}
|
|
2777
|
+
|
|
965
2778
|
/**
|
|
966
|
-
* Create a new
|
|
2779
|
+
* Create a new Sendgrid provider.
|
|
2780
|
+
*
|
|
2781
|
+
* @param {string} params.providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
2782
|
+
* @param {string} params.name - Provider name.
|
|
2783
|
+
* @param {string} params.apiKey - Sendgrid API key.
|
|
2784
|
+
* @param {string} params.fromName - Sender Name.
|
|
2785
|
+
* @param {string} params.fromEmail - Sender email address.
|
|
2786
|
+
* @param {string} params.replyToName - Name set in the reply to field for the mail. Default value is sender name.
|
|
2787
|
+
* @param {string} params.replyToEmail - Email set in the reply to field for the mail. Default value is sender email.
|
|
2788
|
+
* @param {boolean} params.enabled - Set as enabled.
|
|
2789
|
+
* @throws {AppwriteException}
|
|
2790
|
+
* @returns {Promise<Models.Provider>}
|
|
2791
|
+
*/
|
|
2792
|
+
createSendgridProvider(params: { providerId: string, name: string, apiKey?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }): Promise<Models.Provider>;
|
|
2793
|
+
/**
|
|
2794
|
+
* Create a new Sendgrid provider.
|
|
967
2795
|
*
|
|
968
|
-
* @param {string} providerId
|
|
969
|
-
* @param {string} name
|
|
970
|
-
* @param {string}
|
|
971
|
-
* @param {string}
|
|
972
|
-
* @param {string}
|
|
973
|
-
* @param {
|
|
2796
|
+
* @param {string} providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
2797
|
+
* @param {string} name - Provider name.
|
|
2798
|
+
* @param {string} apiKey - Sendgrid API key.
|
|
2799
|
+
* @param {string} fromName - Sender Name.
|
|
2800
|
+
* @param {string} fromEmail - Sender email address.
|
|
2801
|
+
* @param {string} replyToName - Name set in the reply to field for the mail. Default value is sender name.
|
|
2802
|
+
* @param {string} replyToEmail - Email set in the reply to field for the mail. Default value is sender email.
|
|
2803
|
+
* @param {boolean} enabled - Set as enabled.
|
|
974
2804
|
* @throws {AppwriteException}
|
|
975
2805
|
* @returns {Promise<Models.Provider>}
|
|
2806
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
976
2807
|
*/
|
|
977
|
-
|
|
2808
|
+
createSendgridProvider(providerId: string, name: string, apiKey?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise<Models.Provider>;
|
|
2809
|
+
createSendgridProvider(
|
|
2810
|
+
paramsOrFirst: { providerId: string, name: string, apiKey?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean } | string,
|
|
2811
|
+
...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?]
|
|
2812
|
+
): Promise<Models.Provider> {
|
|
2813
|
+
let params: { providerId: string, name: string, apiKey?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean };
|
|
2814
|
+
|
|
2815
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2816
|
+
params = (paramsOrFirst || {}) as { providerId: string, name: string, apiKey?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean };
|
|
2817
|
+
} else {
|
|
2818
|
+
params = {
|
|
2819
|
+
providerId: paramsOrFirst as string,
|
|
2820
|
+
name: rest[0] as string,
|
|
2821
|
+
apiKey: rest[1] as string,
|
|
2822
|
+
fromName: rest[2] as string,
|
|
2823
|
+
fromEmail: rest[3] as string,
|
|
2824
|
+
replyToName: rest[4] as string,
|
|
2825
|
+
replyToEmail: rest[5] as string,
|
|
2826
|
+
enabled: rest[6] as boolean
|
|
2827
|
+
};
|
|
2828
|
+
}
|
|
2829
|
+
|
|
2830
|
+
const providerId = params.providerId;
|
|
2831
|
+
const name = params.name;
|
|
2832
|
+
const apiKey = params.apiKey;
|
|
2833
|
+
const fromName = params.fromName;
|
|
2834
|
+
const fromEmail = params.fromEmail;
|
|
2835
|
+
const replyToName = params.replyToName;
|
|
2836
|
+
const replyToEmail = params.replyToEmail;
|
|
2837
|
+
const enabled = params.enabled;
|
|
2838
|
+
|
|
978
2839
|
if (typeof providerId === 'undefined') {
|
|
979
2840
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
980
2841
|
}
|
|
981
2842
|
if (typeof name === 'undefined') {
|
|
982
2843
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
983
2844
|
}
|
|
984
|
-
|
|
2845
|
+
|
|
2846
|
+
const apiPath = '/messaging/providers/sendgrid';
|
|
985
2847
|
const payload: Payload = {};
|
|
986
2848
|
if (typeof providerId !== 'undefined') {
|
|
987
2849
|
payload['providerId'] = providerId;
|
|
@@ -989,14 +2851,20 @@ export class Messaging {
|
|
|
989
2851
|
if (typeof name !== 'undefined') {
|
|
990
2852
|
payload['name'] = name;
|
|
991
2853
|
}
|
|
992
|
-
if (typeof
|
|
993
|
-
payload['
|
|
2854
|
+
if (typeof apiKey !== 'undefined') {
|
|
2855
|
+
payload['apiKey'] = apiKey;
|
|
994
2856
|
}
|
|
995
|
-
if (typeof
|
|
996
|
-
payload['
|
|
2857
|
+
if (typeof fromName !== 'undefined') {
|
|
2858
|
+
payload['fromName'] = fromName;
|
|
997
2859
|
}
|
|
998
|
-
if (typeof
|
|
999
|
-
payload['
|
|
2860
|
+
if (typeof fromEmail !== 'undefined') {
|
|
2861
|
+
payload['fromEmail'] = fromEmail;
|
|
2862
|
+
}
|
|
2863
|
+
if (typeof replyToName !== 'undefined') {
|
|
2864
|
+
payload['replyToName'] = replyToName;
|
|
2865
|
+
}
|
|
2866
|
+
if (typeof replyToEmail !== 'undefined') {
|
|
2867
|
+
payload['replyToEmail'] = replyToEmail;
|
|
1000
2868
|
}
|
|
1001
2869
|
if (typeof enabled !== 'undefined') {
|
|
1002
2870
|
payload['enabled'] = enabled;
|
|
@@ -1014,23 +2882,73 @@ export class Messaging {
|
|
|
1014
2882
|
payload
|
|
1015
2883
|
);
|
|
1016
2884
|
}
|
|
2885
|
+
|
|
1017
2886
|
/**
|
|
1018
|
-
* Update a
|
|
2887
|
+
* Update a Sendgrid provider by its unique ID.
|
|
2888
|
+
*
|
|
2889
|
+
* @param {string} params.providerId - Provider ID.
|
|
2890
|
+
* @param {string} params.name - Provider name.
|
|
2891
|
+
* @param {boolean} params.enabled - Set as enabled.
|
|
2892
|
+
* @param {string} params.apiKey - Sendgrid API key.
|
|
2893
|
+
* @param {string} params.fromName - Sender Name.
|
|
2894
|
+
* @param {string} params.fromEmail - Sender email address.
|
|
2895
|
+
* @param {string} params.replyToName - Name set in the Reply To field for the mail. Default value is Sender Name.
|
|
2896
|
+
* @param {string} params.replyToEmail - Email set in the Reply To field for the mail. Default value is Sender Email.
|
|
2897
|
+
* @throws {AppwriteException}
|
|
2898
|
+
* @returns {Promise<Models.Provider>}
|
|
2899
|
+
*/
|
|
2900
|
+
updateSendgridProvider(params: { providerId: string, name?: string, enabled?: boolean, apiKey?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string }): Promise<Models.Provider>;
|
|
2901
|
+
/**
|
|
2902
|
+
* Update a Sendgrid provider by its unique ID.
|
|
1019
2903
|
*
|
|
1020
|
-
* @param {string} providerId
|
|
1021
|
-
* @param {string} name
|
|
1022
|
-
* @param {boolean} enabled
|
|
1023
|
-
* @param {string}
|
|
1024
|
-
* @param {string}
|
|
1025
|
-
* @param {string}
|
|
2904
|
+
* @param {string} providerId - Provider ID.
|
|
2905
|
+
* @param {string} name - Provider name.
|
|
2906
|
+
* @param {boolean} enabled - Set as enabled.
|
|
2907
|
+
* @param {string} apiKey - Sendgrid API key.
|
|
2908
|
+
* @param {string} fromName - Sender Name.
|
|
2909
|
+
* @param {string} fromEmail - Sender email address.
|
|
2910
|
+
* @param {string} replyToName - Name set in the Reply To field for the mail. Default value is Sender Name.
|
|
2911
|
+
* @param {string} replyToEmail - Email set in the Reply To field for the mail. Default value is Sender Email.
|
|
1026
2912
|
* @throws {AppwriteException}
|
|
1027
2913
|
* @returns {Promise<Models.Provider>}
|
|
2914
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1028
2915
|
*/
|
|
1029
|
-
|
|
2916
|
+
updateSendgridProvider(providerId: string, name?: string, enabled?: boolean, apiKey?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string): Promise<Models.Provider>;
|
|
2917
|
+
updateSendgridProvider(
|
|
2918
|
+
paramsOrFirst: { providerId: string, name?: string, enabled?: boolean, apiKey?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string } | string,
|
|
2919
|
+
...rest: [(string)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (string)?]
|
|
2920
|
+
): Promise<Models.Provider> {
|
|
2921
|
+
let params: { providerId: string, name?: string, enabled?: boolean, apiKey?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string };
|
|
2922
|
+
|
|
2923
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2924
|
+
params = (paramsOrFirst || {}) as { providerId: string, name?: string, enabled?: boolean, apiKey?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string };
|
|
2925
|
+
} else {
|
|
2926
|
+
params = {
|
|
2927
|
+
providerId: paramsOrFirst as string,
|
|
2928
|
+
name: rest[0] as string,
|
|
2929
|
+
enabled: rest[1] as boolean,
|
|
2930
|
+
apiKey: rest[2] as string,
|
|
2931
|
+
fromName: rest[3] as string,
|
|
2932
|
+
fromEmail: rest[4] as string,
|
|
2933
|
+
replyToName: rest[5] as string,
|
|
2934
|
+
replyToEmail: rest[6] as string
|
|
2935
|
+
};
|
|
2936
|
+
}
|
|
2937
|
+
|
|
2938
|
+
const providerId = params.providerId;
|
|
2939
|
+
const name = params.name;
|
|
2940
|
+
const enabled = params.enabled;
|
|
2941
|
+
const apiKey = params.apiKey;
|
|
2942
|
+
const fromName = params.fromName;
|
|
2943
|
+
const fromEmail = params.fromEmail;
|
|
2944
|
+
const replyToName = params.replyToName;
|
|
2945
|
+
const replyToEmail = params.replyToEmail;
|
|
2946
|
+
|
|
1030
2947
|
if (typeof providerId === 'undefined') {
|
|
1031
2948
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1032
2949
|
}
|
|
1033
|
-
|
|
2950
|
+
|
|
2951
|
+
const apiPath = '/messaging/providers/sendgrid/{providerId}'.replace('{providerId}', providerId);
|
|
1034
2952
|
const payload: Payload = {};
|
|
1035
2953
|
if (typeof name !== 'undefined') {
|
|
1036
2954
|
payload['name'] = name;
|
|
@@ -1038,14 +2956,20 @@ export class Messaging {
|
|
|
1038
2956
|
if (typeof enabled !== 'undefined') {
|
|
1039
2957
|
payload['enabled'] = enabled;
|
|
1040
2958
|
}
|
|
1041
|
-
if (typeof
|
|
1042
|
-
payload['
|
|
2959
|
+
if (typeof apiKey !== 'undefined') {
|
|
2960
|
+
payload['apiKey'] = apiKey;
|
|
1043
2961
|
}
|
|
1044
|
-
if (typeof
|
|
1045
|
-
payload['
|
|
2962
|
+
if (typeof fromName !== 'undefined') {
|
|
2963
|
+
payload['fromName'] = fromName;
|
|
1046
2964
|
}
|
|
1047
|
-
if (typeof
|
|
1048
|
-
payload['
|
|
2965
|
+
if (typeof fromEmail !== 'undefined') {
|
|
2966
|
+
payload['fromEmail'] = fromEmail;
|
|
2967
|
+
}
|
|
2968
|
+
if (typeof replyToName !== 'undefined') {
|
|
2969
|
+
payload['replyToName'] = replyToName;
|
|
2970
|
+
}
|
|
2971
|
+
if (typeof replyToEmail !== 'undefined') {
|
|
2972
|
+
payload['replyToEmail'] = replyToEmail;
|
|
1049
2973
|
}
|
|
1050
2974
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1051
2975
|
|
|
@@ -1060,28 +2984,104 @@ export class Messaging {
|
|
|
1060
2984
|
payload
|
|
1061
2985
|
);
|
|
1062
2986
|
}
|
|
2987
|
+
|
|
1063
2988
|
/**
|
|
1064
|
-
* Create a new
|
|
2989
|
+
* Create a new SMTP provider.
|
|
2990
|
+
*
|
|
2991
|
+
* @param {string} params.providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
2992
|
+
* @param {string} params.name - Provider name.
|
|
2993
|
+
* @param {string} params.host - SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order.
|
|
2994
|
+
* @param {number} params.port - The default SMTP server port.
|
|
2995
|
+
* @param {string} params.username - Authentication username.
|
|
2996
|
+
* @param {string} params.password - Authentication password.
|
|
2997
|
+
* @param {SmtpEncryption} params.encryption - Encryption type. Can be omitted, 'ssl', or 'tls'
|
|
2998
|
+
* @param {boolean} params.autoTLS - Enable SMTP AutoTLS feature.
|
|
2999
|
+
* @param {string} params.mailer - The value to use for the X-Mailer header.
|
|
3000
|
+
* @param {string} params.fromName - Sender Name.
|
|
3001
|
+
* @param {string} params.fromEmail - Sender email address.
|
|
3002
|
+
* @param {string} params.replyToName - Name set in the reply to field for the mail. Default value is sender name.
|
|
3003
|
+
* @param {string} params.replyToEmail - Email set in the reply to field for the mail. Default value is sender email.
|
|
3004
|
+
* @param {boolean} params.enabled - Set as enabled.
|
|
3005
|
+
* @throws {AppwriteException}
|
|
3006
|
+
* @returns {Promise<Models.Provider>}
|
|
3007
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `Messaging.createSMTPProvider` instead.
|
|
3008
|
+
*/
|
|
3009
|
+
createSmtpProvider(params: { providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }): Promise<Models.Provider>;
|
|
3010
|
+
/**
|
|
3011
|
+
* Create a new SMTP provider.
|
|
1065
3012
|
*
|
|
1066
|
-
* @param {string} providerId
|
|
1067
|
-
* @param {string} name
|
|
1068
|
-
* @param {string}
|
|
1069
|
-
* @param {
|
|
1070
|
-
* @param {string}
|
|
1071
|
-
* @param {string}
|
|
1072
|
-
* @param {
|
|
1073
|
-
* @param {boolean}
|
|
3013
|
+
* @param {string} providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
3014
|
+
* @param {string} name - Provider name.
|
|
3015
|
+
* @param {string} host - SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order.
|
|
3016
|
+
* @param {number} port - The default SMTP server port.
|
|
3017
|
+
* @param {string} username - Authentication username.
|
|
3018
|
+
* @param {string} password - Authentication password.
|
|
3019
|
+
* @param {SmtpEncryption} encryption - Encryption type. Can be omitted, 'ssl', or 'tls'
|
|
3020
|
+
* @param {boolean} autoTLS - Enable SMTP AutoTLS feature.
|
|
3021
|
+
* @param {string} mailer - The value to use for the X-Mailer header.
|
|
3022
|
+
* @param {string} fromName - Sender Name.
|
|
3023
|
+
* @param {string} fromEmail - Sender email address.
|
|
3024
|
+
* @param {string} replyToName - Name set in the reply to field for the mail. Default value is sender name.
|
|
3025
|
+
* @param {string} replyToEmail - Email set in the reply to field for the mail. Default value is sender email.
|
|
3026
|
+
* @param {boolean} enabled - Set as enabled.
|
|
1074
3027
|
* @throws {AppwriteException}
|
|
1075
3028
|
* @returns {Promise<Models.Provider>}
|
|
3029
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1076
3030
|
*/
|
|
1077
|
-
|
|
3031
|
+
createSmtpProvider(providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise<Models.Provider>;
|
|
3032
|
+
createSmtpProvider(
|
|
3033
|
+
paramsOrFirst: { providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean } | string,
|
|
3034
|
+
...rest: [(string)?, (string)?, (number)?, (string)?, (string)?, (SmtpEncryption)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?]
|
|
3035
|
+
): Promise<Models.Provider> {
|
|
3036
|
+
let params: { providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean };
|
|
3037
|
+
|
|
3038
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3039
|
+
params = (paramsOrFirst || {}) as { providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean };
|
|
3040
|
+
} else {
|
|
3041
|
+
params = {
|
|
3042
|
+
providerId: paramsOrFirst as string,
|
|
3043
|
+
name: rest[0] as string,
|
|
3044
|
+
host: rest[1] as string,
|
|
3045
|
+
port: rest[2] as number,
|
|
3046
|
+
username: rest[3] as string,
|
|
3047
|
+
password: rest[4] as string,
|
|
3048
|
+
encryption: rest[5] as SmtpEncryption,
|
|
3049
|
+
autoTLS: rest[6] as boolean,
|
|
3050
|
+
mailer: rest[7] as string,
|
|
3051
|
+
fromName: rest[8] as string,
|
|
3052
|
+
fromEmail: rest[9] as string,
|
|
3053
|
+
replyToName: rest[10] as string,
|
|
3054
|
+
replyToEmail: rest[11] as string,
|
|
3055
|
+
enabled: rest[12] as boolean
|
|
3056
|
+
};
|
|
3057
|
+
}
|
|
3058
|
+
|
|
3059
|
+
const providerId = params.providerId;
|
|
3060
|
+
const name = params.name;
|
|
3061
|
+
const host = params.host;
|
|
3062
|
+
const port = params.port;
|
|
3063
|
+
const username = params.username;
|
|
3064
|
+
const password = params.password;
|
|
3065
|
+
const encryption = params.encryption;
|
|
3066
|
+
const autoTLS = params.autoTLS;
|
|
3067
|
+
const mailer = params.mailer;
|
|
3068
|
+
const fromName = params.fromName;
|
|
3069
|
+
const fromEmail = params.fromEmail;
|
|
3070
|
+
const replyToName = params.replyToName;
|
|
3071
|
+
const replyToEmail = params.replyToEmail;
|
|
3072
|
+
const enabled = params.enabled;
|
|
3073
|
+
|
|
1078
3074
|
if (typeof providerId === 'undefined') {
|
|
1079
3075
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1080
3076
|
}
|
|
1081
3077
|
if (typeof name === 'undefined') {
|
|
1082
3078
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
1083
3079
|
}
|
|
1084
|
-
|
|
3080
|
+
if (typeof host === 'undefined') {
|
|
3081
|
+
throw new AppwriteException('Missing required parameter: "host"');
|
|
3082
|
+
}
|
|
3083
|
+
|
|
3084
|
+
const apiPath = '/messaging/providers/smtp';
|
|
1085
3085
|
const payload: Payload = {};
|
|
1086
3086
|
if (typeof providerId !== 'undefined') {
|
|
1087
3087
|
payload['providerId'] = providerId;
|
|
@@ -1089,8 +3089,26 @@ export class Messaging {
|
|
|
1089
3089
|
if (typeof name !== 'undefined') {
|
|
1090
3090
|
payload['name'] = name;
|
|
1091
3091
|
}
|
|
1092
|
-
if (typeof
|
|
1093
|
-
payload['
|
|
3092
|
+
if (typeof host !== 'undefined') {
|
|
3093
|
+
payload['host'] = host;
|
|
3094
|
+
}
|
|
3095
|
+
if (typeof port !== 'undefined') {
|
|
3096
|
+
payload['port'] = port;
|
|
3097
|
+
}
|
|
3098
|
+
if (typeof username !== 'undefined') {
|
|
3099
|
+
payload['username'] = username;
|
|
3100
|
+
}
|
|
3101
|
+
if (typeof password !== 'undefined') {
|
|
3102
|
+
payload['password'] = password;
|
|
3103
|
+
}
|
|
3104
|
+
if (typeof encryption !== 'undefined') {
|
|
3105
|
+
payload['encryption'] = encryption;
|
|
3106
|
+
}
|
|
3107
|
+
if (typeof autoTLS !== 'undefined') {
|
|
3108
|
+
payload['autoTLS'] = autoTLS;
|
|
3109
|
+
}
|
|
3110
|
+
if (typeof mailer !== 'undefined') {
|
|
3111
|
+
payload['mailer'] = mailer;
|
|
1094
3112
|
}
|
|
1095
3113
|
if (typeof fromName !== 'undefined') {
|
|
1096
3114
|
payload['fromName'] = fromName;
|
|
@@ -1120,34 +3138,130 @@ export class Messaging {
|
|
|
1120
3138
|
payload
|
|
1121
3139
|
);
|
|
1122
3140
|
}
|
|
3141
|
+
|
|
1123
3142
|
/**
|
|
1124
|
-
*
|
|
3143
|
+
* Create a new SMTP provider.
|
|
3144
|
+
*
|
|
3145
|
+
* @param {string} params.providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
3146
|
+
* @param {string} params.name - Provider name.
|
|
3147
|
+
* @param {string} params.host - SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order.
|
|
3148
|
+
* @param {number} params.port - The default SMTP server port.
|
|
3149
|
+
* @param {string} params.username - Authentication username.
|
|
3150
|
+
* @param {string} params.password - Authentication password.
|
|
3151
|
+
* @param {SmtpEncryption} params.encryption - Encryption type. Can be omitted, 'ssl', or 'tls'
|
|
3152
|
+
* @param {boolean} params.autoTLS - Enable SMTP AutoTLS feature.
|
|
3153
|
+
* @param {string} params.mailer - The value to use for the X-Mailer header.
|
|
3154
|
+
* @param {string} params.fromName - Sender Name.
|
|
3155
|
+
* @param {string} params.fromEmail - Sender email address.
|
|
3156
|
+
* @param {string} params.replyToName - Name set in the reply to field for the mail. Default value is sender name.
|
|
3157
|
+
* @param {string} params.replyToEmail - Email set in the reply to field for the mail. Default value is sender email.
|
|
3158
|
+
* @param {boolean} params.enabled - Set as enabled.
|
|
3159
|
+
* @throws {AppwriteException}
|
|
3160
|
+
* @returns {Promise<Models.Provider>}
|
|
3161
|
+
*/
|
|
3162
|
+
createSMTPProvider(params: { providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }): Promise<Models.Provider>;
|
|
3163
|
+
/**
|
|
3164
|
+
* Create a new SMTP provider.
|
|
1125
3165
|
*
|
|
1126
|
-
* @param {string} providerId
|
|
1127
|
-
* @param {string} name
|
|
1128
|
-
* @param {
|
|
1129
|
-
* @param {
|
|
1130
|
-
* @param {string}
|
|
1131
|
-
* @param {string}
|
|
1132
|
-
* @param {
|
|
1133
|
-
* @param {
|
|
3166
|
+
* @param {string} providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
3167
|
+
* @param {string} name - Provider name.
|
|
3168
|
+
* @param {string} host - SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order.
|
|
3169
|
+
* @param {number} port - The default SMTP server port.
|
|
3170
|
+
* @param {string} username - Authentication username.
|
|
3171
|
+
* @param {string} password - Authentication password.
|
|
3172
|
+
* @param {SmtpEncryption} encryption - Encryption type. Can be omitted, 'ssl', or 'tls'
|
|
3173
|
+
* @param {boolean} autoTLS - Enable SMTP AutoTLS feature.
|
|
3174
|
+
* @param {string} mailer - The value to use for the X-Mailer header.
|
|
3175
|
+
* @param {string} fromName - Sender Name.
|
|
3176
|
+
* @param {string} fromEmail - Sender email address.
|
|
3177
|
+
* @param {string} replyToName - Name set in the reply to field for the mail. Default value is sender name.
|
|
3178
|
+
* @param {string} replyToEmail - Email set in the reply to field for the mail. Default value is sender email.
|
|
3179
|
+
* @param {boolean} enabled - Set as enabled.
|
|
1134
3180
|
* @throws {AppwriteException}
|
|
1135
3181
|
* @returns {Promise<Models.Provider>}
|
|
3182
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1136
3183
|
*/
|
|
1137
|
-
|
|
3184
|
+
createSMTPProvider(providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise<Models.Provider>;
|
|
3185
|
+
createSMTPProvider(
|
|
3186
|
+
paramsOrFirst: { providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean } | string,
|
|
3187
|
+
...rest: [(string)?, (string)?, (number)?, (string)?, (string)?, (SmtpEncryption)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?]
|
|
3188
|
+
): Promise<Models.Provider> {
|
|
3189
|
+
let params: { providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean };
|
|
3190
|
+
|
|
3191
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3192
|
+
params = (paramsOrFirst || {}) as { providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean };
|
|
3193
|
+
} else {
|
|
3194
|
+
params = {
|
|
3195
|
+
providerId: paramsOrFirst as string,
|
|
3196
|
+
name: rest[0] as string,
|
|
3197
|
+
host: rest[1] as string,
|
|
3198
|
+
port: rest[2] as number,
|
|
3199
|
+
username: rest[3] as string,
|
|
3200
|
+
password: rest[4] as string,
|
|
3201
|
+
encryption: rest[5] as SmtpEncryption,
|
|
3202
|
+
autoTLS: rest[6] as boolean,
|
|
3203
|
+
mailer: rest[7] as string,
|
|
3204
|
+
fromName: rest[8] as string,
|
|
3205
|
+
fromEmail: rest[9] as string,
|
|
3206
|
+
replyToName: rest[10] as string,
|
|
3207
|
+
replyToEmail: rest[11] as string,
|
|
3208
|
+
enabled: rest[12] as boolean
|
|
3209
|
+
};
|
|
3210
|
+
}
|
|
3211
|
+
|
|
3212
|
+
const providerId = params.providerId;
|
|
3213
|
+
const name = params.name;
|
|
3214
|
+
const host = params.host;
|
|
3215
|
+
const port = params.port;
|
|
3216
|
+
const username = params.username;
|
|
3217
|
+
const password = params.password;
|
|
3218
|
+
const encryption = params.encryption;
|
|
3219
|
+
const autoTLS = params.autoTLS;
|
|
3220
|
+
const mailer = params.mailer;
|
|
3221
|
+
const fromName = params.fromName;
|
|
3222
|
+
const fromEmail = params.fromEmail;
|
|
3223
|
+
const replyToName = params.replyToName;
|
|
3224
|
+
const replyToEmail = params.replyToEmail;
|
|
3225
|
+
const enabled = params.enabled;
|
|
3226
|
+
|
|
1138
3227
|
if (typeof providerId === 'undefined') {
|
|
1139
3228
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1140
3229
|
}
|
|
1141
|
-
|
|
3230
|
+
if (typeof name === 'undefined') {
|
|
3231
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
3232
|
+
}
|
|
3233
|
+
if (typeof host === 'undefined') {
|
|
3234
|
+
throw new AppwriteException('Missing required parameter: "host"');
|
|
3235
|
+
}
|
|
3236
|
+
|
|
3237
|
+
const apiPath = '/messaging/providers/smtp';
|
|
1142
3238
|
const payload: Payload = {};
|
|
3239
|
+
if (typeof providerId !== 'undefined') {
|
|
3240
|
+
payload['providerId'] = providerId;
|
|
3241
|
+
}
|
|
1143
3242
|
if (typeof name !== 'undefined') {
|
|
1144
3243
|
payload['name'] = name;
|
|
1145
3244
|
}
|
|
1146
|
-
if (typeof
|
|
1147
|
-
payload['
|
|
3245
|
+
if (typeof host !== 'undefined') {
|
|
3246
|
+
payload['host'] = host;
|
|
3247
|
+
}
|
|
3248
|
+
if (typeof port !== 'undefined') {
|
|
3249
|
+
payload['port'] = port;
|
|
3250
|
+
}
|
|
3251
|
+
if (typeof username !== 'undefined') {
|
|
3252
|
+
payload['username'] = username;
|
|
3253
|
+
}
|
|
3254
|
+
if (typeof password !== 'undefined') {
|
|
3255
|
+
payload['password'] = password;
|
|
3256
|
+
}
|
|
3257
|
+
if (typeof encryption !== 'undefined') {
|
|
3258
|
+
payload['encryption'] = encryption;
|
|
1148
3259
|
}
|
|
1149
|
-
if (typeof
|
|
1150
|
-
payload['
|
|
3260
|
+
if (typeof autoTLS !== 'undefined') {
|
|
3261
|
+
payload['autoTLS'] = autoTLS;
|
|
3262
|
+
}
|
|
3263
|
+
if (typeof mailer !== 'undefined') {
|
|
3264
|
+
payload['mailer'] = mailer;
|
|
1151
3265
|
}
|
|
1152
3266
|
if (typeof fromName !== 'undefined') {
|
|
1153
3267
|
payload['fromName'] = fromName;
|
|
@@ -1161,6 +3275,9 @@ export class Messaging {
|
|
|
1161
3275
|
if (typeof replyToEmail !== 'undefined') {
|
|
1162
3276
|
payload['replyToEmail'] = replyToEmail;
|
|
1163
3277
|
}
|
|
3278
|
+
if (typeof enabled !== 'undefined') {
|
|
3279
|
+
payload['enabled'] = enabled;
|
|
3280
|
+
}
|
|
1164
3281
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1165
3282
|
|
|
1166
3283
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -1168,47 +3285,105 @@ export class Messaging {
|
|
|
1168
3285
|
}
|
|
1169
3286
|
|
|
1170
3287
|
return this.client.call(
|
|
1171
|
-
'
|
|
3288
|
+
'post',
|
|
1172
3289
|
uri,
|
|
1173
3290
|
apiHeaders,
|
|
1174
3291
|
payload
|
|
1175
3292
|
);
|
|
1176
3293
|
}
|
|
3294
|
+
|
|
1177
3295
|
/**
|
|
1178
|
-
*
|
|
3296
|
+
* Update a SMTP provider by its unique ID.
|
|
3297
|
+
*
|
|
3298
|
+
* @param {string} params.providerId - Provider ID.
|
|
3299
|
+
* @param {string} params.name - Provider name.
|
|
3300
|
+
* @param {string} params.host - SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order.
|
|
3301
|
+
* @param {number} params.port - SMTP port.
|
|
3302
|
+
* @param {string} params.username - Authentication username.
|
|
3303
|
+
* @param {string} params.password - Authentication password.
|
|
3304
|
+
* @param {SmtpEncryption} params.encryption - Encryption type. Can be 'ssl' or 'tls'
|
|
3305
|
+
* @param {boolean} params.autoTLS - Enable SMTP AutoTLS feature.
|
|
3306
|
+
* @param {string} params.mailer - The value to use for the X-Mailer header.
|
|
3307
|
+
* @param {string} params.fromName - Sender Name.
|
|
3308
|
+
* @param {string} params.fromEmail - Sender email address.
|
|
3309
|
+
* @param {string} params.replyToName - Name set in the Reply To field for the mail. Default value is Sender Name.
|
|
3310
|
+
* @param {string} params.replyToEmail - Email set in the Reply To field for the mail. Default value is Sender Email.
|
|
3311
|
+
* @param {boolean} params.enabled - Set as enabled.
|
|
3312
|
+
* @throws {AppwriteException}
|
|
3313
|
+
* @returns {Promise<Models.Provider>}
|
|
3314
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `Messaging.updateSMTPProvider` instead.
|
|
3315
|
+
*/
|
|
3316
|
+
updateSmtpProvider(params: { providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }): Promise<Models.Provider>;
|
|
3317
|
+
/**
|
|
3318
|
+
* Update a SMTP provider by its unique ID.
|
|
1179
3319
|
*
|
|
1180
|
-
* @param {string} providerId
|
|
1181
|
-
* @param {string} name
|
|
1182
|
-
* @param {string} host
|
|
1183
|
-
* @param {number} port
|
|
1184
|
-
* @param {string} username
|
|
1185
|
-
* @param {string} password
|
|
1186
|
-
* @param {SmtpEncryption} encryption
|
|
1187
|
-
* @param {boolean} autoTLS
|
|
1188
|
-
* @param {string} mailer
|
|
1189
|
-
* @param {string} fromName
|
|
1190
|
-
* @param {string} fromEmail
|
|
1191
|
-
* @param {string} replyToName
|
|
1192
|
-
* @param {string} replyToEmail
|
|
1193
|
-
* @param {boolean} enabled
|
|
3320
|
+
* @param {string} providerId - Provider ID.
|
|
3321
|
+
* @param {string} name - Provider name.
|
|
3322
|
+
* @param {string} host - SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order.
|
|
3323
|
+
* @param {number} port - SMTP port.
|
|
3324
|
+
* @param {string} username - Authentication username.
|
|
3325
|
+
* @param {string} password - Authentication password.
|
|
3326
|
+
* @param {SmtpEncryption} encryption - Encryption type. Can be 'ssl' or 'tls'
|
|
3327
|
+
* @param {boolean} autoTLS - Enable SMTP AutoTLS feature.
|
|
3328
|
+
* @param {string} mailer - The value to use for the X-Mailer header.
|
|
3329
|
+
* @param {string} fromName - Sender Name.
|
|
3330
|
+
* @param {string} fromEmail - Sender email address.
|
|
3331
|
+
* @param {string} replyToName - Name set in the Reply To field for the mail. Default value is Sender Name.
|
|
3332
|
+
* @param {string} replyToEmail - Email set in the Reply To field for the mail. Default value is Sender Email.
|
|
3333
|
+
* @param {boolean} enabled - Set as enabled.
|
|
1194
3334
|
* @throws {AppwriteException}
|
|
1195
3335
|
* @returns {Promise<Models.Provider>}
|
|
3336
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1196
3337
|
*/
|
|
1197
|
-
|
|
3338
|
+
updateSmtpProvider(providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise<Models.Provider>;
|
|
3339
|
+
updateSmtpProvider(
|
|
3340
|
+
paramsOrFirst: { providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean } | string,
|
|
3341
|
+
...rest: [(string)?, (string)?, (number)?, (string)?, (string)?, (SmtpEncryption)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?]
|
|
3342
|
+
): Promise<Models.Provider> {
|
|
3343
|
+
let params: { providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean };
|
|
3344
|
+
|
|
3345
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3346
|
+
params = (paramsOrFirst || {}) as { providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean };
|
|
3347
|
+
} else {
|
|
3348
|
+
params = {
|
|
3349
|
+
providerId: paramsOrFirst as string,
|
|
3350
|
+
name: rest[0] as string,
|
|
3351
|
+
host: rest[1] as string,
|
|
3352
|
+
port: rest[2] as number,
|
|
3353
|
+
username: rest[3] as string,
|
|
3354
|
+
password: rest[4] as string,
|
|
3355
|
+
encryption: rest[5] as SmtpEncryption,
|
|
3356
|
+
autoTLS: rest[6] as boolean,
|
|
3357
|
+
mailer: rest[7] as string,
|
|
3358
|
+
fromName: rest[8] as string,
|
|
3359
|
+
fromEmail: rest[9] as string,
|
|
3360
|
+
replyToName: rest[10] as string,
|
|
3361
|
+
replyToEmail: rest[11] as string,
|
|
3362
|
+
enabled: rest[12] as boolean
|
|
3363
|
+
};
|
|
3364
|
+
}
|
|
3365
|
+
|
|
3366
|
+
const providerId = params.providerId;
|
|
3367
|
+
const name = params.name;
|
|
3368
|
+
const host = params.host;
|
|
3369
|
+
const port = params.port;
|
|
3370
|
+
const username = params.username;
|
|
3371
|
+
const password = params.password;
|
|
3372
|
+
const encryption = params.encryption;
|
|
3373
|
+
const autoTLS = params.autoTLS;
|
|
3374
|
+
const mailer = params.mailer;
|
|
3375
|
+
const fromName = params.fromName;
|
|
3376
|
+
const fromEmail = params.fromEmail;
|
|
3377
|
+
const replyToName = params.replyToName;
|
|
3378
|
+
const replyToEmail = params.replyToEmail;
|
|
3379
|
+
const enabled = params.enabled;
|
|
3380
|
+
|
|
1198
3381
|
if (typeof providerId === 'undefined') {
|
|
1199
3382
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1200
3383
|
}
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
}
|
|
1204
|
-
if (typeof host === 'undefined') {
|
|
1205
|
-
throw new AppwriteException('Missing required parameter: "host"');
|
|
1206
|
-
}
|
|
1207
|
-
const apiPath = '/messaging/providers/smtp';
|
|
3384
|
+
|
|
3385
|
+
const apiPath = '/messaging/providers/smtp/{providerId}'.replace('{providerId}', providerId);
|
|
1208
3386
|
const payload: Payload = {};
|
|
1209
|
-
if (typeof providerId !== 'undefined') {
|
|
1210
|
-
payload['providerId'] = providerId;
|
|
1211
|
-
}
|
|
1212
3387
|
if (typeof name !== 'undefined') {
|
|
1213
3388
|
payload['name'] = name;
|
|
1214
3389
|
}
|
|
@@ -1255,36 +3430,102 @@ export class Messaging {
|
|
|
1255
3430
|
}
|
|
1256
3431
|
|
|
1257
3432
|
return this.client.call(
|
|
1258
|
-
'
|
|
3433
|
+
'patch',
|
|
1259
3434
|
uri,
|
|
1260
3435
|
apiHeaders,
|
|
1261
3436
|
payload
|
|
1262
3437
|
);
|
|
1263
3438
|
}
|
|
3439
|
+
|
|
3440
|
+
/**
|
|
3441
|
+
* Update a SMTP provider by its unique ID.
|
|
3442
|
+
*
|
|
3443
|
+
* @param {string} params.providerId - Provider ID.
|
|
3444
|
+
* @param {string} params.name - Provider name.
|
|
3445
|
+
* @param {string} params.host - SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order.
|
|
3446
|
+
* @param {number} params.port - SMTP port.
|
|
3447
|
+
* @param {string} params.username - Authentication username.
|
|
3448
|
+
* @param {string} params.password - Authentication password.
|
|
3449
|
+
* @param {SmtpEncryption} params.encryption - Encryption type. Can be 'ssl' or 'tls'
|
|
3450
|
+
* @param {boolean} params.autoTLS - Enable SMTP AutoTLS feature.
|
|
3451
|
+
* @param {string} params.mailer - The value to use for the X-Mailer header.
|
|
3452
|
+
* @param {string} params.fromName - Sender Name.
|
|
3453
|
+
* @param {string} params.fromEmail - Sender email address.
|
|
3454
|
+
* @param {string} params.replyToName - Name set in the Reply To field for the mail. Default value is Sender Name.
|
|
3455
|
+
* @param {string} params.replyToEmail - Email set in the Reply To field for the mail. Default value is Sender Email.
|
|
3456
|
+
* @param {boolean} params.enabled - Set as enabled.
|
|
3457
|
+
* @throws {AppwriteException}
|
|
3458
|
+
* @returns {Promise<Models.Provider>}
|
|
3459
|
+
*/
|
|
3460
|
+
updateSMTPProvider(params: { providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }): Promise<Models.Provider>;
|
|
1264
3461
|
/**
|
|
1265
3462
|
* Update a SMTP provider by its unique ID.
|
|
1266
3463
|
*
|
|
1267
|
-
* @param {string} providerId
|
|
1268
|
-
* @param {string} name
|
|
1269
|
-
* @param {string} host
|
|
1270
|
-
* @param {number} port
|
|
1271
|
-
* @param {string} username
|
|
1272
|
-
* @param {string} password
|
|
1273
|
-
* @param {SmtpEncryption} encryption
|
|
1274
|
-
* @param {boolean} autoTLS
|
|
1275
|
-
* @param {string} mailer
|
|
1276
|
-
* @param {string} fromName
|
|
1277
|
-
* @param {string} fromEmail
|
|
1278
|
-
* @param {string} replyToName
|
|
1279
|
-
* @param {string} replyToEmail
|
|
1280
|
-
* @param {boolean} enabled
|
|
3464
|
+
* @param {string} providerId - Provider ID.
|
|
3465
|
+
* @param {string} name - Provider name.
|
|
3466
|
+
* @param {string} host - SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order.
|
|
3467
|
+
* @param {number} port - SMTP port.
|
|
3468
|
+
* @param {string} username - Authentication username.
|
|
3469
|
+
* @param {string} password - Authentication password.
|
|
3470
|
+
* @param {SmtpEncryption} encryption - Encryption type. Can be 'ssl' or 'tls'
|
|
3471
|
+
* @param {boolean} autoTLS - Enable SMTP AutoTLS feature.
|
|
3472
|
+
* @param {string} mailer - The value to use for the X-Mailer header.
|
|
3473
|
+
* @param {string} fromName - Sender Name.
|
|
3474
|
+
* @param {string} fromEmail - Sender email address.
|
|
3475
|
+
* @param {string} replyToName - Name set in the Reply To field for the mail. Default value is Sender Name.
|
|
3476
|
+
* @param {string} replyToEmail - Email set in the Reply To field for the mail. Default value is Sender Email.
|
|
3477
|
+
* @param {boolean} enabled - Set as enabled.
|
|
1281
3478
|
* @throws {AppwriteException}
|
|
1282
3479
|
* @returns {Promise<Models.Provider>}
|
|
3480
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1283
3481
|
*/
|
|
1284
|
-
|
|
3482
|
+
updateSMTPProvider(providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise<Models.Provider>;
|
|
3483
|
+
updateSMTPProvider(
|
|
3484
|
+
paramsOrFirst: { providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean } | string,
|
|
3485
|
+
...rest: [(string)?, (string)?, (number)?, (string)?, (string)?, (SmtpEncryption)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?]
|
|
3486
|
+
): Promise<Models.Provider> {
|
|
3487
|
+
let params: { providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean };
|
|
3488
|
+
|
|
3489
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3490
|
+
params = (paramsOrFirst || {}) as { providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean };
|
|
3491
|
+
} else {
|
|
3492
|
+
params = {
|
|
3493
|
+
providerId: paramsOrFirst as string,
|
|
3494
|
+
name: rest[0] as string,
|
|
3495
|
+
host: rest[1] as string,
|
|
3496
|
+
port: rest[2] as number,
|
|
3497
|
+
username: rest[3] as string,
|
|
3498
|
+
password: rest[4] as string,
|
|
3499
|
+
encryption: rest[5] as SmtpEncryption,
|
|
3500
|
+
autoTLS: rest[6] as boolean,
|
|
3501
|
+
mailer: rest[7] as string,
|
|
3502
|
+
fromName: rest[8] as string,
|
|
3503
|
+
fromEmail: rest[9] as string,
|
|
3504
|
+
replyToName: rest[10] as string,
|
|
3505
|
+
replyToEmail: rest[11] as string,
|
|
3506
|
+
enabled: rest[12] as boolean
|
|
3507
|
+
};
|
|
3508
|
+
}
|
|
3509
|
+
|
|
3510
|
+
const providerId = params.providerId;
|
|
3511
|
+
const name = params.name;
|
|
3512
|
+
const host = params.host;
|
|
3513
|
+
const port = params.port;
|
|
3514
|
+
const username = params.username;
|
|
3515
|
+
const password = params.password;
|
|
3516
|
+
const encryption = params.encryption;
|
|
3517
|
+
const autoTLS = params.autoTLS;
|
|
3518
|
+
const mailer = params.mailer;
|
|
3519
|
+
const fromName = params.fromName;
|
|
3520
|
+
const fromEmail = params.fromEmail;
|
|
3521
|
+
const replyToName = params.replyToName;
|
|
3522
|
+
const replyToEmail = params.replyToEmail;
|
|
3523
|
+
const enabled = params.enabled;
|
|
3524
|
+
|
|
1285
3525
|
if (typeof providerId === 'undefined') {
|
|
1286
3526
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1287
3527
|
}
|
|
3528
|
+
|
|
1288
3529
|
const apiPath = '/messaging/providers/smtp/{providerId}'.replace('{providerId}', providerId);
|
|
1289
3530
|
const payload: Payload = {};
|
|
1290
3531
|
if (typeof name !== 'undefined') {
|
|
@@ -1339,25 +3580,67 @@ export class Messaging {
|
|
|
1339
3580
|
payload
|
|
1340
3581
|
);
|
|
1341
3582
|
}
|
|
3583
|
+
|
|
3584
|
+
/**
|
|
3585
|
+
* Create a new Telesign provider.
|
|
3586
|
+
*
|
|
3587
|
+
* @param {string} params.providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
3588
|
+
* @param {string} params.name - Provider name.
|
|
3589
|
+
* @param {string} params.from - Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
|
|
3590
|
+
* @param {string} params.customerId - Telesign customer ID.
|
|
3591
|
+
* @param {string} params.apiKey - Telesign API key.
|
|
3592
|
+
* @param {boolean} params.enabled - Set as enabled.
|
|
3593
|
+
* @throws {AppwriteException}
|
|
3594
|
+
* @returns {Promise<Models.Provider>}
|
|
3595
|
+
*/
|
|
3596
|
+
createTelesignProvider(params: { providerId: string, name: string, from?: string, customerId?: string, apiKey?: string, enabled?: boolean }): Promise<Models.Provider>;
|
|
1342
3597
|
/**
|
|
1343
3598
|
* Create a new Telesign provider.
|
|
1344
3599
|
*
|
|
1345
|
-
* @param {string} providerId
|
|
1346
|
-
* @param {string} name
|
|
1347
|
-
* @param {string} from
|
|
1348
|
-
* @param {string} customerId
|
|
1349
|
-
* @param {string} apiKey
|
|
1350
|
-
* @param {boolean} enabled
|
|
3600
|
+
* @param {string} providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
3601
|
+
* @param {string} name - Provider name.
|
|
3602
|
+
* @param {string} from - Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
|
|
3603
|
+
* @param {string} customerId - Telesign customer ID.
|
|
3604
|
+
* @param {string} apiKey - Telesign API key.
|
|
3605
|
+
* @param {boolean} enabled - Set as enabled.
|
|
1351
3606
|
* @throws {AppwriteException}
|
|
1352
3607
|
* @returns {Promise<Models.Provider>}
|
|
3608
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1353
3609
|
*/
|
|
1354
|
-
createTelesignProvider(providerId: string, name: string, from?: string, customerId?: string, apiKey?: string, enabled?: boolean): Promise<Models.Provider
|
|
3610
|
+
createTelesignProvider(providerId: string, name: string, from?: string, customerId?: string, apiKey?: string, enabled?: boolean): Promise<Models.Provider>;
|
|
3611
|
+
createTelesignProvider(
|
|
3612
|
+
paramsOrFirst: { providerId: string, name: string, from?: string, customerId?: string, apiKey?: string, enabled?: boolean } | string,
|
|
3613
|
+
...rest: [(string)?, (string)?, (string)?, (string)?, (boolean)?]
|
|
3614
|
+
): Promise<Models.Provider> {
|
|
3615
|
+
let params: { providerId: string, name: string, from?: string, customerId?: string, apiKey?: string, enabled?: boolean };
|
|
3616
|
+
|
|
3617
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3618
|
+
params = (paramsOrFirst || {}) as { providerId: string, name: string, from?: string, customerId?: string, apiKey?: string, enabled?: boolean };
|
|
3619
|
+
} else {
|
|
3620
|
+
params = {
|
|
3621
|
+
providerId: paramsOrFirst as string,
|
|
3622
|
+
name: rest[0] as string,
|
|
3623
|
+
from: rest[1] as string,
|
|
3624
|
+
customerId: rest[2] as string,
|
|
3625
|
+
apiKey: rest[3] as string,
|
|
3626
|
+
enabled: rest[4] as boolean
|
|
3627
|
+
};
|
|
3628
|
+
}
|
|
3629
|
+
|
|
3630
|
+
const providerId = params.providerId;
|
|
3631
|
+
const name = params.name;
|
|
3632
|
+
const from = params.from;
|
|
3633
|
+
const customerId = params.customerId;
|
|
3634
|
+
const apiKey = params.apiKey;
|
|
3635
|
+
const enabled = params.enabled;
|
|
3636
|
+
|
|
1355
3637
|
if (typeof providerId === 'undefined') {
|
|
1356
3638
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1357
3639
|
}
|
|
1358
3640
|
if (typeof name === 'undefined') {
|
|
1359
3641
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
1360
3642
|
}
|
|
3643
|
+
|
|
1361
3644
|
const apiPath = '/messaging/providers/telesign';
|
|
1362
3645
|
const payload: Payload = {};
|
|
1363
3646
|
if (typeof providerId !== 'undefined') {
|
|
@@ -1391,22 +3674,64 @@ export class Messaging {
|
|
|
1391
3674
|
payload
|
|
1392
3675
|
);
|
|
1393
3676
|
}
|
|
3677
|
+
|
|
3678
|
+
/**
|
|
3679
|
+
* Update a Telesign provider by its unique ID.
|
|
3680
|
+
*
|
|
3681
|
+
* @param {string} params.providerId - Provider ID.
|
|
3682
|
+
* @param {string} params.name - Provider name.
|
|
3683
|
+
* @param {boolean} params.enabled - Set as enabled.
|
|
3684
|
+
* @param {string} params.customerId - Telesign customer ID.
|
|
3685
|
+
* @param {string} params.apiKey - Telesign API key.
|
|
3686
|
+
* @param {string} params.from - Sender number.
|
|
3687
|
+
* @throws {AppwriteException}
|
|
3688
|
+
* @returns {Promise<Models.Provider>}
|
|
3689
|
+
*/
|
|
3690
|
+
updateTelesignProvider(params: { providerId: string, name?: string, enabled?: boolean, customerId?: string, apiKey?: string, from?: string }): Promise<Models.Provider>;
|
|
1394
3691
|
/**
|
|
1395
3692
|
* Update a Telesign provider by its unique ID.
|
|
1396
3693
|
*
|
|
1397
|
-
* @param {string} providerId
|
|
1398
|
-
* @param {string} name
|
|
1399
|
-
* @param {boolean} enabled
|
|
1400
|
-
* @param {string} customerId
|
|
1401
|
-
* @param {string} apiKey
|
|
1402
|
-
* @param {string} from
|
|
3694
|
+
* @param {string} providerId - Provider ID.
|
|
3695
|
+
* @param {string} name - Provider name.
|
|
3696
|
+
* @param {boolean} enabled - Set as enabled.
|
|
3697
|
+
* @param {string} customerId - Telesign customer ID.
|
|
3698
|
+
* @param {string} apiKey - Telesign API key.
|
|
3699
|
+
* @param {string} from - Sender number.
|
|
1403
3700
|
* @throws {AppwriteException}
|
|
1404
3701
|
* @returns {Promise<Models.Provider>}
|
|
3702
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1405
3703
|
*/
|
|
1406
|
-
updateTelesignProvider(providerId: string, name?: string, enabled?: boolean, customerId?: string, apiKey?: string, from?: string): Promise<Models.Provider
|
|
3704
|
+
updateTelesignProvider(providerId: string, name?: string, enabled?: boolean, customerId?: string, apiKey?: string, from?: string): Promise<Models.Provider>;
|
|
3705
|
+
updateTelesignProvider(
|
|
3706
|
+
paramsOrFirst: { providerId: string, name?: string, enabled?: boolean, customerId?: string, apiKey?: string, from?: string } | string,
|
|
3707
|
+
...rest: [(string)?, (boolean)?, (string)?, (string)?, (string)?]
|
|
3708
|
+
): Promise<Models.Provider> {
|
|
3709
|
+
let params: { providerId: string, name?: string, enabled?: boolean, customerId?: string, apiKey?: string, from?: string };
|
|
3710
|
+
|
|
3711
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3712
|
+
params = (paramsOrFirst || {}) as { providerId: string, name?: string, enabled?: boolean, customerId?: string, apiKey?: string, from?: string };
|
|
3713
|
+
} else {
|
|
3714
|
+
params = {
|
|
3715
|
+
providerId: paramsOrFirst as string,
|
|
3716
|
+
name: rest[0] as string,
|
|
3717
|
+
enabled: rest[1] as boolean,
|
|
3718
|
+
customerId: rest[2] as string,
|
|
3719
|
+
apiKey: rest[3] as string,
|
|
3720
|
+
from: rest[4] as string
|
|
3721
|
+
};
|
|
3722
|
+
}
|
|
3723
|
+
|
|
3724
|
+
const providerId = params.providerId;
|
|
3725
|
+
const name = params.name;
|
|
3726
|
+
const enabled = params.enabled;
|
|
3727
|
+
const customerId = params.customerId;
|
|
3728
|
+
const apiKey = params.apiKey;
|
|
3729
|
+
const from = params.from;
|
|
3730
|
+
|
|
1407
3731
|
if (typeof providerId === 'undefined') {
|
|
1408
3732
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1409
3733
|
}
|
|
3734
|
+
|
|
1410
3735
|
const apiPath = '/messaging/providers/telesign/{providerId}'.replace('{providerId}', providerId);
|
|
1411
3736
|
const payload: Payload = {};
|
|
1412
3737
|
if (typeof name !== 'undefined') {
|
|
@@ -1437,25 +3762,67 @@ export class Messaging {
|
|
|
1437
3762
|
payload
|
|
1438
3763
|
);
|
|
1439
3764
|
}
|
|
3765
|
+
|
|
3766
|
+
/**
|
|
3767
|
+
* Create a new Textmagic provider.
|
|
3768
|
+
*
|
|
3769
|
+
* @param {string} params.providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
3770
|
+
* @param {string} params.name - Provider name.
|
|
3771
|
+
* @param {string} params.from - Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
|
|
3772
|
+
* @param {string} params.username - Textmagic username.
|
|
3773
|
+
* @param {string} params.apiKey - Textmagic apiKey.
|
|
3774
|
+
* @param {boolean} params.enabled - Set as enabled.
|
|
3775
|
+
* @throws {AppwriteException}
|
|
3776
|
+
* @returns {Promise<Models.Provider>}
|
|
3777
|
+
*/
|
|
3778
|
+
createTextmagicProvider(params: { providerId: string, name: string, from?: string, username?: string, apiKey?: string, enabled?: boolean }): Promise<Models.Provider>;
|
|
1440
3779
|
/**
|
|
1441
3780
|
* Create a new Textmagic provider.
|
|
1442
3781
|
*
|
|
1443
|
-
* @param {string} providerId
|
|
1444
|
-
* @param {string} name
|
|
1445
|
-
* @param {string} from
|
|
1446
|
-
* @param {string} username
|
|
1447
|
-
* @param {string} apiKey
|
|
1448
|
-
* @param {boolean} enabled
|
|
3782
|
+
* @param {string} providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
3783
|
+
* @param {string} name - Provider name.
|
|
3784
|
+
* @param {string} from - Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
|
|
3785
|
+
* @param {string} username - Textmagic username.
|
|
3786
|
+
* @param {string} apiKey - Textmagic apiKey.
|
|
3787
|
+
* @param {boolean} enabled - Set as enabled.
|
|
1449
3788
|
* @throws {AppwriteException}
|
|
1450
3789
|
* @returns {Promise<Models.Provider>}
|
|
3790
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1451
3791
|
*/
|
|
1452
|
-
createTextmagicProvider(providerId: string, name: string, from?: string, username?: string, apiKey?: string, enabled?: boolean): Promise<Models.Provider
|
|
3792
|
+
createTextmagicProvider(providerId: string, name: string, from?: string, username?: string, apiKey?: string, enabled?: boolean): Promise<Models.Provider>;
|
|
3793
|
+
createTextmagicProvider(
|
|
3794
|
+
paramsOrFirst: { providerId: string, name: string, from?: string, username?: string, apiKey?: string, enabled?: boolean } | string,
|
|
3795
|
+
...rest: [(string)?, (string)?, (string)?, (string)?, (boolean)?]
|
|
3796
|
+
): Promise<Models.Provider> {
|
|
3797
|
+
let params: { providerId: string, name: string, from?: string, username?: string, apiKey?: string, enabled?: boolean };
|
|
3798
|
+
|
|
3799
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3800
|
+
params = (paramsOrFirst || {}) as { providerId: string, name: string, from?: string, username?: string, apiKey?: string, enabled?: boolean };
|
|
3801
|
+
} else {
|
|
3802
|
+
params = {
|
|
3803
|
+
providerId: paramsOrFirst as string,
|
|
3804
|
+
name: rest[0] as string,
|
|
3805
|
+
from: rest[1] as string,
|
|
3806
|
+
username: rest[2] as string,
|
|
3807
|
+
apiKey: rest[3] as string,
|
|
3808
|
+
enabled: rest[4] as boolean
|
|
3809
|
+
};
|
|
3810
|
+
}
|
|
3811
|
+
|
|
3812
|
+
const providerId = params.providerId;
|
|
3813
|
+
const name = params.name;
|
|
3814
|
+
const from = params.from;
|
|
3815
|
+
const username = params.username;
|
|
3816
|
+
const apiKey = params.apiKey;
|
|
3817
|
+
const enabled = params.enabled;
|
|
3818
|
+
|
|
1453
3819
|
if (typeof providerId === 'undefined') {
|
|
1454
3820
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1455
3821
|
}
|
|
1456
3822
|
if (typeof name === 'undefined') {
|
|
1457
3823
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
1458
3824
|
}
|
|
3825
|
+
|
|
1459
3826
|
const apiPath = '/messaging/providers/textmagic';
|
|
1460
3827
|
const payload: Payload = {};
|
|
1461
3828
|
if (typeof providerId !== 'undefined') {
|
|
@@ -1489,22 +3856,64 @@ export class Messaging {
|
|
|
1489
3856
|
payload
|
|
1490
3857
|
);
|
|
1491
3858
|
}
|
|
3859
|
+
|
|
3860
|
+
/**
|
|
3861
|
+
* Update a Textmagic provider by its unique ID.
|
|
3862
|
+
*
|
|
3863
|
+
* @param {string} params.providerId - Provider ID.
|
|
3864
|
+
* @param {string} params.name - Provider name.
|
|
3865
|
+
* @param {boolean} params.enabled - Set as enabled.
|
|
3866
|
+
* @param {string} params.username - Textmagic username.
|
|
3867
|
+
* @param {string} params.apiKey - Textmagic apiKey.
|
|
3868
|
+
* @param {string} params.from - Sender number.
|
|
3869
|
+
* @throws {AppwriteException}
|
|
3870
|
+
* @returns {Promise<Models.Provider>}
|
|
3871
|
+
*/
|
|
3872
|
+
updateTextmagicProvider(params: { providerId: string, name?: string, enabled?: boolean, username?: string, apiKey?: string, from?: string }): Promise<Models.Provider>;
|
|
1492
3873
|
/**
|
|
1493
3874
|
* Update a Textmagic provider by its unique ID.
|
|
1494
3875
|
*
|
|
1495
|
-
* @param {string} providerId
|
|
1496
|
-
* @param {string} name
|
|
1497
|
-
* @param {boolean} enabled
|
|
1498
|
-
* @param {string} username
|
|
1499
|
-
* @param {string} apiKey
|
|
1500
|
-
* @param {string} from
|
|
3876
|
+
* @param {string} providerId - Provider ID.
|
|
3877
|
+
* @param {string} name - Provider name.
|
|
3878
|
+
* @param {boolean} enabled - Set as enabled.
|
|
3879
|
+
* @param {string} username - Textmagic username.
|
|
3880
|
+
* @param {string} apiKey - Textmagic apiKey.
|
|
3881
|
+
* @param {string} from - Sender number.
|
|
1501
3882
|
* @throws {AppwriteException}
|
|
1502
3883
|
* @returns {Promise<Models.Provider>}
|
|
3884
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1503
3885
|
*/
|
|
1504
|
-
updateTextmagicProvider(providerId: string, name?: string, enabled?: boolean, username?: string, apiKey?: string, from?: string): Promise<Models.Provider
|
|
3886
|
+
updateTextmagicProvider(providerId: string, name?: string, enabled?: boolean, username?: string, apiKey?: string, from?: string): Promise<Models.Provider>;
|
|
3887
|
+
updateTextmagicProvider(
|
|
3888
|
+
paramsOrFirst: { providerId: string, name?: string, enabled?: boolean, username?: string, apiKey?: string, from?: string } | string,
|
|
3889
|
+
...rest: [(string)?, (boolean)?, (string)?, (string)?, (string)?]
|
|
3890
|
+
): Promise<Models.Provider> {
|
|
3891
|
+
let params: { providerId: string, name?: string, enabled?: boolean, username?: string, apiKey?: string, from?: string };
|
|
3892
|
+
|
|
3893
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3894
|
+
params = (paramsOrFirst || {}) as { providerId: string, name?: string, enabled?: boolean, username?: string, apiKey?: string, from?: string };
|
|
3895
|
+
} else {
|
|
3896
|
+
params = {
|
|
3897
|
+
providerId: paramsOrFirst as string,
|
|
3898
|
+
name: rest[0] as string,
|
|
3899
|
+
enabled: rest[1] as boolean,
|
|
3900
|
+
username: rest[2] as string,
|
|
3901
|
+
apiKey: rest[3] as string,
|
|
3902
|
+
from: rest[4] as string
|
|
3903
|
+
};
|
|
3904
|
+
}
|
|
3905
|
+
|
|
3906
|
+
const providerId = params.providerId;
|
|
3907
|
+
const name = params.name;
|
|
3908
|
+
const enabled = params.enabled;
|
|
3909
|
+
const username = params.username;
|
|
3910
|
+
const apiKey = params.apiKey;
|
|
3911
|
+
const from = params.from;
|
|
3912
|
+
|
|
1505
3913
|
if (typeof providerId === 'undefined') {
|
|
1506
3914
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1507
3915
|
}
|
|
3916
|
+
|
|
1508
3917
|
const apiPath = '/messaging/providers/textmagic/{providerId}'.replace('{providerId}', providerId);
|
|
1509
3918
|
const payload: Payload = {};
|
|
1510
3919
|
if (typeof name !== 'undefined') {
|
|
@@ -1535,25 +3944,67 @@ export class Messaging {
|
|
|
1535
3944
|
payload
|
|
1536
3945
|
);
|
|
1537
3946
|
}
|
|
3947
|
+
|
|
3948
|
+
/**
|
|
3949
|
+
* Create a new Twilio provider.
|
|
3950
|
+
*
|
|
3951
|
+
* @param {string} params.providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
3952
|
+
* @param {string} params.name - Provider name.
|
|
3953
|
+
* @param {string} params.from - Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
|
|
3954
|
+
* @param {string} params.accountSid - Twilio account secret ID.
|
|
3955
|
+
* @param {string} params.authToken - Twilio authentication token.
|
|
3956
|
+
* @param {boolean} params.enabled - Set as enabled.
|
|
3957
|
+
* @throws {AppwriteException}
|
|
3958
|
+
* @returns {Promise<Models.Provider>}
|
|
3959
|
+
*/
|
|
3960
|
+
createTwilioProvider(params: { providerId: string, name: string, from?: string, accountSid?: string, authToken?: string, enabled?: boolean }): Promise<Models.Provider>;
|
|
1538
3961
|
/**
|
|
1539
3962
|
* Create a new Twilio provider.
|
|
1540
3963
|
*
|
|
1541
|
-
* @param {string} providerId
|
|
1542
|
-
* @param {string} name
|
|
1543
|
-
* @param {string} from
|
|
1544
|
-
* @param {string} accountSid
|
|
1545
|
-
* @param {string} authToken
|
|
1546
|
-
* @param {boolean} enabled
|
|
3964
|
+
* @param {string} providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
3965
|
+
* @param {string} name - Provider name.
|
|
3966
|
+
* @param {string} from - Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
|
|
3967
|
+
* @param {string} accountSid - Twilio account secret ID.
|
|
3968
|
+
* @param {string} authToken - Twilio authentication token.
|
|
3969
|
+
* @param {boolean} enabled - Set as enabled.
|
|
1547
3970
|
* @throws {AppwriteException}
|
|
1548
3971
|
* @returns {Promise<Models.Provider>}
|
|
3972
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1549
3973
|
*/
|
|
1550
|
-
createTwilioProvider(providerId: string, name: string, from?: string, accountSid?: string, authToken?: string, enabled?: boolean): Promise<Models.Provider
|
|
3974
|
+
createTwilioProvider(providerId: string, name: string, from?: string, accountSid?: string, authToken?: string, enabled?: boolean): Promise<Models.Provider>;
|
|
3975
|
+
createTwilioProvider(
|
|
3976
|
+
paramsOrFirst: { providerId: string, name: string, from?: string, accountSid?: string, authToken?: string, enabled?: boolean } | string,
|
|
3977
|
+
...rest: [(string)?, (string)?, (string)?, (string)?, (boolean)?]
|
|
3978
|
+
): Promise<Models.Provider> {
|
|
3979
|
+
let params: { providerId: string, name: string, from?: string, accountSid?: string, authToken?: string, enabled?: boolean };
|
|
3980
|
+
|
|
3981
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3982
|
+
params = (paramsOrFirst || {}) as { providerId: string, name: string, from?: string, accountSid?: string, authToken?: string, enabled?: boolean };
|
|
3983
|
+
} else {
|
|
3984
|
+
params = {
|
|
3985
|
+
providerId: paramsOrFirst as string,
|
|
3986
|
+
name: rest[0] as string,
|
|
3987
|
+
from: rest[1] as string,
|
|
3988
|
+
accountSid: rest[2] as string,
|
|
3989
|
+
authToken: rest[3] as string,
|
|
3990
|
+
enabled: rest[4] as boolean
|
|
3991
|
+
};
|
|
3992
|
+
}
|
|
3993
|
+
|
|
3994
|
+
const providerId = params.providerId;
|
|
3995
|
+
const name = params.name;
|
|
3996
|
+
const from = params.from;
|
|
3997
|
+
const accountSid = params.accountSid;
|
|
3998
|
+
const authToken = params.authToken;
|
|
3999
|
+
const enabled = params.enabled;
|
|
4000
|
+
|
|
1551
4001
|
if (typeof providerId === 'undefined') {
|
|
1552
4002
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1553
4003
|
}
|
|
1554
4004
|
if (typeof name === 'undefined') {
|
|
1555
4005
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
1556
4006
|
}
|
|
4007
|
+
|
|
1557
4008
|
const apiPath = '/messaging/providers/twilio';
|
|
1558
4009
|
const payload: Payload = {};
|
|
1559
4010
|
if (typeof providerId !== 'undefined') {
|
|
@@ -1587,22 +4038,64 @@ export class Messaging {
|
|
|
1587
4038
|
payload
|
|
1588
4039
|
);
|
|
1589
4040
|
}
|
|
4041
|
+
|
|
4042
|
+
/**
|
|
4043
|
+
* Update a Twilio provider by its unique ID.
|
|
4044
|
+
*
|
|
4045
|
+
* @param {string} params.providerId - Provider ID.
|
|
4046
|
+
* @param {string} params.name - Provider name.
|
|
4047
|
+
* @param {boolean} params.enabled - Set as enabled.
|
|
4048
|
+
* @param {string} params.accountSid - Twilio account secret ID.
|
|
4049
|
+
* @param {string} params.authToken - Twilio authentication token.
|
|
4050
|
+
* @param {string} params.from - Sender number.
|
|
4051
|
+
* @throws {AppwriteException}
|
|
4052
|
+
* @returns {Promise<Models.Provider>}
|
|
4053
|
+
*/
|
|
4054
|
+
updateTwilioProvider(params: { providerId: string, name?: string, enabled?: boolean, accountSid?: string, authToken?: string, from?: string }): Promise<Models.Provider>;
|
|
1590
4055
|
/**
|
|
1591
4056
|
* Update a Twilio provider by its unique ID.
|
|
1592
4057
|
*
|
|
1593
|
-
* @param {string} providerId
|
|
1594
|
-
* @param {string} name
|
|
1595
|
-
* @param {boolean} enabled
|
|
1596
|
-
* @param {string} accountSid
|
|
1597
|
-
* @param {string} authToken
|
|
1598
|
-
* @param {string} from
|
|
4058
|
+
* @param {string} providerId - Provider ID.
|
|
4059
|
+
* @param {string} name - Provider name.
|
|
4060
|
+
* @param {boolean} enabled - Set as enabled.
|
|
4061
|
+
* @param {string} accountSid - Twilio account secret ID.
|
|
4062
|
+
* @param {string} authToken - Twilio authentication token.
|
|
4063
|
+
* @param {string} from - Sender number.
|
|
1599
4064
|
* @throws {AppwriteException}
|
|
1600
4065
|
* @returns {Promise<Models.Provider>}
|
|
4066
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1601
4067
|
*/
|
|
1602
|
-
updateTwilioProvider(providerId: string, name?: string, enabled?: boolean, accountSid?: string, authToken?: string, from?: string): Promise<Models.Provider
|
|
4068
|
+
updateTwilioProvider(providerId: string, name?: string, enabled?: boolean, accountSid?: string, authToken?: string, from?: string): Promise<Models.Provider>;
|
|
4069
|
+
updateTwilioProvider(
|
|
4070
|
+
paramsOrFirst: { providerId: string, name?: string, enabled?: boolean, accountSid?: string, authToken?: string, from?: string } | string,
|
|
4071
|
+
...rest: [(string)?, (boolean)?, (string)?, (string)?, (string)?]
|
|
4072
|
+
): Promise<Models.Provider> {
|
|
4073
|
+
let params: { providerId: string, name?: string, enabled?: boolean, accountSid?: string, authToken?: string, from?: string };
|
|
4074
|
+
|
|
4075
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
4076
|
+
params = (paramsOrFirst || {}) as { providerId: string, name?: string, enabled?: boolean, accountSid?: string, authToken?: string, from?: string };
|
|
4077
|
+
} else {
|
|
4078
|
+
params = {
|
|
4079
|
+
providerId: paramsOrFirst as string,
|
|
4080
|
+
name: rest[0] as string,
|
|
4081
|
+
enabled: rest[1] as boolean,
|
|
4082
|
+
accountSid: rest[2] as string,
|
|
4083
|
+
authToken: rest[3] as string,
|
|
4084
|
+
from: rest[4] as string
|
|
4085
|
+
};
|
|
4086
|
+
}
|
|
4087
|
+
|
|
4088
|
+
const providerId = params.providerId;
|
|
4089
|
+
const name = params.name;
|
|
4090
|
+
const enabled = params.enabled;
|
|
4091
|
+
const accountSid = params.accountSid;
|
|
4092
|
+
const authToken = params.authToken;
|
|
4093
|
+
const from = params.from;
|
|
4094
|
+
|
|
1603
4095
|
if (typeof providerId === 'undefined') {
|
|
1604
4096
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1605
4097
|
}
|
|
4098
|
+
|
|
1606
4099
|
const apiPath = '/messaging/providers/twilio/{providerId}'.replace('{providerId}', providerId);
|
|
1607
4100
|
const payload: Payload = {};
|
|
1608
4101
|
if (typeof name !== 'undefined') {
|
|
@@ -1633,25 +4126,67 @@ export class Messaging {
|
|
|
1633
4126
|
payload
|
|
1634
4127
|
);
|
|
1635
4128
|
}
|
|
4129
|
+
|
|
1636
4130
|
/**
|
|
1637
4131
|
* Create a new Vonage provider.
|
|
1638
4132
|
*
|
|
1639
|
-
* @param {string} providerId
|
|
1640
|
-
* @param {string} name
|
|
1641
|
-
* @param {string} from
|
|
1642
|
-
* @param {string} apiKey
|
|
1643
|
-
* @param {string} apiSecret
|
|
1644
|
-
* @param {boolean} enabled
|
|
4133
|
+
* @param {string} params.providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
4134
|
+
* @param {string} params.name - Provider name.
|
|
4135
|
+
* @param {string} params.from - Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
|
|
4136
|
+
* @param {string} params.apiKey - Vonage API key.
|
|
4137
|
+
* @param {string} params.apiSecret - Vonage API secret.
|
|
4138
|
+
* @param {boolean} params.enabled - Set as enabled.
|
|
1645
4139
|
* @throws {AppwriteException}
|
|
1646
4140
|
* @returns {Promise<Models.Provider>}
|
|
1647
4141
|
*/
|
|
1648
|
-
createVonageProvider(providerId: string, name: string, from?: string, apiKey?: string, apiSecret?: string, enabled?: boolean): Promise<Models.Provider
|
|
4142
|
+
createVonageProvider(params: { providerId: string, name: string, from?: string, apiKey?: string, apiSecret?: string, enabled?: boolean }): Promise<Models.Provider>;
|
|
4143
|
+
/**
|
|
4144
|
+
* Create a new Vonage provider.
|
|
4145
|
+
*
|
|
4146
|
+
* @param {string} providerId - Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
4147
|
+
* @param {string} name - Provider name.
|
|
4148
|
+
* @param {string} from - Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
|
|
4149
|
+
* @param {string} apiKey - Vonage API key.
|
|
4150
|
+
* @param {string} apiSecret - Vonage API secret.
|
|
4151
|
+
* @param {boolean} enabled - Set as enabled.
|
|
4152
|
+
* @throws {AppwriteException}
|
|
4153
|
+
* @returns {Promise<Models.Provider>}
|
|
4154
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
4155
|
+
*/
|
|
4156
|
+
createVonageProvider(providerId: string, name: string, from?: string, apiKey?: string, apiSecret?: string, enabled?: boolean): Promise<Models.Provider>;
|
|
4157
|
+
createVonageProvider(
|
|
4158
|
+
paramsOrFirst: { providerId: string, name: string, from?: string, apiKey?: string, apiSecret?: string, enabled?: boolean } | string,
|
|
4159
|
+
...rest: [(string)?, (string)?, (string)?, (string)?, (boolean)?]
|
|
4160
|
+
): Promise<Models.Provider> {
|
|
4161
|
+
let params: { providerId: string, name: string, from?: string, apiKey?: string, apiSecret?: string, enabled?: boolean };
|
|
4162
|
+
|
|
4163
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
4164
|
+
params = (paramsOrFirst || {}) as { providerId: string, name: string, from?: string, apiKey?: string, apiSecret?: string, enabled?: boolean };
|
|
4165
|
+
} else {
|
|
4166
|
+
params = {
|
|
4167
|
+
providerId: paramsOrFirst as string,
|
|
4168
|
+
name: rest[0] as string,
|
|
4169
|
+
from: rest[1] as string,
|
|
4170
|
+
apiKey: rest[2] as string,
|
|
4171
|
+
apiSecret: rest[3] as string,
|
|
4172
|
+
enabled: rest[4] as boolean
|
|
4173
|
+
};
|
|
4174
|
+
}
|
|
4175
|
+
|
|
4176
|
+
const providerId = params.providerId;
|
|
4177
|
+
const name = params.name;
|
|
4178
|
+
const from = params.from;
|
|
4179
|
+
const apiKey = params.apiKey;
|
|
4180
|
+
const apiSecret = params.apiSecret;
|
|
4181
|
+
const enabled = params.enabled;
|
|
4182
|
+
|
|
1649
4183
|
if (typeof providerId === 'undefined') {
|
|
1650
4184
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1651
4185
|
}
|
|
1652
4186
|
if (typeof name === 'undefined') {
|
|
1653
4187
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
1654
4188
|
}
|
|
4189
|
+
|
|
1655
4190
|
const apiPath = '/messaging/providers/vonage';
|
|
1656
4191
|
const payload: Payload = {};
|
|
1657
4192
|
if (typeof providerId !== 'undefined') {
|
|
@@ -1685,22 +4220,64 @@ export class Messaging {
|
|
|
1685
4220
|
payload
|
|
1686
4221
|
);
|
|
1687
4222
|
}
|
|
4223
|
+
|
|
4224
|
+
/**
|
|
4225
|
+
* Update a Vonage provider by its unique ID.
|
|
4226
|
+
*
|
|
4227
|
+
* @param {string} params.providerId - Provider ID.
|
|
4228
|
+
* @param {string} params.name - Provider name.
|
|
4229
|
+
* @param {boolean} params.enabled - Set as enabled.
|
|
4230
|
+
* @param {string} params.apiKey - Vonage API key.
|
|
4231
|
+
* @param {string} params.apiSecret - Vonage API secret.
|
|
4232
|
+
* @param {string} params.from - Sender number.
|
|
4233
|
+
* @throws {AppwriteException}
|
|
4234
|
+
* @returns {Promise<Models.Provider>}
|
|
4235
|
+
*/
|
|
4236
|
+
updateVonageProvider(params: { providerId: string, name?: string, enabled?: boolean, apiKey?: string, apiSecret?: string, from?: string }): Promise<Models.Provider>;
|
|
1688
4237
|
/**
|
|
1689
4238
|
* Update a Vonage provider by its unique ID.
|
|
1690
4239
|
*
|
|
1691
|
-
* @param {string} providerId
|
|
1692
|
-
* @param {string} name
|
|
1693
|
-
* @param {boolean} enabled
|
|
1694
|
-
* @param {string} apiKey
|
|
1695
|
-
* @param {string} apiSecret
|
|
1696
|
-
* @param {string} from
|
|
4240
|
+
* @param {string} providerId - Provider ID.
|
|
4241
|
+
* @param {string} name - Provider name.
|
|
4242
|
+
* @param {boolean} enabled - Set as enabled.
|
|
4243
|
+
* @param {string} apiKey - Vonage API key.
|
|
4244
|
+
* @param {string} apiSecret - Vonage API secret.
|
|
4245
|
+
* @param {string} from - Sender number.
|
|
1697
4246
|
* @throws {AppwriteException}
|
|
1698
4247
|
* @returns {Promise<Models.Provider>}
|
|
4248
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1699
4249
|
*/
|
|
1700
|
-
updateVonageProvider(providerId: string, name?: string, enabled?: boolean, apiKey?: string, apiSecret?: string, from?: string): Promise<Models.Provider
|
|
4250
|
+
updateVonageProvider(providerId: string, name?: string, enabled?: boolean, apiKey?: string, apiSecret?: string, from?: string): Promise<Models.Provider>;
|
|
4251
|
+
updateVonageProvider(
|
|
4252
|
+
paramsOrFirst: { providerId: string, name?: string, enabled?: boolean, apiKey?: string, apiSecret?: string, from?: string } | string,
|
|
4253
|
+
...rest: [(string)?, (boolean)?, (string)?, (string)?, (string)?]
|
|
4254
|
+
): Promise<Models.Provider> {
|
|
4255
|
+
let params: { providerId: string, name?: string, enabled?: boolean, apiKey?: string, apiSecret?: string, from?: string };
|
|
4256
|
+
|
|
4257
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
4258
|
+
params = (paramsOrFirst || {}) as { providerId: string, name?: string, enabled?: boolean, apiKey?: string, apiSecret?: string, from?: string };
|
|
4259
|
+
} else {
|
|
4260
|
+
params = {
|
|
4261
|
+
providerId: paramsOrFirst as string,
|
|
4262
|
+
name: rest[0] as string,
|
|
4263
|
+
enabled: rest[1] as boolean,
|
|
4264
|
+
apiKey: rest[2] as string,
|
|
4265
|
+
apiSecret: rest[3] as string,
|
|
4266
|
+
from: rest[4] as string
|
|
4267
|
+
};
|
|
4268
|
+
}
|
|
4269
|
+
|
|
4270
|
+
const providerId = params.providerId;
|
|
4271
|
+
const name = params.name;
|
|
4272
|
+
const enabled = params.enabled;
|
|
4273
|
+
const apiKey = params.apiKey;
|
|
4274
|
+
const apiSecret = params.apiSecret;
|
|
4275
|
+
const from = params.from;
|
|
4276
|
+
|
|
1701
4277
|
if (typeof providerId === 'undefined') {
|
|
1702
4278
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1703
4279
|
}
|
|
4280
|
+
|
|
1704
4281
|
const apiPath = '/messaging/providers/vonage/{providerId}'.replace('{providerId}', providerId);
|
|
1705
4282
|
const payload: Payload = {};
|
|
1706
4283
|
if (typeof name !== 'undefined') {
|
|
@@ -1731,18 +4308,45 @@ export class Messaging {
|
|
|
1731
4308
|
payload
|
|
1732
4309
|
);
|
|
1733
4310
|
}
|
|
4311
|
+
|
|
1734
4312
|
/**
|
|
1735
4313
|
* Get a provider by its unique ID.
|
|
1736
|
-
|
|
4314
|
+
*
|
|
4315
|
+
*
|
|
4316
|
+
* @param {string} params.providerId - Provider ID.
|
|
4317
|
+
* @throws {AppwriteException}
|
|
4318
|
+
* @returns {Promise<Models.Provider>}
|
|
4319
|
+
*/
|
|
4320
|
+
getProvider(params: { providerId: string }): Promise<Models.Provider>;
|
|
4321
|
+
/**
|
|
4322
|
+
* Get a provider by its unique ID.
|
|
4323
|
+
*
|
|
1737
4324
|
*
|
|
1738
|
-
* @param {string} providerId
|
|
4325
|
+
* @param {string} providerId - Provider ID.
|
|
1739
4326
|
* @throws {AppwriteException}
|
|
1740
4327
|
* @returns {Promise<Models.Provider>}
|
|
4328
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1741
4329
|
*/
|
|
1742
|
-
getProvider(providerId: string): Promise<Models.Provider
|
|
4330
|
+
getProvider(providerId: string): Promise<Models.Provider>;
|
|
4331
|
+
getProvider(
|
|
4332
|
+
paramsOrFirst: { providerId: string } | string
|
|
4333
|
+
): Promise<Models.Provider> {
|
|
4334
|
+
let params: { providerId: string };
|
|
4335
|
+
|
|
4336
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
4337
|
+
params = (paramsOrFirst || {}) as { providerId: string };
|
|
4338
|
+
} else {
|
|
4339
|
+
params = {
|
|
4340
|
+
providerId: paramsOrFirst as string
|
|
4341
|
+
};
|
|
4342
|
+
}
|
|
4343
|
+
|
|
4344
|
+
const providerId = params.providerId;
|
|
4345
|
+
|
|
1743
4346
|
if (typeof providerId === 'undefined') {
|
|
1744
4347
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1745
4348
|
}
|
|
4349
|
+
|
|
1746
4350
|
const apiPath = '/messaging/providers/{providerId}'.replace('{providerId}', providerId);
|
|
1747
4351
|
const payload: Payload = {};
|
|
1748
4352
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -1757,17 +4361,43 @@ export class Messaging {
|
|
|
1757
4361
|
payload
|
|
1758
4362
|
);
|
|
1759
4363
|
}
|
|
4364
|
+
|
|
4365
|
+
/**
|
|
4366
|
+
* Delete a provider by its unique ID.
|
|
4367
|
+
*
|
|
4368
|
+
* @param {string} params.providerId - Provider ID.
|
|
4369
|
+
* @throws {AppwriteException}
|
|
4370
|
+
* @returns {Promise<{}>}
|
|
4371
|
+
*/
|
|
4372
|
+
deleteProvider(params: { providerId: string }): Promise<{}>;
|
|
1760
4373
|
/**
|
|
1761
4374
|
* Delete a provider by its unique ID.
|
|
1762
4375
|
*
|
|
1763
|
-
* @param {string} providerId
|
|
4376
|
+
* @param {string} providerId - Provider ID.
|
|
1764
4377
|
* @throws {AppwriteException}
|
|
1765
4378
|
* @returns {Promise<{}>}
|
|
4379
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1766
4380
|
*/
|
|
1767
|
-
deleteProvider(providerId: string): Promise<{}
|
|
4381
|
+
deleteProvider(providerId: string): Promise<{}>;
|
|
4382
|
+
deleteProvider(
|
|
4383
|
+
paramsOrFirst: { providerId: string } | string
|
|
4384
|
+
): Promise<{}> {
|
|
4385
|
+
let params: { providerId: string };
|
|
4386
|
+
|
|
4387
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
4388
|
+
params = (paramsOrFirst || {}) as { providerId: string };
|
|
4389
|
+
} else {
|
|
4390
|
+
params = {
|
|
4391
|
+
providerId: paramsOrFirst as string
|
|
4392
|
+
};
|
|
4393
|
+
}
|
|
4394
|
+
|
|
4395
|
+
const providerId = params.providerId;
|
|
4396
|
+
|
|
1768
4397
|
if (typeof providerId === 'undefined') {
|
|
1769
4398
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1770
4399
|
}
|
|
4400
|
+
|
|
1771
4401
|
const apiPath = '/messaging/providers/{providerId}'.replace('{providerId}', providerId);
|
|
1772
4402
|
const payload: Payload = {};
|
|
1773
4403
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -1783,23 +4413,60 @@ export class Messaging {
|
|
|
1783
4413
|
payload
|
|
1784
4414
|
);
|
|
1785
4415
|
}
|
|
4416
|
+
|
|
4417
|
+
/**
|
|
4418
|
+
* Get the provider activity logs listed by its unique ID.
|
|
4419
|
+
*
|
|
4420
|
+
* @param {string} params.providerId - Provider ID.
|
|
4421
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
|
|
4422
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
4423
|
+
* @throws {AppwriteException}
|
|
4424
|
+
* @returns {Promise<Models.LogList>}
|
|
4425
|
+
*/
|
|
4426
|
+
listProviderLogs(params: { providerId: string, queries?: string[], total?: boolean }): Promise<Models.LogList>;
|
|
1786
4427
|
/**
|
|
1787
4428
|
* Get the provider activity logs listed by its unique ID.
|
|
1788
4429
|
*
|
|
1789
|
-
* @param {string} providerId
|
|
1790
|
-
* @param {string[]} queries
|
|
4430
|
+
* @param {string} providerId - Provider ID.
|
|
4431
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
|
|
4432
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
1791
4433
|
* @throws {AppwriteException}
|
|
1792
4434
|
* @returns {Promise<Models.LogList>}
|
|
4435
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1793
4436
|
*/
|
|
1794
|
-
listProviderLogs(providerId: string, queries?: string[]): Promise<Models.LogList
|
|
4437
|
+
listProviderLogs(providerId: string, queries?: string[], total?: boolean): Promise<Models.LogList>;
|
|
4438
|
+
listProviderLogs(
|
|
4439
|
+
paramsOrFirst: { providerId: string, queries?: string[], total?: boolean } | string,
|
|
4440
|
+
...rest: [(string[])?, (boolean)?]
|
|
4441
|
+
): Promise<Models.LogList> {
|
|
4442
|
+
let params: { providerId: string, queries?: string[], total?: boolean };
|
|
4443
|
+
|
|
4444
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
4445
|
+
params = (paramsOrFirst || {}) as { providerId: string, queries?: string[], total?: boolean };
|
|
4446
|
+
} else {
|
|
4447
|
+
params = {
|
|
4448
|
+
providerId: paramsOrFirst as string,
|
|
4449
|
+
queries: rest[0] as string[],
|
|
4450
|
+
total: rest[1] as boolean
|
|
4451
|
+
};
|
|
4452
|
+
}
|
|
4453
|
+
|
|
4454
|
+
const providerId = params.providerId;
|
|
4455
|
+
const queries = params.queries;
|
|
4456
|
+
const total = params.total;
|
|
4457
|
+
|
|
1795
4458
|
if (typeof providerId === 'undefined') {
|
|
1796
4459
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1797
4460
|
}
|
|
4461
|
+
|
|
1798
4462
|
const apiPath = '/messaging/providers/{providerId}/logs'.replace('{providerId}', providerId);
|
|
1799
4463
|
const payload: Payload = {};
|
|
1800
4464
|
if (typeof queries !== 'undefined') {
|
|
1801
4465
|
payload['queries'] = queries;
|
|
1802
4466
|
}
|
|
4467
|
+
if (typeof total !== 'undefined') {
|
|
4468
|
+
payload['total'] = total;
|
|
4469
|
+
}
|
|
1803
4470
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1804
4471
|
|
|
1805
4472
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -1812,23 +4479,60 @@ export class Messaging {
|
|
|
1812
4479
|
payload
|
|
1813
4480
|
);
|
|
1814
4481
|
}
|
|
4482
|
+
|
|
4483
|
+
/**
|
|
4484
|
+
* Get the subscriber activity logs listed by its unique ID.
|
|
4485
|
+
*
|
|
4486
|
+
* @param {string} params.subscriberId - Subscriber ID.
|
|
4487
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
|
|
4488
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
4489
|
+
* @throws {AppwriteException}
|
|
4490
|
+
* @returns {Promise<Models.LogList>}
|
|
4491
|
+
*/
|
|
4492
|
+
listSubscriberLogs(params: { subscriberId: string, queries?: string[], total?: boolean }): Promise<Models.LogList>;
|
|
1815
4493
|
/**
|
|
1816
4494
|
* Get the subscriber activity logs listed by its unique ID.
|
|
1817
4495
|
*
|
|
1818
|
-
* @param {string} subscriberId
|
|
1819
|
-
* @param {string[]} queries
|
|
4496
|
+
* @param {string} subscriberId - Subscriber ID.
|
|
4497
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
|
|
4498
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
1820
4499
|
* @throws {AppwriteException}
|
|
1821
4500
|
* @returns {Promise<Models.LogList>}
|
|
4501
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1822
4502
|
*/
|
|
1823
|
-
listSubscriberLogs(subscriberId: string, queries?: string[]): Promise<Models.LogList
|
|
4503
|
+
listSubscriberLogs(subscriberId: string, queries?: string[], total?: boolean): Promise<Models.LogList>;
|
|
4504
|
+
listSubscriberLogs(
|
|
4505
|
+
paramsOrFirst: { subscriberId: string, queries?: string[], total?: boolean } | string,
|
|
4506
|
+
...rest: [(string[])?, (boolean)?]
|
|
4507
|
+
): Promise<Models.LogList> {
|
|
4508
|
+
let params: { subscriberId: string, queries?: string[], total?: boolean };
|
|
4509
|
+
|
|
4510
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
4511
|
+
params = (paramsOrFirst || {}) as { subscriberId: string, queries?: string[], total?: boolean };
|
|
4512
|
+
} else {
|
|
4513
|
+
params = {
|
|
4514
|
+
subscriberId: paramsOrFirst as string,
|
|
4515
|
+
queries: rest[0] as string[],
|
|
4516
|
+
total: rest[1] as boolean
|
|
4517
|
+
};
|
|
4518
|
+
}
|
|
4519
|
+
|
|
4520
|
+
const subscriberId = params.subscriberId;
|
|
4521
|
+
const queries = params.queries;
|
|
4522
|
+
const total = params.total;
|
|
4523
|
+
|
|
1824
4524
|
if (typeof subscriberId === 'undefined') {
|
|
1825
4525
|
throw new AppwriteException('Missing required parameter: "subscriberId"');
|
|
1826
4526
|
}
|
|
4527
|
+
|
|
1827
4528
|
const apiPath = '/messaging/subscribers/{subscriberId}/logs'.replace('{subscriberId}', subscriberId);
|
|
1828
4529
|
const payload: Payload = {};
|
|
1829
4530
|
if (typeof queries !== 'undefined') {
|
|
1830
4531
|
payload['queries'] = queries;
|
|
1831
4532
|
}
|
|
4533
|
+
if (typeof total !== 'undefined') {
|
|
4534
|
+
payload['total'] = total;
|
|
4535
|
+
}
|
|
1832
4536
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1833
4537
|
|
|
1834
4538
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -1841,15 +4545,49 @@ export class Messaging {
|
|
|
1841
4545
|
payload
|
|
1842
4546
|
);
|
|
1843
4547
|
}
|
|
4548
|
+
|
|
4549
|
+
/**
|
|
4550
|
+
* Get a list of all topics from the current Appwrite project.
|
|
4551
|
+
*
|
|
4552
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, description, emailTotal, smsTotal, pushTotal
|
|
4553
|
+
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
|
4554
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
4555
|
+
* @throws {AppwriteException}
|
|
4556
|
+
* @returns {Promise<Models.TopicList>}
|
|
4557
|
+
*/
|
|
4558
|
+
listTopics(params?: { queries?: string[], search?: string, total?: boolean }): Promise<Models.TopicList>;
|
|
1844
4559
|
/**
|
|
1845
4560
|
* Get a list of all topics from the current Appwrite project.
|
|
1846
4561
|
*
|
|
1847
|
-
* @param {string[]} queries
|
|
1848
|
-
* @param {string} search
|
|
4562
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, description, emailTotal, smsTotal, pushTotal
|
|
4563
|
+
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
|
4564
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
1849
4565
|
* @throws {AppwriteException}
|
|
1850
4566
|
* @returns {Promise<Models.TopicList>}
|
|
4567
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1851
4568
|
*/
|
|
1852
|
-
listTopics(queries?: string[], search?: string): Promise<Models.TopicList
|
|
4569
|
+
listTopics(queries?: string[], search?: string, total?: boolean): Promise<Models.TopicList>;
|
|
4570
|
+
listTopics(
|
|
4571
|
+
paramsOrFirst?: { queries?: string[], search?: string, total?: boolean } | string[],
|
|
4572
|
+
...rest: [(string)?, (boolean)?]
|
|
4573
|
+
): Promise<Models.TopicList> {
|
|
4574
|
+
let params: { queries?: string[], search?: string, total?: boolean };
|
|
4575
|
+
|
|
4576
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
4577
|
+
params = (paramsOrFirst || {}) as { queries?: string[], search?: string, total?: boolean };
|
|
4578
|
+
} else {
|
|
4579
|
+
params = {
|
|
4580
|
+
queries: paramsOrFirst as string[],
|
|
4581
|
+
search: rest[0] as string,
|
|
4582
|
+
total: rest[1] as boolean
|
|
4583
|
+
};
|
|
4584
|
+
}
|
|
4585
|
+
|
|
4586
|
+
const queries = params.queries;
|
|
4587
|
+
const search = params.search;
|
|
4588
|
+
const total = params.total;
|
|
4589
|
+
|
|
4590
|
+
|
|
1853
4591
|
const apiPath = '/messaging/topics';
|
|
1854
4592
|
const payload: Payload = {};
|
|
1855
4593
|
if (typeof queries !== 'undefined') {
|
|
@@ -1858,6 +4596,9 @@ export class Messaging {
|
|
|
1858
4596
|
if (typeof search !== 'undefined') {
|
|
1859
4597
|
payload['search'] = search;
|
|
1860
4598
|
}
|
|
4599
|
+
if (typeof total !== 'undefined') {
|
|
4600
|
+
payload['total'] = total;
|
|
4601
|
+
}
|
|
1861
4602
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1862
4603
|
|
|
1863
4604
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -1870,22 +4611,55 @@ export class Messaging {
|
|
|
1870
4611
|
payload
|
|
1871
4612
|
);
|
|
1872
4613
|
}
|
|
4614
|
+
|
|
4615
|
+
/**
|
|
4616
|
+
* Create a new topic.
|
|
4617
|
+
*
|
|
4618
|
+
* @param {string} params.topicId - Topic ID. Choose a custom Topic ID or a new Topic ID.
|
|
4619
|
+
* @param {string} params.name - Topic Name.
|
|
4620
|
+
* @param {string[]} params.subscribe - An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
|
|
4621
|
+
* @throws {AppwriteException}
|
|
4622
|
+
* @returns {Promise<Models.Topic>}
|
|
4623
|
+
*/
|
|
4624
|
+
createTopic(params: { topicId: string, name: string, subscribe?: string[] }): Promise<Models.Topic>;
|
|
1873
4625
|
/**
|
|
1874
4626
|
* Create a new topic.
|
|
1875
4627
|
*
|
|
1876
|
-
* @param {string} topicId
|
|
1877
|
-
* @param {string} name
|
|
1878
|
-
* @param {string[]} subscribe
|
|
4628
|
+
* @param {string} topicId - Topic ID. Choose a custom Topic ID or a new Topic ID.
|
|
4629
|
+
* @param {string} name - Topic Name.
|
|
4630
|
+
* @param {string[]} subscribe - An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
|
|
1879
4631
|
* @throws {AppwriteException}
|
|
1880
4632
|
* @returns {Promise<Models.Topic>}
|
|
4633
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1881
4634
|
*/
|
|
1882
|
-
createTopic(topicId: string, name: string, subscribe?: string[]): Promise<Models.Topic
|
|
4635
|
+
createTopic(topicId: string, name: string, subscribe?: string[]): Promise<Models.Topic>;
|
|
4636
|
+
createTopic(
|
|
4637
|
+
paramsOrFirst: { topicId: string, name: string, subscribe?: string[] } | string,
|
|
4638
|
+
...rest: [(string)?, (string[])?]
|
|
4639
|
+
): Promise<Models.Topic> {
|
|
4640
|
+
let params: { topicId: string, name: string, subscribe?: string[] };
|
|
4641
|
+
|
|
4642
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
4643
|
+
params = (paramsOrFirst || {}) as { topicId: string, name: string, subscribe?: string[] };
|
|
4644
|
+
} else {
|
|
4645
|
+
params = {
|
|
4646
|
+
topicId: paramsOrFirst as string,
|
|
4647
|
+
name: rest[0] as string,
|
|
4648
|
+
subscribe: rest[1] as string[]
|
|
4649
|
+
};
|
|
4650
|
+
}
|
|
4651
|
+
|
|
4652
|
+
const topicId = params.topicId;
|
|
4653
|
+
const name = params.name;
|
|
4654
|
+
const subscribe = params.subscribe;
|
|
4655
|
+
|
|
1883
4656
|
if (typeof topicId === 'undefined') {
|
|
1884
4657
|
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
1885
4658
|
}
|
|
1886
4659
|
if (typeof name === 'undefined') {
|
|
1887
4660
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
1888
4661
|
}
|
|
4662
|
+
|
|
1889
4663
|
const apiPath = '/messaging/topics';
|
|
1890
4664
|
const payload: Payload = {};
|
|
1891
4665
|
if (typeof topicId !== 'undefined') {
|
|
@@ -1910,18 +4684,45 @@ export class Messaging {
|
|
|
1910
4684
|
payload
|
|
1911
4685
|
);
|
|
1912
4686
|
}
|
|
4687
|
+
|
|
1913
4688
|
/**
|
|
1914
4689
|
* Get a topic by its unique ID.
|
|
1915
|
-
|
|
4690
|
+
*
|
|
4691
|
+
*
|
|
4692
|
+
* @param {string} params.topicId - Topic ID.
|
|
4693
|
+
* @throws {AppwriteException}
|
|
4694
|
+
* @returns {Promise<Models.Topic>}
|
|
4695
|
+
*/
|
|
4696
|
+
getTopic(params: { topicId: string }): Promise<Models.Topic>;
|
|
4697
|
+
/**
|
|
4698
|
+
* Get a topic by its unique ID.
|
|
4699
|
+
*
|
|
1916
4700
|
*
|
|
1917
|
-
* @param {string} topicId
|
|
4701
|
+
* @param {string} topicId - Topic ID.
|
|
1918
4702
|
* @throws {AppwriteException}
|
|
1919
4703
|
* @returns {Promise<Models.Topic>}
|
|
4704
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1920
4705
|
*/
|
|
1921
|
-
getTopic(topicId: string): Promise<Models.Topic
|
|
4706
|
+
getTopic(topicId: string): Promise<Models.Topic>;
|
|
4707
|
+
getTopic(
|
|
4708
|
+
paramsOrFirst: { topicId: string } | string
|
|
4709
|
+
): Promise<Models.Topic> {
|
|
4710
|
+
let params: { topicId: string };
|
|
4711
|
+
|
|
4712
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
4713
|
+
params = (paramsOrFirst || {}) as { topicId: string };
|
|
4714
|
+
} else {
|
|
4715
|
+
params = {
|
|
4716
|
+
topicId: paramsOrFirst as string
|
|
4717
|
+
};
|
|
4718
|
+
}
|
|
4719
|
+
|
|
4720
|
+
const topicId = params.topicId;
|
|
4721
|
+
|
|
1922
4722
|
if (typeof topicId === 'undefined') {
|
|
1923
4723
|
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
1924
4724
|
}
|
|
4725
|
+
|
|
1925
4726
|
const apiPath = '/messaging/topics/{topicId}'.replace('{topicId}', topicId);
|
|
1926
4727
|
const payload: Payload = {};
|
|
1927
4728
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -1936,20 +4737,54 @@ export class Messaging {
|
|
|
1936
4737
|
payload
|
|
1937
4738
|
);
|
|
1938
4739
|
}
|
|
4740
|
+
|
|
1939
4741
|
/**
|
|
1940
4742
|
* Update a topic by its unique ID.
|
|
1941
|
-
|
|
4743
|
+
*
|
|
4744
|
+
*
|
|
4745
|
+
* @param {string} params.topicId - Topic ID.
|
|
4746
|
+
* @param {string} params.name - Topic Name.
|
|
4747
|
+
* @param {string[]} params.subscribe - An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
|
|
4748
|
+
* @throws {AppwriteException}
|
|
4749
|
+
* @returns {Promise<Models.Topic>}
|
|
4750
|
+
*/
|
|
4751
|
+
updateTopic(params: { topicId: string, name?: string, subscribe?: string[] }): Promise<Models.Topic>;
|
|
4752
|
+
/**
|
|
4753
|
+
* Update a topic by its unique ID.
|
|
4754
|
+
*
|
|
1942
4755
|
*
|
|
1943
|
-
* @param {string} topicId
|
|
1944
|
-
* @param {string} name
|
|
1945
|
-
* @param {string[]} subscribe
|
|
4756
|
+
* @param {string} topicId - Topic ID.
|
|
4757
|
+
* @param {string} name - Topic Name.
|
|
4758
|
+
* @param {string[]} subscribe - An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
|
|
1946
4759
|
* @throws {AppwriteException}
|
|
1947
4760
|
* @returns {Promise<Models.Topic>}
|
|
4761
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1948
4762
|
*/
|
|
1949
|
-
updateTopic(topicId: string, name?: string, subscribe?: string[]): Promise<Models.Topic
|
|
4763
|
+
updateTopic(topicId: string, name?: string, subscribe?: string[]): Promise<Models.Topic>;
|
|
4764
|
+
updateTopic(
|
|
4765
|
+
paramsOrFirst: { topicId: string, name?: string, subscribe?: string[] } | string,
|
|
4766
|
+
...rest: [(string)?, (string[])?]
|
|
4767
|
+
): Promise<Models.Topic> {
|
|
4768
|
+
let params: { topicId: string, name?: string, subscribe?: string[] };
|
|
4769
|
+
|
|
4770
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
4771
|
+
params = (paramsOrFirst || {}) as { topicId: string, name?: string, subscribe?: string[] };
|
|
4772
|
+
} else {
|
|
4773
|
+
params = {
|
|
4774
|
+
topicId: paramsOrFirst as string,
|
|
4775
|
+
name: rest[0] as string,
|
|
4776
|
+
subscribe: rest[1] as string[]
|
|
4777
|
+
};
|
|
4778
|
+
}
|
|
4779
|
+
|
|
4780
|
+
const topicId = params.topicId;
|
|
4781
|
+
const name = params.name;
|
|
4782
|
+
const subscribe = params.subscribe;
|
|
4783
|
+
|
|
1950
4784
|
if (typeof topicId === 'undefined') {
|
|
1951
4785
|
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
1952
4786
|
}
|
|
4787
|
+
|
|
1953
4788
|
const apiPath = '/messaging/topics/{topicId}'.replace('{topicId}', topicId);
|
|
1954
4789
|
const payload: Payload = {};
|
|
1955
4790
|
if (typeof name !== 'undefined') {
|
|
@@ -1971,17 +4806,43 @@ export class Messaging {
|
|
|
1971
4806
|
payload
|
|
1972
4807
|
);
|
|
1973
4808
|
}
|
|
4809
|
+
|
|
1974
4810
|
/**
|
|
1975
4811
|
* Delete a topic by its unique ID.
|
|
1976
4812
|
*
|
|
1977
|
-
* @param {string} topicId
|
|
4813
|
+
* @param {string} params.topicId - Topic ID.
|
|
1978
4814
|
* @throws {AppwriteException}
|
|
1979
4815
|
* @returns {Promise<{}>}
|
|
1980
4816
|
*/
|
|
1981
|
-
deleteTopic(topicId: string): Promise<{}
|
|
4817
|
+
deleteTopic(params: { topicId: string }): Promise<{}>;
|
|
4818
|
+
/**
|
|
4819
|
+
* Delete a topic by its unique ID.
|
|
4820
|
+
*
|
|
4821
|
+
* @param {string} topicId - Topic ID.
|
|
4822
|
+
* @throws {AppwriteException}
|
|
4823
|
+
* @returns {Promise<{}>}
|
|
4824
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
4825
|
+
*/
|
|
4826
|
+
deleteTopic(topicId: string): Promise<{}>;
|
|
4827
|
+
deleteTopic(
|
|
4828
|
+
paramsOrFirst: { topicId: string } | string
|
|
4829
|
+
): Promise<{}> {
|
|
4830
|
+
let params: { topicId: string };
|
|
4831
|
+
|
|
4832
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
4833
|
+
params = (paramsOrFirst || {}) as { topicId: string };
|
|
4834
|
+
} else {
|
|
4835
|
+
params = {
|
|
4836
|
+
topicId: paramsOrFirst as string
|
|
4837
|
+
};
|
|
4838
|
+
}
|
|
4839
|
+
|
|
4840
|
+
const topicId = params.topicId;
|
|
4841
|
+
|
|
1982
4842
|
if (typeof topicId === 'undefined') {
|
|
1983
4843
|
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
1984
4844
|
}
|
|
4845
|
+
|
|
1985
4846
|
const apiPath = '/messaging/topics/{topicId}'.replace('{topicId}', topicId);
|
|
1986
4847
|
const payload: Payload = {};
|
|
1987
4848
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -1997,23 +4858,60 @@ export class Messaging {
|
|
|
1997
4858
|
payload
|
|
1998
4859
|
);
|
|
1999
4860
|
}
|
|
4861
|
+
|
|
4862
|
+
/**
|
|
4863
|
+
* Get the topic activity logs listed by its unique ID.
|
|
4864
|
+
*
|
|
4865
|
+
* @param {string} params.topicId - Topic ID.
|
|
4866
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
|
|
4867
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
4868
|
+
* @throws {AppwriteException}
|
|
4869
|
+
* @returns {Promise<Models.LogList>}
|
|
4870
|
+
*/
|
|
4871
|
+
listTopicLogs(params: { topicId: string, queries?: string[], total?: boolean }): Promise<Models.LogList>;
|
|
2000
4872
|
/**
|
|
2001
4873
|
* Get the topic activity logs listed by its unique ID.
|
|
2002
4874
|
*
|
|
2003
|
-
* @param {string} topicId
|
|
2004
|
-
* @param {string[]} queries
|
|
4875
|
+
* @param {string} topicId - Topic ID.
|
|
4876
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
|
|
4877
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
2005
4878
|
* @throws {AppwriteException}
|
|
2006
4879
|
* @returns {Promise<Models.LogList>}
|
|
4880
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2007
4881
|
*/
|
|
2008
|
-
listTopicLogs(topicId: string, queries?: string[]): Promise<Models.LogList
|
|
4882
|
+
listTopicLogs(topicId: string, queries?: string[], total?: boolean): Promise<Models.LogList>;
|
|
4883
|
+
listTopicLogs(
|
|
4884
|
+
paramsOrFirst: { topicId: string, queries?: string[], total?: boolean } | string,
|
|
4885
|
+
...rest: [(string[])?, (boolean)?]
|
|
4886
|
+
): Promise<Models.LogList> {
|
|
4887
|
+
let params: { topicId: string, queries?: string[], total?: boolean };
|
|
4888
|
+
|
|
4889
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
4890
|
+
params = (paramsOrFirst || {}) as { topicId: string, queries?: string[], total?: boolean };
|
|
4891
|
+
} else {
|
|
4892
|
+
params = {
|
|
4893
|
+
topicId: paramsOrFirst as string,
|
|
4894
|
+
queries: rest[0] as string[],
|
|
4895
|
+
total: rest[1] as boolean
|
|
4896
|
+
};
|
|
4897
|
+
}
|
|
4898
|
+
|
|
4899
|
+
const topicId = params.topicId;
|
|
4900
|
+
const queries = params.queries;
|
|
4901
|
+
const total = params.total;
|
|
4902
|
+
|
|
2009
4903
|
if (typeof topicId === 'undefined') {
|
|
2010
4904
|
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
2011
4905
|
}
|
|
4906
|
+
|
|
2012
4907
|
const apiPath = '/messaging/topics/{topicId}/logs'.replace('{topicId}', topicId);
|
|
2013
4908
|
const payload: Payload = {};
|
|
2014
4909
|
if (typeof queries !== 'undefined') {
|
|
2015
4910
|
payload['queries'] = queries;
|
|
2016
4911
|
}
|
|
4912
|
+
if (typeof total !== 'undefined') {
|
|
4913
|
+
payload['total'] = total;
|
|
4914
|
+
}
|
|
2017
4915
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2018
4916
|
|
|
2019
4917
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -2026,19 +4924,56 @@ export class Messaging {
|
|
|
2026
4924
|
payload
|
|
2027
4925
|
);
|
|
2028
4926
|
}
|
|
4927
|
+
|
|
4928
|
+
/**
|
|
4929
|
+
* Get a list of all subscribers from the current Appwrite project.
|
|
4930
|
+
*
|
|
4931
|
+
* @param {string} params.topicId - Topic ID. The topic ID subscribed to.
|
|
4932
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled
|
|
4933
|
+
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
|
4934
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
4935
|
+
* @throws {AppwriteException}
|
|
4936
|
+
* @returns {Promise<Models.SubscriberList>}
|
|
4937
|
+
*/
|
|
4938
|
+
listSubscribers(params: { topicId: string, queries?: string[], search?: string, total?: boolean }): Promise<Models.SubscriberList>;
|
|
2029
4939
|
/**
|
|
2030
4940
|
* Get a list of all subscribers from the current Appwrite project.
|
|
2031
4941
|
*
|
|
2032
|
-
* @param {string} topicId
|
|
2033
|
-
* @param {string[]} queries
|
|
2034
|
-
* @param {string} search
|
|
4942
|
+
* @param {string} topicId - Topic ID. The topic ID subscribed to.
|
|
4943
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled
|
|
4944
|
+
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
|
4945
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
2035
4946
|
* @throws {AppwriteException}
|
|
2036
4947
|
* @returns {Promise<Models.SubscriberList>}
|
|
4948
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2037
4949
|
*/
|
|
2038
|
-
listSubscribers(topicId: string, queries?: string[], search?: string): Promise<Models.SubscriberList
|
|
4950
|
+
listSubscribers(topicId: string, queries?: string[], search?: string, total?: boolean): Promise<Models.SubscriberList>;
|
|
4951
|
+
listSubscribers(
|
|
4952
|
+
paramsOrFirst: { topicId: string, queries?: string[], search?: string, total?: boolean } | string,
|
|
4953
|
+
...rest: [(string[])?, (string)?, (boolean)?]
|
|
4954
|
+
): Promise<Models.SubscriberList> {
|
|
4955
|
+
let params: { topicId: string, queries?: string[], search?: string, total?: boolean };
|
|
4956
|
+
|
|
4957
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
4958
|
+
params = (paramsOrFirst || {}) as { topicId: string, queries?: string[], search?: string, total?: boolean };
|
|
4959
|
+
} else {
|
|
4960
|
+
params = {
|
|
4961
|
+
topicId: paramsOrFirst as string,
|
|
4962
|
+
queries: rest[0] as string[],
|
|
4963
|
+
search: rest[1] as string,
|
|
4964
|
+
total: rest[2] as boolean
|
|
4965
|
+
};
|
|
4966
|
+
}
|
|
4967
|
+
|
|
4968
|
+
const topicId = params.topicId;
|
|
4969
|
+
const queries = params.queries;
|
|
4970
|
+
const search = params.search;
|
|
4971
|
+
const total = params.total;
|
|
4972
|
+
|
|
2039
4973
|
if (typeof topicId === 'undefined') {
|
|
2040
4974
|
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
2041
4975
|
}
|
|
4976
|
+
|
|
2042
4977
|
const apiPath = '/messaging/topics/{topicId}/subscribers'.replace('{topicId}', topicId);
|
|
2043
4978
|
const payload: Payload = {};
|
|
2044
4979
|
if (typeof queries !== 'undefined') {
|
|
@@ -2047,6 +4982,9 @@ export class Messaging {
|
|
|
2047
4982
|
if (typeof search !== 'undefined') {
|
|
2048
4983
|
payload['search'] = search;
|
|
2049
4984
|
}
|
|
4985
|
+
if (typeof total !== 'undefined') {
|
|
4986
|
+
payload['total'] = total;
|
|
4987
|
+
}
|
|
2050
4988
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2051
4989
|
|
|
2052
4990
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -2059,16 +4997,48 @@ export class Messaging {
|
|
|
2059
4997
|
payload
|
|
2060
4998
|
);
|
|
2061
4999
|
}
|
|
5000
|
+
|
|
5001
|
+
/**
|
|
5002
|
+
* Create a new subscriber.
|
|
5003
|
+
*
|
|
5004
|
+
* @param {string} params.topicId - Topic ID. The topic ID to subscribe to.
|
|
5005
|
+
* @param {string} params.subscriberId - Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.
|
|
5006
|
+
* @param {string} params.targetId - Target ID. The target ID to link to the specified Topic ID.
|
|
5007
|
+
* @throws {AppwriteException}
|
|
5008
|
+
* @returns {Promise<Models.Subscriber>}
|
|
5009
|
+
*/
|
|
5010
|
+
createSubscriber(params: { topicId: string, subscriberId: string, targetId: string }): Promise<Models.Subscriber>;
|
|
2062
5011
|
/**
|
|
2063
5012
|
* Create a new subscriber.
|
|
2064
5013
|
*
|
|
2065
|
-
* @param {string} topicId
|
|
2066
|
-
* @param {string} subscriberId
|
|
2067
|
-
* @param {string} targetId
|
|
5014
|
+
* @param {string} topicId - Topic ID. The topic ID to subscribe to.
|
|
5015
|
+
* @param {string} subscriberId - Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.
|
|
5016
|
+
* @param {string} targetId - Target ID. The target ID to link to the specified Topic ID.
|
|
2068
5017
|
* @throws {AppwriteException}
|
|
2069
5018
|
* @returns {Promise<Models.Subscriber>}
|
|
5019
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2070
5020
|
*/
|
|
2071
|
-
createSubscriber(topicId: string, subscriberId: string, targetId: string): Promise<Models.Subscriber
|
|
5021
|
+
createSubscriber(topicId: string, subscriberId: string, targetId: string): Promise<Models.Subscriber>;
|
|
5022
|
+
createSubscriber(
|
|
5023
|
+
paramsOrFirst: { topicId: string, subscriberId: string, targetId: string } | string,
|
|
5024
|
+
...rest: [(string)?, (string)?]
|
|
5025
|
+
): Promise<Models.Subscriber> {
|
|
5026
|
+
let params: { topicId: string, subscriberId: string, targetId: string };
|
|
5027
|
+
|
|
5028
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
5029
|
+
params = (paramsOrFirst || {}) as { topicId: string, subscriberId: string, targetId: string };
|
|
5030
|
+
} else {
|
|
5031
|
+
params = {
|
|
5032
|
+
topicId: paramsOrFirst as string,
|
|
5033
|
+
subscriberId: rest[0] as string,
|
|
5034
|
+
targetId: rest[1] as string
|
|
5035
|
+
};
|
|
5036
|
+
}
|
|
5037
|
+
|
|
5038
|
+
const topicId = params.topicId;
|
|
5039
|
+
const subscriberId = params.subscriberId;
|
|
5040
|
+
const targetId = params.targetId;
|
|
5041
|
+
|
|
2072
5042
|
if (typeof topicId === 'undefined') {
|
|
2073
5043
|
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
2074
5044
|
}
|
|
@@ -2078,6 +5048,7 @@ export class Messaging {
|
|
|
2078
5048
|
if (typeof targetId === 'undefined') {
|
|
2079
5049
|
throw new AppwriteException('Missing required parameter: "targetId"');
|
|
2080
5050
|
}
|
|
5051
|
+
|
|
2081
5052
|
const apiPath = '/messaging/topics/{topicId}/subscribers'.replace('{topicId}', topicId);
|
|
2082
5053
|
const payload: Payload = {};
|
|
2083
5054
|
if (typeof subscriberId !== 'undefined') {
|
|
@@ -2099,22 +5070,53 @@ export class Messaging {
|
|
|
2099
5070
|
payload
|
|
2100
5071
|
);
|
|
2101
5072
|
}
|
|
5073
|
+
|
|
2102
5074
|
/**
|
|
2103
5075
|
* Get a subscriber by its unique ID.
|
|
2104
|
-
|
|
5076
|
+
*
|
|
5077
|
+
*
|
|
5078
|
+
* @param {string} params.topicId - Topic ID. The topic ID subscribed to.
|
|
5079
|
+
* @param {string} params.subscriberId - Subscriber ID.
|
|
5080
|
+
* @throws {AppwriteException}
|
|
5081
|
+
* @returns {Promise<Models.Subscriber>}
|
|
5082
|
+
*/
|
|
5083
|
+
getSubscriber(params: { topicId: string, subscriberId: string }): Promise<Models.Subscriber>;
|
|
5084
|
+
/**
|
|
5085
|
+
* Get a subscriber by its unique ID.
|
|
5086
|
+
*
|
|
2105
5087
|
*
|
|
2106
|
-
* @param {string} topicId
|
|
2107
|
-
* @param {string} subscriberId
|
|
5088
|
+
* @param {string} topicId - Topic ID. The topic ID subscribed to.
|
|
5089
|
+
* @param {string} subscriberId - Subscriber ID.
|
|
2108
5090
|
* @throws {AppwriteException}
|
|
2109
5091
|
* @returns {Promise<Models.Subscriber>}
|
|
5092
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2110
5093
|
*/
|
|
2111
|
-
getSubscriber(topicId: string, subscriberId: string): Promise<Models.Subscriber
|
|
5094
|
+
getSubscriber(topicId: string, subscriberId: string): Promise<Models.Subscriber>;
|
|
5095
|
+
getSubscriber(
|
|
5096
|
+
paramsOrFirst: { topicId: string, subscriberId: string } | string,
|
|
5097
|
+
...rest: [(string)?]
|
|
5098
|
+
): Promise<Models.Subscriber> {
|
|
5099
|
+
let params: { topicId: string, subscriberId: string };
|
|
5100
|
+
|
|
5101
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
5102
|
+
params = (paramsOrFirst || {}) as { topicId: string, subscriberId: string };
|
|
5103
|
+
} else {
|
|
5104
|
+
params = {
|
|
5105
|
+
topicId: paramsOrFirst as string,
|
|
5106
|
+
subscriberId: rest[0] as string
|
|
5107
|
+
};
|
|
5108
|
+
}
|
|
5109
|
+
|
|
5110
|
+
const topicId = params.topicId;
|
|
5111
|
+
const subscriberId = params.subscriberId;
|
|
5112
|
+
|
|
2112
5113
|
if (typeof topicId === 'undefined') {
|
|
2113
5114
|
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
2114
5115
|
}
|
|
2115
5116
|
if (typeof subscriberId === 'undefined') {
|
|
2116
5117
|
throw new AppwriteException('Missing required parameter: "subscriberId"');
|
|
2117
5118
|
}
|
|
5119
|
+
|
|
2118
5120
|
const apiPath = '/messaging/topics/{topicId}/subscribers/{subscriberId}'.replace('{topicId}', topicId).replace('{subscriberId}', subscriberId);
|
|
2119
5121
|
const payload: Payload = {};
|
|
2120
5122
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -2129,21 +5131,51 @@ export class Messaging {
|
|
|
2129
5131
|
payload
|
|
2130
5132
|
);
|
|
2131
5133
|
}
|
|
5134
|
+
|
|
2132
5135
|
/**
|
|
2133
5136
|
* Delete a subscriber by its unique ID.
|
|
2134
5137
|
*
|
|
2135
|
-
* @param {string} topicId
|
|
2136
|
-
* @param {string} subscriberId
|
|
5138
|
+
* @param {string} params.topicId - Topic ID. The topic ID subscribed to.
|
|
5139
|
+
* @param {string} params.subscriberId - Subscriber ID.
|
|
2137
5140
|
* @throws {AppwriteException}
|
|
2138
5141
|
* @returns {Promise<{}>}
|
|
2139
5142
|
*/
|
|
2140
|
-
deleteSubscriber(topicId: string, subscriberId: string): Promise<{}
|
|
5143
|
+
deleteSubscriber(params: { topicId: string, subscriberId: string }): Promise<{}>;
|
|
5144
|
+
/**
|
|
5145
|
+
* Delete a subscriber by its unique ID.
|
|
5146
|
+
*
|
|
5147
|
+
* @param {string} topicId - Topic ID. The topic ID subscribed to.
|
|
5148
|
+
* @param {string} subscriberId - Subscriber ID.
|
|
5149
|
+
* @throws {AppwriteException}
|
|
5150
|
+
* @returns {Promise<{}>}
|
|
5151
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
5152
|
+
*/
|
|
5153
|
+
deleteSubscriber(topicId: string, subscriberId: string): Promise<{}>;
|
|
5154
|
+
deleteSubscriber(
|
|
5155
|
+
paramsOrFirst: { topicId: string, subscriberId: string } | string,
|
|
5156
|
+
...rest: [(string)?]
|
|
5157
|
+
): Promise<{}> {
|
|
5158
|
+
let params: { topicId: string, subscriberId: string };
|
|
5159
|
+
|
|
5160
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
5161
|
+
params = (paramsOrFirst || {}) as { topicId: string, subscriberId: string };
|
|
5162
|
+
} else {
|
|
5163
|
+
params = {
|
|
5164
|
+
topicId: paramsOrFirst as string,
|
|
5165
|
+
subscriberId: rest[0] as string
|
|
5166
|
+
};
|
|
5167
|
+
}
|
|
5168
|
+
|
|
5169
|
+
const topicId = params.topicId;
|
|
5170
|
+
const subscriberId = params.subscriberId;
|
|
5171
|
+
|
|
2141
5172
|
if (typeof topicId === 'undefined') {
|
|
2142
5173
|
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
2143
5174
|
}
|
|
2144
5175
|
if (typeof subscriberId === 'undefined') {
|
|
2145
5176
|
throw new AppwriteException('Missing required parameter: "subscriberId"');
|
|
2146
5177
|
}
|
|
5178
|
+
|
|
2147
5179
|
const apiPath = '/messaging/topics/{topicId}/subscribers/{subscriberId}'.replace('{topicId}', topicId).replace('{subscriberId}', subscriberId);
|
|
2148
5180
|
const payload: Payload = {};
|
|
2149
5181
|
const uri = new URL(this.client.config.endpoint + apiPath);
|