@appwrite.io/console 1.5.2 → 1.7.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/CHANGELOG.md +9 -1
- package/README.md +3 -3
- package/dist/cjs/sdk.js +11874 -11100
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +11872 -11101
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +11874 -11100
- package/docs/examples/account/create-anonymous-session.md +1 -1
- package/docs/examples/account/create-billing-address.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-payment-method.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-billing-address.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-payment-method.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-billing-address.md +1 -1
- package/docs/examples/account/get-coupon.md +1 -1
- package/docs/examples/account/get-mfa-recovery-codes.md +1 -1
- package/docs/examples/account/get-payment-method.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-billing-addresses.md +1 -1
- package/docs/examples/account/list-identities.md +1 -1
- package/docs/examples/account/list-invoices.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-payment-methods.md +1 -1
- package/docs/examples/account/list-sessions.md +1 -1
- package/docs/examples/account/update-billing-address.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-payment-method-mandate-options.md +1 -1
- package/docs/examples/account/update-payment-method-provider.md +1 -1
- package/docs/examples/account/update-payment-method.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 +2 -2
- package/docs/examples/avatars/get-credit-card.md +2 -2
- package/docs/examples/avatars/get-favicon.md +1 -1
- package/docs/examples/avatars/get-flag.md +2 -2
- 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/backups/create-archive.md +1 -1
- package/docs/examples/backups/create-policy.md +1 -1
- package/docs/examples/backups/create-restoration.md +1 -1
- package/docs/examples/backups/delete-archive.md +1 -1
- package/docs/examples/backups/delete-policy.md +1 -1
- package/docs/examples/backups/get-archive.md +1 -1
- package/docs/examples/backups/get-policy.md +1 -1
- package/docs/examples/backups/get-restoration.md +1 -1
- package/docs/examples/backups/list-archives.md +1 -1
- package/docs/examples/backups/list-policies.md +1 -1
- package/docs/examples/backups/list-restorations.md +1 -1
- package/docs/examples/backups/update-policy.md +1 -1
- package/docs/examples/console/create-program-membership.md +1 -1
- package/docs/examples/console/create-source.md +1 -1
- package/docs/examples/console/get-campaign.md +1 -1
- package/docs/examples/console/get-coupon.md +1 -1
- package/docs/examples/console/get-resource.md +14 -0
- package/docs/examples/console/plans.md +1 -1
- package/docs/examples/console/regions.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 +4 -2
- package/docs/examples/databases/create-documents.md +15 -0
- 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 +3 -2
- 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-documents.md +15 -0
- 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-documents.md +16 -0
- 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/databases/upsert-documents.md +15 -0
- package/docs/examples/domains/create-preset-google-workspace.md +13 -0
- package/docs/examples/domains/create-preset-i-cloud.md +13 -0
- package/docs/examples/domains/create-preset-mailgun.md +13 -0
- package/docs/examples/domains/create-preset-outlook.md +13 -0
- package/docs/examples/domains/create-preset-proton-mail.md +13 -0
- package/docs/examples/domains/create-preset-zoho.md +13 -0
- package/docs/examples/domains/create-record-a-a-a-a.md +17 -0
- package/docs/examples/domains/create-record-a.md +17 -0
- package/docs/examples/domains/create-record-alias.md +17 -0
- package/docs/examples/domains/create-record-c-a-a.md +17 -0
- package/docs/examples/domains/create-record-c-n-a-m-e.md +17 -0
- package/docs/examples/domains/create-record-h-t-t-p-s.md +17 -0
- package/docs/examples/domains/create-record-m-x.md +18 -0
- package/docs/examples/domains/create-record-n-s.md +17 -0
- package/docs/examples/domains/create-record-s-r-v.md +20 -0
- package/docs/examples/domains/create-record-t-x-t.md +17 -0
- package/docs/examples/domains/create.md +14 -0
- package/docs/examples/domains/delete-record.md +14 -0
- package/docs/examples/domains/delete.md +13 -0
- package/docs/examples/domains/get-preset-google-workspace.md +13 -0
- package/docs/examples/domains/get-preset-i-cloud.md +13 -0
- package/docs/examples/domains/get-preset-mailgun.md +13 -0
- package/docs/examples/domains/get-preset-outlook.md +13 -0
- package/docs/examples/domains/get-preset-proton-mail.md +13 -0
- package/docs/examples/domains/get-preset-zoho.md +13 -0
- package/docs/examples/domains/get-record.md +14 -0
- package/docs/examples/domains/get-zone.md +13 -0
- package/docs/examples/domains/get.md +13 -0
- package/docs/examples/domains/list-records.md +14 -0
- package/docs/examples/domains/list.md +14 -0
- package/docs/examples/domains/update-nameservers.md +13 -0
- package/docs/examples/domains/update-record-a-a-a-a.md +18 -0
- package/docs/examples/domains/update-record-a.md +18 -0
- package/docs/examples/domains/update-record-alias.md +18 -0
- package/docs/examples/domains/update-record-c-a-a.md +18 -0
- package/docs/examples/domains/update-record-c-n-a-m-e.md +18 -0
- package/docs/examples/domains/update-record-h-t-t-p-s.md +18 -0
- package/docs/examples/domains/update-record-m-x.md +19 -0
- package/docs/examples/domains/update-record-n-s.md +18 -0
- package/docs/examples/domains/update-record-s-r-v.md +21 -0
- package/docs/examples/domains/update-record-t-x-t.md +18 -0
- package/docs/examples/domains/update-team.md +14 -0
- package/docs/examples/domains/update-zone.md +14 -0
- package/docs/examples/functions/create-deployment.md +1 -1
- package/docs/examples/functions/create-duplicate-deployment.md +15 -0
- package/docs/examples/functions/create-execution.md +1 -1
- package/docs/examples/functions/create-template-deployment.md +18 -0
- package/docs/examples/functions/create-variable.md +3 -2
- package/docs/examples/functions/create-vcs-deployment.md +16 -0
- package/docs/examples/functions/create.md +3 -3
- package/docs/examples/functions/delete-deployment.md +1 -1
- package/docs/examples/functions/delete-execution.md +1 -1
- package/docs/examples/functions/delete-variable.md +1 -1
- package/docs/examples/functions/delete.md +1 -1
- package/docs/examples/functions/get-deployment-download.md +4 -3
- package/docs/examples/functions/get-deployment.md +1 -1
- package/docs/examples/functions/get-execution.md +1 -1
- package/docs/examples/functions/get-template.md +1 -1
- package/docs/examples/functions/get-usage.md +2 -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 +2 -3
- package/docs/examples/functions/list-runtimes.md +1 -1
- package/docs/examples/functions/list-specifications.md +1 -1
- package/docs/examples/functions/list-templates.md +1 -1
- package/docs/examples/functions/list-usage.md +13 -0
- package/docs/examples/functions/list-variables.md +1 -1
- package/docs/examples/functions/list.md +1 -1
- package/docs/examples/functions/update-deployment-status.md +14 -0
- package/docs/examples/functions/update-function-deployment.md +14 -0
- package/docs/examples/functions/update-variable.md +3 -2
- package/docs/examples/functions/update.md +1 -1
- 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-billing-aggregation.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-priority-builds.md +1 -1
- package/docs/examples/health/get-queue-region-manager.md +13 -0
- package/docs/examples/health/get-queue-stats-resources.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-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 +1 -1
- 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-csv-migration.md +15 -0
- package/docs/examples/migrations/create-firebase-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.md +1 -1
- package/docs/examples/migrations/get-appwrite-report.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.md +1 -1
- package/docs/examples/migrations/retry.md +1 -1
- package/docs/examples/organizations/add-credit.md +1 -1
- package/docs/examples/organizations/create-invoice-payment.md +1 -1
- package/docs/examples/organizations/create.md +1 -1
- package/docs/examples/organizations/delete-backup-payment-method.md +1 -1
- package/docs/examples/organizations/delete-billing-address.md +1 -1
- package/docs/examples/organizations/delete-default-payment-method.md +1 -1
- package/docs/examples/organizations/delete.md +1 -1
- package/docs/examples/organizations/get-aggregation.md +1 -1
- package/docs/examples/organizations/get-billing-address.md +1 -1
- package/docs/examples/organizations/get-credit.md +1 -1
- package/docs/examples/organizations/get-invoice-download.md +1 -1
- package/docs/examples/organizations/get-invoice-view.md +1 -1
- package/docs/examples/organizations/get-invoice.md +1 -1
- package/docs/examples/organizations/get-payment-method.md +1 -1
- package/docs/examples/organizations/get-plan.md +1 -1
- package/docs/examples/organizations/get-scopes.md +1 -1
- package/docs/examples/organizations/list-aggregations.md +1 -1
- package/docs/examples/organizations/list-credits.md +1 -1
- package/docs/examples/organizations/list-invoices.md +1 -1
- package/docs/examples/organizations/list.md +1 -1
- package/docs/examples/organizations/set-backup-payment-method.md +1 -1
- package/docs/examples/organizations/set-billing-address.md +1 -1
- package/docs/examples/organizations/set-billing-email.md +1 -1
- package/docs/examples/organizations/set-billing-tax-id.md +1 -1
- package/docs/examples/organizations/set-default-payment-method.md +1 -1
- package/docs/examples/organizations/update-budget.md +1 -1
- package/docs/examples/organizations/update-plan.md +1 -1
- package/docs/examples/organizations/validate-invoice.md +14 -0
- package/docs/examples/project/create-variable.md +3 -2
- 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 +3 -2
- package/docs/examples/projects/create-dev-key.md +15 -0
- package/docs/examples/projects/create-j-w-t.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 +2 -2
- package/docs/examples/projects/delete-dev-key.md +14 -0
- 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-dev-key.md +14 -0
- 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-dev-keys.md +14 -0
- 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-dev-key.md +16 -0
- package/docs/examples/projects/update-email-template.md +1 -1
- package/docs/examples/projects/update-key.md +1 -1
- package/docs/examples/projects/update-memberships-privacy.md +1 -1
- package/docs/examples/projects/update-mock-numbers.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-session-alerts.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-a-p-i-rule.md +13 -0
- package/docs/examples/proxy/create-function-rule.md +15 -0
- package/docs/examples/proxy/create-redirect-rule.md +15 -0
- package/docs/examples/proxy/create-site-rule.md +15 -0
- 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/sites/create-deployment.md +18 -0
- package/docs/examples/sites/create-duplicate-deployment.md +14 -0
- package/docs/examples/sites/create-template-deployment.md +18 -0
- package/docs/examples/sites/create-variable.md +16 -0
- package/docs/examples/sites/create-vcs-deployment.md +16 -0
- package/docs/examples/sites/create.md +30 -0
- package/docs/examples/sites/delete-deployment.md +14 -0
- package/docs/examples/sites/delete-log.md +14 -0
- package/docs/examples/sites/delete-variable.md +14 -0
- package/docs/examples/sites/delete.md +13 -0
- package/docs/examples/sites/get-deployment-download.md +15 -0
- package/docs/examples/sites/get-deployment.md +14 -0
- package/docs/examples/sites/get-log.md +14 -0
- package/docs/examples/sites/get-template.md +13 -0
- package/docs/examples/sites/get-usage.md +14 -0
- package/docs/examples/sites/get-variable.md +14 -0
- package/docs/examples/sites/get.md +13 -0
- package/docs/examples/sites/list-deployments.md +15 -0
- package/docs/examples/sites/list-frameworks.md +11 -0
- package/docs/examples/sites/list-logs.md +14 -0
- package/docs/examples/sites/list-specifications.md +11 -0
- package/docs/examples/sites/list-templates.md +16 -0
- package/docs/examples/sites/list-usage.md +13 -0
- package/docs/examples/sites/list-variables.md +13 -0
- package/docs/examples/sites/list.md +14 -0
- package/docs/examples/sites/update-deployment-status.md +14 -0
- package/docs/examples/sites/update-site-deployment.md +14 -0
- package/docs/examples/sites/update-variable.md +17 -0
- package/docs/examples/sites/update.md +30 -0
- 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 +3 -2
- package/docs/examples/storage/get-file-preview.md +4 -3
- package/docs/examples/storage/get-file-view.md +3 -2
- 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/tokens/create-file-token.md +15 -0
- package/docs/examples/tokens/delete.md +13 -0
- package/docs/examples/tokens/get.md +13 -0
- package/docs/examples/tokens/list.md +15 -0
- package/docs/examples/tokens/update.md +14 -0
- package/docs/examples/users/create-argon2user.md +1 -1
- package/docs/examples/users/create-bcrypt-user.md +1 -1
- package/docs/examples/users/create-j-w-t.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 +4 -2
- 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 +3 -2
- 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-contents.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 +3 -2
- package/docs/examples/vcs/list-repository-branches.md +1 -1
- package/docs/examples/vcs/update-external-deployments.md +1 -1
- package/package.json +1 -1
- package/src/client.ts +32 -5
- package/src/enums/adapter.ts +4 -0
- package/src/enums/api-service.ts +1 -0
- package/src/enums/build-runtime.ts +62 -0
- package/src/enums/console-resource-type.ts +3 -0
- package/src/enums/deployment-download-type.ts +4 -0
- package/src/enums/framework.ts +16 -0
- package/src/enums/image-format.ts +0 -1
- package/src/enums/name.ts +0 -1
- package/src/enums/o-auth-provider.ts +1 -0
- package/src/enums/region.ts +2 -1
- package/src/enums/runtime.ts +4 -3
- package/src/enums/site-usage-range.ts +5 -0
- package/src/enums/status-code.ts +6 -0
- package/src/enums/v-c-s-deployment-type.ts +5 -0
- package/src/enums/v-c-s-detection-type.ts +4 -0
- package/src/index.ts +13 -2
- package/src/models.ts +1171 -188
- package/src/services/account.ts +126 -446
- package/src/services/assistant.ts +2 -7
- package/src/services/avatars.ts +7 -28
- package/src/services/backups.ts +24 -90
- package/src/services/console.ts +48 -52
- package/src/services/databases.ts +241 -350
- package/src/services/domains.ts +1821 -0
- package/src/services/functions.ts +216 -248
- package/src/services/graphql.ts +4 -14
- package/src/services/health.ts +56 -206
- package/src/services/locale.ts +16 -64
- package/src/services/messaging.ts +92 -335
- package/src/services/migrations.ts +66 -89
- package/src/services/organizations.ts +84 -241
- package/src/services/project.ts +20 -45
- package/src/services/projects.ts +262 -330
- package/src/services/proxy.ts +129 -44
- package/src/services/sites.ts +1104 -0
- package/src/services/storage.ts +42 -105
- package/src/services/teams.ts +28 -104
- package/src/services/tokens.ts +160 -0
- package/src/services/users.ts +94 -313
- package/src/services/vcs.ts +70 -108
- package/types/enums/adapter.d.ts +4 -0
- package/types/enums/api-service.d.ts +1 -0
- package/types/enums/build-runtime.d.ts +62 -0
- package/types/enums/console-resource-type.d.ts +3 -0
- package/types/enums/deployment-download-type.d.ts +4 -0
- package/types/enums/framework.d.ts +16 -0
- package/types/enums/image-format.d.ts +0 -1
- package/types/enums/name.d.ts +0 -1
- package/types/enums/o-auth-provider.d.ts +1 -0
- package/types/enums/region.d.ts +3 -2
- package/types/enums/runtime.d.ts +5 -4
- package/types/enums/site-usage-range.d.ts +5 -0
- package/types/enums/status-code.d.ts +6 -0
- package/types/enums/v-c-s-deployment-type.d.ts +5 -0
- package/types/enums/v-c-s-detection-type.d.ts +4 -0
- package/types/index.d.ts +13 -2
- package/types/models.d.ts +1171 -188
- package/types/services/account.d.ts +4 -128
- package/types/services/assistant.d.ts +0 -2
- package/types/services/avatars.d.ts +0 -14
- package/types/services/backups.d.ts +0 -24
- package/types/services/console.d.ts +9 -13
- package/types/services/databases.d.ts +43 -97
- package/types/services/domains.d.ts +524 -0
- package/types/services/functions.d.ts +58 -84
- package/types/services/graphql.d.ts +0 -4
- package/types/services/health.d.ts +6 -56
- package/types/services/locale.d.ts +0 -16
- package/types/services/messaging.d.ts +0 -92
- package/types/services/migrations.d.ts +9 -23
- package/types/services/organizations.d.ts +11 -68
- package/types/services/project.d.ts +4 -14
- package/types/services/projects.d.ts +47 -91
- package/types/services/proxy.d.ts +31 -13
- package/types/services/sites.d.ts +319 -0
- package/types/services/storage.d.ts +6 -33
- package/types/services/teams.d.ts +0 -28
- package/types/services/tokens.d.ts +51 -0
- package/types/services/users.d.ts +3 -87
- package/types/services/vcs.d.ts +14 -31
package/src/services/account.ts
CHANGED
|
@@ -13,26 +13,20 @@ export class Account {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
* Get account
|
|
17
|
-
*
|
|
18
16
|
* Get the currently logged in user.
|
|
19
17
|
*
|
|
20
18
|
* @throws {AppwriteException}
|
|
21
19
|
* @returns {Promise<Models.User<Preferences>>}
|
|
22
20
|
*/
|
|
23
|
-
|
|
21
|
+
get<Preferences extends Models.Preferences>(): Promise<Models.User<Preferences>> {
|
|
24
22
|
const apiPath = '/account';
|
|
25
23
|
const payload: Payload = {};
|
|
26
24
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
27
25
|
|
|
28
26
|
const apiHeaders: { [header: string]: string } = {
|
|
29
|
-
'content-type': 'application/json',
|
|
30
27
|
}
|
|
31
28
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return await this.client.call(
|
|
29
|
+
return this.client.call(
|
|
36
30
|
'get',
|
|
37
31
|
uri,
|
|
38
32
|
apiHeaders,
|
|
@@ -40,8 +34,6 @@ export class Account {
|
|
|
40
34
|
);
|
|
41
35
|
}
|
|
42
36
|
/**
|
|
43
|
-
* Create account
|
|
44
|
-
*
|
|
45
37
|
* Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [/account/verfication](https://appwrite.io/docs/references/cloud/client-web/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https://appwrite.io/docs/references/cloud/client-web/account#createEmailSession).
|
|
46
38
|
*
|
|
47
39
|
* @param {string} userId
|
|
@@ -51,7 +43,7 @@ export class Account {
|
|
|
51
43
|
* @throws {AppwriteException}
|
|
52
44
|
* @returns {Promise<Models.User<Preferences>>}
|
|
53
45
|
*/
|
|
54
|
-
|
|
46
|
+
create<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>> {
|
|
55
47
|
if (typeof userId === 'undefined') {
|
|
56
48
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
57
49
|
}
|
|
@@ -81,10 +73,7 @@ export class Account {
|
|
|
81
73
|
'content-type': 'application/json',
|
|
82
74
|
}
|
|
83
75
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
return await this.client.call(
|
|
76
|
+
return this.client.call(
|
|
88
77
|
'post',
|
|
89
78
|
uri,
|
|
90
79
|
apiHeaders,
|
|
@@ -92,14 +81,12 @@ export class Account {
|
|
|
92
81
|
);
|
|
93
82
|
}
|
|
94
83
|
/**
|
|
95
|
-
* Delete account
|
|
96
|
-
*
|
|
97
84
|
* Delete the currently logged in user.
|
|
98
85
|
*
|
|
99
86
|
* @throws {AppwriteException}
|
|
100
87
|
* @returns {Promise<{}>}
|
|
101
88
|
*/
|
|
102
|
-
|
|
89
|
+
delete(): Promise<{}> {
|
|
103
90
|
const apiPath = '/account';
|
|
104
91
|
const payload: Payload = {};
|
|
105
92
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -108,10 +95,7 @@ export class Account {
|
|
|
108
95
|
'content-type': 'application/json',
|
|
109
96
|
}
|
|
110
97
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
return await this.client.call(
|
|
98
|
+
return this.client.call(
|
|
115
99
|
'delete',
|
|
116
100
|
uri,
|
|
117
101
|
apiHeaders,
|
|
@@ -119,15 +103,13 @@ export class Account {
|
|
|
119
103
|
);
|
|
120
104
|
}
|
|
121
105
|
/**
|
|
122
|
-
* List billing addresses
|
|
123
|
-
*
|
|
124
106
|
* List all billing addresses for a user.
|
|
125
107
|
*
|
|
126
108
|
* @param {string[]} queries
|
|
127
109
|
* @throws {AppwriteException}
|
|
128
110
|
* @returns {Promise<Models.BillingAddressList>}
|
|
129
111
|
*/
|
|
130
|
-
|
|
112
|
+
listBillingAddresses(queries?: string[]): Promise<Models.BillingAddressList> {
|
|
131
113
|
const apiPath = '/account/billing-addresses';
|
|
132
114
|
const payload: Payload = {};
|
|
133
115
|
if (typeof queries !== 'undefined') {
|
|
@@ -136,13 +118,9 @@ export class Account {
|
|
|
136
118
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
137
119
|
|
|
138
120
|
const apiHeaders: { [header: string]: string } = {
|
|
139
|
-
'content-type': 'application/json',
|
|
140
121
|
}
|
|
141
122
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
return await this.client.call(
|
|
123
|
+
return this.client.call(
|
|
146
124
|
'get',
|
|
147
125
|
uri,
|
|
148
126
|
apiHeaders,
|
|
@@ -150,8 +128,6 @@ export class Account {
|
|
|
150
128
|
);
|
|
151
129
|
}
|
|
152
130
|
/**
|
|
153
|
-
* Create new billing address
|
|
154
|
-
*
|
|
155
131
|
* Add a new billing address to a user's account.
|
|
156
132
|
*
|
|
157
133
|
* @param {string} country
|
|
@@ -163,7 +139,7 @@ export class Account {
|
|
|
163
139
|
* @throws {AppwriteException}
|
|
164
140
|
* @returns {Promise<Models.BillingAddress>}
|
|
165
141
|
*/
|
|
166
|
-
|
|
142
|
+
createBillingAddress(country: string, streetAddress: string, city: string, state: string, postalCode?: string, addressLine2?: string): Promise<Models.BillingAddress> {
|
|
167
143
|
if (typeof country === 'undefined') {
|
|
168
144
|
throw new AppwriteException('Missing required parameter: "country"');
|
|
169
145
|
}
|
|
@@ -202,10 +178,7 @@ export class Account {
|
|
|
202
178
|
'content-type': 'application/json',
|
|
203
179
|
}
|
|
204
180
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
return await this.client.call(
|
|
181
|
+
return this.client.call(
|
|
209
182
|
'post',
|
|
210
183
|
uri,
|
|
211
184
|
apiHeaders,
|
|
@@ -213,15 +186,13 @@ export class Account {
|
|
|
213
186
|
);
|
|
214
187
|
}
|
|
215
188
|
/**
|
|
216
|
-
* Get billing address
|
|
217
|
-
*
|
|
218
189
|
* Get a specific billing address for a user using it's ID.
|
|
219
190
|
*
|
|
220
191
|
* @param {string} billingAddressId
|
|
221
192
|
* @throws {AppwriteException}
|
|
222
193
|
* @returns {Promise<Models.BillingAddress>}
|
|
223
194
|
*/
|
|
224
|
-
|
|
195
|
+
getBillingAddress(billingAddressId: string): Promise<Models.BillingAddress> {
|
|
225
196
|
if (typeof billingAddressId === 'undefined') {
|
|
226
197
|
throw new AppwriteException('Missing required parameter: "billingAddressId"');
|
|
227
198
|
}
|
|
@@ -230,13 +201,9 @@ export class Account {
|
|
|
230
201
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
231
202
|
|
|
232
203
|
const apiHeaders: { [header: string]: string } = {
|
|
233
|
-
'content-type': 'application/json',
|
|
234
204
|
}
|
|
235
205
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
return await this.client.call(
|
|
206
|
+
return this.client.call(
|
|
240
207
|
'get',
|
|
241
208
|
uri,
|
|
242
209
|
apiHeaders,
|
|
@@ -244,8 +211,6 @@ export class Account {
|
|
|
244
211
|
);
|
|
245
212
|
}
|
|
246
213
|
/**
|
|
247
|
-
* Update billing address
|
|
248
|
-
*
|
|
249
214
|
* Update a specific billing address using it's ID.
|
|
250
215
|
*
|
|
251
216
|
* @param {string} billingAddressId
|
|
@@ -258,7 +223,7 @@ export class Account {
|
|
|
258
223
|
* @throws {AppwriteException}
|
|
259
224
|
* @returns {Promise<Models.BillingAddress>}
|
|
260
225
|
*/
|
|
261
|
-
|
|
226
|
+
updateBillingAddress(billingAddressId: string, country: string, streetAddress: string, city: string, state: string, postalCode?: string, addressLine2?: string): Promise<Models.BillingAddress> {
|
|
262
227
|
if (typeof billingAddressId === 'undefined') {
|
|
263
228
|
throw new AppwriteException('Missing required parameter: "billingAddressId"');
|
|
264
229
|
}
|
|
@@ -300,10 +265,7 @@ export class Account {
|
|
|
300
265
|
'content-type': 'application/json',
|
|
301
266
|
}
|
|
302
267
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
return await this.client.call(
|
|
268
|
+
return this.client.call(
|
|
307
269
|
'put',
|
|
308
270
|
uri,
|
|
309
271
|
apiHeaders,
|
|
@@ -311,15 +273,13 @@ export class Account {
|
|
|
311
273
|
);
|
|
312
274
|
}
|
|
313
275
|
/**
|
|
314
|
-
* Delete billing address
|
|
315
|
-
*
|
|
316
276
|
* Delete a specific billing address using it's ID.
|
|
317
277
|
*
|
|
318
278
|
* @param {string} billingAddressId
|
|
319
279
|
* @throws {AppwriteException}
|
|
320
280
|
* @returns {Promise<{}>}
|
|
321
281
|
*/
|
|
322
|
-
|
|
282
|
+
deleteBillingAddress(billingAddressId: string): Promise<{}> {
|
|
323
283
|
if (typeof billingAddressId === 'undefined') {
|
|
324
284
|
throw new AppwriteException('Missing required parameter: "billingAddressId"');
|
|
325
285
|
}
|
|
@@ -331,10 +291,7 @@ export class Account {
|
|
|
331
291
|
'content-type': 'application/json',
|
|
332
292
|
}
|
|
333
293
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
return await this.client.call(
|
|
294
|
+
return this.client.call(
|
|
338
295
|
'delete',
|
|
339
296
|
uri,
|
|
340
297
|
apiHeaders,
|
|
@@ -342,15 +299,13 @@ export class Account {
|
|
|
342
299
|
);
|
|
343
300
|
}
|
|
344
301
|
/**
|
|
345
|
-
* Get coupon details
|
|
346
|
-
*
|
|
347
302
|
* Get coupon details for an account.
|
|
348
303
|
*
|
|
349
304
|
* @param {string} couponId
|
|
350
305
|
* @throws {AppwriteException}
|
|
351
306
|
* @returns {Promise<Models.Coupon>}
|
|
352
307
|
*/
|
|
353
|
-
|
|
308
|
+
getCoupon(couponId: string): Promise<Models.Coupon> {
|
|
354
309
|
if (typeof couponId === 'undefined') {
|
|
355
310
|
throw new AppwriteException('Missing required parameter: "couponId"');
|
|
356
311
|
}
|
|
@@ -359,13 +314,9 @@ export class Account {
|
|
|
359
314
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
360
315
|
|
|
361
316
|
const apiHeaders: { [header: string]: string } = {
|
|
362
|
-
'content-type': 'application/json',
|
|
363
317
|
}
|
|
364
318
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
return await this.client.call(
|
|
319
|
+
return this.client.call(
|
|
369
320
|
'get',
|
|
370
321
|
uri,
|
|
371
322
|
apiHeaders,
|
|
@@ -373,8 +324,6 @@ export class Account {
|
|
|
373
324
|
);
|
|
374
325
|
}
|
|
375
326
|
/**
|
|
376
|
-
* Update email
|
|
377
|
-
*
|
|
378
327
|
* Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.
|
|
379
328
|
This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.
|
|
380
329
|
|
|
@@ -384,7 +333,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
384
333
|
* @throws {AppwriteException}
|
|
385
334
|
* @returns {Promise<Models.User<Preferences>>}
|
|
386
335
|
*/
|
|
387
|
-
|
|
336
|
+
updateEmail<Preferences extends Models.Preferences>(email: string, password: string): Promise<Models.User<Preferences>> {
|
|
388
337
|
if (typeof email === 'undefined') {
|
|
389
338
|
throw new AppwriteException('Missing required parameter: "email"');
|
|
390
339
|
}
|
|
@@ -405,10 +354,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
405
354
|
'content-type': 'application/json',
|
|
406
355
|
}
|
|
407
356
|
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
return await this.client.call(
|
|
357
|
+
return this.client.call(
|
|
412
358
|
'patch',
|
|
413
359
|
uri,
|
|
414
360
|
apiHeaders,
|
|
@@ -416,15 +362,13 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
416
362
|
);
|
|
417
363
|
}
|
|
418
364
|
/**
|
|
419
|
-
* List identities
|
|
420
|
-
*
|
|
421
365
|
* Get the list of identities for the currently logged in user.
|
|
422
366
|
*
|
|
423
367
|
* @param {string[]} queries
|
|
424
368
|
* @throws {AppwriteException}
|
|
425
369
|
* @returns {Promise<Models.IdentityList>}
|
|
426
370
|
*/
|
|
427
|
-
|
|
371
|
+
listIdentities(queries?: string[]): Promise<Models.IdentityList> {
|
|
428
372
|
const apiPath = '/account/identities';
|
|
429
373
|
const payload: Payload = {};
|
|
430
374
|
if (typeof queries !== 'undefined') {
|
|
@@ -433,13 +377,9 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
433
377
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
434
378
|
|
|
435
379
|
const apiHeaders: { [header: string]: string } = {
|
|
436
|
-
'content-type': 'application/json',
|
|
437
380
|
}
|
|
438
381
|
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
return await this.client.call(
|
|
382
|
+
return this.client.call(
|
|
443
383
|
'get',
|
|
444
384
|
uri,
|
|
445
385
|
apiHeaders,
|
|
@@ -447,15 +387,13 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
447
387
|
);
|
|
448
388
|
}
|
|
449
389
|
/**
|
|
450
|
-
* Delete identity
|
|
451
|
-
*
|
|
452
390
|
* Delete an identity by its unique ID.
|
|
453
391
|
*
|
|
454
392
|
* @param {string} identityId
|
|
455
393
|
* @throws {AppwriteException}
|
|
456
394
|
* @returns {Promise<{}>}
|
|
457
395
|
*/
|
|
458
|
-
|
|
396
|
+
deleteIdentity(identityId: string): Promise<{}> {
|
|
459
397
|
if (typeof identityId === 'undefined') {
|
|
460
398
|
throw new AppwriteException('Missing required parameter: "identityId"');
|
|
461
399
|
}
|
|
@@ -467,10 +405,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
467
405
|
'content-type': 'application/json',
|
|
468
406
|
}
|
|
469
407
|
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
return await this.client.call(
|
|
408
|
+
return this.client.call(
|
|
474
409
|
'delete',
|
|
475
410
|
uri,
|
|
476
411
|
apiHeaders,
|
|
@@ -478,15 +413,13 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
478
413
|
);
|
|
479
414
|
}
|
|
480
415
|
/**
|
|
481
|
-
* List invoices
|
|
482
|
-
*
|
|
483
416
|
* List all invoices tied to an account.
|
|
484
417
|
*
|
|
485
418
|
* @param {string[]} queries
|
|
486
419
|
* @throws {AppwriteException}
|
|
487
420
|
* @returns {Promise<Models.InvoiceList>}
|
|
488
421
|
*/
|
|
489
|
-
|
|
422
|
+
listInvoices(queries?: string[]): Promise<Models.InvoiceList> {
|
|
490
423
|
const apiPath = '/account/invoices';
|
|
491
424
|
const payload: Payload = {};
|
|
492
425
|
if (typeof queries !== 'undefined') {
|
|
@@ -495,13 +428,9 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
495
428
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
496
429
|
|
|
497
430
|
const apiHeaders: { [header: string]: string } = {
|
|
498
|
-
'content-type': 'application/json',
|
|
499
431
|
}
|
|
500
432
|
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
return await this.client.call(
|
|
433
|
+
return this.client.call(
|
|
505
434
|
'get',
|
|
506
435
|
uri,
|
|
507
436
|
apiHeaders,
|
|
@@ -509,14 +438,12 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
509
438
|
);
|
|
510
439
|
}
|
|
511
440
|
/**
|
|
512
|
-
* Create JWT
|
|
513
|
-
*
|
|
514
441
|
* Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.
|
|
515
442
|
*
|
|
516
443
|
* @throws {AppwriteException}
|
|
517
444
|
* @returns {Promise<Models.Jwt>}
|
|
518
445
|
*/
|
|
519
|
-
|
|
446
|
+
createJWT(): Promise<Models.Jwt> {
|
|
520
447
|
const apiPath = '/account/jwts';
|
|
521
448
|
const payload: Payload = {};
|
|
522
449
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -525,10 +452,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
525
452
|
'content-type': 'application/json',
|
|
526
453
|
}
|
|
527
454
|
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
return await this.client.call(
|
|
455
|
+
return this.client.call(
|
|
532
456
|
'post',
|
|
533
457
|
uri,
|
|
534
458
|
apiHeaders,
|
|
@@ -536,15 +460,13 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
536
460
|
);
|
|
537
461
|
}
|
|
538
462
|
/**
|
|
539
|
-
* List logs
|
|
540
|
-
*
|
|
541
463
|
* Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log.
|
|
542
464
|
*
|
|
543
465
|
* @param {string[]} queries
|
|
544
466
|
* @throws {AppwriteException}
|
|
545
467
|
* @returns {Promise<Models.LogList>}
|
|
546
468
|
*/
|
|
547
|
-
|
|
469
|
+
listLogs(queries?: string[]): Promise<Models.LogList> {
|
|
548
470
|
const apiPath = '/account/logs';
|
|
549
471
|
const payload: Payload = {};
|
|
550
472
|
if (typeof queries !== 'undefined') {
|
|
@@ -553,13 +475,9 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
553
475
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
554
476
|
|
|
555
477
|
const apiHeaders: { [header: string]: string } = {
|
|
556
|
-
'content-type': 'application/json',
|
|
557
478
|
}
|
|
558
479
|
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
return await this.client.call(
|
|
480
|
+
return this.client.call(
|
|
563
481
|
'get',
|
|
564
482
|
uri,
|
|
565
483
|
apiHeaders,
|
|
@@ -567,15 +485,13 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
567
485
|
);
|
|
568
486
|
}
|
|
569
487
|
/**
|
|
570
|
-
* Update MFA
|
|
571
|
-
*
|
|
572
488
|
* Enable or disable MFA on an account.
|
|
573
489
|
*
|
|
574
490
|
* @param {boolean} mfa
|
|
575
491
|
* @throws {AppwriteException}
|
|
576
492
|
* @returns {Promise<Models.User<Preferences>>}
|
|
577
493
|
*/
|
|
578
|
-
|
|
494
|
+
updateMFA<Preferences extends Models.Preferences>(mfa: boolean): Promise<Models.User<Preferences>> {
|
|
579
495
|
if (typeof mfa === 'undefined') {
|
|
580
496
|
throw new AppwriteException('Missing required parameter: "mfa"');
|
|
581
497
|
}
|
|
@@ -590,10 +506,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
590
506
|
'content-type': 'application/json',
|
|
591
507
|
}
|
|
592
508
|
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
return await this.client.call(
|
|
509
|
+
return this.client.call(
|
|
597
510
|
'patch',
|
|
598
511
|
uri,
|
|
599
512
|
apiHeaders,
|
|
@@ -601,15 +514,13 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
601
514
|
);
|
|
602
515
|
}
|
|
603
516
|
/**
|
|
604
|
-
* Create authenticator
|
|
605
|
-
*
|
|
606
517
|
* Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator) method.
|
|
607
518
|
*
|
|
608
519
|
* @param {AuthenticatorType} type
|
|
609
520
|
* @throws {AppwriteException}
|
|
610
521
|
* @returns {Promise<Models.MfaType>}
|
|
611
522
|
*/
|
|
612
|
-
|
|
523
|
+
createMfaAuthenticator(type: AuthenticatorType): Promise<Models.MfaType> {
|
|
613
524
|
if (typeof type === 'undefined') {
|
|
614
525
|
throw new AppwriteException('Missing required parameter: "type"');
|
|
615
526
|
}
|
|
@@ -621,10 +532,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
621
532
|
'content-type': 'application/json',
|
|
622
533
|
}
|
|
623
534
|
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
return await this.client.call(
|
|
535
|
+
return this.client.call(
|
|
628
536
|
'post',
|
|
629
537
|
uri,
|
|
630
538
|
apiHeaders,
|
|
@@ -632,8 +540,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
632
540
|
);
|
|
633
541
|
}
|
|
634
542
|
/**
|
|
635
|
-
* Verify authenticator
|
|
636
|
-
*
|
|
637
543
|
* Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method.
|
|
638
544
|
*
|
|
639
545
|
* @param {AuthenticatorType} type
|
|
@@ -641,7 +547,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
641
547
|
* @throws {AppwriteException}
|
|
642
548
|
* @returns {Promise<Models.User<Preferences>>}
|
|
643
549
|
*/
|
|
644
|
-
|
|
550
|
+
updateMfaAuthenticator<Preferences extends Models.Preferences>(type: AuthenticatorType, otp: string): Promise<Models.User<Preferences>> {
|
|
645
551
|
if (typeof type === 'undefined') {
|
|
646
552
|
throw new AppwriteException('Missing required parameter: "type"');
|
|
647
553
|
}
|
|
@@ -659,10 +565,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
659
565
|
'content-type': 'application/json',
|
|
660
566
|
}
|
|
661
567
|
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
return await this.client.call(
|
|
568
|
+
return this.client.call(
|
|
666
569
|
'put',
|
|
667
570
|
uri,
|
|
668
571
|
apiHeaders,
|
|
@@ -670,15 +573,13 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
670
573
|
);
|
|
671
574
|
}
|
|
672
575
|
/**
|
|
673
|
-
* Delete authenticator
|
|
674
|
-
*
|
|
675
576
|
* Delete an authenticator for a user by ID.
|
|
676
577
|
*
|
|
677
578
|
* @param {AuthenticatorType} type
|
|
678
579
|
* @throws {AppwriteException}
|
|
679
580
|
* @returns {Promise<{}>}
|
|
680
581
|
*/
|
|
681
|
-
|
|
582
|
+
deleteMfaAuthenticator(type: AuthenticatorType): Promise<{}> {
|
|
682
583
|
if (typeof type === 'undefined') {
|
|
683
584
|
throw new AppwriteException('Missing required parameter: "type"');
|
|
684
585
|
}
|
|
@@ -690,10 +591,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
690
591
|
'content-type': 'application/json',
|
|
691
592
|
}
|
|
692
593
|
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
return await this.client.call(
|
|
594
|
+
return this.client.call(
|
|
697
595
|
'delete',
|
|
698
596
|
uri,
|
|
699
597
|
apiHeaders,
|
|
@@ -701,15 +599,13 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
701
599
|
);
|
|
702
600
|
}
|
|
703
601
|
/**
|
|
704
|
-
* Create MFA challenge
|
|
705
|
-
*
|
|
706
602
|
* Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method.
|
|
707
603
|
*
|
|
708
604
|
* @param {AuthenticationFactor} factor
|
|
709
605
|
* @throws {AppwriteException}
|
|
710
606
|
* @returns {Promise<Models.MfaChallenge>}
|
|
711
607
|
*/
|
|
712
|
-
|
|
608
|
+
createMfaChallenge(factor: AuthenticationFactor): Promise<Models.MfaChallenge> {
|
|
713
609
|
if (typeof factor === 'undefined') {
|
|
714
610
|
throw new AppwriteException('Missing required parameter: "factor"');
|
|
715
611
|
}
|
|
@@ -724,10 +620,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
724
620
|
'content-type': 'application/json',
|
|
725
621
|
}
|
|
726
622
|
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
return await this.client.call(
|
|
623
|
+
return this.client.call(
|
|
731
624
|
'post',
|
|
732
625
|
uri,
|
|
733
626
|
apiHeaders,
|
|
@@ -735,8 +628,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
735
628
|
);
|
|
736
629
|
}
|
|
737
630
|
/**
|
|
738
|
-
* Create MFA challenge (confirmation)
|
|
739
|
-
*
|
|
740
631
|
* Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method.
|
|
741
632
|
*
|
|
742
633
|
* @param {string} challengeId
|
|
@@ -744,7 +635,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
744
635
|
* @throws {AppwriteException}
|
|
745
636
|
* @returns {Promise<Models.Session>}
|
|
746
637
|
*/
|
|
747
|
-
|
|
638
|
+
updateMfaChallenge(challengeId: string, otp: string): Promise<Models.Session> {
|
|
748
639
|
if (typeof challengeId === 'undefined') {
|
|
749
640
|
throw new AppwriteException('Missing required parameter: "challengeId"');
|
|
750
641
|
}
|
|
@@ -765,10 +656,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
765
656
|
'content-type': 'application/json',
|
|
766
657
|
}
|
|
767
658
|
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
return await this.client.call(
|
|
659
|
+
return this.client.call(
|
|
772
660
|
'put',
|
|
773
661
|
uri,
|
|
774
662
|
apiHeaders,
|
|
@@ -776,26 +664,20 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
776
664
|
);
|
|
777
665
|
}
|
|
778
666
|
/**
|
|
779
|
-
* List factors
|
|
780
|
-
*
|
|
781
667
|
* List the factors available on the account to be used as a MFA challange.
|
|
782
668
|
*
|
|
783
669
|
* @throws {AppwriteException}
|
|
784
670
|
* @returns {Promise<Models.MfaFactors>}
|
|
785
671
|
*/
|
|
786
|
-
|
|
672
|
+
listMfaFactors(): Promise<Models.MfaFactors> {
|
|
787
673
|
const apiPath = '/account/mfa/factors';
|
|
788
674
|
const payload: Payload = {};
|
|
789
675
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
790
676
|
|
|
791
677
|
const apiHeaders: { [header: string]: string } = {
|
|
792
|
-
'content-type': 'application/json',
|
|
793
678
|
}
|
|
794
679
|
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
return await this.client.call(
|
|
680
|
+
return this.client.call(
|
|
799
681
|
'get',
|
|
800
682
|
uri,
|
|
801
683
|
apiHeaders,
|
|
@@ -803,26 +685,20 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
803
685
|
);
|
|
804
686
|
}
|
|
805
687
|
/**
|
|
806
|
-
* Get MFA recovery codes
|
|
807
|
-
*
|
|
808
688
|
* Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.
|
|
809
689
|
*
|
|
810
690
|
* @throws {AppwriteException}
|
|
811
691
|
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
812
692
|
*/
|
|
813
|
-
|
|
693
|
+
getMfaRecoveryCodes(): Promise<Models.MfaRecoveryCodes> {
|
|
814
694
|
const apiPath = '/account/mfa/recovery-codes';
|
|
815
695
|
const payload: Payload = {};
|
|
816
696
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
817
697
|
|
|
818
698
|
const apiHeaders: { [header: string]: string } = {
|
|
819
|
-
'content-type': 'application/json',
|
|
820
699
|
}
|
|
821
700
|
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
return await this.client.call(
|
|
701
|
+
return this.client.call(
|
|
826
702
|
'get',
|
|
827
703
|
uri,
|
|
828
704
|
apiHeaders,
|
|
@@ -830,14 +706,12 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
830
706
|
);
|
|
831
707
|
}
|
|
832
708
|
/**
|
|
833
|
-
* Create MFA recovery codes
|
|
834
|
-
*
|
|
835
709
|
* Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method.
|
|
836
710
|
*
|
|
837
711
|
* @throws {AppwriteException}
|
|
838
712
|
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
839
713
|
*/
|
|
840
|
-
|
|
714
|
+
createMfaRecoveryCodes(): Promise<Models.MfaRecoveryCodes> {
|
|
841
715
|
const apiPath = '/account/mfa/recovery-codes';
|
|
842
716
|
const payload: Payload = {};
|
|
843
717
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -846,10 +720,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
846
720
|
'content-type': 'application/json',
|
|
847
721
|
}
|
|
848
722
|
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
return await this.client.call(
|
|
723
|
+
return this.client.call(
|
|
853
724
|
'post',
|
|
854
725
|
uri,
|
|
855
726
|
apiHeaders,
|
|
@@ -857,14 +728,12 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
857
728
|
);
|
|
858
729
|
}
|
|
859
730
|
/**
|
|
860
|
-
* Regenerate MFA recovery codes
|
|
861
|
-
*
|
|
862
731
|
* Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.
|
|
863
732
|
*
|
|
864
733
|
* @throws {AppwriteException}
|
|
865
734
|
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
866
735
|
*/
|
|
867
|
-
|
|
736
|
+
updateMfaRecoveryCodes(): Promise<Models.MfaRecoveryCodes> {
|
|
868
737
|
const apiPath = '/account/mfa/recovery-codes';
|
|
869
738
|
const payload: Payload = {};
|
|
870
739
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -873,10 +742,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
873
742
|
'content-type': 'application/json',
|
|
874
743
|
}
|
|
875
744
|
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
return await this.client.call(
|
|
745
|
+
return this.client.call(
|
|
880
746
|
'patch',
|
|
881
747
|
uri,
|
|
882
748
|
apiHeaders,
|
|
@@ -884,15 +750,13 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
884
750
|
);
|
|
885
751
|
}
|
|
886
752
|
/**
|
|
887
|
-
* Update name
|
|
888
|
-
*
|
|
889
753
|
* Update currently logged in user account name.
|
|
890
754
|
*
|
|
891
755
|
* @param {string} name
|
|
892
756
|
* @throws {AppwriteException}
|
|
893
757
|
* @returns {Promise<Models.User<Preferences>>}
|
|
894
758
|
*/
|
|
895
|
-
|
|
759
|
+
updateName<Preferences extends Models.Preferences>(name: string): Promise<Models.User<Preferences>> {
|
|
896
760
|
if (typeof name === 'undefined') {
|
|
897
761
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
898
762
|
}
|
|
@@ -907,10 +771,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
907
771
|
'content-type': 'application/json',
|
|
908
772
|
}
|
|
909
773
|
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
return await this.client.call(
|
|
774
|
+
return this.client.call(
|
|
914
775
|
'patch',
|
|
915
776
|
uri,
|
|
916
777
|
apiHeaders,
|
|
@@ -918,8 +779,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
918
779
|
);
|
|
919
780
|
}
|
|
920
781
|
/**
|
|
921
|
-
* Update password
|
|
922
|
-
*
|
|
923
782
|
* Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional.
|
|
924
783
|
*
|
|
925
784
|
* @param {string} password
|
|
@@ -927,7 +786,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
927
786
|
* @throws {AppwriteException}
|
|
928
787
|
* @returns {Promise<Models.User<Preferences>>}
|
|
929
788
|
*/
|
|
930
|
-
|
|
789
|
+
updatePassword<Preferences extends Models.Preferences>(password: string, oldPassword?: string): Promise<Models.User<Preferences>> {
|
|
931
790
|
if (typeof password === 'undefined') {
|
|
932
791
|
throw new AppwriteException('Missing required parameter: "password"');
|
|
933
792
|
}
|
|
@@ -945,10 +804,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
945
804
|
'content-type': 'application/json',
|
|
946
805
|
}
|
|
947
806
|
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
return await this.client.call(
|
|
807
|
+
return this.client.call(
|
|
952
808
|
'patch',
|
|
953
809
|
uri,
|
|
954
810
|
apiHeaders,
|
|
@@ -956,15 +812,13 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
956
812
|
);
|
|
957
813
|
}
|
|
958
814
|
/**
|
|
959
|
-
* List payment methods
|
|
960
|
-
*
|
|
961
815
|
* List payment methods for this account.
|
|
962
816
|
*
|
|
963
817
|
* @param {string[]} queries
|
|
964
818
|
* @throws {AppwriteException}
|
|
965
819
|
* @returns {Promise<Models.PaymentMethodList>}
|
|
966
820
|
*/
|
|
967
|
-
|
|
821
|
+
listPaymentMethods(queries?: string[]): Promise<Models.PaymentMethodList> {
|
|
968
822
|
const apiPath = '/account/payment-methods';
|
|
969
823
|
const payload: Payload = {};
|
|
970
824
|
if (typeof queries !== 'undefined') {
|
|
@@ -973,13 +827,9 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
973
827
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
974
828
|
|
|
975
829
|
const apiHeaders: { [header: string]: string } = {
|
|
976
|
-
'content-type': 'application/json',
|
|
977
830
|
}
|
|
978
831
|
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
return await this.client.call(
|
|
832
|
+
return this.client.call(
|
|
983
833
|
'get',
|
|
984
834
|
uri,
|
|
985
835
|
apiHeaders,
|
|
@@ -987,14 +837,12 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
987
837
|
);
|
|
988
838
|
}
|
|
989
839
|
/**
|
|
990
|
-
* Create new payment method
|
|
991
|
-
*
|
|
992
840
|
* Create a new payment method for the current user account.
|
|
993
841
|
*
|
|
994
842
|
* @throws {AppwriteException}
|
|
995
843
|
* @returns {Promise<Models.PaymentMethod>}
|
|
996
844
|
*/
|
|
997
|
-
|
|
845
|
+
createPaymentMethod(): Promise<Models.PaymentMethod> {
|
|
998
846
|
const apiPath = '/account/payment-methods';
|
|
999
847
|
const payload: Payload = {};
|
|
1000
848
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -1003,10 +851,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1003
851
|
'content-type': 'application/json',
|
|
1004
852
|
}
|
|
1005
853
|
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
return await this.client.call(
|
|
854
|
+
return this.client.call(
|
|
1010
855
|
'post',
|
|
1011
856
|
uri,
|
|
1012
857
|
apiHeaders,
|
|
@@ -1014,15 +859,13 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1014
859
|
);
|
|
1015
860
|
}
|
|
1016
861
|
/**
|
|
1017
|
-
* Get payment method
|
|
1018
|
-
*
|
|
1019
862
|
* Get a specific payment method for the user.
|
|
1020
863
|
*
|
|
1021
864
|
* @param {string} paymentMethodId
|
|
1022
865
|
* @throws {AppwriteException}
|
|
1023
866
|
* @returns {Promise<Models.PaymentMethod>}
|
|
1024
867
|
*/
|
|
1025
|
-
|
|
868
|
+
getPaymentMethod(paymentMethodId: string): Promise<Models.PaymentMethod> {
|
|
1026
869
|
if (typeof paymentMethodId === 'undefined') {
|
|
1027
870
|
throw new AppwriteException('Missing required parameter: "paymentMethodId"');
|
|
1028
871
|
}
|
|
@@ -1031,13 +874,9 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1031
874
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1032
875
|
|
|
1033
876
|
const apiHeaders: { [header: string]: string } = {
|
|
1034
|
-
'content-type': 'application/json',
|
|
1035
877
|
}
|
|
1036
878
|
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
return await this.client.call(
|
|
879
|
+
return this.client.call(
|
|
1041
880
|
'get',
|
|
1042
881
|
uri,
|
|
1043
882
|
apiHeaders,
|
|
@@ -1045,8 +884,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1045
884
|
);
|
|
1046
885
|
}
|
|
1047
886
|
/**
|
|
1048
|
-
* Update payment method
|
|
1049
|
-
*
|
|
1050
887
|
* Update a new payment method for the current user account.
|
|
1051
888
|
*
|
|
1052
889
|
* @param {string} paymentMethodId
|
|
@@ -1055,7 +892,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1055
892
|
* @throws {AppwriteException}
|
|
1056
893
|
* @returns {Promise<Models.PaymentMethod>}
|
|
1057
894
|
*/
|
|
1058
|
-
|
|
895
|
+
updatePaymentMethod(paymentMethodId: string, expiryMonth: number, expiryYear: number): Promise<Models.PaymentMethod> {
|
|
1059
896
|
if (typeof paymentMethodId === 'undefined') {
|
|
1060
897
|
throw new AppwriteException('Missing required parameter: "paymentMethodId"');
|
|
1061
898
|
}
|
|
@@ -1079,10 +916,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1079
916
|
'content-type': 'application/json',
|
|
1080
917
|
}
|
|
1081
918
|
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
return await this.client.call(
|
|
919
|
+
return this.client.call(
|
|
1086
920
|
'patch',
|
|
1087
921
|
uri,
|
|
1088
922
|
apiHeaders,
|
|
@@ -1090,15 +924,13 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1090
924
|
);
|
|
1091
925
|
}
|
|
1092
926
|
/**
|
|
1093
|
-
* Delete payment method
|
|
1094
|
-
*
|
|
1095
927
|
* Delete a specific payment method from a user's account.
|
|
1096
928
|
*
|
|
1097
929
|
* @param {string} paymentMethodId
|
|
1098
930
|
* @throws {AppwriteException}
|
|
1099
931
|
* @returns {Promise<{}>}
|
|
1100
932
|
*/
|
|
1101
|
-
|
|
933
|
+
deletePaymentMethod(paymentMethodId: string): Promise<{}> {
|
|
1102
934
|
if (typeof paymentMethodId === 'undefined') {
|
|
1103
935
|
throw new AppwriteException('Missing required parameter: "paymentMethodId"');
|
|
1104
936
|
}
|
|
@@ -1110,10 +942,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1110
942
|
'content-type': 'application/json',
|
|
1111
943
|
}
|
|
1112
944
|
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
return await this.client.call(
|
|
945
|
+
return this.client.call(
|
|
1117
946
|
'delete',
|
|
1118
947
|
uri,
|
|
1119
948
|
apiHeaders,
|
|
@@ -1121,8 +950,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1121
950
|
);
|
|
1122
951
|
}
|
|
1123
952
|
/**
|
|
1124
|
-
* Update payment method provider id
|
|
1125
|
-
*
|
|
1126
953
|
* Update payment method provider.
|
|
1127
954
|
*
|
|
1128
955
|
* @param {string} paymentMethodId
|
|
@@ -1131,7 +958,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1131
958
|
* @throws {AppwriteException}
|
|
1132
959
|
* @returns {Promise<Models.PaymentMethod>}
|
|
1133
960
|
*/
|
|
1134
|
-
|
|
961
|
+
updatePaymentMethodProvider(paymentMethodId: string, providerMethodId: string, name: string): Promise<Models.PaymentMethod> {
|
|
1135
962
|
if (typeof paymentMethodId === 'undefined') {
|
|
1136
963
|
throw new AppwriteException('Missing required parameter: "paymentMethodId"');
|
|
1137
964
|
}
|
|
@@ -1155,10 +982,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1155
982
|
'content-type': 'application/json',
|
|
1156
983
|
}
|
|
1157
984
|
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
return await this.client.call(
|
|
985
|
+
return this.client.call(
|
|
1162
986
|
'patch',
|
|
1163
987
|
uri,
|
|
1164
988
|
apiHeaders,
|
|
@@ -1166,15 +990,13 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1166
990
|
);
|
|
1167
991
|
}
|
|
1168
992
|
/**
|
|
1169
|
-
* Update payment method with new setup with mandates for indian cards
|
|
1170
|
-
*
|
|
1171
993
|
* Update payment method mandate options.
|
|
1172
994
|
*
|
|
1173
995
|
* @param {string} paymentMethodId
|
|
1174
996
|
* @throws {AppwriteException}
|
|
1175
997
|
* @returns {Promise<Models.PaymentMethod>}
|
|
1176
998
|
*/
|
|
1177
|
-
|
|
999
|
+
updatePaymentMethodMandateOptions(paymentMethodId: string): Promise<Models.PaymentMethod> {
|
|
1178
1000
|
if (typeof paymentMethodId === 'undefined') {
|
|
1179
1001
|
throw new AppwriteException('Missing required parameter: "paymentMethodId"');
|
|
1180
1002
|
}
|
|
@@ -1186,10 +1008,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1186
1008
|
'content-type': 'application/json',
|
|
1187
1009
|
}
|
|
1188
1010
|
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
return await this.client.call(
|
|
1011
|
+
return this.client.call(
|
|
1193
1012
|
'patch',
|
|
1194
1013
|
uri,
|
|
1195
1014
|
apiHeaders,
|
|
@@ -1197,8 +1016,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1197
1016
|
);
|
|
1198
1017
|
}
|
|
1199
1018
|
/**
|
|
1200
|
-
* Update phone
|
|
1201
|
-
*
|
|
1202
1019
|
* Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification) endpoint to send a confirmation SMS.
|
|
1203
1020
|
*
|
|
1204
1021
|
* @param {string} phone
|
|
@@ -1206,7 +1023,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1206
1023
|
* @throws {AppwriteException}
|
|
1207
1024
|
* @returns {Promise<Models.User<Preferences>>}
|
|
1208
1025
|
*/
|
|
1209
|
-
|
|
1026
|
+
updatePhone<Preferences extends Models.Preferences>(phone: string, password: string): Promise<Models.User<Preferences>> {
|
|
1210
1027
|
if (typeof phone === 'undefined') {
|
|
1211
1028
|
throw new AppwriteException('Missing required parameter: "phone"');
|
|
1212
1029
|
}
|
|
@@ -1227,10 +1044,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1227
1044
|
'content-type': 'application/json',
|
|
1228
1045
|
}
|
|
1229
1046
|
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
return await this.client.call(
|
|
1047
|
+
return this.client.call(
|
|
1234
1048
|
'patch',
|
|
1235
1049
|
uri,
|
|
1236
1050
|
apiHeaders,
|
|
@@ -1238,26 +1052,20 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1238
1052
|
);
|
|
1239
1053
|
}
|
|
1240
1054
|
/**
|
|
1241
|
-
* Get account preferences
|
|
1242
|
-
*
|
|
1243
1055
|
* Get the preferences as a key-value object for the currently logged in user.
|
|
1244
1056
|
*
|
|
1245
1057
|
* @throws {AppwriteException}
|
|
1246
1058
|
* @returns {Promise<Preferences>}
|
|
1247
1059
|
*/
|
|
1248
|
-
|
|
1060
|
+
getPrefs<Preferences extends Models.Preferences>(): Promise<Preferences> {
|
|
1249
1061
|
const apiPath = '/account/prefs';
|
|
1250
1062
|
const payload: Payload = {};
|
|
1251
1063
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1252
1064
|
|
|
1253
1065
|
const apiHeaders: { [header: string]: string } = {
|
|
1254
|
-
'content-type': 'application/json',
|
|
1255
1066
|
}
|
|
1256
1067
|
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
return await this.client.call(
|
|
1068
|
+
return this.client.call(
|
|
1261
1069
|
'get',
|
|
1262
1070
|
uri,
|
|
1263
1071
|
apiHeaders,
|
|
@@ -1265,15 +1073,13 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1265
1073
|
);
|
|
1266
1074
|
}
|
|
1267
1075
|
/**
|
|
1268
|
-
* Update preferences
|
|
1269
|
-
*
|
|
1270
1076
|
* Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.
|
|
1271
1077
|
*
|
|
1272
1078
|
* @param {Partial<Preferences>} prefs
|
|
1273
1079
|
* @throws {AppwriteException}
|
|
1274
1080
|
* @returns {Promise<Models.User<Preferences>>}
|
|
1275
1081
|
*/
|
|
1276
|
-
|
|
1082
|
+
updatePrefs<Preferences extends Models.Preferences>(prefs: Partial<Preferences>): Promise<Models.User<Preferences>> {
|
|
1277
1083
|
if (typeof prefs === 'undefined') {
|
|
1278
1084
|
throw new AppwriteException('Missing required parameter: "prefs"');
|
|
1279
1085
|
}
|
|
@@ -1288,10 +1094,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1288
1094
|
'content-type': 'application/json',
|
|
1289
1095
|
}
|
|
1290
1096
|
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
return await this.client.call(
|
|
1097
|
+
return this.client.call(
|
|
1295
1098
|
'patch',
|
|
1296
1099
|
uri,
|
|
1297
1100
|
apiHeaders,
|
|
@@ -1299,8 +1102,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1299
1102
|
);
|
|
1300
1103
|
}
|
|
1301
1104
|
/**
|
|
1302
|
-
* Create password recovery
|
|
1303
|
-
*
|
|
1304
1105
|
* Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour.
|
|
1305
1106
|
*
|
|
1306
1107
|
* @param {string} email
|
|
@@ -1308,7 +1109,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1308
1109
|
* @throws {AppwriteException}
|
|
1309
1110
|
* @returns {Promise<Models.Token>}
|
|
1310
1111
|
*/
|
|
1311
|
-
|
|
1112
|
+
createRecovery(email: string, url: string): Promise<Models.Token> {
|
|
1312
1113
|
if (typeof email === 'undefined') {
|
|
1313
1114
|
throw new AppwriteException('Missing required parameter: "email"');
|
|
1314
1115
|
}
|
|
@@ -1329,10 +1130,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1329
1130
|
'content-type': 'application/json',
|
|
1330
1131
|
}
|
|
1331
1132
|
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
return await this.client.call(
|
|
1133
|
+
return this.client.call(
|
|
1336
1134
|
'post',
|
|
1337
1135
|
uri,
|
|
1338
1136
|
apiHeaders,
|
|
@@ -1340,8 +1138,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
|
|
|
1340
1138
|
);
|
|
1341
1139
|
}
|
|
1342
1140
|
/**
|
|
1343
|
-
* Create password recovery (confirmation)
|
|
1344
|
-
*
|
|
1345
1141
|
* Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#createRecovery) endpoint.
|
|
1346
1142
|
|
|
1347
1143
|
Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.
|
|
@@ -1352,7 +1148,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
1352
1148
|
* @throws {AppwriteException}
|
|
1353
1149
|
* @returns {Promise<Models.Token>}
|
|
1354
1150
|
*/
|
|
1355
|
-
|
|
1151
|
+
updateRecovery(userId: string, secret: string, password: string): Promise<Models.Token> {
|
|
1356
1152
|
if (typeof userId === 'undefined') {
|
|
1357
1153
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1358
1154
|
}
|
|
@@ -1379,10 +1175,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
1379
1175
|
'content-type': 'application/json',
|
|
1380
1176
|
}
|
|
1381
1177
|
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
return await this.client.call(
|
|
1178
|
+
return this.client.call(
|
|
1386
1179
|
'put',
|
|
1387
1180
|
uri,
|
|
1388
1181
|
apiHeaders,
|
|
@@ -1390,26 +1183,20 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
1390
1183
|
);
|
|
1391
1184
|
}
|
|
1392
1185
|
/**
|
|
1393
|
-
* List sessions
|
|
1394
|
-
*
|
|
1395
1186
|
* Get the list of active sessions across different devices for the currently logged in user.
|
|
1396
1187
|
*
|
|
1397
1188
|
* @throws {AppwriteException}
|
|
1398
1189
|
* @returns {Promise<Models.SessionList>}
|
|
1399
1190
|
*/
|
|
1400
|
-
|
|
1191
|
+
listSessions(): Promise<Models.SessionList> {
|
|
1401
1192
|
const apiPath = '/account/sessions';
|
|
1402
1193
|
const payload: Payload = {};
|
|
1403
1194
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1404
1195
|
|
|
1405
1196
|
const apiHeaders: { [header: string]: string } = {
|
|
1406
|
-
'content-type': 'application/json',
|
|
1407
1197
|
}
|
|
1408
1198
|
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
return await this.client.call(
|
|
1199
|
+
return this.client.call(
|
|
1413
1200
|
'get',
|
|
1414
1201
|
uri,
|
|
1415
1202
|
apiHeaders,
|
|
@@ -1417,14 +1204,12 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
1417
1204
|
);
|
|
1418
1205
|
}
|
|
1419
1206
|
/**
|
|
1420
|
-
* Delete sessions
|
|
1421
|
-
*
|
|
1422
1207
|
* Delete all sessions from the user account and remove any sessions cookies from the end client.
|
|
1423
1208
|
*
|
|
1424
1209
|
* @throws {AppwriteException}
|
|
1425
1210
|
* @returns {Promise<{}>}
|
|
1426
1211
|
*/
|
|
1427
|
-
|
|
1212
|
+
deleteSessions(): Promise<{}> {
|
|
1428
1213
|
const apiPath = '/account/sessions';
|
|
1429
1214
|
const payload: Payload = {};
|
|
1430
1215
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -1433,10 +1218,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
1433
1218
|
'content-type': 'application/json',
|
|
1434
1219
|
}
|
|
1435
1220
|
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
return await this.client.call(
|
|
1221
|
+
return this.client.call(
|
|
1440
1222
|
'delete',
|
|
1441
1223
|
uri,
|
|
1442
1224
|
apiHeaders,
|
|
@@ -1444,14 +1226,12 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
1444
1226
|
);
|
|
1445
1227
|
}
|
|
1446
1228
|
/**
|
|
1447
|
-
* Create anonymous session
|
|
1448
|
-
*
|
|
1449
1229
|
* Use this endpoint to allow a new user to register an anonymous account in your project. This route will also create a new session for the user. To allow the new user to convert an anonymous account to a normal account, you need to update its [email and password](https://appwrite.io/docs/references/cloud/client-web/account#updateEmail) or create an [OAuth2 session](https://appwrite.io/docs/references/cloud/client-web/account#CreateOAuth2Session).
|
|
1450
1230
|
*
|
|
1451
1231
|
* @throws {AppwriteException}
|
|
1452
1232
|
* @returns {Promise<Models.Session>}
|
|
1453
1233
|
*/
|
|
1454
|
-
|
|
1234
|
+
createAnonymousSession(): Promise<Models.Session> {
|
|
1455
1235
|
const apiPath = '/account/sessions/anonymous';
|
|
1456
1236
|
const payload: Payload = {};
|
|
1457
1237
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -1460,10 +1240,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
1460
1240
|
'content-type': 'application/json',
|
|
1461
1241
|
}
|
|
1462
1242
|
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
return await this.client.call(
|
|
1243
|
+
return this.client.call(
|
|
1467
1244
|
'post',
|
|
1468
1245
|
uri,
|
|
1469
1246
|
apiHeaders,
|
|
@@ -1471,8 +1248,6 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
1471
1248
|
);
|
|
1472
1249
|
}
|
|
1473
1250
|
/**
|
|
1474
|
-
* Create email password session
|
|
1475
|
-
*
|
|
1476
1251
|
* Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.
|
|
1477
1252
|
|
|
1478
1253
|
A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
|
|
@@ -1482,7 +1257,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1482
1257
|
* @throws {AppwriteException}
|
|
1483
1258
|
* @returns {Promise<Models.Session>}
|
|
1484
1259
|
*/
|
|
1485
|
-
|
|
1260
|
+
createEmailPasswordSession(email: string, password: string): Promise<Models.Session> {
|
|
1486
1261
|
if (typeof email === 'undefined') {
|
|
1487
1262
|
throw new AppwriteException('Missing required parameter: "email"');
|
|
1488
1263
|
}
|
|
@@ -1503,10 +1278,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1503
1278
|
'content-type': 'application/json',
|
|
1504
1279
|
}
|
|
1505
1280
|
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
return await this.client.call(
|
|
1281
|
+
return this.client.call(
|
|
1510
1282
|
'post',
|
|
1511
1283
|
uri,
|
|
1512
1284
|
apiHeaders,
|
|
@@ -1514,8 +1286,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1514
1286
|
);
|
|
1515
1287
|
}
|
|
1516
1288
|
/**
|
|
1517
|
-
* Update magic URL session
|
|
1518
|
-
*
|
|
1519
1289
|
* Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.
|
|
1520
1290
|
*
|
|
1521
1291
|
* @param {string} userId
|
|
@@ -1523,7 +1293,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1523
1293
|
* @throws {AppwriteException}
|
|
1524
1294
|
* @returns {Promise<Models.Session>}
|
|
1525
1295
|
*/
|
|
1526
|
-
|
|
1296
|
+
updateMagicURLSession(userId: string, secret: string): Promise<Models.Session> {
|
|
1527
1297
|
if (typeof userId === 'undefined') {
|
|
1528
1298
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1529
1299
|
}
|
|
@@ -1544,10 +1314,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1544
1314
|
'content-type': 'application/json',
|
|
1545
1315
|
}
|
|
1546
1316
|
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
return await this.client.call(
|
|
1317
|
+
return this.client.call(
|
|
1551
1318
|
'put',
|
|
1552
1319
|
uri,
|
|
1553
1320
|
apiHeaders,
|
|
@@ -1555,8 +1322,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1555
1322
|
);
|
|
1556
1323
|
}
|
|
1557
1324
|
/**
|
|
1558
|
-
* Create OAuth2 session
|
|
1559
|
-
*
|
|
1560
1325
|
* Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.
|
|
1561
1326
|
|
|
1562
1327
|
If there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.
|
|
@@ -1569,9 +1334,9 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1569
1334
|
* @param {string} failure
|
|
1570
1335
|
* @param {string[]} scopes
|
|
1571
1336
|
* @throws {AppwriteException}
|
|
1572
|
-
* @returns {
|
|
1337
|
+
* @returns {void | string}
|
|
1573
1338
|
*/
|
|
1574
|
-
|
|
1339
|
+
createOAuth2Session(provider: OAuthProvider, success?: string, failure?: string, scopes?: string[]): void | string {
|
|
1575
1340
|
if (typeof provider === 'undefined') {
|
|
1576
1341
|
throw new AppwriteException('Missing required parameter: "provider"');
|
|
1577
1342
|
}
|
|
@@ -1589,7 +1354,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1589
1354
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1590
1355
|
|
|
1591
1356
|
const apiHeaders: { [header: string]: string } = {
|
|
1592
|
-
'content-type': 'application/json',
|
|
1593
1357
|
}
|
|
1594
1358
|
|
|
1595
1359
|
payload['project'] = this.client.config.project;
|
|
@@ -1597,7 +1361,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1597
1361
|
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
1598
1362
|
uri.searchParams.append(key, value);
|
|
1599
1363
|
}
|
|
1600
|
-
|
|
1364
|
+
|
|
1601
1365
|
if (typeof window !== 'undefined' && window?.location) {
|
|
1602
1366
|
window.location.href = uri.toString();
|
|
1603
1367
|
return;
|
|
@@ -1606,8 +1370,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1606
1370
|
}
|
|
1607
1371
|
}
|
|
1608
1372
|
/**
|
|
1609
|
-
* Update phone session
|
|
1610
|
-
*
|
|
1611
1373
|
* Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.
|
|
1612
1374
|
*
|
|
1613
1375
|
* @param {string} userId
|
|
@@ -1615,7 +1377,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1615
1377
|
* @throws {AppwriteException}
|
|
1616
1378
|
* @returns {Promise<Models.Session>}
|
|
1617
1379
|
*/
|
|
1618
|
-
|
|
1380
|
+
updatePhoneSession(userId: string, secret: string): Promise<Models.Session> {
|
|
1619
1381
|
if (typeof userId === 'undefined') {
|
|
1620
1382
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1621
1383
|
}
|
|
@@ -1636,10 +1398,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1636
1398
|
'content-type': 'application/json',
|
|
1637
1399
|
}
|
|
1638
1400
|
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
return await this.client.call(
|
|
1401
|
+
return this.client.call(
|
|
1643
1402
|
'put',
|
|
1644
1403
|
uri,
|
|
1645
1404
|
apiHeaders,
|
|
@@ -1647,8 +1406,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1647
1406
|
);
|
|
1648
1407
|
}
|
|
1649
1408
|
/**
|
|
1650
|
-
* Create session
|
|
1651
|
-
*
|
|
1652
1409
|
* Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.
|
|
1653
1410
|
*
|
|
1654
1411
|
* @param {string} userId
|
|
@@ -1656,7 +1413,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1656
1413
|
* @throws {AppwriteException}
|
|
1657
1414
|
* @returns {Promise<Models.Session>}
|
|
1658
1415
|
*/
|
|
1659
|
-
|
|
1416
|
+
createSession(userId: string, secret: string): Promise<Models.Session> {
|
|
1660
1417
|
if (typeof userId === 'undefined') {
|
|
1661
1418
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1662
1419
|
}
|
|
@@ -1677,10 +1434,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1677
1434
|
'content-type': 'application/json',
|
|
1678
1435
|
}
|
|
1679
1436
|
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
return await this.client.call(
|
|
1437
|
+
return this.client.call(
|
|
1684
1438
|
'post',
|
|
1685
1439
|
uri,
|
|
1686
1440
|
apiHeaders,
|
|
@@ -1688,15 +1442,13 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1688
1442
|
);
|
|
1689
1443
|
}
|
|
1690
1444
|
/**
|
|
1691
|
-
* Get session
|
|
1692
|
-
*
|
|
1693
1445
|
* Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.
|
|
1694
1446
|
*
|
|
1695
1447
|
* @param {string} sessionId
|
|
1696
1448
|
* @throws {AppwriteException}
|
|
1697
1449
|
* @returns {Promise<Models.Session>}
|
|
1698
1450
|
*/
|
|
1699
|
-
|
|
1451
|
+
getSession(sessionId: string): Promise<Models.Session> {
|
|
1700
1452
|
if (typeof sessionId === 'undefined') {
|
|
1701
1453
|
throw new AppwriteException('Missing required parameter: "sessionId"');
|
|
1702
1454
|
}
|
|
@@ -1705,13 +1457,9 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1705
1457
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1706
1458
|
|
|
1707
1459
|
const apiHeaders: { [header: string]: string } = {
|
|
1708
|
-
'content-type': 'application/json',
|
|
1709
1460
|
}
|
|
1710
1461
|
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
return await this.client.call(
|
|
1462
|
+
return this.client.call(
|
|
1715
1463
|
'get',
|
|
1716
1464
|
uri,
|
|
1717
1465
|
apiHeaders,
|
|
@@ -1719,15 +1467,13 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1719
1467
|
);
|
|
1720
1468
|
}
|
|
1721
1469
|
/**
|
|
1722
|
-
* Update session
|
|
1723
|
-
*
|
|
1724
1470
|
* Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider.
|
|
1725
1471
|
*
|
|
1726
1472
|
* @param {string} sessionId
|
|
1727
1473
|
* @throws {AppwriteException}
|
|
1728
1474
|
* @returns {Promise<Models.Session>}
|
|
1729
1475
|
*/
|
|
1730
|
-
|
|
1476
|
+
updateSession(sessionId: string): Promise<Models.Session> {
|
|
1731
1477
|
if (typeof sessionId === 'undefined') {
|
|
1732
1478
|
throw new AppwriteException('Missing required parameter: "sessionId"');
|
|
1733
1479
|
}
|
|
@@ -1739,10 +1485,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1739
1485
|
'content-type': 'application/json',
|
|
1740
1486
|
}
|
|
1741
1487
|
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
return await this.client.call(
|
|
1488
|
+
return this.client.call(
|
|
1746
1489
|
'patch',
|
|
1747
1490
|
uri,
|
|
1748
1491
|
apiHeaders,
|
|
@@ -1750,15 +1493,13 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1750
1493
|
);
|
|
1751
1494
|
}
|
|
1752
1495
|
/**
|
|
1753
|
-
* Delete session
|
|
1754
|
-
*
|
|
1755
1496
|
* Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https://appwrite.io/docs/references/cloud/client-web/account#deleteSessions) instead.
|
|
1756
1497
|
*
|
|
1757
1498
|
* @param {string} sessionId
|
|
1758
1499
|
* @throws {AppwriteException}
|
|
1759
1500
|
* @returns {Promise<{}>}
|
|
1760
1501
|
*/
|
|
1761
|
-
|
|
1502
|
+
deleteSession(sessionId: string): Promise<{}> {
|
|
1762
1503
|
if (typeof sessionId === 'undefined') {
|
|
1763
1504
|
throw new AppwriteException('Missing required parameter: "sessionId"');
|
|
1764
1505
|
}
|
|
@@ -1770,10 +1511,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1770
1511
|
'content-type': 'application/json',
|
|
1771
1512
|
}
|
|
1772
1513
|
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
return await this.client.call(
|
|
1514
|
+
return this.client.call(
|
|
1777
1515
|
'delete',
|
|
1778
1516
|
uri,
|
|
1779
1517
|
apiHeaders,
|
|
@@ -1781,14 +1519,12 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1781
1519
|
);
|
|
1782
1520
|
}
|
|
1783
1521
|
/**
|
|
1784
|
-
* Update status
|
|
1785
|
-
*
|
|
1786
1522
|
* Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.
|
|
1787
1523
|
*
|
|
1788
1524
|
* @throws {AppwriteException}
|
|
1789
1525
|
* @returns {Promise<Models.User<Preferences>>}
|
|
1790
1526
|
*/
|
|
1791
|
-
|
|
1527
|
+
updateStatus<Preferences extends Models.Preferences>(): Promise<Models.User<Preferences>> {
|
|
1792
1528
|
const apiPath = '/account/status';
|
|
1793
1529
|
const payload: Payload = {};
|
|
1794
1530
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -1797,10 +1533,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1797
1533
|
'content-type': 'application/json',
|
|
1798
1534
|
}
|
|
1799
1535
|
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
return await this.client.call(
|
|
1536
|
+
return this.client.call(
|
|
1804
1537
|
'patch',
|
|
1805
1538
|
uri,
|
|
1806
1539
|
apiHeaders,
|
|
@@ -1808,8 +1541,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1808
1541
|
);
|
|
1809
1542
|
}
|
|
1810
1543
|
/**
|
|
1811
|
-
* Create push target
|
|
1812
|
-
*
|
|
1813
1544
|
* Use this endpoint to register a device for push notifications. Provide a target ID (custom or generated using ID.unique()), a device identifier (usually a device token), and optionally specify which provider should send notifications to this target. The target is automatically linked to the current session and includes device information like brand and model.
|
|
1814
1545
|
*
|
|
1815
1546
|
* @param {string} targetId
|
|
@@ -1818,7 +1549,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1818
1549
|
* @throws {AppwriteException}
|
|
1819
1550
|
* @returns {Promise<Models.Target>}
|
|
1820
1551
|
*/
|
|
1821
|
-
|
|
1552
|
+
createPushTarget(targetId: string, identifier: string, providerId?: string): Promise<Models.Target> {
|
|
1822
1553
|
if (typeof targetId === 'undefined') {
|
|
1823
1554
|
throw new AppwriteException('Missing required parameter: "targetId"');
|
|
1824
1555
|
}
|
|
@@ -1842,10 +1573,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1842
1573
|
'content-type': 'application/json',
|
|
1843
1574
|
}
|
|
1844
1575
|
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
return await this.client.call(
|
|
1576
|
+
return this.client.call(
|
|
1849
1577
|
'post',
|
|
1850
1578
|
uri,
|
|
1851
1579
|
apiHeaders,
|
|
@@ -1853,8 +1581,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1853
1581
|
);
|
|
1854
1582
|
}
|
|
1855
1583
|
/**
|
|
1856
|
-
* Update push target
|
|
1857
|
-
*
|
|
1858
1584
|
* Update the currently logged in user's push notification target. You can modify the target's identifier (device token) and provider ID (token, email, phone etc.). The target must exist and belong to the current user. If you change the provider ID, notifications will be sent through the new messaging provider instead.
|
|
1859
1585
|
*
|
|
1860
1586
|
* @param {string} targetId
|
|
@@ -1862,7 +1588,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1862
1588
|
* @throws {AppwriteException}
|
|
1863
1589
|
* @returns {Promise<Models.Target>}
|
|
1864
1590
|
*/
|
|
1865
|
-
|
|
1591
|
+
updatePushTarget(targetId: string, identifier: string): Promise<Models.Target> {
|
|
1866
1592
|
if (typeof targetId === 'undefined') {
|
|
1867
1593
|
throw new AppwriteException('Missing required parameter: "targetId"');
|
|
1868
1594
|
}
|
|
@@ -1880,10 +1606,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1880
1606
|
'content-type': 'application/json',
|
|
1881
1607
|
}
|
|
1882
1608
|
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
return await this.client.call(
|
|
1609
|
+
return this.client.call(
|
|
1887
1610
|
'put',
|
|
1888
1611
|
uri,
|
|
1889
1612
|
apiHeaders,
|
|
@@ -1891,15 +1614,13 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1891
1614
|
);
|
|
1892
1615
|
}
|
|
1893
1616
|
/**
|
|
1894
|
-
* Delete push target
|
|
1895
|
-
*
|
|
1896
1617
|
* Delete a push notification target for the currently logged in user. After deletion, the device will no longer receive push notifications. The target must exist and belong to the current user.
|
|
1897
1618
|
*
|
|
1898
1619
|
* @param {string} targetId
|
|
1899
1620
|
* @throws {AppwriteException}
|
|
1900
1621
|
* @returns {Promise<{}>}
|
|
1901
1622
|
*/
|
|
1902
|
-
|
|
1623
|
+
deletePushTarget(targetId: string): Promise<{}> {
|
|
1903
1624
|
if (typeof targetId === 'undefined') {
|
|
1904
1625
|
throw new AppwriteException('Missing required parameter: "targetId"');
|
|
1905
1626
|
}
|
|
@@ -1911,10 +1632,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1911
1632
|
'content-type': 'application/json',
|
|
1912
1633
|
}
|
|
1913
1634
|
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
return await this.client.call(
|
|
1635
|
+
return this.client.call(
|
|
1918
1636
|
'delete',
|
|
1919
1637
|
uri,
|
|
1920
1638
|
apiHeaders,
|
|
@@ -1922,8 +1640,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1922
1640
|
);
|
|
1923
1641
|
}
|
|
1924
1642
|
/**
|
|
1925
|
-
* Create email token (OTP)
|
|
1926
|
-
*
|
|
1927
1643
|
* Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.
|
|
1928
1644
|
|
|
1929
1645
|
A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
|
|
@@ -1934,7 +1650,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1934
1650
|
* @throws {AppwriteException}
|
|
1935
1651
|
* @returns {Promise<Models.Token>}
|
|
1936
1652
|
*/
|
|
1937
|
-
|
|
1653
|
+
createEmailToken(userId: string, email: string, phrase?: boolean): Promise<Models.Token> {
|
|
1938
1654
|
if (typeof userId === 'undefined') {
|
|
1939
1655
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1940
1656
|
}
|
|
@@ -1958,10 +1674,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1958
1674
|
'content-type': 'application/json',
|
|
1959
1675
|
}
|
|
1960
1676
|
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
return await this.client.call(
|
|
1677
|
+
return this.client.call(
|
|
1965
1678
|
'post',
|
|
1966
1679
|
uri,
|
|
1967
1680
|
apiHeaders,
|
|
@@ -1969,8 +1682,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1969
1682
|
);
|
|
1970
1683
|
}
|
|
1971
1684
|
/**
|
|
1972
|
-
* Create magic URL token
|
|
1973
|
-
*
|
|
1974
1685
|
* Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.
|
|
1975
1686
|
|
|
1976
1687
|
A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
|
|
@@ -1983,7 +1694,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
1983
1694
|
* @throws {AppwriteException}
|
|
1984
1695
|
* @returns {Promise<Models.Token>}
|
|
1985
1696
|
*/
|
|
1986
|
-
|
|
1697
|
+
createMagicURLToken(userId: string, email: string, url?: string, phrase?: boolean): Promise<Models.Token> {
|
|
1987
1698
|
if (typeof userId === 'undefined') {
|
|
1988
1699
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1989
1700
|
}
|
|
@@ -2010,10 +1721,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
2010
1721
|
'content-type': 'application/json',
|
|
2011
1722
|
}
|
|
2012
1723
|
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
return await this.client.call(
|
|
1724
|
+
return this.client.call(
|
|
2017
1725
|
'post',
|
|
2018
1726
|
uri,
|
|
2019
1727
|
apiHeaders,
|
|
@@ -2021,8 +1729,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
2021
1729
|
);
|
|
2022
1730
|
}
|
|
2023
1731
|
/**
|
|
2024
|
-
* Create OAuth2 token
|
|
2025
|
-
*
|
|
2026
1732
|
* Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.
|
|
2027
1733
|
|
|
2028
1734
|
If authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint.
|
|
@@ -2034,9 +1740,9 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
2034
1740
|
* @param {string} failure
|
|
2035
1741
|
* @param {string[]} scopes
|
|
2036
1742
|
* @throws {AppwriteException}
|
|
2037
|
-
* @returns {
|
|
1743
|
+
* @returns {void | string}
|
|
2038
1744
|
*/
|
|
2039
|
-
|
|
1745
|
+
createOAuth2Token(provider: OAuthProvider, success?: string, failure?: string, scopes?: string[]): void | string {
|
|
2040
1746
|
if (typeof provider === 'undefined') {
|
|
2041
1747
|
throw new AppwriteException('Missing required parameter: "provider"');
|
|
2042
1748
|
}
|
|
@@ -2054,7 +1760,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
2054
1760
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2055
1761
|
|
|
2056
1762
|
const apiHeaders: { [header: string]: string } = {
|
|
2057
|
-
'content-type': 'application/json',
|
|
2058
1763
|
}
|
|
2059
1764
|
|
|
2060
1765
|
payload['project'] = this.client.config.project;
|
|
@@ -2062,7 +1767,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
2062
1767
|
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
2063
1768
|
uri.searchParams.append(key, value);
|
|
2064
1769
|
}
|
|
2065
|
-
|
|
1770
|
+
|
|
2066
1771
|
if (typeof window !== 'undefined' && window?.location) {
|
|
2067
1772
|
window.location.href = uri.toString();
|
|
2068
1773
|
return;
|
|
@@ -2071,8 +1776,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
2071
1776
|
}
|
|
2072
1777
|
}
|
|
2073
1778
|
/**
|
|
2074
|
-
* Create phone token
|
|
2075
|
-
*
|
|
2076
1779
|
* Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.
|
|
2077
1780
|
|
|
2078
1781
|
A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
|
|
@@ -2082,7 +1785,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
2082
1785
|
* @throws {AppwriteException}
|
|
2083
1786
|
* @returns {Promise<Models.Token>}
|
|
2084
1787
|
*/
|
|
2085
|
-
|
|
1788
|
+
createPhoneToken(userId: string, phone: string): Promise<Models.Token> {
|
|
2086
1789
|
if (typeof userId === 'undefined') {
|
|
2087
1790
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
2088
1791
|
}
|
|
@@ -2103,10 +1806,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
2103
1806
|
'content-type': 'application/json',
|
|
2104
1807
|
}
|
|
2105
1808
|
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
return await this.client.call(
|
|
1809
|
+
return this.client.call(
|
|
2110
1810
|
'post',
|
|
2111
1811
|
uri,
|
|
2112
1812
|
apiHeaders,
|
|
@@ -2114,8 +1814,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
|
|
|
2114
1814
|
);
|
|
2115
1815
|
}
|
|
2116
1816
|
/**
|
|
2117
|
-
* Create email verification
|
|
2118
|
-
*
|
|
2119
1817
|
* Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.
|
|
2120
1818
|
|
|
2121
1819
|
Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.
|
|
@@ -2125,7 +1823,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
2125
1823
|
* @throws {AppwriteException}
|
|
2126
1824
|
* @returns {Promise<Models.Token>}
|
|
2127
1825
|
*/
|
|
2128
|
-
|
|
1826
|
+
createVerification(url: string): Promise<Models.Token> {
|
|
2129
1827
|
if (typeof url === 'undefined') {
|
|
2130
1828
|
throw new AppwriteException('Missing required parameter: "url"');
|
|
2131
1829
|
}
|
|
@@ -2140,10 +1838,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
2140
1838
|
'content-type': 'application/json',
|
|
2141
1839
|
}
|
|
2142
1840
|
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
return await this.client.call(
|
|
1841
|
+
return this.client.call(
|
|
2147
1842
|
'post',
|
|
2148
1843
|
uri,
|
|
2149
1844
|
apiHeaders,
|
|
@@ -2151,8 +1846,6 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
2151
1846
|
);
|
|
2152
1847
|
}
|
|
2153
1848
|
/**
|
|
2154
|
-
* Create email verification (confirmation)
|
|
2155
|
-
*
|
|
2156
1849
|
* Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.
|
|
2157
1850
|
*
|
|
2158
1851
|
* @param {string} userId
|
|
@@ -2160,7 +1853,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
2160
1853
|
* @throws {AppwriteException}
|
|
2161
1854
|
* @returns {Promise<Models.Token>}
|
|
2162
1855
|
*/
|
|
2163
|
-
|
|
1856
|
+
updateVerification(userId: string, secret: string): Promise<Models.Token> {
|
|
2164
1857
|
if (typeof userId === 'undefined') {
|
|
2165
1858
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
2166
1859
|
}
|
|
@@ -2181,10 +1874,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
2181
1874
|
'content-type': 'application/json',
|
|
2182
1875
|
}
|
|
2183
1876
|
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
return await this.client.call(
|
|
1877
|
+
return this.client.call(
|
|
2188
1878
|
'put',
|
|
2189
1879
|
uri,
|
|
2190
1880
|
apiHeaders,
|
|
@@ -2192,14 +1882,12 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
2192
1882
|
);
|
|
2193
1883
|
}
|
|
2194
1884
|
/**
|
|
2195
|
-
* Create phone verification
|
|
2196
|
-
*
|
|
2197
1885
|
* Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes.
|
|
2198
1886
|
*
|
|
2199
1887
|
* @throws {AppwriteException}
|
|
2200
1888
|
* @returns {Promise<Models.Token>}
|
|
2201
1889
|
*/
|
|
2202
|
-
|
|
1890
|
+
createPhoneVerification(): Promise<Models.Token> {
|
|
2203
1891
|
const apiPath = '/account/verification/phone';
|
|
2204
1892
|
const payload: Payload = {};
|
|
2205
1893
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -2208,10 +1896,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
2208
1896
|
'content-type': 'application/json',
|
|
2209
1897
|
}
|
|
2210
1898
|
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
return await this.client.call(
|
|
1899
|
+
return this.client.call(
|
|
2215
1900
|
'post',
|
|
2216
1901
|
uri,
|
|
2217
1902
|
apiHeaders,
|
|
@@ -2219,8 +1904,6 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
2219
1904
|
);
|
|
2220
1905
|
}
|
|
2221
1906
|
/**
|
|
2222
|
-
* Update phone verification (confirmation)
|
|
2223
|
-
*
|
|
2224
1907
|
* Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code.
|
|
2225
1908
|
*
|
|
2226
1909
|
* @param {string} userId
|
|
@@ -2228,7 +1911,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
2228
1911
|
* @throws {AppwriteException}
|
|
2229
1912
|
* @returns {Promise<Models.Token>}
|
|
2230
1913
|
*/
|
|
2231
|
-
|
|
1914
|
+
updatePhoneVerification(userId: string, secret: string): Promise<Models.Token> {
|
|
2232
1915
|
if (typeof userId === 'undefined') {
|
|
2233
1916
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
2234
1917
|
}
|
|
@@ -2249,10 +1932,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|
|
2249
1932
|
'content-type': 'application/json',
|
|
2250
1933
|
}
|
|
2251
1934
|
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
return await this.client.call(
|
|
1935
|
+
return this.client.call(
|
|
2256
1936
|
'put',
|
|
2257
1937
|
uri,
|
|
2258
1938
|
apiHeaders,
|