@appwrite.io/console 0.6.0-rc.9 → 0.6.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/.travis.yml +32 -0
- package/README.md +5 -5
- package/dist/cjs/sdk.js +1140 -418
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +1141 -419
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +1140 -418
- package/docs/examples/account/create-anonymous-session.md +6 -13
- package/docs/examples/account/create-email-password-session.md +9 -13
- package/docs/examples/account/create-email-token.md +10 -13
- package/docs/examples/account/create-j-w-t.md +6 -13
- package/docs/examples/account/create-magic-u-r-l-token.md +11 -13
- package/docs/examples/account/create-mfa-authenticator.md +13 -0
- package/docs/examples/account/create-mfa-challenge.md +13 -0
- package/docs/examples/account/create-mfa-recovery-codes.md +11 -0
- package/docs/examples/account/create-o-auth2session.md +10 -9
- package/docs/examples/account/create-o-auth2token.md +15 -0
- package/docs/examples/account/create-phone-token.md +9 -13
- package/docs/examples/account/create-phone-verification.md +6 -13
- package/docs/examples/account/create-push-target.md +10 -13
- package/docs/examples/account/create-recovery.md +9 -13
- package/docs/examples/account/create-session.md +9 -13
- package/docs/examples/account/create-verification.md +8 -13
- package/docs/examples/account/create.md +11 -13
- package/docs/examples/account/delete-identity.md +8 -13
- package/docs/examples/account/delete-mfa-authenticator.md +14 -0
- package/docs/examples/account/delete-push-target.md +8 -13
- package/docs/examples/account/delete-session.md +8 -13
- package/docs/examples/account/delete-sessions.md +6 -13
- package/docs/examples/account/delete.md +6 -13
- package/docs/examples/account/get-mfa-recovery-codes.md +11 -0
- package/docs/examples/account/get-prefs.md +6 -13
- package/docs/examples/account/get-session.md +8 -13
- package/docs/examples/account/get.md +6 -13
- package/docs/examples/account/list-identities.md +8 -13
- package/docs/examples/account/list-logs.md +8 -13
- package/docs/examples/account/list-mfa-factors.md +11 -0
- package/docs/examples/account/list-sessions.md +6 -13
- package/docs/examples/account/update-email.md +9 -13
- package/docs/examples/account/update-m-f-a.md +8 -13
- package/docs/examples/account/update-magic-u-r-l-session.md +9 -13
- package/docs/examples/account/update-mfa-authenticator.md +14 -0
- package/docs/examples/account/update-mfa-challenge.md +14 -0
- package/docs/examples/account/update-mfa-recovery-codes.md +11 -0
- package/docs/examples/account/update-name.md +8 -13
- package/docs/examples/account/update-password.md +9 -13
- package/docs/examples/account/update-phone-session.md +14 -0
- package/docs/examples/account/update-phone-verification.md +9 -13
- package/docs/examples/account/update-phone.md +9 -13
- package/docs/examples/account/update-prefs.md +8 -13
- package/docs/examples/account/update-push-target.md +9 -13
- package/docs/examples/account/update-recovery.md +10 -13
- package/docs/examples/account/update-session.md +8 -13
- package/docs/examples/account/update-status.md +6 -13
- package/docs/examples/account/update-verification.md +9 -13
- package/docs/examples/assistant/chat.md +8 -13
- package/docs/examples/avatars/get-browser.md +11 -9
- package/docs/examples/avatars/get-credit-card.md +11 -9
- package/docs/examples/avatars/get-favicon.md +8 -9
- package/docs/examples/avatars/get-flag.md +11 -9
- package/docs/examples/avatars/get-image.md +10 -9
- package/docs/examples/avatars/get-initials.md +11 -9
- package/docs/examples/avatars/get-q-r.md +11 -9
- package/docs/examples/console/variables.md +6 -13
- package/docs/examples/databases/create-boolean-attribute.md +13 -13
- package/docs/examples/databases/create-collection.md +13 -13
- package/docs/examples/databases/create-datetime-attribute.md +13 -13
- package/docs/examples/databases/create-document.md +12 -13
- package/docs/examples/databases/create-email-attribute.md +13 -13
- package/docs/examples/databases/create-enum-attribute.md +14 -13
- package/docs/examples/databases/create-float-attribute.md +15 -13
- package/docs/examples/databases/create-index.md +13 -13
- package/docs/examples/databases/create-integer-attribute.md +15 -13
- package/docs/examples/databases/create-ip-attribute.md +13 -13
- package/docs/examples/databases/create-relationship-attribute.md +15 -13
- package/docs/examples/databases/create-string-attribute.md +15 -13
- package/docs/examples/databases/create-url-attribute.md +13 -13
- package/docs/examples/databases/create.md +10 -13
- package/docs/examples/databases/delete-attribute.md +10 -13
- package/docs/examples/databases/delete-collection.md +9 -13
- package/docs/examples/databases/delete-document.md +10 -13
- package/docs/examples/databases/delete-index.md +10 -13
- package/docs/examples/databases/delete.md +8 -13
- package/docs/examples/databases/get-attribute.md +10 -13
- package/docs/examples/databases/get-collection-usage.md +10 -13
- package/docs/examples/databases/get-collection.md +9 -13
- package/docs/examples/databases/get-database-usage.md +9 -13
- package/docs/examples/databases/get-document.md +11 -13
- package/docs/examples/databases/get-index.md +10 -13
- package/docs/examples/databases/get-usage.md +8 -13
- package/docs/examples/databases/get.md +8 -13
- package/docs/examples/databases/list-attributes.md +10 -13
- package/docs/examples/databases/list-collection-logs.md +10 -13
- package/docs/examples/databases/list-collections.md +10 -13
- package/docs/examples/databases/list-document-logs.md +11 -13
- package/docs/examples/databases/list-documents.md +10 -13
- package/docs/examples/databases/list-indexes.md +10 -13
- package/docs/examples/databases/list-logs.md +9 -13
- package/docs/examples/databases/list.md +9 -13
- package/docs/examples/databases/update-boolean-attribute.md +12 -13
- package/docs/examples/databases/update-collection.md +13 -13
- package/docs/examples/databases/update-datetime-attribute.md +12 -13
- package/docs/examples/databases/update-document.md +12 -13
- package/docs/examples/databases/update-email-attribute.md +12 -13
- package/docs/examples/databases/update-enum-attribute.md +13 -13
- package/docs/examples/databases/update-float-attribute.md +14 -13
- package/docs/examples/databases/update-integer-attribute.md +14 -13
- package/docs/examples/databases/update-ip-attribute.md +12 -13
- package/docs/examples/databases/update-relationship-attribute.md +11 -13
- package/docs/examples/databases/update-string-attribute.md +12 -13
- package/docs/examples/databases/update-url-attribute.md +12 -13
- package/docs/examples/databases/update.md +10 -13
- package/docs/examples/functions/create-build.md +10 -13
- package/docs/examples/functions/create-deployment.md +12 -13
- package/docs/examples/functions/create-execution.md +13 -13
- package/docs/examples/functions/create-variable.md +10 -13
- package/docs/examples/functions/create.md +27 -13
- package/docs/examples/functions/delete-deployment.md +9 -13
- package/docs/examples/functions/delete-variable.md +9 -13
- package/docs/examples/functions/delete.md +8 -13
- package/docs/examples/functions/download-deployment.md +9 -9
- package/docs/examples/functions/get-deployment.md +9 -13
- package/docs/examples/functions/get-execution.md +9 -13
- package/docs/examples/functions/get-function-usage.md +9 -13
- package/docs/examples/functions/get-usage.md +8 -13
- package/docs/examples/functions/get-variable.md +9 -13
- package/docs/examples/functions/get.md +8 -13
- package/docs/examples/functions/list-deployments.md +10 -13
- package/docs/examples/functions/list-executions.md +10 -13
- package/docs/examples/functions/list-runtimes.md +6 -13
- package/docs/examples/functions/list-variables.md +8 -13
- package/docs/examples/functions/list.md +9 -13
- package/docs/examples/functions/update-deployment.md +9 -13
- package/docs/examples/functions/update-variable.md +11 -13
- package/docs/examples/functions/update.md +23 -13
- package/docs/examples/graphql/mutation.md +8 -13
- package/docs/examples/graphql/query.md +8 -13
- package/docs/examples/health/get-antivirus.md +6 -13
- package/docs/examples/health/get-cache.md +6 -13
- package/docs/examples/health/get-certificate.md +13 -0
- package/docs/examples/health/get-d-b.md +6 -13
- package/docs/examples/health/get-failed-jobs.md +14 -0
- package/docs/examples/health/get-pub-sub.md +6 -13
- package/docs/examples/health/get-queue-builds.md +8 -13
- package/docs/examples/health/get-queue-certificates.md +8 -13
- package/docs/examples/health/get-queue-databases.md +9 -13
- package/docs/examples/health/get-queue-deletes.md +8 -13
- package/docs/examples/health/get-queue-functions.md +8 -13
- package/docs/examples/health/get-queue-logs.md +8 -13
- package/docs/examples/health/get-queue-mails.md +8 -13
- package/docs/examples/health/get-queue-messaging.md +8 -13
- package/docs/examples/health/get-queue-migrations.md +8 -13
- package/docs/examples/health/get-queue-usage-dump.md +13 -0
- package/docs/examples/health/get-queue-usage.md +13 -0
- package/docs/examples/health/get-queue-webhooks.md +8 -13
- package/docs/examples/health/get-queue.md +6 -13
- package/docs/examples/health/get-storage-local.md +6 -13
- package/docs/examples/health/get-storage.md +11 -0
- package/docs/examples/health/get-time.md +6 -13
- package/docs/examples/health/get.md +6 -13
- package/docs/examples/locale/get.md +6 -13
- package/docs/examples/locale/list-codes.md +6 -13
- package/docs/examples/locale/list-continents.md +6 -13
- package/docs/examples/locale/list-countries-e-u.md +6 -13
- package/docs/examples/locale/list-countries-phones.md +6 -13
- package/docs/examples/locale/list-countries.md +6 -13
- package/docs/examples/locale/list-currencies.md +6 -13
- package/docs/examples/locale/list-languages.md +6 -13
- package/docs/examples/messaging/create-apns-provider.md +20 -0
- package/docs/examples/messaging/create-email.md +19 -13
- package/docs/examples/messaging/create-fcm-provider.md +16 -0
- package/docs/examples/messaging/create-mailgun-provider.md +17 -13
- package/docs/examples/messaging/create-msg91provider.md +13 -13
- package/docs/examples/messaging/create-push.md +23 -13
- package/docs/examples/messaging/create-sendgrid-provider.md +15 -13
- package/docs/examples/messaging/create-sms.md +19 -0
- package/docs/examples/messaging/create-smtp-provider.md +26 -0
- package/docs/examples/messaging/create-subscriber.md +10 -13
- package/docs/examples/messaging/create-telesign-provider.md +13 -13
- package/docs/examples/messaging/create-textmagic-provider.md +13 -13
- package/docs/examples/messaging/create-topic.md +10 -13
- package/docs/examples/messaging/create-twilio-provider.md +13 -13
- package/docs/examples/messaging/create-vonage-provider.md +13 -13
- package/docs/examples/messaging/delete-provider.md +8 -13
- package/docs/examples/messaging/delete-subscriber.md +9 -13
- package/docs/examples/messaging/delete-topic.md +8 -13
- package/docs/examples/messaging/delete.md +8 -13
- package/docs/examples/messaging/get-message.md +8 -13
- package/docs/examples/messaging/get-provider.md +8 -13
- package/docs/examples/messaging/get-subscriber.md +9 -13
- package/docs/examples/messaging/get-topic.md +8 -13
- package/docs/examples/messaging/list-message-logs.md +9 -13
- package/docs/examples/messaging/list-messages.md +9 -13
- package/docs/examples/messaging/list-provider-logs.md +9 -13
- package/docs/examples/messaging/list-providers.md +9 -13
- package/docs/examples/messaging/list-subscriber-logs.md +9 -13
- package/docs/examples/messaging/list-subscribers.md +10 -13
- package/docs/examples/messaging/list-targets.md +9 -13
- package/docs/examples/messaging/list-topic-logs.md +9 -13
- package/docs/examples/messaging/list-topics.md +9 -13
- package/docs/examples/messaging/update-apns-provider.md +20 -0
- package/docs/examples/messaging/update-email.md +18 -13
- package/docs/examples/messaging/update-fcm-provider.md +16 -0
- package/docs/examples/messaging/update-mailgun-provider.md +17 -13
- package/docs/examples/messaging/update-msg91provider.md +13 -13
- package/docs/examples/messaging/update-push.md +23 -13
- package/docs/examples/messaging/update-sendgrid-provider.md +15 -13
- package/docs/examples/messaging/update-sms.md +19 -0
- package/docs/examples/messaging/update-smtp-provider.md +26 -0
- package/docs/examples/messaging/update-telesign-provider.md +13 -13
- package/docs/examples/messaging/update-textmagic-provider.md +13 -13
- package/docs/examples/messaging/update-topic.md +10 -13
- package/docs/examples/messaging/update-twilio-provider.md +13 -13
- package/docs/examples/messaging/update-vonage-provider.md +13 -13
- package/docs/examples/migrations/create-appwrite-migration.md +11 -13
- package/docs/examples/migrations/create-firebase-migration.md +9 -13
- package/docs/examples/migrations/create-firebase-o-auth-migration.md +9 -13
- package/docs/examples/migrations/create-n-host-migration.md +15 -13
- package/docs/examples/migrations/create-supabase-migration.md +14 -13
- package/docs/examples/migrations/delete-firebase-auth.md +6 -13
- package/docs/examples/migrations/delete.md +8 -13
- package/docs/examples/migrations/get-appwrite-report.md +11 -13
- package/docs/examples/migrations/get-firebase-report-o-auth.md +9 -13
- package/docs/examples/migrations/get-firebase-report.md +9 -13
- package/docs/examples/migrations/get-n-host-report.md +15 -13
- package/docs/examples/migrations/get-supabase-report.md +14 -13
- package/docs/examples/migrations/get.md +8 -13
- package/docs/examples/migrations/list-firebase-projects.md +6 -13
- package/docs/examples/migrations/list.md +9 -13
- package/docs/examples/migrations/retry.md +8 -13
- package/docs/examples/project/create-variable.md +9 -13
- package/docs/examples/project/delete-variable.md +8 -13
- package/docs/examples/project/get-usage.md +10 -13
- package/docs/examples/project/get-variable.md +8 -13
- package/docs/examples/project/list-variables.md +6 -13
- package/docs/examples/project/update-variable.md +10 -13
- package/docs/examples/projects/create-key.md +11 -13
- package/docs/examples/projects/create-platform.md +13 -13
- package/docs/examples/projects/create-smtp-test.md +17 -13
- package/docs/examples/projects/create-webhook.md +15 -13
- package/docs/examples/projects/create.md +20 -13
- package/docs/examples/projects/delete-email-template.md +10 -13
- package/docs/examples/projects/delete-key.md +9 -13
- package/docs/examples/projects/delete-platform.md +9 -13
- package/docs/examples/projects/delete-sms-template.md +10 -13
- package/docs/examples/projects/delete-webhook.md +9 -13
- package/docs/examples/projects/delete.md +8 -13
- package/docs/examples/projects/get-email-template.md +10 -13
- package/docs/examples/projects/get-key.md +9 -13
- package/docs/examples/projects/get-platform.md +9 -13
- package/docs/examples/projects/get-sms-template.md +10 -13
- package/docs/examples/projects/get-webhook.md +9 -13
- package/docs/examples/projects/get.md +8 -13
- package/docs/examples/projects/list-keys.md +8 -13
- package/docs/examples/projects/list-platforms.md +8 -13
- package/docs/examples/projects/list-webhooks.md +8 -13
- package/docs/examples/projects/list.md +9 -13
- package/docs/examples/projects/update-api-status-all.md +14 -0
- package/docs/examples/projects/update-api-status.md +15 -0
- package/docs/examples/projects/update-auth-duration.md +9 -13
- package/docs/examples/projects/update-auth-limit.md +9 -13
- package/docs/examples/projects/update-auth-password-dictionary.md +9 -13
- package/docs/examples/projects/update-auth-password-history.md +9 -13
- package/docs/examples/projects/update-auth-sessions-limit.md +9 -13
- package/docs/examples/projects/update-auth-status.md +10 -13
- package/docs/examples/projects/update-email-template.md +15 -13
- package/docs/examples/projects/update-key.md +12 -13
- package/docs/examples/projects/update-o-auth2.md +12 -13
- package/docs/examples/projects/update-personal-data-check.md +9 -13
- package/docs/examples/projects/update-platform.md +13 -13
- package/docs/examples/projects/update-service-status-all.md +9 -13
- package/docs/examples/projects/update-service-status.md +10 -13
- package/docs/examples/projects/update-sms-template.md +11 -13
- package/docs/examples/projects/update-smtp.md +17 -13
- package/docs/examples/projects/update-team.md +9 -13
- package/docs/examples/projects/update-webhook-signature.md +9 -13
- package/docs/examples/projects/update-webhook.md +16 -13
- package/docs/examples/projects/update.md +18 -13
- package/docs/examples/proxy/create-rule.md +10 -13
- package/docs/examples/proxy/delete-rule.md +8 -13
- package/docs/examples/proxy/get-rule.md +8 -13
- package/docs/examples/proxy/list-rules.md +9 -13
- package/docs/examples/proxy/update-rule-verification.md +8 -13
- package/docs/examples/storage/create-bucket.md +17 -13
- package/docs/examples/storage/create-file.md +11 -13
- package/docs/examples/storage/delete-bucket.md +8 -13
- package/docs/examples/storage/delete-file.md +9 -13
- package/docs/examples/storage/get-bucket-usage.md +9 -13
- package/docs/examples/storage/get-bucket.md +8 -13
- package/docs/examples/storage/get-file-download.md +9 -9
- package/docs/examples/storage/get-file-preview.md +20 -9
- package/docs/examples/storage/get-file-view.md +9 -9
- package/docs/examples/storage/get-file.md +9 -13
- package/docs/examples/storage/get-usage.md +8 -13
- package/docs/examples/storage/list-buckets.md +9 -13
- package/docs/examples/storage/list-files.md +10 -13
- package/docs/examples/storage/update-bucket.md +17 -13
- package/docs/examples/storage/update-file.md +11 -13
- package/docs/examples/teams/create-membership.md +14 -13
- package/docs/examples/teams/create.md +10 -13
- package/docs/examples/teams/delete-membership.md +9 -13
- package/docs/examples/teams/delete.md +8 -13
- package/docs/examples/teams/get-membership.md +9 -13
- package/docs/examples/teams/get-prefs.md +8 -13
- package/docs/examples/teams/get.md +8 -13
- package/docs/examples/teams/list-logs.md +9 -13
- package/docs/examples/teams/list-memberships.md +10 -13
- package/docs/examples/teams/list.md +9 -13
- package/docs/examples/teams/update-membership-status.md +11 -13
- package/docs/examples/teams/update-membership.md +10 -13
- package/docs/examples/teams/update-name.md +9 -13
- package/docs/examples/teams/update-prefs.md +9 -13
- package/docs/examples/users/create-argon2user.md +11 -13
- package/docs/examples/users/create-bcrypt-user.md +11 -13
- package/docs/examples/users/create-m-d5user.md +11 -13
- package/docs/examples/users/create-mfa-recovery-codes.md +13 -0
- package/docs/examples/users/create-p-h-pass-user.md +11 -13
- package/docs/examples/users/create-s-h-a-user.md +12 -13
- package/docs/examples/users/create-scrypt-modified-user.md +14 -13
- package/docs/examples/users/create-scrypt-user.md +16 -13
- package/docs/examples/users/create-session.md +8 -13
- package/docs/examples/users/create-target.md +13 -13
- package/docs/examples/users/create-token.md +10 -13
- package/docs/examples/users/create.md +12 -13
- package/docs/examples/users/delete-identity.md +8 -13
- package/docs/examples/users/delete-mfa-authenticator.md +14 -0
- package/docs/examples/users/delete-session.md +9 -13
- package/docs/examples/users/delete-sessions.md +8 -13
- package/docs/examples/users/delete-target.md +9 -13
- package/docs/examples/users/delete.md +8 -13
- package/docs/examples/users/get-mfa-recovery-codes.md +13 -0
- package/docs/examples/users/get-prefs.md +8 -13
- package/docs/examples/users/get-target.md +9 -13
- package/docs/examples/users/get-usage.md +8 -13
- package/docs/examples/users/get.md +8 -13
- package/docs/examples/users/list-identities.md +9 -13
- package/docs/examples/users/list-logs.md +9 -13
- package/docs/examples/users/list-memberships.md +8 -13
- package/docs/examples/users/list-mfa-factors.md +13 -0
- package/docs/examples/users/list-sessions.md +8 -13
- package/docs/examples/users/list-targets.md +9 -13
- package/docs/examples/users/list.md +9 -13
- package/docs/examples/users/update-email-verification.md +9 -13
- package/docs/examples/users/update-email.md +9 -13
- package/docs/examples/users/update-labels.md +9 -13
- package/docs/examples/users/update-mfa-recovery-codes.md +13 -0
- package/docs/examples/users/update-mfa.md +9 -13
- package/docs/examples/users/update-name.md +9 -13
- package/docs/examples/users/update-password.md +9 -13
- package/docs/examples/users/update-phone-verification.md +9 -13
- package/docs/examples/users/update-phone.md +9 -13
- package/docs/examples/users/update-prefs.md +9 -13
- package/docs/examples/users/update-status.md +9 -13
- package/docs/examples/users/update-target.md +12 -13
- package/docs/examples/vcs/create-repository-detection.md +10 -13
- package/docs/examples/vcs/create-repository.md +10 -13
- package/docs/examples/vcs/delete-installation.md +8 -13
- package/docs/examples/vcs/get-installation.md +8 -13
- package/docs/examples/vcs/get-repository.md +9 -13
- package/docs/examples/vcs/list-installations.md +9 -13
- package/docs/examples/vcs/list-repositories.md +9 -13
- package/docs/examples/vcs/list-repository-branches.md +9 -13
- package/docs/examples/vcs/update-external-deployments.md +10 -13
- package/package.json +1 -1
- package/src/client.ts +3 -3
- package/src/enums/{a-p-i-service.ts → api-service.ts} +1 -1
- package/src/enums/api.ts +5 -0
- package/src/enums/authentication-factor.ts +6 -0
- package/src/enums/authenticator-type.ts +3 -0
- package/src/enums/email-template-locale.ts +133 -0
- package/src/enums/email-template-type.ts +7 -0
- package/src/enums/index-type.ts +0 -1
- package/src/enums/name.ts +15 -0
- package/src/enums/{password-version.ts → password-hash.ts} +1 -1
- package/src/enums/region.ts +1 -0
- package/src/enums/runtime.ts +40 -0
- package/src/enums/{template-locale.ts → sms-template-locale.ts} +1 -1
- package/src/enums/{template-type.ts → sms-template-type.ts} +2 -1
- package/src/enums/{s-m-t-p-encryption.ts → smtp-encryption.ts} +1 -1
- package/src/index.ts +11 -8
- package/src/models.ts +57 -19
- package/src/query.ts +2 -2
- package/src/service.ts +0 -3
- package/src/services/account.ts +239 -66
- package/src/services/assistant.ts +0 -1
- package/src/services/avatars.ts +0 -1
- package/src/services/console.ts +0 -1
- package/src/services/databases.ts +20 -4
- package/src/services/functions.ts +0 -1
- package/src/services/graphql.ts +0 -1
- package/src/services/health.ts +121 -1
- package/src/services/locale.ts +0 -1
- package/src/services/messaging.ts +161 -70
- package/src/services/migrations.ts +0 -1
- package/src/services/project.ts +1 -2
- package/src/services/projects.ts +97 -24
- package/src/services/proxy.ts +0 -1
- package/src/services/storage.ts +2 -3
- package/src/services/teams.ts +0 -1
- package/src/services/users.ts +115 -39
- package/src/services/vcs.ts +0 -1
- package/types/enums/{a-p-i-service.d.ts → api-service.d.ts} +1 -1
- package/types/enums/api.d.ts +5 -0
- package/types/enums/authentication-factor.d.ts +6 -0
- package/types/enums/authenticator-type.d.ts +3 -0
- package/types/enums/email-template-locale.d.ts +133 -0
- package/types/enums/email-template-type.d.ts +7 -0
- package/types/enums/index-type.d.ts +1 -2
- package/types/enums/name.d.ts +15 -0
- package/types/enums/{password-version.d.ts → password-hash.d.ts} +1 -1
- package/types/enums/region.d.ts +2 -1
- package/types/enums/runtime.d.ts +41 -1
- package/types/enums/{template-locale.d.ts → sms-template-locale.d.ts} +1 -1
- package/types/enums/sms-template-type.d.ts +6 -0
- package/types/enums/{s-m-t-p-encryption.d.ts → smtp-encryption.d.ts} +1 -1
- package/types/index.d.ts +11 -8
- package/types/models.d.ts +57 -19
- package/types/query.d.ts +2 -2
- package/types/services/account.d.ts +121 -28
- package/types/services/databases.d.ts +20 -3
- package/types/services/health.d.ts +56 -0
- package/types/services/messaging.d.ts +109 -49
- package/types/services/project.d.ts +1 -1
- package/types/services/projects.d.ts +47 -23
- package/types/services/storage.d.ts +2 -2
- package/types/services/users.d.ts +63 -17
- package/docs/examples/account/add-authenticator.md +0 -18
- package/docs/examples/account/create-challenge.md +0 -18
- package/docs/examples/account/delete-authenticator.md +0 -18
- package/docs/examples/account/list-factors.md +0 -18
- package/docs/examples/account/update-challenge.md +0 -18
- package/docs/examples/account/verify-authenticator.md +0 -18
- package/docs/examples/messaging/create-a-p-n-s-provider.md +0 -18
- package/docs/examples/messaging/create-f-c-m-provider.md +0 -18
- package/docs/examples/messaging/create-s-m-s.md +0 -18
- package/docs/examples/messaging/create-s-m-t-p-provider.md +0 -18
- package/docs/examples/messaging/update-a-p-n-s-provider.md +0 -18
- package/docs/examples/messaging/update-f-c-m-provider.md +0 -18
- package/docs/examples/messaging/update-s-m-s.md +0 -18
- package/docs/examples/messaging/update-s-m-t-p-provider.md +0 -18
- package/docs/examples/users/delete-authenticator.md +0 -18
- package/docs/examples/users/list-providers.md +0 -18
- package/src/enums/authenticator-factor.ts +0 -3
- package/src/enums/authenticator-provider.ts +0 -3
- package/src/enums/message-type.ts +0 -5
- package/types/enums/authenticator-factor.d.ts +0 -3
- package/types/enums/authenticator-provider.d.ts +0 -3
- package/types/enums/message-type.d.ts +0 -5
- package/types/enums/template-type.d.ts +0 -5
package/src/services/account.ts
CHANGED
|
@@ -2,9 +2,8 @@ import { Service } from '../service';
|
|
|
2
2
|
import { AppwriteException, Client } from '../client';
|
|
3
3
|
import type { Models } from '../models';
|
|
4
4
|
import type { UploadProgress, Payload } from '../client';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { AuthenticatorFactor } from '../enums/authenticator-factor';
|
|
5
|
+
import { AuthenticatorType } from '../enums/authenticator-type';
|
|
6
|
+
import { AuthenticationFactor } from '../enums/authentication-factor';
|
|
8
7
|
import { OAuthProvider } from '../enums/o-auth-provider';
|
|
9
8
|
|
|
10
9
|
export class Account extends Service {
|
|
@@ -244,6 +243,7 @@ export class Account extends Service {
|
|
|
244
243
|
/**
|
|
245
244
|
* Update MFA
|
|
246
245
|
*
|
|
246
|
+
* Enable or disable MFA on an account.
|
|
247
247
|
*
|
|
248
248
|
* @param {boolean} mfa
|
|
249
249
|
* @throws {AppwriteException}
|
|
@@ -268,25 +268,25 @@ export class Account extends Service {
|
|
|
268
268
|
}
|
|
269
269
|
|
|
270
270
|
/**
|
|
271
|
-
*
|
|
271
|
+
* Add Authenticator
|
|
272
272
|
*
|
|
273
|
+
* Add an authenticator app to be used as an MFA factor. Verify the
|
|
274
|
+
* authenticator using the [verify
|
|
275
|
+
* authenticator](/docs/references/cloud/client-web/account#verifyAuthenticator)
|
|
276
|
+
* method.
|
|
273
277
|
*
|
|
274
|
-
* @param {
|
|
278
|
+
* @param {AuthenticatorType} type
|
|
275
279
|
* @throws {AppwriteException}
|
|
276
280
|
* @returns {Promise}
|
|
277
281
|
*/
|
|
278
|
-
async
|
|
279
|
-
if (typeof
|
|
280
|
-
throw new AppwriteException('Missing required parameter: "
|
|
282
|
+
async createMfaAuthenticator(type: AuthenticatorType): Promise<Models.MfaType> {
|
|
283
|
+
if (typeof type === 'undefined') {
|
|
284
|
+
throw new AppwriteException('Missing required parameter: "type"');
|
|
281
285
|
}
|
|
282
286
|
|
|
283
|
-
const apiPath = '/account/mfa/
|
|
287
|
+
const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type);
|
|
284
288
|
const payload: Payload = {};
|
|
285
289
|
|
|
286
|
-
if (typeof provider !== 'undefined') {
|
|
287
|
-
payload['provider'] = provider;
|
|
288
|
-
}
|
|
289
|
-
|
|
290
290
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
291
291
|
return await this.client.call('post', uri, {
|
|
292
292
|
'content-type': 'application/json',
|
|
@@ -294,30 +294,29 @@ export class Account extends Service {
|
|
|
294
294
|
}
|
|
295
295
|
|
|
296
296
|
/**
|
|
297
|
-
*
|
|
297
|
+
* Verify Authenticator
|
|
298
298
|
*
|
|
299
|
+
* Verify an authenticator app after adding it using the [add
|
|
300
|
+
* authenticator](/docs/references/cloud/client-web/account#addAuthenticator)
|
|
301
|
+
* method.
|
|
299
302
|
*
|
|
300
|
-
* @param {
|
|
303
|
+
* @param {AuthenticatorType} type
|
|
301
304
|
* @param {string} otp
|
|
302
305
|
* @throws {AppwriteException}
|
|
303
306
|
* @returns {Promise}
|
|
304
307
|
*/
|
|
305
|
-
async
|
|
306
|
-
if (typeof
|
|
307
|
-
throw new AppwriteException('Missing required parameter: "
|
|
308
|
+
async updateMfaAuthenticator<Preferences extends Models.Preferences>(type: AuthenticatorType, otp: string): Promise<Models.User<Preferences>> {
|
|
309
|
+
if (typeof type === 'undefined') {
|
|
310
|
+
throw new AppwriteException('Missing required parameter: "type"');
|
|
308
311
|
}
|
|
309
312
|
|
|
310
313
|
if (typeof otp === 'undefined') {
|
|
311
314
|
throw new AppwriteException('Missing required parameter: "otp"');
|
|
312
315
|
}
|
|
313
316
|
|
|
314
|
-
const apiPath = '/account/mfa/
|
|
317
|
+
const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type);
|
|
315
318
|
const payload: Payload = {};
|
|
316
319
|
|
|
317
|
-
if (typeof challengeId !== 'undefined') {
|
|
318
|
-
payload['challengeId'] = challengeId;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
320
|
if (typeof otp !== 'undefined') {
|
|
322
321
|
payload['otp'] = otp;
|
|
323
322
|
}
|
|
@@ -329,39 +328,60 @@ export class Account extends Service {
|
|
|
329
328
|
}
|
|
330
329
|
|
|
331
330
|
/**
|
|
332
|
-
*
|
|
331
|
+
* Delete Authenticator
|
|
333
332
|
*
|
|
334
|
-
*
|
|
333
|
+
* Delete an authenticator for a user by ID.
|
|
335
334
|
*
|
|
335
|
+
* @param {AuthenticatorType} type
|
|
336
|
+
* @param {string} otp
|
|
336
337
|
* @throws {AppwriteException}
|
|
337
338
|
* @returns {Promise}
|
|
338
339
|
*/
|
|
339
|
-
async
|
|
340
|
-
|
|
340
|
+
async deleteMfaAuthenticator<Preferences extends Models.Preferences>(type: AuthenticatorType, otp: string): Promise<Models.User<Preferences>> {
|
|
341
|
+
if (typeof type === 'undefined') {
|
|
342
|
+
throw new AppwriteException('Missing required parameter: "type"');
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
if (typeof otp === 'undefined') {
|
|
346
|
+
throw new AppwriteException('Missing required parameter: "otp"');
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type);
|
|
341
350
|
const payload: Payload = {};
|
|
342
351
|
|
|
352
|
+
if (typeof otp !== 'undefined') {
|
|
353
|
+
payload['otp'] = otp;
|
|
354
|
+
}
|
|
355
|
+
|
|
343
356
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
344
|
-
return await this.client.call('
|
|
357
|
+
return await this.client.call('delete', uri, {
|
|
345
358
|
'content-type': 'application/json',
|
|
346
359
|
}, payload);
|
|
347
360
|
}
|
|
348
361
|
|
|
349
362
|
/**
|
|
350
|
-
*
|
|
363
|
+
* Create 2FA Challenge
|
|
351
364
|
*
|
|
365
|
+
* Begin the process of MFA verification after sign-in. Finish the flow with
|
|
366
|
+
* [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge)
|
|
367
|
+
* method.
|
|
352
368
|
*
|
|
353
|
-
* @param {
|
|
369
|
+
* @param {AuthenticationFactor} factor
|
|
354
370
|
* @throws {AppwriteException}
|
|
355
371
|
* @returns {Promise}
|
|
356
372
|
*/
|
|
357
|
-
async
|
|
373
|
+
async createMfaChallenge(factor: AuthenticationFactor): Promise<Models.MfaChallenge> {
|
|
358
374
|
if (typeof factor === 'undefined') {
|
|
359
375
|
throw new AppwriteException('Missing required parameter: "factor"');
|
|
360
376
|
}
|
|
361
377
|
|
|
362
|
-
const apiPath = '/account/mfa/
|
|
378
|
+
const apiPath = '/account/mfa/challenge';
|
|
363
379
|
const payload: Payload = {};
|
|
364
380
|
|
|
381
|
+
if (typeof factor !== 'undefined') {
|
|
382
|
+
payload['factor'] = factor;
|
|
383
|
+
}
|
|
384
|
+
|
|
365
385
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
366
386
|
return await this.client.call('post', uri, {
|
|
367
387
|
'content-type': 'application/json',
|
|
@@ -369,26 +389,35 @@ export class Account extends Service {
|
|
|
369
389
|
}
|
|
370
390
|
|
|
371
391
|
/**
|
|
372
|
-
*
|
|
392
|
+
* Create MFA Challenge (confirmation)
|
|
373
393
|
*
|
|
394
|
+
* Complete the MFA challenge by providing the one-time password. Finish the
|
|
395
|
+
* process of MFA verification by providing the one-time password. To begin
|
|
396
|
+
* the flow, use
|
|
397
|
+
* [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge)
|
|
398
|
+
* method.
|
|
374
399
|
*
|
|
375
|
-
* @param {
|
|
400
|
+
* @param {string} challengeId
|
|
376
401
|
* @param {string} otp
|
|
377
402
|
* @throws {AppwriteException}
|
|
378
403
|
* @returns {Promise}
|
|
379
404
|
*/
|
|
380
|
-
async
|
|
381
|
-
if (typeof
|
|
382
|
-
throw new AppwriteException('Missing required parameter: "
|
|
405
|
+
async updateMfaChallenge(challengeId: string, otp: string): Promise<{}> {
|
|
406
|
+
if (typeof challengeId === 'undefined') {
|
|
407
|
+
throw new AppwriteException('Missing required parameter: "challengeId"');
|
|
383
408
|
}
|
|
384
409
|
|
|
385
410
|
if (typeof otp === 'undefined') {
|
|
386
411
|
throw new AppwriteException('Missing required parameter: "otp"');
|
|
387
412
|
}
|
|
388
413
|
|
|
389
|
-
const apiPath = '/account/mfa/
|
|
414
|
+
const apiPath = '/account/mfa/challenge';
|
|
390
415
|
const payload: Payload = {};
|
|
391
416
|
|
|
417
|
+
if (typeof challengeId !== 'undefined') {
|
|
418
|
+
payload['challengeId'] = challengeId;
|
|
419
|
+
}
|
|
420
|
+
|
|
392
421
|
if (typeof otp !== 'undefined') {
|
|
393
422
|
payload['otp'] = otp;
|
|
394
423
|
}
|
|
@@ -400,32 +429,83 @@ export class Account extends Service {
|
|
|
400
429
|
}
|
|
401
430
|
|
|
402
431
|
/**
|
|
403
|
-
*
|
|
432
|
+
* List Factors
|
|
404
433
|
*
|
|
434
|
+
* List the factors available on the account to be used as a MFA challange.
|
|
405
435
|
*
|
|
406
|
-
* @param {AuthenticatorProvider} provider
|
|
407
|
-
* @param {string} otp
|
|
408
436
|
* @throws {AppwriteException}
|
|
409
437
|
* @returns {Promise}
|
|
410
438
|
*/
|
|
411
|
-
async
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
}
|
|
439
|
+
async listMfaFactors(): Promise<Models.MfaFactors> {
|
|
440
|
+
const apiPath = '/account/mfa/factors';
|
|
441
|
+
const payload: Payload = {};
|
|
415
442
|
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
443
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
444
|
+
return await this.client.call('get', uri, {
|
|
445
|
+
'content-type': 'application/json',
|
|
446
|
+
}, payload);
|
|
447
|
+
}
|
|
419
448
|
|
|
420
|
-
|
|
449
|
+
/**
|
|
450
|
+
* Get MFA Recovery Codes
|
|
451
|
+
*
|
|
452
|
+
* Get recovery codes that can be used as backup for MFA flow. Before getting
|
|
453
|
+
* codes, they must be generated using
|
|
454
|
+
* [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes)
|
|
455
|
+
* method. An OTP challenge is required to read recovery codes.
|
|
456
|
+
*
|
|
457
|
+
* @throws {AppwriteException}
|
|
458
|
+
* @returns {Promise}
|
|
459
|
+
*/
|
|
460
|
+
async getMfaRecoveryCodes(): Promise<Models.MfaRecoveryCodes> {
|
|
461
|
+
const apiPath = '/account/mfa/recovery-codes';
|
|
421
462
|
const payload: Payload = {};
|
|
422
463
|
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
464
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
465
|
+
return await this.client.call('get', uri, {
|
|
466
|
+
'content-type': 'application/json',
|
|
467
|
+
}, payload);
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* Create MFA Recovery Codes
|
|
472
|
+
*
|
|
473
|
+
* Generate recovery codes as backup for MFA flow. It's recommended to
|
|
474
|
+
* generate and show then immediately after user successfully adds their
|
|
475
|
+
* authehticator. Recovery codes can be used as a MFA verification type in
|
|
476
|
+
* [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge)
|
|
477
|
+
* method.
|
|
478
|
+
*
|
|
479
|
+
* @throws {AppwriteException}
|
|
480
|
+
* @returns {Promise}
|
|
481
|
+
*/
|
|
482
|
+
async createMfaRecoveryCodes(): Promise<Models.MfaRecoveryCodes> {
|
|
483
|
+
const apiPath = '/account/mfa/recovery-codes';
|
|
484
|
+
const payload: Payload = {};
|
|
426
485
|
|
|
427
486
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
428
|
-
return await this.client.call('
|
|
487
|
+
return await this.client.call('post', uri, {
|
|
488
|
+
'content-type': 'application/json',
|
|
489
|
+
}, payload);
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* Regenerate MFA Recovery Codes
|
|
494
|
+
*
|
|
495
|
+
* Regenerate recovery codes that can be used as backup for MFA flow. Before
|
|
496
|
+
* regenerating codes, they must be first generated using
|
|
497
|
+
* [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes)
|
|
498
|
+
* method. An OTP challenge is required to regenreate recovery codes.
|
|
499
|
+
*
|
|
500
|
+
* @throws {AppwriteException}
|
|
501
|
+
* @returns {Promise}
|
|
502
|
+
*/
|
|
503
|
+
async updateMfaRecoveryCodes(): Promise<Models.MfaRecoveryCodes> {
|
|
504
|
+
const apiPath = '/account/mfa/recovery-codes';
|
|
505
|
+
const payload: Payload = {};
|
|
506
|
+
|
|
507
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
508
|
+
return await this.client.call('patch', uri, {
|
|
429
509
|
'content-type': 'application/json',
|
|
430
510
|
}, payload);
|
|
431
511
|
}
|
|
@@ -779,7 +859,7 @@ export class Account extends Service {
|
|
|
779
859
|
}
|
|
780
860
|
|
|
781
861
|
/**
|
|
782
|
-
*
|
|
862
|
+
* Update magic URL session
|
|
783
863
|
*
|
|
784
864
|
* Use this endpoint to create a session from token. Provide the **userId**
|
|
785
865
|
* and **secret** parameters from the successful response of authentication
|
|
@@ -839,12 +919,11 @@ export class Account extends Service {
|
|
|
839
919
|
* @param {OAuthProvider} provider
|
|
840
920
|
* @param {string} success
|
|
841
921
|
* @param {string} failure
|
|
842
|
-
* @param {boolean} token
|
|
843
922
|
* @param {string[]} scopes
|
|
844
923
|
* @throws {AppwriteException}
|
|
845
924
|
* @returns {void|string}
|
|
846
925
|
*/
|
|
847
|
-
createOAuth2Session(provider: OAuthProvider, success?: string, failure?: string,
|
|
926
|
+
createOAuth2Session(provider: OAuthProvider, success?: string, failure?: string, scopes?: string[]): void | URL {
|
|
848
927
|
if (typeof provider === 'undefined') {
|
|
849
928
|
throw new AppwriteException('Missing required parameter: "provider"');
|
|
850
929
|
}
|
|
@@ -860,10 +939,6 @@ export class Account extends Service {
|
|
|
860
939
|
payload['failure'] = failure;
|
|
861
940
|
}
|
|
862
941
|
|
|
863
|
-
if (typeof token !== 'undefined') {
|
|
864
|
-
payload['token'] = token;
|
|
865
|
-
}
|
|
866
|
-
|
|
867
942
|
if (typeof scopes !== 'undefined') {
|
|
868
943
|
payload['scopes'] = scopes;
|
|
869
944
|
}
|
|
@@ -882,6 +957,44 @@ export class Account extends Service {
|
|
|
882
957
|
}
|
|
883
958
|
}
|
|
884
959
|
|
|
960
|
+
/**
|
|
961
|
+
* Update phone session
|
|
962
|
+
*
|
|
963
|
+
* Use this endpoint to create a session from token. Provide the **userId**
|
|
964
|
+
* and **secret** parameters from the successful response of authentication
|
|
965
|
+
* flows initiated by token creation. For example, magic URL and phone login.
|
|
966
|
+
*
|
|
967
|
+
* @param {string} userId
|
|
968
|
+
* @param {string} secret
|
|
969
|
+
* @throws {AppwriteException}
|
|
970
|
+
* @returns {Promise}
|
|
971
|
+
*/
|
|
972
|
+
async updatePhoneSession(userId: string, secret: string): Promise<Models.Session> {
|
|
973
|
+
if (typeof userId === 'undefined') {
|
|
974
|
+
throw new AppwriteException('Missing required parameter: "userId"');
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
if (typeof secret === 'undefined') {
|
|
978
|
+
throw new AppwriteException('Missing required parameter: "secret"');
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
const apiPath = '/account/sessions/phone';
|
|
982
|
+
const payload: Payload = {};
|
|
983
|
+
|
|
984
|
+
if (typeof userId !== 'undefined') {
|
|
985
|
+
payload['userId'] = userId;
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
if (typeof secret !== 'undefined') {
|
|
989
|
+
payload['secret'] = secret;
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
993
|
+
return await this.client.call('put', uri, {
|
|
994
|
+
'content-type': 'application/json',
|
|
995
|
+
}, payload);
|
|
996
|
+
}
|
|
997
|
+
|
|
885
998
|
/**
|
|
886
999
|
* Create session
|
|
887
1000
|
*
|
|
@@ -945,10 +1058,11 @@ export class Account extends Service {
|
|
|
945
1058
|
}
|
|
946
1059
|
|
|
947
1060
|
/**
|
|
948
|
-
* Update
|
|
1061
|
+
* Update session
|
|
949
1062
|
*
|
|
950
|
-
*
|
|
951
|
-
* useful when session
|
|
1063
|
+
* Use this endpoint to extend a session's length. Extending a session is
|
|
1064
|
+
* useful when session expiry is short. If the session was created using an
|
|
1065
|
+
* OAuth provider, this endpoint refreshes the access token from the provider.
|
|
952
1066
|
*
|
|
953
1067
|
* @param {string} sessionId
|
|
954
1068
|
* @throws {AppwriteException}
|
|
@@ -1016,7 +1130,7 @@ export class Account extends Service {
|
|
|
1016
1130
|
}
|
|
1017
1131
|
|
|
1018
1132
|
/**
|
|
1019
|
-
* Create
|
|
1133
|
+
* Create push target
|
|
1020
1134
|
*
|
|
1021
1135
|
*
|
|
1022
1136
|
* @param {string} targetId
|
|
@@ -1056,7 +1170,7 @@ export class Account extends Service {
|
|
|
1056
1170
|
}
|
|
1057
1171
|
|
|
1058
1172
|
/**
|
|
1059
|
-
* Update
|
|
1173
|
+
* Update push target
|
|
1060
1174
|
*
|
|
1061
1175
|
*
|
|
1062
1176
|
* @param {string} targetId
|
|
@@ -1087,7 +1201,7 @@ export class Account extends Service {
|
|
|
1087
1201
|
}
|
|
1088
1202
|
|
|
1089
1203
|
/**
|
|
1090
|
-
* Delete
|
|
1204
|
+
* Delete push target
|
|
1091
1205
|
*
|
|
1092
1206
|
*
|
|
1093
1207
|
* @param {string} targetId
|
|
@@ -1219,6 +1333,65 @@ export class Account extends Service {
|
|
|
1219
1333
|
}, payload);
|
|
1220
1334
|
}
|
|
1221
1335
|
|
|
1336
|
+
/**
|
|
1337
|
+
* Create OAuth2 token
|
|
1338
|
+
*
|
|
1339
|
+
* Allow the user to login to their account using the OAuth2 provider of their
|
|
1340
|
+
* choice. Each OAuth2 provider should be enabled from the Appwrite console
|
|
1341
|
+
* first. Use the success and failure arguments to provide a redirect URL's
|
|
1342
|
+
* back to your app when login is completed.
|
|
1343
|
+
*
|
|
1344
|
+
* If authentication succeeds, `userId` and `secret` of a token will be
|
|
1345
|
+
* appended to the success URL as query parameters. These can be used to
|
|
1346
|
+
* create a new session using the [Create
|
|
1347
|
+
* session](https://appwrite.io/docs/references/cloud/client-web/account#createSession)
|
|
1348
|
+
* endpoint.
|
|
1349
|
+
*
|
|
1350
|
+
* A user is limited to 10 active sessions at a time by default. [Learn more
|
|
1351
|
+
* about session
|
|
1352
|
+
* limits](https://appwrite.io/docs/authentication-security#limits).
|
|
1353
|
+
*
|
|
1354
|
+
* @param {OAuthProvider} provider
|
|
1355
|
+
* @param {string} success
|
|
1356
|
+
* @param {string} failure
|
|
1357
|
+
* @param {string[]} scopes
|
|
1358
|
+
* @throws {AppwriteException}
|
|
1359
|
+
* @returns {void|string}
|
|
1360
|
+
*/
|
|
1361
|
+
createOAuth2Token(provider: OAuthProvider, success?: string, failure?: string, scopes?: string[]): void | URL {
|
|
1362
|
+
if (typeof provider === 'undefined') {
|
|
1363
|
+
throw new AppwriteException('Missing required parameter: "provider"');
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
const apiPath = '/account/tokens/oauth2/{provider}'.replace('{provider}', provider);
|
|
1367
|
+
const payload: Payload = {};
|
|
1368
|
+
|
|
1369
|
+
if (typeof success !== 'undefined') {
|
|
1370
|
+
payload['success'] = success;
|
|
1371
|
+
}
|
|
1372
|
+
|
|
1373
|
+
if (typeof failure !== 'undefined') {
|
|
1374
|
+
payload['failure'] = failure;
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
if (typeof scopes !== 'undefined') {
|
|
1378
|
+
payload['scopes'] = scopes;
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1382
|
+
payload['project'] = this.client.config.project;
|
|
1383
|
+
|
|
1384
|
+
|
|
1385
|
+
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
1386
|
+
uri.searchParams.append(key, value);
|
|
1387
|
+
}
|
|
1388
|
+
if (typeof window !== 'undefined' && window?.location) {
|
|
1389
|
+
window.location.href = uri.toString();
|
|
1390
|
+
} else {
|
|
1391
|
+
return uri;
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1222
1395
|
/**
|
|
1223
1396
|
* Create phone token
|
|
1224
1397
|
*
|
|
@@ -2,7 +2,6 @@ import { Service } from '../service';
|
|
|
2
2
|
import { AppwriteException, Client } from '../client';
|
|
3
3
|
import type { Models } from '../models';
|
|
4
4
|
import type { UploadProgress, Payload } from '../client';
|
|
5
|
-
import { Query } from '../query';
|
|
6
5
|
|
|
7
6
|
export class Assistant extends Service {
|
|
8
7
|
|
package/src/services/avatars.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { Service } from '../service';
|
|
|
2
2
|
import { AppwriteException, Client } from '../client';
|
|
3
3
|
import type { Models } from '../models';
|
|
4
4
|
import type { UploadProgress, Payload } from '../client';
|
|
5
|
-
import { Query } from '../query';
|
|
6
5
|
import { Browser } from '../enums/browser';
|
|
7
6
|
import { CreditCard } from '../enums/credit-card';
|
|
8
7
|
import { Flag } from '../enums/flag';
|
package/src/services/console.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { Service } from '../service';
|
|
|
2
2
|
import { AppwriteException, Client } from '../client';
|
|
3
3
|
import type { Models } from '../models';
|
|
4
4
|
import type { UploadProgress, Payload } from '../client';
|
|
5
|
-
import { Query } from '../query';
|
|
6
5
|
|
|
7
6
|
export class Console extends Service {
|
|
8
7
|
|
|
@@ -2,7 +2,6 @@ import { Service } from '../service';
|
|
|
2
2
|
import { AppwriteException, Client } from '../client';
|
|
3
3
|
import type { Models } from '../models';
|
|
4
4
|
import type { UploadProgress, Payload } from '../client';
|
|
5
|
-
import { Query } from '../query';
|
|
6
5
|
import { DatabaseUsageRange } from '../enums/database-usage-range';
|
|
7
6
|
import { RelationshipType } from '../enums/relationship-type';
|
|
8
7
|
import { RelationMutate } from '../enums/relation-mutate';
|
|
@@ -87,7 +86,7 @@ export class Databases extends Service {
|
|
|
87
86
|
}
|
|
88
87
|
|
|
89
88
|
/**
|
|
90
|
-
* Get usage stats
|
|
89
|
+
* Get databases usage stats
|
|
91
90
|
*
|
|
92
91
|
*
|
|
93
92
|
* @param {DatabaseUsageRange} range
|
|
@@ -399,6 +398,7 @@ export class Databases extends Service {
|
|
|
399
398
|
/**
|
|
400
399
|
* List attributes
|
|
401
400
|
*
|
|
401
|
+
* List attributes in the collection.
|
|
402
402
|
*
|
|
403
403
|
* @param {string} databaseId
|
|
404
404
|
* @param {string} collectionId
|
|
@@ -488,6 +488,8 @@ export class Databases extends Service {
|
|
|
488
488
|
/**
|
|
489
489
|
* Update boolean attribute
|
|
490
490
|
*
|
|
491
|
+
* Update a boolean attribute. Changing the `default` value will not update
|
|
492
|
+
* already existing documents.
|
|
491
493
|
*
|
|
492
494
|
* @param {string} databaseId
|
|
493
495
|
* @param {string} collectionId
|
|
@@ -538,6 +540,7 @@ export class Databases extends Service {
|
|
|
538
540
|
/**
|
|
539
541
|
* Create datetime attribute
|
|
540
542
|
*
|
|
543
|
+
* Create a date time attribute according to the ISO 8601 standard.
|
|
541
544
|
*
|
|
542
545
|
* @param {string} databaseId
|
|
543
546
|
* @param {string} collectionId
|
|
@@ -593,6 +596,8 @@ export class Databases extends Service {
|
|
|
593
596
|
/**
|
|
594
597
|
* Update dateTime attribute
|
|
595
598
|
*
|
|
599
|
+
* Update a date time attribute. Changing the `default` value will not update
|
|
600
|
+
* already existing documents.
|
|
596
601
|
*
|
|
597
602
|
* @param {string} databaseId
|
|
598
603
|
* @param {string} collectionId
|
|
@@ -753,6 +758,9 @@ export class Databases extends Service {
|
|
|
753
758
|
/**
|
|
754
759
|
* Create enum attribute
|
|
755
760
|
*
|
|
761
|
+
* Create an enumeration attribute. The `elements` param acts as a white-list
|
|
762
|
+
* of accepted values for this attribute.
|
|
763
|
+
*
|
|
756
764
|
*
|
|
757
765
|
* @param {string} databaseId
|
|
758
766
|
* @param {string} collectionId
|
|
@@ -1569,6 +1577,7 @@ export class Databases extends Service {
|
|
|
1569
1577
|
/**
|
|
1570
1578
|
* Get attribute
|
|
1571
1579
|
*
|
|
1580
|
+
* Get attribute by ID.
|
|
1572
1581
|
*
|
|
1573
1582
|
* @param {string} databaseId
|
|
1574
1583
|
* @param {string} collectionId
|
|
@@ -1601,6 +1610,7 @@ export class Databases extends Service {
|
|
|
1601
1610
|
/**
|
|
1602
1611
|
* Delete attribute
|
|
1603
1612
|
*
|
|
1613
|
+
* Deletes an attribute.
|
|
1604
1614
|
*
|
|
1605
1615
|
* @param {string} databaseId
|
|
1606
1616
|
* @param {string} collectionId
|
|
@@ -1915,6 +1925,7 @@ export class Databases extends Service {
|
|
|
1915
1925
|
/**
|
|
1916
1926
|
* List indexes
|
|
1917
1927
|
*
|
|
1928
|
+
* List indexes in the collection.
|
|
1918
1929
|
*
|
|
1919
1930
|
* @param {string} databaseId
|
|
1920
1931
|
* @param {string} collectionId
|
|
@@ -1947,6 +1958,9 @@ export class Databases extends Service {
|
|
|
1947
1958
|
/**
|
|
1948
1959
|
* Create index
|
|
1949
1960
|
*
|
|
1961
|
+
* Creates an index on the attributes listed. Your index should include all
|
|
1962
|
+
* the attributes you will query in a single request.
|
|
1963
|
+
* Attributes can be `key`, `fulltext`, and `unique`.
|
|
1950
1964
|
*
|
|
1951
1965
|
* @param {string} databaseId
|
|
1952
1966
|
* @param {string} collectionId
|
|
@@ -2006,6 +2020,7 @@ export class Databases extends Service {
|
|
|
2006
2020
|
/**
|
|
2007
2021
|
* Get index
|
|
2008
2022
|
*
|
|
2023
|
+
* Get index by ID.
|
|
2009
2024
|
*
|
|
2010
2025
|
* @param {string} databaseId
|
|
2011
2026
|
* @param {string} collectionId
|
|
@@ -2038,6 +2053,7 @@ export class Databases extends Service {
|
|
|
2038
2053
|
/**
|
|
2039
2054
|
* Delete index
|
|
2040
2055
|
*
|
|
2056
|
+
* Delete an index.
|
|
2041
2057
|
*
|
|
2042
2058
|
* @param {string} databaseId
|
|
2043
2059
|
* @param {string} collectionId
|
|
@@ -2101,7 +2117,7 @@ export class Databases extends Service {
|
|
|
2101
2117
|
}
|
|
2102
2118
|
|
|
2103
2119
|
/**
|
|
2104
|
-
* Get usage stats
|
|
2120
|
+
* Get collection usage stats
|
|
2105
2121
|
*
|
|
2106
2122
|
*
|
|
2107
2123
|
* @param {string} databaseId
|
|
@@ -2161,7 +2177,7 @@ export class Databases extends Service {
|
|
|
2161
2177
|
}
|
|
2162
2178
|
|
|
2163
2179
|
/**
|
|
2164
|
-
* Get usage stats
|
|
2180
|
+
* Get database usage stats
|
|
2165
2181
|
*
|
|
2166
2182
|
*
|
|
2167
2183
|
* @param {string} databaseId
|
|
@@ -2,7 +2,6 @@ import { Service } from '../service';
|
|
|
2
2
|
import { AppwriteException, Client } from '../client';
|
|
3
3
|
import type { Models } from '../models';
|
|
4
4
|
import type { UploadProgress, Payload } from '../client';
|
|
5
|
-
import { Query } from '../query';
|
|
6
5
|
import { Runtime } from '../enums/runtime';
|
|
7
6
|
import { FunctionUsageRange } from '../enums/function-usage-range';
|
|
8
7
|
import { ExecutionMethod } from '../enums/execution-method';
|
package/src/services/graphql.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { Service } from '../service';
|
|
|
2
2
|
import { AppwriteException, Client } from '../client';
|
|
3
3
|
import type { Models } from '../models';
|
|
4
4
|
import type { UploadProgress, Payload } from '../client';
|
|
5
|
-
import { Query } from '../query';
|
|
6
5
|
|
|
7
6
|
export class Graphql extends Service {
|
|
8
7
|
|