@appwrite.io/console 0.6.4 → 0.7.0-rc.2
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/README.md +3 -3
- package/dist/cjs/sdk.js +2513 -2350
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +2513 -2350
- package/dist/esm/sdk.js.map +1 -1
- package/dist/iife/sdk.js +2513 -2350
- package/docs/examples/account/create-anonymous-session.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-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-identity.md +1 -1
- package/docs/examples/account/delete-mfa-authenticator.md +2 -3
- 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-mfa-recovery-codes.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-identities.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-sessions.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-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/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 +1 -1
- 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 +1 -1
- 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-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-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/functions/create-build.md +2 -2
- package/docs/examples/functions/create-deployment.md +1 -1
- package/docs/examples/functions/create-execution.md +3 -2
- package/docs/examples/functions/create-variable.md +1 -1
- package/docs/examples/functions/create.md +3 -3
- package/docs/examples/functions/delete-deployment.md +1 -1
- package/docs/examples/functions/delete-execution.md +14 -0
- package/docs/examples/functions/delete-variable.md +1 -1
- package/docs/examples/functions/delete.md +1 -1
- package/docs/examples/functions/{download-deployment.md → get-deployment-download.md} +1 -1
- package/docs/examples/functions/get-deployment.md +1 -1
- package/docs/examples/functions/get-execution.md +1 -1
- package/docs/examples/functions/get-function-usage.md +1 -1
- package/docs/examples/functions/{get-specifications.md → get-template.md} +4 -2
- package/docs/examples/functions/get-usage.md +1 -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 +1 -1
- package/docs/examples/functions/list-runtimes.md +1 -1
- package/docs/examples/functions/list-templates.md +16 -0
- package/docs/examples/functions/list-variables.md +1 -1
- package/docs/examples/functions/list.md +1 -1
- package/docs/examples/functions/update-deployment-build.md +14 -0
- package/docs/examples/functions/update-deployment.md +1 -1
- package/docs/examples/functions/update-variable.md +1 -1
- package/docs/examples/functions/update.md +3 -3
- 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-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-usage-dump.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-queue.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-firebase-migration.md +1 -1
- package/docs/examples/migrations/create-firebase-o-auth-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-firebase-auth.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-o-auth.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-firebase-projects.md +1 -1
- package/docs/examples/migrations/list.md +1 -1
- package/docs/examples/migrations/retry.md +1 -1
- package/docs/examples/project/create-variable.md +1 -1
- 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 +1 -1
- package/docs/examples/projects/create-j-w-t.md +15 -0
- 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 +1 -1
- 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-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-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-email-template.md +1 -1
- package/docs/examples/projects/update-key.md +1 -1
- package/docs/examples/projects/update-mock-numbers.md +14 -0
- 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 +14 -0
- 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-rule.md +1 -1
- 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/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.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/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 +15 -0
- 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 +1 -1
- 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 +1 -1
- 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 +15 -0
- 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 +1 -1
- 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 +124 -66
- package/src/enums/email-template-type.ts +2 -0
- package/src/enums/platform-type.ts +2 -0
- package/src/enums/runtime.ts +1 -0
- package/src/index.ts +1 -1
- package/src/models.ts +230 -28
- package/src/services/account.ts +651 -644
- package/src/services/assistant.ts +19 -16
- package/src/services/avatars.ts +111 -152
- package/src/services/console.ts +19 -14
- package/src/services/databases.ts +628 -638
- package/src/services/functions.ts +435 -339
- package/src/services/graphql.ts +31 -24
- package/src/services/health.ts +299 -199
- package/src/services/locale.ts +113 -77
- package/src/services/messaging.ts +568 -583
- package/src/services/migrations.ts +199 -197
- package/src/services/project.ts +82 -65
- package/src/services/projects.ts +615 -459
- package/src/services/proxy.ts +68 -50
- package/src/services/storage.ts +198 -253
- package/src/services/teams.ts +198 -188
- package/src/services/users.ts +568 -478
- package/src/services/vcs.ts +149 -83
- package/types/client.d.ts +13 -17
- package/types/enums/email-template-type.d.ts +3 -1
- package/types/enums/platform-type.d.ts +3 -1
- package/types/enums/runtime.d.ts +2 -1
- package/types/index.d.ts +1 -1
- package/types/models.d.ts +230 -28
- package/types/services/account.d.ts +162 -317
- package/types/services/assistant.d.ts +4 -4
- package/types/services/avatars.d.ts +50 -84
- package/types/services/console.d.ts +4 -4
- package/types/services/databases.d.ts +143 -173
- package/types/services/functions.d.ts +112 -97
- package/types/services/graphql.d.ts +6 -6
- package/types/services/health.d.ts +64 -85
- package/types/services/locale.d.ts +28 -39
- package/types/services/messaging.d.ts +103 -104
- package/types/services/migrations.d.ts +34 -34
- package/types/services/project.d.ts +17 -20
- package/types/services/projects.d.ts +118 -87
- package/types/services/proxy.d.ts +13 -14
- package/types/services/storage.d.ts +53 -78
- package/types/services/teams.d.ts +53 -83
- package/types/services/users.d.ts +120 -157
- package/types/services/vcs.d.ts +31 -20
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AppwriteException, Client } from '../client';
|
|
1
|
+
import { AppwriteException, Client, type Payload, UploadProgress } from '../client';
|
|
3
2
|
import type { Models } from '../models';
|
|
4
|
-
import type { UploadProgress, Payload } from '../client';
|
|
5
3
|
|
|
6
|
-
export class Migrations
|
|
4
|
+
export class Migrations {
|
|
5
|
+
client: Client;
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
7
|
+
constructor(client: Client) {
|
|
8
|
+
this.client = client;
|
|
9
|
+
}
|
|
12
10
|
|
|
13
11
|
/**
|
|
14
12
|
* List Migrations
|
|
@@ -17,26 +15,30 @@ export class Migrations extends Service {
|
|
|
17
15
|
* @param {string[]} queries
|
|
18
16
|
* @param {string} search
|
|
19
17
|
* @throws {AppwriteException}
|
|
20
|
-
* @returns {Promise}
|
|
21
|
-
|
|
18
|
+
* @returns {Promise<Models.MigrationList>}
|
|
19
|
+
*/
|
|
22
20
|
async list(queries?: string[], search?: string): Promise<Models.MigrationList> {
|
|
23
21
|
const apiPath = '/migrations';
|
|
24
22
|
const payload: Payload = {};
|
|
25
|
-
|
|
26
23
|
if (typeof queries !== 'undefined') {
|
|
27
24
|
payload['queries'] = queries;
|
|
28
25
|
}
|
|
29
|
-
|
|
30
26
|
if (typeof search !== 'undefined') {
|
|
31
27
|
payload['search'] = search;
|
|
32
28
|
}
|
|
33
|
-
|
|
34
29
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
35
|
-
|
|
30
|
+
|
|
31
|
+
const apiHeaders: { [header: string]: string } = {
|
|
36
32
|
'content-type': 'application/json',
|
|
37
|
-
}
|
|
38
|
-
}
|
|
33
|
+
}
|
|
39
34
|
|
|
35
|
+
return await this.client.call(
|
|
36
|
+
'get',
|
|
37
|
+
uri,
|
|
38
|
+
apiHeaders,
|
|
39
|
+
payload
|
|
40
|
+
);
|
|
41
|
+
}
|
|
40
42
|
/**
|
|
41
43
|
* Migrate Appwrite Data
|
|
42
44
|
*
|
|
@@ -46,50 +48,48 @@ export class Migrations extends Service {
|
|
|
46
48
|
* @param {string} projectId
|
|
47
49
|
* @param {string} apiKey
|
|
48
50
|
* @throws {AppwriteException}
|
|
49
|
-
* @returns {Promise}
|
|
50
|
-
|
|
51
|
+
* @returns {Promise<Models.Migration>}
|
|
52
|
+
*/
|
|
51
53
|
async createAppwriteMigration(resources: string[], endpoint: string, projectId: string, apiKey: string): Promise<Models.Migration> {
|
|
52
54
|
if (typeof resources === 'undefined') {
|
|
53
55
|
throw new AppwriteException('Missing required parameter: "resources"');
|
|
54
56
|
}
|
|
55
|
-
|
|
56
57
|
if (typeof endpoint === 'undefined') {
|
|
57
58
|
throw new AppwriteException('Missing required parameter: "endpoint"');
|
|
58
59
|
}
|
|
59
|
-
|
|
60
60
|
if (typeof projectId === 'undefined') {
|
|
61
61
|
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
62
62
|
}
|
|
63
|
-
|
|
64
63
|
if (typeof apiKey === 'undefined') {
|
|
65
64
|
throw new AppwriteException('Missing required parameter: "apiKey"');
|
|
66
65
|
}
|
|
67
|
-
|
|
68
66
|
const apiPath = '/migrations/appwrite';
|
|
69
67
|
const payload: Payload = {};
|
|
70
|
-
|
|
71
68
|
if (typeof resources !== 'undefined') {
|
|
72
69
|
payload['resources'] = resources;
|
|
73
70
|
}
|
|
74
|
-
|
|
75
71
|
if (typeof endpoint !== 'undefined') {
|
|
76
72
|
payload['endpoint'] = endpoint;
|
|
77
73
|
}
|
|
78
|
-
|
|
79
74
|
if (typeof projectId !== 'undefined') {
|
|
80
75
|
payload['projectId'] = projectId;
|
|
81
76
|
}
|
|
82
|
-
|
|
83
77
|
if (typeof apiKey !== 'undefined') {
|
|
84
78
|
payload['apiKey'] = apiKey;
|
|
85
79
|
}
|
|
86
|
-
|
|
87
80
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
88
|
-
|
|
81
|
+
|
|
82
|
+
const apiHeaders: { [header: string]: string } = {
|
|
89
83
|
'content-type': 'application/json',
|
|
90
|
-
}
|
|
91
|
-
}
|
|
84
|
+
}
|
|
92
85
|
|
|
86
|
+
return await this.client.call(
|
|
87
|
+
'post',
|
|
88
|
+
uri,
|
|
89
|
+
apiHeaders,
|
|
90
|
+
payload
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
93
|
/**
|
|
94
94
|
* Generate a report on Appwrite Data
|
|
95
95
|
*
|
|
@@ -99,50 +99,48 @@ export class Migrations extends Service {
|
|
|
99
99
|
* @param {string} projectID
|
|
100
100
|
* @param {string} key
|
|
101
101
|
* @throws {AppwriteException}
|
|
102
|
-
* @returns {Promise}
|
|
103
|
-
|
|
102
|
+
* @returns {Promise<Models.MigrationReport>}
|
|
103
|
+
*/
|
|
104
104
|
async getAppwriteReport(resources: string[], endpoint: string, projectID: string, key: string): Promise<Models.MigrationReport> {
|
|
105
105
|
if (typeof resources === 'undefined') {
|
|
106
106
|
throw new AppwriteException('Missing required parameter: "resources"');
|
|
107
107
|
}
|
|
108
|
-
|
|
109
108
|
if (typeof endpoint === 'undefined') {
|
|
110
109
|
throw new AppwriteException('Missing required parameter: "endpoint"');
|
|
111
110
|
}
|
|
112
|
-
|
|
113
111
|
if (typeof projectID === 'undefined') {
|
|
114
112
|
throw new AppwriteException('Missing required parameter: "projectID"');
|
|
115
113
|
}
|
|
116
|
-
|
|
117
114
|
if (typeof key === 'undefined') {
|
|
118
115
|
throw new AppwriteException('Missing required parameter: "key"');
|
|
119
116
|
}
|
|
120
|
-
|
|
121
117
|
const apiPath = '/migrations/appwrite/report';
|
|
122
118
|
const payload: Payload = {};
|
|
123
|
-
|
|
124
119
|
if (typeof resources !== 'undefined') {
|
|
125
120
|
payload['resources'] = resources;
|
|
126
121
|
}
|
|
127
|
-
|
|
128
122
|
if (typeof endpoint !== 'undefined') {
|
|
129
123
|
payload['endpoint'] = endpoint;
|
|
130
124
|
}
|
|
131
|
-
|
|
132
125
|
if (typeof projectID !== 'undefined') {
|
|
133
126
|
payload['projectID'] = projectID;
|
|
134
127
|
}
|
|
135
|
-
|
|
136
128
|
if (typeof key !== 'undefined') {
|
|
137
129
|
payload['key'] = key;
|
|
138
130
|
}
|
|
139
|
-
|
|
140
131
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
141
|
-
|
|
132
|
+
|
|
133
|
+
const apiHeaders: { [header: string]: string } = {
|
|
142
134
|
'content-type': 'application/json',
|
|
143
|
-
}
|
|
144
|
-
}
|
|
135
|
+
}
|
|
145
136
|
|
|
137
|
+
return await this.client.call(
|
|
138
|
+
'get',
|
|
139
|
+
uri,
|
|
140
|
+
apiHeaders,
|
|
141
|
+
payload
|
|
142
|
+
);
|
|
143
|
+
}
|
|
146
144
|
/**
|
|
147
145
|
* Migrate Firebase Data (Service Account)
|
|
148
146
|
*
|
|
@@ -150,51 +148,59 @@ export class Migrations extends Service {
|
|
|
150
148
|
* @param {string[]} resources
|
|
151
149
|
* @param {string} serviceAccount
|
|
152
150
|
* @throws {AppwriteException}
|
|
153
|
-
* @returns {Promise}
|
|
154
|
-
|
|
151
|
+
* @returns {Promise<Models.Migration>}
|
|
152
|
+
*/
|
|
155
153
|
async createFirebaseMigration(resources: string[], serviceAccount: string): Promise<Models.Migration> {
|
|
156
154
|
if (typeof resources === 'undefined') {
|
|
157
155
|
throw new AppwriteException('Missing required parameter: "resources"');
|
|
158
156
|
}
|
|
159
|
-
|
|
160
157
|
if (typeof serviceAccount === 'undefined') {
|
|
161
158
|
throw new AppwriteException('Missing required parameter: "serviceAccount"');
|
|
162
159
|
}
|
|
163
|
-
|
|
164
160
|
const apiPath = '/migrations/firebase';
|
|
165
161
|
const payload: Payload = {};
|
|
166
|
-
|
|
167
162
|
if (typeof resources !== 'undefined') {
|
|
168
163
|
payload['resources'] = resources;
|
|
169
164
|
}
|
|
170
|
-
|
|
171
165
|
if (typeof serviceAccount !== 'undefined') {
|
|
172
166
|
payload['serviceAccount'] = serviceAccount;
|
|
173
167
|
}
|
|
174
|
-
|
|
175
168
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
176
|
-
|
|
169
|
+
|
|
170
|
+
const apiHeaders: { [header: string]: string } = {
|
|
177
171
|
'content-type': 'application/json',
|
|
178
|
-
}
|
|
179
|
-
}
|
|
172
|
+
}
|
|
180
173
|
|
|
174
|
+
return await this.client.call(
|
|
175
|
+
'post',
|
|
176
|
+
uri,
|
|
177
|
+
apiHeaders,
|
|
178
|
+
payload
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
181
|
/**
|
|
182
182
|
* Revoke Appwrite's authorization to access Firebase Projects
|
|
183
183
|
*
|
|
184
184
|
*
|
|
185
185
|
* @throws {AppwriteException}
|
|
186
|
-
* @returns {Promise}
|
|
187
|
-
|
|
186
|
+
* @returns {Promise<{}>}
|
|
187
|
+
*/
|
|
188
188
|
async deleteFirebaseAuth(): Promise<{}> {
|
|
189
189
|
const apiPath = '/migrations/firebase/deauthorize';
|
|
190
190
|
const payload: Payload = {};
|
|
191
|
-
|
|
192
191
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
193
|
-
|
|
192
|
+
|
|
193
|
+
const apiHeaders: { [header: string]: string } = {
|
|
194
194
|
'content-type': 'application/json',
|
|
195
|
-
}
|
|
196
|
-
}
|
|
195
|
+
}
|
|
197
196
|
|
|
197
|
+
return await this.client.call(
|
|
198
|
+
'get',
|
|
199
|
+
uri,
|
|
200
|
+
apiHeaders,
|
|
201
|
+
payload
|
|
202
|
+
);
|
|
203
|
+
}
|
|
198
204
|
/**
|
|
199
205
|
* Migrate Firebase Data (OAuth)
|
|
200
206
|
*
|
|
@@ -202,51 +208,59 @@ export class Migrations extends Service {
|
|
|
202
208
|
* @param {string[]} resources
|
|
203
209
|
* @param {string} projectId
|
|
204
210
|
* @throws {AppwriteException}
|
|
205
|
-
* @returns {Promise}
|
|
206
|
-
|
|
211
|
+
* @returns {Promise<Models.Migration>}
|
|
212
|
+
*/
|
|
207
213
|
async createFirebaseOAuthMigration(resources: string[], projectId: string): Promise<Models.Migration> {
|
|
208
214
|
if (typeof resources === 'undefined') {
|
|
209
215
|
throw new AppwriteException('Missing required parameter: "resources"');
|
|
210
216
|
}
|
|
211
|
-
|
|
212
217
|
if (typeof projectId === 'undefined') {
|
|
213
218
|
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
214
219
|
}
|
|
215
|
-
|
|
216
220
|
const apiPath = '/migrations/firebase/oauth';
|
|
217
221
|
const payload: Payload = {};
|
|
218
|
-
|
|
219
222
|
if (typeof resources !== 'undefined') {
|
|
220
223
|
payload['resources'] = resources;
|
|
221
224
|
}
|
|
222
|
-
|
|
223
225
|
if (typeof projectId !== 'undefined') {
|
|
224
226
|
payload['projectId'] = projectId;
|
|
225
227
|
}
|
|
226
|
-
|
|
227
228
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
228
|
-
|
|
229
|
+
|
|
230
|
+
const apiHeaders: { [header: string]: string } = {
|
|
229
231
|
'content-type': 'application/json',
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
+
}
|
|
232
233
|
|
|
234
|
+
return await this.client.call(
|
|
235
|
+
'post',
|
|
236
|
+
uri,
|
|
237
|
+
apiHeaders,
|
|
238
|
+
payload
|
|
239
|
+
);
|
|
240
|
+
}
|
|
233
241
|
/**
|
|
234
242
|
* List Firebase Projects
|
|
235
243
|
*
|
|
236
244
|
*
|
|
237
245
|
* @throws {AppwriteException}
|
|
238
|
-
* @returns {Promise}
|
|
239
|
-
|
|
246
|
+
* @returns {Promise<Models.FirebaseProjectList>}
|
|
247
|
+
*/
|
|
240
248
|
async listFirebaseProjects(): Promise<Models.FirebaseProjectList> {
|
|
241
249
|
const apiPath = '/migrations/firebase/projects';
|
|
242
250
|
const payload: Payload = {};
|
|
243
|
-
|
|
244
251
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
245
|
-
|
|
252
|
+
|
|
253
|
+
const apiHeaders: { [header: string]: string } = {
|
|
246
254
|
'content-type': 'application/json',
|
|
247
|
-
}
|
|
248
|
-
}
|
|
255
|
+
}
|
|
249
256
|
|
|
257
|
+
return await this.client.call(
|
|
258
|
+
'get',
|
|
259
|
+
uri,
|
|
260
|
+
apiHeaders,
|
|
261
|
+
payload
|
|
262
|
+
);
|
|
263
|
+
}
|
|
250
264
|
/**
|
|
251
265
|
* Generate a report on Firebase Data
|
|
252
266
|
*
|
|
@@ -254,34 +268,36 @@ export class Migrations extends Service {
|
|
|
254
268
|
* @param {string[]} resources
|
|
255
269
|
* @param {string} serviceAccount
|
|
256
270
|
* @throws {AppwriteException}
|
|
257
|
-
* @returns {Promise}
|
|
258
|
-
|
|
271
|
+
* @returns {Promise<Models.MigrationReport>}
|
|
272
|
+
*/
|
|
259
273
|
async getFirebaseReport(resources: string[], serviceAccount: string): Promise<Models.MigrationReport> {
|
|
260
274
|
if (typeof resources === 'undefined') {
|
|
261
275
|
throw new AppwriteException('Missing required parameter: "resources"');
|
|
262
276
|
}
|
|
263
|
-
|
|
264
277
|
if (typeof serviceAccount === 'undefined') {
|
|
265
278
|
throw new AppwriteException('Missing required parameter: "serviceAccount"');
|
|
266
279
|
}
|
|
267
|
-
|
|
268
280
|
const apiPath = '/migrations/firebase/report';
|
|
269
281
|
const payload: Payload = {};
|
|
270
|
-
|
|
271
282
|
if (typeof resources !== 'undefined') {
|
|
272
283
|
payload['resources'] = resources;
|
|
273
284
|
}
|
|
274
|
-
|
|
275
285
|
if (typeof serviceAccount !== 'undefined') {
|
|
276
286
|
payload['serviceAccount'] = serviceAccount;
|
|
277
287
|
}
|
|
278
|
-
|
|
279
288
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
280
|
-
|
|
289
|
+
|
|
290
|
+
const apiHeaders: { [header: string]: string } = {
|
|
281
291
|
'content-type': 'application/json',
|
|
282
|
-
}
|
|
283
|
-
}
|
|
292
|
+
}
|
|
284
293
|
|
|
294
|
+
return await this.client.call(
|
|
295
|
+
'get',
|
|
296
|
+
uri,
|
|
297
|
+
apiHeaders,
|
|
298
|
+
payload
|
|
299
|
+
);
|
|
300
|
+
}
|
|
285
301
|
/**
|
|
286
302
|
* Generate a report on Firebase Data using OAuth
|
|
287
303
|
*
|
|
@@ -289,34 +305,36 @@ export class Migrations extends Service {
|
|
|
289
305
|
* @param {string[]} resources
|
|
290
306
|
* @param {string} projectId
|
|
291
307
|
* @throws {AppwriteException}
|
|
292
|
-
* @returns {Promise}
|
|
293
|
-
|
|
308
|
+
* @returns {Promise<Models.MigrationReport>}
|
|
309
|
+
*/
|
|
294
310
|
async getFirebaseReportOAuth(resources: string[], projectId: string): Promise<Models.MigrationReport> {
|
|
295
311
|
if (typeof resources === 'undefined') {
|
|
296
312
|
throw new AppwriteException('Missing required parameter: "resources"');
|
|
297
313
|
}
|
|
298
|
-
|
|
299
314
|
if (typeof projectId === 'undefined') {
|
|
300
315
|
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
301
316
|
}
|
|
302
|
-
|
|
303
317
|
const apiPath = '/migrations/firebase/report/oauth';
|
|
304
318
|
const payload: Payload = {};
|
|
305
|
-
|
|
306
319
|
if (typeof resources !== 'undefined') {
|
|
307
320
|
payload['resources'] = resources;
|
|
308
321
|
}
|
|
309
|
-
|
|
310
322
|
if (typeof projectId !== 'undefined') {
|
|
311
323
|
payload['projectId'] = projectId;
|
|
312
324
|
}
|
|
313
|
-
|
|
314
325
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
315
|
-
|
|
326
|
+
|
|
327
|
+
const apiHeaders: { [header: string]: string } = {
|
|
316
328
|
'content-type': 'application/json',
|
|
317
|
-
}
|
|
318
|
-
}
|
|
329
|
+
}
|
|
319
330
|
|
|
331
|
+
return await this.client.call(
|
|
332
|
+
'get',
|
|
333
|
+
uri,
|
|
334
|
+
apiHeaders,
|
|
335
|
+
payload
|
|
336
|
+
);
|
|
337
|
+
}
|
|
320
338
|
/**
|
|
321
339
|
* Migrate NHost Data
|
|
322
340
|
*
|
|
@@ -330,78 +348,69 @@ export class Migrations extends Service {
|
|
|
330
348
|
* @param {string} password
|
|
331
349
|
* @param {number} port
|
|
332
350
|
* @throws {AppwriteException}
|
|
333
|
-
* @returns {Promise}
|
|
334
|
-
|
|
351
|
+
* @returns {Promise<Models.Migration>}
|
|
352
|
+
*/
|
|
335
353
|
async createNHostMigration(resources: string[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number): Promise<Models.Migration> {
|
|
336
354
|
if (typeof resources === 'undefined') {
|
|
337
355
|
throw new AppwriteException('Missing required parameter: "resources"');
|
|
338
356
|
}
|
|
339
|
-
|
|
340
357
|
if (typeof subdomain === 'undefined') {
|
|
341
358
|
throw new AppwriteException('Missing required parameter: "subdomain"');
|
|
342
359
|
}
|
|
343
|
-
|
|
344
360
|
if (typeof region === 'undefined') {
|
|
345
361
|
throw new AppwriteException('Missing required parameter: "region"');
|
|
346
362
|
}
|
|
347
|
-
|
|
348
363
|
if (typeof adminSecret === 'undefined') {
|
|
349
364
|
throw new AppwriteException('Missing required parameter: "adminSecret"');
|
|
350
365
|
}
|
|
351
|
-
|
|
352
366
|
if (typeof database === 'undefined') {
|
|
353
367
|
throw new AppwriteException('Missing required parameter: "database"');
|
|
354
368
|
}
|
|
355
|
-
|
|
356
369
|
if (typeof username === 'undefined') {
|
|
357
370
|
throw new AppwriteException('Missing required parameter: "username"');
|
|
358
371
|
}
|
|
359
|
-
|
|
360
372
|
if (typeof password === 'undefined') {
|
|
361
373
|
throw new AppwriteException('Missing required parameter: "password"');
|
|
362
374
|
}
|
|
363
|
-
|
|
364
375
|
const apiPath = '/migrations/nhost';
|
|
365
376
|
const payload: Payload = {};
|
|
366
|
-
|
|
367
377
|
if (typeof resources !== 'undefined') {
|
|
368
378
|
payload['resources'] = resources;
|
|
369
379
|
}
|
|
370
|
-
|
|
371
380
|
if (typeof subdomain !== 'undefined') {
|
|
372
381
|
payload['subdomain'] = subdomain;
|
|
373
382
|
}
|
|
374
|
-
|
|
375
383
|
if (typeof region !== 'undefined') {
|
|
376
384
|
payload['region'] = region;
|
|
377
385
|
}
|
|
378
|
-
|
|
379
386
|
if (typeof adminSecret !== 'undefined') {
|
|
380
387
|
payload['adminSecret'] = adminSecret;
|
|
381
388
|
}
|
|
382
|
-
|
|
383
389
|
if (typeof database !== 'undefined') {
|
|
384
390
|
payload['database'] = database;
|
|
385
391
|
}
|
|
386
|
-
|
|
387
392
|
if (typeof username !== 'undefined') {
|
|
388
393
|
payload['username'] = username;
|
|
389
394
|
}
|
|
390
|
-
|
|
391
395
|
if (typeof password !== 'undefined') {
|
|
392
396
|
payload['password'] = password;
|
|
393
397
|
}
|
|
394
|
-
|
|
395
398
|
if (typeof port !== 'undefined') {
|
|
396
399
|
payload['port'] = port;
|
|
397
400
|
}
|
|
398
|
-
|
|
399
401
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
400
|
-
|
|
402
|
+
|
|
403
|
+
const apiHeaders: { [header: string]: string } = {
|
|
401
404
|
'content-type': 'application/json',
|
|
402
|
-
}
|
|
403
|
-
}
|
|
405
|
+
}
|
|
404
406
|
|
|
407
|
+
return await this.client.call(
|
|
408
|
+
'post',
|
|
409
|
+
uri,
|
|
410
|
+
apiHeaders,
|
|
411
|
+
payload
|
|
412
|
+
);
|
|
413
|
+
}
|
|
405
414
|
/**
|
|
406
415
|
* Generate a report on NHost Data
|
|
407
416
|
*
|
|
@@ -415,78 +424,69 @@ export class Migrations extends Service {
|
|
|
415
424
|
* @param {string} password
|
|
416
425
|
* @param {number} port
|
|
417
426
|
* @throws {AppwriteException}
|
|
418
|
-
* @returns {Promise}
|
|
419
|
-
|
|
427
|
+
* @returns {Promise<Models.MigrationReport>}
|
|
428
|
+
*/
|
|
420
429
|
async getNHostReport(resources: string[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number): Promise<Models.MigrationReport> {
|
|
421
430
|
if (typeof resources === 'undefined') {
|
|
422
431
|
throw new AppwriteException('Missing required parameter: "resources"');
|
|
423
432
|
}
|
|
424
|
-
|
|
425
433
|
if (typeof subdomain === 'undefined') {
|
|
426
434
|
throw new AppwriteException('Missing required parameter: "subdomain"');
|
|
427
435
|
}
|
|
428
|
-
|
|
429
436
|
if (typeof region === 'undefined') {
|
|
430
437
|
throw new AppwriteException('Missing required parameter: "region"');
|
|
431
438
|
}
|
|
432
|
-
|
|
433
439
|
if (typeof adminSecret === 'undefined') {
|
|
434
440
|
throw new AppwriteException('Missing required parameter: "adminSecret"');
|
|
435
441
|
}
|
|
436
|
-
|
|
437
442
|
if (typeof database === 'undefined') {
|
|
438
443
|
throw new AppwriteException('Missing required parameter: "database"');
|
|
439
444
|
}
|
|
440
|
-
|
|
441
445
|
if (typeof username === 'undefined') {
|
|
442
446
|
throw new AppwriteException('Missing required parameter: "username"');
|
|
443
447
|
}
|
|
444
|
-
|
|
445
448
|
if (typeof password === 'undefined') {
|
|
446
449
|
throw new AppwriteException('Missing required parameter: "password"');
|
|
447
450
|
}
|
|
448
|
-
|
|
449
451
|
const apiPath = '/migrations/nhost/report';
|
|
450
452
|
const payload: Payload = {};
|
|
451
|
-
|
|
452
453
|
if (typeof resources !== 'undefined') {
|
|
453
454
|
payload['resources'] = resources;
|
|
454
455
|
}
|
|
455
|
-
|
|
456
456
|
if (typeof subdomain !== 'undefined') {
|
|
457
457
|
payload['subdomain'] = subdomain;
|
|
458
458
|
}
|
|
459
|
-
|
|
460
459
|
if (typeof region !== 'undefined') {
|
|
461
460
|
payload['region'] = region;
|
|
462
461
|
}
|
|
463
|
-
|
|
464
462
|
if (typeof adminSecret !== 'undefined') {
|
|
465
463
|
payload['adminSecret'] = adminSecret;
|
|
466
464
|
}
|
|
467
|
-
|
|
468
465
|
if (typeof database !== 'undefined') {
|
|
469
466
|
payload['database'] = database;
|
|
470
467
|
}
|
|
471
|
-
|
|
472
468
|
if (typeof username !== 'undefined') {
|
|
473
469
|
payload['username'] = username;
|
|
474
470
|
}
|
|
475
|
-
|
|
476
471
|
if (typeof password !== 'undefined') {
|
|
477
472
|
payload['password'] = password;
|
|
478
473
|
}
|
|
479
|
-
|
|
480
474
|
if (typeof port !== 'undefined') {
|
|
481
475
|
payload['port'] = port;
|
|
482
476
|
}
|
|
483
|
-
|
|
484
477
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
485
|
-
|
|
478
|
+
|
|
479
|
+
const apiHeaders: { [header: string]: string } = {
|
|
486
480
|
'content-type': 'application/json',
|
|
487
|
-
}
|
|
488
|
-
}
|
|
481
|
+
}
|
|
489
482
|
|
|
483
|
+
return await this.client.call(
|
|
484
|
+
'get',
|
|
485
|
+
uri,
|
|
486
|
+
apiHeaders,
|
|
487
|
+
payload
|
|
488
|
+
);
|
|
489
|
+
}
|
|
490
490
|
/**
|
|
491
491
|
* Migrate Supabase Data
|
|
492
492
|
*
|
|
@@ -499,70 +499,63 @@ export class Migrations extends Service {
|
|
|
499
499
|
* @param {string} password
|
|
500
500
|
* @param {number} port
|
|
501
501
|
* @throws {AppwriteException}
|
|
502
|
-
* @returns {Promise}
|
|
503
|
-
|
|
502
|
+
* @returns {Promise<Models.Migration>}
|
|
503
|
+
*/
|
|
504
504
|
async createSupabaseMigration(resources: string[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number): Promise<Models.Migration> {
|
|
505
505
|
if (typeof resources === 'undefined') {
|
|
506
506
|
throw new AppwriteException('Missing required parameter: "resources"');
|
|
507
507
|
}
|
|
508
|
-
|
|
509
508
|
if (typeof endpoint === 'undefined') {
|
|
510
509
|
throw new AppwriteException('Missing required parameter: "endpoint"');
|
|
511
510
|
}
|
|
512
|
-
|
|
513
511
|
if (typeof apiKey === 'undefined') {
|
|
514
512
|
throw new AppwriteException('Missing required parameter: "apiKey"');
|
|
515
513
|
}
|
|
516
|
-
|
|
517
514
|
if (typeof databaseHost === 'undefined') {
|
|
518
515
|
throw new AppwriteException('Missing required parameter: "databaseHost"');
|
|
519
516
|
}
|
|
520
|
-
|
|
521
517
|
if (typeof username === 'undefined') {
|
|
522
518
|
throw new AppwriteException('Missing required parameter: "username"');
|
|
523
519
|
}
|
|
524
|
-
|
|
525
520
|
if (typeof password === 'undefined') {
|
|
526
521
|
throw new AppwriteException('Missing required parameter: "password"');
|
|
527
522
|
}
|
|
528
|
-
|
|
529
523
|
const apiPath = '/migrations/supabase';
|
|
530
524
|
const payload: Payload = {};
|
|
531
|
-
|
|
532
525
|
if (typeof resources !== 'undefined') {
|
|
533
526
|
payload['resources'] = resources;
|
|
534
527
|
}
|
|
535
|
-
|
|
536
528
|
if (typeof endpoint !== 'undefined') {
|
|
537
529
|
payload['endpoint'] = endpoint;
|
|
538
530
|
}
|
|
539
|
-
|
|
540
531
|
if (typeof apiKey !== 'undefined') {
|
|
541
532
|
payload['apiKey'] = apiKey;
|
|
542
533
|
}
|
|
543
|
-
|
|
544
534
|
if (typeof databaseHost !== 'undefined') {
|
|
545
535
|
payload['databaseHost'] = databaseHost;
|
|
546
536
|
}
|
|
547
|
-
|
|
548
537
|
if (typeof username !== 'undefined') {
|
|
549
538
|
payload['username'] = username;
|
|
550
539
|
}
|
|
551
|
-
|
|
552
540
|
if (typeof password !== 'undefined') {
|
|
553
541
|
payload['password'] = password;
|
|
554
542
|
}
|
|
555
|
-
|
|
556
543
|
if (typeof port !== 'undefined') {
|
|
557
544
|
payload['port'] = port;
|
|
558
545
|
}
|
|
559
|
-
|
|
560
546
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
561
|
-
|
|
547
|
+
|
|
548
|
+
const apiHeaders: { [header: string]: string } = {
|
|
562
549
|
'content-type': 'application/json',
|
|
563
|
-
}
|
|
564
|
-
}
|
|
550
|
+
}
|
|
565
551
|
|
|
552
|
+
return await this.client.call(
|
|
553
|
+
'post',
|
|
554
|
+
uri,
|
|
555
|
+
apiHeaders,
|
|
556
|
+
payload
|
|
557
|
+
);
|
|
558
|
+
}
|
|
566
559
|
/**
|
|
567
560
|
* Generate a report on Supabase Data
|
|
568
561
|
*
|
|
@@ -575,133 +568,142 @@ export class Migrations extends Service {
|
|
|
575
568
|
* @param {string} password
|
|
576
569
|
* @param {number} port
|
|
577
570
|
* @throws {AppwriteException}
|
|
578
|
-
* @returns {Promise}
|
|
579
|
-
|
|
571
|
+
* @returns {Promise<Models.MigrationReport>}
|
|
572
|
+
*/
|
|
580
573
|
async getSupabaseReport(resources: string[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number): Promise<Models.MigrationReport> {
|
|
581
574
|
if (typeof resources === 'undefined') {
|
|
582
575
|
throw new AppwriteException('Missing required parameter: "resources"');
|
|
583
576
|
}
|
|
584
|
-
|
|
585
577
|
if (typeof endpoint === 'undefined') {
|
|
586
578
|
throw new AppwriteException('Missing required parameter: "endpoint"');
|
|
587
579
|
}
|
|
588
|
-
|
|
589
580
|
if (typeof apiKey === 'undefined') {
|
|
590
581
|
throw new AppwriteException('Missing required parameter: "apiKey"');
|
|
591
582
|
}
|
|
592
|
-
|
|
593
583
|
if (typeof databaseHost === 'undefined') {
|
|
594
584
|
throw new AppwriteException('Missing required parameter: "databaseHost"');
|
|
595
585
|
}
|
|
596
|
-
|
|
597
586
|
if (typeof username === 'undefined') {
|
|
598
587
|
throw new AppwriteException('Missing required parameter: "username"');
|
|
599
588
|
}
|
|
600
|
-
|
|
601
589
|
if (typeof password === 'undefined') {
|
|
602
590
|
throw new AppwriteException('Missing required parameter: "password"');
|
|
603
591
|
}
|
|
604
|
-
|
|
605
592
|
const apiPath = '/migrations/supabase/report';
|
|
606
593
|
const payload: Payload = {};
|
|
607
|
-
|
|
608
594
|
if (typeof resources !== 'undefined') {
|
|
609
595
|
payload['resources'] = resources;
|
|
610
596
|
}
|
|
611
|
-
|
|
612
597
|
if (typeof endpoint !== 'undefined') {
|
|
613
598
|
payload['endpoint'] = endpoint;
|
|
614
599
|
}
|
|
615
|
-
|
|
616
600
|
if (typeof apiKey !== 'undefined') {
|
|
617
601
|
payload['apiKey'] = apiKey;
|
|
618
602
|
}
|
|
619
|
-
|
|
620
603
|
if (typeof databaseHost !== 'undefined') {
|
|
621
604
|
payload['databaseHost'] = databaseHost;
|
|
622
605
|
}
|
|
623
|
-
|
|
624
606
|
if (typeof username !== 'undefined') {
|
|
625
607
|
payload['username'] = username;
|
|
626
608
|
}
|
|
627
|
-
|
|
628
609
|
if (typeof password !== 'undefined') {
|
|
629
610
|
payload['password'] = password;
|
|
630
611
|
}
|
|
631
|
-
|
|
632
612
|
if (typeof port !== 'undefined') {
|
|
633
613
|
payload['port'] = port;
|
|
634
614
|
}
|
|
635
|
-
|
|
636
615
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
637
|
-
|
|
616
|
+
|
|
617
|
+
const apiHeaders: { [header: string]: string } = {
|
|
638
618
|
'content-type': 'application/json',
|
|
639
|
-
}
|
|
640
|
-
}
|
|
619
|
+
}
|
|
641
620
|
|
|
621
|
+
return await this.client.call(
|
|
622
|
+
'get',
|
|
623
|
+
uri,
|
|
624
|
+
apiHeaders,
|
|
625
|
+
payload
|
|
626
|
+
);
|
|
627
|
+
}
|
|
642
628
|
/**
|
|
643
629
|
* Get Migration
|
|
644
630
|
*
|
|
645
631
|
*
|
|
646
632
|
* @param {string} migrationId
|
|
647
633
|
* @throws {AppwriteException}
|
|
648
|
-
* @returns {Promise}
|
|
649
|
-
|
|
634
|
+
* @returns {Promise<Models.Migration>}
|
|
635
|
+
*/
|
|
650
636
|
async get(migrationId: string): Promise<Models.Migration> {
|
|
651
637
|
if (typeof migrationId === 'undefined') {
|
|
652
638
|
throw new AppwriteException('Missing required parameter: "migrationId"');
|
|
653
639
|
}
|
|
654
|
-
|
|
655
640
|
const apiPath = '/migrations/{migrationId}'.replace('{migrationId}', migrationId);
|
|
656
641
|
const payload: Payload = {};
|
|
657
|
-
|
|
658
642
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
659
|
-
|
|
643
|
+
|
|
644
|
+
const apiHeaders: { [header: string]: string } = {
|
|
660
645
|
'content-type': 'application/json',
|
|
661
|
-
}
|
|
662
|
-
}
|
|
646
|
+
}
|
|
663
647
|
|
|
648
|
+
return await this.client.call(
|
|
649
|
+
'get',
|
|
650
|
+
uri,
|
|
651
|
+
apiHeaders,
|
|
652
|
+
payload
|
|
653
|
+
);
|
|
654
|
+
}
|
|
664
655
|
/**
|
|
665
656
|
* Retry Migration
|
|
666
657
|
*
|
|
667
658
|
*
|
|
668
659
|
* @param {string} migrationId
|
|
669
660
|
* @throws {AppwriteException}
|
|
670
|
-
* @returns {Promise}
|
|
671
|
-
|
|
661
|
+
* @returns {Promise<Models.Migration>}
|
|
662
|
+
*/
|
|
672
663
|
async retry(migrationId: string): Promise<Models.Migration> {
|
|
673
664
|
if (typeof migrationId === 'undefined') {
|
|
674
665
|
throw new AppwriteException('Missing required parameter: "migrationId"');
|
|
675
666
|
}
|
|
676
|
-
|
|
677
667
|
const apiPath = '/migrations/{migrationId}'.replace('{migrationId}', migrationId);
|
|
678
668
|
const payload: Payload = {};
|
|
679
|
-
|
|
680
669
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
681
|
-
|
|
670
|
+
|
|
671
|
+
const apiHeaders: { [header: string]: string } = {
|
|
682
672
|
'content-type': 'application/json',
|
|
683
|
-
}
|
|
684
|
-
}
|
|
673
|
+
}
|
|
685
674
|
|
|
675
|
+
return await this.client.call(
|
|
676
|
+
'patch',
|
|
677
|
+
uri,
|
|
678
|
+
apiHeaders,
|
|
679
|
+
payload
|
|
680
|
+
);
|
|
681
|
+
}
|
|
686
682
|
/**
|
|
687
683
|
* Delete Migration
|
|
688
684
|
*
|
|
689
685
|
*
|
|
690
686
|
* @param {string} migrationId
|
|
691
687
|
* @throws {AppwriteException}
|
|
692
|
-
* @returns {Promise}
|
|
693
|
-
|
|
688
|
+
* @returns {Promise<{}>}
|
|
689
|
+
*/
|
|
694
690
|
async delete(migrationId: string): Promise<{}> {
|
|
695
691
|
if (typeof migrationId === 'undefined') {
|
|
696
692
|
throw new AppwriteException('Missing required parameter: "migrationId"');
|
|
697
693
|
}
|
|
698
|
-
|
|
699
694
|
const apiPath = '/migrations/{migrationId}'.replace('{migrationId}', migrationId);
|
|
700
695
|
const payload: Payload = {};
|
|
701
|
-
|
|
702
696
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
703
|
-
|
|
697
|
+
|
|
698
|
+
const apiHeaders: { [header: string]: string } = {
|
|
704
699
|
'content-type': 'application/json',
|
|
705
|
-
}
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
return await this.client.call(
|
|
703
|
+
'delete',
|
|
704
|
+
uri,
|
|
705
|
+
apiHeaders,
|
|
706
|
+
payload
|
|
707
|
+
);
|
|
706
708
|
}
|
|
707
|
-
}
|
|
709
|
+
}
|