@appwrite.io/console 0.6.1 → 0.6.4
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/autoclose.yml +11 -0
- package/.github/workflows/publish.yml +40 -16
- package/.travis.yml +2 -2
- package/README.md +2 -2
- package/dist/cjs/sdk.js +315 -29
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +314 -28
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +317 -28
- 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-o-auth2session.md +1 -1
- package/docs/examples/account/create-o-auth2token.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 +1 -1
- package/docs/examples/account/delete-push-target.md +1 -1
- package/docs/examples/account/delete-session.md +1 -1
- package/docs/examples/account/delete-sessions.md +1 -1
- package/docs/examples/account/delete.md +1 -1
- package/docs/examples/account/get-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/avatars/get-browser.md +1 -1
- package/docs/examples/avatars/get-credit-card.md +1 -1
- package/docs/examples/avatars/get-favicon.md +1 -1
- package/docs/examples/avatars/get-flag.md +1 -1
- package/docs/examples/avatars/get-image.md +1 -1
- package/docs/examples/avatars/get-initials.md +1 -1
- package/docs/examples/avatars/get-q-r.md +1 -1
- package/docs/examples/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 +1 -1
- package/docs/examples/functions/create-deployment.md +1 -1
- package/docs/examples/functions/create-execution.md +1 -1
- package/docs/examples/functions/create-variable.md +1 -1
- package/docs/examples/functions/create.md +3 -2
- package/docs/examples/functions/delete-deployment.md +1 -1
- package/docs/examples/functions/delete-variable.md +1 -1
- package/docs/examples/functions/delete.md +1 -1
- package/docs/examples/functions/download-deployment.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 +11 -0
- 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-variables.md +1 -1
- package/docs/examples/functions/list.md +1 -1
- 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 -2
- 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 +3 -2
- 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-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-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-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-download.md +1 -1
- package/docs/examples/storage/get-file-preview.md +1 -1
- package/docs/examples/storage/get-file-view.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-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.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 -5
- package/rollup.config.js +1 -5
- package/src/client.ts +230 -5
- package/src/enums/credit-card.ts +1 -1
- package/src/enums/flag.ts +1 -0
- package/src/enums/name.ts +1 -2
- package/src/enums/runtime.ts +1 -0
- package/src/id.ts +21 -2
- package/src/index.ts +7 -0
- package/src/models.ts +108 -3
- package/src/permission.ts +41 -6
- package/src/query.ts +161 -1
- package/src/service.ts +3 -0
- package/src/services/account.ts +6 -6
- package/src/services/functions.ts +33 -4
- package/src/services/messaging.ts +6 -1
- package/src/services/users.ts +4 -4
- package/types/client.d.ts +82 -1
- package/types/enums/credit-card.d.ts +1 -1
- package/types/enums/flag.d.ts +1 -0
- package/types/enums/name.d.ts +2 -3
- package/types/enums/runtime.d.ts +1 -0
- package/types/id.d.ts +15 -0
- package/types/index.d.ts +7 -0
- package/types/models.d.ts +108 -3
- package/types/permission.d.ts +36 -0
- package/types/query.d.ts +160 -0
- package/types/service.d.ts +3 -0
- package/types/services/account.d.ts +6 -6
- package/types/services/functions.d.ts +16 -4
- package/types/services/messaging.d.ts +2 -1
- package/types/services/users.d.ts +4 -4
package/src/permission.ts
CHANGED
|
@@ -1,22 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper class to generate permission strings for resources.
|
|
3
|
+
*/
|
|
1
4
|
export class Permission {
|
|
2
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Generate read permission string for the provided role.
|
|
7
|
+
*
|
|
8
|
+
* @param {string} role
|
|
9
|
+
* @returns {string}
|
|
10
|
+
*/
|
|
3
11
|
static read = (role: string): string => {
|
|
4
|
-
return `read("${role}")
|
|
12
|
+
return `read("${role}")`;
|
|
5
13
|
}
|
|
6
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Generate write permission string for the provided role.
|
|
17
|
+
*
|
|
18
|
+
* This is an alias of update, delete, and possibly create.
|
|
19
|
+
* Don't use write in combination with update, delete, or create.
|
|
20
|
+
*
|
|
21
|
+
* @param {string} role
|
|
22
|
+
* @returns {string}
|
|
23
|
+
*/
|
|
7
24
|
static write = (role: string): string => {
|
|
8
|
-
return `write("${role}")
|
|
25
|
+
return `write("${role}")`;
|
|
9
26
|
}
|
|
10
27
|
|
|
28
|
+
/**
|
|
29
|
+
* Generate create permission string for the provided role.
|
|
30
|
+
*
|
|
31
|
+
* @param {string} role
|
|
32
|
+
* @returns {string}
|
|
33
|
+
*/
|
|
11
34
|
static create = (role: string): string => {
|
|
12
|
-
return `create("${role}")
|
|
35
|
+
return `create("${role}")`;
|
|
13
36
|
}
|
|
14
37
|
|
|
38
|
+
/**
|
|
39
|
+
* Generate update permission string for the provided role.
|
|
40
|
+
*
|
|
41
|
+
* @param {string} role
|
|
42
|
+
* @returns {string}
|
|
43
|
+
*/
|
|
15
44
|
static update = (role: string): string => {
|
|
16
|
-
return `update("${role}")
|
|
45
|
+
return `update("${role}")`;
|
|
17
46
|
}
|
|
18
47
|
|
|
48
|
+
/**
|
|
49
|
+
* Generate delete permission string for the provided role.
|
|
50
|
+
*
|
|
51
|
+
* @param {string} role
|
|
52
|
+
* @returns {string}
|
|
53
|
+
*/
|
|
19
54
|
static delete = (role: string): string => {
|
|
20
|
-
return `delete("${role}")
|
|
55
|
+
return `delete("${role}")`;
|
|
21
56
|
}
|
|
22
57
|
}
|
package/src/query.ts
CHANGED
|
@@ -3,11 +3,21 @@ export type QueryTypesList = string[] | number[] | boolean[] | Query[];
|
|
|
3
3
|
export type QueryTypes = QueryTypesSingle | QueryTypesList;
|
|
4
4
|
type AttributesTypes = string | string[];
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Helper class to generate query strings.
|
|
8
|
+
*/
|
|
6
9
|
export class Query {
|
|
7
10
|
method: string;
|
|
8
11
|
attribute: AttributesTypes | undefined;
|
|
9
12
|
values: QueryTypesList | undefined;
|
|
10
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Constructor for Query class.
|
|
16
|
+
*
|
|
17
|
+
* @param {string} method
|
|
18
|
+
* @param {AttributesTypes} attribute
|
|
19
|
+
* @param {QueryTypes} values
|
|
20
|
+
*/
|
|
11
21
|
constructor(
|
|
12
22
|
method: string,
|
|
13
23
|
attribute?: AttributesTypes,
|
|
@@ -25,6 +35,11 @@ export class Query {
|
|
|
25
35
|
}
|
|
26
36
|
}
|
|
27
37
|
|
|
38
|
+
/**
|
|
39
|
+
* Convert the query object to a JSON string.
|
|
40
|
+
*
|
|
41
|
+
* @returns {string}
|
|
42
|
+
*/
|
|
28
43
|
toString(): string {
|
|
29
44
|
return JSON.stringify({
|
|
30
45
|
method: this.method,
|
|
@@ -33,69 +48,214 @@ export class Query {
|
|
|
33
48
|
});
|
|
34
49
|
}
|
|
35
50
|
|
|
51
|
+
/**
|
|
52
|
+
* Filter resources where attribute is equal to value.
|
|
53
|
+
*
|
|
54
|
+
* @param {string} attribute
|
|
55
|
+
* @param {QueryTypes} value
|
|
56
|
+
* @returns {string}
|
|
57
|
+
*/
|
|
36
58
|
static equal = (attribute: string, value: QueryTypes): string =>
|
|
37
59
|
new Query("equal", attribute, value).toString();
|
|
38
60
|
|
|
61
|
+
/**
|
|
62
|
+
* Filter resources where attribute is not equal to value.
|
|
63
|
+
*
|
|
64
|
+
* @param {string} attribute
|
|
65
|
+
* @param {QueryTypes} value
|
|
66
|
+
* @returns {string}
|
|
67
|
+
*/
|
|
39
68
|
static notEqual = (attribute: string, value: QueryTypes): string =>
|
|
40
69
|
new Query("notEqual", attribute, value).toString();
|
|
41
70
|
|
|
71
|
+
/**
|
|
72
|
+
* Filter resources where attribute is less than value.
|
|
73
|
+
*
|
|
74
|
+
* @param {string} attribute
|
|
75
|
+
* @param {QueryTypes} value
|
|
76
|
+
* @returns {string}
|
|
77
|
+
*/
|
|
42
78
|
static lessThan = (attribute: string, value: QueryTypes): string =>
|
|
43
79
|
new Query("lessThan", attribute, value).toString();
|
|
44
80
|
|
|
81
|
+
/**
|
|
82
|
+
* Filter resources where attribute is less than or equal to value.
|
|
83
|
+
*
|
|
84
|
+
* @param {string} attribute
|
|
85
|
+
* @param {QueryTypes} value
|
|
86
|
+
* @returns {string}
|
|
87
|
+
*/
|
|
45
88
|
static lessThanEqual = (attribute: string, value: QueryTypes): string =>
|
|
46
89
|
new Query("lessThanEqual", attribute, value).toString();
|
|
47
90
|
|
|
91
|
+
/**
|
|
92
|
+
* Filter resources where attribute is greater than value.
|
|
93
|
+
*
|
|
94
|
+
* @param {string} attribute
|
|
95
|
+
* @param {QueryTypes} value
|
|
96
|
+
* @returns {string}
|
|
97
|
+
*/
|
|
48
98
|
static greaterThan = (attribute: string, value: QueryTypes): string =>
|
|
49
99
|
new Query("greaterThan", attribute, value).toString();
|
|
50
100
|
|
|
101
|
+
/**
|
|
102
|
+
* Filter resources where attribute is greater than or equal to value.
|
|
103
|
+
*
|
|
104
|
+
* @param {string} attribute
|
|
105
|
+
* @param {QueryTypes} value
|
|
106
|
+
* @returns {string}
|
|
107
|
+
*/
|
|
51
108
|
static greaterThanEqual = (attribute: string, value: QueryTypes): string =>
|
|
52
109
|
new Query("greaterThanEqual", attribute, value).toString();
|
|
53
110
|
|
|
111
|
+
/**
|
|
112
|
+
* Filter resources where attribute is null.
|
|
113
|
+
*
|
|
114
|
+
* @param {string} attribute
|
|
115
|
+
* @returns {string}
|
|
116
|
+
*/
|
|
54
117
|
static isNull = (attribute: string): string =>
|
|
55
118
|
new Query("isNull", attribute).toString();
|
|
56
119
|
|
|
120
|
+
/**
|
|
121
|
+
* Filter resources where attribute is not null.
|
|
122
|
+
*
|
|
123
|
+
* @param {string} attribute
|
|
124
|
+
* @returns {string}
|
|
125
|
+
*/
|
|
57
126
|
static isNotNull = (attribute: string): string =>
|
|
58
127
|
new Query("isNotNull", attribute).toString();
|
|
59
128
|
|
|
60
|
-
|
|
129
|
+
/**
|
|
130
|
+
* Filter resources where attribute is between start and end (inclusive).
|
|
131
|
+
*
|
|
132
|
+
* @param {string} attribute
|
|
133
|
+
* @param {string | number} start
|
|
134
|
+
* @param {string | number} end
|
|
135
|
+
* @returns {string}
|
|
136
|
+
*/
|
|
137
|
+
static between = (attribute: string, start: string | number, end: string | number): string =>
|
|
61
138
|
new Query("between", attribute, [start, end] as QueryTypesList).toString();
|
|
62
139
|
|
|
140
|
+
/**
|
|
141
|
+
* Filter resources where attribute starts with value.
|
|
142
|
+
*
|
|
143
|
+
* @param {string} attribute
|
|
144
|
+
* @param {string} value
|
|
145
|
+
* @returns {string}
|
|
146
|
+
*/
|
|
63
147
|
static startsWith = (attribute: string, value: string): string =>
|
|
64
148
|
new Query("startsWith", attribute, value).toString();
|
|
65
149
|
|
|
150
|
+
/**
|
|
151
|
+
* Filter resources where attribute ends with value.
|
|
152
|
+
*
|
|
153
|
+
* @param {string} attribute
|
|
154
|
+
* @param {string} value
|
|
155
|
+
* @returns {string}
|
|
156
|
+
*/
|
|
66
157
|
static endsWith = (attribute: string, value: string): string =>
|
|
67
158
|
new Query("endsWith", attribute, value).toString();
|
|
68
159
|
|
|
160
|
+
/**
|
|
161
|
+
* Specify which attributes should be returned by the API call.
|
|
162
|
+
*
|
|
163
|
+
* @param {string[]} attributes
|
|
164
|
+
* @returns {string}
|
|
165
|
+
*/
|
|
69
166
|
static select = (attributes: string[]): string =>
|
|
70
167
|
new Query("select", undefined, attributes).toString();
|
|
71
168
|
|
|
169
|
+
/**
|
|
170
|
+
* Filter resources by searching attribute for value.
|
|
171
|
+
* A fulltext index on attribute is required for this query to work.
|
|
172
|
+
*
|
|
173
|
+
* @param {string} attribute
|
|
174
|
+
* @param {string} value
|
|
175
|
+
* @returns {string}
|
|
176
|
+
*/
|
|
72
177
|
static search = (attribute: string, value: string): string =>
|
|
73
178
|
new Query("search", attribute, value).toString();
|
|
74
179
|
|
|
180
|
+
/**
|
|
181
|
+
* Sort results by attribute descending.
|
|
182
|
+
*
|
|
183
|
+
* @param {string} attribute
|
|
184
|
+
* @returns {string}
|
|
185
|
+
*/
|
|
75
186
|
static orderDesc = (attribute: string): string =>
|
|
76
187
|
new Query("orderDesc", attribute).toString();
|
|
77
188
|
|
|
189
|
+
/**
|
|
190
|
+
* Sort results by attribute ascending.
|
|
191
|
+
*
|
|
192
|
+
* @param {string} attribute
|
|
193
|
+
* @returns {string}
|
|
194
|
+
*/
|
|
78
195
|
static orderAsc = (attribute: string): string =>
|
|
79
196
|
new Query("orderAsc", attribute).toString();
|
|
80
197
|
|
|
198
|
+
/**
|
|
199
|
+
* Return results after documentId.
|
|
200
|
+
*
|
|
201
|
+
* @param {string} documentId
|
|
202
|
+
* @returns {string}
|
|
203
|
+
*/
|
|
81
204
|
static cursorAfter = (documentId: string): string =>
|
|
82
205
|
new Query("cursorAfter", undefined, documentId).toString();
|
|
83
206
|
|
|
207
|
+
/**
|
|
208
|
+
* Return results before documentId.
|
|
209
|
+
*
|
|
210
|
+
* @param {string} documentId
|
|
211
|
+
* @returns {string}
|
|
212
|
+
*/
|
|
84
213
|
static cursorBefore = (documentId: string): string =>
|
|
85
214
|
new Query("cursorBefore", undefined, documentId).toString();
|
|
86
215
|
|
|
216
|
+
/**
|
|
217
|
+
* Return only limit results.
|
|
218
|
+
*
|
|
219
|
+
* @param {number} limit
|
|
220
|
+
* @returns {string}
|
|
221
|
+
*/
|
|
87
222
|
static limit = (limit: number): string =>
|
|
88
223
|
new Query("limit", undefined, limit).toString();
|
|
89
224
|
|
|
225
|
+
/**
|
|
226
|
+
* Filter resources by skipping the first offset results.
|
|
227
|
+
*
|
|
228
|
+
* @param {number} offset
|
|
229
|
+
* @returns {string}
|
|
230
|
+
*/
|
|
90
231
|
static offset = (offset: number): string =>
|
|
91
232
|
new Query("offset", undefined, offset).toString();
|
|
92
233
|
|
|
234
|
+
/**
|
|
235
|
+
* Filter resources where attribute contains the specified value.
|
|
236
|
+
*
|
|
237
|
+
* @param {string} attribute
|
|
238
|
+
* @param {string | string[]} value
|
|
239
|
+
* @returns {string}
|
|
240
|
+
*/
|
|
93
241
|
static contains = (attribute: string, value: string | string[]): string =>
|
|
94
242
|
new Query("contains", attribute, value).toString();
|
|
95
243
|
|
|
244
|
+
/**
|
|
245
|
+
* Combine multiple queries using logical OR operator.
|
|
246
|
+
*
|
|
247
|
+
* @param {string[]} queries
|
|
248
|
+
* @returns {string}
|
|
249
|
+
*/
|
|
96
250
|
static or = (queries: string[]) =>
|
|
97
251
|
new Query("or", undefined, queries.map((query) => JSON.parse(query))).toString();
|
|
98
252
|
|
|
253
|
+
/**
|
|
254
|
+
* Combine multiple queries using logical AND operator.
|
|
255
|
+
*
|
|
256
|
+
* @param {string[]} queries
|
|
257
|
+
* @returns {string}
|
|
258
|
+
*/
|
|
99
259
|
static and = (queries: string[]) =>
|
|
100
260
|
new Query("and", undefined, queries.map((query) => JSON.parse(query))).toString();
|
|
101
261
|
}
|
package/src/service.ts
CHANGED
package/src/services/account.ts
CHANGED
|
@@ -268,11 +268,11 @@ export class Account extends Service {
|
|
|
268
268
|
}
|
|
269
269
|
|
|
270
270
|
/**
|
|
271
|
-
*
|
|
271
|
+
* Create Authenticator
|
|
272
272
|
*
|
|
273
273
|
* Add an authenticator app to be used as an MFA factor. Verify the
|
|
274
274
|
* authenticator using the [verify
|
|
275
|
-
* authenticator](/docs/references/cloud/client-web/account#
|
|
275
|
+
* authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator)
|
|
276
276
|
* method.
|
|
277
277
|
*
|
|
278
278
|
* @param {AuthenticatorType} type
|
|
@@ -297,7 +297,7 @@ export class Account extends Service {
|
|
|
297
297
|
* Verify Authenticator
|
|
298
298
|
*
|
|
299
299
|
* Verify an authenticator app after adding it using the [add
|
|
300
|
-
* authenticator](/docs/references/cloud/client-web/account#
|
|
300
|
+
* authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator)
|
|
301
301
|
* method.
|
|
302
302
|
*
|
|
303
303
|
* @param {AuthenticatorType} type
|
|
@@ -337,7 +337,7 @@ export class Account extends Service {
|
|
|
337
337
|
* @throws {AppwriteException}
|
|
338
338
|
* @returns {Promise}
|
|
339
339
|
*/
|
|
340
|
-
async deleteMfaAuthenticator
|
|
340
|
+
async deleteMfaAuthenticator(type: AuthenticatorType, otp: string): Promise<{}> {
|
|
341
341
|
if (typeof type === 'undefined') {
|
|
342
342
|
throw new AppwriteException('Missing required parameter: "type"');
|
|
343
343
|
}
|
|
@@ -360,7 +360,7 @@ export class Account extends Service {
|
|
|
360
360
|
}
|
|
361
361
|
|
|
362
362
|
/**
|
|
363
|
-
* Create
|
|
363
|
+
* Create MFA Challenge
|
|
364
364
|
*
|
|
365
365
|
* Begin the process of MFA verification after sign-in. Finish the flow with
|
|
366
366
|
* [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge)
|
|
@@ -1543,7 +1543,7 @@ export class Account extends Service {
|
|
|
1543
1543
|
}
|
|
1544
1544
|
|
|
1545
1545
|
/**
|
|
1546
|
-
*
|
|
1546
|
+
* Update phone verification (confirmation)
|
|
1547
1547
|
*
|
|
1548
1548
|
* Use this endpoint to complete the user phone verification process. Use the
|
|
1549
1549
|
* **userId** and **secret** that were sent to your user's phone number to
|
|
@@ -70,10 +70,11 @@ export class Functions extends Service {
|
|
|
70
70
|
* @param {string} templateOwner
|
|
71
71
|
* @param {string} templateRootDirectory
|
|
72
72
|
* @param {string} templateBranch
|
|
73
|
+
* @param {string} specification
|
|
73
74
|
* @throws {AppwriteException}
|
|
74
75
|
* @returns {Promise}
|
|
75
76
|
*/
|
|
76
|
-
async create(functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, templateRepository?: string, templateOwner?: string, templateRootDirectory?: string, templateBranch?: string): Promise<Models.Function> {
|
|
77
|
+
async create(functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, templateRepository?: string, templateOwner?: string, templateRootDirectory?: string, templateBranch?: string, specification?: string): Promise<Models.Function> {
|
|
77
78
|
if (typeof functionId === 'undefined') {
|
|
78
79
|
throw new AppwriteException('Missing required parameter: "functionId"');
|
|
79
80
|
}
|
|
@@ -169,6 +170,10 @@ export class Functions extends Service {
|
|
|
169
170
|
payload['templateBranch'] = templateBranch;
|
|
170
171
|
}
|
|
171
172
|
|
|
173
|
+
if (typeof specification !== 'undefined') {
|
|
174
|
+
payload['specification'] = specification;
|
|
175
|
+
}
|
|
176
|
+
|
|
172
177
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
173
178
|
return await this.client.call('post', uri, {
|
|
174
179
|
'content-type': 'application/json',
|
|
@@ -193,6 +198,25 @@ export class Functions extends Service {
|
|
|
193
198
|
}, payload);
|
|
194
199
|
}
|
|
195
200
|
|
|
201
|
+
/**
|
|
202
|
+
* Get available function runtime specifications
|
|
203
|
+
*
|
|
204
|
+
* Get allowed function specifications for this instance.
|
|
205
|
+
*
|
|
206
|
+
*
|
|
207
|
+
* @throws {AppwriteException}
|
|
208
|
+
* @returns {Promise}
|
|
209
|
+
*/
|
|
210
|
+
async getSpecifications(): Promise<Models.SpecificationList> {
|
|
211
|
+
const apiPath = '/functions/specifications';
|
|
212
|
+
const payload: Payload = {};
|
|
213
|
+
|
|
214
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
215
|
+
return await this.client.call('get', uri, {
|
|
216
|
+
'content-type': 'application/json',
|
|
217
|
+
}, payload);
|
|
218
|
+
}
|
|
219
|
+
|
|
196
220
|
/**
|
|
197
221
|
* Get functions usage
|
|
198
222
|
*
|
|
@@ -259,10 +283,11 @@ export class Functions extends Service {
|
|
|
259
283
|
* @param {string} providerBranch
|
|
260
284
|
* @param {boolean} providerSilentMode
|
|
261
285
|
* @param {string} providerRootDirectory
|
|
286
|
+
* @param {string} specification
|
|
262
287
|
* @throws {AppwriteException}
|
|
263
288
|
* @returns {Promise}
|
|
264
289
|
*/
|
|
265
|
-
async update(functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string): Promise<Models.Function> {
|
|
290
|
+
async update(functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise<Models.Function> {
|
|
266
291
|
if (typeof functionId === 'undefined') {
|
|
267
292
|
throw new AppwriteException('Missing required parameter: "functionId"');
|
|
268
293
|
}
|
|
@@ -334,6 +359,10 @@ export class Functions extends Service {
|
|
|
334
359
|
payload['providerRootDirectory'] = providerRootDirectory;
|
|
335
360
|
}
|
|
336
361
|
|
|
362
|
+
if (typeof specification !== 'undefined') {
|
|
363
|
+
payload['specification'] = specification;
|
|
364
|
+
}
|
|
365
|
+
|
|
337
366
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
338
367
|
return await this.client.call('put', uri, {
|
|
339
368
|
'content-type': 'application/json',
|
|
@@ -527,7 +556,7 @@ export class Functions extends Service {
|
|
|
527
556
|
}
|
|
528
557
|
|
|
529
558
|
/**
|
|
530
|
-
* Update
|
|
559
|
+
* Update deployment
|
|
531
560
|
*
|
|
532
561
|
* Update the function code deployment ID using the unique function ID. Use
|
|
533
562
|
* this endpoint to switch the code deployment that should be executed by the
|
|
@@ -619,7 +648,7 @@ export class Functions extends Service {
|
|
|
619
648
|
}
|
|
620
649
|
|
|
621
650
|
/**
|
|
622
|
-
* Download
|
|
651
|
+
* Download deployment
|
|
623
652
|
*
|
|
624
653
|
* Get a Deployment's contents by its unique ID. This endpoint supports range
|
|
625
654
|
* requests for partial or streaming file download.
|
|
@@ -146,10 +146,11 @@ export class Messaging extends Service {
|
|
|
146
146
|
* @param {string[]} cc
|
|
147
147
|
* @param {string[]} bcc
|
|
148
148
|
* @param {string} scheduledAt
|
|
149
|
+
* @param {string[]} attachments
|
|
149
150
|
* @throws {AppwriteException}
|
|
150
151
|
* @returns {Promise}
|
|
151
152
|
*/
|
|
152
|
-
async updateEmail(messageId: string, topics?: string[], users?: string[], targets?: string[], subject?: string, content?: string, draft?: boolean, html?: boolean, cc?: string[], bcc?: string[], scheduledAt?: string): Promise<Models.Message> {
|
|
153
|
+
async updateEmail(messageId: string, topics?: string[], users?: string[], targets?: string[], subject?: string, content?: string, draft?: boolean, html?: boolean, cc?: string[], bcc?: string[], scheduledAt?: string, attachments?: string[]): Promise<Models.Message> {
|
|
153
154
|
if (typeof messageId === 'undefined') {
|
|
154
155
|
throw new AppwriteException('Missing required parameter: "messageId"');
|
|
155
156
|
}
|
|
@@ -197,6 +198,10 @@ export class Messaging extends Service {
|
|
|
197
198
|
payload['scheduledAt'] = scheduledAt;
|
|
198
199
|
}
|
|
199
200
|
|
|
201
|
+
if (typeof attachments !== 'undefined') {
|
|
202
|
+
payload['attachments'] = attachments;
|
|
203
|
+
}
|
|
204
|
+
|
|
200
205
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
201
206
|
return await this.client.call('patch', uri, {
|
|
202
207
|
'content-type': 'application/json',
|
package/src/services/users.ts
CHANGED
|
@@ -1422,11 +1422,11 @@ export class Users extends Service {
|
|
|
1422
1422
|
/**
|
|
1423
1423
|
* Create token
|
|
1424
1424
|
*
|
|
1425
|
-
* Returns a token with a secret key for creating a session.
|
|
1426
|
-
*
|
|
1427
|
-
*
|
|
1428
|
-
* /account/sessions/custom](https://appwrite.io/docs/references/cloud/client-web/account#updateCustomSession)
|
|
1425
|
+
* Returns a token with a secret key for creating a session. Use the user ID
|
|
1426
|
+
* and secret and submit a request to the [PUT
|
|
1427
|
+
* /account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession)
|
|
1429
1428
|
* endpoint to complete the login process.
|
|
1429
|
+
*
|
|
1430
1430
|
*
|
|
1431
1431
|
* @param {string} userId
|
|
1432
1432
|
* @param {number} length
|
package/types/client.d.ts
CHANGED
|
@@ -1,31 +1,96 @@
|
|
|
1
|
-
import 'isomorphic-form-data';
|
|
2
1
|
import { Models } from './models';
|
|
2
|
+
/**
|
|
3
|
+
* Payload type representing a key-value pair with string keys and any values.
|
|
4
|
+
*/
|
|
3
5
|
declare type Payload = {
|
|
4
6
|
[key: string]: any;
|
|
5
7
|
};
|
|
8
|
+
/**
|
|
9
|
+
* Headers type representing a key-value pair with string keys and string values.
|
|
10
|
+
*/
|
|
6
11
|
declare type Headers = {
|
|
7
12
|
[key: string]: string;
|
|
8
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* Realtime event response structure with generic payload type.
|
|
16
|
+
*/
|
|
9
17
|
export declare type RealtimeResponseEvent<T extends unknown> = {
|
|
18
|
+
/**
|
|
19
|
+
* List of event names associated with the response.
|
|
20
|
+
*/
|
|
10
21
|
events: string[];
|
|
22
|
+
/**
|
|
23
|
+
* List of channel names associated with the response.
|
|
24
|
+
*/
|
|
11
25
|
channels: string[];
|
|
26
|
+
/**
|
|
27
|
+
* Timestamp indicating the time of the event.
|
|
28
|
+
*/
|
|
12
29
|
timestamp: number;
|
|
30
|
+
/**
|
|
31
|
+
* Payload containing event-specific data.
|
|
32
|
+
*/
|
|
13
33
|
payload: T;
|
|
14
34
|
};
|
|
35
|
+
/**
|
|
36
|
+
* Type representing upload progress information.
|
|
37
|
+
*/
|
|
15
38
|
export declare type UploadProgress = {
|
|
39
|
+
/**
|
|
40
|
+
* Identifier for the upload progress.
|
|
41
|
+
*/
|
|
16
42
|
$id: string;
|
|
43
|
+
/**
|
|
44
|
+
* Current progress of the upload (in percentage).
|
|
45
|
+
*/
|
|
17
46
|
progress: number;
|
|
47
|
+
/**
|
|
48
|
+
* Total size uploaded (in bytes) during the upload process.
|
|
49
|
+
*/
|
|
18
50
|
sizeUploaded: number;
|
|
51
|
+
/**
|
|
52
|
+
* Total number of chunks that need to be uploaded.
|
|
53
|
+
*/
|
|
19
54
|
chunksTotal: number;
|
|
55
|
+
/**
|
|
56
|
+
* Number of chunks that have been successfully uploaded.
|
|
57
|
+
*/
|
|
20
58
|
chunksUploaded: number;
|
|
21
59
|
};
|
|
60
|
+
/**
|
|
61
|
+
* Exception thrown by the package
|
|
62
|
+
*/
|
|
22
63
|
declare class AppwriteException extends Error {
|
|
64
|
+
/**
|
|
65
|
+
* The error code associated with the exception.
|
|
66
|
+
*/
|
|
23
67
|
code: number;
|
|
68
|
+
/**
|
|
69
|
+
* The response string associated with the exception.
|
|
70
|
+
*/
|
|
24
71
|
response: string;
|
|
72
|
+
/**
|
|
73
|
+
* Error type.
|
|
74
|
+
* See [Error Types](https://appwrite.io/docs/response-codes#errorTypes) for more information.
|
|
75
|
+
*/
|
|
25
76
|
type: string;
|
|
77
|
+
/**
|
|
78
|
+
* Initializes a Appwrite Exception.
|
|
79
|
+
*
|
|
80
|
+
* @param {string} message - The error message.
|
|
81
|
+
* @param {number} code - The error code. Default is 0.
|
|
82
|
+
* @param {string} type - The error type. Default is an empty string.
|
|
83
|
+
* @param {string} response - The response string. Default is an empty string.
|
|
84
|
+
*/
|
|
26
85
|
constructor(message: string, code?: number, type?: string, response?: string);
|
|
27
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* Client that handles requests to Appwrite
|
|
89
|
+
*/
|
|
28
90
|
declare class Client {
|
|
91
|
+
/**
|
|
92
|
+
* Holds configuration such as project.
|
|
93
|
+
*/
|
|
29
94
|
config: {
|
|
30
95
|
endpoint: string;
|
|
31
96
|
endpointRealtime: string;
|
|
@@ -35,6 +100,9 @@ declare class Client {
|
|
|
35
100
|
locale: string;
|
|
36
101
|
mode: string;
|
|
37
102
|
};
|
|
103
|
+
/**
|
|
104
|
+
* Custom headers for API requests.
|
|
105
|
+
*/
|
|
38
106
|
headers: Headers;
|
|
39
107
|
/**
|
|
40
108
|
* Set Endpoint
|
|
@@ -127,6 +195,19 @@ declare class Client {
|
|
|
127
195
|
* @returns {() => void} Unsubscribes from events.
|
|
128
196
|
*/
|
|
129
197
|
subscribe<T extends unknown>(channels: string | string[], callback: (payload: RealtimeResponseEvent<T>) => void): () => void;
|
|
198
|
+
/**
|
|
199
|
+
* Call API endpoint with the specified method, URL, headers, and parameters.
|
|
200
|
+
*
|
|
201
|
+
* @param {string} method - HTTP method (e.g., 'GET', 'POST', 'PUT', 'DELETE').
|
|
202
|
+
* @param {URL} url - The URL of the API endpoint.
|
|
203
|
+
* @param {Headers} headers - Custom headers for the API request.
|
|
204
|
+
* @param {Payload} params - Request parameters.
|
|
205
|
+
* @returns {Promise<any>} - A promise that resolves with the response data.
|
|
206
|
+
*
|
|
207
|
+
* @typedef {Object} Payload - Request payload data.
|
|
208
|
+
* @property {string} key - The key.
|
|
209
|
+
* @property {string} value - The value.
|
|
210
|
+
*/
|
|
130
211
|
call(method: string, url: URL, headers?: Headers, params?: Payload): Promise<any>;
|
|
131
212
|
}
|
|
132
213
|
export { Client, AppwriteException };
|
package/types/enums/flag.d.ts
CHANGED
package/types/enums/name.d.ts
CHANGED
|
@@ -6,10 +6,9 @@ export declare enum Name {
|
|
|
6
6
|
V1functions = "v1-functions",
|
|
7
7
|
V1usage = "v1-usage",
|
|
8
8
|
V1usagedump = "v1-usage-dump",
|
|
9
|
-
|
|
9
|
+
V1webhooks = "v1-webhooks",
|
|
10
10
|
V1certificates = "v1-certificates",
|
|
11
11
|
V1builds = "v1-builds",
|
|
12
12
|
V1messaging = "v1-messaging",
|
|
13
|
-
V1migrations = "v1-migrations"
|
|
14
|
-
Hamsterv1 = "hamsterv1"
|
|
13
|
+
V1migrations = "v1-migrations"
|
|
15
14
|
}
|
package/types/enums/runtime.d.ts
CHANGED