@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/iife/sdk.js
CHANGED
|
@@ -4279,7 +4279,7 @@
|
|
|
4279
4279
|
'x-sdk-name': 'Console',
|
|
4280
4280
|
'x-sdk-platform': 'console',
|
|
4281
4281
|
'x-sdk-language': 'web',
|
|
4282
|
-
'x-sdk-version': '2.
|
|
4282
|
+
'x-sdk-version': '2.3.0',
|
|
4283
4283
|
'X-Appwrite-Response-Format': '1.8.0',
|
|
4284
4284
|
};
|
|
4285
4285
|
this.realtime = {
|
|
@@ -4288,7 +4288,10 @@
|
|
|
4288
4288
|
heartbeat: undefined,
|
|
4289
4289
|
url: '',
|
|
4290
4290
|
channels: new Set(),
|
|
4291
|
+
queries: new Set(),
|
|
4291
4292
|
subscriptions: new Map(),
|
|
4293
|
+
slotToSubscriptionId: new Map(),
|
|
4294
|
+
subscriptionIdToSlot: new Map(),
|
|
4292
4295
|
subscriptionsCounter: 0,
|
|
4293
4296
|
reconnect: true,
|
|
4294
4297
|
reconnectAttempts: 0,
|
|
@@ -4323,26 +4326,34 @@
|
|
|
4323
4326
|
}, 20000);
|
|
4324
4327
|
},
|
|
4325
4328
|
createSocket: () => {
|
|
4326
|
-
var _a, _b, _c;
|
|
4327
|
-
if (this.realtime.
|
|
4329
|
+
var _a, _b, _c, _d;
|
|
4330
|
+
if (this.realtime.subscriptions.size < 1) {
|
|
4328
4331
|
this.realtime.reconnect = false;
|
|
4329
4332
|
(_a = this.realtime.socket) === null || _a === void 0 ? void 0 : _a.close();
|
|
4330
4333
|
return;
|
|
4331
4334
|
}
|
|
4332
|
-
const
|
|
4333
|
-
|
|
4334
|
-
channels.set('project', this.config.project);
|
|
4335
|
-
}
|
|
4335
|
+
const encodedProject = encodeURIComponent((_b = this.config.project) !== null && _b !== void 0 ? _b : '');
|
|
4336
|
+
let queryParams = 'project=' + encodedProject;
|
|
4336
4337
|
this.realtime.channels.forEach(channel => {
|
|
4337
|
-
|
|
4338
|
+
queryParams += '&channels[]=' + encodeURIComponent(channel);
|
|
4338
4339
|
});
|
|
4339
|
-
|
|
4340
|
+
// Per-subscription queries: channel[slot][]=query so server can route events by subscription
|
|
4341
|
+
const selectAllQuery = Query.select(['*']).toString();
|
|
4342
|
+
this.realtime.subscriptions.forEach((sub, slot) => {
|
|
4343
|
+
const queries = sub.queries.length > 0 ? sub.queries : [selectAllQuery];
|
|
4344
|
+
sub.channels.forEach(channel => {
|
|
4345
|
+
queries.forEach(query => {
|
|
4346
|
+
queryParams += '&' + encodeURIComponent(channel) + '[' + slot + '][]=' + encodeURIComponent(query);
|
|
4347
|
+
});
|
|
4348
|
+
});
|
|
4349
|
+
});
|
|
4350
|
+
const url = this.config.endpointRealtime + '/realtime?' + queryParams;
|
|
4340
4351
|
if (url !== this.realtime.url || // Check if URL is present
|
|
4341
4352
|
!this.realtime.socket || // Check if WebSocket has not been created
|
|
4342
|
-
((
|
|
4353
|
+
((_c = this.realtime.socket) === null || _c === void 0 ? void 0 : _c.readyState) > WebSocket.OPEN // Check if WebSocket is CLOSING (3) or CLOSED (4)
|
|
4343
4354
|
) {
|
|
4344
4355
|
if (this.realtime.socket &&
|
|
4345
|
-
((
|
|
4356
|
+
((_d = this.realtime.socket) === null || _d === void 0 ? void 0 : _d.readyState) < WebSocket.CLOSING // Close WebSocket if it is CONNECTING (0) or OPEN (1)
|
|
4346
4357
|
) {
|
|
4347
4358
|
this.realtime.reconnect = false;
|
|
4348
4359
|
this.realtime.socket.close();
|
|
@@ -4378,14 +4389,25 @@
|
|
|
4378
4389
|
const message = JSONbig.parse(event.data);
|
|
4379
4390
|
this.realtime.lastMessage = message;
|
|
4380
4391
|
switch (message.type) {
|
|
4381
|
-
case 'connected':
|
|
4392
|
+
case 'connected': {
|
|
4393
|
+
const messageData = message.data;
|
|
4394
|
+
if (messageData === null || messageData === void 0 ? void 0 : messageData.subscriptions) {
|
|
4395
|
+
this.realtime.slotToSubscriptionId.clear();
|
|
4396
|
+
this.realtime.subscriptionIdToSlot.clear();
|
|
4397
|
+
for (const [slotStr, subscriptionId] of Object.entries(messageData.subscriptions)) {
|
|
4398
|
+
const slot = Number(slotStr);
|
|
4399
|
+
if (!isNaN(slot) && typeof subscriptionId === 'string') {
|
|
4400
|
+
this.realtime.slotToSubscriptionId.set(slot, subscriptionId);
|
|
4401
|
+
this.realtime.subscriptionIdToSlot.set(subscriptionId, slot);
|
|
4402
|
+
}
|
|
4403
|
+
}
|
|
4404
|
+
}
|
|
4382
4405
|
let session = this.config.session;
|
|
4383
4406
|
if (!session) {
|
|
4384
4407
|
const cookie = JSONbig.parse((_a = window.localStorage.getItem('cookieFallback')) !== null && _a !== void 0 ? _a : '{}');
|
|
4385
4408
|
session = cookie === null || cookie === void 0 ? void 0 : cookie[`a_session_${this.config.project}`];
|
|
4386
4409
|
}
|
|
4387
|
-
|
|
4388
|
-
if (session && !messageData.user) {
|
|
4410
|
+
if (session && !(messageData === null || messageData === void 0 ? void 0 : messageData.user)) {
|
|
4389
4411
|
(_b = this.realtime.socket) === null || _b === void 0 ? void 0 : _b.send(JSONbig.stringify({
|
|
4390
4412
|
type: 'authentication',
|
|
4391
4413
|
data: {
|
|
@@ -4394,12 +4416,27 @@
|
|
|
4394
4416
|
}));
|
|
4395
4417
|
}
|
|
4396
4418
|
break;
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4419
|
+
}
|
|
4420
|
+
case 'event': {
|
|
4421
|
+
const data = message.data;
|
|
4422
|
+
if (!(data === null || data === void 0 ? void 0 : data.channels))
|
|
4423
|
+
break;
|
|
4424
|
+
const eventSubIds = data.subscriptions;
|
|
4425
|
+
if (eventSubIds && eventSubIds.length > 0) {
|
|
4426
|
+
for (const subscriptionId of eventSubIds) {
|
|
4427
|
+
const slot = this.realtime.subscriptionIdToSlot.get(subscriptionId);
|
|
4428
|
+
if (slot !== undefined) {
|
|
4429
|
+
const subscription = this.realtime.subscriptions.get(slot);
|
|
4430
|
+
if (subscription) {
|
|
4431
|
+
setTimeout(() => subscription.callback(data));
|
|
4432
|
+
}
|
|
4433
|
+
}
|
|
4434
|
+
}
|
|
4435
|
+
}
|
|
4436
|
+
else {
|
|
4400
4437
|
const isSubscribed = data.channels.some(channel => this.realtime.channels.has(channel));
|
|
4401
4438
|
if (!isSubscribed)
|
|
4402
|
-
|
|
4439
|
+
break;
|
|
4403
4440
|
this.realtime.subscriptions.forEach(subscription => {
|
|
4404
4441
|
if (data.channels.some(channel => subscription.channels.includes(channel))) {
|
|
4405
4442
|
setTimeout(() => subscription.callback(data));
|
|
@@ -4407,6 +4444,7 @@
|
|
|
4407
4444
|
});
|
|
4408
4445
|
}
|
|
4409
4446
|
break;
|
|
4447
|
+
}
|
|
4410
4448
|
case 'pong':
|
|
4411
4449
|
break; // Handle pong response if needed
|
|
4412
4450
|
case 'error':
|
|
@@ -4419,7 +4457,7 @@
|
|
|
4419
4457
|
console.error(e);
|
|
4420
4458
|
}
|
|
4421
4459
|
},
|
|
4422
|
-
cleanUp: channels => {
|
|
4460
|
+
cleanUp: (channels, queries) => {
|
|
4423
4461
|
this.realtime.channels.forEach(channel => {
|
|
4424
4462
|
if (channels.includes(channel)) {
|
|
4425
4463
|
let found = Array.from(this.realtime.subscriptions).some(([_key, subscription]) => {
|
|
@@ -4430,6 +4468,17 @@
|
|
|
4430
4468
|
}
|
|
4431
4469
|
}
|
|
4432
4470
|
});
|
|
4471
|
+
this.realtime.queries.forEach(query => {
|
|
4472
|
+
if (queries.includes(query)) {
|
|
4473
|
+
let found = Array.from(this.realtime.subscriptions).some(([_key, subscription]) => {
|
|
4474
|
+
var _a;
|
|
4475
|
+
return (_a = subscription.queries) === null || _a === void 0 ? void 0 : _a.includes(query);
|
|
4476
|
+
});
|
|
4477
|
+
if (!found) {
|
|
4478
|
+
this.realtime.queries.delete(query);
|
|
4479
|
+
}
|
|
4480
|
+
}
|
|
4481
|
+
});
|
|
4433
4482
|
}
|
|
4434
4483
|
};
|
|
4435
4484
|
}
|
|
@@ -4610,7 +4659,7 @@
|
|
|
4610
4659
|
* @param {(payload: RealtimeMessage) => void} callback Is called on every realtime update.
|
|
4611
4660
|
* @returns {() => void} Unsubscribes from events.
|
|
4612
4661
|
*/
|
|
4613
|
-
subscribe(channels, callback) {
|
|
4662
|
+
subscribe(channels, callback, queries = []) {
|
|
4614
4663
|
const channelArray = Array.isArray(channels) ? channels : [channels];
|
|
4615
4664
|
// Convert Channel instances to strings
|
|
4616
4665
|
const channelStrings = channelArray.map(ch => {
|
|
@@ -4625,15 +4674,18 @@
|
|
|
4625
4674
|
return String(ch);
|
|
4626
4675
|
});
|
|
4627
4676
|
channelStrings.forEach(channel => this.realtime.channels.add(channel));
|
|
4677
|
+
const queryStrings = (queries !== null && queries !== void 0 ? queries : []).map(q => typeof q === 'string' ? q : q.toString());
|
|
4678
|
+
queryStrings.forEach(query => this.realtime.queries.add(query));
|
|
4628
4679
|
const counter = this.realtime.subscriptionsCounter++;
|
|
4629
4680
|
this.realtime.subscriptions.set(counter, {
|
|
4630
4681
|
channels: channelStrings,
|
|
4682
|
+
queries: queryStrings,
|
|
4631
4683
|
callback
|
|
4632
4684
|
});
|
|
4633
4685
|
this.realtime.connect();
|
|
4634
4686
|
return () => {
|
|
4635
4687
|
this.realtime.subscriptions.delete(counter);
|
|
4636
|
-
this.realtime.cleanUp(channelStrings);
|
|
4688
|
+
this.realtime.cleanUp(channelStrings, queryStrings);
|
|
4637
4689
|
this.realtime.connect();
|
|
4638
4690
|
};
|
|
4639
4691
|
}
|
|
@@ -5405,7 +5457,7 @@
|
|
|
5405
5457
|
}
|
|
5406
5458
|
createMfaAuthenticator(paramsOrFirst) {
|
|
5407
5459
|
let params;
|
|
5408
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) {
|
|
5460
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('type' in paramsOrFirst))) {
|
|
5409
5461
|
params = (paramsOrFirst || {});
|
|
5410
5462
|
}
|
|
5411
5463
|
else {
|
|
@@ -5427,7 +5479,7 @@
|
|
|
5427
5479
|
}
|
|
5428
5480
|
createMFAAuthenticator(paramsOrFirst) {
|
|
5429
5481
|
let params;
|
|
5430
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) {
|
|
5482
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('type' in paramsOrFirst))) {
|
|
5431
5483
|
params = (paramsOrFirst || {});
|
|
5432
5484
|
}
|
|
5433
5485
|
else {
|
|
@@ -5449,7 +5501,7 @@
|
|
|
5449
5501
|
}
|
|
5450
5502
|
updateMfaAuthenticator(paramsOrFirst, ...rest) {
|
|
5451
5503
|
let params;
|
|
5452
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) {
|
|
5504
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('type' in paramsOrFirst || 'otp' in paramsOrFirst))) {
|
|
5453
5505
|
params = (paramsOrFirst || {});
|
|
5454
5506
|
}
|
|
5455
5507
|
else {
|
|
@@ -5479,7 +5531,7 @@
|
|
|
5479
5531
|
}
|
|
5480
5532
|
updateMFAAuthenticator(paramsOrFirst, ...rest) {
|
|
5481
5533
|
let params;
|
|
5482
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) {
|
|
5534
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('type' in paramsOrFirst || 'otp' in paramsOrFirst))) {
|
|
5483
5535
|
params = (paramsOrFirst || {});
|
|
5484
5536
|
}
|
|
5485
5537
|
else {
|
|
@@ -5509,7 +5561,7 @@
|
|
|
5509
5561
|
}
|
|
5510
5562
|
deleteMfaAuthenticator(paramsOrFirst) {
|
|
5511
5563
|
let params;
|
|
5512
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) {
|
|
5564
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('type' in paramsOrFirst))) {
|
|
5513
5565
|
params = (paramsOrFirst || {});
|
|
5514
5566
|
}
|
|
5515
5567
|
else {
|
|
@@ -5531,7 +5583,7 @@
|
|
|
5531
5583
|
}
|
|
5532
5584
|
deleteMFAAuthenticator(paramsOrFirst) {
|
|
5533
5585
|
let params;
|
|
5534
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) {
|
|
5586
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('type' in paramsOrFirst))) {
|
|
5535
5587
|
params = (paramsOrFirst || {});
|
|
5536
5588
|
}
|
|
5537
5589
|
else {
|
|
@@ -5553,7 +5605,7 @@
|
|
|
5553
5605
|
}
|
|
5554
5606
|
createMfaChallenge(paramsOrFirst) {
|
|
5555
5607
|
let params;
|
|
5556
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'factor' in paramsOrFirst)) {
|
|
5608
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('factor' in paramsOrFirst))) {
|
|
5557
5609
|
params = (paramsOrFirst || {});
|
|
5558
5610
|
}
|
|
5559
5611
|
else {
|
|
@@ -5578,7 +5630,7 @@
|
|
|
5578
5630
|
}
|
|
5579
5631
|
createMFAChallenge(paramsOrFirst) {
|
|
5580
5632
|
let params;
|
|
5581
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'factor' in paramsOrFirst)) {
|
|
5633
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('factor' in paramsOrFirst))) {
|
|
5582
5634
|
params = (paramsOrFirst || {});
|
|
5583
5635
|
}
|
|
5584
5636
|
else {
|
|
@@ -6071,7 +6123,7 @@
|
|
|
6071
6123
|
}
|
|
6072
6124
|
updatePrefs(paramsOrFirst) {
|
|
6073
6125
|
let params;
|
|
6074
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'prefs' in paramsOrFirst)) {
|
|
6126
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('prefs' in paramsOrFirst))) {
|
|
6075
6127
|
params = (paramsOrFirst || {});
|
|
6076
6128
|
}
|
|
6077
6129
|
else {
|
|
@@ -6279,7 +6331,7 @@
|
|
|
6279
6331
|
}
|
|
6280
6332
|
createOAuth2Session(paramsOrFirst, ...rest) {
|
|
6281
6333
|
let params;
|
|
6282
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'provider' in paramsOrFirst)) {
|
|
6334
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('provider' in paramsOrFirst || 'success' in paramsOrFirst || 'failure' in paramsOrFirst || 'scopes' in paramsOrFirst))) {
|
|
6283
6335
|
params = (paramsOrFirst || {});
|
|
6284
6336
|
}
|
|
6285
6337
|
else {
|
|
@@ -6639,7 +6691,7 @@
|
|
|
6639
6691
|
}
|
|
6640
6692
|
createOAuth2Token(paramsOrFirst, ...rest) {
|
|
6641
6693
|
let params;
|
|
6642
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'provider' in paramsOrFirst)) {
|
|
6694
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('provider' in paramsOrFirst || 'success' in paramsOrFirst || 'failure' in paramsOrFirst || 'scopes' in paramsOrFirst))) {
|
|
6643
6695
|
params = (paramsOrFirst || {});
|
|
6644
6696
|
}
|
|
6645
6697
|
else {
|
|
@@ -6886,7 +6938,7 @@
|
|
|
6886
6938
|
}
|
|
6887
6939
|
getBrowser(paramsOrFirst, ...rest) {
|
|
6888
6940
|
let params;
|
|
6889
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) {
|
|
6941
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('code' in paramsOrFirst || 'width' in paramsOrFirst || 'height' in paramsOrFirst || 'quality' in paramsOrFirst))) {
|
|
6890
6942
|
params = (paramsOrFirst || {});
|
|
6891
6943
|
}
|
|
6892
6944
|
else {
|
|
@@ -6924,7 +6976,7 @@
|
|
|
6924
6976
|
}
|
|
6925
6977
|
getCreditCard(paramsOrFirst, ...rest) {
|
|
6926
6978
|
let params;
|
|
6927
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) {
|
|
6979
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('code' in paramsOrFirst || 'width' in paramsOrFirst || 'height' in paramsOrFirst || 'quality' in paramsOrFirst))) {
|
|
6928
6980
|
params = (paramsOrFirst || {});
|
|
6929
6981
|
}
|
|
6930
6982
|
else {
|
|
@@ -6988,7 +7040,7 @@
|
|
|
6988
7040
|
}
|
|
6989
7041
|
getFlag(paramsOrFirst, ...rest) {
|
|
6990
7042
|
let params;
|
|
6991
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) {
|
|
7043
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('code' in paramsOrFirst || 'width' in paramsOrFirst || 'height' in paramsOrFirst || 'quality' in paramsOrFirst))) {
|
|
6992
7044
|
params = (paramsOrFirst || {});
|
|
6993
7045
|
}
|
|
6994
7046
|
else {
|
|
@@ -7288,7 +7340,7 @@
|
|
|
7288
7340
|
}
|
|
7289
7341
|
createArchive(paramsOrFirst, ...rest) {
|
|
7290
7342
|
let params;
|
|
7291
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'services' in paramsOrFirst)) {
|
|
7343
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('services' in paramsOrFirst || 'resourceId' in paramsOrFirst))) {
|
|
7292
7344
|
params = (paramsOrFirst || {});
|
|
7293
7345
|
}
|
|
7294
7346
|
else {
|
|
@@ -7688,7 +7740,7 @@
|
|
|
7688
7740
|
}
|
|
7689
7741
|
getPlans(paramsOrFirst) {
|
|
7690
7742
|
let params;
|
|
7691
|
-
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'platform' in paramsOrFirst)) {
|
|
7743
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('platform' in paramsOrFirst))) {
|
|
7692
7744
|
params = (paramsOrFirst || {});
|
|
7693
7745
|
}
|
|
7694
7746
|
else {
|
|
@@ -8173,7 +8225,7 @@
|
|
|
8173
8225
|
}
|
|
8174
8226
|
listUsage(paramsOrFirst) {
|
|
8175
8227
|
let params;
|
|
8176
|
-
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'range' in paramsOrFirst)) {
|
|
8228
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) {
|
|
8177
8229
|
params = (paramsOrFirst || {});
|
|
8178
8230
|
}
|
|
8179
8231
|
else {
|
|
@@ -11317,6 +11369,39 @@
|
|
|
11317
11369
|
};
|
|
11318
11370
|
return this.client.call('post', uri, apiHeaders, payload);
|
|
11319
11371
|
}
|
|
11372
|
+
getPrice(paramsOrFirst, ...rest) {
|
|
11373
|
+
let params;
|
|
11374
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
11375
|
+
params = (paramsOrFirst || {});
|
|
11376
|
+
}
|
|
11377
|
+
else {
|
|
11378
|
+
params = {
|
|
11379
|
+
domain: paramsOrFirst,
|
|
11380
|
+
periodYears: rest[0],
|
|
11381
|
+
registrationType: rest[1]
|
|
11382
|
+
};
|
|
11383
|
+
}
|
|
11384
|
+
const domain = params.domain;
|
|
11385
|
+
const periodYears = params.periodYears;
|
|
11386
|
+
const registrationType = params.registrationType;
|
|
11387
|
+
if (typeof domain === 'undefined') {
|
|
11388
|
+
throw new AppwriteException('Missing required parameter: "domain"');
|
|
11389
|
+
}
|
|
11390
|
+
const apiPath = '/domains/price';
|
|
11391
|
+
const payload = {};
|
|
11392
|
+
if (typeof domain !== 'undefined') {
|
|
11393
|
+
payload['domain'] = domain;
|
|
11394
|
+
}
|
|
11395
|
+
if (typeof periodYears !== 'undefined') {
|
|
11396
|
+
payload['periodYears'] = periodYears;
|
|
11397
|
+
}
|
|
11398
|
+
if (typeof registrationType !== 'undefined') {
|
|
11399
|
+
payload['registrationType'] = registrationType;
|
|
11400
|
+
}
|
|
11401
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
11402
|
+
const apiHeaders = {};
|
|
11403
|
+
return this.client.call('get', uri, apiHeaders, payload);
|
|
11404
|
+
}
|
|
11320
11405
|
listSuggestions(paramsOrFirst, ...rest) {
|
|
11321
11406
|
let params;
|
|
11322
11407
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
@@ -13149,7 +13234,7 @@
|
|
|
13149
13234
|
}
|
|
13150
13235
|
listTemplates(paramsOrFirst, ...rest) {
|
|
13151
13236
|
let params;
|
|
13152
|
-
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'runtimes' in paramsOrFirst)) {
|
|
13237
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('runtimes' in paramsOrFirst || 'useCases' in paramsOrFirst || 'limit' in paramsOrFirst || 'offset' in paramsOrFirst || 'total' in paramsOrFirst))) {
|
|
13153
13238
|
params = (paramsOrFirst || {});
|
|
13154
13239
|
}
|
|
13155
13240
|
else {
|
|
@@ -13209,7 +13294,7 @@
|
|
|
13209
13294
|
}
|
|
13210
13295
|
listUsage(paramsOrFirst) {
|
|
13211
13296
|
let params;
|
|
13212
|
-
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'range' in paramsOrFirst)) {
|
|
13297
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) {
|
|
13213
13298
|
params = (paramsOrFirst || {});
|
|
13214
13299
|
}
|
|
13215
13300
|
else {
|
|
@@ -14079,7 +14164,7 @@
|
|
|
14079
14164
|
}
|
|
14080
14165
|
query(paramsOrFirst) {
|
|
14081
14166
|
let params;
|
|
14082
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'query' in paramsOrFirst)) {
|
|
14167
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('query' in paramsOrFirst))) {
|
|
14083
14168
|
params = (paramsOrFirst || {});
|
|
14084
14169
|
}
|
|
14085
14170
|
else {
|
|
@@ -14105,7 +14190,7 @@
|
|
|
14105
14190
|
}
|
|
14106
14191
|
mutation(paramsOrFirst) {
|
|
14107
14192
|
let params;
|
|
14108
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'query' in paramsOrFirst)) {
|
|
14193
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('query' in paramsOrFirst))) {
|
|
14109
14194
|
params = (paramsOrFirst || {});
|
|
14110
14195
|
}
|
|
14111
14196
|
else {
|
|
@@ -14387,7 +14472,7 @@
|
|
|
14387
14472
|
}
|
|
14388
14473
|
getFailedJobs(paramsOrFirst, ...rest) {
|
|
14389
14474
|
let params;
|
|
14390
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'name' in paramsOrFirst)) {
|
|
14475
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('name' in paramsOrFirst || 'threshold' in paramsOrFirst))) {
|
|
14391
14476
|
params = (paramsOrFirst || {});
|
|
14392
14477
|
}
|
|
14393
14478
|
else {
|
|
@@ -17622,7 +17707,7 @@
|
|
|
17622
17707
|
}
|
|
17623
17708
|
createAppwriteMigration(paramsOrFirst, ...rest) {
|
|
17624
17709
|
let params;
|
|
17625
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
|
|
17710
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('resources' in paramsOrFirst || 'endpoint' in paramsOrFirst || 'projectId' in paramsOrFirst || 'apiKey' in paramsOrFirst))) {
|
|
17626
17711
|
params = (paramsOrFirst || {});
|
|
17627
17712
|
}
|
|
17628
17713
|
else {
|
|
@@ -17671,7 +17756,7 @@
|
|
|
17671
17756
|
}
|
|
17672
17757
|
getAppwriteReport(paramsOrFirst, ...rest) {
|
|
17673
17758
|
let params;
|
|
17674
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
|
|
17759
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('resources' in paramsOrFirst || 'endpoint' in paramsOrFirst || 'projectID' in paramsOrFirst || 'key' in paramsOrFirst))) {
|
|
17675
17760
|
params = (paramsOrFirst || {});
|
|
17676
17761
|
}
|
|
17677
17762
|
else {
|
|
@@ -17832,7 +17917,7 @@
|
|
|
17832
17917
|
}
|
|
17833
17918
|
createFirebaseMigration(paramsOrFirst, ...rest) {
|
|
17834
17919
|
let params;
|
|
17835
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
|
|
17920
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('resources' in paramsOrFirst || 'serviceAccount' in paramsOrFirst))) {
|
|
17836
17921
|
params = (paramsOrFirst || {});
|
|
17837
17922
|
}
|
|
17838
17923
|
else {
|
|
@@ -17865,7 +17950,7 @@
|
|
|
17865
17950
|
}
|
|
17866
17951
|
getFirebaseReport(paramsOrFirst, ...rest) {
|
|
17867
17952
|
let params;
|
|
17868
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
|
|
17953
|
+
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('resources' in paramsOrFirst || 'serviceAccount' in paramsOrFirst))) {
|
|
17869
17954
|
params = (paramsOrFirst || {});
|
|
17870
17955
|
}
|
|
17871
17956
|
else {
|
|
@@ -17896,7 +17981,7 @@
|
|
|
17896
17981
|
}
|
|
17897
17982
|
createNHostMigration(paramsOrFirst, ...rest) {
|
|
17898
17983
|
let params;
|
|
17899
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
|
|
17984
|
+
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))) {
|
|
17900
17985
|
params = (paramsOrFirst || {});
|
|
17901
17986
|
}
|
|
17902
17987
|
else {
|
|
@@ -17974,7 +18059,7 @@
|
|
|
17974
18059
|
}
|
|
17975
18060
|
getNHostReport(paramsOrFirst, ...rest) {
|
|
17976
18061
|
let params;
|
|
17977
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
|
|
18062
|
+
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))) {
|
|
17978
18063
|
params = (paramsOrFirst || {});
|
|
17979
18064
|
}
|
|
17980
18065
|
else {
|
|
@@ -18050,7 +18135,7 @@
|
|
|
18050
18135
|
}
|
|
18051
18136
|
createSupabaseMigration(paramsOrFirst, ...rest) {
|
|
18052
18137
|
let params;
|
|
18053
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
|
|
18138
|
+
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))) {
|
|
18054
18139
|
params = (paramsOrFirst || {});
|
|
18055
18140
|
}
|
|
18056
18141
|
else {
|
|
@@ -18120,7 +18205,7 @@
|
|
|
18120
18205
|
}
|
|
18121
18206
|
getSupabaseReport(paramsOrFirst, ...rest) {
|
|
18122
18207
|
let params;
|
|
18123
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
|
|
18208
|
+
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))) {
|
|
18124
18209
|
params = (paramsOrFirst || {});
|
|
18125
18210
|
}
|
|
18126
18211
|
else {
|
|
@@ -19403,33 +19488,6 @@
|
|
|
19403
19488
|
};
|
|
19404
19489
|
return this.client.call('patch', uri, apiHeaders, payload);
|
|
19405
19490
|
}
|
|
19406
|
-
updateProjects(paramsOrFirst, ...rest) {
|
|
19407
|
-
let params;
|
|
19408
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
19409
|
-
params = (paramsOrFirst || {});
|
|
19410
|
-
}
|
|
19411
|
-
else {
|
|
19412
|
-
params = {
|
|
19413
|
-
organizationId: paramsOrFirst,
|
|
19414
|
-
projects: rest[0]
|
|
19415
|
-
};
|
|
19416
|
-
}
|
|
19417
|
-
const organizationId = params.organizationId;
|
|
19418
|
-
const projects = params.projects;
|
|
19419
|
-
if (typeof organizationId === 'undefined') {
|
|
19420
|
-
throw new AppwriteException('Missing required parameter: "organizationId"');
|
|
19421
|
-
}
|
|
19422
|
-
const apiPath = '/organizations/{organizationId}/projects'.replace('{organizationId}', organizationId);
|
|
19423
|
-
const payload = {};
|
|
19424
|
-
if (typeof projects !== 'undefined') {
|
|
19425
|
-
payload['projects'] = projects;
|
|
19426
|
-
}
|
|
19427
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
19428
|
-
const apiHeaders = {
|
|
19429
|
-
'content-type': 'application/json',
|
|
19430
|
-
};
|
|
19431
|
-
return this.client.call('patch', uri, apiHeaders, payload);
|
|
19432
|
-
}
|
|
19433
19491
|
listRegions(paramsOrFirst) {
|
|
19434
19492
|
let params;
|
|
19435
19493
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
@@ -20664,16 +20722,21 @@
|
|
|
20664
20722
|
else {
|
|
20665
20723
|
params = {
|
|
20666
20724
|
projectId: paramsOrFirst,
|
|
20667
|
-
|
|
20725
|
+
queries: rest[0],
|
|
20726
|
+
total: rest[1]
|
|
20668
20727
|
};
|
|
20669
20728
|
}
|
|
20670
20729
|
const projectId = params.projectId;
|
|
20730
|
+
const queries = params.queries;
|
|
20671
20731
|
const total = params.total;
|
|
20672
20732
|
if (typeof projectId === 'undefined') {
|
|
20673
20733
|
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
20674
20734
|
}
|
|
20675
20735
|
const apiPath = '/projects/{projectId}/keys'.replace('{projectId}', projectId);
|
|
20676
20736
|
const payload = {};
|
|
20737
|
+
if (typeof queries !== 'undefined') {
|
|
20738
|
+
payload['queries'] = queries;
|
|
20739
|
+
}
|
|
20677
20740
|
if (typeof total !== 'undefined') {
|
|
20678
20741
|
payload['total'] = total;
|
|
20679
20742
|
}
|
|
@@ -20691,12 +20754,14 @@
|
|
|
20691
20754
|
projectId: paramsOrFirst,
|
|
20692
20755
|
name: rest[0],
|
|
20693
20756
|
scopes: rest[1],
|
|
20694
|
-
|
|
20757
|
+
keyId: rest[2],
|
|
20758
|
+
expire: rest[3]
|
|
20695
20759
|
};
|
|
20696
20760
|
}
|
|
20697
20761
|
const projectId = params.projectId;
|
|
20698
20762
|
const name = params.name;
|
|
20699
20763
|
const scopes = params.scopes;
|
|
20764
|
+
const keyId = params.keyId;
|
|
20700
20765
|
const expire = params.expire;
|
|
20701
20766
|
if (typeof projectId === 'undefined') {
|
|
20702
20767
|
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
@@ -20709,6 +20774,9 @@
|
|
|
20709
20774
|
}
|
|
20710
20775
|
const apiPath = '/projects/{projectId}/keys'.replace('{projectId}', projectId);
|
|
20711
20776
|
const payload = {};
|
|
20777
|
+
if (typeof keyId !== 'undefined') {
|
|
20778
|
+
payload['keyId'] = keyId;
|
|
20779
|
+
}
|
|
20712
20780
|
if (typeof name !== 'undefined') {
|
|
20713
20781
|
payload['name'] = name;
|
|
20714
20782
|
}
|
|
@@ -21445,36 +21513,6 @@
|
|
|
21445
21513
|
};
|
|
21446
21514
|
return this.client.call('post', uri, apiHeaders, payload);
|
|
21447
21515
|
}
|
|
21448
|
-
updateStatus(paramsOrFirst, ...rest) {
|
|
21449
|
-
let params;
|
|
21450
|
-
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
21451
|
-
params = (paramsOrFirst || {});
|
|
21452
|
-
}
|
|
21453
|
-
else {
|
|
21454
|
-
params = {
|
|
21455
|
-
projectId: paramsOrFirst,
|
|
21456
|
-
status: rest[0]
|
|
21457
|
-
};
|
|
21458
|
-
}
|
|
21459
|
-
const projectId = params.projectId;
|
|
21460
|
-
const status = params.status;
|
|
21461
|
-
if (typeof projectId === 'undefined') {
|
|
21462
|
-
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
21463
|
-
}
|
|
21464
|
-
if (typeof status === 'undefined') {
|
|
21465
|
-
throw new AppwriteException('Missing required parameter: "status"');
|
|
21466
|
-
}
|
|
21467
|
-
const apiPath = '/projects/{projectId}/status'.replace('{projectId}', projectId);
|
|
21468
|
-
const payload = {};
|
|
21469
|
-
if (typeof status !== 'undefined') {
|
|
21470
|
-
payload['status'] = status;
|
|
21471
|
-
}
|
|
21472
|
-
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
21473
|
-
const apiHeaders = {
|
|
21474
|
-
'content-type': 'application/json',
|
|
21475
|
-
};
|
|
21476
|
-
return this.client.call('patch', uri, apiHeaders, payload);
|
|
21477
|
-
}
|
|
21478
21516
|
updateTeam(paramsOrFirst, ...rest) {
|
|
21479
21517
|
let params;
|
|
21480
21518
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
@@ -22522,7 +22560,7 @@
|
|
|
22522
22560
|
}
|
|
22523
22561
|
listTemplates(paramsOrFirst, ...rest) {
|
|
22524
22562
|
let params;
|
|
22525
|
-
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'frameworks' in paramsOrFirst)) {
|
|
22563
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('frameworks' in paramsOrFirst || 'useCases' in paramsOrFirst || 'limit' in paramsOrFirst || 'offset' in paramsOrFirst))) {
|
|
22526
22564
|
params = (paramsOrFirst || {});
|
|
22527
22565
|
}
|
|
22528
22566
|
else {
|
|
@@ -22577,7 +22615,7 @@
|
|
|
22577
22615
|
}
|
|
22578
22616
|
listUsage(paramsOrFirst) {
|
|
22579
22617
|
let params;
|
|
22580
|
-
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'range' in paramsOrFirst)) {
|
|
22618
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) {
|
|
22581
22619
|
params = (paramsOrFirst || {});
|
|
22582
22620
|
}
|
|
22583
22621
|
else {
|
|
@@ -23947,7 +23985,7 @@
|
|
|
23947
23985
|
}
|
|
23948
23986
|
getUsage(paramsOrFirst) {
|
|
23949
23987
|
let params;
|
|
23950
|
-
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'range' in paramsOrFirst)) {
|
|
23988
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) {
|
|
23951
23989
|
params = (paramsOrFirst || {});
|
|
23952
23990
|
}
|
|
23953
23991
|
else {
|
|
@@ -24209,7 +24247,7 @@
|
|
|
24209
24247
|
}
|
|
24210
24248
|
listUsage(paramsOrFirst) {
|
|
24211
24249
|
let params;
|
|
24212
|
-
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'range' in paramsOrFirst)) {
|
|
24250
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) {
|
|
24213
24251
|
params = (paramsOrFirst || {});
|
|
24214
24252
|
}
|
|
24215
24253
|
else {
|
|
@@ -28378,7 +28416,7 @@
|
|
|
28378
28416
|
}
|
|
28379
28417
|
getUsage(paramsOrFirst) {
|
|
28380
28418
|
let params;
|
|
28381
|
-
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'range' in paramsOrFirst)) {
|
|
28419
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) {
|
|
28382
28420
|
params = (paramsOrFirst || {});
|
|
28383
28421
|
}
|
|
28384
28422
|
else {
|
|
@@ -29748,11 +29786,16 @@
|
|
|
29748
29786
|
this.TYPE_CONNECTED = 'connected';
|
|
29749
29787
|
this.DEBOUNCE_MS = 1;
|
|
29750
29788
|
this.HEARTBEAT_INTERVAL = 20000; // 20 seconds in milliseconds
|
|
29751
|
-
|
|
29789
|
+
// Slot-centric state: Map<slot, { channels: Set<string>, queries: string[], callback: Function }>
|
|
29752
29790
|
this.activeSubscriptions = new Map();
|
|
29791
|
+
// Map slot index -> subscriptionId (from backend)
|
|
29792
|
+
this.slotToSubscriptionId = new Map();
|
|
29793
|
+
// Inverse map: subscriptionId -> slot index (for O(1) lookup)
|
|
29794
|
+
this.subscriptionIdToSlot = new Map();
|
|
29753
29795
|
this.subCallDepth = 0;
|
|
29754
29796
|
this.reconnectAttempts = 0;
|
|
29755
29797
|
this.subscriptionsCounter = 0;
|
|
29798
|
+
this.connectionId = 0;
|
|
29756
29799
|
this.reconnect = true;
|
|
29757
29800
|
this.onErrorCallbacks = [];
|
|
29758
29801
|
this.onCloseCallbacks = [];
|
|
@@ -29802,7 +29845,7 @@
|
|
|
29802
29845
|
}
|
|
29803
29846
|
createSocket() {
|
|
29804
29847
|
return __awaiter(this, void 0, void 0, function* () {
|
|
29805
|
-
if (this.
|
|
29848
|
+
if (this.activeSubscriptions.size === 0) {
|
|
29806
29849
|
this.reconnect = false;
|
|
29807
29850
|
yield this.closeSocket();
|
|
29808
29851
|
return;
|
|
@@ -29811,10 +29854,36 @@
|
|
|
29811
29854
|
if (!projectId) {
|
|
29812
29855
|
throw new AppwriteException('Missing project ID');
|
|
29813
29856
|
}
|
|
29857
|
+
// Collect all unique channels from all slots
|
|
29858
|
+
const allChannels = new Set();
|
|
29859
|
+
for (const subscription of this.activeSubscriptions.values()) {
|
|
29860
|
+
for (const channel of subscription.channels) {
|
|
29861
|
+
allChannels.add(channel);
|
|
29862
|
+
}
|
|
29863
|
+
}
|
|
29814
29864
|
let queryParams = `project=${projectId}`;
|
|
29815
|
-
for (const channel of
|
|
29865
|
+
for (const channel of allChannels) {
|
|
29816
29866
|
queryParams += `&channels[]=${encodeURIComponent(channel)}`;
|
|
29817
29867
|
}
|
|
29868
|
+
// Build query string from slots → channels → queries
|
|
29869
|
+
// Format: channel[slot][]=query
|
|
29870
|
+
// For each slot, repeat its queries under each channel it subscribes to
|
|
29871
|
+
// Example: slot 1 → channels [tests, prod], queries [q1, q2]
|
|
29872
|
+
// Produces: tests[1][]=q1&tests[1][]=q2&prod[1][]=q1&prod[1][]=q2
|
|
29873
|
+
const selectAllQuery = Query.select(['*']).toString();
|
|
29874
|
+
for (const [slot, subscription] of this.activeSubscriptions) {
|
|
29875
|
+
// queries is string[] - iterate over each query string
|
|
29876
|
+
const queries = subscription.queries.length === 0
|
|
29877
|
+
? [selectAllQuery]
|
|
29878
|
+
: subscription.queries;
|
|
29879
|
+
// Repeat this slot's queries under each channel it subscribes to
|
|
29880
|
+
// Each query is sent as a separate parameter: channel[slot][]=q1&channel[slot][]=q2
|
|
29881
|
+
for (const channel of subscription.channels) {
|
|
29882
|
+
for (const query of queries) {
|
|
29883
|
+
queryParams += `&${encodeURIComponent(channel)}[${slot}][]=${encodeURIComponent(query)}`;
|
|
29884
|
+
}
|
|
29885
|
+
}
|
|
29886
|
+
}
|
|
29818
29887
|
const endpoint = this.client.config.endpointRealtime !== ''
|
|
29819
29888
|
? this.client.config.endpointRealtime
|
|
29820
29889
|
: this.client.config.endpoint || '';
|
|
@@ -29824,18 +29893,29 @@
|
|
|
29824
29893
|
const url = `${realtimeEndpoint}/realtime?${queryParams}`;
|
|
29825
29894
|
if (this.socket) {
|
|
29826
29895
|
this.reconnect = false;
|
|
29827
|
-
|
|
29896
|
+
if (this.socket.readyState < WebSocket.CLOSING) {
|
|
29897
|
+
yield this.closeSocket();
|
|
29898
|
+
}
|
|
29899
|
+
// Ensure reconnect isn't stuck false if close event was missed.
|
|
29900
|
+
this.reconnect = true;
|
|
29828
29901
|
}
|
|
29829
29902
|
return new Promise((resolve, reject) => {
|
|
29830
29903
|
try {
|
|
29831
|
-
|
|
29832
|
-
this.socket
|
|
29904
|
+
const connectionId = ++this.connectionId;
|
|
29905
|
+
const socket = (this.socket = new WebSocket(url));
|
|
29906
|
+
socket.addEventListener('open', () => {
|
|
29907
|
+
if (connectionId !== this.connectionId) {
|
|
29908
|
+
return;
|
|
29909
|
+
}
|
|
29833
29910
|
this.reconnectAttempts = 0;
|
|
29834
29911
|
this.onOpenCallbacks.forEach(callback => callback());
|
|
29835
29912
|
this.startHeartbeat();
|
|
29836
29913
|
resolve();
|
|
29837
29914
|
});
|
|
29838
|
-
|
|
29915
|
+
socket.addEventListener('message', (event) => {
|
|
29916
|
+
if (connectionId !== this.connectionId) {
|
|
29917
|
+
return;
|
|
29918
|
+
}
|
|
29839
29919
|
try {
|
|
29840
29920
|
const message = JSON.parse(event.data);
|
|
29841
29921
|
this.handleMessage(message);
|
|
@@ -29844,7 +29924,10 @@
|
|
|
29844
29924
|
console.error('Failed to parse message:', error);
|
|
29845
29925
|
}
|
|
29846
29926
|
});
|
|
29847
|
-
|
|
29927
|
+
socket.addEventListener('close', (event) => __awaiter(this, void 0, void 0, function* () {
|
|
29928
|
+
if (connectionId !== this.connectionId || socket !== this.socket) {
|
|
29929
|
+
return;
|
|
29930
|
+
}
|
|
29848
29931
|
this.stopHeartbeat();
|
|
29849
29932
|
this.onCloseCallbacks.forEach(callback => callback());
|
|
29850
29933
|
if (!this.reconnect || event.code === RealtimeCode.POLICY_VIOLATION) {
|
|
@@ -29862,7 +29945,10 @@
|
|
|
29862
29945
|
console.error('Failed to reconnect:', error);
|
|
29863
29946
|
}
|
|
29864
29947
|
}));
|
|
29865
|
-
|
|
29948
|
+
socket.addEventListener('error', (event) => {
|
|
29949
|
+
if (connectionId !== this.connectionId || socket !== this.socket) {
|
|
29950
|
+
return;
|
|
29951
|
+
}
|
|
29866
29952
|
this.stopHeartbeat();
|
|
29867
29953
|
const error = new Error('WebSocket error');
|
|
29868
29954
|
console.error('WebSocket error:', error.message);
|
|
@@ -29933,7 +30019,7 @@
|
|
|
29933
30019
|
}
|
|
29934
30020
|
return String(channel);
|
|
29935
30021
|
}
|
|
29936
|
-
subscribe(channelsOrChannel, callback) {
|
|
30022
|
+
subscribe(channelsOrChannel, callback, queries = []) {
|
|
29937
30023
|
return __awaiter(this, void 0, void 0, function* () {
|
|
29938
30024
|
const channelArray = Array.isArray(channelsOrChannel)
|
|
29939
30025
|
? channelsOrChannel
|
|
@@ -29941,13 +30027,29 @@
|
|
|
29941
30027
|
// Convert all channels to strings
|
|
29942
30028
|
const channelStrings = channelArray.map(ch => this.channelToString(ch));
|
|
29943
30029
|
const channels = new Set(channelStrings);
|
|
29944
|
-
|
|
29945
|
-
|
|
29946
|
-
|
|
29947
|
-
|
|
30030
|
+
// Convert queries to array of strings
|
|
30031
|
+
// Ensure each query is a separate string in the array
|
|
30032
|
+
const queryStrings = [];
|
|
30033
|
+
for (const q of (queries !== null && queries !== void 0 ? queries : [])) {
|
|
30034
|
+
if (Array.isArray(q)) {
|
|
30035
|
+
// Handle nested arrays: [[q1, q2]] -> [q1, q2]
|
|
30036
|
+
for (const inner of q) {
|
|
30037
|
+
queryStrings.push(typeof inner === 'string' ? inner : inner.toString());
|
|
30038
|
+
}
|
|
30039
|
+
}
|
|
30040
|
+
else {
|
|
30041
|
+
queryStrings.push(typeof q === 'string' ? q : q.toString());
|
|
30042
|
+
}
|
|
29948
30043
|
}
|
|
29949
|
-
|
|
30044
|
+
// Allocate a new slot index
|
|
30045
|
+
this.subscriptionsCounter++;
|
|
30046
|
+
const slot = this.subscriptionsCounter;
|
|
30047
|
+
// Store slot-centric data: channels, queries, and callback belong to the slot
|
|
30048
|
+
// queries is stored as string[] (array of query strings)
|
|
30049
|
+
// No channel mutation occurs here - channels are derived from slots in createSocket()
|
|
30050
|
+
this.activeSubscriptions.set(slot, {
|
|
29950
30051
|
channels,
|
|
30052
|
+
queries: queryStrings,
|
|
29951
30053
|
callback
|
|
29952
30054
|
});
|
|
29953
30055
|
this.subCallDepth++;
|
|
@@ -29958,23 +30060,19 @@
|
|
|
29958
30060
|
this.subCallDepth--;
|
|
29959
30061
|
return {
|
|
29960
30062
|
close: () => __awaiter(this, void 0, void 0, function* () {
|
|
29961
|
-
this.
|
|
29962
|
-
this.
|
|
30063
|
+
const subscriptionId = this.slotToSubscriptionId.get(slot);
|
|
30064
|
+
this.activeSubscriptions.delete(slot);
|
|
30065
|
+
this.slotToSubscriptionId.delete(slot);
|
|
30066
|
+
if (subscriptionId) {
|
|
30067
|
+
this.subscriptionIdToSlot.delete(subscriptionId);
|
|
30068
|
+
}
|
|
29963
30069
|
yield this.createSocket();
|
|
29964
30070
|
})
|
|
29965
30071
|
};
|
|
29966
30072
|
});
|
|
29967
30073
|
}
|
|
29968
|
-
cleanUp(
|
|
29969
|
-
|
|
29970
|
-
if (!channels.has(channel)) {
|
|
29971
|
-
return true;
|
|
29972
|
-
}
|
|
29973
|
-
const subsWithChannel = Array.from(this.activeSubscriptions.values())
|
|
29974
|
-
.filter(sub => sub.channels.has(channel));
|
|
29975
|
-
return subsWithChannel.length > 0;
|
|
29976
|
-
}));
|
|
29977
|
-
}
|
|
30074
|
+
// cleanUp is no longer needed - slots are removed directly in subscribe().close()
|
|
30075
|
+
// Channels are automatically rebuilt from remaining slots in createSocket()
|
|
29978
30076
|
handleMessage(message) {
|
|
29979
30077
|
if (!message.type) {
|
|
29980
30078
|
return;
|
|
@@ -30000,6 +30098,19 @@
|
|
|
30000
30098
|
return;
|
|
30001
30099
|
}
|
|
30002
30100
|
const messageData = message.data;
|
|
30101
|
+
// Store subscription ID mappings from backend
|
|
30102
|
+
// Format: { "0": "sub_a1f9", "1": "sub_b83c", ... }
|
|
30103
|
+
if (messageData.subscriptions) {
|
|
30104
|
+
this.slotToSubscriptionId.clear();
|
|
30105
|
+
this.subscriptionIdToSlot.clear();
|
|
30106
|
+
for (const [slotStr, subscriptionId] of Object.entries(messageData.subscriptions)) {
|
|
30107
|
+
const slot = Number(slotStr);
|
|
30108
|
+
if (!isNaN(slot)) {
|
|
30109
|
+
this.slotToSubscriptionId.set(slot, subscriptionId);
|
|
30110
|
+
this.subscriptionIdToSlot.set(subscriptionId, slot);
|
|
30111
|
+
}
|
|
30112
|
+
}
|
|
30113
|
+
}
|
|
30003
30114
|
let session = this.client.config.session;
|
|
30004
30115
|
if (!session) {
|
|
30005
30116
|
try {
|
|
@@ -30034,23 +30145,26 @@
|
|
|
30034
30145
|
const events = data.events;
|
|
30035
30146
|
const payload = data.payload;
|
|
30036
30147
|
const timestamp = data.timestamp;
|
|
30037
|
-
|
|
30038
|
-
|
|
30039
|
-
}
|
|
30040
|
-
const hasActiveChannel = channels.some(channel => this.activeChannels.has(channel));
|
|
30041
|
-
if (!hasActiveChannel) {
|
|
30148
|
+
const subscriptions = data.subscriptions;
|
|
30149
|
+
if (!channels || !events || !payload || !subscriptions || subscriptions.length === 0) {
|
|
30042
30150
|
return;
|
|
30043
30151
|
}
|
|
30044
|
-
|
|
30045
|
-
|
|
30046
|
-
|
|
30047
|
-
|
|
30048
|
-
|
|
30049
|
-
|
|
30050
|
-
|
|
30051
|
-
|
|
30052
|
-
|
|
30053
|
-
|
|
30152
|
+
// Iterate over all matching subscriptionIds and call callback for each
|
|
30153
|
+
for (const subscriptionId of subscriptions) {
|
|
30154
|
+
// O(1) lookup using subscriptionId
|
|
30155
|
+
const slot = this.subscriptionIdToSlot.get(subscriptionId);
|
|
30156
|
+
if (slot !== undefined) {
|
|
30157
|
+
const subscription = this.activeSubscriptions.get(slot);
|
|
30158
|
+
if (subscription) {
|
|
30159
|
+
const response = {
|
|
30160
|
+
events,
|
|
30161
|
+
channels,
|
|
30162
|
+
timestamp,
|
|
30163
|
+
payload,
|
|
30164
|
+
subscriptions
|
|
30165
|
+
};
|
|
30166
|
+
subscription.callback(response);
|
|
30167
|
+
}
|
|
30054
30168
|
}
|
|
30055
30169
|
}
|
|
30056
30170
|
}
|
|
@@ -30252,8 +30366,11 @@
|
|
|
30252
30366
|
constructor(segments) {
|
|
30253
30367
|
this.segments = segments;
|
|
30254
30368
|
}
|
|
30255
|
-
next(segment, id
|
|
30256
|
-
|
|
30369
|
+
next(segment, id) {
|
|
30370
|
+
const segments = id === undefined
|
|
30371
|
+
? [...this.segments, segment]
|
|
30372
|
+
: [...this.segments, segment, normalize(id)];
|
|
30373
|
+
return new Channel(segments);
|
|
30257
30374
|
}
|
|
30258
30375
|
resolve(action) {
|
|
30259
30376
|
return new Channel([...this.segments, action]);
|
|
@@ -30263,28 +30380,29 @@
|
|
|
30263
30380
|
}
|
|
30264
30381
|
// --- DATABASE ROUTE ---
|
|
30265
30382
|
// Only available on Channel<Database>
|
|
30266
|
-
collection(id
|
|
30267
|
-
|
|
30383
|
+
collection(id) {
|
|
30384
|
+
// Default: wildcard collection ID
|
|
30385
|
+
return this.next("collections", id !== null && id !== void 0 ? id : "*");
|
|
30268
30386
|
}
|
|
30269
30387
|
// Only available on Channel<Collection>
|
|
30270
|
-
document(id
|
|
30388
|
+
document(id) {
|
|
30389
|
+
// Default: no document ID segment
|
|
30271
30390
|
return this.next("documents", id);
|
|
30272
30391
|
}
|
|
30273
30392
|
// --- TABLESDB ROUTE ---
|
|
30274
|
-
table(id
|
|
30275
|
-
|
|
30393
|
+
table(id) {
|
|
30394
|
+
// Default: wildcard table ID
|
|
30395
|
+
return this.next("tables", id !== null && id !== void 0 ? id : "*");
|
|
30276
30396
|
}
|
|
30277
|
-
row(id
|
|
30397
|
+
row(id) {
|
|
30398
|
+
// Default: no row ID segment
|
|
30278
30399
|
return this.next("rows", id);
|
|
30279
30400
|
}
|
|
30280
30401
|
// --- BUCKET ROUTE ---
|
|
30281
|
-
file(id
|
|
30402
|
+
file(id) {
|
|
30403
|
+
// Default: no file ID segment
|
|
30282
30404
|
return this.next("files", id);
|
|
30283
30405
|
}
|
|
30284
|
-
// --- FUNCTION ROUTE ---
|
|
30285
|
-
execution(id = "*") {
|
|
30286
|
-
return this.next("executions", id);
|
|
30287
|
-
}
|
|
30288
30406
|
// --- TERMINAL ACTIONS ---
|
|
30289
30407
|
// Restricted to the Actionable union
|
|
30290
30408
|
create() {
|
|
@@ -30300,6 +30418,9 @@
|
|
|
30300
30418
|
static database(id = "*") {
|
|
30301
30419
|
return new Channel(["databases", normalize(id)]);
|
|
30302
30420
|
}
|
|
30421
|
+
static execution(id = "*") {
|
|
30422
|
+
return new Channel(["executions", normalize(id)]);
|
|
30423
|
+
}
|
|
30303
30424
|
static tablesdb(id = "*") {
|
|
30304
30425
|
return new Channel(["tablesdb", normalize(id)]);
|
|
30305
30426
|
}
|
|
@@ -30315,9 +30436,8 @@
|
|
|
30315
30436
|
static membership(id = "*") {
|
|
30316
30437
|
return new Channel(["memberships", normalize(id)]);
|
|
30317
30438
|
}
|
|
30318
|
-
static account(
|
|
30319
|
-
|
|
30320
|
-
return id === "*" ? "account" : `account.${id}`;
|
|
30439
|
+
static account() {
|
|
30440
|
+
return "account";
|
|
30321
30441
|
}
|
|
30322
30442
|
// Global events
|
|
30323
30443
|
static documents() {
|
|
@@ -30335,6 +30455,9 @@
|
|
|
30335
30455
|
static teams() {
|
|
30336
30456
|
return "teams";
|
|
30337
30457
|
}
|
|
30458
|
+
static memberships() {
|
|
30459
|
+
return "memberships";
|
|
30460
|
+
}
|
|
30338
30461
|
}
|
|
30339
30462
|
|
|
30340
30463
|
exports.Condition = void 0;
|
|
@@ -30667,6 +30790,7 @@
|
|
|
30667
30790
|
Scopes["RestorationsWrite"] = "restorations.write";
|
|
30668
30791
|
Scopes["DomainsRead"] = "domains.read";
|
|
30669
30792
|
Scopes["DomainsWrite"] = "domains.write";
|
|
30793
|
+
Scopes["EventsRead"] = "events.read";
|
|
30670
30794
|
})(exports.Scopes || (exports.Scopes = {}));
|
|
30671
30795
|
|
|
30672
30796
|
exports.AuthenticatorType = void 0;
|
|
@@ -31429,12 +31553,12 @@
|
|
|
31429
31553
|
ImageFormat["Gif"] = "gif";
|
|
31430
31554
|
})(exports.ImageFormat || (exports.ImageFormat = {}));
|
|
31431
31555
|
|
|
31432
|
-
exports.
|
|
31433
|
-
(function (
|
|
31434
|
-
|
|
31435
|
-
|
|
31436
|
-
|
|
31437
|
-
})(exports.
|
|
31556
|
+
exports.BackupServices = void 0;
|
|
31557
|
+
(function (BackupServices) {
|
|
31558
|
+
BackupServices["Databases"] = "databases";
|
|
31559
|
+
BackupServices["Functions"] = "functions";
|
|
31560
|
+
BackupServices["Storage"] = "storage";
|
|
31561
|
+
})(exports.BackupServices || (exports.BackupServices = {}));
|
|
31438
31562
|
|
|
31439
31563
|
exports.Platform = void 0;
|
|
31440
31564
|
(function (Platform) {
|
|
@@ -31483,6 +31607,14 @@
|
|
|
31483
31607
|
OrderBy["Desc"] = "desc";
|
|
31484
31608
|
})(exports.OrderBy || (exports.OrderBy = {}));
|
|
31485
31609
|
|
|
31610
|
+
exports.RegistrationType = void 0;
|
|
31611
|
+
(function (RegistrationType) {
|
|
31612
|
+
RegistrationType["New"] = "new";
|
|
31613
|
+
RegistrationType["Transfer"] = "transfer";
|
|
31614
|
+
RegistrationType["Renewal"] = "renewal";
|
|
31615
|
+
RegistrationType["Trade"] = "trade";
|
|
31616
|
+
})(exports.RegistrationType || (exports.RegistrationType = {}));
|
|
31617
|
+
|
|
31486
31618
|
exports.FilterType = void 0;
|
|
31487
31619
|
(function (FilterType) {
|
|
31488
31620
|
FilterType["Premium"] = "premium";
|
|
@@ -31513,6 +31645,9 @@
|
|
|
31513
31645
|
Runtime["Python312"] = "python-3.12";
|
|
31514
31646
|
Runtime["Pythonml311"] = "python-ml-3.11";
|
|
31515
31647
|
Runtime["Pythonml312"] = "python-ml-3.12";
|
|
31648
|
+
Runtime["Deno121"] = "deno-1.21";
|
|
31649
|
+
Runtime["Deno124"] = "deno-1.24";
|
|
31650
|
+
Runtime["Deno135"] = "deno-1.35";
|
|
31516
31651
|
Runtime["Deno140"] = "deno-1.40";
|
|
31517
31652
|
Runtime["Deno146"] = "deno-1.46";
|
|
31518
31653
|
Runtime["Deno20"] = "deno-2.0";
|
|
@@ -31527,6 +31662,7 @@
|
|
|
31527
31662
|
Runtime["Dart35"] = "dart-3.5";
|
|
31528
31663
|
Runtime["Dart38"] = "dart-3.8";
|
|
31529
31664
|
Runtime["Dart39"] = "dart-3.9";
|
|
31665
|
+
Runtime["Dart310"] = "dart-3.10";
|
|
31530
31666
|
Runtime["Dotnet60"] = "dotnet-6.0";
|
|
31531
31667
|
Runtime["Dotnet70"] = "dotnet-7.0";
|
|
31532
31668
|
Runtime["Dotnet80"] = "dotnet-8.0";
|
|
@@ -31555,6 +31691,7 @@
|
|
|
31555
31691
|
Runtime["Flutter329"] = "flutter-3.29";
|
|
31556
31692
|
Runtime["Flutter332"] = "flutter-3.32";
|
|
31557
31693
|
Runtime["Flutter335"] = "flutter-3.35";
|
|
31694
|
+
Runtime["Flutter338"] = "flutter-3.38";
|
|
31558
31695
|
})(exports.Runtime || (exports.Runtime = {}));
|
|
31559
31696
|
|
|
31560
31697
|
exports.Runtimes = void 0;
|
|
@@ -31581,6 +31718,9 @@
|
|
|
31581
31718
|
Runtimes["Python312"] = "python-3.12";
|
|
31582
31719
|
Runtimes["Pythonml311"] = "python-ml-3.11";
|
|
31583
31720
|
Runtimes["Pythonml312"] = "python-ml-3.12";
|
|
31721
|
+
Runtimes["Deno121"] = "deno-1.21";
|
|
31722
|
+
Runtimes["Deno124"] = "deno-1.24";
|
|
31723
|
+
Runtimes["Deno135"] = "deno-1.35";
|
|
31584
31724
|
Runtimes["Deno140"] = "deno-1.40";
|
|
31585
31725
|
Runtimes["Deno146"] = "deno-1.46";
|
|
31586
31726
|
Runtimes["Deno20"] = "deno-2.0";
|
|
@@ -31595,6 +31735,7 @@
|
|
|
31595
31735
|
Runtimes["Dart35"] = "dart-3.5";
|
|
31596
31736
|
Runtimes["Dart38"] = "dart-3.8";
|
|
31597
31737
|
Runtimes["Dart39"] = "dart-3.9";
|
|
31738
|
+
Runtimes["Dart310"] = "dart-3.10";
|
|
31598
31739
|
Runtimes["Dotnet60"] = "dotnet-6.0";
|
|
31599
31740
|
Runtimes["Dotnet70"] = "dotnet-7.0";
|
|
31600
31741
|
Runtimes["Dotnet80"] = "dotnet-8.0";
|
|
@@ -31623,6 +31764,7 @@
|
|
|
31623
31764
|
Runtimes["Flutter329"] = "flutter-3.29";
|
|
31624
31765
|
Runtimes["Flutter332"] = "flutter-3.32";
|
|
31625
31766
|
Runtimes["Flutter335"] = "flutter-3.35";
|
|
31767
|
+
Runtimes["Flutter338"] = "flutter-3.38";
|
|
31626
31768
|
})(exports.Runtimes || (exports.Runtimes = {}));
|
|
31627
31769
|
|
|
31628
31770
|
exports.UseCases = void 0;
|
|
@@ -31790,12 +31932,6 @@
|
|
|
31790
31932
|
SMTPSecure["Ssl"] = "ssl";
|
|
31791
31933
|
})(exports.SMTPSecure || (exports.SMTPSecure = {}));
|
|
31792
31934
|
|
|
31793
|
-
exports.Status = void 0;
|
|
31794
|
-
(function (Status) {
|
|
31795
|
-
Status["Active"] = "active";
|
|
31796
|
-
Status["Archived"] = "archived";
|
|
31797
|
-
})(exports.Status || (exports.Status = {}));
|
|
31798
|
-
|
|
31799
31935
|
exports.EmailTemplateType = void 0;
|
|
31800
31936
|
(function (EmailTemplateType) {
|
|
31801
31937
|
EmailTemplateType["Verification"] = "verification";
|
|
@@ -32142,6 +32278,9 @@
|
|
|
32142
32278
|
BuildRuntime["Python312"] = "python-3.12";
|
|
32143
32279
|
BuildRuntime["Pythonml311"] = "python-ml-3.11";
|
|
32144
32280
|
BuildRuntime["Pythonml312"] = "python-ml-3.12";
|
|
32281
|
+
BuildRuntime["Deno121"] = "deno-1.21";
|
|
32282
|
+
BuildRuntime["Deno124"] = "deno-1.24";
|
|
32283
|
+
BuildRuntime["Deno135"] = "deno-1.35";
|
|
32145
32284
|
BuildRuntime["Deno140"] = "deno-1.40";
|
|
32146
32285
|
BuildRuntime["Deno146"] = "deno-1.46";
|
|
32147
32286
|
BuildRuntime["Deno20"] = "deno-2.0";
|
|
@@ -32156,6 +32295,7 @@
|
|
|
32156
32295
|
BuildRuntime["Dart35"] = "dart-3.5";
|
|
32157
32296
|
BuildRuntime["Dart38"] = "dart-3.8";
|
|
32158
32297
|
BuildRuntime["Dart39"] = "dart-3.9";
|
|
32298
|
+
BuildRuntime["Dart310"] = "dart-3.10";
|
|
32159
32299
|
BuildRuntime["Dotnet60"] = "dotnet-6.0";
|
|
32160
32300
|
BuildRuntime["Dotnet70"] = "dotnet-7.0";
|
|
32161
32301
|
BuildRuntime["Dotnet80"] = "dotnet-8.0";
|
|
@@ -32184,6 +32324,7 @@
|
|
|
32184
32324
|
BuildRuntime["Flutter329"] = "flutter-3.29";
|
|
32185
32325
|
BuildRuntime["Flutter332"] = "flutter-3.32";
|
|
32186
32326
|
BuildRuntime["Flutter335"] = "flutter-3.35";
|
|
32327
|
+
BuildRuntime["Flutter338"] = "flutter-3.38";
|
|
32187
32328
|
})(exports.BuildRuntime || (exports.BuildRuntime = {}));
|
|
32188
32329
|
|
|
32189
32330
|
exports.Adapter = void 0;
|
|
@@ -32231,15 +32372,6 @@
|
|
|
32231
32372
|
ImageGravity["Bottomright"] = "bottom-right";
|
|
32232
32373
|
})(exports.ImageGravity || (exports.ImageGravity = {}));
|
|
32233
32374
|
|
|
32234
|
-
exports.Roles = void 0;
|
|
32235
|
-
(function (Roles) {
|
|
32236
|
-
Roles["Developer"] = "developer";
|
|
32237
|
-
Roles["Editor"] = "editor";
|
|
32238
|
-
Roles["Analyst"] = "analyst";
|
|
32239
|
-
Roles["Billing"] = "billing";
|
|
32240
|
-
Roles["Owner"] = "owner";
|
|
32241
|
-
})(exports.Roles || (exports.Roles = {}));
|
|
32242
|
-
|
|
32243
32375
|
exports.PasswordHash = void 0;
|
|
32244
32376
|
(function (PasswordHash) {
|
|
32245
32377
|
PasswordHash["Sha1"] = "sha1";
|