@appwrite.io/console 2.2.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/README.md +1 -1
- package/dist/cjs/sdk.js +412 -202
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +412 -203
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +412 -202
- package/docs/examples/account/create-anonymous-session.md +2 -0
- package/docs/examples/account/create-billing-address.md +2 -0
- package/docs/examples/account/create-email-password-session.md +2 -0
- package/docs/examples/account/create-email-token.md +2 -0
- package/docs/examples/account/create-email-verification.md +2 -0
- package/docs/examples/account/create-jwt.md +2 -0
- package/docs/examples/account/create-key.md +2 -0
- package/docs/examples/account/create-magic-url-token.md +2 -0
- package/docs/examples/account/create-mfa-authenticator.md +2 -0
- package/docs/examples/account/create-mfa-challenge.md +2 -0
- package/docs/examples/account/create-mfa-recovery-codes.md +2 -0
- package/docs/examples/account/create-o-auth-2-session.md +2 -0
- package/docs/examples/account/create-o-auth-2-token.md +2 -0
- package/docs/examples/account/create-payment-method.md +2 -0
- package/docs/examples/account/create-phone-token.md +2 -0
- package/docs/examples/account/create-phone-verification.md +2 -0
- package/docs/examples/account/create-push-target.md +2 -0
- package/docs/examples/account/create-recovery.md +2 -0
- package/docs/examples/account/create-session.md +2 -0
- package/docs/examples/account/create-verification.md +2 -0
- package/docs/examples/account/create.md +2 -0
- package/docs/examples/account/delete-billing-address.md +2 -0
- package/docs/examples/account/delete-identity.md +2 -0
- package/docs/examples/account/delete-key.md +2 -0
- package/docs/examples/account/delete-mfa-authenticator.md +2 -0
- package/docs/examples/account/delete-payment-method.md +2 -0
- package/docs/examples/account/delete-push-target.md +2 -0
- package/docs/examples/account/delete-session.md +2 -0
- package/docs/examples/account/delete-sessions.md +2 -0
- package/docs/examples/account/delete.md +2 -0
- package/docs/examples/account/get-billing-address.md +2 -0
- package/docs/examples/account/get-coupon.md +2 -0
- package/docs/examples/account/get-key.md +2 -0
- package/docs/examples/account/get-mfa-recovery-codes.md +2 -0
- package/docs/examples/account/get-payment-method.md +2 -0
- package/docs/examples/account/get-prefs.md +2 -0
- package/docs/examples/account/get-session.md +2 -0
- package/docs/examples/account/get.md +2 -0
- package/docs/examples/account/list-billing-addresses.md +2 -0
- package/docs/examples/account/list-identities.md +2 -0
- package/docs/examples/account/list-invoices.md +2 -0
- package/docs/examples/account/list-keys.md +2 -0
- package/docs/examples/account/list-logs.md +2 -0
- package/docs/examples/account/list-mfa-factors.md +2 -0
- package/docs/examples/account/list-payment-methods.md +2 -0
- package/docs/examples/account/list-sessions.md +2 -0
- package/docs/examples/account/update-billing-address.md +2 -0
- package/docs/examples/account/update-email-verification.md +2 -0
- package/docs/examples/account/update-email.md +2 -0
- package/docs/examples/account/update-key.md +2 -0
- package/docs/examples/account/update-magic-url-session.md +2 -0
- package/docs/examples/account/update-mfa-authenticator.md +2 -0
- package/docs/examples/account/update-mfa-challenge.md +2 -0
- package/docs/examples/account/update-mfa-recovery-codes.md +2 -0
- package/docs/examples/account/update-mfa.md +2 -0
- package/docs/examples/account/update-name.md +2 -0
- package/docs/examples/account/update-password.md +2 -0
- package/docs/examples/account/update-payment-method-mandate-options.md +2 -0
- package/docs/examples/account/update-payment-method-provider.md +2 -0
- package/docs/examples/account/update-payment-method.md +2 -0
- package/docs/examples/account/update-phone-session.md +2 -0
- package/docs/examples/account/update-phone-verification.md +2 -0
- package/docs/examples/account/update-phone.md +2 -0
- package/docs/examples/account/update-prefs.md +2 -0
- package/docs/examples/account/update-push-target.md +2 -0
- package/docs/examples/account/update-recovery.md +2 -0
- package/docs/examples/account/update-session.md +2 -0
- package/docs/examples/account/update-status.md +2 -0
- package/docs/examples/account/update-verification.md +2 -0
- package/docs/examples/activities/get-event.md +15 -0
- package/docs/examples/activities/list-events.md +15 -0
- package/docs/examples/assistant/chat.md +2 -0
- package/docs/examples/avatars/get-browser.md +2 -0
- package/docs/examples/avatars/get-credit-card.md +2 -0
- package/docs/examples/avatars/get-favicon.md +2 -0
- package/docs/examples/avatars/get-flag.md +2 -0
- package/docs/examples/avatars/get-image.md +2 -0
- package/docs/examples/avatars/get-initials.md +2 -0
- package/docs/examples/avatars/get-qr.md +2 -0
- package/docs/examples/avatars/get-screenshot.md +2 -0
- package/docs/examples/backups/create-archive.md +4 -2
- package/docs/examples/backups/create-policy.md +4 -2
- package/docs/examples/backups/create-restoration.md +4 -2
- package/docs/examples/backups/delete-archive.md +2 -0
- package/docs/examples/backups/delete-policy.md +2 -0
- package/docs/examples/backups/get-archive.md +2 -0
- package/docs/examples/backups/get-policy.md +2 -0
- package/docs/examples/backups/get-restoration.md +2 -0
- package/docs/examples/backups/list-archives.md +2 -0
- package/docs/examples/backups/list-policies.md +2 -0
- package/docs/examples/backups/list-restorations.md +2 -0
- package/docs/examples/backups/update-policy.md +2 -0
- package/docs/examples/console/create-program-membership.md +2 -0
- package/docs/examples/console/create-source.md +2 -0
- package/docs/examples/console/get-campaign.md +2 -0
- package/docs/examples/console/get-coupon.md +2 -0
- package/docs/examples/console/get-plan.md +2 -0
- package/docs/examples/console/get-plans.md +2 -0
- package/docs/examples/console/get-program.md +2 -0
- package/docs/examples/console/get-resource.md +2 -0
- package/docs/examples/console/list-regions.md +2 -0
- package/docs/examples/console/suggest-columns.md +2 -0
- package/docs/examples/console/suggest-indexes.md +2 -0
- package/docs/examples/console/variables.md +2 -0
- package/docs/examples/databases/create-boolean-attribute.md +2 -0
- package/docs/examples/databases/create-collection.md +2 -0
- package/docs/examples/databases/create-datetime-attribute.md +2 -0
- package/docs/examples/databases/create-document.md +2 -0
- package/docs/examples/databases/create-documents.md +2 -0
- package/docs/examples/databases/create-email-attribute.md +2 -0
- package/docs/examples/databases/create-enum-attribute.md +2 -0
- package/docs/examples/databases/create-float-attribute.md +2 -0
- package/docs/examples/databases/create-index.md +2 -0
- package/docs/examples/databases/create-integer-attribute.md +2 -0
- package/docs/examples/databases/create-ip-attribute.md +2 -0
- package/docs/examples/databases/create-line-attribute.md +2 -0
- package/docs/examples/databases/create-longtext-attribute.md +4 -1
- package/docs/examples/databases/create-mediumtext-attribute.md +4 -1
- package/docs/examples/databases/create-operations.md +2 -0
- package/docs/examples/databases/create-point-attribute.md +2 -0
- package/docs/examples/databases/create-polygon-attribute.md +2 -0
- package/docs/examples/databases/create-relationship-attribute.md +2 -0
- package/docs/examples/databases/create-string-attribute.md +2 -0
- package/docs/examples/databases/create-text-attribute.md +4 -1
- package/docs/examples/databases/create-transaction.md +2 -0
- package/docs/examples/databases/create-url-attribute.md +2 -0
- package/docs/examples/databases/create-varchar-attribute.md +4 -1
- package/docs/examples/databases/create.md +2 -0
- package/docs/examples/databases/decrement-document-attribute.md +2 -0
- package/docs/examples/databases/delete-attribute.md +2 -0
- package/docs/examples/databases/delete-collection.md +2 -0
- package/docs/examples/databases/delete-document.md +2 -0
- package/docs/examples/databases/delete-documents.md +2 -0
- package/docs/examples/databases/delete-index.md +2 -0
- package/docs/examples/databases/delete-transaction.md +2 -0
- package/docs/examples/databases/delete.md +2 -0
- package/docs/examples/databases/get-attribute.md +2 -0
- package/docs/examples/databases/get-collection-usage.md +2 -0
- package/docs/examples/databases/get-collection.md +2 -0
- package/docs/examples/databases/get-document.md +2 -0
- package/docs/examples/databases/get-index.md +2 -0
- package/docs/examples/databases/get-transaction.md +2 -0
- package/docs/examples/databases/get-usage.md +2 -0
- package/docs/examples/databases/get.md +2 -0
- package/docs/examples/databases/increment-document-attribute.md +2 -0
- package/docs/examples/databases/list-attributes.md +2 -0
- package/docs/examples/databases/list-collection-logs.md +2 -0
- package/docs/examples/databases/list-collections.md +2 -0
- package/docs/examples/databases/list-document-logs.md +2 -0
- package/docs/examples/databases/list-documents.md +2 -0
- package/docs/examples/databases/list-indexes.md +2 -0
- package/docs/examples/databases/list-logs.md +2 -0
- package/docs/examples/databases/list-transactions.md +2 -0
- package/docs/examples/databases/list-usage.md +2 -0
- package/docs/examples/databases/list.md +2 -0
- package/docs/examples/databases/update-boolean-attribute.md +2 -0
- package/docs/examples/databases/update-collection.md +2 -0
- package/docs/examples/databases/update-datetime-attribute.md +2 -0
- package/docs/examples/databases/update-document.md +2 -0
- package/docs/examples/databases/update-documents.md +2 -0
- package/docs/examples/databases/update-email-attribute.md +2 -0
- package/docs/examples/databases/update-enum-attribute.md +2 -0
- package/docs/examples/databases/update-float-attribute.md +2 -0
- package/docs/examples/databases/update-integer-attribute.md +2 -0
- package/docs/examples/databases/update-ip-attribute.md +2 -0
- package/docs/examples/databases/update-line-attribute.md +2 -0
- package/docs/examples/databases/update-longtext-attribute.md +2 -0
- package/docs/examples/databases/update-mediumtext-attribute.md +2 -0
- package/docs/examples/databases/update-point-attribute.md +2 -0
- package/docs/examples/databases/update-polygon-attribute.md +2 -0
- package/docs/examples/databases/update-relationship-attribute.md +2 -0
- package/docs/examples/databases/update-string-attribute.md +2 -0
- package/docs/examples/databases/update-text-attribute.md +2 -0
- package/docs/examples/databases/update-transaction.md +2 -0
- package/docs/examples/databases/update-url-attribute.md +2 -0
- package/docs/examples/databases/update-varchar-attribute.md +2 -0
- package/docs/examples/databases/update.md +2 -0
- package/docs/examples/databases/upsert-document.md +2 -0
- package/docs/examples/databases/upsert-documents.md +2 -0
- package/docs/examples/domains/create-preset-google-workspace.md +2 -0
- package/docs/examples/domains/create-preset-i-cloud.md +2 -0
- package/docs/examples/domains/create-preset-mailgun.md +2 -0
- package/docs/examples/domains/create-preset-outlook.md +2 -0
- package/docs/examples/domains/create-preset-proton-mail.md +2 -0
- package/docs/examples/domains/create-preset-zoho.md +2 -0
- package/docs/examples/domains/create-record-a.md +2 -0
- package/docs/examples/domains/create-record-aaaa.md +2 -0
- package/docs/examples/domains/create-record-alias.md +2 -0
- package/docs/examples/domains/create-record-caa.md +2 -0
- package/docs/examples/domains/create-record-cname.md +2 -0
- package/docs/examples/domains/create-record-https.md +2 -0
- package/docs/examples/domains/create-record-mx.md +2 -0
- package/docs/examples/domains/create-record-ns.md +2 -0
- package/docs/examples/domains/create-record-srv.md +2 -0
- package/docs/examples/domains/create-record-txt.md +2 -0
- package/docs/examples/domains/create.md +2 -0
- package/docs/examples/domains/delete-record.md +2 -0
- package/docs/examples/domains/delete.md +2 -0
- package/docs/examples/domains/get-preset-google-workspace.md +2 -0
- package/docs/examples/domains/get-preset-i-cloud.md +2 -0
- package/docs/examples/domains/get-preset-mailgun.md +2 -0
- package/docs/examples/domains/get-preset-outlook.md +2 -0
- package/docs/examples/domains/get-preset-proton-mail.md +2 -0
- package/docs/examples/domains/get-preset-zoho.md +2 -0
- package/docs/examples/domains/get-price.md +17 -0
- package/docs/examples/domains/get-record.md +2 -0
- package/docs/examples/domains/get-zone.md +2 -0
- package/docs/examples/domains/get.md +2 -0
- package/docs/examples/domains/list-records.md +2 -0
- package/docs/examples/domains/list-suggestions.md +2 -0
- package/docs/examples/domains/list.md +2 -0
- package/docs/examples/domains/update-nameservers.md +2 -0
- package/docs/examples/domains/update-record-a.md +2 -0
- package/docs/examples/domains/update-record-aaaa.md +2 -0
- package/docs/examples/domains/update-record-alias.md +2 -0
- package/docs/examples/domains/update-record-caa.md +2 -0
- package/docs/examples/domains/update-record-cname.md +2 -0
- package/docs/examples/domains/update-record-https.md +2 -0
- package/docs/examples/domains/update-record-mx.md +2 -0
- package/docs/examples/domains/update-record-ns.md +2 -0
- package/docs/examples/domains/update-record-srv.md +2 -0
- package/docs/examples/domains/update-record-txt.md +2 -0
- package/docs/examples/domains/update-team.md +2 -0
- package/docs/examples/domains/update-zone.md +2 -0
- package/docs/examples/functions/create-deployment.md +2 -0
- package/docs/examples/functions/create-duplicate-deployment.md +2 -0
- package/docs/examples/functions/create-execution.md +2 -0
- package/docs/examples/functions/create-template-deployment.md +2 -0
- package/docs/examples/functions/create-variable.md +2 -0
- package/docs/examples/functions/create-vcs-deployment.md +2 -0
- package/docs/examples/functions/create.md +2 -0
- package/docs/examples/functions/delete-deployment.md +2 -0
- package/docs/examples/functions/delete-execution.md +2 -0
- package/docs/examples/functions/delete-variable.md +2 -0
- package/docs/examples/functions/delete.md +2 -0
- package/docs/examples/functions/get-deployment-download.md +2 -0
- package/docs/examples/functions/get-deployment.md +2 -0
- package/docs/examples/functions/get-execution.md +2 -0
- package/docs/examples/functions/get-template.md +2 -0
- package/docs/examples/functions/get-usage.md +2 -0
- package/docs/examples/functions/get-variable.md +2 -0
- package/docs/examples/functions/get.md +2 -0
- package/docs/examples/functions/list-deployments.md +2 -0
- package/docs/examples/functions/list-executions.md +2 -0
- package/docs/examples/functions/list-runtimes.md +2 -0
- package/docs/examples/functions/list-specifications.md +2 -0
- package/docs/examples/functions/list-templates.md +2 -0
- package/docs/examples/functions/list-usage.md +2 -0
- package/docs/examples/functions/list-variables.md +2 -0
- package/docs/examples/functions/list.md +2 -0
- package/docs/examples/functions/update-deployment-status.md +2 -0
- package/docs/examples/functions/update-function-deployment.md +2 -0
- package/docs/examples/functions/update-variable.md +2 -0
- package/docs/examples/functions/update.md +2 -0
- package/docs/examples/graphql/mutation.md +2 -0
- package/docs/examples/graphql/query.md +2 -0
- package/docs/examples/health/get-antivirus.md +2 -0
- package/docs/examples/health/get-cache.md +2 -0
- package/docs/examples/health/get-certificate.md +2 -0
- package/docs/examples/health/get-db.md +2 -0
- package/docs/examples/health/get-failed-jobs.md +2 -0
- package/docs/examples/health/get-pub-sub.md +2 -0
- package/docs/examples/health/get-queue-audits.md +2 -0
- package/docs/examples/health/get-queue-billing-project-aggregation.md +2 -0
- package/docs/examples/health/get-queue-billing-team-aggregation.md +2 -0
- package/docs/examples/health/get-queue-builds.md +2 -0
- package/docs/examples/health/get-queue-certificates.md +2 -0
- package/docs/examples/health/get-queue-databases.md +2 -0
- package/docs/examples/health/get-queue-deletes.md +2 -0
- package/docs/examples/health/get-queue-functions.md +2 -0
- package/docs/examples/health/get-queue-logs.md +2 -0
- package/docs/examples/health/get-queue-mails.md +2 -0
- package/docs/examples/health/get-queue-messaging.md +2 -0
- package/docs/examples/health/get-queue-migrations.md +2 -0
- package/docs/examples/health/get-queue-priority-builds.md +2 -0
- package/docs/examples/health/get-queue-region-manager.md +2 -0
- package/docs/examples/health/get-queue-stats-resources.md +2 -0
- package/docs/examples/health/get-queue-threats.md +2 -0
- package/docs/examples/health/get-queue-usage.md +2 -0
- package/docs/examples/health/get-queue-webhooks.md +2 -0
- package/docs/examples/health/get-storage-local.md +2 -0
- package/docs/examples/health/get-storage.md +2 -0
- package/docs/examples/health/get-time.md +2 -0
- package/docs/examples/health/get.md +2 -0
- package/docs/examples/locale/get.md +2 -0
- package/docs/examples/locale/list-codes.md +2 -0
- package/docs/examples/locale/list-continents.md +2 -0
- package/docs/examples/locale/list-countries-eu.md +2 -0
- package/docs/examples/locale/list-countries-phones.md +2 -0
- package/docs/examples/locale/list-countries.md +2 -0
- package/docs/examples/locale/list-currencies.md +2 -0
- package/docs/examples/locale/list-languages.md +2 -0
- package/docs/examples/messaging/create-apns-provider.md +2 -0
- package/docs/examples/messaging/create-email.md +2 -0
- package/docs/examples/messaging/create-fcm-provider.md +2 -0
- package/docs/examples/messaging/create-mailgun-provider.md +2 -0
- package/docs/examples/messaging/create-msg-91-provider.md +2 -0
- package/docs/examples/messaging/create-push.md +2 -0
- package/docs/examples/messaging/create-resend-provider.md +2 -0
- package/docs/examples/messaging/create-sendgrid-provider.md +2 -0
- package/docs/examples/messaging/create-sms.md +2 -0
- package/docs/examples/messaging/create-smtp-provider.md +2 -0
- package/docs/examples/messaging/create-subscriber.md +2 -0
- package/docs/examples/messaging/create-telesign-provider.md +2 -0
- package/docs/examples/messaging/create-textmagic-provider.md +2 -0
- package/docs/examples/messaging/create-topic.md +2 -0
- package/docs/examples/messaging/create-twilio-provider.md +2 -0
- package/docs/examples/messaging/create-vonage-provider.md +2 -0
- package/docs/examples/messaging/delete-provider.md +2 -0
- package/docs/examples/messaging/delete-subscriber.md +2 -0
- package/docs/examples/messaging/delete-topic.md +2 -0
- package/docs/examples/messaging/delete.md +2 -0
- package/docs/examples/messaging/get-message.md +2 -0
- package/docs/examples/messaging/get-provider.md +2 -0
- package/docs/examples/messaging/get-subscriber.md +2 -0
- package/docs/examples/messaging/get-topic.md +2 -0
- package/docs/examples/messaging/list-message-logs.md +2 -0
- package/docs/examples/messaging/list-messages.md +2 -0
- package/docs/examples/messaging/list-provider-logs.md +2 -0
- package/docs/examples/messaging/list-providers.md +2 -0
- package/docs/examples/messaging/list-subscriber-logs.md +2 -0
- package/docs/examples/messaging/list-subscribers.md +2 -0
- package/docs/examples/messaging/list-targets.md +2 -0
- package/docs/examples/messaging/list-topic-logs.md +2 -0
- package/docs/examples/messaging/list-topics.md +2 -0
- package/docs/examples/messaging/update-apns-provider.md +2 -0
- package/docs/examples/messaging/update-email.md +2 -0
- package/docs/examples/messaging/update-fcm-provider.md +2 -0
- package/docs/examples/messaging/update-mailgun-provider.md +2 -0
- package/docs/examples/messaging/update-msg-91-provider.md +2 -0
- package/docs/examples/messaging/update-push.md +2 -0
- package/docs/examples/messaging/update-resend-provider.md +2 -0
- package/docs/examples/messaging/update-sendgrid-provider.md +2 -0
- package/docs/examples/messaging/update-sms.md +2 -0
- package/docs/examples/messaging/update-smtp-provider.md +2 -0
- package/docs/examples/messaging/update-telesign-provider.md +2 -0
- package/docs/examples/messaging/update-textmagic-provider.md +2 -0
- package/docs/examples/messaging/update-topic.md +2 -0
- package/docs/examples/messaging/update-twilio-provider.md +2 -0
- package/docs/examples/messaging/update-vonage-provider.md +2 -0
- package/docs/examples/migrations/create-appwrite-migration.md +2 -0
- package/docs/examples/migrations/create-csv-export.md +2 -0
- package/docs/examples/migrations/create-csv-import.md +2 -0
- package/docs/examples/migrations/create-firebase-migration.md +2 -0
- package/docs/examples/migrations/create-n-host-migration.md +2 -0
- package/docs/examples/migrations/create-supabase-migration.md +2 -0
- package/docs/examples/migrations/delete.md +2 -0
- package/docs/examples/migrations/get-appwrite-report.md +2 -0
- package/docs/examples/migrations/get-firebase-report.md +2 -0
- package/docs/examples/migrations/get-n-host-report.md +2 -0
- package/docs/examples/migrations/get-supabase-report.md +2 -0
- package/docs/examples/migrations/get.md +2 -0
- package/docs/examples/migrations/list.md +2 -0
- package/docs/examples/migrations/retry.md +2 -0
- package/docs/examples/organizations/add-credit.md +2 -0
- package/docs/examples/organizations/cancel-downgrade.md +2 -0
- package/docs/examples/organizations/create-downgrade-feedback.md +2 -0
- package/docs/examples/organizations/create-invoice-payment.md +2 -0
- package/docs/examples/organizations/create-key.md +2 -0
- package/docs/examples/organizations/create.md +2 -0
- package/docs/examples/organizations/delete-backup-payment-method.md +2 -0
- package/docs/examples/organizations/delete-billing-address.md +2 -0
- package/docs/examples/organizations/delete-default-payment-method.md +2 -0
- package/docs/examples/organizations/delete-key.md +2 -0
- package/docs/examples/organizations/delete.md +2 -0
- package/docs/examples/organizations/estimation-create-organization.md +2 -0
- package/docs/examples/organizations/estimation-delete-organization.md +2 -0
- package/docs/examples/organizations/estimation-update-plan.md +2 -0
- package/docs/examples/organizations/get-aggregation.md +2 -0
- package/docs/examples/organizations/get-available-credits.md +2 -0
- package/docs/examples/organizations/get-billing-address.md +2 -0
- package/docs/examples/organizations/get-credit.md +2 -0
- package/docs/examples/organizations/get-invoice-download.md +2 -0
- package/docs/examples/organizations/get-invoice-view.md +2 -0
- package/docs/examples/organizations/get-invoice.md +2 -0
- package/docs/examples/organizations/get-key.md +2 -0
- package/docs/examples/organizations/get-payment-method.md +2 -0
- package/docs/examples/organizations/get-plan.md +2 -0
- package/docs/examples/organizations/get-scopes.md +2 -0
- package/docs/examples/organizations/get-usage.md +2 -0
- package/docs/examples/organizations/list-aggregations.md +2 -0
- package/docs/examples/organizations/list-credits.md +2 -0
- package/docs/examples/organizations/list-invoices.md +2 -0
- package/docs/examples/organizations/list-keys.md +2 -0
- package/docs/examples/organizations/list-regions.md +2 -0
- package/docs/examples/organizations/list.md +2 -0
- package/docs/examples/organizations/set-backup-payment-method.md +2 -0
- package/docs/examples/organizations/set-billing-address.md +2 -0
- package/docs/examples/organizations/set-billing-email.md +2 -0
- package/docs/examples/organizations/set-billing-tax-id.md +2 -0
- package/docs/examples/organizations/set-default-payment-method.md +2 -0
- package/docs/examples/organizations/update-budget.md +2 -0
- package/docs/examples/organizations/update-key.md +2 -0
- package/docs/examples/organizations/update-plan.md +2 -0
- package/docs/examples/organizations/validate-invoice.md +2 -0
- package/docs/examples/organizations/validate-payment.md +2 -0
- package/docs/examples/project/create-variable.md +2 -0
- package/docs/examples/project/delete-variable.md +2 -0
- package/docs/examples/project/get-usage.md +2 -0
- package/docs/examples/project/get-variable.md +2 -0
- package/docs/examples/project/list-variables.md +2 -0
- package/docs/examples/project/update-variable.md +2 -0
- package/docs/examples/projects/create-dev-key.md +2 -0
- package/docs/examples/projects/create-jwt.md +2 -0
- package/docs/examples/projects/create-key.md +3 -0
- package/docs/examples/projects/create-platform.md +2 -0
- package/docs/examples/projects/create-smtp-test.md +2 -0
- package/docs/examples/projects/create-webhook.md +2 -0
- package/docs/examples/projects/create.md +2 -0
- package/docs/examples/projects/delete-dev-key.md +2 -0
- package/docs/examples/projects/delete-email-template.md +2 -0
- package/docs/examples/projects/delete-key.md +2 -0
- package/docs/examples/projects/delete-platform.md +2 -0
- package/docs/examples/projects/delete-sms-template.md +2 -0
- package/docs/examples/projects/delete-webhook.md +2 -0
- package/docs/examples/projects/delete.md +2 -0
- package/docs/examples/projects/get-dev-key.md +2 -0
- package/docs/examples/projects/get-email-template.md +2 -0
- package/docs/examples/projects/get-key.md +2 -0
- package/docs/examples/projects/get-platform.md +2 -0
- package/docs/examples/projects/get-sms-template.md +2 -0
- package/docs/examples/projects/get-webhook.md +2 -0
- package/docs/examples/projects/get.md +2 -0
- package/docs/examples/projects/list-dev-keys.md +2 -0
- package/docs/examples/projects/list-keys.md +3 -0
- package/docs/examples/projects/list-platforms.md +2 -0
- package/docs/examples/projects/list-webhooks.md +2 -0
- package/docs/examples/projects/list.md +2 -0
- package/docs/examples/projects/update-api-status-all.md +2 -0
- package/docs/examples/projects/update-api-status.md +2 -0
- package/docs/examples/projects/update-auth-duration.md +2 -0
- package/docs/examples/projects/update-auth-limit.md +2 -0
- package/docs/examples/projects/update-auth-password-dictionary.md +2 -0
- package/docs/examples/projects/update-auth-password-history.md +2 -0
- package/docs/examples/projects/update-auth-sessions-limit.md +2 -0
- package/docs/examples/projects/update-auth-status.md +2 -0
- package/docs/examples/projects/update-dev-key.md +2 -0
- package/docs/examples/projects/update-email-template.md +2 -0
- package/docs/examples/projects/update-key.md +2 -0
- package/docs/examples/projects/update-labels.md +2 -0
- package/docs/examples/projects/update-memberships-privacy.md +2 -0
- package/docs/examples/projects/update-mock-numbers.md +2 -0
- package/docs/examples/projects/update-o-auth-2.md +2 -0
- package/docs/examples/projects/update-personal-data-check.md +2 -0
- package/docs/examples/projects/update-platform.md +2 -0
- package/docs/examples/projects/update-service-status-all.md +2 -0
- package/docs/examples/projects/update-service-status.md +2 -0
- package/docs/examples/projects/update-session-alerts.md +2 -0
- package/docs/examples/projects/update-session-invalidation.md +2 -0
- package/docs/examples/projects/update-sms-template.md +2 -0
- package/docs/examples/projects/update-smtp.md +2 -0
- package/docs/examples/projects/update-team.md +2 -0
- package/docs/examples/projects/update-webhook-signature.md +2 -0
- package/docs/examples/projects/update-webhook.md +2 -0
- package/docs/examples/projects/update.md +2 -0
- package/docs/examples/proxy/create-api-rule.md +2 -0
- package/docs/examples/proxy/create-function-rule.md +2 -0
- package/docs/examples/proxy/create-redirect-rule.md +2 -0
- package/docs/examples/proxy/create-site-rule.md +2 -0
- package/docs/examples/proxy/delete-rule.md +2 -0
- package/docs/examples/proxy/get-rule.md +2 -0
- package/docs/examples/proxy/list-rules.md +2 -0
- package/docs/examples/proxy/update-rule-verification.md +2 -0
- package/docs/examples/sites/create-deployment.md +2 -0
- package/docs/examples/sites/create-duplicate-deployment.md +2 -0
- package/docs/examples/sites/create-template-deployment.md +2 -0
- package/docs/examples/sites/create-variable.md +2 -0
- package/docs/examples/sites/create-vcs-deployment.md +2 -0
- package/docs/examples/sites/create.md +2 -0
- package/docs/examples/sites/delete-deployment.md +2 -0
- package/docs/examples/sites/delete-log.md +2 -0
- package/docs/examples/sites/delete-variable.md +2 -0
- package/docs/examples/sites/delete.md +2 -0
- package/docs/examples/sites/get-deployment-download.md +2 -0
- package/docs/examples/sites/get-deployment.md +2 -0
- package/docs/examples/sites/get-log.md +2 -0
- package/docs/examples/sites/get-template.md +2 -0
- package/docs/examples/sites/get-usage.md +2 -0
- package/docs/examples/sites/get-variable.md +2 -0
- package/docs/examples/sites/get.md +2 -0
- package/docs/examples/sites/list-deployments.md +2 -0
- package/docs/examples/sites/list-frameworks.md +2 -0
- package/docs/examples/sites/list-logs.md +2 -0
- package/docs/examples/sites/list-specifications.md +2 -0
- package/docs/examples/sites/list-templates.md +2 -0
- package/docs/examples/sites/list-usage.md +2 -0
- package/docs/examples/sites/list-variables.md +2 -0
- package/docs/examples/sites/list.md +2 -0
- package/docs/examples/sites/update-deployment-status.md +2 -0
- package/docs/examples/sites/update-site-deployment.md +2 -0
- package/docs/examples/sites/update-variable.md +2 -0
- package/docs/examples/sites/update.md +2 -0
- package/docs/examples/storage/create-bucket.md +2 -0
- package/docs/examples/storage/create-file.md +2 -0
- package/docs/examples/storage/delete-bucket.md +2 -0
- package/docs/examples/storage/delete-file.md +2 -0
- package/docs/examples/storage/get-bucket-usage.md +2 -0
- package/docs/examples/storage/get-bucket.md +2 -0
- package/docs/examples/storage/get-file-download.md +2 -0
- package/docs/examples/storage/get-file-preview.md +2 -0
- package/docs/examples/storage/get-file-view.md +2 -0
- package/docs/examples/storage/get-file.md +2 -0
- package/docs/examples/storage/get-usage.md +2 -0
- package/docs/examples/storage/list-buckets.md +2 -0
- package/docs/examples/storage/list-files.md +2 -0
- package/docs/examples/storage/update-bucket.md +2 -0
- package/docs/examples/storage/update-file.md +2 -0
- package/docs/examples/tablesdb/create-boolean-column.md +2 -0
- package/docs/examples/tablesdb/create-datetime-column.md +2 -0
- package/docs/examples/tablesdb/create-email-column.md +2 -0
- package/docs/examples/tablesdb/create-enum-column.md +2 -0
- package/docs/examples/tablesdb/create-float-column.md +2 -0
- package/docs/examples/tablesdb/create-index.md +2 -0
- package/docs/examples/tablesdb/create-integer-column.md +2 -0
- package/docs/examples/tablesdb/create-ip-column.md +2 -0
- package/docs/examples/tablesdb/create-line-column.md +2 -0
- package/docs/examples/tablesdb/create-longtext-column.md +4 -1
- package/docs/examples/tablesdb/create-mediumtext-column.md +4 -1
- package/docs/examples/tablesdb/create-operations.md +2 -0
- package/docs/examples/tablesdb/create-point-column.md +2 -0
- package/docs/examples/tablesdb/create-polygon-column.md +2 -0
- package/docs/examples/tablesdb/create-relationship-column.md +2 -0
- package/docs/examples/tablesdb/create-row.md +2 -0
- package/docs/examples/tablesdb/create-rows.md +2 -0
- package/docs/examples/tablesdb/create-string-column.md +2 -0
- package/docs/examples/tablesdb/create-table.md +2 -0
- package/docs/examples/tablesdb/create-text-column.md +4 -1
- package/docs/examples/tablesdb/create-transaction.md +2 -0
- package/docs/examples/tablesdb/create-url-column.md +2 -0
- package/docs/examples/tablesdb/create-varchar-column.md +4 -1
- package/docs/examples/tablesdb/create.md +2 -0
- package/docs/examples/tablesdb/decrement-row-column.md +2 -0
- package/docs/examples/tablesdb/delete-column.md +2 -0
- package/docs/examples/tablesdb/delete-index.md +2 -0
- package/docs/examples/tablesdb/delete-row.md +2 -0
- package/docs/examples/tablesdb/delete-rows.md +2 -0
- package/docs/examples/tablesdb/delete-table.md +2 -0
- package/docs/examples/tablesdb/delete-transaction.md +2 -0
- package/docs/examples/tablesdb/delete.md +2 -0
- package/docs/examples/tablesdb/get-column.md +2 -0
- package/docs/examples/tablesdb/get-index.md +2 -0
- package/docs/examples/tablesdb/get-row.md +2 -0
- package/docs/examples/tablesdb/get-table-usage.md +2 -0
- package/docs/examples/tablesdb/get-table.md +2 -0
- package/docs/examples/tablesdb/get-transaction.md +2 -0
- package/docs/examples/tablesdb/get-usage.md +2 -0
- package/docs/examples/tablesdb/get.md +2 -0
- package/docs/examples/tablesdb/increment-row-column.md +2 -0
- package/docs/examples/tablesdb/list-columns.md +2 -0
- package/docs/examples/tablesdb/list-indexes.md +2 -0
- package/docs/examples/tablesdb/list-row-logs.md +2 -0
- package/docs/examples/tablesdb/list-rows.md +2 -0
- package/docs/examples/tablesdb/list-table-logs.md +2 -0
- package/docs/examples/tablesdb/list-tables.md +2 -0
- package/docs/examples/tablesdb/list-transactions.md +2 -0
- package/docs/examples/tablesdb/list-usage.md +2 -0
- package/docs/examples/tablesdb/list.md +2 -0
- package/docs/examples/tablesdb/update-boolean-column.md +2 -0
- package/docs/examples/tablesdb/update-datetime-column.md +2 -0
- package/docs/examples/tablesdb/update-email-column.md +2 -0
- package/docs/examples/tablesdb/update-enum-column.md +2 -0
- package/docs/examples/tablesdb/update-float-column.md +2 -0
- package/docs/examples/tablesdb/update-integer-column.md +2 -0
- package/docs/examples/tablesdb/update-ip-column.md +2 -0
- package/docs/examples/tablesdb/update-line-column.md +2 -0
- package/docs/examples/tablesdb/update-longtext-column.md +2 -0
- package/docs/examples/tablesdb/update-mediumtext-column.md +2 -0
- package/docs/examples/tablesdb/update-point-column.md +2 -0
- package/docs/examples/tablesdb/update-polygon-column.md +2 -0
- package/docs/examples/tablesdb/update-relationship-column.md +2 -0
- package/docs/examples/tablesdb/update-row.md +2 -0
- package/docs/examples/tablesdb/update-rows.md +2 -0
- package/docs/examples/tablesdb/update-string-column.md +2 -0
- package/docs/examples/tablesdb/update-table.md +2 -0
- package/docs/examples/tablesdb/update-text-column.md +2 -0
- package/docs/examples/tablesdb/update-transaction.md +2 -0
- package/docs/examples/tablesdb/update-url-column.md +2 -0
- package/docs/examples/tablesdb/update-varchar-column.md +2 -0
- package/docs/examples/tablesdb/update.md +2 -0
- package/docs/examples/tablesdb/upsert-row.md +2 -0
- package/docs/examples/tablesdb/upsert-rows.md +2 -0
- package/docs/examples/teams/create-membership.md +4 -2
- package/docs/examples/teams/create.md +2 -0
- package/docs/examples/teams/delete-membership.md +2 -0
- package/docs/examples/teams/delete.md +2 -0
- package/docs/examples/teams/get-membership.md +2 -0
- package/docs/examples/teams/get-prefs.md +2 -0
- package/docs/examples/teams/get.md +2 -0
- package/docs/examples/teams/list-logs.md +2 -0
- package/docs/examples/teams/list-memberships.md +2 -0
- package/docs/examples/teams/list.md +2 -0
- package/docs/examples/teams/update-membership-status.md +2 -0
- package/docs/examples/teams/update-membership.md +4 -2
- package/docs/examples/teams/update-name.md +2 -0
- package/docs/examples/teams/update-prefs.md +2 -0
- package/docs/examples/tokens/create-file-token.md +2 -0
- package/docs/examples/tokens/delete.md +2 -0
- package/docs/examples/tokens/get.md +2 -0
- package/docs/examples/tokens/list.md +2 -0
- package/docs/examples/tokens/update.md +2 -0
- package/docs/examples/users/create-argon-2-user.md +2 -0
- package/docs/examples/users/create-bcrypt-user.md +2 -0
- package/docs/examples/users/create-jwt.md +2 -0
- package/docs/examples/users/create-md-5-user.md +2 -0
- package/docs/examples/users/create-mfa-recovery-codes.md +2 -0
- package/docs/examples/users/create-ph-pass-user.md +2 -0
- package/docs/examples/users/create-scrypt-modified-user.md +2 -0
- package/docs/examples/users/create-scrypt-user.md +2 -0
- package/docs/examples/users/create-session.md +2 -0
- package/docs/examples/users/create-sha-user.md +2 -0
- package/docs/examples/users/create-target.md +2 -0
- package/docs/examples/users/create-token.md +2 -0
- package/docs/examples/users/create.md +2 -0
- package/docs/examples/users/delete-identity.md +2 -0
- package/docs/examples/users/delete-mfa-authenticator.md +2 -0
- package/docs/examples/users/delete-session.md +2 -0
- package/docs/examples/users/delete-sessions.md +2 -0
- package/docs/examples/users/delete-target.md +2 -0
- package/docs/examples/users/delete.md +2 -0
- package/docs/examples/users/get-mfa-recovery-codes.md +2 -0
- package/docs/examples/users/get-prefs.md +2 -0
- package/docs/examples/users/get-target.md +2 -0
- package/docs/examples/users/get-usage.md +2 -0
- package/docs/examples/users/get.md +2 -0
- package/docs/examples/users/list-identities.md +2 -0
- package/docs/examples/users/list-logs.md +2 -0
- package/docs/examples/users/list-memberships.md +2 -0
- package/docs/examples/users/list-mfa-factors.md +2 -0
- package/docs/examples/users/list-sessions.md +2 -0
- package/docs/examples/users/list-targets.md +2 -0
- package/docs/examples/users/list.md +2 -0
- package/docs/examples/users/update-email-verification.md +2 -0
- package/docs/examples/users/update-email.md +2 -0
- package/docs/examples/users/update-labels.md +2 -0
- package/docs/examples/users/update-mfa-recovery-codes.md +2 -0
- package/docs/examples/users/update-mfa.md +2 -0
- package/docs/examples/users/update-name.md +2 -0
- package/docs/examples/users/update-password.md +2 -0
- package/docs/examples/users/update-phone-verification.md +2 -0
- package/docs/examples/users/update-phone.md +2 -0
- package/docs/examples/users/update-prefs.md +2 -0
- package/docs/examples/users/update-status.md +2 -0
- package/docs/examples/users/update-target.md +2 -0
- package/docs/examples/vcs/create-repository-detection.md +2 -0
- package/docs/examples/vcs/create-repository.md +2 -0
- package/docs/examples/vcs/delete-installation.md +2 -0
- package/docs/examples/vcs/get-installation.md +2 -0
- package/docs/examples/vcs/get-repository-contents.md +2 -0
- package/docs/examples/vcs/get-repository.md +2 -0
- package/docs/examples/vcs/list-installations.md +2 -0
- package/docs/examples/vcs/list-repositories.md +2 -0
- package/docs/examples/vcs/list-repository-branches.md +2 -0
- package/docs/examples/vcs/update-external-deployments.md +2 -0
- package/package.json +1 -1
- package/src/channel.ts +30 -18
- package/src/client.ts +108 -22
- package/src/enums/{services.ts → backup-services.ts} +1 -1
- package/src/enums/build-runtime.ts +2 -0
- package/src/enums/registration-type.ts +6 -0
- package/src/enums/runtime.ts +2 -0
- package/src/enums/runtimes.ts +2 -0
- package/src/enums/scopes.ts +1 -0
- package/src/index.ts +3 -3
- package/src/models.ts +227 -5
- package/src/services/account.ts +11 -11
- package/src/services/activities.ts +116 -0
- package/src/services/avatars.ts +3 -3
- package/src/services/backups.ts +28 -28
- package/src/services/console.ts +1 -1
- package/src/services/databases.ts +57 -29
- package/src/services/domains.ts +70 -0
- package/src/services/functions.ts +2 -2
- package/src/services/graphql.ts +2 -2
- package/src/services/health.ts +1 -1
- package/src/services/migrations.ts +10 -10
- package/src/services/organizations.ts +0 -60
- package/src/services/projects.ts +28 -78
- package/src/services/realtime.ts +135 -58
- package/src/services/sites.ts +2 -2
- package/src/services/storage.ts +1 -1
- package/src/services/tables-db.ts +57 -29
- package/src/services/teams.ts +18 -19
- package/src/services/users.ts +1 -1
- package/types/channel.d.ts +4 -3
- package/types/client.d.ts +7 -2
- package/types/enums/{services.d.ts → backup-services.d.ts} +1 -1
- package/types/enums/build-runtime.d.ts +3 -1
- package/types/enums/registration-type.d.ts +6 -0
- package/types/enums/runtime.d.ts +3 -1
- package/types/enums/runtimes.d.ts +3 -1
- package/types/enums/scopes.d.ts +2 -1
- package/types/index.d.ts +3 -3
- package/types/models.d.ts +224 -5
- package/types/services/activities.d.ts +46 -0
- package/types/services/backups.d.ts +13 -13
- package/types/services/databases.d.ts +16 -4
- package/types/services/domains.d.ts +26 -0
- package/types/services/migrations.d.ts +2 -2
- package/types/services/organizations.d.ts +0 -22
- package/types/services/projects.d.ts +8 -25
- package/types/services/realtime.d.ts +13 -6
- package/types/services/tables-db.d.ts +16 -4
- package/types/services/teams.d.ts +8 -9
- package/docs/examples/organizations/update-projects.md +0 -14
- package/docs/examples/projects/update-status.md +0 -14
- package/src/enums/roles.ts +0 -7
- package/src/enums/status.ts +0 -4
- package/types/enums/roles.d.ts +0 -7
- package/types/enums/status.d.ts +0 -4
package/src/services/realtime.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AppwriteException, Client } from '../client';
|
|
2
2
|
import { Channel, ActionableChannel, ResolvedChannel } from '../channel';
|
|
3
|
+
import { Query } from '../query';
|
|
3
4
|
|
|
4
5
|
export type RealtimeSubscription = {
|
|
5
6
|
close: () => Promise<void>;
|
|
@@ -7,6 +8,7 @@ export type RealtimeSubscription = {
|
|
|
7
8
|
|
|
8
9
|
export type RealtimeCallback<T = any> = {
|
|
9
10
|
channels: Set<string>;
|
|
11
|
+
queries: string[]; // Array of query strings
|
|
10
12
|
callback: (event: RealtimeResponseEvent<T>) => void;
|
|
11
13
|
}
|
|
12
14
|
|
|
@@ -20,11 +22,13 @@ export type RealtimeResponseEvent<T = any> = {
|
|
|
20
22
|
channels: string[];
|
|
21
23
|
timestamp: string;
|
|
22
24
|
payload: T;
|
|
25
|
+
subscriptions: string[]; // Backend-provided subscription IDs
|
|
23
26
|
}
|
|
24
27
|
|
|
25
28
|
export type RealtimeResponseConnected = {
|
|
26
29
|
channels: string[];
|
|
27
30
|
user?: object;
|
|
31
|
+
subscriptions?: { [slot: string]: string }; // Map slot index -> subscriptionId
|
|
28
32
|
}
|
|
29
33
|
|
|
30
34
|
export type RealtimeRequest = {
|
|
@@ -50,13 +54,18 @@ export class Realtime {
|
|
|
50
54
|
|
|
51
55
|
private client: Client;
|
|
52
56
|
private socket?: WebSocket;
|
|
53
|
-
|
|
57
|
+
// Slot-centric state: Map<slot, { channels: Set<string>, queries: string[], callback: Function }>
|
|
54
58
|
private activeSubscriptions = new Map<number, RealtimeCallback<any>>();
|
|
59
|
+
// Map slot index -> subscriptionId (from backend)
|
|
60
|
+
private slotToSubscriptionId = new Map<number, string>();
|
|
61
|
+
// Inverse map: subscriptionId -> slot index (for O(1) lookup)
|
|
62
|
+
private subscriptionIdToSlot = new Map<string, number>();
|
|
55
63
|
private heartbeatTimer?: number;
|
|
56
64
|
|
|
57
65
|
private subCallDepth = 0;
|
|
58
66
|
private reconnectAttempts = 0;
|
|
59
67
|
private subscriptionsCounter = 0;
|
|
68
|
+
private connectionId = 0;
|
|
60
69
|
private reconnect = true;
|
|
61
70
|
|
|
62
71
|
private onErrorCallbacks: Array<(error?: Error, statusCode?: number) => void> = [];
|
|
@@ -114,7 +123,7 @@ export class Realtime {
|
|
|
114
123
|
}
|
|
115
124
|
|
|
116
125
|
private async createSocket(): Promise<void> {
|
|
117
|
-
if (this.
|
|
126
|
+
if (this.activeSubscriptions.size === 0) {
|
|
118
127
|
this.reconnect = false;
|
|
119
128
|
await this.closeSocket();
|
|
120
129
|
return;
|
|
@@ -125,11 +134,40 @@ export class Realtime {
|
|
|
125
134
|
throw new AppwriteException('Missing project ID');
|
|
126
135
|
}
|
|
127
136
|
|
|
137
|
+
// Collect all unique channels from all slots
|
|
138
|
+
const allChannels = new Set<string>();
|
|
139
|
+
for (const subscription of this.activeSubscriptions.values()) {
|
|
140
|
+
for (const channel of subscription.channels) {
|
|
141
|
+
allChannels.add(channel);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
128
145
|
let queryParams = `project=${projectId}`;
|
|
129
|
-
for (const channel of
|
|
146
|
+
for (const channel of allChannels) {
|
|
130
147
|
queryParams += `&channels[]=${encodeURIComponent(channel)}`;
|
|
131
148
|
}
|
|
132
149
|
|
|
150
|
+
// Build query string from slots → channels → queries
|
|
151
|
+
// Format: channel[slot][]=query
|
|
152
|
+
// For each slot, repeat its queries under each channel it subscribes to
|
|
153
|
+
// Example: slot 1 → channels [tests, prod], queries [q1, q2]
|
|
154
|
+
// Produces: tests[1][]=q1&tests[1][]=q2&prod[1][]=q1&prod[1][]=q2
|
|
155
|
+
const selectAllQuery = Query.select(['*']).toString();
|
|
156
|
+
for (const [slot, subscription] of this.activeSubscriptions) {
|
|
157
|
+
// queries is string[] - iterate over each query string
|
|
158
|
+
const queries = subscription.queries.length === 0
|
|
159
|
+
? [selectAllQuery]
|
|
160
|
+
: subscription.queries;
|
|
161
|
+
|
|
162
|
+
// Repeat this slot's queries under each channel it subscribes to
|
|
163
|
+
// Each query is sent as a separate parameter: channel[slot][]=q1&channel[slot][]=q2
|
|
164
|
+
for (const channel of subscription.channels) {
|
|
165
|
+
for (const query of queries) {
|
|
166
|
+
queryParams += `&${encodeURIComponent(channel)}[${slot}][]=${encodeURIComponent(query)}`;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
133
171
|
const endpoint =
|
|
134
172
|
this.client.config.endpointRealtime !== ''
|
|
135
173
|
? this.client.config.endpointRealtime
|
|
@@ -141,21 +179,32 @@ export class Realtime {
|
|
|
141
179
|
|
|
142
180
|
if (this.socket) {
|
|
143
181
|
this.reconnect = false;
|
|
144
|
-
|
|
182
|
+
if (this.socket.readyState < WebSocket.CLOSING) {
|
|
183
|
+
await this.closeSocket();
|
|
184
|
+
}
|
|
185
|
+
// Ensure reconnect isn't stuck false if close event was missed.
|
|
186
|
+
this.reconnect = true;
|
|
145
187
|
}
|
|
146
188
|
|
|
147
189
|
return new Promise((resolve, reject) => {
|
|
148
190
|
try {
|
|
149
|
-
|
|
191
|
+
const connectionId = ++this.connectionId;
|
|
192
|
+
const socket = (this.socket = new WebSocket(url));
|
|
150
193
|
|
|
151
|
-
|
|
194
|
+
socket.addEventListener('open', () => {
|
|
195
|
+
if (connectionId !== this.connectionId) {
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
152
198
|
this.reconnectAttempts = 0;
|
|
153
199
|
this.onOpenCallbacks.forEach(callback => callback());
|
|
154
200
|
this.startHeartbeat();
|
|
155
201
|
resolve();
|
|
156
202
|
});
|
|
157
203
|
|
|
158
|
-
|
|
204
|
+
socket.addEventListener('message', (event: MessageEvent) => {
|
|
205
|
+
if (connectionId !== this.connectionId) {
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
159
208
|
try {
|
|
160
209
|
const message = JSON.parse(event.data) as RealtimeResponse;
|
|
161
210
|
this.handleMessage(message);
|
|
@@ -164,7 +213,10 @@ export class Realtime {
|
|
|
164
213
|
}
|
|
165
214
|
});
|
|
166
215
|
|
|
167
|
-
|
|
216
|
+
socket.addEventListener('close', async (event: CloseEvent) => {
|
|
217
|
+
if (connectionId !== this.connectionId || socket !== this.socket) {
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
168
220
|
this.stopHeartbeat();
|
|
169
221
|
this.onCloseCallbacks.forEach(callback => callback());
|
|
170
222
|
|
|
@@ -186,7 +238,10 @@ export class Realtime {
|
|
|
186
238
|
}
|
|
187
239
|
});
|
|
188
240
|
|
|
189
|
-
|
|
241
|
+
socket.addEventListener('error', (event: Event) => {
|
|
242
|
+
if (connectionId !== this.connectionId || socket !== this.socket) {
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
190
245
|
this.stopHeartbeat();
|
|
191
246
|
const error = new Error('WebSocket error');
|
|
192
247
|
console.error('WebSocket error:', error.message);
|
|
@@ -265,7 +320,8 @@ export class Realtime {
|
|
|
265
320
|
*/
|
|
266
321
|
public async subscribe(
|
|
267
322
|
channel: string | Channel<any> | ActionableChannel | ResolvedChannel,
|
|
268
|
-
callback: (event: RealtimeResponseEvent<any>) => void
|
|
323
|
+
callback: (event: RealtimeResponseEvent<any>) => void,
|
|
324
|
+
queries?: (string | Query)[]
|
|
269
325
|
): Promise<RealtimeSubscription>;
|
|
270
326
|
|
|
271
327
|
/**
|
|
@@ -277,7 +333,8 @@ export class Realtime {
|
|
|
277
333
|
*/
|
|
278
334
|
public async subscribe(
|
|
279
335
|
channels: (string | Channel<any> | ActionableChannel | ResolvedChannel)[],
|
|
280
|
-
callback: (event: RealtimeResponseEvent<any>) => void
|
|
336
|
+
callback: (event: RealtimeResponseEvent<any>) => void,
|
|
337
|
+
queries?: (string | Query)[]
|
|
281
338
|
): Promise<RealtimeSubscription>;
|
|
282
339
|
|
|
283
340
|
/**
|
|
@@ -289,7 +346,8 @@ export class Realtime {
|
|
|
289
346
|
*/
|
|
290
347
|
public async subscribe<T>(
|
|
291
348
|
channel: string | Channel<any> | ActionableChannel | ResolvedChannel,
|
|
292
|
-
callback: (event: RealtimeResponseEvent<T>) => void
|
|
349
|
+
callback: (event: RealtimeResponseEvent<T>) => void,
|
|
350
|
+
queries?: (string | Query)[]
|
|
293
351
|
): Promise<RealtimeSubscription>;
|
|
294
352
|
|
|
295
353
|
/**
|
|
@@ -301,12 +359,14 @@ export class Realtime {
|
|
|
301
359
|
*/
|
|
302
360
|
public async subscribe<T>(
|
|
303
361
|
channels: (string | Channel<any> | ActionableChannel | ResolvedChannel)[],
|
|
304
|
-
callback: (event: RealtimeResponseEvent<T>) => void
|
|
362
|
+
callback: (event: RealtimeResponseEvent<T>) => void,
|
|
363
|
+
queries?: (string | Query)[]
|
|
305
364
|
): Promise<RealtimeSubscription>;
|
|
306
365
|
|
|
307
366
|
public async subscribe<T = any>(
|
|
308
367
|
channelsOrChannel: string | Channel<any> | ActionableChannel | ResolvedChannel | (string | Channel<any> | ActionableChannel | ResolvedChannel)[],
|
|
309
|
-
callback: (event: RealtimeResponseEvent<T>) => void
|
|
368
|
+
callback: (event: RealtimeResponseEvent<T>) => void,
|
|
369
|
+
queries: (string | Query)[] = []
|
|
310
370
|
): Promise<RealtimeSubscription> {
|
|
311
371
|
const channelArray = Array.isArray(channelsOrChannel)
|
|
312
372
|
? channelsOrChannel
|
|
@@ -316,15 +376,30 @@ export class Realtime {
|
|
|
316
376
|
const channelStrings = channelArray.map(ch => this.channelToString(ch));
|
|
317
377
|
const channels = new Set(channelStrings);
|
|
318
378
|
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
for (const
|
|
323
|
-
|
|
379
|
+
// Convert queries to array of strings
|
|
380
|
+
// Ensure each query is a separate string in the array
|
|
381
|
+
const queryStrings: string[] = [];
|
|
382
|
+
for (const q of (queries ?? [])) {
|
|
383
|
+
if (Array.isArray(q)) {
|
|
384
|
+
// Handle nested arrays: [[q1, q2]] -> [q1, q2]
|
|
385
|
+
for (const inner of q) {
|
|
386
|
+
queryStrings.push(typeof inner === 'string' ? inner : inner.toString());
|
|
387
|
+
}
|
|
388
|
+
} else {
|
|
389
|
+
queryStrings.push(typeof q === 'string' ? q : q.toString());
|
|
390
|
+
}
|
|
324
391
|
}
|
|
325
392
|
|
|
326
|
-
|
|
393
|
+
// Allocate a new slot index
|
|
394
|
+
this.subscriptionsCounter++;
|
|
395
|
+
const slot = this.subscriptionsCounter;
|
|
396
|
+
|
|
397
|
+
// Store slot-centric data: channels, queries, and callback belong to the slot
|
|
398
|
+
// queries is stored as string[] (array of query strings)
|
|
399
|
+
// No channel mutation occurs here - channels are derived from slots in createSocket()
|
|
400
|
+
this.activeSubscriptions.set(slot, {
|
|
327
401
|
channels,
|
|
402
|
+
queries: queryStrings,
|
|
328
403
|
callback
|
|
329
404
|
});
|
|
330
405
|
|
|
@@ -340,27 +415,19 @@ export class Realtime {
|
|
|
340
415
|
|
|
341
416
|
return {
|
|
342
417
|
close: async () => {
|
|
343
|
-
this.
|
|
344
|
-
this.
|
|
418
|
+
const subscriptionId = this.slotToSubscriptionId.get(slot);
|
|
419
|
+
this.activeSubscriptions.delete(slot);
|
|
420
|
+
this.slotToSubscriptionId.delete(slot);
|
|
421
|
+
if (subscriptionId) {
|
|
422
|
+
this.subscriptionIdToSlot.delete(subscriptionId);
|
|
423
|
+
}
|
|
345
424
|
await this.createSocket();
|
|
346
425
|
}
|
|
347
426
|
};
|
|
348
427
|
}
|
|
349
428
|
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
Array.from(this.activeChannels).filter(channel => {
|
|
353
|
-
if (!channels.has(channel)) {
|
|
354
|
-
return true;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
const subsWithChannel = Array.from(this.activeSubscriptions.values())
|
|
358
|
-
.filter(sub => sub.channels.has(channel));
|
|
359
|
-
|
|
360
|
-
return subsWithChannel.length > 0;
|
|
361
|
-
})
|
|
362
|
-
);
|
|
363
|
-
}
|
|
429
|
+
// cleanUp is no longer needed - slots are removed directly in subscribe().close()
|
|
430
|
+
// Channels are automatically rebuilt from remaining slots in createSocket()
|
|
364
431
|
|
|
365
432
|
private handleMessage(message: RealtimeResponse): void {
|
|
366
433
|
if (!message.type) {
|
|
@@ -390,6 +457,20 @@ export class Realtime {
|
|
|
390
457
|
|
|
391
458
|
const messageData = message.data as RealtimeResponseConnected;
|
|
392
459
|
|
|
460
|
+
// Store subscription ID mappings from backend
|
|
461
|
+
// Format: { "0": "sub_a1f9", "1": "sub_b83c", ... }
|
|
462
|
+
if (messageData.subscriptions) {
|
|
463
|
+
this.slotToSubscriptionId.clear();
|
|
464
|
+
this.subscriptionIdToSlot.clear();
|
|
465
|
+
for (const [slotStr, subscriptionId] of Object.entries(messageData.subscriptions)) {
|
|
466
|
+
const slot = Number(slotStr);
|
|
467
|
+
if (!isNaN(slot)) {
|
|
468
|
+
this.slotToSubscriptionId.set(slot, subscriptionId);
|
|
469
|
+
this.subscriptionIdToSlot.set(subscriptionId, slot);
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
|
|
393
474
|
let session = this.client.config.session;
|
|
394
475
|
if (!session) {
|
|
395
476
|
try {
|
|
@@ -428,32 +509,28 @@ export class Realtime {
|
|
|
428
509
|
const events = data.events as string[];
|
|
429
510
|
const payload = data.payload;
|
|
430
511
|
const timestamp = data.timestamp as string;
|
|
512
|
+
const subscriptions = data.subscriptions as string[] | undefined;
|
|
431
513
|
|
|
432
|
-
if (!channels || !events || !payload) {
|
|
514
|
+
if (!channels || !events || !payload || !subscriptions || subscriptions.length === 0) {
|
|
433
515
|
return;
|
|
434
516
|
}
|
|
435
517
|
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
channels,
|
|
453
|
-
timestamp,
|
|
454
|
-
payload
|
|
455
|
-
};
|
|
456
|
-
subscription.callback(response);
|
|
518
|
+
// Iterate over all matching subscriptionIds and call callback for each
|
|
519
|
+
for (const subscriptionId of subscriptions) {
|
|
520
|
+
// O(1) lookup using subscriptionId
|
|
521
|
+
const slot = this.subscriptionIdToSlot.get(subscriptionId);
|
|
522
|
+
if (slot !== undefined) {
|
|
523
|
+
const subscription = this.activeSubscriptions.get(slot);
|
|
524
|
+
if (subscription) {
|
|
525
|
+
const response: RealtimeResponseEvent<any> = {
|
|
526
|
+
events,
|
|
527
|
+
channels,
|
|
528
|
+
timestamp,
|
|
529
|
+
payload,
|
|
530
|
+
subscriptions
|
|
531
|
+
};
|
|
532
|
+
subscription.callback(response);
|
|
533
|
+
}
|
|
457
534
|
}
|
|
458
535
|
}
|
|
459
536
|
}
|
package/src/services/sites.ts
CHANGED
|
@@ -344,7 +344,7 @@ export class Sites {
|
|
|
344
344
|
): Promise<Models.TemplateSiteList> {
|
|
345
345
|
let params: { frameworks?: Frameworks[], useCases?: UseCases[], limit?: number, offset?: number };
|
|
346
346
|
|
|
347
|
-
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'frameworks' in paramsOrFirst)) {
|
|
347
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('frameworks' in paramsOrFirst || 'useCases' in paramsOrFirst || 'limit' in paramsOrFirst || 'offset' in paramsOrFirst))) {
|
|
348
348
|
params = (paramsOrFirst || {}) as { frameworks?: Frameworks[], useCases?: UseCases[], limit?: number, offset?: number };
|
|
349
349
|
} else {
|
|
350
350
|
params = {
|
|
@@ -461,7 +461,7 @@ export class Sites {
|
|
|
461
461
|
): Promise<Models.UsageSites> {
|
|
462
462
|
let params: { range?: UsageRange };
|
|
463
463
|
|
|
464
|
-
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'range' in paramsOrFirst)) {
|
|
464
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) {
|
|
465
465
|
params = (paramsOrFirst || {}) as { range?: UsageRange };
|
|
466
466
|
} else {
|
|
467
467
|
params = {
|
package/src/services/storage.ts
CHANGED
|
@@ -1104,7 +1104,7 @@ export class Storage {
|
|
|
1104
1104
|
): Promise<Models.UsageStorage> {
|
|
1105
1105
|
let params: { range?: UsageRange };
|
|
1106
1106
|
|
|
1107
|
-
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'range' in paramsOrFirst)) {
|
|
1107
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) {
|
|
1108
1108
|
params = (paramsOrFirst || {}) as { range?: UsageRange };
|
|
1109
1109
|
} else {
|
|
1110
1110
|
params = {
|
|
@@ -511,7 +511,7 @@ export class TablesDB {
|
|
|
511
511
|
): Promise<Models.UsageDatabases> {
|
|
512
512
|
let params: { range?: UsageRange };
|
|
513
513
|
|
|
514
|
-
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'range' in paramsOrFirst)) {
|
|
514
|
+
if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) {
|
|
515
515
|
params = (paramsOrFirst || {}) as { range?: UsageRange };
|
|
516
516
|
} else {
|
|
517
517
|
params = {
|
|
@@ -2771,10 +2771,11 @@ export class TablesDB {
|
|
|
2771
2771
|
* @param {boolean} params.required - Is column required?
|
|
2772
2772
|
* @param {string} params.xdefault - Default value for column when not provided. Cannot be set when column is required.
|
|
2773
2773
|
* @param {boolean} params.array - Is column an array?
|
|
2774
|
+
* @param {boolean} params.encrypt - Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.
|
|
2774
2775
|
* @throws {AppwriteException}
|
|
2775
2776
|
* @returns {Promise<Models.ColumnLongtext>}
|
|
2776
2777
|
*/
|
|
2777
|
-
createLongtextColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, array?: boolean }): Promise<Models.ColumnLongtext>;
|
|
2778
|
+
createLongtextColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }): Promise<Models.ColumnLongtext>;
|
|
2778
2779
|
/**
|
|
2779
2780
|
* Create a longtext column.
|
|
2780
2781
|
*
|
|
@@ -2785,19 +2786,20 @@ export class TablesDB {
|
|
|
2785
2786
|
* @param {boolean} required - Is column required?
|
|
2786
2787
|
* @param {string} xdefault - Default value for column when not provided. Cannot be set when column is required.
|
|
2787
2788
|
* @param {boolean} array - Is column an array?
|
|
2789
|
+
* @param {boolean} encrypt - Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.
|
|
2788
2790
|
* @throws {AppwriteException}
|
|
2789
2791
|
* @returns {Promise<Models.ColumnLongtext>}
|
|
2790
2792
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2791
2793
|
*/
|
|
2792
|
-
createLongtextColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.ColumnLongtext>;
|
|
2794
|
+
createLongtextColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean): Promise<Models.ColumnLongtext>;
|
|
2793
2795
|
createLongtextColumn(
|
|
2794
|
-
paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, array?: boolean } | string,
|
|
2795
|
-
...rest: [(string)?, (string)?, (boolean)?, (string)?, (boolean)?]
|
|
2796
|
+
paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean } | string,
|
|
2797
|
+
...rest: [(string)?, (string)?, (boolean)?, (string)?, (boolean)?, (boolean)?]
|
|
2796
2798
|
): Promise<Models.ColumnLongtext> {
|
|
2797
|
-
let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, array?: boolean };
|
|
2799
|
+
let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean };
|
|
2798
2800
|
|
|
2799
2801
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2800
|
-
params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, array?: boolean };
|
|
2802
|
+
params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean };
|
|
2801
2803
|
} else {
|
|
2802
2804
|
params = {
|
|
2803
2805
|
databaseId: paramsOrFirst as string,
|
|
@@ -2805,7 +2807,8 @@ export class TablesDB {
|
|
|
2805
2807
|
key: rest[1] as string,
|
|
2806
2808
|
required: rest[2] as boolean,
|
|
2807
2809
|
xdefault: rest[3] as string,
|
|
2808
|
-
array: rest[4] as boolean
|
|
2810
|
+
array: rest[4] as boolean,
|
|
2811
|
+
encrypt: rest[5] as boolean
|
|
2809
2812
|
};
|
|
2810
2813
|
}
|
|
2811
2814
|
|
|
@@ -2815,6 +2818,7 @@ export class TablesDB {
|
|
|
2815
2818
|
const required = params.required;
|
|
2816
2819
|
const xdefault = params.xdefault;
|
|
2817
2820
|
const array = params.array;
|
|
2821
|
+
const encrypt = params.encrypt;
|
|
2818
2822
|
|
|
2819
2823
|
if (typeof databaseId === 'undefined') {
|
|
2820
2824
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -2843,6 +2847,9 @@ export class TablesDB {
|
|
|
2843
2847
|
if (typeof array !== 'undefined') {
|
|
2844
2848
|
payload['array'] = array;
|
|
2845
2849
|
}
|
|
2850
|
+
if (typeof encrypt !== 'undefined') {
|
|
2851
|
+
payload['encrypt'] = encrypt;
|
|
2852
|
+
}
|
|
2846
2853
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2847
2854
|
|
|
2848
2855
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -2963,10 +2970,11 @@ export class TablesDB {
|
|
|
2963
2970
|
* @param {boolean} params.required - Is column required?
|
|
2964
2971
|
* @param {string} params.xdefault - Default value for column when not provided. Cannot be set when column is required.
|
|
2965
2972
|
* @param {boolean} params.array - Is column an array?
|
|
2973
|
+
* @param {boolean} params.encrypt - Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.
|
|
2966
2974
|
* @throws {AppwriteException}
|
|
2967
2975
|
* @returns {Promise<Models.ColumnMediumtext>}
|
|
2968
2976
|
*/
|
|
2969
|
-
createMediumtextColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, array?: boolean }): Promise<Models.ColumnMediumtext>;
|
|
2977
|
+
createMediumtextColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }): Promise<Models.ColumnMediumtext>;
|
|
2970
2978
|
/**
|
|
2971
2979
|
* Create a mediumtext column.
|
|
2972
2980
|
*
|
|
@@ -2977,19 +2985,20 @@ export class TablesDB {
|
|
|
2977
2985
|
* @param {boolean} required - Is column required?
|
|
2978
2986
|
* @param {string} xdefault - Default value for column when not provided. Cannot be set when column is required.
|
|
2979
2987
|
* @param {boolean} array - Is column an array?
|
|
2988
|
+
* @param {boolean} encrypt - Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.
|
|
2980
2989
|
* @throws {AppwriteException}
|
|
2981
2990
|
* @returns {Promise<Models.ColumnMediumtext>}
|
|
2982
2991
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
2983
2992
|
*/
|
|
2984
|
-
createMediumtextColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.ColumnMediumtext>;
|
|
2993
|
+
createMediumtextColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean): Promise<Models.ColumnMediumtext>;
|
|
2985
2994
|
createMediumtextColumn(
|
|
2986
|
-
paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, array?: boolean } | string,
|
|
2987
|
-
...rest: [(string)?, (string)?, (boolean)?, (string)?, (boolean)?]
|
|
2995
|
+
paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean } | string,
|
|
2996
|
+
...rest: [(string)?, (string)?, (boolean)?, (string)?, (boolean)?, (boolean)?]
|
|
2988
2997
|
): Promise<Models.ColumnMediumtext> {
|
|
2989
|
-
let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, array?: boolean };
|
|
2998
|
+
let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean };
|
|
2990
2999
|
|
|
2991
3000
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
2992
|
-
params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, array?: boolean };
|
|
3001
|
+
params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean };
|
|
2993
3002
|
} else {
|
|
2994
3003
|
params = {
|
|
2995
3004
|
databaseId: paramsOrFirst as string,
|
|
@@ -2997,7 +3006,8 @@ export class TablesDB {
|
|
|
2997
3006
|
key: rest[1] as string,
|
|
2998
3007
|
required: rest[2] as boolean,
|
|
2999
3008
|
xdefault: rest[3] as string,
|
|
3000
|
-
array: rest[4] as boolean
|
|
3009
|
+
array: rest[4] as boolean,
|
|
3010
|
+
encrypt: rest[5] as boolean
|
|
3001
3011
|
};
|
|
3002
3012
|
}
|
|
3003
3013
|
|
|
@@ -3007,6 +3017,7 @@ export class TablesDB {
|
|
|
3007
3017
|
const required = params.required;
|
|
3008
3018
|
const xdefault = params.xdefault;
|
|
3009
3019
|
const array = params.array;
|
|
3020
|
+
const encrypt = params.encrypt;
|
|
3010
3021
|
|
|
3011
3022
|
if (typeof databaseId === 'undefined') {
|
|
3012
3023
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -3035,6 +3046,9 @@ export class TablesDB {
|
|
|
3035
3046
|
if (typeof array !== 'undefined') {
|
|
3036
3047
|
payload['array'] = array;
|
|
3037
3048
|
}
|
|
3049
|
+
if (typeof encrypt !== 'undefined') {
|
|
3050
|
+
payload['encrypt'] = encrypt;
|
|
3051
|
+
}
|
|
3038
3052
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3039
3053
|
|
|
3040
3054
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -3839,10 +3853,11 @@ export class TablesDB {
|
|
|
3839
3853
|
* @param {boolean} params.required - Is column required?
|
|
3840
3854
|
* @param {string} params.xdefault - Default value for column when not provided. Cannot be set when column is required.
|
|
3841
3855
|
* @param {boolean} params.array - Is column an array?
|
|
3856
|
+
* @param {boolean} params.encrypt - Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.
|
|
3842
3857
|
* @throws {AppwriteException}
|
|
3843
3858
|
* @returns {Promise<Models.ColumnText>}
|
|
3844
3859
|
*/
|
|
3845
|
-
createTextColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, array?: boolean }): Promise<Models.ColumnText>;
|
|
3860
|
+
createTextColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }): Promise<Models.ColumnText>;
|
|
3846
3861
|
/**
|
|
3847
3862
|
* Create a text column.
|
|
3848
3863
|
*
|
|
@@ -3853,19 +3868,20 @@ export class TablesDB {
|
|
|
3853
3868
|
* @param {boolean} required - Is column required?
|
|
3854
3869
|
* @param {string} xdefault - Default value for column when not provided. Cannot be set when column is required.
|
|
3855
3870
|
* @param {boolean} array - Is column an array?
|
|
3871
|
+
* @param {boolean} encrypt - Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.
|
|
3856
3872
|
* @throws {AppwriteException}
|
|
3857
3873
|
* @returns {Promise<Models.ColumnText>}
|
|
3858
3874
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
3859
3875
|
*/
|
|
3860
|
-
createTextColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.ColumnText>;
|
|
3876
|
+
createTextColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean): Promise<Models.ColumnText>;
|
|
3861
3877
|
createTextColumn(
|
|
3862
|
-
paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, array?: boolean } | string,
|
|
3863
|
-
...rest: [(string)?, (string)?, (boolean)?, (string)?, (boolean)?]
|
|
3878
|
+
paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean } | string,
|
|
3879
|
+
...rest: [(string)?, (string)?, (boolean)?, (string)?, (boolean)?, (boolean)?]
|
|
3864
3880
|
): Promise<Models.ColumnText> {
|
|
3865
|
-
let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, array?: boolean };
|
|
3881
|
+
let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean };
|
|
3866
3882
|
|
|
3867
3883
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
3868
|
-
params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, array?: boolean };
|
|
3884
|
+
params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean };
|
|
3869
3885
|
} else {
|
|
3870
3886
|
params = {
|
|
3871
3887
|
databaseId: paramsOrFirst as string,
|
|
@@ -3873,7 +3889,8 @@ export class TablesDB {
|
|
|
3873
3889
|
key: rest[1] as string,
|
|
3874
3890
|
required: rest[2] as boolean,
|
|
3875
3891
|
xdefault: rest[3] as string,
|
|
3876
|
-
array: rest[4] as boolean
|
|
3892
|
+
array: rest[4] as boolean,
|
|
3893
|
+
encrypt: rest[5] as boolean
|
|
3877
3894
|
};
|
|
3878
3895
|
}
|
|
3879
3896
|
|
|
@@ -3883,6 +3900,7 @@ export class TablesDB {
|
|
|
3883
3900
|
const required = params.required;
|
|
3884
3901
|
const xdefault = params.xdefault;
|
|
3885
3902
|
const array = params.array;
|
|
3903
|
+
const encrypt = params.encrypt;
|
|
3886
3904
|
|
|
3887
3905
|
if (typeof databaseId === 'undefined') {
|
|
3888
3906
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -3911,6 +3929,9 @@ export class TablesDB {
|
|
|
3911
3929
|
if (typeof array !== 'undefined') {
|
|
3912
3930
|
payload['array'] = array;
|
|
3913
3931
|
}
|
|
3932
|
+
if (typeof encrypt !== 'undefined') {
|
|
3933
|
+
payload['encrypt'] = encrypt;
|
|
3934
|
+
}
|
|
3914
3935
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3915
3936
|
|
|
3916
3937
|
const apiHeaders: { [header: string]: string } = {
|
|
@@ -4224,10 +4245,11 @@ export class TablesDB {
|
|
|
4224
4245
|
* @param {boolean} params.required - Is column required?
|
|
4225
4246
|
* @param {string} params.xdefault - Default value for column when not provided. Cannot be set when column is required.
|
|
4226
4247
|
* @param {boolean} params.array - Is column an array?
|
|
4248
|
+
* @param {boolean} params.encrypt - Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.
|
|
4227
4249
|
* @throws {AppwriteException}
|
|
4228
4250
|
* @returns {Promise<Models.ColumnVarchar>}
|
|
4229
4251
|
*/
|
|
4230
|
-
createVarcharColumn(params: { databaseId: string, tableId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean }): Promise<Models.ColumnVarchar>;
|
|
4252
|
+
createVarcharColumn(params: { databaseId: string, tableId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }): Promise<Models.ColumnVarchar>;
|
|
4231
4253
|
/**
|
|
4232
4254
|
* Create a varchar column.
|
|
4233
4255
|
*
|
|
@@ -4239,19 +4261,20 @@ export class TablesDB {
|
|
|
4239
4261
|
* @param {boolean} required - Is column required?
|
|
4240
4262
|
* @param {string} xdefault - Default value for column when not provided. Cannot be set when column is required.
|
|
4241
4263
|
* @param {boolean} array - Is column an array?
|
|
4264
|
+
* @param {boolean} encrypt - Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.
|
|
4242
4265
|
* @throws {AppwriteException}
|
|
4243
4266
|
* @returns {Promise<Models.ColumnVarchar>}
|
|
4244
4267
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
4245
4268
|
*/
|
|
4246
|
-
createVarcharColumn(databaseId: string, tableId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean): Promise<Models.ColumnVarchar>;
|
|
4269
|
+
createVarcharColumn(databaseId: string, tableId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean): Promise<Models.ColumnVarchar>;
|
|
4247
4270
|
createVarcharColumn(
|
|
4248
|
-
paramsOrFirst: { databaseId: string, tableId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean } | string,
|
|
4249
|
-
...rest: [(string)?, (string)?, (number)?, (boolean)?, (string)?, (boolean)?]
|
|
4271
|
+
paramsOrFirst: { databaseId: string, tableId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean } | string,
|
|
4272
|
+
...rest: [(string)?, (string)?, (number)?, (boolean)?, (string)?, (boolean)?, (boolean)?]
|
|
4250
4273
|
): Promise<Models.ColumnVarchar> {
|
|
4251
|
-
let params: { databaseId: string, tableId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean };
|
|
4274
|
+
let params: { databaseId: string, tableId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean };
|
|
4252
4275
|
|
|
4253
4276
|
if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
|
|
4254
|
-
params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean };
|
|
4277
|
+
params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean };
|
|
4255
4278
|
} else {
|
|
4256
4279
|
params = {
|
|
4257
4280
|
databaseId: paramsOrFirst as string,
|
|
@@ -4260,7 +4283,8 @@ export class TablesDB {
|
|
|
4260
4283
|
size: rest[2] as number,
|
|
4261
4284
|
required: rest[3] as boolean,
|
|
4262
4285
|
xdefault: rest[4] as string,
|
|
4263
|
-
array: rest[5] as boolean
|
|
4286
|
+
array: rest[5] as boolean,
|
|
4287
|
+
encrypt: rest[6] as boolean
|
|
4264
4288
|
};
|
|
4265
4289
|
}
|
|
4266
4290
|
|
|
@@ -4271,6 +4295,7 @@ export class TablesDB {
|
|
|
4271
4295
|
const required = params.required;
|
|
4272
4296
|
const xdefault = params.xdefault;
|
|
4273
4297
|
const array = params.array;
|
|
4298
|
+
const encrypt = params.encrypt;
|
|
4274
4299
|
|
|
4275
4300
|
if (typeof databaseId === 'undefined') {
|
|
4276
4301
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -4305,6 +4330,9 @@ export class TablesDB {
|
|
|
4305
4330
|
if (typeof array !== 'undefined') {
|
|
4306
4331
|
payload['array'] = array;
|
|
4307
4332
|
}
|
|
4333
|
+
if (typeof encrypt !== 'undefined') {
|
|
4334
|
+
payload['encrypt'] = encrypt;
|
|
4335
|
+
}
|
|
4308
4336
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
4309
4337
|
|
|
4310
4338
|
const apiHeaders: { [header: string]: string } = {
|