@appwrite.io/console 0.6.1 → 0.6.4
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/autoclose.yml +11 -0
- package/.github/workflows/publish.yml +40 -16
- package/.travis.yml +2 -2
- package/README.md +2 -2
- package/dist/cjs/sdk.js +315 -29
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +314 -28
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +317 -28
- package/docs/examples/account/create-anonymous-session.md +1 -1
- package/docs/examples/account/create-email-password-session.md +1 -1
- package/docs/examples/account/create-email-token.md +1 -1
- package/docs/examples/account/create-j-w-t.md +1 -1
- package/docs/examples/account/create-magic-u-r-l-token.md +1 -1
- package/docs/examples/account/create-mfa-authenticator.md +1 -1
- package/docs/examples/account/create-mfa-challenge.md +1 -1
- package/docs/examples/account/create-mfa-recovery-codes.md +1 -1
- package/docs/examples/account/create-o-auth2session.md +1 -1
- package/docs/examples/account/create-o-auth2token.md +1 -1
- package/docs/examples/account/create-phone-token.md +1 -1
- package/docs/examples/account/create-phone-verification.md +1 -1
- package/docs/examples/account/create-push-target.md +1 -1
- package/docs/examples/account/create-recovery.md +1 -1
- package/docs/examples/account/create-session.md +1 -1
- package/docs/examples/account/create-verification.md +1 -1
- package/docs/examples/account/create.md +1 -1
- package/docs/examples/account/delete-identity.md +1 -1
- package/docs/examples/account/delete-mfa-authenticator.md +1 -1
- package/docs/examples/account/delete-push-target.md +1 -1
- package/docs/examples/account/delete-session.md +1 -1
- package/docs/examples/account/delete-sessions.md +1 -1
- package/docs/examples/account/delete.md +1 -1
- package/docs/examples/account/get-mfa-recovery-codes.md +1 -1
- package/docs/examples/account/get-prefs.md +1 -1
- package/docs/examples/account/get-session.md +1 -1
- package/docs/examples/account/get.md +1 -1
- package/docs/examples/account/list-identities.md +1 -1
- package/docs/examples/account/list-logs.md +1 -1
- package/docs/examples/account/list-mfa-factors.md +1 -1
- package/docs/examples/account/list-sessions.md +1 -1
- package/docs/examples/account/update-email.md +1 -1
- package/docs/examples/account/update-m-f-a.md +1 -1
- package/docs/examples/account/update-magic-u-r-l-session.md +1 -1
- package/docs/examples/account/update-mfa-authenticator.md +1 -1
- package/docs/examples/account/update-mfa-challenge.md +1 -1
- package/docs/examples/account/update-mfa-recovery-codes.md +1 -1
- package/docs/examples/account/update-name.md +1 -1
- package/docs/examples/account/update-password.md +1 -1
- package/docs/examples/account/update-phone-session.md +1 -1
- package/docs/examples/account/update-phone-verification.md +1 -1
- package/docs/examples/account/update-phone.md +1 -1
- package/docs/examples/account/update-prefs.md +1 -1
- package/docs/examples/account/update-push-target.md +1 -1
- package/docs/examples/account/update-recovery.md +1 -1
- package/docs/examples/account/update-session.md +1 -1
- package/docs/examples/account/update-status.md +1 -1
- package/docs/examples/account/update-verification.md +1 -1
- package/docs/examples/assistant/chat.md +1 -1
- package/docs/examples/avatars/get-browser.md +1 -1
- package/docs/examples/avatars/get-credit-card.md +1 -1
- package/docs/examples/avatars/get-favicon.md +1 -1
- package/docs/examples/avatars/get-flag.md +1 -1
- package/docs/examples/avatars/get-image.md +1 -1
- package/docs/examples/avatars/get-initials.md +1 -1
- package/docs/examples/avatars/get-q-r.md +1 -1
- package/docs/examples/console/variables.md +1 -1
- package/docs/examples/databases/create-boolean-attribute.md +1 -1
- package/docs/examples/databases/create-collection.md +1 -1
- package/docs/examples/databases/create-datetime-attribute.md +1 -1
- package/docs/examples/databases/create-document.md +1 -1
- package/docs/examples/databases/create-email-attribute.md +1 -1
- package/docs/examples/databases/create-enum-attribute.md +1 -1
- package/docs/examples/databases/create-float-attribute.md +1 -1
- package/docs/examples/databases/create-index.md +1 -1
- package/docs/examples/databases/create-integer-attribute.md +1 -1
- package/docs/examples/databases/create-ip-attribute.md +1 -1
- package/docs/examples/databases/create-relationship-attribute.md +1 -1
- package/docs/examples/databases/create-string-attribute.md +1 -1
- package/docs/examples/databases/create-url-attribute.md +1 -1
- package/docs/examples/databases/create.md +1 -1
- package/docs/examples/databases/delete-attribute.md +1 -1
- package/docs/examples/databases/delete-collection.md +1 -1
- package/docs/examples/databases/delete-document.md +1 -1
- package/docs/examples/databases/delete-index.md +1 -1
- package/docs/examples/databases/delete.md +1 -1
- package/docs/examples/databases/get-attribute.md +1 -1
- package/docs/examples/databases/get-collection-usage.md +1 -1
- package/docs/examples/databases/get-collection.md +1 -1
- package/docs/examples/databases/get-database-usage.md +1 -1
- package/docs/examples/databases/get-document.md +1 -1
- package/docs/examples/databases/get-index.md +1 -1
- package/docs/examples/databases/get-usage.md +1 -1
- package/docs/examples/databases/get.md +1 -1
- package/docs/examples/databases/list-attributes.md +1 -1
- package/docs/examples/databases/list-collection-logs.md +1 -1
- package/docs/examples/databases/list-collections.md +1 -1
- package/docs/examples/databases/list-document-logs.md +1 -1
- package/docs/examples/databases/list-documents.md +1 -1
- package/docs/examples/databases/list-indexes.md +1 -1
- package/docs/examples/databases/list-logs.md +1 -1
- package/docs/examples/databases/list.md +1 -1
- package/docs/examples/databases/update-boolean-attribute.md +1 -1
- package/docs/examples/databases/update-collection.md +1 -1
- package/docs/examples/databases/update-datetime-attribute.md +1 -1
- package/docs/examples/databases/update-document.md +1 -1
- package/docs/examples/databases/update-email-attribute.md +1 -1
- package/docs/examples/databases/update-enum-attribute.md +1 -1
- package/docs/examples/databases/update-float-attribute.md +1 -1
- package/docs/examples/databases/update-integer-attribute.md +1 -1
- package/docs/examples/databases/update-ip-attribute.md +1 -1
- package/docs/examples/databases/update-relationship-attribute.md +1 -1
- package/docs/examples/databases/update-string-attribute.md +1 -1
- package/docs/examples/databases/update-url-attribute.md +1 -1
- package/docs/examples/databases/update.md +1 -1
- package/docs/examples/functions/create-build.md +1 -1
- package/docs/examples/functions/create-deployment.md +1 -1
- package/docs/examples/functions/create-execution.md +1 -1
- package/docs/examples/functions/create-variable.md +1 -1
- package/docs/examples/functions/create.md +3 -2
- package/docs/examples/functions/delete-deployment.md +1 -1
- package/docs/examples/functions/delete-variable.md +1 -1
- package/docs/examples/functions/delete.md +1 -1
- package/docs/examples/functions/download-deployment.md +1 -1
- package/docs/examples/functions/get-deployment.md +1 -1
- package/docs/examples/functions/get-execution.md +1 -1
- package/docs/examples/functions/get-function-usage.md +1 -1
- package/docs/examples/functions/get-specifications.md +11 -0
- package/docs/examples/functions/get-usage.md +1 -1
- package/docs/examples/functions/get-variable.md +1 -1
- package/docs/examples/functions/get.md +1 -1
- package/docs/examples/functions/list-deployments.md +1 -1
- package/docs/examples/functions/list-executions.md +1 -1
- package/docs/examples/functions/list-runtimes.md +1 -1
- package/docs/examples/functions/list-variables.md +1 -1
- package/docs/examples/functions/list.md +1 -1
- package/docs/examples/functions/update-deployment.md +1 -1
- package/docs/examples/functions/update-variable.md +1 -1
- package/docs/examples/functions/update.md +3 -2
- package/docs/examples/graphql/mutation.md +1 -1
- package/docs/examples/graphql/query.md +1 -1
- package/docs/examples/health/get-antivirus.md +1 -1
- package/docs/examples/health/get-cache.md +1 -1
- package/docs/examples/health/get-certificate.md +1 -1
- package/docs/examples/health/get-d-b.md +1 -1
- package/docs/examples/health/get-failed-jobs.md +1 -1
- package/docs/examples/health/get-pub-sub.md +1 -1
- package/docs/examples/health/get-queue-builds.md +1 -1
- package/docs/examples/health/get-queue-certificates.md +1 -1
- package/docs/examples/health/get-queue-databases.md +1 -1
- package/docs/examples/health/get-queue-deletes.md +1 -1
- package/docs/examples/health/get-queue-functions.md +1 -1
- package/docs/examples/health/get-queue-logs.md +1 -1
- package/docs/examples/health/get-queue-mails.md +1 -1
- package/docs/examples/health/get-queue-messaging.md +1 -1
- package/docs/examples/health/get-queue-migrations.md +1 -1
- package/docs/examples/health/get-queue-usage-dump.md +1 -1
- package/docs/examples/health/get-queue-usage.md +1 -1
- package/docs/examples/health/get-queue-webhooks.md +1 -1
- package/docs/examples/health/get-queue.md +1 -1
- package/docs/examples/health/get-storage-local.md +1 -1
- package/docs/examples/health/get-storage.md +1 -1
- package/docs/examples/health/get-time.md +1 -1
- package/docs/examples/health/get.md +1 -1
- package/docs/examples/locale/get.md +1 -1
- package/docs/examples/locale/list-codes.md +1 -1
- package/docs/examples/locale/list-continents.md +1 -1
- package/docs/examples/locale/list-countries-e-u.md +1 -1
- package/docs/examples/locale/list-countries-phones.md +1 -1
- package/docs/examples/locale/list-countries.md +1 -1
- package/docs/examples/locale/list-currencies.md +1 -1
- package/docs/examples/locale/list-languages.md +1 -1
- package/docs/examples/messaging/create-apns-provider.md +1 -1
- package/docs/examples/messaging/create-email.md +1 -1
- package/docs/examples/messaging/create-fcm-provider.md +1 -1
- package/docs/examples/messaging/create-mailgun-provider.md +1 -1
- package/docs/examples/messaging/create-msg91provider.md +1 -1
- package/docs/examples/messaging/create-push.md +1 -1
- package/docs/examples/messaging/create-sendgrid-provider.md +1 -1
- package/docs/examples/messaging/create-sms.md +1 -1
- package/docs/examples/messaging/create-smtp-provider.md +1 -1
- package/docs/examples/messaging/create-subscriber.md +1 -1
- package/docs/examples/messaging/create-telesign-provider.md +1 -1
- package/docs/examples/messaging/create-textmagic-provider.md +1 -1
- package/docs/examples/messaging/create-topic.md +1 -1
- package/docs/examples/messaging/create-twilio-provider.md +1 -1
- package/docs/examples/messaging/create-vonage-provider.md +1 -1
- package/docs/examples/messaging/delete-provider.md +1 -1
- package/docs/examples/messaging/delete-subscriber.md +1 -1
- package/docs/examples/messaging/delete-topic.md +1 -1
- package/docs/examples/messaging/delete.md +1 -1
- package/docs/examples/messaging/get-message.md +1 -1
- package/docs/examples/messaging/get-provider.md +1 -1
- package/docs/examples/messaging/get-subscriber.md +1 -1
- package/docs/examples/messaging/get-topic.md +1 -1
- package/docs/examples/messaging/list-message-logs.md +1 -1
- package/docs/examples/messaging/list-messages.md +1 -1
- package/docs/examples/messaging/list-provider-logs.md +1 -1
- package/docs/examples/messaging/list-providers.md +1 -1
- package/docs/examples/messaging/list-subscriber-logs.md +1 -1
- package/docs/examples/messaging/list-subscribers.md +1 -1
- package/docs/examples/messaging/list-targets.md +1 -1
- package/docs/examples/messaging/list-topic-logs.md +1 -1
- package/docs/examples/messaging/list-topics.md +1 -1
- package/docs/examples/messaging/update-apns-provider.md +1 -1
- package/docs/examples/messaging/update-email.md +3 -2
- package/docs/examples/messaging/update-fcm-provider.md +1 -1
- package/docs/examples/messaging/update-mailgun-provider.md +1 -1
- package/docs/examples/messaging/update-msg91provider.md +1 -1
- package/docs/examples/messaging/update-push.md +1 -1
- package/docs/examples/messaging/update-sendgrid-provider.md +1 -1
- package/docs/examples/messaging/update-sms.md +1 -1
- package/docs/examples/messaging/update-smtp-provider.md +1 -1
- package/docs/examples/messaging/update-telesign-provider.md +1 -1
- package/docs/examples/messaging/update-textmagic-provider.md +1 -1
- package/docs/examples/messaging/update-topic.md +1 -1
- package/docs/examples/messaging/update-twilio-provider.md +1 -1
- package/docs/examples/messaging/update-vonage-provider.md +1 -1
- package/docs/examples/migrations/create-appwrite-migration.md +1 -1
- package/docs/examples/migrations/create-firebase-migration.md +1 -1
- package/docs/examples/migrations/create-firebase-o-auth-migration.md +1 -1
- package/docs/examples/migrations/create-n-host-migration.md +1 -1
- package/docs/examples/migrations/create-supabase-migration.md +1 -1
- package/docs/examples/migrations/delete-firebase-auth.md +1 -1
- package/docs/examples/migrations/delete.md +1 -1
- package/docs/examples/migrations/get-appwrite-report.md +1 -1
- package/docs/examples/migrations/get-firebase-report-o-auth.md +1 -1
- package/docs/examples/migrations/get-firebase-report.md +1 -1
- package/docs/examples/migrations/get-n-host-report.md +1 -1
- package/docs/examples/migrations/get-supabase-report.md +1 -1
- package/docs/examples/migrations/get.md +1 -1
- package/docs/examples/migrations/list-firebase-projects.md +1 -1
- package/docs/examples/migrations/list.md +1 -1
- package/docs/examples/migrations/retry.md +1 -1
- package/docs/examples/project/create-variable.md +1 -1
- package/docs/examples/project/delete-variable.md +1 -1
- package/docs/examples/project/get-usage.md +1 -1
- package/docs/examples/project/get-variable.md +1 -1
- package/docs/examples/project/list-variables.md +1 -1
- package/docs/examples/project/update-variable.md +1 -1
- package/docs/examples/projects/create-key.md +1 -1
- package/docs/examples/projects/create-platform.md +1 -1
- package/docs/examples/projects/create-smtp-test.md +1 -1
- package/docs/examples/projects/create-webhook.md +1 -1
- package/docs/examples/projects/create.md +1 -1
- package/docs/examples/projects/delete-email-template.md +1 -1
- package/docs/examples/projects/delete-key.md +1 -1
- package/docs/examples/projects/delete-platform.md +1 -1
- package/docs/examples/projects/delete-sms-template.md +1 -1
- package/docs/examples/projects/delete-webhook.md +1 -1
- package/docs/examples/projects/delete.md +1 -1
- package/docs/examples/projects/get-email-template.md +1 -1
- package/docs/examples/projects/get-key.md +1 -1
- package/docs/examples/projects/get-platform.md +1 -1
- package/docs/examples/projects/get-sms-template.md +1 -1
- package/docs/examples/projects/get-webhook.md +1 -1
- package/docs/examples/projects/get.md +1 -1
- package/docs/examples/projects/list-keys.md +1 -1
- package/docs/examples/projects/list-platforms.md +1 -1
- package/docs/examples/projects/list-webhooks.md +1 -1
- package/docs/examples/projects/list.md +1 -1
- package/docs/examples/projects/update-api-status-all.md +1 -1
- package/docs/examples/projects/update-api-status.md +1 -1
- package/docs/examples/projects/update-auth-duration.md +1 -1
- package/docs/examples/projects/update-auth-limit.md +1 -1
- package/docs/examples/projects/update-auth-password-dictionary.md +1 -1
- package/docs/examples/projects/update-auth-password-history.md +1 -1
- package/docs/examples/projects/update-auth-sessions-limit.md +1 -1
- package/docs/examples/projects/update-auth-status.md +1 -1
- package/docs/examples/projects/update-email-template.md +1 -1
- package/docs/examples/projects/update-key.md +1 -1
- package/docs/examples/projects/update-o-auth2.md +1 -1
- package/docs/examples/projects/update-personal-data-check.md +1 -1
- package/docs/examples/projects/update-platform.md +1 -1
- package/docs/examples/projects/update-service-status-all.md +1 -1
- package/docs/examples/projects/update-service-status.md +1 -1
- package/docs/examples/projects/update-sms-template.md +1 -1
- package/docs/examples/projects/update-smtp.md +1 -1
- package/docs/examples/projects/update-team.md +1 -1
- package/docs/examples/projects/update-webhook-signature.md +1 -1
- package/docs/examples/projects/update-webhook.md +1 -1
- package/docs/examples/projects/update.md +1 -1
- package/docs/examples/proxy/create-rule.md +1 -1
- package/docs/examples/proxy/delete-rule.md +1 -1
- package/docs/examples/proxy/get-rule.md +1 -1
- package/docs/examples/proxy/list-rules.md +1 -1
- package/docs/examples/proxy/update-rule-verification.md +1 -1
- package/docs/examples/storage/create-bucket.md +1 -1
- package/docs/examples/storage/create-file.md +1 -1
- package/docs/examples/storage/delete-bucket.md +1 -1
- package/docs/examples/storage/delete-file.md +1 -1
- package/docs/examples/storage/get-bucket-usage.md +1 -1
- package/docs/examples/storage/get-bucket.md +1 -1
- package/docs/examples/storage/get-file-download.md +1 -1
- package/docs/examples/storage/get-file-preview.md +1 -1
- package/docs/examples/storage/get-file-view.md +1 -1
- package/docs/examples/storage/get-file.md +1 -1
- package/docs/examples/storage/get-usage.md +1 -1
- package/docs/examples/storage/list-buckets.md +1 -1
- package/docs/examples/storage/list-files.md +1 -1
- package/docs/examples/storage/update-bucket.md +1 -1
- package/docs/examples/storage/update-file.md +1 -1
- package/docs/examples/teams/create-membership.md +1 -1
- package/docs/examples/teams/create.md +1 -1
- package/docs/examples/teams/delete-membership.md +1 -1
- package/docs/examples/teams/delete.md +1 -1
- package/docs/examples/teams/get-membership.md +1 -1
- package/docs/examples/teams/get-prefs.md +1 -1
- package/docs/examples/teams/get.md +1 -1
- package/docs/examples/teams/list-logs.md +1 -1
- package/docs/examples/teams/list-memberships.md +1 -1
- package/docs/examples/teams/list.md +1 -1
- package/docs/examples/teams/update-membership-status.md +1 -1
- package/docs/examples/teams/update-membership.md +1 -1
- package/docs/examples/teams/update-name.md +1 -1
- package/docs/examples/teams/update-prefs.md +1 -1
- package/docs/examples/users/create-argon2user.md +1 -1
- package/docs/examples/users/create-bcrypt-user.md +1 -1
- package/docs/examples/users/create-m-d5user.md +1 -1
- package/docs/examples/users/create-mfa-recovery-codes.md +1 -1
- package/docs/examples/users/create-p-h-pass-user.md +1 -1
- package/docs/examples/users/create-s-h-a-user.md +1 -1
- package/docs/examples/users/create-scrypt-modified-user.md +1 -1
- package/docs/examples/users/create-scrypt-user.md +1 -1
- package/docs/examples/users/create-session.md +1 -1
- package/docs/examples/users/create-target.md +1 -1
- package/docs/examples/users/create-token.md +1 -1
- package/docs/examples/users/create.md +1 -1
- package/docs/examples/users/delete-identity.md +1 -1
- package/docs/examples/users/delete-mfa-authenticator.md +1 -1
- package/docs/examples/users/delete-session.md +1 -1
- package/docs/examples/users/delete-sessions.md +1 -1
- package/docs/examples/users/delete-target.md +1 -1
- package/docs/examples/users/delete.md +1 -1
- package/docs/examples/users/get-mfa-recovery-codes.md +1 -1
- package/docs/examples/users/get-prefs.md +1 -1
- package/docs/examples/users/get-target.md +1 -1
- package/docs/examples/users/get-usage.md +1 -1
- package/docs/examples/users/get.md +1 -1
- package/docs/examples/users/list-identities.md +1 -1
- package/docs/examples/users/list-logs.md +1 -1
- package/docs/examples/users/list-memberships.md +1 -1
- package/docs/examples/users/list-mfa-factors.md +1 -1
- package/docs/examples/users/list-sessions.md +1 -1
- package/docs/examples/users/list-targets.md +1 -1
- package/docs/examples/users/list.md +1 -1
- package/docs/examples/users/update-email-verification.md +1 -1
- package/docs/examples/users/update-email.md +1 -1
- package/docs/examples/users/update-labels.md +1 -1
- package/docs/examples/users/update-mfa-recovery-codes.md +1 -1
- package/docs/examples/users/update-mfa.md +1 -1
- package/docs/examples/users/update-name.md +1 -1
- package/docs/examples/users/update-password.md +1 -1
- package/docs/examples/users/update-phone-verification.md +1 -1
- package/docs/examples/users/update-phone.md +1 -1
- package/docs/examples/users/update-prefs.md +1 -1
- package/docs/examples/users/update-status.md +1 -1
- package/docs/examples/users/update-target.md +1 -1
- package/docs/examples/vcs/create-repository-detection.md +1 -1
- package/docs/examples/vcs/create-repository.md +1 -1
- package/docs/examples/vcs/delete-installation.md +1 -1
- package/docs/examples/vcs/get-installation.md +1 -1
- package/docs/examples/vcs/get-repository.md +1 -1
- package/docs/examples/vcs/list-installations.md +1 -1
- package/docs/examples/vcs/list-repositories.md +1 -1
- package/docs/examples/vcs/list-repository-branches.md +1 -1
- package/docs/examples/vcs/update-external-deployments.md +1 -1
- package/package.json +1 -5
- package/rollup.config.js +1 -5
- package/src/client.ts +230 -5
- package/src/enums/credit-card.ts +1 -1
- package/src/enums/flag.ts +1 -0
- package/src/enums/name.ts +1 -2
- package/src/enums/runtime.ts +1 -0
- package/src/id.ts +21 -2
- package/src/index.ts +7 -0
- package/src/models.ts +108 -3
- package/src/permission.ts +41 -6
- package/src/query.ts +161 -1
- package/src/service.ts +3 -0
- package/src/services/account.ts +6 -6
- package/src/services/functions.ts +33 -4
- package/src/services/messaging.ts +6 -1
- package/src/services/users.ts +4 -4
- package/types/client.d.ts +82 -1
- package/types/enums/credit-card.d.ts +1 -1
- package/types/enums/flag.d.ts +1 -0
- package/types/enums/name.d.ts +2 -3
- package/types/enums/runtime.d.ts +1 -0
- package/types/id.d.ts +15 -0
- package/types/index.d.ts +7 -0
- package/types/models.d.ts +108 -3
- package/types/permission.d.ts +36 -0
- package/types/query.d.ts +160 -0
- package/types/service.d.ts +3 -0
- package/types/services/account.d.ts +6 -6
- package/types/services/functions.d.ts +16 -4
- package/types/services/messaging.d.ts +2 -1
- package/types/services/users.d.ts +4 -4
package/dist/cjs/sdk.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
require('isomorphic-form-data');
|
|
4
|
-
var crossFetch = require('cross-fetch');
|
|
5
|
-
|
|
6
3
|
/******************************************************************************
|
|
7
4
|
Copyright (c) Microsoft Corporation.
|
|
8
5
|
|
|
@@ -52,9 +49,22 @@ class Service {
|
|
|
52
49
|
return output;
|
|
53
50
|
}
|
|
54
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* The size for chunked uploads in bytes.
|
|
54
|
+
*/
|
|
55
55
|
Service.CHUNK_SIZE = 5 * 1024 * 1024; // 5MB
|
|
56
56
|
|
|
57
|
+
/**
|
|
58
|
+
* Helper class to generate query strings.
|
|
59
|
+
*/
|
|
57
60
|
class Query {
|
|
61
|
+
/**
|
|
62
|
+
* Constructor for Query class.
|
|
63
|
+
*
|
|
64
|
+
* @param {string} method
|
|
65
|
+
* @param {AttributesTypes} attribute
|
|
66
|
+
* @param {QueryTypes} values
|
|
67
|
+
*/
|
|
58
68
|
constructor(method, attribute, values) {
|
|
59
69
|
this.method = method;
|
|
60
70
|
this.attribute = attribute;
|
|
@@ -67,6 +77,11 @@ class Query {
|
|
|
67
77
|
}
|
|
68
78
|
}
|
|
69
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Convert the query object to a JSON string.
|
|
82
|
+
*
|
|
83
|
+
* @returns {string}
|
|
84
|
+
*/
|
|
70
85
|
toString() {
|
|
71
86
|
return JSON.stringify({
|
|
72
87
|
method: this.method,
|
|
@@ -75,30 +90,186 @@ class Query {
|
|
|
75
90
|
});
|
|
76
91
|
}
|
|
77
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Filter resources where attribute is equal to value.
|
|
95
|
+
*
|
|
96
|
+
* @param {string} attribute
|
|
97
|
+
* @param {QueryTypes} value
|
|
98
|
+
* @returns {string}
|
|
99
|
+
*/
|
|
78
100
|
Query.equal = (attribute, value) => new Query("equal", attribute, value).toString();
|
|
101
|
+
/**
|
|
102
|
+
* Filter resources where attribute is not equal to value.
|
|
103
|
+
*
|
|
104
|
+
* @param {string} attribute
|
|
105
|
+
* @param {QueryTypes} value
|
|
106
|
+
* @returns {string}
|
|
107
|
+
*/
|
|
79
108
|
Query.notEqual = (attribute, value) => new Query("notEqual", attribute, value).toString();
|
|
109
|
+
/**
|
|
110
|
+
* Filter resources where attribute is less than value.
|
|
111
|
+
*
|
|
112
|
+
* @param {string} attribute
|
|
113
|
+
* @param {QueryTypes} value
|
|
114
|
+
* @returns {string}
|
|
115
|
+
*/
|
|
80
116
|
Query.lessThan = (attribute, value) => new Query("lessThan", attribute, value).toString();
|
|
117
|
+
/**
|
|
118
|
+
* Filter resources where attribute is less than or equal to value.
|
|
119
|
+
*
|
|
120
|
+
* @param {string} attribute
|
|
121
|
+
* @param {QueryTypes} value
|
|
122
|
+
* @returns {string}
|
|
123
|
+
*/
|
|
81
124
|
Query.lessThanEqual = (attribute, value) => new Query("lessThanEqual", attribute, value).toString();
|
|
125
|
+
/**
|
|
126
|
+
* Filter resources where attribute is greater than value.
|
|
127
|
+
*
|
|
128
|
+
* @param {string} attribute
|
|
129
|
+
* @param {QueryTypes} value
|
|
130
|
+
* @returns {string}
|
|
131
|
+
*/
|
|
82
132
|
Query.greaterThan = (attribute, value) => new Query("greaterThan", attribute, value).toString();
|
|
133
|
+
/**
|
|
134
|
+
* Filter resources where attribute is greater than or equal to value.
|
|
135
|
+
*
|
|
136
|
+
* @param {string} attribute
|
|
137
|
+
* @param {QueryTypes} value
|
|
138
|
+
* @returns {string}
|
|
139
|
+
*/
|
|
83
140
|
Query.greaterThanEqual = (attribute, value) => new Query("greaterThanEqual", attribute, value).toString();
|
|
141
|
+
/**
|
|
142
|
+
* Filter resources where attribute is null.
|
|
143
|
+
*
|
|
144
|
+
* @param {string} attribute
|
|
145
|
+
* @returns {string}
|
|
146
|
+
*/
|
|
84
147
|
Query.isNull = (attribute) => new Query("isNull", attribute).toString();
|
|
148
|
+
/**
|
|
149
|
+
* Filter resources where attribute is not null.
|
|
150
|
+
*
|
|
151
|
+
* @param {string} attribute
|
|
152
|
+
* @returns {string}
|
|
153
|
+
*/
|
|
85
154
|
Query.isNotNull = (attribute) => new Query("isNotNull", attribute).toString();
|
|
155
|
+
/**
|
|
156
|
+
* Filter resources where attribute is between start and end (inclusive).
|
|
157
|
+
*
|
|
158
|
+
* @param {string} attribute
|
|
159
|
+
* @param {string | number} start
|
|
160
|
+
* @param {string | number} end
|
|
161
|
+
* @returns {string}
|
|
162
|
+
*/
|
|
86
163
|
Query.between = (attribute, start, end) => new Query("between", attribute, [start, end]).toString();
|
|
164
|
+
/**
|
|
165
|
+
* Filter resources where attribute starts with value.
|
|
166
|
+
*
|
|
167
|
+
* @param {string} attribute
|
|
168
|
+
* @param {string} value
|
|
169
|
+
* @returns {string}
|
|
170
|
+
*/
|
|
87
171
|
Query.startsWith = (attribute, value) => new Query("startsWith", attribute, value).toString();
|
|
172
|
+
/**
|
|
173
|
+
* Filter resources where attribute ends with value.
|
|
174
|
+
*
|
|
175
|
+
* @param {string} attribute
|
|
176
|
+
* @param {string} value
|
|
177
|
+
* @returns {string}
|
|
178
|
+
*/
|
|
88
179
|
Query.endsWith = (attribute, value) => new Query("endsWith", attribute, value).toString();
|
|
180
|
+
/**
|
|
181
|
+
* Specify which attributes should be returned by the API call.
|
|
182
|
+
*
|
|
183
|
+
* @param {string[]} attributes
|
|
184
|
+
* @returns {string}
|
|
185
|
+
*/
|
|
89
186
|
Query.select = (attributes) => new Query("select", undefined, attributes).toString();
|
|
187
|
+
/**
|
|
188
|
+
* Filter resources by searching attribute for value.
|
|
189
|
+
* A fulltext index on attribute is required for this query to work.
|
|
190
|
+
*
|
|
191
|
+
* @param {string} attribute
|
|
192
|
+
* @param {string} value
|
|
193
|
+
* @returns {string}
|
|
194
|
+
*/
|
|
90
195
|
Query.search = (attribute, value) => new Query("search", attribute, value).toString();
|
|
196
|
+
/**
|
|
197
|
+
* Sort results by attribute descending.
|
|
198
|
+
*
|
|
199
|
+
* @param {string} attribute
|
|
200
|
+
* @returns {string}
|
|
201
|
+
*/
|
|
91
202
|
Query.orderDesc = (attribute) => new Query("orderDesc", attribute).toString();
|
|
203
|
+
/**
|
|
204
|
+
* Sort results by attribute ascending.
|
|
205
|
+
*
|
|
206
|
+
* @param {string} attribute
|
|
207
|
+
* @returns {string}
|
|
208
|
+
*/
|
|
92
209
|
Query.orderAsc = (attribute) => new Query("orderAsc", attribute).toString();
|
|
210
|
+
/**
|
|
211
|
+
* Return results after documentId.
|
|
212
|
+
*
|
|
213
|
+
* @param {string} documentId
|
|
214
|
+
* @returns {string}
|
|
215
|
+
*/
|
|
93
216
|
Query.cursorAfter = (documentId) => new Query("cursorAfter", undefined, documentId).toString();
|
|
217
|
+
/**
|
|
218
|
+
* Return results before documentId.
|
|
219
|
+
*
|
|
220
|
+
* @param {string} documentId
|
|
221
|
+
* @returns {string}
|
|
222
|
+
*/
|
|
94
223
|
Query.cursorBefore = (documentId) => new Query("cursorBefore", undefined, documentId).toString();
|
|
224
|
+
/**
|
|
225
|
+
* Return only limit results.
|
|
226
|
+
*
|
|
227
|
+
* @param {number} limit
|
|
228
|
+
* @returns {string}
|
|
229
|
+
*/
|
|
95
230
|
Query.limit = (limit) => new Query("limit", undefined, limit).toString();
|
|
231
|
+
/**
|
|
232
|
+
* Filter resources by skipping the first offset results.
|
|
233
|
+
*
|
|
234
|
+
* @param {number} offset
|
|
235
|
+
* @returns {string}
|
|
236
|
+
*/
|
|
96
237
|
Query.offset = (offset) => new Query("offset", undefined, offset).toString();
|
|
238
|
+
/**
|
|
239
|
+
* Filter resources where attribute contains the specified value.
|
|
240
|
+
*
|
|
241
|
+
* @param {string} attribute
|
|
242
|
+
* @param {string | string[]} value
|
|
243
|
+
* @returns {string}
|
|
244
|
+
*/
|
|
97
245
|
Query.contains = (attribute, value) => new Query("contains", attribute, value).toString();
|
|
246
|
+
/**
|
|
247
|
+
* Combine multiple queries using logical OR operator.
|
|
248
|
+
*
|
|
249
|
+
* @param {string[]} queries
|
|
250
|
+
* @returns {string}
|
|
251
|
+
*/
|
|
98
252
|
Query.or = (queries) => new Query("or", undefined, queries.map((query) => JSON.parse(query))).toString();
|
|
253
|
+
/**
|
|
254
|
+
* Combine multiple queries using logical AND operator.
|
|
255
|
+
*
|
|
256
|
+
* @param {string[]} queries
|
|
257
|
+
* @returns {string}
|
|
258
|
+
*/
|
|
99
259
|
Query.and = (queries) => new Query("and", undefined, queries.map((query) => JSON.parse(query))).toString();
|
|
100
260
|
|
|
261
|
+
/**
|
|
262
|
+
* Exception thrown by the package
|
|
263
|
+
*/
|
|
101
264
|
class AppwriteException extends Error {
|
|
265
|
+
/**
|
|
266
|
+
* Initializes a Appwrite Exception.
|
|
267
|
+
*
|
|
268
|
+
* @param {string} message - The error message.
|
|
269
|
+
* @param {number} code - The error code. Default is 0.
|
|
270
|
+
* @param {string} type - The error type. Default is an empty string.
|
|
271
|
+
* @param {string} response - The response string. Default is an empty string.
|
|
272
|
+
*/
|
|
102
273
|
constructor(message, code = 0, type = '', response = '') {
|
|
103
274
|
super(message);
|
|
104
275
|
this.name = 'AppwriteException';
|
|
@@ -108,8 +279,14 @@ class AppwriteException extends Error {
|
|
|
108
279
|
this.response = response;
|
|
109
280
|
}
|
|
110
281
|
}
|
|
282
|
+
/**
|
|
283
|
+
* Client that handles requests to Appwrite
|
|
284
|
+
*/
|
|
111
285
|
class Client {
|
|
112
286
|
constructor() {
|
|
287
|
+
/**
|
|
288
|
+
* Holds configuration such as project.
|
|
289
|
+
*/
|
|
113
290
|
this.config = {
|
|
114
291
|
endpoint: 'https://cloud.appwrite.io/v1',
|
|
115
292
|
endpointRealtime: '',
|
|
@@ -119,11 +296,14 @@ class Client {
|
|
|
119
296
|
locale: '',
|
|
120
297
|
mode: '',
|
|
121
298
|
};
|
|
299
|
+
/**
|
|
300
|
+
* Custom headers for API requests.
|
|
301
|
+
*/
|
|
122
302
|
this.headers = {
|
|
123
303
|
'x-sdk-name': 'Console',
|
|
124
304
|
'x-sdk-platform': 'console',
|
|
125
305
|
'x-sdk-language': 'web',
|
|
126
|
-
'x-sdk-version': '0.6.
|
|
306
|
+
'x-sdk-version': '0.6.4',
|
|
127
307
|
'X-Appwrite-Response-Format': '1.5.0',
|
|
128
308
|
};
|
|
129
309
|
this.realtime = {
|
|
@@ -155,9 +335,12 @@ class Client {
|
|
|
155
335
|
}
|
|
156
336
|
},
|
|
157
337
|
createSocket: () => {
|
|
158
|
-
var _a, _b;
|
|
159
|
-
if (this.realtime.channels.size < 1)
|
|
338
|
+
var _a, _b, _c;
|
|
339
|
+
if (this.realtime.channels.size < 1) {
|
|
340
|
+
this.realtime.reconnect = false;
|
|
341
|
+
(_a = this.realtime.socket) === null || _a === void 0 ? void 0 : _a.close();
|
|
160
342
|
return;
|
|
343
|
+
}
|
|
161
344
|
const channels = new URLSearchParams();
|
|
162
345
|
channels.set('project', this.config.project);
|
|
163
346
|
this.realtime.channels.forEach(channel => {
|
|
@@ -166,10 +349,10 @@ class Client {
|
|
|
166
349
|
const url = this.config.endpointRealtime + '/realtime?' + channels.toString();
|
|
167
350
|
if (url !== this.realtime.url || // Check if URL is present
|
|
168
351
|
!this.realtime.socket || // Check if WebSocket has not been created
|
|
169
|
-
((
|
|
352
|
+
((_b = this.realtime.socket) === null || _b === void 0 ? void 0 : _b.readyState) > WebSocket.OPEN // Check if WebSocket is CLOSING (3) or CLOSED (4)
|
|
170
353
|
) {
|
|
171
354
|
if (this.realtime.socket &&
|
|
172
|
-
((
|
|
355
|
+
((_c = this.realtime.socket) === null || _c === void 0 ? void 0 : _c.readyState) < WebSocket.CLOSING // Close WebSocket if it is CONNECTING (0) or OPEN (1)
|
|
173
356
|
) {
|
|
174
357
|
this.realtime.reconnect = false;
|
|
175
358
|
this.realtime.socket.close();
|
|
@@ -385,8 +568,21 @@ class Client {
|
|
|
385
568
|
this.realtime.connect();
|
|
386
569
|
};
|
|
387
570
|
}
|
|
571
|
+
/**
|
|
572
|
+
* Call API endpoint with the specified method, URL, headers, and parameters.
|
|
573
|
+
*
|
|
574
|
+
* @param {string} method - HTTP method (e.g., 'GET', 'POST', 'PUT', 'DELETE').
|
|
575
|
+
* @param {URL} url - The URL of the API endpoint.
|
|
576
|
+
* @param {Headers} headers - Custom headers for the API request.
|
|
577
|
+
* @param {Payload} params - Request parameters.
|
|
578
|
+
* @returns {Promise<any>} - A promise that resolves with the response data.
|
|
579
|
+
*
|
|
580
|
+
* @typedef {Object} Payload - Request payload data.
|
|
581
|
+
* @property {string} key - The key.
|
|
582
|
+
* @property {string} value - The value.
|
|
583
|
+
*/
|
|
388
584
|
call(method, url, headers = {}, params = {}) {
|
|
389
|
-
var _a
|
|
585
|
+
var _a;
|
|
390
586
|
return __awaiter(this, void 0, void 0, function* () {
|
|
391
587
|
method = method.toUpperCase();
|
|
392
588
|
headers = Object.assign({}, this.headers, headers);
|
|
@@ -396,7 +592,10 @@ class Client {
|
|
|
396
592
|
credentials: 'include'
|
|
397
593
|
};
|
|
398
594
|
if (typeof window !== 'undefined' && window.localStorage) {
|
|
399
|
-
|
|
595
|
+
const cookieFallback = window.localStorage.getItem('cookieFallback');
|
|
596
|
+
if (cookieFallback) {
|
|
597
|
+
headers['X-Fallback-Cookies'] = cookieFallback;
|
|
598
|
+
}
|
|
400
599
|
}
|
|
401
600
|
if (method === 'GET') {
|
|
402
601
|
for (const [key, value] of Object.entries(Service.flatten(params))) {
|
|
@@ -427,8 +626,12 @@ class Client {
|
|
|
427
626
|
}
|
|
428
627
|
try {
|
|
429
628
|
let data = null;
|
|
430
|
-
const response = yield
|
|
431
|
-
|
|
629
|
+
const response = yield fetch(url.toString(), options);
|
|
630
|
+
const warnings = response.headers.get('x-appwrite-warning');
|
|
631
|
+
if (warnings) {
|
|
632
|
+
warnings.split(';').forEach((warning) => console.warn('Warning: ' + warning));
|
|
633
|
+
}
|
|
634
|
+
if ((_a = response.headers.get('content-type')) === null || _a === void 0 ? void 0 : _a.includes('application/json')) {
|
|
432
635
|
data = yield response.json();
|
|
433
636
|
}
|
|
434
637
|
else {
|
|
@@ -699,11 +902,11 @@ class Account extends Service {
|
|
|
699
902
|
});
|
|
700
903
|
}
|
|
701
904
|
/**
|
|
702
|
-
*
|
|
905
|
+
* Create Authenticator
|
|
703
906
|
*
|
|
704
907
|
* Add an authenticator app to be used as an MFA factor. Verify the
|
|
705
908
|
* authenticator using the [verify
|
|
706
|
-
* authenticator](/docs/references/cloud/client-web/account#
|
|
909
|
+
* authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator)
|
|
707
910
|
* method.
|
|
708
911
|
*
|
|
709
912
|
* @param {AuthenticatorType} type
|
|
@@ -727,7 +930,7 @@ class Account extends Service {
|
|
|
727
930
|
* Verify Authenticator
|
|
728
931
|
*
|
|
729
932
|
* Verify an authenticator app after adding it using the [add
|
|
730
|
-
* authenticator](/docs/references/cloud/client-web/account#
|
|
933
|
+
* authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator)
|
|
731
934
|
* method.
|
|
732
935
|
*
|
|
733
936
|
* @param {AuthenticatorType} type
|
|
@@ -784,7 +987,7 @@ class Account extends Service {
|
|
|
784
987
|
});
|
|
785
988
|
}
|
|
786
989
|
/**
|
|
787
|
-
* Create
|
|
990
|
+
* Create MFA Challenge
|
|
788
991
|
*
|
|
789
992
|
* Begin the process of MFA verification after sign-in. Finish the flow with
|
|
790
993
|
* [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge)
|
|
@@ -1877,7 +2080,7 @@ class Account extends Service {
|
|
|
1877
2080
|
});
|
|
1878
2081
|
}
|
|
1879
2082
|
/**
|
|
1880
|
-
*
|
|
2083
|
+
* Update phone verification (confirmation)
|
|
1881
2084
|
*
|
|
1882
2085
|
* Use this endpoint to complete the user phone verification process. Use the
|
|
1883
2086
|
* **userId** and **secret** that were sent to your user's phone number to
|
|
@@ -4245,10 +4448,11 @@ class Functions extends Service {
|
|
|
4245
4448
|
* @param {string} templateOwner
|
|
4246
4449
|
* @param {string} templateRootDirectory
|
|
4247
4450
|
* @param {string} templateBranch
|
|
4451
|
+
* @param {string} specification
|
|
4248
4452
|
* @throws {AppwriteException}
|
|
4249
4453
|
* @returns {Promise}
|
|
4250
4454
|
*/
|
|
4251
|
-
create(functionId, name, runtime, execute, events, schedule, timeout, enabled, logging, entrypoint, commands, installationId, providerRepositoryId, providerBranch, providerSilentMode, providerRootDirectory, templateRepository, templateOwner, templateRootDirectory, templateBranch) {
|
|
4455
|
+
create(functionId, name, runtime, execute, events, schedule, timeout, enabled, logging, entrypoint, commands, installationId, providerRepositoryId, providerBranch, providerSilentMode, providerRootDirectory, templateRepository, templateOwner, templateRootDirectory, templateBranch, specification) {
|
|
4252
4456
|
return __awaiter(this, void 0, void 0, function* () {
|
|
4253
4457
|
if (typeof functionId === 'undefined') {
|
|
4254
4458
|
throw new AppwriteException('Missing required parameter: "functionId"');
|
|
@@ -4321,6 +4525,9 @@ class Functions extends Service {
|
|
|
4321
4525
|
if (typeof templateBranch !== 'undefined') {
|
|
4322
4526
|
payload['templateBranch'] = templateBranch;
|
|
4323
4527
|
}
|
|
4528
|
+
if (typeof specification !== 'undefined') {
|
|
4529
|
+
payload['specification'] = specification;
|
|
4530
|
+
}
|
|
4324
4531
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
4325
4532
|
return yield this.client.call('post', uri, {
|
|
4326
4533
|
'content-type': 'application/json',
|
|
@@ -4345,6 +4552,25 @@ class Functions extends Service {
|
|
|
4345
4552
|
}, payload);
|
|
4346
4553
|
});
|
|
4347
4554
|
}
|
|
4555
|
+
/**
|
|
4556
|
+
* Get available function runtime specifications
|
|
4557
|
+
*
|
|
4558
|
+
* Get allowed function specifications for this instance.
|
|
4559
|
+
*
|
|
4560
|
+
*
|
|
4561
|
+
* @throws {AppwriteException}
|
|
4562
|
+
* @returns {Promise}
|
|
4563
|
+
*/
|
|
4564
|
+
getSpecifications() {
|
|
4565
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4566
|
+
const apiPath = '/functions/specifications';
|
|
4567
|
+
const payload = {};
|
|
4568
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
4569
|
+
return yield this.client.call('get', uri, {
|
|
4570
|
+
'content-type': 'application/json',
|
|
4571
|
+
}, payload);
|
|
4572
|
+
});
|
|
4573
|
+
}
|
|
4348
4574
|
/**
|
|
4349
4575
|
* Get functions usage
|
|
4350
4576
|
*
|
|
@@ -4409,10 +4635,11 @@ class Functions extends Service {
|
|
|
4409
4635
|
* @param {string} providerBranch
|
|
4410
4636
|
* @param {boolean} providerSilentMode
|
|
4411
4637
|
* @param {string} providerRootDirectory
|
|
4638
|
+
* @param {string} specification
|
|
4412
4639
|
* @throws {AppwriteException}
|
|
4413
4640
|
* @returns {Promise}
|
|
4414
4641
|
*/
|
|
4415
|
-
update(functionId, name, runtime, execute, events, schedule, timeout, enabled, logging, entrypoint, commands, installationId, providerRepositoryId, providerBranch, providerSilentMode, providerRootDirectory) {
|
|
4642
|
+
update(functionId, name, runtime, execute, events, schedule, timeout, enabled, logging, entrypoint, commands, installationId, providerRepositoryId, providerBranch, providerSilentMode, providerRootDirectory, specification) {
|
|
4416
4643
|
return __awaiter(this, void 0, void 0, function* () {
|
|
4417
4644
|
if (typeof functionId === 'undefined') {
|
|
4418
4645
|
throw new AppwriteException('Missing required parameter: "functionId"');
|
|
@@ -4467,6 +4694,9 @@ class Functions extends Service {
|
|
|
4467
4694
|
if (typeof providerRootDirectory !== 'undefined') {
|
|
4468
4695
|
payload['providerRootDirectory'] = providerRootDirectory;
|
|
4469
4696
|
}
|
|
4697
|
+
if (typeof specification !== 'undefined') {
|
|
4698
|
+
payload['specification'] = specification;
|
|
4699
|
+
}
|
|
4470
4700
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
4471
4701
|
return yield this.client.call('put', uri, {
|
|
4472
4702
|
'content-type': 'application/json',
|
|
@@ -4638,7 +4868,7 @@ class Functions extends Service {
|
|
|
4638
4868
|
});
|
|
4639
4869
|
}
|
|
4640
4870
|
/**
|
|
4641
|
-
* Update
|
|
4871
|
+
* Update deployment
|
|
4642
4872
|
*
|
|
4643
4873
|
* Update the function code deployment ID using the unique function ID. Use
|
|
4644
4874
|
* this endpoint to switch the code deployment that should be executed by the
|
|
@@ -4723,7 +4953,7 @@ class Functions extends Service {
|
|
|
4723
4953
|
});
|
|
4724
4954
|
}
|
|
4725
4955
|
/**
|
|
4726
|
-
* Download
|
|
4956
|
+
* Download deployment
|
|
4727
4957
|
*
|
|
4728
4958
|
* Get a Deployment's contents by its unique ID. This endpoint supports range
|
|
4729
4959
|
* requests for partial or streaming file download.
|
|
@@ -5875,10 +6105,11 @@ class Messaging extends Service {
|
|
|
5875
6105
|
* @param {string[]} cc
|
|
5876
6106
|
* @param {string[]} bcc
|
|
5877
6107
|
* @param {string} scheduledAt
|
|
6108
|
+
* @param {string[]} attachments
|
|
5878
6109
|
* @throws {AppwriteException}
|
|
5879
6110
|
* @returns {Promise}
|
|
5880
6111
|
*/
|
|
5881
|
-
updateEmail(messageId, topics, users, targets, subject, content, draft, html, cc, bcc, scheduledAt) {
|
|
6112
|
+
updateEmail(messageId, topics, users, targets, subject, content, draft, html, cc, bcc, scheduledAt, attachments) {
|
|
5882
6113
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5883
6114
|
if (typeof messageId === 'undefined') {
|
|
5884
6115
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
@@ -5915,6 +6146,9 @@ class Messaging extends Service {
|
|
|
5915
6146
|
if (typeof scheduledAt !== 'undefined') {
|
|
5916
6147
|
payload['scheduledAt'] = scheduledAt;
|
|
5917
6148
|
}
|
|
6149
|
+
if (typeof attachments !== 'undefined') {
|
|
6150
|
+
payload['attachments'] = attachments;
|
|
6151
|
+
}
|
|
5918
6152
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
5919
6153
|
return yield this.client.call('patch', uri, {
|
|
5920
6154
|
'content-type': 'application/json',
|
|
@@ -12442,12 +12676,12 @@ class Users extends Service {
|
|
|
12442
12676
|
/**
|
|
12443
12677
|
* Create token
|
|
12444
12678
|
*
|
|
12445
|
-
* Returns a token with a secret key for creating a session.
|
|
12446
|
-
*
|
|
12447
|
-
*
|
|
12448
|
-
* /account/sessions/custom](https://appwrite.io/docs/references/cloud/client-web/account#updateCustomSession)
|
|
12679
|
+
* Returns a token with a secret key for creating a session. Use the user ID
|
|
12680
|
+
* and secret and submit a request to the [PUT
|
|
12681
|
+
* /account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession)
|
|
12449
12682
|
* endpoint to complete the login process.
|
|
12450
12683
|
*
|
|
12684
|
+
*
|
|
12451
12685
|
* @param {string} userId
|
|
12452
12686
|
* @param {number} length
|
|
12453
12687
|
* @param {number} expire
|
|
@@ -12777,20 +13011,56 @@ class Vcs extends Service {
|
|
|
12777
13011
|
}
|
|
12778
13012
|
}
|
|
12779
13013
|
|
|
13014
|
+
/**
|
|
13015
|
+
* Helper class to generate permission strings for resources.
|
|
13016
|
+
*/
|
|
12780
13017
|
class Permission {
|
|
12781
13018
|
}
|
|
13019
|
+
/**
|
|
13020
|
+
* Generate read permission string for the provided role.
|
|
13021
|
+
*
|
|
13022
|
+
* @param {string} role
|
|
13023
|
+
* @returns {string}
|
|
13024
|
+
*/
|
|
12782
13025
|
Permission.read = (role) => {
|
|
12783
13026
|
return `read("${role}")`;
|
|
12784
13027
|
};
|
|
13028
|
+
/**
|
|
13029
|
+
* Generate write permission string for the provided role.
|
|
13030
|
+
*
|
|
13031
|
+
* This is an alias of update, delete, and possibly create.
|
|
13032
|
+
* Don't use write in combination with update, delete, or create.
|
|
13033
|
+
*
|
|
13034
|
+
* @param {string} role
|
|
13035
|
+
* @returns {string}
|
|
13036
|
+
*/
|
|
12785
13037
|
Permission.write = (role) => {
|
|
12786
13038
|
return `write("${role}")`;
|
|
12787
13039
|
};
|
|
13040
|
+
/**
|
|
13041
|
+
* Generate create permission string for the provided role.
|
|
13042
|
+
*
|
|
13043
|
+
* @param {string} role
|
|
13044
|
+
* @returns {string}
|
|
13045
|
+
*/
|
|
12788
13046
|
Permission.create = (role) => {
|
|
12789
13047
|
return `create("${role}")`;
|
|
12790
13048
|
};
|
|
13049
|
+
/**
|
|
13050
|
+
* Generate update permission string for the provided role.
|
|
13051
|
+
*
|
|
13052
|
+
* @param {string} role
|
|
13053
|
+
* @returns {string}
|
|
13054
|
+
*/
|
|
12791
13055
|
Permission.update = (role) => {
|
|
12792
13056
|
return `update("${role}")`;
|
|
12793
13057
|
};
|
|
13058
|
+
/**
|
|
13059
|
+
* Generate delete permission string for the provided role.
|
|
13060
|
+
*
|
|
13061
|
+
* @param {string} role
|
|
13062
|
+
* @returns {string}
|
|
13063
|
+
*/
|
|
12794
13064
|
Permission.delete = (role) => {
|
|
12795
13065
|
return `delete("${role}")`;
|
|
12796
13066
|
};
|
|
@@ -12890,10 +13160,25 @@ class Role {
|
|
|
12890
13160
|
}
|
|
12891
13161
|
|
|
12892
13162
|
var _a, _ID_hexTimestamp;
|
|
13163
|
+
/**
|
|
13164
|
+
* Helper class to generate ID strings for resources.
|
|
13165
|
+
*/
|
|
12893
13166
|
class ID {
|
|
13167
|
+
/**
|
|
13168
|
+
* Uses the provided ID as the ID for the resource.
|
|
13169
|
+
*
|
|
13170
|
+
* @param {string} id
|
|
13171
|
+
* @returns {string}
|
|
13172
|
+
*/
|
|
12894
13173
|
static custom(id) {
|
|
12895
13174
|
return id;
|
|
12896
13175
|
}
|
|
13176
|
+
/**
|
|
13177
|
+
* Have Appwrite generate a unique ID for you.
|
|
13178
|
+
*
|
|
13179
|
+
* @param {number} padding. Default is 7.
|
|
13180
|
+
* @returns {string}
|
|
13181
|
+
*/
|
|
12897
13182
|
static unique(padding = 7) {
|
|
12898
13183
|
// Generate a unique ID with padding to have a longer ID
|
|
12899
13184
|
const baseId = __classPrivateFieldGet(ID, _a, "m", _ID_hexTimestamp).call(ID);
|
|
@@ -12993,7 +13278,7 @@ exports.CreditCard = void 0;
|
|
|
12993
13278
|
CreditCard["AmericanExpress"] = "amex";
|
|
12994
13279
|
CreditCard["Argencard"] = "argencard";
|
|
12995
13280
|
CreditCard["Cabal"] = "cabal";
|
|
12996
|
-
CreditCard["
|
|
13281
|
+
CreditCard["Cencosud"] = "cencosud";
|
|
12997
13282
|
CreditCard["DinersClub"] = "diners";
|
|
12998
13283
|
CreditCard["Discover"] = "discover";
|
|
12999
13284
|
CreditCard["Elo"] = "elo";
|
|
@@ -13151,6 +13436,7 @@ exports.Flag = void 0;
|
|
|
13151
13436
|
Flag["Palau"] = "pw";
|
|
13152
13437
|
Flag["PapuaNewGuinea"] = "pg";
|
|
13153
13438
|
Flag["Poland"] = "pl";
|
|
13439
|
+
Flag["FrenchPolynesia"] = "pf";
|
|
13154
13440
|
Flag["NorthKorea"] = "kp";
|
|
13155
13441
|
Flag["Portugal"] = "pt";
|
|
13156
13442
|
Flag["Paraguay"] = "py";
|
|
@@ -13256,6 +13542,7 @@ exports.Runtime = void 0;
|
|
|
13256
13542
|
Runtime["Python310"] = "python-3.10";
|
|
13257
13543
|
Runtime["Python311"] = "python-3.11";
|
|
13258
13544
|
Runtime["Python312"] = "python-3.12";
|
|
13545
|
+
Runtime["Pythonml311"] = "python-ml-3.11";
|
|
13259
13546
|
Runtime["Deno140"] = "deno-1.40";
|
|
13260
13547
|
Runtime["Dart215"] = "dart-2.15";
|
|
13261
13548
|
Runtime["Dart216"] = "dart-2.16";
|
|
@@ -13309,12 +13596,11 @@ exports.Name = void 0;
|
|
|
13309
13596
|
Name["V1functions"] = "v1-functions";
|
|
13310
13597
|
Name["V1usage"] = "v1-usage";
|
|
13311
13598
|
Name["V1usagedump"] = "v1-usage-dump";
|
|
13312
|
-
Name["
|
|
13599
|
+
Name["V1webhooks"] = "v1-webhooks";
|
|
13313
13600
|
Name["V1certificates"] = "v1-certificates";
|
|
13314
13601
|
Name["V1builds"] = "v1-builds";
|
|
13315
13602
|
Name["V1messaging"] = "v1-messaging";
|
|
13316
13603
|
Name["V1migrations"] = "v1-migrations";
|
|
13317
|
-
Name["Hamsterv1"] = "hamsterv1";
|
|
13318
13604
|
})(exports.Name || (exports.Name = {}));
|
|
13319
13605
|
|
|
13320
13606
|
exports.SmtpEncryption = void 0;
|