@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
package/src/services/teams.ts
CHANGED
|
@@ -1,87 +1,87 @@
|
|
|
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 Teams
|
|
4
|
+
export class Teams {
|
|
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 teams
|
|
15
13
|
*
|
|
16
|
-
* Get a list of all the teams in which the current user is a member. You can
|
|
17
|
-
* use the parameters to filter your results.
|
|
14
|
+
* Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.
|
|
18
15
|
*
|
|
19
16
|
* @param {string[]} queries
|
|
20
17
|
* @param {string} search
|
|
21
18
|
* @throws {AppwriteException}
|
|
22
|
-
* @returns {Promise}
|
|
23
|
-
|
|
19
|
+
* @returns {Promise<Models.TeamList<Preferences>>}
|
|
20
|
+
*/
|
|
24
21
|
async list<Preferences extends Models.Preferences>(queries?: string[], search?: string): Promise<Models.TeamList<Preferences>> {
|
|
25
22
|
const apiPath = '/teams';
|
|
26
23
|
const payload: Payload = {};
|
|
27
|
-
|
|
28
24
|
if (typeof queries !== 'undefined') {
|
|
29
25
|
payload['queries'] = queries;
|
|
30
26
|
}
|
|
31
|
-
|
|
32
27
|
if (typeof search !== 'undefined') {
|
|
33
28
|
payload['search'] = search;
|
|
34
29
|
}
|
|
35
|
-
|
|
36
30
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
37
|
-
|
|
31
|
+
|
|
32
|
+
const apiHeaders: { [header: string]: string } = {
|
|
38
33
|
'content-type': 'application/json',
|
|
39
|
-
}
|
|
40
|
-
}
|
|
34
|
+
}
|
|
41
35
|
|
|
36
|
+
return await this.client.call(
|
|
37
|
+
'get',
|
|
38
|
+
uri,
|
|
39
|
+
apiHeaders,
|
|
40
|
+
payload
|
|
41
|
+
);
|
|
42
|
+
}
|
|
42
43
|
/**
|
|
43
44
|
* Create team
|
|
44
45
|
*
|
|
45
|
-
* Create a new team. The user who creates the team will automatically be
|
|
46
|
-
* assigned as the owner of the team. Only the users with the owner role can
|
|
47
|
-
* invite new members, add new owners and delete or update the team.
|
|
46
|
+
* Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team.
|
|
48
47
|
*
|
|
49
48
|
* @param {string} teamId
|
|
50
49
|
* @param {string} name
|
|
51
50
|
* @param {string[]} roles
|
|
52
51
|
* @throws {AppwriteException}
|
|
53
|
-
* @returns {Promise}
|
|
54
|
-
|
|
52
|
+
* @returns {Promise<Models.Team<Preferences>>}
|
|
53
|
+
*/
|
|
55
54
|
async create<Preferences extends Models.Preferences>(teamId: string, name: string, roles?: string[]): Promise<Models.Team<Preferences>> {
|
|
56
55
|
if (typeof teamId === 'undefined') {
|
|
57
56
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
58
57
|
}
|
|
59
|
-
|
|
60
58
|
if (typeof name === 'undefined') {
|
|
61
59
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
62
60
|
}
|
|
63
|
-
|
|
64
61
|
const apiPath = '/teams';
|
|
65
62
|
const payload: Payload = {};
|
|
66
|
-
|
|
67
63
|
if (typeof teamId !== 'undefined') {
|
|
68
64
|
payload['teamId'] = teamId;
|
|
69
65
|
}
|
|
70
|
-
|
|
71
66
|
if (typeof name !== 'undefined') {
|
|
72
67
|
payload['name'] = name;
|
|
73
68
|
}
|
|
74
|
-
|
|
75
69
|
if (typeof roles !== 'undefined') {
|
|
76
70
|
payload['roles'] = roles;
|
|
77
71
|
}
|
|
78
|
-
|
|
79
72
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
80
|
-
|
|
73
|
+
|
|
74
|
+
const apiHeaders: { [header: string]: string } = {
|
|
81
75
|
'content-type': 'application/json',
|
|
82
|
-
}
|
|
83
|
-
}
|
|
76
|
+
}
|
|
84
77
|
|
|
78
|
+
return await this.client.call(
|
|
79
|
+
'post',
|
|
80
|
+
uri,
|
|
81
|
+
apiHeaders,
|
|
82
|
+
payload
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
85
|
/**
|
|
86
86
|
* Get team
|
|
87
87
|
*
|
|
@@ -89,78 +89,90 @@ export class Teams extends Service {
|
|
|
89
89
|
*
|
|
90
90
|
* @param {string} teamId
|
|
91
91
|
* @throws {AppwriteException}
|
|
92
|
-
* @returns {Promise}
|
|
93
|
-
|
|
92
|
+
* @returns {Promise<Models.Team<Preferences>>}
|
|
93
|
+
*/
|
|
94
94
|
async get<Preferences extends Models.Preferences>(teamId: string): Promise<Models.Team<Preferences>> {
|
|
95
95
|
if (typeof teamId === 'undefined') {
|
|
96
96
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
97
97
|
}
|
|
98
|
-
|
|
99
98
|
const apiPath = '/teams/{teamId}'.replace('{teamId}', teamId);
|
|
100
99
|
const payload: Payload = {};
|
|
101
|
-
|
|
102
100
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
103
|
-
|
|
101
|
+
|
|
102
|
+
const apiHeaders: { [header: string]: string } = {
|
|
104
103
|
'content-type': 'application/json',
|
|
105
|
-
}
|
|
106
|
-
}
|
|
104
|
+
}
|
|
107
105
|
|
|
106
|
+
return await this.client.call(
|
|
107
|
+
'get',
|
|
108
|
+
uri,
|
|
109
|
+
apiHeaders,
|
|
110
|
+
payload
|
|
111
|
+
);
|
|
112
|
+
}
|
|
108
113
|
/**
|
|
109
114
|
* Update name
|
|
110
115
|
*
|
|
111
|
-
* Update the team
|
|
116
|
+
* Update the team's name by its unique ID.
|
|
112
117
|
*
|
|
113
118
|
* @param {string} teamId
|
|
114
119
|
* @param {string} name
|
|
115
120
|
* @throws {AppwriteException}
|
|
116
|
-
* @returns {Promise}
|
|
117
|
-
|
|
121
|
+
* @returns {Promise<Models.Team<Preferences>>}
|
|
122
|
+
*/
|
|
118
123
|
async updateName<Preferences extends Models.Preferences>(teamId: string, name: string): Promise<Models.Team<Preferences>> {
|
|
119
124
|
if (typeof teamId === 'undefined') {
|
|
120
125
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
121
126
|
}
|
|
122
|
-
|
|
123
127
|
if (typeof name === 'undefined') {
|
|
124
128
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
125
129
|
}
|
|
126
|
-
|
|
127
130
|
const apiPath = '/teams/{teamId}'.replace('{teamId}', teamId);
|
|
128
131
|
const payload: Payload = {};
|
|
129
|
-
|
|
130
132
|
if (typeof name !== 'undefined') {
|
|
131
133
|
payload['name'] = name;
|
|
132
134
|
}
|
|
133
|
-
|
|
134
135
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
135
|
-
|
|
136
|
+
|
|
137
|
+
const apiHeaders: { [header: string]: string } = {
|
|
136
138
|
'content-type': 'application/json',
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
+
}
|
|
139
140
|
|
|
141
|
+
return await this.client.call(
|
|
142
|
+
'put',
|
|
143
|
+
uri,
|
|
144
|
+
apiHeaders,
|
|
145
|
+
payload
|
|
146
|
+
);
|
|
147
|
+
}
|
|
140
148
|
/**
|
|
141
149
|
* Delete team
|
|
142
150
|
*
|
|
143
|
-
* Delete a team using its ID. Only team members with the owner role can
|
|
144
|
-
* delete the team.
|
|
151
|
+
* Delete a team using its ID. Only team members with the owner role can delete the team.
|
|
145
152
|
*
|
|
146
153
|
* @param {string} teamId
|
|
147
154
|
* @throws {AppwriteException}
|
|
148
|
-
* @returns {Promise}
|
|
149
|
-
|
|
155
|
+
* @returns {Promise<{}>}
|
|
156
|
+
*/
|
|
150
157
|
async delete(teamId: string): Promise<{}> {
|
|
151
158
|
if (typeof teamId === 'undefined') {
|
|
152
159
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
153
160
|
}
|
|
154
|
-
|
|
155
161
|
const apiPath = '/teams/{teamId}'.replace('{teamId}', teamId);
|
|
156
162
|
const payload: Payload = {};
|
|
157
|
-
|
|
158
163
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
159
|
-
|
|
164
|
+
|
|
165
|
+
const apiHeaders: { [header: string]: string } = {
|
|
160
166
|
'content-type': 'application/json',
|
|
161
|
-
}
|
|
162
|
-
}
|
|
167
|
+
}
|
|
163
168
|
|
|
169
|
+
return await this.client.call(
|
|
170
|
+
'delete',
|
|
171
|
+
uri,
|
|
172
|
+
apiHeaders,
|
|
173
|
+
payload
|
|
174
|
+
);
|
|
175
|
+
}
|
|
164
176
|
/**
|
|
165
177
|
* List team logs
|
|
166
178
|
*
|
|
@@ -169,84 +181,77 @@ export class Teams extends Service {
|
|
|
169
181
|
* @param {string} teamId
|
|
170
182
|
* @param {string[]} queries
|
|
171
183
|
* @throws {AppwriteException}
|
|
172
|
-
* @returns {Promise}
|
|
173
|
-
|
|
184
|
+
* @returns {Promise<Models.LogList>}
|
|
185
|
+
*/
|
|
174
186
|
async listLogs(teamId: string, queries?: string[]): Promise<Models.LogList> {
|
|
175
187
|
if (typeof teamId === 'undefined') {
|
|
176
188
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
177
189
|
}
|
|
178
|
-
|
|
179
190
|
const apiPath = '/teams/{teamId}/logs'.replace('{teamId}', teamId);
|
|
180
191
|
const payload: Payload = {};
|
|
181
|
-
|
|
182
192
|
if (typeof queries !== 'undefined') {
|
|
183
193
|
payload['queries'] = queries;
|
|
184
194
|
}
|
|
185
|
-
|
|
186
195
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
187
|
-
|
|
196
|
+
|
|
197
|
+
const apiHeaders: { [header: string]: string } = {
|
|
188
198
|
'content-type': 'application/json',
|
|
189
|
-
}
|
|
190
|
-
}
|
|
199
|
+
}
|
|
191
200
|
|
|
201
|
+
return await this.client.call(
|
|
202
|
+
'get',
|
|
203
|
+
uri,
|
|
204
|
+
apiHeaders,
|
|
205
|
+
payload
|
|
206
|
+
);
|
|
207
|
+
}
|
|
192
208
|
/**
|
|
193
209
|
* List team memberships
|
|
194
210
|
*
|
|
195
|
-
* Use this endpoint to list a team
|
|
196
|
-
* members have read access to this endpoint.
|
|
211
|
+
* Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.
|
|
197
212
|
*
|
|
198
213
|
* @param {string} teamId
|
|
199
214
|
* @param {string[]} queries
|
|
200
215
|
* @param {string} search
|
|
201
216
|
* @throws {AppwriteException}
|
|
202
|
-
* @returns {Promise}
|
|
203
|
-
|
|
217
|
+
* @returns {Promise<Models.MembershipList>}
|
|
218
|
+
*/
|
|
204
219
|
async listMemberships(teamId: string, queries?: string[], search?: string): Promise<Models.MembershipList> {
|
|
205
220
|
if (typeof teamId === 'undefined') {
|
|
206
221
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
207
222
|
}
|
|
208
|
-
|
|
209
223
|
const apiPath = '/teams/{teamId}/memberships'.replace('{teamId}', teamId);
|
|
210
224
|
const payload: Payload = {};
|
|
211
|
-
|
|
212
225
|
if (typeof queries !== 'undefined') {
|
|
213
226
|
payload['queries'] = queries;
|
|
214
227
|
}
|
|
215
|
-
|
|
216
228
|
if (typeof search !== 'undefined') {
|
|
217
229
|
payload['search'] = search;
|
|
218
230
|
}
|
|
219
|
-
|
|
220
231
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
221
|
-
|
|
232
|
+
|
|
233
|
+
const apiHeaders: { [header: string]: string } = {
|
|
222
234
|
'content-type': 'application/json',
|
|
223
|
-
}
|
|
224
|
-
}
|
|
235
|
+
}
|
|
225
236
|
|
|
237
|
+
return await this.client.call(
|
|
238
|
+
'get',
|
|
239
|
+
uri,
|
|
240
|
+
apiHeaders,
|
|
241
|
+
payload
|
|
242
|
+
);
|
|
243
|
+
}
|
|
226
244
|
/**
|
|
227
245
|
* Create team membership
|
|
228
246
|
*
|
|
229
|
-
* Invite a new member to join your team. Provide an ID for existing users, or
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
* will prioritize accepting the user ID > email > phone number if you provide
|
|
238
|
-
* more than one of these parameters.
|
|
239
|
-
*
|
|
240
|
-
* Use the `url` parameter to redirect the user from the invitation email to
|
|
241
|
-
* your app. After the user is redirected, use the [Update Team Membership
|
|
242
|
-
* Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus)
|
|
243
|
-
* endpoint to allow the user to accept the invitation to the team.
|
|
244
|
-
*
|
|
245
|
-
* Please note that to avoid a [Redirect
|
|
246
|
-
* Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
|
247
|
-
* Appwrite will accept the only redirect URLs under the domains you have
|
|
248
|
-
* added as a platform on the Appwrite Console.
|
|
249
|
-
*
|
|
247
|
+
* Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.
|
|
248
|
+
|
|
249
|
+
You only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.
|
|
250
|
+
|
|
251
|
+
Use the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.
|
|
252
|
+
|
|
253
|
+
Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.
|
|
254
|
+
|
|
250
255
|
*
|
|
251
256
|
* @param {string} teamId
|
|
252
257
|
* @param {string[]} roles
|
|
@@ -256,257 +261,262 @@ export class Teams extends Service {
|
|
|
256
261
|
* @param {string} url
|
|
257
262
|
* @param {string} name
|
|
258
263
|
* @throws {AppwriteException}
|
|
259
|
-
* @returns {Promise}
|
|
260
|
-
|
|
264
|
+
* @returns {Promise<Models.Membership>}
|
|
265
|
+
*/
|
|
261
266
|
async createMembership(teamId: string, roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string): Promise<Models.Membership> {
|
|
262
267
|
if (typeof teamId === 'undefined') {
|
|
263
268
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
264
269
|
}
|
|
265
|
-
|
|
266
270
|
if (typeof roles === 'undefined') {
|
|
267
271
|
throw new AppwriteException('Missing required parameter: "roles"');
|
|
268
272
|
}
|
|
269
|
-
|
|
270
273
|
const apiPath = '/teams/{teamId}/memberships'.replace('{teamId}', teamId);
|
|
271
274
|
const payload: Payload = {};
|
|
272
|
-
|
|
273
275
|
if (typeof email !== 'undefined') {
|
|
274
276
|
payload['email'] = email;
|
|
275
277
|
}
|
|
276
|
-
|
|
277
278
|
if (typeof userId !== 'undefined') {
|
|
278
279
|
payload['userId'] = userId;
|
|
279
280
|
}
|
|
280
|
-
|
|
281
281
|
if (typeof phone !== 'undefined') {
|
|
282
282
|
payload['phone'] = phone;
|
|
283
283
|
}
|
|
284
|
-
|
|
285
284
|
if (typeof roles !== 'undefined') {
|
|
286
285
|
payload['roles'] = roles;
|
|
287
286
|
}
|
|
288
|
-
|
|
289
287
|
if (typeof url !== 'undefined') {
|
|
290
288
|
payload['url'] = url;
|
|
291
289
|
}
|
|
292
|
-
|
|
293
290
|
if (typeof name !== 'undefined') {
|
|
294
291
|
payload['name'] = name;
|
|
295
292
|
}
|
|
296
|
-
|
|
297
293
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
298
|
-
|
|
294
|
+
|
|
295
|
+
const apiHeaders: { [header: string]: string } = {
|
|
299
296
|
'content-type': 'application/json',
|
|
300
|
-
}
|
|
301
|
-
}
|
|
297
|
+
}
|
|
302
298
|
|
|
299
|
+
return await this.client.call(
|
|
300
|
+
'post',
|
|
301
|
+
uri,
|
|
302
|
+
apiHeaders,
|
|
303
|
+
payload
|
|
304
|
+
);
|
|
305
|
+
}
|
|
303
306
|
/**
|
|
304
307
|
* Get team membership
|
|
305
308
|
*
|
|
306
|
-
* Get a team member by the membership unique id. All team members have read
|
|
307
|
-
* access for this resource.
|
|
309
|
+
* Get a team member by the membership unique id. All team members have read access for this resource.
|
|
308
310
|
*
|
|
309
311
|
* @param {string} teamId
|
|
310
312
|
* @param {string} membershipId
|
|
311
313
|
* @throws {AppwriteException}
|
|
312
|
-
* @returns {Promise}
|
|
313
|
-
|
|
314
|
+
* @returns {Promise<Models.Membership>}
|
|
315
|
+
*/
|
|
314
316
|
async getMembership(teamId: string, membershipId: string): Promise<Models.Membership> {
|
|
315
317
|
if (typeof teamId === 'undefined') {
|
|
316
318
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
317
319
|
}
|
|
318
|
-
|
|
319
320
|
if (typeof membershipId === 'undefined') {
|
|
320
321
|
throw new AppwriteException('Missing required parameter: "membershipId"');
|
|
321
322
|
}
|
|
322
|
-
|
|
323
323
|
const apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);
|
|
324
324
|
const payload: Payload = {};
|
|
325
|
-
|
|
326
325
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
327
|
-
|
|
326
|
+
|
|
327
|
+
const apiHeaders: { [header: string]: string } = {
|
|
328
328
|
'content-type': 'application/json',
|
|
329
|
-
}
|
|
330
|
-
}
|
|
329
|
+
}
|
|
331
330
|
|
|
331
|
+
return await this.client.call(
|
|
332
|
+
'get',
|
|
333
|
+
uri,
|
|
334
|
+
apiHeaders,
|
|
335
|
+
payload
|
|
336
|
+
);
|
|
337
|
+
}
|
|
332
338
|
/**
|
|
333
339
|
* Update membership
|
|
334
340
|
*
|
|
335
|
-
* Modify the roles of a team member. Only team members with the owner role
|
|
336
|
-
|
|
337
|
-
* permissions](https://appwrite.io/docs/permissions).
|
|
338
|
-
*
|
|
341
|
+
* Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https://appwrite.io/docs/permissions).
|
|
342
|
+
|
|
339
343
|
*
|
|
340
344
|
* @param {string} teamId
|
|
341
345
|
* @param {string} membershipId
|
|
342
346
|
* @param {string[]} roles
|
|
343
347
|
* @throws {AppwriteException}
|
|
344
|
-
* @returns {Promise}
|
|
345
|
-
|
|
348
|
+
* @returns {Promise<Models.Membership>}
|
|
349
|
+
*/
|
|
346
350
|
async updateMembership(teamId: string, membershipId: string, roles: string[]): Promise<Models.Membership> {
|
|
347
351
|
if (typeof teamId === 'undefined') {
|
|
348
352
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
349
353
|
}
|
|
350
|
-
|
|
351
354
|
if (typeof membershipId === 'undefined') {
|
|
352
355
|
throw new AppwriteException('Missing required parameter: "membershipId"');
|
|
353
356
|
}
|
|
354
|
-
|
|
355
357
|
if (typeof roles === 'undefined') {
|
|
356
358
|
throw new AppwriteException('Missing required parameter: "roles"');
|
|
357
359
|
}
|
|
358
|
-
|
|
359
360
|
const apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);
|
|
360
361
|
const payload: Payload = {};
|
|
361
|
-
|
|
362
362
|
if (typeof roles !== 'undefined') {
|
|
363
363
|
payload['roles'] = roles;
|
|
364
364
|
}
|
|
365
|
-
|
|
366
365
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
367
|
-
|
|
366
|
+
|
|
367
|
+
const apiHeaders: { [header: string]: string } = {
|
|
368
368
|
'content-type': 'application/json',
|
|
369
|
-
}
|
|
370
|
-
}
|
|
369
|
+
}
|
|
371
370
|
|
|
371
|
+
return await this.client.call(
|
|
372
|
+
'patch',
|
|
373
|
+
uri,
|
|
374
|
+
apiHeaders,
|
|
375
|
+
payload
|
|
376
|
+
);
|
|
377
|
+
}
|
|
372
378
|
/**
|
|
373
379
|
* Delete team membership
|
|
374
380
|
*
|
|
375
|
-
* This endpoint allows a user to leave a team or for a team owner to delete
|
|
376
|
-
* the membership of any other team member. You can also use this endpoint to
|
|
377
|
-
* delete a user membership even if it is not accepted.
|
|
381
|
+
* This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted.
|
|
378
382
|
*
|
|
379
383
|
* @param {string} teamId
|
|
380
384
|
* @param {string} membershipId
|
|
381
385
|
* @throws {AppwriteException}
|
|
382
|
-
* @returns {Promise}
|
|
383
|
-
|
|
386
|
+
* @returns {Promise<{}>}
|
|
387
|
+
*/
|
|
384
388
|
async deleteMembership(teamId: string, membershipId: string): Promise<{}> {
|
|
385
389
|
if (typeof teamId === 'undefined') {
|
|
386
390
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
387
391
|
}
|
|
388
|
-
|
|
389
392
|
if (typeof membershipId === 'undefined') {
|
|
390
393
|
throw new AppwriteException('Missing required parameter: "membershipId"');
|
|
391
394
|
}
|
|
392
|
-
|
|
393
395
|
const apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);
|
|
394
396
|
const payload: Payload = {};
|
|
395
|
-
|
|
396
397
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
397
|
-
|
|
398
|
+
|
|
399
|
+
const apiHeaders: { [header: string]: string } = {
|
|
398
400
|
'content-type': 'application/json',
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
+
}
|
|
401
402
|
|
|
403
|
+
return await this.client.call(
|
|
404
|
+
'delete',
|
|
405
|
+
uri,
|
|
406
|
+
apiHeaders,
|
|
407
|
+
payload
|
|
408
|
+
);
|
|
409
|
+
}
|
|
402
410
|
/**
|
|
403
411
|
* Update team membership status
|
|
404
412
|
*
|
|
405
|
-
* Use this endpoint to allow a user to accept an invitation to join a team
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
* If the request is successful, a session for the user is automatically
|
|
410
|
-
* created.
|
|
411
|
-
*
|
|
413
|
+
* Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.
|
|
414
|
+
|
|
415
|
+
If the request is successful, a session for the user is automatically created.
|
|
416
|
+
|
|
412
417
|
*
|
|
413
418
|
* @param {string} teamId
|
|
414
419
|
* @param {string} membershipId
|
|
415
420
|
* @param {string} userId
|
|
416
421
|
* @param {string} secret
|
|
417
422
|
* @throws {AppwriteException}
|
|
418
|
-
* @returns {Promise}
|
|
419
|
-
|
|
423
|
+
* @returns {Promise<Models.Membership>}
|
|
424
|
+
*/
|
|
420
425
|
async updateMembershipStatus(teamId: string, membershipId: string, userId: string, secret: string): Promise<Models.Membership> {
|
|
421
426
|
if (typeof teamId === 'undefined') {
|
|
422
427
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
423
428
|
}
|
|
424
|
-
|
|
425
429
|
if (typeof membershipId === 'undefined') {
|
|
426
430
|
throw new AppwriteException('Missing required parameter: "membershipId"');
|
|
427
431
|
}
|
|
428
|
-
|
|
429
432
|
if (typeof userId === 'undefined') {
|
|
430
433
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
431
434
|
}
|
|
432
|
-
|
|
433
435
|
if (typeof secret === 'undefined') {
|
|
434
436
|
throw new AppwriteException('Missing required parameter: "secret"');
|
|
435
437
|
}
|
|
436
|
-
|
|
437
438
|
const apiPath = '/teams/{teamId}/memberships/{membershipId}/status'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);
|
|
438
439
|
const payload: Payload = {};
|
|
439
|
-
|
|
440
440
|
if (typeof userId !== 'undefined') {
|
|
441
441
|
payload['userId'] = userId;
|
|
442
442
|
}
|
|
443
|
-
|
|
444
443
|
if (typeof secret !== 'undefined') {
|
|
445
444
|
payload['secret'] = secret;
|
|
446
445
|
}
|
|
447
|
-
|
|
448
446
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
449
|
-
|
|
447
|
+
|
|
448
|
+
const apiHeaders: { [header: string]: string } = {
|
|
450
449
|
'content-type': 'application/json',
|
|
451
|
-
}
|
|
452
|
-
}
|
|
450
|
+
}
|
|
453
451
|
|
|
452
|
+
return await this.client.call(
|
|
453
|
+
'patch',
|
|
454
|
+
uri,
|
|
455
|
+
apiHeaders,
|
|
456
|
+
payload
|
|
457
|
+
);
|
|
458
|
+
}
|
|
454
459
|
/**
|
|
455
460
|
* Get team preferences
|
|
456
461
|
*
|
|
457
|
-
* Get the team
|
|
458
|
-
* need to be shared by all team members, prefer storing them in [user
|
|
459
|
-
* preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs).
|
|
462
|
+
* Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs).
|
|
460
463
|
*
|
|
461
464
|
* @param {string} teamId
|
|
462
465
|
* @throws {AppwriteException}
|
|
463
|
-
* @returns {Promise}
|
|
464
|
-
|
|
466
|
+
* @returns {Promise<Preferences>}
|
|
467
|
+
*/
|
|
465
468
|
async getPrefs<Preferences extends Models.Preferences>(teamId: string): Promise<Preferences> {
|
|
466
469
|
if (typeof teamId === 'undefined') {
|
|
467
470
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
468
471
|
}
|
|
469
|
-
|
|
470
472
|
const apiPath = '/teams/{teamId}/prefs'.replace('{teamId}', teamId);
|
|
471
473
|
const payload: Payload = {};
|
|
472
|
-
|
|
473
474
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
474
|
-
|
|
475
|
+
|
|
476
|
+
const apiHeaders: { [header: string]: string } = {
|
|
475
477
|
'content-type': 'application/json',
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
+
}
|
|
478
479
|
|
|
480
|
+
return await this.client.call(
|
|
481
|
+
'get',
|
|
482
|
+
uri,
|
|
483
|
+
apiHeaders,
|
|
484
|
+
payload
|
|
485
|
+
);
|
|
486
|
+
}
|
|
479
487
|
/**
|
|
480
488
|
* Update preferences
|
|
481
489
|
*
|
|
482
|
-
* Update the team
|
|
483
|
-
* stored as is and replaces any previous value. The maximum allowed prefs
|
|
484
|
-
* size is 64kB and throws an error if exceeded.
|
|
490
|
+
* Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded.
|
|
485
491
|
*
|
|
486
492
|
* @param {string} teamId
|
|
487
493
|
* @param {object} prefs
|
|
488
494
|
* @throws {AppwriteException}
|
|
489
|
-
* @returns {Promise}
|
|
490
|
-
|
|
495
|
+
* @returns {Promise<Preferences>}
|
|
496
|
+
*/
|
|
491
497
|
async updatePrefs<Preferences extends Models.Preferences>(teamId: string, prefs: object): Promise<Preferences> {
|
|
492
498
|
if (typeof teamId === 'undefined') {
|
|
493
499
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
494
500
|
}
|
|
495
|
-
|
|
496
501
|
if (typeof prefs === 'undefined') {
|
|
497
502
|
throw new AppwriteException('Missing required parameter: "prefs"');
|
|
498
503
|
}
|
|
499
|
-
|
|
500
504
|
const apiPath = '/teams/{teamId}/prefs'.replace('{teamId}', teamId);
|
|
501
505
|
const payload: Payload = {};
|
|
502
|
-
|
|
503
506
|
if (typeof prefs !== 'undefined') {
|
|
504
507
|
payload['prefs'] = prefs;
|
|
505
508
|
}
|
|
506
|
-
|
|
507
509
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
508
|
-
|
|
510
|
+
|
|
511
|
+
const apiHeaders: { [header: string]: string } = {
|
|
509
512
|
'content-type': 'application/json',
|
|
510
|
-
}
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
return await this.client.call(
|
|
516
|
+
'put',
|
|
517
|
+
uri,
|
|
518
|
+
apiHeaders,
|
|
519
|
+
payload
|
|
520
|
+
);
|
|
511
521
|
}
|
|
512
|
-
}
|
|
522
|
+
}
|