chirag-appwrite-cli 0.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/npm-publish.yml +49 -0
- package/CHANGELOG.md +1 -0
- package/Formula/appwrite.rb +19 -0
- package/LICENSE.md +1 -0
- package/README.md +104 -0
- package/appwrite.json +164 -0
- package/docs/examples/account/create-anonymous-session.md +1 -0
- package/docs/examples/account/create-email-password-session.md +3 -0
- package/docs/examples/account/create-email-token.md +4 -0
- package/docs/examples/account/create-j-w-t.md +1 -0
- package/docs/examples/account/create-magic-u-r-l-token.md +5 -0
- package/docs/examples/account/create-mfa-authenticator.md +2 -0
- package/docs/examples/account/create-mfa-challenge.md +2 -0
- package/docs/examples/account/create-mfa-recovery-codes.md +1 -0
- package/docs/examples/account/create-o-auth2session.md +5 -0
- package/docs/examples/account/create-o-auth2token.md +5 -0
- package/docs/examples/account/create-phone-token.md +3 -0
- package/docs/examples/account/create-phone-verification.md +1 -0
- package/docs/examples/account/create-push-target.md +4 -0
- package/docs/examples/account/create-recovery.md +3 -0
- package/docs/examples/account/create-session.md +3 -0
- package/docs/examples/account/create-verification.md +2 -0
- package/docs/examples/account/create.md +5 -0
- package/docs/examples/account/delete-identity.md +2 -0
- package/docs/examples/account/delete-mfa-authenticator.md +2 -0
- package/docs/examples/account/delete-push-target.md +2 -0
- package/docs/examples/account/delete-session.md +2 -0
- package/docs/examples/account/delete-sessions.md +1 -0
- package/docs/examples/account/delete.md +1 -0
- package/docs/examples/account/get-mfa-recovery-codes.md +1 -0
- package/docs/examples/account/get-prefs.md +1 -0
- package/docs/examples/account/get-session.md +2 -0
- package/docs/examples/account/get.md +1 -0
- package/docs/examples/account/list-identities.md +2 -0
- package/docs/examples/account/list-logs.md +2 -0
- package/docs/examples/account/list-mfa-factors.md +1 -0
- package/docs/examples/account/list-sessions.md +1 -0
- package/docs/examples/account/update-email.md +3 -0
- package/docs/examples/account/update-m-f-a.md +2 -0
- package/docs/examples/account/update-magic-u-r-l-session.md +3 -0
- package/docs/examples/account/update-mfa-authenticator.md +3 -0
- package/docs/examples/account/update-mfa-challenge.md +3 -0
- package/docs/examples/account/update-mfa-recovery-codes.md +1 -0
- package/docs/examples/account/update-name.md +2 -0
- package/docs/examples/account/update-password.md +3 -0
- package/docs/examples/account/update-phone-session.md +3 -0
- package/docs/examples/account/update-phone-verification.md +3 -0
- package/docs/examples/account/update-phone.md +3 -0
- package/docs/examples/account/update-prefs.md +2 -0
- package/docs/examples/account/update-push-target.md +3 -0
- package/docs/examples/account/update-recovery.md +4 -0
- package/docs/examples/account/update-session.md +2 -0
- package/docs/examples/account/update-status.md +1 -0
- package/docs/examples/account/update-verification.md +3 -0
- package/docs/examples/avatars/get-browser.md +5 -0
- package/docs/examples/avatars/get-credit-card.md +5 -0
- package/docs/examples/avatars/get-favicon.md +2 -0
- package/docs/examples/avatars/get-flag.md +5 -0
- package/docs/examples/avatars/get-image.md +4 -0
- package/docs/examples/avatars/get-initials.md +5 -0
- package/docs/examples/avatars/get-q-r.md +5 -0
- package/docs/examples/console/get-resource.md +3 -0
- package/docs/examples/console/variables.md +1 -0
- package/docs/examples/databases/create-boolean-attribute.md +7 -0
- package/docs/examples/databases/create-collection.md +7 -0
- package/docs/examples/databases/create-datetime-attribute.md +7 -0
- package/docs/examples/databases/create-document.md +6 -0
- package/docs/examples/databases/create-documents.md +4 -0
- package/docs/examples/databases/create-email-attribute.md +7 -0
- package/docs/examples/databases/create-enum-attribute.md +8 -0
- package/docs/examples/databases/create-float-attribute.md +9 -0
- package/docs/examples/databases/create-index.md +8 -0
- package/docs/examples/databases/create-integer-attribute.md +9 -0
- package/docs/examples/databases/create-ip-attribute.md +7 -0
- package/docs/examples/databases/create-relationship-attribute.md +9 -0
- package/docs/examples/databases/create-string-attribute.md +9 -0
- package/docs/examples/databases/create-url-attribute.md +7 -0
- package/docs/examples/databases/create.md +4 -0
- package/docs/examples/databases/decrement-document-attribute.md +7 -0
- package/docs/examples/databases/delete-attribute.md +4 -0
- package/docs/examples/databases/delete-collection.md +3 -0
- package/docs/examples/databases/delete-document.md +4 -0
- package/docs/examples/databases/delete-documents.md +4 -0
- package/docs/examples/databases/delete-index.md +4 -0
- package/docs/examples/databases/delete.md +2 -0
- package/docs/examples/databases/get-attribute.md +4 -0
- package/docs/examples/databases/get-collection-usage.md +4 -0
- package/docs/examples/databases/get-collection.md +3 -0
- package/docs/examples/databases/get-database-usage.md +3 -0
- package/docs/examples/databases/get-document.md +5 -0
- package/docs/examples/databases/get-index.md +4 -0
- package/docs/examples/databases/get-usage.md +2 -0
- package/docs/examples/databases/get.md +2 -0
- package/docs/examples/databases/increment-document-attribute.md +7 -0
- package/docs/examples/databases/list-attributes.md +4 -0
- package/docs/examples/databases/list-collection-logs.md +4 -0
- package/docs/examples/databases/list-collections.md +4 -0
- package/docs/examples/databases/list-document-logs.md +5 -0
- package/docs/examples/databases/list-documents.md +4 -0
- package/docs/examples/databases/list-indexes.md +4 -0
- package/docs/examples/databases/list-logs.md +3 -0
- package/docs/examples/databases/list.md +3 -0
- package/docs/examples/databases/update-boolean-attribute.md +7 -0
- package/docs/examples/databases/update-collection.md +7 -0
- package/docs/examples/databases/update-datetime-attribute.md +7 -0
- package/docs/examples/databases/update-document.md +6 -0
- package/docs/examples/databases/update-documents.md +5 -0
- package/docs/examples/databases/update-email-attribute.md +7 -0
- package/docs/examples/databases/update-enum-attribute.md +8 -0
- package/docs/examples/databases/update-float-attribute.md +9 -0
- package/docs/examples/databases/update-integer-attribute.md +9 -0
- package/docs/examples/databases/update-ip-attribute.md +7 -0
- package/docs/examples/databases/update-relationship-attribute.md +6 -0
- package/docs/examples/databases/update-string-attribute.md +8 -0
- package/docs/examples/databases/update-url-attribute.md +7 -0
- package/docs/examples/databases/update.md +4 -0
- package/docs/examples/databases/upsert-document.md +6 -0
- package/docs/examples/databases/upsert-documents.md +4 -0
- package/docs/examples/functions/create-deployment.md +6 -0
- package/docs/examples/functions/create-duplicate-deployment.md +4 -0
- package/docs/examples/functions/create-execution.md +8 -0
- package/docs/examples/functions/create-template-deployment.md +7 -0
- package/docs/examples/functions/create-variable.md +5 -0
- package/docs/examples/functions/create-vcs-deployment.md +5 -0
- package/docs/examples/functions/create.md +19 -0
- package/docs/examples/functions/delete-deployment.md +3 -0
- package/docs/examples/functions/delete-execution.md +3 -0
- package/docs/examples/functions/delete-variable.md +3 -0
- package/docs/examples/functions/delete.md +2 -0
- package/docs/examples/functions/get-deployment-download.md +4 -0
- package/docs/examples/functions/get-deployment.md +3 -0
- package/docs/examples/functions/get-execution.md +3 -0
- package/docs/examples/functions/get-template.md +2 -0
- package/docs/examples/functions/get-usage.md +3 -0
- package/docs/examples/functions/get-variable.md +3 -0
- package/docs/examples/functions/get.md +2 -0
- package/docs/examples/functions/list-deployments.md +4 -0
- package/docs/examples/functions/list-executions.md +3 -0
- package/docs/examples/functions/list-runtimes.md +1 -0
- package/docs/examples/functions/list-specifications.md +1 -0
- package/docs/examples/functions/list-templates.md +5 -0
- package/docs/examples/functions/list-usage.md +2 -0
- package/docs/examples/functions/list-variables.md +2 -0
- package/docs/examples/functions/list.md +3 -0
- package/docs/examples/functions/update-deployment-status.md +3 -0
- package/docs/examples/functions/update-function-deployment.md +3 -0
- package/docs/examples/functions/update-variable.md +6 -0
- package/docs/examples/functions/update.md +19 -0
- package/docs/examples/graphql/mutation.md +2 -0
- package/docs/examples/graphql/query.md +2 -0
- package/docs/examples/health/get-antivirus.md +1 -0
- package/docs/examples/health/get-cache.md +1 -0
- package/docs/examples/health/get-certificate.md +2 -0
- package/docs/examples/health/get-d-b.md +1 -0
- package/docs/examples/health/get-failed-jobs.md +3 -0
- package/docs/examples/health/get-pub-sub.md +1 -0
- package/docs/examples/health/get-queue-builds.md +2 -0
- package/docs/examples/health/get-queue-certificates.md +2 -0
- package/docs/examples/health/get-queue-databases.md +3 -0
- package/docs/examples/health/get-queue-deletes.md +2 -0
- package/docs/examples/health/get-queue-functions.md +2 -0
- package/docs/examples/health/get-queue-logs.md +2 -0
- package/docs/examples/health/get-queue-mails.md +2 -0
- package/docs/examples/health/get-queue-messaging.md +2 -0
- package/docs/examples/health/get-queue-migrations.md +2 -0
- package/docs/examples/health/get-queue-stats-resources.md +2 -0
- package/docs/examples/health/get-queue-usage.md +2 -0
- package/docs/examples/health/get-queue-webhooks.md +2 -0
- package/docs/examples/health/get-storage-local.md +1 -0
- package/docs/examples/health/get-storage.md +1 -0
- package/docs/examples/health/get-time.md +1 -0
- package/docs/examples/health/get.md +1 -0
- package/docs/examples/locale/get.md +1 -0
- package/docs/examples/locale/list-codes.md +1 -0
- package/docs/examples/locale/list-continents.md +1 -0
- package/docs/examples/locale/list-countries-e-u.md +1 -0
- package/docs/examples/locale/list-countries-phones.md +1 -0
- package/docs/examples/locale/list-countries.md +1 -0
- package/docs/examples/locale/list-currencies.md +1 -0
- package/docs/examples/locale/list-languages.md +1 -0
- package/docs/examples/messaging/create-apns-provider.md +9 -0
- package/docs/examples/messaging/create-email.md +13 -0
- package/docs/examples/messaging/create-fcm-provider.md +5 -0
- package/docs/examples/messaging/create-mailgun-provider.md +11 -0
- package/docs/examples/messaging/create-msg91provider.md +7 -0
- package/docs/examples/messaging/create-push.md +20 -0
- package/docs/examples/messaging/create-sendgrid-provider.md +9 -0
- package/docs/examples/messaging/create-sms.md +8 -0
- package/docs/examples/messaging/create-smtp-provider.md +15 -0
- package/docs/examples/messaging/create-subscriber.md +4 -0
- package/docs/examples/messaging/create-telesign-provider.md +7 -0
- package/docs/examples/messaging/create-textmagic-provider.md +7 -0
- package/docs/examples/messaging/create-topic.md +4 -0
- package/docs/examples/messaging/create-twilio-provider.md +7 -0
- package/docs/examples/messaging/create-vonage-provider.md +7 -0
- package/docs/examples/messaging/delete-provider.md +2 -0
- package/docs/examples/messaging/delete-subscriber.md +3 -0
- package/docs/examples/messaging/delete-topic.md +2 -0
- package/docs/examples/messaging/delete.md +2 -0
- package/docs/examples/messaging/get-message.md +2 -0
- package/docs/examples/messaging/get-provider.md +2 -0
- package/docs/examples/messaging/get-subscriber.md +3 -0
- package/docs/examples/messaging/get-topic.md +2 -0
- package/docs/examples/messaging/list-message-logs.md +3 -0
- package/docs/examples/messaging/list-messages.md +3 -0
- package/docs/examples/messaging/list-provider-logs.md +3 -0
- package/docs/examples/messaging/list-providers.md +3 -0
- package/docs/examples/messaging/list-subscriber-logs.md +3 -0
- package/docs/examples/messaging/list-subscribers.md +4 -0
- package/docs/examples/messaging/list-targets.md +3 -0
- package/docs/examples/messaging/list-topic-logs.md +3 -0
- package/docs/examples/messaging/list-topics.md +3 -0
- package/docs/examples/messaging/update-apns-provider.md +9 -0
- package/docs/examples/messaging/update-email.md +13 -0
- package/docs/examples/messaging/update-fcm-provider.md +5 -0
- package/docs/examples/messaging/update-mailgun-provider.md +11 -0
- package/docs/examples/messaging/update-msg91provider.md +7 -0
- package/docs/examples/messaging/update-push.md +20 -0
- package/docs/examples/messaging/update-sendgrid-provider.md +9 -0
- package/docs/examples/messaging/update-sms.md +8 -0
- package/docs/examples/messaging/update-smtp-provider.md +15 -0
- package/docs/examples/messaging/update-telesign-provider.md +7 -0
- package/docs/examples/messaging/update-textmagic-provider.md +7 -0
- package/docs/examples/messaging/update-topic.md +4 -0
- package/docs/examples/messaging/update-twilio-provider.md +7 -0
- package/docs/examples/messaging/update-vonage-provider.md +7 -0
- package/docs/examples/migrations/create-appwrite-migration.md +5 -0
- package/docs/examples/migrations/create-csv-migration.md +4 -0
- package/docs/examples/migrations/create-firebase-migration.md +3 -0
- package/docs/examples/migrations/create-n-host-migration.md +9 -0
- package/docs/examples/migrations/create-supabase-migration.md +8 -0
- package/docs/examples/migrations/delete.md +2 -0
- package/docs/examples/migrations/get-appwrite-report.md +5 -0
- package/docs/examples/migrations/get-firebase-report.md +3 -0
- package/docs/examples/migrations/get-n-host-report.md +9 -0
- package/docs/examples/migrations/get-supabase-report.md +8 -0
- package/docs/examples/migrations/get.md +2 -0
- package/docs/examples/migrations/list.md +3 -0
- package/docs/examples/migrations/retry.md +2 -0
- package/docs/examples/project/create-variable.md +4 -0
- package/docs/examples/project/delete-variable.md +2 -0
- package/docs/examples/project/get-usage.md +4 -0
- package/docs/examples/project/get-variable.md +2 -0
- package/docs/examples/project/list-variables.md +1 -0
- package/docs/examples/project/update-variable.md +5 -0
- package/docs/examples/projects/create-dev-key.md +4 -0
- package/docs/examples/projects/create-j-w-t.md +4 -0
- package/docs/examples/projects/create-key.md +5 -0
- package/docs/examples/projects/create-platform.md +7 -0
- package/docs/examples/projects/create-smtp-test.md +11 -0
- package/docs/examples/projects/create-webhook.md +9 -0
- package/docs/examples/projects/create.md +14 -0
- package/docs/examples/projects/delete-dev-key.md +3 -0
- package/docs/examples/projects/delete-email-template.md +4 -0
- package/docs/examples/projects/delete-key.md +3 -0
- package/docs/examples/projects/delete-platform.md +3 -0
- package/docs/examples/projects/delete-sms-template.md +4 -0
- package/docs/examples/projects/delete-webhook.md +3 -0
- package/docs/examples/projects/delete.md +2 -0
- package/docs/examples/projects/get-dev-key.md +3 -0
- package/docs/examples/projects/get-email-template.md +4 -0
- package/docs/examples/projects/get-key.md +3 -0
- package/docs/examples/projects/get-platform.md +3 -0
- package/docs/examples/projects/get-sms-template.md +4 -0
- package/docs/examples/projects/get-webhook.md +3 -0
- package/docs/examples/projects/get.md +2 -0
- package/docs/examples/projects/list-dev-keys.md +3 -0
- package/docs/examples/projects/list-keys.md +2 -0
- package/docs/examples/projects/list-platforms.md +2 -0
- package/docs/examples/projects/list-webhooks.md +2 -0
- package/docs/examples/projects/list.md +3 -0
- package/docs/examples/projects/update-api-status-all.md +3 -0
- package/docs/examples/projects/update-api-status.md +4 -0
- package/docs/examples/projects/update-auth-duration.md +3 -0
- package/docs/examples/projects/update-auth-limit.md +3 -0
- package/docs/examples/projects/update-auth-password-dictionary.md +3 -0
- package/docs/examples/projects/update-auth-password-history.md +3 -0
- package/docs/examples/projects/update-auth-sessions-limit.md +3 -0
- package/docs/examples/projects/update-auth-status.md +4 -0
- package/docs/examples/projects/update-dev-key.md +5 -0
- package/docs/examples/projects/update-email-template.md +9 -0
- package/docs/examples/projects/update-key.md +6 -0
- package/docs/examples/projects/update-memberships-privacy.md +5 -0
- package/docs/examples/projects/update-mock-numbers.md +3 -0
- package/docs/examples/projects/update-o-auth2.md +6 -0
- package/docs/examples/projects/update-personal-data-check.md +3 -0
- package/docs/examples/projects/update-platform.md +7 -0
- package/docs/examples/projects/update-service-status-all.md +3 -0
- package/docs/examples/projects/update-service-status.md +4 -0
- package/docs/examples/projects/update-session-alerts.md +3 -0
- package/docs/examples/projects/update-sms-template.md +5 -0
- package/docs/examples/projects/update-smtp.md +11 -0
- package/docs/examples/projects/update-team.md +3 -0
- package/docs/examples/projects/update-webhook-signature.md +3 -0
- package/docs/examples/projects/update-webhook.md +10 -0
- package/docs/examples/projects/update.md +12 -0
- package/docs/examples/proxy/create-a-p-i-rule.md +2 -0
- package/docs/examples/proxy/create-function-rule.md +4 -0
- package/docs/examples/proxy/create-redirect-rule.md +6 -0
- package/docs/examples/proxy/create-site-rule.md +4 -0
- package/docs/examples/proxy/delete-rule.md +2 -0
- package/docs/examples/proxy/get-rule.md +2 -0
- package/docs/examples/proxy/list-rules.md +3 -0
- package/docs/examples/proxy/update-rule-verification.md +2 -0
- package/docs/examples/sites/create-deployment.md +7 -0
- package/docs/examples/sites/create-duplicate-deployment.md +3 -0
- package/docs/examples/sites/create-template-deployment.md +7 -0
- package/docs/examples/sites/create-variable.md +5 -0
- package/docs/examples/sites/create-vcs-deployment.md +5 -0
- package/docs/examples/sites/create.md +19 -0
- package/docs/examples/sites/delete-deployment.md +3 -0
- package/docs/examples/sites/delete-log.md +3 -0
- package/docs/examples/sites/delete-variable.md +3 -0
- package/docs/examples/sites/delete.md +2 -0
- package/docs/examples/sites/get-deployment-download.md +4 -0
- package/docs/examples/sites/get-deployment.md +3 -0
- package/docs/examples/sites/get-log.md +3 -0
- package/docs/examples/sites/get-template.md +2 -0
- package/docs/examples/sites/get-usage.md +3 -0
- package/docs/examples/sites/get-variable.md +3 -0
- package/docs/examples/sites/get.md +2 -0
- package/docs/examples/sites/list-deployments.md +4 -0
- package/docs/examples/sites/list-frameworks.md +1 -0
- package/docs/examples/sites/list-logs.md +3 -0
- package/docs/examples/sites/list-specifications.md +1 -0
- package/docs/examples/sites/list-templates.md +5 -0
- package/docs/examples/sites/list-usage.md +2 -0
- package/docs/examples/sites/list-variables.md +2 -0
- package/docs/examples/sites/list.md +3 -0
- package/docs/examples/sites/update-deployment-status.md +3 -0
- package/docs/examples/sites/update-site-deployment.md +3 -0
- package/docs/examples/sites/update-variable.md +6 -0
- package/docs/examples/sites/update.md +19 -0
- package/docs/examples/storage/create-bucket.md +11 -0
- package/docs/examples/storage/create-file.md +5 -0
- package/docs/examples/storage/delete-bucket.md +2 -0
- package/docs/examples/storage/delete-file.md +3 -0
- package/docs/examples/storage/get-bucket-usage.md +3 -0
- package/docs/examples/storage/get-bucket.md +2 -0
- package/docs/examples/storage/get-file-download.md +4 -0
- package/docs/examples/storage/get-file-preview.md +15 -0
- package/docs/examples/storage/get-file-view.md +4 -0
- package/docs/examples/storage/get-file.md +3 -0
- package/docs/examples/storage/get-usage.md +2 -0
- package/docs/examples/storage/list-buckets.md +3 -0
- package/docs/examples/storage/list-files.md +4 -0
- package/docs/examples/storage/update-bucket.md +11 -0
- package/docs/examples/storage/update-file.md +5 -0
- package/docs/examples/teams/create-membership.md +8 -0
- package/docs/examples/teams/create.md +4 -0
- package/docs/examples/teams/delete-membership.md +3 -0
- package/docs/examples/teams/delete.md +2 -0
- package/docs/examples/teams/get-membership.md +3 -0
- package/docs/examples/teams/get-prefs.md +2 -0
- package/docs/examples/teams/get.md +2 -0
- package/docs/examples/teams/list-logs.md +3 -0
- package/docs/examples/teams/list-memberships.md +4 -0
- package/docs/examples/teams/list.md +3 -0
- package/docs/examples/teams/update-membership-status.md +5 -0
- package/docs/examples/teams/update-membership.md +4 -0
- package/docs/examples/teams/update-name.md +3 -0
- package/docs/examples/teams/update-prefs.md +3 -0
- package/docs/examples/tokens/create-file-token.md +4 -0
- package/docs/examples/tokens/delete.md +2 -0
- package/docs/examples/tokens/get.md +2 -0
- package/docs/examples/tokens/list.md +4 -0
- package/docs/examples/tokens/update.md +3 -0
- package/docs/examples/users/create-argon2user.md +5 -0
- package/docs/examples/users/create-bcrypt-user.md +5 -0
- package/docs/examples/users/create-j-w-t.md +4 -0
- package/docs/examples/users/create-m-d5user.md +5 -0
- package/docs/examples/users/create-mfa-recovery-codes.md +2 -0
- package/docs/examples/users/create-p-h-pass-user.md +5 -0
- package/docs/examples/users/create-s-h-a-user.md +6 -0
- package/docs/examples/users/create-scrypt-modified-user.md +8 -0
- package/docs/examples/users/create-scrypt-user.md +10 -0
- package/docs/examples/users/create-session.md +2 -0
- package/docs/examples/users/create-target.md +7 -0
- package/docs/examples/users/create-token.md +4 -0
- package/docs/examples/users/create.md +6 -0
- package/docs/examples/users/delete-identity.md +2 -0
- package/docs/examples/users/delete-mfa-authenticator.md +3 -0
- package/docs/examples/users/delete-session.md +3 -0
- package/docs/examples/users/delete-sessions.md +2 -0
- package/docs/examples/users/delete-target.md +3 -0
- package/docs/examples/users/delete.md +2 -0
- package/docs/examples/users/get-mfa-recovery-codes.md +2 -0
- package/docs/examples/users/get-prefs.md +2 -0
- package/docs/examples/users/get-target.md +3 -0
- package/docs/examples/users/get-usage.md +2 -0
- package/docs/examples/users/get.md +2 -0
- package/docs/examples/users/list-identities.md +3 -0
- package/docs/examples/users/list-logs.md +3 -0
- package/docs/examples/users/list-memberships.md +4 -0
- package/docs/examples/users/list-mfa-factors.md +2 -0
- package/docs/examples/users/list-sessions.md +2 -0
- package/docs/examples/users/list-targets.md +3 -0
- package/docs/examples/users/list.md +3 -0
- package/docs/examples/users/update-email-verification.md +3 -0
- package/docs/examples/users/update-email.md +3 -0
- package/docs/examples/users/update-labels.md +3 -0
- package/docs/examples/users/update-mfa-recovery-codes.md +2 -0
- package/docs/examples/users/update-mfa.md +3 -0
- package/docs/examples/users/update-name.md +3 -0
- package/docs/examples/users/update-password.md +3 -0
- package/docs/examples/users/update-phone-verification.md +3 -0
- package/docs/examples/users/update-phone.md +3 -0
- package/docs/examples/users/update-prefs.md +3 -0
- package/docs/examples/users/update-status.md +3 -0
- package/docs/examples/users/update-target.md +6 -0
- package/docs/examples/vcs/create-repository-detection.md +5 -0
- package/docs/examples/vcs/create-repository.md +4 -0
- package/docs/examples/vcs/delete-installation.md +2 -0
- package/docs/examples/vcs/get-installation.md +2 -0
- package/docs/examples/vcs/get-repository-contents.md +5 -0
- package/docs/examples/vcs/get-repository.md +3 -0
- package/docs/examples/vcs/list-installations.md +3 -0
- package/docs/examples/vcs/list-repositories.md +4 -0
- package/docs/examples/vcs/list-repository-branches.md +3 -0
- package/docs/examples/vcs/update-external-deployments.md +4 -0
- package/functions/Starter function/.prettierrc.json +6 -0
- package/functions/Starter function/README.md +48 -0
- package/functions/Starter function/package-lock.json +60 -0
- package/functions/Starter function/package.json +16 -0
- package/functions/Starter function/src/main.js +35 -0
- package/generate/appwrite.d.ts +18 -0
- package/index.js +109 -0
- package/install.ps1 +98 -0
- package/install.sh +157 -0
- package/lib/client.js +259 -0
- package/lib/commands/account.js +2074 -0
- package/lib/commands/avatars.js +491 -0
- package/lib/commands/console.js +129 -0
- package/lib/commands/databases.js +2972 -0
- package/lib/commands/functions.js +1737 -0
- package/lib/commands/generic.js +328 -0
- package/lib/commands/graphql.js +128 -0
- package/lib/commands/health.js +891 -0
- package/lib/commands/init.js +566 -0
- package/lib/commands/locale.js +324 -0
- package/lib/commands/messaging.js +2970 -0
- package/lib/commands/migrations.js +751 -0
- package/lib/commands/organizations.js +48 -0
- package/lib/commands/project.js +308 -0
- package/lib/commands/projects.js +2615 -0
- package/lib/commands/proxy.js +406 -0
- package/lib/commands/pull.js +474 -0
- package/lib/commands/push.js +2117 -0
- package/lib/commands/run.js +330 -0
- package/lib/commands/sites.js +1663 -0
- package/lib/commands/storage.js +990 -0
- package/lib/commands/teams.js +682 -0
- package/lib/commands/tokens.js +261 -0
- package/lib/commands/types.js +156 -0
- package/lib/commands/users.js +2035 -0
- package/lib/commands/vcs.js +484 -0
- package/lib/config.js +705 -0
- package/lib/emulation/docker.js +264 -0
- package/lib/emulation/utils.js +186 -0
- package/lib/exception.js +9 -0
- package/lib/id.js +30 -0
- package/lib/paginate.js +52 -0
- package/lib/parser.js +246 -0
- package/lib/questions.js +1006 -0
- package/lib/sdks.js +60 -0
- package/lib/spinner.js +104 -0
- package/lib/type-generation/attribute.js +16 -0
- package/lib/type-generation/languages/dart.js +196 -0
- package/lib/type-generation/languages/java.js +130 -0
- package/lib/type-generation/languages/javascript.js +102 -0
- package/lib/type-generation/languages/kotlin.js +84 -0
- package/lib/type-generation/languages/language.js +125 -0
- package/lib/type-generation/languages/php.js +109 -0
- package/lib/type-generation/languages/swift.js +169 -0
- package/lib/type-generation/languages/typescript.js +102 -0
- package/lib/utils.js +289 -0
- package/lib/validations.js +17 -0
- package/package.json +50 -0
- package/scoop/appwrite.json +30 -0
- package/sites/JavaScript starter/.env.example +3 -0
- package/sites/JavaScript starter/LICENSE +21 -0
- package/sites/JavaScript starter/images/appwrite.svg +8 -0
- package/sites/JavaScript starter/images/javascript.svg +5 -0
- package/sites/JavaScript starter/index.html +250 -0
- package/sites/JavaScript starter/lib/appwrite.js +10 -0
- package/sites/JavaScript starter/package-lock.json +1431 -0
- package/sites/JavaScript starter/package.json +21 -0
- package/sites/JavaScript starter/readme.md +26 -0
- package/sites/JavaScript starter/src/javascript.svg +1 -0
- package/sites/JavaScript starter/style/app.css +20 -0
- package/sites/JavaScript starter/vite.config.js +7 -0
|
@@ -0,0 +1,2970 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const pathLib = require('path');
|
|
3
|
+
const tar = require("tar");
|
|
4
|
+
const ignore = require("ignore");
|
|
5
|
+
const { promisify } = require('util');
|
|
6
|
+
const libClient = require('../client.js');
|
|
7
|
+
const { getAllFiles, showConsoleLink } = require('../utils.js');
|
|
8
|
+
const { Command } = require('commander');
|
|
9
|
+
const { sdkForProject, sdkForConsole } = require('../sdks')
|
|
10
|
+
const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log } = require('../parser')
|
|
11
|
+
const { localConfig, globalConfig } = require("../config");
|
|
12
|
+
const { File } = require('undici');
|
|
13
|
+
const { ReadableStream } = require('stream/web');
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @param {fs.ReadStream} readStream
|
|
17
|
+
* @returns {ReadableStream}
|
|
18
|
+
*/
|
|
19
|
+
function convertReadStreamToReadableStream(readStream) {
|
|
20
|
+
return new ReadableStream({
|
|
21
|
+
start(controller) {
|
|
22
|
+
readStream.on("data", (chunk) => {
|
|
23
|
+
controller.enqueue(chunk);
|
|
24
|
+
});
|
|
25
|
+
readStream.on("end", () => {
|
|
26
|
+
controller.close();
|
|
27
|
+
});
|
|
28
|
+
readStream.on("error", (err) => {
|
|
29
|
+
controller.error(err);
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
cancel() {
|
|
33
|
+
readStream.destroy();
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const messaging = new Command("messaging").description(commandDescriptions['messaging'] ?? '').configureHelp({
|
|
39
|
+
helpWidth: process.stdout.columns || 80
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @typedef {Object} MessagingListMessagesRequestParams
|
|
44
|
+
* @property {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
|
|
45
|
+
* @property {string} search Search term to filter your list results. Max length: 256 chars.
|
|
46
|
+
* @property {boolean} overrideForCli
|
|
47
|
+
* @property {boolean} parseOutput
|
|
48
|
+
* @property {libClient | undefined} sdk
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @param {MessagingListMessagesRequestParams} params
|
|
53
|
+
*/
|
|
54
|
+
const messagingListMessages = async ({queries,search,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
55
|
+
let client = !sdk ? await sdkForProject() :
|
|
56
|
+
sdk;
|
|
57
|
+
let apiPath = '/messaging/messages';
|
|
58
|
+
let payload = {};
|
|
59
|
+
if (typeof queries !== 'undefined') {
|
|
60
|
+
payload['queries'] = queries;
|
|
61
|
+
}
|
|
62
|
+
if (typeof search !== 'undefined') {
|
|
63
|
+
payload['search'] = search;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
let response = undefined;
|
|
67
|
+
|
|
68
|
+
response = await client.call('get', apiPath, {
|
|
69
|
+
}, payload);
|
|
70
|
+
|
|
71
|
+
if (parseOutput) {
|
|
72
|
+
if(console) {
|
|
73
|
+
showConsoleLink('messaging', 'listMessages');
|
|
74
|
+
} else {
|
|
75
|
+
parse(response)
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return response;
|
|
80
|
+
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* @typedef {Object} MessagingCreateEmailRequestParams
|
|
85
|
+
* @property {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.
|
|
86
|
+
* @property {string} subject Email Subject.
|
|
87
|
+
* @property {string} content Email Content.
|
|
88
|
+
* @property {string[]} topics List of Topic IDs.
|
|
89
|
+
* @property {string[]} users List of User IDs.
|
|
90
|
+
* @property {string[]} targets List of Targets IDs.
|
|
91
|
+
* @property {string[]} cc Array of target IDs to be added as CC.
|
|
92
|
+
* @property {string[]} bcc Array of target IDs to be added as BCC.
|
|
93
|
+
* @property {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>.
|
|
94
|
+
* @property {boolean} draft Is message a draft
|
|
95
|
+
* @property {boolean} html Is content of type HTML
|
|
96
|
+
* @property {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.
|
|
97
|
+
* @property {boolean} overrideForCli
|
|
98
|
+
* @property {boolean} parseOutput
|
|
99
|
+
* @property {libClient | undefined} sdk
|
|
100
|
+
*/
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* @param {MessagingCreateEmailRequestParams} params
|
|
104
|
+
*/
|
|
105
|
+
const messagingCreateEmail = async ({messageId,subject,content,topics,users,targets,cc,bcc,attachments,draft,html,scheduledAt,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
106
|
+
let client = !sdk ? await sdkForProject() :
|
|
107
|
+
sdk;
|
|
108
|
+
let apiPath = '/messaging/messages/email';
|
|
109
|
+
let payload = {};
|
|
110
|
+
if (typeof messageId !== 'undefined') {
|
|
111
|
+
payload['messageId'] = messageId;
|
|
112
|
+
}
|
|
113
|
+
if (typeof subject !== 'undefined') {
|
|
114
|
+
payload['subject'] = subject;
|
|
115
|
+
}
|
|
116
|
+
if (typeof content !== 'undefined') {
|
|
117
|
+
payload['content'] = content;
|
|
118
|
+
}
|
|
119
|
+
topics = topics === true ? [] : topics;
|
|
120
|
+
if (typeof topics !== 'undefined') {
|
|
121
|
+
payload['topics'] = topics;
|
|
122
|
+
}
|
|
123
|
+
users = users === true ? [] : users;
|
|
124
|
+
if (typeof users !== 'undefined') {
|
|
125
|
+
payload['users'] = users;
|
|
126
|
+
}
|
|
127
|
+
targets = targets === true ? [] : targets;
|
|
128
|
+
if (typeof targets !== 'undefined') {
|
|
129
|
+
payload['targets'] = targets;
|
|
130
|
+
}
|
|
131
|
+
cc = cc === true ? [] : cc;
|
|
132
|
+
if (typeof cc !== 'undefined') {
|
|
133
|
+
payload['cc'] = cc;
|
|
134
|
+
}
|
|
135
|
+
bcc = bcc === true ? [] : bcc;
|
|
136
|
+
if (typeof bcc !== 'undefined') {
|
|
137
|
+
payload['bcc'] = bcc;
|
|
138
|
+
}
|
|
139
|
+
attachments = attachments === true ? [] : attachments;
|
|
140
|
+
if (typeof attachments !== 'undefined') {
|
|
141
|
+
payload['attachments'] = attachments;
|
|
142
|
+
}
|
|
143
|
+
if (typeof draft !== 'undefined') {
|
|
144
|
+
payload['draft'] = draft;
|
|
145
|
+
}
|
|
146
|
+
if (typeof html !== 'undefined') {
|
|
147
|
+
payload['html'] = html;
|
|
148
|
+
}
|
|
149
|
+
if (typeof scheduledAt !== 'undefined') {
|
|
150
|
+
payload['scheduledAt'] = scheduledAt;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
let response = undefined;
|
|
154
|
+
|
|
155
|
+
response = await client.call('post', apiPath, {
|
|
156
|
+
'content-type': 'application/json',
|
|
157
|
+
}, payload);
|
|
158
|
+
|
|
159
|
+
if (parseOutput) {
|
|
160
|
+
parse(response)
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return response;
|
|
164
|
+
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* @typedef {Object} MessagingUpdateEmailRequestParams
|
|
169
|
+
* @property {string} messageId Message ID.
|
|
170
|
+
* @property {string[]} topics List of Topic IDs.
|
|
171
|
+
* @property {string[]} users List of User IDs.
|
|
172
|
+
* @property {string[]} targets List of Targets IDs.
|
|
173
|
+
* @property {string} subject Email Subject.
|
|
174
|
+
* @property {string} content Email Content.
|
|
175
|
+
* @property {boolean} draft Is message a draft
|
|
176
|
+
* @property {boolean} html Is content of type HTML
|
|
177
|
+
* @property {string[]} cc Array of target IDs to be added as CC.
|
|
178
|
+
* @property {string[]} bcc Array of target IDs to be added as BCC.
|
|
179
|
+
* @property {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.
|
|
180
|
+
* @property {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>.
|
|
181
|
+
* @property {boolean} overrideForCli
|
|
182
|
+
* @property {boolean} parseOutput
|
|
183
|
+
* @property {libClient | undefined} sdk
|
|
184
|
+
*/
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* @param {MessagingUpdateEmailRequestParams} params
|
|
188
|
+
*/
|
|
189
|
+
const messagingUpdateEmail = async ({messageId,topics,users,targets,subject,content,draft,html,cc,bcc,scheduledAt,attachments,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
190
|
+
let client = !sdk ? await sdkForProject() :
|
|
191
|
+
sdk;
|
|
192
|
+
let apiPath = '/messaging/messages/email/{messageId}'.replace('{messageId}', messageId);
|
|
193
|
+
let payload = {};
|
|
194
|
+
topics = topics === true ? [] : topics;
|
|
195
|
+
if (typeof topics !== 'undefined') {
|
|
196
|
+
payload['topics'] = topics;
|
|
197
|
+
}
|
|
198
|
+
users = users === true ? [] : users;
|
|
199
|
+
if (typeof users !== 'undefined') {
|
|
200
|
+
payload['users'] = users;
|
|
201
|
+
}
|
|
202
|
+
targets = targets === true ? [] : targets;
|
|
203
|
+
if (typeof targets !== 'undefined') {
|
|
204
|
+
payload['targets'] = targets;
|
|
205
|
+
}
|
|
206
|
+
if (typeof subject !== 'undefined') {
|
|
207
|
+
payload['subject'] = subject;
|
|
208
|
+
}
|
|
209
|
+
if (typeof content !== 'undefined') {
|
|
210
|
+
payload['content'] = content;
|
|
211
|
+
}
|
|
212
|
+
if (typeof draft !== 'undefined') {
|
|
213
|
+
payload['draft'] = draft;
|
|
214
|
+
}
|
|
215
|
+
if (typeof html !== 'undefined') {
|
|
216
|
+
payload['html'] = html;
|
|
217
|
+
}
|
|
218
|
+
cc = cc === true ? [] : cc;
|
|
219
|
+
if (typeof cc !== 'undefined') {
|
|
220
|
+
payload['cc'] = cc;
|
|
221
|
+
}
|
|
222
|
+
bcc = bcc === true ? [] : bcc;
|
|
223
|
+
if (typeof bcc !== 'undefined') {
|
|
224
|
+
payload['bcc'] = bcc;
|
|
225
|
+
}
|
|
226
|
+
if (typeof scheduledAt !== 'undefined') {
|
|
227
|
+
payload['scheduledAt'] = scheduledAt;
|
|
228
|
+
}
|
|
229
|
+
attachments = attachments === true ? [] : attachments;
|
|
230
|
+
if (typeof attachments !== 'undefined') {
|
|
231
|
+
payload['attachments'] = attachments;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
let response = undefined;
|
|
235
|
+
|
|
236
|
+
response = await client.call('patch', apiPath, {
|
|
237
|
+
'content-type': 'application/json',
|
|
238
|
+
}, payload);
|
|
239
|
+
|
|
240
|
+
if (parseOutput) {
|
|
241
|
+
parse(response)
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
return response;
|
|
245
|
+
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* @typedef {Object} MessagingCreatePushRequestParams
|
|
250
|
+
* @property {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.
|
|
251
|
+
* @property {string} title Title for push notification.
|
|
252
|
+
* @property {string} body Body for push notification.
|
|
253
|
+
* @property {string[]} topics List of Topic IDs.
|
|
254
|
+
* @property {string[]} users List of User IDs.
|
|
255
|
+
* @property {string[]} targets List of Targets IDs.
|
|
256
|
+
* @property {object} data Additional key-value pair data for push notification.
|
|
257
|
+
* @property {string} action Action for push notification.
|
|
258
|
+
* @property {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>.
|
|
259
|
+
* @property {string} icon Icon for push notification. Available only for Android and Web Platform.
|
|
260
|
+
* @property {string} sound Sound for push notification. Available only for Android and iOS Platform.
|
|
261
|
+
* @property {string} color Color for push notification. Available only for Android Platform.
|
|
262
|
+
* @property {string} tag Tag for push notification. Available only for Android Platform.
|
|
263
|
+
* @property {number} badge Badge for push notification. Available only for iOS Platform.
|
|
264
|
+
* @property {boolean} draft Is message a draft
|
|
265
|
+
* @property {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.
|
|
266
|
+
* @property {boolean} contentAvailable If set to true, the notification will be delivered in the background. Available only for iOS Platform.
|
|
267
|
+
* @property {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.
|
|
268
|
+
* @property {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.
|
|
269
|
+
* @property {boolean} overrideForCli
|
|
270
|
+
* @property {boolean} parseOutput
|
|
271
|
+
* @property {libClient | undefined} sdk
|
|
272
|
+
*/
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* @param {MessagingCreatePushRequestParams} params
|
|
276
|
+
*/
|
|
277
|
+
const messagingCreatePush = async ({messageId,title,body,topics,users,targets,data,action,image,icon,sound,color,tag,badge,draft,scheduledAt,contentAvailable,critical,priority,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
278
|
+
let client = !sdk ? await sdkForProject() :
|
|
279
|
+
sdk;
|
|
280
|
+
let apiPath = '/messaging/messages/push';
|
|
281
|
+
let payload = {};
|
|
282
|
+
if (typeof messageId !== 'undefined') {
|
|
283
|
+
payload['messageId'] = messageId;
|
|
284
|
+
}
|
|
285
|
+
if (typeof title !== 'undefined') {
|
|
286
|
+
payload['title'] = title;
|
|
287
|
+
}
|
|
288
|
+
if (typeof body !== 'undefined') {
|
|
289
|
+
payload['body'] = body;
|
|
290
|
+
}
|
|
291
|
+
topics = topics === true ? [] : topics;
|
|
292
|
+
if (typeof topics !== 'undefined') {
|
|
293
|
+
payload['topics'] = topics;
|
|
294
|
+
}
|
|
295
|
+
users = users === true ? [] : users;
|
|
296
|
+
if (typeof users !== 'undefined') {
|
|
297
|
+
payload['users'] = users;
|
|
298
|
+
}
|
|
299
|
+
targets = targets === true ? [] : targets;
|
|
300
|
+
if (typeof targets !== 'undefined') {
|
|
301
|
+
payload['targets'] = targets;
|
|
302
|
+
}
|
|
303
|
+
if (typeof data !== 'undefined') {
|
|
304
|
+
payload['data'] = JSON.parse(data);
|
|
305
|
+
}
|
|
306
|
+
if (typeof action !== 'undefined') {
|
|
307
|
+
payload['action'] = action;
|
|
308
|
+
}
|
|
309
|
+
if (typeof image !== 'undefined') {
|
|
310
|
+
payload['image'] = image;
|
|
311
|
+
}
|
|
312
|
+
if (typeof icon !== 'undefined') {
|
|
313
|
+
payload['icon'] = icon;
|
|
314
|
+
}
|
|
315
|
+
if (typeof sound !== 'undefined') {
|
|
316
|
+
payload['sound'] = sound;
|
|
317
|
+
}
|
|
318
|
+
if (typeof color !== 'undefined') {
|
|
319
|
+
payload['color'] = color;
|
|
320
|
+
}
|
|
321
|
+
if (typeof tag !== 'undefined') {
|
|
322
|
+
payload['tag'] = tag;
|
|
323
|
+
}
|
|
324
|
+
if (typeof badge !== 'undefined') {
|
|
325
|
+
payload['badge'] = badge;
|
|
326
|
+
}
|
|
327
|
+
if (typeof draft !== 'undefined') {
|
|
328
|
+
payload['draft'] = draft;
|
|
329
|
+
}
|
|
330
|
+
if (typeof scheduledAt !== 'undefined') {
|
|
331
|
+
payload['scheduledAt'] = scheduledAt;
|
|
332
|
+
}
|
|
333
|
+
if (typeof contentAvailable !== 'undefined') {
|
|
334
|
+
payload['contentAvailable'] = contentAvailable;
|
|
335
|
+
}
|
|
336
|
+
if (typeof critical !== 'undefined') {
|
|
337
|
+
payload['critical'] = critical;
|
|
338
|
+
}
|
|
339
|
+
if (typeof priority !== 'undefined') {
|
|
340
|
+
payload['priority'] = priority;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
let response = undefined;
|
|
344
|
+
|
|
345
|
+
response = await client.call('post', apiPath, {
|
|
346
|
+
'content-type': 'application/json',
|
|
347
|
+
}, payload);
|
|
348
|
+
|
|
349
|
+
if (parseOutput) {
|
|
350
|
+
parse(response)
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
return response;
|
|
354
|
+
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* @typedef {Object} MessagingUpdatePushRequestParams
|
|
359
|
+
* @property {string} messageId Message ID.
|
|
360
|
+
* @property {string[]} topics List of Topic IDs.
|
|
361
|
+
* @property {string[]} users List of User IDs.
|
|
362
|
+
* @property {string[]} targets List of Targets IDs.
|
|
363
|
+
* @property {string} title Title for push notification.
|
|
364
|
+
* @property {string} body Body for push notification.
|
|
365
|
+
* @property {object} data Additional Data for push notification.
|
|
366
|
+
* @property {string} action Action for push notification.
|
|
367
|
+
* @property {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>.
|
|
368
|
+
* @property {string} icon Icon for push notification. Available only for Android and Web platforms.
|
|
369
|
+
* @property {string} sound Sound for push notification. Available only for Android and iOS platforms.
|
|
370
|
+
* @property {string} color Color for push notification. Available only for Android platforms.
|
|
371
|
+
* @property {string} tag Tag for push notification. Available only for Android platforms.
|
|
372
|
+
* @property {number} badge Badge for push notification. Available only for iOS platforms.
|
|
373
|
+
* @property {boolean} draft Is message a draft
|
|
374
|
+
* @property {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.
|
|
375
|
+
* @property {boolean} contentAvailable If set to true, the notification will be delivered in the background. Available only for iOS Platform.
|
|
376
|
+
* @property {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.
|
|
377
|
+
* @property {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.
|
|
378
|
+
* @property {boolean} overrideForCli
|
|
379
|
+
* @property {boolean} parseOutput
|
|
380
|
+
* @property {libClient | undefined} sdk
|
|
381
|
+
*/
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* @param {MessagingUpdatePushRequestParams} params
|
|
385
|
+
*/
|
|
386
|
+
const messagingUpdatePush = async ({messageId,topics,users,targets,title,body,data,action,image,icon,sound,color,tag,badge,draft,scheduledAt,contentAvailable,critical,priority,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
387
|
+
let client = !sdk ? await sdkForProject() :
|
|
388
|
+
sdk;
|
|
389
|
+
let apiPath = '/messaging/messages/push/{messageId}'.replace('{messageId}', messageId);
|
|
390
|
+
let payload = {};
|
|
391
|
+
topics = topics === true ? [] : topics;
|
|
392
|
+
if (typeof topics !== 'undefined') {
|
|
393
|
+
payload['topics'] = topics;
|
|
394
|
+
}
|
|
395
|
+
users = users === true ? [] : users;
|
|
396
|
+
if (typeof users !== 'undefined') {
|
|
397
|
+
payload['users'] = users;
|
|
398
|
+
}
|
|
399
|
+
targets = targets === true ? [] : targets;
|
|
400
|
+
if (typeof targets !== 'undefined') {
|
|
401
|
+
payload['targets'] = targets;
|
|
402
|
+
}
|
|
403
|
+
if (typeof title !== 'undefined') {
|
|
404
|
+
payload['title'] = title;
|
|
405
|
+
}
|
|
406
|
+
if (typeof body !== 'undefined') {
|
|
407
|
+
payload['body'] = body;
|
|
408
|
+
}
|
|
409
|
+
if (typeof data !== 'undefined') {
|
|
410
|
+
payload['data'] = JSON.parse(data);
|
|
411
|
+
}
|
|
412
|
+
if (typeof action !== 'undefined') {
|
|
413
|
+
payload['action'] = action;
|
|
414
|
+
}
|
|
415
|
+
if (typeof image !== 'undefined') {
|
|
416
|
+
payload['image'] = image;
|
|
417
|
+
}
|
|
418
|
+
if (typeof icon !== 'undefined') {
|
|
419
|
+
payload['icon'] = icon;
|
|
420
|
+
}
|
|
421
|
+
if (typeof sound !== 'undefined') {
|
|
422
|
+
payload['sound'] = sound;
|
|
423
|
+
}
|
|
424
|
+
if (typeof color !== 'undefined') {
|
|
425
|
+
payload['color'] = color;
|
|
426
|
+
}
|
|
427
|
+
if (typeof tag !== 'undefined') {
|
|
428
|
+
payload['tag'] = tag;
|
|
429
|
+
}
|
|
430
|
+
if (typeof badge !== 'undefined') {
|
|
431
|
+
payload['badge'] = badge;
|
|
432
|
+
}
|
|
433
|
+
if (typeof draft !== 'undefined') {
|
|
434
|
+
payload['draft'] = draft;
|
|
435
|
+
}
|
|
436
|
+
if (typeof scheduledAt !== 'undefined') {
|
|
437
|
+
payload['scheduledAt'] = scheduledAt;
|
|
438
|
+
}
|
|
439
|
+
if (typeof contentAvailable !== 'undefined') {
|
|
440
|
+
payload['contentAvailable'] = contentAvailable;
|
|
441
|
+
}
|
|
442
|
+
if (typeof critical !== 'undefined') {
|
|
443
|
+
payload['critical'] = critical;
|
|
444
|
+
}
|
|
445
|
+
if (typeof priority !== 'undefined') {
|
|
446
|
+
payload['priority'] = priority;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
let response = undefined;
|
|
450
|
+
|
|
451
|
+
response = await client.call('patch', apiPath, {
|
|
452
|
+
'content-type': 'application/json',
|
|
453
|
+
}, payload);
|
|
454
|
+
|
|
455
|
+
if (parseOutput) {
|
|
456
|
+
parse(response)
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
return response;
|
|
460
|
+
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* @typedef {Object} MessagingCreateSmsRequestParams
|
|
465
|
+
* @property {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.
|
|
466
|
+
* @property {string} content SMS Content.
|
|
467
|
+
* @property {string[]} topics List of Topic IDs.
|
|
468
|
+
* @property {string[]} users List of User IDs.
|
|
469
|
+
* @property {string[]} targets List of Targets IDs.
|
|
470
|
+
* @property {boolean} draft Is message a draft
|
|
471
|
+
* @property {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.
|
|
472
|
+
* @property {boolean} overrideForCli
|
|
473
|
+
* @property {boolean} parseOutput
|
|
474
|
+
* @property {libClient | undefined} sdk
|
|
475
|
+
*/
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* @param {MessagingCreateSmsRequestParams} params
|
|
479
|
+
*/
|
|
480
|
+
const messagingCreateSms = async ({messageId,content,topics,users,targets,draft,scheduledAt,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
481
|
+
let client = !sdk ? await sdkForProject() :
|
|
482
|
+
sdk;
|
|
483
|
+
let apiPath = '/messaging/messages/sms';
|
|
484
|
+
let payload = {};
|
|
485
|
+
if (typeof messageId !== 'undefined') {
|
|
486
|
+
payload['messageId'] = messageId;
|
|
487
|
+
}
|
|
488
|
+
if (typeof content !== 'undefined') {
|
|
489
|
+
payload['content'] = content;
|
|
490
|
+
}
|
|
491
|
+
topics = topics === true ? [] : topics;
|
|
492
|
+
if (typeof topics !== 'undefined') {
|
|
493
|
+
payload['topics'] = topics;
|
|
494
|
+
}
|
|
495
|
+
users = users === true ? [] : users;
|
|
496
|
+
if (typeof users !== 'undefined') {
|
|
497
|
+
payload['users'] = users;
|
|
498
|
+
}
|
|
499
|
+
targets = targets === true ? [] : targets;
|
|
500
|
+
if (typeof targets !== 'undefined') {
|
|
501
|
+
payload['targets'] = targets;
|
|
502
|
+
}
|
|
503
|
+
if (typeof draft !== 'undefined') {
|
|
504
|
+
payload['draft'] = draft;
|
|
505
|
+
}
|
|
506
|
+
if (typeof scheduledAt !== 'undefined') {
|
|
507
|
+
payload['scheduledAt'] = scheduledAt;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
let response = undefined;
|
|
511
|
+
|
|
512
|
+
response = await client.call('post', apiPath, {
|
|
513
|
+
'content-type': 'application/json',
|
|
514
|
+
}, payload);
|
|
515
|
+
|
|
516
|
+
if (parseOutput) {
|
|
517
|
+
parse(response)
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
return response;
|
|
521
|
+
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* @typedef {Object} MessagingUpdateSmsRequestParams
|
|
526
|
+
* @property {string} messageId Message ID.
|
|
527
|
+
* @property {string[]} topics List of Topic IDs.
|
|
528
|
+
* @property {string[]} users List of User IDs.
|
|
529
|
+
* @property {string[]} targets List of Targets IDs.
|
|
530
|
+
* @property {string} content Email Content.
|
|
531
|
+
* @property {boolean} draft Is message a draft
|
|
532
|
+
* @property {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.
|
|
533
|
+
* @property {boolean} overrideForCli
|
|
534
|
+
* @property {boolean} parseOutput
|
|
535
|
+
* @property {libClient | undefined} sdk
|
|
536
|
+
*/
|
|
537
|
+
|
|
538
|
+
/**
|
|
539
|
+
* @param {MessagingUpdateSmsRequestParams} params
|
|
540
|
+
*/
|
|
541
|
+
const messagingUpdateSms = async ({messageId,topics,users,targets,content,draft,scheduledAt,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
542
|
+
let client = !sdk ? await sdkForProject() :
|
|
543
|
+
sdk;
|
|
544
|
+
let apiPath = '/messaging/messages/sms/{messageId}'.replace('{messageId}', messageId);
|
|
545
|
+
let payload = {};
|
|
546
|
+
topics = topics === true ? [] : topics;
|
|
547
|
+
if (typeof topics !== 'undefined') {
|
|
548
|
+
payload['topics'] = topics;
|
|
549
|
+
}
|
|
550
|
+
users = users === true ? [] : users;
|
|
551
|
+
if (typeof users !== 'undefined') {
|
|
552
|
+
payload['users'] = users;
|
|
553
|
+
}
|
|
554
|
+
targets = targets === true ? [] : targets;
|
|
555
|
+
if (typeof targets !== 'undefined') {
|
|
556
|
+
payload['targets'] = targets;
|
|
557
|
+
}
|
|
558
|
+
if (typeof content !== 'undefined') {
|
|
559
|
+
payload['content'] = content;
|
|
560
|
+
}
|
|
561
|
+
if (typeof draft !== 'undefined') {
|
|
562
|
+
payload['draft'] = draft;
|
|
563
|
+
}
|
|
564
|
+
if (typeof scheduledAt !== 'undefined') {
|
|
565
|
+
payload['scheduledAt'] = scheduledAt;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
let response = undefined;
|
|
569
|
+
|
|
570
|
+
response = await client.call('patch', apiPath, {
|
|
571
|
+
'content-type': 'application/json',
|
|
572
|
+
}, payload);
|
|
573
|
+
|
|
574
|
+
if (parseOutput) {
|
|
575
|
+
parse(response)
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
return response;
|
|
579
|
+
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
/**
|
|
583
|
+
* @typedef {Object} MessagingGetMessageRequestParams
|
|
584
|
+
* @property {string} messageId Message ID.
|
|
585
|
+
* @property {boolean} overrideForCli
|
|
586
|
+
* @property {boolean} parseOutput
|
|
587
|
+
* @property {libClient | undefined} sdk
|
|
588
|
+
*/
|
|
589
|
+
|
|
590
|
+
/**
|
|
591
|
+
* @param {MessagingGetMessageRequestParams} params
|
|
592
|
+
*/
|
|
593
|
+
const messagingGetMessage = async ({messageId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
594
|
+
let client = !sdk ? await sdkForProject() :
|
|
595
|
+
sdk;
|
|
596
|
+
let apiPath = '/messaging/messages/{messageId}'.replace('{messageId}', messageId);
|
|
597
|
+
let payload = {};
|
|
598
|
+
|
|
599
|
+
let response = undefined;
|
|
600
|
+
|
|
601
|
+
response = await client.call('get', apiPath, {
|
|
602
|
+
}, payload);
|
|
603
|
+
|
|
604
|
+
if (parseOutput) {
|
|
605
|
+
if(console) {
|
|
606
|
+
showConsoleLink('messaging', 'getMessage', messageId);
|
|
607
|
+
} else {
|
|
608
|
+
parse(response)
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
return response;
|
|
613
|
+
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
/**
|
|
617
|
+
* @typedef {Object} MessagingDeleteRequestParams
|
|
618
|
+
* @property {string} messageId Message ID.
|
|
619
|
+
* @property {boolean} overrideForCli
|
|
620
|
+
* @property {boolean} parseOutput
|
|
621
|
+
* @property {libClient | undefined} sdk
|
|
622
|
+
*/
|
|
623
|
+
|
|
624
|
+
/**
|
|
625
|
+
* @param {MessagingDeleteRequestParams} params
|
|
626
|
+
*/
|
|
627
|
+
const messagingDelete = async ({messageId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
628
|
+
let client = !sdk ? await sdkForProject() :
|
|
629
|
+
sdk;
|
|
630
|
+
let apiPath = '/messaging/messages/{messageId}'.replace('{messageId}', messageId);
|
|
631
|
+
let payload = {};
|
|
632
|
+
|
|
633
|
+
let response = undefined;
|
|
634
|
+
|
|
635
|
+
response = await client.call('delete', apiPath, {
|
|
636
|
+
'content-type': 'application/json',
|
|
637
|
+
}, payload);
|
|
638
|
+
|
|
639
|
+
if (parseOutput) {
|
|
640
|
+
parse(response)
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
return response;
|
|
644
|
+
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
/**
|
|
648
|
+
* @typedef {Object} MessagingListMessageLogsRequestParams
|
|
649
|
+
* @property {string} messageId Message ID.
|
|
650
|
+
* @property {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
|
|
651
|
+
* @property {boolean} overrideForCli
|
|
652
|
+
* @property {boolean} parseOutput
|
|
653
|
+
* @property {libClient | undefined} sdk
|
|
654
|
+
*/
|
|
655
|
+
|
|
656
|
+
/**
|
|
657
|
+
* @param {MessagingListMessageLogsRequestParams} params
|
|
658
|
+
*/
|
|
659
|
+
const messagingListMessageLogs = async ({messageId,queries,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
660
|
+
let client = !sdk ? await sdkForProject() :
|
|
661
|
+
sdk;
|
|
662
|
+
let apiPath = '/messaging/messages/{messageId}/logs'.replace('{messageId}', messageId);
|
|
663
|
+
let payload = {};
|
|
664
|
+
if (typeof queries !== 'undefined') {
|
|
665
|
+
payload['queries'] = queries;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
let response = undefined;
|
|
669
|
+
|
|
670
|
+
response = await client.call('get', apiPath, {
|
|
671
|
+
}, payload);
|
|
672
|
+
|
|
673
|
+
if (parseOutput) {
|
|
674
|
+
if(console) {
|
|
675
|
+
showConsoleLink('messaging', 'listMessageLogs', messageId);
|
|
676
|
+
} else {
|
|
677
|
+
parse(response)
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
return response;
|
|
682
|
+
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
/**
|
|
686
|
+
* @typedef {Object} MessagingListTargetsRequestParams
|
|
687
|
+
* @property {string} messageId Message ID.
|
|
688
|
+
* @property {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
|
|
689
|
+
* @property {boolean} overrideForCli
|
|
690
|
+
* @property {boolean} parseOutput
|
|
691
|
+
* @property {libClient | undefined} sdk
|
|
692
|
+
*/
|
|
693
|
+
|
|
694
|
+
/**
|
|
695
|
+
* @param {MessagingListTargetsRequestParams} params
|
|
696
|
+
*/
|
|
697
|
+
const messagingListTargets = async ({messageId,queries,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
698
|
+
let client = !sdk ? await sdkForProject() :
|
|
699
|
+
sdk;
|
|
700
|
+
let apiPath = '/messaging/messages/{messageId}/targets'.replace('{messageId}', messageId);
|
|
701
|
+
let payload = {};
|
|
702
|
+
if (typeof queries !== 'undefined') {
|
|
703
|
+
payload['queries'] = queries;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
let response = undefined;
|
|
707
|
+
|
|
708
|
+
response = await client.call('get', apiPath, {
|
|
709
|
+
}, payload);
|
|
710
|
+
|
|
711
|
+
if (parseOutput) {
|
|
712
|
+
parse(response)
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
return response;
|
|
716
|
+
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
/**
|
|
720
|
+
* @typedef {Object} MessagingListProvidersRequestParams
|
|
721
|
+
* @property {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
|
|
722
|
+
* @property {string} search Search term to filter your list results. Max length: 256 chars.
|
|
723
|
+
* @property {boolean} overrideForCli
|
|
724
|
+
* @property {boolean} parseOutput
|
|
725
|
+
* @property {libClient | undefined} sdk
|
|
726
|
+
*/
|
|
727
|
+
|
|
728
|
+
/**
|
|
729
|
+
* @param {MessagingListProvidersRequestParams} params
|
|
730
|
+
*/
|
|
731
|
+
const messagingListProviders = async ({queries,search,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
732
|
+
let client = !sdk ? await sdkForProject() :
|
|
733
|
+
sdk;
|
|
734
|
+
let apiPath = '/messaging/providers';
|
|
735
|
+
let payload = {};
|
|
736
|
+
if (typeof queries !== 'undefined') {
|
|
737
|
+
payload['queries'] = queries;
|
|
738
|
+
}
|
|
739
|
+
if (typeof search !== 'undefined') {
|
|
740
|
+
payload['search'] = search;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
let response = undefined;
|
|
744
|
+
|
|
745
|
+
response = await client.call('get', apiPath, {
|
|
746
|
+
}, payload);
|
|
747
|
+
|
|
748
|
+
if (parseOutput) {
|
|
749
|
+
if(console) {
|
|
750
|
+
showConsoleLink('messaging', 'listProviders');
|
|
751
|
+
} else {
|
|
752
|
+
parse(response)
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
return response;
|
|
757
|
+
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
/**
|
|
761
|
+
* @typedef {Object} MessagingCreateApnsProviderRequestParams
|
|
762
|
+
* @property {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.
|
|
763
|
+
* @property {string} name Provider name.
|
|
764
|
+
* @property {string} authKey APNS authentication key.
|
|
765
|
+
* @property {string} authKeyId APNS authentication key ID.
|
|
766
|
+
* @property {string} teamId APNS team ID.
|
|
767
|
+
* @property {string} bundleId APNS bundle ID.
|
|
768
|
+
* @property {boolean} sandbox Use APNS sandbox environment.
|
|
769
|
+
* @property {boolean} enabled Set as enabled.
|
|
770
|
+
* @property {boolean} overrideForCli
|
|
771
|
+
* @property {boolean} parseOutput
|
|
772
|
+
* @property {libClient | undefined} sdk
|
|
773
|
+
*/
|
|
774
|
+
|
|
775
|
+
/**
|
|
776
|
+
* @param {MessagingCreateApnsProviderRequestParams} params
|
|
777
|
+
*/
|
|
778
|
+
const messagingCreateApnsProvider = async ({providerId,name,authKey,authKeyId,teamId,bundleId,sandbox,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
779
|
+
let client = !sdk ? await sdkForProject() :
|
|
780
|
+
sdk;
|
|
781
|
+
let apiPath = '/messaging/providers/apns';
|
|
782
|
+
let payload = {};
|
|
783
|
+
if (typeof providerId !== 'undefined') {
|
|
784
|
+
payload['providerId'] = providerId;
|
|
785
|
+
}
|
|
786
|
+
if (typeof name !== 'undefined') {
|
|
787
|
+
payload['name'] = name;
|
|
788
|
+
}
|
|
789
|
+
if (typeof authKey !== 'undefined') {
|
|
790
|
+
payload['authKey'] = authKey;
|
|
791
|
+
}
|
|
792
|
+
if (typeof authKeyId !== 'undefined') {
|
|
793
|
+
payload['authKeyId'] = authKeyId;
|
|
794
|
+
}
|
|
795
|
+
if (typeof teamId !== 'undefined') {
|
|
796
|
+
payload['teamId'] = teamId;
|
|
797
|
+
}
|
|
798
|
+
if (typeof bundleId !== 'undefined') {
|
|
799
|
+
payload['bundleId'] = bundleId;
|
|
800
|
+
}
|
|
801
|
+
if (typeof sandbox !== 'undefined') {
|
|
802
|
+
payload['sandbox'] = sandbox;
|
|
803
|
+
}
|
|
804
|
+
if (typeof enabled !== 'undefined') {
|
|
805
|
+
payload['enabled'] = enabled;
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
let response = undefined;
|
|
809
|
+
|
|
810
|
+
response = await client.call('post', apiPath, {
|
|
811
|
+
'content-type': 'application/json',
|
|
812
|
+
}, payload);
|
|
813
|
+
|
|
814
|
+
if (parseOutput) {
|
|
815
|
+
parse(response)
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
return response;
|
|
819
|
+
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
/**
|
|
823
|
+
* @typedef {Object} MessagingUpdateApnsProviderRequestParams
|
|
824
|
+
* @property {string} providerId Provider ID.
|
|
825
|
+
* @property {string} name Provider name.
|
|
826
|
+
* @property {boolean} enabled Set as enabled.
|
|
827
|
+
* @property {string} authKey APNS authentication key.
|
|
828
|
+
* @property {string} authKeyId APNS authentication key ID.
|
|
829
|
+
* @property {string} teamId APNS team ID.
|
|
830
|
+
* @property {string} bundleId APNS bundle ID.
|
|
831
|
+
* @property {boolean} sandbox Use APNS sandbox environment.
|
|
832
|
+
* @property {boolean} overrideForCli
|
|
833
|
+
* @property {boolean} parseOutput
|
|
834
|
+
* @property {libClient | undefined} sdk
|
|
835
|
+
*/
|
|
836
|
+
|
|
837
|
+
/**
|
|
838
|
+
* @param {MessagingUpdateApnsProviderRequestParams} params
|
|
839
|
+
*/
|
|
840
|
+
const messagingUpdateApnsProvider = async ({providerId,name,enabled,authKey,authKeyId,teamId,bundleId,sandbox,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
841
|
+
let client = !sdk ? await sdkForProject() :
|
|
842
|
+
sdk;
|
|
843
|
+
let apiPath = '/messaging/providers/apns/{providerId}'.replace('{providerId}', providerId);
|
|
844
|
+
let payload = {};
|
|
845
|
+
if (typeof name !== 'undefined') {
|
|
846
|
+
payload['name'] = name;
|
|
847
|
+
}
|
|
848
|
+
if (typeof enabled !== 'undefined') {
|
|
849
|
+
payload['enabled'] = enabled;
|
|
850
|
+
}
|
|
851
|
+
if (typeof authKey !== 'undefined') {
|
|
852
|
+
payload['authKey'] = authKey;
|
|
853
|
+
}
|
|
854
|
+
if (typeof authKeyId !== 'undefined') {
|
|
855
|
+
payload['authKeyId'] = authKeyId;
|
|
856
|
+
}
|
|
857
|
+
if (typeof teamId !== 'undefined') {
|
|
858
|
+
payload['teamId'] = teamId;
|
|
859
|
+
}
|
|
860
|
+
if (typeof bundleId !== 'undefined') {
|
|
861
|
+
payload['bundleId'] = bundleId;
|
|
862
|
+
}
|
|
863
|
+
if (typeof sandbox !== 'undefined') {
|
|
864
|
+
payload['sandbox'] = sandbox;
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
let response = undefined;
|
|
868
|
+
|
|
869
|
+
response = await client.call('patch', apiPath, {
|
|
870
|
+
'content-type': 'application/json',
|
|
871
|
+
}, payload);
|
|
872
|
+
|
|
873
|
+
if (parseOutput) {
|
|
874
|
+
parse(response)
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
return response;
|
|
878
|
+
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
/**
|
|
882
|
+
* @typedef {Object} MessagingCreateFcmProviderRequestParams
|
|
883
|
+
* @property {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.
|
|
884
|
+
* @property {string} name Provider name.
|
|
885
|
+
* @property {object} serviceAccountJSON FCM service account JSON.
|
|
886
|
+
* @property {boolean} enabled Set as enabled.
|
|
887
|
+
* @property {boolean} overrideForCli
|
|
888
|
+
* @property {boolean} parseOutput
|
|
889
|
+
* @property {libClient | undefined} sdk
|
|
890
|
+
*/
|
|
891
|
+
|
|
892
|
+
/**
|
|
893
|
+
* @param {MessagingCreateFcmProviderRequestParams} params
|
|
894
|
+
*/
|
|
895
|
+
const messagingCreateFcmProvider = async ({providerId,name,serviceAccountJSON,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
896
|
+
let client = !sdk ? await sdkForProject() :
|
|
897
|
+
sdk;
|
|
898
|
+
let apiPath = '/messaging/providers/fcm';
|
|
899
|
+
let payload = {};
|
|
900
|
+
if (typeof providerId !== 'undefined') {
|
|
901
|
+
payload['providerId'] = providerId;
|
|
902
|
+
}
|
|
903
|
+
if (typeof name !== 'undefined') {
|
|
904
|
+
payload['name'] = name;
|
|
905
|
+
}
|
|
906
|
+
if (typeof serviceAccountJSON !== 'undefined') {
|
|
907
|
+
payload['serviceAccountJSON'] = JSON.parse(serviceAccountJSON);
|
|
908
|
+
}
|
|
909
|
+
if (typeof enabled !== 'undefined') {
|
|
910
|
+
payload['enabled'] = enabled;
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
let response = undefined;
|
|
914
|
+
|
|
915
|
+
response = await client.call('post', apiPath, {
|
|
916
|
+
'content-type': 'application/json',
|
|
917
|
+
}, payload);
|
|
918
|
+
|
|
919
|
+
if (parseOutput) {
|
|
920
|
+
parse(response)
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
return response;
|
|
924
|
+
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
/**
|
|
928
|
+
* @typedef {Object} MessagingUpdateFcmProviderRequestParams
|
|
929
|
+
* @property {string} providerId Provider ID.
|
|
930
|
+
* @property {string} name Provider name.
|
|
931
|
+
* @property {boolean} enabled Set as enabled.
|
|
932
|
+
* @property {object} serviceAccountJSON FCM service account JSON.
|
|
933
|
+
* @property {boolean} overrideForCli
|
|
934
|
+
* @property {boolean} parseOutput
|
|
935
|
+
* @property {libClient | undefined} sdk
|
|
936
|
+
*/
|
|
937
|
+
|
|
938
|
+
/**
|
|
939
|
+
* @param {MessagingUpdateFcmProviderRequestParams} params
|
|
940
|
+
*/
|
|
941
|
+
const messagingUpdateFcmProvider = async ({providerId,name,enabled,serviceAccountJSON,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
942
|
+
let client = !sdk ? await sdkForProject() :
|
|
943
|
+
sdk;
|
|
944
|
+
let apiPath = '/messaging/providers/fcm/{providerId}'.replace('{providerId}', providerId);
|
|
945
|
+
let payload = {};
|
|
946
|
+
if (typeof name !== 'undefined') {
|
|
947
|
+
payload['name'] = name;
|
|
948
|
+
}
|
|
949
|
+
if (typeof enabled !== 'undefined') {
|
|
950
|
+
payload['enabled'] = enabled;
|
|
951
|
+
}
|
|
952
|
+
if (typeof serviceAccountJSON !== 'undefined') {
|
|
953
|
+
payload['serviceAccountJSON'] = JSON.parse(serviceAccountJSON);
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
let response = undefined;
|
|
957
|
+
|
|
958
|
+
response = await client.call('patch', apiPath, {
|
|
959
|
+
'content-type': 'application/json',
|
|
960
|
+
}, payload);
|
|
961
|
+
|
|
962
|
+
if (parseOutput) {
|
|
963
|
+
parse(response)
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
return response;
|
|
967
|
+
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
/**
|
|
971
|
+
* @typedef {Object} MessagingCreateMailgunProviderRequestParams
|
|
972
|
+
* @property {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.
|
|
973
|
+
* @property {string} name Provider name.
|
|
974
|
+
* @property {string} apiKey Mailgun API Key.
|
|
975
|
+
* @property {string} domain Mailgun Domain.
|
|
976
|
+
* @property {boolean} isEuRegion Set as EU region.
|
|
977
|
+
* @property {string} fromName Sender Name.
|
|
978
|
+
* @property {string} fromEmail Sender email address.
|
|
979
|
+
* @property {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.
|
|
980
|
+
* @property {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.
|
|
981
|
+
* @property {boolean} enabled Set as enabled.
|
|
982
|
+
* @property {boolean} overrideForCli
|
|
983
|
+
* @property {boolean} parseOutput
|
|
984
|
+
* @property {libClient | undefined} sdk
|
|
985
|
+
*/
|
|
986
|
+
|
|
987
|
+
/**
|
|
988
|
+
* @param {MessagingCreateMailgunProviderRequestParams} params
|
|
989
|
+
*/
|
|
990
|
+
const messagingCreateMailgunProvider = async ({providerId,name,apiKey,domain,isEuRegion,fromName,fromEmail,replyToName,replyToEmail,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
991
|
+
let client = !sdk ? await sdkForProject() :
|
|
992
|
+
sdk;
|
|
993
|
+
let apiPath = '/messaging/providers/mailgun';
|
|
994
|
+
let payload = {};
|
|
995
|
+
if (typeof providerId !== 'undefined') {
|
|
996
|
+
payload['providerId'] = providerId;
|
|
997
|
+
}
|
|
998
|
+
if (typeof name !== 'undefined') {
|
|
999
|
+
payload['name'] = name;
|
|
1000
|
+
}
|
|
1001
|
+
if (typeof apiKey !== 'undefined') {
|
|
1002
|
+
payload['apiKey'] = apiKey;
|
|
1003
|
+
}
|
|
1004
|
+
if (typeof domain !== 'undefined') {
|
|
1005
|
+
payload['domain'] = domain;
|
|
1006
|
+
}
|
|
1007
|
+
if (typeof isEuRegion !== 'undefined') {
|
|
1008
|
+
payload['isEuRegion'] = isEuRegion;
|
|
1009
|
+
}
|
|
1010
|
+
if (typeof fromName !== 'undefined') {
|
|
1011
|
+
payload['fromName'] = fromName;
|
|
1012
|
+
}
|
|
1013
|
+
if (typeof fromEmail !== 'undefined') {
|
|
1014
|
+
payload['fromEmail'] = fromEmail;
|
|
1015
|
+
}
|
|
1016
|
+
if (typeof replyToName !== 'undefined') {
|
|
1017
|
+
payload['replyToName'] = replyToName;
|
|
1018
|
+
}
|
|
1019
|
+
if (typeof replyToEmail !== 'undefined') {
|
|
1020
|
+
payload['replyToEmail'] = replyToEmail;
|
|
1021
|
+
}
|
|
1022
|
+
if (typeof enabled !== 'undefined') {
|
|
1023
|
+
payload['enabled'] = enabled;
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
let response = undefined;
|
|
1027
|
+
|
|
1028
|
+
response = await client.call('post', apiPath, {
|
|
1029
|
+
'content-type': 'application/json',
|
|
1030
|
+
}, payload);
|
|
1031
|
+
|
|
1032
|
+
if (parseOutput) {
|
|
1033
|
+
parse(response)
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
return response;
|
|
1037
|
+
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
/**
|
|
1041
|
+
* @typedef {Object} MessagingUpdateMailgunProviderRequestParams
|
|
1042
|
+
* @property {string} providerId Provider ID.
|
|
1043
|
+
* @property {string} name Provider name.
|
|
1044
|
+
* @property {string} apiKey Mailgun API Key.
|
|
1045
|
+
* @property {string} domain Mailgun Domain.
|
|
1046
|
+
* @property {boolean} isEuRegion Set as EU region.
|
|
1047
|
+
* @property {boolean} enabled Set as enabled.
|
|
1048
|
+
* @property {string} fromName Sender Name.
|
|
1049
|
+
* @property {string} fromEmail Sender email address.
|
|
1050
|
+
* @property {string} replyToName Name set in the reply to field for the mail. Default value is sender name.
|
|
1051
|
+
* @property {string} replyToEmail Email set in the reply to field for the mail. Default value is sender email.
|
|
1052
|
+
* @property {boolean} overrideForCli
|
|
1053
|
+
* @property {boolean} parseOutput
|
|
1054
|
+
* @property {libClient | undefined} sdk
|
|
1055
|
+
*/
|
|
1056
|
+
|
|
1057
|
+
/**
|
|
1058
|
+
* @param {MessagingUpdateMailgunProviderRequestParams} params
|
|
1059
|
+
*/
|
|
1060
|
+
const messagingUpdateMailgunProvider = async ({providerId,name,apiKey,domain,isEuRegion,enabled,fromName,fromEmail,replyToName,replyToEmail,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1061
|
+
let client = !sdk ? await sdkForProject() :
|
|
1062
|
+
sdk;
|
|
1063
|
+
let apiPath = '/messaging/providers/mailgun/{providerId}'.replace('{providerId}', providerId);
|
|
1064
|
+
let payload = {};
|
|
1065
|
+
if (typeof name !== 'undefined') {
|
|
1066
|
+
payload['name'] = name;
|
|
1067
|
+
}
|
|
1068
|
+
if (typeof apiKey !== 'undefined') {
|
|
1069
|
+
payload['apiKey'] = apiKey;
|
|
1070
|
+
}
|
|
1071
|
+
if (typeof domain !== 'undefined') {
|
|
1072
|
+
payload['domain'] = domain;
|
|
1073
|
+
}
|
|
1074
|
+
if (typeof isEuRegion !== 'undefined') {
|
|
1075
|
+
payload['isEuRegion'] = isEuRegion;
|
|
1076
|
+
}
|
|
1077
|
+
if (typeof enabled !== 'undefined') {
|
|
1078
|
+
payload['enabled'] = enabled;
|
|
1079
|
+
}
|
|
1080
|
+
if (typeof fromName !== 'undefined') {
|
|
1081
|
+
payload['fromName'] = fromName;
|
|
1082
|
+
}
|
|
1083
|
+
if (typeof fromEmail !== 'undefined') {
|
|
1084
|
+
payload['fromEmail'] = fromEmail;
|
|
1085
|
+
}
|
|
1086
|
+
if (typeof replyToName !== 'undefined') {
|
|
1087
|
+
payload['replyToName'] = replyToName;
|
|
1088
|
+
}
|
|
1089
|
+
if (typeof replyToEmail !== 'undefined') {
|
|
1090
|
+
payload['replyToEmail'] = replyToEmail;
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
let response = undefined;
|
|
1094
|
+
|
|
1095
|
+
response = await client.call('patch', apiPath, {
|
|
1096
|
+
'content-type': 'application/json',
|
|
1097
|
+
}, payload);
|
|
1098
|
+
|
|
1099
|
+
if (parseOutput) {
|
|
1100
|
+
parse(response)
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
return response;
|
|
1104
|
+
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
/**
|
|
1108
|
+
* @typedef {Object} MessagingCreateMsg91ProviderRequestParams
|
|
1109
|
+
* @property {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.
|
|
1110
|
+
* @property {string} name Provider name.
|
|
1111
|
+
* @property {string} templateId Msg91 template ID
|
|
1112
|
+
* @property {string} senderId Msg91 sender ID.
|
|
1113
|
+
* @property {string} authKey Msg91 auth key.
|
|
1114
|
+
* @property {boolean} enabled Set as enabled.
|
|
1115
|
+
* @property {boolean} overrideForCli
|
|
1116
|
+
* @property {boolean} parseOutput
|
|
1117
|
+
* @property {libClient | undefined} sdk
|
|
1118
|
+
*/
|
|
1119
|
+
|
|
1120
|
+
/**
|
|
1121
|
+
* @param {MessagingCreateMsg91ProviderRequestParams} params
|
|
1122
|
+
*/
|
|
1123
|
+
const messagingCreateMsg91Provider = async ({providerId,name,templateId,senderId,authKey,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1124
|
+
let client = !sdk ? await sdkForProject() :
|
|
1125
|
+
sdk;
|
|
1126
|
+
let apiPath = '/messaging/providers/msg91';
|
|
1127
|
+
let payload = {};
|
|
1128
|
+
if (typeof providerId !== 'undefined') {
|
|
1129
|
+
payload['providerId'] = providerId;
|
|
1130
|
+
}
|
|
1131
|
+
if (typeof name !== 'undefined') {
|
|
1132
|
+
payload['name'] = name;
|
|
1133
|
+
}
|
|
1134
|
+
if (typeof templateId !== 'undefined') {
|
|
1135
|
+
payload['templateId'] = templateId;
|
|
1136
|
+
}
|
|
1137
|
+
if (typeof senderId !== 'undefined') {
|
|
1138
|
+
payload['senderId'] = senderId;
|
|
1139
|
+
}
|
|
1140
|
+
if (typeof authKey !== 'undefined') {
|
|
1141
|
+
payload['authKey'] = authKey;
|
|
1142
|
+
}
|
|
1143
|
+
if (typeof enabled !== 'undefined') {
|
|
1144
|
+
payload['enabled'] = enabled;
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
let response = undefined;
|
|
1148
|
+
|
|
1149
|
+
response = await client.call('post', apiPath, {
|
|
1150
|
+
'content-type': 'application/json',
|
|
1151
|
+
}, payload);
|
|
1152
|
+
|
|
1153
|
+
if (parseOutput) {
|
|
1154
|
+
parse(response)
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
return response;
|
|
1158
|
+
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
/**
|
|
1162
|
+
* @typedef {Object} MessagingUpdateMsg91ProviderRequestParams
|
|
1163
|
+
* @property {string} providerId Provider ID.
|
|
1164
|
+
* @property {string} name Provider name.
|
|
1165
|
+
* @property {boolean} enabled Set as enabled.
|
|
1166
|
+
* @property {string} templateId Msg91 template ID.
|
|
1167
|
+
* @property {string} senderId Msg91 sender ID.
|
|
1168
|
+
* @property {string} authKey Msg91 auth key.
|
|
1169
|
+
* @property {boolean} overrideForCli
|
|
1170
|
+
* @property {boolean} parseOutput
|
|
1171
|
+
* @property {libClient | undefined} sdk
|
|
1172
|
+
*/
|
|
1173
|
+
|
|
1174
|
+
/**
|
|
1175
|
+
* @param {MessagingUpdateMsg91ProviderRequestParams} params
|
|
1176
|
+
*/
|
|
1177
|
+
const messagingUpdateMsg91Provider = async ({providerId,name,enabled,templateId,senderId,authKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1178
|
+
let client = !sdk ? await sdkForProject() :
|
|
1179
|
+
sdk;
|
|
1180
|
+
let apiPath = '/messaging/providers/msg91/{providerId}'.replace('{providerId}', providerId);
|
|
1181
|
+
let payload = {};
|
|
1182
|
+
if (typeof name !== 'undefined') {
|
|
1183
|
+
payload['name'] = name;
|
|
1184
|
+
}
|
|
1185
|
+
if (typeof enabled !== 'undefined') {
|
|
1186
|
+
payload['enabled'] = enabled;
|
|
1187
|
+
}
|
|
1188
|
+
if (typeof templateId !== 'undefined') {
|
|
1189
|
+
payload['templateId'] = templateId;
|
|
1190
|
+
}
|
|
1191
|
+
if (typeof senderId !== 'undefined') {
|
|
1192
|
+
payload['senderId'] = senderId;
|
|
1193
|
+
}
|
|
1194
|
+
if (typeof authKey !== 'undefined') {
|
|
1195
|
+
payload['authKey'] = authKey;
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
let response = undefined;
|
|
1199
|
+
|
|
1200
|
+
response = await client.call('patch', apiPath, {
|
|
1201
|
+
'content-type': 'application/json',
|
|
1202
|
+
}, payload);
|
|
1203
|
+
|
|
1204
|
+
if (parseOutput) {
|
|
1205
|
+
parse(response)
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
return response;
|
|
1209
|
+
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
/**
|
|
1213
|
+
* @typedef {Object} MessagingCreateSendgridProviderRequestParams
|
|
1214
|
+
* @property {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.
|
|
1215
|
+
* @property {string} name Provider name.
|
|
1216
|
+
* @property {string} apiKey Sendgrid API key.
|
|
1217
|
+
* @property {string} fromName Sender Name.
|
|
1218
|
+
* @property {string} fromEmail Sender email address.
|
|
1219
|
+
* @property {string} replyToName Name set in the reply to field for the mail. Default value is sender name.
|
|
1220
|
+
* @property {string} replyToEmail Email set in the reply to field for the mail. Default value is sender email.
|
|
1221
|
+
* @property {boolean} enabled Set as enabled.
|
|
1222
|
+
* @property {boolean} overrideForCli
|
|
1223
|
+
* @property {boolean} parseOutput
|
|
1224
|
+
* @property {libClient | undefined} sdk
|
|
1225
|
+
*/
|
|
1226
|
+
|
|
1227
|
+
/**
|
|
1228
|
+
* @param {MessagingCreateSendgridProviderRequestParams} params
|
|
1229
|
+
*/
|
|
1230
|
+
const messagingCreateSendgridProvider = async ({providerId,name,apiKey,fromName,fromEmail,replyToName,replyToEmail,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1231
|
+
let client = !sdk ? await sdkForProject() :
|
|
1232
|
+
sdk;
|
|
1233
|
+
let apiPath = '/messaging/providers/sendgrid';
|
|
1234
|
+
let payload = {};
|
|
1235
|
+
if (typeof providerId !== 'undefined') {
|
|
1236
|
+
payload['providerId'] = providerId;
|
|
1237
|
+
}
|
|
1238
|
+
if (typeof name !== 'undefined') {
|
|
1239
|
+
payload['name'] = name;
|
|
1240
|
+
}
|
|
1241
|
+
if (typeof apiKey !== 'undefined') {
|
|
1242
|
+
payload['apiKey'] = apiKey;
|
|
1243
|
+
}
|
|
1244
|
+
if (typeof fromName !== 'undefined') {
|
|
1245
|
+
payload['fromName'] = fromName;
|
|
1246
|
+
}
|
|
1247
|
+
if (typeof fromEmail !== 'undefined') {
|
|
1248
|
+
payload['fromEmail'] = fromEmail;
|
|
1249
|
+
}
|
|
1250
|
+
if (typeof replyToName !== 'undefined') {
|
|
1251
|
+
payload['replyToName'] = replyToName;
|
|
1252
|
+
}
|
|
1253
|
+
if (typeof replyToEmail !== 'undefined') {
|
|
1254
|
+
payload['replyToEmail'] = replyToEmail;
|
|
1255
|
+
}
|
|
1256
|
+
if (typeof enabled !== 'undefined') {
|
|
1257
|
+
payload['enabled'] = enabled;
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
let response = undefined;
|
|
1261
|
+
|
|
1262
|
+
response = await client.call('post', apiPath, {
|
|
1263
|
+
'content-type': 'application/json',
|
|
1264
|
+
}, payload);
|
|
1265
|
+
|
|
1266
|
+
if (parseOutput) {
|
|
1267
|
+
parse(response)
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
return response;
|
|
1271
|
+
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
/**
|
|
1275
|
+
* @typedef {Object} MessagingUpdateSendgridProviderRequestParams
|
|
1276
|
+
* @property {string} providerId Provider ID.
|
|
1277
|
+
* @property {string} name Provider name.
|
|
1278
|
+
* @property {boolean} enabled Set as enabled.
|
|
1279
|
+
* @property {string} apiKey Sendgrid API key.
|
|
1280
|
+
* @property {string} fromName Sender Name.
|
|
1281
|
+
* @property {string} fromEmail Sender email address.
|
|
1282
|
+
* @property {string} replyToName Name set in the Reply To field for the mail. Default value is Sender Name.
|
|
1283
|
+
* @property {string} replyToEmail Email set in the Reply To field for the mail. Default value is Sender Email.
|
|
1284
|
+
* @property {boolean} overrideForCli
|
|
1285
|
+
* @property {boolean} parseOutput
|
|
1286
|
+
* @property {libClient | undefined} sdk
|
|
1287
|
+
*/
|
|
1288
|
+
|
|
1289
|
+
/**
|
|
1290
|
+
* @param {MessagingUpdateSendgridProviderRequestParams} params
|
|
1291
|
+
*/
|
|
1292
|
+
const messagingUpdateSendgridProvider = async ({providerId,name,enabled,apiKey,fromName,fromEmail,replyToName,replyToEmail,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1293
|
+
let client = !sdk ? await sdkForProject() :
|
|
1294
|
+
sdk;
|
|
1295
|
+
let apiPath = '/messaging/providers/sendgrid/{providerId}'.replace('{providerId}', providerId);
|
|
1296
|
+
let payload = {};
|
|
1297
|
+
if (typeof name !== 'undefined') {
|
|
1298
|
+
payload['name'] = name;
|
|
1299
|
+
}
|
|
1300
|
+
if (typeof enabled !== 'undefined') {
|
|
1301
|
+
payload['enabled'] = enabled;
|
|
1302
|
+
}
|
|
1303
|
+
if (typeof apiKey !== 'undefined') {
|
|
1304
|
+
payload['apiKey'] = apiKey;
|
|
1305
|
+
}
|
|
1306
|
+
if (typeof fromName !== 'undefined') {
|
|
1307
|
+
payload['fromName'] = fromName;
|
|
1308
|
+
}
|
|
1309
|
+
if (typeof fromEmail !== 'undefined') {
|
|
1310
|
+
payload['fromEmail'] = fromEmail;
|
|
1311
|
+
}
|
|
1312
|
+
if (typeof replyToName !== 'undefined') {
|
|
1313
|
+
payload['replyToName'] = replyToName;
|
|
1314
|
+
}
|
|
1315
|
+
if (typeof replyToEmail !== 'undefined') {
|
|
1316
|
+
payload['replyToEmail'] = replyToEmail;
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1319
|
+
let response = undefined;
|
|
1320
|
+
|
|
1321
|
+
response = await client.call('patch', apiPath, {
|
|
1322
|
+
'content-type': 'application/json',
|
|
1323
|
+
}, payload);
|
|
1324
|
+
|
|
1325
|
+
if (parseOutput) {
|
|
1326
|
+
parse(response)
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
return response;
|
|
1330
|
+
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
/**
|
|
1334
|
+
* @typedef {Object} MessagingCreateSmtpProviderRequestParams
|
|
1335
|
+
* @property {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.
|
|
1336
|
+
* @property {string} name Provider name.
|
|
1337
|
+
* @property {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.
|
|
1338
|
+
* @property {number} port The default SMTP server port.
|
|
1339
|
+
* @property {string} username Authentication username.
|
|
1340
|
+
* @property {string} password Authentication password.
|
|
1341
|
+
* @property {SmtpEncryption} encryption Encryption type. Can be omitted, 'ssl', or 'tls'
|
|
1342
|
+
* @property {boolean} autoTLS Enable SMTP AutoTLS feature.
|
|
1343
|
+
* @property {string} mailer The value to use for the X-Mailer header.
|
|
1344
|
+
* @property {string} fromName Sender Name.
|
|
1345
|
+
* @property {string} fromEmail Sender email address.
|
|
1346
|
+
* @property {string} replyToName Name set in the reply to field for the mail. Default value is sender name.
|
|
1347
|
+
* @property {string} replyToEmail Email set in the reply to field for the mail. Default value is sender email.
|
|
1348
|
+
* @property {boolean} enabled Set as enabled.
|
|
1349
|
+
* @property {boolean} overrideForCli
|
|
1350
|
+
* @property {boolean} parseOutput
|
|
1351
|
+
* @property {libClient | undefined} sdk
|
|
1352
|
+
*/
|
|
1353
|
+
|
|
1354
|
+
/**
|
|
1355
|
+
* @param {MessagingCreateSmtpProviderRequestParams} params
|
|
1356
|
+
*/
|
|
1357
|
+
const messagingCreateSmtpProvider = async ({providerId,name,host,port,username,password,encryption,autoTLS,mailer,fromName,fromEmail,replyToName,replyToEmail,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1358
|
+
let client = !sdk ? await sdkForProject() :
|
|
1359
|
+
sdk;
|
|
1360
|
+
let apiPath = '/messaging/providers/smtp';
|
|
1361
|
+
let payload = {};
|
|
1362
|
+
if (typeof providerId !== 'undefined') {
|
|
1363
|
+
payload['providerId'] = providerId;
|
|
1364
|
+
}
|
|
1365
|
+
if (typeof name !== 'undefined') {
|
|
1366
|
+
payload['name'] = name;
|
|
1367
|
+
}
|
|
1368
|
+
if (typeof host !== 'undefined') {
|
|
1369
|
+
payload['host'] = host;
|
|
1370
|
+
}
|
|
1371
|
+
if (typeof port !== 'undefined') {
|
|
1372
|
+
payload['port'] = port;
|
|
1373
|
+
}
|
|
1374
|
+
if (typeof username !== 'undefined') {
|
|
1375
|
+
payload['username'] = username;
|
|
1376
|
+
}
|
|
1377
|
+
if (typeof password !== 'undefined') {
|
|
1378
|
+
payload['password'] = password;
|
|
1379
|
+
}
|
|
1380
|
+
if (typeof encryption !== 'undefined') {
|
|
1381
|
+
payload['encryption'] = encryption;
|
|
1382
|
+
}
|
|
1383
|
+
if (typeof autoTLS !== 'undefined') {
|
|
1384
|
+
payload['autoTLS'] = autoTLS;
|
|
1385
|
+
}
|
|
1386
|
+
if (typeof mailer !== 'undefined') {
|
|
1387
|
+
payload['mailer'] = mailer;
|
|
1388
|
+
}
|
|
1389
|
+
if (typeof fromName !== 'undefined') {
|
|
1390
|
+
payload['fromName'] = fromName;
|
|
1391
|
+
}
|
|
1392
|
+
if (typeof fromEmail !== 'undefined') {
|
|
1393
|
+
payload['fromEmail'] = fromEmail;
|
|
1394
|
+
}
|
|
1395
|
+
if (typeof replyToName !== 'undefined') {
|
|
1396
|
+
payload['replyToName'] = replyToName;
|
|
1397
|
+
}
|
|
1398
|
+
if (typeof replyToEmail !== 'undefined') {
|
|
1399
|
+
payload['replyToEmail'] = replyToEmail;
|
|
1400
|
+
}
|
|
1401
|
+
if (typeof enabled !== 'undefined') {
|
|
1402
|
+
payload['enabled'] = enabled;
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
let response = undefined;
|
|
1406
|
+
|
|
1407
|
+
response = await client.call('post', apiPath, {
|
|
1408
|
+
'content-type': 'application/json',
|
|
1409
|
+
}, payload);
|
|
1410
|
+
|
|
1411
|
+
if (parseOutput) {
|
|
1412
|
+
parse(response)
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
return response;
|
|
1416
|
+
|
|
1417
|
+
}
|
|
1418
|
+
|
|
1419
|
+
/**
|
|
1420
|
+
* @typedef {Object} MessagingUpdateSmtpProviderRequestParams
|
|
1421
|
+
* @property {string} providerId Provider ID.
|
|
1422
|
+
* @property {string} name Provider name.
|
|
1423
|
+
* @property {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.
|
|
1424
|
+
* @property {number} port SMTP port.
|
|
1425
|
+
* @property {string} username Authentication username.
|
|
1426
|
+
* @property {string} password Authentication password.
|
|
1427
|
+
* @property {SmtpEncryption} encryption Encryption type. Can be 'ssl' or 'tls'
|
|
1428
|
+
* @property {boolean} autoTLS Enable SMTP AutoTLS feature.
|
|
1429
|
+
* @property {string} mailer The value to use for the X-Mailer header.
|
|
1430
|
+
* @property {string} fromName Sender Name.
|
|
1431
|
+
* @property {string} fromEmail Sender email address.
|
|
1432
|
+
* @property {string} replyToName Name set in the Reply To field for the mail. Default value is Sender Name.
|
|
1433
|
+
* @property {string} replyToEmail Email set in the Reply To field for the mail. Default value is Sender Email.
|
|
1434
|
+
* @property {boolean} enabled Set as enabled.
|
|
1435
|
+
* @property {boolean} overrideForCli
|
|
1436
|
+
* @property {boolean} parseOutput
|
|
1437
|
+
* @property {libClient | undefined} sdk
|
|
1438
|
+
*/
|
|
1439
|
+
|
|
1440
|
+
/**
|
|
1441
|
+
* @param {MessagingUpdateSmtpProviderRequestParams} params
|
|
1442
|
+
*/
|
|
1443
|
+
const messagingUpdateSmtpProvider = async ({providerId,name,host,port,username,password,encryption,autoTLS,mailer,fromName,fromEmail,replyToName,replyToEmail,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1444
|
+
let client = !sdk ? await sdkForProject() :
|
|
1445
|
+
sdk;
|
|
1446
|
+
let apiPath = '/messaging/providers/smtp/{providerId}'.replace('{providerId}', providerId);
|
|
1447
|
+
let payload = {};
|
|
1448
|
+
if (typeof name !== 'undefined') {
|
|
1449
|
+
payload['name'] = name;
|
|
1450
|
+
}
|
|
1451
|
+
if (typeof host !== 'undefined') {
|
|
1452
|
+
payload['host'] = host;
|
|
1453
|
+
}
|
|
1454
|
+
if (typeof port !== 'undefined') {
|
|
1455
|
+
payload['port'] = port;
|
|
1456
|
+
}
|
|
1457
|
+
if (typeof username !== 'undefined') {
|
|
1458
|
+
payload['username'] = username;
|
|
1459
|
+
}
|
|
1460
|
+
if (typeof password !== 'undefined') {
|
|
1461
|
+
payload['password'] = password;
|
|
1462
|
+
}
|
|
1463
|
+
if (typeof encryption !== 'undefined') {
|
|
1464
|
+
payload['encryption'] = encryption;
|
|
1465
|
+
}
|
|
1466
|
+
if (typeof autoTLS !== 'undefined') {
|
|
1467
|
+
payload['autoTLS'] = autoTLS;
|
|
1468
|
+
}
|
|
1469
|
+
if (typeof mailer !== 'undefined') {
|
|
1470
|
+
payload['mailer'] = mailer;
|
|
1471
|
+
}
|
|
1472
|
+
if (typeof fromName !== 'undefined') {
|
|
1473
|
+
payload['fromName'] = fromName;
|
|
1474
|
+
}
|
|
1475
|
+
if (typeof fromEmail !== 'undefined') {
|
|
1476
|
+
payload['fromEmail'] = fromEmail;
|
|
1477
|
+
}
|
|
1478
|
+
if (typeof replyToName !== 'undefined') {
|
|
1479
|
+
payload['replyToName'] = replyToName;
|
|
1480
|
+
}
|
|
1481
|
+
if (typeof replyToEmail !== 'undefined') {
|
|
1482
|
+
payload['replyToEmail'] = replyToEmail;
|
|
1483
|
+
}
|
|
1484
|
+
if (typeof enabled !== 'undefined') {
|
|
1485
|
+
payload['enabled'] = enabled;
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
let response = undefined;
|
|
1489
|
+
|
|
1490
|
+
response = await client.call('patch', apiPath, {
|
|
1491
|
+
'content-type': 'application/json',
|
|
1492
|
+
}, payload);
|
|
1493
|
+
|
|
1494
|
+
if (parseOutput) {
|
|
1495
|
+
parse(response)
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
return response;
|
|
1499
|
+
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
/**
|
|
1503
|
+
* @typedef {Object} MessagingCreateTelesignProviderRequestParams
|
|
1504
|
+
* @property {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.
|
|
1505
|
+
* @property {string} name Provider name.
|
|
1506
|
+
* @property {string} from Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
|
|
1507
|
+
* @property {string} customerId Telesign customer ID.
|
|
1508
|
+
* @property {string} apiKey Telesign API key.
|
|
1509
|
+
* @property {boolean} enabled Set as enabled.
|
|
1510
|
+
* @property {boolean} overrideForCli
|
|
1511
|
+
* @property {boolean} parseOutput
|
|
1512
|
+
* @property {libClient | undefined} sdk
|
|
1513
|
+
*/
|
|
1514
|
+
|
|
1515
|
+
/**
|
|
1516
|
+
* @param {MessagingCreateTelesignProviderRequestParams} params
|
|
1517
|
+
*/
|
|
1518
|
+
const messagingCreateTelesignProvider = async ({providerId,name,from,customerId,apiKey,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1519
|
+
let client = !sdk ? await sdkForProject() :
|
|
1520
|
+
sdk;
|
|
1521
|
+
let apiPath = '/messaging/providers/telesign';
|
|
1522
|
+
let payload = {};
|
|
1523
|
+
if (typeof providerId !== 'undefined') {
|
|
1524
|
+
payload['providerId'] = providerId;
|
|
1525
|
+
}
|
|
1526
|
+
if (typeof name !== 'undefined') {
|
|
1527
|
+
payload['name'] = name;
|
|
1528
|
+
}
|
|
1529
|
+
if (typeof from !== 'undefined') {
|
|
1530
|
+
payload['from'] = from;
|
|
1531
|
+
}
|
|
1532
|
+
if (typeof customerId !== 'undefined') {
|
|
1533
|
+
payload['customerId'] = customerId;
|
|
1534
|
+
}
|
|
1535
|
+
if (typeof apiKey !== 'undefined') {
|
|
1536
|
+
payload['apiKey'] = apiKey;
|
|
1537
|
+
}
|
|
1538
|
+
if (typeof enabled !== 'undefined') {
|
|
1539
|
+
payload['enabled'] = enabled;
|
|
1540
|
+
}
|
|
1541
|
+
|
|
1542
|
+
let response = undefined;
|
|
1543
|
+
|
|
1544
|
+
response = await client.call('post', apiPath, {
|
|
1545
|
+
'content-type': 'application/json',
|
|
1546
|
+
}, payload);
|
|
1547
|
+
|
|
1548
|
+
if (parseOutput) {
|
|
1549
|
+
parse(response)
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
return response;
|
|
1553
|
+
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
/**
|
|
1557
|
+
* @typedef {Object} MessagingUpdateTelesignProviderRequestParams
|
|
1558
|
+
* @property {string} providerId Provider ID.
|
|
1559
|
+
* @property {string} name Provider name.
|
|
1560
|
+
* @property {boolean} enabled Set as enabled.
|
|
1561
|
+
* @property {string} customerId Telesign customer ID.
|
|
1562
|
+
* @property {string} apiKey Telesign API key.
|
|
1563
|
+
* @property {string} from Sender number.
|
|
1564
|
+
* @property {boolean} overrideForCli
|
|
1565
|
+
* @property {boolean} parseOutput
|
|
1566
|
+
* @property {libClient | undefined} sdk
|
|
1567
|
+
*/
|
|
1568
|
+
|
|
1569
|
+
/**
|
|
1570
|
+
* @param {MessagingUpdateTelesignProviderRequestParams} params
|
|
1571
|
+
*/
|
|
1572
|
+
const messagingUpdateTelesignProvider = async ({providerId,name,enabled,customerId,apiKey,from,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1573
|
+
let client = !sdk ? await sdkForProject() :
|
|
1574
|
+
sdk;
|
|
1575
|
+
let apiPath = '/messaging/providers/telesign/{providerId}'.replace('{providerId}', providerId);
|
|
1576
|
+
let payload = {};
|
|
1577
|
+
if (typeof name !== 'undefined') {
|
|
1578
|
+
payload['name'] = name;
|
|
1579
|
+
}
|
|
1580
|
+
if (typeof enabled !== 'undefined') {
|
|
1581
|
+
payload['enabled'] = enabled;
|
|
1582
|
+
}
|
|
1583
|
+
if (typeof customerId !== 'undefined') {
|
|
1584
|
+
payload['customerId'] = customerId;
|
|
1585
|
+
}
|
|
1586
|
+
if (typeof apiKey !== 'undefined') {
|
|
1587
|
+
payload['apiKey'] = apiKey;
|
|
1588
|
+
}
|
|
1589
|
+
if (typeof from !== 'undefined') {
|
|
1590
|
+
payload['from'] = from;
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
let response = undefined;
|
|
1594
|
+
|
|
1595
|
+
response = await client.call('patch', apiPath, {
|
|
1596
|
+
'content-type': 'application/json',
|
|
1597
|
+
}, payload);
|
|
1598
|
+
|
|
1599
|
+
if (parseOutput) {
|
|
1600
|
+
parse(response)
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1603
|
+
return response;
|
|
1604
|
+
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1607
|
+
/**
|
|
1608
|
+
* @typedef {Object} MessagingCreateTextmagicProviderRequestParams
|
|
1609
|
+
* @property {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.
|
|
1610
|
+
* @property {string} name Provider name.
|
|
1611
|
+
* @property {string} from Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
|
|
1612
|
+
* @property {string} username Textmagic username.
|
|
1613
|
+
* @property {string} apiKey Textmagic apiKey.
|
|
1614
|
+
* @property {boolean} enabled Set as enabled.
|
|
1615
|
+
* @property {boolean} overrideForCli
|
|
1616
|
+
* @property {boolean} parseOutput
|
|
1617
|
+
* @property {libClient | undefined} sdk
|
|
1618
|
+
*/
|
|
1619
|
+
|
|
1620
|
+
/**
|
|
1621
|
+
* @param {MessagingCreateTextmagicProviderRequestParams} params
|
|
1622
|
+
*/
|
|
1623
|
+
const messagingCreateTextmagicProvider = async ({providerId,name,from,username,apiKey,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1624
|
+
let client = !sdk ? await sdkForProject() :
|
|
1625
|
+
sdk;
|
|
1626
|
+
let apiPath = '/messaging/providers/textmagic';
|
|
1627
|
+
let payload = {};
|
|
1628
|
+
if (typeof providerId !== 'undefined') {
|
|
1629
|
+
payload['providerId'] = providerId;
|
|
1630
|
+
}
|
|
1631
|
+
if (typeof name !== 'undefined') {
|
|
1632
|
+
payload['name'] = name;
|
|
1633
|
+
}
|
|
1634
|
+
if (typeof from !== 'undefined') {
|
|
1635
|
+
payload['from'] = from;
|
|
1636
|
+
}
|
|
1637
|
+
if (typeof username !== 'undefined') {
|
|
1638
|
+
payload['username'] = username;
|
|
1639
|
+
}
|
|
1640
|
+
if (typeof apiKey !== 'undefined') {
|
|
1641
|
+
payload['apiKey'] = apiKey;
|
|
1642
|
+
}
|
|
1643
|
+
if (typeof enabled !== 'undefined') {
|
|
1644
|
+
payload['enabled'] = enabled;
|
|
1645
|
+
}
|
|
1646
|
+
|
|
1647
|
+
let response = undefined;
|
|
1648
|
+
|
|
1649
|
+
response = await client.call('post', apiPath, {
|
|
1650
|
+
'content-type': 'application/json',
|
|
1651
|
+
}, payload);
|
|
1652
|
+
|
|
1653
|
+
if (parseOutput) {
|
|
1654
|
+
parse(response)
|
|
1655
|
+
}
|
|
1656
|
+
|
|
1657
|
+
return response;
|
|
1658
|
+
|
|
1659
|
+
}
|
|
1660
|
+
|
|
1661
|
+
/**
|
|
1662
|
+
* @typedef {Object} MessagingUpdateTextmagicProviderRequestParams
|
|
1663
|
+
* @property {string} providerId Provider ID.
|
|
1664
|
+
* @property {string} name Provider name.
|
|
1665
|
+
* @property {boolean} enabled Set as enabled.
|
|
1666
|
+
* @property {string} username Textmagic username.
|
|
1667
|
+
* @property {string} apiKey Textmagic apiKey.
|
|
1668
|
+
* @property {string} from Sender number.
|
|
1669
|
+
* @property {boolean} overrideForCli
|
|
1670
|
+
* @property {boolean} parseOutput
|
|
1671
|
+
* @property {libClient | undefined} sdk
|
|
1672
|
+
*/
|
|
1673
|
+
|
|
1674
|
+
/**
|
|
1675
|
+
* @param {MessagingUpdateTextmagicProviderRequestParams} params
|
|
1676
|
+
*/
|
|
1677
|
+
const messagingUpdateTextmagicProvider = async ({providerId,name,enabled,username,apiKey,from,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1678
|
+
let client = !sdk ? await sdkForProject() :
|
|
1679
|
+
sdk;
|
|
1680
|
+
let apiPath = '/messaging/providers/textmagic/{providerId}'.replace('{providerId}', providerId);
|
|
1681
|
+
let payload = {};
|
|
1682
|
+
if (typeof name !== 'undefined') {
|
|
1683
|
+
payload['name'] = name;
|
|
1684
|
+
}
|
|
1685
|
+
if (typeof enabled !== 'undefined') {
|
|
1686
|
+
payload['enabled'] = enabled;
|
|
1687
|
+
}
|
|
1688
|
+
if (typeof username !== 'undefined') {
|
|
1689
|
+
payload['username'] = username;
|
|
1690
|
+
}
|
|
1691
|
+
if (typeof apiKey !== 'undefined') {
|
|
1692
|
+
payload['apiKey'] = apiKey;
|
|
1693
|
+
}
|
|
1694
|
+
if (typeof from !== 'undefined') {
|
|
1695
|
+
payload['from'] = from;
|
|
1696
|
+
}
|
|
1697
|
+
|
|
1698
|
+
let response = undefined;
|
|
1699
|
+
|
|
1700
|
+
response = await client.call('patch', apiPath, {
|
|
1701
|
+
'content-type': 'application/json',
|
|
1702
|
+
}, payload);
|
|
1703
|
+
|
|
1704
|
+
if (parseOutput) {
|
|
1705
|
+
parse(response)
|
|
1706
|
+
}
|
|
1707
|
+
|
|
1708
|
+
return response;
|
|
1709
|
+
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1712
|
+
/**
|
|
1713
|
+
* @typedef {Object} MessagingCreateTwilioProviderRequestParams
|
|
1714
|
+
* @property {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.
|
|
1715
|
+
* @property {string} name Provider name.
|
|
1716
|
+
* @property {string} from Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
|
|
1717
|
+
* @property {string} accountSid Twilio account secret ID.
|
|
1718
|
+
* @property {string} authToken Twilio authentication token.
|
|
1719
|
+
* @property {boolean} enabled Set as enabled.
|
|
1720
|
+
* @property {boolean} overrideForCli
|
|
1721
|
+
* @property {boolean} parseOutput
|
|
1722
|
+
* @property {libClient | undefined} sdk
|
|
1723
|
+
*/
|
|
1724
|
+
|
|
1725
|
+
/**
|
|
1726
|
+
* @param {MessagingCreateTwilioProviderRequestParams} params
|
|
1727
|
+
*/
|
|
1728
|
+
const messagingCreateTwilioProvider = async ({providerId,name,from,accountSid,authToken,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1729
|
+
let client = !sdk ? await sdkForProject() :
|
|
1730
|
+
sdk;
|
|
1731
|
+
let apiPath = '/messaging/providers/twilio';
|
|
1732
|
+
let payload = {};
|
|
1733
|
+
if (typeof providerId !== 'undefined') {
|
|
1734
|
+
payload['providerId'] = providerId;
|
|
1735
|
+
}
|
|
1736
|
+
if (typeof name !== 'undefined') {
|
|
1737
|
+
payload['name'] = name;
|
|
1738
|
+
}
|
|
1739
|
+
if (typeof from !== 'undefined') {
|
|
1740
|
+
payload['from'] = from;
|
|
1741
|
+
}
|
|
1742
|
+
if (typeof accountSid !== 'undefined') {
|
|
1743
|
+
payload['accountSid'] = accountSid;
|
|
1744
|
+
}
|
|
1745
|
+
if (typeof authToken !== 'undefined') {
|
|
1746
|
+
payload['authToken'] = authToken;
|
|
1747
|
+
}
|
|
1748
|
+
if (typeof enabled !== 'undefined') {
|
|
1749
|
+
payload['enabled'] = enabled;
|
|
1750
|
+
}
|
|
1751
|
+
|
|
1752
|
+
let response = undefined;
|
|
1753
|
+
|
|
1754
|
+
response = await client.call('post', apiPath, {
|
|
1755
|
+
'content-type': 'application/json',
|
|
1756
|
+
}, payload);
|
|
1757
|
+
|
|
1758
|
+
if (parseOutput) {
|
|
1759
|
+
parse(response)
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
return response;
|
|
1763
|
+
|
|
1764
|
+
}
|
|
1765
|
+
|
|
1766
|
+
/**
|
|
1767
|
+
* @typedef {Object} MessagingUpdateTwilioProviderRequestParams
|
|
1768
|
+
* @property {string} providerId Provider ID.
|
|
1769
|
+
* @property {string} name Provider name.
|
|
1770
|
+
* @property {boolean} enabled Set as enabled.
|
|
1771
|
+
* @property {string} accountSid Twilio account secret ID.
|
|
1772
|
+
* @property {string} authToken Twilio authentication token.
|
|
1773
|
+
* @property {string} from Sender number.
|
|
1774
|
+
* @property {boolean} overrideForCli
|
|
1775
|
+
* @property {boolean} parseOutput
|
|
1776
|
+
* @property {libClient | undefined} sdk
|
|
1777
|
+
*/
|
|
1778
|
+
|
|
1779
|
+
/**
|
|
1780
|
+
* @param {MessagingUpdateTwilioProviderRequestParams} params
|
|
1781
|
+
*/
|
|
1782
|
+
const messagingUpdateTwilioProvider = async ({providerId,name,enabled,accountSid,authToken,from,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1783
|
+
let client = !sdk ? await sdkForProject() :
|
|
1784
|
+
sdk;
|
|
1785
|
+
let apiPath = '/messaging/providers/twilio/{providerId}'.replace('{providerId}', providerId);
|
|
1786
|
+
let payload = {};
|
|
1787
|
+
if (typeof name !== 'undefined') {
|
|
1788
|
+
payload['name'] = name;
|
|
1789
|
+
}
|
|
1790
|
+
if (typeof enabled !== 'undefined') {
|
|
1791
|
+
payload['enabled'] = enabled;
|
|
1792
|
+
}
|
|
1793
|
+
if (typeof accountSid !== 'undefined') {
|
|
1794
|
+
payload['accountSid'] = accountSid;
|
|
1795
|
+
}
|
|
1796
|
+
if (typeof authToken !== 'undefined') {
|
|
1797
|
+
payload['authToken'] = authToken;
|
|
1798
|
+
}
|
|
1799
|
+
if (typeof from !== 'undefined') {
|
|
1800
|
+
payload['from'] = from;
|
|
1801
|
+
}
|
|
1802
|
+
|
|
1803
|
+
let response = undefined;
|
|
1804
|
+
|
|
1805
|
+
response = await client.call('patch', apiPath, {
|
|
1806
|
+
'content-type': 'application/json',
|
|
1807
|
+
}, payload);
|
|
1808
|
+
|
|
1809
|
+
if (parseOutput) {
|
|
1810
|
+
parse(response)
|
|
1811
|
+
}
|
|
1812
|
+
|
|
1813
|
+
return response;
|
|
1814
|
+
|
|
1815
|
+
}
|
|
1816
|
+
|
|
1817
|
+
/**
|
|
1818
|
+
* @typedef {Object} MessagingCreateVonageProviderRequestParams
|
|
1819
|
+
* @property {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.
|
|
1820
|
+
* @property {string} name Provider name.
|
|
1821
|
+
* @property {string} from Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
|
|
1822
|
+
* @property {string} apiKey Vonage API key.
|
|
1823
|
+
* @property {string} apiSecret Vonage API secret.
|
|
1824
|
+
* @property {boolean} enabled Set as enabled.
|
|
1825
|
+
* @property {boolean} overrideForCli
|
|
1826
|
+
* @property {boolean} parseOutput
|
|
1827
|
+
* @property {libClient | undefined} sdk
|
|
1828
|
+
*/
|
|
1829
|
+
|
|
1830
|
+
/**
|
|
1831
|
+
* @param {MessagingCreateVonageProviderRequestParams} params
|
|
1832
|
+
*/
|
|
1833
|
+
const messagingCreateVonageProvider = async ({providerId,name,from,apiKey,apiSecret,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1834
|
+
let client = !sdk ? await sdkForProject() :
|
|
1835
|
+
sdk;
|
|
1836
|
+
let apiPath = '/messaging/providers/vonage';
|
|
1837
|
+
let payload = {};
|
|
1838
|
+
if (typeof providerId !== 'undefined') {
|
|
1839
|
+
payload['providerId'] = providerId;
|
|
1840
|
+
}
|
|
1841
|
+
if (typeof name !== 'undefined') {
|
|
1842
|
+
payload['name'] = name;
|
|
1843
|
+
}
|
|
1844
|
+
if (typeof from !== 'undefined') {
|
|
1845
|
+
payload['from'] = from;
|
|
1846
|
+
}
|
|
1847
|
+
if (typeof apiKey !== 'undefined') {
|
|
1848
|
+
payload['apiKey'] = apiKey;
|
|
1849
|
+
}
|
|
1850
|
+
if (typeof apiSecret !== 'undefined') {
|
|
1851
|
+
payload['apiSecret'] = apiSecret;
|
|
1852
|
+
}
|
|
1853
|
+
if (typeof enabled !== 'undefined') {
|
|
1854
|
+
payload['enabled'] = enabled;
|
|
1855
|
+
}
|
|
1856
|
+
|
|
1857
|
+
let response = undefined;
|
|
1858
|
+
|
|
1859
|
+
response = await client.call('post', apiPath, {
|
|
1860
|
+
'content-type': 'application/json',
|
|
1861
|
+
}, payload);
|
|
1862
|
+
|
|
1863
|
+
if (parseOutput) {
|
|
1864
|
+
parse(response)
|
|
1865
|
+
}
|
|
1866
|
+
|
|
1867
|
+
return response;
|
|
1868
|
+
|
|
1869
|
+
}
|
|
1870
|
+
|
|
1871
|
+
/**
|
|
1872
|
+
* @typedef {Object} MessagingUpdateVonageProviderRequestParams
|
|
1873
|
+
* @property {string} providerId Provider ID.
|
|
1874
|
+
* @property {string} name Provider name.
|
|
1875
|
+
* @property {boolean} enabled Set as enabled.
|
|
1876
|
+
* @property {string} apiKey Vonage API key.
|
|
1877
|
+
* @property {string} apiSecret Vonage API secret.
|
|
1878
|
+
* @property {string} from Sender number.
|
|
1879
|
+
* @property {boolean} overrideForCli
|
|
1880
|
+
* @property {boolean} parseOutput
|
|
1881
|
+
* @property {libClient | undefined} sdk
|
|
1882
|
+
*/
|
|
1883
|
+
|
|
1884
|
+
/**
|
|
1885
|
+
* @param {MessagingUpdateVonageProviderRequestParams} params
|
|
1886
|
+
*/
|
|
1887
|
+
const messagingUpdateVonageProvider = async ({providerId,name,enabled,apiKey,apiSecret,from,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1888
|
+
let client = !sdk ? await sdkForProject() :
|
|
1889
|
+
sdk;
|
|
1890
|
+
let apiPath = '/messaging/providers/vonage/{providerId}'.replace('{providerId}', providerId);
|
|
1891
|
+
let payload = {};
|
|
1892
|
+
if (typeof name !== 'undefined') {
|
|
1893
|
+
payload['name'] = name;
|
|
1894
|
+
}
|
|
1895
|
+
if (typeof enabled !== 'undefined') {
|
|
1896
|
+
payload['enabled'] = enabled;
|
|
1897
|
+
}
|
|
1898
|
+
if (typeof apiKey !== 'undefined') {
|
|
1899
|
+
payload['apiKey'] = apiKey;
|
|
1900
|
+
}
|
|
1901
|
+
if (typeof apiSecret !== 'undefined') {
|
|
1902
|
+
payload['apiSecret'] = apiSecret;
|
|
1903
|
+
}
|
|
1904
|
+
if (typeof from !== 'undefined') {
|
|
1905
|
+
payload['from'] = from;
|
|
1906
|
+
}
|
|
1907
|
+
|
|
1908
|
+
let response = undefined;
|
|
1909
|
+
|
|
1910
|
+
response = await client.call('patch', apiPath, {
|
|
1911
|
+
'content-type': 'application/json',
|
|
1912
|
+
}, payload);
|
|
1913
|
+
|
|
1914
|
+
if (parseOutput) {
|
|
1915
|
+
parse(response)
|
|
1916
|
+
}
|
|
1917
|
+
|
|
1918
|
+
return response;
|
|
1919
|
+
|
|
1920
|
+
}
|
|
1921
|
+
|
|
1922
|
+
/**
|
|
1923
|
+
* @typedef {Object} MessagingGetProviderRequestParams
|
|
1924
|
+
* @property {string} providerId Provider ID.
|
|
1925
|
+
* @property {boolean} overrideForCli
|
|
1926
|
+
* @property {boolean} parseOutput
|
|
1927
|
+
* @property {libClient | undefined} sdk
|
|
1928
|
+
*/
|
|
1929
|
+
|
|
1930
|
+
/**
|
|
1931
|
+
* @param {MessagingGetProviderRequestParams} params
|
|
1932
|
+
*/
|
|
1933
|
+
const messagingGetProvider = async ({providerId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
1934
|
+
let client = !sdk ? await sdkForProject() :
|
|
1935
|
+
sdk;
|
|
1936
|
+
let apiPath = '/messaging/providers/{providerId}'.replace('{providerId}', providerId);
|
|
1937
|
+
let payload = {};
|
|
1938
|
+
|
|
1939
|
+
let response = undefined;
|
|
1940
|
+
|
|
1941
|
+
response = await client.call('get', apiPath, {
|
|
1942
|
+
}, payload);
|
|
1943
|
+
|
|
1944
|
+
if (parseOutput) {
|
|
1945
|
+
if(console) {
|
|
1946
|
+
showConsoleLink('messaging', 'getProvider', providerId);
|
|
1947
|
+
} else {
|
|
1948
|
+
parse(response)
|
|
1949
|
+
}
|
|
1950
|
+
}
|
|
1951
|
+
|
|
1952
|
+
return response;
|
|
1953
|
+
|
|
1954
|
+
}
|
|
1955
|
+
|
|
1956
|
+
/**
|
|
1957
|
+
* @typedef {Object} MessagingDeleteProviderRequestParams
|
|
1958
|
+
* @property {string} providerId Provider ID.
|
|
1959
|
+
* @property {boolean} overrideForCli
|
|
1960
|
+
* @property {boolean} parseOutput
|
|
1961
|
+
* @property {libClient | undefined} sdk
|
|
1962
|
+
*/
|
|
1963
|
+
|
|
1964
|
+
/**
|
|
1965
|
+
* @param {MessagingDeleteProviderRequestParams} params
|
|
1966
|
+
*/
|
|
1967
|
+
const messagingDeleteProvider = async ({providerId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
1968
|
+
let client = !sdk ? await sdkForProject() :
|
|
1969
|
+
sdk;
|
|
1970
|
+
let apiPath = '/messaging/providers/{providerId}'.replace('{providerId}', providerId);
|
|
1971
|
+
let payload = {};
|
|
1972
|
+
|
|
1973
|
+
let response = undefined;
|
|
1974
|
+
|
|
1975
|
+
response = await client.call('delete', apiPath, {
|
|
1976
|
+
'content-type': 'application/json',
|
|
1977
|
+
}, payload);
|
|
1978
|
+
|
|
1979
|
+
if (parseOutput) {
|
|
1980
|
+
parse(response)
|
|
1981
|
+
}
|
|
1982
|
+
|
|
1983
|
+
return response;
|
|
1984
|
+
|
|
1985
|
+
}
|
|
1986
|
+
|
|
1987
|
+
/**
|
|
1988
|
+
* @typedef {Object} MessagingListProviderLogsRequestParams
|
|
1989
|
+
* @property {string} providerId Provider ID.
|
|
1990
|
+
* @property {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
|
|
1991
|
+
* @property {boolean} overrideForCli
|
|
1992
|
+
* @property {boolean} parseOutput
|
|
1993
|
+
* @property {libClient | undefined} sdk
|
|
1994
|
+
*/
|
|
1995
|
+
|
|
1996
|
+
/**
|
|
1997
|
+
* @param {MessagingListProviderLogsRequestParams} params
|
|
1998
|
+
*/
|
|
1999
|
+
const messagingListProviderLogs = async ({providerId,queries,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
2000
|
+
let client = !sdk ? await sdkForProject() :
|
|
2001
|
+
sdk;
|
|
2002
|
+
let apiPath = '/messaging/providers/{providerId}/logs'.replace('{providerId}', providerId);
|
|
2003
|
+
let payload = {};
|
|
2004
|
+
if (typeof queries !== 'undefined') {
|
|
2005
|
+
payload['queries'] = queries;
|
|
2006
|
+
}
|
|
2007
|
+
|
|
2008
|
+
let response = undefined;
|
|
2009
|
+
|
|
2010
|
+
response = await client.call('get', apiPath, {
|
|
2011
|
+
}, payload);
|
|
2012
|
+
|
|
2013
|
+
if (parseOutput) {
|
|
2014
|
+
parse(response)
|
|
2015
|
+
}
|
|
2016
|
+
|
|
2017
|
+
return response;
|
|
2018
|
+
|
|
2019
|
+
}
|
|
2020
|
+
|
|
2021
|
+
/**
|
|
2022
|
+
* @typedef {Object} MessagingListSubscriberLogsRequestParams
|
|
2023
|
+
* @property {string} subscriberId Subscriber ID.
|
|
2024
|
+
* @property {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
|
|
2025
|
+
* @property {boolean} overrideForCli
|
|
2026
|
+
* @property {boolean} parseOutput
|
|
2027
|
+
* @property {libClient | undefined} sdk
|
|
2028
|
+
*/
|
|
2029
|
+
|
|
2030
|
+
/**
|
|
2031
|
+
* @param {MessagingListSubscriberLogsRequestParams} params
|
|
2032
|
+
*/
|
|
2033
|
+
const messagingListSubscriberLogs = async ({subscriberId,queries,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
2034
|
+
let client = !sdk ? await sdkForProject() :
|
|
2035
|
+
sdk;
|
|
2036
|
+
let apiPath = '/messaging/subscribers/{subscriberId}/logs'.replace('{subscriberId}', subscriberId);
|
|
2037
|
+
let payload = {};
|
|
2038
|
+
if (typeof queries !== 'undefined') {
|
|
2039
|
+
payload['queries'] = queries;
|
|
2040
|
+
}
|
|
2041
|
+
|
|
2042
|
+
let response = undefined;
|
|
2043
|
+
|
|
2044
|
+
response = await client.call('get', apiPath, {
|
|
2045
|
+
}, payload);
|
|
2046
|
+
|
|
2047
|
+
if (parseOutput) {
|
|
2048
|
+
parse(response)
|
|
2049
|
+
}
|
|
2050
|
+
|
|
2051
|
+
return response;
|
|
2052
|
+
|
|
2053
|
+
}
|
|
2054
|
+
|
|
2055
|
+
/**
|
|
2056
|
+
* @typedef {Object} MessagingListTopicsRequestParams
|
|
2057
|
+
* @property {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
|
|
2058
|
+
* @property {string} search Search term to filter your list results. Max length: 256 chars.
|
|
2059
|
+
* @property {boolean} overrideForCli
|
|
2060
|
+
* @property {boolean} parseOutput
|
|
2061
|
+
* @property {libClient | undefined} sdk
|
|
2062
|
+
*/
|
|
2063
|
+
|
|
2064
|
+
/**
|
|
2065
|
+
* @param {MessagingListTopicsRequestParams} params
|
|
2066
|
+
*/
|
|
2067
|
+
const messagingListTopics = async ({queries,search,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
2068
|
+
let client = !sdk ? await sdkForProject() :
|
|
2069
|
+
sdk;
|
|
2070
|
+
let apiPath = '/messaging/topics';
|
|
2071
|
+
let payload = {};
|
|
2072
|
+
if (typeof queries !== 'undefined') {
|
|
2073
|
+
payload['queries'] = queries;
|
|
2074
|
+
}
|
|
2075
|
+
if (typeof search !== 'undefined') {
|
|
2076
|
+
payload['search'] = search;
|
|
2077
|
+
}
|
|
2078
|
+
|
|
2079
|
+
let response = undefined;
|
|
2080
|
+
|
|
2081
|
+
response = await client.call('get', apiPath, {
|
|
2082
|
+
}, payload);
|
|
2083
|
+
|
|
2084
|
+
if (parseOutput) {
|
|
2085
|
+
if(console) {
|
|
2086
|
+
showConsoleLink('messaging', 'listTopics');
|
|
2087
|
+
} else {
|
|
2088
|
+
parse(response)
|
|
2089
|
+
}
|
|
2090
|
+
}
|
|
2091
|
+
|
|
2092
|
+
return response;
|
|
2093
|
+
|
|
2094
|
+
}
|
|
2095
|
+
|
|
2096
|
+
/**
|
|
2097
|
+
* @typedef {Object} MessagingCreateTopicRequestParams
|
|
2098
|
+
* @property {string} topicId Topic ID. Choose a custom Topic ID or a new Topic ID.
|
|
2099
|
+
* @property {string} name Topic Name.
|
|
2100
|
+
* @property {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.
|
|
2101
|
+
* @property {boolean} overrideForCli
|
|
2102
|
+
* @property {boolean} parseOutput
|
|
2103
|
+
* @property {libClient | undefined} sdk
|
|
2104
|
+
*/
|
|
2105
|
+
|
|
2106
|
+
/**
|
|
2107
|
+
* @param {MessagingCreateTopicRequestParams} params
|
|
2108
|
+
*/
|
|
2109
|
+
const messagingCreateTopic = async ({topicId,name,subscribe,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
2110
|
+
let client = !sdk ? await sdkForProject() :
|
|
2111
|
+
sdk;
|
|
2112
|
+
let apiPath = '/messaging/topics';
|
|
2113
|
+
let payload = {};
|
|
2114
|
+
if (typeof topicId !== 'undefined') {
|
|
2115
|
+
payload['topicId'] = topicId;
|
|
2116
|
+
}
|
|
2117
|
+
if (typeof name !== 'undefined') {
|
|
2118
|
+
payload['name'] = name;
|
|
2119
|
+
}
|
|
2120
|
+
subscribe = subscribe === true ? [] : subscribe;
|
|
2121
|
+
if (typeof subscribe !== 'undefined') {
|
|
2122
|
+
payload['subscribe'] = subscribe;
|
|
2123
|
+
}
|
|
2124
|
+
|
|
2125
|
+
let response = undefined;
|
|
2126
|
+
|
|
2127
|
+
response = await client.call('post', apiPath, {
|
|
2128
|
+
'content-type': 'application/json',
|
|
2129
|
+
}, payload);
|
|
2130
|
+
|
|
2131
|
+
if (parseOutput) {
|
|
2132
|
+
parse(response)
|
|
2133
|
+
}
|
|
2134
|
+
|
|
2135
|
+
return response;
|
|
2136
|
+
|
|
2137
|
+
}
|
|
2138
|
+
|
|
2139
|
+
/**
|
|
2140
|
+
* @typedef {Object} MessagingGetTopicRequestParams
|
|
2141
|
+
* @property {string} topicId Topic ID.
|
|
2142
|
+
* @property {boolean} overrideForCli
|
|
2143
|
+
* @property {boolean} parseOutput
|
|
2144
|
+
* @property {libClient | undefined} sdk
|
|
2145
|
+
*/
|
|
2146
|
+
|
|
2147
|
+
/**
|
|
2148
|
+
* @param {MessagingGetTopicRequestParams} params
|
|
2149
|
+
*/
|
|
2150
|
+
const messagingGetTopic = async ({topicId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
2151
|
+
let client = !sdk ? await sdkForProject() :
|
|
2152
|
+
sdk;
|
|
2153
|
+
let apiPath = '/messaging/topics/{topicId}'.replace('{topicId}', topicId);
|
|
2154
|
+
let payload = {};
|
|
2155
|
+
|
|
2156
|
+
let response = undefined;
|
|
2157
|
+
|
|
2158
|
+
response = await client.call('get', apiPath, {
|
|
2159
|
+
}, payload);
|
|
2160
|
+
|
|
2161
|
+
if (parseOutput) {
|
|
2162
|
+
if(console) {
|
|
2163
|
+
showConsoleLink('messaging', 'getTopic', topicId);
|
|
2164
|
+
} else {
|
|
2165
|
+
parse(response)
|
|
2166
|
+
}
|
|
2167
|
+
}
|
|
2168
|
+
|
|
2169
|
+
return response;
|
|
2170
|
+
|
|
2171
|
+
}
|
|
2172
|
+
|
|
2173
|
+
/**
|
|
2174
|
+
* @typedef {Object} MessagingUpdateTopicRequestParams
|
|
2175
|
+
* @property {string} topicId Topic ID.
|
|
2176
|
+
* @property {string} name Topic Name.
|
|
2177
|
+
* @property {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.
|
|
2178
|
+
* @property {boolean} overrideForCli
|
|
2179
|
+
* @property {boolean} parseOutput
|
|
2180
|
+
* @property {libClient | undefined} sdk
|
|
2181
|
+
*/
|
|
2182
|
+
|
|
2183
|
+
/**
|
|
2184
|
+
* @param {MessagingUpdateTopicRequestParams} params
|
|
2185
|
+
*/
|
|
2186
|
+
const messagingUpdateTopic = async ({topicId,name,subscribe,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
2187
|
+
let client = !sdk ? await sdkForProject() :
|
|
2188
|
+
sdk;
|
|
2189
|
+
let apiPath = '/messaging/topics/{topicId}'.replace('{topicId}', topicId);
|
|
2190
|
+
let payload = {};
|
|
2191
|
+
if (typeof name !== 'undefined') {
|
|
2192
|
+
payload['name'] = name;
|
|
2193
|
+
}
|
|
2194
|
+
subscribe = subscribe === true ? [] : subscribe;
|
|
2195
|
+
if (typeof subscribe !== 'undefined') {
|
|
2196
|
+
payload['subscribe'] = subscribe;
|
|
2197
|
+
}
|
|
2198
|
+
|
|
2199
|
+
let response = undefined;
|
|
2200
|
+
|
|
2201
|
+
response = await client.call('patch', apiPath, {
|
|
2202
|
+
'content-type': 'application/json',
|
|
2203
|
+
}, payload);
|
|
2204
|
+
|
|
2205
|
+
if (parseOutput) {
|
|
2206
|
+
parse(response)
|
|
2207
|
+
}
|
|
2208
|
+
|
|
2209
|
+
return response;
|
|
2210
|
+
|
|
2211
|
+
}
|
|
2212
|
+
|
|
2213
|
+
/**
|
|
2214
|
+
* @typedef {Object} MessagingDeleteTopicRequestParams
|
|
2215
|
+
* @property {string} topicId Topic ID.
|
|
2216
|
+
* @property {boolean} overrideForCli
|
|
2217
|
+
* @property {boolean} parseOutput
|
|
2218
|
+
* @property {libClient | undefined} sdk
|
|
2219
|
+
*/
|
|
2220
|
+
|
|
2221
|
+
/**
|
|
2222
|
+
* @param {MessagingDeleteTopicRequestParams} params
|
|
2223
|
+
*/
|
|
2224
|
+
const messagingDeleteTopic = async ({topicId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
2225
|
+
let client = !sdk ? await sdkForProject() :
|
|
2226
|
+
sdk;
|
|
2227
|
+
let apiPath = '/messaging/topics/{topicId}'.replace('{topicId}', topicId);
|
|
2228
|
+
let payload = {};
|
|
2229
|
+
|
|
2230
|
+
let response = undefined;
|
|
2231
|
+
|
|
2232
|
+
response = await client.call('delete', apiPath, {
|
|
2233
|
+
'content-type': 'application/json',
|
|
2234
|
+
}, payload);
|
|
2235
|
+
|
|
2236
|
+
if (parseOutput) {
|
|
2237
|
+
parse(response)
|
|
2238
|
+
}
|
|
2239
|
+
|
|
2240
|
+
return response;
|
|
2241
|
+
|
|
2242
|
+
}
|
|
2243
|
+
|
|
2244
|
+
/**
|
|
2245
|
+
* @typedef {Object} MessagingListTopicLogsRequestParams
|
|
2246
|
+
* @property {string} topicId Topic ID.
|
|
2247
|
+
* @property {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
|
|
2248
|
+
* @property {boolean} overrideForCli
|
|
2249
|
+
* @property {boolean} parseOutput
|
|
2250
|
+
* @property {libClient | undefined} sdk
|
|
2251
|
+
*/
|
|
2252
|
+
|
|
2253
|
+
/**
|
|
2254
|
+
* @param {MessagingListTopicLogsRequestParams} params
|
|
2255
|
+
*/
|
|
2256
|
+
const messagingListTopicLogs = async ({topicId,queries,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
2257
|
+
let client = !sdk ? await sdkForProject() :
|
|
2258
|
+
sdk;
|
|
2259
|
+
let apiPath = '/messaging/topics/{topicId}/logs'.replace('{topicId}', topicId);
|
|
2260
|
+
let payload = {};
|
|
2261
|
+
if (typeof queries !== 'undefined') {
|
|
2262
|
+
payload['queries'] = queries;
|
|
2263
|
+
}
|
|
2264
|
+
|
|
2265
|
+
let response = undefined;
|
|
2266
|
+
|
|
2267
|
+
response = await client.call('get', apiPath, {
|
|
2268
|
+
}, payload);
|
|
2269
|
+
|
|
2270
|
+
if (parseOutput) {
|
|
2271
|
+
parse(response)
|
|
2272
|
+
}
|
|
2273
|
+
|
|
2274
|
+
return response;
|
|
2275
|
+
|
|
2276
|
+
}
|
|
2277
|
+
|
|
2278
|
+
/**
|
|
2279
|
+
* @typedef {Object} MessagingListSubscribersRequestParams
|
|
2280
|
+
* @property {string} topicId Topic ID. The topic ID subscribed to.
|
|
2281
|
+
* @property {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
|
|
2282
|
+
* @property {string} search Search term to filter your list results. Max length: 256 chars.
|
|
2283
|
+
* @property {boolean} overrideForCli
|
|
2284
|
+
* @property {boolean} parseOutput
|
|
2285
|
+
* @property {libClient | undefined} sdk
|
|
2286
|
+
*/
|
|
2287
|
+
|
|
2288
|
+
/**
|
|
2289
|
+
* @param {MessagingListSubscribersRequestParams} params
|
|
2290
|
+
*/
|
|
2291
|
+
const messagingListSubscribers = async ({topicId,queries,search,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
|
|
2292
|
+
let client = !sdk ? await sdkForProject() :
|
|
2293
|
+
sdk;
|
|
2294
|
+
let apiPath = '/messaging/topics/{topicId}/subscribers'.replace('{topicId}', topicId);
|
|
2295
|
+
let payload = {};
|
|
2296
|
+
if (typeof queries !== 'undefined') {
|
|
2297
|
+
payload['queries'] = queries;
|
|
2298
|
+
}
|
|
2299
|
+
if (typeof search !== 'undefined') {
|
|
2300
|
+
payload['search'] = search;
|
|
2301
|
+
}
|
|
2302
|
+
|
|
2303
|
+
let response = undefined;
|
|
2304
|
+
|
|
2305
|
+
response = await client.call('get', apiPath, {
|
|
2306
|
+
}, payload);
|
|
2307
|
+
|
|
2308
|
+
if (parseOutput) {
|
|
2309
|
+
if(console) {
|
|
2310
|
+
showConsoleLink('messaging', 'listSubscribers', topicId);
|
|
2311
|
+
} else {
|
|
2312
|
+
parse(response)
|
|
2313
|
+
}
|
|
2314
|
+
}
|
|
2315
|
+
|
|
2316
|
+
return response;
|
|
2317
|
+
|
|
2318
|
+
}
|
|
2319
|
+
|
|
2320
|
+
/**
|
|
2321
|
+
* @typedef {Object} MessagingCreateSubscriberRequestParams
|
|
2322
|
+
* @property {string} topicId Topic ID. The topic ID to subscribe to.
|
|
2323
|
+
* @property {string} subscriberId Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.
|
|
2324
|
+
* @property {string} targetId Target ID. The target ID to link to the specified Topic ID.
|
|
2325
|
+
* @property {boolean} overrideForCli
|
|
2326
|
+
* @property {boolean} parseOutput
|
|
2327
|
+
* @property {libClient | undefined} sdk
|
|
2328
|
+
*/
|
|
2329
|
+
|
|
2330
|
+
/**
|
|
2331
|
+
* @param {MessagingCreateSubscriberRequestParams} params
|
|
2332
|
+
*/
|
|
2333
|
+
const messagingCreateSubscriber = async ({topicId,subscriberId,targetId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
2334
|
+
let client = !sdk ? await sdkForProject() :
|
|
2335
|
+
sdk;
|
|
2336
|
+
let apiPath = '/messaging/topics/{topicId}/subscribers'.replace('{topicId}', topicId);
|
|
2337
|
+
let payload = {};
|
|
2338
|
+
if (typeof subscriberId !== 'undefined') {
|
|
2339
|
+
payload['subscriberId'] = subscriberId;
|
|
2340
|
+
}
|
|
2341
|
+
if (typeof targetId !== 'undefined') {
|
|
2342
|
+
payload['targetId'] = targetId;
|
|
2343
|
+
}
|
|
2344
|
+
|
|
2345
|
+
let response = undefined;
|
|
2346
|
+
|
|
2347
|
+
response = await client.call('post', apiPath, {
|
|
2348
|
+
'content-type': 'application/json',
|
|
2349
|
+
}, payload);
|
|
2350
|
+
|
|
2351
|
+
if (parseOutput) {
|
|
2352
|
+
parse(response)
|
|
2353
|
+
}
|
|
2354
|
+
|
|
2355
|
+
return response;
|
|
2356
|
+
|
|
2357
|
+
}
|
|
2358
|
+
|
|
2359
|
+
/**
|
|
2360
|
+
* @typedef {Object} MessagingGetSubscriberRequestParams
|
|
2361
|
+
* @property {string} topicId Topic ID. The topic ID subscribed to.
|
|
2362
|
+
* @property {string} subscriberId Subscriber ID.
|
|
2363
|
+
* @property {boolean} overrideForCli
|
|
2364
|
+
* @property {boolean} parseOutput
|
|
2365
|
+
* @property {libClient | undefined} sdk
|
|
2366
|
+
*/
|
|
2367
|
+
|
|
2368
|
+
/**
|
|
2369
|
+
* @param {MessagingGetSubscriberRequestParams} params
|
|
2370
|
+
*/
|
|
2371
|
+
const messagingGetSubscriber = async ({topicId,subscriberId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
2372
|
+
let client = !sdk ? await sdkForProject() :
|
|
2373
|
+
sdk;
|
|
2374
|
+
let apiPath = '/messaging/topics/{topicId}/subscribers/{subscriberId}'.replace('{topicId}', topicId).replace('{subscriberId}', subscriberId);
|
|
2375
|
+
let payload = {};
|
|
2376
|
+
|
|
2377
|
+
let response = undefined;
|
|
2378
|
+
|
|
2379
|
+
response = await client.call('get', apiPath, {
|
|
2380
|
+
}, payload);
|
|
2381
|
+
|
|
2382
|
+
if (parseOutput) {
|
|
2383
|
+
parse(response)
|
|
2384
|
+
}
|
|
2385
|
+
|
|
2386
|
+
return response;
|
|
2387
|
+
|
|
2388
|
+
}
|
|
2389
|
+
|
|
2390
|
+
/**
|
|
2391
|
+
* @typedef {Object} MessagingDeleteSubscriberRequestParams
|
|
2392
|
+
* @property {string} topicId Topic ID. The topic ID subscribed to.
|
|
2393
|
+
* @property {string} subscriberId Subscriber ID.
|
|
2394
|
+
* @property {boolean} overrideForCli
|
|
2395
|
+
* @property {boolean} parseOutput
|
|
2396
|
+
* @property {libClient | undefined} sdk
|
|
2397
|
+
*/
|
|
2398
|
+
|
|
2399
|
+
/**
|
|
2400
|
+
* @param {MessagingDeleteSubscriberRequestParams} params
|
|
2401
|
+
*/
|
|
2402
|
+
const messagingDeleteSubscriber = async ({topicId,subscriberId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
|
|
2403
|
+
let client = !sdk ? await sdkForProject() :
|
|
2404
|
+
sdk;
|
|
2405
|
+
let apiPath = '/messaging/topics/{topicId}/subscribers/{subscriberId}'.replace('{topicId}', topicId).replace('{subscriberId}', subscriberId);
|
|
2406
|
+
let payload = {};
|
|
2407
|
+
|
|
2408
|
+
let response = undefined;
|
|
2409
|
+
|
|
2410
|
+
response = await client.call('delete', apiPath, {
|
|
2411
|
+
'content-type': 'application/json',
|
|
2412
|
+
}, payload);
|
|
2413
|
+
|
|
2414
|
+
if (parseOutput) {
|
|
2415
|
+
parse(response)
|
|
2416
|
+
}
|
|
2417
|
+
|
|
2418
|
+
return response;
|
|
2419
|
+
|
|
2420
|
+
}
|
|
2421
|
+
|
|
2422
|
+
messaging
|
|
2423
|
+
.command(`list-messages`)
|
|
2424
|
+
.description(`Get a list of all messages from the current Appwrite project.`)
|
|
2425
|
+
.option(`--queries [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`)
|
|
2426
|
+
.option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
|
|
2427
|
+
.option(`--console`, `Get the resource console url`)
|
|
2428
|
+
.action(actionRunner(messagingListMessages))
|
|
2429
|
+
|
|
2430
|
+
messaging
|
|
2431
|
+
.command(`create-email`)
|
|
2432
|
+
.description(`Create a new email message.`)
|
|
2433
|
+
.requiredOption(`--message-id <message-id>`, `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.`)
|
|
2434
|
+
.requiredOption(`--subject <subject>`, `Email Subject.`)
|
|
2435
|
+
.requiredOption(`--content <content>`, `Email Content.`)
|
|
2436
|
+
.option(`--topics [topics...]`, `List of Topic IDs.`)
|
|
2437
|
+
.option(`--users [users...]`, `List of User IDs.`)
|
|
2438
|
+
.option(`--targets [targets...]`, `List of Targets IDs.`)
|
|
2439
|
+
.option(`--cc [cc...]`, `Array of target IDs to be added as CC.`)
|
|
2440
|
+
.option(`--bcc [bcc...]`, `Array of target IDs to be added as BCC.`)
|
|
2441
|
+
.option(`--attachments [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>.`)
|
|
2442
|
+
.option(`--draft [value]`, `Is message a draft`, (value) => value === undefined ? true : parseBool(value))
|
|
2443
|
+
.option(`--html [value]`, `Is content of type HTML`, (value) => value === undefined ? true : parseBool(value))
|
|
2444
|
+
.option(`--scheduled-at <scheduled-at>`, `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.`)
|
|
2445
|
+
.action(actionRunner(messagingCreateEmail))
|
|
2446
|
+
|
|
2447
|
+
messaging
|
|
2448
|
+
.command(`update-email`)
|
|
2449
|
+
.description(`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. `)
|
|
2450
|
+
.requiredOption(`--message-id <message-id>`, `Message ID.`)
|
|
2451
|
+
.option(`--topics [topics...]`, `List of Topic IDs.`)
|
|
2452
|
+
.option(`--users [users...]`, `List of User IDs.`)
|
|
2453
|
+
.option(`--targets [targets...]`, `List of Targets IDs.`)
|
|
2454
|
+
.option(`--subject <subject>`, `Email Subject.`)
|
|
2455
|
+
.option(`--content <content>`, `Email Content.`)
|
|
2456
|
+
.option(`--draft [value]`, `Is message a draft`, (value) => value === undefined ? true : parseBool(value))
|
|
2457
|
+
.option(`--html [value]`, `Is content of type HTML`, (value) => value === undefined ? true : parseBool(value))
|
|
2458
|
+
.option(`--cc [cc...]`, `Array of target IDs to be added as CC.`)
|
|
2459
|
+
.option(`--bcc [bcc...]`, `Array of target IDs to be added as BCC.`)
|
|
2460
|
+
.option(`--scheduled-at <scheduled-at>`, `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.`)
|
|
2461
|
+
.option(`--attachments [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>.`)
|
|
2462
|
+
.action(actionRunner(messagingUpdateEmail))
|
|
2463
|
+
|
|
2464
|
+
messaging
|
|
2465
|
+
.command(`create-push`)
|
|
2466
|
+
.description(`Create a new push notification.`)
|
|
2467
|
+
.requiredOption(`--message-id <message-id>`, `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.`)
|
|
2468
|
+
.option(`--title <title>`, `Title for push notification.`)
|
|
2469
|
+
.option(`--body <body>`, `Body for push notification.`)
|
|
2470
|
+
.option(`--topics [topics...]`, `List of Topic IDs.`)
|
|
2471
|
+
.option(`--users [users...]`, `List of User IDs.`)
|
|
2472
|
+
.option(`--targets [targets...]`, `List of Targets IDs.`)
|
|
2473
|
+
.option(`--data <data>`, `Additional key-value pair data for push notification.`)
|
|
2474
|
+
.option(`--action <action>`, `Action for push notification.`)
|
|
2475
|
+
.option(`--image <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>.`)
|
|
2476
|
+
.option(`--icon <icon>`, `Icon for push notification. Available only for Android and Web Platform.`)
|
|
2477
|
+
.option(`--sound <sound>`, `Sound for push notification. Available only for Android and iOS Platform.`)
|
|
2478
|
+
.option(`--color <color>`, `Color for push notification. Available only for Android Platform.`)
|
|
2479
|
+
.option(`--tag <tag>`, `Tag for push notification. Available only for Android Platform.`)
|
|
2480
|
+
.option(`--badge <badge>`, `Badge for push notification. Available only for iOS Platform.`, parseInteger)
|
|
2481
|
+
.option(`--draft [value]`, `Is message a draft`, (value) => value === undefined ? true : parseBool(value))
|
|
2482
|
+
.option(`--scheduled-at <scheduled-at>`, `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.`)
|
|
2483
|
+
.option(`--content-available [value]`, `If set to true, the notification will be delivered in the background. Available only for iOS Platform.`, (value) => value === undefined ? true : parseBool(value))
|
|
2484
|
+
.option(`--critical [value]`, `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.`, (value) => value === undefined ? true : parseBool(value))
|
|
2485
|
+
.option(`--priority <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.`)
|
|
2486
|
+
.action(actionRunner(messagingCreatePush))
|
|
2487
|
+
|
|
2488
|
+
messaging
|
|
2489
|
+
.command(`update-push`)
|
|
2490
|
+
.description(`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. `)
|
|
2491
|
+
.requiredOption(`--message-id <message-id>`, `Message ID.`)
|
|
2492
|
+
.option(`--topics [topics...]`, `List of Topic IDs.`)
|
|
2493
|
+
.option(`--users [users...]`, `List of User IDs.`)
|
|
2494
|
+
.option(`--targets [targets...]`, `List of Targets IDs.`)
|
|
2495
|
+
.option(`--title <title>`, `Title for push notification.`)
|
|
2496
|
+
.option(`--body <body>`, `Body for push notification.`)
|
|
2497
|
+
.option(`--data <data>`, `Additional Data for push notification.`)
|
|
2498
|
+
.option(`--action <action>`, `Action for push notification.`)
|
|
2499
|
+
.option(`--image <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>.`)
|
|
2500
|
+
.option(`--icon <icon>`, `Icon for push notification. Available only for Android and Web platforms.`)
|
|
2501
|
+
.option(`--sound <sound>`, `Sound for push notification. Available only for Android and iOS platforms.`)
|
|
2502
|
+
.option(`--color <color>`, `Color for push notification. Available only for Android platforms.`)
|
|
2503
|
+
.option(`--tag <tag>`, `Tag for push notification. Available only for Android platforms.`)
|
|
2504
|
+
.option(`--badge <badge>`, `Badge for push notification. Available only for iOS platforms.`, parseInteger)
|
|
2505
|
+
.option(`--draft [value]`, `Is message a draft`, (value) => value === undefined ? true : parseBool(value))
|
|
2506
|
+
.option(`--scheduled-at <scheduled-at>`, `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.`)
|
|
2507
|
+
.option(`--content-available [value]`, `If set to true, the notification will be delivered in the background. Available only for iOS Platform.`, (value) => value === undefined ? true : parseBool(value))
|
|
2508
|
+
.option(`--critical [value]`, `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.`, (value) => value === undefined ? true : parseBool(value))
|
|
2509
|
+
.option(`--priority <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.`)
|
|
2510
|
+
.action(actionRunner(messagingUpdatePush))
|
|
2511
|
+
|
|
2512
|
+
messaging
|
|
2513
|
+
.command(`create-sms`)
|
|
2514
|
+
.description(`Create a new SMS message.`)
|
|
2515
|
+
.requiredOption(`--message-id <message-id>`, `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.`)
|
|
2516
|
+
.requiredOption(`--content <content>`, `SMS Content.`)
|
|
2517
|
+
.option(`--topics [topics...]`, `List of Topic IDs.`)
|
|
2518
|
+
.option(`--users [users...]`, `List of User IDs.`)
|
|
2519
|
+
.option(`--targets [targets...]`, `List of Targets IDs.`)
|
|
2520
|
+
.option(`--draft [value]`, `Is message a draft`, (value) => value === undefined ? true : parseBool(value))
|
|
2521
|
+
.option(`--scheduled-at <scheduled-at>`, `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.`)
|
|
2522
|
+
.action(actionRunner(messagingCreateSms))
|
|
2523
|
+
|
|
2524
|
+
messaging
|
|
2525
|
+
.command(`update-sms`)
|
|
2526
|
+
.description(`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. `)
|
|
2527
|
+
.requiredOption(`--message-id <message-id>`, `Message ID.`)
|
|
2528
|
+
.option(`--topics [topics...]`, `List of Topic IDs.`)
|
|
2529
|
+
.option(`--users [users...]`, `List of User IDs.`)
|
|
2530
|
+
.option(`--targets [targets...]`, `List of Targets IDs.`)
|
|
2531
|
+
.option(`--content <content>`, `Email Content.`)
|
|
2532
|
+
.option(`--draft [value]`, `Is message a draft`, (value) => value === undefined ? true : parseBool(value))
|
|
2533
|
+
.option(`--scheduled-at <scheduled-at>`, `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.`)
|
|
2534
|
+
.action(actionRunner(messagingUpdateSms))
|
|
2535
|
+
|
|
2536
|
+
messaging
|
|
2537
|
+
.command(`get-message`)
|
|
2538
|
+
.description(`Get a message by its unique ID. `)
|
|
2539
|
+
.requiredOption(`--message-id <message-id>`, `Message ID.`)
|
|
2540
|
+
.option(`--console`, `Get the resource console url`)
|
|
2541
|
+
.action(actionRunner(messagingGetMessage))
|
|
2542
|
+
|
|
2543
|
+
messaging
|
|
2544
|
+
.command(`delete`)
|
|
2545
|
+
.description(`Delete a message. If the message is not a draft or scheduled, but has been sent, this will not recall the message.`)
|
|
2546
|
+
.requiredOption(`--message-id <message-id>`, `Message ID.`)
|
|
2547
|
+
.action(actionRunner(messagingDelete))
|
|
2548
|
+
|
|
2549
|
+
messaging
|
|
2550
|
+
.command(`list-message-logs`)
|
|
2551
|
+
.description(`Get the message activity logs listed by its unique ID.`)
|
|
2552
|
+
.requiredOption(`--message-id <message-id>`, `Message ID.`)
|
|
2553
|
+
.option(`--queries [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`)
|
|
2554
|
+
.option(`--console`, `Get the resource console url`)
|
|
2555
|
+
.action(actionRunner(messagingListMessageLogs))
|
|
2556
|
+
|
|
2557
|
+
messaging
|
|
2558
|
+
.command(`list-targets`)
|
|
2559
|
+
.description(`Get a list of the targets associated with a message.`)
|
|
2560
|
+
.requiredOption(`--message-id <message-id>`, `Message ID.`)
|
|
2561
|
+
.option(`--queries [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`)
|
|
2562
|
+
.action(actionRunner(messagingListTargets))
|
|
2563
|
+
|
|
2564
|
+
messaging
|
|
2565
|
+
.command(`list-providers`)
|
|
2566
|
+
.description(`Get a list of all providers from the current Appwrite project.`)
|
|
2567
|
+
.option(`--queries [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`)
|
|
2568
|
+
.option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
|
|
2569
|
+
.option(`--console`, `Get the resource console url`)
|
|
2570
|
+
.action(actionRunner(messagingListProviders))
|
|
2571
|
+
|
|
2572
|
+
messaging
|
|
2573
|
+
.command(`create-apns-provider`)
|
|
2574
|
+
.description(`Create a new Apple Push Notification service provider.`)
|
|
2575
|
+
.requiredOption(`--provider-id <provider-id>`, `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.`)
|
|
2576
|
+
.requiredOption(`--name <name>`, `Provider name.`)
|
|
2577
|
+
.option(`--auth-key <auth-key>`, `APNS authentication key.`)
|
|
2578
|
+
.option(`--auth-key-id <auth-key-id>`, `APNS authentication key ID.`)
|
|
2579
|
+
.option(`--team-id <team-id>`, `APNS team ID.`)
|
|
2580
|
+
.option(`--bundle-id <bundle-id>`, `APNS bundle ID.`)
|
|
2581
|
+
.option(`--sandbox [value]`, `Use APNS sandbox environment.`, (value) => value === undefined ? true : parseBool(value))
|
|
2582
|
+
.option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
|
|
2583
|
+
.action(actionRunner(messagingCreateApnsProvider))
|
|
2584
|
+
|
|
2585
|
+
messaging
|
|
2586
|
+
.command(`update-apns-provider`)
|
|
2587
|
+
.description(`Update a Apple Push Notification service provider by its unique ID.`)
|
|
2588
|
+
.requiredOption(`--provider-id <provider-id>`, `Provider ID.`)
|
|
2589
|
+
.option(`--name <name>`, `Provider name.`)
|
|
2590
|
+
.option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
|
|
2591
|
+
.option(`--auth-key <auth-key>`, `APNS authentication key.`)
|
|
2592
|
+
.option(`--auth-key-id <auth-key-id>`, `APNS authentication key ID.`)
|
|
2593
|
+
.option(`--team-id <team-id>`, `APNS team ID.`)
|
|
2594
|
+
.option(`--bundle-id <bundle-id>`, `APNS bundle ID.`)
|
|
2595
|
+
.option(`--sandbox [value]`, `Use APNS sandbox environment.`, (value) => value === undefined ? true : parseBool(value))
|
|
2596
|
+
.action(actionRunner(messagingUpdateApnsProvider))
|
|
2597
|
+
|
|
2598
|
+
messaging
|
|
2599
|
+
.command(`create-fcm-provider`)
|
|
2600
|
+
.description(`Create a new Firebase Cloud Messaging provider.`)
|
|
2601
|
+
.requiredOption(`--provider-id <provider-id>`, `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.`)
|
|
2602
|
+
.requiredOption(`--name <name>`, `Provider name.`)
|
|
2603
|
+
.option(`--service-account-json <service-account-json>`, `FCM service account JSON.`)
|
|
2604
|
+
.option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
|
|
2605
|
+
.action(actionRunner(messagingCreateFcmProvider))
|
|
2606
|
+
|
|
2607
|
+
messaging
|
|
2608
|
+
.command(`update-fcm-provider`)
|
|
2609
|
+
.description(`Update a Firebase Cloud Messaging provider by its unique ID.`)
|
|
2610
|
+
.requiredOption(`--provider-id <provider-id>`, `Provider ID.`)
|
|
2611
|
+
.option(`--name <name>`, `Provider name.`)
|
|
2612
|
+
.option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
|
|
2613
|
+
.option(`--service-account-json <service-account-json>`, `FCM service account JSON.`)
|
|
2614
|
+
.action(actionRunner(messagingUpdateFcmProvider))
|
|
2615
|
+
|
|
2616
|
+
messaging
|
|
2617
|
+
.command(`create-mailgun-provider`)
|
|
2618
|
+
.description(`Create a new Mailgun provider.`)
|
|
2619
|
+
.requiredOption(`--provider-id <provider-id>`, `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.`)
|
|
2620
|
+
.requiredOption(`--name <name>`, `Provider name.`)
|
|
2621
|
+
.option(`--api-key <api-key>`, `Mailgun API Key.`)
|
|
2622
|
+
.option(`--domain <domain>`, `Mailgun Domain.`)
|
|
2623
|
+
.option(`--is-eu-region [value]`, `Set as EU region.`, (value) => value === undefined ? true : parseBool(value))
|
|
2624
|
+
.option(`--from-name <from-name>`, `Sender Name.`)
|
|
2625
|
+
.option(`--from-email <from-email>`, `Sender email address.`)
|
|
2626
|
+
.option(`--reply-to-name <reply-to-name>`, `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.`)
|
|
2627
|
+
.option(`--reply-to-email <reply-to-email>`, `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.`)
|
|
2628
|
+
.option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
|
|
2629
|
+
.action(actionRunner(messagingCreateMailgunProvider))
|
|
2630
|
+
|
|
2631
|
+
messaging
|
|
2632
|
+
.command(`update-mailgun-provider`)
|
|
2633
|
+
.description(`Update a Mailgun provider by its unique ID.`)
|
|
2634
|
+
.requiredOption(`--provider-id <provider-id>`, `Provider ID.`)
|
|
2635
|
+
.option(`--name <name>`, `Provider name.`)
|
|
2636
|
+
.option(`--api-key <api-key>`, `Mailgun API Key.`)
|
|
2637
|
+
.option(`--domain <domain>`, `Mailgun Domain.`)
|
|
2638
|
+
.option(`--is-eu-region [value]`, `Set as EU region.`, (value) => value === undefined ? true : parseBool(value))
|
|
2639
|
+
.option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
|
|
2640
|
+
.option(`--from-name <from-name>`, `Sender Name.`)
|
|
2641
|
+
.option(`--from-email <from-email>`, `Sender email address.`)
|
|
2642
|
+
.option(`--reply-to-name <reply-to-name>`, `Name set in the reply to field for the mail. Default value is sender name.`)
|
|
2643
|
+
.option(`--reply-to-email <reply-to-email>`, `Email set in the reply to field for the mail. Default value is sender email.`)
|
|
2644
|
+
.action(actionRunner(messagingUpdateMailgunProvider))
|
|
2645
|
+
|
|
2646
|
+
messaging
|
|
2647
|
+
.command(`create-msg-91-provider`)
|
|
2648
|
+
.description(`Create a new MSG91 provider.`)
|
|
2649
|
+
.requiredOption(`--provider-id <provider-id>`, `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.`)
|
|
2650
|
+
.requiredOption(`--name <name>`, `Provider name.`)
|
|
2651
|
+
.option(`--template-id <template-id>`, `Msg91 template ID`)
|
|
2652
|
+
.option(`--sender-id <sender-id>`, `Msg91 sender ID.`)
|
|
2653
|
+
.option(`--auth-key <auth-key>`, `Msg91 auth key.`)
|
|
2654
|
+
.option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
|
|
2655
|
+
.action(actionRunner(messagingCreateMsg91Provider))
|
|
2656
|
+
|
|
2657
|
+
messaging
|
|
2658
|
+
.command(`update-msg-91-provider`)
|
|
2659
|
+
.description(`Update a MSG91 provider by its unique ID.`)
|
|
2660
|
+
.requiredOption(`--provider-id <provider-id>`, `Provider ID.`)
|
|
2661
|
+
.option(`--name <name>`, `Provider name.`)
|
|
2662
|
+
.option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
|
|
2663
|
+
.option(`--template-id <template-id>`, `Msg91 template ID.`)
|
|
2664
|
+
.option(`--sender-id <sender-id>`, `Msg91 sender ID.`)
|
|
2665
|
+
.option(`--auth-key <auth-key>`, `Msg91 auth key.`)
|
|
2666
|
+
.action(actionRunner(messagingUpdateMsg91Provider))
|
|
2667
|
+
|
|
2668
|
+
messaging
|
|
2669
|
+
.command(`create-sendgrid-provider`)
|
|
2670
|
+
.description(`Create a new Sendgrid provider.`)
|
|
2671
|
+
.requiredOption(`--provider-id <provider-id>`, `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.`)
|
|
2672
|
+
.requiredOption(`--name <name>`, `Provider name.`)
|
|
2673
|
+
.option(`--api-key <api-key>`, `Sendgrid API key.`)
|
|
2674
|
+
.option(`--from-name <from-name>`, `Sender Name.`)
|
|
2675
|
+
.option(`--from-email <from-email>`, `Sender email address.`)
|
|
2676
|
+
.option(`--reply-to-name <reply-to-name>`, `Name set in the reply to field for the mail. Default value is sender name.`)
|
|
2677
|
+
.option(`--reply-to-email <reply-to-email>`, `Email set in the reply to field for the mail. Default value is sender email.`)
|
|
2678
|
+
.option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
|
|
2679
|
+
.action(actionRunner(messagingCreateSendgridProvider))
|
|
2680
|
+
|
|
2681
|
+
messaging
|
|
2682
|
+
.command(`update-sendgrid-provider`)
|
|
2683
|
+
.description(`Update a Sendgrid provider by its unique ID.`)
|
|
2684
|
+
.requiredOption(`--provider-id <provider-id>`, `Provider ID.`)
|
|
2685
|
+
.option(`--name <name>`, `Provider name.`)
|
|
2686
|
+
.option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
|
|
2687
|
+
.option(`--api-key <api-key>`, `Sendgrid API key.`)
|
|
2688
|
+
.option(`--from-name <from-name>`, `Sender Name.`)
|
|
2689
|
+
.option(`--from-email <from-email>`, `Sender email address.`)
|
|
2690
|
+
.option(`--reply-to-name <reply-to-name>`, `Name set in the Reply To field for the mail. Default value is Sender Name.`)
|
|
2691
|
+
.option(`--reply-to-email <reply-to-email>`, `Email set in the Reply To field for the mail. Default value is Sender Email.`)
|
|
2692
|
+
.action(actionRunner(messagingUpdateSendgridProvider))
|
|
2693
|
+
|
|
2694
|
+
messaging
|
|
2695
|
+
.command(`create-smtp-provider`)
|
|
2696
|
+
.description(`Create a new SMTP provider.`)
|
|
2697
|
+
.requiredOption(`--provider-id <provider-id>`, `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.`)
|
|
2698
|
+
.requiredOption(`--name <name>`, `Provider name.`)
|
|
2699
|
+
.requiredOption(`--host <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.`)
|
|
2700
|
+
.option(`--port <port>`, `The default SMTP server port.`, parseInteger)
|
|
2701
|
+
.option(`--username <username>`, `Authentication username.`)
|
|
2702
|
+
.option(`--password <password>`, `Authentication password.`)
|
|
2703
|
+
.option(`--encryption <encryption>`, `Encryption type. Can be omitted, 'ssl', or 'tls'`)
|
|
2704
|
+
.option(`--auto-tls [value]`, `Enable SMTP AutoTLS feature.`, (value) => value === undefined ? true : parseBool(value))
|
|
2705
|
+
.option(`--mailer <mailer>`, `The value to use for the X-Mailer header.`)
|
|
2706
|
+
.option(`--from-name <from-name>`, `Sender Name.`)
|
|
2707
|
+
.option(`--from-email <from-email>`, `Sender email address.`)
|
|
2708
|
+
.option(`--reply-to-name <reply-to-name>`, `Name set in the reply to field for the mail. Default value is sender name.`)
|
|
2709
|
+
.option(`--reply-to-email <reply-to-email>`, `Email set in the reply to field for the mail. Default value is sender email.`)
|
|
2710
|
+
.option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
|
|
2711
|
+
.action(actionRunner(messagingCreateSmtpProvider))
|
|
2712
|
+
|
|
2713
|
+
messaging
|
|
2714
|
+
.command(`update-smtp-provider`)
|
|
2715
|
+
.description(`Update a SMTP provider by its unique ID.`)
|
|
2716
|
+
.requiredOption(`--provider-id <provider-id>`, `Provider ID.`)
|
|
2717
|
+
.option(`--name <name>`, `Provider name.`)
|
|
2718
|
+
.option(`--host <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.`)
|
|
2719
|
+
.option(`--port <port>`, `SMTP port.`, parseInteger)
|
|
2720
|
+
.option(`--username <username>`, `Authentication username.`)
|
|
2721
|
+
.option(`--password <password>`, `Authentication password.`)
|
|
2722
|
+
.option(`--encryption <encryption>`, `Encryption type. Can be 'ssl' or 'tls'`)
|
|
2723
|
+
.option(`--auto-tls [value]`, `Enable SMTP AutoTLS feature.`, (value) => value === undefined ? true : parseBool(value))
|
|
2724
|
+
.option(`--mailer <mailer>`, `The value to use for the X-Mailer header.`)
|
|
2725
|
+
.option(`--from-name <from-name>`, `Sender Name.`)
|
|
2726
|
+
.option(`--from-email <from-email>`, `Sender email address.`)
|
|
2727
|
+
.option(`--reply-to-name <reply-to-name>`, `Name set in the Reply To field for the mail. Default value is Sender Name.`)
|
|
2728
|
+
.option(`--reply-to-email <reply-to-email>`, `Email set in the Reply To field for the mail. Default value is Sender Email.`)
|
|
2729
|
+
.option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
|
|
2730
|
+
.action(actionRunner(messagingUpdateSmtpProvider))
|
|
2731
|
+
|
|
2732
|
+
messaging
|
|
2733
|
+
.command(`create-telesign-provider`)
|
|
2734
|
+
.description(`Create a new Telesign provider.`)
|
|
2735
|
+
.requiredOption(`--provider-id <provider-id>`, `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.`)
|
|
2736
|
+
.requiredOption(`--name <name>`, `Provider name.`)
|
|
2737
|
+
.option(`--from <from>`, `Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`)
|
|
2738
|
+
.option(`--customer-id <customer-id>`, `Telesign customer ID.`)
|
|
2739
|
+
.option(`--api-key <api-key>`, `Telesign API key.`)
|
|
2740
|
+
.option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
|
|
2741
|
+
.action(actionRunner(messagingCreateTelesignProvider))
|
|
2742
|
+
|
|
2743
|
+
messaging
|
|
2744
|
+
.command(`update-telesign-provider`)
|
|
2745
|
+
.description(`Update a Telesign provider by its unique ID.`)
|
|
2746
|
+
.requiredOption(`--provider-id <provider-id>`, `Provider ID.`)
|
|
2747
|
+
.option(`--name <name>`, `Provider name.`)
|
|
2748
|
+
.option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
|
|
2749
|
+
.option(`--customer-id <customer-id>`, `Telesign customer ID.`)
|
|
2750
|
+
.option(`--api-key <api-key>`, `Telesign API key.`)
|
|
2751
|
+
.option(`--from <from>`, `Sender number.`)
|
|
2752
|
+
.action(actionRunner(messagingUpdateTelesignProvider))
|
|
2753
|
+
|
|
2754
|
+
messaging
|
|
2755
|
+
.command(`create-textmagic-provider`)
|
|
2756
|
+
.description(`Create a new Textmagic provider.`)
|
|
2757
|
+
.requiredOption(`--provider-id <provider-id>`, `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.`)
|
|
2758
|
+
.requiredOption(`--name <name>`, `Provider name.`)
|
|
2759
|
+
.option(`--from <from>`, `Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`)
|
|
2760
|
+
.option(`--username <username>`, `Textmagic username.`)
|
|
2761
|
+
.option(`--api-key <api-key>`, `Textmagic apiKey.`)
|
|
2762
|
+
.option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
|
|
2763
|
+
.action(actionRunner(messagingCreateTextmagicProvider))
|
|
2764
|
+
|
|
2765
|
+
messaging
|
|
2766
|
+
.command(`update-textmagic-provider`)
|
|
2767
|
+
.description(`Update a Textmagic provider by its unique ID.`)
|
|
2768
|
+
.requiredOption(`--provider-id <provider-id>`, `Provider ID.`)
|
|
2769
|
+
.option(`--name <name>`, `Provider name.`)
|
|
2770
|
+
.option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
|
|
2771
|
+
.option(`--username <username>`, `Textmagic username.`)
|
|
2772
|
+
.option(`--api-key <api-key>`, `Textmagic apiKey.`)
|
|
2773
|
+
.option(`--from <from>`, `Sender number.`)
|
|
2774
|
+
.action(actionRunner(messagingUpdateTextmagicProvider))
|
|
2775
|
+
|
|
2776
|
+
messaging
|
|
2777
|
+
.command(`create-twilio-provider`)
|
|
2778
|
+
.description(`Create a new Twilio provider.`)
|
|
2779
|
+
.requiredOption(`--provider-id <provider-id>`, `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.`)
|
|
2780
|
+
.requiredOption(`--name <name>`, `Provider name.`)
|
|
2781
|
+
.option(`--from <from>`, `Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`)
|
|
2782
|
+
.option(`--account-sid <account-sid>`, `Twilio account secret ID.`)
|
|
2783
|
+
.option(`--auth-token <auth-token>`, `Twilio authentication token.`)
|
|
2784
|
+
.option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
|
|
2785
|
+
.action(actionRunner(messagingCreateTwilioProvider))
|
|
2786
|
+
|
|
2787
|
+
messaging
|
|
2788
|
+
.command(`update-twilio-provider`)
|
|
2789
|
+
.description(`Update a Twilio provider by its unique ID.`)
|
|
2790
|
+
.requiredOption(`--provider-id <provider-id>`, `Provider ID.`)
|
|
2791
|
+
.option(`--name <name>`, `Provider name.`)
|
|
2792
|
+
.option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
|
|
2793
|
+
.option(`--account-sid <account-sid>`, `Twilio account secret ID.`)
|
|
2794
|
+
.option(`--auth-token <auth-token>`, `Twilio authentication token.`)
|
|
2795
|
+
.option(`--from <from>`, `Sender number.`)
|
|
2796
|
+
.action(actionRunner(messagingUpdateTwilioProvider))
|
|
2797
|
+
|
|
2798
|
+
messaging
|
|
2799
|
+
.command(`create-vonage-provider`)
|
|
2800
|
+
.description(`Create a new Vonage provider.`)
|
|
2801
|
+
.requiredOption(`--provider-id <provider-id>`, `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.`)
|
|
2802
|
+
.requiredOption(`--name <name>`, `Provider name.`)
|
|
2803
|
+
.option(`--from <from>`, `Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`)
|
|
2804
|
+
.option(`--api-key <api-key>`, `Vonage API key.`)
|
|
2805
|
+
.option(`--api-secret <api-secret>`, `Vonage API secret.`)
|
|
2806
|
+
.option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
|
|
2807
|
+
.action(actionRunner(messagingCreateVonageProvider))
|
|
2808
|
+
|
|
2809
|
+
messaging
|
|
2810
|
+
.command(`update-vonage-provider`)
|
|
2811
|
+
.description(`Update a Vonage provider by its unique ID.`)
|
|
2812
|
+
.requiredOption(`--provider-id <provider-id>`, `Provider ID.`)
|
|
2813
|
+
.option(`--name <name>`, `Provider name.`)
|
|
2814
|
+
.option(`--enabled [value]`, `Set as enabled.`, (value) => value === undefined ? true : parseBool(value))
|
|
2815
|
+
.option(`--api-key <api-key>`, `Vonage API key.`)
|
|
2816
|
+
.option(`--api-secret <api-secret>`, `Vonage API secret.`)
|
|
2817
|
+
.option(`--from <from>`, `Sender number.`)
|
|
2818
|
+
.action(actionRunner(messagingUpdateVonageProvider))
|
|
2819
|
+
|
|
2820
|
+
messaging
|
|
2821
|
+
.command(`get-provider`)
|
|
2822
|
+
.description(`Get a provider by its unique ID. `)
|
|
2823
|
+
.requiredOption(`--provider-id <provider-id>`, `Provider ID.`)
|
|
2824
|
+
.option(`--console`, `Get the resource console url`)
|
|
2825
|
+
.action(actionRunner(messagingGetProvider))
|
|
2826
|
+
|
|
2827
|
+
messaging
|
|
2828
|
+
.command(`delete-provider`)
|
|
2829
|
+
.description(`Delete a provider by its unique ID.`)
|
|
2830
|
+
.requiredOption(`--provider-id <provider-id>`, `Provider ID.`)
|
|
2831
|
+
.action(actionRunner(messagingDeleteProvider))
|
|
2832
|
+
|
|
2833
|
+
messaging
|
|
2834
|
+
.command(`list-provider-logs`)
|
|
2835
|
+
.description(`Get the provider activity logs listed by its unique ID.`)
|
|
2836
|
+
.requiredOption(`--provider-id <provider-id>`, `Provider ID.`)
|
|
2837
|
+
.option(`--queries [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`)
|
|
2838
|
+
.action(actionRunner(messagingListProviderLogs))
|
|
2839
|
+
|
|
2840
|
+
messaging
|
|
2841
|
+
.command(`list-subscriber-logs`)
|
|
2842
|
+
.description(`Get the subscriber activity logs listed by its unique ID.`)
|
|
2843
|
+
.requiredOption(`--subscriber-id <subscriber-id>`, `Subscriber ID.`)
|
|
2844
|
+
.option(`--queries [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`)
|
|
2845
|
+
.action(actionRunner(messagingListSubscriberLogs))
|
|
2846
|
+
|
|
2847
|
+
messaging
|
|
2848
|
+
.command(`list-topics`)
|
|
2849
|
+
.description(`Get a list of all topics from the current Appwrite project.`)
|
|
2850
|
+
.option(`--queries [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`)
|
|
2851
|
+
.option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
|
|
2852
|
+
.option(`--console`, `Get the resource console url`)
|
|
2853
|
+
.action(actionRunner(messagingListTopics))
|
|
2854
|
+
|
|
2855
|
+
messaging
|
|
2856
|
+
.command(`create-topic`)
|
|
2857
|
+
.description(`Create a new topic.`)
|
|
2858
|
+
.requiredOption(`--topic-id <topic-id>`, `Topic ID. Choose a custom Topic ID or a new Topic ID.`)
|
|
2859
|
+
.requiredOption(`--name <name>`, `Topic Name.`)
|
|
2860
|
+
.option(`--subscribe [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.`)
|
|
2861
|
+
.action(actionRunner(messagingCreateTopic))
|
|
2862
|
+
|
|
2863
|
+
messaging
|
|
2864
|
+
.command(`get-topic`)
|
|
2865
|
+
.description(`Get a topic by its unique ID. `)
|
|
2866
|
+
.requiredOption(`--topic-id <topic-id>`, `Topic ID.`)
|
|
2867
|
+
.option(`--console`, `Get the resource console url`)
|
|
2868
|
+
.action(actionRunner(messagingGetTopic))
|
|
2869
|
+
|
|
2870
|
+
messaging
|
|
2871
|
+
.command(`update-topic`)
|
|
2872
|
+
.description(`Update a topic by its unique ID. `)
|
|
2873
|
+
.requiredOption(`--topic-id <topic-id>`, `Topic ID.`)
|
|
2874
|
+
.option(`--name <name>`, `Topic Name.`)
|
|
2875
|
+
.option(`--subscribe [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.`)
|
|
2876
|
+
.action(actionRunner(messagingUpdateTopic))
|
|
2877
|
+
|
|
2878
|
+
messaging
|
|
2879
|
+
.command(`delete-topic`)
|
|
2880
|
+
.description(`Delete a topic by its unique ID.`)
|
|
2881
|
+
.requiredOption(`--topic-id <topic-id>`, `Topic ID.`)
|
|
2882
|
+
.action(actionRunner(messagingDeleteTopic))
|
|
2883
|
+
|
|
2884
|
+
messaging
|
|
2885
|
+
.command(`list-topic-logs`)
|
|
2886
|
+
.description(`Get the topic activity logs listed by its unique ID.`)
|
|
2887
|
+
.requiredOption(`--topic-id <topic-id>`, `Topic ID.`)
|
|
2888
|
+
.option(`--queries [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`)
|
|
2889
|
+
.action(actionRunner(messagingListTopicLogs))
|
|
2890
|
+
|
|
2891
|
+
messaging
|
|
2892
|
+
.command(`list-subscribers`)
|
|
2893
|
+
.description(`Get a list of all subscribers from the current Appwrite project.`)
|
|
2894
|
+
.requiredOption(`--topic-id <topic-id>`, `Topic ID. The topic ID subscribed to.`)
|
|
2895
|
+
.option(`--queries [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`)
|
|
2896
|
+
.option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
|
|
2897
|
+
.option(`--console`, `Get the resource console url`)
|
|
2898
|
+
.action(actionRunner(messagingListSubscribers))
|
|
2899
|
+
|
|
2900
|
+
messaging
|
|
2901
|
+
.command(`create-subscriber`)
|
|
2902
|
+
.description(`Create a new subscriber.`)
|
|
2903
|
+
.requiredOption(`--topic-id <topic-id>`, `Topic ID. The topic ID to subscribe to.`)
|
|
2904
|
+
.requiredOption(`--subscriber-id <subscriber-id>`, `Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.`)
|
|
2905
|
+
.requiredOption(`--target-id <target-id>`, `Target ID. The target ID to link to the specified Topic ID.`)
|
|
2906
|
+
.action(actionRunner(messagingCreateSubscriber))
|
|
2907
|
+
|
|
2908
|
+
messaging
|
|
2909
|
+
.command(`get-subscriber`)
|
|
2910
|
+
.description(`Get a subscriber by its unique ID. `)
|
|
2911
|
+
.requiredOption(`--topic-id <topic-id>`, `Topic ID. The topic ID subscribed to.`)
|
|
2912
|
+
.requiredOption(`--subscriber-id <subscriber-id>`, `Subscriber ID.`)
|
|
2913
|
+
.action(actionRunner(messagingGetSubscriber))
|
|
2914
|
+
|
|
2915
|
+
messaging
|
|
2916
|
+
.command(`delete-subscriber`)
|
|
2917
|
+
.description(`Delete a subscriber by its unique ID.`)
|
|
2918
|
+
.requiredOption(`--topic-id <topic-id>`, `Topic ID. The topic ID subscribed to.`)
|
|
2919
|
+
.requiredOption(`--subscriber-id <subscriber-id>`, `Subscriber ID.`)
|
|
2920
|
+
.action(actionRunner(messagingDeleteSubscriber))
|
|
2921
|
+
|
|
2922
|
+
module.exports = {
|
|
2923
|
+
messaging,
|
|
2924
|
+
messagingListMessages,
|
|
2925
|
+
messagingCreateEmail,
|
|
2926
|
+
messagingUpdateEmail,
|
|
2927
|
+
messagingCreatePush,
|
|
2928
|
+
messagingUpdatePush,
|
|
2929
|
+
messagingCreateSms,
|
|
2930
|
+
messagingUpdateSms,
|
|
2931
|
+
messagingGetMessage,
|
|
2932
|
+
messagingDelete,
|
|
2933
|
+
messagingListMessageLogs,
|
|
2934
|
+
messagingListTargets,
|
|
2935
|
+
messagingListProviders,
|
|
2936
|
+
messagingCreateApnsProvider,
|
|
2937
|
+
messagingUpdateApnsProvider,
|
|
2938
|
+
messagingCreateFcmProvider,
|
|
2939
|
+
messagingUpdateFcmProvider,
|
|
2940
|
+
messagingCreateMailgunProvider,
|
|
2941
|
+
messagingUpdateMailgunProvider,
|
|
2942
|
+
messagingCreateMsg91Provider,
|
|
2943
|
+
messagingUpdateMsg91Provider,
|
|
2944
|
+
messagingCreateSendgridProvider,
|
|
2945
|
+
messagingUpdateSendgridProvider,
|
|
2946
|
+
messagingCreateSmtpProvider,
|
|
2947
|
+
messagingUpdateSmtpProvider,
|
|
2948
|
+
messagingCreateTelesignProvider,
|
|
2949
|
+
messagingUpdateTelesignProvider,
|
|
2950
|
+
messagingCreateTextmagicProvider,
|
|
2951
|
+
messagingUpdateTextmagicProvider,
|
|
2952
|
+
messagingCreateTwilioProvider,
|
|
2953
|
+
messagingUpdateTwilioProvider,
|
|
2954
|
+
messagingCreateVonageProvider,
|
|
2955
|
+
messagingUpdateVonageProvider,
|
|
2956
|
+
messagingGetProvider,
|
|
2957
|
+
messagingDeleteProvider,
|
|
2958
|
+
messagingListProviderLogs,
|
|
2959
|
+
messagingListSubscriberLogs,
|
|
2960
|
+
messagingListTopics,
|
|
2961
|
+
messagingCreateTopic,
|
|
2962
|
+
messagingGetTopic,
|
|
2963
|
+
messagingUpdateTopic,
|
|
2964
|
+
messagingDeleteTopic,
|
|
2965
|
+
messagingListTopicLogs,
|
|
2966
|
+
messagingListSubscribers,
|
|
2967
|
+
messagingCreateSubscriber,
|
|
2968
|
+
messagingGetSubscriber,
|
|
2969
|
+
messagingDeleteSubscriber
|
|
2970
|
+
};
|