@appwrite.io/console 2.2.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/README.md +1 -1
- package/dist/cjs/sdk.js +326 -194
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +327 -195
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +326 -194
- 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/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 +2 -0
- package/docs/examples/databases/create-mediumtext-attribute.md +2 -0
- 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 +2 -0
- 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 +2 -0
- 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 +2 -0
- package/docs/examples/tablesdb/create-mediumtext-column.md +2 -0
- 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 +2 -0
- 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 +2 -0
- 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 +5 -0
- package/src/enums/registration-type.ts +6 -0
- package/src/enums/runtime.ts +5 -0
- package/src/enums/runtimes.ts +5 -0
- package/src/enums/scopes.ts +1 -0
- package/src/index.ts +2 -3
- package/src/models.ts +45 -3
- package/src/services/account.ts +11 -11
- 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 +1 -1
- 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 +8 -8
- 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 +1 -1
- 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 +6 -1
- package/types/enums/registration-type.d.ts +6 -0
- package/types/enums/runtime.d.ts +6 -1
- package/types/enums/runtimes.d.ts +6 -1
- package/types/enums/scopes.d.ts +2 -1
- package/types/index.d.ts +2 -3
- package/types/models.d.ts +44 -3
- package/types/services/backups.d.ts +13 -13
- package/types/services/domains.d.ts +26 -0
- 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/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/cjs/sdk.js
CHANGED
|
@@ -541,7 +541,7 @@ class Client {
|
|
|
541
541
|
'x-sdk-name': 'Console',
|
|
542
542
|
'x-sdk-platform': 'console',
|
|
543
543
|
'x-sdk-language': 'web',
|
|
544
|
-
'x-sdk-version': '2.
|
|
544
|
+
'x-sdk-version': '2.3.0',
|
|
545
545
|
'X-Appwrite-Response-Format': '1.8.0',
|
|
546
546
|
};
|
|
547
547
|
this.realtime = {
|
|
@@ -550,7 +550,10 @@ class Client {
|
|
|
550
550
|
heartbeat: undefined,
|
|
551
551
|
url: '',
|
|
552
552
|
channels: new Set(),
|
|
553
|
+
queries: new Set(),
|
|
553
554
|
subscriptions: new Map(),
|
|
555
|
+
slotToSubscriptionId: new Map(),
|
|
556
|
+
subscriptionIdToSlot: new Map(),
|
|
554
557
|
subscriptionsCounter: 0,
|
|
555
558
|
reconnect: true,
|
|
556
559
|
reconnectAttempts: 0,
|
|
@@ -585,26 +588,34 @@ class Client {
|
|
|
585
588
|
}, 20000);
|
|
586
589
|
},
|
|
587
590
|
createSocket: () => {
|
|
588
|
-
var _a, _b, _c;
|
|
589
|
-
if (this.realtime.
|
|
591
|
+
var _a, _b, _c, _d;
|
|
592
|
+
if (this.realtime.subscriptions.size < 1) {
|
|
590
593
|
this.realtime.reconnect = false;
|
|
591
594
|
(_a = this.realtime.socket) === null || _a === void 0 ? void 0 : _a.close();
|
|
592
595
|
return;
|
|
593
596
|
}
|
|
594
|
-
const
|
|
595
|
-
|
|
596
|
-
channels.set('project', this.config.project);
|
|
597
|
-
}
|
|
597
|
+
const encodedProject = encodeURIComponent((_b = this.config.project) !== null && _b !== void 0 ? _b : '');
|
|
598
|
+
let queryParams = 'project=' + encodedProject;
|
|
598
599
|
this.realtime.channels.forEach(channel => {
|
|
599
|
-
|
|
600
|
+
queryParams += '&channels[]=' + encodeURIComponent(channel);
|
|
600
601
|
});
|
|
601
|
-
|
|
602
|
+
// Per-subscription queries: channel[slot][]=query so server can route events by subscription
|
|
603
|
+
const selectAllQuery = Query.select(['*']).toString();
|
|
604
|
+
this.realtime.subscriptions.forEach((sub, slot) => {
|
|
605
|
+
const queries = sub.queries.length > 0 ? sub.queries : [selectAllQuery];
|
|
606
|
+
sub.channels.forEach(channel => {
|
|
607
|
+
queries.forEach(query => {
|
|
608
|
+
queryParams += '&' + encodeURIComponent(channel) + '[' + slot + '][]=' + encodeURIComponent(query);
|
|
609
|
+
});
|
|
610
|
+
});
|
|
611
|
+
});
|
|
612
|
+
const url = this.config.endpointRealtime + '/realtime?' + queryParams;
|
|
602
613
|
if (url !== this.realtime.url || // Check if URL is present
|
|
603
614
|
!this.realtime.socket || // Check if WebSocket has not been created
|
|
604
|
-
((
|
|
615
|
+
((_c = this.realtime.socket) === null || _c === void 0 ? void 0 : _c.readyState) > WebSocket.OPEN // Check if WebSocket is CLOSING (3) or CLOSED (4)
|
|
605
616
|
) {
|
|
606
617
|
if (this.realtime.socket &&
|
|
607
|
-
((
|
|
618
|
+
((_d = this.realtime.socket) === null || _d === void 0 ? void 0 : _d.readyState) < WebSocket.CLOSING // Close WebSocket if it is CONNECTING (0) or OPEN (1)
|
|
608
619
|
) {
|
|
609
620
|
this.realtime.reconnect = false;
|
|
610
621
|
this.realtime.socket.close();
|
|
@@ -640,14 +651,25 @@ class Client {
|
|
|
640
651
|
const message = JSONbig.parse(event.data);
|
|
641
652
|
this.realtime.lastMessage = message;
|
|
642
653
|
switch (message.type) {
|
|
643
|
-
case 'connected':
|
|
654
|
+
case 'connected': {
|
|
655
|
+
const messageData = message.data;
|
|
656
|
+
if (messageData === null || messageData === void 0 ? void 0 : messageData.subscriptions) {
|
|
657
|
+
this.realtime.slotToSubscriptionId.clear();
|
|
658
|
+
this.realtime.subscriptionIdToSlot.clear();
|
|
659
|
+
for (const [slotStr, subscriptionId] of Object.entries(messageData.subscriptions)) {
|
|
660
|
+
const slot = Number(slotStr);
|
|
661
|
+
if (!isNaN(slot) && typeof subscriptionId === 'string') {
|
|
662
|
+
this.realtime.slotToSubscriptionId.set(slot, subscriptionId);
|
|
663
|
+
this.realtime.subscriptionIdToSlot.set(subscriptionId, slot);
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
}
|
|
644
667
|
let session = this.config.session;
|
|
645
668
|
if (!session) {
|
|
646
669
|
const cookie = JSONbig.parse((_a = window.localStorage.getItem('cookieFallback')) !== null && _a !== void 0 ? _a : '{}');
|
|
647
670
|
session = cookie === null || cookie === void 0 ? void 0 : cookie[`a_session_${this.config.project}`];
|
|
648
671
|
}
|
|
649
|
-
|
|
650
|
-
if (session && !messageData.user) {
|
|
672
|
+
if (session && !(messageData === null || messageData === void 0 ? void 0 : messageData.user)) {
|
|
651
673
|
(_b = this.realtime.socket) === null || _b === void 0 ? void 0 : _b.send(JSONbig.stringify({
|
|
652
674
|
type: 'authentication',
|
|
653
675
|
data: {
|
|
@@ -656,12 +678,27 @@ class Client {
|
|
|
656
678
|
}));
|
|
657
679
|
}
|
|
658
680
|
break;
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
681
|
+
}
|
|
682
|
+
case 'event': {
|
|
683
|
+
const data = message.data;
|
|
684
|
+
if (!(data === null || data === void 0 ? void 0 : data.channels))
|
|
685
|
+
break;
|
|
686
|
+
const eventSubIds = data.subscriptions;
|
|
687
|
+
if (eventSubIds && eventSubIds.length > 0) {
|
|
688
|
+
for (const subscriptionId of eventSubIds) {
|
|
689
|
+
const slot = this.realtime.subscriptionIdToSlot.get(subscriptionId);
|
|
690
|
+
if (slot !== undefined) {
|
|
691
|
+
const subscription = this.realtime.subscriptions.get(slot);
|
|
692
|
+
if (subscription) {
|
|
693
|
+
setTimeout(() => subscription.callback(data));
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
else {
|
|
662
699
|
const isSubscribed = data.channels.some(channel => this.realtime.channels.has(channel));
|
|
663
700
|
if (!isSubscribed)
|
|
664
|
-
|
|
701
|
+
break;
|
|
665
702
|
this.realtime.subscriptions.forEach(subscription => {
|
|
666
703
|
if (data.channels.some(channel => subscription.channels.includes(channel))) {
|
|
667
704
|
setTimeout(() => subscription.callback(data));
|
|
@@ -669,6 +706,7 @@ class Client {
|
|
|
669
706
|
});
|
|
670
707
|
}
|
|
671
708
|
break;
|
|
709
|
+
}
|
|
672
710
|
case 'pong':
|
|
673
711
|
break; // Handle pong response if needed
|
|
674
712
|
case 'error':
|
|
@@ -681,7 +719,7 @@ class Client {
|
|
|
681
719
|
console.error(e);
|
|
682
720
|
}
|
|
683
721
|
},
|
|
684
|
-
cleanUp: channels => {
|
|
722
|
+
cleanUp: (channels, queries) => {
|
|
685
723
|
this.realtime.channels.forEach(channel => {
|
|
686
724
|
if (channels.includes(channel)) {
|
|
687
725
|
let found = Array.from(this.realtime.subscriptions).some(([_key, subscription]) => {
|
|
@@ -692,6 +730,17 @@ class Client {
|
|
|
692
730
|
}
|
|
693
731
|
}
|
|
694
732
|
});
|
|
733
|
+
this.realtime.queries.forEach(query => {
|
|
734
|
+
if (queries.includes(query)) {
|
|
735
|
+
let found = Array.from(this.realtime.subscriptions).some(([_key, subscription]) => {
|
|
736
|
+
var _a;
|
|
737
|
+
return (_a = subscription.queries) === null || _a === void 0 ? void 0 : _a.includes(query);
|
|
738
|
+
});
|
|
739
|
+
if (!found) {
|
|
740
|
+
this.realtime.queries.delete(query);
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
});
|
|
695
744
|
}
|
|
696
745
|
};
|
|
697
746
|
}
|
|
@@ -872,7 +921,7 @@ class Client {
|
|
|
872
921
|
* @param {(payload: RealtimeMessage) => void} callback Is called on every realtime update.
|
|
873
922
|
* @returns {() => void} Unsubscribes from events.
|
|
874
923
|
*/
|
|
875
|
-
subscribe(channels, callback) {
|
|
924
|
+
subscribe(channels, callback, queries = []) {
|
|
876
925
|
const channelArray = Array.isArray(channels) ? channels : [channels];
|
|
877
926
|
// Convert Channel instances to strings
|
|
878
927
|
const channelStrings = channelArray.map(ch => {
|
|
@@ -887,15 +936,18 @@ class Client {
|
|
|
887
936
|
return String(ch);
|
|
888
937
|
});
|
|
889
938
|
channelStrings.forEach(channel => this.realtime.channels.add(channel));
|
|
939
|
+
const queryStrings = (queries !== null && queries !== void 0 ? queries : []).map(q => typeof q === 'string' ? q : q.toString());
|
|
940
|
+
queryStrings.forEach(query => this.realtime.queries.add(query));
|
|
890
941
|
const counter = this.realtime.subscriptionsCounter++;
|
|
891
942
|
this.realtime.subscriptions.set(counter, {
|
|
892
943
|
channels: channelStrings,
|
|
944
|
+
queries: queryStrings,
|
|
893
945
|
callback
|
|
894
946
|
});
|
|
895
947
|
this.realtime.connect();
|
|
896
948
|
return () => {
|
|
897
949
|
this.realtime.subscriptions.delete(counter);
|
|
898
|
-
this.realtime.cleanUp(channelStrings);
|
|
950
|
+
this.realtime.cleanUp(channelStrings, queryStrings);
|
|
899
951
|
this.realtime.connect();
|
|
900
952
|
};
|
|
901
953
|
}
|
|
@@ -1667,7 +1719,7 @@ class Account {
|
|
|
1667
1719
|
}
|
|
1668
1720
|
createMfaAuthenticator(paramsOrFirst) {
|
|
1669
1721
|
let params;
|
|
1670
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) {
|
|
1722
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('type' in paramsOrFirst))) {
|
|
1671
1723
|
params = (paramsOrFirst || {});
|
|
1672
1724
|
}
|
|
1673
1725
|
else {
|
|
@@ -1689,7 +1741,7 @@ class Account {
|
|
|
1689
1741
|
}
|
|
1690
1742
|
createMFAAuthenticator(paramsOrFirst) {
|
|
1691
1743
|
let params;
|
|
1692
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) {
|
|
1744
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('type' in paramsOrFirst))) {
|
|
1693
1745
|
params = (paramsOrFirst || {});
|
|
1694
1746
|
}
|
|
1695
1747
|
else {
|
|
@@ -1711,7 +1763,7 @@ class Account {
|
|
|
1711
1763
|
}
|
|
1712
1764
|
updateMfaAuthenticator(paramsOrFirst, ...rest) {
|
|
1713
1765
|
let params;
|
|
1714
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) {
|
|
1766
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('type' in paramsOrFirst || 'otp' in paramsOrFirst))) {
|
|
1715
1767
|
params = (paramsOrFirst || {});
|
|
1716
1768
|
}
|
|
1717
1769
|
else {
|
|
@@ -1741,7 +1793,7 @@ class Account {
|
|
|
1741
1793
|
}
|
|
1742
1794
|
updateMFAAuthenticator(paramsOrFirst, ...rest) {
|
|
1743
1795
|
let params;
|
|
1744
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) {
|
|
1796
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('type' in paramsOrFirst || 'otp' in paramsOrFirst))) {
|
|
1745
1797
|
params = (paramsOrFirst || {});
|
|
1746
1798
|
}
|
|
1747
1799
|
else {
|
|
@@ -1771,7 +1823,7 @@ class Account {
|
|
|
1771
1823
|
}
|
|
1772
1824
|
deleteMfaAuthenticator(paramsOrFirst) {
|
|
1773
1825
|
let params;
|
|
1774
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) {
|
|
1826
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('type' in paramsOrFirst))) {
|
|
1775
1827
|
params = (paramsOrFirst || {});
|
|
1776
1828
|
}
|
|
1777
1829
|
else {
|
|
@@ -1793,7 +1845,7 @@ class Account {
|
|
|
1793
1845
|
}
|
|
1794
1846
|
deleteMFAAuthenticator(paramsOrFirst) {
|
|
1795
1847
|
let params;
|
|
1796
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) {
|
|
1848
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('type' in paramsOrFirst))) {
|
|
1797
1849
|
params = (paramsOrFirst || {});
|
|
1798
1850
|
}
|
|
1799
1851
|
else {
|
|
@@ -1815,7 +1867,7 @@ class Account {
|
|
|
1815
1867
|
}
|
|
1816
1868
|
createMfaChallenge(paramsOrFirst) {
|
|
1817
1869
|
let params;
|
|
1818
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'factor' in paramsOrFirst)) {
|
|
1870
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('factor' in paramsOrFirst))) {
|
|
1819
1871
|
params = (paramsOrFirst || {});
|
|
1820
1872
|
}
|
|
1821
1873
|
else {
|
|
@@ -1840,7 +1892,7 @@ class Account {
|
|
|
1840
1892
|
}
|
|
1841
1893
|
createMFAChallenge(paramsOrFirst) {
|
|
1842
1894
|
let params;
|
|
1843
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'factor' in paramsOrFirst)) {
|
|
1895
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('factor' in paramsOrFirst))) {
|
|
1844
1896
|
params = (paramsOrFirst || {});
|
|
1845
1897
|
}
|
|
1846
1898
|
else {
|
|
@@ -2333,7 +2385,7 @@ class Account {
|
|
|
2333
2385
|
}
|
|
2334
2386
|
updatePrefs(paramsOrFirst) {
|
|
2335
2387
|
let params;
|
|
2336
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'prefs' in paramsOrFirst)) {
|
|
2388
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('prefs' in paramsOrFirst))) {
|
|
2337
2389
|
params = (paramsOrFirst || {});
|
|
2338
2390
|
}
|
|
2339
2391
|
else {
|
|
@@ -2541,7 +2593,7 @@ class Account {
|
|
|
2541
2593
|
}
|
|
2542
2594
|
createOAuth2Session(paramsOrFirst, ...rest) {
|
|
2543
2595
|
let params;
|
|
2544
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'provider' in paramsOrFirst)) {
|
|
2596
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('provider' in paramsOrFirst || 'success' in paramsOrFirst || 'failure' in paramsOrFirst || 'scopes' in paramsOrFirst))) {
|
|
2545
2597
|
params = (paramsOrFirst || {});
|
|
2546
2598
|
}
|
|
2547
2599
|
else {
|
|
@@ -2901,7 +2953,7 @@ class Account {
|
|
|
2901
2953
|
}
|
|
2902
2954
|
createOAuth2Token(paramsOrFirst, ...rest) {
|
|
2903
2955
|
let params;
|
|
2904
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'provider' in paramsOrFirst)) {
|
|
2956
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('provider' in paramsOrFirst || 'success' in paramsOrFirst || 'failure' in paramsOrFirst || 'scopes' in paramsOrFirst))) {
|
|
2905
2957
|
params = (paramsOrFirst || {});
|
|
2906
2958
|
}
|
|
2907
2959
|
else {
|
|
@@ -3148,7 +3200,7 @@ class Avatars {
|
|
|
3148
3200
|
}
|
|
3149
3201
|
getBrowser(paramsOrFirst, ...rest) {
|
|
3150
3202
|
let params;
|
|
3151
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) {
|
|
3203
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('code' in paramsOrFirst || 'width' in paramsOrFirst || 'height' in paramsOrFirst || 'quality' in paramsOrFirst))) {
|
|
3152
3204
|
params = (paramsOrFirst || {});
|
|
3153
3205
|
}
|
|
3154
3206
|
else {
|
|
@@ -3186,7 +3238,7 @@ class Avatars {
|
|
|
3186
3238
|
}
|
|
3187
3239
|
getCreditCard(paramsOrFirst, ...rest) {
|
|
3188
3240
|
let params;
|
|
3189
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) {
|
|
3241
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('code' in paramsOrFirst || 'width' in paramsOrFirst || 'height' in paramsOrFirst || 'quality' in paramsOrFirst))) {
|
|
3190
3242
|
params = (paramsOrFirst || {});
|
|
3191
3243
|
}
|
|
3192
3244
|
else {
|
|
@@ -3250,7 +3302,7 @@ class Avatars {
|
|
|
3250
3302
|
}
|
|
3251
3303
|
getFlag(paramsOrFirst, ...rest) {
|
|
3252
3304
|
let params;
|
|
3253
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) {
|
|
3305
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('code' in paramsOrFirst || 'width' in paramsOrFirst || 'height' in paramsOrFirst || 'quality' in paramsOrFirst))) {
|
|
3254
3306
|
params = (paramsOrFirst || {});
|
|
3255
3307
|
}
|
|
3256
3308
|
else {
|
|
@@ -3550,7 +3602,7 @@ class Backups {
|
|
|
3550
3602
|
}
|
|
3551
3603
|
createArchive(paramsOrFirst, ...rest) {
|
|
3552
3604
|
let params;
|
|
3553
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'services' in paramsOrFirst)) {
|
|
3605
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('services' in paramsOrFirst || 'resourceId' in paramsOrFirst))) {
|
|
3554
3606
|
params = (paramsOrFirst || {});
|
|
3555
3607
|
}
|
|
3556
3608
|
else {
|
|
@@ -3950,7 +4002,7 @@ class Console {
|
|
|
3950
4002
|
}
|
|
3951
4003
|
getPlans(paramsOrFirst) {
|
|
3952
4004
|
let params;
|
|
3953
|
-
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'platform' in paramsOrFirst)) {
|
|
4005
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('platform' in paramsOrFirst))) {
|
|
3954
4006
|
params = (paramsOrFirst || {});
|
|
3955
4007
|
}
|
|
3956
4008
|
else {
|
|
@@ -4435,7 +4487,7 @@ class Databases {
|
|
|
4435
4487
|
}
|
|
4436
4488
|
listUsage(paramsOrFirst) {
|
|
4437
4489
|
let params;
|
|
4438
|
-
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'range' in paramsOrFirst)) {
|
|
4490
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) {
|
|
4439
4491
|
params = (paramsOrFirst || {});
|
|
4440
4492
|
}
|
|
4441
4493
|
else {
|
|
@@ -7579,6 +7631,39 @@ class Domains {
|
|
|
7579
7631
|
};
|
|
7580
7632
|
return this.client.call('post', uri, apiHeaders, payload);
|
|
7581
7633
|
}
|
|
7634
|
+
getPrice(paramsOrFirst, ...rest) {
|
|
7635
|
+
let params;
|
|
7636
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
7637
|
+
params = (paramsOrFirst || {});
|
|
7638
|
+
}
|
|
7639
|
+
else {
|
|
7640
|
+
params = {
|
|
7641
|
+
domain: paramsOrFirst,
|
|
7642
|
+
periodYears: rest[0],
|
|
7643
|
+
registrationType: rest[1]
|
|
7644
|
+
};
|
|
7645
|
+
}
|
|
7646
|
+
const domain = params.domain;
|
|
7647
|
+
const periodYears = params.periodYears;
|
|
7648
|
+
const registrationType = params.registrationType;
|
|
7649
|
+
if (typeof domain === 'undefined') {
|
|
7650
|
+
throw new AppwriteException('Missing required parameter: "domain"');
|
|
7651
|
+
}
|
|
7652
|
+
const apiPath = '/domains/price';
|
|
7653
|
+
const payload = {};
|
|
7654
|
+
if (typeof domain !== 'undefined') {
|
|
7655
|
+
payload['domain'] = domain;
|
|
7656
|
+
}
|
|
7657
|
+
if (typeof periodYears !== 'undefined') {
|
|
7658
|
+
payload['periodYears'] = periodYears;
|
|
7659
|
+
}
|
|
7660
|
+
if (typeof registrationType !== 'undefined') {
|
|
7661
|
+
payload['registrationType'] = registrationType;
|
|
7662
|
+
}
|
|
7663
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
7664
|
+
const apiHeaders = {};
|
|
7665
|
+
return this.client.call('get', uri, apiHeaders, payload);
|
|
7666
|
+
}
|
|
7582
7667
|
listSuggestions(paramsOrFirst, ...rest) {
|
|
7583
7668
|
let params;
|
|
7584
7669
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
@@ -9411,7 +9496,7 @@ class Functions {
|
|
|
9411
9496
|
}
|
|
9412
9497
|
listTemplates(paramsOrFirst, ...rest) {
|
|
9413
9498
|
let params;
|
|
9414
|
-
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'runtimes' in paramsOrFirst)) {
|
|
9499
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('runtimes' in paramsOrFirst || 'useCases' in paramsOrFirst || 'limit' in paramsOrFirst || 'offset' in paramsOrFirst || 'total' in paramsOrFirst))) {
|
|
9415
9500
|
params = (paramsOrFirst || {});
|
|
9416
9501
|
}
|
|
9417
9502
|
else {
|
|
@@ -9471,7 +9556,7 @@ class Functions {
|
|
|
9471
9556
|
}
|
|
9472
9557
|
listUsage(paramsOrFirst) {
|
|
9473
9558
|
let params;
|
|
9474
|
-
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'range' in paramsOrFirst)) {
|
|
9559
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) {
|
|
9475
9560
|
params = (paramsOrFirst || {});
|
|
9476
9561
|
}
|
|
9477
9562
|
else {
|
|
@@ -10341,7 +10426,7 @@ class Graphql {
|
|
|
10341
10426
|
}
|
|
10342
10427
|
query(paramsOrFirst) {
|
|
10343
10428
|
let params;
|
|
10344
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'query' in paramsOrFirst)) {
|
|
10429
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('query' in paramsOrFirst))) {
|
|
10345
10430
|
params = (paramsOrFirst || {});
|
|
10346
10431
|
}
|
|
10347
10432
|
else {
|
|
@@ -10367,7 +10452,7 @@ class Graphql {
|
|
|
10367
10452
|
}
|
|
10368
10453
|
mutation(paramsOrFirst) {
|
|
10369
10454
|
let params;
|
|
10370
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'query' in paramsOrFirst)) {
|
|
10455
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('query' in paramsOrFirst))) {
|
|
10371
10456
|
params = (paramsOrFirst || {});
|
|
10372
10457
|
}
|
|
10373
10458
|
else {
|
|
@@ -10649,7 +10734,7 @@ class Health {
|
|
|
10649
10734
|
}
|
|
10650
10735
|
getFailedJobs(paramsOrFirst, ...rest) {
|
|
10651
10736
|
let params;
|
|
10652
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'name' in paramsOrFirst)) {
|
|
10737
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('name' in paramsOrFirst || 'threshold' in paramsOrFirst))) {
|
|
10653
10738
|
params = (paramsOrFirst || {});
|
|
10654
10739
|
}
|
|
10655
10740
|
else {
|
|
@@ -13884,7 +13969,7 @@ class Migrations {
|
|
|
13884
13969
|
}
|
|
13885
13970
|
createAppwriteMigration(paramsOrFirst, ...rest) {
|
|
13886
13971
|
let params;
|
|
13887
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
|
|
13972
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('resources' in paramsOrFirst || 'endpoint' in paramsOrFirst || 'projectId' in paramsOrFirst || 'apiKey' in paramsOrFirst))) {
|
|
13888
13973
|
params = (paramsOrFirst || {});
|
|
13889
13974
|
}
|
|
13890
13975
|
else {
|
|
@@ -13933,7 +14018,7 @@ class Migrations {
|
|
|
13933
14018
|
}
|
|
13934
14019
|
getAppwriteReport(paramsOrFirst, ...rest) {
|
|
13935
14020
|
let params;
|
|
13936
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
|
|
14021
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('resources' in paramsOrFirst || 'endpoint' in paramsOrFirst || 'projectID' in paramsOrFirst || 'key' in paramsOrFirst))) {
|
|
13937
14022
|
params = (paramsOrFirst || {});
|
|
13938
14023
|
}
|
|
13939
14024
|
else {
|
|
@@ -14094,7 +14179,7 @@ class Migrations {
|
|
|
14094
14179
|
}
|
|
14095
14180
|
createFirebaseMigration(paramsOrFirst, ...rest) {
|
|
14096
14181
|
let params;
|
|
14097
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
|
|
14182
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('resources' in paramsOrFirst || 'serviceAccount' in paramsOrFirst))) {
|
|
14098
14183
|
params = (paramsOrFirst || {});
|
|
14099
14184
|
}
|
|
14100
14185
|
else {
|
|
@@ -14127,7 +14212,7 @@ class Migrations {
|
|
|
14127
14212
|
}
|
|
14128
14213
|
getFirebaseReport(paramsOrFirst, ...rest) {
|
|
14129
14214
|
let params;
|
|
14130
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
|
|
14215
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('resources' in paramsOrFirst || 'serviceAccount' in paramsOrFirst))) {
|
|
14131
14216
|
params = (paramsOrFirst || {});
|
|
14132
14217
|
}
|
|
14133
14218
|
else {
|
|
@@ -14158,7 +14243,7 @@ class Migrations {
|
|
|
14158
14243
|
}
|
|
14159
14244
|
createNHostMigration(paramsOrFirst, ...rest) {
|
|
14160
14245
|
let params;
|
|
14161
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
|
|
14246
|
+
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))) {
|
|
14162
14247
|
params = (paramsOrFirst || {});
|
|
14163
14248
|
}
|
|
14164
14249
|
else {
|
|
@@ -14236,7 +14321,7 @@ class Migrations {
|
|
|
14236
14321
|
}
|
|
14237
14322
|
getNHostReport(paramsOrFirst, ...rest) {
|
|
14238
14323
|
let params;
|
|
14239
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
|
|
14324
|
+
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))) {
|
|
14240
14325
|
params = (paramsOrFirst || {});
|
|
14241
14326
|
}
|
|
14242
14327
|
else {
|
|
@@ -14312,7 +14397,7 @@ class Migrations {
|
|
|
14312
14397
|
}
|
|
14313
14398
|
createSupabaseMigration(paramsOrFirst, ...rest) {
|
|
14314
14399
|
let params;
|
|
14315
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
|
|
14400
|
+
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))) {
|
|
14316
14401
|
params = (paramsOrFirst || {});
|
|
14317
14402
|
}
|
|
14318
14403
|
else {
|
|
@@ -14382,7 +14467,7 @@ class Migrations {
|
|
|
14382
14467
|
}
|
|
14383
14468
|
getSupabaseReport(paramsOrFirst, ...rest) {
|
|
14384
14469
|
let params;
|
|
14385
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
|
|
14470
|
+
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))) {
|
|
14386
14471
|
params = (paramsOrFirst || {});
|
|
14387
14472
|
}
|
|
14388
14473
|
else {
|
|
@@ -15665,33 +15750,6 @@ class Organizations {
|
|
|
15665
15750
|
};
|
|
15666
15751
|
return this.client.call('patch', uri, apiHeaders, payload);
|
|
15667
15752
|
}
|
|
15668
|
-
updateProjects(paramsOrFirst, ...rest) {
|
|
15669
|
-
let params;
|
|
15670
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
15671
|
-
params = (paramsOrFirst || {});
|
|
15672
|
-
}
|
|
15673
|
-
else {
|
|
15674
|
-
params = {
|
|
15675
|
-
organizationId: paramsOrFirst,
|
|
15676
|
-
projects: rest[0]
|
|
15677
|
-
};
|
|
15678
|
-
}
|
|
15679
|
-
const organizationId = params.organizationId;
|
|
15680
|
-
const projects = params.projects;
|
|
15681
|
-
if (typeof organizationId === 'undefined') {
|
|
15682
|
-
throw new AppwriteException('Missing required parameter: "organizationId"');
|
|
15683
|
-
}
|
|
15684
|
-
const apiPath = '/organizations/{organizationId}/projects'.replace('{organizationId}', organizationId);
|
|
15685
|
-
const payload = {};
|
|
15686
|
-
if (typeof projects !== 'undefined') {
|
|
15687
|
-
payload['projects'] = projects;
|
|
15688
|
-
}
|
|
15689
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
15690
|
-
const apiHeaders = {
|
|
15691
|
-
'content-type': 'application/json',
|
|
15692
|
-
};
|
|
15693
|
-
return this.client.call('patch', uri, apiHeaders, payload);
|
|
15694
|
-
}
|
|
15695
15753
|
listRegions(paramsOrFirst) {
|
|
15696
15754
|
let params;
|
|
15697
15755
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
@@ -16926,16 +16984,21 @@ class Projects {
|
|
|
16926
16984
|
else {
|
|
16927
16985
|
params = {
|
|
16928
16986
|
projectId: paramsOrFirst,
|
|
16929
|
-
|
|
16987
|
+
queries: rest[0],
|
|
16988
|
+
total: rest[1]
|
|
16930
16989
|
};
|
|
16931
16990
|
}
|
|
16932
16991
|
const projectId = params.projectId;
|
|
16992
|
+
const queries = params.queries;
|
|
16933
16993
|
const total = params.total;
|
|
16934
16994
|
if (typeof projectId === 'undefined') {
|
|
16935
16995
|
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
16936
16996
|
}
|
|
16937
16997
|
const apiPath = '/projects/{projectId}/keys'.replace('{projectId}', projectId);
|
|
16938
16998
|
const payload = {};
|
|
16999
|
+
if (typeof queries !== 'undefined') {
|
|
17000
|
+
payload['queries'] = queries;
|
|
17001
|
+
}
|
|
16939
17002
|
if (typeof total !== 'undefined') {
|
|
16940
17003
|
payload['total'] = total;
|
|
16941
17004
|
}
|
|
@@ -16953,12 +17016,14 @@ class Projects {
|
|
|
16953
17016
|
projectId: paramsOrFirst,
|
|
16954
17017
|
name: rest[0],
|
|
16955
17018
|
scopes: rest[1],
|
|
16956
|
-
|
|
17019
|
+
keyId: rest[2],
|
|
17020
|
+
expire: rest[3]
|
|
16957
17021
|
};
|
|
16958
17022
|
}
|
|
16959
17023
|
const projectId = params.projectId;
|
|
16960
17024
|
const name = params.name;
|
|
16961
17025
|
const scopes = params.scopes;
|
|
17026
|
+
const keyId = params.keyId;
|
|
16962
17027
|
const expire = params.expire;
|
|
16963
17028
|
if (typeof projectId === 'undefined') {
|
|
16964
17029
|
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
@@ -16971,6 +17036,9 @@ class Projects {
|
|
|
16971
17036
|
}
|
|
16972
17037
|
const apiPath = '/projects/{projectId}/keys'.replace('{projectId}', projectId);
|
|
16973
17038
|
const payload = {};
|
|
17039
|
+
if (typeof keyId !== 'undefined') {
|
|
17040
|
+
payload['keyId'] = keyId;
|
|
17041
|
+
}
|
|
16974
17042
|
if (typeof name !== 'undefined') {
|
|
16975
17043
|
payload['name'] = name;
|
|
16976
17044
|
}
|
|
@@ -17707,36 +17775,6 @@ class Projects {
|
|
|
17707
17775
|
};
|
|
17708
17776
|
return this.client.call('post', uri, apiHeaders, payload);
|
|
17709
17777
|
}
|
|
17710
|
-
updateStatus(paramsOrFirst, ...rest) {
|
|
17711
|
-
let params;
|
|
17712
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
17713
|
-
params = (paramsOrFirst || {});
|
|
17714
|
-
}
|
|
17715
|
-
else {
|
|
17716
|
-
params = {
|
|
17717
|
-
projectId: paramsOrFirst,
|
|
17718
|
-
status: rest[0]
|
|
17719
|
-
};
|
|
17720
|
-
}
|
|
17721
|
-
const projectId = params.projectId;
|
|
17722
|
-
const status = params.status;
|
|
17723
|
-
if (typeof projectId === 'undefined') {
|
|
17724
|
-
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
17725
|
-
}
|
|
17726
|
-
if (typeof status === 'undefined') {
|
|
17727
|
-
throw new AppwriteException('Missing required parameter: "status"');
|
|
17728
|
-
}
|
|
17729
|
-
const apiPath = '/projects/{projectId}/status'.replace('{projectId}', projectId);
|
|
17730
|
-
const payload = {};
|
|
17731
|
-
if (typeof status !== 'undefined') {
|
|
17732
|
-
payload['status'] = status;
|
|
17733
|
-
}
|
|
17734
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
17735
|
-
const apiHeaders = {
|
|
17736
|
-
'content-type': 'application/json',
|
|
17737
|
-
};
|
|
17738
|
-
return this.client.call('patch', uri, apiHeaders, payload);
|
|
17739
|
-
}
|
|
17740
17778
|
updateTeam(paramsOrFirst, ...rest) {
|
|
17741
17779
|
let params;
|
|
17742
17780
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
@@ -18784,7 +18822,7 @@ class Sites {
|
|
|
18784
18822
|
}
|
|
18785
18823
|
listTemplates(paramsOrFirst, ...rest) {
|
|
18786
18824
|
let params;
|
|
18787
|
-
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'frameworks' in paramsOrFirst)) {
|
|
18825
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('frameworks' in paramsOrFirst || 'useCases' in paramsOrFirst || 'limit' in paramsOrFirst || 'offset' in paramsOrFirst))) {
|
|
18788
18826
|
params = (paramsOrFirst || {});
|
|
18789
18827
|
}
|
|
18790
18828
|
else {
|
|
@@ -18839,7 +18877,7 @@ class Sites {
|
|
|
18839
18877
|
}
|
|
18840
18878
|
listUsage(paramsOrFirst) {
|
|
18841
18879
|
let params;
|
|
18842
|
-
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'range' in paramsOrFirst)) {
|
|
18880
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) {
|
|
18843
18881
|
params = (paramsOrFirst || {});
|
|
18844
18882
|
}
|
|
18845
18883
|
else {
|
|
@@ -20209,7 +20247,7 @@ class Storage {
|
|
|
20209
20247
|
}
|
|
20210
20248
|
getUsage(paramsOrFirst) {
|
|
20211
20249
|
let params;
|
|
20212
|
-
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'range' in paramsOrFirst)) {
|
|
20250
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) {
|
|
20213
20251
|
params = (paramsOrFirst || {});
|
|
20214
20252
|
}
|
|
20215
20253
|
else {
|
|
@@ -20471,7 +20509,7 @@ class TablesDB {
|
|
|
20471
20509
|
}
|
|
20472
20510
|
listUsage(paramsOrFirst) {
|
|
20473
20511
|
let params;
|
|
20474
|
-
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'range' in paramsOrFirst)) {
|
|
20512
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) {
|
|
20475
20513
|
params = (paramsOrFirst || {});
|
|
20476
20514
|
}
|
|
20477
20515
|
else {
|
|
@@ -24640,7 +24678,7 @@ class Users {
|
|
|
24640
24678
|
}
|
|
24641
24679
|
getUsage(paramsOrFirst) {
|
|
24642
24680
|
let params;
|
|
24643
|
-
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'range' in paramsOrFirst)) {
|
|
24681
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) {
|
|
24644
24682
|
params = (paramsOrFirst || {});
|
|
24645
24683
|
}
|
|
24646
24684
|
else {
|
|
@@ -26010,11 +26048,16 @@ class Realtime {
|
|
|
26010
26048
|
this.TYPE_CONNECTED = 'connected';
|
|
26011
26049
|
this.DEBOUNCE_MS = 1;
|
|
26012
26050
|
this.HEARTBEAT_INTERVAL = 20000; // 20 seconds in milliseconds
|
|
26013
|
-
|
|
26051
|
+
// Slot-centric state: Map<slot, { channels: Set<string>, queries: string[], callback: Function }>
|
|
26014
26052
|
this.activeSubscriptions = new Map();
|
|
26053
|
+
// Map slot index -> subscriptionId (from backend)
|
|
26054
|
+
this.slotToSubscriptionId = new Map();
|
|
26055
|
+
// Inverse map: subscriptionId -> slot index (for O(1) lookup)
|
|
26056
|
+
this.subscriptionIdToSlot = new Map();
|
|
26015
26057
|
this.subCallDepth = 0;
|
|
26016
26058
|
this.reconnectAttempts = 0;
|
|
26017
26059
|
this.subscriptionsCounter = 0;
|
|
26060
|
+
this.connectionId = 0;
|
|
26018
26061
|
this.reconnect = true;
|
|
26019
26062
|
this.onErrorCallbacks = [];
|
|
26020
26063
|
this.onCloseCallbacks = [];
|
|
@@ -26064,7 +26107,7 @@ class Realtime {
|
|
|
26064
26107
|
}
|
|
26065
26108
|
createSocket() {
|
|
26066
26109
|
return __awaiter(this, void 0, void 0, function* () {
|
|
26067
|
-
if (this.
|
|
26110
|
+
if (this.activeSubscriptions.size === 0) {
|
|
26068
26111
|
this.reconnect = false;
|
|
26069
26112
|
yield this.closeSocket();
|
|
26070
26113
|
return;
|
|
@@ -26073,10 +26116,36 @@ class Realtime {
|
|
|
26073
26116
|
if (!projectId) {
|
|
26074
26117
|
throw new AppwriteException('Missing project ID');
|
|
26075
26118
|
}
|
|
26119
|
+
// Collect all unique channels from all slots
|
|
26120
|
+
const allChannels = new Set();
|
|
26121
|
+
for (const subscription of this.activeSubscriptions.values()) {
|
|
26122
|
+
for (const channel of subscription.channels) {
|
|
26123
|
+
allChannels.add(channel);
|
|
26124
|
+
}
|
|
26125
|
+
}
|
|
26076
26126
|
let queryParams = `project=${projectId}`;
|
|
26077
|
-
for (const channel of
|
|
26127
|
+
for (const channel of allChannels) {
|
|
26078
26128
|
queryParams += `&channels[]=${encodeURIComponent(channel)}`;
|
|
26079
26129
|
}
|
|
26130
|
+
// Build query string from slots → channels → queries
|
|
26131
|
+
// Format: channel[slot][]=query
|
|
26132
|
+
// For each slot, repeat its queries under each channel it subscribes to
|
|
26133
|
+
// Example: slot 1 → channels [tests, prod], queries [q1, q2]
|
|
26134
|
+
// Produces: tests[1][]=q1&tests[1][]=q2&prod[1][]=q1&prod[1][]=q2
|
|
26135
|
+
const selectAllQuery = Query.select(['*']).toString();
|
|
26136
|
+
for (const [slot, subscription] of this.activeSubscriptions) {
|
|
26137
|
+
// queries is string[] - iterate over each query string
|
|
26138
|
+
const queries = subscription.queries.length === 0
|
|
26139
|
+
? [selectAllQuery]
|
|
26140
|
+
: subscription.queries;
|
|
26141
|
+
// Repeat this slot's queries under each channel it subscribes to
|
|
26142
|
+
// Each query is sent as a separate parameter: channel[slot][]=q1&channel[slot][]=q2
|
|
26143
|
+
for (const channel of subscription.channels) {
|
|
26144
|
+
for (const query of queries) {
|
|
26145
|
+
queryParams += `&${encodeURIComponent(channel)}[${slot}][]=${encodeURIComponent(query)}`;
|
|
26146
|
+
}
|
|
26147
|
+
}
|
|
26148
|
+
}
|
|
26080
26149
|
const endpoint = this.client.config.endpointRealtime !== ''
|
|
26081
26150
|
? this.client.config.endpointRealtime
|
|
26082
26151
|
: this.client.config.endpoint || '';
|
|
@@ -26086,18 +26155,29 @@ class Realtime {
|
|
|
26086
26155
|
const url = `${realtimeEndpoint}/realtime?${queryParams}`;
|
|
26087
26156
|
if (this.socket) {
|
|
26088
26157
|
this.reconnect = false;
|
|
26089
|
-
|
|
26158
|
+
if (this.socket.readyState < WebSocket.CLOSING) {
|
|
26159
|
+
yield this.closeSocket();
|
|
26160
|
+
}
|
|
26161
|
+
// Ensure reconnect isn't stuck false if close event was missed.
|
|
26162
|
+
this.reconnect = true;
|
|
26090
26163
|
}
|
|
26091
26164
|
return new Promise((resolve, reject) => {
|
|
26092
26165
|
try {
|
|
26093
|
-
|
|
26094
|
-
this.socket
|
|
26166
|
+
const connectionId = ++this.connectionId;
|
|
26167
|
+
const socket = (this.socket = new WebSocket(url));
|
|
26168
|
+
socket.addEventListener('open', () => {
|
|
26169
|
+
if (connectionId !== this.connectionId) {
|
|
26170
|
+
return;
|
|
26171
|
+
}
|
|
26095
26172
|
this.reconnectAttempts = 0;
|
|
26096
26173
|
this.onOpenCallbacks.forEach(callback => callback());
|
|
26097
26174
|
this.startHeartbeat();
|
|
26098
26175
|
resolve();
|
|
26099
26176
|
});
|
|
26100
|
-
|
|
26177
|
+
socket.addEventListener('message', (event) => {
|
|
26178
|
+
if (connectionId !== this.connectionId) {
|
|
26179
|
+
return;
|
|
26180
|
+
}
|
|
26101
26181
|
try {
|
|
26102
26182
|
const message = JSON.parse(event.data);
|
|
26103
26183
|
this.handleMessage(message);
|
|
@@ -26106,7 +26186,10 @@ class Realtime {
|
|
|
26106
26186
|
console.error('Failed to parse message:', error);
|
|
26107
26187
|
}
|
|
26108
26188
|
});
|
|
26109
|
-
|
|
26189
|
+
socket.addEventListener('close', (event) => __awaiter(this, void 0, void 0, function* () {
|
|
26190
|
+
if (connectionId !== this.connectionId || socket !== this.socket) {
|
|
26191
|
+
return;
|
|
26192
|
+
}
|
|
26110
26193
|
this.stopHeartbeat();
|
|
26111
26194
|
this.onCloseCallbacks.forEach(callback => callback());
|
|
26112
26195
|
if (!this.reconnect || event.code === RealtimeCode.POLICY_VIOLATION) {
|
|
@@ -26124,7 +26207,10 @@ class Realtime {
|
|
|
26124
26207
|
console.error('Failed to reconnect:', error);
|
|
26125
26208
|
}
|
|
26126
26209
|
}));
|
|
26127
|
-
|
|
26210
|
+
socket.addEventListener('error', (event) => {
|
|
26211
|
+
if (connectionId !== this.connectionId || socket !== this.socket) {
|
|
26212
|
+
return;
|
|
26213
|
+
}
|
|
26128
26214
|
this.stopHeartbeat();
|
|
26129
26215
|
const error = new Error('WebSocket error');
|
|
26130
26216
|
console.error('WebSocket error:', error.message);
|
|
@@ -26195,7 +26281,7 @@ class Realtime {
|
|
|
26195
26281
|
}
|
|
26196
26282
|
return String(channel);
|
|
26197
26283
|
}
|
|
26198
|
-
subscribe(channelsOrChannel, callback) {
|
|
26284
|
+
subscribe(channelsOrChannel, callback, queries = []) {
|
|
26199
26285
|
return __awaiter(this, void 0, void 0, function* () {
|
|
26200
26286
|
const channelArray = Array.isArray(channelsOrChannel)
|
|
26201
26287
|
? channelsOrChannel
|
|
@@ -26203,13 +26289,29 @@ class Realtime {
|
|
|
26203
26289
|
// Convert all channels to strings
|
|
26204
26290
|
const channelStrings = channelArray.map(ch => this.channelToString(ch));
|
|
26205
26291
|
const channels = new Set(channelStrings);
|
|
26206
|
-
|
|
26207
|
-
|
|
26208
|
-
|
|
26209
|
-
|
|
26292
|
+
// Convert queries to array of strings
|
|
26293
|
+
// Ensure each query is a separate string in the array
|
|
26294
|
+
const queryStrings = [];
|
|
26295
|
+
for (const q of (queries !== null && queries !== void 0 ? queries : [])) {
|
|
26296
|
+
if (Array.isArray(q)) {
|
|
26297
|
+
// Handle nested arrays: [[q1, q2]] -> [q1, q2]
|
|
26298
|
+
for (const inner of q) {
|
|
26299
|
+
queryStrings.push(typeof inner === 'string' ? inner : inner.toString());
|
|
26300
|
+
}
|
|
26301
|
+
}
|
|
26302
|
+
else {
|
|
26303
|
+
queryStrings.push(typeof q === 'string' ? q : q.toString());
|
|
26304
|
+
}
|
|
26210
26305
|
}
|
|
26211
|
-
|
|
26306
|
+
// Allocate a new slot index
|
|
26307
|
+
this.subscriptionsCounter++;
|
|
26308
|
+
const slot = this.subscriptionsCounter;
|
|
26309
|
+
// Store slot-centric data: channels, queries, and callback belong to the slot
|
|
26310
|
+
// queries is stored as string[] (array of query strings)
|
|
26311
|
+
// No channel mutation occurs here - channels are derived from slots in createSocket()
|
|
26312
|
+
this.activeSubscriptions.set(slot, {
|
|
26212
26313
|
channels,
|
|
26314
|
+
queries: queryStrings,
|
|
26213
26315
|
callback
|
|
26214
26316
|
});
|
|
26215
26317
|
this.subCallDepth++;
|
|
@@ -26220,23 +26322,19 @@ class Realtime {
|
|
|
26220
26322
|
this.subCallDepth--;
|
|
26221
26323
|
return {
|
|
26222
26324
|
close: () => __awaiter(this, void 0, void 0, function* () {
|
|
26223
|
-
this.
|
|
26224
|
-
this.
|
|
26325
|
+
const subscriptionId = this.slotToSubscriptionId.get(slot);
|
|
26326
|
+
this.activeSubscriptions.delete(slot);
|
|
26327
|
+
this.slotToSubscriptionId.delete(slot);
|
|
26328
|
+
if (subscriptionId) {
|
|
26329
|
+
this.subscriptionIdToSlot.delete(subscriptionId);
|
|
26330
|
+
}
|
|
26225
26331
|
yield this.createSocket();
|
|
26226
26332
|
})
|
|
26227
26333
|
};
|
|
26228
26334
|
});
|
|
26229
26335
|
}
|
|
26230
|
-
cleanUp(
|
|
26231
|
-
|
|
26232
|
-
if (!channels.has(channel)) {
|
|
26233
|
-
return true;
|
|
26234
|
-
}
|
|
26235
|
-
const subsWithChannel = Array.from(this.activeSubscriptions.values())
|
|
26236
|
-
.filter(sub => sub.channels.has(channel));
|
|
26237
|
-
return subsWithChannel.length > 0;
|
|
26238
|
-
}));
|
|
26239
|
-
}
|
|
26336
|
+
// cleanUp is no longer needed - slots are removed directly in subscribe().close()
|
|
26337
|
+
// Channels are automatically rebuilt from remaining slots in createSocket()
|
|
26240
26338
|
handleMessage(message) {
|
|
26241
26339
|
if (!message.type) {
|
|
26242
26340
|
return;
|
|
@@ -26262,6 +26360,19 @@ class Realtime {
|
|
|
26262
26360
|
return;
|
|
26263
26361
|
}
|
|
26264
26362
|
const messageData = message.data;
|
|
26363
|
+
// Store subscription ID mappings from backend
|
|
26364
|
+
// Format: { "0": "sub_a1f9", "1": "sub_b83c", ... }
|
|
26365
|
+
if (messageData.subscriptions) {
|
|
26366
|
+
this.slotToSubscriptionId.clear();
|
|
26367
|
+
this.subscriptionIdToSlot.clear();
|
|
26368
|
+
for (const [slotStr, subscriptionId] of Object.entries(messageData.subscriptions)) {
|
|
26369
|
+
const slot = Number(slotStr);
|
|
26370
|
+
if (!isNaN(slot)) {
|
|
26371
|
+
this.slotToSubscriptionId.set(slot, subscriptionId);
|
|
26372
|
+
this.subscriptionIdToSlot.set(subscriptionId, slot);
|
|
26373
|
+
}
|
|
26374
|
+
}
|
|
26375
|
+
}
|
|
26265
26376
|
let session = this.client.config.session;
|
|
26266
26377
|
if (!session) {
|
|
26267
26378
|
try {
|
|
@@ -26296,23 +26407,26 @@ class Realtime {
|
|
|
26296
26407
|
const events = data.events;
|
|
26297
26408
|
const payload = data.payload;
|
|
26298
26409
|
const timestamp = data.timestamp;
|
|
26299
|
-
|
|
26300
|
-
|
|
26301
|
-
}
|
|
26302
|
-
const hasActiveChannel = channels.some(channel => this.activeChannels.has(channel));
|
|
26303
|
-
if (!hasActiveChannel) {
|
|
26410
|
+
const subscriptions = data.subscriptions;
|
|
26411
|
+
if (!channels || !events || !payload || !subscriptions || subscriptions.length === 0) {
|
|
26304
26412
|
return;
|
|
26305
26413
|
}
|
|
26306
|
-
|
|
26307
|
-
|
|
26308
|
-
|
|
26309
|
-
|
|
26310
|
-
|
|
26311
|
-
|
|
26312
|
-
|
|
26313
|
-
|
|
26314
|
-
|
|
26315
|
-
|
|
26414
|
+
// Iterate over all matching subscriptionIds and call callback for each
|
|
26415
|
+
for (const subscriptionId of subscriptions) {
|
|
26416
|
+
// O(1) lookup using subscriptionId
|
|
26417
|
+
const slot = this.subscriptionIdToSlot.get(subscriptionId);
|
|
26418
|
+
if (slot !== undefined) {
|
|
26419
|
+
const subscription = this.activeSubscriptions.get(slot);
|
|
26420
|
+
if (subscription) {
|
|
26421
|
+
const response = {
|
|
26422
|
+
events,
|
|
26423
|
+
channels,
|
|
26424
|
+
timestamp,
|
|
26425
|
+
payload,
|
|
26426
|
+
subscriptions
|
|
26427
|
+
};
|
|
26428
|
+
subscription.callback(response);
|
|
26429
|
+
}
|
|
26316
26430
|
}
|
|
26317
26431
|
}
|
|
26318
26432
|
}
|
|
@@ -26514,8 +26628,11 @@ class Channel {
|
|
|
26514
26628
|
constructor(segments) {
|
|
26515
26629
|
this.segments = segments;
|
|
26516
26630
|
}
|
|
26517
|
-
next(segment, id
|
|
26518
|
-
|
|
26631
|
+
next(segment, id) {
|
|
26632
|
+
const segments = id === undefined
|
|
26633
|
+
? [...this.segments, segment]
|
|
26634
|
+
: [...this.segments, segment, normalize(id)];
|
|
26635
|
+
return new Channel(segments);
|
|
26519
26636
|
}
|
|
26520
26637
|
resolve(action) {
|
|
26521
26638
|
return new Channel([...this.segments, action]);
|
|
@@ -26525,28 +26642,29 @@ class Channel {
|
|
|
26525
26642
|
}
|
|
26526
26643
|
// --- DATABASE ROUTE ---
|
|
26527
26644
|
// Only available on Channel<Database>
|
|
26528
|
-
collection(id
|
|
26529
|
-
|
|
26645
|
+
collection(id) {
|
|
26646
|
+
// Default: wildcard collection ID
|
|
26647
|
+
return this.next("collections", id !== null && id !== void 0 ? id : "*");
|
|
26530
26648
|
}
|
|
26531
26649
|
// Only available on Channel<Collection>
|
|
26532
|
-
document(id
|
|
26650
|
+
document(id) {
|
|
26651
|
+
// Default: no document ID segment
|
|
26533
26652
|
return this.next("documents", id);
|
|
26534
26653
|
}
|
|
26535
26654
|
// --- TABLESDB ROUTE ---
|
|
26536
|
-
table(id
|
|
26537
|
-
|
|
26655
|
+
table(id) {
|
|
26656
|
+
// Default: wildcard table ID
|
|
26657
|
+
return this.next("tables", id !== null && id !== void 0 ? id : "*");
|
|
26538
26658
|
}
|
|
26539
|
-
row(id
|
|
26659
|
+
row(id) {
|
|
26660
|
+
// Default: no row ID segment
|
|
26540
26661
|
return this.next("rows", id);
|
|
26541
26662
|
}
|
|
26542
26663
|
// --- BUCKET ROUTE ---
|
|
26543
|
-
file(id
|
|
26664
|
+
file(id) {
|
|
26665
|
+
// Default: no file ID segment
|
|
26544
26666
|
return this.next("files", id);
|
|
26545
26667
|
}
|
|
26546
|
-
// --- FUNCTION ROUTE ---
|
|
26547
|
-
execution(id = "*") {
|
|
26548
|
-
return this.next("executions", id);
|
|
26549
|
-
}
|
|
26550
26668
|
// --- TERMINAL ACTIONS ---
|
|
26551
26669
|
// Restricted to the Actionable union
|
|
26552
26670
|
create() {
|
|
@@ -26562,6 +26680,9 @@ class Channel {
|
|
|
26562
26680
|
static database(id = "*") {
|
|
26563
26681
|
return new Channel(["databases", normalize(id)]);
|
|
26564
26682
|
}
|
|
26683
|
+
static execution(id = "*") {
|
|
26684
|
+
return new Channel(["executions", normalize(id)]);
|
|
26685
|
+
}
|
|
26565
26686
|
static tablesdb(id = "*") {
|
|
26566
26687
|
return new Channel(["tablesdb", normalize(id)]);
|
|
26567
26688
|
}
|
|
@@ -26577,9 +26698,8 @@ class Channel {
|
|
|
26577
26698
|
static membership(id = "*") {
|
|
26578
26699
|
return new Channel(["memberships", normalize(id)]);
|
|
26579
26700
|
}
|
|
26580
|
-
static account(
|
|
26581
|
-
|
|
26582
|
-
return id === "*" ? "account" : `account.${id}`;
|
|
26701
|
+
static account() {
|
|
26702
|
+
return "account";
|
|
26583
26703
|
}
|
|
26584
26704
|
// Global events
|
|
26585
26705
|
static documents() {
|
|
@@ -26597,6 +26717,9 @@ class Channel {
|
|
|
26597
26717
|
static teams() {
|
|
26598
26718
|
return "teams";
|
|
26599
26719
|
}
|
|
26720
|
+
static memberships() {
|
|
26721
|
+
return "memberships";
|
|
26722
|
+
}
|
|
26600
26723
|
}
|
|
26601
26724
|
|
|
26602
26725
|
exports.Condition = void 0;
|
|
@@ -26929,6 +27052,7 @@ exports.Scopes = void 0;
|
|
|
26929
27052
|
Scopes["RestorationsWrite"] = "restorations.write";
|
|
26930
27053
|
Scopes["DomainsRead"] = "domains.read";
|
|
26931
27054
|
Scopes["DomainsWrite"] = "domains.write";
|
|
27055
|
+
Scopes["EventsRead"] = "events.read";
|
|
26932
27056
|
})(exports.Scopes || (exports.Scopes = {}));
|
|
26933
27057
|
|
|
26934
27058
|
exports.AuthenticatorType = void 0;
|
|
@@ -27691,12 +27815,12 @@ exports.ImageFormat = void 0;
|
|
|
27691
27815
|
ImageFormat["Gif"] = "gif";
|
|
27692
27816
|
})(exports.ImageFormat || (exports.ImageFormat = {}));
|
|
27693
27817
|
|
|
27694
|
-
exports.
|
|
27695
|
-
(function (
|
|
27696
|
-
|
|
27697
|
-
|
|
27698
|
-
|
|
27699
|
-
})(exports.
|
|
27818
|
+
exports.BackupServices = void 0;
|
|
27819
|
+
(function (BackupServices) {
|
|
27820
|
+
BackupServices["Databases"] = "databases";
|
|
27821
|
+
BackupServices["Functions"] = "functions";
|
|
27822
|
+
BackupServices["Storage"] = "storage";
|
|
27823
|
+
})(exports.BackupServices || (exports.BackupServices = {}));
|
|
27700
27824
|
|
|
27701
27825
|
exports.Platform = void 0;
|
|
27702
27826
|
(function (Platform) {
|
|
@@ -27745,6 +27869,14 @@ exports.OrderBy = void 0;
|
|
|
27745
27869
|
OrderBy["Desc"] = "desc";
|
|
27746
27870
|
})(exports.OrderBy || (exports.OrderBy = {}));
|
|
27747
27871
|
|
|
27872
|
+
exports.RegistrationType = void 0;
|
|
27873
|
+
(function (RegistrationType) {
|
|
27874
|
+
RegistrationType["New"] = "new";
|
|
27875
|
+
RegistrationType["Transfer"] = "transfer";
|
|
27876
|
+
RegistrationType["Renewal"] = "renewal";
|
|
27877
|
+
RegistrationType["Trade"] = "trade";
|
|
27878
|
+
})(exports.RegistrationType || (exports.RegistrationType = {}));
|
|
27879
|
+
|
|
27748
27880
|
exports.FilterType = void 0;
|
|
27749
27881
|
(function (FilterType) {
|
|
27750
27882
|
FilterType["Premium"] = "premium";
|
|
@@ -27775,6 +27907,9 @@ exports.Runtime = void 0;
|
|
|
27775
27907
|
Runtime["Python312"] = "python-3.12";
|
|
27776
27908
|
Runtime["Pythonml311"] = "python-ml-3.11";
|
|
27777
27909
|
Runtime["Pythonml312"] = "python-ml-3.12";
|
|
27910
|
+
Runtime["Deno121"] = "deno-1.21";
|
|
27911
|
+
Runtime["Deno124"] = "deno-1.24";
|
|
27912
|
+
Runtime["Deno135"] = "deno-1.35";
|
|
27778
27913
|
Runtime["Deno140"] = "deno-1.40";
|
|
27779
27914
|
Runtime["Deno146"] = "deno-1.46";
|
|
27780
27915
|
Runtime["Deno20"] = "deno-2.0";
|
|
@@ -27789,6 +27924,7 @@ exports.Runtime = void 0;
|
|
|
27789
27924
|
Runtime["Dart35"] = "dart-3.5";
|
|
27790
27925
|
Runtime["Dart38"] = "dart-3.8";
|
|
27791
27926
|
Runtime["Dart39"] = "dart-3.9";
|
|
27927
|
+
Runtime["Dart310"] = "dart-3.10";
|
|
27792
27928
|
Runtime["Dotnet60"] = "dotnet-6.0";
|
|
27793
27929
|
Runtime["Dotnet70"] = "dotnet-7.0";
|
|
27794
27930
|
Runtime["Dotnet80"] = "dotnet-8.0";
|
|
@@ -27817,6 +27953,7 @@ exports.Runtime = void 0;
|
|
|
27817
27953
|
Runtime["Flutter329"] = "flutter-3.29";
|
|
27818
27954
|
Runtime["Flutter332"] = "flutter-3.32";
|
|
27819
27955
|
Runtime["Flutter335"] = "flutter-3.35";
|
|
27956
|
+
Runtime["Flutter338"] = "flutter-3.38";
|
|
27820
27957
|
})(exports.Runtime || (exports.Runtime = {}));
|
|
27821
27958
|
|
|
27822
27959
|
exports.Runtimes = void 0;
|
|
@@ -27843,6 +27980,9 @@ exports.Runtimes = void 0;
|
|
|
27843
27980
|
Runtimes["Python312"] = "python-3.12";
|
|
27844
27981
|
Runtimes["Pythonml311"] = "python-ml-3.11";
|
|
27845
27982
|
Runtimes["Pythonml312"] = "python-ml-3.12";
|
|
27983
|
+
Runtimes["Deno121"] = "deno-1.21";
|
|
27984
|
+
Runtimes["Deno124"] = "deno-1.24";
|
|
27985
|
+
Runtimes["Deno135"] = "deno-1.35";
|
|
27846
27986
|
Runtimes["Deno140"] = "deno-1.40";
|
|
27847
27987
|
Runtimes["Deno146"] = "deno-1.46";
|
|
27848
27988
|
Runtimes["Deno20"] = "deno-2.0";
|
|
@@ -27857,6 +27997,7 @@ exports.Runtimes = void 0;
|
|
|
27857
27997
|
Runtimes["Dart35"] = "dart-3.5";
|
|
27858
27998
|
Runtimes["Dart38"] = "dart-3.8";
|
|
27859
27999
|
Runtimes["Dart39"] = "dart-3.9";
|
|
28000
|
+
Runtimes["Dart310"] = "dart-3.10";
|
|
27860
28001
|
Runtimes["Dotnet60"] = "dotnet-6.0";
|
|
27861
28002
|
Runtimes["Dotnet70"] = "dotnet-7.0";
|
|
27862
28003
|
Runtimes["Dotnet80"] = "dotnet-8.0";
|
|
@@ -27885,6 +28026,7 @@ exports.Runtimes = void 0;
|
|
|
27885
28026
|
Runtimes["Flutter329"] = "flutter-3.29";
|
|
27886
28027
|
Runtimes["Flutter332"] = "flutter-3.32";
|
|
27887
28028
|
Runtimes["Flutter335"] = "flutter-3.35";
|
|
28029
|
+
Runtimes["Flutter338"] = "flutter-3.38";
|
|
27888
28030
|
})(exports.Runtimes || (exports.Runtimes = {}));
|
|
27889
28031
|
|
|
27890
28032
|
exports.UseCases = void 0;
|
|
@@ -28052,12 +28194,6 @@ exports.SMTPSecure = void 0;
|
|
|
28052
28194
|
SMTPSecure["Ssl"] = "ssl";
|
|
28053
28195
|
})(exports.SMTPSecure || (exports.SMTPSecure = {}));
|
|
28054
28196
|
|
|
28055
|
-
exports.Status = void 0;
|
|
28056
|
-
(function (Status) {
|
|
28057
|
-
Status["Active"] = "active";
|
|
28058
|
-
Status["Archived"] = "archived";
|
|
28059
|
-
})(exports.Status || (exports.Status = {}));
|
|
28060
|
-
|
|
28061
28197
|
exports.EmailTemplateType = void 0;
|
|
28062
28198
|
(function (EmailTemplateType) {
|
|
28063
28199
|
EmailTemplateType["Verification"] = "verification";
|
|
@@ -28404,6 +28540,9 @@ exports.BuildRuntime = void 0;
|
|
|
28404
28540
|
BuildRuntime["Python312"] = "python-3.12";
|
|
28405
28541
|
BuildRuntime["Pythonml311"] = "python-ml-3.11";
|
|
28406
28542
|
BuildRuntime["Pythonml312"] = "python-ml-3.12";
|
|
28543
|
+
BuildRuntime["Deno121"] = "deno-1.21";
|
|
28544
|
+
BuildRuntime["Deno124"] = "deno-1.24";
|
|
28545
|
+
BuildRuntime["Deno135"] = "deno-1.35";
|
|
28407
28546
|
BuildRuntime["Deno140"] = "deno-1.40";
|
|
28408
28547
|
BuildRuntime["Deno146"] = "deno-1.46";
|
|
28409
28548
|
BuildRuntime["Deno20"] = "deno-2.0";
|
|
@@ -28418,6 +28557,7 @@ exports.BuildRuntime = void 0;
|
|
|
28418
28557
|
BuildRuntime["Dart35"] = "dart-3.5";
|
|
28419
28558
|
BuildRuntime["Dart38"] = "dart-3.8";
|
|
28420
28559
|
BuildRuntime["Dart39"] = "dart-3.9";
|
|
28560
|
+
BuildRuntime["Dart310"] = "dart-3.10";
|
|
28421
28561
|
BuildRuntime["Dotnet60"] = "dotnet-6.0";
|
|
28422
28562
|
BuildRuntime["Dotnet70"] = "dotnet-7.0";
|
|
28423
28563
|
BuildRuntime["Dotnet80"] = "dotnet-8.0";
|
|
@@ -28446,6 +28586,7 @@ exports.BuildRuntime = void 0;
|
|
|
28446
28586
|
BuildRuntime["Flutter329"] = "flutter-3.29";
|
|
28447
28587
|
BuildRuntime["Flutter332"] = "flutter-3.32";
|
|
28448
28588
|
BuildRuntime["Flutter335"] = "flutter-3.35";
|
|
28589
|
+
BuildRuntime["Flutter338"] = "flutter-3.38";
|
|
28449
28590
|
})(exports.BuildRuntime || (exports.BuildRuntime = {}));
|
|
28450
28591
|
|
|
28451
28592
|
exports.Adapter = void 0;
|
|
@@ -28493,15 +28634,6 @@ exports.ImageGravity = void 0;
|
|
|
28493
28634
|
ImageGravity["Bottomright"] = "bottom-right";
|
|
28494
28635
|
})(exports.ImageGravity || (exports.ImageGravity = {}));
|
|
28495
28636
|
|
|
28496
|
-
exports.Roles = void 0;
|
|
28497
|
-
(function (Roles) {
|
|
28498
|
-
Roles["Developer"] = "developer";
|
|
28499
|
-
Roles["Editor"] = "editor";
|
|
28500
|
-
Roles["Analyst"] = "analyst";
|
|
28501
|
-
Roles["Billing"] = "billing";
|
|
28502
|
-
Roles["Owner"] = "owner";
|
|
28503
|
-
})(exports.Roles || (exports.Roles = {}));
|
|
28504
|
-
|
|
28505
28637
|
exports.PasswordHash = void 0;
|
|
28506
28638
|
(function (PasswordHash) {
|
|
28507
28639
|
PasswordHash["Sha1"] = "sha1";
|