@appwrite.io/console 1.10.0 → 2.1.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 +10 -0
- package/LICENSE +1 -1
- package/README.md +4 -4
- package/dist/cjs/sdk.js +15258 -6062
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +15256 -6063
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +15258 -6062
- 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 +15 -8
- package/docs/examples/databases/create-documents.md +6 -5
- 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 +3 -3
- 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 +4 -4
- 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 -6
- 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 +71 -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 +1692 -238
- package/src/operator.ts +308 -0
- package/src/query.ts +246 -2
- package/src/services/account.ts +2205 -223
- package/src/services/assistant.ts +29 -3
- package/src/services/avatars.ts +486 -33
- package/src/services/backups.ts +389 -42
- package/src/services/console.ts +492 -19
- package/src/services/databases.ts +3521 -431
- package/src/services/domains.ts +1684 -197
- package/src/services/functions.ts +1162 -149
- package/src/services/graphql.ts +55 -4
- package/src/services/health.ts +560 -41
- package/src/services/locale.ts +9 -0
- package/src/services/messaging.ts +3367 -380
- package/src/services/migrations.ts +641 -65
- package/src/services/organizations.ts +1323 -128
- package/src/services/project.ts +168 -17
- package/src/services/projects.ts +2742 -266
- package/src/services/proxy.ts +265 -26
- package/src/services/realtime.ts +437 -0
- package/src/services/sites.ts +1098 -140
- package/src/services/storage.ts +651 -82
- package/src/services/tables-db.ts +5439 -0
- package/src/services/teams.ts +512 -55
- package/src/services/tokens.ts +167 -16
- package/src/services/users.ts +1873 -181
- package/src/services/vcs.ts +359 -39
- package/types/client.d.ts +33 -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 +1664 -245
- package/types/operator.d.ts +180 -0
- package/types/query.d.ts +198 -2
- package/types/services/account.d.ts +985 -123
- package/types/services/assistant.d.ts +13 -2
- package/types/services/avatars.d.ts +244 -26
- package/types/services/backups.d.ts +190 -30
- package/types/services/console.d.ts +201 -14
- package/types/services/databases.d.ts +1731 -284
- package/types/services/domains.d.ts +904 -152
- package/types/services/functions.d.ts +616 -125
- package/types/services/graphql.d.ts +24 -2
- package/types/services/health.d.ts +245 -23
- package/types/services/messaging.d.ts +1660 -271
- package/types/services/migrations.d.ts +319 -53
- package/types/services/organizations.d.ts +635 -97
- 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 +577 -116
- package/types/services/storage.d.ts +354 -73
- package/types/services/tables-db.d.ts +2040 -0
- package/types/services/teams.d.ts +260 -44
- package/types/services/tokens.d.ts +80 -12
- package/types/services/users.d.ts +881 -124
- package/types/services/vcs.d.ts +179 -31
- 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 } = {
|
|
@@ -44,22 +81,80 @@ export class Messaging {
|
|
|
44
81
|
/**
|
|
45
82
|
* Create a new email message.
|
|
46
83
|
*
|
|
47
|
-
* @param {string} messageId
|
|
48
|
-
* @param {string} subject
|
|
49
|
-
* @param {string} content
|
|
50
|
-
* @param {string[]} topics
|
|
51
|
-
* @param {string[]} users
|
|
52
|
-
* @param {string[]} targets
|
|
53
|
-
* @param {string[]} cc
|
|
54
|
-
* @param {string[]} bcc
|
|
55
|
-
* @param {string[]} attachments
|
|
56
|
-
* @param {boolean} draft
|
|
57
|
-
* @param {boolean} html
|
|
58
|
-
* @param {string} scheduledAt
|
|
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>;
|
|
100
|
+
/**
|
|
101
|
+
* Create a new email message.
|
|
102
|
+
*
|
|
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.
|
|
59
115
|
* @throws {AppwriteException}
|
|
60
116
|
* @returns {Promise<Models.Message>}
|
|
117
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
61
118
|
*/
|
|
62
|
-
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
|
+
|
|
63
158
|
if (typeof messageId === 'undefined') {
|
|
64
159
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
65
160
|
}
|
|
@@ -69,6 +164,7 @@ export class Messaging {
|
|
|
69
164
|
if (typeof content === 'undefined') {
|
|
70
165
|
throw new AppwriteException('Missing required parameter: "content"');
|
|
71
166
|
}
|
|
167
|
+
|
|
72
168
|
const apiPath = '/messaging/messages/email';
|
|
73
169
|
const payload: Payload = {};
|
|
74
170
|
if (typeof messageId !== 'undefined') {
|
|
@@ -125,25 +221,85 @@ export class Messaging {
|
|
|
125
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.
|
|
126
222
|
*
|
|
127
223
|
*
|
|
128
|
-
* @param {string} messageId
|
|
129
|
-
* @param {string[]} topics
|
|
130
|
-
* @param {string[]} users
|
|
131
|
-
* @param {string[]} targets
|
|
132
|
-
* @param {string} subject
|
|
133
|
-
* @param {string} content
|
|
134
|
-
* @param {boolean} draft
|
|
135
|
-
* @param {boolean} html
|
|
136
|
-
* @param {string[]} cc
|
|
137
|
-
* @param {string[]} bcc
|
|
138
|
-
* @param {string} scheduledAt
|
|
139
|
-
* @param {string[]} attachments
|
|
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
|
+
*
|
|
243
|
+
*
|
|
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>.
|
|
140
256
|
* @throws {AppwriteException}
|
|
141
257
|
* @returns {Promise<Models.Message>}
|
|
258
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
142
259
|
*/
|
|
143
|
-
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
|
+
|
|
144
299
|
if (typeof messageId === 'undefined') {
|
|
145
300
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
146
301
|
}
|
|
302
|
+
|
|
147
303
|
const apiPath = '/messaging/messages/email/{messageId}'.replace('{messageId}', messageId);
|
|
148
304
|
const payload: Payload = {};
|
|
149
305
|
if (typeof topics !== 'undefined') {
|
|
@@ -196,32 +352,112 @@ export class Messaging {
|
|
|
196
352
|
/**
|
|
197
353
|
* Create a new push notification.
|
|
198
354
|
*
|
|
199
|
-
* @param {string} messageId
|
|
200
|
-
* @param {string} title
|
|
201
|
-
* @param {string} body
|
|
202
|
-
* @param {string[]} topics
|
|
203
|
-
* @param {string[]} users
|
|
204
|
-
* @param {string[]} targets
|
|
205
|
-
* @param {object} data
|
|
206
|
-
* @param {string} action
|
|
207
|
-
* @param {string} image
|
|
208
|
-
* @param {string} icon
|
|
209
|
-
* @param {string} sound
|
|
210
|
-
* @param {string} color
|
|
211
|
-
* @param {string} tag
|
|
212
|
-
* @param {number} badge
|
|
213
|
-
* @param {boolean} draft
|
|
214
|
-
* @param {string} scheduledAt
|
|
215
|
-
* @param {boolean} contentAvailable
|
|
216
|
-
* @param {boolean} critical
|
|
217
|
-
* @param {MessagePriority} priority
|
|
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>;
|
|
378
|
+
/**
|
|
379
|
+
* Create a new push notification.
|
|
380
|
+
*
|
|
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.
|
|
218
400
|
* @throws {AppwriteException}
|
|
219
401
|
* @returns {Promise<Models.Message>}
|
|
402
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
220
403
|
*/
|
|
221
|
-
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
|
+
|
|
222
457
|
if (typeof messageId === 'undefined') {
|
|
223
458
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
224
459
|
}
|
|
460
|
+
|
|
225
461
|
const apiPath = '/messaging/messages/push';
|
|
226
462
|
const payload: Payload = {};
|
|
227
463
|
if (typeof messageId !== 'undefined') {
|
|
@@ -299,32 +535,113 @@ export class Messaging {
|
|
|
299
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.
|
|
300
536
|
*
|
|
301
537
|
*
|
|
302
|
-
* @param {string} messageId
|
|
303
|
-
* @param {string[]} topics
|
|
304
|
-
* @param {string[]} users
|
|
305
|
-
* @param {string[]} targets
|
|
306
|
-
* @param {string} title
|
|
307
|
-
* @param {string} body
|
|
308
|
-
* @param {object} data
|
|
309
|
-
* @param {string} action
|
|
310
|
-
* @param {string} image
|
|
311
|
-
* @param {string} icon
|
|
312
|
-
* @param {string} sound
|
|
313
|
-
* @param {string} color
|
|
314
|
-
* @param {string} tag
|
|
315
|
-
* @param {number} badge
|
|
316
|
-
* @param {boolean} draft
|
|
317
|
-
* @param {string} scheduledAt
|
|
318
|
-
* @param {boolean} contentAvailable
|
|
319
|
-
* @param {boolean} critical
|
|
320
|
-
* @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.
|
|
557
|
+
* @throws {AppwriteException}
|
|
558
|
+
* @returns {Promise<Models.Message>}
|
|
559
|
+
*/
|
|
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.
|
|
321
584
|
* @throws {AppwriteException}
|
|
322
585
|
* @returns {Promise<Models.Message>}
|
|
586
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
323
587
|
*/
|
|
324
|
-
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
|
|
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
|
+
|
|
325
641
|
if (typeof messageId === 'undefined') {
|
|
326
642
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
327
643
|
}
|
|
644
|
+
|
|
328
645
|
const apiPath = '/messaging/messages/push/{messageId}'.replace('{messageId}', messageId);
|
|
329
646
|
const payload: Payload = {};
|
|
330
647
|
if (typeof topics !== 'undefined') {
|
|
@@ -398,23 +715,169 @@ export class Messaging {
|
|
|
398
715
|
/**
|
|
399
716
|
* Create a new SMS message.
|
|
400
717
|
*
|
|
401
|
-
* @param {string} messageId
|
|
402
|
-
* @param {string} content
|
|
403
|
-
* @param {string[]} topics
|
|
404
|
-
* @param {string[]} users
|
|
405
|
-
* @param {string[]} targets
|
|
406
|
-
* @param {boolean} draft
|
|
407
|
-
* @param {string} scheduledAt
|
|
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>;
|
|
831
|
+
/**
|
|
832
|
+
* Create a new SMS message.
|
|
833
|
+
*
|
|
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.
|
|
408
841
|
* @throws {AppwriteException}
|
|
409
842
|
* @returns {Promise<Models.Message>}
|
|
843
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
410
844
|
*/
|
|
411
|
-
|
|
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
|
+
|
|
412
874
|
if (typeof messageId === 'undefined') {
|
|
413
875
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
414
876
|
}
|
|
415
877
|
if (typeof content === 'undefined') {
|
|
416
878
|
throw new AppwriteException('Missing required parameter: "content"');
|
|
417
879
|
}
|
|
880
|
+
|
|
418
881
|
const apiPath = '/messaging/messages/sms';
|
|
419
882
|
const payload: Payload = {};
|
|
420
883
|
if (typeof messageId !== 'undefined') {
|
|
@@ -456,20 +919,163 @@ export class Messaging {
|
|
|
456
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.
|
|
457
920
|
*
|
|
458
921
|
*
|
|
459
|
-
* @param {string} messageId
|
|
460
|
-
* @param {string[]} topics
|
|
461
|
-
* @param {string[]} users
|
|
462
|
-
* @param {string[]} targets
|
|
463
|
-
* @param {string} content
|
|
464
|
-
* @param {boolean} draft
|
|
465
|
-
* @param {string} scheduledAt
|
|
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>;
|
|
934
|
+
/**
|
|
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
|
+
}
|
|
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
|
+
*
|
|
1034
|
+
*
|
|
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.
|
|
466
1042
|
* @throws {AppwriteException}
|
|
467
1043
|
* @returns {Promise<Models.Message>}
|
|
1044
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
468
1045
|
*/
|
|
469
|
-
|
|
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
|
+
|
|
470
1075
|
if (typeof messageId === 'undefined') {
|
|
471
1076
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
472
1077
|
}
|
|
1078
|
+
|
|
473
1079
|
const apiPath = '/messaging/messages/sms/{messageId}'.replace('{messageId}', messageId);
|
|
474
1080
|
const payload: Payload = {};
|
|
475
1081
|
if (typeof topics !== 'undefined') {
|
|
@@ -508,14 +1114,40 @@ export class Messaging {
|
|
|
508
1114
|
* Get a message by its unique ID.
|
|
509
1115
|
*
|
|
510
1116
|
*
|
|
511
|
-
* @param {string} messageId
|
|
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
|
+
*
|
|
1125
|
+
*
|
|
1126
|
+
* @param {string} messageId - Message ID.
|
|
512
1127
|
* @throws {AppwriteException}
|
|
513
1128
|
* @returns {Promise<Models.Message>}
|
|
1129
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
514
1130
|
*/
|
|
515
|
-
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
|
+
|
|
516
1147
|
if (typeof messageId === 'undefined') {
|
|
517
1148
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
518
1149
|
}
|
|
1150
|
+
|
|
519
1151
|
const apiPath = '/messaging/messages/{messageId}'.replace('{messageId}', messageId);
|
|
520
1152
|
const payload: Payload = {};
|
|
521
1153
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -534,14 +1166,39 @@ export class Messaging {
|
|
|
534
1166
|
/**
|
|
535
1167
|
* Delete a message. If the message is not a draft or scheduled, but has been sent, this will not recall the message.
|
|
536
1168
|
*
|
|
537
|
-
* @param {string} messageId
|
|
1169
|
+
* @param {string} params.messageId - Message ID.
|
|
1170
|
+
* @throws {AppwriteException}
|
|
1171
|
+
* @returns {Promise<{}>}
|
|
1172
|
+
*/
|
|
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.
|
|
538
1178
|
* @throws {AppwriteException}
|
|
539
1179
|
* @returns {Promise<{}>}
|
|
1180
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
540
1181
|
*/
|
|
541
|
-
delete(messageId: string): Promise<{}
|
|
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
|
+
|
|
542
1198
|
if (typeof messageId === 'undefined') {
|
|
543
1199
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
544
1200
|
}
|
|
1201
|
+
|
|
545
1202
|
const apiPath = '/messaging/messages/{messageId}'.replace('{messageId}', messageId);
|
|
546
1203
|
const payload: Payload = {};
|
|
547
1204
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -561,20 +1218,56 @@ export class Messaging {
|
|
|
561
1218
|
/**
|
|
562
1219
|
* Get the message activity logs listed by its unique ID.
|
|
563
1220
|
*
|
|
564
|
-
* @param {string} messageId
|
|
565
|
-
* @param {string[]} queries
|
|
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>;
|
|
1228
|
+
/**
|
|
1229
|
+
* Get the message activity logs listed by its unique ID.
|
|
1230
|
+
*
|
|
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.
|
|
566
1234
|
* @throws {AppwriteException}
|
|
567
1235
|
* @returns {Promise<Models.LogList>}
|
|
1236
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
568
1237
|
*/
|
|
569
|
-
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
|
+
|
|
570
1259
|
if (typeof messageId === 'undefined') {
|
|
571
1260
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
572
1261
|
}
|
|
1262
|
+
|
|
573
1263
|
const apiPath = '/messaging/messages/{messageId}/logs'.replace('{messageId}', messageId);
|
|
574
1264
|
const payload: Payload = {};
|
|
575
1265
|
if (typeof queries !== 'undefined') {
|
|
576
1266
|
payload['queries'] = queries;
|
|
577
1267
|
}
|
|
1268
|
+
if (typeof total !== 'undefined') {
|
|
1269
|
+
payload['total'] = total;
|
|
1270
|
+
}
|
|
578
1271
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
579
1272
|
|
|
580
1273
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -591,20 +1284,56 @@ export class Messaging {
|
|
|
591
1284
|
/**
|
|
592
1285
|
* Get a list of the targets associated with a message.
|
|
593
1286
|
*
|
|
594
|
-
* @param {string} messageId
|
|
595
|
-
* @param {string[]} queries
|
|
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>;
|
|
1294
|
+
/**
|
|
1295
|
+
* Get a list of the targets associated with a message.
|
|
1296
|
+
*
|
|
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.
|
|
596
1300
|
* @throws {AppwriteException}
|
|
597
1301
|
* @returns {Promise<Models.TargetList>}
|
|
1302
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
598
1303
|
*/
|
|
599
|
-
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
|
+
|
|
600
1325
|
if (typeof messageId === 'undefined') {
|
|
601
1326
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
602
1327
|
}
|
|
1328
|
+
|
|
603
1329
|
const apiPath = '/messaging/messages/{messageId}/targets'.replace('{messageId}', messageId);
|
|
604
1330
|
const payload: Payload = {};
|
|
605
1331
|
if (typeof queries !== 'undefined') {
|
|
606
1332
|
payload['queries'] = queries;
|
|
607
1333
|
}
|
|
1334
|
+
if (typeof total !== 'undefined') {
|
|
1335
|
+
payload['total'] = total;
|
|
1336
|
+
}
|
|
608
1337
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
609
1338
|
|
|
610
1339
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -621,12 +1350,45 @@ export class Messaging {
|
|
|
621
1350
|
/**
|
|
622
1351
|
* Get a list of all providers from the current Appwrite project.
|
|
623
1352
|
*
|
|
624
|
-
* @param {string[]} queries
|
|
625
|
-
* @param {string} search
|
|
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>;
|
|
1360
|
+
/**
|
|
1361
|
+
* Get a list of all providers from the current Appwrite project.
|
|
1362
|
+
*
|
|
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.
|
|
626
1366
|
* @throws {AppwriteException}
|
|
627
1367
|
* @returns {Promise<Models.ProviderList>}
|
|
1368
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
628
1369
|
*/
|
|
629
|
-
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
|
+
|
|
630
1392
|
const apiPath = '/messaging/providers';
|
|
631
1393
|
const payload: Payload = {};
|
|
632
1394
|
if (typeof queries !== 'undefined') {
|
|
@@ -635,6 +1397,9 @@ export class Messaging {
|
|
|
635
1397
|
if (typeof search !== 'undefined') {
|
|
636
1398
|
payload['search'] = search;
|
|
637
1399
|
}
|
|
1400
|
+
if (typeof total !== 'undefined') {
|
|
1401
|
+
payload['total'] = total;
|
|
1402
|
+
}
|
|
638
1403
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
639
1404
|
|
|
640
1405
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -651,24 +1416,72 @@ export class Messaging {
|
|
|
651
1416
|
/**
|
|
652
1417
|
* Create a new Apple Push Notification service provider.
|
|
653
1418
|
*
|
|
654
|
-
* @param {string} providerId
|
|
655
|
-
* @param {string} name
|
|
656
|
-
* @param {string} authKey
|
|
657
|
-
* @param {string} authKeyId
|
|
658
|
-
* @param {string} teamId
|
|
659
|
-
* @param {string} bundleId
|
|
660
|
-
* @param {boolean} sandbox
|
|
661
|
-
* @param {boolean} enabled
|
|
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>;
|
|
1432
|
+
/**
|
|
1433
|
+
* Create a new Apple Push Notification service provider.
|
|
1434
|
+
*
|
|
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.
|
|
662
1443
|
* @throws {AppwriteException}
|
|
663
1444
|
* @returns {Promise<Models.Provider>}
|
|
1445
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
664
1446
|
*/
|
|
665
|
-
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
|
+
|
|
666
1478
|
if (typeof providerId === 'undefined') {
|
|
667
1479
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
668
1480
|
}
|
|
669
1481
|
if (typeof name === 'undefined') {
|
|
670
1482
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
671
1483
|
}
|
|
1484
|
+
|
|
672
1485
|
const apiPath = '/messaging/providers/apns';
|
|
673
1486
|
const payload: Payload = {};
|
|
674
1487
|
if (typeof providerId !== 'undefined') {
|
|
@@ -710,31 +1523,81 @@ export class Messaging {
|
|
|
710
1523
|
}
|
|
711
1524
|
|
|
712
1525
|
/**
|
|
713
|
-
*
|
|
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.
|
|
714
1542
|
*
|
|
715
|
-
* @param {string} providerId
|
|
716
|
-
* @param {string} name
|
|
717
|
-
* @param {
|
|
718
|
-
* @param {string}
|
|
719
|
-
* @param {string}
|
|
720
|
-
* @param {string}
|
|
721
|
-
* @param {
|
|
722
|
-
* @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.
|
|
723
1551
|
* @throws {AppwriteException}
|
|
724
1552
|
* @returns {Promise<Models.Provider>}
|
|
1553
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
725
1554
|
*/
|
|
726
|
-
|
|
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
|
+
|
|
727
1586
|
if (typeof providerId === 'undefined') {
|
|
728
1587
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
729
1588
|
}
|
|
730
|
-
|
|
1589
|
+
if (typeof name === 'undefined') {
|
|
1590
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
const apiPath = '/messaging/providers/apns';
|
|
731
1594
|
const payload: Payload = {};
|
|
1595
|
+
if (typeof providerId !== 'undefined') {
|
|
1596
|
+
payload['providerId'] = providerId;
|
|
1597
|
+
}
|
|
732
1598
|
if (typeof name !== 'undefined') {
|
|
733
1599
|
payload['name'] = name;
|
|
734
1600
|
}
|
|
735
|
-
if (typeof enabled !== 'undefined') {
|
|
736
|
-
payload['enabled'] = enabled;
|
|
737
|
-
}
|
|
738
1601
|
if (typeof authKey !== 'undefined') {
|
|
739
1602
|
payload['authKey'] = authKey;
|
|
740
1603
|
}
|
|
@@ -750,6 +1613,9 @@ export class Messaging {
|
|
|
750
1613
|
if (typeof sandbox !== 'undefined') {
|
|
751
1614
|
payload['sandbox'] = sandbox;
|
|
752
1615
|
}
|
|
1616
|
+
if (typeof enabled !== 'undefined') {
|
|
1617
|
+
payload['enabled'] = enabled;
|
|
1618
|
+
}
|
|
753
1619
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
754
1620
|
|
|
755
1621
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -757,7 +1623,7 @@ export class Messaging {
|
|
|
757
1623
|
}
|
|
758
1624
|
|
|
759
1625
|
return this.client.call(
|
|
760
|
-
'
|
|
1626
|
+
'post',
|
|
761
1627
|
uri,
|
|
762
1628
|
apiHeaders,
|
|
763
1629
|
payload
|
|
@@ -765,22 +1631,343 @@ export class Messaging {
|
|
|
765
1631
|
}
|
|
766
1632
|
|
|
767
1633
|
/**
|
|
768
|
-
*
|
|
1634
|
+
* Update a Apple Push Notification service provider by its unique ID.
|
|
769
1635
|
*
|
|
770
|
-
* @param {string} providerId
|
|
771
|
-
* @param {string} name
|
|
772
|
-
* @param {
|
|
773
|
-
* @param {
|
|
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.
|
|
774
1644
|
* @throws {AppwriteException}
|
|
775
1645
|
* @returns {Promise<Models.Provider>}
|
|
1646
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `Messaging.updateAPNSProvider` instead.
|
|
776
1647
|
*/
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
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"');
|
|
783
1969
|
}
|
|
1970
|
+
|
|
784
1971
|
const apiPath = '/messaging/providers/fcm';
|
|
785
1972
|
const payload: Payload = {};
|
|
786
1973
|
if (typeof providerId !== 'undefined') {
|
|
@@ -812,17 +1999,127 @@ export class Messaging {
|
|
|
812
1999
|
/**
|
|
813
2000
|
* Update a Firebase Cloud Messaging provider by its unique ID.
|
|
814
2001
|
*
|
|
815
|
-
* @param {string} providerId
|
|
816
|
-
* @param {string} name
|
|
817
|
-
* @param {boolean} enabled
|
|
818
|
-
* @param {object} serviceAccountJSON
|
|
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.
|
|
819
2092
|
* @throws {AppwriteException}
|
|
820
2093
|
* @returns {Promise<Models.Provider>}
|
|
2094
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
821
2095
|
*/
|
|
822
|
-
|
|
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
|
+
|
|
823
2119
|
if (typeof providerId === 'undefined') {
|
|
824
2120
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
825
2121
|
}
|
|
2122
|
+
|
|
826
2123
|
const apiPath = '/messaging/providers/fcm/{providerId}'.replace('{providerId}', providerId);
|
|
827
2124
|
const payload: Payload = {};
|
|
828
2125
|
if (typeof name !== 'undefined') {
|
|
@@ -851,26 +2148,79 @@ export class Messaging {
|
|
|
851
2148
|
/**
|
|
852
2149
|
* Create a new Mailgun provider.
|
|
853
2150
|
*
|
|
854
|
-
* @param {string} providerId
|
|
855
|
-
* @param {string} name
|
|
856
|
-
* @param {string} apiKey
|
|
857
|
-
* @param {string} domain
|
|
858
|
-
* @param {boolean} isEuRegion
|
|
859
|
-
* @param {string} fromName
|
|
860
|
-
* @param {string} fromEmail
|
|
861
|
-
* @param {string} replyToName
|
|
862
|
-
* @param {string} replyToEmail
|
|
863
|
-
* @param {boolean} enabled
|
|
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.
|
|
864
2178
|
* @throws {AppwriteException}
|
|
865
2179
|
* @returns {Promise<Models.Provider>}
|
|
2180
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
866
2181
|
*/
|
|
867
|
-
createMailgunProvider(providerId: string, name: string, apiKey?: string, domain?: string, isEuRegion?: boolean, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise<Models.Provider
|
|
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
|
+
|
|
868
2217
|
if (typeof providerId === 'undefined') {
|
|
869
2218
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
870
2219
|
}
|
|
871
2220
|
if (typeof name === 'undefined') {
|
|
872
2221
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
873
2222
|
}
|
|
2223
|
+
|
|
874
2224
|
const apiPath = '/messaging/providers/mailgun';
|
|
875
2225
|
const payload: Payload = {};
|
|
876
2226
|
if (typeof providerId !== 'undefined') {
|
|
@@ -920,23 +2270,76 @@ export class Messaging {
|
|
|
920
2270
|
/**
|
|
921
2271
|
* Update a Mailgun provider by its unique ID.
|
|
922
2272
|
*
|
|
923
|
-
* @param {string} providerId
|
|
924
|
-
* @param {string} name
|
|
925
|
-
* @param {string} apiKey
|
|
926
|
-
* @param {string} domain
|
|
927
|
-
* @param {boolean} isEuRegion
|
|
928
|
-
* @param {boolean} enabled
|
|
929
|
-
* @param {string} fromName
|
|
930
|
-
* @param {string} fromEmail
|
|
931
|
-
* @param {string} replyToName
|
|
932
|
-
* @param {string} replyToEmail
|
|
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.
|
|
933
2300
|
* @throws {AppwriteException}
|
|
934
2301
|
* @returns {Promise<Models.Provider>}
|
|
2302
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
935
2303
|
*/
|
|
936
|
-
updateMailgunProvider(providerId: string, name?: string, apiKey?: string, domain?: string, isEuRegion?: boolean, enabled?: boolean, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string): Promise<Models.Provider
|
|
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
|
+
|
|
937
2339
|
if (typeof providerId === 'undefined') {
|
|
938
2340
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
939
2341
|
}
|
|
2342
|
+
|
|
940
2343
|
const apiPath = '/messaging/providers/mailgun/{providerId}'.replace('{providerId}', providerId);
|
|
941
2344
|
const payload: Payload = {};
|
|
942
2345
|
if (typeof name !== 'undefined') {
|
|
@@ -983,22 +2386,63 @@ export class Messaging {
|
|
|
983
2386
|
/**
|
|
984
2387
|
* Create a new MSG91 provider.
|
|
985
2388
|
*
|
|
986
|
-
* @param {string} providerId
|
|
987
|
-
* @param {string} name
|
|
988
|
-
* @param {string} templateId
|
|
989
|
-
* @param {string} senderId
|
|
990
|
-
* @param {string} authKey
|
|
991
|
-
* @param {boolean} enabled
|
|
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.
|
|
2401
|
+
*
|
|
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.
|
|
992
2408
|
* @throws {AppwriteException}
|
|
993
2409
|
* @returns {Promise<Models.Provider>}
|
|
2410
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
994
2411
|
*/
|
|
995
|
-
createMsg91Provider(providerId: string, name: string, templateId?: string, senderId?: string, authKey?: string, enabled?: boolean): Promise<Models.Provider
|
|
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
|
+
|
|
996
2439
|
if (typeof providerId === 'undefined') {
|
|
997
2440
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
998
2441
|
}
|
|
999
2442
|
if (typeof name === 'undefined') {
|
|
1000
2443
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
1001
2444
|
}
|
|
2445
|
+
|
|
1002
2446
|
const apiPath = '/messaging/providers/msg91';
|
|
1003
2447
|
const payload: Payload = {};
|
|
1004
2448
|
if (typeof providerId !== 'undefined') {
|
|
@@ -1036,19 +2480,60 @@ export class Messaging {
|
|
|
1036
2480
|
/**
|
|
1037
2481
|
* Update a MSG91 provider by its unique ID.
|
|
1038
2482
|
*
|
|
1039
|
-
* @param {string} providerId
|
|
1040
|
-
* @param {string} name
|
|
1041
|
-
* @param {boolean} enabled
|
|
1042
|
-
* @param {string} templateId
|
|
1043
|
-
* @param {string} senderId
|
|
1044
|
-
* @param {string} authKey
|
|
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.
|
|
2489
|
+
* @throws {AppwriteException}
|
|
2490
|
+
* @returns {Promise<Models.Provider>}
|
|
2491
|
+
*/
|
|
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.
|
|
1045
2502
|
* @throws {AppwriteException}
|
|
1046
2503
|
* @returns {Promise<Models.Provider>}
|
|
2504
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1047
2505
|
*/
|
|
1048
|
-
updateMsg91Provider(providerId: string, name?: string, enabled?: boolean, templateId?: string, senderId?: string, authKey?: string): Promise<Models.Provider
|
|
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
|
+
|
|
1049
2533
|
if (typeof providerId === 'undefined') {
|
|
1050
2534
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1051
2535
|
}
|
|
2536
|
+
|
|
1052
2537
|
const apiPath = '/messaging/providers/msg91/{providerId}'.replace('{providerId}', providerId);
|
|
1053
2538
|
const payload: Payload = {};
|
|
1054
2539
|
if (typeof name !== 'undefined') {
|
|
@@ -1081,26 +2566,283 @@ export class Messaging {
|
|
|
1081
2566
|
}
|
|
1082
2567
|
|
|
1083
2568
|
/**
|
|
1084
|
-
* Create a new
|
|
2569
|
+
* Create a new Resend provider.
|
|
1085
2570
|
*
|
|
1086
|
-
* @param {string} providerId
|
|
1087
|
-
* @param {string} name
|
|
1088
|
-
* @param {string} apiKey
|
|
1089
|
-
* @param {string} fromName
|
|
1090
|
-
* @param {string} fromEmail
|
|
1091
|
-
* @param {string} replyToName
|
|
1092
|
-
* @param {string} replyToEmail
|
|
1093
|
-
* @param {boolean} enabled
|
|
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.
|
|
1094
2579
|
* @throws {AppwriteException}
|
|
1095
2580
|
* @returns {Promise<Models.Provider>}
|
|
1096
2581
|
*/
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
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.
|
|
2585
|
+
*
|
|
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.
|
|
2594
|
+
* @throws {AppwriteException}
|
|
2595
|
+
* @returns {Promise<Models.Provider>}
|
|
2596
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2597
|
+
*/
|
|
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
|
+
|
|
2629
|
+
if (typeof providerId === 'undefined') {
|
|
2630
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
2631
|
+
}
|
|
2632
|
+
if (typeof name === 'undefined') {
|
|
1102
2633
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
1103
2634
|
}
|
|
2635
|
+
|
|
2636
|
+
const apiPath = '/messaging/providers/resend';
|
|
2637
|
+
const payload: Payload = {};
|
|
2638
|
+
if (typeof providerId !== 'undefined') {
|
|
2639
|
+
payload['providerId'] = providerId;
|
|
2640
|
+
}
|
|
2641
|
+
if (typeof name !== 'undefined') {
|
|
2642
|
+
payload['name'] = name;
|
|
2643
|
+
}
|
|
2644
|
+
if (typeof apiKey !== 'undefined') {
|
|
2645
|
+
payload['apiKey'] = apiKey;
|
|
2646
|
+
}
|
|
2647
|
+
if (typeof fromName !== 'undefined') {
|
|
2648
|
+
payload['fromName'] = fromName;
|
|
2649
|
+
}
|
|
2650
|
+
if (typeof fromEmail !== 'undefined') {
|
|
2651
|
+
payload['fromEmail'] = fromEmail;
|
|
2652
|
+
}
|
|
2653
|
+
if (typeof replyToName !== 'undefined') {
|
|
2654
|
+
payload['replyToName'] = replyToName;
|
|
2655
|
+
}
|
|
2656
|
+
if (typeof replyToEmail !== 'undefined') {
|
|
2657
|
+
payload['replyToEmail'] = replyToEmail;
|
|
2658
|
+
}
|
|
2659
|
+
if (typeof enabled !== 'undefined') {
|
|
2660
|
+
payload['enabled'] = enabled;
|
|
2661
|
+
}
|
|
2662
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2663
|
+
|
|
2664
|
+
const apiHeaders: { [header: string]: string } = {
|
|
2665
|
+
'content-type': 'application/json',
|
|
2666
|
+
}
|
|
2667
|
+
|
|
2668
|
+
return this.client.call(
|
|
2669
|
+
'post',
|
|
2670
|
+
uri,
|
|
2671
|
+
apiHeaders,
|
|
2672
|
+
payload
|
|
2673
|
+
);
|
|
2674
|
+
}
|
|
2675
|
+
|
|
2676
|
+
/**
|
|
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.
|
|
2693
|
+
*
|
|
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.
|
|
2702
|
+
* @throws {AppwriteException}
|
|
2703
|
+
* @returns {Promise<Models.Provider>}
|
|
2704
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2705
|
+
*/
|
|
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
|
+
|
|
2737
|
+
if (typeof providerId === 'undefined') {
|
|
2738
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
2739
|
+
}
|
|
2740
|
+
|
|
2741
|
+
const apiPath = '/messaging/providers/resend/{providerId}'.replace('{providerId}', providerId);
|
|
2742
|
+
const payload: Payload = {};
|
|
2743
|
+
if (typeof name !== 'undefined') {
|
|
2744
|
+
payload['name'] = name;
|
|
2745
|
+
}
|
|
2746
|
+
if (typeof enabled !== 'undefined') {
|
|
2747
|
+
payload['enabled'] = enabled;
|
|
2748
|
+
}
|
|
2749
|
+
if (typeof apiKey !== 'undefined') {
|
|
2750
|
+
payload['apiKey'] = apiKey;
|
|
2751
|
+
}
|
|
2752
|
+
if (typeof fromName !== 'undefined') {
|
|
2753
|
+
payload['fromName'] = fromName;
|
|
2754
|
+
}
|
|
2755
|
+
if (typeof fromEmail !== 'undefined') {
|
|
2756
|
+
payload['fromEmail'] = fromEmail;
|
|
2757
|
+
}
|
|
2758
|
+
if (typeof replyToName !== 'undefined') {
|
|
2759
|
+
payload['replyToName'] = replyToName;
|
|
2760
|
+
}
|
|
2761
|
+
if (typeof replyToEmail !== 'undefined') {
|
|
2762
|
+
payload['replyToEmail'] = replyToEmail;
|
|
2763
|
+
}
|
|
2764
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2765
|
+
|
|
2766
|
+
const apiHeaders: { [header: string]: string } = {
|
|
2767
|
+
'content-type': 'application/json',
|
|
2768
|
+
}
|
|
2769
|
+
|
|
2770
|
+
return this.client.call(
|
|
2771
|
+
'patch',
|
|
2772
|
+
uri,
|
|
2773
|
+
apiHeaders,
|
|
2774
|
+
payload
|
|
2775
|
+
);
|
|
2776
|
+
}
|
|
2777
|
+
|
|
2778
|
+
/**
|
|
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.
|
|
2795
|
+
*
|
|
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.
|
|
2804
|
+
* @throws {AppwriteException}
|
|
2805
|
+
* @returns {Promise<Models.Provider>}
|
|
2806
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2807
|
+
*/
|
|
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
|
+
|
|
2839
|
+
if (typeof providerId === 'undefined') {
|
|
2840
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
2841
|
+
}
|
|
2842
|
+
if (typeof name === 'undefined') {
|
|
2843
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
2844
|
+
}
|
|
2845
|
+
|
|
1104
2846
|
const apiPath = '/messaging/providers/sendgrid';
|
|
1105
2847
|
const payload: Payload = {};
|
|
1106
2848
|
if (typeof providerId !== 'undefined') {
|
|
@@ -1109,8 +2851,417 @@ export class Messaging {
|
|
|
1109
2851
|
if (typeof name !== 'undefined') {
|
|
1110
2852
|
payload['name'] = name;
|
|
1111
2853
|
}
|
|
1112
|
-
if (typeof apiKey !== 'undefined') {
|
|
1113
|
-
payload['apiKey'] = apiKey;
|
|
2854
|
+
if (typeof apiKey !== 'undefined') {
|
|
2855
|
+
payload['apiKey'] = apiKey;
|
|
2856
|
+
}
|
|
2857
|
+
if (typeof fromName !== 'undefined') {
|
|
2858
|
+
payload['fromName'] = fromName;
|
|
2859
|
+
}
|
|
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;
|
|
2868
|
+
}
|
|
2869
|
+
if (typeof enabled !== 'undefined') {
|
|
2870
|
+
payload['enabled'] = enabled;
|
|
2871
|
+
}
|
|
2872
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2873
|
+
|
|
2874
|
+
const apiHeaders: { [header: string]: string } = {
|
|
2875
|
+
'content-type': 'application/json',
|
|
2876
|
+
}
|
|
2877
|
+
|
|
2878
|
+
return this.client.call(
|
|
2879
|
+
'post',
|
|
2880
|
+
uri,
|
|
2881
|
+
apiHeaders,
|
|
2882
|
+
payload
|
|
2883
|
+
);
|
|
2884
|
+
}
|
|
2885
|
+
|
|
2886
|
+
/**
|
|
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.
|
|
2903
|
+
*
|
|
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.
|
|
2912
|
+
* @throws {AppwriteException}
|
|
2913
|
+
* @returns {Promise<Models.Provider>}
|
|
2914
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2915
|
+
*/
|
|
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
|
+
|
|
2947
|
+
if (typeof providerId === 'undefined') {
|
|
2948
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
2949
|
+
}
|
|
2950
|
+
|
|
2951
|
+
const apiPath = '/messaging/providers/sendgrid/{providerId}'.replace('{providerId}', providerId);
|
|
2952
|
+
const payload: Payload = {};
|
|
2953
|
+
if (typeof name !== 'undefined') {
|
|
2954
|
+
payload['name'] = name;
|
|
2955
|
+
}
|
|
2956
|
+
if (typeof enabled !== 'undefined') {
|
|
2957
|
+
payload['enabled'] = enabled;
|
|
2958
|
+
}
|
|
2959
|
+
if (typeof apiKey !== 'undefined') {
|
|
2960
|
+
payload['apiKey'] = apiKey;
|
|
2961
|
+
}
|
|
2962
|
+
if (typeof fromName !== 'undefined') {
|
|
2963
|
+
payload['fromName'] = fromName;
|
|
2964
|
+
}
|
|
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;
|
|
2973
|
+
}
|
|
2974
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2975
|
+
|
|
2976
|
+
const apiHeaders: { [header: string]: string } = {
|
|
2977
|
+
'content-type': 'application/json',
|
|
2978
|
+
}
|
|
2979
|
+
|
|
2980
|
+
return this.client.call(
|
|
2981
|
+
'patch',
|
|
2982
|
+
uri,
|
|
2983
|
+
apiHeaders,
|
|
2984
|
+
payload
|
|
2985
|
+
);
|
|
2986
|
+
}
|
|
2987
|
+
|
|
2988
|
+
/**
|
|
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.
|
|
3012
|
+
*
|
|
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.
|
|
3027
|
+
* @throws {AppwriteException}
|
|
3028
|
+
* @returns {Promise<Models.Provider>}
|
|
3029
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
3030
|
+
*/
|
|
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
|
+
|
|
3074
|
+
if (typeof providerId === 'undefined') {
|
|
3075
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
3076
|
+
}
|
|
3077
|
+
if (typeof name === 'undefined') {
|
|
3078
|
+
throw new AppwriteException('Missing required parameter: "name"');
|
|
3079
|
+
}
|
|
3080
|
+
if (typeof host === 'undefined') {
|
|
3081
|
+
throw new AppwriteException('Missing required parameter: "host"');
|
|
3082
|
+
}
|
|
3083
|
+
|
|
3084
|
+
const apiPath = '/messaging/providers/smtp';
|
|
3085
|
+
const payload: Payload = {};
|
|
3086
|
+
if (typeof providerId !== 'undefined') {
|
|
3087
|
+
payload['providerId'] = providerId;
|
|
3088
|
+
}
|
|
3089
|
+
if (typeof name !== 'undefined') {
|
|
3090
|
+
payload['name'] = name;
|
|
3091
|
+
}
|
|
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;
|
|
3112
|
+
}
|
|
3113
|
+
if (typeof fromName !== 'undefined') {
|
|
3114
|
+
payload['fromName'] = fromName;
|
|
3115
|
+
}
|
|
3116
|
+
if (typeof fromEmail !== 'undefined') {
|
|
3117
|
+
payload['fromEmail'] = fromEmail;
|
|
3118
|
+
}
|
|
3119
|
+
if (typeof replyToName !== 'undefined') {
|
|
3120
|
+
payload['replyToName'] = replyToName;
|
|
3121
|
+
}
|
|
3122
|
+
if (typeof replyToEmail !== 'undefined') {
|
|
3123
|
+
payload['replyToEmail'] = replyToEmail;
|
|
3124
|
+
}
|
|
3125
|
+
if (typeof enabled !== 'undefined') {
|
|
3126
|
+
payload['enabled'] = enabled;
|
|
3127
|
+
}
|
|
3128
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3129
|
+
|
|
3130
|
+
const apiHeaders: { [header: string]: string } = {
|
|
3131
|
+
'content-type': 'application/json',
|
|
3132
|
+
}
|
|
3133
|
+
|
|
3134
|
+
return this.client.call(
|
|
3135
|
+
'post',
|
|
3136
|
+
uri,
|
|
3137
|
+
apiHeaders,
|
|
3138
|
+
payload
|
|
3139
|
+
);
|
|
3140
|
+
}
|
|
3141
|
+
|
|
3142
|
+
/**
|
|
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.
|
|
3165
|
+
*
|
|
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.
|
|
3180
|
+
* @throws {AppwriteException}
|
|
3181
|
+
* @returns {Promise<Models.Provider>}
|
|
3182
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
3183
|
+
*/
|
|
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
|
+
|
|
3227
|
+
if (typeof providerId === 'undefined') {
|
|
3228
|
+
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
3229
|
+
}
|
|
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';
|
|
3238
|
+
const payload: Payload = {};
|
|
3239
|
+
if (typeof providerId !== 'undefined') {
|
|
3240
|
+
payload['providerId'] = providerId;
|
|
3241
|
+
}
|
|
3242
|
+
if (typeof name !== 'undefined') {
|
|
3243
|
+
payload['name'] = name;
|
|
3244
|
+
}
|
|
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;
|
|
3259
|
+
}
|
|
3260
|
+
if (typeof autoTLS !== 'undefined') {
|
|
3261
|
+
payload['autoTLS'] = autoTLS;
|
|
3262
|
+
}
|
|
3263
|
+
if (typeof mailer !== 'undefined') {
|
|
3264
|
+
payload['mailer'] = mailer;
|
|
1114
3265
|
}
|
|
1115
3266
|
if (typeof fromName !== 'undefined') {
|
|
1116
3267
|
payload['fromName'] = fromName;
|
|
@@ -1142,95 +3293,97 @@ export class Messaging {
|
|
|
1142
3293
|
}
|
|
1143
3294
|
|
|
1144
3295
|
/**
|
|
1145
|
-
* Update a
|
|
3296
|
+
* Update a SMTP provider by its unique ID.
|
|
1146
3297
|
*
|
|
1147
|
-
* @param {string} providerId
|
|
1148
|
-
* @param {string} name
|
|
1149
|
-
* @param {
|
|
1150
|
-
* @param {
|
|
1151
|
-
* @param {string}
|
|
1152
|
-
* @param {string}
|
|
1153
|
-
* @param {
|
|
1154
|
-
* @param {
|
|
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.
|
|
1155
3312
|
* @throws {AppwriteException}
|
|
1156
3313
|
* @returns {Promise<Models.Provider>}
|
|
3314
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `Messaging.updateSMTPProvider` instead.
|
|
1157
3315
|
*/
|
|
1158
|
-
|
|
1159
|
-
if (typeof providerId === 'undefined') {
|
|
1160
|
-
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1161
|
-
}
|
|
1162
|
-
const apiPath = '/messaging/providers/sendgrid/{providerId}'.replace('{providerId}', providerId);
|
|
1163
|
-
const payload: Payload = {};
|
|
1164
|
-
if (typeof name !== 'undefined') {
|
|
1165
|
-
payload['name'] = name;
|
|
1166
|
-
}
|
|
1167
|
-
if (typeof enabled !== 'undefined') {
|
|
1168
|
-
payload['enabled'] = enabled;
|
|
1169
|
-
}
|
|
1170
|
-
if (typeof apiKey !== 'undefined') {
|
|
1171
|
-
payload['apiKey'] = apiKey;
|
|
1172
|
-
}
|
|
1173
|
-
if (typeof fromName !== 'undefined') {
|
|
1174
|
-
payload['fromName'] = fromName;
|
|
1175
|
-
}
|
|
1176
|
-
if (typeof fromEmail !== 'undefined') {
|
|
1177
|
-
payload['fromEmail'] = fromEmail;
|
|
1178
|
-
}
|
|
1179
|
-
if (typeof replyToName !== 'undefined') {
|
|
1180
|
-
payload['replyToName'] = replyToName;
|
|
1181
|
-
}
|
|
1182
|
-
if (typeof replyToEmail !== 'undefined') {
|
|
1183
|
-
payload['replyToEmail'] = replyToEmail;
|
|
1184
|
-
}
|
|
1185
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1186
|
-
|
|
1187
|
-
const apiHeaders: { [header: string]: string } = {
|
|
1188
|
-
'content-type': 'application/json',
|
|
1189
|
-
}
|
|
1190
|
-
|
|
1191
|
-
return this.client.call(
|
|
1192
|
-
'patch',
|
|
1193
|
-
uri,
|
|
1194
|
-
apiHeaders,
|
|
1195
|
-
payload
|
|
1196
|
-
);
|
|
1197
|
-
}
|
|
1198
|
-
|
|
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>;
|
|
1199
3317
|
/**
|
|
1200
|
-
*
|
|
3318
|
+
* Update a SMTP provider by its unique ID.
|
|
1201
3319
|
*
|
|
1202
|
-
* @param {string} providerId
|
|
1203
|
-
* @param {string} name
|
|
1204
|
-
* @param {string} host
|
|
1205
|
-
* @param {number} port
|
|
1206
|
-
* @param {string} username
|
|
1207
|
-
* @param {string} password
|
|
1208
|
-
* @param {SmtpEncryption} encryption
|
|
1209
|
-
* @param {boolean} autoTLS
|
|
1210
|
-
* @param {string} mailer
|
|
1211
|
-
* @param {string} fromName
|
|
1212
|
-
* @param {string} fromEmail
|
|
1213
|
-
* @param {string} replyToName
|
|
1214
|
-
* @param {string} replyToEmail
|
|
1215
|
-
* @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.
|
|
1216
3334
|
* @throws {AppwriteException}
|
|
1217
3335
|
* @returns {Promise<Models.Provider>}
|
|
3336
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1218
3337
|
*/
|
|
1219
|
-
|
|
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
|
+
|
|
1220
3381
|
if (typeof providerId === 'undefined') {
|
|
1221
3382
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1222
3383
|
}
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
}
|
|
1226
|
-
if (typeof host === 'undefined') {
|
|
1227
|
-
throw new AppwriteException('Missing required parameter: "host"');
|
|
1228
|
-
}
|
|
1229
|
-
const apiPath = '/messaging/providers/smtp';
|
|
3384
|
+
|
|
3385
|
+
const apiPath = '/messaging/providers/smtp/{providerId}'.replace('{providerId}', providerId);
|
|
1230
3386
|
const payload: Payload = {};
|
|
1231
|
-
if (typeof providerId !== 'undefined') {
|
|
1232
|
-
payload['providerId'] = providerId;
|
|
1233
|
-
}
|
|
1234
3387
|
if (typeof name !== 'undefined') {
|
|
1235
3388
|
payload['name'] = name;
|
|
1236
3389
|
}
|
|
@@ -1277,7 +3430,7 @@ export class Messaging {
|
|
|
1277
3430
|
}
|
|
1278
3431
|
|
|
1279
3432
|
return this.client.call(
|
|
1280
|
-
'
|
|
3433
|
+
'patch',
|
|
1281
3434
|
uri,
|
|
1282
3435
|
apiHeaders,
|
|
1283
3436
|
payload
|
|
@@ -1287,27 +3440,92 @@ export class Messaging {
|
|
|
1287
3440
|
/**
|
|
1288
3441
|
* Update a SMTP provider by its unique ID.
|
|
1289
3442
|
*
|
|
1290
|
-
* @param {string} providerId
|
|
1291
|
-
* @param {string} name
|
|
1292
|
-
* @param {string} host
|
|
1293
|
-
* @param {number} port
|
|
1294
|
-
* @param {string} username
|
|
1295
|
-
* @param {string} password
|
|
1296
|
-
* @param {SmtpEncryption} encryption
|
|
1297
|
-
* @param {boolean} autoTLS
|
|
1298
|
-
* @param {string} mailer
|
|
1299
|
-
* @param {string} fromName
|
|
1300
|
-
* @param {string} fromEmail
|
|
1301
|
-
* @param {string} replyToName
|
|
1302
|
-
* @param {string} replyToEmail
|
|
1303
|
-
* @param {boolean} enabled
|
|
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>;
|
|
3461
|
+
/**
|
|
3462
|
+
* Update a SMTP provider by its unique ID.
|
|
3463
|
+
*
|
|
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.
|
|
1304
3478
|
* @throws {AppwriteException}
|
|
1305
3479
|
* @returns {Promise<Models.Provider>}
|
|
3480
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1306
3481
|
*/
|
|
1307
|
-
|
|
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
|
+
|
|
1308
3525
|
if (typeof providerId === 'undefined') {
|
|
1309
3526
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1310
3527
|
}
|
|
3528
|
+
|
|
1311
3529
|
const apiPath = '/messaging/providers/smtp/{providerId}'.replace('{providerId}', providerId);
|
|
1312
3530
|
const payload: Payload = {};
|
|
1313
3531
|
if (typeof name !== 'undefined') {
|
|
@@ -1366,22 +3584,63 @@ export class Messaging {
|
|
|
1366
3584
|
/**
|
|
1367
3585
|
* Create a new Telesign provider.
|
|
1368
3586
|
*
|
|
1369
|
-
* @param {string} providerId
|
|
1370
|
-
* @param {string} name
|
|
1371
|
-
* @param {string} from
|
|
1372
|
-
* @param {string} customerId
|
|
1373
|
-
* @param {string} apiKey
|
|
1374
|
-
* @param {boolean} enabled
|
|
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>;
|
|
3597
|
+
/**
|
|
3598
|
+
* Create a new Telesign provider.
|
|
3599
|
+
*
|
|
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.
|
|
1375
3606
|
* @throws {AppwriteException}
|
|
1376
3607
|
* @returns {Promise<Models.Provider>}
|
|
3608
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1377
3609
|
*/
|
|
1378
|
-
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
|
+
|
|
1379
3637
|
if (typeof providerId === 'undefined') {
|
|
1380
3638
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1381
3639
|
}
|
|
1382
3640
|
if (typeof name === 'undefined') {
|
|
1383
3641
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
1384
3642
|
}
|
|
3643
|
+
|
|
1385
3644
|
const apiPath = '/messaging/providers/telesign';
|
|
1386
3645
|
const payload: Payload = {};
|
|
1387
3646
|
if (typeof providerId !== 'undefined') {
|
|
@@ -1419,19 +3678,60 @@ export class Messaging {
|
|
|
1419
3678
|
/**
|
|
1420
3679
|
* Update a Telesign provider by its unique ID.
|
|
1421
3680
|
*
|
|
1422
|
-
* @param {string} providerId
|
|
1423
|
-
* @param {string} name
|
|
1424
|
-
* @param {boolean} enabled
|
|
1425
|
-
* @param {string} customerId
|
|
1426
|
-
* @param {string} apiKey
|
|
1427
|
-
* @param {string} from
|
|
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>;
|
|
3691
|
+
/**
|
|
3692
|
+
* Update a Telesign provider by its unique ID.
|
|
3693
|
+
*
|
|
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.
|
|
1428
3700
|
* @throws {AppwriteException}
|
|
1429
3701
|
* @returns {Promise<Models.Provider>}
|
|
3702
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1430
3703
|
*/
|
|
1431
|
-
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
|
+
|
|
1432
3731
|
if (typeof providerId === 'undefined') {
|
|
1433
3732
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1434
3733
|
}
|
|
3734
|
+
|
|
1435
3735
|
const apiPath = '/messaging/providers/telesign/{providerId}'.replace('{providerId}', providerId);
|
|
1436
3736
|
const payload: Payload = {};
|
|
1437
3737
|
if (typeof name !== 'undefined') {
|
|
@@ -1466,22 +3766,63 @@ export class Messaging {
|
|
|
1466
3766
|
/**
|
|
1467
3767
|
* Create a new Textmagic provider.
|
|
1468
3768
|
*
|
|
1469
|
-
* @param {string} providerId
|
|
1470
|
-
* @param {string} name
|
|
1471
|
-
* @param {string} from
|
|
1472
|
-
* @param {string} username
|
|
1473
|
-
* @param {string} apiKey
|
|
1474
|
-
* @param {boolean} enabled
|
|
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>;
|
|
3779
|
+
/**
|
|
3780
|
+
* Create a new Textmagic provider.
|
|
3781
|
+
*
|
|
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.
|
|
1475
3788
|
* @throws {AppwriteException}
|
|
1476
3789
|
* @returns {Promise<Models.Provider>}
|
|
3790
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1477
3791
|
*/
|
|
1478
|
-
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
|
+
|
|
1479
3819
|
if (typeof providerId === 'undefined') {
|
|
1480
3820
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1481
3821
|
}
|
|
1482
3822
|
if (typeof name === 'undefined') {
|
|
1483
3823
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
1484
3824
|
}
|
|
3825
|
+
|
|
1485
3826
|
const apiPath = '/messaging/providers/textmagic';
|
|
1486
3827
|
const payload: Payload = {};
|
|
1487
3828
|
if (typeof providerId !== 'undefined') {
|
|
@@ -1519,19 +3860,60 @@ export class Messaging {
|
|
|
1519
3860
|
/**
|
|
1520
3861
|
* Update a Textmagic provider by its unique ID.
|
|
1521
3862
|
*
|
|
1522
|
-
* @param {string} providerId
|
|
1523
|
-
* @param {string} name
|
|
1524
|
-
* @param {boolean} enabled
|
|
1525
|
-
* @param {string} username
|
|
1526
|
-
* @param {string} apiKey
|
|
1527
|
-
* @param {string} from
|
|
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>;
|
|
3873
|
+
/**
|
|
3874
|
+
* Update a Textmagic provider by its unique ID.
|
|
3875
|
+
*
|
|
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.
|
|
1528
3882
|
* @throws {AppwriteException}
|
|
1529
3883
|
* @returns {Promise<Models.Provider>}
|
|
3884
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1530
3885
|
*/
|
|
1531
|
-
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
|
+
|
|
1532
3913
|
if (typeof providerId === 'undefined') {
|
|
1533
3914
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1534
3915
|
}
|
|
3916
|
+
|
|
1535
3917
|
const apiPath = '/messaging/providers/textmagic/{providerId}'.replace('{providerId}', providerId);
|
|
1536
3918
|
const payload: Payload = {};
|
|
1537
3919
|
if (typeof name !== 'undefined') {
|
|
@@ -1566,22 +3948,63 @@ export class Messaging {
|
|
|
1566
3948
|
/**
|
|
1567
3949
|
* Create a new Twilio provider.
|
|
1568
3950
|
*
|
|
1569
|
-
* @param {string} providerId
|
|
1570
|
-
* @param {string} name
|
|
1571
|
-
* @param {string} from
|
|
1572
|
-
* @param {string} accountSid
|
|
1573
|
-
* @param {string} authToken
|
|
1574
|
-
* @param {boolean} enabled
|
|
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>;
|
|
3961
|
+
/**
|
|
3962
|
+
* Create a new Twilio provider.
|
|
3963
|
+
*
|
|
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.
|
|
1575
3970
|
* @throws {AppwriteException}
|
|
1576
3971
|
* @returns {Promise<Models.Provider>}
|
|
3972
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1577
3973
|
*/
|
|
1578
|
-
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
|
+
|
|
1579
4001
|
if (typeof providerId === 'undefined') {
|
|
1580
4002
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1581
4003
|
}
|
|
1582
4004
|
if (typeof name === 'undefined') {
|
|
1583
4005
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
1584
4006
|
}
|
|
4007
|
+
|
|
1585
4008
|
const apiPath = '/messaging/providers/twilio';
|
|
1586
4009
|
const payload: Payload = {};
|
|
1587
4010
|
if (typeof providerId !== 'undefined') {
|
|
@@ -1619,19 +4042,60 @@ export class Messaging {
|
|
|
1619
4042
|
/**
|
|
1620
4043
|
* Update a Twilio provider by its unique ID.
|
|
1621
4044
|
*
|
|
1622
|
-
* @param {string} providerId
|
|
1623
|
-
* @param {string} name
|
|
1624
|
-
* @param {boolean} enabled
|
|
1625
|
-
* @param {string} accountSid
|
|
1626
|
-
* @param {string} authToken
|
|
1627
|
-
* @param {string} from
|
|
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>;
|
|
4055
|
+
/**
|
|
4056
|
+
* Update a Twilio provider by its unique ID.
|
|
4057
|
+
*
|
|
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.
|
|
1628
4064
|
* @throws {AppwriteException}
|
|
1629
4065
|
* @returns {Promise<Models.Provider>}
|
|
4066
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1630
4067
|
*/
|
|
1631
|
-
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
|
+
|
|
1632
4095
|
if (typeof providerId === 'undefined') {
|
|
1633
4096
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1634
4097
|
}
|
|
4098
|
+
|
|
1635
4099
|
const apiPath = '/messaging/providers/twilio/{providerId}'.replace('{providerId}', providerId);
|
|
1636
4100
|
const payload: Payload = {};
|
|
1637
4101
|
if (typeof name !== 'undefined') {
|
|
@@ -1666,22 +4130,63 @@ export class Messaging {
|
|
|
1666
4130
|
/**
|
|
1667
4131
|
* Create a new Vonage provider.
|
|
1668
4132
|
*
|
|
1669
|
-
* @param {string} providerId
|
|
1670
|
-
* @param {string} name
|
|
1671
|
-
* @param {string} from
|
|
1672
|
-
* @param {string} apiKey
|
|
1673
|
-
* @param {string} apiSecret
|
|
1674
|
-
* @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.
|
|
4139
|
+
* @throws {AppwriteException}
|
|
4140
|
+
* @returns {Promise<Models.Provider>}
|
|
4141
|
+
*/
|
|
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.
|
|
1675
4152
|
* @throws {AppwriteException}
|
|
1676
4153
|
* @returns {Promise<Models.Provider>}
|
|
4154
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1677
4155
|
*/
|
|
1678
|
-
createVonageProvider(providerId: string, name: string, from?: string, apiKey?: string, apiSecret?: string, enabled?: boolean): Promise<Models.Provider
|
|
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
|
+
|
|
1679
4183
|
if (typeof providerId === 'undefined') {
|
|
1680
4184
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1681
4185
|
}
|
|
1682
4186
|
if (typeof name === 'undefined') {
|
|
1683
4187
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
1684
4188
|
}
|
|
4189
|
+
|
|
1685
4190
|
const apiPath = '/messaging/providers/vonage';
|
|
1686
4191
|
const payload: Payload = {};
|
|
1687
4192
|
if (typeof providerId !== 'undefined') {
|
|
@@ -1719,19 +4224,60 @@ export class Messaging {
|
|
|
1719
4224
|
/**
|
|
1720
4225
|
* Update a Vonage provider by its unique ID.
|
|
1721
4226
|
*
|
|
1722
|
-
* @param {string} providerId
|
|
1723
|
-
* @param {string} name
|
|
1724
|
-
* @param {boolean} enabled
|
|
1725
|
-
* @param {string} apiKey
|
|
1726
|
-
* @param {string} apiSecret
|
|
1727
|
-
* @param {string} from
|
|
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>;
|
|
4237
|
+
/**
|
|
4238
|
+
* Update a Vonage provider by its unique ID.
|
|
4239
|
+
*
|
|
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.
|
|
1728
4246
|
* @throws {AppwriteException}
|
|
1729
4247
|
* @returns {Promise<Models.Provider>}
|
|
4248
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1730
4249
|
*/
|
|
1731
|
-
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
|
+
|
|
1732
4277
|
if (typeof providerId === 'undefined') {
|
|
1733
4278
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1734
4279
|
}
|
|
4280
|
+
|
|
1735
4281
|
const apiPath = '/messaging/providers/vonage/{providerId}'.replace('{providerId}', providerId);
|
|
1736
4282
|
const payload: Payload = {};
|
|
1737
4283
|
if (typeof name !== 'undefined') {
|
|
@@ -1767,14 +4313,40 @@ export class Messaging {
|
|
|
1767
4313
|
* Get a provider by its unique ID.
|
|
1768
4314
|
*
|
|
1769
4315
|
*
|
|
1770
|
-
* @param {string} providerId
|
|
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
|
+
*
|
|
4324
|
+
*
|
|
4325
|
+
* @param {string} providerId - Provider ID.
|
|
1771
4326
|
* @throws {AppwriteException}
|
|
1772
4327
|
* @returns {Promise<Models.Provider>}
|
|
4328
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1773
4329
|
*/
|
|
1774
|
-
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
|
+
|
|
1775
4346
|
if (typeof providerId === 'undefined') {
|
|
1776
4347
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1777
4348
|
}
|
|
4349
|
+
|
|
1778
4350
|
const apiPath = '/messaging/providers/{providerId}'.replace('{providerId}', providerId);
|
|
1779
4351
|
const payload: Payload = {};
|
|
1780
4352
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -1793,14 +4365,39 @@ export class Messaging {
|
|
|
1793
4365
|
/**
|
|
1794
4366
|
* Delete a provider by its unique ID.
|
|
1795
4367
|
*
|
|
1796
|
-
* @param {string} providerId
|
|
4368
|
+
* @param {string} params.providerId - Provider ID.
|
|
1797
4369
|
* @throws {AppwriteException}
|
|
1798
4370
|
* @returns {Promise<{}>}
|
|
1799
4371
|
*/
|
|
1800
|
-
deleteProvider(providerId: string): Promise<{}
|
|
4372
|
+
deleteProvider(params: { providerId: string }): Promise<{}>;
|
|
4373
|
+
/**
|
|
4374
|
+
* Delete a provider by its unique ID.
|
|
4375
|
+
*
|
|
4376
|
+
* @param {string} providerId - Provider ID.
|
|
4377
|
+
* @throws {AppwriteException}
|
|
4378
|
+
* @returns {Promise<{}>}
|
|
4379
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
4380
|
+
*/
|
|
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
|
+
|
|
1801
4397
|
if (typeof providerId === 'undefined') {
|
|
1802
4398
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1803
4399
|
}
|
|
4400
|
+
|
|
1804
4401
|
const apiPath = '/messaging/providers/{providerId}'.replace('{providerId}', providerId);
|
|
1805
4402
|
const payload: Payload = {};
|
|
1806
4403
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -1820,20 +4417,56 @@ export class Messaging {
|
|
|
1820
4417
|
/**
|
|
1821
4418
|
* Get the provider activity logs listed by its unique ID.
|
|
1822
4419
|
*
|
|
1823
|
-
* @param {string} providerId
|
|
1824
|
-
* @param {string[]} queries
|
|
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.
|
|
1825
4423
|
* @throws {AppwriteException}
|
|
1826
4424
|
* @returns {Promise<Models.LogList>}
|
|
1827
4425
|
*/
|
|
1828
|
-
listProviderLogs(providerId: string, queries?: string[]): Promise<Models.LogList
|
|
4426
|
+
listProviderLogs(params: { providerId: string, queries?: string[], total?: boolean }): Promise<Models.LogList>;
|
|
4427
|
+
/**
|
|
4428
|
+
* Get the provider activity logs listed by its unique ID.
|
|
4429
|
+
*
|
|
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.
|
|
4433
|
+
* @throws {AppwriteException}
|
|
4434
|
+
* @returns {Promise<Models.LogList>}
|
|
4435
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
4436
|
+
*/
|
|
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
|
+
|
|
1829
4458
|
if (typeof providerId === 'undefined') {
|
|
1830
4459
|
throw new AppwriteException('Missing required parameter: "providerId"');
|
|
1831
4460
|
}
|
|
4461
|
+
|
|
1832
4462
|
const apiPath = '/messaging/providers/{providerId}/logs'.replace('{providerId}', providerId);
|
|
1833
4463
|
const payload: Payload = {};
|
|
1834
4464
|
if (typeof queries !== 'undefined') {
|
|
1835
4465
|
payload['queries'] = queries;
|
|
1836
4466
|
}
|
|
4467
|
+
if (typeof total !== 'undefined') {
|
|
4468
|
+
payload['total'] = total;
|
|
4469
|
+
}
|
|
1837
4470
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1838
4471
|
|
|
1839
4472
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -1850,20 +4483,56 @@ export class Messaging {
|
|
|
1850
4483
|
/**
|
|
1851
4484
|
* Get the subscriber activity logs listed by its unique ID.
|
|
1852
4485
|
*
|
|
1853
|
-
* @param {string} subscriberId
|
|
1854
|
-
* @param {string[]} queries
|
|
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>;
|
|
4493
|
+
/**
|
|
4494
|
+
* Get the subscriber activity logs listed by its unique ID.
|
|
4495
|
+
*
|
|
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.
|
|
1855
4499
|
* @throws {AppwriteException}
|
|
1856
4500
|
* @returns {Promise<Models.LogList>}
|
|
4501
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1857
4502
|
*/
|
|
1858
|
-
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
|
+
|
|
1859
4524
|
if (typeof subscriberId === 'undefined') {
|
|
1860
4525
|
throw new AppwriteException('Missing required parameter: "subscriberId"');
|
|
1861
4526
|
}
|
|
4527
|
+
|
|
1862
4528
|
const apiPath = '/messaging/subscribers/{subscriberId}/logs'.replace('{subscriberId}', subscriberId);
|
|
1863
4529
|
const payload: Payload = {};
|
|
1864
4530
|
if (typeof queries !== 'undefined') {
|
|
1865
4531
|
payload['queries'] = queries;
|
|
1866
4532
|
}
|
|
4533
|
+
if (typeof total !== 'undefined') {
|
|
4534
|
+
payload['total'] = total;
|
|
4535
|
+
}
|
|
1867
4536
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1868
4537
|
|
|
1869
4538
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -1880,12 +4549,45 @@ export class Messaging {
|
|
|
1880
4549
|
/**
|
|
1881
4550
|
* Get a list of all topics from the current Appwrite project.
|
|
1882
4551
|
*
|
|
1883
|
-
* @param {string[]} queries
|
|
1884
|
-
* @param {string} search
|
|
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>;
|
|
4559
|
+
/**
|
|
4560
|
+
* Get a list of all topics from the current Appwrite project.
|
|
4561
|
+
*
|
|
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.
|
|
1885
4565
|
* @throws {AppwriteException}
|
|
1886
4566
|
* @returns {Promise<Models.TopicList>}
|
|
4567
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1887
4568
|
*/
|
|
1888
|
-
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
|
+
|
|
1889
4591
|
const apiPath = '/messaging/topics';
|
|
1890
4592
|
const payload: Payload = {};
|
|
1891
4593
|
if (typeof queries !== 'undefined') {
|
|
@@ -1894,6 +4596,9 @@ export class Messaging {
|
|
|
1894
4596
|
if (typeof search !== 'undefined') {
|
|
1895
4597
|
payload['search'] = search;
|
|
1896
4598
|
}
|
|
4599
|
+
if (typeof total !== 'undefined') {
|
|
4600
|
+
payload['total'] = total;
|
|
4601
|
+
}
|
|
1897
4602
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1898
4603
|
|
|
1899
4604
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -1910,19 +4615,51 @@ export class Messaging {
|
|
|
1910
4615
|
/**
|
|
1911
4616
|
* Create a new topic.
|
|
1912
4617
|
*
|
|
1913
|
-
* @param {string} topicId
|
|
1914
|
-
* @param {string} name
|
|
1915
|
-
* @param {string[]} subscribe
|
|
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>;
|
|
4625
|
+
/**
|
|
4626
|
+
* Create a new topic.
|
|
4627
|
+
*
|
|
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.
|
|
1916
4631
|
* @throws {AppwriteException}
|
|
1917
4632
|
* @returns {Promise<Models.Topic>}
|
|
4633
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1918
4634
|
*/
|
|
1919
|
-
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
|
+
|
|
1920
4656
|
if (typeof topicId === 'undefined') {
|
|
1921
4657
|
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
1922
4658
|
}
|
|
1923
4659
|
if (typeof name === 'undefined') {
|
|
1924
4660
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
1925
4661
|
}
|
|
4662
|
+
|
|
1926
4663
|
const apiPath = '/messaging/topics';
|
|
1927
4664
|
const payload: Payload = {};
|
|
1928
4665
|
if (typeof topicId !== 'undefined') {
|
|
@@ -1952,14 +4689,40 @@ export class Messaging {
|
|
|
1952
4689
|
* Get a topic by its unique ID.
|
|
1953
4690
|
*
|
|
1954
4691
|
*
|
|
1955
|
-
* @param {string} topicId
|
|
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
|
+
*
|
|
4700
|
+
*
|
|
4701
|
+
* @param {string} topicId - Topic ID.
|
|
1956
4702
|
* @throws {AppwriteException}
|
|
1957
4703
|
* @returns {Promise<Models.Topic>}
|
|
4704
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1958
4705
|
*/
|
|
1959
|
-
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
|
+
|
|
1960
4722
|
if (typeof topicId === 'undefined') {
|
|
1961
4723
|
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
1962
4724
|
}
|
|
4725
|
+
|
|
1963
4726
|
const apiPath = '/messaging/topics/{topicId}'.replace('{topicId}', topicId);
|
|
1964
4727
|
const payload: Payload = {};
|
|
1965
4728
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -1979,16 +4742,49 @@ export class Messaging {
|
|
|
1979
4742
|
* Update a topic by its unique ID.
|
|
1980
4743
|
*
|
|
1981
4744
|
*
|
|
1982
|
-
* @param {string} topicId
|
|
1983
|
-
* @param {string} name
|
|
1984
|
-
* @param {string[]} subscribe
|
|
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
|
+
*
|
|
4755
|
+
*
|
|
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.
|
|
1985
4759
|
* @throws {AppwriteException}
|
|
1986
4760
|
* @returns {Promise<Models.Topic>}
|
|
4761
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1987
4762
|
*/
|
|
1988
|
-
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
|
+
|
|
1989
4784
|
if (typeof topicId === 'undefined') {
|
|
1990
4785
|
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
1991
4786
|
}
|
|
4787
|
+
|
|
1992
4788
|
const apiPath = '/messaging/topics/{topicId}'.replace('{topicId}', topicId);
|
|
1993
4789
|
const payload: Payload = {};
|
|
1994
4790
|
if (typeof name !== 'undefined') {
|
|
@@ -2014,14 +4810,39 @@ export class Messaging {
|
|
|
2014
4810
|
/**
|
|
2015
4811
|
* Delete a topic by its unique ID.
|
|
2016
4812
|
*
|
|
2017
|
-
* @param {string} topicId
|
|
4813
|
+
* @param {string} params.topicId - Topic ID.
|
|
4814
|
+
* @throws {AppwriteException}
|
|
4815
|
+
* @returns {Promise<{}>}
|
|
4816
|
+
*/
|
|
4817
|
+
deleteTopic(params: { topicId: string }): Promise<{}>;
|
|
4818
|
+
/**
|
|
4819
|
+
* Delete a topic by its unique ID.
|
|
4820
|
+
*
|
|
4821
|
+
* @param {string} topicId - Topic ID.
|
|
2018
4822
|
* @throws {AppwriteException}
|
|
2019
4823
|
* @returns {Promise<{}>}
|
|
4824
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2020
4825
|
*/
|
|
2021
|
-
deleteTopic(topicId: string): Promise<{}
|
|
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
|
+
|
|
2022
4842
|
if (typeof topicId === 'undefined') {
|
|
2023
4843
|
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
2024
4844
|
}
|
|
4845
|
+
|
|
2025
4846
|
const apiPath = '/messaging/topics/{topicId}'.replace('{topicId}', topicId);
|
|
2026
4847
|
const payload: Payload = {};
|
|
2027
4848
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -2041,20 +4862,56 @@ export class Messaging {
|
|
|
2041
4862
|
/**
|
|
2042
4863
|
* Get the topic activity logs listed by its unique ID.
|
|
2043
4864
|
*
|
|
2044
|
-
* @param {string} topicId
|
|
2045
|
-
* @param {string[]} queries
|
|
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>;
|
|
4872
|
+
/**
|
|
4873
|
+
* Get the topic activity logs listed by its unique ID.
|
|
4874
|
+
*
|
|
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.
|
|
2046
4878
|
* @throws {AppwriteException}
|
|
2047
4879
|
* @returns {Promise<Models.LogList>}
|
|
4880
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2048
4881
|
*/
|
|
2049
|
-
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
|
+
|
|
2050
4903
|
if (typeof topicId === 'undefined') {
|
|
2051
4904
|
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
2052
4905
|
}
|
|
4906
|
+
|
|
2053
4907
|
const apiPath = '/messaging/topics/{topicId}/logs'.replace('{topicId}', topicId);
|
|
2054
4908
|
const payload: Payload = {};
|
|
2055
4909
|
if (typeof queries !== 'undefined') {
|
|
2056
4910
|
payload['queries'] = queries;
|
|
2057
4911
|
}
|
|
4912
|
+
if (typeof total !== 'undefined') {
|
|
4913
|
+
payload['total'] = total;
|
|
4914
|
+
}
|
|
2058
4915
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2059
4916
|
|
|
2060
4917
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -2071,16 +4928,52 @@ export class Messaging {
|
|
|
2071
4928
|
/**
|
|
2072
4929
|
* Get a list of all subscribers from the current Appwrite project.
|
|
2073
4930
|
*
|
|
2074
|
-
* @param {string} topicId
|
|
2075
|
-
* @param {string[]} queries
|
|
2076
|
-
* @param {string} search
|
|
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>;
|
|
4939
|
+
/**
|
|
4940
|
+
* Get a list of all subscribers from the current Appwrite project.
|
|
4941
|
+
*
|
|
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.
|
|
2077
4946
|
* @throws {AppwriteException}
|
|
2078
4947
|
* @returns {Promise<Models.SubscriberList>}
|
|
4948
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2079
4949
|
*/
|
|
2080
|
-
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
|
+
|
|
2081
4973
|
if (typeof topicId === 'undefined') {
|
|
2082
4974
|
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
2083
4975
|
}
|
|
4976
|
+
|
|
2084
4977
|
const apiPath = '/messaging/topics/{topicId}/subscribers'.replace('{topicId}', topicId);
|
|
2085
4978
|
const payload: Payload = {};
|
|
2086
4979
|
if (typeof queries !== 'undefined') {
|
|
@@ -2089,6 +4982,9 @@ export class Messaging {
|
|
|
2089
4982
|
if (typeof search !== 'undefined') {
|
|
2090
4983
|
payload['search'] = search;
|
|
2091
4984
|
}
|
|
4985
|
+
if (typeof total !== 'undefined') {
|
|
4986
|
+
payload['total'] = total;
|
|
4987
|
+
}
|
|
2092
4988
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2093
4989
|
|
|
2094
4990
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -2105,13 +5001,44 @@ export class Messaging {
|
|
|
2105
5001
|
/**
|
|
2106
5002
|
* Create a new subscriber.
|
|
2107
5003
|
*
|
|
2108
|
-
* @param {string} topicId
|
|
2109
|
-
* @param {string} subscriberId
|
|
2110
|
-
* @param {string} targetId
|
|
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>;
|
|
5011
|
+
/**
|
|
5012
|
+
* Create a new subscriber.
|
|
5013
|
+
*
|
|
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.
|
|
2111
5017
|
* @throws {AppwriteException}
|
|
2112
5018
|
* @returns {Promise<Models.Subscriber>}
|
|
5019
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2113
5020
|
*/
|
|
2114
|
-
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
|
+
|
|
2115
5042
|
if (typeof topicId === 'undefined') {
|
|
2116
5043
|
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
2117
5044
|
}
|
|
@@ -2121,6 +5048,7 @@ export class Messaging {
|
|
|
2121
5048
|
if (typeof targetId === 'undefined') {
|
|
2122
5049
|
throw new AppwriteException('Missing required parameter: "targetId"');
|
|
2123
5050
|
}
|
|
5051
|
+
|
|
2124
5052
|
const apiPath = '/messaging/topics/{topicId}/subscribers'.replace('{topicId}', topicId);
|
|
2125
5053
|
const payload: Payload = {};
|
|
2126
5054
|
if (typeof subscriberId !== 'undefined') {
|
|
@@ -2147,18 +5075,48 @@ export class Messaging {
|
|
|
2147
5075
|
* Get a subscriber by its unique ID.
|
|
2148
5076
|
*
|
|
2149
5077
|
*
|
|
2150
|
-
* @param {string} topicId
|
|
2151
|
-
* @param {string} subscriberId
|
|
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
|
+
*
|
|
5087
|
+
*
|
|
5088
|
+
* @param {string} topicId - Topic ID. The topic ID subscribed to.
|
|
5089
|
+
* @param {string} subscriberId - Subscriber ID.
|
|
2152
5090
|
* @throws {AppwriteException}
|
|
2153
5091
|
* @returns {Promise<Models.Subscriber>}
|
|
5092
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2154
5093
|
*/
|
|
2155
|
-
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
|
+
|
|
2156
5113
|
if (typeof topicId === 'undefined') {
|
|
2157
5114
|
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
2158
5115
|
}
|
|
2159
5116
|
if (typeof subscriberId === 'undefined') {
|
|
2160
5117
|
throw new AppwriteException('Missing required parameter: "subscriberId"');
|
|
2161
5118
|
}
|
|
5119
|
+
|
|
2162
5120
|
const apiPath = '/messaging/topics/{topicId}/subscribers/{subscriberId}'.replace('{topicId}', topicId).replace('{subscriberId}', subscriberId);
|
|
2163
5121
|
const payload: Payload = {};
|
|
2164
5122
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -2177,18 +5135,47 @@ export class Messaging {
|
|
|
2177
5135
|
/**
|
|
2178
5136
|
* Delete a subscriber by its unique ID.
|
|
2179
5137
|
*
|
|
2180
|
-
* @param {string} topicId
|
|
2181
|
-
* @param {string} subscriberId
|
|
5138
|
+
* @param {string} params.topicId - Topic ID. The topic ID subscribed to.
|
|
5139
|
+
* @param {string} params.subscriberId - Subscriber ID.
|
|
2182
5140
|
* @throws {AppwriteException}
|
|
2183
5141
|
* @returns {Promise<{}>}
|
|
2184
5142
|
*/
|
|
2185
|
-
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
|
+
|
|
2186
5172
|
if (typeof topicId === 'undefined') {
|
|
2187
5173
|
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
2188
5174
|
}
|
|
2189
5175
|
if (typeof subscriberId === 'undefined') {
|
|
2190
5176
|
throw new AppwriteException('Missing required parameter: "subscriberId"');
|
|
2191
5177
|
}
|
|
5178
|
+
|
|
2192
5179
|
const apiPath = '/messaging/topics/{topicId}/subscribers/{subscriberId}'.replace('{topicId}', topicId).replace('{subscriberId}', subscriberId);
|
|
2193
5180
|
const payload: Payload = {};
|
|
2194
5181
|
const uri = new URL(this.client.config.endpoint + apiPath);
|