@appwrite.io/console 1.10.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/publish.yml +9 -8
- package/CHANGELOG.md +6 -0
- package/LICENSE +1 -1
- package/README.md +4 -4
- package/dist/cjs/sdk.js +15239 -6070
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +15237 -6071
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +15239 -6070
- package/docs/examples/account/create-billing-address.md +8 -8
- package/docs/examples/account/create-email-password-session.md +4 -4
- package/docs/examples/account/create-email-token.md +5 -5
- package/docs/examples/account/{update-magic-u-r-l-session.md → create-email-verification.md} +3 -4
- package/docs/examples/account/{update-m-f-a.md → create-jwt.md} +3 -3
- package/docs/examples/account/{create-magic-u-r-l-token.md → create-magic-url-token.md} +6 -6
- package/docs/examples/account/create-mfa-authenticator.md +3 -3
- package/docs/examples/account/create-mfa-challenge.md +3 -3
- package/docs/examples/account/create-mfa-recovery-codes.md +1 -1
- package/docs/examples/account/{create-o-auth2token.md → create-o-auth-2-session.md} +6 -6
- package/docs/examples/account/{create-o-auth2session.md → create-o-auth-2-token.md} +6 -6
- package/docs/examples/account/create-phone-token.md +4 -4
- package/docs/examples/account/create-push-target.md +5 -5
- package/docs/examples/account/create-recovery.md +4 -4
- package/docs/examples/account/create-session.md +4 -4
- package/docs/examples/account/create-verification.md +3 -3
- package/docs/examples/account/create.md +6 -6
- package/docs/examples/account/delete-billing-address.md +3 -3
- package/docs/examples/account/delete-identity.md +3 -3
- package/docs/examples/account/delete-mfa-authenticator.md +3 -3
- package/docs/examples/account/delete-payment-method.md +3 -3
- package/docs/examples/account/delete-push-target.md +3 -3
- package/docs/examples/account/delete-session.md +3 -3
- package/docs/examples/account/get-billing-address.md +3 -3
- package/docs/examples/account/get-coupon.md +3 -3
- package/docs/examples/account/get-mfa-recovery-codes.md +1 -1
- package/docs/examples/account/get-payment-method.md +3 -3
- package/docs/examples/account/get-session.md +3 -3
- package/docs/examples/account/list-billing-addresses.md +3 -3
- package/docs/examples/account/list-identities.md +4 -3
- package/docs/examples/account/list-invoices.md +3 -3
- package/docs/examples/account/list-logs.md +4 -3
- package/docs/examples/account/list-mfa-factors.md +1 -1
- package/docs/examples/account/list-payment-methods.md +3 -3
- package/docs/examples/account/update-billing-address.md +9 -9
- package/docs/examples/account/update-email-verification.md +14 -0
- package/docs/examples/account/update-email.md +4 -4
- package/docs/examples/account/update-magic-url-session.md +14 -0
- package/docs/examples/account/update-mfa-authenticator.md +4 -4
- package/docs/examples/account/update-mfa-challenge.md +4 -4
- package/docs/examples/account/update-mfa-recovery-codes.md +1 -1
- package/docs/examples/account/{create-j-w-t.md → update-mfa.md} +3 -1
- package/docs/examples/account/update-name.md +3 -3
- package/docs/examples/account/update-password.md +4 -4
- package/docs/examples/account/update-payment-method-mandate-options.md +3 -3
- package/docs/examples/account/update-payment-method-provider.md +6 -5
- package/docs/examples/account/update-payment-method.md +6 -5
- package/docs/examples/account/update-phone-session.md +4 -4
- package/docs/examples/account/update-phone-verification.md +4 -4
- package/docs/examples/account/update-phone.md +4 -4
- package/docs/examples/account/update-prefs.md +7 -3
- package/docs/examples/account/update-push-target.md +4 -4
- package/docs/examples/account/update-recovery.md +5 -5
- package/docs/examples/account/update-session.md +3 -3
- package/docs/examples/account/update-verification.md +4 -4
- package/docs/examples/assistant/chat.md +3 -3
- package/docs/examples/avatars/get-browser.md +6 -6
- package/docs/examples/avatars/get-credit-card.md +6 -6
- package/docs/examples/avatars/get-favicon.md +3 -3
- package/docs/examples/avatars/get-flag.md +6 -6
- package/docs/examples/avatars/get-image.md +5 -5
- package/docs/examples/avatars/get-initials.md +6 -6
- package/docs/examples/avatars/{get-q-r.md → get-qr.md} +6 -6
- package/docs/examples/avatars/get-screenshot.md +35 -0
- package/docs/examples/backups/create-archive.md +4 -4
- package/docs/examples/backups/create-policy.md +9 -9
- package/docs/examples/backups/create-restoration.md +6 -6
- package/docs/examples/backups/delete-archive.md +3 -3
- package/docs/examples/backups/delete-policy.md +3 -3
- package/docs/examples/backups/get-archive.md +3 -3
- package/docs/examples/backups/get-policy.md +3 -3
- package/docs/examples/backups/get-restoration.md +3 -3
- package/docs/examples/backups/list-archives.md +3 -3
- package/docs/examples/backups/list-policies.md +3 -3
- package/docs/examples/backups/list-restorations.md +3 -3
- package/docs/examples/backups/update-policy.md +7 -7
- package/docs/examples/console/create-program-membership.md +3 -3
- package/docs/examples/console/create-source.md +7 -7
- package/docs/examples/console/get-campaign.md +3 -3
- package/docs/examples/console/get-coupon.md +3 -3
- package/docs/examples/console/{plans.md → get-plan.md} +3 -1
- package/docs/examples/console/get-plans.md +13 -0
- package/docs/examples/console/{regions.md → get-program.md} +3 -1
- package/docs/examples/console/get-regions.md +13 -0
- package/docs/examples/console/get-resource.md +4 -4
- package/docs/examples/console/suggest-columns.md +17 -0
- package/docs/examples/console/suggest-indexes.md +16 -0
- package/docs/examples/databases/create-boolean-attribute.md +8 -8
- package/docs/examples/databases/create-collection.md +11 -9
- package/docs/examples/databases/create-datetime-attribute.md +8 -8
- package/docs/examples/databases/create-document.md +15 -8
- package/docs/examples/databases/create-documents.md +6 -5
- package/docs/examples/databases/create-email-attribute.md +8 -8
- package/docs/examples/databases/create-enum-attribute.md +9 -9
- package/docs/examples/databases/create-float-attribute.md +10 -10
- package/docs/examples/databases/create-index.md +9 -9
- package/docs/examples/databases/create-integer-attribute.md +10 -10
- package/docs/examples/databases/create-ip-attribute.md +8 -8
- package/docs/examples/databases/create-line-attribute.md +17 -0
- package/docs/examples/databases/create-operations.md +24 -0
- package/docs/examples/databases/create-point-attribute.md +17 -0
- package/docs/examples/databases/create-polygon-attribute.md +17 -0
- package/docs/examples/databases/create-relationship-attribute.md +10 -10
- package/docs/examples/databases/create-string-attribute.md +10 -10
- package/docs/examples/databases/create-transaction.md +13 -0
- package/docs/examples/databases/create-url-attribute.md +8 -8
- package/docs/examples/databases/create.md +5 -5
- package/docs/examples/databases/decrement-document-attribute.md +9 -8
- package/docs/examples/databases/delete-attribute.md +5 -5
- package/docs/examples/databases/delete-collection.md +4 -4
- package/docs/examples/databases/delete-document.md +6 -5
- package/docs/examples/databases/delete-documents.md +6 -5
- package/docs/examples/databases/delete-index.md +5 -5
- package/docs/examples/databases/{get-database-usage.md → delete-transaction.md} +4 -5
- package/docs/examples/databases/delete.md +3 -3
- package/docs/examples/databases/get-attribute.md +5 -5
- package/docs/examples/databases/get-collection-usage.md +6 -6
- package/docs/examples/databases/get-collection.md +4 -4
- package/docs/examples/databases/get-document.md +7 -6
- package/docs/examples/databases/get-index.md +5 -5
- package/docs/examples/databases/get-transaction.md +13 -0
- package/docs/examples/databases/get-usage.md +5 -4
- package/docs/examples/databases/get.md +3 -3
- package/docs/examples/databases/increment-document-attribute.md +9 -8
- package/docs/examples/databases/list-attributes.md +6 -5
- package/docs/examples/databases/list-collection-logs.md +5 -5
- package/docs/examples/databases/list-collections.md +6 -5
- package/docs/examples/databases/list-document-logs.md +6 -6
- package/docs/examples/databases/list-documents.md +7 -5
- package/docs/examples/databases/list-indexes.md +6 -5
- package/docs/examples/databases/list-logs.md +4 -4
- package/docs/examples/databases/list-transactions.md +13 -0
- package/docs/examples/databases/list-usage.md +13 -0
- package/docs/examples/databases/list.md +5 -4
- package/docs/examples/databases/update-boolean-attribute.md +8 -8
- package/docs/examples/databases/update-collection.md +9 -9
- package/docs/examples/databases/update-datetime-attribute.md +8 -8
- package/docs/examples/databases/update-document.md +15 -8
- package/docs/examples/databases/update-documents.md +13 -6
- package/docs/examples/databases/update-email-attribute.md +8 -8
- package/docs/examples/databases/update-enum-attribute.md +9 -9
- package/docs/examples/databases/update-float-attribute.md +10 -10
- package/docs/examples/databases/update-integer-attribute.md +10 -10
- package/docs/examples/databases/update-ip-attribute.md +8 -8
- package/docs/examples/databases/update-line-attribute.md +18 -0
- package/docs/examples/databases/update-point-attribute.md +18 -0
- package/docs/examples/databases/update-polygon-attribute.md +18 -0
- package/docs/examples/databases/update-relationship-attribute.md +7 -7
- package/docs/examples/databases/update-string-attribute.md +9 -9
- package/docs/examples/databases/update-transaction.md +15 -0
- package/docs/examples/databases/update-url-attribute.md +8 -8
- package/docs/examples/databases/update.md +5 -5
- package/docs/examples/databases/upsert-document.md +15 -8
- package/docs/examples/databases/upsert-documents.md +6 -5
- package/docs/examples/domains/create-preset-google-workspace.md +3 -3
- package/docs/examples/domains/create-preset-i-cloud.md +3 -3
- package/docs/examples/domains/create-preset-mailgun.md +3 -3
- package/docs/examples/domains/create-preset-outlook.md +3 -3
- package/docs/examples/domains/create-preset-proton-mail.md +3 -3
- package/docs/examples/domains/create-preset-zoho.md +3 -3
- package/docs/examples/domains/create-record-a.md +7 -7
- package/docs/examples/domains/{create-record-a-a-a-a.md → create-record-aaaa.md} +7 -7
- package/docs/examples/domains/create-record-alias.md +7 -7
- package/docs/examples/domains/{create-record-n-s.md → create-record-caa.md} +7 -7
- package/docs/examples/domains/{create-record-c-a-a.md → create-record-cname.md} +7 -7
- package/docs/examples/domains/{create-record-h-t-t-p-s.md → create-record-https.md} +7 -7
- package/docs/examples/domains/create-record-mx.md +18 -0
- package/docs/examples/domains/create-record-ns.md +17 -0
- package/docs/examples/domains/create-record-srv.md +20 -0
- package/docs/examples/domains/{create-record-c-n-a-m-e.md → create-record-txt.md} +7 -7
- package/docs/examples/domains/create.md +4 -4
- package/docs/examples/domains/delete-record.md +4 -4
- package/docs/examples/domains/delete.md +3 -3
- package/docs/examples/domains/get-preset-google-workspace.md +3 -3
- package/docs/examples/domains/get-preset-i-cloud.md +3 -3
- package/docs/examples/domains/get-preset-mailgun.md +3 -3
- package/docs/examples/domains/get-preset-outlook.md +3 -3
- package/docs/examples/domains/get-preset-proton-mail.md +3 -3
- package/docs/examples/domains/get-preset-zoho.md +3 -3
- package/docs/examples/domains/get-record.md +4 -4
- package/docs/examples/domains/get-zone.md +3 -3
- package/docs/examples/domains/get.md +3 -3
- package/docs/examples/domains/list-records.md +4 -4
- package/docs/examples/domains/list.md +4 -4
- package/docs/examples/domains/update-nameservers.md +3 -3
- package/docs/examples/domains/update-record-a.md +8 -8
- package/docs/examples/domains/update-record-aaaa.md +18 -0
- package/docs/examples/domains/update-record-alias.md +8 -8
- package/docs/examples/domains/update-record-caa.md +18 -0
- package/docs/examples/domains/update-record-cname.md +18 -0
- package/docs/examples/domains/update-record-https.md +18 -0
- package/docs/examples/domains/update-record-mx.md +19 -0
- package/docs/examples/domains/update-record-ns.md +18 -0
- package/docs/examples/domains/update-record-srv.md +21 -0
- package/docs/examples/domains/update-record-txt.md +18 -0
- package/docs/examples/domains/update-team.md +4 -4
- package/docs/examples/domains/update-zone.md +4 -4
- package/docs/examples/functions/create-deployment.md +7 -7
- package/docs/examples/functions/create-duplicate-deployment.md +5 -5
- package/docs/examples/functions/create-execution.md +9 -9
- package/docs/examples/functions/create-template-deployment.md +10 -9
- package/docs/examples/functions/create-variable.md +6 -6
- package/docs/examples/functions/create-vcs-deployment.md +7 -7
- package/docs/examples/functions/create.md +21 -21
- package/docs/examples/functions/delete-deployment.md +4 -4
- package/docs/examples/functions/delete-execution.md +4 -4
- package/docs/examples/functions/delete-variable.md +4 -4
- package/docs/examples/functions/delete.md +3 -3
- package/docs/examples/functions/get-deployment-download.md +5 -5
- package/docs/examples/functions/get-deployment.md +4 -4
- package/docs/examples/functions/get-execution.md +4 -4
- package/docs/examples/functions/get-template.md +3 -3
- package/docs/examples/functions/get-usage.md +5 -5
- package/docs/examples/functions/get-variable.md +4 -4
- package/docs/examples/functions/get.md +3 -3
- package/docs/examples/functions/list-deployments.md +6 -5
- package/docs/examples/functions/list-executions.md +5 -4
- package/docs/examples/functions/list-templates.md +7 -6
- package/docs/examples/functions/list-usage.md +4 -4
- package/docs/examples/functions/list-variables.md +3 -3
- package/docs/examples/functions/list.md +5 -4
- package/docs/examples/functions/update-deployment-status.md +4 -4
- package/docs/examples/functions/update-function-deployment.md +4 -4
- package/docs/examples/functions/update-variable.md +7 -7
- package/docs/examples/functions/update.md +21 -21
- package/docs/examples/graphql/mutation.md +3 -3
- package/docs/examples/graphql/query.md +3 -3
- package/docs/examples/health/get-certificate.md +3 -3
- package/docs/examples/health/get-failed-jobs.md +5 -5
- package/docs/examples/health/get-queue-billing-project-aggregation.md +3 -3
- package/docs/examples/health/get-queue-billing-team-aggregation.md +3 -3
- package/docs/examples/health/get-queue-builds.md +3 -3
- package/docs/examples/health/get-queue-certificates.md +3 -3
- package/docs/examples/health/get-queue-databases.md +4 -4
- package/docs/examples/health/get-queue-deletes.md +3 -3
- package/docs/examples/health/get-queue-functions.md +3 -3
- package/docs/examples/health/get-queue-logs.md +3 -3
- package/docs/examples/health/get-queue-mails.md +3 -3
- package/docs/examples/health/get-queue-messaging.md +3 -3
- package/docs/examples/health/get-queue-migrations.md +3 -3
- package/docs/examples/health/get-queue-priority-builds.md +3 -3
- package/docs/examples/health/get-queue-region-manager.md +3 -3
- package/docs/examples/health/get-queue-stats-resources.md +3 -3
- package/docs/examples/health/get-queue-threats.md +13 -0
- package/docs/examples/health/get-queue-usage.md +3 -3
- package/docs/examples/health/get-queue-webhooks.md +3 -3
- package/docs/examples/messaging/create-apns-provider.md +10 -10
- package/docs/examples/messaging/create-email.md +14 -14
- package/docs/examples/messaging/create-fcm-provider.md +6 -6
- package/docs/examples/messaging/create-mailgun-provider.md +12 -12
- package/docs/examples/messaging/{create-msg91provider.md → create-msg-91-provider.md} +8 -8
- package/docs/examples/messaging/create-push.md +21 -21
- package/docs/examples/messaging/create-resend-provider.md +20 -0
- package/docs/examples/messaging/create-sendgrid-provider.md +10 -10
- package/docs/examples/messaging/create-sms.md +9 -9
- package/docs/examples/messaging/create-smtp-provider.md +16 -16
- package/docs/examples/messaging/create-subscriber.md +5 -5
- package/docs/examples/messaging/create-telesign-provider.md +8 -8
- package/docs/examples/messaging/create-textmagic-provider.md +8 -8
- package/docs/examples/messaging/create-topic.md +5 -5
- package/docs/examples/messaging/create-twilio-provider.md +8 -8
- package/docs/examples/messaging/create-vonage-provider.md +8 -8
- package/docs/examples/messaging/delete-provider.md +3 -3
- package/docs/examples/messaging/delete-subscriber.md +4 -4
- package/docs/examples/messaging/delete-topic.md +3 -3
- package/docs/examples/messaging/delete.md +3 -3
- package/docs/examples/messaging/get-message.md +3 -3
- package/docs/examples/messaging/get-provider.md +3 -3
- package/docs/examples/messaging/get-subscriber.md +4 -4
- package/docs/examples/messaging/get-topic.md +3 -3
- package/docs/examples/messaging/list-message-logs.md +5 -4
- package/docs/examples/messaging/list-messages.md +5 -4
- package/docs/examples/messaging/list-provider-logs.md +5 -4
- package/docs/examples/messaging/list-providers.md +5 -4
- package/docs/examples/messaging/list-subscriber-logs.md +5 -4
- package/docs/examples/messaging/list-subscribers.md +6 -5
- package/docs/examples/messaging/list-targets.md +5 -4
- package/docs/examples/messaging/list-topic-logs.md +5 -4
- package/docs/examples/messaging/list-topics.md +5 -4
- package/docs/examples/messaging/update-apns-provider.md +10 -10
- package/docs/examples/messaging/update-email.md +14 -14
- package/docs/examples/messaging/update-fcm-provider.md +6 -6
- package/docs/examples/messaging/update-mailgun-provider.md +12 -12
- package/docs/examples/messaging/{update-msg91provider.md → update-msg-91-provider.md} +8 -8
- package/docs/examples/messaging/update-push.md +21 -21
- package/docs/examples/messaging/update-resend-provider.md +20 -0
- package/docs/examples/messaging/update-sendgrid-provider.md +10 -10
- package/docs/examples/messaging/update-sms.md +9 -9
- package/docs/examples/messaging/update-smtp-provider.md +16 -16
- package/docs/examples/messaging/update-telesign-provider.md +8 -8
- package/docs/examples/messaging/update-textmagic-provider.md +8 -8
- package/docs/examples/messaging/update-topic.md +5 -5
- package/docs/examples/messaging/update-twilio-provider.md +8 -8
- package/docs/examples/messaging/update-vonage-provider.md +8 -8
- package/docs/examples/migrations/create-appwrite-migration.md +6 -6
- package/docs/examples/migrations/create-csv-export.md +21 -0
- package/docs/examples/migrations/{create-csv-migration.md → create-csv-import.md} +6 -5
- package/docs/examples/migrations/create-firebase-migration.md +4 -4
- package/docs/examples/migrations/create-n-host-migration.md +10 -10
- package/docs/examples/migrations/create-supabase-migration.md +9 -9
- package/docs/examples/migrations/delete.md +3 -3
- package/docs/examples/migrations/get-appwrite-report.md +6 -6
- package/docs/examples/migrations/get-firebase-report.md +4 -4
- package/docs/examples/migrations/get-n-host-report.md +10 -10
- package/docs/examples/migrations/get-supabase-report.md +9 -9
- package/docs/examples/migrations/get.md +3 -3
- package/docs/examples/migrations/list.md +5 -4
- package/docs/examples/migrations/retry.md +3 -3
- package/docs/examples/organizations/add-credit.md +4 -4
- package/docs/examples/organizations/cancel-downgrade.md +3 -3
- package/docs/examples/organizations/create-downgrade-feedback.md +17 -0
- package/docs/examples/organizations/create-invoice-payment.md +5 -5
- package/docs/examples/organizations/create.md +13 -12
- package/docs/examples/organizations/delete-backup-payment-method.md +3 -3
- package/docs/examples/organizations/delete-billing-address.md +3 -3
- package/docs/examples/organizations/delete-default-payment-method.md +3 -3
- package/docs/examples/organizations/delete.md +3 -3
- package/docs/examples/organizations/estimation-create-organization.md +8 -7
- package/docs/examples/organizations/estimation-delete-organization.md +3 -3
- package/docs/examples/organizations/estimation-update-plan.md +7 -7
- package/docs/examples/organizations/get-aggregation.md +6 -4
- package/docs/examples/organizations/get-available-credits.md +3 -3
- package/docs/examples/organizations/get-billing-address.md +4 -4
- package/docs/examples/organizations/get-credit.md +4 -4
- package/docs/examples/organizations/get-invoice-download.md +4 -4
- package/docs/examples/organizations/get-invoice-view.md +4 -4
- package/docs/examples/organizations/get-invoice.md +4 -4
- package/docs/examples/organizations/get-payment-method.md +4 -4
- package/docs/examples/organizations/get-plan.md +3 -3
- package/docs/examples/organizations/get-scopes.md +3 -3
- package/docs/examples/organizations/get-usage.md +5 -5
- package/docs/examples/organizations/list-aggregations.md +4 -4
- package/docs/examples/organizations/list-credits.md +4 -4
- package/docs/examples/organizations/list-invoices.md +4 -4
- package/docs/examples/organizations/list.md +4 -4
- package/docs/examples/organizations/set-backup-payment-method.md +4 -4
- package/docs/examples/organizations/set-billing-address.md +4 -4
- package/docs/examples/organizations/set-billing-email.md +4 -4
- package/docs/examples/organizations/set-billing-tax-id.md +4 -4
- package/docs/examples/organizations/set-default-payment-method.md +4 -4
- package/docs/examples/organizations/update-budget.md +5 -5
- package/docs/examples/organizations/update-plan.md +11 -11
- package/docs/examples/organizations/update-projects.md +4 -4
- package/docs/examples/organizations/validate-invoice.md +4 -4
- package/docs/examples/organizations/validate-payment.md +4 -4
- package/docs/examples/project/create-variable.md +5 -5
- package/docs/examples/project/delete-variable.md +3 -3
- package/docs/examples/project/get-usage.md +5 -5
- package/docs/examples/project/get-variable.md +3 -3
- package/docs/examples/project/update-variable.md +6 -6
- package/docs/examples/projects/create-dev-key.md +5 -5
- package/docs/examples/projects/{create-j-w-t.md → create-jwt.md} +5 -5
- package/docs/examples/projects/create-key.md +6 -6
- package/docs/examples/projects/create-platform.md +8 -8
- package/docs/examples/projects/create-smtp-test.md +12 -12
- package/docs/examples/projects/create-webhook.md +10 -10
- package/docs/examples/projects/create.md +16 -16
- package/docs/examples/projects/delete-dev-key.md +4 -4
- package/docs/examples/projects/delete-email-template.md +5 -5
- package/docs/examples/projects/delete-key.md +4 -4
- package/docs/examples/projects/delete-platform.md +4 -4
- package/docs/examples/projects/delete-sms-template.md +5 -5
- package/docs/examples/projects/delete-webhook.md +4 -4
- package/docs/examples/projects/delete.md +3 -3
- package/docs/examples/projects/get-dev-key.md +4 -4
- package/docs/examples/projects/get-email-template.md +5 -5
- package/docs/examples/projects/get-key.md +4 -4
- package/docs/examples/projects/get-platform.md +4 -4
- package/docs/examples/projects/get-sms-template.md +5 -5
- package/docs/examples/projects/get-webhook.md +4 -4
- package/docs/examples/projects/get.md +3 -3
- package/docs/examples/projects/list-dev-keys.md +4 -4
- package/docs/examples/projects/list-keys.md +4 -3
- package/docs/examples/projects/list-platforms.md +4 -3
- package/docs/examples/projects/list-webhooks.md +4 -3
- package/docs/examples/projects/list.md +5 -4
- package/docs/examples/projects/update-api-status-all.md +4 -4
- package/docs/examples/projects/update-api-status.md +6 -6
- package/docs/examples/projects/update-auth-duration.md +4 -4
- package/docs/examples/projects/update-auth-limit.md +4 -4
- package/docs/examples/projects/update-auth-password-dictionary.md +4 -4
- package/docs/examples/projects/update-auth-password-history.md +4 -4
- package/docs/examples/projects/update-auth-sessions-limit.md +4 -4
- package/docs/examples/projects/update-auth-status.md +5 -5
- package/docs/examples/projects/update-dev-key.md +6 -6
- package/docs/examples/projects/update-email-template.md +10 -10
- package/docs/examples/projects/update-key.md +7 -7
- package/docs/examples/projects/update-memberships-privacy.md +6 -6
- package/docs/examples/projects/update-mock-numbers.md +4 -4
- package/docs/examples/projects/{update-o-auth2.md → update-o-auth-2.md} +7 -7
- package/docs/examples/projects/update-personal-data-check.md +4 -4
- package/docs/examples/projects/update-platform.md +8 -8
- package/docs/examples/projects/update-service-status-all.md +4 -4
- package/docs/examples/projects/update-service-status.md +5 -5
- package/docs/examples/projects/update-session-alerts.md +4 -4
- package/docs/examples/projects/update-session-invalidation.md +14 -0
- package/docs/examples/projects/update-sms-template.md +6 -6
- package/docs/examples/projects/update-smtp.md +12 -12
- package/docs/examples/projects/update-status.md +14 -0
- package/docs/examples/projects/update-team.md +4 -4
- package/docs/examples/projects/update-webhook-signature.md +4 -4
- package/docs/examples/projects/update-webhook.md +11 -11
- package/docs/examples/projects/update.md +13 -13
- package/docs/examples/proxy/{create-a-p-i-rule.md → create-api-rule.md} +3 -3
- package/docs/examples/proxy/create-function-rule.md +5 -5
- package/docs/examples/proxy/create-redirect-rule.md +8 -8
- package/docs/examples/proxy/create-site-rule.md +5 -5
- package/docs/examples/proxy/delete-rule.md +3 -3
- package/docs/examples/proxy/get-rule.md +3 -3
- package/docs/examples/proxy/list-rules.md +5 -4
- package/docs/examples/proxy/update-rule-verification.md +3 -3
- package/docs/examples/sites/create-deployment.md +8 -8
- package/docs/examples/sites/create-duplicate-deployment.md +4 -4
- package/docs/examples/sites/create-template-deployment.md +10 -9
- package/docs/examples/sites/create-variable.md +6 -6
- package/docs/examples/sites/create-vcs-deployment.md +7 -7
- package/docs/examples/sites/create.md +21 -21
- package/docs/examples/sites/delete-deployment.md +4 -4
- package/docs/examples/sites/delete-log.md +4 -4
- package/docs/examples/sites/delete-variable.md +4 -4
- package/docs/examples/sites/delete.md +3 -3
- package/docs/examples/sites/get-deployment-download.md +5 -5
- package/docs/examples/sites/get-deployment.md +4 -4
- package/docs/examples/sites/get-log.md +4 -4
- package/docs/examples/sites/get-template.md +3 -3
- package/docs/examples/sites/get-usage.md +5 -5
- package/docs/examples/sites/get-variable.md +4 -4
- package/docs/examples/sites/get.md +3 -3
- package/docs/examples/sites/list-deployments.md +6 -5
- package/docs/examples/sites/list-logs.md +5 -4
- package/docs/examples/sites/list-templates.md +6 -6
- package/docs/examples/sites/list-usage.md +4 -4
- package/docs/examples/sites/list-variables.md +3 -3
- package/docs/examples/sites/list.md +5 -4
- package/docs/examples/sites/update-deployment-status.md +4 -4
- package/docs/examples/sites/update-site-deployment.md +4 -4
- package/docs/examples/sites/update-variable.md +7 -7
- package/docs/examples/sites/update.md +21 -21
- package/docs/examples/storage/create-bucket.md +14 -13
- package/docs/examples/storage/create-file.md +7 -7
- package/docs/examples/storage/delete-bucket.md +3 -3
- package/docs/examples/storage/delete-file.md +4 -4
- package/docs/examples/storage/get-bucket-usage.md +5 -5
- package/docs/examples/storage/get-bucket.md +3 -3
- package/docs/examples/storage/get-file-download.md +5 -5
- package/docs/examples/storage/get-file-preview.md +16 -16
- package/docs/examples/storage/get-file-view.md +5 -5
- package/docs/examples/storage/get-file.md +4 -4
- package/docs/examples/storage/get-usage.md +4 -4
- package/docs/examples/storage/list-buckets.md +5 -4
- package/docs/examples/storage/list-files.md +6 -5
- package/docs/examples/storage/update-bucket.md +14 -13
- package/docs/examples/storage/update-file.md +7 -7
- package/docs/examples/tablesdb/create-boolean-column.md +18 -0
- package/docs/examples/tablesdb/create-datetime-column.md +18 -0
- package/docs/examples/tablesdb/create-email-column.md +18 -0
- package/docs/examples/tablesdb/create-enum-column.md +19 -0
- package/docs/examples/tablesdb/create-float-column.md +20 -0
- package/docs/examples/tablesdb/create-index.md +19 -0
- package/docs/examples/tablesdb/create-integer-column.md +20 -0
- package/docs/examples/tablesdb/create-ip-column.md +18 -0
- package/docs/examples/tablesdb/create-line-column.md +17 -0
- package/docs/examples/tablesdb/create-operations.md +24 -0
- package/docs/examples/tablesdb/create-point-column.md +17 -0
- package/docs/examples/tablesdb/create-polygon-column.md +17 -0
- package/docs/examples/tablesdb/create-relationship-column.md +20 -0
- package/docs/examples/tablesdb/create-row.md +24 -0
- package/docs/examples/tablesdb/create-rows.md +16 -0
- package/docs/examples/tablesdb/create-string-column.md +20 -0
- package/docs/examples/tablesdb/create-table.md +20 -0
- package/docs/examples/tablesdb/create-transaction.md +13 -0
- package/docs/examples/tablesdb/create-url-column.md +18 -0
- package/docs/examples/tablesdb/create.md +15 -0
- package/docs/examples/tablesdb/decrement-row-column.md +19 -0
- package/docs/examples/tablesdb/delete-column.md +15 -0
- package/docs/examples/tablesdb/delete-index.md +15 -0
- package/docs/examples/tablesdb/delete-row.md +16 -0
- package/docs/examples/tablesdb/delete-rows.md +16 -0
- package/docs/examples/tablesdb/delete-table.md +14 -0
- package/docs/examples/tablesdb/delete-transaction.md +13 -0
- package/docs/examples/tablesdb/delete.md +13 -0
- package/docs/examples/tablesdb/get-column.md +15 -0
- package/docs/examples/tablesdb/get-index.md +15 -0
- package/docs/examples/tablesdb/get-row.md +17 -0
- package/docs/examples/tablesdb/get-table-usage.md +15 -0
- package/docs/examples/tablesdb/get-table.md +14 -0
- package/docs/examples/tablesdb/get-transaction.md +13 -0
- package/docs/examples/tablesdb/get-usage.md +14 -0
- package/docs/examples/tablesdb/get.md +13 -0
- package/docs/examples/tablesdb/increment-row-column.md +19 -0
- package/docs/examples/tablesdb/list-columns.md +16 -0
- package/docs/examples/tablesdb/list-indexes.md +16 -0
- package/docs/examples/tablesdb/list-row-logs.md +16 -0
- package/docs/examples/tablesdb/list-rows.md +17 -0
- package/docs/examples/tablesdb/list-table-logs.md +15 -0
- package/docs/examples/tablesdb/list-tables.md +16 -0
- package/docs/examples/tablesdb/list-transactions.md +13 -0
- package/docs/examples/tablesdb/list-usage.md +13 -0
- package/docs/examples/tablesdb/list.md +15 -0
- package/docs/examples/tablesdb/update-boolean-column.md +18 -0
- package/docs/examples/tablesdb/update-datetime-column.md +18 -0
- package/docs/examples/tablesdb/update-email-column.md +18 -0
- package/docs/examples/tablesdb/update-enum-column.md +19 -0
- package/docs/examples/tablesdb/update-float-column.md +20 -0
- package/docs/examples/tablesdb/update-integer-column.md +20 -0
- package/docs/examples/tablesdb/update-ip-column.md +18 -0
- package/docs/examples/tablesdb/update-line-column.md +18 -0
- package/docs/examples/tablesdb/update-point-column.md +18 -0
- package/docs/examples/tablesdb/update-polygon-column.md +18 -0
- package/docs/examples/tablesdb/update-relationship-column.md +17 -0
- package/docs/examples/tablesdb/update-row.md +24 -0
- package/docs/examples/tablesdb/update-rows.md +23 -0
- package/docs/examples/tablesdb/update-string-column.md +19 -0
- package/docs/examples/tablesdb/update-table.md +18 -0
- package/docs/examples/tablesdb/update-transaction.md +15 -0
- package/docs/examples/tablesdb/update-url-column.md +18 -0
- package/docs/examples/tablesdb/update.md +15 -0
- package/docs/examples/tablesdb/upsert-row.md +24 -0
- package/docs/examples/tablesdb/upsert-rows.md +16 -0
- package/docs/examples/teams/create-membership.md +9 -9
- package/docs/examples/teams/create.md +5 -5
- package/docs/examples/teams/delete-membership.md +4 -4
- package/docs/examples/teams/delete.md +3 -3
- package/docs/examples/teams/get-membership.md +4 -4
- package/docs/examples/teams/get-prefs.md +3 -3
- package/docs/examples/teams/get.md +3 -3
- package/docs/examples/teams/list-logs.md +5 -4
- package/docs/examples/teams/list-memberships.md +6 -5
- package/docs/examples/teams/list.md +5 -4
- package/docs/examples/teams/update-membership-status.md +6 -6
- package/docs/examples/teams/update-membership.md +5 -5
- package/docs/examples/teams/update-name.md +4 -4
- package/docs/examples/teams/update-prefs.md +4 -4
- package/docs/examples/tokens/create-file-token.md +5 -5
- package/docs/examples/tokens/delete.md +3 -3
- package/docs/examples/tokens/get.md +3 -3
- package/docs/examples/tokens/list.md +6 -5
- package/docs/examples/tokens/update.md +4 -4
- package/docs/examples/users/{create-m-d5user.md → create-argon-2-user.md} +6 -6
- package/docs/examples/users/create-bcrypt-user.md +6 -6
- package/docs/examples/users/{create-j-w-t.md → create-jwt.md} +5 -5
- package/docs/examples/users/{create-argon2user.md → create-md-5-user.md} +6 -6
- package/docs/examples/users/create-mfa-recovery-codes.md +3 -3
- package/docs/examples/users/{create-p-h-pass-user.md → create-ph-pass-user.md} +6 -6
- package/docs/examples/users/create-scrypt-modified-user.md +9 -9
- package/docs/examples/users/create-scrypt-user.md +11 -11
- package/docs/examples/users/create-session.md +3 -3
- package/docs/examples/users/{create-s-h-a-user.md → create-sha-user.md} +7 -7
- package/docs/examples/users/create-target.md +8 -8
- package/docs/examples/users/create-token.md +5 -5
- package/docs/examples/users/create.md +7 -7
- package/docs/examples/users/delete-identity.md +3 -3
- package/docs/examples/users/delete-mfa-authenticator.md +4 -4
- package/docs/examples/users/delete-session.md +4 -4
- package/docs/examples/users/delete-sessions.md +3 -3
- package/docs/examples/users/delete-target.md +4 -4
- package/docs/examples/users/delete.md +3 -3
- package/docs/examples/users/get-mfa-recovery-codes.md +3 -3
- package/docs/examples/users/get-prefs.md +3 -3
- package/docs/examples/users/get-target.md +4 -4
- package/docs/examples/users/get-usage.md +4 -4
- package/docs/examples/users/get.md +3 -3
- package/docs/examples/users/list-identities.md +5 -4
- package/docs/examples/users/list-logs.md +5 -4
- package/docs/examples/users/list-memberships.md +6 -5
- package/docs/examples/users/list-mfa-factors.md +3 -3
- package/docs/examples/users/list-sessions.md +4 -3
- package/docs/examples/users/list-targets.md +5 -4
- package/docs/examples/users/list.md +5 -4
- package/docs/examples/users/update-email-verification.md +4 -4
- package/docs/examples/users/update-email.md +4 -4
- package/docs/examples/users/update-labels.md +4 -4
- package/docs/examples/users/update-mfa-recovery-codes.md +3 -3
- package/docs/examples/users/update-mfa.md +4 -4
- package/docs/examples/users/update-name.md +4 -4
- package/docs/examples/users/update-password.md +4 -4
- package/docs/examples/users/update-phone-verification.md +4 -4
- package/docs/examples/users/update-phone.md +4 -4
- package/docs/examples/users/update-prefs.md +4 -4
- package/docs/examples/users/update-status.md +4 -4
- package/docs/examples/users/update-target.md +7 -7
- package/docs/examples/vcs/create-repository-detection.md +6 -6
- package/docs/examples/vcs/create-repository.md +5 -5
- package/docs/examples/vcs/delete-installation.md +3 -3
- package/docs/examples/vcs/get-installation.md +3 -3
- package/docs/examples/vcs/get-repository-contents.md +6 -6
- package/docs/examples/vcs/get-repository.md +4 -4
- package/docs/examples/vcs/list-installations.md +5 -4
- package/docs/examples/vcs/list-repositories.md +6 -5
- package/docs/examples/vcs/list-repository-branches.md +4 -4
- package/docs/examples/vcs/update-external-deployments.md +5 -5
- package/package.json +4 -4
- package/src/client.ts +42 -7
- package/src/enums/api-service.ts +1 -0
- package/src/enums/attribute-status.ts +7 -0
- package/src/enums/billing-plan-group.ts +5 -0
- package/src/enums/build-runtime.ts +2 -0
- package/src/enums/column-status.ts +7 -0
- package/src/enums/credit-card.ts +1 -1
- package/src/enums/database-type.ts +4 -0
- package/src/enums/deployment-status.ts +7 -0
- package/src/enums/execution-method.ts +1 -0
- package/src/enums/execution-status.ts +7 -0
- package/src/enums/execution-trigger.ts +5 -0
- package/src/enums/framework.ts +1 -0
- package/src/enums/health-antivirus-status.ts +5 -0
- package/src/enums/health-check-status.ts +4 -0
- package/src/enums/index-status.ts +7 -0
- package/src/enums/index-type.ts +1 -0
- package/src/enums/message-status.ts +7 -0
- package/src/enums/o-auth-provider.ts +3 -0
- package/src/enums/platform.ts +4 -0
- package/src/enums/proxy-rule-deployment-resource-type.ts +4 -0
- package/src/enums/proxy-rule-status.ts +6 -0
- package/src/enums/region.ts +3 -0
- package/src/enums/runtime.ts +2 -0
- package/src/enums/status.ts +4 -0
- package/src/enums/template-reference-type.ts +5 -0
- package/src/enums/theme.ts +4 -0
- package/src/enums/timezone.ts +421 -0
- package/src/enums/{user-usage-range.ts → usage-range.ts} +1 -1
- package/src/enums/{v-c-s-deployment-type.ts → vcs-reference-type.ts} +1 -1
- package/src/index.ts +27 -11
- package/src/models.ts +1692 -238
- package/src/operator.ts +308 -0
- package/src/query.ts +246 -2
- package/src/services/account.ts +2205 -223
- package/src/services/assistant.ts +29 -3
- package/src/services/avatars.ts +486 -33
- package/src/services/backups.ts +389 -42
- package/src/services/console.ts +492 -19
- package/src/services/databases.ts +3521 -431
- package/src/services/domains.ts +1684 -197
- package/src/services/functions.ts +1162 -149
- package/src/services/graphql.ts +55 -4
- package/src/services/health.ts +560 -41
- package/src/services/locale.ts +9 -0
- package/src/services/messaging.ts +3367 -380
- package/src/services/migrations.ts +641 -65
- package/src/services/organizations.ts +1323 -128
- package/src/services/project.ts +168 -17
- package/src/services/projects.ts +2742 -266
- package/src/services/proxy.ts +265 -26
- package/src/services/realtime.ts +437 -0
- package/src/services/sites.ts +1098 -140
- package/src/services/storage.ts +651 -82
- package/src/services/tables-db.ts +5439 -0
- package/src/services/teams.ts +512 -55
- package/src/services/tokens.ts +167 -16
- package/src/services/users.ts +1873 -181
- package/src/services/vcs.ts +359 -39
- package/types/client.d.ts +14 -5
- package/types/enums/api-service.d.ts +1 -0
- package/types/enums/attribute-status.d.ts +7 -0
- package/types/enums/billing-plan-group.d.ts +5 -0
- package/types/enums/build-runtime.d.ts +3 -1
- package/types/enums/column-status.d.ts +7 -0
- package/types/enums/credit-card.d.ts +1 -1
- package/types/enums/database-type.d.ts +4 -0
- package/types/enums/deployment-status.d.ts +7 -0
- package/types/enums/execution-method.d.ts +2 -1
- package/types/enums/execution-status.d.ts +7 -0
- package/types/enums/execution-trigger.d.ts +5 -0
- package/types/enums/framework.d.ts +1 -0
- package/types/enums/health-antivirus-status.d.ts +5 -0
- package/types/enums/health-check-status.d.ts +4 -0
- package/types/enums/index-status.d.ts +7 -0
- package/types/enums/index-type.d.ts +2 -1
- package/types/enums/message-status.d.ts +7 -0
- package/types/enums/o-auth-provider.d.ts +4 -1
- package/types/enums/platform.d.ts +4 -0
- package/types/enums/proxy-rule-deployment-resource-type.d.ts +4 -0
- package/types/enums/proxy-rule-status.d.ts +6 -0
- package/types/enums/region.d.ts +4 -1
- package/types/enums/runtime.d.ts +3 -1
- package/types/enums/status.d.ts +4 -0
- package/types/enums/template-reference-type.d.ts +5 -0
- package/types/enums/theme.d.ts +4 -0
- package/types/enums/timezone.d.ts +421 -0
- package/types/enums/{site-usage-range.d.ts → usage-range.d.ts} +1 -1
- package/types/enums/{v-c-s-deployment-type.d.ts → vcs-reference-type.d.ts} +1 -1
- package/types/index.d.ts +27 -11
- package/types/models.d.ts +1664 -245
- package/types/operator.d.ts +180 -0
- package/types/query.d.ts +198 -2
- package/types/services/account.d.ts +985 -123
- package/types/services/assistant.d.ts +13 -2
- package/types/services/avatars.d.ts +244 -26
- package/types/services/backups.d.ts +190 -30
- package/types/services/console.d.ts +201 -14
- package/types/services/databases.d.ts +1731 -284
- package/types/services/domains.d.ts +904 -152
- package/types/services/functions.d.ts +616 -125
- package/types/services/graphql.d.ts +24 -2
- package/types/services/health.d.ts +245 -23
- package/types/services/messaging.d.ts +1660 -271
- package/types/services/migrations.d.ts +319 -53
- package/types/services/organizations.d.ts +635 -97
- package/types/services/project.d.ts +81 -12
- package/types/services/projects.d.ts +1308 -202
- package/types/services/proxy.d.ts +128 -19
- package/types/services/realtime.d.ts +118 -0
- package/types/services/sites.d.ts +577 -116
- package/types/services/storage.d.ts +354 -73
- package/types/services/tables-db.d.ts +2040 -0
- package/types/services/teams.d.ts +260 -44
- package/types/services/tokens.d.ts +80 -12
- package/types/services/users.d.ts +881 -124
- package/types/services/vcs.d.ts +179 -31
- package/docs/examples/domains/create-record-m-x.md +0 -18
- package/docs/examples/domains/create-record-s-r-v.md +0 -20
- package/docs/examples/domains/create-record-t-x-t.md +0 -17
- package/docs/examples/domains/update-record-a-a-a-a.md +0 -18
- package/docs/examples/domains/update-record-c-a-a.md +0 -18
- package/docs/examples/domains/update-record-c-n-a-m-e.md +0 -18
- package/docs/examples/domains/update-record-h-t-t-p-s.md +0 -18
- package/docs/examples/domains/update-record-m-x.md +0 -19
- package/docs/examples/domains/update-record-n-s.md +0 -18
- package/docs/examples/domains/update-record-s-r-v.md +0 -21
- package/docs/examples/domains/update-record-t-x-t.md +0 -18
- package/src/enums/billing-plan.ts +0 -5
- package/src/enums/database-usage-range.ts +0 -5
- package/src/enums/function-usage-range.ts +0 -5
- package/src/enums/site-usage-range.ts +0 -5
- package/src/enums/storage-usage-range.ts +0 -5
- package/types/enums/billing-plan.d.ts +0 -5
- package/types/enums/database-usage-range.d.ts +0 -5
- package/types/enums/function-usage-range.d.ts +0 -5
- package/types/enums/storage-usage-range.d.ts +0 -5
- package/types/enums/user-usage-range.d.ts +0 -5
- /package/docs/examples/health/{get-d-b.md → get-db.md} +0 -0
- /package/docs/examples/locale/{list-countries-e-u.md → list-countries-eu.md} +0 -0
- /package/src/enums/{s-m-t-p-secure.ts → smtp-secure.ts} +0 -0
- /package/src/enums/{v-c-s-detection-type.ts → vcs-detection-type.ts} +0 -0
- /package/types/enums/{s-m-t-p-secure.d.ts → smtp-secure.d.ts} +0 -0
- /package/types/enums/{v-c-s-detection-type.d.ts → vcs-detection-type.d.ts} +0 -0
package/src/services/users.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Service } from '../service';
|
|
2
2
|
import { AppwriteException, Client, type Payload, UploadProgress } from '../client';
|
|
3
3
|
import type { Models } from '../models';
|
|
4
|
+
|
|
4
5
|
import { PasswordHash } from '../enums/password-hash';
|
|
5
|
-
import {
|
|
6
|
+
import { UsageRange } from '../enums/usage-range';
|
|
6
7
|
import { AuthenticatorType } from '../enums/authenticator-type';
|
|
7
8
|
import { MessagingProviderType } from '../enums/messaging-provider-type';
|
|
8
9
|
|
|
@@ -14,14 +15,47 @@ export class Users {
|
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
|
-
* Get a list of all the project
|
|
18
|
+
* Get a list of all the project's users. You can use the query params to filter your results.
|
|
19
|
+
*
|
|
20
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels
|
|
21
|
+
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
|
22
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
23
|
+
* @throws {AppwriteException}
|
|
24
|
+
* @returns {Promise<Models.UserList<Preferences>>}
|
|
25
|
+
*/
|
|
26
|
+
list<Preferences extends Models.Preferences = Models.DefaultPreferences>(params?: { queries?: string[], search?: string, total?: boolean }): Promise<Models.UserList<Preferences>>;
|
|
27
|
+
/**
|
|
28
|
+
* Get a list of all the project's users. You can use the query params to filter your results.
|
|
18
29
|
*
|
|
19
|
-
* @param {string[]} queries
|
|
20
|
-
* @param {string} search
|
|
30
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels
|
|
31
|
+
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
|
32
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
21
33
|
* @throws {AppwriteException}
|
|
22
34
|
* @returns {Promise<Models.UserList<Preferences>>}
|
|
35
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
23
36
|
*/
|
|
24
|
-
list<Preferences extends Models.Preferences = Models.DefaultPreferences>(queries?: string[], search?: string): Promise<Models.UserList<Preferences
|
|
37
|
+
list<Preferences extends Models.Preferences = Models.DefaultPreferences>(queries?: string[], search?: string, total?: boolean): Promise<Models.UserList<Preferences>>;
|
|
38
|
+
list<Preferences extends Models.Preferences = Models.DefaultPreferences>(
|
|
39
|
+
paramsOrFirst?: { queries?: string[], search?: string, total?: boolean } | string[],
|
|
40
|
+
...rest: [(string)?, (boolean)?]
|
|
41
|
+
): Promise<Models.UserList<Preferences>> {
|
|
42
|
+
let params: { queries?: string[], search?: string, total?: boolean };
|
|
43
|
+
|
|
44
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
45
|
+
params = (paramsOrFirst || {}) as { queries?: string[], search?: string, total?: boolean };
|
|
46
|
+
} else {
|
|
47
|
+
params = {
|
|
48
|
+
queries: paramsOrFirst as string[],
|
|
49
|
+
search: rest[0] as string,
|
|
50
|
+
total: rest[1] as boolean
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const queries = params.queries;
|
|
55
|
+
const search = params.search;
|
|
56
|
+
const total = params.total;
|
|
57
|
+
|
|
58
|
+
|
|
25
59
|
const apiPath = '/users';
|
|
26
60
|
const payload: Payload = {};
|
|
27
61
|
if (typeof queries !== 'undefined') {
|
|
@@ -30,6 +64,9 @@ export class Users {
|
|
|
30
64
|
if (typeof search !== 'undefined') {
|
|
31
65
|
payload['search'] = search;
|
|
32
66
|
}
|
|
67
|
+
if (typeof total !== 'undefined') {
|
|
68
|
+
payload['total'] = total;
|
|
69
|
+
}
|
|
33
70
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
34
71
|
|
|
35
72
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -46,18 +83,56 @@ export class Users {
|
|
|
46
83
|
/**
|
|
47
84
|
* Create a new user.
|
|
48
85
|
*
|
|
49
|
-
* @param {string} userId
|
|
50
|
-
* @param {string} email
|
|
51
|
-
* @param {string} phone
|
|
52
|
-
* @param {string} password
|
|
53
|
-
* @param {string} name
|
|
86
|
+
* @param {string} params.userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
87
|
+
* @param {string} params.email - User email.
|
|
88
|
+
* @param {string} params.phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
|
|
89
|
+
* @param {string} params.password - Plain text user password. Must be at least 8 chars.
|
|
90
|
+
* @param {string} params.name - User name. Max length: 128 chars.
|
|
91
|
+
* @throws {AppwriteException}
|
|
92
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
93
|
+
*/
|
|
94
|
+
create<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, email?: string, phone?: string, password?: string, name?: string }): Promise<Models.User<Preferences>>;
|
|
95
|
+
/**
|
|
96
|
+
* Create a new user.
|
|
97
|
+
*
|
|
98
|
+
* @param {string} userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
99
|
+
* @param {string} email - User email.
|
|
100
|
+
* @param {string} phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
|
|
101
|
+
* @param {string} password - Plain text user password. Must be at least 8 chars.
|
|
102
|
+
* @param {string} name - User name. Max length: 128 chars.
|
|
54
103
|
* @throws {AppwriteException}
|
|
55
104
|
* @returns {Promise<Models.User<Preferences>>}
|
|
105
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
56
106
|
*/
|
|
57
|
-
create<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email?: string, phone?: string, password?: string, name?: string): Promise<Models.User<Preferences
|
|
107
|
+
create<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email?: string, phone?: string, password?: string, name?: string): Promise<Models.User<Preferences>>;
|
|
108
|
+
create<Preferences extends Models.Preferences = Models.DefaultPreferences>(
|
|
109
|
+
paramsOrFirst: { userId: string, email?: string, phone?: string, password?: string, name?: string } | string,
|
|
110
|
+
...rest: [(string)?, (string)?, (string)?, (string)?]
|
|
111
|
+
): Promise<Models.User<Preferences>> {
|
|
112
|
+
let params: { userId: string, email?: string, phone?: string, password?: string, name?: string };
|
|
113
|
+
|
|
114
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
115
|
+
params = (paramsOrFirst || {}) as { userId: string, email?: string, phone?: string, password?: string, name?: string };
|
|
116
|
+
} else {
|
|
117
|
+
params = {
|
|
118
|
+
userId: paramsOrFirst as string,
|
|
119
|
+
email: rest[0] as string,
|
|
120
|
+
phone: rest[1] as string,
|
|
121
|
+
password: rest[2] as string,
|
|
122
|
+
name: rest[3] as string
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const userId = params.userId;
|
|
127
|
+
const email = params.email;
|
|
128
|
+
const phone = params.phone;
|
|
129
|
+
const password = params.password;
|
|
130
|
+
const name = params.name;
|
|
131
|
+
|
|
58
132
|
if (typeof userId === 'undefined') {
|
|
59
133
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
60
134
|
}
|
|
135
|
+
|
|
61
136
|
const apiPath = '/users';
|
|
62
137
|
const payload: Payload = {};
|
|
63
138
|
if (typeof userId !== 'undefined') {
|
|
@@ -92,14 +167,48 @@ export class Users {
|
|
|
92
167
|
/**
|
|
93
168
|
* Create a new user. Password provided must be hashed with the [Argon2](https://en.wikipedia.org/wiki/Argon2) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
|
|
94
169
|
*
|
|
95
|
-
* @param {string} userId
|
|
96
|
-
* @param {string} email
|
|
97
|
-
* @param {string} password
|
|
98
|
-
* @param {string} name
|
|
170
|
+
* @param {string} params.userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
171
|
+
* @param {string} params.email - User email.
|
|
172
|
+
* @param {string} params.password - User password hashed using Argon2.
|
|
173
|
+
* @param {string} params.name - User name. Max length: 128 chars.
|
|
174
|
+
* @throws {AppwriteException}
|
|
175
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
176
|
+
*/
|
|
177
|
+
createArgon2User<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, email: string, password: string, name?: string }): Promise<Models.User<Preferences>>;
|
|
178
|
+
/**
|
|
179
|
+
* Create a new user. Password provided must be hashed with the [Argon2](https://en.wikipedia.org/wiki/Argon2) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
|
|
180
|
+
*
|
|
181
|
+
* @param {string} userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
182
|
+
* @param {string} email - User email.
|
|
183
|
+
* @param {string} password - User password hashed using Argon2.
|
|
184
|
+
* @param {string} name - User name. Max length: 128 chars.
|
|
99
185
|
* @throws {AppwriteException}
|
|
100
186
|
* @returns {Promise<Models.User<Preferences>>}
|
|
187
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
101
188
|
*/
|
|
102
|
-
createArgon2User<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences
|
|
189
|
+
createArgon2User<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
|
|
190
|
+
createArgon2User<Preferences extends Models.Preferences = Models.DefaultPreferences>(
|
|
191
|
+
paramsOrFirst: { userId: string, email: string, password: string, name?: string } | string,
|
|
192
|
+
...rest: [(string)?, (string)?, (string)?]
|
|
193
|
+
): Promise<Models.User<Preferences>> {
|
|
194
|
+
let params: { userId: string, email: string, password: string, name?: string };
|
|
195
|
+
|
|
196
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
197
|
+
params = (paramsOrFirst || {}) as { userId: string, email: string, password: string, name?: string };
|
|
198
|
+
} else {
|
|
199
|
+
params = {
|
|
200
|
+
userId: paramsOrFirst as string,
|
|
201
|
+
email: rest[0] as string,
|
|
202
|
+
password: rest[1] as string,
|
|
203
|
+
name: rest[2] as string
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
const userId = params.userId;
|
|
208
|
+
const email = params.email;
|
|
209
|
+
const password = params.password;
|
|
210
|
+
const name = params.name;
|
|
211
|
+
|
|
103
212
|
if (typeof userId === 'undefined') {
|
|
104
213
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
105
214
|
}
|
|
@@ -109,6 +218,7 @@ export class Users {
|
|
|
109
218
|
if (typeof password === 'undefined') {
|
|
110
219
|
throw new AppwriteException('Missing required parameter: "password"');
|
|
111
220
|
}
|
|
221
|
+
|
|
112
222
|
const apiPath = '/users/argon2';
|
|
113
223
|
const payload: Payload = {};
|
|
114
224
|
if (typeof userId !== 'undefined') {
|
|
@@ -140,14 +250,48 @@ export class Users {
|
|
|
140
250
|
/**
|
|
141
251
|
* Create a new user. Password provided must be hashed with the [Bcrypt](https://en.wikipedia.org/wiki/Bcrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
|
|
142
252
|
*
|
|
143
|
-
* @param {string} userId
|
|
144
|
-
* @param {string} email
|
|
145
|
-
* @param {string} password
|
|
146
|
-
* @param {string} name
|
|
253
|
+
* @param {string} params.userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
254
|
+
* @param {string} params.email - User email.
|
|
255
|
+
* @param {string} params.password - User password hashed using Bcrypt.
|
|
256
|
+
* @param {string} params.name - User name. Max length: 128 chars.
|
|
257
|
+
* @throws {AppwriteException}
|
|
258
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
259
|
+
*/
|
|
260
|
+
createBcryptUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, email: string, password: string, name?: string }): Promise<Models.User<Preferences>>;
|
|
261
|
+
/**
|
|
262
|
+
* Create a new user. Password provided must be hashed with the [Bcrypt](https://en.wikipedia.org/wiki/Bcrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
|
|
263
|
+
*
|
|
264
|
+
* @param {string} userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
265
|
+
* @param {string} email - User email.
|
|
266
|
+
* @param {string} password - User password hashed using Bcrypt.
|
|
267
|
+
* @param {string} name - User name. Max length: 128 chars.
|
|
147
268
|
* @throws {AppwriteException}
|
|
148
269
|
* @returns {Promise<Models.User<Preferences>>}
|
|
270
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
149
271
|
*/
|
|
150
|
-
createBcryptUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences
|
|
272
|
+
createBcryptUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
|
|
273
|
+
createBcryptUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(
|
|
274
|
+
paramsOrFirst: { userId: string, email: string, password: string, name?: string } | string,
|
|
275
|
+
...rest: [(string)?, (string)?, (string)?]
|
|
276
|
+
): Promise<Models.User<Preferences>> {
|
|
277
|
+
let params: { userId: string, email: string, password: string, name?: string };
|
|
278
|
+
|
|
279
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
280
|
+
params = (paramsOrFirst || {}) as { userId: string, email: string, password: string, name?: string };
|
|
281
|
+
} else {
|
|
282
|
+
params = {
|
|
283
|
+
userId: paramsOrFirst as string,
|
|
284
|
+
email: rest[0] as string,
|
|
285
|
+
password: rest[1] as string,
|
|
286
|
+
name: rest[2] as string
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
const userId = params.userId;
|
|
291
|
+
const email = params.email;
|
|
292
|
+
const password = params.password;
|
|
293
|
+
const name = params.name;
|
|
294
|
+
|
|
151
295
|
if (typeof userId === 'undefined') {
|
|
152
296
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
153
297
|
}
|
|
@@ -157,6 +301,7 @@ export class Users {
|
|
|
157
301
|
if (typeof password === 'undefined') {
|
|
158
302
|
throw new AppwriteException('Missing required parameter: "password"');
|
|
159
303
|
}
|
|
304
|
+
|
|
160
305
|
const apiPath = '/users/bcrypt';
|
|
161
306
|
const payload: Payload = {};
|
|
162
307
|
if (typeof userId !== 'undefined') {
|
|
@@ -188,12 +333,45 @@ export class Users {
|
|
|
188
333
|
/**
|
|
189
334
|
* Get identities for all users.
|
|
190
335
|
*
|
|
191
|
-
* @param {string[]} queries
|
|
192
|
-
* @param {string} search
|
|
336
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry
|
|
337
|
+
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
|
338
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
339
|
+
* @throws {AppwriteException}
|
|
340
|
+
* @returns {Promise<Models.IdentityList>}
|
|
341
|
+
*/
|
|
342
|
+
listIdentities(params?: { queries?: string[], search?: string, total?: boolean }): Promise<Models.IdentityList>;
|
|
343
|
+
/**
|
|
344
|
+
* Get identities for all users.
|
|
345
|
+
*
|
|
346
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry
|
|
347
|
+
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
|
348
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
193
349
|
* @throws {AppwriteException}
|
|
194
350
|
* @returns {Promise<Models.IdentityList>}
|
|
351
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
195
352
|
*/
|
|
196
|
-
listIdentities(queries?: string[], search?: string): Promise<Models.IdentityList
|
|
353
|
+
listIdentities(queries?: string[], search?: string, total?: boolean): Promise<Models.IdentityList>;
|
|
354
|
+
listIdentities(
|
|
355
|
+
paramsOrFirst?: { queries?: string[], search?: string, total?: boolean } | string[],
|
|
356
|
+
...rest: [(string)?, (boolean)?]
|
|
357
|
+
): Promise<Models.IdentityList> {
|
|
358
|
+
let params: { queries?: string[], search?: string, total?: boolean };
|
|
359
|
+
|
|
360
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
361
|
+
params = (paramsOrFirst || {}) as { queries?: string[], search?: string, total?: boolean };
|
|
362
|
+
} else {
|
|
363
|
+
params = {
|
|
364
|
+
queries: paramsOrFirst as string[],
|
|
365
|
+
search: rest[0] as string,
|
|
366
|
+
total: rest[1] as boolean
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
const queries = params.queries;
|
|
371
|
+
const search = params.search;
|
|
372
|
+
const total = params.total;
|
|
373
|
+
|
|
374
|
+
|
|
197
375
|
const apiPath = '/users/identities';
|
|
198
376
|
const payload: Payload = {};
|
|
199
377
|
if (typeof queries !== 'undefined') {
|
|
@@ -202,6 +380,9 @@ export class Users {
|
|
|
202
380
|
if (typeof search !== 'undefined') {
|
|
203
381
|
payload['search'] = search;
|
|
204
382
|
}
|
|
383
|
+
if (typeof total !== 'undefined') {
|
|
384
|
+
payload['total'] = total;
|
|
385
|
+
}
|
|
205
386
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
206
387
|
|
|
207
388
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -218,14 +399,39 @@ export class Users {
|
|
|
218
399
|
/**
|
|
219
400
|
* Delete an identity by its unique ID.
|
|
220
401
|
*
|
|
221
|
-
* @param {string} identityId
|
|
402
|
+
* @param {string} params.identityId - Identity ID.
|
|
403
|
+
* @throws {AppwriteException}
|
|
404
|
+
* @returns {Promise<{}>}
|
|
405
|
+
*/
|
|
406
|
+
deleteIdentity(params: { identityId: string }): Promise<{}>;
|
|
407
|
+
/**
|
|
408
|
+
* Delete an identity by its unique ID.
|
|
409
|
+
*
|
|
410
|
+
* @param {string} identityId - Identity ID.
|
|
222
411
|
* @throws {AppwriteException}
|
|
223
412
|
* @returns {Promise<{}>}
|
|
413
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
224
414
|
*/
|
|
225
|
-
deleteIdentity(identityId: string): Promise<{}
|
|
415
|
+
deleteIdentity(identityId: string): Promise<{}>;
|
|
416
|
+
deleteIdentity(
|
|
417
|
+
paramsOrFirst: { identityId: string } | string
|
|
418
|
+
): Promise<{}> {
|
|
419
|
+
let params: { identityId: string };
|
|
420
|
+
|
|
421
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
422
|
+
params = (paramsOrFirst || {}) as { identityId: string };
|
|
423
|
+
} else {
|
|
424
|
+
params = {
|
|
425
|
+
identityId: paramsOrFirst as string
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
const identityId = params.identityId;
|
|
430
|
+
|
|
226
431
|
if (typeof identityId === 'undefined') {
|
|
227
432
|
throw new AppwriteException('Missing required parameter: "identityId"');
|
|
228
433
|
}
|
|
434
|
+
|
|
229
435
|
const apiPath = '/users/identities/{identityId}'.replace('{identityId}', identityId);
|
|
230
436
|
const payload: Payload = {};
|
|
231
437
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -245,14 +451,48 @@ export class Users {
|
|
|
245
451
|
/**
|
|
246
452
|
* Create a new user. Password provided must be hashed with the [MD5](https://en.wikipedia.org/wiki/MD5) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
|
|
247
453
|
*
|
|
248
|
-
* @param {string} userId
|
|
249
|
-
* @param {string} email
|
|
250
|
-
* @param {string} password
|
|
251
|
-
* @param {string} name
|
|
454
|
+
* @param {string} params.userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
455
|
+
* @param {string} params.email - User email.
|
|
456
|
+
* @param {string} params.password - User password hashed using MD5.
|
|
457
|
+
* @param {string} params.name - User name. Max length: 128 chars.
|
|
458
|
+
* @throws {AppwriteException}
|
|
459
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
460
|
+
*/
|
|
461
|
+
createMD5User<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, email: string, password: string, name?: string }): Promise<Models.User<Preferences>>;
|
|
462
|
+
/**
|
|
463
|
+
* Create a new user. Password provided must be hashed with the [MD5](https://en.wikipedia.org/wiki/MD5) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
|
|
464
|
+
*
|
|
465
|
+
* @param {string} userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
466
|
+
* @param {string} email - User email.
|
|
467
|
+
* @param {string} password - User password hashed using MD5.
|
|
468
|
+
* @param {string} name - User name. Max length: 128 chars.
|
|
252
469
|
* @throws {AppwriteException}
|
|
253
470
|
* @returns {Promise<Models.User<Preferences>>}
|
|
471
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
254
472
|
*/
|
|
255
|
-
createMD5User<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences
|
|
473
|
+
createMD5User<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
|
|
474
|
+
createMD5User<Preferences extends Models.Preferences = Models.DefaultPreferences>(
|
|
475
|
+
paramsOrFirst: { userId: string, email: string, password: string, name?: string } | string,
|
|
476
|
+
...rest: [(string)?, (string)?, (string)?]
|
|
477
|
+
): Promise<Models.User<Preferences>> {
|
|
478
|
+
let params: { userId: string, email: string, password: string, name?: string };
|
|
479
|
+
|
|
480
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
481
|
+
params = (paramsOrFirst || {}) as { userId: string, email: string, password: string, name?: string };
|
|
482
|
+
} else {
|
|
483
|
+
params = {
|
|
484
|
+
userId: paramsOrFirst as string,
|
|
485
|
+
email: rest[0] as string,
|
|
486
|
+
password: rest[1] as string,
|
|
487
|
+
name: rest[2] as string
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
const userId = params.userId;
|
|
492
|
+
const email = params.email;
|
|
493
|
+
const password = params.password;
|
|
494
|
+
const name = params.name;
|
|
495
|
+
|
|
256
496
|
if (typeof userId === 'undefined') {
|
|
257
497
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
258
498
|
}
|
|
@@ -262,6 +502,7 @@ export class Users {
|
|
|
262
502
|
if (typeof password === 'undefined') {
|
|
263
503
|
throw new AppwriteException('Missing required parameter: "password"');
|
|
264
504
|
}
|
|
505
|
+
|
|
265
506
|
const apiPath = '/users/md5';
|
|
266
507
|
const payload: Payload = {};
|
|
267
508
|
if (typeof userId !== 'undefined') {
|
|
@@ -293,14 +534,48 @@ export class Users {
|
|
|
293
534
|
/**
|
|
294
535
|
* Create a new user. Password provided must be hashed with the [PHPass](https://www.openwall.com/phpass/) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
|
|
295
536
|
*
|
|
296
|
-
* @param {string} userId
|
|
297
|
-
* @param {string} email
|
|
298
|
-
* @param {string} password
|
|
299
|
-
* @param {string} name
|
|
537
|
+
* @param {string} params.userId - User ID. Choose a custom ID or pass the string `ID.unique()`to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
538
|
+
* @param {string} params.email - User email.
|
|
539
|
+
* @param {string} params.password - User password hashed using PHPass.
|
|
540
|
+
* @param {string} params.name - User name. Max length: 128 chars.
|
|
541
|
+
* @throws {AppwriteException}
|
|
542
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
543
|
+
*/
|
|
544
|
+
createPHPassUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, email: string, password: string, name?: string }): Promise<Models.User<Preferences>>;
|
|
545
|
+
/**
|
|
546
|
+
* Create a new user. Password provided must be hashed with the [PHPass](https://www.openwall.com/phpass/) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
|
|
547
|
+
*
|
|
548
|
+
* @param {string} userId - User ID. Choose a custom ID or pass the string `ID.unique()`to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
549
|
+
* @param {string} email - User email.
|
|
550
|
+
* @param {string} password - User password hashed using PHPass.
|
|
551
|
+
* @param {string} name - User name. Max length: 128 chars.
|
|
300
552
|
* @throws {AppwriteException}
|
|
301
553
|
* @returns {Promise<Models.User<Preferences>>}
|
|
554
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
302
555
|
*/
|
|
303
|
-
createPHPassUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences
|
|
556
|
+
createPHPassUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
|
|
557
|
+
createPHPassUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(
|
|
558
|
+
paramsOrFirst: { userId: string, email: string, password: string, name?: string } | string,
|
|
559
|
+
...rest: [(string)?, (string)?, (string)?]
|
|
560
|
+
): Promise<Models.User<Preferences>> {
|
|
561
|
+
let params: { userId: string, email: string, password: string, name?: string };
|
|
562
|
+
|
|
563
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
564
|
+
params = (paramsOrFirst || {}) as { userId: string, email: string, password: string, name?: string };
|
|
565
|
+
} else {
|
|
566
|
+
params = {
|
|
567
|
+
userId: paramsOrFirst as string,
|
|
568
|
+
email: rest[0] as string,
|
|
569
|
+
password: rest[1] as string,
|
|
570
|
+
name: rest[2] as string
|
|
571
|
+
};
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
const userId = params.userId;
|
|
575
|
+
const email = params.email;
|
|
576
|
+
const password = params.password;
|
|
577
|
+
const name = params.name;
|
|
578
|
+
|
|
304
579
|
if (typeof userId === 'undefined') {
|
|
305
580
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
306
581
|
}
|
|
@@ -310,6 +585,7 @@ export class Users {
|
|
|
310
585
|
if (typeof password === 'undefined') {
|
|
311
586
|
throw new AppwriteException('Missing required parameter: "password"');
|
|
312
587
|
}
|
|
588
|
+
|
|
313
589
|
const apiPath = '/users/phpass';
|
|
314
590
|
const payload: Payload = {};
|
|
315
591
|
if (typeof userId !== 'undefined') {
|
|
@@ -341,19 +617,68 @@ export class Users {
|
|
|
341
617
|
/**
|
|
342
618
|
* Create a new user. Password provided must be hashed with the [Scrypt](https://github.com/Tarsnap/scrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
|
|
343
619
|
*
|
|
344
|
-
* @param {string} userId
|
|
345
|
-
* @param {string} email
|
|
346
|
-
* @param {string} password
|
|
347
|
-
* @param {string} passwordSalt
|
|
348
|
-
* @param {number} passwordCpu
|
|
349
|
-
* @param {number} passwordMemory
|
|
350
|
-
* @param {number} passwordParallel
|
|
351
|
-
* @param {number} passwordLength
|
|
352
|
-
* @param {string} name
|
|
620
|
+
* @param {string} params.userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
621
|
+
* @param {string} params.email - User email.
|
|
622
|
+
* @param {string} params.password - User password hashed using Scrypt.
|
|
623
|
+
* @param {string} params.passwordSalt - Optional salt used to hash password.
|
|
624
|
+
* @param {number} params.passwordCpu - Optional CPU cost used to hash password.
|
|
625
|
+
* @param {number} params.passwordMemory - Optional memory cost used to hash password.
|
|
626
|
+
* @param {number} params.passwordParallel - Optional parallelization cost used to hash password.
|
|
627
|
+
* @param {number} params.passwordLength - Optional hash length used to hash password.
|
|
628
|
+
* @param {string} params.name - User name. Max length: 128 chars.
|
|
629
|
+
* @throws {AppwriteException}
|
|
630
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
631
|
+
*/
|
|
632
|
+
createScryptUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number, passwordMemory: number, passwordParallel: number, passwordLength: number, name?: string }): Promise<Models.User<Preferences>>;
|
|
633
|
+
/**
|
|
634
|
+
* Create a new user. Password provided must be hashed with the [Scrypt](https://github.com/Tarsnap/scrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
|
|
635
|
+
*
|
|
636
|
+
* @param {string} userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
637
|
+
* @param {string} email - User email.
|
|
638
|
+
* @param {string} password - User password hashed using Scrypt.
|
|
639
|
+
* @param {string} passwordSalt - Optional salt used to hash password.
|
|
640
|
+
* @param {number} passwordCpu - Optional CPU cost used to hash password.
|
|
641
|
+
* @param {number} passwordMemory - Optional memory cost used to hash password.
|
|
642
|
+
* @param {number} passwordParallel - Optional parallelization cost used to hash password.
|
|
643
|
+
* @param {number} passwordLength - Optional hash length used to hash password.
|
|
644
|
+
* @param {string} name - User name. Max length: 128 chars.
|
|
353
645
|
* @throws {AppwriteException}
|
|
354
646
|
* @returns {Promise<Models.User<Preferences>>}
|
|
647
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
355
648
|
*/
|
|
356
|
-
createScryptUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number, passwordMemory: number, passwordParallel: number, passwordLength: number, name?: string): Promise<Models.User<Preferences
|
|
649
|
+
createScryptUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number, passwordMemory: number, passwordParallel: number, passwordLength: number, name?: string): Promise<Models.User<Preferences>>;
|
|
650
|
+
createScryptUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(
|
|
651
|
+
paramsOrFirst: { userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number, passwordMemory: number, passwordParallel: number, passwordLength: number, name?: string } | string,
|
|
652
|
+
...rest: [(string)?, (string)?, (string)?, (number)?, (number)?, (number)?, (number)?, (string)?]
|
|
653
|
+
): Promise<Models.User<Preferences>> {
|
|
654
|
+
let params: { userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number, passwordMemory: number, passwordParallel: number, passwordLength: number, name?: string };
|
|
655
|
+
|
|
656
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
657
|
+
params = (paramsOrFirst || {}) as { userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number, passwordMemory: number, passwordParallel: number, passwordLength: number, name?: string };
|
|
658
|
+
} else {
|
|
659
|
+
params = {
|
|
660
|
+
userId: paramsOrFirst as string,
|
|
661
|
+
email: rest[0] as string,
|
|
662
|
+
password: rest[1] as string,
|
|
663
|
+
passwordSalt: rest[2] as string,
|
|
664
|
+
passwordCpu: rest[3] as number,
|
|
665
|
+
passwordMemory: rest[4] as number,
|
|
666
|
+
passwordParallel: rest[5] as number,
|
|
667
|
+
passwordLength: rest[6] as number,
|
|
668
|
+
name: rest[7] as string
|
|
669
|
+
};
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
const userId = params.userId;
|
|
673
|
+
const email = params.email;
|
|
674
|
+
const password = params.password;
|
|
675
|
+
const passwordSalt = params.passwordSalt;
|
|
676
|
+
const passwordCpu = params.passwordCpu;
|
|
677
|
+
const passwordMemory = params.passwordMemory;
|
|
678
|
+
const passwordParallel = params.passwordParallel;
|
|
679
|
+
const passwordLength = params.passwordLength;
|
|
680
|
+
const name = params.name;
|
|
681
|
+
|
|
357
682
|
if (typeof userId === 'undefined') {
|
|
358
683
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
359
684
|
}
|
|
@@ -378,6 +703,7 @@ export class Users {
|
|
|
378
703
|
if (typeof passwordLength === 'undefined') {
|
|
379
704
|
throw new AppwriteException('Missing required parameter: "passwordLength"');
|
|
380
705
|
}
|
|
706
|
+
|
|
381
707
|
const apiPath = '/users/scrypt';
|
|
382
708
|
const payload: Payload = {};
|
|
383
709
|
if (typeof userId !== 'undefined') {
|
|
@@ -424,17 +750,60 @@ export class Users {
|
|
|
424
750
|
/**
|
|
425
751
|
* Create a new user. Password provided must be hashed with the [Scrypt Modified](https://gist.github.com/Meldiron/eecf84a0225eccb5a378d45bb27462cc) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
|
|
426
752
|
*
|
|
427
|
-
* @param {string} userId
|
|
428
|
-
* @param {string} email
|
|
429
|
-
* @param {string} password
|
|
430
|
-
* @param {string} passwordSalt
|
|
431
|
-
* @param {string} passwordSaltSeparator
|
|
432
|
-
* @param {string} passwordSignerKey
|
|
433
|
-
* @param {string} name
|
|
753
|
+
* @param {string} params.userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
754
|
+
* @param {string} params.email - User email.
|
|
755
|
+
* @param {string} params.password - User password hashed using Scrypt Modified.
|
|
756
|
+
* @param {string} params.passwordSalt - Salt used to hash password.
|
|
757
|
+
* @param {string} params.passwordSaltSeparator - Salt separator used to hash password.
|
|
758
|
+
* @param {string} params.passwordSignerKey - Signer key used to hash password.
|
|
759
|
+
* @param {string} params.name - User name. Max length: 128 chars.
|
|
760
|
+
* @throws {AppwriteException}
|
|
761
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
762
|
+
*/
|
|
763
|
+
createScryptModifiedUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, email: string, password: string, passwordSalt: string, passwordSaltSeparator: string, passwordSignerKey: string, name?: string }): Promise<Models.User<Preferences>>;
|
|
764
|
+
/**
|
|
765
|
+
* Create a new user. Password provided must be hashed with the [Scrypt Modified](https://gist.github.com/Meldiron/eecf84a0225eccb5a378d45bb27462cc) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
|
|
766
|
+
*
|
|
767
|
+
* @param {string} userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
768
|
+
* @param {string} email - User email.
|
|
769
|
+
* @param {string} password - User password hashed using Scrypt Modified.
|
|
770
|
+
* @param {string} passwordSalt - Salt used to hash password.
|
|
771
|
+
* @param {string} passwordSaltSeparator - Salt separator used to hash password.
|
|
772
|
+
* @param {string} passwordSignerKey - Signer key used to hash password.
|
|
773
|
+
* @param {string} name - User name. Max length: 128 chars.
|
|
434
774
|
* @throws {AppwriteException}
|
|
435
775
|
* @returns {Promise<Models.User<Preferences>>}
|
|
776
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
436
777
|
*/
|
|
437
|
-
createScryptModifiedUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, passwordSalt: string, passwordSaltSeparator: string, passwordSignerKey: string, name?: string): Promise<Models.User<Preferences
|
|
778
|
+
createScryptModifiedUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, passwordSalt: string, passwordSaltSeparator: string, passwordSignerKey: string, name?: string): Promise<Models.User<Preferences>>;
|
|
779
|
+
createScryptModifiedUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(
|
|
780
|
+
paramsOrFirst: { userId: string, email: string, password: string, passwordSalt: string, passwordSaltSeparator: string, passwordSignerKey: string, name?: string } | string,
|
|
781
|
+
...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (string)?]
|
|
782
|
+
): Promise<Models.User<Preferences>> {
|
|
783
|
+
let params: { userId: string, email: string, password: string, passwordSalt: string, passwordSaltSeparator: string, passwordSignerKey: string, name?: string };
|
|
784
|
+
|
|
785
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
786
|
+
params = (paramsOrFirst || {}) as { userId: string, email: string, password: string, passwordSalt: string, passwordSaltSeparator: string, passwordSignerKey: string, name?: string };
|
|
787
|
+
} else {
|
|
788
|
+
params = {
|
|
789
|
+
userId: paramsOrFirst as string,
|
|
790
|
+
email: rest[0] as string,
|
|
791
|
+
password: rest[1] as string,
|
|
792
|
+
passwordSalt: rest[2] as string,
|
|
793
|
+
passwordSaltSeparator: rest[3] as string,
|
|
794
|
+
passwordSignerKey: rest[4] as string,
|
|
795
|
+
name: rest[5] as string
|
|
796
|
+
};
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
const userId = params.userId;
|
|
800
|
+
const email = params.email;
|
|
801
|
+
const password = params.password;
|
|
802
|
+
const passwordSalt = params.passwordSalt;
|
|
803
|
+
const passwordSaltSeparator = params.passwordSaltSeparator;
|
|
804
|
+
const passwordSignerKey = params.passwordSignerKey;
|
|
805
|
+
const name = params.name;
|
|
806
|
+
|
|
438
807
|
if (typeof userId === 'undefined') {
|
|
439
808
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
440
809
|
}
|
|
@@ -453,6 +822,7 @@ export class Users {
|
|
|
453
822
|
if (typeof passwordSignerKey === 'undefined') {
|
|
454
823
|
throw new AppwriteException('Missing required parameter: "passwordSignerKey"');
|
|
455
824
|
}
|
|
825
|
+
|
|
456
826
|
const apiPath = '/users/scrypt-modified';
|
|
457
827
|
const payload: Payload = {};
|
|
458
828
|
if (typeof userId !== 'undefined') {
|
|
@@ -493,15 +863,52 @@ export class Users {
|
|
|
493
863
|
/**
|
|
494
864
|
* Create a new user. Password provided must be hashed with the [SHA](https://en.wikipedia.org/wiki/Secure_Hash_Algorithm) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
|
|
495
865
|
*
|
|
496
|
-
* @param {string} userId
|
|
497
|
-
* @param {string} email
|
|
498
|
-
* @param {string} password
|
|
499
|
-
* @param {PasswordHash} passwordVersion
|
|
500
|
-
* @param {string} name
|
|
866
|
+
* @param {string} params.userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
867
|
+
* @param {string} params.email - User email.
|
|
868
|
+
* @param {string} params.password - User password hashed using SHA.
|
|
869
|
+
* @param {PasswordHash} params.passwordVersion - Optional SHA version used to hash password. Allowed values are: 'sha1', 'sha224', 'sha256', 'sha384', 'sha512/224', 'sha512/256', 'sha512', 'sha3-224', 'sha3-256', 'sha3-384', 'sha3-512'
|
|
870
|
+
* @param {string} params.name - User name. Max length: 128 chars.
|
|
871
|
+
* @throws {AppwriteException}
|
|
872
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
873
|
+
*/
|
|
874
|
+
createSHAUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, email: string, password: string, passwordVersion?: PasswordHash, name?: string }): Promise<Models.User<Preferences>>;
|
|
875
|
+
/**
|
|
876
|
+
* Create a new user. Password provided must be hashed with the [SHA](https://en.wikipedia.org/wiki/Secure_Hash_Algorithm) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
|
|
877
|
+
*
|
|
878
|
+
* @param {string} userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
879
|
+
* @param {string} email - User email.
|
|
880
|
+
* @param {string} password - User password hashed using SHA.
|
|
881
|
+
* @param {PasswordHash} passwordVersion - Optional SHA version used to hash password. Allowed values are: 'sha1', 'sha224', 'sha256', 'sha384', 'sha512/224', 'sha512/256', 'sha512', 'sha3-224', 'sha3-256', 'sha3-384', 'sha3-512'
|
|
882
|
+
* @param {string} name - User name. Max length: 128 chars.
|
|
501
883
|
* @throws {AppwriteException}
|
|
502
884
|
* @returns {Promise<Models.User<Preferences>>}
|
|
885
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
503
886
|
*/
|
|
504
|
-
createSHAUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, passwordVersion?: PasswordHash, name?: string): Promise<Models.User<Preferences
|
|
887
|
+
createSHAUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, passwordVersion?: PasswordHash, name?: string): Promise<Models.User<Preferences>>;
|
|
888
|
+
createSHAUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(
|
|
889
|
+
paramsOrFirst: { userId: string, email: string, password: string, passwordVersion?: PasswordHash, name?: string } | string,
|
|
890
|
+
...rest: [(string)?, (string)?, (PasswordHash)?, (string)?]
|
|
891
|
+
): Promise<Models.User<Preferences>> {
|
|
892
|
+
let params: { userId: string, email: string, password: string, passwordVersion?: PasswordHash, name?: string };
|
|
893
|
+
|
|
894
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
895
|
+
params = (paramsOrFirst || {}) as { userId: string, email: string, password: string, passwordVersion?: PasswordHash, name?: string };
|
|
896
|
+
} else {
|
|
897
|
+
params = {
|
|
898
|
+
userId: paramsOrFirst as string,
|
|
899
|
+
email: rest[0] as string,
|
|
900
|
+
password: rest[1] as string,
|
|
901
|
+
passwordVersion: rest[2] as PasswordHash,
|
|
902
|
+
name: rest[3] as string
|
|
903
|
+
};
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
const userId = params.userId;
|
|
907
|
+
const email = params.email;
|
|
908
|
+
const password = params.password;
|
|
909
|
+
const passwordVersion = params.passwordVersion;
|
|
910
|
+
const name = params.name;
|
|
911
|
+
|
|
505
912
|
if (typeof userId === 'undefined') {
|
|
506
913
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
507
914
|
}
|
|
@@ -511,6 +918,7 @@ export class Users {
|
|
|
511
918
|
if (typeof password === 'undefined') {
|
|
512
919
|
throw new AppwriteException('Missing required parameter: "password"');
|
|
513
920
|
}
|
|
921
|
+
|
|
514
922
|
const apiPath = '/users/sha';
|
|
515
923
|
const payload: Payload = {};
|
|
516
924
|
if (typeof userId !== 'undefined') {
|
|
@@ -546,11 +954,37 @@ export class Users {
|
|
|
546
954
|
* Get usage metrics and statistics for all users in the project. You can view the total number of users and sessions. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.
|
|
547
955
|
*
|
|
548
956
|
*
|
|
549
|
-
* @param {
|
|
957
|
+
* @param {UsageRange} params.range - Date range.
|
|
958
|
+
* @throws {AppwriteException}
|
|
959
|
+
* @returns {Promise<Models.UsageUsers>}
|
|
960
|
+
*/
|
|
961
|
+
getUsage(params?: { range?: UsageRange }): Promise<Models.UsageUsers>;
|
|
962
|
+
/**
|
|
963
|
+
* Get usage metrics and statistics for all users in the project. You can view the total number of users and sessions. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.
|
|
964
|
+
*
|
|
965
|
+
*
|
|
966
|
+
* @param {UsageRange} range - Date range.
|
|
550
967
|
* @throws {AppwriteException}
|
|
551
968
|
* @returns {Promise<Models.UsageUsers>}
|
|
969
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
552
970
|
*/
|
|
553
|
-
getUsage(range?:
|
|
971
|
+
getUsage(range?: UsageRange): Promise<Models.UsageUsers>;
|
|
972
|
+
getUsage(
|
|
973
|
+
paramsOrFirst?: { range?: UsageRange } | UsageRange
|
|
974
|
+
): Promise<Models.UsageUsers> {
|
|
975
|
+
let params: { range?: UsageRange };
|
|
976
|
+
|
|
977
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'range' in paramsOrFirst)) {
|
|
978
|
+
params = (paramsOrFirst || {}) as { range?: UsageRange };
|
|
979
|
+
} else {
|
|
980
|
+
params = {
|
|
981
|
+
range: paramsOrFirst as UsageRange
|
|
982
|
+
};
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
const range = params.range;
|
|
986
|
+
|
|
987
|
+
|
|
554
988
|
const apiPath = '/users/usage';
|
|
555
989
|
const payload: Payload = {};
|
|
556
990
|
if (typeof range !== 'undefined') {
|
|
@@ -572,14 +1006,39 @@ export class Users {
|
|
|
572
1006
|
/**
|
|
573
1007
|
* Get a user by its unique ID.
|
|
574
1008
|
*
|
|
575
|
-
* @param {string} userId
|
|
1009
|
+
* @param {string} params.userId - User ID.
|
|
1010
|
+
* @throws {AppwriteException}
|
|
1011
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
1012
|
+
*/
|
|
1013
|
+
get<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string }): Promise<Models.User<Preferences>>;
|
|
1014
|
+
/**
|
|
1015
|
+
* Get a user by its unique ID.
|
|
1016
|
+
*
|
|
1017
|
+
* @param {string} userId - User ID.
|
|
576
1018
|
* @throws {AppwriteException}
|
|
577
1019
|
* @returns {Promise<Models.User<Preferences>>}
|
|
1020
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
578
1021
|
*/
|
|
579
|
-
get<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string): Promise<Models.User<Preferences
|
|
1022
|
+
get<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string): Promise<Models.User<Preferences>>;
|
|
1023
|
+
get<Preferences extends Models.Preferences = Models.DefaultPreferences>(
|
|
1024
|
+
paramsOrFirst: { userId: string } | string
|
|
1025
|
+
): Promise<Models.User<Preferences>> {
|
|
1026
|
+
let params: { userId: string };
|
|
1027
|
+
|
|
1028
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1029
|
+
params = (paramsOrFirst || {}) as { userId: string };
|
|
1030
|
+
} else {
|
|
1031
|
+
params = {
|
|
1032
|
+
userId: paramsOrFirst as string
|
|
1033
|
+
};
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
const userId = params.userId;
|
|
1037
|
+
|
|
580
1038
|
if (typeof userId === 'undefined') {
|
|
581
1039
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
582
1040
|
}
|
|
1041
|
+
|
|
583
1042
|
const apiPath = '/users/{userId}'.replace('{userId}', userId);
|
|
584
1043
|
const payload: Payload = {};
|
|
585
1044
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -596,16 +1055,41 @@ export class Users {
|
|
|
596
1055
|
}
|
|
597
1056
|
|
|
598
1057
|
/**
|
|
599
|
-
* Delete a user by its unique ID, thereby releasing it
|
|
1058
|
+
* Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](https://appwrite.io/docs/server/users#usersUpdateStatus) endpoint instead.
|
|
1059
|
+
*
|
|
1060
|
+
* @param {string} params.userId - User ID.
|
|
1061
|
+
* @throws {AppwriteException}
|
|
1062
|
+
* @returns {Promise<{}>}
|
|
1063
|
+
*/
|
|
1064
|
+
delete(params: { userId: string }): Promise<{}>;
|
|
1065
|
+
/**
|
|
1066
|
+
* Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](https://appwrite.io/docs/server/users#usersUpdateStatus) endpoint instead.
|
|
600
1067
|
*
|
|
601
|
-
* @param {string} userId
|
|
1068
|
+
* @param {string} userId - User ID.
|
|
602
1069
|
* @throws {AppwriteException}
|
|
603
1070
|
* @returns {Promise<{}>}
|
|
1071
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
604
1072
|
*/
|
|
605
|
-
delete(userId: string): Promise<{}
|
|
1073
|
+
delete(userId: string): Promise<{}>;
|
|
1074
|
+
delete(
|
|
1075
|
+
paramsOrFirst: { userId: string } | string
|
|
1076
|
+
): Promise<{}> {
|
|
1077
|
+
let params: { userId: string };
|
|
1078
|
+
|
|
1079
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1080
|
+
params = (paramsOrFirst || {}) as { userId: string };
|
|
1081
|
+
} else {
|
|
1082
|
+
params = {
|
|
1083
|
+
userId: paramsOrFirst as string
|
|
1084
|
+
};
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
const userId = params.userId;
|
|
1088
|
+
|
|
606
1089
|
if (typeof userId === 'undefined') {
|
|
607
1090
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
608
1091
|
}
|
|
1092
|
+
|
|
609
1093
|
const apiPath = '/users/{userId}'.replace('{userId}', userId);
|
|
610
1094
|
const payload: Payload = {};
|
|
611
1095
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -625,18 +1109,47 @@ export class Users {
|
|
|
625
1109
|
/**
|
|
626
1110
|
* Update the user email by its unique ID.
|
|
627
1111
|
*
|
|
628
|
-
* @param {string} userId
|
|
629
|
-
* @param {string} email
|
|
1112
|
+
* @param {string} params.userId - User ID.
|
|
1113
|
+
* @param {string} params.email - User email.
|
|
1114
|
+
* @throws {AppwriteException}
|
|
1115
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
1116
|
+
*/
|
|
1117
|
+
updateEmail<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, email: string }): Promise<Models.User<Preferences>>;
|
|
1118
|
+
/**
|
|
1119
|
+
* Update the user email by its unique ID.
|
|
1120
|
+
*
|
|
1121
|
+
* @param {string} userId - User ID.
|
|
1122
|
+
* @param {string} email - User email.
|
|
630
1123
|
* @throws {AppwriteException}
|
|
631
1124
|
* @returns {Promise<Models.User<Preferences>>}
|
|
1125
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
632
1126
|
*/
|
|
633
|
-
updateEmail<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string): Promise<Models.User<Preferences
|
|
1127
|
+
updateEmail<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string): Promise<Models.User<Preferences>>;
|
|
1128
|
+
updateEmail<Preferences extends Models.Preferences = Models.DefaultPreferences>(
|
|
1129
|
+
paramsOrFirst: { userId: string, email: string } | string,
|
|
1130
|
+
...rest: [(string)?]
|
|
1131
|
+
): Promise<Models.User<Preferences>> {
|
|
1132
|
+
let params: { userId: string, email: string };
|
|
1133
|
+
|
|
1134
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1135
|
+
params = (paramsOrFirst || {}) as { userId: string, email: string };
|
|
1136
|
+
} else {
|
|
1137
|
+
params = {
|
|
1138
|
+
userId: paramsOrFirst as string,
|
|
1139
|
+
email: rest[0] as string
|
|
1140
|
+
};
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
const userId = params.userId;
|
|
1144
|
+
const email = params.email;
|
|
1145
|
+
|
|
634
1146
|
if (typeof userId === 'undefined') {
|
|
635
1147
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
636
1148
|
}
|
|
637
1149
|
if (typeof email === 'undefined') {
|
|
638
1150
|
throw new AppwriteException('Missing required parameter: "email"');
|
|
639
1151
|
}
|
|
1152
|
+
|
|
640
1153
|
const apiPath = '/users/{userId}/email'.replace('{userId}', userId);
|
|
641
1154
|
const payload: Payload = {};
|
|
642
1155
|
if (typeof email !== 'undefined') {
|
|
@@ -659,16 +1172,48 @@ export class Users {
|
|
|
659
1172
|
/**
|
|
660
1173
|
* Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted.
|
|
661
1174
|
*
|
|
662
|
-
* @param {string} userId
|
|
663
|
-
* @param {string} sessionId
|
|
664
|
-
* @param {number} duration
|
|
1175
|
+
* @param {string} params.userId - User ID.
|
|
1176
|
+
* @param {string} params.sessionId - Session ID. Use the string 'recent' to use the most recent session. Defaults to the most recent session.
|
|
1177
|
+
* @param {number} params.duration - Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.
|
|
1178
|
+
* @throws {AppwriteException}
|
|
1179
|
+
* @returns {Promise<Models.Jwt>}
|
|
1180
|
+
*/
|
|
1181
|
+
createJWT(params: { userId: string, sessionId?: string, duration?: number }): Promise<Models.Jwt>;
|
|
1182
|
+
/**
|
|
1183
|
+
* Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted.
|
|
1184
|
+
*
|
|
1185
|
+
* @param {string} userId - User ID.
|
|
1186
|
+
* @param {string} sessionId - Session ID. Use the string 'recent' to use the most recent session. Defaults to the most recent session.
|
|
1187
|
+
* @param {number} duration - Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.
|
|
665
1188
|
* @throws {AppwriteException}
|
|
666
1189
|
* @returns {Promise<Models.Jwt>}
|
|
1190
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
667
1191
|
*/
|
|
668
|
-
createJWT(userId: string, sessionId?: string, duration?: number): Promise<Models.Jwt
|
|
1192
|
+
createJWT(userId: string, sessionId?: string, duration?: number): Promise<Models.Jwt>;
|
|
1193
|
+
createJWT(
|
|
1194
|
+
paramsOrFirst: { userId: string, sessionId?: string, duration?: number } | string,
|
|
1195
|
+
...rest: [(string)?, (number)?]
|
|
1196
|
+
): Promise<Models.Jwt> {
|
|
1197
|
+
let params: { userId: string, sessionId?: string, duration?: number };
|
|
1198
|
+
|
|
1199
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1200
|
+
params = (paramsOrFirst || {}) as { userId: string, sessionId?: string, duration?: number };
|
|
1201
|
+
} else {
|
|
1202
|
+
params = {
|
|
1203
|
+
userId: paramsOrFirst as string,
|
|
1204
|
+
sessionId: rest[0] as string,
|
|
1205
|
+
duration: rest[1] as number
|
|
1206
|
+
};
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
const userId = params.userId;
|
|
1210
|
+
const sessionId = params.sessionId;
|
|
1211
|
+
const duration = params.duration;
|
|
1212
|
+
|
|
669
1213
|
if (typeof userId === 'undefined') {
|
|
670
1214
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
671
1215
|
}
|
|
1216
|
+
|
|
672
1217
|
const apiPath = '/users/{userId}/jwts'.replace('{userId}', userId);
|
|
673
1218
|
const payload: Payload = {};
|
|
674
1219
|
if (typeof sessionId !== 'undefined') {
|
|
@@ -694,20 +1239,51 @@ export class Users {
|
|
|
694
1239
|
/**
|
|
695
1240
|
* Update the user labels by its unique ID.
|
|
696
1241
|
*
|
|
697
|
-
* Labels can be used to grant access to resources. While teams are a way for user
|
|
1242
|
+
* Labels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https://appwrite.io/docs/permissions) for more info.
|
|
1243
|
+
*
|
|
1244
|
+
* @param {string} params.userId - User ID.
|
|
1245
|
+
* @param {string[]} params.labels - Array of user labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long.
|
|
1246
|
+
* @throws {AppwriteException}
|
|
1247
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
1248
|
+
*/
|
|
1249
|
+
updateLabels<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, labels: string[] }): Promise<Models.User<Preferences>>;
|
|
1250
|
+
/**
|
|
1251
|
+
* Update the user labels by its unique ID.
|
|
1252
|
+
*
|
|
1253
|
+
* Labels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https://appwrite.io/docs/permissions) for more info.
|
|
698
1254
|
*
|
|
699
|
-
* @param {string} userId
|
|
700
|
-
* @param {string[]} labels
|
|
1255
|
+
* @param {string} userId - User ID.
|
|
1256
|
+
* @param {string[]} labels - Array of user labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long.
|
|
701
1257
|
* @throws {AppwriteException}
|
|
702
1258
|
* @returns {Promise<Models.User<Preferences>>}
|
|
1259
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
703
1260
|
*/
|
|
704
|
-
updateLabels<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, labels: string[]): Promise<Models.User<Preferences
|
|
1261
|
+
updateLabels<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, labels: string[]): Promise<Models.User<Preferences>>;
|
|
1262
|
+
updateLabels<Preferences extends Models.Preferences = Models.DefaultPreferences>(
|
|
1263
|
+
paramsOrFirst: { userId: string, labels: string[] } | string,
|
|
1264
|
+
...rest: [(string[])?]
|
|
1265
|
+
): Promise<Models.User<Preferences>> {
|
|
1266
|
+
let params: { userId: string, labels: string[] };
|
|
1267
|
+
|
|
1268
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1269
|
+
params = (paramsOrFirst || {}) as { userId: string, labels: string[] };
|
|
1270
|
+
} else {
|
|
1271
|
+
params = {
|
|
1272
|
+
userId: paramsOrFirst as string,
|
|
1273
|
+
labels: rest[0] as string[]
|
|
1274
|
+
};
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
const userId = params.userId;
|
|
1278
|
+
const labels = params.labels;
|
|
1279
|
+
|
|
705
1280
|
if (typeof userId === 'undefined') {
|
|
706
1281
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
707
1282
|
}
|
|
708
1283
|
if (typeof labels === 'undefined') {
|
|
709
1284
|
throw new AppwriteException('Missing required parameter: "labels"');
|
|
710
1285
|
}
|
|
1286
|
+
|
|
711
1287
|
const apiPath = '/users/{userId}/labels'.replace('{userId}', userId);
|
|
712
1288
|
const payload: Payload = {};
|
|
713
1289
|
if (typeof labels !== 'undefined') {
|
|
@@ -730,20 +1306,56 @@ export class Users {
|
|
|
730
1306
|
/**
|
|
731
1307
|
* Get the user activity logs list by its unique ID.
|
|
732
1308
|
*
|
|
733
|
-
* @param {string} userId
|
|
734
|
-
* @param {string[]} queries
|
|
1309
|
+
* @param {string} params.userId - User ID.
|
|
1310
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
|
|
1311
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
1312
|
+
* @throws {AppwriteException}
|
|
1313
|
+
* @returns {Promise<Models.LogList>}
|
|
1314
|
+
*/
|
|
1315
|
+
listLogs(params: { userId: string, queries?: string[], total?: boolean }): Promise<Models.LogList>;
|
|
1316
|
+
/**
|
|
1317
|
+
* Get the user activity logs list by its unique ID.
|
|
1318
|
+
*
|
|
1319
|
+
* @param {string} userId - User ID.
|
|
1320
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
|
|
1321
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
735
1322
|
* @throws {AppwriteException}
|
|
736
1323
|
* @returns {Promise<Models.LogList>}
|
|
1324
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
737
1325
|
*/
|
|
738
|
-
listLogs(userId: string, queries?: string[]): Promise<Models.LogList
|
|
1326
|
+
listLogs(userId: string, queries?: string[], total?: boolean): Promise<Models.LogList>;
|
|
1327
|
+
listLogs(
|
|
1328
|
+
paramsOrFirst: { userId: string, queries?: string[], total?: boolean } | string,
|
|
1329
|
+
...rest: [(string[])?, (boolean)?]
|
|
1330
|
+
): Promise<Models.LogList> {
|
|
1331
|
+
let params: { userId: string, queries?: string[], total?: boolean };
|
|
1332
|
+
|
|
1333
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1334
|
+
params = (paramsOrFirst || {}) as { userId: string, queries?: string[], total?: boolean };
|
|
1335
|
+
} else {
|
|
1336
|
+
params = {
|
|
1337
|
+
userId: paramsOrFirst as string,
|
|
1338
|
+
queries: rest[0] as string[],
|
|
1339
|
+
total: rest[1] as boolean
|
|
1340
|
+
};
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
const userId = params.userId;
|
|
1344
|
+
const queries = params.queries;
|
|
1345
|
+
const total = params.total;
|
|
1346
|
+
|
|
739
1347
|
if (typeof userId === 'undefined') {
|
|
740
1348
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
741
1349
|
}
|
|
1350
|
+
|
|
742
1351
|
const apiPath = '/users/{userId}/logs'.replace('{userId}', userId);
|
|
743
1352
|
const payload: Payload = {};
|
|
744
1353
|
if (typeof queries !== 'undefined') {
|
|
745
1354
|
payload['queries'] = queries;
|
|
746
1355
|
}
|
|
1356
|
+
if (typeof total !== 'undefined') {
|
|
1357
|
+
payload['total'] = total;
|
|
1358
|
+
}
|
|
747
1359
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
748
1360
|
|
|
749
1361
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -760,16 +1372,52 @@ export class Users {
|
|
|
760
1372
|
/**
|
|
761
1373
|
* Get the user membership list by its unique ID.
|
|
762
1374
|
*
|
|
763
|
-
* @param {string} userId
|
|
764
|
-
* @param {string[]} queries
|
|
765
|
-
* @param {string} search
|
|
1375
|
+
* @param {string} params.userId - User ID.
|
|
1376
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles
|
|
1377
|
+
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
|
1378
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
1379
|
+
* @throws {AppwriteException}
|
|
1380
|
+
* @returns {Promise<Models.MembershipList>}
|
|
1381
|
+
*/
|
|
1382
|
+
listMemberships(params: { userId: string, queries?: string[], search?: string, total?: boolean }): Promise<Models.MembershipList>;
|
|
1383
|
+
/**
|
|
1384
|
+
* Get the user membership list by its unique ID.
|
|
1385
|
+
*
|
|
1386
|
+
* @param {string} userId - User ID.
|
|
1387
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles
|
|
1388
|
+
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
|
1389
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
766
1390
|
* @throws {AppwriteException}
|
|
767
1391
|
* @returns {Promise<Models.MembershipList>}
|
|
1392
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
768
1393
|
*/
|
|
769
|
-
listMemberships(userId: string, queries?: string[], search?: string): Promise<Models.MembershipList
|
|
1394
|
+
listMemberships(userId: string, queries?: string[], search?: string, total?: boolean): Promise<Models.MembershipList>;
|
|
1395
|
+
listMemberships(
|
|
1396
|
+
paramsOrFirst: { userId: string, queries?: string[], search?: string, total?: boolean } | string,
|
|
1397
|
+
...rest: [(string[])?, (string)?, (boolean)?]
|
|
1398
|
+
): Promise<Models.MembershipList> {
|
|
1399
|
+
let params: { userId: string, queries?: string[], search?: string, total?: boolean };
|
|
1400
|
+
|
|
1401
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1402
|
+
params = (paramsOrFirst || {}) as { userId: string, queries?: string[], search?: string, total?: boolean };
|
|
1403
|
+
} else {
|
|
1404
|
+
params = {
|
|
1405
|
+
userId: paramsOrFirst as string,
|
|
1406
|
+
queries: rest[0] as string[],
|
|
1407
|
+
search: rest[1] as string,
|
|
1408
|
+
total: rest[2] as boolean
|
|
1409
|
+
};
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1412
|
+
const userId = params.userId;
|
|
1413
|
+
const queries = params.queries;
|
|
1414
|
+
const search = params.search;
|
|
1415
|
+
const total = params.total;
|
|
1416
|
+
|
|
770
1417
|
if (typeof userId === 'undefined') {
|
|
771
1418
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
772
1419
|
}
|
|
1420
|
+
|
|
773
1421
|
const apiPath = '/users/{userId}/memberships'.replace('{userId}', userId);
|
|
774
1422
|
const payload: Payload = {};
|
|
775
1423
|
if (typeof queries !== 'undefined') {
|
|
@@ -778,6 +1426,9 @@ export class Users {
|
|
|
778
1426
|
if (typeof search !== 'undefined') {
|
|
779
1427
|
payload['search'] = search;
|
|
780
1428
|
}
|
|
1429
|
+
if (typeof total !== 'undefined') {
|
|
1430
|
+
payload['total'] = total;
|
|
1431
|
+
}
|
|
781
1432
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
782
1433
|
|
|
783
1434
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -794,18 +1445,48 @@ export class Users {
|
|
|
794
1445
|
/**
|
|
795
1446
|
* Enable or disable MFA on a user account.
|
|
796
1447
|
*
|
|
797
|
-
* @param {string} userId
|
|
798
|
-
* @param {boolean} mfa
|
|
1448
|
+
* @param {string} params.userId - User ID.
|
|
1449
|
+
* @param {boolean} params.mfa - Enable or disable MFA.
|
|
1450
|
+
* @throws {AppwriteException}
|
|
1451
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
1452
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `Users.updateMFA` instead.
|
|
1453
|
+
*/
|
|
1454
|
+
updateMfa<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, mfa: boolean }): Promise<Models.User<Preferences>>;
|
|
1455
|
+
/**
|
|
1456
|
+
* Enable or disable MFA on a user account.
|
|
1457
|
+
*
|
|
1458
|
+
* @param {string} userId - User ID.
|
|
1459
|
+
* @param {boolean} mfa - Enable or disable MFA.
|
|
799
1460
|
* @throws {AppwriteException}
|
|
800
1461
|
* @returns {Promise<Models.User<Preferences>>}
|
|
1462
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
801
1463
|
*/
|
|
802
|
-
updateMfa<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, mfa: boolean): Promise<Models.User<Preferences
|
|
1464
|
+
updateMfa<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, mfa: boolean): Promise<Models.User<Preferences>>;
|
|
1465
|
+
updateMfa<Preferences extends Models.Preferences = Models.DefaultPreferences>(
|
|
1466
|
+
paramsOrFirst: { userId: string, mfa: boolean } | string,
|
|
1467
|
+
...rest: [(boolean)?]
|
|
1468
|
+
): Promise<Models.User<Preferences>> {
|
|
1469
|
+
let params: { userId: string, mfa: boolean };
|
|
1470
|
+
|
|
1471
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1472
|
+
params = (paramsOrFirst || {}) as { userId: string, mfa: boolean };
|
|
1473
|
+
} else {
|
|
1474
|
+
params = {
|
|
1475
|
+
userId: paramsOrFirst as string,
|
|
1476
|
+
mfa: rest[0] as boolean
|
|
1477
|
+
};
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1480
|
+
const userId = params.userId;
|
|
1481
|
+
const mfa = params.mfa;
|
|
1482
|
+
|
|
803
1483
|
if (typeof userId === 'undefined') {
|
|
804
1484
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
805
1485
|
}
|
|
806
1486
|
if (typeof mfa === 'undefined') {
|
|
807
1487
|
throw new AppwriteException('Missing required parameter: "mfa"');
|
|
808
1488
|
}
|
|
1489
|
+
|
|
809
1490
|
const apiPath = '/users/{userId}/mfa'.replace('{userId}', userId);
|
|
810
1491
|
const payload: Payload = {};
|
|
811
1492
|
if (typeof mfa !== 'undefined') {
|
|
@@ -826,22 +1507,54 @@ export class Users {
|
|
|
826
1507
|
}
|
|
827
1508
|
|
|
828
1509
|
/**
|
|
829
|
-
*
|
|
1510
|
+
* Enable or disable MFA on a user account.
|
|
830
1511
|
*
|
|
831
|
-
* @param {string} userId
|
|
832
|
-
* @param {
|
|
1512
|
+
* @param {string} params.userId - User ID.
|
|
1513
|
+
* @param {boolean} params.mfa - Enable or disable MFA.
|
|
833
1514
|
* @throws {AppwriteException}
|
|
834
|
-
* @returns {Promise<
|
|
1515
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
1516
|
+
*/
|
|
1517
|
+
updateMFA<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, mfa: boolean }): Promise<Models.User<Preferences>>;
|
|
1518
|
+
/**
|
|
1519
|
+
* Enable or disable MFA on a user account.
|
|
1520
|
+
*
|
|
1521
|
+
* @param {string} userId - User ID.
|
|
1522
|
+
* @param {boolean} mfa - Enable or disable MFA.
|
|
1523
|
+
* @throws {AppwriteException}
|
|
1524
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
1525
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
835
1526
|
*/
|
|
836
|
-
|
|
1527
|
+
updateMFA<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, mfa: boolean): Promise<Models.User<Preferences>>;
|
|
1528
|
+
updateMFA<Preferences extends Models.Preferences = Models.DefaultPreferences>(
|
|
1529
|
+
paramsOrFirst: { userId: string, mfa: boolean } | string,
|
|
1530
|
+
...rest: [(boolean)?]
|
|
1531
|
+
): Promise<Models.User<Preferences>> {
|
|
1532
|
+
let params: { userId: string, mfa: boolean };
|
|
1533
|
+
|
|
1534
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1535
|
+
params = (paramsOrFirst || {}) as { userId: string, mfa: boolean };
|
|
1536
|
+
} else {
|
|
1537
|
+
params = {
|
|
1538
|
+
userId: paramsOrFirst as string,
|
|
1539
|
+
mfa: rest[0] as boolean
|
|
1540
|
+
};
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1543
|
+
const userId = params.userId;
|
|
1544
|
+
const mfa = params.mfa;
|
|
1545
|
+
|
|
837
1546
|
if (typeof userId === 'undefined') {
|
|
838
1547
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
839
1548
|
}
|
|
840
|
-
if (typeof
|
|
841
|
-
throw new AppwriteException('Missing required parameter: "
|
|
1549
|
+
if (typeof mfa === 'undefined') {
|
|
1550
|
+
throw new AppwriteException('Missing required parameter: "mfa"');
|
|
842
1551
|
}
|
|
843
|
-
|
|
1552
|
+
|
|
1553
|
+
const apiPath = '/users/{userId}/mfa'.replace('{userId}', userId);
|
|
844
1554
|
const payload: Payload = {};
|
|
1555
|
+
if (typeof mfa !== 'undefined') {
|
|
1556
|
+
payload['mfa'] = mfa;
|
|
1557
|
+
}
|
|
845
1558
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
846
1559
|
|
|
847
1560
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -849,7 +1562,7 @@ export class Users {
|
|
|
849
1562
|
}
|
|
850
1563
|
|
|
851
1564
|
return this.client.call(
|
|
852
|
-
'
|
|
1565
|
+
'patch',
|
|
853
1566
|
uri,
|
|
854
1567
|
apiHeaders,
|
|
855
1568
|
payload
|
|
@@ -857,25 +1570,60 @@ export class Users {
|
|
|
857
1570
|
}
|
|
858
1571
|
|
|
859
1572
|
/**
|
|
860
|
-
*
|
|
1573
|
+
* Delete an authenticator app.
|
|
861
1574
|
*
|
|
862
|
-
* @param {string} userId
|
|
1575
|
+
* @param {string} params.userId - User ID.
|
|
1576
|
+
* @param {AuthenticatorType} params.type - Type of authenticator.
|
|
863
1577
|
* @throws {AppwriteException}
|
|
864
|
-
* @returns {Promise<
|
|
1578
|
+
* @returns {Promise<{}>}
|
|
1579
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `Users.deleteMFAAuthenticator` instead.
|
|
865
1580
|
*/
|
|
866
|
-
|
|
1581
|
+
deleteMfaAuthenticator(params: { userId: string, type: AuthenticatorType }): Promise<{}>;
|
|
1582
|
+
/**
|
|
1583
|
+
* Delete an authenticator app.
|
|
1584
|
+
*
|
|
1585
|
+
* @param {string} userId - User ID.
|
|
1586
|
+
* @param {AuthenticatorType} type - Type of authenticator.
|
|
1587
|
+
* @throws {AppwriteException}
|
|
1588
|
+
* @returns {Promise<{}>}
|
|
1589
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1590
|
+
*/
|
|
1591
|
+
deleteMfaAuthenticator(userId: string, type: AuthenticatorType): Promise<{}>;
|
|
1592
|
+
deleteMfaAuthenticator(
|
|
1593
|
+
paramsOrFirst: { userId: string, type: AuthenticatorType } | string,
|
|
1594
|
+
...rest: [(AuthenticatorType)?]
|
|
1595
|
+
): Promise<{}> {
|
|
1596
|
+
let params: { userId: string, type: AuthenticatorType };
|
|
1597
|
+
|
|
1598
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1599
|
+
params = (paramsOrFirst || {}) as { userId: string, type: AuthenticatorType };
|
|
1600
|
+
} else {
|
|
1601
|
+
params = {
|
|
1602
|
+
userId: paramsOrFirst as string,
|
|
1603
|
+
type: rest[0] as AuthenticatorType
|
|
1604
|
+
};
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1607
|
+
const userId = params.userId;
|
|
1608
|
+
const type = params.type;
|
|
1609
|
+
|
|
867
1610
|
if (typeof userId === 'undefined') {
|
|
868
1611
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
869
1612
|
}
|
|
870
|
-
|
|
1613
|
+
if (typeof type === 'undefined') {
|
|
1614
|
+
throw new AppwriteException('Missing required parameter: "type"');
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
const apiPath = '/users/{userId}/mfa/authenticators/{type}'.replace('{userId}', userId).replace('{type}', type);
|
|
871
1618
|
const payload: Payload = {};
|
|
872
1619
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
873
1620
|
|
|
874
1621
|
const apiHeaders: { [header: string]: string } = {
|
|
1622
|
+
'content-type': 'application/json',
|
|
875
1623
|
}
|
|
876
1624
|
|
|
877
1625
|
return this.client.call(
|
|
878
|
-
'
|
|
1626
|
+
'delete',
|
|
879
1627
|
uri,
|
|
880
1628
|
apiHeaders,
|
|
881
1629
|
payload
|
|
@@ -883,25 +1631,59 @@ export class Users {
|
|
|
883
1631
|
}
|
|
884
1632
|
|
|
885
1633
|
/**
|
|
886
|
-
*
|
|
1634
|
+
* Delete an authenticator app.
|
|
887
1635
|
*
|
|
888
|
-
* @param {string} userId
|
|
1636
|
+
* @param {string} params.userId - User ID.
|
|
1637
|
+
* @param {AuthenticatorType} params.type - Type of authenticator.
|
|
889
1638
|
* @throws {AppwriteException}
|
|
890
|
-
* @returns {Promise<
|
|
1639
|
+
* @returns {Promise<{}>}
|
|
1640
|
+
*/
|
|
1641
|
+
deleteMFAAuthenticator(params: { userId: string, type: AuthenticatorType }): Promise<{}>;
|
|
1642
|
+
/**
|
|
1643
|
+
* Delete an authenticator app.
|
|
1644
|
+
*
|
|
1645
|
+
* @param {string} userId - User ID.
|
|
1646
|
+
* @param {AuthenticatorType} type - Type of authenticator.
|
|
1647
|
+
* @throws {AppwriteException}
|
|
1648
|
+
* @returns {Promise<{}>}
|
|
1649
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
891
1650
|
*/
|
|
892
|
-
|
|
1651
|
+
deleteMFAAuthenticator(userId: string, type: AuthenticatorType): Promise<{}>;
|
|
1652
|
+
deleteMFAAuthenticator(
|
|
1653
|
+
paramsOrFirst: { userId: string, type: AuthenticatorType } | string,
|
|
1654
|
+
...rest: [(AuthenticatorType)?]
|
|
1655
|
+
): Promise<{}> {
|
|
1656
|
+
let params: { userId: string, type: AuthenticatorType };
|
|
1657
|
+
|
|
1658
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1659
|
+
params = (paramsOrFirst || {}) as { userId: string, type: AuthenticatorType };
|
|
1660
|
+
} else {
|
|
1661
|
+
params = {
|
|
1662
|
+
userId: paramsOrFirst as string,
|
|
1663
|
+
type: rest[0] as AuthenticatorType
|
|
1664
|
+
};
|
|
1665
|
+
}
|
|
1666
|
+
|
|
1667
|
+
const userId = params.userId;
|
|
1668
|
+
const type = params.type;
|
|
1669
|
+
|
|
893
1670
|
if (typeof userId === 'undefined') {
|
|
894
1671
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
895
1672
|
}
|
|
896
|
-
|
|
1673
|
+
if (typeof type === 'undefined') {
|
|
1674
|
+
throw new AppwriteException('Missing required parameter: "type"');
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1677
|
+
const apiPath = '/users/{userId}/mfa/authenticators/{type}'.replace('{userId}', userId).replace('{type}', type);
|
|
897
1678
|
const payload: Payload = {};
|
|
898
1679
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
899
1680
|
|
|
900
1681
|
const apiHeaders: { [header: string]: string } = {
|
|
1682
|
+
'content-type': 'application/json',
|
|
901
1683
|
}
|
|
902
1684
|
|
|
903
1685
|
return this.client.call(
|
|
904
|
-
'
|
|
1686
|
+
'delete',
|
|
905
1687
|
uri,
|
|
906
1688
|
apiHeaders,
|
|
907
1689
|
payload
|
|
@@ -909,26 +1691,51 @@ export class Users {
|
|
|
909
1691
|
}
|
|
910
1692
|
|
|
911
1693
|
/**
|
|
912
|
-
*
|
|
1694
|
+
* List the factors available on the account to be used as a MFA challange.
|
|
913
1695
|
*
|
|
914
|
-
* @param {string} userId
|
|
1696
|
+
* @param {string} params.userId - User ID.
|
|
915
1697
|
* @throws {AppwriteException}
|
|
916
|
-
* @returns {Promise<Models.
|
|
1698
|
+
* @returns {Promise<Models.MfaFactors>}
|
|
1699
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `Users.listMFAFactors` instead.
|
|
917
1700
|
*/
|
|
918
|
-
|
|
1701
|
+
listMfaFactors(params: { userId: string }): Promise<Models.MfaFactors>;
|
|
1702
|
+
/**
|
|
1703
|
+
* List the factors available on the account to be used as a MFA challange.
|
|
1704
|
+
*
|
|
1705
|
+
* @param {string} userId - User ID.
|
|
1706
|
+
* @throws {AppwriteException}
|
|
1707
|
+
* @returns {Promise<Models.MfaFactors>}
|
|
1708
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1709
|
+
*/
|
|
1710
|
+
listMfaFactors(userId: string): Promise<Models.MfaFactors>;
|
|
1711
|
+
listMfaFactors(
|
|
1712
|
+
paramsOrFirst: { userId: string } | string
|
|
1713
|
+
): Promise<Models.MfaFactors> {
|
|
1714
|
+
let params: { userId: string };
|
|
1715
|
+
|
|
1716
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1717
|
+
params = (paramsOrFirst || {}) as { userId: string };
|
|
1718
|
+
} else {
|
|
1719
|
+
params = {
|
|
1720
|
+
userId: paramsOrFirst as string
|
|
1721
|
+
};
|
|
1722
|
+
}
|
|
1723
|
+
|
|
1724
|
+
const userId = params.userId;
|
|
1725
|
+
|
|
919
1726
|
if (typeof userId === 'undefined') {
|
|
920
1727
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
921
1728
|
}
|
|
922
|
-
|
|
1729
|
+
|
|
1730
|
+
const apiPath = '/users/{userId}/mfa/factors'.replace('{userId}', userId);
|
|
923
1731
|
const payload: Payload = {};
|
|
924
1732
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
925
1733
|
|
|
926
1734
|
const apiHeaders: { [header: string]: string } = {
|
|
927
|
-
'content-type': 'application/json',
|
|
928
1735
|
}
|
|
929
1736
|
|
|
930
1737
|
return this.client.call(
|
|
931
|
-
'
|
|
1738
|
+
'get',
|
|
932
1739
|
uri,
|
|
933
1740
|
apiHeaders,
|
|
934
1741
|
payload
|
|
@@ -936,16 +1743,353 @@ export class Users {
|
|
|
936
1743
|
}
|
|
937
1744
|
|
|
938
1745
|
/**
|
|
939
|
-
*
|
|
1746
|
+
* List the factors available on the account to be used as a MFA challange.
|
|
940
1747
|
*
|
|
941
|
-
* @param {string} userId
|
|
1748
|
+
* @param {string} params.userId - User ID.
|
|
942
1749
|
* @throws {AppwriteException}
|
|
943
|
-
* @returns {Promise<Models.
|
|
1750
|
+
* @returns {Promise<Models.MfaFactors>}
|
|
1751
|
+
*/
|
|
1752
|
+
listMFAFactors(params: { userId: string }): Promise<Models.MfaFactors>;
|
|
1753
|
+
/**
|
|
1754
|
+
* List the factors available on the account to be used as a MFA challange.
|
|
1755
|
+
*
|
|
1756
|
+
* @param {string} userId - User ID.
|
|
1757
|
+
* @throws {AppwriteException}
|
|
1758
|
+
* @returns {Promise<Models.MfaFactors>}
|
|
1759
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
944
1760
|
*/
|
|
945
|
-
|
|
1761
|
+
listMFAFactors(userId: string): Promise<Models.MfaFactors>;
|
|
1762
|
+
listMFAFactors(
|
|
1763
|
+
paramsOrFirst: { userId: string } | string
|
|
1764
|
+
): Promise<Models.MfaFactors> {
|
|
1765
|
+
let params: { userId: string };
|
|
1766
|
+
|
|
1767
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1768
|
+
params = (paramsOrFirst || {}) as { userId: string };
|
|
1769
|
+
} else {
|
|
1770
|
+
params = {
|
|
1771
|
+
userId: paramsOrFirst as string
|
|
1772
|
+
};
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1775
|
+
const userId = params.userId;
|
|
1776
|
+
|
|
946
1777
|
if (typeof userId === 'undefined') {
|
|
947
1778
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
948
1779
|
}
|
|
1780
|
+
|
|
1781
|
+
const apiPath = '/users/{userId}/mfa/factors'.replace('{userId}', userId);
|
|
1782
|
+
const payload: Payload = {};
|
|
1783
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1784
|
+
|
|
1785
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1786
|
+
}
|
|
1787
|
+
|
|
1788
|
+
return this.client.call(
|
|
1789
|
+
'get',
|
|
1790
|
+
uri,
|
|
1791
|
+
apiHeaders,
|
|
1792
|
+
payload
|
|
1793
|
+
);
|
|
1794
|
+
}
|
|
1795
|
+
|
|
1796
|
+
/**
|
|
1797
|
+
* Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method.
|
|
1798
|
+
*
|
|
1799
|
+
* @param {string} params.userId - User ID.
|
|
1800
|
+
* @throws {AppwriteException}
|
|
1801
|
+
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
1802
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `Users.getMFARecoveryCodes` instead.
|
|
1803
|
+
*/
|
|
1804
|
+
getMfaRecoveryCodes(params: { userId: string }): Promise<Models.MfaRecoveryCodes>;
|
|
1805
|
+
/**
|
|
1806
|
+
* Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method.
|
|
1807
|
+
*
|
|
1808
|
+
* @param {string} userId - User ID.
|
|
1809
|
+
* @throws {AppwriteException}
|
|
1810
|
+
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
1811
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1812
|
+
*/
|
|
1813
|
+
getMfaRecoveryCodes(userId: string): Promise<Models.MfaRecoveryCodes>;
|
|
1814
|
+
getMfaRecoveryCodes(
|
|
1815
|
+
paramsOrFirst: { userId: string } | string
|
|
1816
|
+
): Promise<Models.MfaRecoveryCodes> {
|
|
1817
|
+
let params: { userId: string };
|
|
1818
|
+
|
|
1819
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1820
|
+
params = (paramsOrFirst || {}) as { userId: string };
|
|
1821
|
+
} else {
|
|
1822
|
+
params = {
|
|
1823
|
+
userId: paramsOrFirst as string
|
|
1824
|
+
};
|
|
1825
|
+
}
|
|
1826
|
+
|
|
1827
|
+
const userId = params.userId;
|
|
1828
|
+
|
|
1829
|
+
if (typeof userId === 'undefined') {
|
|
1830
|
+
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId);
|
|
1834
|
+
const payload: Payload = {};
|
|
1835
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1836
|
+
|
|
1837
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
return this.client.call(
|
|
1841
|
+
'get',
|
|
1842
|
+
uri,
|
|
1843
|
+
apiHeaders,
|
|
1844
|
+
payload
|
|
1845
|
+
);
|
|
1846
|
+
}
|
|
1847
|
+
|
|
1848
|
+
/**
|
|
1849
|
+
* Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method.
|
|
1850
|
+
*
|
|
1851
|
+
* @param {string} params.userId - User ID.
|
|
1852
|
+
* @throws {AppwriteException}
|
|
1853
|
+
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
1854
|
+
*/
|
|
1855
|
+
getMFARecoveryCodes(params: { userId: string }): Promise<Models.MfaRecoveryCodes>;
|
|
1856
|
+
/**
|
|
1857
|
+
* Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method.
|
|
1858
|
+
*
|
|
1859
|
+
* @param {string} userId - User ID.
|
|
1860
|
+
* @throws {AppwriteException}
|
|
1861
|
+
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
1862
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1863
|
+
*/
|
|
1864
|
+
getMFARecoveryCodes(userId: string): Promise<Models.MfaRecoveryCodes>;
|
|
1865
|
+
getMFARecoveryCodes(
|
|
1866
|
+
paramsOrFirst: { userId: string } | string
|
|
1867
|
+
): Promise<Models.MfaRecoveryCodes> {
|
|
1868
|
+
let params: { userId: string };
|
|
1869
|
+
|
|
1870
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1871
|
+
params = (paramsOrFirst || {}) as { userId: string };
|
|
1872
|
+
} else {
|
|
1873
|
+
params = {
|
|
1874
|
+
userId: paramsOrFirst as string
|
|
1875
|
+
};
|
|
1876
|
+
}
|
|
1877
|
+
|
|
1878
|
+
const userId = params.userId;
|
|
1879
|
+
|
|
1880
|
+
if (typeof userId === 'undefined') {
|
|
1881
|
+
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1882
|
+
}
|
|
1883
|
+
|
|
1884
|
+
const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId);
|
|
1885
|
+
const payload: Payload = {};
|
|
1886
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1887
|
+
|
|
1888
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1889
|
+
}
|
|
1890
|
+
|
|
1891
|
+
return this.client.call(
|
|
1892
|
+
'get',
|
|
1893
|
+
uri,
|
|
1894
|
+
apiHeaders,
|
|
1895
|
+
payload
|
|
1896
|
+
);
|
|
1897
|
+
}
|
|
1898
|
+
|
|
1899
|
+
/**
|
|
1900
|
+
* Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method.
|
|
1901
|
+
*
|
|
1902
|
+
* @param {string} params.userId - User ID.
|
|
1903
|
+
* @throws {AppwriteException}
|
|
1904
|
+
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
1905
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `Users.updateMFARecoveryCodes` instead.
|
|
1906
|
+
*/
|
|
1907
|
+
updateMfaRecoveryCodes(params: { userId: string }): Promise<Models.MfaRecoveryCodes>;
|
|
1908
|
+
/**
|
|
1909
|
+
* Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method.
|
|
1910
|
+
*
|
|
1911
|
+
* @param {string} userId - User ID.
|
|
1912
|
+
* @throws {AppwriteException}
|
|
1913
|
+
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
1914
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1915
|
+
*/
|
|
1916
|
+
updateMfaRecoveryCodes(userId: string): Promise<Models.MfaRecoveryCodes>;
|
|
1917
|
+
updateMfaRecoveryCodes(
|
|
1918
|
+
paramsOrFirst: { userId: string } | string
|
|
1919
|
+
): Promise<Models.MfaRecoveryCodes> {
|
|
1920
|
+
let params: { userId: string };
|
|
1921
|
+
|
|
1922
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1923
|
+
params = (paramsOrFirst || {}) as { userId: string };
|
|
1924
|
+
} else {
|
|
1925
|
+
params = {
|
|
1926
|
+
userId: paramsOrFirst as string
|
|
1927
|
+
};
|
|
1928
|
+
}
|
|
1929
|
+
|
|
1930
|
+
const userId = params.userId;
|
|
1931
|
+
|
|
1932
|
+
if (typeof userId === 'undefined') {
|
|
1933
|
+
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1934
|
+
}
|
|
1935
|
+
|
|
1936
|
+
const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId);
|
|
1937
|
+
const payload: Payload = {};
|
|
1938
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1939
|
+
|
|
1940
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1941
|
+
'content-type': 'application/json',
|
|
1942
|
+
}
|
|
1943
|
+
|
|
1944
|
+
return this.client.call(
|
|
1945
|
+
'put',
|
|
1946
|
+
uri,
|
|
1947
|
+
apiHeaders,
|
|
1948
|
+
payload
|
|
1949
|
+
);
|
|
1950
|
+
}
|
|
1951
|
+
|
|
1952
|
+
/**
|
|
1953
|
+
* Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method.
|
|
1954
|
+
*
|
|
1955
|
+
* @param {string} params.userId - User ID.
|
|
1956
|
+
* @throws {AppwriteException}
|
|
1957
|
+
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
1958
|
+
*/
|
|
1959
|
+
updateMFARecoveryCodes(params: { userId: string }): Promise<Models.MfaRecoveryCodes>;
|
|
1960
|
+
/**
|
|
1961
|
+
* Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method.
|
|
1962
|
+
*
|
|
1963
|
+
* @param {string} userId - User ID.
|
|
1964
|
+
* @throws {AppwriteException}
|
|
1965
|
+
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
1966
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1967
|
+
*/
|
|
1968
|
+
updateMFARecoveryCodes(userId: string): Promise<Models.MfaRecoveryCodes>;
|
|
1969
|
+
updateMFARecoveryCodes(
|
|
1970
|
+
paramsOrFirst: { userId: string } | string
|
|
1971
|
+
): Promise<Models.MfaRecoveryCodes> {
|
|
1972
|
+
let params: { userId: string };
|
|
1973
|
+
|
|
1974
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
1975
|
+
params = (paramsOrFirst || {}) as { userId: string };
|
|
1976
|
+
} else {
|
|
1977
|
+
params = {
|
|
1978
|
+
userId: paramsOrFirst as string
|
|
1979
|
+
};
|
|
1980
|
+
}
|
|
1981
|
+
|
|
1982
|
+
const userId = params.userId;
|
|
1983
|
+
|
|
1984
|
+
if (typeof userId === 'undefined') {
|
|
1985
|
+
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1986
|
+
}
|
|
1987
|
+
|
|
1988
|
+
const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId);
|
|
1989
|
+
const payload: Payload = {};
|
|
1990
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1991
|
+
|
|
1992
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1993
|
+
'content-type': 'application/json',
|
|
1994
|
+
}
|
|
1995
|
+
|
|
1996
|
+
return this.client.call(
|
|
1997
|
+
'put',
|
|
1998
|
+
uri,
|
|
1999
|
+
apiHeaders,
|
|
2000
|
+
payload
|
|
2001
|
+
);
|
|
2002
|
+
}
|
|
2003
|
+
|
|
2004
|
+
/**
|
|
2005
|
+
* Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method by client SDK.
|
|
2006
|
+
*
|
|
2007
|
+
* @param {string} params.userId - User ID.
|
|
2008
|
+
* @throws {AppwriteException}
|
|
2009
|
+
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
2010
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `Users.createMFARecoveryCodes` instead.
|
|
2011
|
+
*/
|
|
2012
|
+
createMfaRecoveryCodes(params: { userId: string }): Promise<Models.MfaRecoveryCodes>;
|
|
2013
|
+
/**
|
|
2014
|
+
* Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method by client SDK.
|
|
2015
|
+
*
|
|
2016
|
+
* @param {string} userId - User ID.
|
|
2017
|
+
* @throws {AppwriteException}
|
|
2018
|
+
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
2019
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2020
|
+
*/
|
|
2021
|
+
createMfaRecoveryCodes(userId: string): Promise<Models.MfaRecoveryCodes>;
|
|
2022
|
+
createMfaRecoveryCodes(
|
|
2023
|
+
paramsOrFirst: { userId: string } | string
|
|
2024
|
+
): Promise<Models.MfaRecoveryCodes> {
|
|
2025
|
+
let params: { userId: string };
|
|
2026
|
+
|
|
2027
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2028
|
+
params = (paramsOrFirst || {}) as { userId: string };
|
|
2029
|
+
} else {
|
|
2030
|
+
params = {
|
|
2031
|
+
userId: paramsOrFirst as string
|
|
2032
|
+
};
|
|
2033
|
+
}
|
|
2034
|
+
|
|
2035
|
+
const userId = params.userId;
|
|
2036
|
+
|
|
2037
|
+
if (typeof userId === 'undefined') {
|
|
2038
|
+
throw new AppwriteException('Missing required parameter: "userId"');
|
|
2039
|
+
}
|
|
2040
|
+
|
|
2041
|
+
const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId);
|
|
2042
|
+
const payload: Payload = {};
|
|
2043
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2044
|
+
|
|
2045
|
+
const apiHeaders: { [header: string]: string } = {
|
|
2046
|
+
'content-type': 'application/json',
|
|
2047
|
+
}
|
|
2048
|
+
|
|
2049
|
+
return this.client.call(
|
|
2050
|
+
'patch',
|
|
2051
|
+
uri,
|
|
2052
|
+
apiHeaders,
|
|
2053
|
+
payload
|
|
2054
|
+
);
|
|
2055
|
+
}
|
|
2056
|
+
|
|
2057
|
+
/**
|
|
2058
|
+
* Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method by client SDK.
|
|
2059
|
+
*
|
|
2060
|
+
* @param {string} params.userId - User ID.
|
|
2061
|
+
* @throws {AppwriteException}
|
|
2062
|
+
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
2063
|
+
*/
|
|
2064
|
+
createMFARecoveryCodes(params: { userId: string }): Promise<Models.MfaRecoveryCodes>;
|
|
2065
|
+
/**
|
|
2066
|
+
* Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method by client SDK.
|
|
2067
|
+
*
|
|
2068
|
+
* @param {string} userId - User ID.
|
|
2069
|
+
* @throws {AppwriteException}
|
|
2070
|
+
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
2071
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2072
|
+
*/
|
|
2073
|
+
createMFARecoveryCodes(userId: string): Promise<Models.MfaRecoveryCodes>;
|
|
2074
|
+
createMFARecoveryCodes(
|
|
2075
|
+
paramsOrFirst: { userId: string } | string
|
|
2076
|
+
): Promise<Models.MfaRecoveryCodes> {
|
|
2077
|
+
let params: { userId: string };
|
|
2078
|
+
|
|
2079
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2080
|
+
params = (paramsOrFirst || {}) as { userId: string };
|
|
2081
|
+
} else {
|
|
2082
|
+
params = {
|
|
2083
|
+
userId: paramsOrFirst as string
|
|
2084
|
+
};
|
|
2085
|
+
}
|
|
2086
|
+
|
|
2087
|
+
const userId = params.userId;
|
|
2088
|
+
|
|
2089
|
+
if (typeof userId === 'undefined') {
|
|
2090
|
+
throw new AppwriteException('Missing required parameter: "userId"');
|
|
2091
|
+
}
|
|
2092
|
+
|
|
949
2093
|
const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId);
|
|
950
2094
|
const payload: Payload = {};
|
|
951
2095
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -965,18 +2109,47 @@ export class Users {
|
|
|
965
2109
|
/**
|
|
966
2110
|
* Update the user name by its unique ID.
|
|
967
2111
|
*
|
|
968
|
-
* @param {string} userId
|
|
969
|
-
* @param {string} name
|
|
2112
|
+
* @param {string} params.userId - User ID.
|
|
2113
|
+
* @param {string} params.name - User name. Max length: 128 chars.
|
|
970
2114
|
* @throws {AppwriteException}
|
|
971
2115
|
* @returns {Promise<Models.User<Preferences>>}
|
|
972
2116
|
*/
|
|
973
|
-
updateName<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, name: string): Promise<Models.User<Preferences
|
|
2117
|
+
updateName<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, name: string }): Promise<Models.User<Preferences>>;
|
|
2118
|
+
/**
|
|
2119
|
+
* Update the user name by its unique ID.
|
|
2120
|
+
*
|
|
2121
|
+
* @param {string} userId - User ID.
|
|
2122
|
+
* @param {string} name - User name. Max length: 128 chars.
|
|
2123
|
+
* @throws {AppwriteException}
|
|
2124
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
2125
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2126
|
+
*/
|
|
2127
|
+
updateName<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, name: string): Promise<Models.User<Preferences>>;
|
|
2128
|
+
updateName<Preferences extends Models.Preferences = Models.DefaultPreferences>(
|
|
2129
|
+
paramsOrFirst: { userId: string, name: string } | string,
|
|
2130
|
+
...rest: [(string)?]
|
|
2131
|
+
): Promise<Models.User<Preferences>> {
|
|
2132
|
+
let params: { userId: string, name: string };
|
|
2133
|
+
|
|
2134
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2135
|
+
params = (paramsOrFirst || {}) as { userId: string, name: string };
|
|
2136
|
+
} else {
|
|
2137
|
+
params = {
|
|
2138
|
+
userId: paramsOrFirst as string,
|
|
2139
|
+
name: rest[0] as string
|
|
2140
|
+
};
|
|
2141
|
+
}
|
|
2142
|
+
|
|
2143
|
+
const userId = params.userId;
|
|
2144
|
+
const name = params.name;
|
|
2145
|
+
|
|
974
2146
|
if (typeof userId === 'undefined') {
|
|
975
2147
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
976
2148
|
}
|
|
977
2149
|
if (typeof name === 'undefined') {
|
|
978
2150
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
979
2151
|
}
|
|
2152
|
+
|
|
980
2153
|
const apiPath = '/users/{userId}/name'.replace('{userId}', userId);
|
|
981
2154
|
const payload: Payload = {};
|
|
982
2155
|
if (typeof name !== 'undefined') {
|
|
@@ -999,18 +2172,47 @@ export class Users {
|
|
|
999
2172
|
/**
|
|
1000
2173
|
* Update the user password by its unique ID.
|
|
1001
2174
|
*
|
|
1002
|
-
* @param {string} userId
|
|
1003
|
-
* @param {string} password
|
|
2175
|
+
* @param {string} params.userId - User ID.
|
|
2176
|
+
* @param {string} params.password - New user password. Must be at least 8 chars.
|
|
1004
2177
|
* @throws {AppwriteException}
|
|
1005
2178
|
* @returns {Promise<Models.User<Preferences>>}
|
|
1006
2179
|
*/
|
|
1007
|
-
updatePassword<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, password: string): Promise<Models.User<Preferences
|
|
2180
|
+
updatePassword<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, password: string }): Promise<Models.User<Preferences>>;
|
|
2181
|
+
/**
|
|
2182
|
+
* Update the user password by its unique ID.
|
|
2183
|
+
*
|
|
2184
|
+
* @param {string} userId - User ID.
|
|
2185
|
+
* @param {string} password - New user password. Must be at least 8 chars.
|
|
2186
|
+
* @throws {AppwriteException}
|
|
2187
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
2188
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2189
|
+
*/
|
|
2190
|
+
updatePassword<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, password: string): Promise<Models.User<Preferences>>;
|
|
2191
|
+
updatePassword<Preferences extends Models.Preferences = Models.DefaultPreferences>(
|
|
2192
|
+
paramsOrFirst: { userId: string, password: string } | string,
|
|
2193
|
+
...rest: [(string)?]
|
|
2194
|
+
): Promise<Models.User<Preferences>> {
|
|
2195
|
+
let params: { userId: string, password: string };
|
|
2196
|
+
|
|
2197
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2198
|
+
params = (paramsOrFirst || {}) as { userId: string, password: string };
|
|
2199
|
+
} else {
|
|
2200
|
+
params = {
|
|
2201
|
+
userId: paramsOrFirst as string,
|
|
2202
|
+
password: rest[0] as string
|
|
2203
|
+
};
|
|
2204
|
+
}
|
|
2205
|
+
|
|
2206
|
+
const userId = params.userId;
|
|
2207
|
+
const password = params.password;
|
|
2208
|
+
|
|
1008
2209
|
if (typeof userId === 'undefined') {
|
|
1009
2210
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1010
2211
|
}
|
|
1011
2212
|
if (typeof password === 'undefined') {
|
|
1012
2213
|
throw new AppwriteException('Missing required parameter: "password"');
|
|
1013
2214
|
}
|
|
2215
|
+
|
|
1014
2216
|
const apiPath = '/users/{userId}/password'.replace('{userId}', userId);
|
|
1015
2217
|
const payload: Payload = {};
|
|
1016
2218
|
if (typeof password !== 'undefined') {
|
|
@@ -1033,18 +2235,47 @@ export class Users {
|
|
|
1033
2235
|
/**
|
|
1034
2236
|
* Update the user phone by its unique ID.
|
|
1035
2237
|
*
|
|
1036
|
-
* @param {string} userId
|
|
1037
|
-
* @param {string} number
|
|
2238
|
+
* @param {string} params.userId - User ID.
|
|
2239
|
+
* @param {string} params.number - User phone number.
|
|
2240
|
+
* @throws {AppwriteException}
|
|
2241
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
2242
|
+
*/
|
|
2243
|
+
updatePhone<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, number: string }): Promise<Models.User<Preferences>>;
|
|
2244
|
+
/**
|
|
2245
|
+
* Update the user phone by its unique ID.
|
|
2246
|
+
*
|
|
2247
|
+
* @param {string} userId - User ID.
|
|
2248
|
+
* @param {string} number - User phone number.
|
|
1038
2249
|
* @throws {AppwriteException}
|
|
1039
2250
|
* @returns {Promise<Models.User<Preferences>>}
|
|
2251
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1040
2252
|
*/
|
|
1041
|
-
updatePhone<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, number: string): Promise<Models.User<Preferences
|
|
2253
|
+
updatePhone<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, number: string): Promise<Models.User<Preferences>>;
|
|
2254
|
+
updatePhone<Preferences extends Models.Preferences = Models.DefaultPreferences>(
|
|
2255
|
+
paramsOrFirst: { userId: string, number: string } | string,
|
|
2256
|
+
...rest: [(string)?]
|
|
2257
|
+
): Promise<Models.User<Preferences>> {
|
|
2258
|
+
let params: { userId: string, number: string };
|
|
2259
|
+
|
|
2260
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2261
|
+
params = (paramsOrFirst || {}) as { userId: string, number: string };
|
|
2262
|
+
} else {
|
|
2263
|
+
params = {
|
|
2264
|
+
userId: paramsOrFirst as string,
|
|
2265
|
+
number: rest[0] as string
|
|
2266
|
+
};
|
|
2267
|
+
}
|
|
2268
|
+
|
|
2269
|
+
const userId = params.userId;
|
|
2270
|
+
const number = params.number;
|
|
2271
|
+
|
|
1042
2272
|
if (typeof userId === 'undefined') {
|
|
1043
2273
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1044
2274
|
}
|
|
1045
2275
|
if (typeof number === 'undefined') {
|
|
1046
2276
|
throw new AppwriteException('Missing required parameter: "number"');
|
|
1047
2277
|
}
|
|
2278
|
+
|
|
1048
2279
|
const apiPath = '/users/{userId}/phone'.replace('{userId}', userId);
|
|
1049
2280
|
const payload: Payload = {};
|
|
1050
2281
|
if (typeof number !== 'undefined') {
|
|
@@ -1067,14 +2298,39 @@ export class Users {
|
|
|
1067
2298
|
/**
|
|
1068
2299
|
* Get the user preferences by its unique ID.
|
|
1069
2300
|
*
|
|
1070
|
-
* @param {string} userId
|
|
2301
|
+
* @param {string} params.userId - User ID.
|
|
2302
|
+
* @throws {AppwriteException}
|
|
2303
|
+
* @returns {Promise<Preferences>}
|
|
2304
|
+
*/
|
|
2305
|
+
getPrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string }): Promise<Preferences>;
|
|
2306
|
+
/**
|
|
2307
|
+
* Get the user preferences by its unique ID.
|
|
2308
|
+
*
|
|
2309
|
+
* @param {string} userId - User ID.
|
|
1071
2310
|
* @throws {AppwriteException}
|
|
1072
2311
|
* @returns {Promise<Preferences>}
|
|
2312
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1073
2313
|
*/
|
|
1074
|
-
getPrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string): Promise<Preferences
|
|
2314
|
+
getPrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string): Promise<Preferences>;
|
|
2315
|
+
getPrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(
|
|
2316
|
+
paramsOrFirst: { userId: string } | string
|
|
2317
|
+
): Promise<Preferences> {
|
|
2318
|
+
let params: { userId: string };
|
|
2319
|
+
|
|
2320
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2321
|
+
params = (paramsOrFirst || {}) as { userId: string };
|
|
2322
|
+
} else {
|
|
2323
|
+
params = {
|
|
2324
|
+
userId: paramsOrFirst as string
|
|
2325
|
+
};
|
|
2326
|
+
}
|
|
2327
|
+
|
|
2328
|
+
const userId = params.userId;
|
|
2329
|
+
|
|
1075
2330
|
if (typeof userId === 'undefined') {
|
|
1076
2331
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1077
2332
|
}
|
|
2333
|
+
|
|
1078
2334
|
const apiPath = '/users/{userId}/prefs'.replace('{userId}', userId);
|
|
1079
2335
|
const payload: Payload = {};
|
|
1080
2336
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -1093,18 +2349,47 @@ export class Users {
|
|
|
1093
2349
|
/**
|
|
1094
2350
|
* Update the user preferences by its unique ID. 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.
|
|
1095
2351
|
*
|
|
1096
|
-
* @param {string} userId
|
|
1097
|
-
* @param {object} prefs
|
|
2352
|
+
* @param {string} params.userId - User ID.
|
|
2353
|
+
* @param {object} params.prefs - Prefs key-value JSON object.
|
|
1098
2354
|
* @throws {AppwriteException}
|
|
1099
2355
|
* @returns {Promise<Preferences>}
|
|
1100
2356
|
*/
|
|
1101
|
-
updatePrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, prefs: object): Promise<Preferences
|
|
2357
|
+
updatePrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, prefs: object }): Promise<Preferences>;
|
|
2358
|
+
/**
|
|
2359
|
+
* Update the user preferences by its unique ID. 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.
|
|
2360
|
+
*
|
|
2361
|
+
* @param {string} userId - User ID.
|
|
2362
|
+
* @param {object} prefs - Prefs key-value JSON object.
|
|
2363
|
+
* @throws {AppwriteException}
|
|
2364
|
+
* @returns {Promise<Preferences>}
|
|
2365
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2366
|
+
*/
|
|
2367
|
+
updatePrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, prefs: object): Promise<Preferences>;
|
|
2368
|
+
updatePrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(
|
|
2369
|
+
paramsOrFirst: { userId: string, prefs: object } | string,
|
|
2370
|
+
...rest: [(object)?]
|
|
2371
|
+
): Promise<Preferences> {
|
|
2372
|
+
let params: { userId: string, prefs: object };
|
|
2373
|
+
|
|
2374
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2375
|
+
params = (paramsOrFirst || {}) as { userId: string, prefs: object };
|
|
2376
|
+
} else {
|
|
2377
|
+
params = {
|
|
2378
|
+
userId: paramsOrFirst as string,
|
|
2379
|
+
prefs: rest[0] as object
|
|
2380
|
+
};
|
|
2381
|
+
}
|
|
2382
|
+
|
|
2383
|
+
const userId = params.userId;
|
|
2384
|
+
const prefs = params.prefs;
|
|
2385
|
+
|
|
1102
2386
|
if (typeof userId === 'undefined') {
|
|
1103
2387
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1104
2388
|
}
|
|
1105
2389
|
if (typeof prefs === 'undefined') {
|
|
1106
2390
|
throw new AppwriteException('Missing required parameter: "prefs"');
|
|
1107
2391
|
}
|
|
2392
|
+
|
|
1108
2393
|
const apiPath = '/users/{userId}/prefs'.replace('{userId}', userId);
|
|
1109
2394
|
const payload: Payload = {};
|
|
1110
2395
|
if (typeof prefs !== 'undefined') {
|
|
@@ -1127,16 +2412,49 @@ export class Users {
|
|
|
1127
2412
|
/**
|
|
1128
2413
|
* Get the user sessions list by its unique ID.
|
|
1129
2414
|
*
|
|
1130
|
-
* @param {string} userId
|
|
2415
|
+
* @param {string} params.userId - User ID.
|
|
2416
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
1131
2417
|
* @throws {AppwriteException}
|
|
1132
2418
|
* @returns {Promise<Models.SessionList>}
|
|
1133
2419
|
*/
|
|
1134
|
-
listSessions(userId: string): Promise<Models.SessionList
|
|
2420
|
+
listSessions(params: { userId: string, total?: boolean }): Promise<Models.SessionList>;
|
|
2421
|
+
/**
|
|
2422
|
+
* Get the user sessions list by its unique ID.
|
|
2423
|
+
*
|
|
2424
|
+
* @param {string} userId - User ID.
|
|
2425
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
2426
|
+
* @throws {AppwriteException}
|
|
2427
|
+
* @returns {Promise<Models.SessionList>}
|
|
2428
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2429
|
+
*/
|
|
2430
|
+
listSessions(userId: string, total?: boolean): Promise<Models.SessionList>;
|
|
2431
|
+
listSessions(
|
|
2432
|
+
paramsOrFirst: { userId: string, total?: boolean } | string,
|
|
2433
|
+
...rest: [(boolean)?]
|
|
2434
|
+
): Promise<Models.SessionList> {
|
|
2435
|
+
let params: { userId: string, total?: boolean };
|
|
2436
|
+
|
|
2437
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2438
|
+
params = (paramsOrFirst || {}) as { userId: string, total?: boolean };
|
|
2439
|
+
} else {
|
|
2440
|
+
params = {
|
|
2441
|
+
userId: paramsOrFirst as string,
|
|
2442
|
+
total: rest[0] as boolean
|
|
2443
|
+
};
|
|
2444
|
+
}
|
|
2445
|
+
|
|
2446
|
+
const userId = params.userId;
|
|
2447
|
+
const total = params.total;
|
|
2448
|
+
|
|
1135
2449
|
if (typeof userId === 'undefined') {
|
|
1136
2450
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1137
2451
|
}
|
|
2452
|
+
|
|
1138
2453
|
const apiPath = '/users/{userId}/sessions'.replace('{userId}', userId);
|
|
1139
2454
|
const payload: Payload = {};
|
|
2455
|
+
if (typeof total !== 'undefined') {
|
|
2456
|
+
payload['total'] = total;
|
|
2457
|
+
}
|
|
1140
2458
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1141
2459
|
|
|
1142
2460
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -1155,14 +2473,41 @@ export class Users {
|
|
|
1155
2473
|
*
|
|
1156
2474
|
* If you want to generate a token for a custom authentication flow, use the [POST /users/{userId}/tokens](https://appwrite.io/docs/server/users#createToken) endpoint.
|
|
1157
2475
|
*
|
|
1158
|
-
* @param {string} userId
|
|
2476
|
+
* @param {string} params.userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
1159
2477
|
* @throws {AppwriteException}
|
|
1160
2478
|
* @returns {Promise<Models.Session>}
|
|
1161
2479
|
*/
|
|
1162
|
-
createSession(userId: string): Promise<Models.Session
|
|
2480
|
+
createSession(params: { userId: string }): Promise<Models.Session>;
|
|
2481
|
+
/**
|
|
2482
|
+
* Creates a session for a user. Returns an immediately usable session object.
|
|
2483
|
+
*
|
|
2484
|
+
* If you want to generate a token for a custom authentication flow, use the [POST /users/{userId}/tokens](https://appwrite.io/docs/server/users#createToken) endpoint.
|
|
2485
|
+
*
|
|
2486
|
+
* @param {string} userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
2487
|
+
* @throws {AppwriteException}
|
|
2488
|
+
* @returns {Promise<Models.Session>}
|
|
2489
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2490
|
+
*/
|
|
2491
|
+
createSession(userId: string): Promise<Models.Session>;
|
|
2492
|
+
createSession(
|
|
2493
|
+
paramsOrFirst: { userId: string } | string
|
|
2494
|
+
): Promise<Models.Session> {
|
|
2495
|
+
let params: { userId: string };
|
|
2496
|
+
|
|
2497
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2498
|
+
params = (paramsOrFirst || {}) as { userId: string };
|
|
2499
|
+
} else {
|
|
2500
|
+
params = {
|
|
2501
|
+
userId: paramsOrFirst as string
|
|
2502
|
+
};
|
|
2503
|
+
}
|
|
2504
|
+
|
|
2505
|
+
const userId = params.userId;
|
|
2506
|
+
|
|
1163
2507
|
if (typeof userId === 'undefined') {
|
|
1164
2508
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1165
2509
|
}
|
|
2510
|
+
|
|
1166
2511
|
const apiPath = '/users/{userId}/sessions'.replace('{userId}', userId);
|
|
1167
2512
|
const payload: Payload = {};
|
|
1168
2513
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -1180,16 +2525,41 @@ export class Users {
|
|
|
1180
2525
|
}
|
|
1181
2526
|
|
|
1182
2527
|
/**
|
|
1183
|
-
* Delete all user
|
|
2528
|
+
* Delete all user's sessions by using the user's unique ID.
|
|
1184
2529
|
*
|
|
1185
|
-
* @param {string} userId
|
|
2530
|
+
* @param {string} params.userId - User ID.
|
|
1186
2531
|
* @throws {AppwriteException}
|
|
1187
2532
|
* @returns {Promise<{}>}
|
|
1188
2533
|
*/
|
|
1189
|
-
deleteSessions(userId: string): Promise<{}
|
|
2534
|
+
deleteSessions(params: { userId: string }): Promise<{}>;
|
|
2535
|
+
/**
|
|
2536
|
+
* Delete all user's sessions by using the user's unique ID.
|
|
2537
|
+
*
|
|
2538
|
+
* @param {string} userId - User ID.
|
|
2539
|
+
* @throws {AppwriteException}
|
|
2540
|
+
* @returns {Promise<{}>}
|
|
2541
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2542
|
+
*/
|
|
2543
|
+
deleteSessions(userId: string): Promise<{}>;
|
|
2544
|
+
deleteSessions(
|
|
2545
|
+
paramsOrFirst: { userId: string } | string
|
|
2546
|
+
): Promise<{}> {
|
|
2547
|
+
let params: { userId: string };
|
|
2548
|
+
|
|
2549
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2550
|
+
params = (paramsOrFirst || {}) as { userId: string };
|
|
2551
|
+
} else {
|
|
2552
|
+
params = {
|
|
2553
|
+
userId: paramsOrFirst as string
|
|
2554
|
+
};
|
|
2555
|
+
}
|
|
2556
|
+
|
|
2557
|
+
const userId = params.userId;
|
|
2558
|
+
|
|
1190
2559
|
if (typeof userId === 'undefined') {
|
|
1191
2560
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1192
2561
|
}
|
|
2562
|
+
|
|
1193
2563
|
const apiPath = '/users/{userId}/sessions'.replace('{userId}', userId);
|
|
1194
2564
|
const payload: Payload = {};
|
|
1195
2565
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -1209,18 +2579,47 @@ export class Users {
|
|
|
1209
2579
|
/**
|
|
1210
2580
|
* Delete a user sessions by its unique ID.
|
|
1211
2581
|
*
|
|
1212
|
-
* @param {string} userId
|
|
1213
|
-
* @param {string} sessionId
|
|
2582
|
+
* @param {string} params.userId - User ID.
|
|
2583
|
+
* @param {string} params.sessionId - Session ID.
|
|
2584
|
+
* @throws {AppwriteException}
|
|
2585
|
+
* @returns {Promise<{}>}
|
|
2586
|
+
*/
|
|
2587
|
+
deleteSession(params: { userId: string, sessionId: string }): Promise<{}>;
|
|
2588
|
+
/**
|
|
2589
|
+
* Delete a user sessions by its unique ID.
|
|
2590
|
+
*
|
|
2591
|
+
* @param {string} userId - User ID.
|
|
2592
|
+
* @param {string} sessionId - Session ID.
|
|
1214
2593
|
* @throws {AppwriteException}
|
|
1215
2594
|
* @returns {Promise<{}>}
|
|
2595
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1216
2596
|
*/
|
|
1217
|
-
deleteSession(userId: string, sessionId: string): Promise<{}
|
|
2597
|
+
deleteSession(userId: string, sessionId: string): Promise<{}>;
|
|
2598
|
+
deleteSession(
|
|
2599
|
+
paramsOrFirst: { userId: string, sessionId: string } | string,
|
|
2600
|
+
...rest: [(string)?]
|
|
2601
|
+
): Promise<{}> {
|
|
2602
|
+
let params: { userId: string, sessionId: string };
|
|
2603
|
+
|
|
2604
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2605
|
+
params = (paramsOrFirst || {}) as { userId: string, sessionId: string };
|
|
2606
|
+
} else {
|
|
2607
|
+
params = {
|
|
2608
|
+
userId: paramsOrFirst as string,
|
|
2609
|
+
sessionId: rest[0] as string
|
|
2610
|
+
};
|
|
2611
|
+
}
|
|
2612
|
+
|
|
2613
|
+
const userId = params.userId;
|
|
2614
|
+
const sessionId = params.sessionId;
|
|
2615
|
+
|
|
1218
2616
|
if (typeof userId === 'undefined') {
|
|
1219
2617
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1220
2618
|
}
|
|
1221
2619
|
if (typeof sessionId === 'undefined') {
|
|
1222
2620
|
throw new AppwriteException('Missing required parameter: "sessionId"');
|
|
1223
2621
|
}
|
|
2622
|
+
|
|
1224
2623
|
const apiPath = '/users/{userId}/sessions/{sessionId}'.replace('{userId}', userId).replace('{sessionId}', sessionId);
|
|
1225
2624
|
const payload: Payload = {};
|
|
1226
2625
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -1238,20 +2637,49 @@ export class Users {
|
|
|
1238
2637
|
}
|
|
1239
2638
|
|
|
1240
2639
|
/**
|
|
1241
|
-
* Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user
|
|
2640
|
+
* Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved.
|
|
1242
2641
|
*
|
|
1243
|
-
* @param {string} userId
|
|
1244
|
-
* @param {boolean} status
|
|
2642
|
+
* @param {string} params.userId - User ID.
|
|
2643
|
+
* @param {boolean} params.status - User Status. To activate the user pass `true` and to block the user pass `false`.
|
|
1245
2644
|
* @throws {AppwriteException}
|
|
1246
2645
|
* @returns {Promise<Models.User<Preferences>>}
|
|
1247
2646
|
*/
|
|
1248
|
-
updateStatus<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, status: boolean): Promise<Models.User<Preferences
|
|
2647
|
+
updateStatus<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, status: boolean }): Promise<Models.User<Preferences>>;
|
|
2648
|
+
/**
|
|
2649
|
+
* Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved.
|
|
2650
|
+
*
|
|
2651
|
+
* @param {string} userId - User ID.
|
|
2652
|
+
* @param {boolean} status - User Status. To activate the user pass `true` and to block the user pass `false`.
|
|
2653
|
+
* @throws {AppwriteException}
|
|
2654
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
2655
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2656
|
+
*/
|
|
2657
|
+
updateStatus<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, status: boolean): Promise<Models.User<Preferences>>;
|
|
2658
|
+
updateStatus<Preferences extends Models.Preferences = Models.DefaultPreferences>(
|
|
2659
|
+
paramsOrFirst: { userId: string, status: boolean } | string,
|
|
2660
|
+
...rest: [(boolean)?]
|
|
2661
|
+
): Promise<Models.User<Preferences>> {
|
|
2662
|
+
let params: { userId: string, status: boolean };
|
|
2663
|
+
|
|
2664
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2665
|
+
params = (paramsOrFirst || {}) as { userId: string, status: boolean };
|
|
2666
|
+
} else {
|
|
2667
|
+
params = {
|
|
2668
|
+
userId: paramsOrFirst as string,
|
|
2669
|
+
status: rest[0] as boolean
|
|
2670
|
+
};
|
|
2671
|
+
}
|
|
2672
|
+
|
|
2673
|
+
const userId = params.userId;
|
|
2674
|
+
const status = params.status;
|
|
2675
|
+
|
|
1249
2676
|
if (typeof userId === 'undefined') {
|
|
1250
2677
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1251
2678
|
}
|
|
1252
2679
|
if (typeof status === 'undefined') {
|
|
1253
2680
|
throw new AppwriteException('Missing required parameter: "status"');
|
|
1254
2681
|
}
|
|
2682
|
+
|
|
1255
2683
|
const apiPath = '/users/{userId}/status'.replace('{userId}', userId);
|
|
1256
2684
|
const payload: Payload = {};
|
|
1257
2685
|
if (typeof status !== 'undefined') {
|
|
@@ -1274,20 +2702,56 @@ export class Users {
|
|
|
1274
2702
|
/**
|
|
1275
2703
|
* List the messaging targets that are associated with a user.
|
|
1276
2704
|
*
|
|
1277
|
-
* @param {string} userId
|
|
1278
|
-
* @param {string[]} queries
|
|
2705
|
+
* @param {string} params.userId - User ID.
|
|
2706
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType
|
|
2707
|
+
* @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
1279
2708
|
* @throws {AppwriteException}
|
|
1280
2709
|
* @returns {Promise<Models.TargetList>}
|
|
1281
2710
|
*/
|
|
1282
|
-
listTargets(userId: string, queries?: string[]): Promise<Models.TargetList
|
|
2711
|
+
listTargets(params: { userId: string, queries?: string[], total?: boolean }): Promise<Models.TargetList>;
|
|
2712
|
+
/**
|
|
2713
|
+
* List the messaging targets that are associated with a user.
|
|
2714
|
+
*
|
|
2715
|
+
* @param {string} userId - User ID.
|
|
2716
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType
|
|
2717
|
+
* @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
|
|
2718
|
+
* @throws {AppwriteException}
|
|
2719
|
+
* @returns {Promise<Models.TargetList>}
|
|
2720
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2721
|
+
*/
|
|
2722
|
+
listTargets(userId: string, queries?: string[], total?: boolean): Promise<Models.TargetList>;
|
|
2723
|
+
listTargets(
|
|
2724
|
+
paramsOrFirst: { userId: string, queries?: string[], total?: boolean } | string,
|
|
2725
|
+
...rest: [(string[])?, (boolean)?]
|
|
2726
|
+
): Promise<Models.TargetList> {
|
|
2727
|
+
let params: { userId: string, queries?: string[], total?: boolean };
|
|
2728
|
+
|
|
2729
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2730
|
+
params = (paramsOrFirst || {}) as { userId: string, queries?: string[], total?: boolean };
|
|
2731
|
+
} else {
|
|
2732
|
+
params = {
|
|
2733
|
+
userId: paramsOrFirst as string,
|
|
2734
|
+
queries: rest[0] as string[],
|
|
2735
|
+
total: rest[1] as boolean
|
|
2736
|
+
};
|
|
2737
|
+
}
|
|
2738
|
+
|
|
2739
|
+
const userId = params.userId;
|
|
2740
|
+
const queries = params.queries;
|
|
2741
|
+
const total = params.total;
|
|
2742
|
+
|
|
1283
2743
|
if (typeof userId === 'undefined') {
|
|
1284
2744
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1285
2745
|
}
|
|
2746
|
+
|
|
1286
2747
|
const apiPath = '/users/{userId}/targets'.replace('{userId}', userId);
|
|
1287
2748
|
const payload: Payload = {};
|
|
1288
2749
|
if (typeof queries !== 'undefined') {
|
|
1289
2750
|
payload['queries'] = queries;
|
|
1290
2751
|
}
|
|
2752
|
+
if (typeof total !== 'undefined') {
|
|
2753
|
+
payload['total'] = total;
|
|
2754
|
+
}
|
|
1291
2755
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1292
2756
|
|
|
1293
2757
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -1304,16 +2768,56 @@ export class Users {
|
|
|
1304
2768
|
/**
|
|
1305
2769
|
* Create a messaging target.
|
|
1306
2770
|
*
|
|
1307
|
-
* @param {string} userId
|
|
1308
|
-
* @param {string} targetId
|
|
1309
|
-
* @param {MessagingProviderType} providerType
|
|
1310
|
-
* @param {string} identifier
|
|
1311
|
-
* @param {string} providerId
|
|
1312
|
-
* @param {string} name
|
|
2771
|
+
* @param {string} params.userId - User ID.
|
|
2772
|
+
* @param {string} params.targetId - Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
2773
|
+
* @param {MessagingProviderType} params.providerType - The target provider type. Can be one of the following: `email`, `sms` or `push`.
|
|
2774
|
+
* @param {string} params.identifier - The target identifier (token, email, phone etc.)
|
|
2775
|
+
* @param {string} params.providerId - Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.
|
|
2776
|
+
* @param {string} params.name - Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.
|
|
1313
2777
|
* @throws {AppwriteException}
|
|
1314
2778
|
* @returns {Promise<Models.Target>}
|
|
1315
2779
|
*/
|
|
1316
|
-
createTarget(userId: string, targetId: string, providerType: MessagingProviderType, identifier: string, providerId?: string, name?: string): Promise<Models.Target
|
|
2780
|
+
createTarget(params: { userId: string, targetId: string, providerType: MessagingProviderType, identifier: string, providerId?: string, name?: string }): Promise<Models.Target>;
|
|
2781
|
+
/**
|
|
2782
|
+
* Create a messaging target.
|
|
2783
|
+
*
|
|
2784
|
+
* @param {string} userId - User ID.
|
|
2785
|
+
* @param {string} targetId - Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
2786
|
+
* @param {MessagingProviderType} providerType - The target provider type. Can be one of the following: `email`, `sms` or `push`.
|
|
2787
|
+
* @param {string} identifier - The target identifier (token, email, phone etc.)
|
|
2788
|
+
* @param {string} providerId - Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.
|
|
2789
|
+
* @param {string} name - Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.
|
|
2790
|
+
* @throws {AppwriteException}
|
|
2791
|
+
* @returns {Promise<Models.Target>}
|
|
2792
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2793
|
+
*/
|
|
2794
|
+
createTarget(userId: string, targetId: string, providerType: MessagingProviderType, identifier: string, providerId?: string, name?: string): Promise<Models.Target>;
|
|
2795
|
+
createTarget(
|
|
2796
|
+
paramsOrFirst: { userId: string, targetId: string, providerType: MessagingProviderType, identifier: string, providerId?: string, name?: string } | string,
|
|
2797
|
+
...rest: [(string)?, (MessagingProviderType)?, (string)?, (string)?, (string)?]
|
|
2798
|
+
): Promise<Models.Target> {
|
|
2799
|
+
let params: { userId: string, targetId: string, providerType: MessagingProviderType, identifier: string, providerId?: string, name?: string };
|
|
2800
|
+
|
|
2801
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2802
|
+
params = (paramsOrFirst || {}) as { userId: string, targetId: string, providerType: MessagingProviderType, identifier: string, providerId?: string, name?: string };
|
|
2803
|
+
} else {
|
|
2804
|
+
params = {
|
|
2805
|
+
userId: paramsOrFirst as string,
|
|
2806
|
+
targetId: rest[0] as string,
|
|
2807
|
+
providerType: rest[1] as MessagingProviderType,
|
|
2808
|
+
identifier: rest[2] as string,
|
|
2809
|
+
providerId: rest[3] as string,
|
|
2810
|
+
name: rest[4] as string
|
|
2811
|
+
};
|
|
2812
|
+
}
|
|
2813
|
+
|
|
2814
|
+
const userId = params.userId;
|
|
2815
|
+
const targetId = params.targetId;
|
|
2816
|
+
const providerType = params.providerType;
|
|
2817
|
+
const identifier = params.identifier;
|
|
2818
|
+
const providerId = params.providerId;
|
|
2819
|
+
const name = params.name;
|
|
2820
|
+
|
|
1317
2821
|
if (typeof userId === 'undefined') {
|
|
1318
2822
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1319
2823
|
}
|
|
@@ -1326,6 +2830,7 @@ export class Users {
|
|
|
1326
2830
|
if (typeof identifier === 'undefined') {
|
|
1327
2831
|
throw new AppwriteException('Missing required parameter: "identifier"');
|
|
1328
2832
|
}
|
|
2833
|
+
|
|
1329
2834
|
const apiPath = '/users/{userId}/targets'.replace('{userId}', userId);
|
|
1330
2835
|
const payload: Payload = {};
|
|
1331
2836
|
if (typeof targetId !== 'undefined') {
|
|
@@ -1358,20 +2863,49 @@ export class Users {
|
|
|
1358
2863
|
}
|
|
1359
2864
|
|
|
1360
2865
|
/**
|
|
1361
|
-
* Get a user
|
|
2866
|
+
* Get a user's push notification target by ID.
|
|
2867
|
+
*
|
|
2868
|
+
* @param {string} params.userId - User ID.
|
|
2869
|
+
* @param {string} params.targetId - Target ID.
|
|
2870
|
+
* @throws {AppwriteException}
|
|
2871
|
+
* @returns {Promise<Models.Target>}
|
|
2872
|
+
*/
|
|
2873
|
+
getTarget(params: { userId: string, targetId: string }): Promise<Models.Target>;
|
|
2874
|
+
/**
|
|
2875
|
+
* Get a user's push notification target by ID.
|
|
1362
2876
|
*
|
|
1363
|
-
* @param {string} userId
|
|
1364
|
-
* @param {string} targetId
|
|
2877
|
+
* @param {string} userId - User ID.
|
|
2878
|
+
* @param {string} targetId - Target ID.
|
|
1365
2879
|
* @throws {AppwriteException}
|
|
1366
2880
|
* @returns {Promise<Models.Target>}
|
|
2881
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1367
2882
|
*/
|
|
1368
|
-
getTarget(userId: string, targetId: string): Promise<Models.Target
|
|
2883
|
+
getTarget(userId: string, targetId: string): Promise<Models.Target>;
|
|
2884
|
+
getTarget(
|
|
2885
|
+
paramsOrFirst: { userId: string, targetId: string } | string,
|
|
2886
|
+
...rest: [(string)?]
|
|
2887
|
+
): Promise<Models.Target> {
|
|
2888
|
+
let params: { userId: string, targetId: string };
|
|
2889
|
+
|
|
2890
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2891
|
+
params = (paramsOrFirst || {}) as { userId: string, targetId: string };
|
|
2892
|
+
} else {
|
|
2893
|
+
params = {
|
|
2894
|
+
userId: paramsOrFirst as string,
|
|
2895
|
+
targetId: rest[0] as string
|
|
2896
|
+
};
|
|
2897
|
+
}
|
|
2898
|
+
|
|
2899
|
+
const userId = params.userId;
|
|
2900
|
+
const targetId = params.targetId;
|
|
2901
|
+
|
|
1369
2902
|
if (typeof userId === 'undefined') {
|
|
1370
2903
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1371
2904
|
}
|
|
1372
2905
|
if (typeof targetId === 'undefined') {
|
|
1373
2906
|
throw new AppwriteException('Missing required parameter: "targetId"');
|
|
1374
2907
|
}
|
|
2908
|
+
|
|
1375
2909
|
const apiPath = '/users/{userId}/targets/{targetId}'.replace('{userId}', userId).replace('{targetId}', targetId);
|
|
1376
2910
|
const payload: Payload = {};
|
|
1377
2911
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -1390,21 +2924,59 @@ export class Users {
|
|
|
1390
2924
|
/**
|
|
1391
2925
|
* Update a messaging target.
|
|
1392
2926
|
*
|
|
1393
|
-
* @param {string} userId
|
|
1394
|
-
* @param {string} targetId
|
|
1395
|
-
* @param {string} identifier
|
|
1396
|
-
* @param {string} providerId
|
|
1397
|
-
* @param {string} name
|
|
2927
|
+
* @param {string} params.userId - User ID.
|
|
2928
|
+
* @param {string} params.targetId - Target ID.
|
|
2929
|
+
* @param {string} params.identifier - The target identifier (token, email, phone etc.)
|
|
2930
|
+
* @param {string} params.providerId - Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.
|
|
2931
|
+
* @param {string} params.name - Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.
|
|
1398
2932
|
* @throws {AppwriteException}
|
|
1399
2933
|
* @returns {Promise<Models.Target>}
|
|
1400
2934
|
*/
|
|
1401
|
-
updateTarget(userId: string, targetId: string, identifier?: string, providerId?: string, name?: string): Promise<Models.Target
|
|
2935
|
+
updateTarget(params: { userId: string, targetId: string, identifier?: string, providerId?: string, name?: string }): Promise<Models.Target>;
|
|
2936
|
+
/**
|
|
2937
|
+
* Update a messaging target.
|
|
2938
|
+
*
|
|
2939
|
+
* @param {string} userId - User ID.
|
|
2940
|
+
* @param {string} targetId - Target ID.
|
|
2941
|
+
* @param {string} identifier - The target identifier (token, email, phone etc.)
|
|
2942
|
+
* @param {string} providerId - Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.
|
|
2943
|
+
* @param {string} name - Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.
|
|
2944
|
+
* @throws {AppwriteException}
|
|
2945
|
+
* @returns {Promise<Models.Target>}
|
|
2946
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2947
|
+
*/
|
|
2948
|
+
updateTarget(userId: string, targetId: string, identifier?: string, providerId?: string, name?: string): Promise<Models.Target>;
|
|
2949
|
+
updateTarget(
|
|
2950
|
+
paramsOrFirst: { userId: string, targetId: string, identifier?: string, providerId?: string, name?: string } | string,
|
|
2951
|
+
...rest: [(string)?, (string)?, (string)?, (string)?]
|
|
2952
|
+
): Promise<Models.Target> {
|
|
2953
|
+
let params: { userId: string, targetId: string, identifier?: string, providerId?: string, name?: string };
|
|
2954
|
+
|
|
2955
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2956
|
+
params = (paramsOrFirst || {}) as { userId: string, targetId: string, identifier?: string, providerId?: string, name?: string };
|
|
2957
|
+
} else {
|
|
2958
|
+
params = {
|
|
2959
|
+
userId: paramsOrFirst as string,
|
|
2960
|
+
targetId: rest[0] as string,
|
|
2961
|
+
identifier: rest[1] as string,
|
|
2962
|
+
providerId: rest[2] as string,
|
|
2963
|
+
name: rest[3] as string
|
|
2964
|
+
};
|
|
2965
|
+
}
|
|
2966
|
+
|
|
2967
|
+
const userId = params.userId;
|
|
2968
|
+
const targetId = params.targetId;
|
|
2969
|
+
const identifier = params.identifier;
|
|
2970
|
+
const providerId = params.providerId;
|
|
2971
|
+
const name = params.name;
|
|
2972
|
+
|
|
1402
2973
|
if (typeof userId === 'undefined') {
|
|
1403
2974
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1404
2975
|
}
|
|
1405
2976
|
if (typeof targetId === 'undefined') {
|
|
1406
2977
|
throw new AppwriteException('Missing required parameter: "targetId"');
|
|
1407
2978
|
}
|
|
2979
|
+
|
|
1408
2980
|
const apiPath = '/users/{userId}/targets/{targetId}'.replace('{userId}', userId).replace('{targetId}', targetId);
|
|
1409
2981
|
const payload: Payload = {};
|
|
1410
2982
|
if (typeof identifier !== 'undefined') {
|
|
@@ -1433,18 +3005,47 @@ export class Users {
|
|
|
1433
3005
|
/**
|
|
1434
3006
|
* Delete a messaging target.
|
|
1435
3007
|
*
|
|
1436
|
-
* @param {string} userId
|
|
1437
|
-
* @param {string} targetId
|
|
3008
|
+
* @param {string} params.userId - User ID.
|
|
3009
|
+
* @param {string} params.targetId - Target ID.
|
|
1438
3010
|
* @throws {AppwriteException}
|
|
1439
3011
|
* @returns {Promise<{}>}
|
|
1440
3012
|
*/
|
|
1441
|
-
deleteTarget(userId: string, targetId: string): Promise<{}
|
|
3013
|
+
deleteTarget(params: { userId: string, targetId: string }): Promise<{}>;
|
|
3014
|
+
/**
|
|
3015
|
+
* Delete a messaging target.
|
|
3016
|
+
*
|
|
3017
|
+
* @param {string} userId - User ID.
|
|
3018
|
+
* @param {string} targetId - Target ID.
|
|
3019
|
+
* @throws {AppwriteException}
|
|
3020
|
+
* @returns {Promise<{}>}
|
|
3021
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
3022
|
+
*/
|
|
3023
|
+
deleteTarget(userId: string, targetId: string): Promise<{}>;
|
|
3024
|
+
deleteTarget(
|
|
3025
|
+
paramsOrFirst: { userId: string, targetId: string } | string,
|
|
3026
|
+
...rest: [(string)?]
|
|
3027
|
+
): Promise<{}> {
|
|
3028
|
+
let params: { userId: string, targetId: string };
|
|
3029
|
+
|
|
3030
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3031
|
+
params = (paramsOrFirst || {}) as { userId: string, targetId: string };
|
|
3032
|
+
} else {
|
|
3033
|
+
params = {
|
|
3034
|
+
userId: paramsOrFirst as string,
|
|
3035
|
+
targetId: rest[0] as string
|
|
3036
|
+
};
|
|
3037
|
+
}
|
|
3038
|
+
|
|
3039
|
+
const userId = params.userId;
|
|
3040
|
+
const targetId = params.targetId;
|
|
3041
|
+
|
|
1442
3042
|
if (typeof userId === 'undefined') {
|
|
1443
3043
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1444
3044
|
}
|
|
1445
3045
|
if (typeof targetId === 'undefined') {
|
|
1446
3046
|
throw new AppwriteException('Missing required parameter: "targetId"');
|
|
1447
3047
|
}
|
|
3048
|
+
|
|
1448
3049
|
const apiPath = '/users/{userId}/targets/{targetId}'.replace('{userId}', userId).replace('{targetId}', targetId);
|
|
1449
3050
|
const payload: Payload = {};
|
|
1450
3051
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -1465,16 +3066,49 @@ export class Users {
|
|
|
1465
3066
|
* Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT /account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process.
|
|
1466
3067
|
*
|
|
1467
3068
|
*
|
|
1468
|
-
* @param {string} userId
|
|
1469
|
-
* @param {number} length
|
|
1470
|
-
* @param {number} expire
|
|
3069
|
+
* @param {string} params.userId - User ID.
|
|
3070
|
+
* @param {number} params.length - Token length in characters. The default length is 6 characters
|
|
3071
|
+
* @param {number} params.expire - Token expiration period in seconds. The default expiration is 15 minutes.
|
|
3072
|
+
* @throws {AppwriteException}
|
|
3073
|
+
* @returns {Promise<Models.Token>}
|
|
3074
|
+
*/
|
|
3075
|
+
createToken(params: { userId: string, length?: number, expire?: number }): Promise<Models.Token>;
|
|
3076
|
+
/**
|
|
3077
|
+
* Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT /account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process.
|
|
3078
|
+
*
|
|
3079
|
+
*
|
|
3080
|
+
* @param {string} userId - User ID.
|
|
3081
|
+
* @param {number} length - Token length in characters. The default length is 6 characters
|
|
3082
|
+
* @param {number} expire - Token expiration period in seconds. The default expiration is 15 minutes.
|
|
1471
3083
|
* @throws {AppwriteException}
|
|
1472
3084
|
* @returns {Promise<Models.Token>}
|
|
3085
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1473
3086
|
*/
|
|
1474
|
-
createToken(userId: string, length?: number, expire?: number): Promise<Models.Token
|
|
3087
|
+
createToken(userId: string, length?: number, expire?: number): Promise<Models.Token>;
|
|
3088
|
+
createToken(
|
|
3089
|
+
paramsOrFirst: { userId: string, length?: number, expire?: number } | string,
|
|
3090
|
+
...rest: [(number)?, (number)?]
|
|
3091
|
+
): Promise<Models.Token> {
|
|
3092
|
+
let params: { userId: string, length?: number, expire?: number };
|
|
3093
|
+
|
|
3094
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3095
|
+
params = (paramsOrFirst || {}) as { userId: string, length?: number, expire?: number };
|
|
3096
|
+
} else {
|
|
3097
|
+
params = {
|
|
3098
|
+
userId: paramsOrFirst as string,
|
|
3099
|
+
length: rest[0] as number,
|
|
3100
|
+
expire: rest[1] as number
|
|
3101
|
+
};
|
|
3102
|
+
}
|
|
3103
|
+
|
|
3104
|
+
const userId = params.userId;
|
|
3105
|
+
const length = params.length;
|
|
3106
|
+
const expire = params.expire;
|
|
3107
|
+
|
|
1475
3108
|
if (typeof userId === 'undefined') {
|
|
1476
3109
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1477
3110
|
}
|
|
3111
|
+
|
|
1478
3112
|
const apiPath = '/users/{userId}/tokens'.replace('{userId}', userId);
|
|
1479
3113
|
const payload: Payload = {};
|
|
1480
3114
|
if (typeof length !== 'undefined') {
|
|
@@ -1500,18 +3134,47 @@ export class Users {
|
|
|
1500
3134
|
/**
|
|
1501
3135
|
* Update the user email verification status by its unique ID.
|
|
1502
3136
|
*
|
|
1503
|
-
* @param {string} userId
|
|
1504
|
-
* @param {boolean} emailVerification
|
|
3137
|
+
* @param {string} params.userId - User ID.
|
|
3138
|
+
* @param {boolean} params.emailVerification - User email verification status.
|
|
3139
|
+
* @throws {AppwriteException}
|
|
3140
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
3141
|
+
*/
|
|
3142
|
+
updateEmailVerification<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, emailVerification: boolean }): Promise<Models.User<Preferences>>;
|
|
3143
|
+
/**
|
|
3144
|
+
* Update the user email verification status by its unique ID.
|
|
3145
|
+
*
|
|
3146
|
+
* @param {string} userId - User ID.
|
|
3147
|
+
* @param {boolean} emailVerification - User email verification status.
|
|
1505
3148
|
* @throws {AppwriteException}
|
|
1506
3149
|
* @returns {Promise<Models.User<Preferences>>}
|
|
3150
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1507
3151
|
*/
|
|
1508
|
-
updateEmailVerification<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, emailVerification: boolean): Promise<Models.User<Preferences
|
|
3152
|
+
updateEmailVerification<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, emailVerification: boolean): Promise<Models.User<Preferences>>;
|
|
3153
|
+
updateEmailVerification<Preferences extends Models.Preferences = Models.DefaultPreferences>(
|
|
3154
|
+
paramsOrFirst: { userId: string, emailVerification: boolean } | string,
|
|
3155
|
+
...rest: [(boolean)?]
|
|
3156
|
+
): Promise<Models.User<Preferences>> {
|
|
3157
|
+
let params: { userId: string, emailVerification: boolean };
|
|
3158
|
+
|
|
3159
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3160
|
+
params = (paramsOrFirst || {}) as { userId: string, emailVerification: boolean };
|
|
3161
|
+
} else {
|
|
3162
|
+
params = {
|
|
3163
|
+
userId: paramsOrFirst as string,
|
|
3164
|
+
emailVerification: rest[0] as boolean
|
|
3165
|
+
};
|
|
3166
|
+
}
|
|
3167
|
+
|
|
3168
|
+
const userId = params.userId;
|
|
3169
|
+
const emailVerification = params.emailVerification;
|
|
3170
|
+
|
|
1509
3171
|
if (typeof userId === 'undefined') {
|
|
1510
3172
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1511
3173
|
}
|
|
1512
3174
|
if (typeof emailVerification === 'undefined') {
|
|
1513
3175
|
throw new AppwriteException('Missing required parameter: "emailVerification"');
|
|
1514
3176
|
}
|
|
3177
|
+
|
|
1515
3178
|
const apiPath = '/users/{userId}/verification'.replace('{userId}', userId);
|
|
1516
3179
|
const payload: Payload = {};
|
|
1517
3180
|
if (typeof emailVerification !== 'undefined') {
|
|
@@ -1534,18 +3197,47 @@ export class Users {
|
|
|
1534
3197
|
/**
|
|
1535
3198
|
* Update the user phone verification status by its unique ID.
|
|
1536
3199
|
*
|
|
1537
|
-
* @param {string} userId
|
|
1538
|
-
* @param {boolean} phoneVerification
|
|
3200
|
+
* @param {string} params.userId - User ID.
|
|
3201
|
+
* @param {boolean} params.phoneVerification - User phone verification status.
|
|
3202
|
+
* @throws {AppwriteException}
|
|
3203
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
3204
|
+
*/
|
|
3205
|
+
updatePhoneVerification<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, phoneVerification: boolean }): Promise<Models.User<Preferences>>;
|
|
3206
|
+
/**
|
|
3207
|
+
* Update the user phone verification status by its unique ID.
|
|
3208
|
+
*
|
|
3209
|
+
* @param {string} userId - User ID.
|
|
3210
|
+
* @param {boolean} phoneVerification - User phone verification status.
|
|
1539
3211
|
* @throws {AppwriteException}
|
|
1540
3212
|
* @returns {Promise<Models.User<Preferences>>}
|
|
3213
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1541
3214
|
*/
|
|
1542
|
-
updatePhoneVerification<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, phoneVerification: boolean): Promise<Models.User<Preferences
|
|
3215
|
+
updatePhoneVerification<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, phoneVerification: boolean): Promise<Models.User<Preferences>>;
|
|
3216
|
+
updatePhoneVerification<Preferences extends Models.Preferences = Models.DefaultPreferences>(
|
|
3217
|
+
paramsOrFirst: { userId: string, phoneVerification: boolean } | string,
|
|
3218
|
+
...rest: [(boolean)?]
|
|
3219
|
+
): Promise<Models.User<Preferences>> {
|
|
3220
|
+
let params: { userId: string, phoneVerification: boolean };
|
|
3221
|
+
|
|
3222
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3223
|
+
params = (paramsOrFirst || {}) as { userId: string, phoneVerification: boolean };
|
|
3224
|
+
} else {
|
|
3225
|
+
params = {
|
|
3226
|
+
userId: paramsOrFirst as string,
|
|
3227
|
+
phoneVerification: rest[0] as boolean
|
|
3228
|
+
};
|
|
3229
|
+
}
|
|
3230
|
+
|
|
3231
|
+
const userId = params.userId;
|
|
3232
|
+
const phoneVerification = params.phoneVerification;
|
|
3233
|
+
|
|
1543
3234
|
if (typeof userId === 'undefined') {
|
|
1544
3235
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1545
3236
|
}
|
|
1546
3237
|
if (typeof phoneVerification === 'undefined') {
|
|
1547
3238
|
throw new AppwriteException('Missing required parameter: "phoneVerification"');
|
|
1548
3239
|
}
|
|
3240
|
+
|
|
1549
3241
|
const apiPath = '/users/{userId}/verification/phone'.replace('{userId}', userId);
|
|
1550
3242
|
const payload: Payload = {};
|
|
1551
3243
|
if (typeof phoneVerification !== 'undefined') {
|