@appwrite.io/console 2.2.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/README.md +1 -1
- package/dist/cjs/sdk.js +412 -202
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +412 -203
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +412 -202
- package/docs/examples/account/create-anonymous-session.md +2 -0
- package/docs/examples/account/create-billing-address.md +2 -0
- package/docs/examples/account/create-email-password-session.md +2 -0
- package/docs/examples/account/create-email-token.md +2 -0
- package/docs/examples/account/create-email-verification.md +2 -0
- package/docs/examples/account/create-jwt.md +2 -0
- package/docs/examples/account/create-key.md +2 -0
- package/docs/examples/account/create-magic-url-token.md +2 -0
- package/docs/examples/account/create-mfa-authenticator.md +2 -0
- package/docs/examples/account/create-mfa-challenge.md +2 -0
- package/docs/examples/account/create-mfa-recovery-codes.md +2 -0
- package/docs/examples/account/create-o-auth-2-session.md +2 -0
- package/docs/examples/account/create-o-auth-2-token.md +2 -0
- package/docs/examples/account/create-payment-method.md +2 -0
- package/docs/examples/account/create-phone-token.md +2 -0
- package/docs/examples/account/create-phone-verification.md +2 -0
- package/docs/examples/account/create-push-target.md +2 -0
- package/docs/examples/account/create-recovery.md +2 -0
- package/docs/examples/account/create-session.md +2 -0
- package/docs/examples/account/create-verification.md +2 -0
- package/docs/examples/account/create.md +2 -0
- package/docs/examples/account/delete-billing-address.md +2 -0
- package/docs/examples/account/delete-identity.md +2 -0
- package/docs/examples/account/delete-key.md +2 -0
- package/docs/examples/account/delete-mfa-authenticator.md +2 -0
- package/docs/examples/account/delete-payment-method.md +2 -0
- package/docs/examples/account/delete-push-target.md +2 -0
- package/docs/examples/account/delete-session.md +2 -0
- package/docs/examples/account/delete-sessions.md +2 -0
- package/docs/examples/account/delete.md +2 -0
- package/docs/examples/account/get-billing-address.md +2 -0
- package/docs/examples/account/get-coupon.md +2 -0
- package/docs/examples/account/get-key.md +2 -0
- package/docs/examples/account/get-mfa-recovery-codes.md +2 -0
- package/docs/examples/account/get-payment-method.md +2 -0
- package/docs/examples/account/get-prefs.md +2 -0
- package/docs/examples/account/get-session.md +2 -0
- package/docs/examples/account/get.md +2 -0
- package/docs/examples/account/list-billing-addresses.md +2 -0
- package/docs/examples/account/list-identities.md +2 -0
- package/docs/examples/account/list-invoices.md +2 -0
- package/docs/examples/account/list-keys.md +2 -0
- package/docs/examples/account/list-logs.md +2 -0
- package/docs/examples/account/list-mfa-factors.md +2 -0
- package/docs/examples/account/list-payment-methods.md +2 -0
- package/docs/examples/account/list-sessions.md +2 -0
- package/docs/examples/account/update-billing-address.md +2 -0
- package/docs/examples/account/update-email-verification.md +2 -0
- package/docs/examples/account/update-email.md +2 -0
- package/docs/examples/account/update-key.md +2 -0
- package/docs/examples/account/update-magic-url-session.md +2 -0
- package/docs/examples/account/update-mfa-authenticator.md +2 -0
- package/docs/examples/account/update-mfa-challenge.md +2 -0
- package/docs/examples/account/update-mfa-recovery-codes.md +2 -0
- package/docs/examples/account/update-mfa.md +2 -0
- package/docs/examples/account/update-name.md +2 -0
- package/docs/examples/account/update-password.md +2 -0
- package/docs/examples/account/update-payment-method-mandate-options.md +2 -0
- package/docs/examples/account/update-payment-method-provider.md +2 -0
- package/docs/examples/account/update-payment-method.md +2 -0
- package/docs/examples/account/update-phone-session.md +2 -0
- package/docs/examples/account/update-phone-verification.md +2 -0
- package/docs/examples/account/update-phone.md +2 -0
- package/docs/examples/account/update-prefs.md +2 -0
- package/docs/examples/account/update-push-target.md +2 -0
- package/docs/examples/account/update-recovery.md +2 -0
- package/docs/examples/account/update-session.md +2 -0
- package/docs/examples/account/update-status.md +2 -0
- package/docs/examples/account/update-verification.md +2 -0
- package/docs/examples/activities/get-event.md +15 -0
- package/docs/examples/activities/list-events.md +15 -0
- package/docs/examples/assistant/chat.md +2 -0
- package/docs/examples/avatars/get-browser.md +2 -0
- package/docs/examples/avatars/get-credit-card.md +2 -0
- package/docs/examples/avatars/get-favicon.md +2 -0
- package/docs/examples/avatars/get-flag.md +2 -0
- package/docs/examples/avatars/get-image.md +2 -0
- package/docs/examples/avatars/get-initials.md +2 -0
- package/docs/examples/avatars/get-qr.md +2 -0
- package/docs/examples/avatars/get-screenshot.md +2 -0
- package/docs/examples/backups/create-archive.md +4 -2
- package/docs/examples/backups/create-policy.md +4 -2
- package/docs/examples/backups/create-restoration.md +4 -2
- package/docs/examples/backups/delete-archive.md +2 -0
- package/docs/examples/backups/delete-policy.md +2 -0
- package/docs/examples/backups/get-archive.md +2 -0
- package/docs/examples/backups/get-policy.md +2 -0
- package/docs/examples/backups/get-restoration.md +2 -0
- package/docs/examples/backups/list-archives.md +2 -0
- package/docs/examples/backups/list-policies.md +2 -0
- package/docs/examples/backups/list-restorations.md +2 -0
- package/docs/examples/backups/update-policy.md +2 -0
- package/docs/examples/console/create-program-membership.md +2 -0
- package/docs/examples/console/create-source.md +2 -0
- package/docs/examples/console/get-campaign.md +2 -0
- package/docs/examples/console/get-coupon.md +2 -0
- package/docs/examples/console/get-plan.md +2 -0
- package/docs/examples/console/get-plans.md +2 -0
- package/docs/examples/console/get-program.md +2 -0
- package/docs/examples/console/get-resource.md +2 -0
- package/docs/examples/console/list-regions.md +2 -0
- package/docs/examples/console/suggest-columns.md +2 -0
- package/docs/examples/console/suggest-indexes.md +2 -0
- package/docs/examples/console/variables.md +2 -0
- package/docs/examples/databases/create-boolean-attribute.md +2 -0
- package/docs/examples/databases/create-collection.md +2 -0
- package/docs/examples/databases/create-datetime-attribute.md +2 -0
- package/docs/examples/databases/create-document.md +2 -0
- package/docs/examples/databases/create-documents.md +2 -0
- package/docs/examples/databases/create-email-attribute.md +2 -0
- package/docs/examples/databases/create-enum-attribute.md +2 -0
- package/docs/examples/databases/create-float-attribute.md +2 -0
- package/docs/examples/databases/create-index.md +2 -0
- package/docs/examples/databases/create-integer-attribute.md +2 -0
- package/docs/examples/databases/create-ip-attribute.md +2 -0
- package/docs/examples/databases/create-line-attribute.md +2 -0
- package/docs/examples/databases/create-longtext-attribute.md +4 -1
- package/docs/examples/databases/create-mediumtext-attribute.md +4 -1
- package/docs/examples/databases/create-operations.md +2 -0
- package/docs/examples/databases/create-point-attribute.md +2 -0
- package/docs/examples/databases/create-polygon-attribute.md +2 -0
- package/docs/examples/databases/create-relationship-attribute.md +2 -0
- package/docs/examples/databases/create-string-attribute.md +2 -0
- package/docs/examples/databases/create-text-attribute.md +4 -1
- package/docs/examples/databases/create-transaction.md +2 -0
- package/docs/examples/databases/create-url-attribute.md +2 -0
- package/docs/examples/databases/create-varchar-attribute.md +4 -1
- package/docs/examples/databases/create.md +2 -0
- package/docs/examples/databases/decrement-document-attribute.md +2 -0
- package/docs/examples/databases/delete-attribute.md +2 -0
- package/docs/examples/databases/delete-collection.md +2 -0
- package/docs/examples/databases/delete-document.md +2 -0
- package/docs/examples/databases/delete-documents.md +2 -0
- package/docs/examples/databases/delete-index.md +2 -0
- package/docs/examples/databases/delete-transaction.md +2 -0
- package/docs/examples/databases/delete.md +2 -0
- package/docs/examples/databases/get-attribute.md +2 -0
- package/docs/examples/databases/get-collection-usage.md +2 -0
- package/docs/examples/databases/get-collection.md +2 -0
- package/docs/examples/databases/get-document.md +2 -0
- package/docs/examples/databases/get-index.md +2 -0
- package/docs/examples/databases/get-transaction.md +2 -0
- package/docs/examples/databases/get-usage.md +2 -0
- package/docs/examples/databases/get.md +2 -0
- package/docs/examples/databases/increment-document-attribute.md +2 -0
- package/docs/examples/databases/list-attributes.md +2 -0
- package/docs/examples/databases/list-collection-logs.md +2 -0
- package/docs/examples/databases/list-collections.md +2 -0
- package/docs/examples/databases/list-document-logs.md +2 -0
- package/docs/examples/databases/list-documents.md +2 -0
- package/docs/examples/databases/list-indexes.md +2 -0
- package/docs/examples/databases/list-logs.md +2 -0
- package/docs/examples/databases/list-transactions.md +2 -0
- package/docs/examples/databases/list-usage.md +2 -0
- package/docs/examples/databases/list.md +2 -0
- package/docs/examples/databases/update-boolean-attribute.md +2 -0
- package/docs/examples/databases/update-collection.md +2 -0
- package/docs/examples/databases/update-datetime-attribute.md +2 -0
- package/docs/examples/databases/update-document.md +2 -0
- package/docs/examples/databases/update-documents.md +2 -0
- package/docs/examples/databases/update-email-attribute.md +2 -0
- package/docs/examples/databases/update-enum-attribute.md +2 -0
- package/docs/examples/databases/update-float-attribute.md +2 -0
- package/docs/examples/databases/update-integer-attribute.md +2 -0
- package/docs/examples/databases/update-ip-attribute.md +2 -0
- package/docs/examples/databases/update-line-attribute.md +2 -0
- package/docs/examples/databases/update-longtext-attribute.md +2 -0
- package/docs/examples/databases/update-mediumtext-attribute.md +2 -0
- package/docs/examples/databases/update-point-attribute.md +2 -0
- package/docs/examples/databases/update-polygon-attribute.md +2 -0
- package/docs/examples/databases/update-relationship-attribute.md +2 -0
- package/docs/examples/databases/update-string-attribute.md +2 -0
- package/docs/examples/databases/update-text-attribute.md +2 -0
- package/docs/examples/databases/update-transaction.md +2 -0
- package/docs/examples/databases/update-url-attribute.md +2 -0
- package/docs/examples/databases/update-varchar-attribute.md +2 -0
- package/docs/examples/databases/update.md +2 -0
- package/docs/examples/databases/upsert-document.md +2 -0
- package/docs/examples/databases/upsert-documents.md +2 -0
- package/docs/examples/domains/create-preset-google-workspace.md +2 -0
- package/docs/examples/domains/create-preset-i-cloud.md +2 -0
- package/docs/examples/domains/create-preset-mailgun.md +2 -0
- package/docs/examples/domains/create-preset-outlook.md +2 -0
- package/docs/examples/domains/create-preset-proton-mail.md +2 -0
- package/docs/examples/domains/create-preset-zoho.md +2 -0
- package/docs/examples/domains/create-record-a.md +2 -0
- package/docs/examples/domains/create-record-aaaa.md +2 -0
- package/docs/examples/domains/create-record-alias.md +2 -0
- package/docs/examples/domains/create-record-caa.md +2 -0
- package/docs/examples/domains/create-record-cname.md +2 -0
- package/docs/examples/domains/create-record-https.md +2 -0
- package/docs/examples/domains/create-record-mx.md +2 -0
- package/docs/examples/domains/create-record-ns.md +2 -0
- package/docs/examples/domains/create-record-srv.md +2 -0
- package/docs/examples/domains/create-record-txt.md +2 -0
- package/docs/examples/domains/create.md +2 -0
- package/docs/examples/domains/delete-record.md +2 -0
- package/docs/examples/domains/delete.md +2 -0
- package/docs/examples/domains/get-preset-google-workspace.md +2 -0
- package/docs/examples/domains/get-preset-i-cloud.md +2 -0
- package/docs/examples/domains/get-preset-mailgun.md +2 -0
- package/docs/examples/domains/get-preset-outlook.md +2 -0
- package/docs/examples/domains/get-preset-proton-mail.md +2 -0
- package/docs/examples/domains/get-preset-zoho.md +2 -0
- package/docs/examples/domains/get-price.md +17 -0
- package/docs/examples/domains/get-record.md +2 -0
- package/docs/examples/domains/get-zone.md +2 -0
- package/docs/examples/domains/get.md +2 -0
- package/docs/examples/domains/list-records.md +2 -0
- package/docs/examples/domains/list-suggestions.md +2 -0
- package/docs/examples/domains/list.md +2 -0
- package/docs/examples/domains/update-nameservers.md +2 -0
- package/docs/examples/domains/update-record-a.md +2 -0
- package/docs/examples/domains/update-record-aaaa.md +2 -0
- package/docs/examples/domains/update-record-alias.md +2 -0
- package/docs/examples/domains/update-record-caa.md +2 -0
- package/docs/examples/domains/update-record-cname.md +2 -0
- package/docs/examples/domains/update-record-https.md +2 -0
- package/docs/examples/domains/update-record-mx.md +2 -0
- package/docs/examples/domains/update-record-ns.md +2 -0
- package/docs/examples/domains/update-record-srv.md +2 -0
- package/docs/examples/domains/update-record-txt.md +2 -0
- package/docs/examples/domains/update-team.md +2 -0
- package/docs/examples/domains/update-zone.md +2 -0
- package/docs/examples/functions/create-deployment.md +2 -0
- package/docs/examples/functions/create-duplicate-deployment.md +2 -0
- package/docs/examples/functions/create-execution.md +2 -0
- package/docs/examples/functions/create-template-deployment.md +2 -0
- package/docs/examples/functions/create-variable.md +2 -0
- package/docs/examples/functions/create-vcs-deployment.md +2 -0
- package/docs/examples/functions/create.md +2 -0
- package/docs/examples/functions/delete-deployment.md +2 -0
- package/docs/examples/functions/delete-execution.md +2 -0
- package/docs/examples/functions/delete-variable.md +2 -0
- package/docs/examples/functions/delete.md +2 -0
- package/docs/examples/functions/get-deployment-download.md +2 -0
- package/docs/examples/functions/get-deployment.md +2 -0
- package/docs/examples/functions/get-execution.md +2 -0
- package/docs/examples/functions/get-template.md +2 -0
- package/docs/examples/functions/get-usage.md +2 -0
- package/docs/examples/functions/get-variable.md +2 -0
- package/docs/examples/functions/get.md +2 -0
- package/docs/examples/functions/list-deployments.md +2 -0
- package/docs/examples/functions/list-executions.md +2 -0
- package/docs/examples/functions/list-runtimes.md +2 -0
- package/docs/examples/functions/list-specifications.md +2 -0
- package/docs/examples/functions/list-templates.md +2 -0
- package/docs/examples/functions/list-usage.md +2 -0
- package/docs/examples/functions/list-variables.md +2 -0
- package/docs/examples/functions/list.md +2 -0
- package/docs/examples/functions/update-deployment-status.md +2 -0
- package/docs/examples/functions/update-function-deployment.md +2 -0
- package/docs/examples/functions/update-variable.md +2 -0
- package/docs/examples/functions/update.md +2 -0
- package/docs/examples/graphql/mutation.md +2 -0
- package/docs/examples/graphql/query.md +2 -0
- package/docs/examples/health/get-antivirus.md +2 -0
- package/docs/examples/health/get-cache.md +2 -0
- package/docs/examples/health/get-certificate.md +2 -0
- package/docs/examples/health/get-db.md +2 -0
- package/docs/examples/health/get-failed-jobs.md +2 -0
- package/docs/examples/health/get-pub-sub.md +2 -0
- package/docs/examples/health/get-queue-audits.md +2 -0
- package/docs/examples/health/get-queue-billing-project-aggregation.md +2 -0
- package/docs/examples/health/get-queue-billing-team-aggregation.md +2 -0
- package/docs/examples/health/get-queue-builds.md +2 -0
- package/docs/examples/health/get-queue-certificates.md +2 -0
- package/docs/examples/health/get-queue-databases.md +2 -0
- package/docs/examples/health/get-queue-deletes.md +2 -0
- package/docs/examples/health/get-queue-functions.md +2 -0
- package/docs/examples/health/get-queue-logs.md +2 -0
- package/docs/examples/health/get-queue-mails.md +2 -0
- package/docs/examples/health/get-queue-messaging.md +2 -0
- package/docs/examples/health/get-queue-migrations.md +2 -0
- package/docs/examples/health/get-queue-priority-builds.md +2 -0
- package/docs/examples/health/get-queue-region-manager.md +2 -0
- package/docs/examples/health/get-queue-stats-resources.md +2 -0
- package/docs/examples/health/get-queue-threats.md +2 -0
- package/docs/examples/health/get-queue-usage.md +2 -0
- package/docs/examples/health/get-queue-webhooks.md +2 -0
- package/docs/examples/health/get-storage-local.md +2 -0
- package/docs/examples/health/get-storage.md +2 -0
- package/docs/examples/health/get-time.md +2 -0
- package/docs/examples/health/get.md +2 -0
- package/docs/examples/locale/get.md +2 -0
- package/docs/examples/locale/list-codes.md +2 -0
- package/docs/examples/locale/list-continents.md +2 -0
- package/docs/examples/locale/list-countries-eu.md +2 -0
- package/docs/examples/locale/list-countries-phones.md +2 -0
- package/docs/examples/locale/list-countries.md +2 -0
- package/docs/examples/locale/list-currencies.md +2 -0
- package/docs/examples/locale/list-languages.md +2 -0
- package/docs/examples/messaging/create-apns-provider.md +2 -0
- package/docs/examples/messaging/create-email.md +2 -0
- package/docs/examples/messaging/create-fcm-provider.md +2 -0
- package/docs/examples/messaging/create-mailgun-provider.md +2 -0
- package/docs/examples/messaging/create-msg-91-provider.md +2 -0
- package/docs/examples/messaging/create-push.md +2 -0
- package/docs/examples/messaging/create-resend-provider.md +2 -0
- package/docs/examples/messaging/create-sendgrid-provider.md +2 -0
- package/docs/examples/messaging/create-sms.md +2 -0
- package/docs/examples/messaging/create-smtp-provider.md +2 -0
- package/docs/examples/messaging/create-subscriber.md +2 -0
- package/docs/examples/messaging/create-telesign-provider.md +2 -0
- package/docs/examples/messaging/create-textmagic-provider.md +2 -0
- package/docs/examples/messaging/create-topic.md +2 -0
- package/docs/examples/messaging/create-twilio-provider.md +2 -0
- package/docs/examples/messaging/create-vonage-provider.md +2 -0
- package/docs/examples/messaging/delete-provider.md +2 -0
- package/docs/examples/messaging/delete-subscriber.md +2 -0
- package/docs/examples/messaging/delete-topic.md +2 -0
- package/docs/examples/messaging/delete.md +2 -0
- package/docs/examples/messaging/get-message.md +2 -0
- package/docs/examples/messaging/get-provider.md +2 -0
- package/docs/examples/messaging/get-subscriber.md +2 -0
- package/docs/examples/messaging/get-topic.md +2 -0
- package/docs/examples/messaging/list-message-logs.md +2 -0
- package/docs/examples/messaging/list-messages.md +2 -0
- package/docs/examples/messaging/list-provider-logs.md +2 -0
- package/docs/examples/messaging/list-providers.md +2 -0
- package/docs/examples/messaging/list-subscriber-logs.md +2 -0
- package/docs/examples/messaging/list-subscribers.md +2 -0
- package/docs/examples/messaging/list-targets.md +2 -0
- package/docs/examples/messaging/list-topic-logs.md +2 -0
- package/docs/examples/messaging/list-topics.md +2 -0
- package/docs/examples/messaging/update-apns-provider.md +2 -0
- package/docs/examples/messaging/update-email.md +2 -0
- package/docs/examples/messaging/update-fcm-provider.md +2 -0
- package/docs/examples/messaging/update-mailgun-provider.md +2 -0
- package/docs/examples/messaging/update-msg-91-provider.md +2 -0
- package/docs/examples/messaging/update-push.md +2 -0
- package/docs/examples/messaging/update-resend-provider.md +2 -0
- package/docs/examples/messaging/update-sendgrid-provider.md +2 -0
- package/docs/examples/messaging/update-sms.md +2 -0
- package/docs/examples/messaging/update-smtp-provider.md +2 -0
- package/docs/examples/messaging/update-telesign-provider.md +2 -0
- package/docs/examples/messaging/update-textmagic-provider.md +2 -0
- package/docs/examples/messaging/update-topic.md +2 -0
- package/docs/examples/messaging/update-twilio-provider.md +2 -0
- package/docs/examples/messaging/update-vonage-provider.md +2 -0
- package/docs/examples/migrations/create-appwrite-migration.md +2 -0
- package/docs/examples/migrations/create-csv-export.md +2 -0
- package/docs/examples/migrations/create-csv-import.md +2 -0
- package/docs/examples/migrations/create-firebase-migration.md +2 -0
- package/docs/examples/migrations/create-n-host-migration.md +2 -0
- package/docs/examples/migrations/create-supabase-migration.md +2 -0
- package/docs/examples/migrations/delete.md +2 -0
- package/docs/examples/migrations/get-appwrite-report.md +2 -0
- package/docs/examples/migrations/get-firebase-report.md +2 -0
- package/docs/examples/migrations/get-n-host-report.md +2 -0
- package/docs/examples/migrations/get-supabase-report.md +2 -0
- package/docs/examples/migrations/get.md +2 -0
- package/docs/examples/migrations/list.md +2 -0
- package/docs/examples/migrations/retry.md +2 -0
- package/docs/examples/organizations/add-credit.md +2 -0
- package/docs/examples/organizations/cancel-downgrade.md +2 -0
- package/docs/examples/organizations/create-downgrade-feedback.md +2 -0
- package/docs/examples/organizations/create-invoice-payment.md +2 -0
- package/docs/examples/organizations/create-key.md +2 -0
- package/docs/examples/organizations/create.md +2 -0
- package/docs/examples/organizations/delete-backup-payment-method.md +2 -0
- package/docs/examples/organizations/delete-billing-address.md +2 -0
- package/docs/examples/organizations/delete-default-payment-method.md +2 -0
- package/docs/examples/organizations/delete-key.md +2 -0
- package/docs/examples/organizations/delete.md +2 -0
- package/docs/examples/organizations/estimation-create-organization.md +2 -0
- package/docs/examples/organizations/estimation-delete-organization.md +2 -0
- package/docs/examples/organizations/estimation-update-plan.md +2 -0
- package/docs/examples/organizations/get-aggregation.md +2 -0
- package/docs/examples/organizations/get-available-credits.md +2 -0
- package/docs/examples/organizations/get-billing-address.md +2 -0
- package/docs/examples/organizations/get-credit.md +2 -0
- package/docs/examples/organizations/get-invoice-download.md +2 -0
- package/docs/examples/organizations/get-invoice-view.md +2 -0
- package/docs/examples/organizations/get-invoice.md +2 -0
- package/docs/examples/organizations/get-key.md +2 -0
- package/docs/examples/organizations/get-payment-method.md +2 -0
- package/docs/examples/organizations/get-plan.md +2 -0
- package/docs/examples/organizations/get-scopes.md +2 -0
- package/docs/examples/organizations/get-usage.md +2 -0
- package/docs/examples/organizations/list-aggregations.md +2 -0
- package/docs/examples/organizations/list-credits.md +2 -0
- package/docs/examples/organizations/list-invoices.md +2 -0
- package/docs/examples/organizations/list-keys.md +2 -0
- package/docs/examples/organizations/list-regions.md +2 -0
- package/docs/examples/organizations/list.md +2 -0
- package/docs/examples/organizations/set-backup-payment-method.md +2 -0
- package/docs/examples/organizations/set-billing-address.md +2 -0
- package/docs/examples/organizations/set-billing-email.md +2 -0
- package/docs/examples/organizations/set-billing-tax-id.md +2 -0
- package/docs/examples/organizations/set-default-payment-method.md +2 -0
- package/docs/examples/organizations/update-budget.md +2 -0
- package/docs/examples/organizations/update-key.md +2 -0
- package/docs/examples/organizations/update-plan.md +2 -0
- package/docs/examples/organizations/validate-invoice.md +2 -0
- package/docs/examples/organizations/validate-payment.md +2 -0
- package/docs/examples/project/create-variable.md +2 -0
- package/docs/examples/project/delete-variable.md +2 -0
- package/docs/examples/project/get-usage.md +2 -0
- package/docs/examples/project/get-variable.md +2 -0
- package/docs/examples/project/list-variables.md +2 -0
- package/docs/examples/project/update-variable.md +2 -0
- package/docs/examples/projects/create-dev-key.md +2 -0
- package/docs/examples/projects/create-jwt.md +2 -0
- package/docs/examples/projects/create-key.md +3 -0
- package/docs/examples/projects/create-platform.md +2 -0
- package/docs/examples/projects/create-smtp-test.md +2 -0
- package/docs/examples/projects/create-webhook.md +2 -0
- package/docs/examples/projects/create.md +2 -0
- package/docs/examples/projects/delete-dev-key.md +2 -0
- package/docs/examples/projects/delete-email-template.md +2 -0
- package/docs/examples/projects/delete-key.md +2 -0
- package/docs/examples/projects/delete-platform.md +2 -0
- package/docs/examples/projects/delete-sms-template.md +2 -0
- package/docs/examples/projects/delete-webhook.md +2 -0
- package/docs/examples/projects/delete.md +2 -0
- package/docs/examples/projects/get-dev-key.md +2 -0
- package/docs/examples/projects/get-email-template.md +2 -0
- package/docs/examples/projects/get-key.md +2 -0
- package/docs/examples/projects/get-platform.md +2 -0
- package/docs/examples/projects/get-sms-template.md +2 -0
- package/docs/examples/projects/get-webhook.md +2 -0
- package/docs/examples/projects/get.md +2 -0
- package/docs/examples/projects/list-dev-keys.md +2 -0
- package/docs/examples/projects/list-keys.md +3 -0
- package/docs/examples/projects/list-platforms.md +2 -0
- package/docs/examples/projects/list-webhooks.md +2 -0
- package/docs/examples/projects/list.md +2 -0
- package/docs/examples/projects/update-api-status-all.md +2 -0
- package/docs/examples/projects/update-api-status.md +2 -0
- package/docs/examples/projects/update-auth-duration.md +2 -0
- package/docs/examples/projects/update-auth-limit.md +2 -0
- package/docs/examples/projects/update-auth-password-dictionary.md +2 -0
- package/docs/examples/projects/update-auth-password-history.md +2 -0
- package/docs/examples/projects/update-auth-sessions-limit.md +2 -0
- package/docs/examples/projects/update-auth-status.md +2 -0
- package/docs/examples/projects/update-dev-key.md +2 -0
- package/docs/examples/projects/update-email-template.md +2 -0
- package/docs/examples/projects/update-key.md +2 -0
- package/docs/examples/projects/update-labels.md +2 -0
- package/docs/examples/projects/update-memberships-privacy.md +2 -0
- package/docs/examples/projects/update-mock-numbers.md +2 -0
- package/docs/examples/projects/update-o-auth-2.md +2 -0
- package/docs/examples/projects/update-personal-data-check.md +2 -0
- package/docs/examples/projects/update-platform.md +2 -0
- package/docs/examples/projects/update-service-status-all.md +2 -0
- package/docs/examples/projects/update-service-status.md +2 -0
- package/docs/examples/projects/update-session-alerts.md +2 -0
- package/docs/examples/projects/update-session-invalidation.md +2 -0
- package/docs/examples/projects/update-sms-template.md +2 -0
- package/docs/examples/projects/update-smtp.md +2 -0
- package/docs/examples/projects/update-team.md +2 -0
- package/docs/examples/projects/update-webhook-signature.md +2 -0
- package/docs/examples/projects/update-webhook.md +2 -0
- package/docs/examples/projects/update.md +2 -0
- package/docs/examples/proxy/create-api-rule.md +2 -0
- package/docs/examples/proxy/create-function-rule.md +2 -0
- package/docs/examples/proxy/create-redirect-rule.md +2 -0
- package/docs/examples/proxy/create-site-rule.md +2 -0
- package/docs/examples/proxy/delete-rule.md +2 -0
- package/docs/examples/proxy/get-rule.md +2 -0
- package/docs/examples/proxy/list-rules.md +2 -0
- package/docs/examples/proxy/update-rule-verification.md +2 -0
- package/docs/examples/sites/create-deployment.md +2 -0
- package/docs/examples/sites/create-duplicate-deployment.md +2 -0
- package/docs/examples/sites/create-template-deployment.md +2 -0
- package/docs/examples/sites/create-variable.md +2 -0
- package/docs/examples/sites/create-vcs-deployment.md +2 -0
- package/docs/examples/sites/create.md +2 -0
- package/docs/examples/sites/delete-deployment.md +2 -0
- package/docs/examples/sites/delete-log.md +2 -0
- package/docs/examples/sites/delete-variable.md +2 -0
- package/docs/examples/sites/delete.md +2 -0
- package/docs/examples/sites/get-deployment-download.md +2 -0
- package/docs/examples/sites/get-deployment.md +2 -0
- package/docs/examples/sites/get-log.md +2 -0
- package/docs/examples/sites/get-template.md +2 -0
- package/docs/examples/sites/get-usage.md +2 -0
- package/docs/examples/sites/get-variable.md +2 -0
- package/docs/examples/sites/get.md +2 -0
- package/docs/examples/sites/list-deployments.md +2 -0
- package/docs/examples/sites/list-frameworks.md +2 -0
- package/docs/examples/sites/list-logs.md +2 -0
- package/docs/examples/sites/list-specifications.md +2 -0
- package/docs/examples/sites/list-templates.md +2 -0
- package/docs/examples/sites/list-usage.md +2 -0
- package/docs/examples/sites/list-variables.md +2 -0
- package/docs/examples/sites/list.md +2 -0
- package/docs/examples/sites/update-deployment-status.md +2 -0
- package/docs/examples/sites/update-site-deployment.md +2 -0
- package/docs/examples/sites/update-variable.md +2 -0
- package/docs/examples/sites/update.md +2 -0
- package/docs/examples/storage/create-bucket.md +2 -0
- package/docs/examples/storage/create-file.md +2 -0
- package/docs/examples/storage/delete-bucket.md +2 -0
- package/docs/examples/storage/delete-file.md +2 -0
- package/docs/examples/storage/get-bucket-usage.md +2 -0
- package/docs/examples/storage/get-bucket.md +2 -0
- package/docs/examples/storage/get-file-download.md +2 -0
- package/docs/examples/storage/get-file-preview.md +2 -0
- package/docs/examples/storage/get-file-view.md +2 -0
- package/docs/examples/storage/get-file.md +2 -0
- package/docs/examples/storage/get-usage.md +2 -0
- package/docs/examples/storage/list-buckets.md +2 -0
- package/docs/examples/storage/list-files.md +2 -0
- package/docs/examples/storage/update-bucket.md +2 -0
- package/docs/examples/storage/update-file.md +2 -0
- package/docs/examples/tablesdb/create-boolean-column.md +2 -0
- package/docs/examples/tablesdb/create-datetime-column.md +2 -0
- package/docs/examples/tablesdb/create-email-column.md +2 -0
- package/docs/examples/tablesdb/create-enum-column.md +2 -0
- package/docs/examples/tablesdb/create-float-column.md +2 -0
- package/docs/examples/tablesdb/create-index.md +2 -0
- package/docs/examples/tablesdb/create-integer-column.md +2 -0
- package/docs/examples/tablesdb/create-ip-column.md +2 -0
- package/docs/examples/tablesdb/create-line-column.md +2 -0
- package/docs/examples/tablesdb/create-longtext-column.md +4 -1
- package/docs/examples/tablesdb/create-mediumtext-column.md +4 -1
- package/docs/examples/tablesdb/create-operations.md +2 -0
- package/docs/examples/tablesdb/create-point-column.md +2 -0
- package/docs/examples/tablesdb/create-polygon-column.md +2 -0
- package/docs/examples/tablesdb/create-relationship-column.md +2 -0
- package/docs/examples/tablesdb/create-row.md +2 -0
- package/docs/examples/tablesdb/create-rows.md +2 -0
- package/docs/examples/tablesdb/create-string-column.md +2 -0
- package/docs/examples/tablesdb/create-table.md +2 -0
- package/docs/examples/tablesdb/create-text-column.md +4 -1
- package/docs/examples/tablesdb/create-transaction.md +2 -0
- package/docs/examples/tablesdb/create-url-column.md +2 -0
- package/docs/examples/tablesdb/create-varchar-column.md +4 -1
- package/docs/examples/tablesdb/create.md +2 -0
- package/docs/examples/tablesdb/decrement-row-column.md +2 -0
- package/docs/examples/tablesdb/delete-column.md +2 -0
- package/docs/examples/tablesdb/delete-index.md +2 -0
- package/docs/examples/tablesdb/delete-row.md +2 -0
- package/docs/examples/tablesdb/delete-rows.md +2 -0
- package/docs/examples/tablesdb/delete-table.md +2 -0
- package/docs/examples/tablesdb/delete-transaction.md +2 -0
- package/docs/examples/tablesdb/delete.md +2 -0
- package/docs/examples/tablesdb/get-column.md +2 -0
- package/docs/examples/tablesdb/get-index.md +2 -0
- package/docs/examples/tablesdb/get-row.md +2 -0
- package/docs/examples/tablesdb/get-table-usage.md +2 -0
- package/docs/examples/tablesdb/get-table.md +2 -0
- package/docs/examples/tablesdb/get-transaction.md +2 -0
- package/docs/examples/tablesdb/get-usage.md +2 -0
- package/docs/examples/tablesdb/get.md +2 -0
- package/docs/examples/tablesdb/increment-row-column.md +2 -0
- package/docs/examples/tablesdb/list-columns.md +2 -0
- package/docs/examples/tablesdb/list-indexes.md +2 -0
- package/docs/examples/tablesdb/list-row-logs.md +2 -0
- package/docs/examples/tablesdb/list-rows.md +2 -0
- package/docs/examples/tablesdb/list-table-logs.md +2 -0
- package/docs/examples/tablesdb/list-tables.md +2 -0
- package/docs/examples/tablesdb/list-transactions.md +2 -0
- package/docs/examples/tablesdb/list-usage.md +2 -0
- package/docs/examples/tablesdb/list.md +2 -0
- package/docs/examples/tablesdb/update-boolean-column.md +2 -0
- package/docs/examples/tablesdb/update-datetime-column.md +2 -0
- package/docs/examples/tablesdb/update-email-column.md +2 -0
- package/docs/examples/tablesdb/update-enum-column.md +2 -0
- package/docs/examples/tablesdb/update-float-column.md +2 -0
- package/docs/examples/tablesdb/update-integer-column.md +2 -0
- package/docs/examples/tablesdb/update-ip-column.md +2 -0
- package/docs/examples/tablesdb/update-line-column.md +2 -0
- package/docs/examples/tablesdb/update-longtext-column.md +2 -0
- package/docs/examples/tablesdb/update-mediumtext-column.md +2 -0
- package/docs/examples/tablesdb/update-point-column.md +2 -0
- package/docs/examples/tablesdb/update-polygon-column.md +2 -0
- package/docs/examples/tablesdb/update-relationship-column.md +2 -0
- package/docs/examples/tablesdb/update-row.md +2 -0
- package/docs/examples/tablesdb/update-rows.md +2 -0
- package/docs/examples/tablesdb/update-string-column.md +2 -0
- package/docs/examples/tablesdb/update-table.md +2 -0
- package/docs/examples/tablesdb/update-text-column.md +2 -0
- package/docs/examples/tablesdb/update-transaction.md +2 -0
- package/docs/examples/tablesdb/update-url-column.md +2 -0
- package/docs/examples/tablesdb/update-varchar-column.md +2 -0
- package/docs/examples/tablesdb/update.md +2 -0
- package/docs/examples/tablesdb/upsert-row.md +2 -0
- package/docs/examples/tablesdb/upsert-rows.md +2 -0
- package/docs/examples/teams/create-membership.md +4 -2
- package/docs/examples/teams/create.md +2 -0
- package/docs/examples/teams/delete-membership.md +2 -0
- package/docs/examples/teams/delete.md +2 -0
- package/docs/examples/teams/get-membership.md +2 -0
- package/docs/examples/teams/get-prefs.md +2 -0
- package/docs/examples/teams/get.md +2 -0
- package/docs/examples/teams/list-logs.md +2 -0
- package/docs/examples/teams/list-memberships.md +2 -0
- package/docs/examples/teams/list.md +2 -0
- package/docs/examples/teams/update-membership-status.md +2 -0
- package/docs/examples/teams/update-membership.md +4 -2
- package/docs/examples/teams/update-name.md +2 -0
- package/docs/examples/teams/update-prefs.md +2 -0
- package/docs/examples/tokens/create-file-token.md +2 -0
- package/docs/examples/tokens/delete.md +2 -0
- package/docs/examples/tokens/get.md +2 -0
- package/docs/examples/tokens/list.md +2 -0
- package/docs/examples/tokens/update.md +2 -0
- package/docs/examples/users/create-argon-2-user.md +2 -0
- package/docs/examples/users/create-bcrypt-user.md +2 -0
- package/docs/examples/users/create-jwt.md +2 -0
- package/docs/examples/users/create-md-5-user.md +2 -0
- package/docs/examples/users/create-mfa-recovery-codes.md +2 -0
- package/docs/examples/users/create-ph-pass-user.md +2 -0
- package/docs/examples/users/create-scrypt-modified-user.md +2 -0
- package/docs/examples/users/create-scrypt-user.md +2 -0
- package/docs/examples/users/create-session.md +2 -0
- package/docs/examples/users/create-sha-user.md +2 -0
- package/docs/examples/users/create-target.md +2 -0
- package/docs/examples/users/create-token.md +2 -0
- package/docs/examples/users/create.md +2 -0
- package/docs/examples/users/delete-identity.md +2 -0
- package/docs/examples/users/delete-mfa-authenticator.md +2 -0
- package/docs/examples/users/delete-session.md +2 -0
- package/docs/examples/users/delete-sessions.md +2 -0
- package/docs/examples/users/delete-target.md +2 -0
- package/docs/examples/users/delete.md +2 -0
- package/docs/examples/users/get-mfa-recovery-codes.md +2 -0
- package/docs/examples/users/get-prefs.md +2 -0
- package/docs/examples/users/get-target.md +2 -0
- package/docs/examples/users/get-usage.md +2 -0
- package/docs/examples/users/get.md +2 -0
- package/docs/examples/users/list-identities.md +2 -0
- package/docs/examples/users/list-logs.md +2 -0
- package/docs/examples/users/list-memberships.md +2 -0
- package/docs/examples/users/list-mfa-factors.md +2 -0
- package/docs/examples/users/list-sessions.md +2 -0
- package/docs/examples/users/list-targets.md +2 -0
- package/docs/examples/users/list.md +2 -0
- package/docs/examples/users/update-email-verification.md +2 -0
- package/docs/examples/users/update-email.md +2 -0
- package/docs/examples/users/update-labels.md +2 -0
- package/docs/examples/users/update-mfa-recovery-codes.md +2 -0
- package/docs/examples/users/update-mfa.md +2 -0
- package/docs/examples/users/update-name.md +2 -0
- package/docs/examples/users/update-password.md +2 -0
- package/docs/examples/users/update-phone-verification.md +2 -0
- package/docs/examples/users/update-phone.md +2 -0
- package/docs/examples/users/update-prefs.md +2 -0
- package/docs/examples/users/update-status.md +2 -0
- package/docs/examples/users/update-target.md +2 -0
- package/docs/examples/vcs/create-repository-detection.md +2 -0
- package/docs/examples/vcs/create-repository.md +2 -0
- package/docs/examples/vcs/delete-installation.md +2 -0
- package/docs/examples/vcs/get-installation.md +2 -0
- package/docs/examples/vcs/get-repository-contents.md +2 -0
- package/docs/examples/vcs/get-repository.md +2 -0
- package/docs/examples/vcs/list-installations.md +2 -0
- package/docs/examples/vcs/list-repositories.md +2 -0
- package/docs/examples/vcs/list-repository-branches.md +2 -0
- package/docs/examples/vcs/update-external-deployments.md +2 -0
- package/package.json +1 -1
- package/src/channel.ts +30 -18
- package/src/client.ts +108 -22
- package/src/enums/{services.ts → backup-services.ts} +1 -1
- package/src/enums/build-runtime.ts +2 -0
- package/src/enums/registration-type.ts +6 -0
- package/src/enums/runtime.ts +2 -0
- package/src/enums/runtimes.ts +2 -0
- package/src/enums/scopes.ts +1 -0
- package/src/index.ts +3 -3
- package/src/models.ts +227 -5
- package/src/services/account.ts +11 -11
- package/src/services/activities.ts +116 -0
- package/src/services/avatars.ts +3 -3
- package/src/services/backups.ts +28 -28
- package/src/services/console.ts +1 -1
- package/src/services/databases.ts +57 -29
- package/src/services/domains.ts +70 -0
- package/src/services/functions.ts +2 -2
- package/src/services/graphql.ts +2 -2
- package/src/services/health.ts +1 -1
- package/src/services/migrations.ts +10 -10
- package/src/services/organizations.ts +0 -60
- package/src/services/projects.ts +28 -78
- package/src/services/realtime.ts +135 -58
- package/src/services/sites.ts +2 -2
- package/src/services/storage.ts +1 -1
- package/src/services/tables-db.ts +57 -29
- package/src/services/teams.ts +18 -19
- package/src/services/users.ts +1 -1
- package/types/channel.d.ts +4 -3
- package/types/client.d.ts +7 -2
- package/types/enums/{services.d.ts → backup-services.d.ts} +1 -1
- package/types/enums/build-runtime.d.ts +3 -1
- package/types/enums/registration-type.d.ts +6 -0
- package/types/enums/runtime.d.ts +3 -1
- package/types/enums/runtimes.d.ts +3 -1
- package/types/enums/scopes.d.ts +2 -1
- package/types/index.d.ts +3 -3
- package/types/models.d.ts +224 -5
- package/types/services/activities.d.ts +46 -0
- package/types/services/backups.d.ts +13 -13
- package/types/services/databases.d.ts +16 -4
- package/types/services/domains.d.ts +26 -0
- package/types/services/migrations.d.ts +2 -2
- package/types/services/organizations.d.ts +0 -22
- package/types/services/projects.d.ts +8 -25
- package/types/services/realtime.d.ts +13 -6
- package/types/services/tables-db.d.ts +16 -4
- package/types/services/teams.d.ts +8 -9
- package/docs/examples/organizations/update-projects.md +0 -14
- package/docs/examples/projects/update-status.md +0 -14
- package/src/enums/roles.ts +0 -7
- package/src/enums/status.ts +0 -4
- package/types/enums/roles.d.ts +0 -7
- package/types/enums/status.d.ts +0 -4
package/dist/esm/sdk.js
CHANGED
|
@@ -534,7 +534,7 @@ class Client {
|
|
|
534
534
|
'x-sdk-name': 'Console',
|
|
535
535
|
'x-sdk-platform': 'console',
|
|
536
536
|
'x-sdk-language': 'web',
|
|
537
|
-
'x-sdk-version': '2.
|
|
537
|
+
'x-sdk-version': '2.3.1',
|
|
538
538
|
'X-Appwrite-Response-Format': '1.8.0',
|
|
539
539
|
};
|
|
540
540
|
this.realtime = {
|
|
@@ -543,7 +543,10 @@ class Client {
|
|
|
543
543
|
heartbeat: undefined,
|
|
544
544
|
url: '',
|
|
545
545
|
channels: new Set(),
|
|
546
|
+
queries: new Set(),
|
|
546
547
|
subscriptions: new Map(),
|
|
548
|
+
slotToSubscriptionId: new Map(),
|
|
549
|
+
subscriptionIdToSlot: new Map(),
|
|
547
550
|
subscriptionsCounter: 0,
|
|
548
551
|
reconnect: true,
|
|
549
552
|
reconnectAttempts: 0,
|
|
@@ -578,26 +581,34 @@ class Client {
|
|
|
578
581
|
}, 20000);
|
|
579
582
|
},
|
|
580
583
|
createSocket: () => {
|
|
581
|
-
var _a, _b, _c;
|
|
582
|
-
if (this.realtime.
|
|
584
|
+
var _a, _b, _c, _d;
|
|
585
|
+
if (this.realtime.subscriptions.size < 1) {
|
|
583
586
|
this.realtime.reconnect = false;
|
|
584
587
|
(_a = this.realtime.socket) === null || _a === void 0 ? void 0 : _a.close();
|
|
585
588
|
return;
|
|
586
589
|
}
|
|
587
|
-
const
|
|
588
|
-
|
|
589
|
-
channels.set('project', this.config.project);
|
|
590
|
-
}
|
|
590
|
+
const encodedProject = encodeURIComponent((_b = this.config.project) !== null && _b !== void 0 ? _b : '');
|
|
591
|
+
let queryParams = 'project=' + encodedProject;
|
|
591
592
|
this.realtime.channels.forEach(channel => {
|
|
592
|
-
|
|
593
|
+
queryParams += '&channels[]=' + encodeURIComponent(channel);
|
|
594
|
+
});
|
|
595
|
+
// Per-subscription queries: channel[slot][]=query so server can route events by subscription
|
|
596
|
+
const selectAllQuery = Query.select(['*']).toString();
|
|
597
|
+
this.realtime.subscriptions.forEach((sub, slot) => {
|
|
598
|
+
const queries = sub.queries.length > 0 ? sub.queries : [selectAllQuery];
|
|
599
|
+
sub.channels.forEach(channel => {
|
|
600
|
+
queries.forEach(query => {
|
|
601
|
+
queryParams += '&' + encodeURIComponent(channel) + '[' + slot + '][]=' + encodeURIComponent(query);
|
|
602
|
+
});
|
|
603
|
+
});
|
|
593
604
|
});
|
|
594
|
-
const url = this.config.endpointRealtime + '/realtime?' +
|
|
605
|
+
const url = this.config.endpointRealtime + '/realtime?' + queryParams;
|
|
595
606
|
if (url !== this.realtime.url || // Check if URL is present
|
|
596
607
|
!this.realtime.socket || // Check if WebSocket has not been created
|
|
597
|
-
((
|
|
608
|
+
((_c = this.realtime.socket) === null || _c === void 0 ? void 0 : _c.readyState) > WebSocket.OPEN // Check if WebSocket is CLOSING (3) or CLOSED (4)
|
|
598
609
|
) {
|
|
599
610
|
if (this.realtime.socket &&
|
|
600
|
-
((
|
|
611
|
+
((_d = this.realtime.socket) === null || _d === void 0 ? void 0 : _d.readyState) < WebSocket.CLOSING // Close WebSocket if it is CONNECTING (0) or OPEN (1)
|
|
601
612
|
) {
|
|
602
613
|
this.realtime.reconnect = false;
|
|
603
614
|
this.realtime.socket.close();
|
|
@@ -633,14 +644,25 @@ class Client {
|
|
|
633
644
|
const message = JSONbig.parse(event.data);
|
|
634
645
|
this.realtime.lastMessage = message;
|
|
635
646
|
switch (message.type) {
|
|
636
|
-
case 'connected':
|
|
647
|
+
case 'connected': {
|
|
648
|
+
const messageData = message.data;
|
|
649
|
+
if (messageData === null || messageData === void 0 ? void 0 : messageData.subscriptions) {
|
|
650
|
+
this.realtime.slotToSubscriptionId.clear();
|
|
651
|
+
this.realtime.subscriptionIdToSlot.clear();
|
|
652
|
+
for (const [slotStr, subscriptionId] of Object.entries(messageData.subscriptions)) {
|
|
653
|
+
const slot = Number(slotStr);
|
|
654
|
+
if (!isNaN(slot) && typeof subscriptionId === 'string') {
|
|
655
|
+
this.realtime.slotToSubscriptionId.set(slot, subscriptionId);
|
|
656
|
+
this.realtime.subscriptionIdToSlot.set(subscriptionId, slot);
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
}
|
|
637
660
|
let session = this.config.session;
|
|
638
661
|
if (!session) {
|
|
639
662
|
const cookie = JSONbig.parse((_a = window.localStorage.getItem('cookieFallback')) !== null && _a !== void 0 ? _a : '{}');
|
|
640
663
|
session = cookie === null || cookie === void 0 ? void 0 : cookie[`a_session_${this.config.project}`];
|
|
641
664
|
}
|
|
642
|
-
|
|
643
|
-
if (session && !messageData.user) {
|
|
665
|
+
if (session && !(messageData === null || messageData === void 0 ? void 0 : messageData.user)) {
|
|
644
666
|
(_b = this.realtime.socket) === null || _b === void 0 ? void 0 : _b.send(JSONbig.stringify({
|
|
645
667
|
type: 'authentication',
|
|
646
668
|
data: {
|
|
@@ -649,12 +671,27 @@ class Client {
|
|
|
649
671
|
}));
|
|
650
672
|
}
|
|
651
673
|
break;
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
674
|
+
}
|
|
675
|
+
case 'event': {
|
|
676
|
+
const data = message.data;
|
|
677
|
+
if (!(data === null || data === void 0 ? void 0 : data.channels))
|
|
678
|
+
break;
|
|
679
|
+
const eventSubIds = data.subscriptions;
|
|
680
|
+
if (eventSubIds && eventSubIds.length > 0) {
|
|
681
|
+
for (const subscriptionId of eventSubIds) {
|
|
682
|
+
const slot = this.realtime.subscriptionIdToSlot.get(subscriptionId);
|
|
683
|
+
if (slot !== undefined) {
|
|
684
|
+
const subscription = this.realtime.subscriptions.get(slot);
|
|
685
|
+
if (subscription) {
|
|
686
|
+
setTimeout(() => subscription.callback(data));
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
else {
|
|
655
692
|
const isSubscribed = data.channels.some(channel => this.realtime.channels.has(channel));
|
|
656
693
|
if (!isSubscribed)
|
|
657
|
-
|
|
694
|
+
break;
|
|
658
695
|
this.realtime.subscriptions.forEach(subscription => {
|
|
659
696
|
if (data.channels.some(channel => subscription.channels.includes(channel))) {
|
|
660
697
|
setTimeout(() => subscription.callback(data));
|
|
@@ -662,6 +699,7 @@ class Client {
|
|
|
662
699
|
});
|
|
663
700
|
}
|
|
664
701
|
break;
|
|
702
|
+
}
|
|
665
703
|
case 'pong':
|
|
666
704
|
break; // Handle pong response if needed
|
|
667
705
|
case 'error':
|
|
@@ -674,7 +712,7 @@ class Client {
|
|
|
674
712
|
console.error(e);
|
|
675
713
|
}
|
|
676
714
|
},
|
|
677
|
-
cleanUp: channels => {
|
|
715
|
+
cleanUp: (channels, queries) => {
|
|
678
716
|
this.realtime.channels.forEach(channel => {
|
|
679
717
|
if (channels.includes(channel)) {
|
|
680
718
|
let found = Array.from(this.realtime.subscriptions).some(([_key, subscription]) => {
|
|
@@ -685,6 +723,17 @@ class Client {
|
|
|
685
723
|
}
|
|
686
724
|
}
|
|
687
725
|
});
|
|
726
|
+
this.realtime.queries.forEach(query => {
|
|
727
|
+
if (queries.includes(query)) {
|
|
728
|
+
let found = Array.from(this.realtime.subscriptions).some(([_key, subscription]) => {
|
|
729
|
+
var _a;
|
|
730
|
+
return (_a = subscription.queries) === null || _a === void 0 ? void 0 : _a.includes(query);
|
|
731
|
+
});
|
|
732
|
+
if (!found) {
|
|
733
|
+
this.realtime.queries.delete(query);
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
});
|
|
688
737
|
}
|
|
689
738
|
};
|
|
690
739
|
}
|
|
@@ -865,7 +914,7 @@ class Client {
|
|
|
865
914
|
* @param {(payload: RealtimeMessage) => void} callback Is called on every realtime update.
|
|
866
915
|
* @returns {() => void} Unsubscribes from events.
|
|
867
916
|
*/
|
|
868
|
-
subscribe(channels, callback) {
|
|
917
|
+
subscribe(channels, callback, queries = []) {
|
|
869
918
|
const channelArray = Array.isArray(channels) ? channels : [channels];
|
|
870
919
|
// Convert Channel instances to strings
|
|
871
920
|
const channelStrings = channelArray.map(ch => {
|
|
@@ -880,15 +929,18 @@ class Client {
|
|
|
880
929
|
return String(ch);
|
|
881
930
|
});
|
|
882
931
|
channelStrings.forEach(channel => this.realtime.channels.add(channel));
|
|
932
|
+
const queryStrings = (queries !== null && queries !== void 0 ? queries : []).map(q => typeof q === 'string' ? q : q.toString());
|
|
933
|
+
queryStrings.forEach(query => this.realtime.queries.add(query));
|
|
883
934
|
const counter = this.realtime.subscriptionsCounter++;
|
|
884
935
|
this.realtime.subscriptions.set(counter, {
|
|
885
936
|
channels: channelStrings,
|
|
937
|
+
queries: queryStrings,
|
|
886
938
|
callback
|
|
887
939
|
});
|
|
888
940
|
this.realtime.connect();
|
|
889
941
|
return () => {
|
|
890
942
|
this.realtime.subscriptions.delete(counter);
|
|
891
|
-
this.realtime.cleanUp(channelStrings);
|
|
943
|
+
this.realtime.cleanUp(channelStrings, queryStrings);
|
|
892
944
|
this.realtime.connect();
|
|
893
945
|
};
|
|
894
946
|
}
|
|
@@ -1660,7 +1712,7 @@ class Account {
|
|
|
1660
1712
|
}
|
|
1661
1713
|
createMfaAuthenticator(paramsOrFirst) {
|
|
1662
1714
|
let params;
|
|
1663
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) {
|
|
1715
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('type' in paramsOrFirst))) {
|
|
1664
1716
|
params = (paramsOrFirst || {});
|
|
1665
1717
|
}
|
|
1666
1718
|
else {
|
|
@@ -1682,7 +1734,7 @@ class Account {
|
|
|
1682
1734
|
}
|
|
1683
1735
|
createMFAAuthenticator(paramsOrFirst) {
|
|
1684
1736
|
let params;
|
|
1685
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) {
|
|
1737
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('type' in paramsOrFirst))) {
|
|
1686
1738
|
params = (paramsOrFirst || {});
|
|
1687
1739
|
}
|
|
1688
1740
|
else {
|
|
@@ -1704,7 +1756,7 @@ class Account {
|
|
|
1704
1756
|
}
|
|
1705
1757
|
updateMfaAuthenticator(paramsOrFirst, ...rest) {
|
|
1706
1758
|
let params;
|
|
1707
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) {
|
|
1759
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('type' in paramsOrFirst || 'otp' in paramsOrFirst))) {
|
|
1708
1760
|
params = (paramsOrFirst || {});
|
|
1709
1761
|
}
|
|
1710
1762
|
else {
|
|
@@ -1734,7 +1786,7 @@ class Account {
|
|
|
1734
1786
|
}
|
|
1735
1787
|
updateMFAAuthenticator(paramsOrFirst, ...rest) {
|
|
1736
1788
|
let params;
|
|
1737
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) {
|
|
1789
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('type' in paramsOrFirst || 'otp' in paramsOrFirst))) {
|
|
1738
1790
|
params = (paramsOrFirst || {});
|
|
1739
1791
|
}
|
|
1740
1792
|
else {
|
|
@@ -1764,7 +1816,7 @@ class Account {
|
|
|
1764
1816
|
}
|
|
1765
1817
|
deleteMfaAuthenticator(paramsOrFirst) {
|
|
1766
1818
|
let params;
|
|
1767
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) {
|
|
1819
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('type' in paramsOrFirst))) {
|
|
1768
1820
|
params = (paramsOrFirst || {});
|
|
1769
1821
|
}
|
|
1770
1822
|
else {
|
|
@@ -1786,7 +1838,7 @@ class Account {
|
|
|
1786
1838
|
}
|
|
1787
1839
|
deleteMFAAuthenticator(paramsOrFirst) {
|
|
1788
1840
|
let params;
|
|
1789
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) {
|
|
1841
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('type' in paramsOrFirst))) {
|
|
1790
1842
|
params = (paramsOrFirst || {});
|
|
1791
1843
|
}
|
|
1792
1844
|
else {
|
|
@@ -1808,7 +1860,7 @@ class Account {
|
|
|
1808
1860
|
}
|
|
1809
1861
|
createMfaChallenge(paramsOrFirst) {
|
|
1810
1862
|
let params;
|
|
1811
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'factor' in paramsOrFirst)) {
|
|
1863
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('factor' in paramsOrFirst))) {
|
|
1812
1864
|
params = (paramsOrFirst || {});
|
|
1813
1865
|
}
|
|
1814
1866
|
else {
|
|
@@ -1833,7 +1885,7 @@ class Account {
|
|
|
1833
1885
|
}
|
|
1834
1886
|
createMFAChallenge(paramsOrFirst) {
|
|
1835
1887
|
let params;
|
|
1836
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'factor' in paramsOrFirst)) {
|
|
1888
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('factor' in paramsOrFirst))) {
|
|
1837
1889
|
params = (paramsOrFirst || {});
|
|
1838
1890
|
}
|
|
1839
1891
|
else {
|
|
@@ -2326,7 +2378,7 @@ class Account {
|
|
|
2326
2378
|
}
|
|
2327
2379
|
updatePrefs(paramsOrFirst) {
|
|
2328
2380
|
let params;
|
|
2329
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'prefs' in paramsOrFirst)) {
|
|
2381
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('prefs' in paramsOrFirst))) {
|
|
2330
2382
|
params = (paramsOrFirst || {});
|
|
2331
2383
|
}
|
|
2332
2384
|
else {
|
|
@@ -2534,7 +2586,7 @@ class Account {
|
|
|
2534
2586
|
}
|
|
2535
2587
|
createOAuth2Session(paramsOrFirst, ...rest) {
|
|
2536
2588
|
let params;
|
|
2537
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'provider' in paramsOrFirst)) {
|
|
2589
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('provider' in paramsOrFirst || 'success' in paramsOrFirst || 'failure' in paramsOrFirst || 'scopes' in paramsOrFirst))) {
|
|
2538
2590
|
params = (paramsOrFirst || {});
|
|
2539
2591
|
}
|
|
2540
2592
|
else {
|
|
@@ -2894,7 +2946,7 @@ class Account {
|
|
|
2894
2946
|
}
|
|
2895
2947
|
createOAuth2Token(paramsOrFirst, ...rest) {
|
|
2896
2948
|
let params;
|
|
2897
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'provider' in paramsOrFirst)) {
|
|
2949
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('provider' in paramsOrFirst || 'success' in paramsOrFirst || 'failure' in paramsOrFirst || 'scopes' in paramsOrFirst))) {
|
|
2898
2950
|
params = (paramsOrFirst || {});
|
|
2899
2951
|
}
|
|
2900
2952
|
else {
|
|
@@ -3135,13 +3187,59 @@ class Account {
|
|
|
3135
3187
|
}
|
|
3136
3188
|
}
|
|
3137
3189
|
|
|
3190
|
+
class Activities {
|
|
3191
|
+
constructor(client) {
|
|
3192
|
+
this.client = client;
|
|
3193
|
+
}
|
|
3194
|
+
listEvents(paramsOrFirst) {
|
|
3195
|
+
let params;
|
|
3196
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3197
|
+
params = (paramsOrFirst || {});
|
|
3198
|
+
}
|
|
3199
|
+
else {
|
|
3200
|
+
params = {
|
|
3201
|
+
queries: paramsOrFirst
|
|
3202
|
+
};
|
|
3203
|
+
}
|
|
3204
|
+
const queries = params.queries;
|
|
3205
|
+
const apiPath = '/activities/events';
|
|
3206
|
+
const payload = {};
|
|
3207
|
+
if (typeof queries !== 'undefined') {
|
|
3208
|
+
payload['queries'] = queries;
|
|
3209
|
+
}
|
|
3210
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3211
|
+
const apiHeaders = {};
|
|
3212
|
+
return this.client.call('get', uri, apiHeaders, payload);
|
|
3213
|
+
}
|
|
3214
|
+
getEvent(paramsOrFirst) {
|
|
3215
|
+
let params;
|
|
3216
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3217
|
+
params = (paramsOrFirst || {});
|
|
3218
|
+
}
|
|
3219
|
+
else {
|
|
3220
|
+
params = {
|
|
3221
|
+
eventId: paramsOrFirst
|
|
3222
|
+
};
|
|
3223
|
+
}
|
|
3224
|
+
const eventId = params.eventId;
|
|
3225
|
+
if (typeof eventId === 'undefined') {
|
|
3226
|
+
throw new AppwriteException('Missing required parameter: "eventId"');
|
|
3227
|
+
}
|
|
3228
|
+
const apiPath = '/activities/events/{eventId}'.replace('{eventId}', eventId);
|
|
3229
|
+
const payload = {};
|
|
3230
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3231
|
+
const apiHeaders = {};
|
|
3232
|
+
return this.client.call('get', uri, apiHeaders, payload);
|
|
3233
|
+
}
|
|
3234
|
+
}
|
|
3235
|
+
|
|
3138
3236
|
class Avatars {
|
|
3139
3237
|
constructor(client) {
|
|
3140
3238
|
this.client = client;
|
|
3141
3239
|
}
|
|
3142
3240
|
getBrowser(paramsOrFirst, ...rest) {
|
|
3143
3241
|
let params;
|
|
3144
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) {
|
|
3242
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('code' in paramsOrFirst || 'width' in paramsOrFirst || 'height' in paramsOrFirst || 'quality' in paramsOrFirst))) {
|
|
3145
3243
|
params = (paramsOrFirst || {});
|
|
3146
3244
|
}
|
|
3147
3245
|
else {
|
|
@@ -3179,7 +3277,7 @@ class Avatars {
|
|
|
3179
3277
|
}
|
|
3180
3278
|
getCreditCard(paramsOrFirst, ...rest) {
|
|
3181
3279
|
let params;
|
|
3182
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) {
|
|
3280
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('code' in paramsOrFirst || 'width' in paramsOrFirst || 'height' in paramsOrFirst || 'quality' in paramsOrFirst))) {
|
|
3183
3281
|
params = (paramsOrFirst || {});
|
|
3184
3282
|
}
|
|
3185
3283
|
else {
|
|
@@ -3243,7 +3341,7 @@ class Avatars {
|
|
|
3243
3341
|
}
|
|
3244
3342
|
getFlag(paramsOrFirst, ...rest) {
|
|
3245
3343
|
let params;
|
|
3246
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) {
|
|
3344
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('code' in paramsOrFirst || 'width' in paramsOrFirst || 'height' in paramsOrFirst || 'quality' in paramsOrFirst))) {
|
|
3247
3345
|
params = (paramsOrFirst || {});
|
|
3248
3346
|
}
|
|
3249
3347
|
else {
|
|
@@ -3543,7 +3641,7 @@ class Backups {
|
|
|
3543
3641
|
}
|
|
3544
3642
|
createArchive(paramsOrFirst, ...rest) {
|
|
3545
3643
|
let params;
|
|
3546
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'services' in paramsOrFirst)) {
|
|
3644
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('services' in paramsOrFirst || 'resourceId' in paramsOrFirst))) {
|
|
3547
3645
|
params = (paramsOrFirst || {});
|
|
3548
3646
|
}
|
|
3549
3647
|
else {
|
|
@@ -3943,7 +4041,7 @@ class Console {
|
|
|
3943
4041
|
}
|
|
3944
4042
|
getPlans(paramsOrFirst) {
|
|
3945
4043
|
let params;
|
|
3946
|
-
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'platform' in paramsOrFirst)) {
|
|
4044
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('platform' in paramsOrFirst))) {
|
|
3947
4045
|
params = (paramsOrFirst || {});
|
|
3948
4046
|
}
|
|
3949
4047
|
else {
|
|
@@ -4428,7 +4526,7 @@ class Databases {
|
|
|
4428
4526
|
}
|
|
4429
4527
|
listUsage(paramsOrFirst) {
|
|
4430
4528
|
let params;
|
|
4431
|
-
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'range' in paramsOrFirst)) {
|
|
4529
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) {
|
|
4432
4530
|
params = (paramsOrFirst || {});
|
|
4433
4531
|
}
|
|
4434
4532
|
else {
|
|
@@ -5660,7 +5758,8 @@ class Databases {
|
|
|
5660
5758
|
key: rest[1],
|
|
5661
5759
|
required: rest[2],
|
|
5662
5760
|
xdefault: rest[3],
|
|
5663
|
-
array: rest[4]
|
|
5761
|
+
array: rest[4],
|
|
5762
|
+
encrypt: rest[5]
|
|
5664
5763
|
};
|
|
5665
5764
|
}
|
|
5666
5765
|
const databaseId = params.databaseId;
|
|
@@ -5669,6 +5768,7 @@ class Databases {
|
|
|
5669
5768
|
const required = params.required;
|
|
5670
5769
|
const xdefault = params.xdefault;
|
|
5671
5770
|
const array = params.array;
|
|
5771
|
+
const encrypt = params.encrypt;
|
|
5672
5772
|
if (typeof databaseId === 'undefined') {
|
|
5673
5773
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
5674
5774
|
}
|
|
@@ -5695,6 +5795,9 @@ class Databases {
|
|
|
5695
5795
|
if (typeof array !== 'undefined') {
|
|
5696
5796
|
payload['array'] = array;
|
|
5697
5797
|
}
|
|
5798
|
+
if (typeof encrypt !== 'undefined') {
|
|
5799
|
+
payload['encrypt'] = encrypt;
|
|
5800
|
+
}
|
|
5698
5801
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
5699
5802
|
const apiHeaders = {
|
|
5700
5803
|
'content-type': 'application/json',
|
|
@@ -5766,7 +5869,8 @@ class Databases {
|
|
|
5766
5869
|
key: rest[1],
|
|
5767
5870
|
required: rest[2],
|
|
5768
5871
|
xdefault: rest[3],
|
|
5769
|
-
array: rest[4]
|
|
5872
|
+
array: rest[4],
|
|
5873
|
+
encrypt: rest[5]
|
|
5770
5874
|
};
|
|
5771
5875
|
}
|
|
5772
5876
|
const databaseId = params.databaseId;
|
|
@@ -5775,6 +5879,7 @@ class Databases {
|
|
|
5775
5879
|
const required = params.required;
|
|
5776
5880
|
const xdefault = params.xdefault;
|
|
5777
5881
|
const array = params.array;
|
|
5882
|
+
const encrypt = params.encrypt;
|
|
5778
5883
|
if (typeof databaseId === 'undefined') {
|
|
5779
5884
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
5780
5885
|
}
|
|
@@ -5801,6 +5906,9 @@ class Databases {
|
|
|
5801
5906
|
if (typeof array !== 'undefined') {
|
|
5802
5907
|
payload['array'] = array;
|
|
5803
5908
|
}
|
|
5909
|
+
if (typeof encrypt !== 'undefined') {
|
|
5910
|
+
payload['encrypt'] = encrypt;
|
|
5911
|
+
}
|
|
5804
5912
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
5805
5913
|
const apiHeaders = {
|
|
5806
5914
|
'content-type': 'application/json',
|
|
@@ -6255,7 +6363,8 @@ class Databases {
|
|
|
6255
6363
|
key: rest[1],
|
|
6256
6364
|
required: rest[2],
|
|
6257
6365
|
xdefault: rest[3],
|
|
6258
|
-
array: rest[4]
|
|
6366
|
+
array: rest[4],
|
|
6367
|
+
encrypt: rest[5]
|
|
6259
6368
|
};
|
|
6260
6369
|
}
|
|
6261
6370
|
const databaseId = params.databaseId;
|
|
@@ -6264,6 +6373,7 @@ class Databases {
|
|
|
6264
6373
|
const required = params.required;
|
|
6265
6374
|
const xdefault = params.xdefault;
|
|
6266
6375
|
const array = params.array;
|
|
6376
|
+
const encrypt = params.encrypt;
|
|
6267
6377
|
if (typeof databaseId === 'undefined') {
|
|
6268
6378
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
6269
6379
|
}
|
|
@@ -6290,6 +6400,9 @@ class Databases {
|
|
|
6290
6400
|
if (typeof array !== 'undefined') {
|
|
6291
6401
|
payload['array'] = array;
|
|
6292
6402
|
}
|
|
6403
|
+
if (typeof encrypt !== 'undefined') {
|
|
6404
|
+
payload['encrypt'] = encrypt;
|
|
6405
|
+
}
|
|
6293
6406
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
6294
6407
|
const apiHeaders = {
|
|
6295
6408
|
'content-type': 'application/json',
|
|
@@ -6468,7 +6581,8 @@ class Databases {
|
|
|
6468
6581
|
size: rest[2],
|
|
6469
6582
|
required: rest[3],
|
|
6470
6583
|
xdefault: rest[4],
|
|
6471
|
-
array: rest[5]
|
|
6584
|
+
array: rest[5],
|
|
6585
|
+
encrypt: rest[6]
|
|
6472
6586
|
};
|
|
6473
6587
|
}
|
|
6474
6588
|
const databaseId = params.databaseId;
|
|
@@ -6478,6 +6592,7 @@ class Databases {
|
|
|
6478
6592
|
const required = params.required;
|
|
6479
6593
|
const xdefault = params.xdefault;
|
|
6480
6594
|
const array = params.array;
|
|
6595
|
+
const encrypt = params.encrypt;
|
|
6481
6596
|
if (typeof databaseId === 'undefined') {
|
|
6482
6597
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
6483
6598
|
}
|
|
@@ -6510,6 +6625,9 @@ class Databases {
|
|
|
6510
6625
|
if (typeof array !== 'undefined') {
|
|
6511
6626
|
payload['array'] = array;
|
|
6512
6627
|
}
|
|
6628
|
+
if (typeof encrypt !== 'undefined') {
|
|
6629
|
+
payload['encrypt'] = encrypt;
|
|
6630
|
+
}
|
|
6513
6631
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
6514
6632
|
const apiHeaders = {
|
|
6515
6633
|
'content-type': 'application/json',
|
|
@@ -7572,6 +7690,39 @@ class Domains {
|
|
|
7572
7690
|
};
|
|
7573
7691
|
return this.client.call('post', uri, apiHeaders, payload);
|
|
7574
7692
|
}
|
|
7693
|
+
getPrice(paramsOrFirst, ...rest) {
|
|
7694
|
+
let params;
|
|
7695
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
7696
|
+
params = (paramsOrFirst || {});
|
|
7697
|
+
}
|
|
7698
|
+
else {
|
|
7699
|
+
params = {
|
|
7700
|
+
domain: paramsOrFirst,
|
|
7701
|
+
periodYears: rest[0],
|
|
7702
|
+
registrationType: rest[1]
|
|
7703
|
+
};
|
|
7704
|
+
}
|
|
7705
|
+
const domain = params.domain;
|
|
7706
|
+
const periodYears = params.periodYears;
|
|
7707
|
+
const registrationType = params.registrationType;
|
|
7708
|
+
if (typeof domain === 'undefined') {
|
|
7709
|
+
throw new AppwriteException('Missing required parameter: "domain"');
|
|
7710
|
+
}
|
|
7711
|
+
const apiPath = '/domains/price';
|
|
7712
|
+
const payload = {};
|
|
7713
|
+
if (typeof domain !== 'undefined') {
|
|
7714
|
+
payload['domain'] = domain;
|
|
7715
|
+
}
|
|
7716
|
+
if (typeof periodYears !== 'undefined') {
|
|
7717
|
+
payload['periodYears'] = periodYears;
|
|
7718
|
+
}
|
|
7719
|
+
if (typeof registrationType !== 'undefined') {
|
|
7720
|
+
payload['registrationType'] = registrationType;
|
|
7721
|
+
}
|
|
7722
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
7723
|
+
const apiHeaders = {};
|
|
7724
|
+
return this.client.call('get', uri, apiHeaders, payload);
|
|
7725
|
+
}
|
|
7575
7726
|
listSuggestions(paramsOrFirst, ...rest) {
|
|
7576
7727
|
let params;
|
|
7577
7728
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
@@ -9404,7 +9555,7 @@ class Functions {
|
|
|
9404
9555
|
}
|
|
9405
9556
|
listTemplates(paramsOrFirst, ...rest) {
|
|
9406
9557
|
let params;
|
|
9407
|
-
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'runtimes' in paramsOrFirst)) {
|
|
9558
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('runtimes' in paramsOrFirst || 'useCases' in paramsOrFirst || 'limit' in paramsOrFirst || 'offset' in paramsOrFirst || 'total' in paramsOrFirst))) {
|
|
9408
9559
|
params = (paramsOrFirst || {});
|
|
9409
9560
|
}
|
|
9410
9561
|
else {
|
|
@@ -9464,7 +9615,7 @@ class Functions {
|
|
|
9464
9615
|
}
|
|
9465
9616
|
listUsage(paramsOrFirst) {
|
|
9466
9617
|
let params;
|
|
9467
|
-
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'range' in paramsOrFirst)) {
|
|
9618
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) {
|
|
9468
9619
|
params = (paramsOrFirst || {});
|
|
9469
9620
|
}
|
|
9470
9621
|
else {
|
|
@@ -10334,7 +10485,7 @@ class Graphql {
|
|
|
10334
10485
|
}
|
|
10335
10486
|
query(paramsOrFirst) {
|
|
10336
10487
|
let params;
|
|
10337
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'query' in paramsOrFirst)) {
|
|
10488
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('query' in paramsOrFirst))) {
|
|
10338
10489
|
params = (paramsOrFirst || {});
|
|
10339
10490
|
}
|
|
10340
10491
|
else {
|
|
@@ -10360,7 +10511,7 @@ class Graphql {
|
|
|
10360
10511
|
}
|
|
10361
10512
|
mutation(paramsOrFirst) {
|
|
10362
10513
|
let params;
|
|
10363
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'query' in paramsOrFirst)) {
|
|
10514
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('query' in paramsOrFirst))) {
|
|
10364
10515
|
params = (paramsOrFirst || {});
|
|
10365
10516
|
}
|
|
10366
10517
|
else {
|
|
@@ -10642,7 +10793,7 @@ class Health {
|
|
|
10642
10793
|
}
|
|
10643
10794
|
getFailedJobs(paramsOrFirst, ...rest) {
|
|
10644
10795
|
let params;
|
|
10645
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'name' in paramsOrFirst)) {
|
|
10796
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('name' in paramsOrFirst || 'threshold' in paramsOrFirst))) {
|
|
10646
10797
|
params = (paramsOrFirst || {});
|
|
10647
10798
|
}
|
|
10648
10799
|
else {
|
|
@@ -13877,7 +14028,7 @@ class Migrations {
|
|
|
13877
14028
|
}
|
|
13878
14029
|
createAppwriteMigration(paramsOrFirst, ...rest) {
|
|
13879
14030
|
let params;
|
|
13880
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
|
|
14031
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('resources' in paramsOrFirst || 'endpoint' in paramsOrFirst || 'projectId' in paramsOrFirst || 'apiKey' in paramsOrFirst))) {
|
|
13881
14032
|
params = (paramsOrFirst || {});
|
|
13882
14033
|
}
|
|
13883
14034
|
else {
|
|
@@ -13926,7 +14077,7 @@ class Migrations {
|
|
|
13926
14077
|
}
|
|
13927
14078
|
getAppwriteReport(paramsOrFirst, ...rest) {
|
|
13928
14079
|
let params;
|
|
13929
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
|
|
14080
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('resources' in paramsOrFirst || 'endpoint' in paramsOrFirst || 'projectID' in paramsOrFirst || 'key' in paramsOrFirst))) {
|
|
13930
14081
|
params = (paramsOrFirst || {});
|
|
13931
14082
|
}
|
|
13932
14083
|
else {
|
|
@@ -14087,7 +14238,7 @@ class Migrations {
|
|
|
14087
14238
|
}
|
|
14088
14239
|
createFirebaseMigration(paramsOrFirst, ...rest) {
|
|
14089
14240
|
let params;
|
|
14090
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
|
|
14241
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('resources' in paramsOrFirst || 'serviceAccount' in paramsOrFirst))) {
|
|
14091
14242
|
params = (paramsOrFirst || {});
|
|
14092
14243
|
}
|
|
14093
14244
|
else {
|
|
@@ -14120,7 +14271,7 @@ class Migrations {
|
|
|
14120
14271
|
}
|
|
14121
14272
|
getFirebaseReport(paramsOrFirst, ...rest) {
|
|
14122
14273
|
let params;
|
|
14123
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
|
|
14274
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('resources' in paramsOrFirst || 'serviceAccount' in paramsOrFirst))) {
|
|
14124
14275
|
params = (paramsOrFirst || {});
|
|
14125
14276
|
}
|
|
14126
14277
|
else {
|
|
@@ -14151,7 +14302,7 @@ class Migrations {
|
|
|
14151
14302
|
}
|
|
14152
14303
|
createNHostMigration(paramsOrFirst, ...rest) {
|
|
14153
14304
|
let params;
|
|
14154
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
|
|
14305
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('resources' in paramsOrFirst || 'subdomain' in paramsOrFirst || 'region' in paramsOrFirst || 'adminSecret' in paramsOrFirst || 'database' in paramsOrFirst || 'username' in paramsOrFirst || 'password' in paramsOrFirst || 'port' in paramsOrFirst))) {
|
|
14155
14306
|
params = (paramsOrFirst || {});
|
|
14156
14307
|
}
|
|
14157
14308
|
else {
|
|
@@ -14229,7 +14380,7 @@ class Migrations {
|
|
|
14229
14380
|
}
|
|
14230
14381
|
getNHostReport(paramsOrFirst, ...rest) {
|
|
14231
14382
|
let params;
|
|
14232
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
|
|
14383
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('resources' in paramsOrFirst || 'subdomain' in paramsOrFirst || 'region' in paramsOrFirst || 'adminSecret' in paramsOrFirst || 'database' in paramsOrFirst || 'username' in paramsOrFirst || 'password' in paramsOrFirst || 'port' in paramsOrFirst))) {
|
|
14233
14384
|
params = (paramsOrFirst || {});
|
|
14234
14385
|
}
|
|
14235
14386
|
else {
|
|
@@ -14305,7 +14456,7 @@ class Migrations {
|
|
|
14305
14456
|
}
|
|
14306
14457
|
createSupabaseMigration(paramsOrFirst, ...rest) {
|
|
14307
14458
|
let params;
|
|
14308
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
|
|
14459
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('resources' in paramsOrFirst || 'endpoint' in paramsOrFirst || 'apiKey' in paramsOrFirst || 'databaseHost' in paramsOrFirst || 'username' in paramsOrFirst || 'password' in paramsOrFirst || 'port' in paramsOrFirst))) {
|
|
14309
14460
|
params = (paramsOrFirst || {});
|
|
14310
14461
|
}
|
|
14311
14462
|
else {
|
|
@@ -14375,7 +14526,7 @@ class Migrations {
|
|
|
14375
14526
|
}
|
|
14376
14527
|
getSupabaseReport(paramsOrFirst, ...rest) {
|
|
14377
14528
|
let params;
|
|
14378
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
|
|
14529
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('resources' in paramsOrFirst || 'endpoint' in paramsOrFirst || 'apiKey' in paramsOrFirst || 'databaseHost' in paramsOrFirst || 'username' in paramsOrFirst || 'password' in paramsOrFirst || 'port' in paramsOrFirst))) {
|
|
14379
14530
|
params = (paramsOrFirst || {});
|
|
14380
14531
|
}
|
|
14381
14532
|
else {
|
|
@@ -15658,33 +15809,6 @@ class Organizations {
|
|
|
15658
15809
|
};
|
|
15659
15810
|
return this.client.call('patch', uri, apiHeaders, payload);
|
|
15660
15811
|
}
|
|
15661
|
-
updateProjects(paramsOrFirst, ...rest) {
|
|
15662
|
-
let params;
|
|
15663
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
15664
|
-
params = (paramsOrFirst || {});
|
|
15665
|
-
}
|
|
15666
|
-
else {
|
|
15667
|
-
params = {
|
|
15668
|
-
organizationId: paramsOrFirst,
|
|
15669
|
-
projects: rest[0]
|
|
15670
|
-
};
|
|
15671
|
-
}
|
|
15672
|
-
const organizationId = params.organizationId;
|
|
15673
|
-
const projects = params.projects;
|
|
15674
|
-
if (typeof organizationId === 'undefined') {
|
|
15675
|
-
throw new AppwriteException('Missing required parameter: "organizationId"');
|
|
15676
|
-
}
|
|
15677
|
-
const apiPath = '/organizations/{organizationId}/projects'.replace('{organizationId}', organizationId);
|
|
15678
|
-
const payload = {};
|
|
15679
|
-
if (typeof projects !== 'undefined') {
|
|
15680
|
-
payload['projects'] = projects;
|
|
15681
|
-
}
|
|
15682
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
15683
|
-
const apiHeaders = {
|
|
15684
|
-
'content-type': 'application/json',
|
|
15685
|
-
};
|
|
15686
|
-
return this.client.call('patch', uri, apiHeaders, payload);
|
|
15687
|
-
}
|
|
15688
15812
|
listRegions(paramsOrFirst) {
|
|
15689
15813
|
let params;
|
|
15690
15814
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
@@ -16919,16 +17043,21 @@ class Projects {
|
|
|
16919
17043
|
else {
|
|
16920
17044
|
params = {
|
|
16921
17045
|
projectId: paramsOrFirst,
|
|
16922
|
-
|
|
17046
|
+
queries: rest[0],
|
|
17047
|
+
total: rest[1]
|
|
16923
17048
|
};
|
|
16924
17049
|
}
|
|
16925
17050
|
const projectId = params.projectId;
|
|
17051
|
+
const queries = params.queries;
|
|
16926
17052
|
const total = params.total;
|
|
16927
17053
|
if (typeof projectId === 'undefined') {
|
|
16928
17054
|
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
16929
17055
|
}
|
|
16930
17056
|
const apiPath = '/projects/{projectId}/keys'.replace('{projectId}', projectId);
|
|
16931
17057
|
const payload = {};
|
|
17058
|
+
if (typeof queries !== 'undefined') {
|
|
17059
|
+
payload['queries'] = queries;
|
|
17060
|
+
}
|
|
16932
17061
|
if (typeof total !== 'undefined') {
|
|
16933
17062
|
payload['total'] = total;
|
|
16934
17063
|
}
|
|
@@ -16946,12 +17075,14 @@ class Projects {
|
|
|
16946
17075
|
projectId: paramsOrFirst,
|
|
16947
17076
|
name: rest[0],
|
|
16948
17077
|
scopes: rest[1],
|
|
16949
|
-
|
|
17078
|
+
keyId: rest[2],
|
|
17079
|
+
expire: rest[3]
|
|
16950
17080
|
};
|
|
16951
17081
|
}
|
|
16952
17082
|
const projectId = params.projectId;
|
|
16953
17083
|
const name = params.name;
|
|
16954
17084
|
const scopes = params.scopes;
|
|
17085
|
+
const keyId = params.keyId;
|
|
16955
17086
|
const expire = params.expire;
|
|
16956
17087
|
if (typeof projectId === 'undefined') {
|
|
16957
17088
|
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
@@ -16964,6 +17095,9 @@ class Projects {
|
|
|
16964
17095
|
}
|
|
16965
17096
|
const apiPath = '/projects/{projectId}/keys'.replace('{projectId}', projectId);
|
|
16966
17097
|
const payload = {};
|
|
17098
|
+
if (typeof keyId !== 'undefined') {
|
|
17099
|
+
payload['keyId'] = keyId;
|
|
17100
|
+
}
|
|
16967
17101
|
if (typeof name !== 'undefined') {
|
|
16968
17102
|
payload['name'] = name;
|
|
16969
17103
|
}
|
|
@@ -17700,36 +17834,6 @@ class Projects {
|
|
|
17700
17834
|
};
|
|
17701
17835
|
return this.client.call('post', uri, apiHeaders, payload);
|
|
17702
17836
|
}
|
|
17703
|
-
updateStatus(paramsOrFirst, ...rest) {
|
|
17704
|
-
let params;
|
|
17705
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
17706
|
-
params = (paramsOrFirst || {});
|
|
17707
|
-
}
|
|
17708
|
-
else {
|
|
17709
|
-
params = {
|
|
17710
|
-
projectId: paramsOrFirst,
|
|
17711
|
-
status: rest[0]
|
|
17712
|
-
};
|
|
17713
|
-
}
|
|
17714
|
-
const projectId = params.projectId;
|
|
17715
|
-
const status = params.status;
|
|
17716
|
-
if (typeof projectId === 'undefined') {
|
|
17717
|
-
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
17718
|
-
}
|
|
17719
|
-
if (typeof status === 'undefined') {
|
|
17720
|
-
throw new AppwriteException('Missing required parameter: "status"');
|
|
17721
|
-
}
|
|
17722
|
-
const apiPath = '/projects/{projectId}/status'.replace('{projectId}', projectId);
|
|
17723
|
-
const payload = {};
|
|
17724
|
-
if (typeof status !== 'undefined') {
|
|
17725
|
-
payload['status'] = status;
|
|
17726
|
-
}
|
|
17727
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
17728
|
-
const apiHeaders = {
|
|
17729
|
-
'content-type': 'application/json',
|
|
17730
|
-
};
|
|
17731
|
-
return this.client.call('patch', uri, apiHeaders, payload);
|
|
17732
|
-
}
|
|
17733
17837
|
updateTeam(paramsOrFirst, ...rest) {
|
|
17734
17838
|
let params;
|
|
17735
17839
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
@@ -18777,7 +18881,7 @@ class Sites {
|
|
|
18777
18881
|
}
|
|
18778
18882
|
listTemplates(paramsOrFirst, ...rest) {
|
|
18779
18883
|
let params;
|
|
18780
|
-
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'frameworks' in paramsOrFirst)) {
|
|
18884
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('frameworks' in paramsOrFirst || 'useCases' in paramsOrFirst || 'limit' in paramsOrFirst || 'offset' in paramsOrFirst))) {
|
|
18781
18885
|
params = (paramsOrFirst || {});
|
|
18782
18886
|
}
|
|
18783
18887
|
else {
|
|
@@ -18832,7 +18936,7 @@ class Sites {
|
|
|
18832
18936
|
}
|
|
18833
18937
|
listUsage(paramsOrFirst) {
|
|
18834
18938
|
let params;
|
|
18835
|
-
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'range' in paramsOrFirst)) {
|
|
18939
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) {
|
|
18836
18940
|
params = (paramsOrFirst || {});
|
|
18837
18941
|
}
|
|
18838
18942
|
else {
|
|
@@ -20202,7 +20306,7 @@ class Storage {
|
|
|
20202
20306
|
}
|
|
20203
20307
|
getUsage(paramsOrFirst) {
|
|
20204
20308
|
let params;
|
|
20205
|
-
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'range' in paramsOrFirst)) {
|
|
20309
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) {
|
|
20206
20310
|
params = (paramsOrFirst || {});
|
|
20207
20311
|
}
|
|
20208
20312
|
else {
|
|
@@ -20464,7 +20568,7 @@ class TablesDB {
|
|
|
20464
20568
|
}
|
|
20465
20569
|
listUsage(paramsOrFirst) {
|
|
20466
20570
|
let params;
|
|
20467
|
-
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'range' in paramsOrFirst)) {
|
|
20571
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) {
|
|
20468
20572
|
params = (paramsOrFirst || {});
|
|
20469
20573
|
}
|
|
20470
20574
|
else {
|
|
@@ -21696,7 +21800,8 @@ class TablesDB {
|
|
|
21696
21800
|
key: rest[1],
|
|
21697
21801
|
required: rest[2],
|
|
21698
21802
|
xdefault: rest[3],
|
|
21699
|
-
array: rest[4]
|
|
21803
|
+
array: rest[4],
|
|
21804
|
+
encrypt: rest[5]
|
|
21700
21805
|
};
|
|
21701
21806
|
}
|
|
21702
21807
|
const databaseId = params.databaseId;
|
|
@@ -21705,6 +21810,7 @@ class TablesDB {
|
|
|
21705
21810
|
const required = params.required;
|
|
21706
21811
|
const xdefault = params.xdefault;
|
|
21707
21812
|
const array = params.array;
|
|
21813
|
+
const encrypt = params.encrypt;
|
|
21708
21814
|
if (typeof databaseId === 'undefined') {
|
|
21709
21815
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
21710
21816
|
}
|
|
@@ -21731,6 +21837,9 @@ class TablesDB {
|
|
|
21731
21837
|
if (typeof array !== 'undefined') {
|
|
21732
21838
|
payload['array'] = array;
|
|
21733
21839
|
}
|
|
21840
|
+
if (typeof encrypt !== 'undefined') {
|
|
21841
|
+
payload['encrypt'] = encrypt;
|
|
21842
|
+
}
|
|
21734
21843
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
21735
21844
|
const apiHeaders = {
|
|
21736
21845
|
'content-type': 'application/json',
|
|
@@ -21802,7 +21911,8 @@ class TablesDB {
|
|
|
21802
21911
|
key: rest[1],
|
|
21803
21912
|
required: rest[2],
|
|
21804
21913
|
xdefault: rest[3],
|
|
21805
|
-
array: rest[4]
|
|
21914
|
+
array: rest[4],
|
|
21915
|
+
encrypt: rest[5]
|
|
21806
21916
|
};
|
|
21807
21917
|
}
|
|
21808
21918
|
const databaseId = params.databaseId;
|
|
@@ -21811,6 +21921,7 @@ class TablesDB {
|
|
|
21811
21921
|
const required = params.required;
|
|
21812
21922
|
const xdefault = params.xdefault;
|
|
21813
21923
|
const array = params.array;
|
|
21924
|
+
const encrypt = params.encrypt;
|
|
21814
21925
|
if (typeof databaseId === 'undefined') {
|
|
21815
21926
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
21816
21927
|
}
|
|
@@ -21837,6 +21948,9 @@ class TablesDB {
|
|
|
21837
21948
|
if (typeof array !== 'undefined') {
|
|
21838
21949
|
payload['array'] = array;
|
|
21839
21950
|
}
|
|
21951
|
+
if (typeof encrypt !== 'undefined') {
|
|
21952
|
+
payload['encrypt'] = encrypt;
|
|
21953
|
+
}
|
|
21840
21954
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
21841
21955
|
const apiHeaders = {
|
|
21842
21956
|
'content-type': 'application/json',
|
|
@@ -22291,7 +22405,8 @@ class TablesDB {
|
|
|
22291
22405
|
key: rest[1],
|
|
22292
22406
|
required: rest[2],
|
|
22293
22407
|
xdefault: rest[3],
|
|
22294
|
-
array: rest[4]
|
|
22408
|
+
array: rest[4],
|
|
22409
|
+
encrypt: rest[5]
|
|
22295
22410
|
};
|
|
22296
22411
|
}
|
|
22297
22412
|
const databaseId = params.databaseId;
|
|
@@ -22300,6 +22415,7 @@ class TablesDB {
|
|
|
22300
22415
|
const required = params.required;
|
|
22301
22416
|
const xdefault = params.xdefault;
|
|
22302
22417
|
const array = params.array;
|
|
22418
|
+
const encrypt = params.encrypt;
|
|
22303
22419
|
if (typeof databaseId === 'undefined') {
|
|
22304
22420
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
22305
22421
|
}
|
|
@@ -22326,6 +22442,9 @@ class TablesDB {
|
|
|
22326
22442
|
if (typeof array !== 'undefined') {
|
|
22327
22443
|
payload['array'] = array;
|
|
22328
22444
|
}
|
|
22445
|
+
if (typeof encrypt !== 'undefined') {
|
|
22446
|
+
payload['encrypt'] = encrypt;
|
|
22447
|
+
}
|
|
22329
22448
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
22330
22449
|
const apiHeaders = {
|
|
22331
22450
|
'content-type': 'application/json',
|
|
@@ -22504,7 +22623,8 @@ class TablesDB {
|
|
|
22504
22623
|
size: rest[2],
|
|
22505
22624
|
required: rest[3],
|
|
22506
22625
|
xdefault: rest[4],
|
|
22507
|
-
array: rest[5]
|
|
22626
|
+
array: rest[5],
|
|
22627
|
+
encrypt: rest[6]
|
|
22508
22628
|
};
|
|
22509
22629
|
}
|
|
22510
22630
|
const databaseId = params.databaseId;
|
|
@@ -22514,6 +22634,7 @@ class TablesDB {
|
|
|
22514
22634
|
const required = params.required;
|
|
22515
22635
|
const xdefault = params.xdefault;
|
|
22516
22636
|
const array = params.array;
|
|
22637
|
+
const encrypt = params.encrypt;
|
|
22517
22638
|
if (typeof databaseId === 'undefined') {
|
|
22518
22639
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
22519
22640
|
}
|
|
@@ -22546,6 +22667,9 @@ class TablesDB {
|
|
|
22546
22667
|
if (typeof array !== 'undefined') {
|
|
22547
22668
|
payload['array'] = array;
|
|
22548
22669
|
}
|
|
22670
|
+
if (typeof encrypt !== 'undefined') {
|
|
22671
|
+
payload['encrypt'] = encrypt;
|
|
22672
|
+
}
|
|
22549
22673
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
22550
22674
|
const apiHeaders = {
|
|
22551
22675
|
'content-type': 'application/json',
|
|
@@ -24633,7 +24757,7 @@ class Users {
|
|
|
24633
24757
|
}
|
|
24634
24758
|
getUsage(paramsOrFirst) {
|
|
24635
24759
|
let params;
|
|
24636
|
-
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'range' in paramsOrFirst)) {
|
|
24760
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) {
|
|
24637
24761
|
params = (paramsOrFirst || {});
|
|
24638
24762
|
}
|
|
24639
24763
|
else {
|
|
@@ -26003,11 +26127,16 @@ class Realtime {
|
|
|
26003
26127
|
this.TYPE_CONNECTED = 'connected';
|
|
26004
26128
|
this.DEBOUNCE_MS = 1;
|
|
26005
26129
|
this.HEARTBEAT_INTERVAL = 20000; // 20 seconds in milliseconds
|
|
26006
|
-
|
|
26130
|
+
// Slot-centric state: Map<slot, { channels: Set<string>, queries: string[], callback: Function }>
|
|
26007
26131
|
this.activeSubscriptions = new Map();
|
|
26132
|
+
// Map slot index -> subscriptionId (from backend)
|
|
26133
|
+
this.slotToSubscriptionId = new Map();
|
|
26134
|
+
// Inverse map: subscriptionId -> slot index (for O(1) lookup)
|
|
26135
|
+
this.subscriptionIdToSlot = new Map();
|
|
26008
26136
|
this.subCallDepth = 0;
|
|
26009
26137
|
this.reconnectAttempts = 0;
|
|
26010
26138
|
this.subscriptionsCounter = 0;
|
|
26139
|
+
this.connectionId = 0;
|
|
26011
26140
|
this.reconnect = true;
|
|
26012
26141
|
this.onErrorCallbacks = [];
|
|
26013
26142
|
this.onCloseCallbacks = [];
|
|
@@ -26057,7 +26186,7 @@ class Realtime {
|
|
|
26057
26186
|
}
|
|
26058
26187
|
createSocket() {
|
|
26059
26188
|
return __awaiter(this, void 0, void 0, function* () {
|
|
26060
|
-
if (this.
|
|
26189
|
+
if (this.activeSubscriptions.size === 0) {
|
|
26061
26190
|
this.reconnect = false;
|
|
26062
26191
|
yield this.closeSocket();
|
|
26063
26192
|
return;
|
|
@@ -26066,10 +26195,36 @@ class Realtime {
|
|
|
26066
26195
|
if (!projectId) {
|
|
26067
26196
|
throw new AppwriteException('Missing project ID');
|
|
26068
26197
|
}
|
|
26198
|
+
// Collect all unique channels from all slots
|
|
26199
|
+
const allChannels = new Set();
|
|
26200
|
+
for (const subscription of this.activeSubscriptions.values()) {
|
|
26201
|
+
for (const channel of subscription.channels) {
|
|
26202
|
+
allChannels.add(channel);
|
|
26203
|
+
}
|
|
26204
|
+
}
|
|
26069
26205
|
let queryParams = `project=${projectId}`;
|
|
26070
|
-
for (const channel of
|
|
26206
|
+
for (const channel of allChannels) {
|
|
26071
26207
|
queryParams += `&channels[]=${encodeURIComponent(channel)}`;
|
|
26072
26208
|
}
|
|
26209
|
+
// Build query string from slots → channels → queries
|
|
26210
|
+
// Format: channel[slot][]=query
|
|
26211
|
+
// For each slot, repeat its queries under each channel it subscribes to
|
|
26212
|
+
// Example: slot 1 → channels [tests, prod], queries [q1, q2]
|
|
26213
|
+
// Produces: tests[1][]=q1&tests[1][]=q2&prod[1][]=q1&prod[1][]=q2
|
|
26214
|
+
const selectAllQuery = Query.select(['*']).toString();
|
|
26215
|
+
for (const [slot, subscription] of this.activeSubscriptions) {
|
|
26216
|
+
// queries is string[] - iterate over each query string
|
|
26217
|
+
const queries = subscription.queries.length === 0
|
|
26218
|
+
? [selectAllQuery]
|
|
26219
|
+
: subscription.queries;
|
|
26220
|
+
// Repeat this slot's queries under each channel it subscribes to
|
|
26221
|
+
// Each query is sent as a separate parameter: channel[slot][]=q1&channel[slot][]=q2
|
|
26222
|
+
for (const channel of subscription.channels) {
|
|
26223
|
+
for (const query of queries) {
|
|
26224
|
+
queryParams += `&${encodeURIComponent(channel)}[${slot}][]=${encodeURIComponent(query)}`;
|
|
26225
|
+
}
|
|
26226
|
+
}
|
|
26227
|
+
}
|
|
26073
26228
|
const endpoint = this.client.config.endpointRealtime !== ''
|
|
26074
26229
|
? this.client.config.endpointRealtime
|
|
26075
26230
|
: this.client.config.endpoint || '';
|
|
@@ -26079,18 +26234,29 @@ class Realtime {
|
|
|
26079
26234
|
const url = `${realtimeEndpoint}/realtime?${queryParams}`;
|
|
26080
26235
|
if (this.socket) {
|
|
26081
26236
|
this.reconnect = false;
|
|
26082
|
-
|
|
26237
|
+
if (this.socket.readyState < WebSocket.CLOSING) {
|
|
26238
|
+
yield this.closeSocket();
|
|
26239
|
+
}
|
|
26240
|
+
// Ensure reconnect isn't stuck false if close event was missed.
|
|
26241
|
+
this.reconnect = true;
|
|
26083
26242
|
}
|
|
26084
26243
|
return new Promise((resolve, reject) => {
|
|
26085
26244
|
try {
|
|
26086
|
-
|
|
26087
|
-
this.socket
|
|
26245
|
+
const connectionId = ++this.connectionId;
|
|
26246
|
+
const socket = (this.socket = new WebSocket(url));
|
|
26247
|
+
socket.addEventListener('open', () => {
|
|
26248
|
+
if (connectionId !== this.connectionId) {
|
|
26249
|
+
return;
|
|
26250
|
+
}
|
|
26088
26251
|
this.reconnectAttempts = 0;
|
|
26089
26252
|
this.onOpenCallbacks.forEach(callback => callback());
|
|
26090
26253
|
this.startHeartbeat();
|
|
26091
26254
|
resolve();
|
|
26092
26255
|
});
|
|
26093
|
-
|
|
26256
|
+
socket.addEventListener('message', (event) => {
|
|
26257
|
+
if (connectionId !== this.connectionId) {
|
|
26258
|
+
return;
|
|
26259
|
+
}
|
|
26094
26260
|
try {
|
|
26095
26261
|
const message = JSON.parse(event.data);
|
|
26096
26262
|
this.handleMessage(message);
|
|
@@ -26099,7 +26265,10 @@ class Realtime {
|
|
|
26099
26265
|
console.error('Failed to parse message:', error);
|
|
26100
26266
|
}
|
|
26101
26267
|
});
|
|
26102
|
-
|
|
26268
|
+
socket.addEventListener('close', (event) => __awaiter(this, void 0, void 0, function* () {
|
|
26269
|
+
if (connectionId !== this.connectionId || socket !== this.socket) {
|
|
26270
|
+
return;
|
|
26271
|
+
}
|
|
26103
26272
|
this.stopHeartbeat();
|
|
26104
26273
|
this.onCloseCallbacks.forEach(callback => callback());
|
|
26105
26274
|
if (!this.reconnect || event.code === RealtimeCode.POLICY_VIOLATION) {
|
|
@@ -26117,7 +26286,10 @@ class Realtime {
|
|
|
26117
26286
|
console.error('Failed to reconnect:', error);
|
|
26118
26287
|
}
|
|
26119
26288
|
}));
|
|
26120
|
-
|
|
26289
|
+
socket.addEventListener('error', (event) => {
|
|
26290
|
+
if (connectionId !== this.connectionId || socket !== this.socket) {
|
|
26291
|
+
return;
|
|
26292
|
+
}
|
|
26121
26293
|
this.stopHeartbeat();
|
|
26122
26294
|
const error = new Error('WebSocket error');
|
|
26123
26295
|
console.error('WebSocket error:', error.message);
|
|
@@ -26188,7 +26360,7 @@ class Realtime {
|
|
|
26188
26360
|
}
|
|
26189
26361
|
return String(channel);
|
|
26190
26362
|
}
|
|
26191
|
-
subscribe(channelsOrChannel, callback) {
|
|
26363
|
+
subscribe(channelsOrChannel, callback, queries = []) {
|
|
26192
26364
|
return __awaiter(this, void 0, void 0, function* () {
|
|
26193
26365
|
const channelArray = Array.isArray(channelsOrChannel)
|
|
26194
26366
|
? channelsOrChannel
|
|
@@ -26196,13 +26368,29 @@ class Realtime {
|
|
|
26196
26368
|
// Convert all channels to strings
|
|
26197
26369
|
const channelStrings = channelArray.map(ch => this.channelToString(ch));
|
|
26198
26370
|
const channels = new Set(channelStrings);
|
|
26199
|
-
|
|
26200
|
-
|
|
26201
|
-
|
|
26202
|
-
|
|
26371
|
+
// Convert queries to array of strings
|
|
26372
|
+
// Ensure each query is a separate string in the array
|
|
26373
|
+
const queryStrings = [];
|
|
26374
|
+
for (const q of (queries !== null && queries !== void 0 ? queries : [])) {
|
|
26375
|
+
if (Array.isArray(q)) {
|
|
26376
|
+
// Handle nested arrays: [[q1, q2]] -> [q1, q2]
|
|
26377
|
+
for (const inner of q) {
|
|
26378
|
+
queryStrings.push(typeof inner === 'string' ? inner : inner.toString());
|
|
26379
|
+
}
|
|
26380
|
+
}
|
|
26381
|
+
else {
|
|
26382
|
+
queryStrings.push(typeof q === 'string' ? q : q.toString());
|
|
26383
|
+
}
|
|
26203
26384
|
}
|
|
26204
|
-
|
|
26385
|
+
// Allocate a new slot index
|
|
26386
|
+
this.subscriptionsCounter++;
|
|
26387
|
+
const slot = this.subscriptionsCounter;
|
|
26388
|
+
// Store slot-centric data: channels, queries, and callback belong to the slot
|
|
26389
|
+
// queries is stored as string[] (array of query strings)
|
|
26390
|
+
// No channel mutation occurs here - channels are derived from slots in createSocket()
|
|
26391
|
+
this.activeSubscriptions.set(slot, {
|
|
26205
26392
|
channels,
|
|
26393
|
+
queries: queryStrings,
|
|
26206
26394
|
callback
|
|
26207
26395
|
});
|
|
26208
26396
|
this.subCallDepth++;
|
|
@@ -26213,23 +26401,19 @@ class Realtime {
|
|
|
26213
26401
|
this.subCallDepth--;
|
|
26214
26402
|
return {
|
|
26215
26403
|
close: () => __awaiter(this, void 0, void 0, function* () {
|
|
26216
|
-
this.
|
|
26217
|
-
this.
|
|
26404
|
+
const subscriptionId = this.slotToSubscriptionId.get(slot);
|
|
26405
|
+
this.activeSubscriptions.delete(slot);
|
|
26406
|
+
this.slotToSubscriptionId.delete(slot);
|
|
26407
|
+
if (subscriptionId) {
|
|
26408
|
+
this.subscriptionIdToSlot.delete(subscriptionId);
|
|
26409
|
+
}
|
|
26218
26410
|
yield this.createSocket();
|
|
26219
26411
|
})
|
|
26220
26412
|
};
|
|
26221
26413
|
});
|
|
26222
26414
|
}
|
|
26223
|
-
cleanUp(
|
|
26224
|
-
|
|
26225
|
-
if (!channels.has(channel)) {
|
|
26226
|
-
return true;
|
|
26227
|
-
}
|
|
26228
|
-
const subsWithChannel = Array.from(this.activeSubscriptions.values())
|
|
26229
|
-
.filter(sub => sub.channels.has(channel));
|
|
26230
|
-
return subsWithChannel.length > 0;
|
|
26231
|
-
}));
|
|
26232
|
-
}
|
|
26415
|
+
// cleanUp is no longer needed - slots are removed directly in subscribe().close()
|
|
26416
|
+
// Channels are automatically rebuilt from remaining slots in createSocket()
|
|
26233
26417
|
handleMessage(message) {
|
|
26234
26418
|
if (!message.type) {
|
|
26235
26419
|
return;
|
|
@@ -26255,6 +26439,19 @@ class Realtime {
|
|
|
26255
26439
|
return;
|
|
26256
26440
|
}
|
|
26257
26441
|
const messageData = message.data;
|
|
26442
|
+
// Store subscription ID mappings from backend
|
|
26443
|
+
// Format: { "0": "sub_a1f9", "1": "sub_b83c", ... }
|
|
26444
|
+
if (messageData.subscriptions) {
|
|
26445
|
+
this.slotToSubscriptionId.clear();
|
|
26446
|
+
this.subscriptionIdToSlot.clear();
|
|
26447
|
+
for (const [slotStr, subscriptionId] of Object.entries(messageData.subscriptions)) {
|
|
26448
|
+
const slot = Number(slotStr);
|
|
26449
|
+
if (!isNaN(slot)) {
|
|
26450
|
+
this.slotToSubscriptionId.set(slot, subscriptionId);
|
|
26451
|
+
this.subscriptionIdToSlot.set(subscriptionId, slot);
|
|
26452
|
+
}
|
|
26453
|
+
}
|
|
26454
|
+
}
|
|
26258
26455
|
let session = this.client.config.session;
|
|
26259
26456
|
if (!session) {
|
|
26260
26457
|
try {
|
|
@@ -26289,23 +26486,26 @@ class Realtime {
|
|
|
26289
26486
|
const events = data.events;
|
|
26290
26487
|
const payload = data.payload;
|
|
26291
26488
|
const timestamp = data.timestamp;
|
|
26292
|
-
|
|
26489
|
+
const subscriptions = data.subscriptions;
|
|
26490
|
+
if (!channels || !events || !payload || !subscriptions || subscriptions.length === 0) {
|
|
26293
26491
|
return;
|
|
26294
26492
|
}
|
|
26295
|
-
|
|
26296
|
-
|
|
26297
|
-
|
|
26298
|
-
|
|
26299
|
-
|
|
26300
|
-
|
|
26301
|
-
|
|
26302
|
-
|
|
26303
|
-
|
|
26304
|
-
|
|
26305
|
-
|
|
26306
|
-
|
|
26307
|
-
|
|
26308
|
-
|
|
26493
|
+
// Iterate over all matching subscriptionIds and call callback for each
|
|
26494
|
+
for (const subscriptionId of subscriptions) {
|
|
26495
|
+
// O(1) lookup using subscriptionId
|
|
26496
|
+
const slot = this.subscriptionIdToSlot.get(subscriptionId);
|
|
26497
|
+
if (slot !== undefined) {
|
|
26498
|
+
const subscription = this.activeSubscriptions.get(slot);
|
|
26499
|
+
if (subscription) {
|
|
26500
|
+
const response = {
|
|
26501
|
+
events,
|
|
26502
|
+
channels,
|
|
26503
|
+
timestamp,
|
|
26504
|
+
payload,
|
|
26505
|
+
subscriptions
|
|
26506
|
+
};
|
|
26507
|
+
subscription.callback(response);
|
|
26508
|
+
}
|
|
26309
26509
|
}
|
|
26310
26510
|
}
|
|
26311
26511
|
}
|
|
@@ -26507,8 +26707,11 @@ class Channel {
|
|
|
26507
26707
|
constructor(segments) {
|
|
26508
26708
|
this.segments = segments;
|
|
26509
26709
|
}
|
|
26510
|
-
next(segment, id
|
|
26511
|
-
|
|
26710
|
+
next(segment, id) {
|
|
26711
|
+
const segments = id === undefined
|
|
26712
|
+
? [...this.segments, segment]
|
|
26713
|
+
: [...this.segments, segment, normalize(id)];
|
|
26714
|
+
return new Channel(segments);
|
|
26512
26715
|
}
|
|
26513
26716
|
resolve(action) {
|
|
26514
26717
|
return new Channel([...this.segments, action]);
|
|
@@ -26518,28 +26721,29 @@ class Channel {
|
|
|
26518
26721
|
}
|
|
26519
26722
|
// --- DATABASE ROUTE ---
|
|
26520
26723
|
// Only available on Channel<Database>
|
|
26521
|
-
collection(id
|
|
26522
|
-
|
|
26724
|
+
collection(id) {
|
|
26725
|
+
// Default: wildcard collection ID
|
|
26726
|
+
return this.next("collections", id !== null && id !== void 0 ? id : "*");
|
|
26523
26727
|
}
|
|
26524
26728
|
// Only available on Channel<Collection>
|
|
26525
|
-
document(id
|
|
26729
|
+
document(id) {
|
|
26730
|
+
// Default: no document ID segment
|
|
26526
26731
|
return this.next("documents", id);
|
|
26527
26732
|
}
|
|
26528
26733
|
// --- TABLESDB ROUTE ---
|
|
26529
|
-
table(id
|
|
26530
|
-
|
|
26734
|
+
table(id) {
|
|
26735
|
+
// Default: wildcard table ID
|
|
26736
|
+
return this.next("tables", id !== null && id !== void 0 ? id : "*");
|
|
26531
26737
|
}
|
|
26532
|
-
row(id
|
|
26738
|
+
row(id) {
|
|
26739
|
+
// Default: no row ID segment
|
|
26533
26740
|
return this.next("rows", id);
|
|
26534
26741
|
}
|
|
26535
26742
|
// --- BUCKET ROUTE ---
|
|
26536
|
-
file(id
|
|
26743
|
+
file(id) {
|
|
26744
|
+
// Default: no file ID segment
|
|
26537
26745
|
return this.next("files", id);
|
|
26538
26746
|
}
|
|
26539
|
-
// --- FUNCTION ROUTE ---
|
|
26540
|
-
execution(id = "*") {
|
|
26541
|
-
return this.next("executions", id);
|
|
26542
|
-
}
|
|
26543
26747
|
// --- TERMINAL ACTIONS ---
|
|
26544
26748
|
// Restricted to the Actionable union
|
|
26545
26749
|
create() {
|
|
@@ -26555,6 +26759,9 @@ class Channel {
|
|
|
26555
26759
|
static database(id = "*") {
|
|
26556
26760
|
return new Channel(["databases", normalize(id)]);
|
|
26557
26761
|
}
|
|
26762
|
+
static execution(id = "*") {
|
|
26763
|
+
return new Channel(["executions", normalize(id)]);
|
|
26764
|
+
}
|
|
26558
26765
|
static tablesdb(id = "*") {
|
|
26559
26766
|
return new Channel(["tablesdb", normalize(id)]);
|
|
26560
26767
|
}
|
|
@@ -26570,9 +26777,8 @@ class Channel {
|
|
|
26570
26777
|
static membership(id = "*") {
|
|
26571
26778
|
return new Channel(["memberships", normalize(id)]);
|
|
26572
26779
|
}
|
|
26573
|
-
static account(
|
|
26574
|
-
|
|
26575
|
-
return id === "*" ? "account" : `account.${id}`;
|
|
26780
|
+
static account() {
|
|
26781
|
+
return "account";
|
|
26576
26782
|
}
|
|
26577
26783
|
// Global events
|
|
26578
26784
|
static documents() {
|
|
@@ -26590,6 +26796,9 @@ class Channel {
|
|
|
26590
26796
|
static teams() {
|
|
26591
26797
|
return "teams";
|
|
26592
26798
|
}
|
|
26799
|
+
static memberships() {
|
|
26800
|
+
return "memberships";
|
|
26801
|
+
}
|
|
26593
26802
|
}
|
|
26594
26803
|
|
|
26595
26804
|
var Condition;
|
|
@@ -26922,6 +27131,7 @@ var Scopes;
|
|
|
26922
27131
|
Scopes["RestorationsWrite"] = "restorations.write";
|
|
26923
27132
|
Scopes["DomainsRead"] = "domains.read";
|
|
26924
27133
|
Scopes["DomainsWrite"] = "domains.write";
|
|
27134
|
+
Scopes["EventsRead"] = "events.read";
|
|
26925
27135
|
})(Scopes || (Scopes = {}));
|
|
26926
27136
|
|
|
26927
27137
|
var AuthenticatorType;
|
|
@@ -27684,12 +27894,12 @@ var ImageFormat;
|
|
|
27684
27894
|
ImageFormat["Gif"] = "gif";
|
|
27685
27895
|
})(ImageFormat || (ImageFormat = {}));
|
|
27686
27896
|
|
|
27687
|
-
var
|
|
27688
|
-
(function (
|
|
27689
|
-
|
|
27690
|
-
|
|
27691
|
-
|
|
27692
|
-
})(
|
|
27897
|
+
var BackupServices;
|
|
27898
|
+
(function (BackupServices) {
|
|
27899
|
+
BackupServices["Databases"] = "databases";
|
|
27900
|
+
BackupServices["Functions"] = "functions";
|
|
27901
|
+
BackupServices["Storage"] = "storage";
|
|
27902
|
+
})(BackupServices || (BackupServices = {}));
|
|
27693
27903
|
|
|
27694
27904
|
var Platform;
|
|
27695
27905
|
(function (Platform) {
|
|
@@ -27738,6 +27948,14 @@ var OrderBy;
|
|
|
27738
27948
|
OrderBy["Desc"] = "desc";
|
|
27739
27949
|
})(OrderBy || (OrderBy = {}));
|
|
27740
27950
|
|
|
27951
|
+
var RegistrationType;
|
|
27952
|
+
(function (RegistrationType) {
|
|
27953
|
+
RegistrationType["New"] = "new";
|
|
27954
|
+
RegistrationType["Transfer"] = "transfer";
|
|
27955
|
+
RegistrationType["Renewal"] = "renewal";
|
|
27956
|
+
RegistrationType["Trade"] = "trade";
|
|
27957
|
+
})(RegistrationType || (RegistrationType = {}));
|
|
27958
|
+
|
|
27741
27959
|
var FilterType;
|
|
27742
27960
|
(function (FilterType) {
|
|
27743
27961
|
FilterType["Premium"] = "premium";
|
|
@@ -27782,6 +28000,7 @@ var Runtime;
|
|
|
27782
28000
|
Runtime["Dart35"] = "dart-3.5";
|
|
27783
28001
|
Runtime["Dart38"] = "dart-3.8";
|
|
27784
28002
|
Runtime["Dart39"] = "dart-3.9";
|
|
28003
|
+
Runtime["Dart310"] = "dart-3.10";
|
|
27785
28004
|
Runtime["Dotnet60"] = "dotnet-6.0";
|
|
27786
28005
|
Runtime["Dotnet70"] = "dotnet-7.0";
|
|
27787
28006
|
Runtime["Dotnet80"] = "dotnet-8.0";
|
|
@@ -27810,6 +28029,7 @@ var Runtime;
|
|
|
27810
28029
|
Runtime["Flutter329"] = "flutter-3.29";
|
|
27811
28030
|
Runtime["Flutter332"] = "flutter-3.32";
|
|
27812
28031
|
Runtime["Flutter335"] = "flutter-3.35";
|
|
28032
|
+
Runtime["Flutter338"] = "flutter-3.38";
|
|
27813
28033
|
})(Runtime || (Runtime = {}));
|
|
27814
28034
|
|
|
27815
28035
|
var Runtimes;
|
|
@@ -27850,6 +28070,7 @@ var Runtimes;
|
|
|
27850
28070
|
Runtimes["Dart35"] = "dart-3.5";
|
|
27851
28071
|
Runtimes["Dart38"] = "dart-3.8";
|
|
27852
28072
|
Runtimes["Dart39"] = "dart-3.9";
|
|
28073
|
+
Runtimes["Dart310"] = "dart-3.10";
|
|
27853
28074
|
Runtimes["Dotnet60"] = "dotnet-6.0";
|
|
27854
28075
|
Runtimes["Dotnet70"] = "dotnet-7.0";
|
|
27855
28076
|
Runtimes["Dotnet80"] = "dotnet-8.0";
|
|
@@ -27878,6 +28099,7 @@ var Runtimes;
|
|
|
27878
28099
|
Runtimes["Flutter329"] = "flutter-3.29";
|
|
27879
28100
|
Runtimes["Flutter332"] = "flutter-3.32";
|
|
27880
28101
|
Runtimes["Flutter335"] = "flutter-3.35";
|
|
28102
|
+
Runtimes["Flutter338"] = "flutter-3.38";
|
|
27881
28103
|
})(Runtimes || (Runtimes = {}));
|
|
27882
28104
|
|
|
27883
28105
|
var UseCases;
|
|
@@ -28045,12 +28267,6 @@ var SMTPSecure;
|
|
|
28045
28267
|
SMTPSecure["Ssl"] = "ssl";
|
|
28046
28268
|
})(SMTPSecure || (SMTPSecure = {}));
|
|
28047
28269
|
|
|
28048
|
-
var Status;
|
|
28049
|
-
(function (Status) {
|
|
28050
|
-
Status["Active"] = "active";
|
|
28051
|
-
Status["Archived"] = "archived";
|
|
28052
|
-
})(Status || (Status = {}));
|
|
28053
|
-
|
|
28054
28270
|
var EmailTemplateType;
|
|
28055
28271
|
(function (EmailTemplateType) {
|
|
28056
28272
|
EmailTemplateType["Verification"] = "verification";
|
|
@@ -28411,6 +28627,7 @@ var BuildRuntime;
|
|
|
28411
28627
|
BuildRuntime["Dart35"] = "dart-3.5";
|
|
28412
28628
|
BuildRuntime["Dart38"] = "dart-3.8";
|
|
28413
28629
|
BuildRuntime["Dart39"] = "dart-3.9";
|
|
28630
|
+
BuildRuntime["Dart310"] = "dart-3.10";
|
|
28414
28631
|
BuildRuntime["Dotnet60"] = "dotnet-6.0";
|
|
28415
28632
|
BuildRuntime["Dotnet70"] = "dotnet-7.0";
|
|
28416
28633
|
BuildRuntime["Dotnet80"] = "dotnet-8.0";
|
|
@@ -28439,6 +28656,7 @@ var BuildRuntime;
|
|
|
28439
28656
|
BuildRuntime["Flutter329"] = "flutter-3.29";
|
|
28440
28657
|
BuildRuntime["Flutter332"] = "flutter-3.32";
|
|
28441
28658
|
BuildRuntime["Flutter335"] = "flutter-3.35";
|
|
28659
|
+
BuildRuntime["Flutter338"] = "flutter-3.38";
|
|
28442
28660
|
})(BuildRuntime || (BuildRuntime = {}));
|
|
28443
28661
|
|
|
28444
28662
|
var Adapter;
|
|
@@ -28486,15 +28704,6 @@ var ImageGravity;
|
|
|
28486
28704
|
ImageGravity["Bottomright"] = "bottom-right";
|
|
28487
28705
|
})(ImageGravity || (ImageGravity = {}));
|
|
28488
28706
|
|
|
28489
|
-
var Roles;
|
|
28490
|
-
(function (Roles) {
|
|
28491
|
-
Roles["Developer"] = "developer";
|
|
28492
|
-
Roles["Editor"] = "editor";
|
|
28493
|
-
Roles["Analyst"] = "analyst";
|
|
28494
|
-
Roles["Billing"] = "billing";
|
|
28495
|
-
Roles["Owner"] = "owner";
|
|
28496
|
-
})(Roles || (Roles = {}));
|
|
28497
|
-
|
|
28498
28707
|
var PasswordHash;
|
|
28499
28708
|
(function (PasswordHash) {
|
|
28500
28709
|
PasswordHash["Sha1"] = "sha1";
|
|
@@ -28625,5 +28834,5 @@ var BillingPlanGroup;
|
|
|
28625
28834
|
BillingPlanGroup["Scale"] = "scale";
|
|
28626
28835
|
})(BillingPlanGroup || (BillingPlanGroup = {}));
|
|
28627
28836
|
|
|
28628
|
-
export { Account, Adapter, Api, ApiService, AppwriteException, Assistant, AttributeStatus, AuthMethod, AuthenticationFactor, AuthenticatorType, Avatars, Backups, BillingPlanGroup, Browser, BrowserPermission, BuildRuntime, Channel, Client, ColumnStatus, Compression, Condition, Console, ConsoleResourceType, CreditCard, DatabaseType, Databases, DeploymentDownloadType, DeploymentStatus, Domains, EmailTemplateLocale, EmailTemplateType, ExecutionMethod, ExecutionStatus, ExecutionTrigger, FilterType, Flag, Framework, Frameworks, Functions, Graphql, Health, HealthAntivirusStatus, HealthCheckStatus, ID, ImageFormat, ImageGravity, IndexStatus, IndexType, Locale, MessagePriority, MessageStatus, Messaging, MessagingProviderType, Migrations, Name, OAuthProvider, Operator, OrderBy, Organizations, PasswordHash, Permission, Platform, PlatformType, Project, ProjectUsageRange, Projects, Proxy, ProxyResourceType, ProxyRuleDeploymentResourceType, ProxyRuleStatus, Query, Realtime, Region, RelationMutate, RelationshipType, Resources, Role,
|
|
28837
|
+
export { Account, Activities, Adapter, Api, ApiService, AppwriteException, Assistant, AttributeStatus, AuthMethod, AuthenticationFactor, AuthenticatorType, Avatars, BackupServices, Backups, BillingPlanGroup, Browser, BrowserPermission, BuildRuntime, Channel, Client, ColumnStatus, Compression, Condition, Console, ConsoleResourceType, CreditCard, DatabaseType, Databases, DeploymentDownloadType, DeploymentStatus, Domains, EmailTemplateLocale, EmailTemplateType, ExecutionMethod, ExecutionStatus, ExecutionTrigger, FilterType, Flag, Framework, Frameworks, Functions, Graphql, Health, HealthAntivirusStatus, HealthCheckStatus, ID, ImageFormat, ImageGravity, IndexStatus, IndexType, Locale, MessagePriority, MessageStatus, Messaging, MessagingProviderType, Migrations, Name, OAuthProvider, Operator, OrderBy, Organizations, PasswordHash, Permission, Platform, PlatformType, Project, ProjectUsageRange, Projects, Proxy, ProxyResourceType, ProxyRuleDeploymentResourceType, ProxyRuleStatus, Query, Realtime, Region, RegistrationType, RelationMutate, RelationshipType, Resources, Role, Runtime, Runtimes, SMTPSecure, Scopes, Sites, SmsTemplateLocale, SmsTemplateType, SmtpEncryption, StatusCode, Storage, TablesDB, Teams, TemplateReferenceType, Theme, Timezone, Tokens, UsageRange, UseCases, Users, VCSDetectionType, VCSReferenceType, Vcs };
|
|
28629
28838
|
//# sourceMappingURL=sdk.js.map
|