@appwrite.io/console 1.5.2 → 1.7.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 +9 -1
- package/README.md +3 -3
- package/dist/cjs/sdk.js +11874 -11100
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +11872 -11101
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +11874 -11100
- package/docs/examples/account/create-anonymous-session.md +1 -1
- package/docs/examples/account/create-billing-address.md +1 -1
- package/docs/examples/account/create-email-password-session.md +1 -1
- package/docs/examples/account/create-email-token.md +1 -1
- package/docs/examples/account/create-j-w-t.md +1 -1
- package/docs/examples/account/create-magic-u-r-l-token.md +1 -1
- package/docs/examples/account/create-mfa-authenticator.md +1 -1
- package/docs/examples/account/create-mfa-challenge.md +1 -1
- package/docs/examples/account/create-mfa-recovery-codes.md +1 -1
- package/docs/examples/account/create-o-auth2session.md +1 -1
- package/docs/examples/account/create-o-auth2token.md +1 -1
- package/docs/examples/account/create-payment-method.md +1 -1
- package/docs/examples/account/create-phone-token.md +1 -1
- package/docs/examples/account/create-phone-verification.md +1 -1
- package/docs/examples/account/create-push-target.md +1 -1
- package/docs/examples/account/create-recovery.md +1 -1
- package/docs/examples/account/create-session.md +1 -1
- package/docs/examples/account/create-verification.md +1 -1
- package/docs/examples/account/create.md +1 -1
- package/docs/examples/account/delete-billing-address.md +1 -1
- package/docs/examples/account/delete-identity.md +1 -1
- package/docs/examples/account/delete-mfa-authenticator.md +1 -1
- package/docs/examples/account/delete-payment-method.md +1 -1
- package/docs/examples/account/delete-push-target.md +1 -1
- package/docs/examples/account/delete-session.md +1 -1
- package/docs/examples/account/delete-sessions.md +1 -1
- package/docs/examples/account/delete.md +1 -1
- package/docs/examples/account/get-billing-address.md +1 -1
- package/docs/examples/account/get-coupon.md +1 -1
- package/docs/examples/account/get-mfa-recovery-codes.md +1 -1
- package/docs/examples/account/get-payment-method.md +1 -1
- package/docs/examples/account/get-prefs.md +1 -1
- package/docs/examples/account/get-session.md +1 -1
- package/docs/examples/account/get.md +1 -1
- package/docs/examples/account/list-billing-addresses.md +1 -1
- package/docs/examples/account/list-identities.md +1 -1
- package/docs/examples/account/list-invoices.md +1 -1
- package/docs/examples/account/list-logs.md +1 -1
- package/docs/examples/account/list-mfa-factors.md +1 -1
- package/docs/examples/account/list-payment-methods.md +1 -1
- package/docs/examples/account/list-sessions.md +1 -1
- package/docs/examples/account/update-billing-address.md +1 -1
- package/docs/examples/account/update-email.md +1 -1
- package/docs/examples/account/update-m-f-a.md +1 -1
- package/docs/examples/account/update-magic-u-r-l-session.md +1 -1
- package/docs/examples/account/update-mfa-authenticator.md +1 -1
- package/docs/examples/account/update-mfa-challenge.md +1 -1
- package/docs/examples/account/update-mfa-recovery-codes.md +1 -1
- package/docs/examples/account/update-name.md +1 -1
- package/docs/examples/account/update-password.md +1 -1
- package/docs/examples/account/update-payment-method-mandate-options.md +1 -1
- package/docs/examples/account/update-payment-method-provider.md +1 -1
- package/docs/examples/account/update-payment-method.md +1 -1
- package/docs/examples/account/update-phone-session.md +1 -1
- package/docs/examples/account/update-phone-verification.md +1 -1
- package/docs/examples/account/update-phone.md +1 -1
- package/docs/examples/account/update-prefs.md +1 -1
- package/docs/examples/account/update-push-target.md +1 -1
- package/docs/examples/account/update-recovery.md +1 -1
- package/docs/examples/account/update-session.md +1 -1
- package/docs/examples/account/update-status.md +1 -1
- package/docs/examples/account/update-verification.md +1 -1
- package/docs/examples/assistant/chat.md +1 -1
- package/docs/examples/avatars/get-browser.md +2 -2
- package/docs/examples/avatars/get-credit-card.md +2 -2
- package/docs/examples/avatars/get-favicon.md +1 -1
- package/docs/examples/avatars/get-flag.md +2 -2
- package/docs/examples/avatars/get-image.md +1 -1
- package/docs/examples/avatars/get-initials.md +1 -1
- package/docs/examples/avatars/get-q-r.md +1 -1
- package/docs/examples/backups/create-archive.md +1 -1
- package/docs/examples/backups/create-policy.md +1 -1
- package/docs/examples/backups/create-restoration.md +1 -1
- package/docs/examples/backups/delete-archive.md +1 -1
- package/docs/examples/backups/delete-policy.md +1 -1
- package/docs/examples/backups/get-archive.md +1 -1
- package/docs/examples/backups/get-policy.md +1 -1
- package/docs/examples/backups/get-restoration.md +1 -1
- package/docs/examples/backups/list-archives.md +1 -1
- package/docs/examples/backups/list-policies.md +1 -1
- package/docs/examples/backups/list-restorations.md +1 -1
- package/docs/examples/backups/update-policy.md +1 -1
- package/docs/examples/console/create-program-membership.md +1 -1
- package/docs/examples/console/create-source.md +1 -1
- package/docs/examples/console/get-campaign.md +1 -1
- package/docs/examples/console/get-coupon.md +1 -1
- package/docs/examples/console/get-resource.md +14 -0
- package/docs/examples/console/plans.md +1 -1
- package/docs/examples/console/regions.md +1 -1
- package/docs/examples/console/variables.md +1 -1
- package/docs/examples/databases/create-boolean-attribute.md +1 -1
- package/docs/examples/databases/create-collection.md +1 -1
- package/docs/examples/databases/create-datetime-attribute.md +1 -1
- package/docs/examples/databases/create-document.md +4 -2
- package/docs/examples/databases/create-documents.md +15 -0
- package/docs/examples/databases/create-email-attribute.md +1 -1
- package/docs/examples/databases/create-enum-attribute.md +1 -1
- package/docs/examples/databases/create-float-attribute.md +1 -1
- package/docs/examples/databases/create-index.md +3 -2
- package/docs/examples/databases/create-integer-attribute.md +1 -1
- package/docs/examples/databases/create-ip-attribute.md +1 -1
- package/docs/examples/databases/create-relationship-attribute.md +1 -1
- package/docs/examples/databases/create-string-attribute.md +1 -1
- package/docs/examples/databases/create-url-attribute.md +1 -1
- package/docs/examples/databases/create.md +1 -1
- package/docs/examples/databases/delete-attribute.md +1 -1
- package/docs/examples/databases/delete-collection.md +1 -1
- package/docs/examples/databases/delete-document.md +1 -1
- package/docs/examples/databases/delete-documents.md +15 -0
- package/docs/examples/databases/delete-index.md +1 -1
- package/docs/examples/databases/delete.md +1 -1
- package/docs/examples/databases/get-attribute.md +1 -1
- package/docs/examples/databases/get-collection-usage.md +1 -1
- package/docs/examples/databases/get-collection.md +1 -1
- package/docs/examples/databases/get-database-usage.md +1 -1
- package/docs/examples/databases/get-document.md +1 -1
- package/docs/examples/databases/get-index.md +1 -1
- package/docs/examples/databases/get-usage.md +1 -1
- package/docs/examples/databases/get.md +1 -1
- package/docs/examples/databases/list-attributes.md +1 -1
- package/docs/examples/databases/list-collection-logs.md +1 -1
- package/docs/examples/databases/list-collections.md +1 -1
- package/docs/examples/databases/list-document-logs.md +1 -1
- package/docs/examples/databases/list-documents.md +1 -1
- package/docs/examples/databases/list-indexes.md +1 -1
- package/docs/examples/databases/list-logs.md +1 -1
- package/docs/examples/databases/list.md +1 -1
- package/docs/examples/databases/update-boolean-attribute.md +1 -1
- package/docs/examples/databases/update-collection.md +1 -1
- package/docs/examples/databases/update-datetime-attribute.md +1 -1
- package/docs/examples/databases/update-document.md +1 -1
- package/docs/examples/databases/update-documents.md +16 -0
- package/docs/examples/databases/update-email-attribute.md +1 -1
- package/docs/examples/databases/update-enum-attribute.md +1 -1
- package/docs/examples/databases/update-float-attribute.md +1 -1
- package/docs/examples/databases/update-integer-attribute.md +1 -1
- package/docs/examples/databases/update-ip-attribute.md +1 -1
- package/docs/examples/databases/update-relationship-attribute.md +1 -1
- package/docs/examples/databases/update-string-attribute.md +1 -1
- package/docs/examples/databases/update-url-attribute.md +1 -1
- package/docs/examples/databases/update.md +1 -1
- package/docs/examples/databases/upsert-documents.md +15 -0
- package/docs/examples/domains/create-preset-google-workspace.md +13 -0
- package/docs/examples/domains/create-preset-i-cloud.md +13 -0
- package/docs/examples/domains/create-preset-mailgun.md +13 -0
- package/docs/examples/domains/create-preset-outlook.md +13 -0
- package/docs/examples/domains/create-preset-proton-mail.md +13 -0
- package/docs/examples/domains/create-preset-zoho.md +13 -0
- package/docs/examples/domains/create-record-a-a-a-a.md +17 -0
- package/docs/examples/domains/create-record-a.md +17 -0
- package/docs/examples/domains/create-record-alias.md +17 -0
- package/docs/examples/domains/create-record-c-a-a.md +17 -0
- package/docs/examples/domains/create-record-c-n-a-m-e.md +17 -0
- package/docs/examples/domains/create-record-h-t-t-p-s.md +17 -0
- package/docs/examples/domains/create-record-m-x.md +18 -0
- package/docs/examples/domains/create-record-n-s.md +17 -0
- package/docs/examples/domains/create-record-s-r-v.md +20 -0
- package/docs/examples/domains/create-record-t-x-t.md +17 -0
- package/docs/examples/domains/create.md +14 -0
- package/docs/examples/domains/delete-record.md +14 -0
- package/docs/examples/domains/delete.md +13 -0
- package/docs/examples/domains/get-preset-google-workspace.md +13 -0
- package/docs/examples/domains/get-preset-i-cloud.md +13 -0
- package/docs/examples/domains/get-preset-mailgun.md +13 -0
- package/docs/examples/domains/get-preset-outlook.md +13 -0
- package/docs/examples/domains/get-preset-proton-mail.md +13 -0
- package/docs/examples/domains/get-preset-zoho.md +13 -0
- package/docs/examples/domains/get-record.md +14 -0
- package/docs/examples/domains/get-zone.md +13 -0
- package/docs/examples/domains/get.md +13 -0
- package/docs/examples/domains/list-records.md +14 -0
- package/docs/examples/domains/list.md +14 -0
- package/docs/examples/domains/update-nameservers.md +13 -0
- package/docs/examples/domains/update-record-a-a-a-a.md +18 -0
- package/docs/examples/domains/update-record-a.md +18 -0
- package/docs/examples/domains/update-record-alias.md +18 -0
- package/docs/examples/domains/update-record-c-a-a.md +18 -0
- package/docs/examples/domains/update-record-c-n-a-m-e.md +18 -0
- package/docs/examples/domains/update-record-h-t-t-p-s.md +18 -0
- package/docs/examples/domains/update-record-m-x.md +19 -0
- package/docs/examples/domains/update-record-n-s.md +18 -0
- package/docs/examples/domains/update-record-s-r-v.md +21 -0
- package/docs/examples/domains/update-record-t-x-t.md +18 -0
- package/docs/examples/domains/update-team.md +14 -0
- package/docs/examples/domains/update-zone.md +14 -0
- package/docs/examples/functions/create-deployment.md +1 -1
- package/docs/examples/functions/create-duplicate-deployment.md +15 -0
- package/docs/examples/functions/create-execution.md +1 -1
- package/docs/examples/functions/create-template-deployment.md +18 -0
- package/docs/examples/functions/create-variable.md +3 -2
- package/docs/examples/functions/create-vcs-deployment.md +16 -0
- package/docs/examples/functions/create.md +3 -3
- package/docs/examples/functions/delete-deployment.md +1 -1
- package/docs/examples/functions/delete-execution.md +1 -1
- package/docs/examples/functions/delete-variable.md +1 -1
- package/docs/examples/functions/delete.md +1 -1
- package/docs/examples/functions/get-deployment-download.md +4 -3
- package/docs/examples/functions/get-deployment.md +1 -1
- package/docs/examples/functions/get-execution.md +1 -1
- package/docs/examples/functions/get-template.md +1 -1
- package/docs/examples/functions/get-usage.md +2 -1
- package/docs/examples/functions/get-variable.md +1 -1
- package/docs/examples/functions/get.md +1 -1
- package/docs/examples/functions/list-deployments.md +1 -1
- package/docs/examples/functions/list-executions.md +2 -3
- package/docs/examples/functions/list-runtimes.md +1 -1
- package/docs/examples/functions/list-specifications.md +1 -1
- package/docs/examples/functions/list-templates.md +1 -1
- package/docs/examples/functions/list-usage.md +13 -0
- package/docs/examples/functions/list-variables.md +1 -1
- package/docs/examples/functions/list.md +1 -1
- package/docs/examples/functions/update-deployment-status.md +14 -0
- package/docs/examples/functions/update-function-deployment.md +14 -0
- package/docs/examples/functions/update-variable.md +3 -2
- package/docs/examples/functions/update.md +1 -1
- package/docs/examples/graphql/mutation.md +1 -1
- package/docs/examples/graphql/query.md +1 -1
- package/docs/examples/health/get-antivirus.md +1 -1
- package/docs/examples/health/get-cache.md +1 -1
- package/docs/examples/health/get-certificate.md +1 -1
- package/docs/examples/health/get-d-b.md +1 -1
- package/docs/examples/health/get-failed-jobs.md +1 -1
- package/docs/examples/health/get-pub-sub.md +1 -1
- package/docs/examples/health/get-queue-billing-aggregation.md +1 -1
- package/docs/examples/health/get-queue-builds.md +1 -1
- package/docs/examples/health/get-queue-certificates.md +1 -1
- package/docs/examples/health/get-queue-databases.md +1 -1
- package/docs/examples/health/get-queue-deletes.md +1 -1
- package/docs/examples/health/get-queue-functions.md +1 -1
- package/docs/examples/health/get-queue-logs.md +1 -1
- package/docs/examples/health/get-queue-mails.md +1 -1
- package/docs/examples/health/get-queue-messaging.md +1 -1
- package/docs/examples/health/get-queue-migrations.md +1 -1
- package/docs/examples/health/get-queue-priority-builds.md +1 -1
- package/docs/examples/health/get-queue-region-manager.md +13 -0
- package/docs/examples/health/get-queue-stats-resources.md +1 -1
- package/docs/examples/health/get-queue-usage.md +1 -1
- package/docs/examples/health/get-queue-webhooks.md +1 -1
- package/docs/examples/health/get-storage-local.md +1 -1
- package/docs/examples/health/get-storage.md +1 -1
- package/docs/examples/health/get-time.md +1 -1
- package/docs/examples/health/get.md +1 -1
- package/docs/examples/locale/get.md +1 -1
- package/docs/examples/locale/list-codes.md +1 -1
- package/docs/examples/locale/list-continents.md +1 -1
- package/docs/examples/locale/list-countries-e-u.md +1 -1
- package/docs/examples/locale/list-countries-phones.md +1 -1
- package/docs/examples/locale/list-countries.md +1 -1
- package/docs/examples/locale/list-currencies.md +1 -1
- package/docs/examples/locale/list-languages.md +1 -1
- package/docs/examples/messaging/create-apns-provider.md +1 -1
- package/docs/examples/messaging/create-email.md +1 -1
- package/docs/examples/messaging/create-fcm-provider.md +1 -1
- package/docs/examples/messaging/create-mailgun-provider.md +1 -1
- package/docs/examples/messaging/create-msg91provider.md +1 -1
- package/docs/examples/messaging/create-push.md +1 -1
- package/docs/examples/messaging/create-sendgrid-provider.md +1 -1
- package/docs/examples/messaging/create-sms.md +1 -1
- package/docs/examples/messaging/create-smtp-provider.md +1 -1
- package/docs/examples/messaging/create-subscriber.md +1 -1
- package/docs/examples/messaging/create-telesign-provider.md +1 -1
- package/docs/examples/messaging/create-textmagic-provider.md +1 -1
- package/docs/examples/messaging/create-topic.md +1 -1
- package/docs/examples/messaging/create-twilio-provider.md +1 -1
- package/docs/examples/messaging/create-vonage-provider.md +1 -1
- package/docs/examples/messaging/delete-provider.md +1 -1
- package/docs/examples/messaging/delete-subscriber.md +1 -1
- package/docs/examples/messaging/delete-topic.md +1 -1
- package/docs/examples/messaging/delete.md +1 -1
- package/docs/examples/messaging/get-message.md +1 -1
- package/docs/examples/messaging/get-provider.md +1 -1
- package/docs/examples/messaging/get-subscriber.md +1 -1
- package/docs/examples/messaging/get-topic.md +1 -1
- package/docs/examples/messaging/list-message-logs.md +1 -1
- package/docs/examples/messaging/list-messages.md +1 -1
- package/docs/examples/messaging/list-provider-logs.md +1 -1
- package/docs/examples/messaging/list-providers.md +1 -1
- package/docs/examples/messaging/list-subscriber-logs.md +1 -1
- package/docs/examples/messaging/list-subscribers.md +1 -1
- package/docs/examples/messaging/list-targets.md +1 -1
- package/docs/examples/messaging/list-topic-logs.md +1 -1
- package/docs/examples/messaging/list-topics.md +1 -1
- package/docs/examples/messaging/update-apns-provider.md +1 -1
- package/docs/examples/messaging/update-email.md +1 -1
- package/docs/examples/messaging/update-fcm-provider.md +1 -1
- package/docs/examples/messaging/update-mailgun-provider.md +1 -1
- package/docs/examples/messaging/update-msg91provider.md +1 -1
- package/docs/examples/messaging/update-push.md +1 -1
- package/docs/examples/messaging/update-sendgrid-provider.md +1 -1
- package/docs/examples/messaging/update-sms.md +1 -1
- package/docs/examples/messaging/update-smtp-provider.md +1 -1
- package/docs/examples/messaging/update-telesign-provider.md +1 -1
- package/docs/examples/messaging/update-textmagic-provider.md +1 -1
- package/docs/examples/messaging/update-topic.md +1 -1
- package/docs/examples/messaging/update-twilio-provider.md +1 -1
- package/docs/examples/messaging/update-vonage-provider.md +1 -1
- package/docs/examples/migrations/create-appwrite-migration.md +1 -1
- package/docs/examples/migrations/create-csv-migration.md +15 -0
- package/docs/examples/migrations/create-firebase-migration.md +1 -1
- package/docs/examples/migrations/create-n-host-migration.md +1 -1
- package/docs/examples/migrations/create-supabase-migration.md +1 -1
- package/docs/examples/migrations/delete.md +1 -1
- package/docs/examples/migrations/get-appwrite-report.md +1 -1
- package/docs/examples/migrations/get-firebase-report.md +1 -1
- package/docs/examples/migrations/get-n-host-report.md +1 -1
- package/docs/examples/migrations/get-supabase-report.md +1 -1
- package/docs/examples/migrations/get.md +1 -1
- package/docs/examples/migrations/list.md +1 -1
- package/docs/examples/migrations/retry.md +1 -1
- package/docs/examples/organizations/add-credit.md +1 -1
- package/docs/examples/organizations/create-invoice-payment.md +1 -1
- package/docs/examples/organizations/create.md +1 -1
- package/docs/examples/organizations/delete-backup-payment-method.md +1 -1
- package/docs/examples/organizations/delete-billing-address.md +1 -1
- package/docs/examples/organizations/delete-default-payment-method.md +1 -1
- package/docs/examples/organizations/delete.md +1 -1
- package/docs/examples/organizations/get-aggregation.md +1 -1
- package/docs/examples/organizations/get-billing-address.md +1 -1
- package/docs/examples/organizations/get-credit.md +1 -1
- package/docs/examples/organizations/get-invoice-download.md +1 -1
- package/docs/examples/organizations/get-invoice-view.md +1 -1
- package/docs/examples/organizations/get-invoice.md +1 -1
- package/docs/examples/organizations/get-payment-method.md +1 -1
- package/docs/examples/organizations/get-plan.md +1 -1
- package/docs/examples/organizations/get-scopes.md +1 -1
- package/docs/examples/organizations/list-aggregations.md +1 -1
- package/docs/examples/organizations/list-credits.md +1 -1
- package/docs/examples/organizations/list-invoices.md +1 -1
- package/docs/examples/organizations/list.md +1 -1
- package/docs/examples/organizations/set-backup-payment-method.md +1 -1
- package/docs/examples/organizations/set-billing-address.md +1 -1
- package/docs/examples/organizations/set-billing-email.md +1 -1
- package/docs/examples/organizations/set-billing-tax-id.md +1 -1
- package/docs/examples/organizations/set-default-payment-method.md +1 -1
- package/docs/examples/organizations/update-budget.md +1 -1
- package/docs/examples/organizations/update-plan.md +1 -1
- package/docs/examples/organizations/validate-invoice.md +14 -0
- package/docs/examples/project/create-variable.md +3 -2
- package/docs/examples/project/delete-variable.md +1 -1
- package/docs/examples/project/get-usage.md +1 -1
- package/docs/examples/project/get-variable.md +1 -1
- package/docs/examples/project/list-variables.md +1 -1
- package/docs/examples/project/update-variable.md +3 -2
- package/docs/examples/projects/create-dev-key.md +15 -0
- package/docs/examples/projects/create-j-w-t.md +1 -1
- package/docs/examples/projects/create-key.md +1 -1
- package/docs/examples/projects/create-platform.md +1 -1
- package/docs/examples/projects/create-smtp-test.md +1 -1
- package/docs/examples/projects/create-webhook.md +1 -1
- package/docs/examples/projects/create.md +2 -2
- package/docs/examples/projects/delete-dev-key.md +14 -0
- package/docs/examples/projects/delete-email-template.md +1 -1
- package/docs/examples/projects/delete-key.md +1 -1
- package/docs/examples/projects/delete-platform.md +1 -1
- package/docs/examples/projects/delete-sms-template.md +1 -1
- package/docs/examples/projects/delete-webhook.md +1 -1
- package/docs/examples/projects/delete.md +1 -1
- package/docs/examples/projects/get-dev-key.md +14 -0
- package/docs/examples/projects/get-email-template.md +1 -1
- package/docs/examples/projects/get-key.md +1 -1
- package/docs/examples/projects/get-platform.md +1 -1
- package/docs/examples/projects/get-sms-template.md +1 -1
- package/docs/examples/projects/get-webhook.md +1 -1
- package/docs/examples/projects/get.md +1 -1
- package/docs/examples/projects/list-dev-keys.md +14 -0
- package/docs/examples/projects/list-keys.md +1 -1
- package/docs/examples/projects/list-platforms.md +1 -1
- package/docs/examples/projects/list-webhooks.md +1 -1
- package/docs/examples/projects/list.md +1 -1
- package/docs/examples/projects/update-api-status-all.md +1 -1
- package/docs/examples/projects/update-api-status.md +1 -1
- package/docs/examples/projects/update-auth-duration.md +1 -1
- package/docs/examples/projects/update-auth-limit.md +1 -1
- package/docs/examples/projects/update-auth-password-dictionary.md +1 -1
- package/docs/examples/projects/update-auth-password-history.md +1 -1
- package/docs/examples/projects/update-auth-sessions-limit.md +1 -1
- package/docs/examples/projects/update-auth-status.md +1 -1
- package/docs/examples/projects/update-dev-key.md +16 -0
- package/docs/examples/projects/update-email-template.md +1 -1
- package/docs/examples/projects/update-key.md +1 -1
- package/docs/examples/projects/update-memberships-privacy.md +1 -1
- package/docs/examples/projects/update-mock-numbers.md +1 -1
- package/docs/examples/projects/update-o-auth2.md +1 -1
- package/docs/examples/projects/update-personal-data-check.md +1 -1
- package/docs/examples/projects/update-platform.md +1 -1
- package/docs/examples/projects/update-service-status-all.md +1 -1
- package/docs/examples/projects/update-service-status.md +1 -1
- package/docs/examples/projects/update-session-alerts.md +1 -1
- package/docs/examples/projects/update-sms-template.md +1 -1
- package/docs/examples/projects/update-smtp.md +1 -1
- package/docs/examples/projects/update-team.md +1 -1
- package/docs/examples/projects/update-webhook-signature.md +1 -1
- package/docs/examples/projects/update-webhook.md +1 -1
- package/docs/examples/projects/update.md +1 -1
- package/docs/examples/proxy/create-a-p-i-rule.md +13 -0
- package/docs/examples/proxy/create-function-rule.md +15 -0
- package/docs/examples/proxy/create-redirect-rule.md +15 -0
- package/docs/examples/proxy/create-site-rule.md +15 -0
- package/docs/examples/proxy/delete-rule.md +1 -1
- package/docs/examples/proxy/get-rule.md +1 -1
- package/docs/examples/proxy/list-rules.md +1 -1
- package/docs/examples/proxy/update-rule-verification.md +1 -1
- package/docs/examples/sites/create-deployment.md +18 -0
- package/docs/examples/sites/create-duplicate-deployment.md +14 -0
- package/docs/examples/sites/create-template-deployment.md +18 -0
- package/docs/examples/sites/create-variable.md +16 -0
- package/docs/examples/sites/create-vcs-deployment.md +16 -0
- package/docs/examples/sites/create.md +30 -0
- package/docs/examples/sites/delete-deployment.md +14 -0
- package/docs/examples/sites/delete-log.md +14 -0
- package/docs/examples/sites/delete-variable.md +14 -0
- package/docs/examples/sites/delete.md +13 -0
- package/docs/examples/sites/get-deployment-download.md +15 -0
- package/docs/examples/sites/get-deployment.md +14 -0
- package/docs/examples/sites/get-log.md +14 -0
- package/docs/examples/sites/get-template.md +13 -0
- package/docs/examples/sites/get-usage.md +14 -0
- package/docs/examples/sites/get-variable.md +14 -0
- package/docs/examples/sites/get.md +13 -0
- package/docs/examples/sites/list-deployments.md +15 -0
- package/docs/examples/sites/list-frameworks.md +11 -0
- package/docs/examples/sites/list-logs.md +14 -0
- package/docs/examples/sites/list-specifications.md +11 -0
- package/docs/examples/sites/list-templates.md +16 -0
- package/docs/examples/sites/list-usage.md +13 -0
- package/docs/examples/sites/list-variables.md +13 -0
- package/docs/examples/sites/list.md +14 -0
- package/docs/examples/sites/update-deployment-status.md +14 -0
- package/docs/examples/sites/update-site-deployment.md +14 -0
- package/docs/examples/sites/update-variable.md +17 -0
- package/docs/examples/sites/update.md +30 -0
- package/docs/examples/storage/create-bucket.md +1 -1
- package/docs/examples/storage/create-file.md +1 -1
- package/docs/examples/storage/delete-bucket.md +1 -1
- package/docs/examples/storage/delete-file.md +1 -1
- package/docs/examples/storage/get-bucket-usage.md +1 -1
- package/docs/examples/storage/get-bucket.md +1 -1
- package/docs/examples/storage/get-file-download.md +3 -2
- package/docs/examples/storage/get-file-preview.md +4 -3
- package/docs/examples/storage/get-file-view.md +3 -2
- package/docs/examples/storage/get-file.md +1 -1
- package/docs/examples/storage/get-usage.md +1 -1
- package/docs/examples/storage/list-buckets.md +1 -1
- package/docs/examples/storage/list-files.md +1 -1
- package/docs/examples/storage/update-bucket.md +1 -1
- package/docs/examples/storage/update-file.md +1 -1
- package/docs/examples/teams/create-membership.md +1 -1
- package/docs/examples/teams/create.md +1 -1
- package/docs/examples/teams/delete-membership.md +1 -1
- package/docs/examples/teams/delete.md +1 -1
- package/docs/examples/teams/get-membership.md +1 -1
- package/docs/examples/teams/get-prefs.md +1 -1
- package/docs/examples/teams/get.md +1 -1
- package/docs/examples/teams/list-logs.md +1 -1
- package/docs/examples/teams/list-memberships.md +1 -1
- package/docs/examples/teams/list.md +1 -1
- package/docs/examples/teams/update-membership-status.md +1 -1
- package/docs/examples/teams/update-membership.md +1 -1
- package/docs/examples/teams/update-name.md +1 -1
- package/docs/examples/teams/update-prefs.md +1 -1
- package/docs/examples/tokens/create-file-token.md +15 -0
- package/docs/examples/tokens/delete.md +13 -0
- package/docs/examples/tokens/get.md +13 -0
- package/docs/examples/tokens/list.md +15 -0
- package/docs/examples/tokens/update.md +14 -0
- package/docs/examples/users/create-argon2user.md +1 -1
- package/docs/examples/users/create-bcrypt-user.md +1 -1
- package/docs/examples/users/create-j-w-t.md +1 -1
- package/docs/examples/users/create-m-d5user.md +1 -1
- package/docs/examples/users/create-mfa-recovery-codes.md +1 -1
- package/docs/examples/users/create-p-h-pass-user.md +1 -1
- package/docs/examples/users/create-s-h-a-user.md +1 -1
- package/docs/examples/users/create-scrypt-modified-user.md +1 -1
- package/docs/examples/users/create-scrypt-user.md +1 -1
- package/docs/examples/users/create-session.md +1 -1
- package/docs/examples/users/create-target.md +1 -1
- package/docs/examples/users/create-token.md +1 -1
- package/docs/examples/users/create.md +1 -1
- package/docs/examples/users/delete-identity.md +1 -1
- package/docs/examples/users/delete-mfa-authenticator.md +1 -1
- package/docs/examples/users/delete-session.md +1 -1
- package/docs/examples/users/delete-sessions.md +1 -1
- package/docs/examples/users/delete-target.md +1 -1
- package/docs/examples/users/delete.md +1 -1
- package/docs/examples/users/get-mfa-recovery-codes.md +1 -1
- package/docs/examples/users/get-prefs.md +1 -1
- package/docs/examples/users/get-target.md +1 -1
- package/docs/examples/users/get-usage.md +1 -1
- package/docs/examples/users/get.md +1 -1
- package/docs/examples/users/list-identities.md +1 -1
- package/docs/examples/users/list-logs.md +1 -1
- package/docs/examples/users/list-memberships.md +4 -2
- package/docs/examples/users/list-mfa-factors.md +1 -1
- package/docs/examples/users/list-sessions.md +1 -1
- package/docs/examples/users/list-targets.md +1 -1
- package/docs/examples/users/list.md +1 -1
- package/docs/examples/users/update-email-verification.md +1 -1
- package/docs/examples/users/update-email.md +1 -1
- package/docs/examples/users/update-labels.md +1 -1
- package/docs/examples/users/update-mfa-recovery-codes.md +1 -1
- package/docs/examples/users/update-mfa.md +1 -1
- package/docs/examples/users/update-name.md +1 -1
- package/docs/examples/users/update-password.md +1 -1
- package/docs/examples/users/update-phone-verification.md +1 -1
- package/docs/examples/users/update-phone.md +1 -1
- package/docs/examples/users/update-prefs.md +1 -1
- package/docs/examples/users/update-status.md +1 -1
- package/docs/examples/users/update-target.md +1 -1
- package/docs/examples/vcs/create-repository-detection.md +3 -2
- package/docs/examples/vcs/create-repository.md +1 -1
- package/docs/examples/vcs/delete-installation.md +1 -1
- package/docs/examples/vcs/get-installation.md +1 -1
- package/docs/examples/vcs/get-repository-contents.md +1 -1
- package/docs/examples/vcs/get-repository.md +1 -1
- package/docs/examples/vcs/list-installations.md +1 -1
- package/docs/examples/vcs/list-repositories.md +3 -2
- package/docs/examples/vcs/list-repository-branches.md +1 -1
- package/docs/examples/vcs/update-external-deployments.md +1 -1
- package/package.json +1 -1
- package/src/client.ts +32 -5
- package/src/enums/adapter.ts +4 -0
- package/src/enums/api-service.ts +1 -0
- package/src/enums/build-runtime.ts +62 -0
- package/src/enums/console-resource-type.ts +3 -0
- package/src/enums/deployment-download-type.ts +4 -0
- package/src/enums/framework.ts +16 -0
- package/src/enums/image-format.ts +0 -1
- package/src/enums/name.ts +0 -1
- package/src/enums/o-auth-provider.ts +1 -0
- package/src/enums/region.ts +2 -1
- package/src/enums/runtime.ts +4 -3
- package/src/enums/site-usage-range.ts +5 -0
- package/src/enums/status-code.ts +6 -0
- package/src/enums/v-c-s-deployment-type.ts +5 -0
- package/src/enums/v-c-s-detection-type.ts +4 -0
- package/src/index.ts +13 -2
- package/src/models.ts +1171 -188
- package/src/services/account.ts +126 -446
- package/src/services/assistant.ts +2 -7
- package/src/services/avatars.ts +7 -28
- package/src/services/backups.ts +24 -90
- package/src/services/console.ts +48 -52
- package/src/services/databases.ts +241 -350
- package/src/services/domains.ts +1821 -0
- package/src/services/functions.ts +216 -248
- package/src/services/graphql.ts +4 -14
- package/src/services/health.ts +56 -206
- package/src/services/locale.ts +16 -64
- package/src/services/messaging.ts +92 -335
- package/src/services/migrations.ts +66 -89
- package/src/services/organizations.ts +84 -241
- package/src/services/project.ts +20 -45
- package/src/services/projects.ts +262 -330
- package/src/services/proxy.ts +129 -44
- package/src/services/sites.ts +1104 -0
- package/src/services/storage.ts +42 -105
- package/src/services/teams.ts +28 -104
- package/src/services/tokens.ts +160 -0
- package/src/services/users.ts +94 -313
- package/src/services/vcs.ts +70 -108
- package/types/enums/adapter.d.ts +4 -0
- package/types/enums/api-service.d.ts +1 -0
- package/types/enums/build-runtime.d.ts +62 -0
- package/types/enums/console-resource-type.d.ts +3 -0
- package/types/enums/deployment-download-type.d.ts +4 -0
- package/types/enums/framework.d.ts +16 -0
- package/types/enums/image-format.d.ts +0 -1
- package/types/enums/name.d.ts +0 -1
- package/types/enums/o-auth-provider.d.ts +1 -0
- package/types/enums/region.d.ts +3 -2
- package/types/enums/runtime.d.ts +5 -4
- package/types/enums/site-usage-range.d.ts +5 -0
- package/types/enums/status-code.d.ts +6 -0
- package/types/enums/v-c-s-deployment-type.d.ts +5 -0
- package/types/enums/v-c-s-detection-type.d.ts +4 -0
- package/types/index.d.ts +13 -2
- package/types/models.d.ts +1171 -188
- package/types/services/account.d.ts +4 -128
- package/types/services/assistant.d.ts +0 -2
- package/types/services/avatars.d.ts +0 -14
- package/types/services/backups.d.ts +0 -24
- package/types/services/console.d.ts +9 -13
- package/types/services/databases.d.ts +43 -97
- package/types/services/domains.d.ts +524 -0
- package/types/services/functions.d.ts +58 -84
- package/types/services/graphql.d.ts +0 -4
- package/types/services/health.d.ts +6 -56
- package/types/services/locale.d.ts +0 -16
- package/types/services/messaging.d.ts +0 -92
- package/types/services/migrations.d.ts +9 -23
- package/types/services/organizations.d.ts +11 -68
- package/types/services/project.d.ts +4 -14
- package/types/services/projects.d.ts +47 -91
- package/types/services/proxy.d.ts +31 -13
- package/types/services/sites.d.ts +319 -0
- package/types/services/storage.d.ts +6 -33
- package/types/services/teams.d.ts +0 -28
- package/types/services/tokens.d.ts +51 -0
- package/types/services/users.d.ts +3 -87
- package/types/services/vcs.d.ts +14 -31
|
@@ -14,8 +14,6 @@ export class Databases {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
* List databases
|
|
18
|
-
*
|
|
19
17
|
* Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.
|
|
20
18
|
*
|
|
21
19
|
* @param {string[]} queries
|
|
@@ -23,7 +21,7 @@ export class Databases {
|
|
|
23
21
|
* @throws {AppwriteException}
|
|
24
22
|
* @returns {Promise<Models.DatabaseList>}
|
|
25
23
|
*/
|
|
26
|
-
|
|
24
|
+
list(queries?: string[], search?: string): Promise<Models.DatabaseList> {
|
|
27
25
|
const apiPath = '/databases';
|
|
28
26
|
const payload: Payload = {};
|
|
29
27
|
if (typeof queries !== 'undefined') {
|
|
@@ -35,13 +33,9 @@ export class Databases {
|
|
|
35
33
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
36
34
|
|
|
37
35
|
const apiHeaders: { [header: string]: string } = {
|
|
38
|
-
'content-type': 'application/json',
|
|
39
36
|
}
|
|
40
37
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return await this.client.call(
|
|
38
|
+
return this.client.call(
|
|
45
39
|
'get',
|
|
46
40
|
uri,
|
|
47
41
|
apiHeaders,
|
|
@@ -49,8 +43,6 @@ export class Databases {
|
|
|
49
43
|
);
|
|
50
44
|
}
|
|
51
45
|
/**
|
|
52
|
-
* Create database
|
|
53
|
-
*
|
|
54
46
|
* Create a new Database.
|
|
55
47
|
|
|
56
48
|
*
|
|
@@ -60,7 +52,7 @@ export class Databases {
|
|
|
60
52
|
* @throws {AppwriteException}
|
|
61
53
|
* @returns {Promise<Models.Database>}
|
|
62
54
|
*/
|
|
63
|
-
|
|
55
|
+
create(databaseId: string, name: string, enabled?: boolean): Promise<Models.Database> {
|
|
64
56
|
if (typeof databaseId === 'undefined') {
|
|
65
57
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
66
58
|
}
|
|
@@ -84,10 +76,7 @@ export class Databases {
|
|
|
84
76
|
'content-type': 'application/json',
|
|
85
77
|
}
|
|
86
78
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
return await this.client.call(
|
|
79
|
+
return this.client.call(
|
|
91
80
|
'post',
|
|
92
81
|
uri,
|
|
93
82
|
apiHeaders,
|
|
@@ -95,15 +84,13 @@ export class Databases {
|
|
|
95
84
|
);
|
|
96
85
|
}
|
|
97
86
|
/**
|
|
98
|
-
* Get databases usage stats
|
|
99
|
-
*
|
|
100
87
|
* Get usage metrics and statistics for all databases in the project. You can view the total number of databases, collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.
|
|
101
88
|
*
|
|
102
89
|
* @param {DatabaseUsageRange} range
|
|
103
90
|
* @throws {AppwriteException}
|
|
104
91
|
* @returns {Promise<Models.UsageDatabases>}
|
|
105
92
|
*/
|
|
106
|
-
|
|
93
|
+
getUsage(range?: DatabaseUsageRange): Promise<Models.UsageDatabases> {
|
|
107
94
|
const apiPath = '/databases/usage';
|
|
108
95
|
const payload: Payload = {};
|
|
109
96
|
if (typeof range !== 'undefined') {
|
|
@@ -112,13 +99,9 @@ export class Databases {
|
|
|
112
99
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
113
100
|
|
|
114
101
|
const apiHeaders: { [header: string]: string } = {
|
|
115
|
-
'content-type': 'application/json',
|
|
116
102
|
}
|
|
117
103
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
return await this.client.call(
|
|
104
|
+
return this.client.call(
|
|
122
105
|
'get',
|
|
123
106
|
uri,
|
|
124
107
|
apiHeaders,
|
|
@@ -126,15 +109,13 @@ export class Databases {
|
|
|
126
109
|
);
|
|
127
110
|
}
|
|
128
111
|
/**
|
|
129
|
-
* Get database
|
|
130
|
-
*
|
|
131
112
|
* Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.
|
|
132
113
|
*
|
|
133
114
|
* @param {string} databaseId
|
|
134
115
|
* @throws {AppwriteException}
|
|
135
116
|
* @returns {Promise<Models.Database>}
|
|
136
117
|
*/
|
|
137
|
-
|
|
118
|
+
get(databaseId: string): Promise<Models.Database> {
|
|
138
119
|
if (typeof databaseId === 'undefined') {
|
|
139
120
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
140
121
|
}
|
|
@@ -143,13 +124,9 @@ export class Databases {
|
|
|
143
124
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
144
125
|
|
|
145
126
|
const apiHeaders: { [header: string]: string } = {
|
|
146
|
-
'content-type': 'application/json',
|
|
147
127
|
}
|
|
148
128
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
return await this.client.call(
|
|
129
|
+
return this.client.call(
|
|
153
130
|
'get',
|
|
154
131
|
uri,
|
|
155
132
|
apiHeaders,
|
|
@@ -157,8 +134,6 @@ export class Databases {
|
|
|
157
134
|
);
|
|
158
135
|
}
|
|
159
136
|
/**
|
|
160
|
-
* Update database
|
|
161
|
-
*
|
|
162
137
|
* Update a database by its unique ID.
|
|
163
138
|
*
|
|
164
139
|
* @param {string} databaseId
|
|
@@ -167,7 +142,7 @@ export class Databases {
|
|
|
167
142
|
* @throws {AppwriteException}
|
|
168
143
|
* @returns {Promise<Models.Database>}
|
|
169
144
|
*/
|
|
170
|
-
|
|
145
|
+
update(databaseId: string, name: string, enabled?: boolean): Promise<Models.Database> {
|
|
171
146
|
if (typeof databaseId === 'undefined') {
|
|
172
147
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
173
148
|
}
|
|
@@ -188,10 +163,7 @@ export class Databases {
|
|
|
188
163
|
'content-type': 'application/json',
|
|
189
164
|
}
|
|
190
165
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
return await this.client.call(
|
|
166
|
+
return this.client.call(
|
|
195
167
|
'put',
|
|
196
168
|
uri,
|
|
197
169
|
apiHeaders,
|
|
@@ -199,15 +171,13 @@ export class Databases {
|
|
|
199
171
|
);
|
|
200
172
|
}
|
|
201
173
|
/**
|
|
202
|
-
* Delete database
|
|
203
|
-
*
|
|
204
174
|
* Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.
|
|
205
175
|
*
|
|
206
176
|
* @param {string} databaseId
|
|
207
177
|
* @throws {AppwriteException}
|
|
208
178
|
* @returns {Promise<{}>}
|
|
209
179
|
*/
|
|
210
|
-
|
|
180
|
+
delete(databaseId: string): Promise<{}> {
|
|
211
181
|
if (typeof databaseId === 'undefined') {
|
|
212
182
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
213
183
|
}
|
|
@@ -219,10 +189,7 @@ export class Databases {
|
|
|
219
189
|
'content-type': 'application/json',
|
|
220
190
|
}
|
|
221
191
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
return await this.client.call(
|
|
192
|
+
return this.client.call(
|
|
226
193
|
'delete',
|
|
227
194
|
uri,
|
|
228
195
|
apiHeaders,
|
|
@@ -230,8 +197,6 @@ export class Databases {
|
|
|
230
197
|
);
|
|
231
198
|
}
|
|
232
199
|
/**
|
|
233
|
-
* List collections
|
|
234
|
-
*
|
|
235
200
|
* Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results.
|
|
236
201
|
*
|
|
237
202
|
* @param {string} databaseId
|
|
@@ -240,7 +205,7 @@ export class Databases {
|
|
|
240
205
|
* @throws {AppwriteException}
|
|
241
206
|
* @returns {Promise<Models.CollectionList>}
|
|
242
207
|
*/
|
|
243
|
-
|
|
208
|
+
listCollections(databaseId: string, queries?: string[], search?: string): Promise<Models.CollectionList> {
|
|
244
209
|
if (typeof databaseId === 'undefined') {
|
|
245
210
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
246
211
|
}
|
|
@@ -255,13 +220,9 @@ export class Databases {
|
|
|
255
220
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
256
221
|
|
|
257
222
|
const apiHeaders: { [header: string]: string } = {
|
|
258
|
-
'content-type': 'application/json',
|
|
259
223
|
}
|
|
260
224
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
return await this.client.call(
|
|
225
|
+
return this.client.call(
|
|
265
226
|
'get',
|
|
266
227
|
uri,
|
|
267
228
|
apiHeaders,
|
|
@@ -269,8 +230,6 @@ export class Databases {
|
|
|
269
230
|
);
|
|
270
231
|
}
|
|
271
232
|
/**
|
|
272
|
-
* Create collection
|
|
273
|
-
*
|
|
274
233
|
* Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.
|
|
275
234
|
*
|
|
276
235
|
* @param {string} databaseId
|
|
@@ -282,7 +241,7 @@ export class Databases {
|
|
|
282
241
|
* @throws {AppwriteException}
|
|
283
242
|
* @returns {Promise<Models.Collection>}
|
|
284
243
|
*/
|
|
285
|
-
|
|
244
|
+
createCollection(databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean): Promise<Models.Collection> {
|
|
286
245
|
if (typeof databaseId === 'undefined') {
|
|
287
246
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
288
247
|
}
|
|
@@ -315,10 +274,7 @@ export class Databases {
|
|
|
315
274
|
'content-type': 'application/json',
|
|
316
275
|
}
|
|
317
276
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
return await this.client.call(
|
|
277
|
+
return this.client.call(
|
|
322
278
|
'post',
|
|
323
279
|
uri,
|
|
324
280
|
apiHeaders,
|
|
@@ -326,8 +282,6 @@ export class Databases {
|
|
|
326
282
|
);
|
|
327
283
|
}
|
|
328
284
|
/**
|
|
329
|
-
* Get collection
|
|
330
|
-
*
|
|
331
285
|
* Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.
|
|
332
286
|
*
|
|
333
287
|
* @param {string} databaseId
|
|
@@ -335,7 +289,7 @@ export class Databases {
|
|
|
335
289
|
* @throws {AppwriteException}
|
|
336
290
|
* @returns {Promise<Models.Collection>}
|
|
337
291
|
*/
|
|
338
|
-
|
|
292
|
+
getCollection(databaseId: string, collectionId: string): Promise<Models.Collection> {
|
|
339
293
|
if (typeof databaseId === 'undefined') {
|
|
340
294
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
341
295
|
}
|
|
@@ -347,13 +301,9 @@ export class Databases {
|
|
|
347
301
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
348
302
|
|
|
349
303
|
const apiHeaders: { [header: string]: string } = {
|
|
350
|
-
'content-type': 'application/json',
|
|
351
304
|
}
|
|
352
305
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
return await this.client.call(
|
|
306
|
+
return this.client.call(
|
|
357
307
|
'get',
|
|
358
308
|
uri,
|
|
359
309
|
apiHeaders,
|
|
@@ -361,8 +311,6 @@ export class Databases {
|
|
|
361
311
|
);
|
|
362
312
|
}
|
|
363
313
|
/**
|
|
364
|
-
* Update collection
|
|
365
|
-
*
|
|
366
314
|
* Update a collection by its unique ID.
|
|
367
315
|
*
|
|
368
316
|
* @param {string} databaseId
|
|
@@ -374,7 +322,7 @@ export class Databases {
|
|
|
374
322
|
* @throws {AppwriteException}
|
|
375
323
|
* @returns {Promise<Models.Collection>}
|
|
376
324
|
*/
|
|
377
|
-
|
|
325
|
+
updateCollection(databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean): Promise<Models.Collection> {
|
|
378
326
|
if (typeof databaseId === 'undefined') {
|
|
379
327
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
380
328
|
}
|
|
@@ -404,10 +352,7 @@ export class Databases {
|
|
|
404
352
|
'content-type': 'application/json',
|
|
405
353
|
}
|
|
406
354
|
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
return await this.client.call(
|
|
355
|
+
return this.client.call(
|
|
411
356
|
'put',
|
|
412
357
|
uri,
|
|
413
358
|
apiHeaders,
|
|
@@ -415,8 +360,6 @@ export class Databases {
|
|
|
415
360
|
);
|
|
416
361
|
}
|
|
417
362
|
/**
|
|
418
|
-
* Delete collection
|
|
419
|
-
*
|
|
420
363
|
* Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.
|
|
421
364
|
*
|
|
422
365
|
* @param {string} databaseId
|
|
@@ -424,7 +367,7 @@ export class Databases {
|
|
|
424
367
|
* @throws {AppwriteException}
|
|
425
368
|
* @returns {Promise<{}>}
|
|
426
369
|
*/
|
|
427
|
-
|
|
370
|
+
deleteCollection(databaseId: string, collectionId: string): Promise<{}> {
|
|
428
371
|
if (typeof databaseId === 'undefined') {
|
|
429
372
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
430
373
|
}
|
|
@@ -439,10 +382,7 @@ export class Databases {
|
|
|
439
382
|
'content-type': 'application/json',
|
|
440
383
|
}
|
|
441
384
|
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
return await this.client.call(
|
|
385
|
+
return this.client.call(
|
|
446
386
|
'delete',
|
|
447
387
|
uri,
|
|
448
388
|
apiHeaders,
|
|
@@ -450,8 +390,6 @@ export class Databases {
|
|
|
450
390
|
);
|
|
451
391
|
}
|
|
452
392
|
/**
|
|
453
|
-
* List attributes
|
|
454
|
-
*
|
|
455
393
|
* List attributes in the collection.
|
|
456
394
|
*
|
|
457
395
|
* @param {string} databaseId
|
|
@@ -460,7 +398,7 @@ export class Databases {
|
|
|
460
398
|
* @throws {AppwriteException}
|
|
461
399
|
* @returns {Promise<Models.AttributeList>}
|
|
462
400
|
*/
|
|
463
|
-
|
|
401
|
+
listAttributes(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.AttributeList> {
|
|
464
402
|
if (typeof databaseId === 'undefined') {
|
|
465
403
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
466
404
|
}
|
|
@@ -475,13 +413,9 @@ export class Databases {
|
|
|
475
413
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
476
414
|
|
|
477
415
|
const apiHeaders: { [header: string]: string } = {
|
|
478
|
-
'content-type': 'application/json',
|
|
479
416
|
}
|
|
480
417
|
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
return await this.client.call(
|
|
418
|
+
return this.client.call(
|
|
485
419
|
'get',
|
|
486
420
|
uri,
|
|
487
421
|
apiHeaders,
|
|
@@ -489,8 +423,6 @@ export class Databases {
|
|
|
489
423
|
);
|
|
490
424
|
}
|
|
491
425
|
/**
|
|
492
|
-
* Create boolean attribute
|
|
493
|
-
*
|
|
494
426
|
* Create a boolean attribute.
|
|
495
427
|
|
|
496
428
|
*
|
|
@@ -503,7 +435,7 @@ export class Databases {
|
|
|
503
435
|
* @throws {AppwriteException}
|
|
504
436
|
* @returns {Promise<Models.AttributeBoolean>}
|
|
505
437
|
*/
|
|
506
|
-
|
|
438
|
+
createBooleanAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: boolean, array?: boolean): Promise<Models.AttributeBoolean> {
|
|
507
439
|
if (typeof databaseId === 'undefined') {
|
|
508
440
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
509
441
|
}
|
|
@@ -536,10 +468,7 @@ export class Databases {
|
|
|
536
468
|
'content-type': 'application/json',
|
|
537
469
|
}
|
|
538
470
|
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
return await this.client.call(
|
|
471
|
+
return this.client.call(
|
|
543
472
|
'post',
|
|
544
473
|
uri,
|
|
545
474
|
apiHeaders,
|
|
@@ -547,8 +476,6 @@ export class Databases {
|
|
|
547
476
|
);
|
|
548
477
|
}
|
|
549
478
|
/**
|
|
550
|
-
* Update boolean attribute
|
|
551
|
-
*
|
|
552
479
|
* Update a boolean attribute. Changing the `default` value will not update already existing documents.
|
|
553
480
|
*
|
|
554
481
|
* @param {string} databaseId
|
|
@@ -560,7 +487,7 @@ export class Databases {
|
|
|
560
487
|
* @throws {AppwriteException}
|
|
561
488
|
* @returns {Promise<Models.AttributeBoolean>}
|
|
562
489
|
*/
|
|
563
|
-
|
|
490
|
+
updateBooleanAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: boolean, newKey?: string): Promise<Models.AttributeBoolean> {
|
|
564
491
|
if (typeof databaseId === 'undefined') {
|
|
565
492
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
566
493
|
}
|
|
@@ -593,10 +520,7 @@ export class Databases {
|
|
|
593
520
|
'content-type': 'application/json',
|
|
594
521
|
}
|
|
595
522
|
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
return await this.client.call(
|
|
523
|
+
return this.client.call(
|
|
600
524
|
'patch',
|
|
601
525
|
uri,
|
|
602
526
|
apiHeaders,
|
|
@@ -604,8 +528,6 @@ export class Databases {
|
|
|
604
528
|
);
|
|
605
529
|
}
|
|
606
530
|
/**
|
|
607
|
-
* Create datetime attribute
|
|
608
|
-
*
|
|
609
531
|
* Create a date time attribute according to the ISO 8601 standard.
|
|
610
532
|
*
|
|
611
533
|
* @param {string} databaseId
|
|
@@ -617,7 +539,7 @@ export class Databases {
|
|
|
617
539
|
* @throws {AppwriteException}
|
|
618
540
|
* @returns {Promise<Models.AttributeDatetime>}
|
|
619
541
|
*/
|
|
620
|
-
|
|
542
|
+
createDatetimeAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeDatetime> {
|
|
621
543
|
if (typeof databaseId === 'undefined') {
|
|
622
544
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
623
545
|
}
|
|
@@ -650,10 +572,7 @@ export class Databases {
|
|
|
650
572
|
'content-type': 'application/json',
|
|
651
573
|
}
|
|
652
574
|
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
return await this.client.call(
|
|
575
|
+
return this.client.call(
|
|
657
576
|
'post',
|
|
658
577
|
uri,
|
|
659
578
|
apiHeaders,
|
|
@@ -661,8 +580,6 @@ export class Databases {
|
|
|
661
580
|
);
|
|
662
581
|
}
|
|
663
582
|
/**
|
|
664
|
-
* Update dateTime attribute
|
|
665
|
-
*
|
|
666
583
|
* Update a date time attribute. Changing the `default` value will not update already existing documents.
|
|
667
584
|
*
|
|
668
585
|
* @param {string} databaseId
|
|
@@ -674,7 +591,7 @@ export class Databases {
|
|
|
674
591
|
* @throws {AppwriteException}
|
|
675
592
|
* @returns {Promise<Models.AttributeDatetime>}
|
|
676
593
|
*/
|
|
677
|
-
|
|
594
|
+
updateDatetimeAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeDatetime> {
|
|
678
595
|
if (typeof databaseId === 'undefined') {
|
|
679
596
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
680
597
|
}
|
|
@@ -707,10 +624,7 @@ export class Databases {
|
|
|
707
624
|
'content-type': 'application/json',
|
|
708
625
|
}
|
|
709
626
|
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
return await this.client.call(
|
|
627
|
+
return this.client.call(
|
|
714
628
|
'patch',
|
|
715
629
|
uri,
|
|
716
630
|
apiHeaders,
|
|
@@ -718,8 +632,6 @@ export class Databases {
|
|
|
718
632
|
);
|
|
719
633
|
}
|
|
720
634
|
/**
|
|
721
|
-
* Create email attribute
|
|
722
|
-
*
|
|
723
635
|
* Create an email attribute.
|
|
724
636
|
|
|
725
637
|
*
|
|
@@ -732,7 +644,7 @@ export class Databases {
|
|
|
732
644
|
* @throws {AppwriteException}
|
|
733
645
|
* @returns {Promise<Models.AttributeEmail>}
|
|
734
646
|
*/
|
|
735
|
-
|
|
647
|
+
createEmailAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeEmail> {
|
|
736
648
|
if (typeof databaseId === 'undefined') {
|
|
737
649
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
738
650
|
}
|
|
@@ -765,10 +677,7 @@ export class Databases {
|
|
|
765
677
|
'content-type': 'application/json',
|
|
766
678
|
}
|
|
767
679
|
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
return await this.client.call(
|
|
680
|
+
return this.client.call(
|
|
772
681
|
'post',
|
|
773
682
|
uri,
|
|
774
683
|
apiHeaders,
|
|
@@ -776,8 +685,6 @@ export class Databases {
|
|
|
776
685
|
);
|
|
777
686
|
}
|
|
778
687
|
/**
|
|
779
|
-
* Update email attribute
|
|
780
|
-
*
|
|
781
688
|
* Update an email attribute. Changing the `default` value will not update already existing documents.
|
|
782
689
|
|
|
783
690
|
*
|
|
@@ -790,7 +697,7 @@ export class Databases {
|
|
|
790
697
|
* @throws {AppwriteException}
|
|
791
698
|
* @returns {Promise<Models.AttributeEmail>}
|
|
792
699
|
*/
|
|
793
|
-
|
|
700
|
+
updateEmailAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeEmail> {
|
|
794
701
|
if (typeof databaseId === 'undefined') {
|
|
795
702
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
796
703
|
}
|
|
@@ -823,10 +730,7 @@ export class Databases {
|
|
|
823
730
|
'content-type': 'application/json',
|
|
824
731
|
}
|
|
825
732
|
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
return await this.client.call(
|
|
733
|
+
return this.client.call(
|
|
830
734
|
'patch',
|
|
831
735
|
uri,
|
|
832
736
|
apiHeaders,
|
|
@@ -834,8 +738,6 @@ export class Databases {
|
|
|
834
738
|
);
|
|
835
739
|
}
|
|
836
740
|
/**
|
|
837
|
-
* Create enum attribute
|
|
838
|
-
*
|
|
839
741
|
* Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute.
|
|
840
742
|
|
|
841
743
|
*
|
|
@@ -849,7 +751,7 @@ export class Databases {
|
|
|
849
751
|
* @throws {AppwriteException}
|
|
850
752
|
* @returns {Promise<Models.AttributeEnum>}
|
|
851
753
|
*/
|
|
852
|
-
|
|
754
|
+
createEnumAttribute(databaseId: string, collectionId: string, key: string, elements: string[], required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeEnum> {
|
|
853
755
|
if (typeof databaseId === 'undefined') {
|
|
854
756
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
855
757
|
}
|
|
@@ -888,10 +790,7 @@ export class Databases {
|
|
|
888
790
|
'content-type': 'application/json',
|
|
889
791
|
}
|
|
890
792
|
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
return await this.client.call(
|
|
793
|
+
return this.client.call(
|
|
895
794
|
'post',
|
|
896
795
|
uri,
|
|
897
796
|
apiHeaders,
|
|
@@ -899,8 +798,6 @@ export class Databases {
|
|
|
899
798
|
);
|
|
900
799
|
}
|
|
901
800
|
/**
|
|
902
|
-
* Update enum attribute
|
|
903
|
-
*
|
|
904
801
|
* Update an enum attribute. Changing the `default` value will not update already existing documents.
|
|
905
802
|
|
|
906
803
|
*
|
|
@@ -914,7 +811,7 @@ export class Databases {
|
|
|
914
811
|
* @throws {AppwriteException}
|
|
915
812
|
* @returns {Promise<Models.AttributeEnum>}
|
|
916
813
|
*/
|
|
917
|
-
|
|
814
|
+
updateEnumAttribute(databaseId: string, collectionId: string, key: string, elements: string[], required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeEnum> {
|
|
918
815
|
if (typeof databaseId === 'undefined') {
|
|
919
816
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
920
817
|
}
|
|
@@ -953,10 +850,7 @@ export class Databases {
|
|
|
953
850
|
'content-type': 'application/json',
|
|
954
851
|
}
|
|
955
852
|
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
return await this.client.call(
|
|
853
|
+
return this.client.call(
|
|
960
854
|
'patch',
|
|
961
855
|
uri,
|
|
962
856
|
apiHeaders,
|
|
@@ -964,8 +858,6 @@ export class Databases {
|
|
|
964
858
|
);
|
|
965
859
|
}
|
|
966
860
|
/**
|
|
967
|
-
* Create float attribute
|
|
968
|
-
*
|
|
969
861
|
* Create a float attribute. Optionally, minimum and maximum values can be provided.
|
|
970
862
|
|
|
971
863
|
*
|
|
@@ -980,7 +872,7 @@ export class Databases {
|
|
|
980
872
|
* @throws {AppwriteException}
|
|
981
873
|
* @returns {Promise<Models.AttributeFloat>}
|
|
982
874
|
*/
|
|
983
|
-
|
|
875
|
+
createFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise<Models.AttributeFloat> {
|
|
984
876
|
if (typeof databaseId === 'undefined') {
|
|
985
877
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
986
878
|
}
|
|
@@ -1019,10 +911,7 @@ export class Databases {
|
|
|
1019
911
|
'content-type': 'application/json',
|
|
1020
912
|
}
|
|
1021
913
|
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
return await this.client.call(
|
|
914
|
+
return this.client.call(
|
|
1026
915
|
'post',
|
|
1027
916
|
uri,
|
|
1028
917
|
apiHeaders,
|
|
@@ -1030,8 +919,6 @@ export class Databases {
|
|
|
1030
919
|
);
|
|
1031
920
|
}
|
|
1032
921
|
/**
|
|
1033
|
-
* Update float attribute
|
|
1034
|
-
*
|
|
1035
922
|
* Update a float attribute. Changing the `default` value will not update already existing documents.
|
|
1036
923
|
|
|
1037
924
|
*
|
|
@@ -1046,7 +933,7 @@ export class Databases {
|
|
|
1046
933
|
* @throws {AppwriteException}
|
|
1047
934
|
* @returns {Promise<Models.AttributeFloat>}
|
|
1048
935
|
*/
|
|
1049
|
-
|
|
936
|
+
updateFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string): Promise<Models.AttributeFloat> {
|
|
1050
937
|
if (typeof databaseId === 'undefined') {
|
|
1051
938
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1052
939
|
}
|
|
@@ -1085,10 +972,7 @@ export class Databases {
|
|
|
1085
972
|
'content-type': 'application/json',
|
|
1086
973
|
}
|
|
1087
974
|
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
return await this.client.call(
|
|
975
|
+
return this.client.call(
|
|
1092
976
|
'patch',
|
|
1093
977
|
uri,
|
|
1094
978
|
apiHeaders,
|
|
@@ -1096,8 +980,6 @@ export class Databases {
|
|
|
1096
980
|
);
|
|
1097
981
|
}
|
|
1098
982
|
/**
|
|
1099
|
-
* Create integer attribute
|
|
1100
|
-
*
|
|
1101
983
|
* Create an integer attribute. Optionally, minimum and maximum values can be provided.
|
|
1102
984
|
|
|
1103
985
|
*
|
|
@@ -1112,7 +994,7 @@ export class Databases {
|
|
|
1112
994
|
* @throws {AppwriteException}
|
|
1113
995
|
* @returns {Promise<Models.AttributeInteger>}
|
|
1114
996
|
*/
|
|
1115
|
-
|
|
997
|
+
createIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise<Models.AttributeInteger> {
|
|
1116
998
|
if (typeof databaseId === 'undefined') {
|
|
1117
999
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1118
1000
|
}
|
|
@@ -1151,10 +1033,7 @@ export class Databases {
|
|
|
1151
1033
|
'content-type': 'application/json',
|
|
1152
1034
|
}
|
|
1153
1035
|
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
return await this.client.call(
|
|
1036
|
+
return this.client.call(
|
|
1158
1037
|
'post',
|
|
1159
1038
|
uri,
|
|
1160
1039
|
apiHeaders,
|
|
@@ -1162,8 +1041,6 @@ export class Databases {
|
|
|
1162
1041
|
);
|
|
1163
1042
|
}
|
|
1164
1043
|
/**
|
|
1165
|
-
* Update integer attribute
|
|
1166
|
-
*
|
|
1167
1044
|
* Update an integer attribute. Changing the `default` value will not update already existing documents.
|
|
1168
1045
|
|
|
1169
1046
|
*
|
|
@@ -1178,7 +1055,7 @@ export class Databases {
|
|
|
1178
1055
|
* @throws {AppwriteException}
|
|
1179
1056
|
* @returns {Promise<Models.AttributeInteger>}
|
|
1180
1057
|
*/
|
|
1181
|
-
|
|
1058
|
+
updateIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string): Promise<Models.AttributeInteger> {
|
|
1182
1059
|
if (typeof databaseId === 'undefined') {
|
|
1183
1060
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1184
1061
|
}
|
|
@@ -1217,10 +1094,7 @@ export class Databases {
|
|
|
1217
1094
|
'content-type': 'application/json',
|
|
1218
1095
|
}
|
|
1219
1096
|
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
return await this.client.call(
|
|
1097
|
+
return this.client.call(
|
|
1224
1098
|
'patch',
|
|
1225
1099
|
uri,
|
|
1226
1100
|
apiHeaders,
|
|
@@ -1228,8 +1102,6 @@ export class Databases {
|
|
|
1228
1102
|
);
|
|
1229
1103
|
}
|
|
1230
1104
|
/**
|
|
1231
|
-
* Create IP address attribute
|
|
1232
|
-
*
|
|
1233
1105
|
* Create IP address attribute.
|
|
1234
1106
|
|
|
1235
1107
|
*
|
|
@@ -1242,7 +1114,7 @@ export class Databases {
|
|
|
1242
1114
|
* @throws {AppwriteException}
|
|
1243
1115
|
* @returns {Promise<Models.AttributeIp>}
|
|
1244
1116
|
*/
|
|
1245
|
-
|
|
1117
|
+
createIpAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeIp> {
|
|
1246
1118
|
if (typeof databaseId === 'undefined') {
|
|
1247
1119
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1248
1120
|
}
|
|
@@ -1275,10 +1147,7 @@ export class Databases {
|
|
|
1275
1147
|
'content-type': 'application/json',
|
|
1276
1148
|
}
|
|
1277
1149
|
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
return await this.client.call(
|
|
1150
|
+
return this.client.call(
|
|
1282
1151
|
'post',
|
|
1283
1152
|
uri,
|
|
1284
1153
|
apiHeaders,
|
|
@@ -1286,8 +1155,6 @@ export class Databases {
|
|
|
1286
1155
|
);
|
|
1287
1156
|
}
|
|
1288
1157
|
/**
|
|
1289
|
-
* Update IP address attribute
|
|
1290
|
-
*
|
|
1291
1158
|
* Update an ip attribute. Changing the `default` value will not update already existing documents.
|
|
1292
1159
|
|
|
1293
1160
|
*
|
|
@@ -1300,7 +1167,7 @@ export class Databases {
|
|
|
1300
1167
|
* @throws {AppwriteException}
|
|
1301
1168
|
* @returns {Promise<Models.AttributeIp>}
|
|
1302
1169
|
*/
|
|
1303
|
-
|
|
1170
|
+
updateIpAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeIp> {
|
|
1304
1171
|
if (typeof databaseId === 'undefined') {
|
|
1305
1172
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1306
1173
|
}
|
|
@@ -1333,10 +1200,7 @@ export class Databases {
|
|
|
1333
1200
|
'content-type': 'application/json',
|
|
1334
1201
|
}
|
|
1335
1202
|
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
return await this.client.call(
|
|
1203
|
+
return this.client.call(
|
|
1340
1204
|
'patch',
|
|
1341
1205
|
uri,
|
|
1342
1206
|
apiHeaders,
|
|
@@ -1344,8 +1208,6 @@ export class Databases {
|
|
|
1344
1208
|
);
|
|
1345
1209
|
}
|
|
1346
1210
|
/**
|
|
1347
|
-
* Create relationship attribute
|
|
1348
|
-
*
|
|
1349
1211
|
* Create relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
|
|
1350
1212
|
|
|
1351
1213
|
*
|
|
@@ -1360,7 +1222,7 @@ export class Databases {
|
|
|
1360
1222
|
* @throws {AppwriteException}
|
|
1361
1223
|
* @returns {Promise<Models.AttributeRelationship>}
|
|
1362
1224
|
*/
|
|
1363
|
-
|
|
1225
|
+
createRelationshipAttribute(databaseId: string, collectionId: string, relatedCollectionId: string, type: RelationshipType, twoWay?: boolean, key?: string, twoWayKey?: string, onDelete?: RelationMutate): Promise<Models.AttributeRelationship> {
|
|
1364
1226
|
if (typeof databaseId === 'undefined') {
|
|
1365
1227
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1366
1228
|
}
|
|
@@ -1399,10 +1261,7 @@ export class Databases {
|
|
|
1399
1261
|
'content-type': 'application/json',
|
|
1400
1262
|
}
|
|
1401
1263
|
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
return await this.client.call(
|
|
1264
|
+
return this.client.call(
|
|
1406
1265
|
'post',
|
|
1407
1266
|
uri,
|
|
1408
1267
|
apiHeaders,
|
|
@@ -1410,8 +1269,6 @@ export class Databases {
|
|
|
1410
1269
|
);
|
|
1411
1270
|
}
|
|
1412
1271
|
/**
|
|
1413
|
-
* Create string attribute
|
|
1414
|
-
*
|
|
1415
1272
|
* Create a string attribute.
|
|
1416
1273
|
|
|
1417
1274
|
*
|
|
@@ -1426,7 +1283,7 @@ export class Databases {
|
|
|
1426
1283
|
* @throws {AppwriteException}
|
|
1427
1284
|
* @returns {Promise<Models.AttributeString>}
|
|
1428
1285
|
*/
|
|
1429
|
-
|
|
1286
|
+
createStringAttribute(databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean): Promise<Models.AttributeString> {
|
|
1430
1287
|
if (typeof databaseId === 'undefined') {
|
|
1431
1288
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1432
1289
|
}
|
|
@@ -1468,10 +1325,7 @@ export class Databases {
|
|
|
1468
1325
|
'content-type': 'application/json',
|
|
1469
1326
|
}
|
|
1470
1327
|
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
return await this.client.call(
|
|
1328
|
+
return this.client.call(
|
|
1475
1329
|
'post',
|
|
1476
1330
|
uri,
|
|
1477
1331
|
apiHeaders,
|
|
@@ -1479,8 +1333,6 @@ export class Databases {
|
|
|
1479
1333
|
);
|
|
1480
1334
|
}
|
|
1481
1335
|
/**
|
|
1482
|
-
* Update string attribute
|
|
1483
|
-
*
|
|
1484
1336
|
* Update a string attribute. Changing the `default` value will not update already existing documents.
|
|
1485
1337
|
|
|
1486
1338
|
*
|
|
@@ -1494,7 +1346,7 @@ export class Databases {
|
|
|
1494
1346
|
* @throws {AppwriteException}
|
|
1495
1347
|
* @returns {Promise<Models.AttributeString>}
|
|
1496
1348
|
*/
|
|
1497
|
-
|
|
1349
|
+
updateStringAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string): Promise<Models.AttributeString> {
|
|
1498
1350
|
if (typeof databaseId === 'undefined') {
|
|
1499
1351
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1500
1352
|
}
|
|
@@ -1530,10 +1382,7 @@ export class Databases {
|
|
|
1530
1382
|
'content-type': 'application/json',
|
|
1531
1383
|
}
|
|
1532
1384
|
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
return await this.client.call(
|
|
1385
|
+
return this.client.call(
|
|
1537
1386
|
'patch',
|
|
1538
1387
|
uri,
|
|
1539
1388
|
apiHeaders,
|
|
@@ -1541,8 +1390,6 @@ export class Databases {
|
|
|
1541
1390
|
);
|
|
1542
1391
|
}
|
|
1543
1392
|
/**
|
|
1544
|
-
* Create URL attribute
|
|
1545
|
-
*
|
|
1546
1393
|
* Create a URL attribute.
|
|
1547
1394
|
|
|
1548
1395
|
*
|
|
@@ -1555,7 +1402,7 @@ export class Databases {
|
|
|
1555
1402
|
* @throws {AppwriteException}
|
|
1556
1403
|
* @returns {Promise<Models.AttributeUrl>}
|
|
1557
1404
|
*/
|
|
1558
|
-
|
|
1405
|
+
createUrlAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeUrl> {
|
|
1559
1406
|
if (typeof databaseId === 'undefined') {
|
|
1560
1407
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1561
1408
|
}
|
|
@@ -1588,10 +1435,7 @@ export class Databases {
|
|
|
1588
1435
|
'content-type': 'application/json',
|
|
1589
1436
|
}
|
|
1590
1437
|
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
return await this.client.call(
|
|
1438
|
+
return this.client.call(
|
|
1595
1439
|
'post',
|
|
1596
1440
|
uri,
|
|
1597
1441
|
apiHeaders,
|
|
@@ -1599,8 +1443,6 @@ export class Databases {
|
|
|
1599
1443
|
);
|
|
1600
1444
|
}
|
|
1601
1445
|
/**
|
|
1602
|
-
* Update URL attribute
|
|
1603
|
-
*
|
|
1604
1446
|
* Update an url attribute. Changing the `default` value will not update already existing documents.
|
|
1605
1447
|
|
|
1606
1448
|
*
|
|
@@ -1613,7 +1455,7 @@ export class Databases {
|
|
|
1613
1455
|
* @throws {AppwriteException}
|
|
1614
1456
|
* @returns {Promise<Models.AttributeUrl>}
|
|
1615
1457
|
*/
|
|
1616
|
-
|
|
1458
|
+
updateUrlAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeUrl> {
|
|
1617
1459
|
if (typeof databaseId === 'undefined') {
|
|
1618
1460
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1619
1461
|
}
|
|
@@ -1646,10 +1488,7 @@ export class Databases {
|
|
|
1646
1488
|
'content-type': 'application/json',
|
|
1647
1489
|
}
|
|
1648
1490
|
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
return await this.client.call(
|
|
1491
|
+
return this.client.call(
|
|
1653
1492
|
'patch',
|
|
1654
1493
|
uri,
|
|
1655
1494
|
apiHeaders,
|
|
@@ -1657,8 +1496,6 @@ export class Databases {
|
|
|
1657
1496
|
);
|
|
1658
1497
|
}
|
|
1659
1498
|
/**
|
|
1660
|
-
* Get attribute
|
|
1661
|
-
*
|
|
1662
1499
|
* Get attribute by ID.
|
|
1663
1500
|
*
|
|
1664
1501
|
* @param {string} databaseId
|
|
@@ -1667,7 +1504,7 @@ export class Databases {
|
|
|
1667
1504
|
* @throws {AppwriteException}
|
|
1668
1505
|
* @returns {Promise<{}>}
|
|
1669
1506
|
*/
|
|
1670
|
-
|
|
1507
|
+
getAttribute(databaseId: string, collectionId: string, key: string): Promise<{}> {
|
|
1671
1508
|
if (typeof databaseId === 'undefined') {
|
|
1672
1509
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1673
1510
|
}
|
|
@@ -1682,13 +1519,9 @@ export class Databases {
|
|
|
1682
1519
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1683
1520
|
|
|
1684
1521
|
const apiHeaders: { [header: string]: string } = {
|
|
1685
|
-
'content-type': 'application/json',
|
|
1686
1522
|
}
|
|
1687
1523
|
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
return await this.client.call(
|
|
1524
|
+
return this.client.call(
|
|
1692
1525
|
'get',
|
|
1693
1526
|
uri,
|
|
1694
1527
|
apiHeaders,
|
|
@@ -1696,8 +1529,6 @@ export class Databases {
|
|
|
1696
1529
|
);
|
|
1697
1530
|
}
|
|
1698
1531
|
/**
|
|
1699
|
-
* Delete attribute
|
|
1700
|
-
*
|
|
1701
1532
|
* Deletes an attribute.
|
|
1702
1533
|
*
|
|
1703
1534
|
* @param {string} databaseId
|
|
@@ -1706,7 +1537,7 @@ export class Databases {
|
|
|
1706
1537
|
* @throws {AppwriteException}
|
|
1707
1538
|
* @returns {Promise<{}>}
|
|
1708
1539
|
*/
|
|
1709
|
-
|
|
1540
|
+
deleteAttribute(databaseId: string, collectionId: string, key: string): Promise<{}> {
|
|
1710
1541
|
if (typeof databaseId === 'undefined') {
|
|
1711
1542
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1712
1543
|
}
|
|
@@ -1724,10 +1555,7 @@ export class Databases {
|
|
|
1724
1555
|
'content-type': 'application/json',
|
|
1725
1556
|
}
|
|
1726
1557
|
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
return await this.client.call(
|
|
1558
|
+
return this.client.call(
|
|
1731
1559
|
'delete',
|
|
1732
1560
|
uri,
|
|
1733
1561
|
apiHeaders,
|
|
@@ -1735,8 +1563,6 @@ export class Databases {
|
|
|
1735
1563
|
);
|
|
1736
1564
|
}
|
|
1737
1565
|
/**
|
|
1738
|
-
* Update relationship attribute
|
|
1739
|
-
*
|
|
1740
1566
|
* Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
|
|
1741
1567
|
|
|
1742
1568
|
*
|
|
@@ -1748,7 +1574,7 @@ export class Databases {
|
|
|
1748
1574
|
* @throws {AppwriteException}
|
|
1749
1575
|
* @returns {Promise<Models.AttributeRelationship>}
|
|
1750
1576
|
*/
|
|
1751
|
-
|
|
1577
|
+
updateRelationshipAttribute(databaseId: string, collectionId: string, key: string, onDelete?: RelationMutate, newKey?: string): Promise<Models.AttributeRelationship> {
|
|
1752
1578
|
if (typeof databaseId === 'undefined') {
|
|
1753
1579
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1754
1580
|
}
|
|
@@ -1772,10 +1598,7 @@ export class Databases {
|
|
|
1772
1598
|
'content-type': 'application/json',
|
|
1773
1599
|
}
|
|
1774
1600
|
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
return await this.client.call(
|
|
1601
|
+
return this.client.call(
|
|
1779
1602
|
'patch',
|
|
1780
1603
|
uri,
|
|
1781
1604
|
apiHeaders,
|
|
@@ -1783,8 +1606,6 @@ export class Databases {
|
|
|
1783
1606
|
);
|
|
1784
1607
|
}
|
|
1785
1608
|
/**
|
|
1786
|
-
* List documents
|
|
1787
|
-
*
|
|
1788
1609
|
* Get a list of all the user's documents in a given collection. You can use the query params to filter your results.
|
|
1789
1610
|
*
|
|
1790
1611
|
* @param {string} databaseId
|
|
@@ -1793,7 +1614,7 @@ export class Databases {
|
|
|
1793
1614
|
* @throws {AppwriteException}
|
|
1794
1615
|
* @returns {Promise<Models.DocumentList<Document>>}
|
|
1795
1616
|
*/
|
|
1796
|
-
|
|
1617
|
+
listDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>> {
|
|
1797
1618
|
if (typeof databaseId === 'undefined') {
|
|
1798
1619
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1799
1620
|
}
|
|
@@ -1808,13 +1629,9 @@ export class Databases {
|
|
|
1808
1629
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1809
1630
|
|
|
1810
1631
|
const apiHeaders: { [header: string]: string } = {
|
|
1811
|
-
'content-type': 'application/json',
|
|
1812
1632
|
}
|
|
1813
1633
|
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
return await this.client.call(
|
|
1634
|
+
return this.client.call(
|
|
1818
1635
|
'get',
|
|
1819
1636
|
uri,
|
|
1820
1637
|
apiHeaders,
|
|
@@ -1822,10 +1639,7 @@ export class Databases {
|
|
|
1822
1639
|
);
|
|
1823
1640
|
}
|
|
1824
1641
|
/**
|
|
1825
|
-
* Create document
|
|
1826
|
-
*
|
|
1827
1642
|
* Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.
|
|
1828
|
-
|
|
1829
1643
|
*
|
|
1830
1644
|
* @param {string} databaseId
|
|
1831
1645
|
* @param {string} collectionId
|
|
@@ -1835,7 +1649,7 @@ export class Databases {
|
|
|
1835
1649
|
* @throws {AppwriteException}
|
|
1836
1650
|
* @returns {Promise<Document>}
|
|
1837
1651
|
*/
|
|
1838
|
-
|
|
1652
|
+
createDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data: Omit<Document, keyof Models.Document>, permissions?: string[]): Promise<Document> {
|
|
1839
1653
|
if (typeof databaseId === 'undefined') {
|
|
1840
1654
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1841
1655
|
}
|
|
@@ -1865,10 +1679,44 @@ export class Databases {
|
|
|
1865
1679
|
'content-type': 'application/json',
|
|
1866
1680
|
}
|
|
1867
1681
|
|
|
1868
|
-
|
|
1682
|
+
return this.client.call(
|
|
1683
|
+
'post',
|
|
1684
|
+
uri,
|
|
1685
|
+
apiHeaders,
|
|
1686
|
+
payload
|
|
1687
|
+
);
|
|
1688
|
+
}
|
|
1689
|
+
/**
|
|
1690
|
+
* Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.
|
|
1691
|
+
*
|
|
1692
|
+
* @param {string} databaseId
|
|
1693
|
+
* @param {string} collectionId
|
|
1694
|
+
* @param {object[]} documents
|
|
1695
|
+
* @throws {AppwriteException}
|
|
1696
|
+
* @returns {Promise<Models.DocumentList<Document>>}
|
|
1697
|
+
*/
|
|
1698
|
+
createDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, documents: object[]): Promise<Models.DocumentList<Document>> {
|
|
1699
|
+
if (typeof databaseId === 'undefined') {
|
|
1700
|
+
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1701
|
+
}
|
|
1702
|
+
if (typeof collectionId === 'undefined') {
|
|
1703
|
+
throw new AppwriteException('Missing required parameter: "collectionId"');
|
|
1704
|
+
}
|
|
1705
|
+
if (typeof documents === 'undefined') {
|
|
1706
|
+
throw new AppwriteException('Missing required parameter: "documents"');
|
|
1707
|
+
}
|
|
1708
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
1709
|
+
const payload: Payload = {};
|
|
1710
|
+
if (typeof documents !== 'undefined') {
|
|
1711
|
+
payload['documents'] = documents;
|
|
1712
|
+
}
|
|
1713
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1869
1714
|
|
|
1715
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1716
|
+
'content-type': 'application/json',
|
|
1717
|
+
}
|
|
1870
1718
|
|
|
1871
|
-
return
|
|
1719
|
+
return this.client.call(
|
|
1872
1720
|
'post',
|
|
1873
1721
|
uri,
|
|
1874
1722
|
apiHeaders,
|
|
@@ -1876,8 +1724,113 @@ export class Databases {
|
|
|
1876
1724
|
);
|
|
1877
1725
|
}
|
|
1878
1726
|
/**
|
|
1879
|
-
*
|
|
1727
|
+
* Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.
|
|
1728
|
+
|
|
1729
|
+
*
|
|
1730
|
+
* @param {string} databaseId
|
|
1731
|
+
* @param {string} collectionId
|
|
1732
|
+
* @param {object[]} documents
|
|
1733
|
+
* @throws {AppwriteException}
|
|
1734
|
+
* @returns {Promise<Models.DocumentList<Document>>}
|
|
1735
|
+
*/
|
|
1736
|
+
upsertDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, documents?: object[]): Promise<Models.DocumentList<Document>> {
|
|
1737
|
+
if (typeof databaseId === 'undefined') {
|
|
1738
|
+
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1739
|
+
}
|
|
1740
|
+
if (typeof collectionId === 'undefined') {
|
|
1741
|
+
throw new AppwriteException('Missing required parameter: "collectionId"');
|
|
1742
|
+
}
|
|
1743
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
1744
|
+
const payload: Payload = {};
|
|
1745
|
+
if (typeof documents !== 'undefined') {
|
|
1746
|
+
payload['documents'] = documents;
|
|
1747
|
+
}
|
|
1748
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1749
|
+
|
|
1750
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1751
|
+
'content-type': 'application/json',
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
return this.client.call(
|
|
1755
|
+
'put',
|
|
1756
|
+
uri,
|
|
1757
|
+
apiHeaders,
|
|
1758
|
+
payload
|
|
1759
|
+
);
|
|
1760
|
+
}
|
|
1761
|
+
/**
|
|
1762
|
+
* Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.
|
|
1763
|
+
*
|
|
1764
|
+
* @param {string} databaseId
|
|
1765
|
+
* @param {string} collectionId
|
|
1766
|
+
* @param {object} data
|
|
1767
|
+
* @param {string[]} queries
|
|
1768
|
+
* @throws {AppwriteException}
|
|
1769
|
+
* @returns {Promise<Models.DocumentList<Document>>}
|
|
1770
|
+
*/
|
|
1771
|
+
updateDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, data?: object, queries?: string[]): Promise<Models.DocumentList<Document>> {
|
|
1772
|
+
if (typeof databaseId === 'undefined') {
|
|
1773
|
+
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1774
|
+
}
|
|
1775
|
+
if (typeof collectionId === 'undefined') {
|
|
1776
|
+
throw new AppwriteException('Missing required parameter: "collectionId"');
|
|
1777
|
+
}
|
|
1778
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
1779
|
+
const payload: Payload = {};
|
|
1780
|
+
if (typeof data !== 'undefined') {
|
|
1781
|
+
payload['data'] = data;
|
|
1782
|
+
}
|
|
1783
|
+
if (typeof queries !== 'undefined') {
|
|
1784
|
+
payload['queries'] = queries;
|
|
1785
|
+
}
|
|
1786
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1787
|
+
|
|
1788
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1789
|
+
'content-type': 'application/json',
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1792
|
+
return this.client.call(
|
|
1793
|
+
'patch',
|
|
1794
|
+
uri,
|
|
1795
|
+
apiHeaders,
|
|
1796
|
+
payload
|
|
1797
|
+
);
|
|
1798
|
+
}
|
|
1799
|
+
/**
|
|
1800
|
+
* Bulk delete documents using queries, if no queries are passed then all documents are deleted.
|
|
1880
1801
|
*
|
|
1802
|
+
* @param {string} databaseId
|
|
1803
|
+
* @param {string} collectionId
|
|
1804
|
+
* @param {string[]} queries
|
|
1805
|
+
* @throws {AppwriteException}
|
|
1806
|
+
* @returns {Promise<Models.DocumentList<Document>>}
|
|
1807
|
+
*/
|
|
1808
|
+
deleteDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>> {
|
|
1809
|
+
if (typeof databaseId === 'undefined') {
|
|
1810
|
+
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1811
|
+
}
|
|
1812
|
+
if (typeof collectionId === 'undefined') {
|
|
1813
|
+
throw new AppwriteException('Missing required parameter: "collectionId"');
|
|
1814
|
+
}
|
|
1815
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
|
|
1816
|
+
const payload: Payload = {};
|
|
1817
|
+
if (typeof queries !== 'undefined') {
|
|
1818
|
+
payload['queries'] = queries;
|
|
1819
|
+
}
|
|
1820
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1821
|
+
|
|
1822
|
+
const apiHeaders: { [header: string]: string } = {
|
|
1823
|
+
'content-type': 'application/json',
|
|
1824
|
+
}
|
|
1825
|
+
|
|
1826
|
+
return this.client.call(
|
|
1827
|
+
'delete',
|
|
1828
|
+
uri,
|
|
1829
|
+
apiHeaders,
|
|
1830
|
+
payload
|
|
1831
|
+
);
|
|
1832
|
+
}
|
|
1833
|
+
/**
|
|
1881
1834
|
* Get a document by its unique ID. This endpoint response returns a JSON object with the document data.
|
|
1882
1835
|
*
|
|
1883
1836
|
* @param {string} databaseId
|
|
@@ -1887,7 +1840,7 @@ export class Databases {
|
|
|
1887
1840
|
* @throws {AppwriteException}
|
|
1888
1841
|
* @returns {Promise<Document>}
|
|
1889
1842
|
*/
|
|
1890
|
-
|
|
1843
|
+
getDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise<Document> {
|
|
1891
1844
|
if (typeof databaseId === 'undefined') {
|
|
1892
1845
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1893
1846
|
}
|
|
@@ -1905,13 +1858,9 @@ export class Databases {
|
|
|
1905
1858
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1906
1859
|
|
|
1907
1860
|
const apiHeaders: { [header: string]: string } = {
|
|
1908
|
-
'content-type': 'application/json',
|
|
1909
1861
|
}
|
|
1910
1862
|
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
return await this.client.call(
|
|
1863
|
+
return this.client.call(
|
|
1915
1864
|
'get',
|
|
1916
1865
|
uri,
|
|
1917
1866
|
apiHeaders,
|
|
@@ -1919,8 +1868,6 @@ export class Databases {
|
|
|
1919
1868
|
);
|
|
1920
1869
|
}
|
|
1921
1870
|
/**
|
|
1922
|
-
* Update document
|
|
1923
|
-
*
|
|
1924
1871
|
* Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.
|
|
1925
1872
|
*
|
|
1926
1873
|
* @param {string} databaseId
|
|
@@ -1931,7 +1878,7 @@ export class Databases {
|
|
|
1931
1878
|
* @throws {AppwriteException}
|
|
1932
1879
|
* @returns {Promise<Document>}
|
|
1933
1880
|
*/
|
|
1934
|
-
|
|
1881
|
+
updateDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data?: Partial<Omit<Document, keyof Models.Document>>, permissions?: string[]): Promise<Document> {
|
|
1935
1882
|
if (typeof databaseId === 'undefined') {
|
|
1936
1883
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1937
1884
|
}
|
|
@@ -1955,10 +1902,7 @@ export class Databases {
|
|
|
1955
1902
|
'content-type': 'application/json',
|
|
1956
1903
|
}
|
|
1957
1904
|
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
return await this.client.call(
|
|
1905
|
+
return this.client.call(
|
|
1962
1906
|
'patch',
|
|
1963
1907
|
uri,
|
|
1964
1908
|
apiHeaders,
|
|
@@ -1966,8 +1910,6 @@ export class Databases {
|
|
|
1966
1910
|
);
|
|
1967
1911
|
}
|
|
1968
1912
|
/**
|
|
1969
|
-
* Delete document
|
|
1970
|
-
*
|
|
1971
1913
|
* Delete a document by its unique ID.
|
|
1972
1914
|
*
|
|
1973
1915
|
* @param {string} databaseId
|
|
@@ -1976,7 +1918,7 @@ export class Databases {
|
|
|
1976
1918
|
* @throws {AppwriteException}
|
|
1977
1919
|
* @returns {Promise<{}>}
|
|
1978
1920
|
*/
|
|
1979
|
-
|
|
1921
|
+
deleteDocument(databaseId: string, collectionId: string, documentId: string): Promise<{}> {
|
|
1980
1922
|
if (typeof databaseId === 'undefined') {
|
|
1981
1923
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
1982
1924
|
}
|
|
@@ -1994,10 +1936,7 @@ export class Databases {
|
|
|
1994
1936
|
'content-type': 'application/json',
|
|
1995
1937
|
}
|
|
1996
1938
|
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
return await this.client.call(
|
|
1939
|
+
return this.client.call(
|
|
2001
1940
|
'delete',
|
|
2002
1941
|
uri,
|
|
2003
1942
|
apiHeaders,
|
|
@@ -2005,8 +1944,6 @@ export class Databases {
|
|
|
2005
1944
|
);
|
|
2006
1945
|
}
|
|
2007
1946
|
/**
|
|
2008
|
-
* List document logs
|
|
2009
|
-
*
|
|
2010
1947
|
* Get the document activity logs list by its unique ID.
|
|
2011
1948
|
*
|
|
2012
1949
|
* @param {string} databaseId
|
|
@@ -2016,7 +1953,7 @@ export class Databases {
|
|
|
2016
1953
|
* @throws {AppwriteException}
|
|
2017
1954
|
* @returns {Promise<Models.LogList>}
|
|
2018
1955
|
*/
|
|
2019
|
-
|
|
1956
|
+
listDocumentLogs(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise<Models.LogList> {
|
|
2020
1957
|
if (typeof databaseId === 'undefined') {
|
|
2021
1958
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2022
1959
|
}
|
|
@@ -2034,13 +1971,9 @@ export class Databases {
|
|
|
2034
1971
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2035
1972
|
|
|
2036
1973
|
const apiHeaders: { [header: string]: string } = {
|
|
2037
|
-
'content-type': 'application/json',
|
|
2038
1974
|
}
|
|
2039
1975
|
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
return await this.client.call(
|
|
1976
|
+
return this.client.call(
|
|
2044
1977
|
'get',
|
|
2045
1978
|
uri,
|
|
2046
1979
|
apiHeaders,
|
|
@@ -2048,8 +1981,6 @@ export class Databases {
|
|
|
2048
1981
|
);
|
|
2049
1982
|
}
|
|
2050
1983
|
/**
|
|
2051
|
-
* List indexes
|
|
2052
|
-
*
|
|
2053
1984
|
* List indexes in the collection.
|
|
2054
1985
|
*
|
|
2055
1986
|
* @param {string} databaseId
|
|
@@ -2058,7 +1989,7 @@ export class Databases {
|
|
|
2058
1989
|
* @throws {AppwriteException}
|
|
2059
1990
|
* @returns {Promise<Models.IndexList>}
|
|
2060
1991
|
*/
|
|
2061
|
-
|
|
1992
|
+
listIndexes(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.IndexList> {
|
|
2062
1993
|
if (typeof databaseId === 'undefined') {
|
|
2063
1994
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2064
1995
|
}
|
|
@@ -2073,13 +2004,9 @@ export class Databases {
|
|
|
2073
2004
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2074
2005
|
|
|
2075
2006
|
const apiHeaders: { [header: string]: string } = {
|
|
2076
|
-
'content-type': 'application/json',
|
|
2077
2007
|
}
|
|
2078
2008
|
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
return await this.client.call(
|
|
2009
|
+
return this.client.call(
|
|
2083
2010
|
'get',
|
|
2084
2011
|
uri,
|
|
2085
2012
|
apiHeaders,
|
|
@@ -2087,8 +2014,6 @@ export class Databases {
|
|
|
2087
2014
|
);
|
|
2088
2015
|
}
|
|
2089
2016
|
/**
|
|
2090
|
-
* Create index
|
|
2091
|
-
*
|
|
2092
2017
|
* Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.
|
|
2093
2018
|
Attributes can be `key`, `fulltext`, and `unique`.
|
|
2094
2019
|
*
|
|
@@ -2098,10 +2023,11 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2098
2023
|
* @param {IndexType} type
|
|
2099
2024
|
* @param {string[]} attributes
|
|
2100
2025
|
* @param {string[]} orders
|
|
2026
|
+
* @param {number[]} lengths
|
|
2101
2027
|
* @throws {AppwriteException}
|
|
2102
2028
|
* @returns {Promise<Models.Index>}
|
|
2103
2029
|
*/
|
|
2104
|
-
|
|
2030
|
+
createIndex(databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[], lengths?: number[]): Promise<Models.Index> {
|
|
2105
2031
|
if (typeof databaseId === 'undefined') {
|
|
2106
2032
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2107
2033
|
}
|
|
@@ -2131,16 +2057,16 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2131
2057
|
if (typeof orders !== 'undefined') {
|
|
2132
2058
|
payload['orders'] = orders;
|
|
2133
2059
|
}
|
|
2060
|
+
if (typeof lengths !== 'undefined') {
|
|
2061
|
+
payload['lengths'] = lengths;
|
|
2062
|
+
}
|
|
2134
2063
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2135
2064
|
|
|
2136
2065
|
const apiHeaders: { [header: string]: string } = {
|
|
2137
2066
|
'content-type': 'application/json',
|
|
2138
2067
|
}
|
|
2139
2068
|
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
return await this.client.call(
|
|
2069
|
+
return this.client.call(
|
|
2144
2070
|
'post',
|
|
2145
2071
|
uri,
|
|
2146
2072
|
apiHeaders,
|
|
@@ -2148,8 +2074,6 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2148
2074
|
);
|
|
2149
2075
|
}
|
|
2150
2076
|
/**
|
|
2151
|
-
* Get index
|
|
2152
|
-
*
|
|
2153
2077
|
* Get index by ID.
|
|
2154
2078
|
*
|
|
2155
2079
|
* @param {string} databaseId
|
|
@@ -2158,7 +2082,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2158
2082
|
* @throws {AppwriteException}
|
|
2159
2083
|
* @returns {Promise<Models.Index>}
|
|
2160
2084
|
*/
|
|
2161
|
-
|
|
2085
|
+
getIndex(databaseId: string, collectionId: string, key: string): Promise<Models.Index> {
|
|
2162
2086
|
if (typeof databaseId === 'undefined') {
|
|
2163
2087
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2164
2088
|
}
|
|
@@ -2173,13 +2097,9 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2173
2097
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2174
2098
|
|
|
2175
2099
|
const apiHeaders: { [header: string]: string } = {
|
|
2176
|
-
'content-type': 'application/json',
|
|
2177
2100
|
}
|
|
2178
2101
|
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
return await this.client.call(
|
|
2102
|
+
return this.client.call(
|
|
2183
2103
|
'get',
|
|
2184
2104
|
uri,
|
|
2185
2105
|
apiHeaders,
|
|
@@ -2187,8 +2107,6 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2187
2107
|
);
|
|
2188
2108
|
}
|
|
2189
2109
|
/**
|
|
2190
|
-
* Delete index
|
|
2191
|
-
*
|
|
2192
2110
|
* Delete an index.
|
|
2193
2111
|
*
|
|
2194
2112
|
* @param {string} databaseId
|
|
@@ -2197,7 +2115,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2197
2115
|
* @throws {AppwriteException}
|
|
2198
2116
|
* @returns {Promise<{}>}
|
|
2199
2117
|
*/
|
|
2200
|
-
|
|
2118
|
+
deleteIndex(databaseId: string, collectionId: string, key: string): Promise<{}> {
|
|
2201
2119
|
if (typeof databaseId === 'undefined') {
|
|
2202
2120
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2203
2121
|
}
|
|
@@ -2215,10 +2133,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2215
2133
|
'content-type': 'application/json',
|
|
2216
2134
|
}
|
|
2217
2135
|
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
return await this.client.call(
|
|
2136
|
+
return this.client.call(
|
|
2222
2137
|
'delete',
|
|
2223
2138
|
uri,
|
|
2224
2139
|
apiHeaders,
|
|
@@ -2226,8 +2141,6 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2226
2141
|
);
|
|
2227
2142
|
}
|
|
2228
2143
|
/**
|
|
2229
|
-
* List collection logs
|
|
2230
|
-
*
|
|
2231
2144
|
* Get the collection activity logs list by its unique ID.
|
|
2232
2145
|
*
|
|
2233
2146
|
* @param {string} databaseId
|
|
@@ -2236,7 +2149,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2236
2149
|
* @throws {AppwriteException}
|
|
2237
2150
|
* @returns {Promise<Models.LogList>}
|
|
2238
2151
|
*/
|
|
2239
|
-
|
|
2152
|
+
listCollectionLogs(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.LogList> {
|
|
2240
2153
|
if (typeof databaseId === 'undefined') {
|
|
2241
2154
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2242
2155
|
}
|
|
@@ -2251,13 +2164,9 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2251
2164
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2252
2165
|
|
|
2253
2166
|
const apiHeaders: { [header: string]: string } = {
|
|
2254
|
-
'content-type': 'application/json',
|
|
2255
2167
|
}
|
|
2256
2168
|
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
return await this.client.call(
|
|
2169
|
+
return this.client.call(
|
|
2261
2170
|
'get',
|
|
2262
2171
|
uri,
|
|
2263
2172
|
apiHeaders,
|
|
@@ -2265,8 +2174,6 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2265
2174
|
);
|
|
2266
2175
|
}
|
|
2267
2176
|
/**
|
|
2268
|
-
* Get collection usage stats
|
|
2269
|
-
*
|
|
2270
2177
|
* Get usage metrics and statistics for a collection. Returning the total number of documents. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.
|
|
2271
2178
|
*
|
|
2272
2179
|
* @param {string} databaseId
|
|
@@ -2275,7 +2182,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2275
2182
|
* @throws {AppwriteException}
|
|
2276
2183
|
* @returns {Promise<Models.UsageCollection>}
|
|
2277
2184
|
*/
|
|
2278
|
-
|
|
2185
|
+
getCollectionUsage(databaseId: string, collectionId: string, range?: DatabaseUsageRange): Promise<Models.UsageCollection> {
|
|
2279
2186
|
if (typeof databaseId === 'undefined') {
|
|
2280
2187
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2281
2188
|
}
|
|
@@ -2290,13 +2197,9 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2290
2197
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2291
2198
|
|
|
2292
2199
|
const apiHeaders: { [header: string]: string } = {
|
|
2293
|
-
'content-type': 'application/json',
|
|
2294
2200
|
}
|
|
2295
2201
|
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
return await this.client.call(
|
|
2202
|
+
return this.client.call(
|
|
2300
2203
|
'get',
|
|
2301
2204
|
uri,
|
|
2302
2205
|
apiHeaders,
|
|
@@ -2304,8 +2207,6 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2304
2207
|
);
|
|
2305
2208
|
}
|
|
2306
2209
|
/**
|
|
2307
|
-
* List database logs
|
|
2308
|
-
*
|
|
2309
2210
|
* Get the database activity logs list by its unique ID.
|
|
2310
2211
|
*
|
|
2311
2212
|
* @param {string} databaseId
|
|
@@ -2313,7 +2214,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2313
2214
|
* @throws {AppwriteException}
|
|
2314
2215
|
* @returns {Promise<Models.LogList>}
|
|
2315
2216
|
*/
|
|
2316
|
-
|
|
2217
|
+
listLogs(databaseId: string, queries?: string[]): Promise<Models.LogList> {
|
|
2317
2218
|
if (typeof databaseId === 'undefined') {
|
|
2318
2219
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2319
2220
|
}
|
|
@@ -2325,13 +2226,9 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2325
2226
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2326
2227
|
|
|
2327
2228
|
const apiHeaders: { [header: string]: string } = {
|
|
2328
|
-
'content-type': 'application/json',
|
|
2329
2229
|
}
|
|
2330
2230
|
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
return await this.client.call(
|
|
2231
|
+
return this.client.call(
|
|
2335
2232
|
'get',
|
|
2336
2233
|
uri,
|
|
2337
2234
|
apiHeaders,
|
|
@@ -2339,8 +2236,6 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2339
2236
|
);
|
|
2340
2237
|
}
|
|
2341
2238
|
/**
|
|
2342
|
-
* Get database usage stats
|
|
2343
|
-
*
|
|
2344
2239
|
* Get usage metrics and statistics for a database. You can view the total number of collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.
|
|
2345
2240
|
*
|
|
2346
2241
|
* @param {string} databaseId
|
|
@@ -2348,7 +2243,7 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2348
2243
|
* @throws {AppwriteException}
|
|
2349
2244
|
* @returns {Promise<Models.UsageDatabase>}
|
|
2350
2245
|
*/
|
|
2351
|
-
|
|
2246
|
+
getDatabaseUsage(databaseId: string, range?: DatabaseUsageRange): Promise<Models.UsageDatabase> {
|
|
2352
2247
|
if (typeof databaseId === 'undefined') {
|
|
2353
2248
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2354
2249
|
}
|
|
@@ -2360,13 +2255,9 @@ Attributes can be `key`, `fulltext`, and `unique`.
|
|
|
2360
2255
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2361
2256
|
|
|
2362
2257
|
const apiHeaders: { [header: string]: string } = {
|
|
2363
|
-
'content-type': 'application/json',
|
|
2364
2258
|
}
|
|
2365
2259
|
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
return await this.client.call(
|
|
2260
|
+
return this.client.call(
|
|
2370
2261
|
'get',
|
|
2371
2262
|
uri,
|
|
2372
2263
|
apiHeaders,
|