@appwrite.io/console 0.6.4 → 0.7.0-rc.2
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/README.md +3 -3
- package/dist/cjs/sdk.js +2513 -2350
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +2513 -2350
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +2513 -2350
- package/docs/examples/account/create-anonymous-session.md +1 -1
- package/docs/examples/account/create-email-password-session.md +1 -1
- package/docs/examples/account/create-email-token.md +1 -1
- package/docs/examples/account/create-j-w-t.md +1 -1
- package/docs/examples/account/create-magic-u-r-l-token.md +1 -1
- package/docs/examples/account/create-mfa-authenticator.md +1 -1
- package/docs/examples/account/create-mfa-challenge.md +1 -1
- package/docs/examples/account/create-mfa-recovery-codes.md +1 -1
- package/docs/examples/account/create-phone-token.md +1 -1
- package/docs/examples/account/create-phone-verification.md +1 -1
- package/docs/examples/account/create-push-target.md +1 -1
- package/docs/examples/account/create-recovery.md +1 -1
- package/docs/examples/account/create-session.md +1 -1
- package/docs/examples/account/create-verification.md +1 -1
- package/docs/examples/account/create.md +1 -1
- package/docs/examples/account/delete-identity.md +1 -1
- package/docs/examples/account/delete-mfa-authenticator.md +2 -3
- package/docs/examples/account/delete-push-target.md +1 -1
- package/docs/examples/account/delete-session.md +1 -1
- package/docs/examples/account/delete-sessions.md +1 -1
- package/docs/examples/account/delete.md +1 -1
- package/docs/examples/account/get-mfa-recovery-codes.md +1 -1
- package/docs/examples/account/get-prefs.md +1 -1
- package/docs/examples/account/get-session.md +1 -1
- package/docs/examples/account/get.md +1 -1
- package/docs/examples/account/list-identities.md +1 -1
- package/docs/examples/account/list-logs.md +1 -1
- package/docs/examples/account/list-mfa-factors.md +1 -1
- package/docs/examples/account/list-sessions.md +1 -1
- package/docs/examples/account/update-email.md +1 -1
- package/docs/examples/account/update-m-f-a.md +1 -1
- package/docs/examples/account/update-magic-u-r-l-session.md +1 -1
- package/docs/examples/account/update-mfa-authenticator.md +1 -1
- package/docs/examples/account/update-mfa-challenge.md +1 -1
- package/docs/examples/account/update-mfa-recovery-codes.md +1 -1
- package/docs/examples/account/update-name.md +1 -1
- package/docs/examples/account/update-password.md +1 -1
- package/docs/examples/account/update-phone-session.md +1 -1
- package/docs/examples/account/update-phone-verification.md +1 -1
- package/docs/examples/account/update-phone.md +1 -1
- package/docs/examples/account/update-prefs.md +1 -1
- package/docs/examples/account/update-push-target.md +1 -1
- package/docs/examples/account/update-recovery.md +1 -1
- package/docs/examples/account/update-session.md +1 -1
- package/docs/examples/account/update-status.md +1 -1
- package/docs/examples/account/update-verification.md +1 -1
- package/docs/examples/assistant/chat.md +1 -1
- package/docs/examples/console/variables.md +1 -1
- package/docs/examples/databases/create-boolean-attribute.md +1 -1
- package/docs/examples/databases/create-collection.md +1 -1
- package/docs/examples/databases/create-datetime-attribute.md +1 -1
- package/docs/examples/databases/create-document.md +1 -1
- package/docs/examples/databases/create-email-attribute.md +1 -1
- package/docs/examples/databases/create-enum-attribute.md +1 -1
- package/docs/examples/databases/create-float-attribute.md +1 -1
- package/docs/examples/databases/create-index.md +1 -1
- package/docs/examples/databases/create-integer-attribute.md +1 -1
- package/docs/examples/databases/create-ip-attribute.md +1 -1
- package/docs/examples/databases/create-relationship-attribute.md +1 -1
- package/docs/examples/databases/create-string-attribute.md +1 -1
- package/docs/examples/databases/create-url-attribute.md +1 -1
- package/docs/examples/databases/create.md +1 -1
- package/docs/examples/databases/delete-attribute.md +1 -1
- package/docs/examples/databases/delete-collection.md +1 -1
- package/docs/examples/databases/delete-document.md +1 -1
- package/docs/examples/databases/delete-index.md +1 -1
- package/docs/examples/databases/delete.md +1 -1
- package/docs/examples/databases/get-attribute.md +1 -1
- package/docs/examples/databases/get-collection-usage.md +1 -1
- package/docs/examples/databases/get-collection.md +1 -1
- package/docs/examples/databases/get-database-usage.md +1 -1
- package/docs/examples/databases/get-document.md +1 -1
- package/docs/examples/databases/get-index.md +1 -1
- package/docs/examples/databases/get-usage.md +1 -1
- package/docs/examples/databases/get.md +1 -1
- package/docs/examples/databases/list-attributes.md +1 -1
- package/docs/examples/databases/list-collection-logs.md +1 -1
- package/docs/examples/databases/list-collections.md +1 -1
- package/docs/examples/databases/list-document-logs.md +1 -1
- package/docs/examples/databases/list-documents.md +1 -1
- package/docs/examples/databases/list-indexes.md +1 -1
- package/docs/examples/databases/list-logs.md +1 -1
- package/docs/examples/databases/list.md +1 -1
- package/docs/examples/databases/update-boolean-attribute.md +1 -1
- package/docs/examples/databases/update-collection.md +1 -1
- package/docs/examples/databases/update-datetime-attribute.md +1 -1
- package/docs/examples/databases/update-document.md +1 -1
- package/docs/examples/databases/update-email-attribute.md +1 -1
- package/docs/examples/databases/update-enum-attribute.md +1 -1
- package/docs/examples/databases/update-float-attribute.md +1 -1
- package/docs/examples/databases/update-integer-attribute.md +1 -1
- package/docs/examples/databases/update-ip-attribute.md +1 -1
- package/docs/examples/databases/update-relationship-attribute.md +1 -1
- package/docs/examples/databases/update-string-attribute.md +1 -1
- package/docs/examples/databases/update-url-attribute.md +1 -1
- package/docs/examples/databases/update.md +1 -1
- package/docs/examples/functions/create-build.md +2 -2
- package/docs/examples/functions/create-deployment.md +1 -1
- package/docs/examples/functions/create-execution.md +3 -2
- package/docs/examples/functions/create-variable.md +1 -1
- package/docs/examples/functions/create.md +3 -3
- package/docs/examples/functions/delete-deployment.md +1 -1
- package/docs/examples/functions/delete-execution.md +14 -0
- package/docs/examples/functions/delete-variable.md +1 -1
- package/docs/examples/functions/delete.md +1 -1
- package/docs/examples/functions/{download-deployment.md → get-deployment-download.md} +1 -1
- package/docs/examples/functions/get-deployment.md +1 -1
- package/docs/examples/functions/get-execution.md +1 -1
- package/docs/examples/functions/get-function-usage.md +1 -1
- package/docs/examples/functions/{get-specifications.md → get-template.md} +4 -2
- package/docs/examples/functions/get-usage.md +1 -1
- package/docs/examples/functions/get-variable.md +1 -1
- package/docs/examples/functions/get.md +1 -1
- package/docs/examples/functions/list-deployments.md +1 -1
- package/docs/examples/functions/list-executions.md +1 -1
- package/docs/examples/functions/list-runtimes.md +1 -1
- package/docs/examples/functions/list-templates.md +16 -0
- package/docs/examples/functions/list-variables.md +1 -1
- package/docs/examples/functions/list.md +1 -1
- package/docs/examples/functions/update-deployment-build.md +14 -0
- package/docs/examples/functions/update-deployment.md +1 -1
- package/docs/examples/functions/update-variable.md +1 -1
- package/docs/examples/functions/update.md +3 -3
- package/docs/examples/graphql/mutation.md +1 -1
- package/docs/examples/graphql/query.md +1 -1
- package/docs/examples/health/get-antivirus.md +1 -1
- package/docs/examples/health/get-cache.md +1 -1
- package/docs/examples/health/get-certificate.md +1 -1
- package/docs/examples/health/get-d-b.md +1 -1
- package/docs/examples/health/get-failed-jobs.md +1 -1
- package/docs/examples/health/get-pub-sub.md +1 -1
- package/docs/examples/health/get-queue-builds.md +1 -1
- package/docs/examples/health/get-queue-certificates.md +1 -1
- package/docs/examples/health/get-queue-databases.md +1 -1
- package/docs/examples/health/get-queue-deletes.md +1 -1
- package/docs/examples/health/get-queue-functions.md +1 -1
- package/docs/examples/health/get-queue-logs.md +1 -1
- package/docs/examples/health/get-queue-mails.md +1 -1
- package/docs/examples/health/get-queue-messaging.md +1 -1
- package/docs/examples/health/get-queue-migrations.md +1 -1
- package/docs/examples/health/get-queue-usage-dump.md +1 -1
- package/docs/examples/health/get-queue-usage.md +1 -1
- package/docs/examples/health/get-queue-webhooks.md +1 -1
- package/docs/examples/health/get-queue.md +1 -1
- package/docs/examples/health/get-storage-local.md +1 -1
- package/docs/examples/health/get-storage.md +1 -1
- package/docs/examples/health/get-time.md +1 -1
- package/docs/examples/health/get.md +1 -1
- package/docs/examples/locale/get.md +1 -1
- package/docs/examples/locale/list-codes.md +1 -1
- package/docs/examples/locale/list-continents.md +1 -1
- package/docs/examples/locale/list-countries-e-u.md +1 -1
- package/docs/examples/locale/list-countries-phones.md +1 -1
- package/docs/examples/locale/list-countries.md +1 -1
- package/docs/examples/locale/list-currencies.md +1 -1
- package/docs/examples/locale/list-languages.md +1 -1
- package/docs/examples/messaging/create-apns-provider.md +1 -1
- package/docs/examples/messaging/create-email.md +1 -1
- package/docs/examples/messaging/create-fcm-provider.md +1 -1
- package/docs/examples/messaging/create-mailgun-provider.md +1 -1
- package/docs/examples/messaging/create-msg91provider.md +1 -1
- package/docs/examples/messaging/create-push.md +1 -1
- package/docs/examples/messaging/create-sendgrid-provider.md +1 -1
- package/docs/examples/messaging/create-sms.md +1 -1
- package/docs/examples/messaging/create-smtp-provider.md +1 -1
- package/docs/examples/messaging/create-subscriber.md +1 -1
- package/docs/examples/messaging/create-telesign-provider.md +1 -1
- package/docs/examples/messaging/create-textmagic-provider.md +1 -1
- package/docs/examples/messaging/create-topic.md +1 -1
- package/docs/examples/messaging/create-twilio-provider.md +1 -1
- package/docs/examples/messaging/create-vonage-provider.md +1 -1
- package/docs/examples/messaging/delete-provider.md +1 -1
- package/docs/examples/messaging/delete-subscriber.md +1 -1
- package/docs/examples/messaging/delete-topic.md +1 -1
- package/docs/examples/messaging/delete.md +1 -1
- package/docs/examples/messaging/get-message.md +1 -1
- package/docs/examples/messaging/get-provider.md +1 -1
- package/docs/examples/messaging/get-subscriber.md +1 -1
- package/docs/examples/messaging/get-topic.md +1 -1
- package/docs/examples/messaging/list-message-logs.md +1 -1
- package/docs/examples/messaging/list-messages.md +1 -1
- package/docs/examples/messaging/list-provider-logs.md +1 -1
- package/docs/examples/messaging/list-providers.md +1 -1
- package/docs/examples/messaging/list-subscriber-logs.md +1 -1
- package/docs/examples/messaging/list-subscribers.md +1 -1
- package/docs/examples/messaging/list-targets.md +1 -1
- package/docs/examples/messaging/list-topic-logs.md +1 -1
- package/docs/examples/messaging/list-topics.md +1 -1
- package/docs/examples/messaging/update-apns-provider.md +1 -1
- package/docs/examples/messaging/update-email.md +1 -1
- package/docs/examples/messaging/update-fcm-provider.md +1 -1
- package/docs/examples/messaging/update-mailgun-provider.md +1 -1
- package/docs/examples/messaging/update-msg91provider.md +1 -1
- package/docs/examples/messaging/update-push.md +1 -1
- package/docs/examples/messaging/update-sendgrid-provider.md +1 -1
- package/docs/examples/messaging/update-sms.md +1 -1
- package/docs/examples/messaging/update-smtp-provider.md +1 -1
- package/docs/examples/messaging/update-telesign-provider.md +1 -1
- package/docs/examples/messaging/update-textmagic-provider.md +1 -1
- package/docs/examples/messaging/update-topic.md +1 -1
- package/docs/examples/messaging/update-twilio-provider.md +1 -1
- package/docs/examples/messaging/update-vonage-provider.md +1 -1
- package/docs/examples/migrations/create-appwrite-migration.md +1 -1
- package/docs/examples/migrations/create-firebase-migration.md +1 -1
- package/docs/examples/migrations/create-firebase-o-auth-migration.md +1 -1
- package/docs/examples/migrations/create-n-host-migration.md +1 -1
- package/docs/examples/migrations/create-supabase-migration.md +1 -1
- package/docs/examples/migrations/delete-firebase-auth.md +1 -1
- package/docs/examples/migrations/delete.md +1 -1
- package/docs/examples/migrations/get-appwrite-report.md +1 -1
- package/docs/examples/migrations/get-firebase-report-o-auth.md +1 -1
- package/docs/examples/migrations/get-firebase-report.md +1 -1
- package/docs/examples/migrations/get-n-host-report.md +1 -1
- package/docs/examples/migrations/get-supabase-report.md +1 -1
- package/docs/examples/migrations/get.md +1 -1
- package/docs/examples/migrations/list-firebase-projects.md +1 -1
- package/docs/examples/migrations/list.md +1 -1
- package/docs/examples/migrations/retry.md +1 -1
- package/docs/examples/project/create-variable.md +1 -1
- package/docs/examples/project/delete-variable.md +1 -1
- package/docs/examples/project/get-usage.md +1 -1
- package/docs/examples/project/get-variable.md +1 -1
- package/docs/examples/project/list-variables.md +1 -1
- package/docs/examples/project/update-variable.md +1 -1
- package/docs/examples/projects/create-j-w-t.md +15 -0
- package/docs/examples/projects/create-key.md +1 -1
- package/docs/examples/projects/create-platform.md +1 -1
- package/docs/examples/projects/create-smtp-test.md +1 -1
- package/docs/examples/projects/create-webhook.md +1 -1
- package/docs/examples/projects/create.md +1 -1
- package/docs/examples/projects/delete-email-template.md +1 -1
- package/docs/examples/projects/delete-key.md +1 -1
- package/docs/examples/projects/delete-platform.md +1 -1
- package/docs/examples/projects/delete-sms-template.md +1 -1
- package/docs/examples/projects/delete-webhook.md +1 -1
- package/docs/examples/projects/delete.md +1 -1
- package/docs/examples/projects/get-email-template.md +1 -1
- package/docs/examples/projects/get-key.md +1 -1
- package/docs/examples/projects/get-platform.md +1 -1
- package/docs/examples/projects/get-sms-template.md +1 -1
- package/docs/examples/projects/get-webhook.md +1 -1
- package/docs/examples/projects/get.md +1 -1
- package/docs/examples/projects/list-keys.md +1 -1
- package/docs/examples/projects/list-platforms.md +1 -1
- package/docs/examples/projects/list-webhooks.md +1 -1
- package/docs/examples/projects/list.md +1 -1
- package/docs/examples/projects/update-api-status-all.md +1 -1
- package/docs/examples/projects/update-api-status.md +1 -1
- package/docs/examples/projects/update-auth-duration.md +1 -1
- package/docs/examples/projects/update-auth-limit.md +1 -1
- package/docs/examples/projects/update-auth-password-dictionary.md +1 -1
- package/docs/examples/projects/update-auth-password-history.md +1 -1
- package/docs/examples/projects/update-auth-sessions-limit.md +1 -1
- package/docs/examples/projects/update-auth-status.md +1 -1
- package/docs/examples/projects/update-email-template.md +1 -1
- package/docs/examples/projects/update-key.md +1 -1
- package/docs/examples/projects/update-mock-numbers.md +14 -0
- package/docs/examples/projects/update-o-auth2.md +1 -1
- package/docs/examples/projects/update-personal-data-check.md +1 -1
- package/docs/examples/projects/update-platform.md +1 -1
- package/docs/examples/projects/update-service-status-all.md +1 -1
- package/docs/examples/projects/update-service-status.md +1 -1
- package/docs/examples/projects/update-session-alerts.md +14 -0
- package/docs/examples/projects/update-sms-template.md +1 -1
- package/docs/examples/projects/update-smtp.md +1 -1
- package/docs/examples/projects/update-team.md +1 -1
- package/docs/examples/projects/update-webhook-signature.md +1 -1
- package/docs/examples/projects/update-webhook.md +1 -1
- package/docs/examples/projects/update.md +1 -1
- package/docs/examples/proxy/create-rule.md +1 -1
- package/docs/examples/proxy/delete-rule.md +1 -1
- package/docs/examples/proxy/get-rule.md +1 -1
- package/docs/examples/proxy/list-rules.md +1 -1
- package/docs/examples/proxy/update-rule-verification.md +1 -1
- package/docs/examples/storage/create-bucket.md +1 -1
- package/docs/examples/storage/create-file.md +1 -1
- package/docs/examples/storage/delete-bucket.md +1 -1
- package/docs/examples/storage/delete-file.md +1 -1
- package/docs/examples/storage/get-bucket-usage.md +1 -1
- package/docs/examples/storage/get-bucket.md +1 -1
- package/docs/examples/storage/get-file.md +1 -1
- package/docs/examples/storage/get-usage.md +1 -1
- package/docs/examples/storage/list-buckets.md +1 -1
- package/docs/examples/storage/list-files.md +1 -1
- package/docs/examples/storage/update-bucket.md +1 -1
- package/docs/examples/storage/update-file.md +1 -1
- package/docs/examples/teams/create-membership.md +1 -1
- package/docs/examples/teams/create.md +1 -1
- package/docs/examples/teams/delete-membership.md +1 -1
- package/docs/examples/teams/delete.md +1 -1
- package/docs/examples/teams/get-membership.md +1 -1
- package/docs/examples/teams/get-prefs.md +1 -1
- package/docs/examples/teams/get.md +1 -1
- package/docs/examples/teams/list-logs.md +1 -1
- package/docs/examples/teams/list-memberships.md +1 -1
- package/docs/examples/teams/list.md +1 -1
- package/docs/examples/teams/update-membership-status.md +1 -1
- package/docs/examples/teams/update-membership.md +1 -1
- package/docs/examples/teams/update-name.md +1 -1
- package/docs/examples/teams/update-prefs.md +1 -1
- package/docs/examples/users/create-argon2user.md +1 -1
- package/docs/examples/users/create-bcrypt-user.md +1 -1
- package/docs/examples/users/create-j-w-t.md +15 -0
- package/docs/examples/users/create-m-d5user.md +1 -1
- package/docs/examples/users/create-mfa-recovery-codes.md +1 -1
- package/docs/examples/users/create-p-h-pass-user.md +1 -1
- package/docs/examples/users/create-s-h-a-user.md +1 -1
- package/docs/examples/users/create-scrypt-modified-user.md +1 -1
- package/docs/examples/users/create-scrypt-user.md +1 -1
- package/docs/examples/users/create-session.md +1 -1
- package/docs/examples/users/create-target.md +1 -1
- package/docs/examples/users/create-token.md +1 -1
- package/docs/examples/users/create.md +1 -1
- package/docs/examples/users/delete-identity.md +1 -1
- package/docs/examples/users/delete-mfa-authenticator.md +1 -1
- package/docs/examples/users/delete-session.md +1 -1
- package/docs/examples/users/delete-sessions.md +1 -1
- package/docs/examples/users/delete-target.md +1 -1
- package/docs/examples/users/delete.md +1 -1
- package/docs/examples/users/get-mfa-recovery-codes.md +1 -1
- package/docs/examples/users/get-prefs.md +1 -1
- package/docs/examples/users/get-target.md +1 -1
- package/docs/examples/users/get-usage.md +1 -1
- package/docs/examples/users/get.md +1 -1
- package/docs/examples/users/list-identities.md +1 -1
- package/docs/examples/users/list-logs.md +1 -1
- package/docs/examples/users/list-memberships.md +1 -1
- package/docs/examples/users/list-mfa-factors.md +1 -1
- package/docs/examples/users/list-sessions.md +1 -1
- package/docs/examples/users/list-targets.md +1 -1
- package/docs/examples/users/list.md +1 -1
- package/docs/examples/users/update-email-verification.md +1 -1
- package/docs/examples/users/update-email.md +1 -1
- package/docs/examples/users/update-labels.md +1 -1
- package/docs/examples/users/update-mfa-recovery-codes.md +1 -1
- package/docs/examples/users/update-mfa.md +1 -1
- package/docs/examples/users/update-name.md +1 -1
- package/docs/examples/users/update-password.md +1 -1
- package/docs/examples/users/update-phone-verification.md +1 -1
- package/docs/examples/users/update-phone.md +1 -1
- package/docs/examples/users/update-prefs.md +1 -1
- package/docs/examples/users/update-status.md +1 -1
- package/docs/examples/users/update-target.md +1 -1
- package/docs/examples/vcs/create-repository-detection.md +1 -1
- package/docs/examples/vcs/create-repository.md +1 -1
- package/docs/examples/vcs/delete-installation.md +1 -1
- package/docs/examples/vcs/get-installation.md +1 -1
- package/docs/examples/vcs/get-repository-contents.md +15 -0
- package/docs/examples/vcs/get-repository.md +1 -1
- package/docs/examples/vcs/list-installations.md +1 -1
- package/docs/examples/vcs/list-repositories.md +1 -1
- package/docs/examples/vcs/list-repository-branches.md +1 -1
- package/docs/examples/vcs/update-external-deployments.md +1 -1
- package/package.json +1 -1
- package/src/client.ts +124 -66
- package/src/enums/email-template-type.ts +2 -0
- package/src/enums/platform-type.ts +2 -0
- package/src/enums/runtime.ts +1 -0
- package/src/index.ts +1 -1
- package/src/models.ts +230 -28
- package/src/services/account.ts +651 -644
- package/src/services/assistant.ts +19 -16
- package/src/services/avatars.ts +111 -152
- package/src/services/console.ts +19 -14
- package/src/services/databases.ts +628 -638
- package/src/services/functions.ts +435 -339
- package/src/services/graphql.ts +31 -24
- package/src/services/health.ts +299 -199
- package/src/services/locale.ts +113 -77
- package/src/services/messaging.ts +568 -583
- package/src/services/migrations.ts +199 -197
- package/src/services/project.ts +82 -65
- package/src/services/projects.ts +615 -459
- package/src/services/proxy.ts +68 -50
- package/src/services/storage.ts +198 -253
- package/src/services/teams.ts +198 -188
- package/src/services/users.ts +568 -478
- package/src/services/vcs.ts +149 -83
- package/types/client.d.ts +13 -17
- package/types/enums/email-template-type.d.ts +3 -1
- package/types/enums/platform-type.d.ts +3 -1
- package/types/enums/runtime.d.ts +2 -1
- package/types/index.d.ts +1 -1
- package/types/models.d.ts +230 -28
- package/types/services/account.d.ts +162 -317
- package/types/services/assistant.d.ts +4 -4
- package/types/services/avatars.d.ts +50 -84
- package/types/services/console.d.ts +4 -4
- package/types/services/databases.d.ts +143 -173
- package/types/services/functions.d.ts +112 -97
- package/types/services/graphql.d.ts +6 -6
- package/types/services/health.d.ts +64 -85
- package/types/services/locale.d.ts +28 -39
- package/types/services/messaging.d.ts +103 -104
- package/types/services/migrations.d.ts +34 -34
- package/types/services/project.d.ts +17 -20
- package/types/services/projects.d.ts +118 -87
- package/types/services/proxy.d.ts +13 -14
- package/types/services/storage.d.ts +53 -78
- package/types/services/teams.d.ts +53 -83
- package/types/services/users.d.ts +120 -157
- package/types/services/vcs.d.ts +31 -20
package/src/services/locale.ts
CHANGED
|
@@ -1,169 +1,205 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AppwriteException, Client } from '../client';
|
|
1
|
+
import { AppwriteException, Client, type Payload, UploadProgress } from '../client';
|
|
3
2
|
import type { Models } from '../models';
|
|
4
|
-
import type { UploadProgress, Payload } from '../client';
|
|
5
3
|
|
|
6
|
-
export class Locale
|
|
4
|
+
export class Locale {
|
|
5
|
+
client: Client;
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
7
|
+
constructor(client: Client) {
|
|
8
|
+
this.client = client;
|
|
9
|
+
}
|
|
12
10
|
|
|
13
11
|
/**
|
|
14
12
|
* Get user locale
|
|
15
13
|
*
|
|
16
|
-
* Get the current user location based on IP. Returns an object with user
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
* supported language.
|
|
20
|
-
*
|
|
21
|
-
* ([IP Geolocation by DB-IP](https://db-ip.com))
|
|
14
|
+
* Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.
|
|
15
|
+
|
|
16
|
+
([IP Geolocation by DB-IP](https://db-ip.com))
|
|
22
17
|
*
|
|
23
18
|
* @throws {AppwriteException}
|
|
24
|
-
* @returns {Promise}
|
|
25
|
-
|
|
19
|
+
* @returns {Promise<Models.Locale>}
|
|
20
|
+
*/
|
|
26
21
|
async get(): Promise<Models.Locale> {
|
|
27
22
|
const apiPath = '/locale';
|
|
28
23
|
const payload: Payload = {};
|
|
29
|
-
|
|
30
24
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
31
|
-
|
|
25
|
+
|
|
26
|
+
const apiHeaders: { [header: string]: string } = {
|
|
32
27
|
'content-type': 'application/json',
|
|
33
|
-
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return await this.client.call(
|
|
31
|
+
'get',
|
|
32
|
+
uri,
|
|
33
|
+
apiHeaders,
|
|
34
|
+
payload
|
|
35
|
+
);
|
|
34
36
|
}
|
|
35
|
-
|
|
36
37
|
/**
|
|
37
38
|
* List Locale Codes
|
|
38
39
|
*
|
|
39
|
-
* List of all locale codes in [ISO
|
|
40
|
-
* 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
|
|
40
|
+
* List of all locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
|
|
41
41
|
*
|
|
42
42
|
* @throws {AppwriteException}
|
|
43
|
-
* @returns {Promise}
|
|
44
|
-
|
|
43
|
+
* @returns {Promise<Models.LocaleCodeList>}
|
|
44
|
+
*/
|
|
45
45
|
async listCodes(): Promise<Models.LocaleCodeList> {
|
|
46
46
|
const apiPath = '/locale/codes';
|
|
47
47
|
const payload: Payload = {};
|
|
48
|
-
|
|
49
48
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
50
|
-
|
|
49
|
+
|
|
50
|
+
const apiHeaders: { [header: string]: string } = {
|
|
51
51
|
'content-type': 'application/json',
|
|
52
|
-
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return await this.client.call(
|
|
55
|
+
'get',
|
|
56
|
+
uri,
|
|
57
|
+
apiHeaders,
|
|
58
|
+
payload
|
|
59
|
+
);
|
|
53
60
|
}
|
|
54
|
-
|
|
55
61
|
/**
|
|
56
62
|
* List continents
|
|
57
63
|
*
|
|
58
|
-
* List of all continents. You can use the locale header to get the data in a
|
|
59
|
-
* supported language.
|
|
64
|
+
* List of all continents. You can use the locale header to get the data in a supported language.
|
|
60
65
|
*
|
|
61
66
|
* @throws {AppwriteException}
|
|
62
|
-
* @returns {Promise}
|
|
63
|
-
|
|
67
|
+
* @returns {Promise<Models.ContinentList>}
|
|
68
|
+
*/
|
|
64
69
|
async listContinents(): Promise<Models.ContinentList> {
|
|
65
70
|
const apiPath = '/locale/continents';
|
|
66
71
|
const payload: Payload = {};
|
|
67
|
-
|
|
68
72
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
69
|
-
|
|
73
|
+
|
|
74
|
+
const apiHeaders: { [header: string]: string } = {
|
|
70
75
|
'content-type': 'application/json',
|
|
71
|
-
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return await this.client.call(
|
|
79
|
+
'get',
|
|
80
|
+
uri,
|
|
81
|
+
apiHeaders,
|
|
82
|
+
payload
|
|
83
|
+
);
|
|
72
84
|
}
|
|
73
|
-
|
|
74
85
|
/**
|
|
75
86
|
* List countries
|
|
76
87
|
*
|
|
77
|
-
* List of all countries. You can use the locale header to get the data in a
|
|
78
|
-
* supported language.
|
|
88
|
+
* List of all countries. You can use the locale header to get the data in a supported language.
|
|
79
89
|
*
|
|
80
90
|
* @throws {AppwriteException}
|
|
81
|
-
* @returns {Promise}
|
|
82
|
-
|
|
91
|
+
* @returns {Promise<Models.CountryList>}
|
|
92
|
+
*/
|
|
83
93
|
async listCountries(): Promise<Models.CountryList> {
|
|
84
94
|
const apiPath = '/locale/countries';
|
|
85
95
|
const payload: Payload = {};
|
|
86
|
-
|
|
87
96
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
88
|
-
|
|
97
|
+
|
|
98
|
+
const apiHeaders: { [header: string]: string } = {
|
|
89
99
|
'content-type': 'application/json',
|
|
90
|
-
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return await this.client.call(
|
|
103
|
+
'get',
|
|
104
|
+
uri,
|
|
105
|
+
apiHeaders,
|
|
106
|
+
payload
|
|
107
|
+
);
|
|
91
108
|
}
|
|
92
|
-
|
|
93
109
|
/**
|
|
94
110
|
* List EU countries
|
|
95
111
|
*
|
|
96
|
-
* List of all countries that are currently members of the EU. You can use the
|
|
97
|
-
* locale header to get the data in a supported language.
|
|
112
|
+
* List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.
|
|
98
113
|
*
|
|
99
114
|
* @throws {AppwriteException}
|
|
100
|
-
* @returns {Promise}
|
|
101
|
-
|
|
115
|
+
* @returns {Promise<Models.CountryList>}
|
|
116
|
+
*/
|
|
102
117
|
async listCountriesEU(): Promise<Models.CountryList> {
|
|
103
118
|
const apiPath = '/locale/countries/eu';
|
|
104
119
|
const payload: Payload = {};
|
|
105
|
-
|
|
106
120
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
107
|
-
|
|
121
|
+
|
|
122
|
+
const apiHeaders: { [header: string]: string } = {
|
|
108
123
|
'content-type': 'application/json',
|
|
109
|
-
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return await this.client.call(
|
|
127
|
+
'get',
|
|
128
|
+
uri,
|
|
129
|
+
apiHeaders,
|
|
130
|
+
payload
|
|
131
|
+
);
|
|
110
132
|
}
|
|
111
|
-
|
|
112
133
|
/**
|
|
113
134
|
* List countries phone codes
|
|
114
135
|
*
|
|
115
|
-
* List of all countries phone codes. You can use the locale header to get the
|
|
116
|
-
* data in a supported language.
|
|
136
|
+
* List of all countries phone codes. You can use the locale header to get the data in a supported language.
|
|
117
137
|
*
|
|
118
138
|
* @throws {AppwriteException}
|
|
119
|
-
* @returns {Promise}
|
|
120
|
-
|
|
139
|
+
* @returns {Promise<Models.PhoneList>}
|
|
140
|
+
*/
|
|
121
141
|
async listCountriesPhones(): Promise<Models.PhoneList> {
|
|
122
142
|
const apiPath = '/locale/countries/phones';
|
|
123
143
|
const payload: Payload = {};
|
|
124
|
-
|
|
125
144
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
126
|
-
|
|
145
|
+
|
|
146
|
+
const apiHeaders: { [header: string]: string } = {
|
|
127
147
|
'content-type': 'application/json',
|
|
128
|
-
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return await this.client.call(
|
|
151
|
+
'get',
|
|
152
|
+
uri,
|
|
153
|
+
apiHeaders,
|
|
154
|
+
payload
|
|
155
|
+
);
|
|
129
156
|
}
|
|
130
|
-
|
|
131
157
|
/**
|
|
132
158
|
* List currencies
|
|
133
159
|
*
|
|
134
|
-
* List of all currencies, including currency symbol, name, plural, and
|
|
135
|
-
* decimal digits for all major and minor currencies. You can use the locale
|
|
136
|
-
* header to get the data in a supported language.
|
|
160
|
+
* List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.
|
|
137
161
|
*
|
|
138
162
|
* @throws {AppwriteException}
|
|
139
|
-
* @returns {Promise}
|
|
140
|
-
|
|
163
|
+
* @returns {Promise<Models.CurrencyList>}
|
|
164
|
+
*/
|
|
141
165
|
async listCurrencies(): Promise<Models.CurrencyList> {
|
|
142
166
|
const apiPath = '/locale/currencies';
|
|
143
167
|
const payload: Payload = {};
|
|
144
|
-
|
|
145
168
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
146
|
-
|
|
169
|
+
|
|
170
|
+
const apiHeaders: { [header: string]: string } = {
|
|
147
171
|
'content-type': 'application/json',
|
|
148
|
-
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
return await this.client.call(
|
|
175
|
+
'get',
|
|
176
|
+
uri,
|
|
177
|
+
apiHeaders,
|
|
178
|
+
payload
|
|
179
|
+
);
|
|
149
180
|
}
|
|
150
|
-
|
|
151
181
|
/**
|
|
152
182
|
* List languages
|
|
153
183
|
*
|
|
154
|
-
* List of all languages classified by ISO 639-1 including 2-letter code, name
|
|
155
|
-
* in English, and name in the respective language.
|
|
184
|
+
* List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.
|
|
156
185
|
*
|
|
157
186
|
* @throws {AppwriteException}
|
|
158
|
-
* @returns {Promise}
|
|
159
|
-
|
|
187
|
+
* @returns {Promise<Models.LanguageList>}
|
|
188
|
+
*/
|
|
160
189
|
async listLanguages(): Promise<Models.LanguageList> {
|
|
161
190
|
const apiPath = '/locale/languages';
|
|
162
191
|
const payload: Payload = {};
|
|
163
|
-
|
|
164
192
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
165
|
-
|
|
193
|
+
|
|
194
|
+
const apiHeaders: { [header: string]: string } = {
|
|
166
195
|
'content-type': 'application/json',
|
|
167
|
-
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
return await this.client.call(
|
|
199
|
+
'get',
|
|
200
|
+
uri,
|
|
201
|
+
apiHeaders,
|
|
202
|
+
payload
|
|
203
|
+
);
|
|
168
204
|
}
|
|
169
|
-
}
|
|
205
|
+
}
|