@appwrite.io/console 1.9.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 +51 -6
- package/LICENSE +1 -1
- package/README.md +84 -4
- package/dist/cjs/sdk.js +15258 -6036
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +15256 -6037
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +15258 -6036
- 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 +16 -11
- package/docs/examples/databases/create-documents.md +7 -6
- 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 +13 -0
- 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 +14 -0
- 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 -5
- 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 +1925 -239
- package/src/operator.ts +308 -0
- package/src/query.ts +246 -2
- package/src/services/account.ts +2278 -235
- package/src/services/assistant.ts +29 -3
- package/src/services/avatars.ts +511 -52
- package/src/services/backups.ts +400 -42
- package/src/services/console.ts +499 -19
- package/src/services/databases.ts +3584 -430
- package/src/services/domains.ts +1795 -266
- package/src/services/functions.ts +1197 -155
- package/src/services/graphql.ts +56 -4
- package/src/services/health.ts +586 -42
- package/src/services/locale.ts +18 -2
- package/src/services/messaging.ts +3418 -386
- package/src/services/migrations.ts +653 -65
- package/src/services/organizations.ts +1411 -126
- package/src/services/project.ts +173 -17
- package/src/services/projects.ts +2808 -282
- package/src/services/proxy.ts +272 -26
- package/src/services/realtime.ts +437 -0
- package/src/services/sites.ts +1129 -143
- package/src/services/storage.ts +672 -89
- package/src/services/tables-db.ts +5439 -0
- package/src/services/teams.ts +535 -65
- package/src/services/tokens.ts +171 -16
- package/src/services/users.ts +1916 -182
- package/src/services/vcs.ts +373 -41
- 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 +1877 -422
- package/types/operator.d.ts +180 -0
- package/types/query.d.ts +198 -2
- package/types/services/account.d.ts +1020 -158
- package/types/services/assistant.d.ts +13 -2
- package/types/services/avatars.d.ts +263 -45
- package/types/services/backups.d.ts +190 -30
- package/types/services/console.d.ts +202 -15
- package/types/services/databases.d.ts +1756 -299
- package/types/services/domains.d.ts +971 -219
- package/types/services/functions.d.ts +622 -131
- package/types/services/graphql.d.ts +24 -2
- package/types/services/health.d.ts +246 -24
- package/types/services/locale.d.ts +2 -2
- package/types/services/messaging.d.ts +1670 -281
- package/types/services/migrations.d.ts +319 -53
- package/types/services/organizations.d.ts +664 -109
- 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 +580 -119
- package/types/services/storage.d.ts +362 -81
- package/types/services/tables-db.d.ts +2040 -0
- package/types/services/teams.d.ts +277 -61
- package/types/services/tokens.d.ts +80 -12
- package/types/services/users.d.ts +906 -149
- package/types/services/vcs.d.ts +182 -34
- 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>(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 } = {
|
|
@@ -42,21 +79,60 @@ export class Users {
|
|
|
42
79
|
payload
|
|
43
80
|
);
|
|
44
81
|
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Create a new user.
|
|
85
|
+
*
|
|
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>>;
|
|
45
95
|
/**
|
|
46
96
|
* Create a new user.
|
|
47
97
|
*
|
|
48
|
-
* @param {string} userId
|
|
49
|
-
* @param {string} email
|
|
50
|
-
* @param {string} phone
|
|
51
|
-
* @param {string} password
|
|
52
|
-
* @param {string} name
|
|
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.
|
|
53
103
|
* @throws {AppwriteException}
|
|
54
104
|
* @returns {Promise<Models.User<Preferences>>}
|
|
105
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
55
106
|
*/
|
|
56
|
-
create<Preferences extends Models.Preferences>(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
|
+
|
|
57
132
|
if (typeof userId === 'undefined') {
|
|
58
133
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
59
134
|
}
|
|
135
|
+
|
|
60
136
|
const apiPath = '/users';
|
|
61
137
|
const payload: Payload = {};
|
|
62
138
|
if (typeof userId !== 'undefined') {
|
|
@@ -87,17 +163,52 @@ export class Users {
|
|
|
87
163
|
payload
|
|
88
164
|
);
|
|
89
165
|
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
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.
|
|
169
|
+
*
|
|
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>>;
|
|
90
178
|
/**
|
|
91
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.
|
|
92
180
|
*
|
|
93
|
-
* @param {string} userId
|
|
94
|
-
* @param {string} email
|
|
95
|
-
* @param {string} password
|
|
96
|
-
* @param {string} name
|
|
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.
|
|
97
185
|
* @throws {AppwriteException}
|
|
98
186
|
* @returns {Promise<Models.User<Preferences>>}
|
|
187
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
99
188
|
*/
|
|
100
|
-
createArgon2User<Preferences extends Models.Preferences>(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
|
+
|
|
101
212
|
if (typeof userId === 'undefined') {
|
|
102
213
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
103
214
|
}
|
|
@@ -107,6 +218,7 @@ export class Users {
|
|
|
107
218
|
if (typeof password === 'undefined') {
|
|
108
219
|
throw new AppwriteException('Missing required parameter: "password"');
|
|
109
220
|
}
|
|
221
|
+
|
|
110
222
|
const apiPath = '/users/argon2';
|
|
111
223
|
const payload: Payload = {};
|
|
112
224
|
if (typeof userId !== 'undefined') {
|
|
@@ -134,17 +246,52 @@ export class Users {
|
|
|
134
246
|
payload
|
|
135
247
|
);
|
|
136
248
|
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
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.
|
|
252
|
+
*
|
|
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>>;
|
|
137
261
|
/**
|
|
138
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.
|
|
139
263
|
*
|
|
140
|
-
* @param {string} userId
|
|
141
|
-
* @param {string} email
|
|
142
|
-
* @param {string} password
|
|
143
|
-
* @param {string} name
|
|
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.
|
|
144
268
|
* @throws {AppwriteException}
|
|
145
269
|
* @returns {Promise<Models.User<Preferences>>}
|
|
270
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
146
271
|
*/
|
|
147
|
-
createBcryptUser<Preferences extends Models.Preferences>(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
|
+
|
|
148
295
|
if (typeof userId === 'undefined') {
|
|
149
296
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
150
297
|
}
|
|
@@ -154,6 +301,7 @@ export class Users {
|
|
|
154
301
|
if (typeof password === 'undefined') {
|
|
155
302
|
throw new AppwriteException('Missing required parameter: "password"');
|
|
156
303
|
}
|
|
304
|
+
|
|
157
305
|
const apiPath = '/users/bcrypt';
|
|
158
306
|
const payload: Payload = {};
|
|
159
307
|
if (typeof userId !== 'undefined') {
|
|
@@ -181,15 +329,49 @@ export class Users {
|
|
|
181
329
|
payload
|
|
182
330
|
);
|
|
183
331
|
}
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* Get identities for all users.
|
|
335
|
+
*
|
|
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>;
|
|
184
343
|
/**
|
|
185
344
|
* Get identities for all users.
|
|
186
345
|
*
|
|
187
|
-
* @param {string[]} queries
|
|
188
|
-
* @param {string} search
|
|
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.
|
|
189
349
|
* @throws {AppwriteException}
|
|
190
350
|
* @returns {Promise<Models.IdentityList>}
|
|
351
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
191
352
|
*/
|
|
192
|
-
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
|
+
|
|
193
375
|
const apiPath = '/users/identities';
|
|
194
376
|
const payload: Payload = {};
|
|
195
377
|
if (typeof queries !== 'undefined') {
|
|
@@ -198,6 +380,9 @@ export class Users {
|
|
|
198
380
|
if (typeof search !== 'undefined') {
|
|
199
381
|
payload['search'] = search;
|
|
200
382
|
}
|
|
383
|
+
if (typeof total !== 'undefined') {
|
|
384
|
+
payload['total'] = total;
|
|
385
|
+
}
|
|
201
386
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
202
387
|
|
|
203
388
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -210,17 +395,43 @@ export class Users {
|
|
|
210
395
|
payload
|
|
211
396
|
);
|
|
212
397
|
}
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* Delete an identity by its unique ID.
|
|
401
|
+
*
|
|
402
|
+
* @param {string} params.identityId - Identity ID.
|
|
403
|
+
* @throws {AppwriteException}
|
|
404
|
+
* @returns {Promise<{}>}
|
|
405
|
+
*/
|
|
406
|
+
deleteIdentity(params: { identityId: string }): Promise<{}>;
|
|
213
407
|
/**
|
|
214
408
|
* Delete an identity by its unique ID.
|
|
215
409
|
*
|
|
216
|
-
* @param {string} identityId
|
|
410
|
+
* @param {string} identityId - Identity ID.
|
|
217
411
|
* @throws {AppwriteException}
|
|
218
412
|
* @returns {Promise<{}>}
|
|
413
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
219
414
|
*/
|
|
220
|
-
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
|
+
|
|
221
431
|
if (typeof identityId === 'undefined') {
|
|
222
432
|
throw new AppwriteException('Missing required parameter: "identityId"');
|
|
223
433
|
}
|
|
434
|
+
|
|
224
435
|
const apiPath = '/users/identities/{identityId}'.replace('{identityId}', identityId);
|
|
225
436
|
const payload: Payload = {};
|
|
226
437
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -236,17 +447,52 @@ export class Users {
|
|
|
236
447
|
payload
|
|
237
448
|
);
|
|
238
449
|
}
|
|
450
|
+
|
|
239
451
|
/**
|
|
240
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.
|
|
241
453
|
*
|
|
242
|
-
* @param {string} userId
|
|
243
|
-
* @param {string} email
|
|
244
|
-
* @param {string} password
|
|
245
|
-
* @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.
|
|
246
458
|
* @throws {AppwriteException}
|
|
247
459
|
* @returns {Promise<Models.User<Preferences>>}
|
|
248
460
|
*/
|
|
249
|
-
createMD5User<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences
|
|
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.
|
|
469
|
+
* @throws {AppwriteException}
|
|
470
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
471
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
472
|
+
*/
|
|
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
|
+
|
|
250
496
|
if (typeof userId === 'undefined') {
|
|
251
497
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
252
498
|
}
|
|
@@ -256,6 +502,7 @@ export class Users {
|
|
|
256
502
|
if (typeof password === 'undefined') {
|
|
257
503
|
throw new AppwriteException('Missing required parameter: "password"');
|
|
258
504
|
}
|
|
505
|
+
|
|
259
506
|
const apiPath = '/users/md5';
|
|
260
507
|
const payload: Payload = {};
|
|
261
508
|
if (typeof userId !== 'undefined') {
|
|
@@ -283,17 +530,52 @@ export class Users {
|
|
|
283
530
|
payload
|
|
284
531
|
);
|
|
285
532
|
}
|
|
533
|
+
|
|
534
|
+
/**
|
|
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.
|
|
536
|
+
*
|
|
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>>;
|
|
286
545
|
/**
|
|
287
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.
|
|
288
547
|
*
|
|
289
|
-
* @param {string} userId
|
|
290
|
-
* @param {string} email
|
|
291
|
-
* @param {string} password
|
|
292
|
-
* @param {string} name
|
|
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.
|
|
293
552
|
* @throws {AppwriteException}
|
|
294
553
|
* @returns {Promise<Models.User<Preferences>>}
|
|
554
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
295
555
|
*/
|
|
296
|
-
createPHPassUser<Preferences extends Models.Preferences>(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
|
+
|
|
297
579
|
if (typeof userId === 'undefined') {
|
|
298
580
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
299
581
|
}
|
|
@@ -303,6 +585,7 @@ export class Users {
|
|
|
303
585
|
if (typeof password === 'undefined') {
|
|
304
586
|
throw new AppwriteException('Missing required parameter: "password"');
|
|
305
587
|
}
|
|
588
|
+
|
|
306
589
|
const apiPath = '/users/phpass';
|
|
307
590
|
const payload: Payload = {};
|
|
308
591
|
if (typeof userId !== 'undefined') {
|
|
@@ -330,22 +613,72 @@ export class Users {
|
|
|
330
613
|
payload
|
|
331
614
|
);
|
|
332
615
|
}
|
|
616
|
+
|
|
617
|
+
/**
|
|
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.
|
|
619
|
+
*
|
|
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>>;
|
|
333
633
|
/**
|
|
334
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.
|
|
335
635
|
*
|
|
336
|
-
* @param {string} userId
|
|
337
|
-
* @param {string} email
|
|
338
|
-
* @param {string} password
|
|
339
|
-
* @param {string} passwordSalt
|
|
340
|
-
* @param {number} passwordCpu
|
|
341
|
-
* @param {number} passwordMemory
|
|
342
|
-
* @param {number} passwordParallel
|
|
343
|
-
* @param {number} passwordLength
|
|
344
|
-
* @param {string} name
|
|
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.
|
|
345
645
|
* @throws {AppwriteException}
|
|
346
646
|
* @returns {Promise<Models.User<Preferences>>}
|
|
647
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
347
648
|
*/
|
|
348
|
-
createScryptUser<Preferences extends Models.Preferences>(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
|
+
|
|
349
682
|
if (typeof userId === 'undefined') {
|
|
350
683
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
351
684
|
}
|
|
@@ -370,6 +703,7 @@ export class Users {
|
|
|
370
703
|
if (typeof passwordLength === 'undefined') {
|
|
371
704
|
throw new AppwriteException('Missing required parameter: "passwordLength"');
|
|
372
705
|
}
|
|
706
|
+
|
|
373
707
|
const apiPath = '/users/scrypt';
|
|
374
708
|
const payload: Payload = {};
|
|
375
709
|
if (typeof userId !== 'undefined') {
|
|
@@ -412,20 +746,64 @@ export class Users {
|
|
|
412
746
|
payload
|
|
413
747
|
);
|
|
414
748
|
}
|
|
749
|
+
|
|
750
|
+
/**
|
|
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.
|
|
752
|
+
*
|
|
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>>;
|
|
415
764
|
/**
|
|
416
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.
|
|
417
766
|
*
|
|
418
|
-
* @param {string} userId
|
|
419
|
-
* @param {string} email
|
|
420
|
-
* @param {string} password
|
|
421
|
-
* @param {string} passwordSalt
|
|
422
|
-
* @param {string} passwordSaltSeparator
|
|
423
|
-
* @param {string} passwordSignerKey
|
|
424
|
-
* @param {string} name
|
|
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.
|
|
425
774
|
* @throws {AppwriteException}
|
|
426
775
|
* @returns {Promise<Models.User<Preferences>>}
|
|
776
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
427
777
|
*/
|
|
428
|
-
createScryptModifiedUser<Preferences extends Models.Preferences>(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
|
+
|
|
429
807
|
if (typeof userId === 'undefined') {
|
|
430
808
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
431
809
|
}
|
|
@@ -444,6 +822,7 @@ export class Users {
|
|
|
444
822
|
if (typeof passwordSignerKey === 'undefined') {
|
|
445
823
|
throw new AppwriteException('Missing required parameter: "passwordSignerKey"');
|
|
446
824
|
}
|
|
825
|
+
|
|
447
826
|
const apiPath = '/users/scrypt-modified';
|
|
448
827
|
const payload: Payload = {};
|
|
449
828
|
if (typeof userId !== 'undefined') {
|
|
@@ -480,18 +859,56 @@ export class Users {
|
|
|
480
859
|
payload
|
|
481
860
|
);
|
|
482
861
|
}
|
|
862
|
+
|
|
863
|
+
/**
|
|
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.
|
|
865
|
+
*
|
|
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>>;
|
|
483
875
|
/**
|
|
484
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.
|
|
485
877
|
*
|
|
486
|
-
* @param {string} userId
|
|
487
|
-
* @param {string} email
|
|
488
|
-
* @param {string} password
|
|
489
|
-
* @param {PasswordHash} passwordVersion
|
|
490
|
-
* @param {string} name
|
|
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.
|
|
491
883
|
* @throws {AppwriteException}
|
|
492
884
|
* @returns {Promise<Models.User<Preferences>>}
|
|
885
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
493
886
|
*/
|
|
494
|
-
createSHAUser<Preferences extends Models.Preferences>(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
|
+
|
|
495
912
|
if (typeof userId === 'undefined') {
|
|
496
913
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
497
914
|
}
|
|
@@ -501,6 +918,7 @@ export class Users {
|
|
|
501
918
|
if (typeof password === 'undefined') {
|
|
502
919
|
throw new AppwriteException('Missing required parameter: "password"');
|
|
503
920
|
}
|
|
921
|
+
|
|
504
922
|
const apiPath = '/users/sha';
|
|
505
923
|
const payload: Payload = {};
|
|
506
924
|
if (typeof userId !== 'undefined') {
|
|
@@ -531,15 +949,42 @@ export class Users {
|
|
|
531
949
|
payload
|
|
532
950
|
);
|
|
533
951
|
}
|
|
952
|
+
|
|
534
953
|
/**
|
|
535
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.
|
|
536
|
-
|
|
955
|
+
*
|
|
956
|
+
*
|
|
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
|
+
*
|
|
537
965
|
*
|
|
538
|
-
* @param {
|
|
966
|
+
* @param {UsageRange} range - Date range.
|
|
539
967
|
* @throws {AppwriteException}
|
|
540
968
|
* @returns {Promise<Models.UsageUsers>}
|
|
969
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
541
970
|
*/
|
|
542
|
-
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
|
+
|
|
543
988
|
const apiPath = '/users/usage';
|
|
544
989
|
const payload: Payload = {};
|
|
545
990
|
if (typeof range !== 'undefined') {
|
|
@@ -557,17 +1002,43 @@ export class Users {
|
|
|
557
1002
|
payload
|
|
558
1003
|
);
|
|
559
1004
|
}
|
|
1005
|
+
|
|
1006
|
+
/**
|
|
1007
|
+
* Get a user by its unique ID.
|
|
1008
|
+
*
|
|
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>>;
|
|
560
1014
|
/**
|
|
561
1015
|
* Get a user by its unique ID.
|
|
562
1016
|
*
|
|
563
|
-
* @param {string} userId
|
|
1017
|
+
* @param {string} userId - User ID.
|
|
564
1018
|
* @throws {AppwriteException}
|
|
565
1019
|
* @returns {Promise<Models.User<Preferences>>}
|
|
1020
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
566
1021
|
*/
|
|
567
|
-
get<Preferences extends Models.Preferences>(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
|
+
|
|
568
1038
|
if (typeof userId === 'undefined') {
|
|
569
1039
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
570
1040
|
}
|
|
1041
|
+
|
|
571
1042
|
const apiPath = '/users/{userId}'.replace('{userId}', userId);
|
|
572
1043
|
const payload: Payload = {};
|
|
573
1044
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -582,17 +1053,43 @@ export class Users {
|
|
|
582
1053
|
payload
|
|
583
1054
|
);
|
|
584
1055
|
}
|
|
1056
|
+
|
|
585
1057
|
/**
|
|
586
|
-
* 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.
|
|
587
1059
|
*
|
|
588
|
-
* @param {string} userId
|
|
1060
|
+
* @param {string} params.userId - User ID.
|
|
589
1061
|
* @throws {AppwriteException}
|
|
590
1062
|
* @returns {Promise<{}>}
|
|
591
1063
|
*/
|
|
592
|
-
delete(userId: string): Promise<{}
|
|
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.
|
|
1067
|
+
*
|
|
1068
|
+
* @param {string} userId - User ID.
|
|
1069
|
+
* @throws {AppwriteException}
|
|
1070
|
+
* @returns {Promise<{}>}
|
|
1071
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1072
|
+
*/
|
|
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
|
+
|
|
593
1089
|
if (typeof userId === 'undefined') {
|
|
594
1090
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
595
1091
|
}
|
|
1092
|
+
|
|
596
1093
|
const apiPath = '/users/{userId}'.replace('{userId}', userId);
|
|
597
1094
|
const payload: Payload = {};
|
|
598
1095
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -608,21 +1105,51 @@ export class Users {
|
|
|
608
1105
|
payload
|
|
609
1106
|
);
|
|
610
1107
|
}
|
|
1108
|
+
|
|
611
1109
|
/**
|
|
612
1110
|
* Update the user email by its unique ID.
|
|
613
1111
|
*
|
|
614
|
-
* @param {string} userId
|
|
615
|
-
* @param {string} email
|
|
1112
|
+
* @param {string} params.userId - User ID.
|
|
1113
|
+
* @param {string} params.email - User email.
|
|
616
1114
|
* @throws {AppwriteException}
|
|
617
1115
|
* @returns {Promise<Models.User<Preferences>>}
|
|
618
1116
|
*/
|
|
619
|
-
updateEmail<Preferences extends Models.Preferences>(userId: string, email: string): Promise<Models.User<Preferences
|
|
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.
|
|
1123
|
+
* @throws {AppwriteException}
|
|
1124
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
1125
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1126
|
+
*/
|
|
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
|
+
|
|
620
1146
|
if (typeof userId === 'undefined') {
|
|
621
1147
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
622
1148
|
}
|
|
623
1149
|
if (typeof email === 'undefined') {
|
|
624
1150
|
throw new AppwriteException('Missing required parameter: "email"');
|
|
625
1151
|
}
|
|
1152
|
+
|
|
626
1153
|
const apiPath = '/users/{userId}/email'.replace('{userId}', userId);
|
|
627
1154
|
const payload: Payload = {};
|
|
628
1155
|
if (typeof email !== 'undefined') {
|
|
@@ -641,19 +1168,52 @@ export class Users {
|
|
|
641
1168
|
payload
|
|
642
1169
|
);
|
|
643
1170
|
}
|
|
1171
|
+
|
|
1172
|
+
/**
|
|
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.
|
|
1174
|
+
*
|
|
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>;
|
|
644
1182
|
/**
|
|
645
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.
|
|
646
1184
|
*
|
|
647
|
-
* @param {string} userId
|
|
648
|
-
* @param {string} sessionId
|
|
649
|
-
* @param {number} duration
|
|
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.
|
|
650
1188
|
* @throws {AppwriteException}
|
|
651
1189
|
* @returns {Promise<Models.Jwt>}
|
|
1190
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
652
1191
|
*/
|
|
653
|
-
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
|
+
|
|
654
1213
|
if (typeof userId === 'undefined') {
|
|
655
1214
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
656
1215
|
}
|
|
1216
|
+
|
|
657
1217
|
const apiPath = '/users/{userId}/jwts'.replace('{userId}', userId);
|
|
658
1218
|
const payload: Payload = {};
|
|
659
1219
|
if (typeof sessionId !== 'undefined') {
|
|
@@ -675,23 +1235,55 @@ export class Users {
|
|
|
675
1235
|
payload
|
|
676
1236
|
);
|
|
677
1237
|
}
|
|
1238
|
+
|
|
678
1239
|
/**
|
|
679
1240
|
* Update the user labels by its unique ID.
|
|
680
|
-
|
|
681
|
-
Labels can be used to grant access to resources. While teams are a way for user
|
|
1241
|
+
*
|
|
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.
|
|
682
1254
|
*
|
|
683
|
-
* @param {string} userId
|
|
684
|
-
* @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.
|
|
685
1257
|
* @throws {AppwriteException}
|
|
686
1258
|
* @returns {Promise<Models.User<Preferences>>}
|
|
1259
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
687
1260
|
*/
|
|
688
|
-
updateLabels<Preferences extends Models.Preferences>(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
|
+
|
|
689
1280
|
if (typeof userId === 'undefined') {
|
|
690
1281
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
691
1282
|
}
|
|
692
1283
|
if (typeof labels === 'undefined') {
|
|
693
1284
|
throw new AppwriteException('Missing required parameter: "labels"');
|
|
694
1285
|
}
|
|
1286
|
+
|
|
695
1287
|
const apiPath = '/users/{userId}/labels'.replace('{userId}', userId);
|
|
696
1288
|
const payload: Payload = {};
|
|
697
1289
|
if (typeof labels !== 'undefined') {
|
|
@@ -710,23 +1302,60 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
710
1302
|
payload
|
|
711
1303
|
);
|
|
712
1304
|
}
|
|
1305
|
+
|
|
1306
|
+
/**
|
|
1307
|
+
* Get the user activity logs list by its unique ID.
|
|
1308
|
+
*
|
|
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>;
|
|
713
1316
|
/**
|
|
714
1317
|
* Get the user activity logs list by its unique ID.
|
|
715
1318
|
*
|
|
716
|
-
* @param {string} userId
|
|
717
|
-
* @param {string[]} queries
|
|
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.
|
|
718
1322
|
* @throws {AppwriteException}
|
|
719
1323
|
* @returns {Promise<Models.LogList>}
|
|
1324
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
720
1325
|
*/
|
|
721
|
-
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
|
+
|
|
722
1347
|
if (typeof userId === 'undefined') {
|
|
723
1348
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
724
1349
|
}
|
|
1350
|
+
|
|
725
1351
|
const apiPath = '/users/{userId}/logs'.replace('{userId}', userId);
|
|
726
1352
|
const payload: Payload = {};
|
|
727
1353
|
if (typeof queries !== 'undefined') {
|
|
728
1354
|
payload['queries'] = queries;
|
|
729
1355
|
}
|
|
1356
|
+
if (typeof total !== 'undefined') {
|
|
1357
|
+
payload['total'] = total;
|
|
1358
|
+
}
|
|
730
1359
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
731
1360
|
|
|
732
1361
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -739,19 +1368,56 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
739
1368
|
payload
|
|
740
1369
|
);
|
|
741
1370
|
}
|
|
1371
|
+
|
|
1372
|
+
/**
|
|
1373
|
+
* Get the user membership list by its unique ID.
|
|
1374
|
+
*
|
|
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>;
|
|
742
1383
|
/**
|
|
743
1384
|
* Get the user membership list by its unique ID.
|
|
744
1385
|
*
|
|
745
|
-
* @param {string} userId
|
|
746
|
-
* @param {string[]} queries
|
|
747
|
-
* @param {string} search
|
|
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.
|
|
748
1390
|
* @throws {AppwriteException}
|
|
749
1391
|
* @returns {Promise<Models.MembershipList>}
|
|
1392
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
750
1393
|
*/
|
|
751
|
-
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
|
+
|
|
752
1417
|
if (typeof userId === 'undefined') {
|
|
753
1418
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
754
1419
|
}
|
|
1420
|
+
|
|
755
1421
|
const apiPath = '/users/{userId}/memberships'.replace('{userId}', userId);
|
|
756
1422
|
const payload: Payload = {};
|
|
757
1423
|
if (typeof queries !== 'undefined') {
|
|
@@ -760,6 +1426,9 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
760
1426
|
if (typeof search !== 'undefined') {
|
|
761
1427
|
payload['search'] = search;
|
|
762
1428
|
}
|
|
1429
|
+
if (typeof total !== 'undefined') {
|
|
1430
|
+
payload['total'] = total;
|
|
1431
|
+
}
|
|
763
1432
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
764
1433
|
|
|
765
1434
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -772,21 +1441,52 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
772
1441
|
payload
|
|
773
1442
|
);
|
|
774
1443
|
}
|
|
1444
|
+
|
|
775
1445
|
/**
|
|
776
1446
|
* Enable or disable MFA on a user account.
|
|
777
1447
|
*
|
|
778
|
-
* @param {string} userId
|
|
779
|
-
* @param {boolean} mfa
|
|
1448
|
+
* @param {string} params.userId - User ID.
|
|
1449
|
+
* @param {boolean} params.mfa - Enable or disable MFA.
|
|
780
1450
|
* @throws {AppwriteException}
|
|
781
1451
|
* @returns {Promise<Models.User<Preferences>>}
|
|
1452
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `Users.updateMFA` instead.
|
|
782
1453
|
*/
|
|
783
|
-
updateMfa<Preferences extends Models.Preferences>(userId: string, mfa: boolean): Promise<Models.User<Preferences
|
|
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.
|
|
1460
|
+
* @throws {AppwriteException}
|
|
1461
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
1462
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1463
|
+
*/
|
|
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
|
+
|
|
784
1483
|
if (typeof userId === 'undefined') {
|
|
785
1484
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
786
1485
|
}
|
|
787
1486
|
if (typeof mfa === 'undefined') {
|
|
788
1487
|
throw new AppwriteException('Missing required parameter: "mfa"');
|
|
789
1488
|
}
|
|
1489
|
+
|
|
790
1490
|
const apiPath = '/users/{userId}/mfa'.replace('{userId}', userId);
|
|
791
1491
|
const payload: Payload = {};
|
|
792
1492
|
if (typeof mfa !== 'undefined') {
|
|
@@ -805,23 +1505,56 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
805
1505
|
payload
|
|
806
1506
|
);
|
|
807
1507
|
}
|
|
1508
|
+
|
|
808
1509
|
/**
|
|
809
|
-
*
|
|
1510
|
+
* Enable or disable MFA on a user account.
|
|
810
1511
|
*
|
|
811
|
-
* @param {string} userId
|
|
812
|
-
* @param {
|
|
1512
|
+
* @param {string} params.userId - User ID.
|
|
1513
|
+
* @param {boolean} params.mfa - Enable or disable MFA.
|
|
813
1514
|
* @throws {AppwriteException}
|
|
814
|
-
* @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.
|
|
815
1526
|
*/
|
|
816
|
-
|
|
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
|
+
|
|
817
1546
|
if (typeof userId === 'undefined') {
|
|
818
1547
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
819
1548
|
}
|
|
820
|
-
if (typeof
|
|
821
|
-
throw new AppwriteException('Missing required parameter: "
|
|
1549
|
+
if (typeof mfa === 'undefined') {
|
|
1550
|
+
throw new AppwriteException('Missing required parameter: "mfa"');
|
|
822
1551
|
}
|
|
823
|
-
|
|
1552
|
+
|
|
1553
|
+
const apiPath = '/users/{userId}/mfa'.replace('{userId}', userId);
|
|
824
1554
|
const payload: Payload = {};
|
|
1555
|
+
if (typeof mfa !== 'undefined') {
|
|
1556
|
+
payload['mfa'] = mfa;
|
|
1557
|
+
}
|
|
825
1558
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
826
1559
|
|
|
827
1560
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -829,73 +1562,429 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
829
1562
|
}
|
|
830
1563
|
|
|
831
1564
|
return this.client.call(
|
|
832
|
-
'
|
|
1565
|
+
'patch',
|
|
833
1566
|
uri,
|
|
834
1567
|
apiHeaders,
|
|
835
1568
|
payload
|
|
836
1569
|
);
|
|
837
1570
|
}
|
|
1571
|
+
|
|
838
1572
|
/**
|
|
839
|
-
*
|
|
1573
|
+
* Delete an authenticator app.
|
|
840
1574
|
*
|
|
841
|
-
* @param {string} userId
|
|
1575
|
+
* @param {string} params.userId - User ID.
|
|
1576
|
+
* @param {AuthenticatorType} params.type - Type of authenticator.
|
|
842
1577
|
* @throws {AppwriteException}
|
|
843
|
-
* @returns {Promise<
|
|
1578
|
+
* @returns {Promise<{}>}
|
|
1579
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `Users.deleteMFAAuthenticator` instead.
|
|
1580
|
+
*/
|
|
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.
|
|
844
1590
|
*/
|
|
845
|
-
|
|
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
|
+
|
|
846
1610
|
if (typeof userId === 'undefined') {
|
|
847
1611
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
848
1612
|
}
|
|
849
|
-
|
|
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);
|
|
850
1618
|
const payload: Payload = {};
|
|
851
1619
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
852
1620
|
|
|
853
1621
|
const apiHeaders: { [header: string]: string } = {
|
|
1622
|
+
'content-type': 'application/json',
|
|
854
1623
|
}
|
|
855
1624
|
|
|
856
1625
|
return this.client.call(
|
|
857
|
-
'
|
|
1626
|
+
'delete',
|
|
858
1627
|
uri,
|
|
859
1628
|
apiHeaders,
|
|
860
1629
|
payload
|
|
861
1630
|
);
|
|
862
1631
|
}
|
|
1632
|
+
|
|
863
1633
|
/**
|
|
864
|
-
*
|
|
1634
|
+
* Delete an authenticator app.
|
|
865
1635
|
*
|
|
866
|
-
* @param {string} userId
|
|
1636
|
+
* @param {string} params.userId - User ID.
|
|
1637
|
+
* @param {AuthenticatorType} params.type - Type of authenticator.
|
|
867
1638
|
* @throws {AppwriteException}
|
|
868
|
-
* @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.
|
|
869
1650
|
*/
|
|
870
|
-
|
|
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
|
+
|
|
871
1670
|
if (typeof userId === 'undefined') {
|
|
872
1671
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
873
1672
|
}
|
|
874
|
-
|
|
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);
|
|
875
1678
|
const payload: Payload = {};
|
|
876
1679
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
877
1680
|
|
|
878
1681
|
const apiHeaders: { [header: string]: string } = {
|
|
1682
|
+
'content-type': 'application/json',
|
|
879
1683
|
}
|
|
880
1684
|
|
|
881
1685
|
return this.client.call(
|
|
882
|
-
'
|
|
1686
|
+
'delete',
|
|
883
1687
|
uri,
|
|
884
1688
|
apiHeaders,
|
|
885
1689
|
payload
|
|
886
1690
|
);
|
|
887
1691
|
}
|
|
1692
|
+
|
|
888
1693
|
/**
|
|
889
|
-
*
|
|
1694
|
+
* List the factors available on the account to be used as a MFA challange.
|
|
890
1695
|
*
|
|
891
|
-
* @param {string} userId
|
|
1696
|
+
* @param {string} params.userId - User ID.
|
|
892
1697
|
* @throws {AppwriteException}
|
|
893
|
-
* @returns {Promise<Models.
|
|
1698
|
+
* @returns {Promise<Models.MfaFactors>}
|
|
1699
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `Users.listMFAFactors` instead.
|
|
894
1700
|
*/
|
|
895
|
-
|
|
896
|
-
|
|
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
|
+
|
|
1726
|
+
if (typeof userId === 'undefined') {
|
|
1727
|
+
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1728
|
+
}
|
|
1729
|
+
|
|
1730
|
+
const apiPath = '/users/{userId}/mfa/factors'.replace('{userId}', userId);
|
|
1731
|
+
const payload: Payload = {};
|
|
1732
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1733
|
+
|
|
1734
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1735
|
+
}
|
|
1736
|
+
|
|
1737
|
+
return this.client.call(
|
|
1738
|
+
'get',
|
|
1739
|
+
uri,
|
|
1740
|
+
apiHeaders,
|
|
1741
|
+
payload
|
|
1742
|
+
);
|
|
1743
|
+
}
|
|
1744
|
+
|
|
1745
|
+
/**
|
|
1746
|
+
* List the factors available on the account to be used as a MFA challange.
|
|
1747
|
+
*
|
|
1748
|
+
* @param {string} params.userId - User ID.
|
|
1749
|
+
* @throws {AppwriteException}
|
|
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.
|
|
1760
|
+
*/
|
|
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
|
+
|
|
1777
|
+
if (typeof userId === 'undefined') {
|
|
1778
|
+
throw new AppwriteException('Missing required parameter: "userId"');
|
|
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') {
|
|
897
1985
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
898
1986
|
}
|
|
1987
|
+
|
|
899
1988
|
const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId);
|
|
900
1989
|
const payload: Payload = {};
|
|
901
1990
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -911,17 +2000,44 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
911
2000
|
payload
|
|
912
2001
|
);
|
|
913
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>;
|
|
914
2013
|
/**
|
|
915
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.
|
|
916
2015
|
*
|
|
917
|
-
* @param {string} userId
|
|
2016
|
+
* @param {string} userId - User ID.
|
|
918
2017
|
* @throws {AppwriteException}
|
|
919
2018
|
* @returns {Promise<Models.MfaRecoveryCodes>}
|
|
2019
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
920
2020
|
*/
|
|
921
|
-
createMfaRecoveryCodes(userId: string): Promise<Models.MfaRecoveryCodes
|
|
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
|
+
|
|
922
2037
|
if (typeof userId === 'undefined') {
|
|
923
2038
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
924
2039
|
}
|
|
2040
|
+
|
|
925
2041
|
const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId);
|
|
926
2042
|
const payload: Payload = {};
|
|
927
2043
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -937,21 +2053,103 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
937
2053
|
payload
|
|
938
2054
|
);
|
|
939
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
|
+
|
|
2093
|
+
const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId);
|
|
2094
|
+
const payload: Payload = {};
|
|
2095
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2096
|
+
|
|
2097
|
+
const apiHeaders: { [header: string]: string } = {
|
|
2098
|
+
'content-type': 'application/json',
|
|
2099
|
+
}
|
|
2100
|
+
|
|
2101
|
+
return this.client.call(
|
|
2102
|
+
'patch',
|
|
2103
|
+
uri,
|
|
2104
|
+
apiHeaders,
|
|
2105
|
+
payload
|
|
2106
|
+
);
|
|
2107
|
+
}
|
|
2108
|
+
|
|
2109
|
+
/**
|
|
2110
|
+
* Update the user name by its unique ID.
|
|
2111
|
+
*
|
|
2112
|
+
* @param {string} params.userId - User ID.
|
|
2113
|
+
* @param {string} params.name - User name. Max length: 128 chars.
|
|
2114
|
+
* @throws {AppwriteException}
|
|
2115
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
2116
|
+
*/
|
|
2117
|
+
updateName<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, name: string }): Promise<Models.User<Preferences>>;
|
|
940
2118
|
/**
|
|
941
2119
|
* Update the user name by its unique ID.
|
|
942
2120
|
*
|
|
943
|
-
* @param {string} userId
|
|
944
|
-
* @param {string} name
|
|
2121
|
+
* @param {string} userId - User ID.
|
|
2122
|
+
* @param {string} name - User name. Max length: 128 chars.
|
|
945
2123
|
* @throws {AppwriteException}
|
|
946
2124
|
* @returns {Promise<Models.User<Preferences>>}
|
|
2125
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
947
2126
|
*/
|
|
948
|
-
updateName<Preferences extends Models.Preferences>(userId: string, name: string): Promise<Models.User<Preferences
|
|
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
|
+
|
|
949
2146
|
if (typeof userId === 'undefined') {
|
|
950
2147
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
951
2148
|
}
|
|
952
2149
|
if (typeof name === 'undefined') {
|
|
953
2150
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
954
2151
|
}
|
|
2152
|
+
|
|
955
2153
|
const apiPath = '/users/{userId}/name'.replace('{userId}', userId);
|
|
956
2154
|
const payload: Payload = {};
|
|
957
2155
|
if (typeof name !== 'undefined') {
|
|
@@ -970,21 +2168,51 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
970
2168
|
payload
|
|
971
2169
|
);
|
|
972
2170
|
}
|
|
2171
|
+
|
|
973
2172
|
/**
|
|
974
2173
|
* Update the user password by its unique ID.
|
|
975
2174
|
*
|
|
976
|
-
* @param {string} userId
|
|
977
|
-
* @param {string} password
|
|
2175
|
+
* @param {string} params.userId - User ID.
|
|
2176
|
+
* @param {string} params.password - New user password. Must be at least 8 chars.
|
|
978
2177
|
* @throws {AppwriteException}
|
|
979
2178
|
* @returns {Promise<Models.User<Preferences>>}
|
|
980
2179
|
*/
|
|
981
|
-
updatePassword<Preferences extends Models.Preferences>(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
|
+
|
|
982
2209
|
if (typeof userId === 'undefined') {
|
|
983
2210
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
984
2211
|
}
|
|
985
2212
|
if (typeof password === 'undefined') {
|
|
986
2213
|
throw new AppwriteException('Missing required parameter: "password"');
|
|
987
2214
|
}
|
|
2215
|
+
|
|
988
2216
|
const apiPath = '/users/{userId}/password'.replace('{userId}', userId);
|
|
989
2217
|
const payload: Payload = {};
|
|
990
2218
|
if (typeof password !== 'undefined') {
|
|
@@ -1003,21 +2231,51 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
1003
2231
|
payload
|
|
1004
2232
|
);
|
|
1005
2233
|
}
|
|
2234
|
+
|
|
2235
|
+
/**
|
|
2236
|
+
* Update the user phone by its unique ID.
|
|
2237
|
+
*
|
|
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>>;
|
|
1006
2244
|
/**
|
|
1007
2245
|
* Update the user phone by its unique ID.
|
|
1008
2246
|
*
|
|
1009
|
-
* @param {string} userId
|
|
1010
|
-
* @param {string} number
|
|
2247
|
+
* @param {string} userId - User ID.
|
|
2248
|
+
* @param {string} number - User phone number.
|
|
1011
2249
|
* @throws {AppwriteException}
|
|
1012
2250
|
* @returns {Promise<Models.User<Preferences>>}
|
|
2251
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1013
2252
|
*/
|
|
1014
|
-
updatePhone<Preferences extends Models.Preferences>(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
|
+
|
|
1015
2272
|
if (typeof userId === 'undefined') {
|
|
1016
2273
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1017
2274
|
}
|
|
1018
2275
|
if (typeof number === 'undefined') {
|
|
1019
2276
|
throw new AppwriteException('Missing required parameter: "number"');
|
|
1020
2277
|
}
|
|
2278
|
+
|
|
1021
2279
|
const apiPath = '/users/{userId}/phone'.replace('{userId}', userId);
|
|
1022
2280
|
const payload: Payload = {};
|
|
1023
2281
|
if (typeof number !== 'undefined') {
|
|
@@ -1036,17 +2294,43 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
1036
2294
|
payload
|
|
1037
2295
|
);
|
|
1038
2296
|
}
|
|
2297
|
+
|
|
2298
|
+
/**
|
|
2299
|
+
* Get the user preferences by its unique ID.
|
|
2300
|
+
*
|
|
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>;
|
|
1039
2306
|
/**
|
|
1040
2307
|
* Get the user preferences by its unique ID.
|
|
1041
2308
|
*
|
|
1042
|
-
* @param {string} userId
|
|
2309
|
+
* @param {string} userId - User ID.
|
|
1043
2310
|
* @throws {AppwriteException}
|
|
1044
2311
|
* @returns {Promise<Preferences>}
|
|
2312
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1045
2313
|
*/
|
|
1046
|
-
getPrefs<Preferences extends Models.Preferences>(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
|
+
|
|
1047
2330
|
if (typeof userId === 'undefined') {
|
|
1048
2331
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1049
2332
|
}
|
|
2333
|
+
|
|
1050
2334
|
const apiPath = '/users/{userId}/prefs'.replace('{userId}', userId);
|
|
1051
2335
|
const payload: Payload = {};
|
|
1052
2336
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -1061,21 +2345,51 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
1061
2345
|
payload
|
|
1062
2346
|
);
|
|
1063
2347
|
}
|
|
2348
|
+
|
|
2349
|
+
/**
|
|
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.
|
|
2351
|
+
*
|
|
2352
|
+
* @param {string} params.userId - User ID.
|
|
2353
|
+
* @param {object} params.prefs - Prefs key-value JSON object.
|
|
2354
|
+
* @throws {AppwriteException}
|
|
2355
|
+
* @returns {Promise<Preferences>}
|
|
2356
|
+
*/
|
|
2357
|
+
updatePrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, prefs: object }): Promise<Preferences>;
|
|
1064
2358
|
/**
|
|
1065
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.
|
|
1066
2360
|
*
|
|
1067
|
-
* @param {string} userId
|
|
1068
|
-
* @param {object} prefs
|
|
2361
|
+
* @param {string} userId - User ID.
|
|
2362
|
+
* @param {object} prefs - Prefs key-value JSON object.
|
|
1069
2363
|
* @throws {AppwriteException}
|
|
1070
2364
|
* @returns {Promise<Preferences>}
|
|
2365
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1071
2366
|
*/
|
|
1072
|
-
updatePrefs<Preferences extends Models.Preferences>(userId: string, prefs: object): Promise<Preferences
|
|
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
|
+
|
|
1073
2386
|
if (typeof userId === 'undefined') {
|
|
1074
2387
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1075
2388
|
}
|
|
1076
2389
|
if (typeof prefs === 'undefined') {
|
|
1077
2390
|
throw new AppwriteException('Missing required parameter: "prefs"');
|
|
1078
2391
|
}
|
|
2392
|
+
|
|
1079
2393
|
const apiPath = '/users/{userId}/prefs'.replace('{userId}', userId);
|
|
1080
2394
|
const payload: Payload = {};
|
|
1081
2395
|
if (typeof prefs !== 'undefined') {
|
|
@@ -1094,19 +2408,53 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
1094
2408
|
payload
|
|
1095
2409
|
);
|
|
1096
2410
|
}
|
|
2411
|
+
|
|
1097
2412
|
/**
|
|
1098
2413
|
* Get the user sessions list by its unique ID.
|
|
1099
2414
|
*
|
|
1100
|
-
* @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.
|
|
1101
2417
|
* @throws {AppwriteException}
|
|
1102
2418
|
* @returns {Promise<Models.SessionList>}
|
|
1103
2419
|
*/
|
|
1104
|
-
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
|
+
|
|
1105
2449
|
if (typeof userId === 'undefined') {
|
|
1106
2450
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1107
2451
|
}
|
|
2452
|
+
|
|
1108
2453
|
const apiPath = '/users/{userId}/sessions'.replace('{userId}', userId);
|
|
1109
2454
|
const payload: Payload = {};
|
|
2455
|
+
if (typeof total !== 'undefined') {
|
|
2456
|
+
payload['total'] = total;
|
|
2457
|
+
}
|
|
1110
2458
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1111
2459
|
|
|
1112
2460
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -1119,19 +2467,47 @@ Labels can be used to grant access to resources. While teams are a way for user&
|
|
|
1119
2467
|
payload
|
|
1120
2468
|
);
|
|
1121
2469
|
}
|
|
2470
|
+
|
|
1122
2471
|
/**
|
|
1123
2472
|
* Creates a session for a user. Returns an immediately usable session object.
|
|
1124
|
-
|
|
1125
|
-
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.
|
|
2473
|
+
*
|
|
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.
|
|
1126
2475
|
*
|
|
1127
|
-
* @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.
|
|
1128
2477
|
* @throws {AppwriteException}
|
|
1129
2478
|
* @returns {Promise<Models.Session>}
|
|
1130
2479
|
*/
|
|
1131
|
-
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
|
+
|
|
1132
2507
|
if (typeof userId === 'undefined') {
|
|
1133
2508
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1134
2509
|
}
|
|
2510
|
+
|
|
1135
2511
|
const apiPath = '/users/{userId}/sessions'.replace('{userId}', userId);
|
|
1136
2512
|
const payload: Payload = {};
|
|
1137
2513
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -1147,17 +2523,43 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1147
2523
|
payload
|
|
1148
2524
|
);
|
|
1149
2525
|
}
|
|
2526
|
+
|
|
1150
2527
|
/**
|
|
1151
|
-
* Delete all user
|
|
2528
|
+
* Delete all user's sessions by using the user's unique ID.
|
|
1152
2529
|
*
|
|
1153
|
-
* @param {string} userId
|
|
2530
|
+
* @param {string} params.userId - User ID.
|
|
1154
2531
|
* @throws {AppwriteException}
|
|
1155
2532
|
* @returns {Promise<{}>}
|
|
1156
2533
|
*/
|
|
1157
|
-
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
|
+
|
|
1158
2559
|
if (typeof userId === 'undefined') {
|
|
1159
2560
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1160
2561
|
}
|
|
2562
|
+
|
|
1161
2563
|
const apiPath = '/users/{userId}/sessions'.replace('{userId}', userId);
|
|
1162
2564
|
const payload: Payload = {};
|
|
1163
2565
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -1173,21 +2575,51 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1173
2575
|
payload
|
|
1174
2576
|
);
|
|
1175
2577
|
}
|
|
2578
|
+
|
|
2579
|
+
/**
|
|
2580
|
+
* Delete a user sessions by its unique ID.
|
|
2581
|
+
*
|
|
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<{}>;
|
|
1176
2588
|
/**
|
|
1177
2589
|
* Delete a user sessions by its unique ID.
|
|
1178
2590
|
*
|
|
1179
|
-
* @param {string} userId
|
|
1180
|
-
* @param {string} sessionId
|
|
2591
|
+
* @param {string} userId - User ID.
|
|
2592
|
+
* @param {string} sessionId - Session ID.
|
|
1181
2593
|
* @throws {AppwriteException}
|
|
1182
2594
|
* @returns {Promise<{}>}
|
|
2595
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1183
2596
|
*/
|
|
1184
|
-
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
|
+
|
|
1185
2616
|
if (typeof userId === 'undefined') {
|
|
1186
2617
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1187
2618
|
}
|
|
1188
2619
|
if (typeof sessionId === 'undefined') {
|
|
1189
2620
|
throw new AppwriteException('Missing required parameter: "sessionId"');
|
|
1190
2621
|
}
|
|
2622
|
+
|
|
1191
2623
|
const apiPath = '/users/{userId}/sessions/{sessionId}'.replace('{userId}', userId).replace('{sessionId}', sessionId);
|
|
1192
2624
|
const payload: Payload = {};
|
|
1193
2625
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -1203,21 +2635,51 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1203
2635
|
payload
|
|
1204
2636
|
);
|
|
1205
2637
|
}
|
|
2638
|
+
|
|
2639
|
+
/**
|
|
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.
|
|
2641
|
+
*
|
|
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`.
|
|
2644
|
+
* @throws {AppwriteException}
|
|
2645
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
2646
|
+
*/
|
|
2647
|
+
updateStatus<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, status: boolean }): Promise<Models.User<Preferences>>;
|
|
1206
2648
|
/**
|
|
1207
|
-
* Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user
|
|
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.
|
|
1208
2650
|
*
|
|
1209
|
-
* @param {string} userId
|
|
1210
|
-
* @param {boolean} status
|
|
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`.
|
|
1211
2653
|
* @throws {AppwriteException}
|
|
1212
2654
|
* @returns {Promise<Models.User<Preferences>>}
|
|
2655
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1213
2656
|
*/
|
|
1214
|
-
updateStatus<Preferences extends Models.Preferences>(userId: string, status: boolean): Promise<Models.User<Preferences
|
|
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
|
+
|
|
1215
2676
|
if (typeof userId === 'undefined') {
|
|
1216
2677
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1217
2678
|
}
|
|
1218
2679
|
if (typeof status === 'undefined') {
|
|
1219
2680
|
throw new AppwriteException('Missing required parameter: "status"');
|
|
1220
2681
|
}
|
|
2682
|
+
|
|
1221
2683
|
const apiPath = '/users/{userId}/status'.replace('{userId}', userId);
|
|
1222
2684
|
const payload: Payload = {};
|
|
1223
2685
|
if (typeof status !== 'undefined') {
|
|
@@ -1236,23 +2698,60 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1236
2698
|
payload
|
|
1237
2699
|
);
|
|
1238
2700
|
}
|
|
2701
|
+
|
|
1239
2702
|
/**
|
|
1240
2703
|
* List the messaging targets that are associated with a user.
|
|
1241
2704
|
*
|
|
1242
|
-
* @param {string} userId
|
|
1243
|
-
* @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.
|
|
1244
2708
|
* @throws {AppwriteException}
|
|
1245
2709
|
* @returns {Promise<Models.TargetList>}
|
|
1246
2710
|
*/
|
|
1247
|
-
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
|
+
|
|
1248
2743
|
if (typeof userId === 'undefined') {
|
|
1249
2744
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1250
2745
|
}
|
|
2746
|
+
|
|
1251
2747
|
const apiPath = '/users/{userId}/targets'.replace('{userId}', userId);
|
|
1252
2748
|
const payload: Payload = {};
|
|
1253
2749
|
if (typeof queries !== 'undefined') {
|
|
1254
2750
|
payload['queries'] = queries;
|
|
1255
2751
|
}
|
|
2752
|
+
if (typeof total !== 'undefined') {
|
|
2753
|
+
payload['total'] = total;
|
|
2754
|
+
}
|
|
1256
2755
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1257
2756
|
|
|
1258
2757
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -1265,19 +2764,60 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1265
2764
|
payload
|
|
1266
2765
|
);
|
|
1267
2766
|
}
|
|
2767
|
+
|
|
1268
2768
|
/**
|
|
1269
2769
|
* Create a messaging target.
|
|
1270
2770
|
*
|
|
1271
|
-
* @param {string} userId
|
|
1272
|
-
* @param {string} targetId
|
|
1273
|
-
* @param {MessagingProviderType} providerType
|
|
1274
|
-
* @param {string} identifier
|
|
1275
|
-
* @param {string} providerId
|
|
1276
|
-
* @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.
|
|
1277
2777
|
* @throws {AppwriteException}
|
|
1278
2778
|
* @returns {Promise<Models.Target>}
|
|
1279
2779
|
*/
|
|
1280
|
-
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
|
+
|
|
1281
2821
|
if (typeof userId === 'undefined') {
|
|
1282
2822
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1283
2823
|
}
|
|
@@ -1290,6 +2830,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1290
2830
|
if (typeof identifier === 'undefined') {
|
|
1291
2831
|
throw new AppwriteException('Missing required parameter: "identifier"');
|
|
1292
2832
|
}
|
|
2833
|
+
|
|
1293
2834
|
const apiPath = '/users/{userId}/targets'.replace('{userId}', userId);
|
|
1294
2835
|
const payload: Payload = {};
|
|
1295
2836
|
if (typeof targetId !== 'undefined') {
|
|
@@ -1320,21 +2861,51 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1320
2861
|
payload
|
|
1321
2862
|
);
|
|
1322
2863
|
}
|
|
2864
|
+
|
|
1323
2865
|
/**
|
|
1324
|
-
* Get a user
|
|
2866
|
+
* Get a user's push notification target by ID.
|
|
1325
2867
|
*
|
|
1326
|
-
* @param {string} userId
|
|
1327
|
-
* @param {string} targetId
|
|
2868
|
+
* @param {string} params.userId - User ID.
|
|
2869
|
+
* @param {string} params.targetId - Target ID.
|
|
1328
2870
|
* @throws {AppwriteException}
|
|
1329
2871
|
* @returns {Promise<Models.Target>}
|
|
1330
2872
|
*/
|
|
1331
|
-
getTarget(userId: string, targetId: string): Promise<Models.Target
|
|
2873
|
+
getTarget(params: { userId: string, targetId: string }): Promise<Models.Target>;
|
|
2874
|
+
/**
|
|
2875
|
+
* Get a user's push notification target by ID.
|
|
2876
|
+
*
|
|
2877
|
+
* @param {string} userId - User ID.
|
|
2878
|
+
* @param {string} targetId - Target ID.
|
|
2879
|
+
* @throws {AppwriteException}
|
|
2880
|
+
* @returns {Promise<Models.Target>}
|
|
2881
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2882
|
+
*/
|
|
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
|
+
|
|
1332
2902
|
if (typeof userId === 'undefined') {
|
|
1333
2903
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1334
2904
|
}
|
|
1335
2905
|
if (typeof targetId === 'undefined') {
|
|
1336
2906
|
throw new AppwriteException('Missing required parameter: "targetId"');
|
|
1337
2907
|
}
|
|
2908
|
+
|
|
1338
2909
|
const apiPath = '/users/{userId}/targets/{targetId}'.replace('{userId}', userId).replace('{targetId}', targetId);
|
|
1339
2910
|
const payload: Payload = {};
|
|
1340
2911
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -1349,24 +2920,63 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1349
2920
|
payload
|
|
1350
2921
|
);
|
|
1351
2922
|
}
|
|
2923
|
+
|
|
2924
|
+
/**
|
|
2925
|
+
* Update a messaging target.
|
|
2926
|
+
*
|
|
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.
|
|
2932
|
+
* @throws {AppwriteException}
|
|
2933
|
+
* @returns {Promise<Models.Target>}
|
|
2934
|
+
*/
|
|
2935
|
+
updateTarget(params: { userId: string, targetId: string, identifier?: string, providerId?: string, name?: string }): Promise<Models.Target>;
|
|
1352
2936
|
/**
|
|
1353
2937
|
* Update a messaging target.
|
|
1354
2938
|
*
|
|
1355
|
-
* @param {string} userId
|
|
1356
|
-
* @param {string} targetId
|
|
1357
|
-
* @param {string} identifier
|
|
1358
|
-
* @param {string} providerId
|
|
1359
|
-
* @param {string} name
|
|
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.
|
|
1360
2944
|
* @throws {AppwriteException}
|
|
1361
2945
|
* @returns {Promise<Models.Target>}
|
|
2946
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1362
2947
|
*/
|
|
1363
|
-
updateTarget(userId: string, targetId: string, identifier?: string, providerId?: string, name?: string): Promise<Models.Target
|
|
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
|
+
|
|
1364
2973
|
if (typeof userId === 'undefined') {
|
|
1365
2974
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1366
2975
|
}
|
|
1367
2976
|
if (typeof targetId === 'undefined') {
|
|
1368
2977
|
throw new AppwriteException('Missing required parameter: "targetId"');
|
|
1369
2978
|
}
|
|
2979
|
+
|
|
1370
2980
|
const apiPath = '/users/{userId}/targets/{targetId}'.replace('{userId}', userId).replace('{targetId}', targetId);
|
|
1371
2981
|
const payload: Payload = {};
|
|
1372
2982
|
if (typeof identifier !== 'undefined') {
|
|
@@ -1391,21 +3001,51 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1391
3001
|
payload
|
|
1392
3002
|
);
|
|
1393
3003
|
}
|
|
3004
|
+
|
|
1394
3005
|
/**
|
|
1395
3006
|
* Delete a messaging target.
|
|
1396
3007
|
*
|
|
1397
|
-
* @param {string} userId
|
|
1398
|
-
* @param {string} targetId
|
|
3008
|
+
* @param {string} params.userId - User ID.
|
|
3009
|
+
* @param {string} params.targetId - Target ID.
|
|
1399
3010
|
* @throws {AppwriteException}
|
|
1400
3011
|
* @returns {Promise<{}>}
|
|
1401
3012
|
*/
|
|
1402
|
-
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
|
+
|
|
1403
3042
|
if (typeof userId === 'undefined') {
|
|
1404
3043
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1405
3044
|
}
|
|
1406
3045
|
if (typeof targetId === 'undefined') {
|
|
1407
3046
|
throw new AppwriteException('Missing required parameter: "targetId"');
|
|
1408
3047
|
}
|
|
3048
|
+
|
|
1409
3049
|
const apiPath = '/users/{userId}/targets/{targetId}'.replace('{userId}', userId).replace('{targetId}', targetId);
|
|
1410
3050
|
const payload: Payload = {};
|
|
1411
3051
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
@@ -1421,20 +3061,54 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1421
3061
|
payload
|
|
1422
3062
|
);
|
|
1423
3063
|
}
|
|
3064
|
+
|
|
1424
3065
|
/**
|
|
1425
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.
|
|
1426
|
-
|
|
3067
|
+
*
|
|
3068
|
+
*
|
|
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
|
+
*
|
|
1427
3079
|
*
|
|
1428
|
-
* @param {string} userId
|
|
1429
|
-
* @param {number} length
|
|
1430
|
-
* @param {number} expire
|
|
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.
|
|
1431
3083
|
* @throws {AppwriteException}
|
|
1432
3084
|
* @returns {Promise<Models.Token>}
|
|
3085
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1433
3086
|
*/
|
|
1434
|
-
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
|
+
|
|
1435
3108
|
if (typeof userId === 'undefined') {
|
|
1436
3109
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1437
3110
|
}
|
|
3111
|
+
|
|
1438
3112
|
const apiPath = '/users/{userId}/tokens'.replace('{userId}', userId);
|
|
1439
3113
|
const payload: Payload = {};
|
|
1440
3114
|
if (typeof length !== 'undefined') {
|
|
@@ -1456,21 +3130,51 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1456
3130
|
payload
|
|
1457
3131
|
);
|
|
1458
3132
|
}
|
|
3133
|
+
|
|
3134
|
+
/**
|
|
3135
|
+
* Update the user email verification status by its unique ID.
|
|
3136
|
+
*
|
|
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>>;
|
|
1459
3143
|
/**
|
|
1460
3144
|
* Update the user email verification status by its unique ID.
|
|
1461
3145
|
*
|
|
1462
|
-
* @param {string} userId
|
|
1463
|
-
* @param {boolean} emailVerification
|
|
3146
|
+
* @param {string} userId - User ID.
|
|
3147
|
+
* @param {boolean} emailVerification - User email verification status.
|
|
1464
3148
|
* @throws {AppwriteException}
|
|
1465
3149
|
* @returns {Promise<Models.User<Preferences>>}
|
|
3150
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1466
3151
|
*/
|
|
1467
|
-
updateEmailVerification<Preferences extends Models.Preferences>(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
|
+
|
|
1468
3171
|
if (typeof userId === 'undefined') {
|
|
1469
3172
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1470
3173
|
}
|
|
1471
3174
|
if (typeof emailVerification === 'undefined') {
|
|
1472
3175
|
throw new AppwriteException('Missing required parameter: "emailVerification"');
|
|
1473
3176
|
}
|
|
3177
|
+
|
|
1474
3178
|
const apiPath = '/users/{userId}/verification'.replace('{userId}', userId);
|
|
1475
3179
|
const payload: Payload = {};
|
|
1476
3180
|
if (typeof emailVerification !== 'undefined') {
|
|
@@ -1489,21 +3193,51 @@ If you want to generate a token for a custom authentication flow, use the [POST
|
|
|
1489
3193
|
payload
|
|
1490
3194
|
);
|
|
1491
3195
|
}
|
|
3196
|
+
|
|
1492
3197
|
/**
|
|
1493
3198
|
* Update the user phone verification status by its unique ID.
|
|
1494
3199
|
*
|
|
1495
|
-
* @param {string} userId
|
|
1496
|
-
* @param {boolean} phoneVerification
|
|
3200
|
+
* @param {string} params.userId - User ID.
|
|
3201
|
+
* @param {boolean} params.phoneVerification - User phone verification status.
|
|
1497
3202
|
* @throws {AppwriteException}
|
|
1498
3203
|
* @returns {Promise<Models.User<Preferences>>}
|
|
1499
3204
|
*/
|
|
1500
|
-
updatePhoneVerification<Preferences extends Models.Preferences>(userId: string, phoneVerification: boolean): Promise<Models.User<Preferences
|
|
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.
|
|
3211
|
+
* @throws {AppwriteException}
|
|
3212
|
+
* @returns {Promise<Models.User<Preferences>>}
|
|
3213
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
3214
|
+
*/
|
|
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
|
+
|
|
1501
3234
|
if (typeof userId === 'undefined') {
|
|
1502
3235
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
1503
3236
|
}
|
|
1504
3237
|
if (typeof phoneVerification === 'undefined') {
|
|
1505
3238
|
throw new AppwriteException('Missing required parameter: "phoneVerification"');
|
|
1506
3239
|
}
|
|
3240
|
+
|
|
1507
3241
|
const apiPath = '/users/{userId}/verification/phone'.replace('{userId}', userId);
|
|
1508
3242
|
const payload: Payload = {};
|
|
1509
3243
|
if (typeof phoneVerification !== 'undefined') {
|