From 318c455a244b3e7ab9bab410015a221e3a2a5da6 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 20 Aug 2024 13:10:14 +0200 Subject: [PATCH 1/9] 1.6.x sync --- README.md | 6 +- .../account/create-anonymous-session.md | 2 +- .../account/create-email-password-session.md | 2 +- docs/examples/account/create-email-token.md | 2 +- docs/examples/account/create-j-w-t.md | 2 +- .../account/create-magic-u-r-l-token.md | 2 +- .../account/create-mfa-authenticator.md | 2 +- docs/examples/account/create-mfa-challenge.md | 2 +- .../account/create-mfa-recovery-codes.md | 2 +- docs/examples/account/create-phone-token.md | 2 +- .../account/create-phone-verification.md | 2 +- docs/examples/account/create-push-target.md | 2 +- docs/examples/account/create-recovery.md | 2 +- docs/examples/account/create-session.md | 2 +- docs/examples/account/create-verification.md | 2 +- docs/examples/account/create.md | 2 +- docs/examples/account/delete-identity.md | 2 +- .../account/delete-mfa-authenticator.md | 5 +- docs/examples/account/delete-push-target.md | 2 +- docs/examples/account/delete-session.md | 2 +- docs/examples/account/delete-sessions.md | 2 +- docs/examples/account/delete.md | 2 +- .../account/get-mfa-recovery-codes.md | 2 +- docs/examples/account/get-prefs.md | 2 +- docs/examples/account/get-session.md | 2 +- docs/examples/account/get.md | 2 +- docs/examples/account/list-identities.md | 2 +- docs/examples/account/list-logs.md | 2 +- docs/examples/account/list-mfa-factors.md | 2 +- docs/examples/account/list-sessions.md | 2 +- docs/examples/account/update-email.md | 2 +- docs/examples/account/update-m-f-a.md | 2 +- .../account/update-magic-u-r-l-session.md | 2 +- .../account/update-mfa-authenticator.md | 2 +- docs/examples/account/update-mfa-challenge.md | 2 +- .../account/update-mfa-recovery-codes.md | 2 +- docs/examples/account/update-name.md | 2 +- docs/examples/account/update-password.md | 2 +- docs/examples/account/update-phone-session.md | 2 +- .../account/update-phone-verification.md | 2 +- docs/examples/account/update-phone.md | 2 +- docs/examples/account/update-prefs.md | 2 +- docs/examples/account/update-push-target.md | 2 +- docs/examples/account/update-recovery.md | 2 +- docs/examples/account/update-session.md | 2 +- docs/examples/account/update-status.md | 2 +- docs/examples/account/update-verification.md | 2 +- docs/examples/assistant/chat.md | 2 +- docs/examples/console/variables.md | 2 +- .../databases/create-boolean-attribute.md | 2 +- docs/examples/databases/create-collection.md | 2 +- .../databases/create-datetime-attribute.md | 2 +- docs/examples/databases/create-document.md | 2 +- .../databases/create-email-attribute.md | 2 +- .../databases/create-enum-attribute.md | 2 +- .../databases/create-float-attribute.md | 2 +- docs/examples/databases/create-index.md | 2 +- .../databases/create-integer-attribute.md | 2 +- .../examples/databases/create-ip-attribute.md | 2 +- .../create-relationship-attribute.md | 2 +- .../databases/create-string-attribute.md | 2 +- .../databases/create-url-attribute.md | 2 +- docs/examples/databases/create.md | 2 +- docs/examples/databases/delete-attribute.md | 2 +- docs/examples/databases/delete-collection.md | 2 +- docs/examples/databases/delete-document.md | 2 +- docs/examples/databases/delete-index.md | 2 +- docs/examples/databases/delete.md | 2 +- docs/examples/databases/get-attribute.md | 2 +- .../databases/get-collection-usage.md | 2 +- docs/examples/databases/get-collection.md | 2 +- docs/examples/databases/get-database-usage.md | 2 +- docs/examples/databases/get-document.md | 2 +- docs/examples/databases/get-index.md | 2 +- docs/examples/databases/get-usage.md | 2 +- docs/examples/databases/get.md | 2 +- docs/examples/databases/list-attributes.md | 2 +- .../databases/list-collection-logs.md | 2 +- docs/examples/databases/list-collections.md | 2 +- docs/examples/databases/list-document-logs.md | 2 +- docs/examples/databases/list-documents.md | 2 +- docs/examples/databases/list-indexes.md | 2 +- docs/examples/databases/list-logs.md | 2 +- docs/examples/databases/list.md | 2 +- .../databases/update-boolean-attribute.md | 2 +- docs/examples/databases/update-collection.md | 2 +- .../databases/update-datetime-attribute.md | 2 +- docs/examples/databases/update-document.md | 2 +- .../databases/update-email-attribute.md | 2 +- .../databases/update-enum-attribute.md | 2 +- .../databases/update-float-attribute.md | 2 +- .../databases/update-integer-attribute.md | 2 +- .../examples/databases/update-ip-attribute.md | 2 +- .../update-relationship-attribute.md | 2 +- .../databases/update-string-attribute.md | 2 +- .../databases/update-url-attribute.md | 2 +- docs/examples/databases/update.md | 2 +- docs/examples/functions/create-build.md | 4 +- docs/examples/functions/create-deployment.md | 2 +- docs/examples/functions/create-execution.md | 5 +- docs/examples/functions/create-variable.md | 2 +- docs/examples/functions/create.md | 6 +- docs/examples/functions/delete-deployment.md | 2 +- docs/examples/functions/delete-execution.md | 14 + docs/examples/functions/delete-variable.md | 2 +- docs/examples/functions/delete.md | 2 +- ...ployment.md => get-deployment-download.md} | 2 +- docs/examples/functions/get-deployment.md | 2 +- docs/examples/functions/get-execution.md | 2 +- docs/examples/functions/get-function-usage.md | 2 +- ...{get-specifications.md => get-template.md} | 6 +- docs/examples/functions/get-usage.md | 2 +- docs/examples/functions/get-variable.md | 2 +- docs/examples/functions/get.md | 2 +- docs/examples/functions/list-deployments.md | 2 +- docs/examples/functions/list-executions.md | 2 +- docs/examples/functions/list-runtimes.md | 2 +- docs/examples/functions/list-templates.md | 16 ++ docs/examples/functions/list-variables.md | 2 +- docs/examples/functions/list.md | 2 +- .../functions/update-deployment-build.md | 14 + docs/examples/functions/update-deployment.md | 2 +- docs/examples/functions/update-variable.md | 2 +- docs/examples/functions/update.md | 6 +- docs/examples/graphql/mutation.md | 2 +- docs/examples/graphql/query.md | 2 +- docs/examples/health/get-antivirus.md | 2 +- docs/examples/health/get-cache.md | 2 +- docs/examples/health/get-certificate.md | 2 +- docs/examples/health/get-d-b.md | 2 +- docs/examples/health/get-failed-jobs.md | 2 +- docs/examples/health/get-pub-sub.md | 2 +- docs/examples/health/get-queue-builds.md | 2 +- .../examples/health/get-queue-certificates.md | 2 +- docs/examples/health/get-queue-databases.md | 2 +- docs/examples/health/get-queue-deletes.md | 2 +- docs/examples/health/get-queue-functions.md | 2 +- docs/examples/health/get-queue-logs.md | 2 +- docs/examples/health/get-queue-mails.md | 2 +- docs/examples/health/get-queue-messaging.md | 2 +- docs/examples/health/get-queue-migrations.md | 2 +- docs/examples/health/get-queue-usage-dump.md | 2 +- docs/examples/health/get-queue-usage.md | 2 +- docs/examples/health/get-queue-webhooks.md | 2 +- docs/examples/health/get-queue.md | 2 +- docs/examples/health/get-storage-local.md | 2 +- docs/examples/health/get-storage.md | 2 +- docs/examples/health/get-time.md | 2 +- docs/examples/health/get.md | 2 +- docs/examples/locale/get.md | 2 +- docs/examples/locale/list-codes.md | 2 +- docs/examples/locale/list-continents.md | 2 +- docs/examples/locale/list-countries-e-u.md | 2 +- docs/examples/locale/list-countries-phones.md | 2 +- docs/examples/locale/list-countries.md | 2 +- docs/examples/locale/list-currencies.md | 2 +- docs/examples/locale/list-languages.md | 2 +- .../messaging/create-apns-provider.md | 2 +- docs/examples/messaging/create-email.md | 2 +- .../examples/messaging/create-fcm-provider.md | 2 +- .../messaging/create-mailgun-provider.md | 2 +- .../messaging/create-msg91provider.md | 2 +- docs/examples/messaging/create-push.md | 2 +- .../messaging/create-sendgrid-provider.md | 2 +- docs/examples/messaging/create-sms.md | 2 +- .../messaging/create-smtp-provider.md | 2 +- docs/examples/messaging/create-subscriber.md | 2 +- .../messaging/create-telesign-provider.md | 2 +- .../messaging/create-textmagic-provider.md | 2 +- docs/examples/messaging/create-topic.md | 2 +- .../messaging/create-twilio-provider.md | 2 +- .../messaging/create-vonage-provider.md | 2 +- docs/examples/messaging/delete-provider.md | 2 +- docs/examples/messaging/delete-subscriber.md | 2 +- docs/examples/messaging/delete-topic.md | 2 +- docs/examples/messaging/delete.md | 2 +- docs/examples/messaging/get-message.md | 2 +- docs/examples/messaging/get-provider.md | 2 +- docs/examples/messaging/get-subscriber.md | 2 +- docs/examples/messaging/get-topic.md | 2 +- docs/examples/messaging/list-message-logs.md | 2 +- docs/examples/messaging/list-messages.md | 2 +- docs/examples/messaging/list-provider-logs.md | 2 +- docs/examples/messaging/list-providers.md | 2 +- .../messaging/list-subscriber-logs.md | 2 +- docs/examples/messaging/list-subscribers.md | 2 +- docs/examples/messaging/list-targets.md | 2 +- docs/examples/messaging/list-topic-logs.md | 2 +- docs/examples/messaging/list-topics.md | 2 +- .../messaging/update-apns-provider.md | 2 +- docs/examples/messaging/update-email.md | 2 +- .../examples/messaging/update-fcm-provider.md | 2 +- .../messaging/update-mailgun-provider.md | 2 +- .../messaging/update-msg91provider.md | 2 +- docs/examples/messaging/update-push.md | 2 +- .../messaging/update-sendgrid-provider.md | 2 +- docs/examples/messaging/update-sms.md | 2 +- .../messaging/update-smtp-provider.md | 2 +- .../messaging/update-telesign-provider.md | 2 +- .../messaging/update-textmagic-provider.md | 2 +- docs/examples/messaging/update-topic.md | 2 +- .../messaging/update-twilio-provider.md | 2 +- .../messaging/update-vonage-provider.md | 2 +- .../migrations/create-appwrite-migration.md | 2 +- .../migrations/create-firebase-migration.md | 2 +- .../create-firebase-o-auth-migration.md | 2 +- .../migrations/create-n-host-migration.md | 2 +- .../migrations/create-supabase-migration.md | 2 +- .../migrations/delete-firebase-auth.md | 2 +- docs/examples/migrations/delete.md | 2 +- .../migrations/get-appwrite-report.md | 2 +- .../migrations/get-firebase-report-o-auth.md | 2 +- .../migrations/get-firebase-report.md | 2 +- docs/examples/migrations/get-n-host-report.md | 2 +- .../migrations/get-supabase-report.md | 2 +- docs/examples/migrations/get.md | 2 +- .../migrations/list-firebase-projects.md | 2 +- docs/examples/migrations/list.md | 2 +- docs/examples/migrations/retry.md | 2 +- docs/examples/project/create-variable.md | 2 +- docs/examples/project/delete-variable.md | 2 +- docs/examples/project/get-usage.md | 2 +- docs/examples/project/get-variable.md | 2 +- docs/examples/project/list-variables.md | 2 +- docs/examples/project/update-variable.md | 2 +- docs/examples/projects/create-j-w-t.md | 15 + docs/examples/projects/create-key.md | 2 +- docs/examples/projects/create-platform.md | 2 +- docs/examples/projects/create-smtp-test.md | 2 +- docs/examples/projects/create-webhook.md | 2 +- docs/examples/projects/create.md | 2 +- .../projects/delete-email-template.md | 2 +- docs/examples/projects/delete-key.md | 2 +- docs/examples/projects/delete-platform.md | 2 +- docs/examples/projects/delete-sms-template.md | 2 +- docs/examples/projects/delete-webhook.md | 2 +- docs/examples/projects/delete.md | 2 +- docs/examples/projects/get-email-template.md | 2 +- docs/examples/projects/get-key.md | 2 +- docs/examples/projects/get-platform.md | 2 +- docs/examples/projects/get-sms-template.md | 2 +- docs/examples/projects/get-webhook.md | 2 +- docs/examples/projects/get.md | 2 +- docs/examples/projects/list-keys.md | 2 +- docs/examples/projects/list-platforms.md | 2 +- docs/examples/projects/list-webhooks.md | 2 +- docs/examples/projects/list.md | 2 +- .../projects/update-api-status-all.md | 2 +- docs/examples/projects/update-api-status.md | 2 +- .../examples/projects/update-auth-duration.md | 2 +- docs/examples/projects/update-auth-limit.md | 2 +- .../update-auth-password-dictionary.md | 2 +- .../projects/update-auth-password-history.md | 2 +- .../projects/update-auth-sessions-limit.md | 2 +- docs/examples/projects/update-auth-status.md | 2 +- .../projects/update-email-template.md | 2 +- docs/examples/projects/update-key.md | 2 +- docs/examples/projects/update-mock-numbers.md | 14 + docs/examples/projects/update-o-auth2.md | 2 +- .../projects/update-personal-data-check.md | 2 +- docs/examples/projects/update-platform.md | 2 +- .../projects/update-service-status-all.md | 2 +- .../projects/update-service-status.md | 2 +- .../projects/update-session-alerts.md | 14 + docs/examples/projects/update-sms-template.md | 2 +- docs/examples/projects/update-smtp.md | 2 +- docs/examples/projects/update-team.md | 2 +- .../projects/update-webhook-signature.md | 2 +- docs/examples/projects/update-webhook.md | 2 +- docs/examples/projects/update.md | 2 +- docs/examples/proxy/create-rule.md | 2 +- docs/examples/proxy/delete-rule.md | 2 +- docs/examples/proxy/get-rule.md | 2 +- docs/examples/proxy/list-rules.md | 2 +- .../proxy/update-rule-verification.md | 2 +- docs/examples/storage/create-bucket.md | 2 +- docs/examples/storage/create-file.md | 2 +- docs/examples/storage/delete-bucket.md | 2 +- docs/examples/storage/delete-file.md | 2 +- docs/examples/storage/get-bucket-usage.md | 2 +- docs/examples/storage/get-bucket.md | 2 +- docs/examples/storage/get-file.md | 2 +- docs/examples/storage/get-usage.md | 2 +- docs/examples/storage/list-buckets.md | 2 +- docs/examples/storage/list-files.md | 2 +- docs/examples/storage/update-bucket.md | 2 +- docs/examples/storage/update-file.md | 2 +- docs/examples/teams/create-membership.md | 2 +- docs/examples/teams/create.md | 2 +- docs/examples/teams/delete-membership.md | 2 +- docs/examples/teams/delete.md | 2 +- docs/examples/teams/get-membership.md | 2 +- docs/examples/teams/get-prefs.md | 2 +- docs/examples/teams/get.md | 2 +- docs/examples/teams/list-logs.md | 2 +- docs/examples/teams/list-memberships.md | 2 +- docs/examples/teams/list.md | 2 +- .../teams/update-membership-status.md | 2 +- docs/examples/teams/update-membership.md | 2 +- docs/examples/teams/update-name.md | 2 +- docs/examples/teams/update-prefs.md | 2 +- docs/examples/users/create-argon2user.md | 2 +- docs/examples/users/create-bcrypt-user.md | 2 +- docs/examples/users/create-j-w-t.md | 15 + docs/examples/users/create-m-d5user.md | 2 +- .../users/create-mfa-recovery-codes.md | 2 +- docs/examples/users/create-p-h-pass-user.md | 2 +- docs/examples/users/create-s-h-a-user.md | 2 +- .../users/create-scrypt-modified-user.md | 2 +- docs/examples/users/create-scrypt-user.md | 2 +- docs/examples/users/create-session.md | 2 +- docs/examples/users/create-target.md | 2 +- docs/examples/users/create-token.md | 2 +- docs/examples/users/create.md | 2 +- docs/examples/users/delete-identity.md | 2 +- .../users/delete-mfa-authenticator.md | 2 +- docs/examples/users/delete-session.md | 2 +- docs/examples/users/delete-sessions.md | 2 +- docs/examples/users/delete-target.md | 2 +- docs/examples/users/delete.md | 2 +- docs/examples/users/get-mfa-recovery-codes.md | 2 +- docs/examples/users/get-prefs.md | 2 +- docs/examples/users/get-target.md | 2 +- docs/examples/users/get-usage.md | 2 +- docs/examples/users/get.md | 2 +- docs/examples/users/list-identities.md | 2 +- docs/examples/users/list-logs.md | 2 +- docs/examples/users/list-memberships.md | 2 +- docs/examples/users/list-mfa-factors.md | 2 +- docs/examples/users/list-sessions.md | 2 +- docs/examples/users/list-targets.md | 2 +- docs/examples/users/list.md | 2 +- .../users/update-email-verification.md | 2 +- docs/examples/users/update-email.md | 2 +- docs/examples/users/update-labels.md | 2 +- .../users/update-mfa-recovery-codes.md | 2 +- docs/examples/users/update-mfa.md | 2 +- docs/examples/users/update-name.md | 2 +- docs/examples/users/update-password.md | 2 +- .../users/update-phone-verification.md | 2 +- docs/examples/users/update-phone.md | 2 +- docs/examples/users/update-prefs.md | 2 +- docs/examples/users/update-status.md | 2 +- docs/examples/users/update-target.md | 2 +- .../vcs/create-repository-detection.md | 2 +- docs/examples/vcs/create-repository.md | 2 +- docs/examples/vcs/delete-installation.md | 2 +- docs/examples/vcs/get-installation.md | 2 +- docs/examples/vcs/get-repository-contents.md | 15 + docs/examples/vcs/get-repository.md | 2 +- docs/examples/vcs/list-installations.md | 2 +- docs/examples/vcs/list-repositories.md | 2 +- docs/examples/vcs/list-repository-branches.md | 2 +- .../vcs/update-external-deployments.md | 2 +- package.json | 2 +- src/client.ts | 4 +- src/enums/email-template-type.ts | 2 + src/enums/platform-type.ts | 2 + src/enums/runtime.ts | 1 + src/index.ts | 2 +- src/models.ts | 258 ++++++++++++++++-- src/services/account.ts | 13 +- src/services/avatars.ts | 2 + src/services/functions.ts | 168 +++++++++--- src/services/projects.ts | 100 ++++++- src/services/users.ts | 35 +++ src/services/vcs.ts | 32 +++ 367 files changed, 1020 insertions(+), 434 deletions(-) create mode 100644 docs/examples/functions/delete-execution.md rename docs/examples/functions/{download-deployment.md => get-deployment-download.md} (88%) rename docs/examples/functions/{get-specifications.md => get-template.md} (72%) create mode 100644 docs/examples/functions/list-templates.md create mode 100644 docs/examples/functions/update-deployment-build.md create mode 100644 docs/examples/projects/create-j-w-t.md create mode 100644 docs/examples/projects/update-mock-numbers.md create mode 100644 docs/examples/projects/update-session-alerts.md create mode 100644 docs/examples/users/create-j-w-t.md create mode 100644 docs/examples/vcs/get-repository-contents.md diff --git a/README.md b/README.md index 7d58ced..1949fc5 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # Appwrite Console SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-console.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.5.8-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.6.0-blue.svg?style=flat-square) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) -**This SDK is compatible with Appwrite server version 1.5.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-console/releases).** +**This SDK is compatible with Appwrite server version 1.6.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-console/releases).** Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Console SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) @@ -33,7 +33,7 @@ import { Client, Account } from "@appwrite.io/console"; To install with a CDN (content delivery network) add the following scripts to the bottom of your tag, but before you use any Appwrite services: ```html - + ``` diff --git a/docs/examples/account/create-anonymous-session.md b/docs/examples/account/create-anonymous-session.md index ec4fe10..ff7140d 100644 --- a/docs/examples/account/create-anonymous-session.md +++ b/docs/examples/account/create-anonymous-session.md @@ -8,4 +8,4 @@ const account = new Account(client); const result = await account.createAnonymousSession(); -console.log(response); +console.log(result); diff --git a/docs/examples/account/create-email-password-session.md b/docs/examples/account/create-email-password-session.md index a364384..2019181 100644 --- a/docs/examples/account/create-email-password-session.md +++ b/docs/examples/account/create-email-password-session.md @@ -11,4 +11,4 @@ const result = await account.createEmailPasswordSession( 'password' // password ); -console.log(response); +console.log(result); diff --git a/docs/examples/account/create-email-token.md b/docs/examples/account/create-email-token.md index 4dc8080..1ebc5b9 100644 --- a/docs/examples/account/create-email-token.md +++ b/docs/examples/account/create-email-token.md @@ -12,4 +12,4 @@ const result = await account.createEmailToken( false // phrase (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/account/create-j-w-t.md b/docs/examples/account/create-j-w-t.md index 2e1751b..1bb8b1a 100644 --- a/docs/examples/account/create-j-w-t.md +++ b/docs/examples/account/create-j-w-t.md @@ -8,4 +8,4 @@ const account = new Account(client); const result = await account.createJWT(); -console.log(response); +console.log(result); diff --git a/docs/examples/account/create-magic-u-r-l-token.md b/docs/examples/account/create-magic-u-r-l-token.md index e40acd1..2b36a7f 100644 --- a/docs/examples/account/create-magic-u-r-l-token.md +++ b/docs/examples/account/create-magic-u-r-l-token.md @@ -13,4 +13,4 @@ const result = await account.createMagicURLToken( false // phrase (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/account/create-mfa-authenticator.md b/docs/examples/account/create-mfa-authenticator.md index 02f9c6b..840eb77 100644 --- a/docs/examples/account/create-mfa-authenticator.md +++ b/docs/examples/account/create-mfa-authenticator.md @@ -10,4 +10,4 @@ const result = await account.createMfaAuthenticator( AuthenticatorType.Totp // type ); -console.log(response); +console.log(result); diff --git a/docs/examples/account/create-mfa-challenge.md b/docs/examples/account/create-mfa-challenge.md index b97c649..8057cf3 100644 --- a/docs/examples/account/create-mfa-challenge.md +++ b/docs/examples/account/create-mfa-challenge.md @@ -10,4 +10,4 @@ const result = await account.createMfaChallenge( AuthenticationFactor.Email // factor ); -console.log(response); +console.log(result); diff --git a/docs/examples/account/create-mfa-recovery-codes.md b/docs/examples/account/create-mfa-recovery-codes.md index e220852..3415457 100644 --- a/docs/examples/account/create-mfa-recovery-codes.md +++ b/docs/examples/account/create-mfa-recovery-codes.md @@ -8,4 +8,4 @@ const account = new Account(client); const result = await account.createMfaRecoveryCodes(); -console.log(response); +console.log(result); diff --git a/docs/examples/account/create-phone-token.md b/docs/examples/account/create-phone-token.md index 2c28644..349dd72 100644 --- a/docs/examples/account/create-phone-token.md +++ b/docs/examples/account/create-phone-token.md @@ -11,4 +11,4 @@ const result = await account.createPhoneToken( '+12065550100' // phone ); -console.log(response); +console.log(result); diff --git a/docs/examples/account/create-phone-verification.md b/docs/examples/account/create-phone-verification.md index d76b2b7..bdd569d 100644 --- a/docs/examples/account/create-phone-verification.md +++ b/docs/examples/account/create-phone-verification.md @@ -8,4 +8,4 @@ const account = new Account(client); const result = await account.createPhoneVerification(); -console.log(response); +console.log(result); diff --git a/docs/examples/account/create-push-target.md b/docs/examples/account/create-push-target.md index 0cae647..e5f2445 100644 --- a/docs/examples/account/create-push-target.md +++ b/docs/examples/account/create-push-target.md @@ -12,4 +12,4 @@ const result = await account.createPushTarget( '' // providerId (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/account/create-recovery.md b/docs/examples/account/create-recovery.md index c411e80..69233b2 100644 --- a/docs/examples/account/create-recovery.md +++ b/docs/examples/account/create-recovery.md @@ -11,4 +11,4 @@ const result = await account.createRecovery( 'https://example.com' // url ); -console.log(response); +console.log(result); diff --git a/docs/examples/account/create-session.md b/docs/examples/account/create-session.md index 29b1e19..f155142 100644 --- a/docs/examples/account/create-session.md +++ b/docs/examples/account/create-session.md @@ -11,4 +11,4 @@ const result = await account.createSession( '' // secret ); -console.log(response); +console.log(result); diff --git a/docs/examples/account/create-verification.md b/docs/examples/account/create-verification.md index 3071bd1..57a5a05 100644 --- a/docs/examples/account/create-verification.md +++ b/docs/examples/account/create-verification.md @@ -10,4 +10,4 @@ const result = await account.createVerification( 'https://example.com' // url ); -console.log(response); +console.log(result); diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md index f359211..6f85726 100644 --- a/docs/examples/account/create.md +++ b/docs/examples/account/create.md @@ -13,4 +13,4 @@ const result = await account.create( '' // name (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/account/delete-identity.md b/docs/examples/account/delete-identity.md index 223144c..cbf2b69 100644 --- a/docs/examples/account/delete-identity.md +++ b/docs/examples/account/delete-identity.md @@ -10,4 +10,4 @@ const result = await account.deleteIdentity( '' // identityId ); -console.log(response); +console.log(result); diff --git a/docs/examples/account/delete-mfa-authenticator.md b/docs/examples/account/delete-mfa-authenticator.md index d73d705..6e49272 100644 --- a/docs/examples/account/delete-mfa-authenticator.md +++ b/docs/examples/account/delete-mfa-authenticator.md @@ -7,8 +7,7 @@ const client = new Client() const account = new Account(client); const result = await account.deleteMfaAuthenticator( - AuthenticatorType.Totp, // type - '' // otp + AuthenticatorType.Totp // type ); -console.log(response); +console.log(result); diff --git a/docs/examples/account/delete-push-target.md b/docs/examples/account/delete-push-target.md index aa44caf..07daa33 100644 --- a/docs/examples/account/delete-push-target.md +++ b/docs/examples/account/delete-push-target.md @@ -10,4 +10,4 @@ const result = await account.deletePushTarget( '' // targetId ); -console.log(response); +console.log(result); diff --git a/docs/examples/account/delete-session.md b/docs/examples/account/delete-session.md index 16cd2e7..8d0fcbc 100644 --- a/docs/examples/account/delete-session.md +++ b/docs/examples/account/delete-session.md @@ -10,4 +10,4 @@ const result = await account.deleteSession( '' // sessionId ); -console.log(response); +console.log(result); diff --git a/docs/examples/account/delete-sessions.md b/docs/examples/account/delete-sessions.md index 9f64d87..d075a34 100644 --- a/docs/examples/account/delete-sessions.md +++ b/docs/examples/account/delete-sessions.md @@ -8,4 +8,4 @@ const account = new Account(client); const result = await account.deleteSessions(); -console.log(response); +console.log(result); diff --git a/docs/examples/account/delete.md b/docs/examples/account/delete.md index f76e8e5..ce36229 100644 --- a/docs/examples/account/delete.md +++ b/docs/examples/account/delete.md @@ -8,4 +8,4 @@ const account = new Account(client); const result = await account.delete(); -console.log(response); +console.log(result); diff --git a/docs/examples/account/get-mfa-recovery-codes.md b/docs/examples/account/get-mfa-recovery-codes.md index 455aaf4..0199465 100644 --- a/docs/examples/account/get-mfa-recovery-codes.md +++ b/docs/examples/account/get-mfa-recovery-codes.md @@ -8,4 +8,4 @@ const account = new Account(client); const result = await account.getMfaRecoveryCodes(); -console.log(response); +console.log(result); diff --git a/docs/examples/account/get-prefs.md b/docs/examples/account/get-prefs.md index 54f3d3b..f6f2308 100644 --- a/docs/examples/account/get-prefs.md +++ b/docs/examples/account/get-prefs.md @@ -8,4 +8,4 @@ const account = new Account(client); const result = await account.getPrefs(); -console.log(response); +console.log(result); diff --git a/docs/examples/account/get-session.md b/docs/examples/account/get-session.md index 661b798..ffff775 100644 --- a/docs/examples/account/get-session.md +++ b/docs/examples/account/get-session.md @@ -10,4 +10,4 @@ const result = await account.getSession( '' // sessionId ); -console.log(response); +console.log(result); diff --git a/docs/examples/account/get.md b/docs/examples/account/get.md index c5d69c2..76b90c1 100644 --- a/docs/examples/account/get.md +++ b/docs/examples/account/get.md @@ -8,4 +8,4 @@ const account = new Account(client); const result = await account.get(); -console.log(response); +console.log(result); diff --git a/docs/examples/account/list-identities.md b/docs/examples/account/list-identities.md index c94685e..0713a8c 100644 --- a/docs/examples/account/list-identities.md +++ b/docs/examples/account/list-identities.md @@ -10,4 +10,4 @@ const result = await account.listIdentities( [] // queries (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/account/list-logs.md b/docs/examples/account/list-logs.md index 1a4bfe7..98dc19b 100644 --- a/docs/examples/account/list-logs.md +++ b/docs/examples/account/list-logs.md @@ -10,4 +10,4 @@ const result = await account.listLogs( [] // queries (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/account/list-mfa-factors.md b/docs/examples/account/list-mfa-factors.md index 871d2ab..338bd35 100644 --- a/docs/examples/account/list-mfa-factors.md +++ b/docs/examples/account/list-mfa-factors.md @@ -8,4 +8,4 @@ const account = new Account(client); const result = await account.listMfaFactors(); -console.log(response); +console.log(result); diff --git a/docs/examples/account/list-sessions.md b/docs/examples/account/list-sessions.md index 7ec5539..587adbd 100644 --- a/docs/examples/account/list-sessions.md +++ b/docs/examples/account/list-sessions.md @@ -8,4 +8,4 @@ const account = new Account(client); const result = await account.listSessions(); -console.log(response); +console.log(result); diff --git a/docs/examples/account/update-email.md b/docs/examples/account/update-email.md index c47022c..5c8450c 100644 --- a/docs/examples/account/update-email.md +++ b/docs/examples/account/update-email.md @@ -11,4 +11,4 @@ const result = await account.updateEmail( 'password' // password ); -console.log(response); +console.log(result); diff --git a/docs/examples/account/update-m-f-a.md b/docs/examples/account/update-m-f-a.md index 001e6f7..7f89c00 100644 --- a/docs/examples/account/update-m-f-a.md +++ b/docs/examples/account/update-m-f-a.md @@ -10,4 +10,4 @@ const result = await account.updateMFA( false // mfa ); -console.log(response); +console.log(result); diff --git a/docs/examples/account/update-magic-u-r-l-session.md b/docs/examples/account/update-magic-u-r-l-session.md index 7f4b824..f850bb3 100644 --- a/docs/examples/account/update-magic-u-r-l-session.md +++ b/docs/examples/account/update-magic-u-r-l-session.md @@ -11,4 +11,4 @@ const result = await account.updateMagicURLSession( '' // secret ); -console.log(response); +console.log(result); diff --git a/docs/examples/account/update-mfa-authenticator.md b/docs/examples/account/update-mfa-authenticator.md index 4b584fa..1e260be 100644 --- a/docs/examples/account/update-mfa-authenticator.md +++ b/docs/examples/account/update-mfa-authenticator.md @@ -11,4 +11,4 @@ const result = await account.updateMfaAuthenticator( '' // otp ); -console.log(response); +console.log(result); diff --git a/docs/examples/account/update-mfa-challenge.md b/docs/examples/account/update-mfa-challenge.md index 217f167..b3e444f 100644 --- a/docs/examples/account/update-mfa-challenge.md +++ b/docs/examples/account/update-mfa-challenge.md @@ -11,4 +11,4 @@ const result = await account.updateMfaChallenge( '' // otp ); -console.log(response); +console.log(result); diff --git a/docs/examples/account/update-mfa-recovery-codes.md b/docs/examples/account/update-mfa-recovery-codes.md index 597ddc3..9910e4c 100644 --- a/docs/examples/account/update-mfa-recovery-codes.md +++ b/docs/examples/account/update-mfa-recovery-codes.md @@ -8,4 +8,4 @@ const account = new Account(client); const result = await account.updateMfaRecoveryCodes(); -console.log(response); +console.log(result); diff --git a/docs/examples/account/update-name.md b/docs/examples/account/update-name.md index 59917e6..ccd224b 100644 --- a/docs/examples/account/update-name.md +++ b/docs/examples/account/update-name.md @@ -10,4 +10,4 @@ const result = await account.updateName( '' // name ); -console.log(response); +console.log(result); diff --git a/docs/examples/account/update-password.md b/docs/examples/account/update-password.md index a2332e7..7e02472 100644 --- a/docs/examples/account/update-password.md +++ b/docs/examples/account/update-password.md @@ -11,4 +11,4 @@ const result = await account.updatePassword( 'password' // oldPassword (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/account/update-phone-session.md b/docs/examples/account/update-phone-session.md index 85bf50e..12822cc 100644 --- a/docs/examples/account/update-phone-session.md +++ b/docs/examples/account/update-phone-session.md @@ -11,4 +11,4 @@ const result = await account.updatePhoneSession( '' // secret ); -console.log(response); +console.log(result); diff --git a/docs/examples/account/update-phone-verification.md b/docs/examples/account/update-phone-verification.md index b72260f..a5094c0 100644 --- a/docs/examples/account/update-phone-verification.md +++ b/docs/examples/account/update-phone-verification.md @@ -11,4 +11,4 @@ const result = await account.updatePhoneVerification( '' // secret ); -console.log(response); +console.log(result); diff --git a/docs/examples/account/update-phone.md b/docs/examples/account/update-phone.md index 3e2421b..82acb97 100644 --- a/docs/examples/account/update-phone.md +++ b/docs/examples/account/update-phone.md @@ -11,4 +11,4 @@ const result = await account.updatePhone( 'password' // password ); -console.log(response); +console.log(result); diff --git a/docs/examples/account/update-prefs.md b/docs/examples/account/update-prefs.md index 054aa7e..5793528 100644 --- a/docs/examples/account/update-prefs.md +++ b/docs/examples/account/update-prefs.md @@ -10,4 +10,4 @@ const result = await account.updatePrefs( {} // prefs ); -console.log(response); +console.log(result); diff --git a/docs/examples/account/update-push-target.md b/docs/examples/account/update-push-target.md index 5178052..53d02ea 100644 --- a/docs/examples/account/update-push-target.md +++ b/docs/examples/account/update-push-target.md @@ -11,4 +11,4 @@ const result = await account.updatePushTarget( '' // identifier ); -console.log(response); +console.log(result); diff --git a/docs/examples/account/update-recovery.md b/docs/examples/account/update-recovery.md index d2ed14e..fd8de0f 100644 --- a/docs/examples/account/update-recovery.md +++ b/docs/examples/account/update-recovery.md @@ -12,4 +12,4 @@ const result = await account.updateRecovery( '' // password ); -console.log(response); +console.log(result); diff --git a/docs/examples/account/update-session.md b/docs/examples/account/update-session.md index 20ceeb7..c66b40d 100644 --- a/docs/examples/account/update-session.md +++ b/docs/examples/account/update-session.md @@ -10,4 +10,4 @@ const result = await account.updateSession( '' // sessionId ); -console.log(response); +console.log(result); diff --git a/docs/examples/account/update-status.md b/docs/examples/account/update-status.md index 3e1a532..87f315a 100644 --- a/docs/examples/account/update-status.md +++ b/docs/examples/account/update-status.md @@ -8,4 +8,4 @@ const account = new Account(client); const result = await account.updateStatus(); -console.log(response); +console.log(result); diff --git a/docs/examples/account/update-verification.md b/docs/examples/account/update-verification.md index d3b0426..32e6301 100644 --- a/docs/examples/account/update-verification.md +++ b/docs/examples/account/update-verification.md @@ -11,4 +11,4 @@ const result = await account.updateVerification( '' // secret ); -console.log(response); +console.log(result); diff --git a/docs/examples/assistant/chat.md b/docs/examples/assistant/chat.md index 8c47108..884adbb 100644 --- a/docs/examples/assistant/chat.md +++ b/docs/examples/assistant/chat.md @@ -10,4 +10,4 @@ const result = await assistant.chat( '' // prompt ); -console.log(response); +console.log(result); diff --git a/docs/examples/console/variables.md b/docs/examples/console/variables.md index 8d4e298..2245d4a 100644 --- a/docs/examples/console/variables.md +++ b/docs/examples/console/variables.md @@ -8,4 +8,4 @@ const console = new Console(client); const result = await console.variables(); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/create-boolean-attribute.md b/docs/examples/databases/create-boolean-attribute.md index b070039..444f58a 100644 --- a/docs/examples/databases/create-boolean-attribute.md +++ b/docs/examples/databases/create-boolean-attribute.md @@ -15,4 +15,4 @@ const result = await databases.createBooleanAttribute( false // array (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/create-collection.md b/docs/examples/databases/create-collection.md index 8f5ab24..2941ccf 100644 --- a/docs/examples/databases/create-collection.md +++ b/docs/examples/databases/create-collection.md @@ -15,4 +15,4 @@ const result = await databases.createCollection( false // enabled (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/create-datetime-attribute.md b/docs/examples/databases/create-datetime-attribute.md index 9dc4d41..0168865 100644 --- a/docs/examples/databases/create-datetime-attribute.md +++ b/docs/examples/databases/create-datetime-attribute.md @@ -15,4 +15,4 @@ const result = await databases.createDatetimeAttribute( false // array (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index 11f3bfd..380f337 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -14,4 +14,4 @@ const result = await databases.createDocument( ["read("any")"] // permissions (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/create-email-attribute.md b/docs/examples/databases/create-email-attribute.md index bd93e73..fd7aff8 100644 --- a/docs/examples/databases/create-email-attribute.md +++ b/docs/examples/databases/create-email-attribute.md @@ -15,4 +15,4 @@ const result = await databases.createEmailAttribute( false // array (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/create-enum-attribute.md b/docs/examples/databases/create-enum-attribute.md index 82aeb68..4052f34 100644 --- a/docs/examples/databases/create-enum-attribute.md +++ b/docs/examples/databases/create-enum-attribute.md @@ -16,4 +16,4 @@ const result = await databases.createEnumAttribute( false // array (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/create-float-attribute.md b/docs/examples/databases/create-float-attribute.md index 5755837..aaedd21 100644 --- a/docs/examples/databases/create-float-attribute.md +++ b/docs/examples/databases/create-float-attribute.md @@ -17,4 +17,4 @@ const result = await databases.createFloatAttribute( false // array (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/create-index.md b/docs/examples/databases/create-index.md index f5c94d5..4203e41 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -15,4 +15,4 @@ const result = await databases.createIndex( [] // orders (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/create-integer-attribute.md b/docs/examples/databases/create-integer-attribute.md index 637e194..6546c5d 100644 --- a/docs/examples/databases/create-integer-attribute.md +++ b/docs/examples/databases/create-integer-attribute.md @@ -17,4 +17,4 @@ const result = await databases.createIntegerAttribute( false // array (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/create-ip-attribute.md b/docs/examples/databases/create-ip-attribute.md index 1617d8e..c4995df 100644 --- a/docs/examples/databases/create-ip-attribute.md +++ b/docs/examples/databases/create-ip-attribute.md @@ -15,4 +15,4 @@ const result = await databases.createIpAttribute( false // array (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/create-relationship-attribute.md b/docs/examples/databases/create-relationship-attribute.md index 925fb65..17efcd0 100644 --- a/docs/examples/databases/create-relationship-attribute.md +++ b/docs/examples/databases/create-relationship-attribute.md @@ -17,4 +17,4 @@ const result = await databases.createRelationshipAttribute( RelationMutate.Cascade // onDelete (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/create-string-attribute.md b/docs/examples/databases/create-string-attribute.md index 614ac8f..81953eb 100644 --- a/docs/examples/databases/create-string-attribute.md +++ b/docs/examples/databases/create-string-attribute.md @@ -17,4 +17,4 @@ const result = await databases.createStringAttribute( false // encrypt (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/create-url-attribute.md b/docs/examples/databases/create-url-attribute.md index db36663..1a26d92 100644 --- a/docs/examples/databases/create-url-attribute.md +++ b/docs/examples/databases/create-url-attribute.md @@ -15,4 +15,4 @@ const result = await databases.createUrlAttribute( false // array (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/create.md b/docs/examples/databases/create.md index 0873418..c37cb14 100644 --- a/docs/examples/databases/create.md +++ b/docs/examples/databases/create.md @@ -12,4 +12,4 @@ const result = await databases.create( false // enabled (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/delete-attribute.md b/docs/examples/databases/delete-attribute.md index 76b157e..06861f9 100644 --- a/docs/examples/databases/delete-attribute.md +++ b/docs/examples/databases/delete-attribute.md @@ -12,4 +12,4 @@ const result = await databases.deleteAttribute( '' // key ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/delete-collection.md b/docs/examples/databases/delete-collection.md index b92d6a1..03253c5 100644 --- a/docs/examples/databases/delete-collection.md +++ b/docs/examples/databases/delete-collection.md @@ -11,4 +11,4 @@ const result = await databases.deleteCollection( '' // collectionId ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/delete-document.md b/docs/examples/databases/delete-document.md index 7a7789c..cf334da 100644 --- a/docs/examples/databases/delete-document.md +++ b/docs/examples/databases/delete-document.md @@ -12,4 +12,4 @@ const result = await databases.deleteDocument( '' // documentId ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/delete-index.md b/docs/examples/databases/delete-index.md index de9d1b3..e9bd792 100644 --- a/docs/examples/databases/delete-index.md +++ b/docs/examples/databases/delete-index.md @@ -12,4 +12,4 @@ const result = await databases.deleteIndex( '' // key ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/delete.md b/docs/examples/databases/delete.md index 237cbd9..8c2e45e 100644 --- a/docs/examples/databases/delete.md +++ b/docs/examples/databases/delete.md @@ -10,4 +10,4 @@ const result = await databases.delete( '' // databaseId ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/get-attribute.md b/docs/examples/databases/get-attribute.md index 73c91d6..ca8286c 100644 --- a/docs/examples/databases/get-attribute.md +++ b/docs/examples/databases/get-attribute.md @@ -12,4 +12,4 @@ const result = await databases.getAttribute( '' // key ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/get-collection-usage.md b/docs/examples/databases/get-collection-usage.md index ce409da..c65a2f5 100644 --- a/docs/examples/databases/get-collection-usage.md +++ b/docs/examples/databases/get-collection-usage.md @@ -12,4 +12,4 @@ const result = await databases.getCollectionUsage( DatabaseUsageRange.TwentyFourHours // range (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/get-collection.md b/docs/examples/databases/get-collection.md index e89863b..53d6e19 100644 --- a/docs/examples/databases/get-collection.md +++ b/docs/examples/databases/get-collection.md @@ -11,4 +11,4 @@ const result = await databases.getCollection( '' // collectionId ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/get-database-usage.md b/docs/examples/databases/get-database-usage.md index 14a4bd4..71dc197 100644 --- a/docs/examples/databases/get-database-usage.md +++ b/docs/examples/databases/get-database-usage.md @@ -11,4 +11,4 @@ const result = await databases.getDatabaseUsage( DatabaseUsageRange.TwentyFourHours // range (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/get-document.md b/docs/examples/databases/get-document.md index 83f832a..a19ffb9 100644 --- a/docs/examples/databases/get-document.md +++ b/docs/examples/databases/get-document.md @@ -13,4 +13,4 @@ const result = await databases.getDocument( [] // queries (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/get-index.md b/docs/examples/databases/get-index.md index 5fe73a5..733d226 100644 --- a/docs/examples/databases/get-index.md +++ b/docs/examples/databases/get-index.md @@ -12,4 +12,4 @@ const result = await databases.getIndex( '' // key ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/get-usage.md b/docs/examples/databases/get-usage.md index 40382b3..d8262c5 100644 --- a/docs/examples/databases/get-usage.md +++ b/docs/examples/databases/get-usage.md @@ -10,4 +10,4 @@ const result = await databases.getUsage( DatabaseUsageRange.TwentyFourHours // range (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/get.md b/docs/examples/databases/get.md index cd04ed9..2d71055 100644 --- a/docs/examples/databases/get.md +++ b/docs/examples/databases/get.md @@ -10,4 +10,4 @@ const result = await databases.get( '' // databaseId ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/list-attributes.md b/docs/examples/databases/list-attributes.md index eecb6a2..e39b486 100644 --- a/docs/examples/databases/list-attributes.md +++ b/docs/examples/databases/list-attributes.md @@ -12,4 +12,4 @@ const result = await databases.listAttributes( [] // queries (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/list-collection-logs.md b/docs/examples/databases/list-collection-logs.md index 850c443..e928ce5 100644 --- a/docs/examples/databases/list-collection-logs.md +++ b/docs/examples/databases/list-collection-logs.md @@ -12,4 +12,4 @@ const result = await databases.listCollectionLogs( [] // queries (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/list-collections.md b/docs/examples/databases/list-collections.md index 891c7c7..1eb7c38 100644 --- a/docs/examples/databases/list-collections.md +++ b/docs/examples/databases/list-collections.md @@ -12,4 +12,4 @@ const result = await databases.listCollections( '' // search (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/list-document-logs.md b/docs/examples/databases/list-document-logs.md index 0fa86b4..89d20b0 100644 --- a/docs/examples/databases/list-document-logs.md +++ b/docs/examples/databases/list-document-logs.md @@ -13,4 +13,4 @@ const result = await databases.listDocumentLogs( [] // queries (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/list-documents.md b/docs/examples/databases/list-documents.md index 1918bad..7dda31e 100644 --- a/docs/examples/databases/list-documents.md +++ b/docs/examples/databases/list-documents.md @@ -12,4 +12,4 @@ const result = await databases.listDocuments( [] // queries (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/list-indexes.md b/docs/examples/databases/list-indexes.md index 6e308a8..2b231a7 100644 --- a/docs/examples/databases/list-indexes.md +++ b/docs/examples/databases/list-indexes.md @@ -12,4 +12,4 @@ const result = await databases.listIndexes( [] // queries (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/list-logs.md b/docs/examples/databases/list-logs.md index a28ba46..27e8eee 100644 --- a/docs/examples/databases/list-logs.md +++ b/docs/examples/databases/list-logs.md @@ -11,4 +11,4 @@ const result = await databases.listLogs( [] // queries (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/list.md b/docs/examples/databases/list.md index 75a5c46..fcf0c8c 100644 --- a/docs/examples/databases/list.md +++ b/docs/examples/databases/list.md @@ -11,4 +11,4 @@ const result = await databases.list( '' // search (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/update-boolean-attribute.md b/docs/examples/databases/update-boolean-attribute.md index 2abf121..80dbd50 100644 --- a/docs/examples/databases/update-boolean-attribute.md +++ b/docs/examples/databases/update-boolean-attribute.md @@ -14,4 +14,4 @@ const result = await databases.updateBooleanAttribute( false // default ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/update-collection.md b/docs/examples/databases/update-collection.md index 3bce3a5..d2537ed 100644 --- a/docs/examples/databases/update-collection.md +++ b/docs/examples/databases/update-collection.md @@ -15,4 +15,4 @@ const result = await databases.updateCollection( false // enabled (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/update-datetime-attribute.md b/docs/examples/databases/update-datetime-attribute.md index 3152f6b..e429303 100644 --- a/docs/examples/databases/update-datetime-attribute.md +++ b/docs/examples/databases/update-datetime-attribute.md @@ -14,4 +14,4 @@ const result = await databases.updateDatetimeAttribute( '' // default ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/update-document.md b/docs/examples/databases/update-document.md index bfc7df6..440f29f 100644 --- a/docs/examples/databases/update-document.md +++ b/docs/examples/databases/update-document.md @@ -14,4 +14,4 @@ const result = await databases.updateDocument( ["read("any")"] // permissions (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/update-email-attribute.md b/docs/examples/databases/update-email-attribute.md index eaa6338..a9fd86e 100644 --- a/docs/examples/databases/update-email-attribute.md +++ b/docs/examples/databases/update-email-attribute.md @@ -14,4 +14,4 @@ const result = await databases.updateEmailAttribute( 'email@example.com' // default ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/update-enum-attribute.md b/docs/examples/databases/update-enum-attribute.md index b579869..04dc791 100644 --- a/docs/examples/databases/update-enum-attribute.md +++ b/docs/examples/databases/update-enum-attribute.md @@ -15,4 +15,4 @@ const result = await databases.updateEnumAttribute( '' // default ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/update-float-attribute.md b/docs/examples/databases/update-float-attribute.md index 16cca26..88506bc 100644 --- a/docs/examples/databases/update-float-attribute.md +++ b/docs/examples/databases/update-float-attribute.md @@ -16,4 +16,4 @@ const result = await databases.updateFloatAttribute( null // default ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/update-integer-attribute.md b/docs/examples/databases/update-integer-attribute.md index 97bf6a9..cdafd12 100644 --- a/docs/examples/databases/update-integer-attribute.md +++ b/docs/examples/databases/update-integer-attribute.md @@ -16,4 +16,4 @@ const result = await databases.updateIntegerAttribute( null // default ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/update-ip-attribute.md b/docs/examples/databases/update-ip-attribute.md index 0f3c511..f1cf749 100644 --- a/docs/examples/databases/update-ip-attribute.md +++ b/docs/examples/databases/update-ip-attribute.md @@ -14,4 +14,4 @@ const result = await databases.updateIpAttribute( '' // default ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/update-relationship-attribute.md b/docs/examples/databases/update-relationship-attribute.md index 205aeba..ceb5ebf 100644 --- a/docs/examples/databases/update-relationship-attribute.md +++ b/docs/examples/databases/update-relationship-attribute.md @@ -13,4 +13,4 @@ const result = await databases.updateRelationshipAttribute( RelationMutate.Cascade // onDelete (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/update-string-attribute.md b/docs/examples/databases/update-string-attribute.md index 763b6d5..765f2f3 100644 --- a/docs/examples/databases/update-string-attribute.md +++ b/docs/examples/databases/update-string-attribute.md @@ -14,4 +14,4 @@ const result = await databases.updateStringAttribute( '' // default ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/update-url-attribute.md b/docs/examples/databases/update-url-attribute.md index ca89f96..a4ab424 100644 --- a/docs/examples/databases/update-url-attribute.md +++ b/docs/examples/databases/update-url-attribute.md @@ -14,4 +14,4 @@ const result = await databases.updateUrlAttribute( 'https://example.com' // default ); -console.log(response); +console.log(result); diff --git a/docs/examples/databases/update.md b/docs/examples/databases/update.md index fa87d14..7fc7147 100644 --- a/docs/examples/databases/update.md +++ b/docs/examples/databases/update.md @@ -12,4 +12,4 @@ const result = await databases.update( false // enabled (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/functions/create-build.md b/docs/examples/functions/create-build.md index ddaeef2..a46bc37 100644 --- a/docs/examples/functions/create-build.md +++ b/docs/examples/functions/create-build.md @@ -9,7 +9,7 @@ const functions = new Functions(client); const result = await functions.createBuild( '', // functionId '', // deploymentId - '' // buildId + '' // buildId (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/functions/create-deployment.md b/docs/examples/functions/create-deployment.md index 2617615..09fd57d 100644 --- a/docs/examples/functions/create-deployment.md +++ b/docs/examples/functions/create-deployment.md @@ -14,4 +14,4 @@ const result = await functions.createDeployment( '' // commands (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index cce7887..dfd9626 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -12,7 +12,8 @@ const result = await functions.createExecution( false, // async (optional) '', // path (optional) ExecutionMethod.GET, // method (optional) - {} // headers (optional) + {}, // headers (optional) + '' // scheduledAt (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index 16a0474..2343b34 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -12,4 +12,4 @@ const result = await functions.createVariable( '' // value ); -console.log(response); +console.log(result); diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index 722b1ad..0ec5e2e 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -18,6 +18,7 @@ const result = await functions.create( false, // logging (optional) '', // entrypoint (optional) '', // commands (optional) + [], // scopes (optional) '', // installationId (optional) '', // providerRepositoryId (optional) '', // providerBranch (optional) @@ -26,8 +27,7 @@ const result = await functions.create( '', // templateRepository (optional) '', // templateOwner (optional) '', // templateRootDirectory (optional) - '', // templateBranch (optional) - '' // specification (optional) + '' // templateVersion (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/functions/delete-deployment.md b/docs/examples/functions/delete-deployment.md index 8dd7a18..db2aa5c 100644 --- a/docs/examples/functions/delete-deployment.md +++ b/docs/examples/functions/delete-deployment.md @@ -11,4 +11,4 @@ const result = await functions.deleteDeployment( '' // deploymentId ); -console.log(response); +console.log(result); diff --git a/docs/examples/functions/delete-execution.md b/docs/examples/functions/delete-execution.md new file mode 100644 index 0000000..3fdcc87 --- /dev/null +++ b/docs/examples/functions/delete-execution.md @@ -0,0 +1,14 @@ +import { Client, Functions } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.deleteExecution( + '', // functionId + '' // executionId +); + +console.log(result); diff --git a/docs/examples/functions/delete-variable.md b/docs/examples/functions/delete-variable.md index 71f1d32..2a814a3 100644 --- a/docs/examples/functions/delete-variable.md +++ b/docs/examples/functions/delete-variable.md @@ -11,4 +11,4 @@ const result = await functions.deleteVariable( '' // variableId ); -console.log(response); +console.log(result); diff --git a/docs/examples/functions/delete.md b/docs/examples/functions/delete.md index 9a27e2d..193155b 100644 --- a/docs/examples/functions/delete.md +++ b/docs/examples/functions/delete.md @@ -10,4 +10,4 @@ const result = await functions.delete( '' // functionId ); -console.log(response); +console.log(result); diff --git a/docs/examples/functions/download-deployment.md b/docs/examples/functions/get-deployment-download.md similarity index 88% rename from docs/examples/functions/download-deployment.md rename to docs/examples/functions/get-deployment-download.md index cfcd00b..8324b18 100644 --- a/docs/examples/functions/download-deployment.md +++ b/docs/examples/functions/get-deployment-download.md @@ -6,7 +6,7 @@ const client = new Client() const functions = new Functions(client); -const result = functions.downloadDeployment( +const result = functions.getDeploymentDownload( '', // functionId '' // deploymentId ); diff --git a/docs/examples/functions/get-deployment.md b/docs/examples/functions/get-deployment.md index 468eb70..e329357 100644 --- a/docs/examples/functions/get-deployment.md +++ b/docs/examples/functions/get-deployment.md @@ -11,4 +11,4 @@ const result = await functions.getDeployment( '' // deploymentId ); -console.log(response); +console.log(result); diff --git a/docs/examples/functions/get-execution.md b/docs/examples/functions/get-execution.md index a476780..ea9c9f9 100644 --- a/docs/examples/functions/get-execution.md +++ b/docs/examples/functions/get-execution.md @@ -11,4 +11,4 @@ const result = await functions.getExecution( '' // executionId ); -console.log(response); +console.log(result); diff --git a/docs/examples/functions/get-function-usage.md b/docs/examples/functions/get-function-usage.md index 4a151c1..f6746d6 100644 --- a/docs/examples/functions/get-function-usage.md +++ b/docs/examples/functions/get-function-usage.md @@ -11,4 +11,4 @@ const result = await functions.getFunctionUsage( FunctionUsageRange.TwentyFourHours // range (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/functions/get-specifications.md b/docs/examples/functions/get-template.md similarity index 72% rename from docs/examples/functions/get-specifications.md rename to docs/examples/functions/get-template.md index 20414e9..d837032 100644 --- a/docs/examples/functions/get-specifications.md +++ b/docs/examples/functions/get-template.md @@ -6,6 +6,8 @@ const client = new Client() const functions = new Functions(client); -const result = await functions.getSpecifications(); +const result = await functions.getTemplate( + '' // templateId +); -console.log(response); +console.log(result); diff --git a/docs/examples/functions/get-usage.md b/docs/examples/functions/get-usage.md index a98d074..0efab64 100644 --- a/docs/examples/functions/get-usage.md +++ b/docs/examples/functions/get-usage.md @@ -10,4 +10,4 @@ const result = await functions.getUsage( FunctionUsageRange.TwentyFourHours // range (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/functions/get-variable.md b/docs/examples/functions/get-variable.md index e6a5a88..39fcfe1 100644 --- a/docs/examples/functions/get-variable.md +++ b/docs/examples/functions/get-variable.md @@ -11,4 +11,4 @@ const result = await functions.getVariable( '' // variableId ); -console.log(response); +console.log(result); diff --git a/docs/examples/functions/get.md b/docs/examples/functions/get.md index 12cd21f..7794f78 100644 --- a/docs/examples/functions/get.md +++ b/docs/examples/functions/get.md @@ -10,4 +10,4 @@ const result = await functions.get( '' // functionId ); -console.log(response); +console.log(result); diff --git a/docs/examples/functions/list-deployments.md b/docs/examples/functions/list-deployments.md index 6fb7d98..5f3638e 100644 --- a/docs/examples/functions/list-deployments.md +++ b/docs/examples/functions/list-deployments.md @@ -12,4 +12,4 @@ const result = await functions.listDeployments( '' // search (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md index e2858fd..ceb4b19 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -12,4 +12,4 @@ const result = await functions.listExecutions( '' // search (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/functions/list-runtimes.md b/docs/examples/functions/list-runtimes.md index 7fa0e83..4fa0e60 100644 --- a/docs/examples/functions/list-runtimes.md +++ b/docs/examples/functions/list-runtimes.md @@ -8,4 +8,4 @@ const functions = new Functions(client); const result = await functions.listRuntimes(); -console.log(response); +console.log(result); diff --git a/docs/examples/functions/list-templates.md b/docs/examples/functions/list-templates.md new file mode 100644 index 0000000..b0df525 --- /dev/null +++ b/docs/examples/functions/list-templates.md @@ -0,0 +1,16 @@ +import { Client, Functions } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.listTemplates( + [], // runtimes (optional) + [], // useCases (optional) + 1, // limit (optional) + 0 // offset (optional) +); + +console.log(result); diff --git a/docs/examples/functions/list-variables.md b/docs/examples/functions/list-variables.md index 7163e26..0de9bdb 100644 --- a/docs/examples/functions/list-variables.md +++ b/docs/examples/functions/list-variables.md @@ -10,4 +10,4 @@ const result = await functions.listVariables( '' // functionId ); -console.log(response); +console.log(result); diff --git a/docs/examples/functions/list.md b/docs/examples/functions/list.md index aeeb7c6..aaa8aaf 100644 --- a/docs/examples/functions/list.md +++ b/docs/examples/functions/list.md @@ -11,4 +11,4 @@ const result = await functions.list( '' // search (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/functions/update-deployment-build.md b/docs/examples/functions/update-deployment-build.md new file mode 100644 index 0000000..bdfdb21 --- /dev/null +++ b/docs/examples/functions/update-deployment-build.md @@ -0,0 +1,14 @@ +import { Client, Functions } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const functions = new Functions(client); + +const result = await functions.updateDeploymentBuild( + '', // functionId + '' // deploymentId +); + +console.log(result); diff --git a/docs/examples/functions/update-deployment.md b/docs/examples/functions/update-deployment.md index c17f7a7..b5b3e81 100644 --- a/docs/examples/functions/update-deployment.md +++ b/docs/examples/functions/update-deployment.md @@ -11,4 +11,4 @@ const result = await functions.updateDeployment( '' // deploymentId ); -console.log(response); +console.log(result); diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index cc59432..a4f10df 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -13,4 +13,4 @@ const result = await functions.updateVariable( '' // value (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index ddee824..7296010 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -18,12 +18,12 @@ const result = await functions.update( false, // logging (optional) '', // entrypoint (optional) '', // commands (optional) + [], // scopes (optional) '', // installationId (optional) '', // providerRepositoryId (optional) '', // providerBranch (optional) false, // providerSilentMode (optional) - '', // providerRootDirectory (optional) - '' // specification (optional) + '' // providerRootDirectory (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/graphql/mutation.md b/docs/examples/graphql/mutation.md index 5a6cb2c..bef8ef2 100644 --- a/docs/examples/graphql/mutation.md +++ b/docs/examples/graphql/mutation.md @@ -10,4 +10,4 @@ const result = await graphql.mutation( {} // query ); -console.log(response); +console.log(result); diff --git a/docs/examples/graphql/query.md b/docs/examples/graphql/query.md index c92c636..8aea5b8 100644 --- a/docs/examples/graphql/query.md +++ b/docs/examples/graphql/query.md @@ -10,4 +10,4 @@ const result = await graphql.query( {} // query ); -console.log(response); +console.log(result); diff --git a/docs/examples/health/get-antivirus.md b/docs/examples/health/get-antivirus.md index 6daffff..7638e5a 100644 --- a/docs/examples/health/get-antivirus.md +++ b/docs/examples/health/get-antivirus.md @@ -8,4 +8,4 @@ const health = new Health(client); const result = await health.getAntivirus(); -console.log(response); +console.log(result); diff --git a/docs/examples/health/get-cache.md b/docs/examples/health/get-cache.md index acbf728..f9f4eba 100644 --- a/docs/examples/health/get-cache.md +++ b/docs/examples/health/get-cache.md @@ -8,4 +8,4 @@ const health = new Health(client); const result = await health.getCache(); -console.log(response); +console.log(result); diff --git a/docs/examples/health/get-certificate.md b/docs/examples/health/get-certificate.md index 264e18e..3d17b4d 100644 --- a/docs/examples/health/get-certificate.md +++ b/docs/examples/health/get-certificate.md @@ -10,4 +10,4 @@ const result = await health.getCertificate( '' // domain (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/health/get-d-b.md b/docs/examples/health/get-d-b.md index 12d22d0..3c4928d 100644 --- a/docs/examples/health/get-d-b.md +++ b/docs/examples/health/get-d-b.md @@ -8,4 +8,4 @@ const health = new Health(client); const result = await health.getDB(); -console.log(response); +console.log(result); diff --git a/docs/examples/health/get-failed-jobs.md b/docs/examples/health/get-failed-jobs.md index 4dac04a..6801851 100644 --- a/docs/examples/health/get-failed-jobs.md +++ b/docs/examples/health/get-failed-jobs.md @@ -11,4 +11,4 @@ const result = await health.getFailedJobs( null // threshold (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/health/get-pub-sub.md b/docs/examples/health/get-pub-sub.md index b2e654d..5dab6c8 100644 --- a/docs/examples/health/get-pub-sub.md +++ b/docs/examples/health/get-pub-sub.md @@ -8,4 +8,4 @@ const health = new Health(client); const result = await health.getPubSub(); -console.log(response); +console.log(result); diff --git a/docs/examples/health/get-queue-builds.md b/docs/examples/health/get-queue-builds.md index 5c41eb7..0281fc3 100644 --- a/docs/examples/health/get-queue-builds.md +++ b/docs/examples/health/get-queue-builds.md @@ -10,4 +10,4 @@ const result = await health.getQueueBuilds( null // threshold (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/health/get-queue-certificates.md b/docs/examples/health/get-queue-certificates.md index 744d0c7..5847b33 100644 --- a/docs/examples/health/get-queue-certificates.md +++ b/docs/examples/health/get-queue-certificates.md @@ -10,4 +10,4 @@ const result = await health.getQueueCertificates( null // threshold (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/health/get-queue-databases.md b/docs/examples/health/get-queue-databases.md index d7d5457..c2274cb 100644 --- a/docs/examples/health/get-queue-databases.md +++ b/docs/examples/health/get-queue-databases.md @@ -11,4 +11,4 @@ const result = await health.getQueueDatabases( null // threshold (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/health/get-queue-deletes.md b/docs/examples/health/get-queue-deletes.md index bcb1c95..190e13b 100644 --- a/docs/examples/health/get-queue-deletes.md +++ b/docs/examples/health/get-queue-deletes.md @@ -10,4 +10,4 @@ const result = await health.getQueueDeletes( null // threshold (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/health/get-queue-functions.md b/docs/examples/health/get-queue-functions.md index 92ca143..fd53231 100644 --- a/docs/examples/health/get-queue-functions.md +++ b/docs/examples/health/get-queue-functions.md @@ -10,4 +10,4 @@ const result = await health.getQueueFunctions( null // threshold (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/health/get-queue-logs.md b/docs/examples/health/get-queue-logs.md index e2bfb36..ae1eb17 100644 --- a/docs/examples/health/get-queue-logs.md +++ b/docs/examples/health/get-queue-logs.md @@ -10,4 +10,4 @@ const result = await health.getQueueLogs( null // threshold (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/health/get-queue-mails.md b/docs/examples/health/get-queue-mails.md index 78be0c7..ddd53af 100644 --- a/docs/examples/health/get-queue-mails.md +++ b/docs/examples/health/get-queue-mails.md @@ -10,4 +10,4 @@ const result = await health.getQueueMails( null // threshold (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/health/get-queue-messaging.md b/docs/examples/health/get-queue-messaging.md index 6a5de6a..fc19878 100644 --- a/docs/examples/health/get-queue-messaging.md +++ b/docs/examples/health/get-queue-messaging.md @@ -10,4 +10,4 @@ const result = await health.getQueueMessaging( null // threshold (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/health/get-queue-migrations.md b/docs/examples/health/get-queue-migrations.md index dc18fdf..48f70c2 100644 --- a/docs/examples/health/get-queue-migrations.md +++ b/docs/examples/health/get-queue-migrations.md @@ -10,4 +10,4 @@ const result = await health.getQueueMigrations( null // threshold (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/health/get-queue-usage-dump.md b/docs/examples/health/get-queue-usage-dump.md index 10eed8e..7ce52a6 100644 --- a/docs/examples/health/get-queue-usage-dump.md +++ b/docs/examples/health/get-queue-usage-dump.md @@ -10,4 +10,4 @@ const result = await health.getQueueUsageDump( null // threshold (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/health/get-queue-usage.md b/docs/examples/health/get-queue-usage.md index 155a1b2..2908407 100644 --- a/docs/examples/health/get-queue-usage.md +++ b/docs/examples/health/get-queue-usage.md @@ -10,4 +10,4 @@ const result = await health.getQueueUsage( null // threshold (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/health/get-queue-webhooks.md b/docs/examples/health/get-queue-webhooks.md index b238feb..7ee629e 100644 --- a/docs/examples/health/get-queue-webhooks.md +++ b/docs/examples/health/get-queue-webhooks.md @@ -10,4 +10,4 @@ const result = await health.getQueueWebhooks( null // threshold (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/health/get-queue.md b/docs/examples/health/get-queue.md index f035b83..16bba54 100644 --- a/docs/examples/health/get-queue.md +++ b/docs/examples/health/get-queue.md @@ -8,4 +8,4 @@ const health = new Health(client); const result = await health.getQueue(); -console.log(response); +console.log(result); diff --git a/docs/examples/health/get-storage-local.md b/docs/examples/health/get-storage-local.md index b61b9fb..5c6794a 100644 --- a/docs/examples/health/get-storage-local.md +++ b/docs/examples/health/get-storage-local.md @@ -8,4 +8,4 @@ const health = new Health(client); const result = await health.getStorageLocal(); -console.log(response); +console.log(result); diff --git a/docs/examples/health/get-storage.md b/docs/examples/health/get-storage.md index 354cb4b..c0a2371 100644 --- a/docs/examples/health/get-storage.md +++ b/docs/examples/health/get-storage.md @@ -8,4 +8,4 @@ const health = new Health(client); const result = await health.getStorage(); -console.log(response); +console.log(result); diff --git a/docs/examples/health/get-time.md b/docs/examples/health/get-time.md index f4438e8..c2a504d 100644 --- a/docs/examples/health/get-time.md +++ b/docs/examples/health/get-time.md @@ -8,4 +8,4 @@ const health = new Health(client); const result = await health.getTime(); -console.log(response); +console.log(result); diff --git a/docs/examples/health/get.md b/docs/examples/health/get.md index 5ff8076..d8990c9 100644 --- a/docs/examples/health/get.md +++ b/docs/examples/health/get.md @@ -8,4 +8,4 @@ const health = new Health(client); const result = await health.get(); -console.log(response); +console.log(result); diff --git a/docs/examples/locale/get.md b/docs/examples/locale/get.md index a93eece..825d6af 100644 --- a/docs/examples/locale/get.md +++ b/docs/examples/locale/get.md @@ -8,4 +8,4 @@ const locale = new Locale(client); const result = await locale.get(); -console.log(response); +console.log(result); diff --git a/docs/examples/locale/list-codes.md b/docs/examples/locale/list-codes.md index d2639f6..ef68451 100644 --- a/docs/examples/locale/list-codes.md +++ b/docs/examples/locale/list-codes.md @@ -8,4 +8,4 @@ const locale = new Locale(client); const result = await locale.listCodes(); -console.log(response); +console.log(result); diff --git a/docs/examples/locale/list-continents.md b/docs/examples/locale/list-continents.md index ec9327f..2ddee46 100644 --- a/docs/examples/locale/list-continents.md +++ b/docs/examples/locale/list-continents.md @@ -8,4 +8,4 @@ const locale = new Locale(client); const result = await locale.listContinents(); -console.log(response); +console.log(result); diff --git a/docs/examples/locale/list-countries-e-u.md b/docs/examples/locale/list-countries-e-u.md index 52e14d3..d2da2e1 100644 --- a/docs/examples/locale/list-countries-e-u.md +++ b/docs/examples/locale/list-countries-e-u.md @@ -8,4 +8,4 @@ const locale = new Locale(client); const result = await locale.listCountriesEU(); -console.log(response); +console.log(result); diff --git a/docs/examples/locale/list-countries-phones.md b/docs/examples/locale/list-countries-phones.md index 7cd739d..a0e6841 100644 --- a/docs/examples/locale/list-countries-phones.md +++ b/docs/examples/locale/list-countries-phones.md @@ -8,4 +8,4 @@ const locale = new Locale(client); const result = await locale.listCountriesPhones(); -console.log(response); +console.log(result); diff --git a/docs/examples/locale/list-countries.md b/docs/examples/locale/list-countries.md index 73e6093..19ce337 100644 --- a/docs/examples/locale/list-countries.md +++ b/docs/examples/locale/list-countries.md @@ -8,4 +8,4 @@ const locale = new Locale(client); const result = await locale.listCountries(); -console.log(response); +console.log(result); diff --git a/docs/examples/locale/list-currencies.md b/docs/examples/locale/list-currencies.md index 554513c..1ec368b 100644 --- a/docs/examples/locale/list-currencies.md +++ b/docs/examples/locale/list-currencies.md @@ -8,4 +8,4 @@ const locale = new Locale(client); const result = await locale.listCurrencies(); -console.log(response); +console.log(result); diff --git a/docs/examples/locale/list-languages.md b/docs/examples/locale/list-languages.md index f3f03cf..4a25d3b 100644 --- a/docs/examples/locale/list-languages.md +++ b/docs/examples/locale/list-languages.md @@ -8,4 +8,4 @@ const locale = new Locale(client); const result = await locale.listLanguages(); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/create-apns-provider.md b/docs/examples/messaging/create-apns-provider.md index 60691b2..552b567 100644 --- a/docs/examples/messaging/create-apns-provider.md +++ b/docs/examples/messaging/create-apns-provider.md @@ -17,4 +17,4 @@ const result = await messaging.createApnsProvider( false // enabled (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/create-email.md b/docs/examples/messaging/create-email.md index 057339b..b7c1d08 100644 --- a/docs/examples/messaging/create-email.md +++ b/docs/examples/messaging/create-email.md @@ -21,4 +21,4 @@ const result = await messaging.createEmail( '' // scheduledAt (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/create-fcm-provider.md b/docs/examples/messaging/create-fcm-provider.md index 967e99c..d4b87cf 100644 --- a/docs/examples/messaging/create-fcm-provider.md +++ b/docs/examples/messaging/create-fcm-provider.md @@ -13,4 +13,4 @@ const result = await messaging.createFcmProvider( false // enabled (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/create-mailgun-provider.md b/docs/examples/messaging/create-mailgun-provider.md index f1cf6e2..f2fb484 100644 --- a/docs/examples/messaging/create-mailgun-provider.md +++ b/docs/examples/messaging/create-mailgun-provider.md @@ -19,4 +19,4 @@ const result = await messaging.createMailgunProvider( false // enabled (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/create-msg91provider.md b/docs/examples/messaging/create-msg91provider.md index 2b9b4b4..2d2412a 100644 --- a/docs/examples/messaging/create-msg91provider.md +++ b/docs/examples/messaging/create-msg91provider.md @@ -15,4 +15,4 @@ const result = await messaging.createMsg91Provider( false // enabled (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md index aa4a83c..95e7c7c 100644 --- a/docs/examples/messaging/create-push.md +++ b/docs/examples/messaging/create-push.md @@ -25,4 +25,4 @@ const result = await messaging.createPush( '' // scheduledAt (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/create-sendgrid-provider.md b/docs/examples/messaging/create-sendgrid-provider.md index 465ff14..8c9b870 100644 --- a/docs/examples/messaging/create-sendgrid-provider.md +++ b/docs/examples/messaging/create-sendgrid-provider.md @@ -17,4 +17,4 @@ const result = await messaging.createSendgridProvider( false // enabled (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/create-sms.md b/docs/examples/messaging/create-sms.md index fe474c8..1ceffae 100644 --- a/docs/examples/messaging/create-sms.md +++ b/docs/examples/messaging/create-sms.md @@ -16,4 +16,4 @@ const result = await messaging.createSms( '' // scheduledAt (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/create-smtp-provider.md b/docs/examples/messaging/create-smtp-provider.md index 0c3c74a..2c1ea54 100644 --- a/docs/examples/messaging/create-smtp-provider.md +++ b/docs/examples/messaging/create-smtp-provider.md @@ -23,4 +23,4 @@ const result = await messaging.createSmtpProvider( false // enabled (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/create-subscriber.md b/docs/examples/messaging/create-subscriber.md index 9d14c97..3b0c3f4 100644 --- a/docs/examples/messaging/create-subscriber.md +++ b/docs/examples/messaging/create-subscriber.md @@ -12,4 +12,4 @@ const result = await messaging.createSubscriber( '' // targetId ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/create-telesign-provider.md b/docs/examples/messaging/create-telesign-provider.md index b48b846..a44af4a 100644 --- a/docs/examples/messaging/create-telesign-provider.md +++ b/docs/examples/messaging/create-telesign-provider.md @@ -15,4 +15,4 @@ const result = await messaging.createTelesignProvider( false // enabled (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/create-textmagic-provider.md b/docs/examples/messaging/create-textmagic-provider.md index 53b458d..e60ee10 100644 --- a/docs/examples/messaging/create-textmagic-provider.md +++ b/docs/examples/messaging/create-textmagic-provider.md @@ -15,4 +15,4 @@ const result = await messaging.createTextmagicProvider( false // enabled (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/create-topic.md b/docs/examples/messaging/create-topic.md index c103e0d..88d1382 100644 --- a/docs/examples/messaging/create-topic.md +++ b/docs/examples/messaging/create-topic.md @@ -12,4 +12,4 @@ const result = await messaging.createTopic( ["any"] // subscribe (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/create-twilio-provider.md b/docs/examples/messaging/create-twilio-provider.md index 73f2b69..ca52c4a 100644 --- a/docs/examples/messaging/create-twilio-provider.md +++ b/docs/examples/messaging/create-twilio-provider.md @@ -15,4 +15,4 @@ const result = await messaging.createTwilioProvider( false // enabled (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/create-vonage-provider.md b/docs/examples/messaging/create-vonage-provider.md index 166a5a9..d4af220 100644 --- a/docs/examples/messaging/create-vonage-provider.md +++ b/docs/examples/messaging/create-vonage-provider.md @@ -15,4 +15,4 @@ const result = await messaging.createVonageProvider( false // enabled (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/delete-provider.md b/docs/examples/messaging/delete-provider.md index aff19d2..6e8f14e 100644 --- a/docs/examples/messaging/delete-provider.md +++ b/docs/examples/messaging/delete-provider.md @@ -10,4 +10,4 @@ const result = await messaging.deleteProvider( '' // providerId ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/delete-subscriber.md b/docs/examples/messaging/delete-subscriber.md index be167bb..9cc86f3 100644 --- a/docs/examples/messaging/delete-subscriber.md +++ b/docs/examples/messaging/delete-subscriber.md @@ -11,4 +11,4 @@ const result = await messaging.deleteSubscriber( '' // subscriberId ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/delete-topic.md b/docs/examples/messaging/delete-topic.md index 6d55cbf..9a27f00 100644 --- a/docs/examples/messaging/delete-topic.md +++ b/docs/examples/messaging/delete-topic.md @@ -10,4 +10,4 @@ const result = await messaging.deleteTopic( '' // topicId ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/delete.md b/docs/examples/messaging/delete.md index cae9701..eead43e 100644 --- a/docs/examples/messaging/delete.md +++ b/docs/examples/messaging/delete.md @@ -10,4 +10,4 @@ const result = await messaging.delete( '' // messageId ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/get-message.md b/docs/examples/messaging/get-message.md index 4857198..03e92fb 100644 --- a/docs/examples/messaging/get-message.md +++ b/docs/examples/messaging/get-message.md @@ -10,4 +10,4 @@ const result = await messaging.getMessage( '' // messageId ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/get-provider.md b/docs/examples/messaging/get-provider.md index 0526d2b..942a6da 100644 --- a/docs/examples/messaging/get-provider.md +++ b/docs/examples/messaging/get-provider.md @@ -10,4 +10,4 @@ const result = await messaging.getProvider( '' // providerId ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/get-subscriber.md b/docs/examples/messaging/get-subscriber.md index e43eba9..fa68a05 100644 --- a/docs/examples/messaging/get-subscriber.md +++ b/docs/examples/messaging/get-subscriber.md @@ -11,4 +11,4 @@ const result = await messaging.getSubscriber( '' // subscriberId ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/get-topic.md b/docs/examples/messaging/get-topic.md index f8afb4c..e9c5133 100644 --- a/docs/examples/messaging/get-topic.md +++ b/docs/examples/messaging/get-topic.md @@ -10,4 +10,4 @@ const result = await messaging.getTopic( '' // topicId ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/list-message-logs.md b/docs/examples/messaging/list-message-logs.md index b8e5c50..27471c6 100644 --- a/docs/examples/messaging/list-message-logs.md +++ b/docs/examples/messaging/list-message-logs.md @@ -11,4 +11,4 @@ const result = await messaging.listMessageLogs( [] // queries (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/list-messages.md b/docs/examples/messaging/list-messages.md index 6311c77..9e27d9f 100644 --- a/docs/examples/messaging/list-messages.md +++ b/docs/examples/messaging/list-messages.md @@ -11,4 +11,4 @@ const result = await messaging.listMessages( '' // search (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/list-provider-logs.md b/docs/examples/messaging/list-provider-logs.md index 91458fa..94625b8 100644 --- a/docs/examples/messaging/list-provider-logs.md +++ b/docs/examples/messaging/list-provider-logs.md @@ -11,4 +11,4 @@ const result = await messaging.listProviderLogs( [] // queries (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/list-providers.md b/docs/examples/messaging/list-providers.md index 026218d..d3d82ff 100644 --- a/docs/examples/messaging/list-providers.md +++ b/docs/examples/messaging/list-providers.md @@ -11,4 +11,4 @@ const result = await messaging.listProviders( '' // search (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/list-subscriber-logs.md b/docs/examples/messaging/list-subscriber-logs.md index f22a2d7..677b137 100644 --- a/docs/examples/messaging/list-subscriber-logs.md +++ b/docs/examples/messaging/list-subscriber-logs.md @@ -11,4 +11,4 @@ const result = await messaging.listSubscriberLogs( [] // queries (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/list-subscribers.md b/docs/examples/messaging/list-subscribers.md index 1ca77b3..51f8e6f 100644 --- a/docs/examples/messaging/list-subscribers.md +++ b/docs/examples/messaging/list-subscribers.md @@ -12,4 +12,4 @@ const result = await messaging.listSubscribers( '' // search (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/list-targets.md b/docs/examples/messaging/list-targets.md index a213207..10a8b22 100644 --- a/docs/examples/messaging/list-targets.md +++ b/docs/examples/messaging/list-targets.md @@ -11,4 +11,4 @@ const result = await messaging.listTargets( [] // queries (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/list-topic-logs.md b/docs/examples/messaging/list-topic-logs.md index 44f8922..7631727 100644 --- a/docs/examples/messaging/list-topic-logs.md +++ b/docs/examples/messaging/list-topic-logs.md @@ -11,4 +11,4 @@ const result = await messaging.listTopicLogs( [] // queries (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/list-topics.md b/docs/examples/messaging/list-topics.md index d2941d6..708a3f5 100644 --- a/docs/examples/messaging/list-topics.md +++ b/docs/examples/messaging/list-topics.md @@ -11,4 +11,4 @@ const result = await messaging.listTopics( '' // search (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/update-apns-provider.md b/docs/examples/messaging/update-apns-provider.md index 837b51f..891e1b8 100644 --- a/docs/examples/messaging/update-apns-provider.md +++ b/docs/examples/messaging/update-apns-provider.md @@ -17,4 +17,4 @@ const result = await messaging.updateApnsProvider( false // sandbox (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/update-email.md b/docs/examples/messaging/update-email.md index 2c2dec4..03ad05f 100644 --- a/docs/examples/messaging/update-email.md +++ b/docs/examples/messaging/update-email.md @@ -21,4 +21,4 @@ const result = await messaging.updateEmail( [] // attachments (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/update-fcm-provider.md b/docs/examples/messaging/update-fcm-provider.md index 6b56f59..2774986 100644 --- a/docs/examples/messaging/update-fcm-provider.md +++ b/docs/examples/messaging/update-fcm-provider.md @@ -13,4 +13,4 @@ const result = await messaging.updateFcmProvider( {} // serviceAccountJSON (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/update-mailgun-provider.md b/docs/examples/messaging/update-mailgun-provider.md index 2bf2ca6..2fb1d66 100644 --- a/docs/examples/messaging/update-mailgun-provider.md +++ b/docs/examples/messaging/update-mailgun-provider.md @@ -19,4 +19,4 @@ const result = await messaging.updateMailgunProvider( '' // replyToEmail (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/update-msg91provider.md b/docs/examples/messaging/update-msg91provider.md index f5ded13..124f333 100644 --- a/docs/examples/messaging/update-msg91provider.md +++ b/docs/examples/messaging/update-msg91provider.md @@ -15,4 +15,4 @@ const result = await messaging.updateMsg91Provider( '' // authKey (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md index ac26d8b..d8e3d97 100644 --- a/docs/examples/messaging/update-push.md +++ b/docs/examples/messaging/update-push.md @@ -25,4 +25,4 @@ const result = await messaging.updatePush( '' // scheduledAt (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/update-sendgrid-provider.md b/docs/examples/messaging/update-sendgrid-provider.md index 3d38971..699c4ce 100644 --- a/docs/examples/messaging/update-sendgrid-provider.md +++ b/docs/examples/messaging/update-sendgrid-provider.md @@ -17,4 +17,4 @@ const result = await messaging.updateSendgridProvider( '' // replyToEmail (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/update-sms.md b/docs/examples/messaging/update-sms.md index b14182c..485b55f 100644 --- a/docs/examples/messaging/update-sms.md +++ b/docs/examples/messaging/update-sms.md @@ -16,4 +16,4 @@ const result = await messaging.updateSms( '' // scheduledAt (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/update-smtp-provider.md b/docs/examples/messaging/update-smtp-provider.md index e848e8d..dbba6d0 100644 --- a/docs/examples/messaging/update-smtp-provider.md +++ b/docs/examples/messaging/update-smtp-provider.md @@ -23,4 +23,4 @@ const result = await messaging.updateSmtpProvider( false // enabled (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/update-telesign-provider.md b/docs/examples/messaging/update-telesign-provider.md index e4e63cc..8e246de 100644 --- a/docs/examples/messaging/update-telesign-provider.md +++ b/docs/examples/messaging/update-telesign-provider.md @@ -15,4 +15,4 @@ const result = await messaging.updateTelesignProvider( '' // from (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/update-textmagic-provider.md b/docs/examples/messaging/update-textmagic-provider.md index b15bc19..2e7f0e9 100644 --- a/docs/examples/messaging/update-textmagic-provider.md +++ b/docs/examples/messaging/update-textmagic-provider.md @@ -15,4 +15,4 @@ const result = await messaging.updateTextmagicProvider( '' // from (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/update-topic.md b/docs/examples/messaging/update-topic.md index 646484e..22cee4d 100644 --- a/docs/examples/messaging/update-topic.md +++ b/docs/examples/messaging/update-topic.md @@ -12,4 +12,4 @@ const result = await messaging.updateTopic( ["any"] // subscribe (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/update-twilio-provider.md b/docs/examples/messaging/update-twilio-provider.md index 9cf45ea..b839391 100644 --- a/docs/examples/messaging/update-twilio-provider.md +++ b/docs/examples/messaging/update-twilio-provider.md @@ -15,4 +15,4 @@ const result = await messaging.updateTwilioProvider( '' // from (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/messaging/update-vonage-provider.md b/docs/examples/messaging/update-vonage-provider.md index d565495..8ddd447 100644 --- a/docs/examples/messaging/update-vonage-provider.md +++ b/docs/examples/messaging/update-vonage-provider.md @@ -15,4 +15,4 @@ const result = await messaging.updateVonageProvider( '' // from (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/migrations/create-appwrite-migration.md b/docs/examples/migrations/create-appwrite-migration.md index f35317c..bfffc7f 100644 --- a/docs/examples/migrations/create-appwrite-migration.md +++ b/docs/examples/migrations/create-appwrite-migration.md @@ -13,4 +13,4 @@ const result = await migrations.createAppwriteMigration( '' // apiKey ); -console.log(response); +console.log(result); diff --git a/docs/examples/migrations/create-firebase-migration.md b/docs/examples/migrations/create-firebase-migration.md index af85183..d273eb6 100644 --- a/docs/examples/migrations/create-firebase-migration.md +++ b/docs/examples/migrations/create-firebase-migration.md @@ -11,4 +11,4 @@ const result = await migrations.createFirebaseMigration( '' // serviceAccount ); -console.log(response); +console.log(result); diff --git a/docs/examples/migrations/create-firebase-o-auth-migration.md b/docs/examples/migrations/create-firebase-o-auth-migration.md index 46f66df..e8a4bc1 100644 --- a/docs/examples/migrations/create-firebase-o-auth-migration.md +++ b/docs/examples/migrations/create-firebase-o-auth-migration.md @@ -11,4 +11,4 @@ const result = await migrations.createFirebaseOAuthMigration( '' // projectId ); -console.log(response); +console.log(result); diff --git a/docs/examples/migrations/create-n-host-migration.md b/docs/examples/migrations/create-n-host-migration.md index 23dd906..e002c67 100644 --- a/docs/examples/migrations/create-n-host-migration.md +++ b/docs/examples/migrations/create-n-host-migration.md @@ -17,4 +17,4 @@ const result = await migrations.createNHostMigration( null // port (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/migrations/create-supabase-migration.md b/docs/examples/migrations/create-supabase-migration.md index 180a884..5fd36ca 100644 --- a/docs/examples/migrations/create-supabase-migration.md +++ b/docs/examples/migrations/create-supabase-migration.md @@ -16,4 +16,4 @@ const result = await migrations.createSupabaseMigration( null // port (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/migrations/delete-firebase-auth.md b/docs/examples/migrations/delete-firebase-auth.md index a3766f1..18b5321 100644 --- a/docs/examples/migrations/delete-firebase-auth.md +++ b/docs/examples/migrations/delete-firebase-auth.md @@ -8,4 +8,4 @@ const migrations = new Migrations(client); const result = await migrations.deleteFirebaseAuth(); -console.log(response); +console.log(result); diff --git a/docs/examples/migrations/delete.md b/docs/examples/migrations/delete.md index 1ba4d38..d86a349 100644 --- a/docs/examples/migrations/delete.md +++ b/docs/examples/migrations/delete.md @@ -10,4 +10,4 @@ const result = await migrations.delete( '' // migrationId ); -console.log(response); +console.log(result); diff --git a/docs/examples/migrations/get-appwrite-report.md b/docs/examples/migrations/get-appwrite-report.md index 4e3a0bb..d2c96b6 100644 --- a/docs/examples/migrations/get-appwrite-report.md +++ b/docs/examples/migrations/get-appwrite-report.md @@ -13,4 +13,4 @@ const result = await migrations.getAppwriteReport( '' // key ); -console.log(response); +console.log(result); diff --git a/docs/examples/migrations/get-firebase-report-o-auth.md b/docs/examples/migrations/get-firebase-report-o-auth.md index 302f5bf..155f495 100644 --- a/docs/examples/migrations/get-firebase-report-o-auth.md +++ b/docs/examples/migrations/get-firebase-report-o-auth.md @@ -11,4 +11,4 @@ const result = await migrations.getFirebaseReportOAuth( '' // projectId ); -console.log(response); +console.log(result); diff --git a/docs/examples/migrations/get-firebase-report.md b/docs/examples/migrations/get-firebase-report.md index 3f19494..8e89a29 100644 --- a/docs/examples/migrations/get-firebase-report.md +++ b/docs/examples/migrations/get-firebase-report.md @@ -11,4 +11,4 @@ const result = await migrations.getFirebaseReport( '' // serviceAccount ); -console.log(response); +console.log(result); diff --git a/docs/examples/migrations/get-n-host-report.md b/docs/examples/migrations/get-n-host-report.md index 73e312a..afd2444 100644 --- a/docs/examples/migrations/get-n-host-report.md +++ b/docs/examples/migrations/get-n-host-report.md @@ -17,4 +17,4 @@ const result = await migrations.getNHostReport( null // port (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/migrations/get-supabase-report.md b/docs/examples/migrations/get-supabase-report.md index 1538bdb..31d9d0e 100644 --- a/docs/examples/migrations/get-supabase-report.md +++ b/docs/examples/migrations/get-supabase-report.md @@ -16,4 +16,4 @@ const result = await migrations.getSupabaseReport( null // port (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/migrations/get.md b/docs/examples/migrations/get.md index ececfcb..5c78aed 100644 --- a/docs/examples/migrations/get.md +++ b/docs/examples/migrations/get.md @@ -10,4 +10,4 @@ const result = await migrations.get( '' // migrationId ); -console.log(response); +console.log(result); diff --git a/docs/examples/migrations/list-firebase-projects.md b/docs/examples/migrations/list-firebase-projects.md index ec15beb..e70ee32 100644 --- a/docs/examples/migrations/list-firebase-projects.md +++ b/docs/examples/migrations/list-firebase-projects.md @@ -8,4 +8,4 @@ const migrations = new Migrations(client); const result = await migrations.listFirebaseProjects(); -console.log(response); +console.log(result); diff --git a/docs/examples/migrations/list.md b/docs/examples/migrations/list.md index e3f0fd6..d098bce 100644 --- a/docs/examples/migrations/list.md +++ b/docs/examples/migrations/list.md @@ -11,4 +11,4 @@ const result = await migrations.list( '' // search (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/migrations/retry.md b/docs/examples/migrations/retry.md index ebd161b..e2daeab 100644 --- a/docs/examples/migrations/retry.md +++ b/docs/examples/migrations/retry.md @@ -10,4 +10,4 @@ const result = await migrations.retry( '' // migrationId ); -console.log(response); +console.log(result); diff --git a/docs/examples/project/create-variable.md b/docs/examples/project/create-variable.md index 053a102..d0135be 100644 --- a/docs/examples/project/create-variable.md +++ b/docs/examples/project/create-variable.md @@ -11,4 +11,4 @@ const result = await project.createVariable( '' // value ); -console.log(response); +console.log(result); diff --git a/docs/examples/project/delete-variable.md b/docs/examples/project/delete-variable.md index e4806e6..6eb0b69 100644 --- a/docs/examples/project/delete-variable.md +++ b/docs/examples/project/delete-variable.md @@ -10,4 +10,4 @@ const result = await project.deleteVariable( '' // variableId ); -console.log(response); +console.log(result); diff --git a/docs/examples/project/get-usage.md b/docs/examples/project/get-usage.md index 5200210..412a5eb 100644 --- a/docs/examples/project/get-usage.md +++ b/docs/examples/project/get-usage.md @@ -12,4 +12,4 @@ const result = await project.getUsage( ProjectUsageRange.OneHour // period (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/project/get-variable.md b/docs/examples/project/get-variable.md index 4f561c8..3f35d2b 100644 --- a/docs/examples/project/get-variable.md +++ b/docs/examples/project/get-variable.md @@ -10,4 +10,4 @@ const result = await project.getVariable( '' // variableId ); -console.log(response); +console.log(result); diff --git a/docs/examples/project/list-variables.md b/docs/examples/project/list-variables.md index 0915dc2..55731bb 100644 --- a/docs/examples/project/list-variables.md +++ b/docs/examples/project/list-variables.md @@ -8,4 +8,4 @@ const project = new Project(client); const result = await project.listVariables(); -console.log(response); +console.log(result); diff --git a/docs/examples/project/update-variable.md b/docs/examples/project/update-variable.md index 7e9b5ba..2bc13f4 100644 --- a/docs/examples/project/update-variable.md +++ b/docs/examples/project/update-variable.md @@ -12,4 +12,4 @@ const result = await project.updateVariable( '' // value (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/create-j-w-t.md b/docs/examples/projects/create-j-w-t.md new file mode 100644 index 0000000..4de595d --- /dev/null +++ b/docs/examples/projects/create-j-w-t.md @@ -0,0 +1,15 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.createJWT( + '', // projectId + [], // scopes + 0 // duration (optional) +); + +console.log(result); diff --git a/docs/examples/projects/create-key.md b/docs/examples/projects/create-key.md index d2b2ad4..8cc040b 100644 --- a/docs/examples/projects/create-key.md +++ b/docs/examples/projects/create-key.md @@ -13,4 +13,4 @@ const result = await projects.createKey( '' // expire (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/create-platform.md b/docs/examples/projects/create-platform.md index 6e7633a..f0578df 100644 --- a/docs/examples/projects/create-platform.md +++ b/docs/examples/projects/create-platform.md @@ -15,4 +15,4 @@ const result = await projects.createPlatform( '' // hostname (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/create-smtp-test.md b/docs/examples/projects/create-smtp-test.md index e3ff0e3..1742ca0 100644 --- a/docs/examples/projects/create-smtp-test.md +++ b/docs/examples/projects/create-smtp-test.md @@ -19,4 +19,4 @@ const result = await projects.createSmtpTest( SMTPSecure.Tls // secure (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/create-webhook.md b/docs/examples/projects/create-webhook.md index 505c7e0..b065a5b 100644 --- a/docs/examples/projects/create-webhook.md +++ b/docs/examples/projects/create-webhook.md @@ -17,4 +17,4 @@ const result = await projects.createWebhook( '' // httpPass (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/create.md b/docs/examples/projects/create.md index c6444b5..4dfe642 100644 --- a/docs/examples/projects/create.md +++ b/docs/examples/projects/create.md @@ -22,4 +22,4 @@ const result = await projects.create( '' // legalTaxId (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/delete-email-template.md b/docs/examples/projects/delete-email-template.md index b973a0f..9897498 100644 --- a/docs/examples/projects/delete-email-template.md +++ b/docs/examples/projects/delete-email-template.md @@ -12,4 +12,4 @@ const result = await projects.deleteEmailTemplate( EmailTemplateLocale.Af // locale ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/delete-key.md b/docs/examples/projects/delete-key.md index 53696cc..1a291d6 100644 --- a/docs/examples/projects/delete-key.md +++ b/docs/examples/projects/delete-key.md @@ -11,4 +11,4 @@ const result = await projects.deleteKey( '' // keyId ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/delete-platform.md b/docs/examples/projects/delete-platform.md index 0cd3d08..b16a8d0 100644 --- a/docs/examples/projects/delete-platform.md +++ b/docs/examples/projects/delete-platform.md @@ -11,4 +11,4 @@ const result = await projects.deletePlatform( '' // platformId ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/delete-sms-template.md b/docs/examples/projects/delete-sms-template.md index 875d9c7..a6638d6 100644 --- a/docs/examples/projects/delete-sms-template.md +++ b/docs/examples/projects/delete-sms-template.md @@ -12,4 +12,4 @@ const result = await projects.deleteSmsTemplate( SmsTemplateLocale.Af // locale ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/delete-webhook.md b/docs/examples/projects/delete-webhook.md index 94f5a9a..f0672b8 100644 --- a/docs/examples/projects/delete-webhook.md +++ b/docs/examples/projects/delete-webhook.md @@ -11,4 +11,4 @@ const result = await projects.deleteWebhook( '' // webhookId ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/delete.md b/docs/examples/projects/delete.md index 79a7df0..6171f76 100644 --- a/docs/examples/projects/delete.md +++ b/docs/examples/projects/delete.md @@ -10,4 +10,4 @@ const result = await projects.delete( '' // projectId ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/get-email-template.md b/docs/examples/projects/get-email-template.md index 1982c29..06ac756 100644 --- a/docs/examples/projects/get-email-template.md +++ b/docs/examples/projects/get-email-template.md @@ -12,4 +12,4 @@ const result = await projects.getEmailTemplate( EmailTemplateLocale.Af // locale ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/get-key.md b/docs/examples/projects/get-key.md index c4ce139..74a5fdc 100644 --- a/docs/examples/projects/get-key.md +++ b/docs/examples/projects/get-key.md @@ -11,4 +11,4 @@ const result = await projects.getKey( '' // keyId ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/get-platform.md b/docs/examples/projects/get-platform.md index 3afe06d..bb5e4ff 100644 --- a/docs/examples/projects/get-platform.md +++ b/docs/examples/projects/get-platform.md @@ -11,4 +11,4 @@ const result = await projects.getPlatform( '' // platformId ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/get-sms-template.md b/docs/examples/projects/get-sms-template.md index 2588ab0..7fa3961 100644 --- a/docs/examples/projects/get-sms-template.md +++ b/docs/examples/projects/get-sms-template.md @@ -12,4 +12,4 @@ const result = await projects.getSmsTemplate( SmsTemplateLocale.Af // locale ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/get-webhook.md b/docs/examples/projects/get-webhook.md index 9b6637d..caaf674 100644 --- a/docs/examples/projects/get-webhook.md +++ b/docs/examples/projects/get-webhook.md @@ -11,4 +11,4 @@ const result = await projects.getWebhook( '' // webhookId ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/get.md b/docs/examples/projects/get.md index fa2d94b..f022595 100644 --- a/docs/examples/projects/get.md +++ b/docs/examples/projects/get.md @@ -10,4 +10,4 @@ const result = await projects.get( '' // projectId ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/list-keys.md b/docs/examples/projects/list-keys.md index 6799144..4fdb513 100644 --- a/docs/examples/projects/list-keys.md +++ b/docs/examples/projects/list-keys.md @@ -10,4 +10,4 @@ const result = await projects.listKeys( '' // projectId ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/list-platforms.md b/docs/examples/projects/list-platforms.md index b0f4904..9501f4f 100644 --- a/docs/examples/projects/list-platforms.md +++ b/docs/examples/projects/list-platforms.md @@ -10,4 +10,4 @@ const result = await projects.listPlatforms( '' // projectId ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/list-webhooks.md b/docs/examples/projects/list-webhooks.md index e567fc6..7498344 100644 --- a/docs/examples/projects/list-webhooks.md +++ b/docs/examples/projects/list-webhooks.md @@ -10,4 +10,4 @@ const result = await projects.listWebhooks( '' // projectId ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/list.md b/docs/examples/projects/list.md index f81ae48..551d0c9 100644 --- a/docs/examples/projects/list.md +++ b/docs/examples/projects/list.md @@ -11,4 +11,4 @@ const result = await projects.list( '' // search (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/update-api-status-all.md b/docs/examples/projects/update-api-status-all.md index e28544d..6ebe810 100644 --- a/docs/examples/projects/update-api-status-all.md +++ b/docs/examples/projects/update-api-status-all.md @@ -11,4 +11,4 @@ const result = await projects.updateApiStatusAll( false // status ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/update-api-status.md b/docs/examples/projects/update-api-status.md index c5b7e27..0b8048f 100644 --- a/docs/examples/projects/update-api-status.md +++ b/docs/examples/projects/update-api-status.md @@ -12,4 +12,4 @@ const result = await projects.updateApiStatus( false // status ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/update-auth-duration.md b/docs/examples/projects/update-auth-duration.md index 6c000c1..6e5fe91 100644 --- a/docs/examples/projects/update-auth-duration.md +++ b/docs/examples/projects/update-auth-duration.md @@ -11,4 +11,4 @@ const result = await projects.updateAuthDuration( 0 // duration ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/update-auth-limit.md b/docs/examples/projects/update-auth-limit.md index 1a68366..4949206 100644 --- a/docs/examples/projects/update-auth-limit.md +++ b/docs/examples/projects/update-auth-limit.md @@ -11,4 +11,4 @@ const result = await projects.updateAuthLimit( 0 // limit ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/update-auth-password-dictionary.md b/docs/examples/projects/update-auth-password-dictionary.md index 8d9d961..4eb1f1e 100644 --- a/docs/examples/projects/update-auth-password-dictionary.md +++ b/docs/examples/projects/update-auth-password-dictionary.md @@ -11,4 +11,4 @@ const result = await projects.updateAuthPasswordDictionary( false // enabled ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/update-auth-password-history.md b/docs/examples/projects/update-auth-password-history.md index 9f7f295..1aaacf1 100644 --- a/docs/examples/projects/update-auth-password-history.md +++ b/docs/examples/projects/update-auth-password-history.md @@ -11,4 +11,4 @@ const result = await projects.updateAuthPasswordHistory( 0 // limit ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/update-auth-sessions-limit.md b/docs/examples/projects/update-auth-sessions-limit.md index a20d375..ed0b658 100644 --- a/docs/examples/projects/update-auth-sessions-limit.md +++ b/docs/examples/projects/update-auth-sessions-limit.md @@ -11,4 +11,4 @@ const result = await projects.updateAuthSessionsLimit( 1 // limit ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/update-auth-status.md b/docs/examples/projects/update-auth-status.md index 4eb886d..c1c3c7d 100644 --- a/docs/examples/projects/update-auth-status.md +++ b/docs/examples/projects/update-auth-status.md @@ -12,4 +12,4 @@ const result = await projects.updateAuthStatus( false // status ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/update-email-template.md b/docs/examples/projects/update-email-template.md index 965111a..637b881 100644 --- a/docs/examples/projects/update-email-template.md +++ b/docs/examples/projects/update-email-template.md @@ -17,4 +17,4 @@ const result = await projects.updateEmailTemplate( 'email@example.com' // replyTo (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/update-key.md b/docs/examples/projects/update-key.md index 97c4138..a3f904a 100644 --- a/docs/examples/projects/update-key.md +++ b/docs/examples/projects/update-key.md @@ -14,4 +14,4 @@ const result = await projects.updateKey( '' // expire (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/update-mock-numbers.md b/docs/examples/projects/update-mock-numbers.md new file mode 100644 index 0000000..313a126 --- /dev/null +++ b/docs/examples/projects/update-mock-numbers.md @@ -0,0 +1,14 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.updateMockNumbers( + '', // projectId + [] // numbers +); + +console.log(result); diff --git a/docs/examples/projects/update-o-auth2.md b/docs/examples/projects/update-o-auth2.md index 0870f1e..e44a554 100644 --- a/docs/examples/projects/update-o-auth2.md +++ b/docs/examples/projects/update-o-auth2.md @@ -14,4 +14,4 @@ const result = await projects.updateOAuth2( false // enabled (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/update-personal-data-check.md b/docs/examples/projects/update-personal-data-check.md index b2cefc1..3d1a3d6 100644 --- a/docs/examples/projects/update-personal-data-check.md +++ b/docs/examples/projects/update-personal-data-check.md @@ -11,4 +11,4 @@ const result = await projects.updatePersonalDataCheck( false // enabled ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/update-platform.md b/docs/examples/projects/update-platform.md index fc62f57..6ebfc23 100644 --- a/docs/examples/projects/update-platform.md +++ b/docs/examples/projects/update-platform.md @@ -15,4 +15,4 @@ const result = await projects.updatePlatform( '' // hostname (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/update-service-status-all.md b/docs/examples/projects/update-service-status-all.md index 9f09337..9687333 100644 --- a/docs/examples/projects/update-service-status-all.md +++ b/docs/examples/projects/update-service-status-all.md @@ -11,4 +11,4 @@ const result = await projects.updateServiceStatusAll( false // status ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/update-service-status.md b/docs/examples/projects/update-service-status.md index bf9d69c..1a6ecd6 100644 --- a/docs/examples/projects/update-service-status.md +++ b/docs/examples/projects/update-service-status.md @@ -12,4 +12,4 @@ const result = await projects.updateServiceStatus( false // status ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/update-session-alerts.md b/docs/examples/projects/update-session-alerts.md new file mode 100644 index 0000000..607c440 --- /dev/null +++ b/docs/examples/projects/update-session-alerts.md @@ -0,0 +1,14 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.updateSessionAlerts( + '', // projectId + false // alerts +); + +console.log(result); diff --git a/docs/examples/projects/update-sms-template.md b/docs/examples/projects/update-sms-template.md index 3d73d45..ab034a7 100644 --- a/docs/examples/projects/update-sms-template.md +++ b/docs/examples/projects/update-sms-template.md @@ -13,4 +13,4 @@ const result = await projects.updateSmsTemplate( '' // message ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/update-smtp.md b/docs/examples/projects/update-smtp.md index b24d6b5..3852028 100644 --- a/docs/examples/projects/update-smtp.md +++ b/docs/examples/projects/update-smtp.md @@ -19,4 +19,4 @@ const result = await projects.updateSmtp( SMTPSecure.Tls // secure (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/update-team.md b/docs/examples/projects/update-team.md index 98ef985..a93d985 100644 --- a/docs/examples/projects/update-team.md +++ b/docs/examples/projects/update-team.md @@ -11,4 +11,4 @@ const result = await projects.updateTeam( '' // teamId ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/update-webhook-signature.md b/docs/examples/projects/update-webhook-signature.md index ff2c0a6..a7e5cd8 100644 --- a/docs/examples/projects/update-webhook-signature.md +++ b/docs/examples/projects/update-webhook-signature.md @@ -11,4 +11,4 @@ const result = await projects.updateWebhookSignature( '' // webhookId ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/update-webhook.md b/docs/examples/projects/update-webhook.md index 69fd250..c36581b 100644 --- a/docs/examples/projects/update-webhook.md +++ b/docs/examples/projects/update-webhook.md @@ -18,4 +18,4 @@ const result = await projects.updateWebhook( '' // httpPass (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/projects/update.md b/docs/examples/projects/update.md index 49d8bf9..2aa5593 100644 --- a/docs/examples/projects/update.md +++ b/docs/examples/projects/update.md @@ -20,4 +20,4 @@ const result = await projects.update( '' // legalTaxId (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/proxy/create-rule.md b/docs/examples/proxy/create-rule.md index 2bf7a8d..eabb21a 100644 --- a/docs/examples/proxy/create-rule.md +++ b/docs/examples/proxy/create-rule.md @@ -12,4 +12,4 @@ const result = await proxy.createRule( '' // resourceId (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/proxy/delete-rule.md b/docs/examples/proxy/delete-rule.md index a9ffeef..972ca06 100644 --- a/docs/examples/proxy/delete-rule.md +++ b/docs/examples/proxy/delete-rule.md @@ -10,4 +10,4 @@ const result = await proxy.deleteRule( '' // ruleId ); -console.log(response); +console.log(result); diff --git a/docs/examples/proxy/get-rule.md b/docs/examples/proxy/get-rule.md index 95ff212..6e7add1 100644 --- a/docs/examples/proxy/get-rule.md +++ b/docs/examples/proxy/get-rule.md @@ -10,4 +10,4 @@ const result = await proxy.getRule( '' // ruleId ); -console.log(response); +console.log(result); diff --git a/docs/examples/proxy/list-rules.md b/docs/examples/proxy/list-rules.md index f9b7f35..c634984 100644 --- a/docs/examples/proxy/list-rules.md +++ b/docs/examples/proxy/list-rules.md @@ -11,4 +11,4 @@ const result = await proxy.listRules( '' // search (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/proxy/update-rule-verification.md b/docs/examples/proxy/update-rule-verification.md index 1696c32..9553223 100644 --- a/docs/examples/proxy/update-rule-verification.md +++ b/docs/examples/proxy/update-rule-verification.md @@ -10,4 +10,4 @@ const result = await proxy.updateRuleVerification( '' // ruleId ); -console.log(response); +console.log(result); diff --git a/docs/examples/storage/create-bucket.md b/docs/examples/storage/create-bucket.md index 4481ada..7e4908a 100644 --- a/docs/examples/storage/create-bucket.md +++ b/docs/examples/storage/create-bucket.md @@ -19,4 +19,4 @@ const result = await storage.createBucket( false // antivirus (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index ec326fa..8cf4ede 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -13,4 +13,4 @@ const result = await storage.createFile( ["read("any")"] // permissions (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/storage/delete-bucket.md b/docs/examples/storage/delete-bucket.md index 819def3..c4e9828 100644 --- a/docs/examples/storage/delete-bucket.md +++ b/docs/examples/storage/delete-bucket.md @@ -10,4 +10,4 @@ const result = await storage.deleteBucket( '' // bucketId ); -console.log(response); +console.log(result); diff --git a/docs/examples/storage/delete-file.md b/docs/examples/storage/delete-file.md index 6707707..b083bdf 100644 --- a/docs/examples/storage/delete-file.md +++ b/docs/examples/storage/delete-file.md @@ -11,4 +11,4 @@ const result = await storage.deleteFile( '' // fileId ); -console.log(response); +console.log(result); diff --git a/docs/examples/storage/get-bucket-usage.md b/docs/examples/storage/get-bucket-usage.md index 98d4a62..6178279 100644 --- a/docs/examples/storage/get-bucket-usage.md +++ b/docs/examples/storage/get-bucket-usage.md @@ -11,4 +11,4 @@ const result = await storage.getBucketUsage( StorageUsageRange.TwentyFourHours // range (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/storage/get-bucket.md b/docs/examples/storage/get-bucket.md index 52b7082..c16cd46 100644 --- a/docs/examples/storage/get-bucket.md +++ b/docs/examples/storage/get-bucket.md @@ -10,4 +10,4 @@ const result = await storage.getBucket( '' // bucketId ); -console.log(response); +console.log(result); diff --git a/docs/examples/storage/get-file.md b/docs/examples/storage/get-file.md index e1118c0..e503f5f 100644 --- a/docs/examples/storage/get-file.md +++ b/docs/examples/storage/get-file.md @@ -11,4 +11,4 @@ const result = await storage.getFile( '' // fileId ); -console.log(response); +console.log(result); diff --git a/docs/examples/storage/get-usage.md b/docs/examples/storage/get-usage.md index a67dbf1..5fa84fa 100644 --- a/docs/examples/storage/get-usage.md +++ b/docs/examples/storage/get-usage.md @@ -10,4 +10,4 @@ const result = await storage.getUsage( StorageUsageRange.TwentyFourHours // range (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/storage/list-buckets.md b/docs/examples/storage/list-buckets.md index 5caf111..c48d5d8 100644 --- a/docs/examples/storage/list-buckets.md +++ b/docs/examples/storage/list-buckets.md @@ -11,4 +11,4 @@ const result = await storage.listBuckets( '' // search (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/storage/list-files.md b/docs/examples/storage/list-files.md index c139e8b..7fc7067 100644 --- a/docs/examples/storage/list-files.md +++ b/docs/examples/storage/list-files.md @@ -12,4 +12,4 @@ const result = await storage.listFiles( '' // search (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/storage/update-bucket.md b/docs/examples/storage/update-bucket.md index bd7d923..821ec7a 100644 --- a/docs/examples/storage/update-bucket.md +++ b/docs/examples/storage/update-bucket.md @@ -19,4 +19,4 @@ const result = await storage.updateBucket( false // antivirus (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/storage/update-file.md b/docs/examples/storage/update-file.md index c597905..5fa19f1 100644 --- a/docs/examples/storage/update-file.md +++ b/docs/examples/storage/update-file.md @@ -13,4 +13,4 @@ const result = await storage.updateFile( ["read("any")"] // permissions (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/teams/create-membership.md b/docs/examples/teams/create-membership.md index 6eb57f4..da7ff89 100644 --- a/docs/examples/teams/create-membership.md +++ b/docs/examples/teams/create-membership.md @@ -16,4 +16,4 @@ const result = await teams.createMembership( '' // name (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/teams/create.md b/docs/examples/teams/create.md index 47aad4c..e64c11c 100644 --- a/docs/examples/teams/create.md +++ b/docs/examples/teams/create.md @@ -12,4 +12,4 @@ const result = await teams.create( [] // roles (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/teams/delete-membership.md b/docs/examples/teams/delete-membership.md index ba07bb2..e28663c 100644 --- a/docs/examples/teams/delete-membership.md +++ b/docs/examples/teams/delete-membership.md @@ -11,4 +11,4 @@ const result = await teams.deleteMembership( '' // membershipId ); -console.log(response); +console.log(result); diff --git a/docs/examples/teams/delete.md b/docs/examples/teams/delete.md index 71a4721..4853107 100644 --- a/docs/examples/teams/delete.md +++ b/docs/examples/teams/delete.md @@ -10,4 +10,4 @@ const result = await teams.delete( '' // teamId ); -console.log(response); +console.log(result); diff --git a/docs/examples/teams/get-membership.md b/docs/examples/teams/get-membership.md index 1b97621..1a1ab24 100644 --- a/docs/examples/teams/get-membership.md +++ b/docs/examples/teams/get-membership.md @@ -11,4 +11,4 @@ const result = await teams.getMembership( '' // membershipId ); -console.log(response); +console.log(result); diff --git a/docs/examples/teams/get-prefs.md b/docs/examples/teams/get-prefs.md index fc21ec0..48e44d5 100644 --- a/docs/examples/teams/get-prefs.md +++ b/docs/examples/teams/get-prefs.md @@ -10,4 +10,4 @@ const result = await teams.getPrefs( '' // teamId ); -console.log(response); +console.log(result); diff --git a/docs/examples/teams/get.md b/docs/examples/teams/get.md index 5de7eba..d3d788e 100644 --- a/docs/examples/teams/get.md +++ b/docs/examples/teams/get.md @@ -10,4 +10,4 @@ const result = await teams.get( '' // teamId ); -console.log(response); +console.log(result); diff --git a/docs/examples/teams/list-logs.md b/docs/examples/teams/list-logs.md index 5d18db7..7e7e949 100644 --- a/docs/examples/teams/list-logs.md +++ b/docs/examples/teams/list-logs.md @@ -11,4 +11,4 @@ const result = await teams.listLogs( [] // queries (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/teams/list-memberships.md b/docs/examples/teams/list-memberships.md index c1fcaa0..c777c51 100644 --- a/docs/examples/teams/list-memberships.md +++ b/docs/examples/teams/list-memberships.md @@ -12,4 +12,4 @@ const result = await teams.listMemberships( '' // search (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/teams/list.md b/docs/examples/teams/list.md index fbd10f5..35b3f6d 100644 --- a/docs/examples/teams/list.md +++ b/docs/examples/teams/list.md @@ -11,4 +11,4 @@ const result = await teams.list( '' // search (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/teams/update-membership-status.md b/docs/examples/teams/update-membership-status.md index 14d386c..8c179bc 100644 --- a/docs/examples/teams/update-membership-status.md +++ b/docs/examples/teams/update-membership-status.md @@ -13,4 +13,4 @@ const result = await teams.updateMembershipStatus( '' // secret ); -console.log(response); +console.log(result); diff --git a/docs/examples/teams/update-membership.md b/docs/examples/teams/update-membership.md index c83344f..70c3917 100644 --- a/docs/examples/teams/update-membership.md +++ b/docs/examples/teams/update-membership.md @@ -12,4 +12,4 @@ const result = await teams.updateMembership( [] // roles ); -console.log(response); +console.log(result); diff --git a/docs/examples/teams/update-name.md b/docs/examples/teams/update-name.md index b64c0d7..7a4257a 100644 --- a/docs/examples/teams/update-name.md +++ b/docs/examples/teams/update-name.md @@ -11,4 +11,4 @@ const result = await teams.updateName( '' // name ); -console.log(response); +console.log(result); diff --git a/docs/examples/teams/update-prefs.md b/docs/examples/teams/update-prefs.md index d55b2aa..7132d11 100644 --- a/docs/examples/teams/update-prefs.md +++ b/docs/examples/teams/update-prefs.md @@ -11,4 +11,4 @@ const result = await teams.updatePrefs( {} // prefs ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/create-argon2user.md b/docs/examples/users/create-argon2user.md index 02c6c1e..ec2710b 100644 --- a/docs/examples/users/create-argon2user.md +++ b/docs/examples/users/create-argon2user.md @@ -13,4 +13,4 @@ const result = await users.createArgon2User( '' // name (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/create-bcrypt-user.md b/docs/examples/users/create-bcrypt-user.md index ec9e978..2d79439 100644 --- a/docs/examples/users/create-bcrypt-user.md +++ b/docs/examples/users/create-bcrypt-user.md @@ -13,4 +13,4 @@ const result = await users.createBcryptUser( '' // name (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/create-j-w-t.md b/docs/examples/users/create-j-w-t.md new file mode 100644 index 0000000..393acd6 --- /dev/null +++ b/docs/examples/users/create-j-w-t.md @@ -0,0 +1,15 @@ +import { Client, Users } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const users = new Users(client); + +const result = await users.createJWT( + '', // userId + '', // sessionId (optional) + 0 // duration (optional) +); + +console.log(result); diff --git a/docs/examples/users/create-m-d5user.md b/docs/examples/users/create-m-d5user.md index 4b7ced5..4b4ec19 100644 --- a/docs/examples/users/create-m-d5user.md +++ b/docs/examples/users/create-m-d5user.md @@ -13,4 +13,4 @@ const result = await users.createMD5User( '' // name (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/create-mfa-recovery-codes.md b/docs/examples/users/create-mfa-recovery-codes.md index 7297fac..7c10a62 100644 --- a/docs/examples/users/create-mfa-recovery-codes.md +++ b/docs/examples/users/create-mfa-recovery-codes.md @@ -10,4 +10,4 @@ const result = await users.createMfaRecoveryCodes( '' // userId ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/create-p-h-pass-user.md b/docs/examples/users/create-p-h-pass-user.md index 52cdec1..9578039 100644 --- a/docs/examples/users/create-p-h-pass-user.md +++ b/docs/examples/users/create-p-h-pass-user.md @@ -13,4 +13,4 @@ const result = await users.createPHPassUser( '' // name (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/create-s-h-a-user.md b/docs/examples/users/create-s-h-a-user.md index 029a524..9456a97 100644 --- a/docs/examples/users/create-s-h-a-user.md +++ b/docs/examples/users/create-s-h-a-user.md @@ -14,4 +14,4 @@ const result = await users.createSHAUser( '' // name (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/create-scrypt-modified-user.md b/docs/examples/users/create-scrypt-modified-user.md index 0a94516..3c37a2f 100644 --- a/docs/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/users/create-scrypt-modified-user.md @@ -16,4 +16,4 @@ const result = await users.createScryptModifiedUser( '' // name (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/create-scrypt-user.md b/docs/examples/users/create-scrypt-user.md index eb9cc23..11b59aa 100644 --- a/docs/examples/users/create-scrypt-user.md +++ b/docs/examples/users/create-scrypt-user.md @@ -18,4 +18,4 @@ const result = await users.createScryptUser( '' // name (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/create-session.md b/docs/examples/users/create-session.md index 83c3540..43d8bab 100644 --- a/docs/examples/users/create-session.md +++ b/docs/examples/users/create-session.md @@ -10,4 +10,4 @@ const result = await users.createSession( '' // userId ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/create-target.md b/docs/examples/users/create-target.md index b44a7bc..9dcb19a 100644 --- a/docs/examples/users/create-target.md +++ b/docs/examples/users/create-target.md @@ -15,4 +15,4 @@ const result = await users.createTarget( '' // name (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/create-token.md b/docs/examples/users/create-token.md index 54611cb..2b5cd21 100644 --- a/docs/examples/users/create-token.md +++ b/docs/examples/users/create-token.md @@ -12,4 +12,4 @@ const result = await users.createToken( 60 // expire (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/create.md b/docs/examples/users/create.md index 488bea0..e2b7b8d 100644 --- a/docs/examples/users/create.md +++ b/docs/examples/users/create.md @@ -14,4 +14,4 @@ const result = await users.create( '' // name (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/delete-identity.md b/docs/examples/users/delete-identity.md index bd44e19..f006c4e 100644 --- a/docs/examples/users/delete-identity.md +++ b/docs/examples/users/delete-identity.md @@ -10,4 +10,4 @@ const result = await users.deleteIdentity( '' // identityId ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/delete-mfa-authenticator.md b/docs/examples/users/delete-mfa-authenticator.md index 6264163..a6eb078 100644 --- a/docs/examples/users/delete-mfa-authenticator.md +++ b/docs/examples/users/delete-mfa-authenticator.md @@ -11,4 +11,4 @@ const result = await users.deleteMfaAuthenticator( AuthenticatorType.Totp // type ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/delete-session.md b/docs/examples/users/delete-session.md index 95832cd..f447039 100644 --- a/docs/examples/users/delete-session.md +++ b/docs/examples/users/delete-session.md @@ -11,4 +11,4 @@ const result = await users.deleteSession( '' // sessionId ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/delete-sessions.md b/docs/examples/users/delete-sessions.md index 6e27241..b96efbe 100644 --- a/docs/examples/users/delete-sessions.md +++ b/docs/examples/users/delete-sessions.md @@ -10,4 +10,4 @@ const result = await users.deleteSessions( '' // userId ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/delete-target.md b/docs/examples/users/delete-target.md index 62ea4ff..b5caecc 100644 --- a/docs/examples/users/delete-target.md +++ b/docs/examples/users/delete-target.md @@ -11,4 +11,4 @@ const result = await users.deleteTarget( '' // targetId ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/delete.md b/docs/examples/users/delete.md index 6304bf4..3ddfe26 100644 --- a/docs/examples/users/delete.md +++ b/docs/examples/users/delete.md @@ -10,4 +10,4 @@ const result = await users.delete( '' // userId ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/get-mfa-recovery-codes.md b/docs/examples/users/get-mfa-recovery-codes.md index 96b1e53..7576851 100644 --- a/docs/examples/users/get-mfa-recovery-codes.md +++ b/docs/examples/users/get-mfa-recovery-codes.md @@ -10,4 +10,4 @@ const result = await users.getMfaRecoveryCodes( '' // userId ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/get-prefs.md b/docs/examples/users/get-prefs.md index 30f0e87..242fb30 100644 --- a/docs/examples/users/get-prefs.md +++ b/docs/examples/users/get-prefs.md @@ -10,4 +10,4 @@ const result = await users.getPrefs( '' // userId ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/get-target.md b/docs/examples/users/get-target.md index e568bec..8516cf4 100644 --- a/docs/examples/users/get-target.md +++ b/docs/examples/users/get-target.md @@ -11,4 +11,4 @@ const result = await users.getTarget( '' // targetId ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/get-usage.md b/docs/examples/users/get-usage.md index 7690def..a8118f9 100644 --- a/docs/examples/users/get-usage.md +++ b/docs/examples/users/get-usage.md @@ -10,4 +10,4 @@ const result = await users.getUsage( UserUsageRange.TwentyFourHours // range (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/get.md b/docs/examples/users/get.md index 3fe5d22..fe3ead0 100644 --- a/docs/examples/users/get.md +++ b/docs/examples/users/get.md @@ -10,4 +10,4 @@ const result = await users.get( '' // userId ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/list-identities.md b/docs/examples/users/list-identities.md index a56388c..31892a5 100644 --- a/docs/examples/users/list-identities.md +++ b/docs/examples/users/list-identities.md @@ -11,4 +11,4 @@ const result = await users.listIdentities( '' // search (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/list-logs.md b/docs/examples/users/list-logs.md index 4ec5e66..6e6f6e1 100644 --- a/docs/examples/users/list-logs.md +++ b/docs/examples/users/list-logs.md @@ -11,4 +11,4 @@ const result = await users.listLogs( [] // queries (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/list-memberships.md b/docs/examples/users/list-memberships.md index 389a2cd..059af09 100644 --- a/docs/examples/users/list-memberships.md +++ b/docs/examples/users/list-memberships.md @@ -10,4 +10,4 @@ const result = await users.listMemberships( '' // userId ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/list-mfa-factors.md b/docs/examples/users/list-mfa-factors.md index 5a34a5d..85fefb4 100644 --- a/docs/examples/users/list-mfa-factors.md +++ b/docs/examples/users/list-mfa-factors.md @@ -10,4 +10,4 @@ const result = await users.listMfaFactors( '' // userId ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/list-sessions.md b/docs/examples/users/list-sessions.md index 3aaa019..be1d9cc 100644 --- a/docs/examples/users/list-sessions.md +++ b/docs/examples/users/list-sessions.md @@ -10,4 +10,4 @@ const result = await users.listSessions( '' // userId ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/list-targets.md b/docs/examples/users/list-targets.md index 950fa08..e3fb352 100644 --- a/docs/examples/users/list-targets.md +++ b/docs/examples/users/list-targets.md @@ -11,4 +11,4 @@ const result = await users.listTargets( [] // queries (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/list.md b/docs/examples/users/list.md index f3421fd..ffc7004 100644 --- a/docs/examples/users/list.md +++ b/docs/examples/users/list.md @@ -11,4 +11,4 @@ const result = await users.list( '' // search (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/update-email-verification.md b/docs/examples/users/update-email-verification.md index 991af51..afd0f09 100644 --- a/docs/examples/users/update-email-verification.md +++ b/docs/examples/users/update-email-verification.md @@ -11,4 +11,4 @@ const result = await users.updateEmailVerification( false // emailVerification ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/update-email.md b/docs/examples/users/update-email.md index 28c892a..7e34a7e 100644 --- a/docs/examples/users/update-email.md +++ b/docs/examples/users/update-email.md @@ -11,4 +11,4 @@ const result = await users.updateEmail( 'email@example.com' // email ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/update-labels.md b/docs/examples/users/update-labels.md index b5031d7..1a0c6c9 100644 --- a/docs/examples/users/update-labels.md +++ b/docs/examples/users/update-labels.md @@ -11,4 +11,4 @@ const result = await users.updateLabels( [] // labels ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/update-mfa-recovery-codes.md b/docs/examples/users/update-mfa-recovery-codes.md index 0b7586d..ae777cd 100644 --- a/docs/examples/users/update-mfa-recovery-codes.md +++ b/docs/examples/users/update-mfa-recovery-codes.md @@ -10,4 +10,4 @@ const result = await users.updateMfaRecoveryCodes( '' // userId ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/update-mfa.md b/docs/examples/users/update-mfa.md index 16bc49c..1daa6af 100644 --- a/docs/examples/users/update-mfa.md +++ b/docs/examples/users/update-mfa.md @@ -11,4 +11,4 @@ const result = await users.updateMfa( false // mfa ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/update-name.md b/docs/examples/users/update-name.md index 59aca8c..3c562a2 100644 --- a/docs/examples/users/update-name.md +++ b/docs/examples/users/update-name.md @@ -11,4 +11,4 @@ const result = await users.updateName( '' // name ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/update-password.md b/docs/examples/users/update-password.md index f6e7c4c..a490da3 100644 --- a/docs/examples/users/update-password.md +++ b/docs/examples/users/update-password.md @@ -11,4 +11,4 @@ const result = await users.updatePassword( '' // password ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/update-phone-verification.md b/docs/examples/users/update-phone-verification.md index f477ec2..21ed93e 100644 --- a/docs/examples/users/update-phone-verification.md +++ b/docs/examples/users/update-phone-verification.md @@ -11,4 +11,4 @@ const result = await users.updatePhoneVerification( false // phoneVerification ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/update-phone.md b/docs/examples/users/update-phone.md index 1d942f3..49d56ee 100644 --- a/docs/examples/users/update-phone.md +++ b/docs/examples/users/update-phone.md @@ -11,4 +11,4 @@ const result = await users.updatePhone( '+12065550100' // number ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/update-prefs.md b/docs/examples/users/update-prefs.md index 853631e..ed52376 100644 --- a/docs/examples/users/update-prefs.md +++ b/docs/examples/users/update-prefs.md @@ -11,4 +11,4 @@ const result = await users.updatePrefs( {} // prefs ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/update-status.md b/docs/examples/users/update-status.md index 6b28c5d..aaf3813 100644 --- a/docs/examples/users/update-status.md +++ b/docs/examples/users/update-status.md @@ -11,4 +11,4 @@ const result = await users.updateStatus( false // status ); -console.log(response); +console.log(result); diff --git a/docs/examples/users/update-target.md b/docs/examples/users/update-target.md index 86fc1c3..ca432af 100644 --- a/docs/examples/users/update-target.md +++ b/docs/examples/users/update-target.md @@ -14,4 +14,4 @@ const result = await users.updateTarget( '' // name (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/vcs/create-repository-detection.md b/docs/examples/vcs/create-repository-detection.md index dd71b67..d4c82f6 100644 --- a/docs/examples/vcs/create-repository-detection.md +++ b/docs/examples/vcs/create-repository-detection.md @@ -12,4 +12,4 @@ const result = await vcs.createRepositoryDetection( '' // providerRootDirectory (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/vcs/create-repository.md b/docs/examples/vcs/create-repository.md index 7d73b2a..4fab34b 100644 --- a/docs/examples/vcs/create-repository.md +++ b/docs/examples/vcs/create-repository.md @@ -12,4 +12,4 @@ const result = await vcs.createRepository( false // private ); -console.log(response); +console.log(result); diff --git a/docs/examples/vcs/delete-installation.md b/docs/examples/vcs/delete-installation.md index a770bb6..3edd5df 100644 --- a/docs/examples/vcs/delete-installation.md +++ b/docs/examples/vcs/delete-installation.md @@ -10,4 +10,4 @@ const result = await vcs.deleteInstallation( '' // installationId ); -console.log(response); +console.log(result); diff --git a/docs/examples/vcs/get-installation.md b/docs/examples/vcs/get-installation.md index 961a6c4..11c39a8 100644 --- a/docs/examples/vcs/get-installation.md +++ b/docs/examples/vcs/get-installation.md @@ -10,4 +10,4 @@ const result = await vcs.getInstallation( '' // installationId ); -console.log(response); +console.log(result); diff --git a/docs/examples/vcs/get-repository-contents.md b/docs/examples/vcs/get-repository-contents.md new file mode 100644 index 0000000..9845e3a --- /dev/null +++ b/docs/examples/vcs/get-repository-contents.md @@ -0,0 +1,15 @@ +import { Client, Vcs } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const vcs = new Vcs(client); + +const result = await vcs.getRepositoryContents( + '', // installationId + '', // providerRepositoryId + '' // providerRootDirectory (optional) +); + +console.log(result); diff --git a/docs/examples/vcs/get-repository.md b/docs/examples/vcs/get-repository.md index 05d8b6c..12b528e 100644 --- a/docs/examples/vcs/get-repository.md +++ b/docs/examples/vcs/get-repository.md @@ -11,4 +11,4 @@ const result = await vcs.getRepository( '' // providerRepositoryId ); -console.log(response); +console.log(result); diff --git a/docs/examples/vcs/list-installations.md b/docs/examples/vcs/list-installations.md index 64ff523..4bef271 100644 --- a/docs/examples/vcs/list-installations.md +++ b/docs/examples/vcs/list-installations.md @@ -11,4 +11,4 @@ const result = await vcs.listInstallations( '' // search (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/vcs/list-repositories.md b/docs/examples/vcs/list-repositories.md index 80115d6..31d6b2f 100644 --- a/docs/examples/vcs/list-repositories.md +++ b/docs/examples/vcs/list-repositories.md @@ -11,4 +11,4 @@ const result = await vcs.listRepositories( '' // search (optional) ); -console.log(response); +console.log(result); diff --git a/docs/examples/vcs/list-repository-branches.md b/docs/examples/vcs/list-repository-branches.md index d236f8b..29f1565 100644 --- a/docs/examples/vcs/list-repository-branches.md +++ b/docs/examples/vcs/list-repository-branches.md @@ -11,4 +11,4 @@ const result = await vcs.listRepositoryBranches( '' // providerRepositoryId ); -console.log(response); +console.log(result); diff --git a/docs/examples/vcs/update-external-deployments.md b/docs/examples/vcs/update-external-deployments.md index 577e0ac..ce11633 100644 --- a/docs/examples/vcs/update-external-deployments.md +++ b/docs/examples/vcs/update-external-deployments.md @@ -12,4 +12,4 @@ const result = await vcs.updateExternalDeployments( '' // providerPullRequestId ); -console.log(response); +console.log(result); diff --git a/package.json b/package.json index ea95921..e8a8cd1 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@appwrite.io/console", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API", - "version": "0.6.4", + "version": "0.6.3", "license": "BSD-3-Clause", "main": "dist/cjs/sdk.js", "exports": { diff --git a/src/client.ts b/src/client.ts index 49cdaf8..fcf0817 100644 --- a/src/client.ts +++ b/src/client.ts @@ -304,8 +304,8 @@ class Client { 'x-sdk-name': 'Console', 'x-sdk-platform': 'console', 'x-sdk-language': 'web', - 'x-sdk-version': '0.6.4', - 'X-Appwrite-Response-Format': '1.5.0', + 'x-sdk-version': '0.6.3', + 'X-Appwrite-Response-Format': '1.6.0', }; /** diff --git a/src/enums/email-template-type.ts b/src/enums/email-template-type.ts index e0ab5c6..639340a 100644 --- a/src/enums/email-template-type.ts +++ b/src/enums/email-template-type.ts @@ -4,4 +4,6 @@ export enum EmailTemplateType { Recovery = 'recovery', Invitation = 'invitation', Mfachallenge = 'mfachallenge', + Sessionalert = 'sessionalert', + Otpsession = 'otpsession', } \ No newline at end of file diff --git a/src/enums/platform-type.ts b/src/enums/platform-type.ts index 914dda8..e7c72fd 100644 --- a/src/enums/platform-type.ts +++ b/src/enums/platform-type.ts @@ -12,4 +12,6 @@ export enum PlatformType { Appletvos = 'apple-tvos', Android = 'android', Unity = 'unity', + Reactnativeios = 'react-native-ios', + Reactnativeandroid = 'react-native-android', } \ No newline at end of file diff --git a/src/enums/runtime.ts b/src/enums/runtime.ts index 113d655..8a2326b 100644 --- a/src/enums/runtime.ts +++ b/src/enums/runtime.ts @@ -44,4 +44,5 @@ export enum Runtime { Cpp17 = 'cpp-17', Cpp20 = 'cpp-20', Bun10 = 'bun-1.0', + Go122 = 'go-1.22', } \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 82bbbec..6336e23 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,7 @@ /** * Appwrite Console SDK * - * This SDK is compatible with Appwrite server version 1.5.x. + * This SDK is compatible with Appwrite server version 1.6.x. * For older versions, please check * [previous releases](https://github.com/appwrite/sdk-for-console/releases). */ diff --git a/src/models.ts b/src/models.ts index 71293f3..4ece510 100644 --- a/src/models.ts +++ b/src/models.ts @@ -171,6 +171,19 @@ export namespace Models { */ functions: Function[]; } + /** + * Function Templates List + */ + export type TemplateFunctionList = { + /** + * Total number of templates documents that matched your query. + */ + total: number; + /** + * List of templates. + */ + templates: TemplateFunction[]; + } /** * Installations List */ @@ -497,17 +510,17 @@ export namespace Models { projects: FirebaseProject[]; } /** - * Specifications List + * VCS Content List */ - export type SpecificationList = { + export type VcsContentList = { /** - * Total number of specifications documents that matched your query. + * Total number of contents documents that matched your query. */ total: number; /** - * List of specifications. + * List of contents. */ - specifications: Specification[]; + contents: VcsContent[]; } /** * Database @@ -1806,6 +1819,10 @@ export namespace Models { * Function's active deployment ID. */ deployment: string; + /** + * Allowed permission scopes. + */ + scopes: string[]; /** * Function variables. */ @@ -1854,10 +1871,129 @@ export namespace Models { * Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests */ providerSilentMode: boolean; + } + /** + * Template Function + */ + export type TemplateFunction = { + /** + * Function Template Icon. + */ + icon: string; + /** + * Function Template ID. + */ + id: string; + /** + * Function Template Name. + */ + name: string; + /** + * Function Template Tagline. + */ + tagline: string; + /** + * Execution permissions. + */ + permissions: string[]; + /** + * Function trigger events. + */ + events: string[]; + /** + * Function execution schedult in CRON format. + */ + cron: string; + /** + * Function execution timeout in seconds. + */ + timeout: number; + /** + * Function use cases. + */ + useCases: string[]; + /** + * List of runtimes that can be used with this template. + */ + runtimes: TemplateRuntime[]; + /** + * Function Template Instructions. + */ + instructions: string; + /** + * VCS (Version Control System) Provider. + */ + vcsProvider: string; + /** + * VCS (Version Control System) Repository ID + */ + providerRepositoryId: string; + /** + * VCS (Version Control System) Owner. + */ + providerOwner: string; + /** + * VCS (Version Control System) branch version (tag). + */ + providerVersion: string; + /** + * Function variables. + */ + variables: TemplateVariable[]; + /** + * Function scopes. + */ + scopes: string[]; + } + /** + * Template Runtime + */ + export type TemplateRuntime = { + /** + * Runtime Name. + */ + name: string; + /** + * The build command used to build the deployment. + */ + commands: string; + /** + * The entrypoint file used to execute the deployment. + */ + entrypoint: string; + /** + * Path to function in VCS (Version Control System) repository + */ + providerRootDirectory: string; + } + /** + * Template Variable + */ + export type TemplateVariable = { + /** + * Variable Name. + */ + name: string; /** - * Function execution and builds machine specification. + * Variable Description. */ - specification: string; + description: string; + /** + * Variable Value. + */ + value: string; + /** + * Variable Placeholder. + */ + placeholder: string; + /** + * Is the variable required? + */ + required: boolean; + /** + * Variable Type. + */ + type: string; } /** * Installation @@ -1930,6 +2066,23 @@ export namespace Models { */ runtime: string; } + /** + * VcsContents + */ + export type VcsContent = { + /** + * Content size in bytes. Only files have size, and for directories, 0 is returned. + */ + size?: number; + /** + * If a content is a directory. Directories can be used to check nested contents. + */ + isDirectory?: boolean; + /** + * Name of directory or file. + */ + name: string; + } /** * Branch */ @@ -1947,6 +2100,10 @@ export namespace Models { * Runtime ID. */ $id: string; + /** + * Parent runtime key. + */ + key: string; /** * Runtime Name. */ @@ -2137,6 +2294,51 @@ export namespace Models { * Function execution duration in seconds. */ duration: number; + /** + * The scheduled time for execution. If left empty, execution will be queued immediately. + */ + scheduledAt?: string; + } + /** + * Build + */ + export type Build = { + /** + * Build ID. + */ + $id: string; + /** + * The deployment that created this build. + */ + deploymentId: string; + /** + * The build status. There are a few different types and each one means something different. \nFailed - The deployment build has failed. More details can usually be found in buildStderr\nReady - The deployment build was successful and the deployment is ready to be deployed\nProcessing - The deployment is currently waiting to have a build triggered\nBuilding - The deployment is currently being built + */ + status: string; + /** + * The stdout of the build. + */ + stdout: string; + /** + * The stderr of the build. + */ + stderr: string; + /** + * The deployment creation date in ISO 8601 format. + */ + startTime: string; + /** + * The time the build was finished in ISO 8601 format. + */ + endTime: string; + /** + * The build duration in seconds. + */ + duration: number; + /** + * The code size in bytes. + */ + size: number; } /** * Project @@ -2222,6 +2424,14 @@ export namespace Models { * Whether or not to check the user password for similarity with their personal data. */ authPersonalDataCheck: boolean; + /** + * An array of mock numbers and their corresponding verification codes (OTPs). + */ + authMockNumbers: MockNumber[]; + /** + * Whether or not to send session alert emails to users. + */ + authSessionAlerts: boolean; /** * List of Auth Providers. */ @@ -2445,6 +2655,19 @@ export namespace Models { */ sdks: string[]; } + /** + * Mock Number + */ + export type MockNumber = { + /** + * Mock phone number for testing phone authentication. Useful for testing phone authentication without sending an SMS. + */ + phone: string; + /** + * Mock OTP for the number. + */ + otp: string; + } /** * AuthProvider */ @@ -3174,27 +3397,6 @@ export namespace Models { */ value: string; } - /** - * Specification - */ - export type Specification = { - /** - * Memory size in MB. - */ - memory: number; - /** - * Number of CPUs. - */ - cpus: number; - /** - * Is size enabled. - */ - enabled: boolean; - /** - * Size slug. - */ - slug: string; - } /** * Rule */ diff --git a/src/services/account.ts b/src/services/account.ts index ebcb167..7413d4c 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -207,7 +207,7 @@ export class Account extends Service { * @returns {Promise} */ async createJWT(): Promise { - const apiPath = '/account/jwt'; + const apiPath = '/account/jwts'; const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -333,26 +333,17 @@ export class Account extends Service { * Delete an authenticator for a user by ID. * * @param {AuthenticatorType} type - * @param {string} otp * @throws {AppwriteException} * @returns {Promise} */ - async deleteMfaAuthenticator(type: AuthenticatorType, otp: string): Promise<{}> { + async deleteMfaAuthenticator(type: AuthenticatorType): Promise<{}> { if (typeof type === 'undefined') { throw new AppwriteException('Missing required parameter: "type"'); } - if (typeof otp === 'undefined') { - throw new AppwriteException('Missing required parameter: "otp"'); - } - const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type); const payload: Payload = {}; - if (typeof otp !== 'undefined') { - payload['otp'] = otp; - } - const uri = new URL(this.client.config.endpoint + apiPath); return await this.client.call('delete', uri, { 'content-type': 'application/json', diff --git a/src/services/avatars.ts b/src/services/avatars.ts index fae5666..6c775fc 100644 --- a/src/services/avatars.ts +++ b/src/services/avatars.ts @@ -120,6 +120,7 @@ export class Avatars extends Service { * Use this endpoint to fetch the favorite icon (AKA favicon) of any remote * website URL. * + * This endpoint does not follow HTTP redirects. * * @param {string} url * @throws {AppwriteException} @@ -211,6 +212,7 @@ export class Avatars extends Service { * image at source quality. If dimensions are not specified, the default size * of image returned is 400x400px. * + * This endpoint does not follow HTTP redirects. * * @param {string} url * @param {number} width diff --git a/src/services/functions.ts b/src/services/functions.ts index f034b0b..1ff4b3a 100644 --- a/src/services/functions.ts +++ b/src/services/functions.ts @@ -61,6 +61,7 @@ export class Functions extends Service { * @param {boolean} logging * @param {string} entrypoint * @param {string} commands + * @param {string[]} scopes * @param {string} installationId * @param {string} providerRepositoryId * @param {string} providerBranch @@ -69,12 +70,11 @@ export class Functions extends Service { * @param {string} templateRepository * @param {string} templateOwner * @param {string} templateRootDirectory - * @param {string} templateBranch - * @param {string} specification + * @param {string} templateVersion * @throws {AppwriteException} * @returns {Promise} */ - async create(functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, templateRepository?: string, templateOwner?: string, templateRootDirectory?: string, templateBranch?: string, specification?: string): Promise { + async create(functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, templateRepository?: string, templateOwner?: string, templateRootDirectory?: string, templateVersion?: string): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -134,6 +134,10 @@ export class Functions extends Service { payload['commands'] = commands; } + if (typeof scopes !== 'undefined') { + payload['scopes'] = scopes; + } + if (typeof installationId !== 'undefined') { payload['installationId'] = installationId; } @@ -166,12 +170,8 @@ export class Functions extends Service { payload['templateRootDirectory'] = templateRootDirectory; } - if (typeof templateBranch !== 'undefined') { - payload['templateBranch'] = templateBranch; - } - - if (typeof specification !== 'undefined') { - payload['specification'] = specification; + if (typeof templateVersion !== 'undefined') { + payload['templateVersion'] = templateVersion; } const uri = new URL(this.client.config.endpoint + apiPath); @@ -199,16 +199,62 @@ export class Functions extends Service { } /** - * Get available function runtime specifications + * List function templates * - * Get allowed function specifications for this instance. - * + * List available function templates. You can use template details in + * [createFunction](/docs/references/cloud/server-nodejs/functions#create) + * method. * + * @param {string[]} runtimes + * @param {string[]} useCases + * @param {number} limit + * @param {number} offset * @throws {AppwriteException} * @returns {Promise} */ - async getSpecifications(): Promise { - const apiPath = '/functions/specifications'; + async listTemplates(runtimes?: string[], useCases?: string[], limit?: number, offset?: number): Promise { + const apiPath = '/functions/templates'; + const payload: Payload = {}; + + if (typeof runtimes !== 'undefined') { + payload['runtimes'] = runtimes; + } + + if (typeof useCases !== 'undefined') { + payload['useCases'] = useCases; + } + + if (typeof limit !== 'undefined') { + payload['limit'] = limit; + } + + if (typeof offset !== 'undefined') { + payload['offset'] = offset; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return await this.client.call('get', uri, { + 'content-type': 'application/json', + }, payload); + } + + /** + * Get function template + * + * Get a function template using ID. You can use template details in + * [createFunction](/docs/references/cloud/server-nodejs/functions#create) + * method. + * + * @param {string} templateId + * @throws {AppwriteException} + * @returns {Promise} + */ + async getTemplate(templateId: string): Promise { + if (typeof templateId === 'undefined') { + throw new AppwriteException('Missing required parameter: "templateId"'); + } + + const apiPath = '/functions/templates/{templateId}'.replace('{templateId}', templateId); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -278,16 +324,16 @@ export class Functions extends Service { * @param {boolean} logging * @param {string} entrypoint * @param {string} commands + * @param {string[]} scopes * @param {string} installationId * @param {string} providerRepositoryId * @param {string} providerBranch * @param {boolean} providerSilentMode * @param {string} providerRootDirectory - * @param {string} specification * @throws {AppwriteException} * @returns {Promise} */ - async update(functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise { + async update(functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -339,6 +385,10 @@ export class Functions extends Service { payload['commands'] = commands; } + if (typeof scopes !== 'undefined') { + payload['scopes'] = scopes; + } + if (typeof installationId !== 'undefined') { payload['installationId'] = installationId; } @@ -359,10 +409,6 @@ export class Functions extends Service { payload['providerRootDirectory'] = providerRootDirectory; } - if (typeof specification !== 'undefined') { - payload['specification'] = specification; - } - const uri = new URL(this.client.config.endpoint + apiPath); return await this.client.call('put', uri, { 'content-type': 'application/json', @@ -614,10 +660,8 @@ export class Functions extends Service { } /** - * Create build + * Rebuild deployment * - * Create a new build for an Appwrite Function deployment. This endpoint can - * be used to retry a failed build. * * @param {string} functionId * @param {string} deploymentId @@ -625,7 +669,7 @@ export class Functions extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async createBuild(functionId: string, deploymentId: string, buildId: string): Promise<{}> { + async createBuild(functionId: string, deploymentId: string, buildId?: string): Promise<{}> { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -634,15 +678,42 @@ export class Functions extends Service { throw new AppwriteException('Missing required parameter: "deploymentId"'); } - if (typeof buildId === 'undefined') { - throw new AppwriteException('Missing required parameter: "buildId"'); + const apiPath = '/functions/{functionId}/deployments/{deploymentId}/build'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId); + const payload: Payload = {}; + + if (typeof buildId !== 'undefined') { + payload['buildId'] = buildId; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return await this.client.call('post', uri, { + 'content-type': 'application/json', + }, payload); + } + + /** + * Cancel deployment + * + * + * @param {string} functionId + * @param {string} deploymentId + * @throws {AppwriteException} + * @returns {Promise} + */ + async updateDeploymentBuild(functionId: string, deploymentId: string): Promise { + if (typeof functionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "functionId"'); + } + + if (typeof deploymentId === 'undefined') { + throw new AppwriteException('Missing required parameter: "deploymentId"'); } - const apiPath = '/functions/{functionId}/deployments/{deploymentId}/builds/{buildId}'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId).replace('{buildId}', buildId); + const apiPath = '/functions/{functionId}/deployments/{deploymentId}/build'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + return await this.client.call('patch', uri, { 'content-type': 'application/json', }, payload); } @@ -658,7 +729,7 @@ export class Functions extends Service { * @throws {AppwriteException} * @returns {URL} */ - downloadDeployment(functionId: string, deploymentId: string): URL { + getDeploymentDownload(functionId: string, deploymentId: string): URL { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -728,10 +799,11 @@ export class Functions extends Service { * @param {string} xpath * @param {ExecutionMethod} method * @param {object} headers + * @param {string} scheduledAt * @throws {AppwriteException} * @returns {Promise} */ - async createExecution(functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object): Promise { + async createExecution(functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string, onProgress = (progress: UploadProgress) => {}): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -759,10 +831,11 @@ export class Functions extends Service { payload['headers'] = headers; } + if (typeof scheduledAt !== 'undefined') { + payload['scheduledAt'] = scheduledAt; + } + const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { - 'content-type': 'application/json', - }, payload); } /** @@ -793,6 +866,35 @@ export class Functions extends Service { }, payload); } + /** + * Delete execution + * + * Delete a function execution by its unique ID. + * + * + * @param {string} functionId + * @param {string} executionId + * @throws {AppwriteException} + * @returns {Promise} + */ + async deleteExecution(functionId: string, executionId: string): Promise<{}> { + if (typeof functionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "functionId"'); + } + + if (typeof executionId === 'undefined') { + throw new AppwriteException('Missing required parameter: "executionId"'); + } + + const apiPath = '/functions/{functionId}/executions/{executionId}'.replace('{functionId}', functionId).replace('{executionId}', executionId); + const payload: Payload = {}; + + const uri = new URL(this.client.config.endpoint + apiPath); + return await this.client.call('delete', uri, { + 'content-type': 'application/json', + }, payload); + } + /** * Get function usage * diff --git a/src/services/projects.ts b/src/services/projects.ts index c419271..e3e0f8d 100644 --- a/src/services/projects.ts +++ b/src/services/projects.ts @@ -426,6 +426,37 @@ export class Projects extends Service { }, payload); } + /** + * Update the mock numbers for the project + * + * + * @param {string} projectId + * @param {object[]} numbers + * @throws {AppwriteException} + * @returns {Promise} + */ + async updateMockNumbers(projectId: string, numbers: object[]): Promise { + if (typeof projectId === 'undefined') { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + + if (typeof numbers === 'undefined') { + throw new AppwriteException('Missing required parameter: "numbers"'); + } + + const apiPath = '/projects/{projectId}/auth/mock-numbers'.replace('{projectId}', projectId); + const payload: Payload = {}; + + if (typeof numbers !== 'undefined') { + payload['numbers'] = numbers; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return await this.client.call('patch', uri, { + 'content-type': 'application/json', + }, payload); + } + /** * Update authentication password dictionary status. Use this endpoint to enable or disable the dicitonary check for user password * @@ -519,6 +550,37 @@ export class Projects extends Service { }, payload); } + /** + * Update project sessions emails + * + * + * @param {string} projectId + * @param {boolean} alerts + * @throws {AppwriteException} + * @returns {Promise} + */ + async updateSessionAlerts(projectId: string, alerts: boolean): Promise { + if (typeof projectId === 'undefined') { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + + if (typeof alerts === 'undefined') { + throw new AppwriteException('Missing required parameter: "alerts"'); + } + + const apiPath = '/projects/{projectId}/auth/session-alerts'.replace('{projectId}', projectId); + const payload: Payload = {}; + + if (typeof alerts !== 'undefined') { + payload['alerts'] = alerts; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return await this.client.call('patch', uri, { + 'content-type': 'application/json', + }, payload); + } + /** * Update project auth method status. Use this endpoint to enable or disable a given auth method for this project. * @@ -555,6 +617,42 @@ export class Projects extends Service { }, payload); } + /** + * Create JWT + * + * + * @param {string} projectId + * @param {string[]} scopes + * @param {number} duration + * @throws {AppwriteException} + * @returns {Promise} + */ + async createJWT(projectId: string, scopes: string[], duration?: number): Promise { + if (typeof projectId === 'undefined') { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + + if (typeof scopes === 'undefined') { + throw new AppwriteException('Missing required parameter: "scopes"'); + } + + const apiPath = '/projects/{projectId}/jwts'.replace('{projectId}', projectId); + const payload: Payload = {}; + + if (typeof scopes !== 'undefined') { + payload['scopes'] = scopes; + } + + if (typeof duration !== 'undefined') { + payload['duration'] = duration; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return await this.client.call('post', uri, { + 'content-type': 'application/json', + }, payload); + } + /** * List keys * @@ -1180,7 +1278,7 @@ export class Projects extends Service { } /** - * Update Project Team + * Update project team * * * @param {string} projectId diff --git a/src/services/users.ts b/src/services/users.ts index c89227d..403cd6b 100644 --- a/src/services/users.ts +++ b/src/services/users.ts @@ -695,6 +695,41 @@ export class Users extends Service { }, payload); } + /** + * Create user JWT + * + * Use this endpoint to create a JSON Web Token for user by its unique ID. You + * can use the resulting JWT to authenticate on behalf of the user. The JWT + * secret will become invalid if the session it uses gets deleted. + * + * @param {string} userId + * @param {string} sessionId + * @param {number} duration + * @throws {AppwriteException} + * @returns {Promise} + */ + async createJWT(userId: string, sessionId?: string, duration?: number): Promise { + if (typeof userId === 'undefined') { + throw new AppwriteException('Missing required parameter: "userId"'); + } + + const apiPath = '/users/{userId}/jwts'.replace('{userId}', userId); + const payload: Payload = {}; + + if (typeof sessionId !== 'undefined') { + payload['sessionId'] = sessionId; + } + + if (typeof duration !== 'undefined') { + payload['duration'] = duration; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return await this.client.call('post', uri, { + 'content-type': 'application/json', + }, payload); + } + /** * Update user labels * diff --git a/src/services/vcs.ts b/src/services/vcs.ts index 95ddf7b..d376916 100644 --- a/src/services/vcs.ts +++ b/src/services/vcs.ts @@ -131,6 +131,38 @@ export class Vcs extends Service { }, payload); } + /** + * Get files and directories of a VCS repository + * + * + * @param {string} installationId + * @param {string} providerRepositoryId + * @param {string} providerRootDirectory + * @throws {AppwriteException} + * @returns {Promise} + */ + async getRepositoryContents(installationId: string, providerRepositoryId: string, providerRootDirectory?: string): Promise { + if (typeof installationId === 'undefined') { + throw new AppwriteException('Missing required parameter: "installationId"'); + } + + if (typeof providerRepositoryId === 'undefined') { + throw new AppwriteException('Missing required parameter: "providerRepositoryId"'); + } + + const apiPath = '/vcs/github/installations/{installationId}/providerRepositories/{providerRepositoryId}/contents'.replace('{installationId}', installationId).replace('{providerRepositoryId}', providerRepositoryId); + const payload: Payload = {}; + + if (typeof providerRootDirectory !== 'undefined') { + payload['providerRootDirectory'] = providerRootDirectory; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return await this.client.call('get', uri, { + 'content-type': 'application/json', + }, payload); + } + /** * Detect runtime settings from source code * From 2715ba4367253b1bc5a0c5360378078206637784 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 20 Aug 2024 13:25:51 +0200 Subject: [PATCH 2/9] sync 1.6.x --- src/client.ts | 183 +++-- src/services/account.ts | 1284 ++++++++++++++++++------------------ src/services/assistant.ts | 35 +- src/services/avatars.ts | 265 ++++---- src/services/console.ts | 33 +- src/services/databases.ts | 1266 ++++++++++++++++++----------------- src/services/functions.ts | 696 ++++++++++--------- src/services/graphql.ts | 55 +- src/services/health.ts | 498 ++++++++------ src/services/locale.ts | 190 +++--- src/services/messaging.ts | 1151 ++++++++++++++++---------------- src/services/migrations.ts | 396 +++++------ src/services/project.ts | 147 +++-- src/services/projects.ts | 1036 +++++++++++++++-------------- src/services/proxy.ts | 118 ++-- src/services/storage.ts | 451 ++++++------- src/services/teams.ts | 386 +++++------ src/services/users.ts | 1037 +++++++++++++++-------------- src/services/vcs.ts | 220 +++--- 19 files changed, 4865 insertions(+), 4582 deletions(-) diff --git a/src/client.ts b/src/client.ts index fcf0817..cd569c6 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1,5 +1,4 @@ import { Models } from './models'; -import { Service } from './service'; /** * Payload type representing a key-value pair with string keys and any values. @@ -48,7 +47,7 @@ type RealtimeRequest = { /** * Realtime event response structure with generic payload type. */ -export type RealtimeResponseEvent = { +type RealtimeResponseEvent = { /** * List of event names associated with the response. */ @@ -215,7 +214,7 @@ type Realtime = { /** * Type representing upload progress information. */ -export type UploadProgress = { +type UploadProgress = { /** * Identifier for the upload progress. */ @@ -284,6 +283,8 @@ class AppwriteException extends Error { * Client that handles requests to Appwrite */ class Client { + static CHUNK_SIZE = 1024 * 1024 * 5; + /** * Holds configuration such as project. */ @@ -296,7 +297,6 @@ class Client { locale: '', mode: '', }; - /** * Custom headers for API requests. */ @@ -351,7 +351,6 @@ class Client { this.config.project = value; return this; } - /** * Set Key * @@ -366,7 +365,6 @@ class Client { this.config.key = value; return this; } - /** * Set JWT * @@ -381,7 +379,6 @@ class Client { this.config.jwt = value; return this; } - /** * Set Locale * @@ -394,7 +391,6 @@ class Client { this.config.locale = value; return this; } - /** * Set Mode * @@ -408,7 +404,6 @@ class Client { return this; } - private realtime: Realtime = { socket: undefined, timeout: undefined, @@ -592,40 +587,18 @@ class Client { } } - /** - * Call API endpoint with the specified method, URL, headers, and parameters. - * - * @param {string} method - HTTP method (e.g., 'GET', 'POST', 'PUT', 'DELETE'). - * @param {URL} url - The URL of the API endpoint. - * @param {Headers} headers - Custom headers for the API request. - * @param {Payload} params - Request parameters. - * @returns {Promise} - A promise that resolves with the response data. - * - * @typedef {Object} Payload - Request payload data. - * @property {string} key - The key. - * @property {string} value - The value. - */ - async call(method: string, url: URL, headers: Headers = {}, params: Payload = {}): Promise { + prepareRequest(method: string, url: URL, headers: Headers = {}, params: Payload = {}): { uri: string, options: RequestInit } { method = method.toUpperCase(); - headers = Object.assign({}, this.headers, headers); let options: RequestInit = { method, headers, - credentials: 'include' }; - if (typeof window !== 'undefined' && window.localStorage) { - const cookieFallback = window.localStorage.getItem('cookieFallback'); - if (cookieFallback) { - headers['X-Fallback-Cookies'] = cookieFallback; - } - } - if (method === 'GET') { - for (const [key, value] of Object.entries(Service.flatten(params))) { + for (const [key, value] of Object.entries(Client.flatten(params))) { url.searchParams.append(key, value); } } else { @@ -635,15 +608,17 @@ class Client { break; case 'multipart/form-data': - let formData = new FormData(); - - for (const key in params) { - if (Array.isArray(params[key])) { - params[key].forEach((value: any) => { - formData.append(key + '[]', value); - }) + const formData = new FormData(); + + for (const [key, value] of Object.entries(params)) { + if (value instanceof File) { + formData.append(key, value, value.name); + } else if (Array.isArray(value)) { + for (const nestedValue of value) { + formData.append(`${key}[]`, nestedValue); + } } else { - formData.append(key, params[key]); + formData.append(key, value); } } @@ -653,45 +628,121 @@ class Client { } } - try { - let data = null; - const response = await fetch(url.toString(), options); + return { uri: url.toString(), options }; + } + + async chunkedUpload(method: string, url: URL, headers: Headers = {}, originalPayload: Payload = {}, onProgress: (progress: UploadProgress) => void) { + const file = Object.values(originalPayload).find((value) => value instanceof File); + + if (file.size <= Client.CHUNK_SIZE) { + return await this.call(method, url, headers, originalPayload); + } - const warnings = response.headers.get('x-appwrite-warning'); - if (warnings) { - warnings.split(';').forEach((warning: string) => console.warn('Warning: ' + warning)); + let start = 0; + let response = null; + + while (start < file.size) { + let end = start + Client.CHUNK_SIZE; // Prepare end for the next chunk + if (end >= file.size) { + end = file.size; // Adjust for the last chunk to include the last byte } - if (response.headers.get('content-type')?.includes('application/json')) { - data = await response.json(); - } else { - data = { - message: await response.text() - }; + headers['content-range'] = `bytes ${start}-${end-1}/${file.size}`; + const chunk = file.slice(start, end); + + let payload = { ...originalPayload, file: new File([chunk], file.name)}; + + response = await this.call(method, url, headers, payload); + + if (onProgress && typeof onProgress === 'function') { + onProgress({ + $id: response.$id, + progress: Math.round((end / file.size) * 100), + sizeUploaded: end, + chunksTotal: Math.ceil(file.size / Client.CHUNK_SIZE), + chunksUploaded: Math.ceil(end / Client.CHUNK_SIZE) + }); } - if (400 <= response.status) { - throw new AppwriteException(data?.message, response.status, data?.type, data); + if (response && response.$id) { + headers['x-appwrite-id'] = response.$id; } - const cookieFallback = response.headers.get('X-Fallback-Cookies'); + start = end; + } - if (typeof window !== 'undefined' && window.localStorage && cookieFallback) { - window.console.warn('Appwrite is using localStorage for session management. Increase your security by adding a custom domain as your API endpoint.'); - window.localStorage.setItem('cookieFallback', cookieFallback); - } + return response; + } + + async redirect(method: string, url: URL, headers: Headers = {}, params: Payload = {}): Promise { + const { uri, options } = this.prepareRequest(method, url, headers, params); + + const response = await fetch(uri, { + ...options, + redirect: 'manual' + }); + + if (response.status !== 301 && response.status !== 302) { + throw new AppwriteException('Invalid redirect', response.status); + } + + return response.headers.get('location') || ''; + } + + async call(method: string, url: URL, headers: Headers = {}, params: Payload = {}, responseType = 'json'): Promise { + const { uri, options } = this.prepareRequest(method, url, headers, params); + + let data: any = null; + + const response = await fetch(uri, options); + + const warnings = response.headers.get('x-appwrite-warning'); + if (warnings) { + warnings.split(';').forEach((warning: string) => console.warn('Warning: ' + warning)); + } - return data; - } catch (e) { - if (e instanceof AppwriteException) { - throw e; + if (response.headers.get('content-type')?.includes('application/json')) { + data = await response.json(); + } else if (responseType === 'arrayBuffer') { + data = await response.arrayBuffer(); + } else { + data = { + message: await response.text() + }; + } + + if (400 <= response.status) { + throw new AppwriteException(data?.message, response.status, data?.type, data); + } + + const cookieFallback = response.headers.get('X-Fallback-Cookies'); + + if (typeof window !== 'undefined' && window.localStorage && cookieFallback) { + window.console.warn('Appwrite is using localStorage for session management. Increase your security by adding a custom domain as your API endpoint.'); + window.localStorage.setItem('cookieFallback', cookieFallback); + } + + return data; + } + + static flatten(data: Payload, prefix = ''): Payload { + let output: Payload = {}; + + for (const [key, value] of Object.entries(data)) { + let finalKey = prefix ? prefix + '[' + key +']' : key; + if (Array.isArray(value)) { + output = { ...output, ...Client.flatten(value, finalKey) }; + } else { + output[finalKey] = value; } - throw new AppwriteException((e).message); } + + return output; } } export { Client, AppwriteException }; export { Query } from './query'; -export type { Models, Payload }; +export type { Models, Payload, UploadProgress }; +export type { RealtimeResponseEvent }; export type { QueryTypes, QueryTypesList } from './query'; diff --git a/src/services/account.ts b/src/services/account.ts index 7413d4c..4dc514b 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -1,17 +1,15 @@ -import { Service } from '../service'; -import { AppwriteException, Client } from '../client'; +import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; -import type { UploadProgress, Payload } from '../client'; import { AuthenticatorType } from '../enums/authenticator-type'; import { AuthenticationFactor } from '../enums/authentication-factor'; import { OAuthProvider } from '../enums/o-auth-provider'; -export class Account extends Service { +export class Account { + client: Client; - constructor(client: Client) - { - super(client); - } + constructor(client: Client) { + this.client = client; + } /** * Get account @@ -19,135 +17,137 @@ export class Account extends Service { * Get the currently logged in user. * * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise>} + */ async get(): Promise> { const apiPath = '/account'; const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Create account * - * Use this endpoint to allow a new user to register a new account in your - * project. After the user registration completes successfully, you can use - * the - * [/account/verfication](https://appwrite.io/docs/references/cloud/client-web/account#createVerification) - * route to start verifying the user email address. To allow the new user to - * login to their new account, you need to create a new [account - * session](https://appwrite.io/docs/references/cloud/client-web/account#createEmailSession). + * Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [/account/verfication](https://appwrite.io/docs/references/cloud/client-web/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https://appwrite.io/docs/references/cloud/client-web/account#createEmailSession). * * @param {string} userId * @param {string} email * @param {string} password * @param {string} name * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise>} + */ async create(userId: string, email: string, password: string, name?: string): Promise> { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof email === 'undefined') { throw new AppwriteException('Missing required parameter: "email"'); } - if (typeof password === 'undefined') { throw new AppwriteException('Missing required parameter: "password"'); } - const apiPath = '/account'; const payload: Payload = {}; - if (typeof userId !== 'undefined') { payload['userId'] = userId; } - if (typeof email !== 'undefined') { payload['email'] = email; } - if (typeof password !== 'undefined') { payload['password'] = password; } - if (typeof name !== 'undefined') { payload['name'] = name; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Delete account * * Delete the currently logged in user. * * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async delete(): Promise<{}> { const apiPath = '/account'; const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } /** * Update email * - * Update currently logged in user account email address. After changing user - * address, the user confirmation status will get reset. A new confirmation - * email is not sent automatically however you can use the send confirmation - * email endpoint again to send the confirmation email. For security measures, - * user password is required to complete this request. - * This endpoint can also be used to convert an anonymous account to a normal - * one, by passing an email address and a new password. - * + * Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request. +This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password. + * * @param {string} email * @param {string} password * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise>} + */ async updateEmail(email: string, password: string): Promise> { if (typeof email === 'undefined') { throw new AppwriteException('Missing required parameter: "email"'); } - if (typeof password === 'undefined') { throw new AppwriteException('Missing required parameter: "password"'); } - const apiPath = '/account/email'; const payload: Payload = {}; - if (typeof email !== 'undefined') { payload['email'] = email; } - if (typeof password !== 'undefined') { payload['password'] = password; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * List Identities * @@ -155,22 +155,27 @@ export class Account extends Service { * * @param {string[]} queries * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listIdentities(queries?: string[]): Promise { const apiPath = '/account/identities'; const payload: Payload = {}; - if (typeof queries !== 'undefined') { payload['queries'] = queries; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Delete identity * @@ -178,68 +183,79 @@ export class Account extends Service { * * @param {string} identityId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async deleteIdentity(identityId: string): Promise<{}> { if (typeof identityId === 'undefined') { throw new AppwriteException('Missing required parameter: "identityId"'); } - const apiPath = '/account/identities/{identityId}'.replace('{identityId}', identityId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } /** * Create JWT * - * Use this endpoint to create a JSON Web Token. You can use the resulting JWT - * to authenticate on behalf of the current user when working with the - * Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes - * from its creation and will be invalid if the user will logout in that time - * frame. + * Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame. * * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createJWT(): Promise { const apiPath = '/account/jwts'; const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * List logs * - * Get the list of latest security activity logs for the currently logged in - * user. Each log returns user IP address, location and date and time of log. + * Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log. * * @param {string[]} queries * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listLogs(queries?: string[]): Promise { const apiPath = '/account/logs'; const payload: Payload = {}; - if (typeof queries !== 'undefined') { payload['queries'] = queries; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Update MFA * @@ -247,86 +263,93 @@ export class Account extends Service { * * @param {boolean} mfa * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise>} + */ async updateMFA(mfa: boolean): Promise> { if (typeof mfa === 'undefined') { throw new AppwriteException('Missing required parameter: "mfa"'); } - const apiPath = '/account/mfa'; const payload: Payload = {}; - if (typeof mfa !== 'undefined') { payload['mfa'] = mfa; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Create Authenticator * - * Add an authenticator app to be used as an MFA factor. Verify the - * authenticator using the [verify - * authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator) - * method. + * Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator) method. * * @param {AuthenticatorType} type * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createMfaAuthenticator(type: AuthenticatorType): Promise { if (typeof type === 'undefined') { throw new AppwriteException('Missing required parameter: "type"'); } - const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Verify Authenticator * - * Verify an authenticator app after adding it using the [add - * authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) - * method. + * Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method. * * @param {AuthenticatorType} type * @param {string} otp * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise>} + */ async updateMfaAuthenticator(type: AuthenticatorType, otp: string): Promise> { if (typeof type === 'undefined') { throw new AppwriteException('Missing required parameter: "type"'); } - if (typeof otp === 'undefined') { throw new AppwriteException('Missing required parameter: "otp"'); } - const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type); const payload: Payload = {}; - if (typeof otp !== 'undefined') { payload['otp'] = otp; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('put', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'put', + uri, + apiHeaders, + payload + ); + } /** * Delete Authenticator * @@ -334,173 +357,192 @@ export class Account extends Service { * * @param {AuthenticatorType} type * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async deleteMfaAuthenticator(type: AuthenticatorType): Promise<{}> { if (typeof type === 'undefined') { throw new AppwriteException('Missing required parameter: "type"'); } - const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } /** * Create MFA Challenge * - * Begin the process of MFA verification after sign-in. Finish the flow with - * [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) - * method. + * Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method. * * @param {AuthenticationFactor} factor * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createMfaChallenge(factor: AuthenticationFactor): Promise { if (typeof factor === 'undefined') { throw new AppwriteException('Missing required parameter: "factor"'); } - const apiPath = '/account/mfa/challenge'; const payload: Payload = {}; - if (typeof factor !== 'undefined') { payload['factor'] = factor; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Create MFA Challenge (confirmation) * - * Complete the MFA challenge by providing the one-time password. Finish the - * process of MFA verification by providing the one-time password. To begin - * the flow, use - * [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) - * method. + * Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. * * @param {string} challengeId * @param {string} otp * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async updateMfaChallenge(challengeId: string, otp: string): Promise<{}> { if (typeof challengeId === 'undefined') { throw new AppwriteException('Missing required parameter: "challengeId"'); } - if (typeof otp === 'undefined') { throw new AppwriteException('Missing required parameter: "otp"'); } - const apiPath = '/account/mfa/challenge'; const payload: Payload = {}; - if (typeof challengeId !== 'undefined') { payload['challengeId'] = challengeId; } - if (typeof otp !== 'undefined') { payload['otp'] = otp; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('put', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'put', + uri, + apiHeaders, + payload + ); + } /** * List Factors * * List the factors available on the account to be used as a MFA challange. * * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listMfaFactors(): Promise { const apiPath = '/account/mfa/factors'; const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Get MFA Recovery Codes * - * Get recovery codes that can be used as backup for MFA flow. Before getting - * codes, they must be generated using - * [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) - * method. An OTP challenge is required to read recovery codes. + * Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes. * * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getMfaRecoveryCodes(): Promise { const apiPath = '/account/mfa/recovery-codes'; const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Create MFA Recovery Codes * - * Generate recovery codes as backup for MFA flow. It's recommended to - * generate and show then immediately after user successfully adds their - * authehticator. Recovery codes can be used as a MFA verification type in - * [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) - * method. + * Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. * * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createMfaRecoveryCodes(): Promise { const apiPath = '/account/mfa/recovery-codes'; const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Regenerate MFA Recovery Codes * - * Regenerate recovery codes that can be used as backup for MFA flow. Before - * regenerating codes, they must be first generated using - * [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) - * method. An OTP challenge is required to regenreate recovery codes. + * Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes. * * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateMfaRecoveryCodes(): Promise { const apiPath = '/account/mfa/recovery-codes'; const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Update name * @@ -508,618 +550,626 @@ export class Account extends Service { * * @param {string} name * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise>} + */ async updateName(name: string): Promise> { if (typeof name === 'undefined') { throw new AppwriteException('Missing required parameter: "name"'); } - const apiPath = '/account/name'; const payload: Payload = {}; - if (typeof name !== 'undefined') { payload['name'] = name; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Update password * - * Update currently logged in user password. For validation, user is required - * to pass in the new password, and the old password. For users created with - * OAuth, Team Invites and Magic URL, oldPassword is optional. + * Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional. * * @param {string} password * @param {string} oldPassword * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise>} + */ async updatePassword(password: string, oldPassword?: string): Promise> { if (typeof password === 'undefined') { throw new AppwriteException('Missing required parameter: "password"'); } - const apiPath = '/account/password'; const payload: Payload = {}; - if (typeof password !== 'undefined') { payload['password'] = password; } - if (typeof oldPassword !== 'undefined') { payload['oldPassword'] = oldPassword; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Update phone * - * Update the currently logged in user's phone number. After updating the - * phone number, the phone verification status will be reset. A confirmation - * SMS is not sent automatically, however you can use the [POST - * /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification) - * endpoint to send a confirmation SMS. + * Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification) endpoint to send a confirmation SMS. * * @param {string} phone * @param {string} password * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise>} + */ async updatePhone(phone: string, password: string): Promise> { if (typeof phone === 'undefined') { throw new AppwriteException('Missing required parameter: "phone"'); } - if (typeof password === 'undefined') { throw new AppwriteException('Missing required parameter: "password"'); } - const apiPath = '/account/phone'; const payload: Payload = {}; - if (typeof phone !== 'undefined') { payload['phone'] = phone; } - if (typeof password !== 'undefined') { payload['password'] = password; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Get account preferences * * Get the preferences as a key-value object for the currently logged in user. * * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getPrefs(): Promise { const apiPath = '/account/prefs'; const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Update preferences * - * Update currently logged in user account preferences. The object you pass is - * stored as is, and replaces any previous value. The maximum allowed prefs - * size is 64kB and throws error if exceeded. + * Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded. * * @param {Partial} prefs * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise>} + */ async updatePrefs(prefs: Partial): Promise> { if (typeof prefs === 'undefined') { throw new AppwriteException('Missing required parameter: "prefs"'); } - const apiPath = '/account/prefs'; const payload: Payload = {}; - if (typeof prefs !== 'undefined') { payload['prefs'] = prefs; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Create password recovery * - * Sends the user an email with a temporary secret key for password reset. - * When the user clicks the confirmation link he is redirected back to your - * app password reset URL with the secret key and email address values - * attached to the URL query string. Use the query string params to submit a - * request to the [PUT - * /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#updateRecovery) - * endpoint to complete the process. The verification link sent to the user's - * email address is valid for 1 hour. + * Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour. * * @param {string} email * @param {string} url * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createRecovery(email: string, url: string): Promise { if (typeof email === 'undefined') { throw new AppwriteException('Missing required parameter: "email"'); } - if (typeof url === 'undefined') { throw new AppwriteException('Missing required parameter: "url"'); } - const apiPath = '/account/recovery'; const payload: Payload = {}; - if (typeof email !== 'undefined') { payload['email'] = email; } - if (typeof url !== 'undefined') { payload['url'] = url; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Create password recovery (confirmation) * - * Use this endpoint to complete the user account password reset. Both the - * **userId** and **secret** arguments will be passed as query parameters to - * the redirect URL you have provided when sending your request to the [POST - * /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#createRecovery) - * endpoint. - * - * Please note that in order to avoid a [Redirect - * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) - * the only valid redirect URLs are the ones from domains you have set when - * adding your platforms in the console interface. + * Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#createRecovery) endpoint. + +Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. * * @param {string} userId * @param {string} secret * @param {string} password * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateRecovery(userId: string, secret: string, password: string): Promise { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof secret === 'undefined') { throw new AppwriteException('Missing required parameter: "secret"'); } - if (typeof password === 'undefined') { throw new AppwriteException('Missing required parameter: "password"'); } - const apiPath = '/account/recovery'; const payload: Payload = {}; - if (typeof userId !== 'undefined') { payload['userId'] = userId; } - if (typeof secret !== 'undefined') { payload['secret'] = secret; } - if (typeof password !== 'undefined') { payload['password'] = password; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('put', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'put', + uri, + apiHeaders, + payload + ); + } /** * List sessions * - * Get the list of active sessions across different devices for the currently - * logged in user. + * Get the list of active sessions across different devices for the currently logged in user. * * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listSessions(): Promise { const apiPath = '/account/sessions'; const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Delete sessions * - * Delete all sessions from the user account and remove any sessions cookies - * from the end client. + * Delete all sessions from the user account and remove any sessions cookies from the end client. * * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async deleteSessions(): Promise<{}> { const apiPath = '/account/sessions'; const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } /** * Create anonymous session * - * Use this endpoint to allow a new user to register an anonymous account in - * your project. This route will also create a new session for the user. To - * allow the new user to convert an anonymous account to a normal account, you - * need to update its [email and - * password](https://appwrite.io/docs/references/cloud/client-web/account#updateEmail) - * or create an [OAuth2 - * session](https://appwrite.io/docs/references/cloud/client-web/account#CreateOAuth2Session). + * Use this endpoint to allow a new user to register an anonymous account in your project. This route will also create a new session for the user. To allow the new user to convert an anonymous account to a normal account, you need to update its [email and password](https://appwrite.io/docs/references/cloud/client-web/account#updateEmail) or create an [OAuth2 session](https://appwrite.io/docs/references/cloud/client-web/account#CreateOAuth2Session). * * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createAnonymousSession(): Promise { const apiPath = '/account/sessions/anonymous'; const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Create email password session * - * Allow the user to login into their account by providing a valid email and - * password combination. This route will create a new session for the user. - * - * A user is limited to 10 active sessions at a time by default. [Learn more - * about session - * limits](https://appwrite.io/docs/authentication-security#limits). + * Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user. + +A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). * * @param {string} email * @param {string} password * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createEmailPasswordSession(email: string, password: string): Promise { if (typeof email === 'undefined') { throw new AppwriteException('Missing required parameter: "email"'); } - if (typeof password === 'undefined') { throw new AppwriteException('Missing required parameter: "password"'); } - const apiPath = '/account/sessions/email'; const payload: Payload = {}; - if (typeof email !== 'undefined') { payload['email'] = email; } - if (typeof password !== 'undefined') { payload['password'] = password; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Update magic URL session * - * Use this endpoint to create a session from token. Provide the **userId** - * and **secret** parameters from the successful response of authentication - * flows initiated by token creation. For example, magic URL and phone login. + * Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login. * * @param {string} userId * @param {string} secret * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateMagicURLSession(userId: string, secret: string): Promise { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof secret === 'undefined') { throw new AppwriteException('Missing required parameter: "secret"'); } - const apiPath = '/account/sessions/magic-url'; const payload: Payload = {}; - if (typeof userId !== 'undefined') { payload['userId'] = userId; } - if (typeof secret !== 'undefined') { payload['secret'] = secret; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('put', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'put', + uri, + apiHeaders, + payload + ); + } /** * Create OAuth2 session * - * Allow the user to login to their account using the OAuth2 provider of their - * choice. Each OAuth2 provider should be enabled from the Appwrite console - * first. Use the success and failure arguments to provide a redirect URL's - * back to your app when login is completed. - * - * If there is already an active session, the new session will be attached to - * the logged-in account. If there are no active sessions, the server will - * attempt to look for a user with the same email address as the email - * received from the OAuth2 provider and attach the new session to the - * existing user. If no matching user is found - the server will create a new - * user. - * - * A user is limited to 10 active sessions at a time by default. [Learn more - * about session - * limits](https://appwrite.io/docs/authentication-security#limits). - * + * Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. + +If there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user. + +A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). + * * @param {OAuthProvider} provider * @param {string} success * @param {string} failure * @param {string[]} scopes * @throws {AppwriteException} - * @returns {void|string} - */ - createOAuth2Session(provider: OAuthProvider, success?: string, failure?: string, scopes?: string[]): void | URL { + * @returns {Promise} + */ + async createOAuth2Session(provider: OAuthProvider, success?: string, failure?: string, scopes?: string[]): Promise { if (typeof provider === 'undefined') { throw new AppwriteException('Missing required parameter: "provider"'); } - const apiPath = '/account/sessions/oauth2/{provider}'.replace('{provider}', provider); const payload: Payload = {}; - if (typeof success !== 'undefined') { payload['success'] = success; } - if (typeof failure !== 'undefined') { payload['failure'] = failure; } - if (typeof scopes !== 'undefined') { payload['scopes'] = scopes; } - const uri = new URL(this.client.config.endpoint + apiPath); - payload['project'] = this.client.config.project; - - for (const [key, value] of Object.entries(Service.flatten(payload))) { - uri.searchParams.append(key, value); + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', } - if (typeof window !== 'undefined' && window?.location) { - window.location.href = uri.toString(); - } else { - return uri; + + const location = await this.client.redirect( + 'get', + uri, + apiHeaders, + payload + ); + if (typeof window !== 'undefined') { + window.location.href = location; } + return location.toString(); } - /** * Update phone session * - * Use this endpoint to create a session from token. Provide the **userId** - * and **secret** parameters from the successful response of authentication - * flows initiated by token creation. For example, magic URL and phone login. + * Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login. * * @param {string} userId * @param {string} secret * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updatePhoneSession(userId: string, secret: string): Promise { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof secret === 'undefined') { throw new AppwriteException('Missing required parameter: "secret"'); } - const apiPath = '/account/sessions/phone'; const payload: Payload = {}; - if (typeof userId !== 'undefined') { payload['userId'] = userId; } - if (typeof secret !== 'undefined') { payload['secret'] = secret; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('put', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'put', + uri, + apiHeaders, + payload + ); + } /** * Create session * - * Use this endpoint to create a session from token. Provide the **userId** - * and **secret** parameters from the successful response of authentication - * flows initiated by token creation. For example, magic URL and phone login. + * Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login. * * @param {string} userId * @param {string} secret * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createSession(userId: string, secret: string): Promise { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof secret === 'undefined') { throw new AppwriteException('Missing required parameter: "secret"'); } - const apiPath = '/account/sessions/token'; const payload: Payload = {}; - if (typeof userId !== 'undefined') { payload['userId'] = userId; } - if (typeof secret !== 'undefined') { payload['secret'] = secret; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Get session * - * Use this endpoint to get a logged in user's session using a Session ID. - * Inputting 'current' will return the current session being used. + * Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used. * * @param {string} sessionId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getSession(sessionId: string): Promise { if (typeof sessionId === 'undefined') { throw new AppwriteException('Missing required parameter: "sessionId"'); } - const apiPath = '/account/sessions/{sessionId}'.replace('{sessionId}', sessionId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Update session * - * Use this endpoint to extend a session's length. Extending a session is - * useful when session expiry is short. If the session was created using an - * OAuth provider, this endpoint refreshes the access token from the provider. + * Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider. * * @param {string} sessionId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateSession(sessionId: string): Promise { if (typeof sessionId === 'undefined') { throw new AppwriteException('Missing required parameter: "sessionId"'); } - const apiPath = '/account/sessions/{sessionId}'.replace('{sessionId}', sessionId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Delete session * - * Logout the user. Use 'current' as the session ID to logout on this device, - * use a session ID to logout on another device. If you're looking to logout - * the user on all devices, use [Delete - * Sessions](https://appwrite.io/docs/references/cloud/client-web/account#deleteSessions) - * instead. + * Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https://appwrite.io/docs/references/cloud/client-web/account#deleteSessions) instead. * * @param {string} sessionId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async deleteSession(sessionId: string): Promise<{}> { if (typeof sessionId === 'undefined') { throw new AppwriteException('Missing required parameter: "sessionId"'); } - const apiPath = '/account/sessions/{sessionId}'.replace('{sessionId}', sessionId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } /** * Update status * - * Block the currently logged in user account. Behind the scene, the user - * record is not deleted but permanently blocked from any access. To - * completely delete a user, use the Users API instead. + * Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead. * * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise>} + */ async updateStatus(): Promise> { const apiPath = '/account/status'; const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Create push target * @@ -1128,38 +1178,39 @@ export class Account extends Service { * @param {string} identifier * @param {string} providerId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createPushTarget(targetId: string, identifier: string, providerId?: string): Promise { if (typeof targetId === 'undefined') { throw new AppwriteException('Missing required parameter: "targetId"'); } - if (typeof identifier === 'undefined') { throw new AppwriteException('Missing required parameter: "identifier"'); } - const apiPath = '/account/targets/push'; const payload: Payload = {}; - if (typeof targetId !== 'undefined') { payload['targetId'] = targetId; } - if (typeof identifier !== 'undefined') { payload['identifier'] = identifier; } - if (typeof providerId !== 'undefined') { payload['providerId'] = providerId; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Update push target * @@ -1167,408 +1218,373 @@ export class Account extends Service { * @param {string} targetId * @param {string} identifier * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updatePushTarget(targetId: string, identifier: string): Promise { if (typeof targetId === 'undefined') { throw new AppwriteException('Missing required parameter: "targetId"'); } - if (typeof identifier === 'undefined') { throw new AppwriteException('Missing required parameter: "identifier"'); } - const apiPath = '/account/targets/{targetId}/push'.replace('{targetId}', targetId); const payload: Payload = {}; - if (typeof identifier !== 'undefined') { payload['identifier'] = identifier; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('put', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'put', + uri, + apiHeaders, + payload + ); + } /** * Delete push target * * * @param {string} targetId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async deletePushTarget(targetId: string): Promise<{}> { if (typeof targetId === 'undefined') { throw new AppwriteException('Missing required parameter: "targetId"'); } - const apiPath = '/account/targets/{targetId}/push'.replace('{targetId}', targetId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } /** * Create email token (OTP) * - * Sends the user an email with a secret key for creating a session. If the - * provided user ID has not be registered, a new user will be created. Use the - * returned user ID and secret and submit a request to the [POST - * /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) - * endpoint to complete the login process. The secret sent to the user's email - * is valid for 15 minutes. - * - * A user is limited to 10 active sessions at a time by default. [Learn more - * about session - * limits](https://appwrite.io/docs/authentication-security#limits). + * Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes. + +A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). * * @param {string} userId * @param {string} email * @param {boolean} phrase * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createEmailToken(userId: string, email: string, phrase?: boolean): Promise { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof email === 'undefined') { throw new AppwriteException('Missing required parameter: "email"'); } - const apiPath = '/account/tokens/email'; const payload: Payload = {}; - if (typeof userId !== 'undefined') { payload['userId'] = userId; } - if (typeof email !== 'undefined') { payload['email'] = email; } - if (typeof phrase !== 'undefined') { payload['phrase'] = phrase; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Create magic URL token * - * Sends the user an email with a secret key for creating a session. If the - * provided user ID has not been registered, a new user will be created. When - * the user clicks the link in the email, the user is redirected back to the - * URL you provided with the secret key and userId values attached to the URL - * query string. Use the query string parameters to submit a request to the - * [POST - * /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) - * endpoint to complete the login process. The link sent to the user's email - * address is valid for 1 hour. If you are on a mobile device you can leave - * the URL parameter empty, so that the login completion will be handled by - * your Appwrite instance by default. - * - * A user is limited to 10 active sessions at a time by default. [Learn more - * about session - * limits](https://appwrite.io/docs/authentication-security#limits). - * + * Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default. + +A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). + * * @param {string} userId * @param {string} email * @param {string} url * @param {boolean} phrase * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createMagicURLToken(userId: string, email: string, url?: string, phrase?: boolean): Promise { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof email === 'undefined') { throw new AppwriteException('Missing required parameter: "email"'); } - const apiPath = '/account/tokens/magic-url'; const payload: Payload = {}; - if (typeof userId !== 'undefined') { payload['userId'] = userId; } - if (typeof email !== 'undefined') { payload['email'] = email; } - if (typeof url !== 'undefined') { payload['url'] = url; } - if (typeof phrase !== 'undefined') { payload['phrase'] = phrase; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Create OAuth2 token * - * Allow the user to login to their account using the OAuth2 provider of their - * choice. Each OAuth2 provider should be enabled from the Appwrite console - * first. Use the success and failure arguments to provide a redirect URL's - * back to your app when login is completed. - * - * If authentication succeeds, `userId` and `secret` of a token will be - * appended to the success URL as query parameters. These can be used to - * create a new session using the [Create - * session](https://appwrite.io/docs/references/cloud/client-web/account#createSession) - * endpoint. - * - * A user is limited to 10 active sessions at a time by default. [Learn more - * about session - * limits](https://appwrite.io/docs/authentication-security#limits). + * Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. + +If authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint. + +A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). * * @param {OAuthProvider} provider * @param {string} success * @param {string} failure * @param {string[]} scopes * @throws {AppwriteException} - * @returns {void|string} - */ - createOAuth2Token(provider: OAuthProvider, success?: string, failure?: string, scopes?: string[]): void | URL { + * @returns {Promise} + */ + async createOAuth2Token(provider: OAuthProvider, success?: string, failure?: string, scopes?: string[]): Promise { if (typeof provider === 'undefined') { throw new AppwriteException('Missing required parameter: "provider"'); } - const apiPath = '/account/tokens/oauth2/{provider}'.replace('{provider}', provider); const payload: Payload = {}; - if (typeof success !== 'undefined') { payload['success'] = success; } - if (typeof failure !== 'undefined') { payload['failure'] = failure; } - if (typeof scopes !== 'undefined') { payload['scopes'] = scopes; } - const uri = new URL(this.client.config.endpoint + apiPath); - payload['project'] = this.client.config.project; - - for (const [key, value] of Object.entries(Service.flatten(payload))) { - uri.searchParams.append(key, value); + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', } - if (typeof window !== 'undefined' && window?.location) { - window.location.href = uri.toString(); - } else { - return uri; + + const location = await this.client.redirect( + 'get', + uri, + apiHeaders, + payload + ); + if (typeof window !== 'undefined') { + window.location.href = location; } + return location.toString(); } - /** * Create phone token * - * Sends the user an SMS with a secret key for creating a session. If the - * provided user ID has not be registered, a new user will be created. Use the - * returned user ID and secret and submit a request to the [POST - * /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) - * endpoint to complete the login process. The secret sent to the user's phone - * is valid for 15 minutes. - * - * A user is limited to 10 active sessions at a time by default. [Learn more - * about session - * limits](https://appwrite.io/docs/authentication-security#limits). + * Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes. + +A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). * * @param {string} userId * @param {string} phone * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createPhoneToken(userId: string, phone: string): Promise { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof phone === 'undefined') { throw new AppwriteException('Missing required parameter: "phone"'); } - const apiPath = '/account/tokens/phone'; const payload: Payload = {}; - if (typeof userId !== 'undefined') { payload['userId'] = userId; } - if (typeof phone !== 'undefined') { payload['phone'] = phone; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Create email verification * - * Use this endpoint to send a verification message to your user email address - * to confirm they are the valid owners of that address. Both the **userId** - * and **secret** arguments will be passed as query parameters to the URL you - * have provided to be attached to the verification email. The provided URL - * should redirect the user back to your app and allow you to complete the - * verification process by verifying both the **userId** and **secret** - * parameters. Learn more about how to [complete the verification - * process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). - * The verification link sent to the user's email address is valid for 7 days. - * - * Please note that in order to avoid a [Redirect - * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), - * the only valid redirect URLs are the ones from domains you have set when - * adding your platforms in the console interface. - * + * Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). The verification link sent to the user's email address is valid for 7 days. + +Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. + * * @param {string} url * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createVerification(url: string): Promise { if (typeof url === 'undefined') { throw new AppwriteException('Missing required parameter: "url"'); } - const apiPath = '/account/verification'; const payload: Payload = {}; - if (typeof url !== 'undefined') { payload['url'] = url; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Create email verification (confirmation) * - * Use this endpoint to complete the user email verification process. Use both - * the **userId** and **secret** parameters that were attached to your app URL - * to verify the user email ownership. If confirmed this route will return a - * 200 status code. + * Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code. * * @param {string} userId * @param {string} secret * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateVerification(userId: string, secret: string): Promise { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof secret === 'undefined') { throw new AppwriteException('Missing required parameter: "secret"'); } - const apiPath = '/account/verification'; const payload: Payload = {}; - if (typeof userId !== 'undefined') { payload['userId'] = userId; } - if (typeof secret !== 'undefined') { payload['secret'] = secret; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('put', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'put', + uri, + apiHeaders, + payload + ); + } /** * Create phone verification * - * Use this endpoint to send a verification SMS to the currently logged in - * user. This endpoint is meant for use after updating a user's phone number - * using the - * [accountUpdatePhone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhone) - * endpoint. Learn more about how to [complete the verification - * process](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneVerification). - * The verification code sent to the user's phone number is valid for 15 - * minutes. + * Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes. * * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createPhoneVerification(): Promise { const apiPath = '/account/verification/phone'; const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Update phone verification (confirmation) * - * Use this endpoint to complete the user phone verification process. Use the - * **userId** and **secret** that were sent to your user's phone number to - * verify the user email ownership. If confirmed this route will return a 200 - * status code. + * Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code. * * @param {string} userId * @param {string} secret * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updatePhoneVerification(userId: string, secret: string): Promise { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof secret === 'undefined') { throw new AppwriteException('Missing required parameter: "secret"'); } - const apiPath = '/account/verification/phone'; const payload: Payload = {}; - if (typeof userId !== 'undefined') { payload['userId'] = userId; } - if (typeof secret !== 'undefined') { payload['secret'] = secret; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('put', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); + } + + return await this.client.call( + 'put', + uri, + apiHeaders, + payload + ); } -}; +} diff --git a/src/services/assistant.ts b/src/services/assistant.ts index 108aa25..610a008 100644 --- a/src/services/assistant.ts +++ b/src/services/assistant.ts @@ -1,14 +1,12 @@ -import { Service } from '../service'; -import { AppwriteException, Client } from '../client'; +import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; -import type { UploadProgress, Payload } from '../client'; -export class Assistant extends Service { +export class Assistant { + client: Client; - constructor(client: Client) - { - super(client); - } + constructor(client: Client) { + this.client = client; + } /** * Ask Query @@ -16,23 +14,28 @@ export class Assistant extends Service { * * @param {string} prompt * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async chat(prompt: string): Promise<{}> { if (typeof prompt === 'undefined') { throw new AppwriteException('Missing required parameter: "prompt"'); } - const apiPath = '/console/assistant'; const payload: Payload = {}; - if (typeof prompt !== 'undefined') { payload['prompt'] = prompt; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); + } + + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); } -}; +} diff --git a/src/services/avatars.ts b/src/services/avatars.ts index 6c775fc..ab76ccb 100644 --- a/src/services/avatars.ts +++ b/src/services/avatars.ts @@ -1,357 +1,314 @@ -import { Service } from '../service'; -import { AppwriteException, Client } from '../client'; +import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; -import type { UploadProgress, Payload } from '../client'; import { Browser } from '../enums/browser'; import { CreditCard } from '../enums/credit-card'; import { Flag } from '../enums/flag'; -export class Avatars extends Service { +export class Avatars { + client: Client; - constructor(client: Client) - { - super(client); - } + constructor(client: Client) { + this.client = client; + } /** * Get browser icon * - * You can use this endpoint to show different browser icons to your users. - * The code argument receives the browser code as it appears in your user [GET - * /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) - * endpoint. Use width, height and quality arguments to change the output - * settings. - * - * When one dimension is specified and the other is 0, the image is scaled - * with preserved aspect ratio. If both dimensions are 0, the API provides an - * image at source quality. If dimensions are not specified, the default size - * of image returned is 100x100px. + * You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings. + +When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. * * @param {Browser} code * @param {number} width * @param {number} height * @param {number} quality * @throws {AppwriteException} - * @returns {URL} - */ - getBrowser(code: Browser, width?: number, height?: number, quality?: number): URL { + * @returns {string} + */ + getBrowser(code: Browser, width?: number, height?: number, quality?: number): string { if (typeof code === 'undefined') { throw new AppwriteException('Missing required parameter: "code"'); } - const apiPath = '/avatars/browsers/{code}'.replace('{code}', code); const payload: Payload = {}; - if (typeof width !== 'undefined') { payload['width'] = width; } - if (typeof height !== 'undefined') { payload['height'] = height; } - if (typeof quality !== 'undefined') { payload['quality'] = quality; } - const uri = new URL(this.client.config.endpoint + apiPath); - payload['project'] = this.client.config.project; + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + payload['project'] = this.client.config.project; - for (const [key, value] of Object.entries(Service.flatten(payload))) { + for (const [key, value] of Object.entries(Client.flatten(payload))) { uri.searchParams.append(key, value); } - return uri; - } + return uri.toString(); + } /** * Get credit card icon * - * The credit card endpoint will return you the icon of the credit card - * provider you need. Use width, height and quality arguments to change the - * output settings. - * - * When one dimension is specified and the other is 0, the image is scaled - * with preserved aspect ratio. If both dimensions are 0, the API provides an - * image at source quality. If dimensions are not specified, the default size - * of image returned is 100x100px. - * + * The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings. + +When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. + * * @param {CreditCard} code * @param {number} width * @param {number} height * @param {number} quality * @throws {AppwriteException} - * @returns {URL} - */ - getCreditCard(code: CreditCard, width?: number, height?: number, quality?: number): URL { + * @returns {string} + */ + getCreditCard(code: CreditCard, width?: number, height?: number, quality?: number): string { if (typeof code === 'undefined') { throw new AppwriteException('Missing required parameter: "code"'); } - const apiPath = '/avatars/credit-cards/{code}'.replace('{code}', code); const payload: Payload = {}; - if (typeof width !== 'undefined') { payload['width'] = width; } - if (typeof height !== 'undefined') { payload['height'] = height; } - if (typeof quality !== 'undefined') { payload['quality'] = quality; } - const uri = new URL(this.client.config.endpoint + apiPath); - payload['project'] = this.client.config.project; + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + payload['project'] = this.client.config.project; - for (const [key, value] of Object.entries(Service.flatten(payload))) { + for (const [key, value] of Object.entries(Client.flatten(payload))) { uri.searchParams.append(key, value); } - return uri; - } + return uri.toString(); + } /** * Get favicon * - * Use this endpoint to fetch the favorite icon (AKA favicon) of any remote - * website URL. - * - * This endpoint does not follow HTTP redirects. + * Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL. + +This endpoint does not follow HTTP redirects. * * @param {string} url * @throws {AppwriteException} - * @returns {URL} - */ - getFavicon(url: string): URL { + * @returns {string} + */ + getFavicon(url: string): string { if (typeof url === 'undefined') { throw new AppwriteException('Missing required parameter: "url"'); } - const apiPath = '/avatars/favicon'; const payload: Payload = {}; - if (typeof url !== 'undefined') { payload['url'] = url; } - const uri = new URL(this.client.config.endpoint + apiPath); - payload['project'] = this.client.config.project; + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + payload['project'] = this.client.config.project; - for (const [key, value] of Object.entries(Service.flatten(payload))) { + for (const [key, value] of Object.entries(Client.flatten(payload))) { uri.searchParams.append(key, value); } - return uri; - } + return uri.toString(); + } /** * Get country flag * - * You can use this endpoint to show different country flags icons to your - * users. The code argument receives the 2 letter country code. Use width, - * height and quality arguments to change the output settings. Country codes - * follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard. - * - * When one dimension is specified and the other is 0, the image is scaled - * with preserved aspect ratio. If both dimensions are 0, the API provides an - * image at source quality. If dimensions are not specified, the default size - * of image returned is 100x100px. - * + * You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard. + +When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. + * * @param {Flag} code * @param {number} width * @param {number} height * @param {number} quality * @throws {AppwriteException} - * @returns {URL} - */ - getFlag(code: Flag, width?: number, height?: number, quality?: number): URL { + * @returns {string} + */ + getFlag(code: Flag, width?: number, height?: number, quality?: number): string { if (typeof code === 'undefined') { throw new AppwriteException('Missing required parameter: "code"'); } - const apiPath = '/avatars/flags/{code}'.replace('{code}', code); const payload: Payload = {}; - if (typeof width !== 'undefined') { payload['width'] = width; } - if (typeof height !== 'undefined') { payload['height'] = height; } - if (typeof quality !== 'undefined') { payload['quality'] = quality; } - const uri = new URL(this.client.config.endpoint + apiPath); - payload['project'] = this.client.config.project; + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + payload['project'] = this.client.config.project; - for (const [key, value] of Object.entries(Service.flatten(payload))) { + for (const [key, value] of Object.entries(Client.flatten(payload))) { uri.searchParams.append(key, value); } - return uri; - } + return uri.toString(); + } /** * Get image from URL * - * Use this endpoint to fetch a remote image URL and crop it to any image size - * you want. This endpoint is very useful if you need to crop and display - * remote images in your app or in case you want to make sure a 3rd party - * image is properly served using a TLS protocol. - * - * When one dimension is specified and the other is 0, the image is scaled - * with preserved aspect ratio. If both dimensions are 0, the API provides an - * image at source quality. If dimensions are not specified, the default size - * of image returned is 400x400px. - * - * This endpoint does not follow HTTP redirects. + * Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol. + +When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px. + +This endpoint does not follow HTTP redirects. * * @param {string} url * @param {number} width * @param {number} height * @throws {AppwriteException} - * @returns {URL} - */ - getImage(url: string, width?: number, height?: number): URL { + * @returns {string} + */ + getImage(url: string, width?: number, height?: number): string { if (typeof url === 'undefined') { throw new AppwriteException('Missing required parameter: "url"'); } - const apiPath = '/avatars/image'; const payload: Payload = {}; - if (typeof url !== 'undefined') { payload['url'] = url; } - if (typeof width !== 'undefined') { payload['width'] = width; } - if (typeof height !== 'undefined') { payload['height'] = height; } - const uri = new URL(this.client.config.endpoint + apiPath); - payload['project'] = this.client.config.project; + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + payload['project'] = this.client.config.project; - for (const [key, value] of Object.entries(Service.flatten(payload))) { + for (const [key, value] of Object.entries(Client.flatten(payload))) { uri.searchParams.append(key, value); } - return uri; - } + return uri.toString(); + } /** * Get user initials * - * Use this endpoint to show your user initials avatar icon on your website or - * app. By default, this route will try to print your logged-in user name or - * email initials. You can also overwrite the user name if you pass the 'name' - * parameter. If no name is given and no user is logged, an empty avatar will - * be returned. - * - * You can use the color and background params to change the avatar colors. By - * default, a random theme will be selected. The random theme will persist for - * the user's initials when reloading the same theme will always return for - * the same initials. - * - * When one dimension is specified and the other is 0, the image is scaled - * with preserved aspect ratio. If both dimensions are 0, the API provides an - * image at source quality. If dimensions are not specified, the default size - * of image returned is 100x100px. - * + * Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned. + +You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials. + +When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. + * * @param {string} name * @param {number} width * @param {number} height * @param {string} background * @throws {AppwriteException} - * @returns {URL} - */ - getInitials(name?: string, width?: number, height?: number, background?: string): URL { + * @returns {string} + */ + getInitials(name?: string, width?: number, height?: number, background?: string): string { const apiPath = '/avatars/initials'; const payload: Payload = {}; - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof width !== 'undefined') { payload['width'] = width; } - if (typeof height !== 'undefined') { payload['height'] = height; } - if (typeof background !== 'undefined') { payload['background'] = background; } - const uri = new URL(this.client.config.endpoint + apiPath); - payload['project'] = this.client.config.project; + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } - for (const [key, value] of Object.entries(Service.flatten(payload))) { + payload['project'] = this.client.config.project; + + for (const [key, value] of Object.entries(Client.flatten(payload))) { uri.searchParams.append(key, value); } - return uri; - } + return uri.toString(); + } /** * Get QR code * - * Converts a given plain text to a QR code image. You can use the query - * parameters to change the size and style of the resulting image. - * + * Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image. + * * @param {string} text * @param {number} size * @param {number} margin * @param {boolean} download * @throws {AppwriteException} - * @returns {URL} - */ - getQR(text: string, size?: number, margin?: number, download?: boolean): URL { + * @returns {string} + */ + getQR(text: string, size?: number, margin?: number, download?: boolean): string { if (typeof text === 'undefined') { throw new AppwriteException('Missing required parameter: "text"'); } - const apiPath = '/avatars/qr'; const payload: Payload = {}; - if (typeof text !== 'undefined') { payload['text'] = text; } - if (typeof size !== 'undefined') { payload['size'] = size; } - if (typeof margin !== 'undefined') { payload['margin'] = margin; } - if (typeof download !== 'undefined') { payload['download'] = download; } - const uri = new URL(this.client.config.endpoint + apiPath); - payload['project'] = this.client.config.project; + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } - for (const [key, value] of Object.entries(Service.flatten(payload))) { + payload['project'] = this.client.config.project; + + for (const [key, value] of Object.entries(Client.flatten(payload))) { uri.searchParams.append(key, value); } - return uri; + + return uri.toString(); } -}; +} diff --git a/src/services/console.ts b/src/services/console.ts index 4ac795c..dddba0b 100644 --- a/src/services/console.ts +++ b/src/services/console.ts @@ -1,14 +1,12 @@ -import { Service } from '../service'; -import { AppwriteException, Client } from '../client'; +import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; -import type { UploadProgress, Payload } from '../client'; -export class Console extends Service { +export class Console { + client: Client; - constructor(client: Client) - { - super(client); - } + constructor(client: Client) { + this.client = client; + } /** * Get variables @@ -16,15 +14,22 @@ export class Console extends Service { * Get all Environment Variables that are relevant for the console. * * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async variables(): Promise { const apiPath = '/console/variables'; const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); + } + + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); } -}; +} diff --git a/src/services/databases.ts b/src/services/databases.ts index 01ddb78..2ce4821 100644 --- a/src/services/databases.ts +++ b/src/services/databases.ts @@ -1,136 +1,147 @@ -import { Service } from '../service'; -import { AppwriteException, Client } from '../client'; +import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; -import type { UploadProgress, Payload } from '../client'; import { DatabaseUsageRange } from '../enums/database-usage-range'; import { RelationshipType } from '../enums/relationship-type'; import { RelationMutate } from '../enums/relation-mutate'; import { IndexType } from '../enums/index-type'; -export class Databases extends Service { +export class Databases { + client: Client; - constructor(client: Client) - { - super(client); - } + constructor(client: Client) { + this.client = client; + } /** * List databases * - * Get a list of all databases from the current Appwrite project. You can use - * the search parameter to filter your results. + * Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results. * * @param {string[]} queries * @param {string} search * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async list(queries?: string[], search?: string): Promise { const apiPath = '/databases'; const payload: Payload = {}; - if (typeof queries !== 'undefined') { payload['queries'] = queries; } - if (typeof search !== 'undefined') { payload['search'] = search; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Create database * * Create a new Database. - * + * * @param {string} databaseId * @param {string} name * @param {boolean} enabled * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async create(databaseId: string, name: string, enabled?: boolean): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof name === 'undefined') { throw new AppwriteException('Missing required parameter: "name"'); } - const apiPath = '/databases'; const payload: Payload = {}; - if (typeof databaseId !== 'undefined') { payload['databaseId'] = databaseId; } - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Get databases usage stats * * * @param {DatabaseUsageRange} range * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getUsage(range?: DatabaseUsageRange): Promise { const apiPath = '/databases/usage'; const payload: Payload = {}; - if (typeof range !== 'undefined') { payload['range'] = range; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Get database * - * Get a database by its unique ID. This endpoint response returns a JSON - * object with the database metadata. + * Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata. * * @param {string} databaseId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async get(databaseId: string): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - const apiPath = '/databases/{databaseId}'.replace('{databaseId}', databaseId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Update database * @@ -140,99 +151,104 @@ export class Databases extends Service { * @param {string} name * @param {boolean} enabled * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async update(databaseId: string, name: string, enabled?: boolean): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof name === 'undefined') { throw new AppwriteException('Missing required parameter: "name"'); } - const apiPath = '/databases/{databaseId}'.replace('{databaseId}', databaseId); const payload: Payload = {}; - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('put', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'put', + uri, + apiHeaders, + payload + ); + } /** * Delete database * - * Delete a database by its unique ID. Only API keys with with databases.write - * scope can delete a database. + * Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database. * * @param {string} databaseId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async delete(databaseId: string): Promise<{}> { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - const apiPath = '/databases/{databaseId}'.replace('{databaseId}', databaseId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } /** * List collections * - * Get a list of all collections that belong to the provided databaseId. You - * can use the search parameter to filter your results. + * Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results. * * @param {string} databaseId * @param {string[]} queries * @param {string} search * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listCollections(databaseId: string, queries?: string[], search?: string): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - const apiPath = '/databases/{databaseId}/collections'.replace('{databaseId}', databaseId); const payload: Payload = {}; - if (typeof queries !== 'undefined') { payload['queries'] = queries; } - if (typeof search !== 'undefined') { payload['search'] = search; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Create collection * - * Create a new Collection. Before using this route, you should create a new - * database resource using either a [server - * integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) - * API or directly from your database console. + * Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. * * @param {string} databaseId * @param {string} collectionId @@ -241,79 +257,80 @@ export class Databases extends Service { * @param {boolean} documentSecurity * @param {boolean} enabled * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createCollection(databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - if (typeof name === 'undefined') { throw new AppwriteException('Missing required parameter: "name"'); } - const apiPath = '/databases/{databaseId}/collections'.replace('{databaseId}', databaseId); const payload: Payload = {}; - if (typeof collectionId !== 'undefined') { payload['collectionId'] = collectionId; } - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof permissions !== 'undefined') { payload['permissions'] = permissions; } - if (typeof documentSecurity !== 'undefined') { payload['documentSecurity'] = documentSecurity; } - if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Get collection * - * Get a collection by its unique ID. This endpoint response returns a JSON - * object with the collection metadata. + * Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata. * * @param {string} databaseId * @param {string} collectionId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getCollection(databaseId: string, collectionId: string): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Update collection * @@ -326,75 +343,77 @@ export class Databases extends Service { * @param {boolean} documentSecurity * @param {boolean} enabled * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateCollection(databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - if (typeof name === 'undefined') { throw new AppwriteException('Missing required parameter: "name"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); const payload: Payload = {}; - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof permissions !== 'undefined') { payload['permissions'] = permissions; } - if (typeof documentSecurity !== 'undefined') { payload['documentSecurity'] = documentSecurity; } - if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('put', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'put', + uri, + apiHeaders, + payload + ); + } /** * Delete collection * - * Delete a collection by its unique ID. Only users with write permissions - * have access to delete this resource. + * Delete a collection by its unique ID. Only users with write permissions have access to delete this resource. * * @param {string} databaseId * @param {string} collectionId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async deleteCollection(databaseId: string, collectionId: string): Promise<{}> { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } /** * List attributes * @@ -404,35 +423,38 @@ export class Databases extends Service { * @param {string} collectionId * @param {string[]} queries * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listAttributes(databaseId: string, collectionId: string, queries?: string[]): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); const payload: Payload = {}; - if (typeof queries !== 'undefined') { payload['queries'] = queries; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Create boolean attribute * * Create a boolean attribute. - * + * * @param {string} databaseId * @param {string} collectionId @@ -441,55 +463,52 @@ export class Databases extends Service { * @param {boolean} xdefault * @param {boolean} array * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createBooleanAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: boolean, array?: boolean): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - if (typeof key === 'undefined') { throw new AppwriteException('Missing required parameter: "key"'); } - if (typeof required === 'undefined') { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); const payload: Payload = {}; - if (typeof key !== 'undefined') { payload['key'] = key; } - if (typeof required !== 'undefined') { payload['required'] = required; } - if (typeof xdefault !== 'undefined') { payload['default'] = xdefault; } - if (typeof array !== 'undefined') { payload['array'] = array; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Update boolean attribute * - * Update a boolean attribute. Changing the `default` value will not update - * already existing documents. + * Update a boolean attribute. Changing the `default` value will not update already existing documents. * * @param {string} databaseId * @param {string} collectionId @@ -497,46 +516,45 @@ export class Databases extends Service { * @param {boolean} required * @param {boolean} xdefault * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateBooleanAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: boolean): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - if (typeof key === 'undefined') { throw new AppwriteException('Missing required parameter: "key"'); } - if (typeof required === 'undefined') { throw new AppwriteException('Missing required parameter: "required"'); } - if (typeof xdefault === 'undefined') { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); const payload: Payload = {}; - if (typeof required !== 'undefined') { payload['required'] = required; } - if (typeof xdefault !== 'undefined') { payload['default'] = xdefault; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Create datetime attribute * @@ -549,55 +567,52 @@ export class Databases extends Service { * @param {string} xdefault * @param {boolean} array * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createDatetimeAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - if (typeof key === 'undefined') { throw new AppwriteException('Missing required parameter: "key"'); } - if (typeof required === 'undefined') { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); const payload: Payload = {}; - if (typeof key !== 'undefined') { payload['key'] = key; } - if (typeof required !== 'undefined') { payload['required'] = required; } - if (typeof xdefault !== 'undefined') { payload['default'] = xdefault; } - if (typeof array !== 'undefined') { payload['array'] = array; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Update dateTime attribute * - * Update a date time attribute. Changing the `default` value will not update - * already existing documents. + * Update a date time attribute. Changing the `default` value will not update already existing documents. * * @param {string} databaseId * @param {string} collectionId @@ -605,51 +620,50 @@ export class Databases extends Service { * @param {boolean} required * @param {string} xdefault * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateDatetimeAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - if (typeof key === 'undefined') { throw new AppwriteException('Missing required parameter: "key"'); } - if (typeof required === 'undefined') { throw new AppwriteException('Missing required parameter: "required"'); } - if (typeof xdefault === 'undefined') { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); const payload: Payload = {}; - if (typeof required !== 'undefined') { payload['required'] = required; } - if (typeof xdefault !== 'undefined') { payload['default'] = xdefault; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Create email attribute * * Create an email attribute. - * + * * @param {string} databaseId * @param {string} collectionId @@ -658,56 +672,53 @@ export class Databases extends Service { * @param {string} xdefault * @param {boolean} array * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createEmailAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - if (typeof key === 'undefined') { throw new AppwriteException('Missing required parameter: "key"'); } - if (typeof required === 'undefined') { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/email'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); const payload: Payload = {}; - if (typeof key !== 'undefined') { payload['key'] = key; } - if (typeof required !== 'undefined') { payload['required'] = required; } - if (typeof xdefault !== 'undefined') { payload['default'] = xdefault; } - if (typeof array !== 'undefined') { payload['array'] = array; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Update email attribute * - * Update an email attribute. Changing the `default` value will not update - * already existing documents. - * + * Update an email attribute. Changing the `default` value will not update already existing documents. + * * @param {string} databaseId * @param {string} collectionId @@ -715,52 +726,50 @@ export class Databases extends Service { * @param {boolean} required * @param {string} xdefault * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateEmailAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - if (typeof key === 'undefined') { throw new AppwriteException('Missing required parameter: "key"'); } - if (typeof required === 'undefined') { throw new AppwriteException('Missing required parameter: "required"'); } - if (typeof xdefault === 'undefined') { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/email/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); const payload: Payload = {}; - if (typeof required !== 'undefined') { payload['required'] = required; } - if (typeof xdefault !== 'undefined') { payload['default'] = xdefault; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Create enum attribute * - * Create an enumeration attribute. The `elements` param acts as a white-list - * of accepted values for this attribute. - * + * Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute. + * * @param {string} databaseId * @param {string} collectionId @@ -770,64 +779,59 @@ export class Databases extends Service { * @param {string} xdefault * @param {boolean} array * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createEnumAttribute(databaseId: string, collectionId: string, key: string, elements: string[], required: boolean, xdefault?: string, array?: boolean): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - if (typeof key === 'undefined') { throw new AppwriteException('Missing required parameter: "key"'); } - if (typeof elements === 'undefined') { throw new AppwriteException('Missing required parameter: "elements"'); } - if (typeof required === 'undefined') { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/enum'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); const payload: Payload = {}; - if (typeof key !== 'undefined') { payload['key'] = key; } - if (typeof elements !== 'undefined') { payload['elements'] = elements; } - if (typeof required !== 'undefined') { payload['required'] = required; } - if (typeof xdefault !== 'undefined') { payload['default'] = xdefault; } - if (typeof array !== 'undefined') { payload['array'] = array; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Update enum attribute * - * Update an enum attribute. Changing the `default` value will not update - * already existing documents. - * + * Update an enum attribute. Changing the `default` value will not update already existing documents. + * * @param {string} databaseId * @param {string} collectionId @@ -836,60 +840,56 @@ export class Databases extends Service { * @param {boolean} required * @param {string} xdefault * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateEnumAttribute(databaseId: string, collectionId: string, key: string, elements: string[], required: boolean, xdefault?: string): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - if (typeof key === 'undefined') { throw new AppwriteException('Missing required parameter: "key"'); } - if (typeof elements === 'undefined') { throw new AppwriteException('Missing required parameter: "elements"'); } - if (typeof required === 'undefined') { throw new AppwriteException('Missing required parameter: "required"'); } - if (typeof xdefault === 'undefined') { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); const payload: Payload = {}; - if (typeof elements !== 'undefined') { payload['elements'] = elements; } - if (typeof required !== 'undefined') { payload['required'] = required; } - if (typeof xdefault !== 'undefined') { payload['default'] = xdefault; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Create float attribute * - * Create a float attribute. Optionally, minimum and maximum values can be - * provided. - * + * Create a float attribute. Optionally, minimum and maximum values can be provided. + * * @param {string} databaseId * @param {string} collectionId @@ -900,64 +900,59 @@ export class Databases extends Service { * @param {number} xdefault * @param {boolean} array * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - if (typeof key === 'undefined') { throw new AppwriteException('Missing required parameter: "key"'); } - if (typeof required === 'undefined') { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/float'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); const payload: Payload = {}; - if (typeof key !== 'undefined') { payload['key'] = key; } - if (typeof required !== 'undefined') { payload['required'] = required; } - if (typeof min !== 'undefined') { payload['min'] = min; } - if (typeof max !== 'undefined') { payload['max'] = max; } - if (typeof xdefault !== 'undefined') { payload['default'] = xdefault; } - if (typeof array !== 'undefined') { payload['array'] = array; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Update float attribute * - * Update a float attribute. Changing the `default` value will not update - * already existing documents. - * + * Update a float attribute. Changing the `default` value will not update already existing documents. + * * @param {string} databaseId * @param {string} collectionId @@ -967,68 +962,62 @@ export class Databases extends Service { * @param {number} max * @param {number} xdefault * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateFloatAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min: number, max: number, xdefault?: number): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - if (typeof key === 'undefined') { throw new AppwriteException('Missing required parameter: "key"'); } - if (typeof required === 'undefined') { throw new AppwriteException('Missing required parameter: "required"'); } - if (typeof min === 'undefined') { throw new AppwriteException('Missing required parameter: "min"'); } - if (typeof max === 'undefined') { throw new AppwriteException('Missing required parameter: "max"'); } - if (typeof xdefault === 'undefined') { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/float/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); const payload: Payload = {}; - if (typeof required !== 'undefined') { payload['required'] = required; } - if (typeof min !== 'undefined') { payload['min'] = min; } - if (typeof max !== 'undefined') { payload['max'] = max; } - if (typeof xdefault !== 'undefined') { payload['default'] = xdefault; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Create integer attribute * - * Create an integer attribute. Optionally, minimum and maximum values can be - * provided. - * + * Create an integer attribute. Optionally, minimum and maximum values can be provided. + * * @param {string} databaseId * @param {string} collectionId @@ -1039,64 +1028,59 @@ export class Databases extends Service { * @param {number} xdefault * @param {boolean} array * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - if (typeof key === 'undefined') { throw new AppwriteException('Missing required parameter: "key"'); } - if (typeof required === 'undefined') { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/integer'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); const payload: Payload = {}; - if (typeof key !== 'undefined') { payload['key'] = key; } - if (typeof required !== 'undefined') { payload['required'] = required; } - if (typeof min !== 'undefined') { payload['min'] = min; } - if (typeof max !== 'undefined') { payload['max'] = max; } - if (typeof xdefault !== 'undefined') { payload['default'] = xdefault; } - if (typeof array !== 'undefined') { payload['array'] = array; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Update integer attribute * - * Update an integer attribute. Changing the `default` value will not update - * already existing documents. - * + * Update an integer attribute. Changing the `default` value will not update already existing documents. + * * @param {string} databaseId * @param {string} collectionId @@ -1106,67 +1090,62 @@ export class Databases extends Service { * @param {number} max * @param {number} xdefault * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min: number, max: number, xdefault?: number): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - if (typeof key === 'undefined') { throw new AppwriteException('Missing required parameter: "key"'); } - if (typeof required === 'undefined') { throw new AppwriteException('Missing required parameter: "required"'); } - if (typeof min === 'undefined') { throw new AppwriteException('Missing required parameter: "min"'); } - if (typeof max === 'undefined') { throw new AppwriteException('Missing required parameter: "max"'); } - if (typeof xdefault === 'undefined') { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/integer/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); const payload: Payload = {}; - if (typeof required !== 'undefined') { payload['required'] = required; } - if (typeof min !== 'undefined') { payload['min'] = min; } - if (typeof max !== 'undefined') { payload['max'] = max; } - if (typeof xdefault !== 'undefined') { payload['default'] = xdefault; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Create IP address attribute * * Create IP address attribute. - * + * * @param {string} databaseId * @param {string} collectionId @@ -1175,56 +1154,53 @@ export class Databases extends Service { * @param {string} xdefault * @param {boolean} array * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createIpAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - if (typeof key === 'undefined') { throw new AppwriteException('Missing required parameter: "key"'); } - if (typeof required === 'undefined') { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/ip'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); const payload: Payload = {}; - if (typeof key !== 'undefined') { payload['key'] = key; } - if (typeof required !== 'undefined') { payload['required'] = required; } - if (typeof xdefault !== 'undefined') { payload['default'] = xdefault; } - if (typeof array !== 'undefined') { payload['array'] = array; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Update IP address attribute * - * Update an ip attribute. Changing the `default` value will not update - * already existing documents. - * + * Update an ip attribute. Changing the `default` value will not update already existing documents. + * * @param {string} databaseId * @param {string} collectionId @@ -1232,52 +1208,50 @@ export class Databases extends Service { * @param {boolean} required * @param {string} xdefault * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateIpAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - if (typeof key === 'undefined') { throw new AppwriteException('Missing required parameter: "key"'); } - if (typeof required === 'undefined') { throw new AppwriteException('Missing required parameter: "required"'); } - if (typeof xdefault === 'undefined') { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/ip/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); const payload: Payload = {}; - if (typeof required !== 'undefined') { payload['required'] = required; } - if (typeof xdefault !== 'undefined') { payload['default'] = xdefault; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Create relationship attribute * - * Create relationship attribute. [Learn more about relationship - * attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). - * + * Create relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). + * * @param {string} databaseId * @param {string} collectionId @@ -1288,63 +1262,59 @@ export class Databases extends Service { * @param {string} twoWayKey * @param {RelationMutate} onDelete * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createRelationshipAttribute(databaseId: string, collectionId: string, relatedCollectionId: string, type: RelationshipType, twoWay?: boolean, key?: string, twoWayKey?: string, onDelete?: RelationMutate): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - if (typeof relatedCollectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "relatedCollectionId"'); } - if (typeof type === 'undefined') { throw new AppwriteException('Missing required parameter: "type"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/relationship'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); const payload: Payload = {}; - if (typeof relatedCollectionId !== 'undefined') { payload['relatedCollectionId'] = relatedCollectionId; } - if (typeof type !== 'undefined') { payload['type'] = type; } - if (typeof twoWay !== 'undefined') { payload['twoWay'] = twoWay; } - if (typeof key !== 'undefined') { payload['key'] = key; } - if (typeof twoWayKey !== 'undefined') { payload['twoWayKey'] = twoWayKey; } - if (typeof onDelete !== 'undefined') { payload['onDelete'] = onDelete; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Create string attribute * * Create a string attribute. - * + * * @param {string} databaseId * @param {string} collectionId @@ -1355,68 +1325,62 @@ export class Databases extends Service { * @param {boolean} array * @param {boolean} encrypt * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createStringAttribute(databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - if (typeof key === 'undefined') { throw new AppwriteException('Missing required parameter: "key"'); } - if (typeof size === 'undefined') { throw new AppwriteException('Missing required parameter: "size"'); } - if (typeof required === 'undefined') { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/string'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); const payload: Payload = {}; - if (typeof key !== 'undefined') { payload['key'] = key; } - if (typeof size !== 'undefined') { payload['size'] = size; } - if (typeof required !== 'undefined') { payload['required'] = required; } - if (typeof xdefault !== 'undefined') { payload['default'] = xdefault; } - if (typeof array !== 'undefined') { payload['array'] = array; } - if (typeof encrypt !== 'undefined') { payload['encrypt'] = encrypt; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Update string attribute * - * Update a string attribute. Changing the `default` value will not update - * already existing documents. - * + * Update a string attribute. Changing the `default` value will not update already existing documents. + * * @param {string} databaseId * @param {string} collectionId @@ -1424,51 +1388,50 @@ export class Databases extends Service { * @param {boolean} required * @param {string} xdefault * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateStringAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - if (typeof key === 'undefined') { throw new AppwriteException('Missing required parameter: "key"'); } - if (typeof required === 'undefined') { throw new AppwriteException('Missing required parameter: "required"'); } - if (typeof xdefault === 'undefined') { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/string/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); const payload: Payload = {}; - if (typeof required !== 'undefined') { payload['required'] = required; } - if (typeof xdefault !== 'undefined') { payload['default'] = xdefault; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Create URL attribute * * Create a URL attribute. - * + * * @param {string} databaseId * @param {string} collectionId @@ -1477,56 +1440,53 @@ export class Databases extends Service { * @param {string} xdefault * @param {boolean} array * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createUrlAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - if (typeof key === 'undefined') { throw new AppwriteException('Missing required parameter: "key"'); } - if (typeof required === 'undefined') { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/url'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); const payload: Payload = {}; - if (typeof key !== 'undefined') { payload['key'] = key; } - if (typeof required !== 'undefined') { payload['required'] = required; } - if (typeof xdefault !== 'undefined') { payload['default'] = xdefault; } - if (typeof array !== 'undefined') { payload['array'] = array; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Update URL attribute * - * Update an url attribute. Changing the `default` value will not update - * already existing documents. - * + * Update an url attribute. Changing the `default` value will not update already existing documents. + * * @param {string} databaseId * @param {string} collectionId @@ -1534,46 +1494,45 @@ export class Databases extends Service { * @param {boolean} required * @param {string} xdefault * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateUrlAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - if (typeof key === 'undefined') { throw new AppwriteException('Missing required parameter: "key"'); } - if (typeof required === 'undefined') { throw new AppwriteException('Missing required parameter: "required"'); } - if (typeof xdefault === 'undefined') { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/url/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); const payload: Payload = {}; - if (typeof required !== 'undefined') { payload['required'] = required; } - if (typeof xdefault !== 'undefined') { payload['default'] = xdefault; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Get attribute * @@ -1583,30 +1542,33 @@ export class Databases extends Service { * @param {string} collectionId * @param {string} key * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async getAttribute(databaseId: string, collectionId: string, key: string): Promise<{}> { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - if (typeof key === 'undefined') { throw new AppwriteException('Missing required parameter: "key"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Delete attribute * @@ -1616,111 +1578,114 @@ export class Databases extends Service { * @param {string} collectionId * @param {string} key * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async deleteAttribute(databaseId: string, collectionId: string, key: string): Promise<{}> { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - if (typeof key === 'undefined') { throw new AppwriteException('Missing required parameter: "key"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } /** * Update relationship attribute * - * Update relationship attribute. [Learn more about relationship - * attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). - * + * Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). + * * @param {string} databaseId * @param {string} collectionId * @param {string} key * @param {RelationMutate} onDelete * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateRelationshipAttribute(databaseId: string, collectionId: string, key: string, onDelete?: RelationMutate): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - if (typeof key === 'undefined') { throw new AppwriteException('Missing required parameter: "key"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); const payload: Payload = {}; - if (typeof onDelete !== 'undefined') { payload['onDelete'] = onDelete; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * List documents * - * Get a list of all the user's documents in a given collection. You can use - * the query params to filter your results. + * Get a list of all the user's documents in a given collection. You can use the query params to filter your results. * * @param {string} databaseId * @param {string} collectionId * @param {string[]} queries * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise>} + */ async listDocuments(databaseId: string, collectionId: string, queries?: string[]): Promise> { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); const payload: Payload = {}; - if (typeof queries !== 'undefined') { payload['queries'] = queries; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Create document * - * Create a new Document. Before using this route, you should create a new - * collection resource using either a [server - * integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) - * API or directly from your database console. + * Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. * * @param {string} databaseId * @param {string} collectionId @@ -1728,90 +1693,89 @@ export class Databases extends Service { * @param {Omit} data * @param {string[]} permissions * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createDocument(databaseId: string, collectionId: string, documentId: string, data: Omit, permissions?: string[]): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - if (typeof documentId === 'undefined') { throw new AppwriteException('Missing required parameter: "documentId"'); } - if (typeof data === 'undefined') { throw new AppwriteException('Missing required parameter: "data"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); const payload: Payload = {}; - if (typeof documentId !== 'undefined') { payload['documentId'] = documentId; } - if (typeof data !== 'undefined') { payload['data'] = data; } - if (typeof permissions !== 'undefined') { payload['permissions'] = permissions; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Get document * - * Get a document by its unique ID. This endpoint response returns a JSON - * object with the document data. + * Get a document by its unique ID. This endpoint response returns a JSON object with the document data. * * @param {string} databaseId * @param {string} collectionId * @param {string} documentId * @param {string[]} queries * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getDocument(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - if (typeof documentId === 'undefined') { throw new AppwriteException('Missing required parameter: "documentId"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId); const payload: Payload = {}; - if (typeof queries !== 'undefined') { payload['queries'] = queries; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Update document * - * Update a document by its unique ID. Using the patch method you can pass - * only specific fields that will get updated. + * Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated. * * @param {string} databaseId * @param {string} collectionId @@ -1819,38 +1783,39 @@ export class Databases extends Service { * @param {Partial>} data * @param {string[]} permissions * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateDocument(databaseId: string, collectionId: string, documentId: string, data?: Partial>, permissions?: string[]): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - if (typeof documentId === 'undefined') { throw new AppwriteException('Missing required parameter: "documentId"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId); const payload: Payload = {}; - if (typeof data !== 'undefined') { payload['data'] = data; } - if (typeof permissions !== 'undefined') { payload['permissions'] = permissions; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Delete document * @@ -1860,30 +1825,33 @@ export class Databases extends Service { * @param {string} collectionId * @param {string} documentId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async deleteDocument(databaseId: string, collectionId: string, documentId: string): Promise<{}> { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - if (typeof documentId === 'undefined') { throw new AppwriteException('Missing required parameter: "documentId"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } /** * List document logs * @@ -1894,34 +1862,36 @@ export class Databases extends Service { * @param {string} documentId * @param {string[]} queries * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listDocumentLogs(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - if (typeof documentId === 'undefined') { throw new AppwriteException('Missing required parameter: "documentId"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/logs'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId); const payload: Payload = {}; - if (typeof queries !== 'undefined') { payload['queries'] = queries; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * List indexes * @@ -1931,36 +1901,38 @@ export class Databases extends Service { * @param {string} collectionId * @param {string[]} queries * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listIndexes(databaseId: string, collectionId: string, queries?: string[]): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); const payload: Payload = {}; - if (typeof queries !== 'undefined') { payload['queries'] = queries; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Create index * - * Creates an index on the attributes listed. Your index should include all - * the attributes you will query in a single request. - * Attributes can be `key`, `fulltext`, and `unique`. + * Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request. +Attributes can be `key`, `fulltext`, and `unique`. * * @param {string} databaseId * @param {string} collectionId @@ -1969,54 +1941,51 @@ export class Databases extends Service { * @param {string[]} attributes * @param {string[]} orders * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createIndex(databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[]): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - if (typeof key === 'undefined') { throw new AppwriteException('Missing required parameter: "key"'); } - if (typeof type === 'undefined') { throw new AppwriteException('Missing required parameter: "type"'); } - if (typeof attributes === 'undefined') { throw new AppwriteException('Missing required parameter: "attributes"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); const payload: Payload = {}; - if (typeof key !== 'undefined') { payload['key'] = key; } - if (typeof type !== 'undefined') { payload['type'] = type; } - if (typeof attributes !== 'undefined') { payload['attributes'] = attributes; } - if (typeof orders !== 'undefined') { payload['orders'] = orders; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Get index * @@ -2026,30 +1995,33 @@ export class Databases extends Service { * @param {string} collectionId * @param {string} key * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getIndex(databaseId: string, collectionId: string, key: string): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - if (typeof key === 'undefined') { throw new AppwriteException('Missing required parameter: "key"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Delete index * @@ -2059,30 +2031,33 @@ export class Databases extends Service { * @param {string} collectionId * @param {string} key * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async deleteIndex(databaseId: string, collectionId: string, key: string): Promise<{}> { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - if (typeof key === 'undefined') { throw new AppwriteException('Missing required parameter: "key"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } /** * List collection logs * @@ -2092,30 +2067,33 @@ export class Databases extends Service { * @param {string} collectionId * @param {string[]} queries * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listCollectionLogs(databaseId: string, collectionId: string, queries?: string[]): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/logs'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); const payload: Payload = {}; - if (typeof queries !== 'undefined') { payload['queries'] = queries; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Get collection usage stats * @@ -2124,30 +2102,33 @@ export class Databases extends Service { * @param {string} collectionId * @param {DatabaseUsageRange} range * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getCollectionUsage(databaseId: string, collectionId: string, range?: DatabaseUsageRange): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - if (typeof collectionId === 'undefined') { throw new AppwriteException('Missing required parameter: "collectionId"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/usage'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); const payload: Payload = {}; - if (typeof range !== 'undefined') { payload['range'] = range; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * List database logs * @@ -2156,26 +2137,30 @@ export class Databases extends Service { * @param {string} databaseId * @param {string[]} queries * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listLogs(databaseId: string, queries?: string[]): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - const apiPath = '/databases/{databaseId}/logs'.replace('{databaseId}', databaseId); const payload: Payload = {}; - if (typeof queries !== 'undefined') { payload['queries'] = queries; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Get database usage stats * @@ -2183,23 +2168,28 @@ export class Databases extends Service { * @param {string} databaseId * @param {DatabaseUsageRange} range * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getDatabaseUsage(databaseId: string, range?: DatabaseUsageRange): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } - const apiPath = '/databases/{databaseId}/usage'.replace('{databaseId}', databaseId); const payload: Payload = {}; - if (typeof range !== 'undefined') { payload['range'] = range; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); + } + + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); } -}; +} diff --git a/src/services/functions.ts b/src/services/functions.ts index 1ff4b3a..8b0ac4e 100644 --- a/src/services/functions.ts +++ b/src/services/functions.ts @@ -1,54 +1,52 @@ -import { Service } from '../service'; -import { AppwriteException, Client } from '../client'; +import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; -import type { UploadProgress, Payload } from '../client'; import { Runtime } from '../enums/runtime'; import { FunctionUsageRange } from '../enums/function-usage-range'; import { ExecutionMethod } from '../enums/execution-method'; -export class Functions extends Service { +export class Functions { + client: Client; - constructor(client: Client) - { - super(client); - } + constructor(client: Client) { + this.client = client; + } /** * List functions * - * Get a list of all the project's functions. You can use the query params to - * filter your results. + * Get a list of all the project's functions. You can use the query params to filter your results. * * @param {string[]} queries * @param {string} search * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async list(queries?: string[], search?: string): Promise { const apiPath = '/functions'; const payload: Payload = {}; - if (typeof queries !== 'undefined') { payload['queries'] = queries; } - if (typeof search !== 'undefined') { payload['search'] = search; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Create function * - * Create a new function. You can pass a list of - * [permissions](https://appwrite.io/docs/permissions) to allow different - * project users or team with access to execute the function using the client - * API. + * Create a new function. You can pass a list of [permissions](https://appwrite.io/docs/permissions) to allow different project users or team with access to execute the function using the client API. * * @param {string} functionId * @param {string} name @@ -72,219 +70,215 @@ export class Functions extends Service { * @param {string} templateRootDirectory * @param {string} templateVersion * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async create(functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, templateRepository?: string, templateOwner?: string, templateRootDirectory?: string, templateVersion?: string): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } - if (typeof name === 'undefined') { throw new AppwriteException('Missing required parameter: "name"'); } - if (typeof runtime === 'undefined') { throw new AppwriteException('Missing required parameter: "runtime"'); } - const apiPath = '/functions'; const payload: Payload = {}; - if (typeof functionId !== 'undefined') { payload['functionId'] = functionId; } - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof runtime !== 'undefined') { payload['runtime'] = runtime; } - if (typeof execute !== 'undefined') { payload['execute'] = execute; } - if (typeof events !== 'undefined') { payload['events'] = events; } - if (typeof schedule !== 'undefined') { payload['schedule'] = schedule; } - if (typeof timeout !== 'undefined') { payload['timeout'] = timeout; } - if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - if (typeof logging !== 'undefined') { payload['logging'] = logging; } - if (typeof entrypoint !== 'undefined') { payload['entrypoint'] = entrypoint; } - if (typeof commands !== 'undefined') { payload['commands'] = commands; } - if (typeof scopes !== 'undefined') { payload['scopes'] = scopes; } - if (typeof installationId !== 'undefined') { payload['installationId'] = installationId; } - if (typeof providerRepositoryId !== 'undefined') { payload['providerRepositoryId'] = providerRepositoryId; } - if (typeof providerBranch !== 'undefined') { payload['providerBranch'] = providerBranch; } - if (typeof providerSilentMode !== 'undefined') { payload['providerSilentMode'] = providerSilentMode; } - if (typeof providerRootDirectory !== 'undefined') { payload['providerRootDirectory'] = providerRootDirectory; } - if (typeof templateRepository !== 'undefined') { payload['templateRepository'] = templateRepository; } - if (typeof templateOwner !== 'undefined') { payload['templateOwner'] = templateOwner; } - if (typeof templateRootDirectory !== 'undefined') { payload['templateRootDirectory'] = templateRootDirectory; } - if (typeof templateVersion !== 'undefined') { payload['templateVersion'] = templateVersion; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * List runtimes * * Get a list of all runtimes that are currently active on your instance. * * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listRuntimes(): Promise { const apiPath = '/functions/runtimes'; const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * List function templates * - * List available function templates. You can use template details in - * [createFunction](/docs/references/cloud/server-nodejs/functions#create) - * method. + * List available function templates. You can use template details in [createFunction](/docs/references/cloud/server-nodejs/functions#create) method. * * @param {string[]} runtimes * @param {string[]} useCases * @param {number} limit * @param {number} offset * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listTemplates(runtimes?: string[], useCases?: string[], limit?: number, offset?: number): Promise { const apiPath = '/functions/templates'; const payload: Payload = {}; - if (typeof runtimes !== 'undefined') { payload['runtimes'] = runtimes; } - if (typeof useCases !== 'undefined') { payload['useCases'] = useCases; } - if (typeof limit !== 'undefined') { payload['limit'] = limit; } - if (typeof offset !== 'undefined') { payload['offset'] = offset; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Get function template * - * Get a function template using ID. You can use template details in - * [createFunction](/docs/references/cloud/server-nodejs/functions#create) - * method. + * Get a function template using ID. You can use template details in [createFunction](/docs/references/cloud/server-nodejs/functions#create) method. * * @param {string} templateId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getTemplate(templateId: string): Promise { if (typeof templateId === 'undefined') { throw new AppwriteException('Missing required parameter: "templateId"'); } - const apiPath = '/functions/templates/{templateId}'.replace('{templateId}', templateId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Get functions usage * * * @param {FunctionUsageRange} range * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getUsage(range?: FunctionUsageRange): Promise { const apiPath = '/functions/usage'; const payload: Payload = {}; - if (typeof range !== 'undefined') { payload['range'] = range; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Get function * @@ -292,22 +286,27 @@ export class Functions extends Service { * * @param {string} functionId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async get(functionId: string): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } - const apiPath = '/functions/{functionId}'.replace('{functionId}', functionId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Update function * @@ -331,90 +330,78 @@ export class Functions extends Service { * @param {boolean} providerSilentMode * @param {string} providerRootDirectory * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async update(functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } - if (typeof name === 'undefined') { throw new AppwriteException('Missing required parameter: "name"'); } - const apiPath = '/functions/{functionId}'.replace('{functionId}', functionId); const payload: Payload = {}; - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof runtime !== 'undefined') { payload['runtime'] = runtime; } - if (typeof execute !== 'undefined') { payload['execute'] = execute; } - if (typeof events !== 'undefined') { payload['events'] = events; } - if (typeof schedule !== 'undefined') { payload['schedule'] = schedule; } - if (typeof timeout !== 'undefined') { payload['timeout'] = timeout; } - if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - if (typeof logging !== 'undefined') { payload['logging'] = logging; } - if (typeof entrypoint !== 'undefined') { payload['entrypoint'] = entrypoint; } - if (typeof commands !== 'undefined') { payload['commands'] = commands; } - if (typeof scopes !== 'undefined') { payload['scopes'] = scopes; } - if (typeof installationId !== 'undefined') { payload['installationId'] = installationId; } - if (typeof providerRepositoryId !== 'undefined') { payload['providerRepositoryId'] = providerRepositoryId; } - if (typeof providerBranch !== 'undefined') { payload['providerBranch'] = providerBranch; } - if (typeof providerSilentMode !== 'undefined') { payload['providerSilentMode'] = providerSilentMode; } - if (typeof providerRootDirectory !== 'undefined') { payload['providerRootDirectory'] = providerRootDirectory; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('put', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'put', + uri, + apiHeaders, + payload + ); + } /** * Delete function * @@ -422,69 +409,71 @@ export class Functions extends Service { * * @param {string} functionId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async delete(functionId: string): Promise<{}> { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } - const apiPath = '/functions/{functionId}'.replace('{functionId}', functionId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } /** * List deployments * - * Get a list of all the project's code deployments. You can use the query - * params to filter your results. + * Get a list of all the project's code deployments. You can use the query params to filter your results. * * @param {string} functionId * @param {string[]} queries * @param {string} search * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listDeployments(functionId: string, queries?: string[], search?: string): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } - const apiPath = '/functions/{functionId}/deployments'.replace('{functionId}', functionId); const payload: Payload = {}; - if (typeof queries !== 'undefined') { payload['queries'] = queries; } - if (typeof search !== 'undefined') { payload['search'] = search; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Create deployment * - * Create a new function code deployment. Use this endpoint to upload a new - * version of your code function. To execute your newly uploaded code, you'll - * need to update the function's deployment to use your new deployment UID. - * - * This endpoint accepts a tar.gz file compressed with your code. Make sure to - * include any dependencies your code has within the compressed file. You can - * learn more about code packaging in the [Appwrite Cloud Functions - * tutorial](https://appwrite.io/docs/functions). - * - * Use the "command" param to set the entrypoint used to execute your code. + * Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID. + +This endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https://appwrite.io/docs/functions). + +Use the "command" param to set the entrypoint used to execute your code. * * @param {string} functionId * @param {File} code @@ -492,87 +481,46 @@ export class Functions extends Service { * @param {string} entrypoint * @param {string} commands * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createDeployment(functionId: string, code: File, activate: boolean, entrypoint?: string, commands?: string, onProgress = (progress: UploadProgress) => {}): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } - if (typeof code === 'undefined') { throw new AppwriteException('Missing required parameter: "code"'); } - if (typeof activate === 'undefined') { throw new AppwriteException('Missing required parameter: "activate"'); } - const apiPath = '/functions/{functionId}/deployments'.replace('{functionId}', functionId); const payload: Payload = {}; - if (typeof entrypoint !== 'undefined') { payload['entrypoint'] = entrypoint; } - if (typeof commands !== 'undefined') { payload['commands'] = commands; } - if (typeof code !== 'undefined') { payload['code'] = code; } - if (typeof activate !== 'undefined') { payload['activate'] = activate; } - const uri = new URL(this.client.config.endpoint + apiPath); - if(!(code instanceof File)) { - throw new AppwriteException('Parameter "code" has to be a File.'); - } - - const size = code.size; - - if (size <= Service.CHUNK_SIZE) { - return await this.client.call('post', uri, { - 'content-type': 'multipart/form-data', - }, payload); - } - const apiHeaders: { [header: string]: string } = { 'content-type': 'multipart/form-data', } - let offset = 0; - let response = undefined; - - while (offset < size) { - let end = Math.min(offset + Service.CHUNK_SIZE - 1, size - 1); - - apiHeaders['content-range'] = 'bytes ' + offset + '-' + end + '/' + size; - if (response && response.$id) { - apiHeaders['x-appwrite-id'] = response.$id; - } - - const chunk = code.slice(offset, end + 1); - payload['code'] = new File([chunk], code.name); - response = await this.client.call('post', uri, apiHeaders, payload); - - if (onProgress) { - onProgress({ - $id: response.$id, - progress: (offset / size) * 100, - sizeUploaded: offset, - chunksTotal: response.chunksTotal, - chunksUploaded: response.chunksUploaded - }); - } - offset += Service.CHUNK_SIZE; - } - return response; + return await this.client.chunkedUpload( + 'post', + uri, + apiHeaders, + payload, + onProgress + ); } - /** * Get deployment * @@ -581,56 +529,62 @@ export class Functions extends Service { * @param {string} functionId * @param {string} deploymentId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getDeployment(functionId: string, deploymentId: string): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } - if (typeof deploymentId === 'undefined') { throw new AppwriteException('Missing required parameter: "deploymentId"'); } - const apiPath = '/functions/{functionId}/deployments/{deploymentId}'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Update deployment * - * Update the function code deployment ID using the unique function ID. Use - * this endpoint to switch the code deployment that should be executed by the - * execution endpoint. + * Update the function code deployment ID using the unique function ID. Use this endpoint to switch the code deployment that should be executed by the execution endpoint. * * @param {string} functionId * @param {string} deploymentId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateDeployment(functionId: string, deploymentId: string): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } - if (typeof deploymentId === 'undefined') { throw new AppwriteException('Missing required parameter: "deploymentId"'); } - const apiPath = '/functions/{functionId}/deployments/{deploymentId}'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Delete deployment * @@ -639,26 +593,30 @@ export class Functions extends Service { * @param {string} functionId * @param {string} deploymentId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async deleteDeployment(functionId: string, deploymentId: string): Promise<{}> { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } - if (typeof deploymentId === 'undefined') { throw new AppwriteException('Missing required parameter: "deploymentId"'); } - const apiPath = '/functions/{functionId}/deployments/{deploymentId}'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } /** * Rebuild deployment * @@ -667,30 +625,33 @@ export class Functions extends Service { * @param {string} deploymentId * @param {string} buildId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async createBuild(functionId: string, deploymentId: string, buildId?: string): Promise<{}> { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } - if (typeof deploymentId === 'undefined') { throw new AppwriteException('Missing required parameter: "deploymentId"'); } - const apiPath = '/functions/{functionId}/deployments/{deploymentId}/build'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId); const payload: Payload = {}; - if (typeof buildId !== 'undefined') { payload['buildId'] = buildId; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Cancel deployment * @@ -698,100 +659,103 @@ export class Functions extends Service { * @param {string} functionId * @param {string} deploymentId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateDeploymentBuild(functionId: string, deploymentId: string): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } - if (typeof deploymentId === 'undefined') { throw new AppwriteException('Missing required parameter: "deploymentId"'); } - const apiPath = '/functions/{functionId}/deployments/{deploymentId}/build'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Download deployment * - * Get a Deployment's contents by its unique ID. This endpoint supports range - * requests for partial or streaming file download. + * Get a Deployment's contents by its unique ID. This endpoint supports range requests for partial or streaming file download. * * @param {string} functionId * @param {string} deploymentId * @throws {AppwriteException} - * @returns {URL} - */ - getDeploymentDownload(functionId: string, deploymentId: string): URL { + * @returns {string} + */ + getDeploymentDownload(functionId: string, deploymentId: string): string { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } - if (typeof deploymentId === 'undefined') { throw new AppwriteException('Missing required parameter: "deploymentId"'); } - const apiPath = '/functions/{functionId}/deployments/{deploymentId}/download'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - payload['project'] = this.client.config.project; + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + payload['project'] = this.client.config.project; - for (const [key, value] of Object.entries(Service.flatten(payload))) { + for (const [key, value] of Object.entries(Client.flatten(payload))) { uri.searchParams.append(key, value); } - return uri; - } + return uri.toString(); + } /** * List executions * - * Get a list of all the current user function execution logs. You can use the - * query params to filter your results. + * Get a list of all the current user function execution logs. You can use the query params to filter your results. * * @param {string} functionId * @param {string[]} queries * @param {string} search * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listExecutions(functionId: string, queries?: string[], search?: string): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } - const apiPath = '/functions/{functionId}/executions'.replace('{functionId}', functionId); const payload: Payload = {}; - if (typeof queries !== 'undefined') { payload['queries'] = queries; } - if (typeof search !== 'undefined') { payload['search'] = search; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Create execution * - * Trigger a function execution. The returned object will return you the - * current execution status. You can ping the `Get Execution` endpoint to get - * updates on the current execution status. Once this endpoint is called, your - * function execution process will start asynchronously. + * Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously. * * @param {string} functionId * @param {string} body @@ -801,43 +765,46 @@ export class Functions extends Service { * @param {object} headers * @param {string} scheduledAt * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createExecution(functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string, onProgress = (progress: UploadProgress) => {}): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } - const apiPath = '/functions/{functionId}/executions'.replace('{functionId}', functionId); const payload: Payload = {}; - if (typeof body !== 'undefined') { payload['body'] = body; } - if (typeof async !== 'undefined') { payload['async'] = async; } - if (typeof xpath !== 'undefined') { payload['path'] = xpath; } - if (typeof method !== 'undefined') { payload['method'] = method; } - if (typeof headers !== 'undefined') { payload['headers'] = headers; } - if (typeof scheduledAt !== 'undefined') { payload['scheduledAt'] = scheduledAt; } - const uri = new URL(this.client.config.endpoint + apiPath); - } + const apiHeaders: { [header: string]: string } = { + 'content-type': 'multipart/form-data', + } + + return await this.client.chunkedUpload( + 'post', + uri, + apiHeaders, + payload, + onProgress + ); + } /** * Get execution * @@ -846,55 +813,63 @@ export class Functions extends Service { * @param {string} functionId * @param {string} executionId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getExecution(functionId: string, executionId: string): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } - if (typeof executionId === 'undefined') { throw new AppwriteException('Missing required parameter: "executionId"'); } - const apiPath = '/functions/{functionId}/executions/{executionId}'.replace('{functionId}', functionId).replace('{executionId}', executionId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Delete execution * * Delete a function execution by its unique ID. - * + * * @param {string} functionId * @param {string} executionId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async deleteExecution(functionId: string, executionId: string): Promise<{}> { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } - if (typeof executionId === 'undefined') { throw new AppwriteException('Missing required parameter: "executionId"'); } - const apiPath = '/functions/{functionId}/executions/{executionId}'.replace('{functionId}', functionId).replace('{executionId}', executionId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } /** * Get function usage * @@ -902,26 +877,30 @@ export class Functions extends Service { * @param {string} functionId * @param {FunctionUsageRange} range * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getFunctionUsage(functionId: string, range?: FunctionUsageRange): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } - const apiPath = '/functions/{functionId}/usage'.replace('{functionId}', functionId); const payload: Payload = {}; - if (typeof range !== 'undefined') { payload['range'] = range; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * List variables * @@ -929,64 +908,69 @@ export class Functions extends Service { * * @param {string} functionId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listVariables(functionId: string): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } - const apiPath = '/functions/{functionId}/variables'.replace('{functionId}', functionId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Create variable * - * Create a new function environment variable. These variables can be accessed - * in the function at runtime as environment variables. + * Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables. * * @param {string} functionId * @param {string} key * @param {string} value * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createVariable(functionId: string, key: string, value: string): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } - if (typeof key === 'undefined') { throw new AppwriteException('Missing required parameter: "key"'); } - if (typeof value === 'undefined') { throw new AppwriteException('Missing required parameter: "value"'); } - const apiPath = '/functions/{functionId}/variables'.replace('{functionId}', functionId); const payload: Payload = {}; - if (typeof key !== 'undefined') { payload['key'] = key; } - if (typeof value !== 'undefined') { payload['value'] = value; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Get variable * @@ -995,26 +979,30 @@ export class Functions extends Service { * @param {string} functionId * @param {string} variableId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getVariable(functionId: string, variableId: string): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } - if (typeof variableId === 'undefined') { throw new AppwriteException('Missing required parameter: "variableId"'); } - const apiPath = '/functions/{functionId}/variables/{variableId}'.replace('{functionId}', functionId).replace('{variableId}', variableId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Update variable * @@ -1025,38 +1013,39 @@ export class Functions extends Service { * @param {string} key * @param {string} value * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateVariable(functionId: string, variableId: string, key: string, value?: string): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } - if (typeof variableId === 'undefined') { throw new AppwriteException('Missing required parameter: "variableId"'); } - if (typeof key === 'undefined') { throw new AppwriteException('Missing required parameter: "key"'); } - const apiPath = '/functions/{functionId}/variables/{variableId}'.replace('{functionId}', functionId).replace('{variableId}', variableId); const payload: Payload = {}; - if (typeof key !== 'undefined') { payload['key'] = key; } - if (typeof value !== 'undefined') { payload['value'] = value; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('put', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'put', + uri, + apiHeaders, + payload + ); + } /** * Delete variable * @@ -1065,23 +1054,28 @@ export class Functions extends Service { * @param {string} functionId * @param {string} variableId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async deleteVariable(functionId: string, variableId: string): Promise<{}> { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } - if (typeof variableId === 'undefined') { throw new AppwriteException('Missing required parameter: "variableId"'); } - const apiPath = '/functions/{functionId}/variables/{variableId}'.replace('{functionId}', functionId).replace('{variableId}', variableId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); + } + + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); } -}; +} diff --git a/src/services/graphql.ts b/src/services/graphql.ts index ca03efb..b68e7b5 100644 --- a/src/services/graphql.ts +++ b/src/services/graphql.ts @@ -1,14 +1,12 @@ -import { Service } from '../service'; -import { AppwriteException, Client } from '../client'; +import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; -import type { UploadProgress, Payload } from '../client'; -export class Graphql extends Service { +export class Graphql { + client: Client; - constructor(client: Client) - { - super(client); - } + constructor(client: Client) { + this.client = client; + } /** * GraphQL endpoint @@ -17,27 +15,31 @@ export class Graphql extends Service { * * @param {object} query * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async query(query: object): Promise<{}> { if (typeof query === 'undefined') { throw new AppwriteException('Missing required parameter: "query"'); } - const apiPath = '/graphql'; const payload: Payload = {}; - if (typeof query !== 'undefined') { payload['query'] = query; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'x-sdk-graphql': 'true', 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * GraphQL endpoint * @@ -45,24 +47,29 @@ export class Graphql extends Service { * * @param {object} query * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async mutation(query: object): Promise<{}> { if (typeof query === 'undefined') { throw new AppwriteException('Missing required parameter: "query"'); } - const apiPath = '/graphql/mutation'; const payload: Payload = {}; - if (typeof query !== 'undefined') { payload['query'] = query; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'x-sdk-graphql': 'true', 'content-type': 'application/json', - }, payload); + } + + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); } -}; +} diff --git a/src/services/health.ts b/src/services/health.ts index 0c9a977..446b687 100644 --- a/src/services/health.ts +++ b/src/services/health.ts @@ -1,15 +1,13 @@ -import { Service } from '../service'; -import { AppwriteException, Client } from '../client'; +import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; -import type { UploadProgress, Payload } from '../client'; import { Name } from '../enums/name'; -export class Health extends Service { +export class Health { + client: Client; - constructor(client: Client) - { - super(client); - } + constructor(client: Client) { + this.client = client; + } /** * Get HTTP @@ -17,55 +15,72 @@ export class Health extends Service { * Check the Appwrite HTTP server is up and responsive. * * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async get(): Promise { const apiPath = '/health'; const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Get antivirus * * Check the Appwrite Antivirus server is up and connection is successful. * * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getAntivirus(): Promise { const apiPath = '/health/anti-virus'; const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Get cache * - * Check the Appwrite in-memory cache servers are up and connection is - * successful. + * Check the Appwrite in-memory cache servers are up and connection is successful. * * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getCache(): Promise { const apiPath = '/health/cache'; const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Get the SSL certificate for a domain * @@ -73,457 +88,542 @@ export class Health extends Service { * * @param {string} domain * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getCertificate(domain?: string): Promise { const apiPath = '/health/certificate'; const payload: Payload = {}; - if (typeof domain !== 'undefined') { payload['domain'] = domain; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Get DB * * Check the Appwrite database servers are up and connection is successful. * * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getDB(): Promise { const apiPath = '/health/db'; const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Get pubsub * * Check the Appwrite pub-sub servers are up and connection is successful. * * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getPubSub(): Promise { const apiPath = '/health/pubsub'; const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Get queue * - * Check the Appwrite queue messaging servers are up and connection is - * successful. + * Check the Appwrite queue messaging servers are up and connection is successful. * * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getQueue(): Promise { const apiPath = '/health/queue'; const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Get builds queue * - * Get the number of builds that are waiting to be processed in the Appwrite - * internal queue server. + * Get the number of builds that are waiting to be processed in the Appwrite internal queue server. * * @param {number} threshold * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getQueueBuilds(threshold?: number): Promise { const apiPath = '/health/queue/builds'; const payload: Payload = {}; - if (typeof threshold !== 'undefined') { payload['threshold'] = threshold; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Get certificates queue * - * Get the number of certificates that are waiting to be issued against - * [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue - * server. + * Get the number of certificates that are waiting to be issued against [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue server. * * @param {number} threshold * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getQueueCertificates(threshold?: number): Promise { const apiPath = '/health/queue/certificates'; const payload: Payload = {}; - if (typeof threshold !== 'undefined') { payload['threshold'] = threshold; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Get databases queue * - * Get the number of database changes that are waiting to be processed in the - * Appwrite internal queue server. + * Get the number of database changes that are waiting to be processed in the Appwrite internal queue server. * * @param {string} name * @param {number} threshold * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getQueueDatabases(name?: string, threshold?: number): Promise { const apiPath = '/health/queue/databases'; const payload: Payload = {}; - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof threshold !== 'undefined') { payload['threshold'] = threshold; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Get deletes queue * - * Get the number of background destructive changes that are waiting to be - * processed in the Appwrite internal queue server. + * Get the number of background destructive changes that are waiting to be processed in the Appwrite internal queue server. * * @param {number} threshold * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getQueueDeletes(threshold?: number): Promise { const apiPath = '/health/queue/deletes'; const payload: Payload = {}; - if (typeof threshold !== 'undefined') { payload['threshold'] = threshold; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Get number of failed queue jobs * * Returns the amount of failed jobs in a given queue. - * + * * @param {Name} name * @param {number} threshold * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getFailedJobs(name: Name, threshold?: number): Promise { if (typeof name === 'undefined') { throw new AppwriteException('Missing required parameter: "name"'); } - const apiPath = '/health/queue/failed/{name}'.replace('{name}', name); const payload: Payload = {}; - if (typeof threshold !== 'undefined') { payload['threshold'] = threshold; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Get functions queue * - * Get the number of function executions that are waiting to be processed in - * the Appwrite internal queue server. + * Get the number of function executions that are waiting to be processed in the Appwrite internal queue server. * * @param {number} threshold * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getQueueFunctions(threshold?: number): Promise { const apiPath = '/health/queue/functions'; const payload: Payload = {}; - if (typeof threshold !== 'undefined') { payload['threshold'] = threshold; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Get logs queue * - * Get the number of logs that are waiting to be processed in the Appwrite - * internal queue server. + * Get the number of logs that are waiting to be processed in the Appwrite internal queue server. * * @param {number} threshold * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getQueueLogs(threshold?: number): Promise { const apiPath = '/health/queue/logs'; const payload: Payload = {}; - if (typeof threshold !== 'undefined') { payload['threshold'] = threshold; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Get mails queue * - * Get the number of mails that are waiting to be processed in the Appwrite - * internal queue server. + * Get the number of mails that are waiting to be processed in the Appwrite internal queue server. * * @param {number} threshold * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getQueueMails(threshold?: number): Promise { const apiPath = '/health/queue/mails'; const payload: Payload = {}; - if (typeof threshold !== 'undefined') { payload['threshold'] = threshold; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Get messaging queue * - * Get the number of messages that are waiting to be processed in the Appwrite - * internal queue server. + * Get the number of messages that are waiting to be processed in the Appwrite internal queue server. * * @param {number} threshold * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getQueueMessaging(threshold?: number): Promise { const apiPath = '/health/queue/messaging'; const payload: Payload = {}; - if (typeof threshold !== 'undefined') { payload['threshold'] = threshold; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Get migrations queue * - * Get the number of migrations that are waiting to be processed in the - * Appwrite internal queue server. + * Get the number of migrations that are waiting to be processed in the Appwrite internal queue server. * * @param {number} threshold * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getQueueMigrations(threshold?: number): Promise { const apiPath = '/health/queue/migrations'; const payload: Payload = {}; - if (typeof threshold !== 'undefined') { payload['threshold'] = threshold; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Get usage queue * - * Get the number of metrics that are waiting to be processed in the Appwrite - * internal queue server. + * Get the number of metrics that are waiting to be processed in the Appwrite internal queue server. * * @param {number} threshold * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getQueueUsage(threshold?: number): Promise { const apiPath = '/health/queue/usage'; const payload: Payload = {}; - if (typeof threshold !== 'undefined') { payload['threshold'] = threshold; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Get usage dump queue * - * Get the number of projects containing metrics that are waiting to be - * processed in the Appwrite internal queue server. + * Get the number of projects containing metrics that are waiting to be processed in the Appwrite internal queue server. * * @param {number} threshold * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getQueueUsageDump(threshold?: number): Promise { const apiPath = '/health/queue/usage-dump'; const payload: Payload = {}; - if (typeof threshold !== 'undefined') { payload['threshold'] = threshold; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Get webhooks queue * - * Get the number of webhooks that are waiting to be processed in the Appwrite - * internal queue server. + * Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server. * * @param {number} threshold * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getQueueWebhooks(threshold?: number): Promise { const apiPath = '/health/queue/webhooks'; const payload: Payload = {}; - if (typeof threshold !== 'undefined') { payload['threshold'] = threshold; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Get storage * * Check the Appwrite storage device is up and connection is successful. * * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getStorage(): Promise { const apiPath = '/health/storage'; const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Get local storage * * Check the Appwrite local storage device is up and connection is successful. * * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getStorageLocal(): Promise { const apiPath = '/health/storage/local'; const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Get time * - * Check the Appwrite server time is synced with Google remote NTP server. We - * use this technology to smoothly handle leap seconds with no disruptive - * events. The [Network Time - * Protocol](https://en.wikipedia.org/wiki/Network_Time_Protocol) (NTP) is - * used by hundreds of millions of computers and devices to synchronize their - * clocks over the Internet. If your computer sets its own clock, it likely - * uses NTP. + * Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https://en.wikipedia.org/wiki/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP. * * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getTime(): Promise { const apiPath = '/health/time'; const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); + } + + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); } -}; +} diff --git a/src/services/locale.ts b/src/services/locale.ts index d70b5ed..d1c94b7 100644 --- a/src/services/locale.ts +++ b/src/services/locale.ts @@ -1,169 +1,205 @@ -import { Service } from '../service'; -import { AppwriteException, Client } from '../client'; +import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; -import type { UploadProgress, Payload } from '../client'; -export class Locale extends Service { +export class Locale { + client: Client; - constructor(client: Client) - { - super(client); - } + constructor(client: Client) { + this.client = client; + } /** * Get user locale * - * Get the current user location based on IP. Returns an object with user - * country code, country name, continent name, continent code, ip address and - * suggested currency. You can use the locale header to get the data in a - * supported language. - * - * ([IP Geolocation by DB-IP](https://db-ip.com)) + * Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language. + +([IP Geolocation by DB-IP](https://db-ip.com)) * * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async get(): Promise { const apiPath = '/locale'; const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); + } + + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); } - /** * List Locale Codes * - * List of all locale codes in [ISO - * 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes). + * List of all locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes). * * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listCodes(): Promise { const apiPath = '/locale/codes'; const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); + } + + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); } - /** * List continents * - * List of all continents. You can use the locale header to get the data in a - * supported language. + * List of all continents. You can use the locale header to get the data in a supported language. * * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listContinents(): Promise { const apiPath = '/locale/continents'; const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); + } + + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); } - /** * List countries * - * List of all countries. You can use the locale header to get the data in a - * supported language. + * List of all countries. You can use the locale header to get the data in a supported language. * * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listCountries(): Promise { const apiPath = '/locale/countries'; const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); + } + + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); } - /** * List EU countries * - * List of all countries that are currently members of the EU. You can use the - * locale header to get the data in a supported language. + * List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language. * * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listCountriesEU(): Promise { const apiPath = '/locale/countries/eu'; const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); + } + + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); } - /** * List countries phone codes * - * List of all countries phone codes. You can use the locale header to get the - * data in a supported language. + * List of all countries phone codes. You can use the locale header to get the data in a supported language. * * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listCountriesPhones(): Promise { const apiPath = '/locale/countries/phones'; const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); + } + + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); } - /** * List currencies * - * List of all currencies, including currency symbol, name, plural, and - * decimal digits for all major and minor currencies. You can use the locale - * header to get the data in a supported language. + * List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language. * * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listCurrencies(): Promise { const apiPath = '/locale/currencies'; const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); + } + + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); } - /** * List languages * - * List of all languages classified by ISO 639-1 including 2-letter code, name - * in English, and name in the respective language. + * List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language. * * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listLanguages(): Promise { const apiPath = '/locale/languages'; const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); + } + + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); } -}; +} diff --git a/src/services/messaging.ts b/src/services/messaging.ts index 2814654..560e30c 100644 --- a/src/services/messaging.ts +++ b/src/services/messaging.ts @@ -1,15 +1,13 @@ -import { Service } from '../service'; -import { AppwriteException, Client } from '../client'; +import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; -import type { UploadProgress, Payload } from '../client'; import { SmtpEncryption } from '../enums/smtp-encryption'; -export class Messaging extends Service { +export class Messaging { + client: Client; - constructor(client: Client) - { - super(client); - } + constructor(client: Client) { + this.client = client; + } /** * List messages @@ -19,26 +17,30 @@ export class Messaging extends Service { * @param {string[]} queries * @param {string} search * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listMessages(queries?: string[], search?: string): Promise { const apiPath = '/messaging/messages'; const payload: Payload = {}; - if (typeof queries !== 'undefined') { payload['queries'] = queries; } - if (typeof search !== 'undefined') { payload['search'] = search; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Create email * @@ -57,83 +59,74 @@ export class Messaging extends Service { * @param {boolean} html * @param {string} scheduledAt * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createEmail(messageId: string, subject: string, content: string, topics?: string[], users?: string[], targets?: string[], cc?: string[], bcc?: string[], attachments?: string[], draft?: boolean, html?: boolean, scheduledAt?: string): Promise { if (typeof messageId === 'undefined') { throw new AppwriteException('Missing required parameter: "messageId"'); } - if (typeof subject === 'undefined') { throw new AppwriteException('Missing required parameter: "subject"'); } - if (typeof content === 'undefined') { throw new AppwriteException('Missing required parameter: "content"'); } - const apiPath = '/messaging/messages/email'; const payload: Payload = {}; - if (typeof messageId !== 'undefined') { payload['messageId'] = messageId; } - if (typeof subject !== 'undefined') { payload['subject'] = subject; } - if (typeof content !== 'undefined') { payload['content'] = content; } - if (typeof topics !== 'undefined') { payload['topics'] = topics; } - if (typeof users !== 'undefined') { payload['users'] = users; } - if (typeof targets !== 'undefined') { payload['targets'] = targets; } - if (typeof cc !== 'undefined') { payload['cc'] = cc; } - if (typeof bcc !== 'undefined') { payload['bcc'] = bcc; } - if (typeof attachments !== 'undefined') { payload['attachments'] = attachments; } - if (typeof draft !== 'undefined') { payload['draft'] = draft; } - if (typeof html !== 'undefined') { payload['html'] = html; } - if (typeof scheduledAt !== 'undefined') { payload['scheduledAt'] = scheduledAt; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Update email * * Update an email message by its unique ID. - * + * * @param {string} messageId * @param {string[]} topics @@ -148,66 +141,60 @@ export class Messaging extends Service { * @param {string} scheduledAt * @param {string[]} attachments * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateEmail(messageId: string, topics?: string[], users?: string[], targets?: string[], subject?: string, content?: string, draft?: boolean, html?: boolean, cc?: string[], bcc?: string[], scheduledAt?: string, attachments?: string[]): Promise { if (typeof messageId === 'undefined') { throw new AppwriteException('Missing required parameter: "messageId"'); } - const apiPath = '/messaging/messages/email/{messageId}'.replace('{messageId}', messageId); const payload: Payload = {}; - if (typeof topics !== 'undefined') { payload['topics'] = topics; } - if (typeof users !== 'undefined') { payload['users'] = users; } - if (typeof targets !== 'undefined') { payload['targets'] = targets; } - if (typeof subject !== 'undefined') { payload['subject'] = subject; } - if (typeof content !== 'undefined') { payload['content'] = content; } - if (typeof draft !== 'undefined') { payload['draft'] = draft; } - if (typeof html !== 'undefined') { payload['html'] = html; } - if (typeof cc !== 'undefined') { payload['cc'] = cc; } - if (typeof bcc !== 'undefined') { payload['bcc'] = bcc; } - if (typeof scheduledAt !== 'undefined') { payload['scheduledAt'] = scheduledAt; } - if (typeof attachments !== 'undefined') { payload['attachments'] = attachments; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Create push notification * @@ -230,99 +217,86 @@ export class Messaging extends Service { * @param {boolean} draft * @param {string} scheduledAt * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createPush(messageId: string, title: string, body: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: string, draft?: boolean, scheduledAt?: string): Promise { if (typeof messageId === 'undefined') { throw new AppwriteException('Missing required parameter: "messageId"'); } - if (typeof title === 'undefined') { throw new AppwriteException('Missing required parameter: "title"'); } - if (typeof body === 'undefined') { throw new AppwriteException('Missing required parameter: "body"'); } - const apiPath = '/messaging/messages/push'; const payload: Payload = {}; - if (typeof messageId !== 'undefined') { payload['messageId'] = messageId; } - if (typeof title !== 'undefined') { payload['title'] = title; } - if (typeof body !== 'undefined') { payload['body'] = body; } - if (typeof topics !== 'undefined') { payload['topics'] = topics; } - if (typeof users !== 'undefined') { payload['users'] = users; } - if (typeof targets !== 'undefined') { payload['targets'] = targets; } - if (typeof data !== 'undefined') { payload['data'] = data; } - if (typeof action !== 'undefined') { payload['action'] = action; } - if (typeof image !== 'undefined') { payload['image'] = image; } - if (typeof icon !== 'undefined') { payload['icon'] = icon; } - if (typeof sound !== 'undefined') { payload['sound'] = sound; } - if (typeof color !== 'undefined') { payload['color'] = color; } - if (typeof tag !== 'undefined') { payload['tag'] = tag; } - if (typeof badge !== 'undefined') { payload['badge'] = badge; } - if (typeof draft !== 'undefined') { payload['draft'] = draft; } - if (typeof scheduledAt !== 'undefined') { payload['scheduledAt'] = scheduledAt; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Update push notification * * Update a push notification by its unique ID. - * + * * @param {string} messageId * @param {string[]} topics @@ -341,82 +315,72 @@ export class Messaging extends Service { * @param {boolean} draft * @param {string} scheduledAt * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updatePush(messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string): Promise { if (typeof messageId === 'undefined') { throw new AppwriteException('Missing required parameter: "messageId"'); } - const apiPath = '/messaging/messages/push/{messageId}'.replace('{messageId}', messageId); const payload: Payload = {}; - if (typeof topics !== 'undefined') { payload['topics'] = topics; } - if (typeof users !== 'undefined') { payload['users'] = users; } - if (typeof targets !== 'undefined') { payload['targets'] = targets; } - if (typeof title !== 'undefined') { payload['title'] = title; } - if (typeof body !== 'undefined') { payload['body'] = body; } - if (typeof data !== 'undefined') { payload['data'] = data; } - if (typeof action !== 'undefined') { payload['action'] = action; } - if (typeof image !== 'undefined') { payload['image'] = image; } - if (typeof icon !== 'undefined') { payload['icon'] = icon; } - if (typeof sound !== 'undefined') { payload['sound'] = sound; } - if (typeof color !== 'undefined') { payload['color'] = color; } - if (typeof tag !== 'undefined') { payload['tag'] = tag; } - if (typeof badge !== 'undefined') { payload['badge'] = badge; } - if (typeof draft !== 'undefined') { payload['draft'] = draft; } - if (typeof scheduledAt !== 'undefined') { payload['scheduledAt'] = scheduledAt; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Create SMS * @@ -430,59 +394,56 @@ export class Messaging extends Service { * @param {boolean} draft * @param {string} scheduledAt * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createSms(messageId: string, content: string, topics?: string[], users?: string[], targets?: string[], draft?: boolean, scheduledAt?: string): Promise { if (typeof messageId === 'undefined') { throw new AppwriteException('Missing required parameter: "messageId"'); } - if (typeof content === 'undefined') { throw new AppwriteException('Missing required parameter: "content"'); } - const apiPath = '/messaging/messages/sms'; const payload: Payload = {}; - if (typeof messageId !== 'undefined') { payload['messageId'] = messageId; } - if (typeof content !== 'undefined') { payload['content'] = content; } - if (typeof topics !== 'undefined') { payload['topics'] = topics; } - if (typeof users !== 'undefined') { payload['users'] = users; } - if (typeof targets !== 'undefined') { payload['targets'] = targets; } - if (typeof draft !== 'undefined') { payload['draft'] = draft; } - if (typeof scheduledAt !== 'undefined') { payload['scheduledAt'] = scheduledAt; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Update SMS * * Update an email message by its unique ID. - * + * * @param {string} messageId * @param {string[]} topics @@ -492,94 +453,102 @@ export class Messaging extends Service { * @param {boolean} draft * @param {string} scheduledAt * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateSms(messageId: string, topics?: string[], users?: string[], targets?: string[], content?: string, draft?: boolean, scheduledAt?: string): Promise { if (typeof messageId === 'undefined') { throw new AppwriteException('Missing required parameter: "messageId"'); } - const apiPath = '/messaging/messages/sms/{messageId}'.replace('{messageId}', messageId); const payload: Payload = {}; - if (typeof topics !== 'undefined') { payload['topics'] = topics; } - if (typeof users !== 'undefined') { payload['users'] = users; } - if (typeof targets !== 'undefined') { payload['targets'] = targets; } - if (typeof content !== 'undefined') { payload['content'] = content; } - if (typeof draft !== 'undefined') { payload['draft'] = draft; } - if (typeof scheduledAt !== 'undefined') { payload['scheduledAt'] = scheduledAt; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Get message * * Get a message by its unique ID. - * + * * @param {string} messageId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getMessage(messageId: string): Promise { if (typeof messageId === 'undefined') { throw new AppwriteException('Missing required parameter: "messageId"'); } - const apiPath = '/messaging/messages/{messageId}'.replace('{messageId}', messageId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Delete message * - * Delete a message. If the message is not a draft or scheduled, but has been - * sent, this will not recall the message. + * Delete a message. If the message is not a draft or scheduled, but has been sent, this will not recall the message. * * @param {string} messageId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async delete(messageId: string): Promise<{}> { if (typeof messageId === 'undefined') { throw new AppwriteException('Missing required parameter: "messageId"'); } - const apiPath = '/messaging/messages/{messageId}'.replace('{messageId}', messageId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } /** * List message logs * @@ -588,26 +557,30 @@ export class Messaging extends Service { * @param {string} messageId * @param {string[]} queries * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listMessageLogs(messageId: string, queries?: string[]): Promise { if (typeof messageId === 'undefined') { throw new AppwriteException('Missing required parameter: "messageId"'); } - const apiPath = '/messaging/messages/{messageId}/logs'.replace('{messageId}', messageId); const payload: Payload = {}; - if (typeof queries !== 'undefined') { payload['queries'] = queries; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * List message targets * @@ -616,26 +589,30 @@ export class Messaging extends Service { * @param {string} messageId * @param {string[]} queries * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listTargets(messageId: string, queries?: string[]): Promise { if (typeof messageId === 'undefined') { throw new AppwriteException('Missing required parameter: "messageId"'); } - const apiPath = '/messaging/messages/{messageId}/targets'.replace('{messageId}', messageId); const payload: Payload = {}; - if (typeof queries !== 'undefined') { payload['queries'] = queries; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * List providers * @@ -644,26 +621,30 @@ export class Messaging extends Service { * @param {string[]} queries * @param {string} search * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listProviders(queries?: string[], search?: string): Promise { const apiPath = '/messaging/providers'; const payload: Payload = {}; - if (typeof queries !== 'undefined') { payload['queries'] = queries; } - if (typeof search !== 'undefined') { payload['search'] = search; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Create APNS provider * @@ -678,58 +659,54 @@ export class Messaging extends Service { * @param {boolean} sandbox * @param {boolean} enabled * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createApnsProvider(providerId: string, name: string, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, sandbox?: boolean, enabled?: boolean): Promise { if (typeof providerId === 'undefined') { throw new AppwriteException('Missing required parameter: "providerId"'); } - if (typeof name === 'undefined') { throw new AppwriteException('Missing required parameter: "name"'); } - const apiPath = '/messaging/providers/apns'; const payload: Payload = {}; - if (typeof providerId !== 'undefined') { payload['providerId'] = providerId; } - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof authKey !== 'undefined') { payload['authKey'] = authKey; } - if (typeof authKeyId !== 'undefined') { payload['authKeyId'] = authKeyId; } - if (typeof teamId !== 'undefined') { payload['teamId'] = teamId; } - if (typeof bundleId !== 'undefined') { payload['bundleId'] = bundleId; } - if (typeof sandbox !== 'undefined') { payload['sandbox'] = sandbox; } - if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Update APNS provider * @@ -744,50 +721,48 @@ export class Messaging extends Service { * @param {string} bundleId * @param {boolean} sandbox * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateApnsProvider(providerId: string, name?: string, enabled?: boolean, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, sandbox?: boolean): Promise { if (typeof providerId === 'undefined') { throw new AppwriteException('Missing required parameter: "providerId"'); } - const apiPath = '/messaging/providers/apns/{providerId}'.replace('{providerId}', providerId); const payload: Payload = {}; - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - if (typeof authKey !== 'undefined') { payload['authKey'] = authKey; } - if (typeof authKeyId !== 'undefined') { payload['authKeyId'] = authKeyId; } - if (typeof teamId !== 'undefined') { payload['teamId'] = teamId; } - if (typeof bundleId !== 'undefined') { payload['bundleId'] = bundleId; } - if (typeof sandbox !== 'undefined') { payload['sandbox'] = sandbox; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Create FCM provider * @@ -798,42 +773,42 @@ export class Messaging extends Service { * @param {object} serviceAccountJSON * @param {boolean} enabled * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createFcmProvider(providerId: string, name: string, serviceAccountJSON?: object, enabled?: boolean): Promise { if (typeof providerId === 'undefined') { throw new AppwriteException('Missing required parameter: "providerId"'); } - if (typeof name === 'undefined') { throw new AppwriteException('Missing required parameter: "name"'); } - const apiPath = '/messaging/providers/fcm'; const payload: Payload = {}; - if (typeof providerId !== 'undefined') { payload['providerId'] = providerId; } - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof serviceAccountJSON !== 'undefined') { payload['serviceAccountJSON'] = serviceAccountJSON; } - if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Update FCM provider * @@ -844,34 +819,36 @@ export class Messaging extends Service { * @param {boolean} enabled * @param {object} serviceAccountJSON * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateFcmProvider(providerId: string, name?: string, enabled?: boolean, serviceAccountJSON?: object): Promise { if (typeof providerId === 'undefined') { throw new AppwriteException('Missing required parameter: "providerId"'); } - const apiPath = '/messaging/providers/fcm/{providerId}'.replace('{providerId}', providerId); const payload: Payload = {}; - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - if (typeof serviceAccountJSON !== 'undefined') { payload['serviceAccountJSON'] = serviceAccountJSON; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Create Mailgun provider * @@ -888,66 +865,60 @@ export class Messaging extends Service { * @param {string} replyToEmail * @param {boolean} enabled * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createMailgunProvider(providerId: string, name: string, apiKey?: string, domain?: string, isEuRegion?: boolean, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise { if (typeof providerId === 'undefined') { throw new AppwriteException('Missing required parameter: "providerId"'); } - if (typeof name === 'undefined') { throw new AppwriteException('Missing required parameter: "name"'); } - const apiPath = '/messaging/providers/mailgun'; const payload: Payload = {}; - if (typeof providerId !== 'undefined') { payload['providerId'] = providerId; } - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof apiKey !== 'undefined') { payload['apiKey'] = apiKey; } - if (typeof domain !== 'undefined') { payload['domain'] = domain; } - if (typeof isEuRegion !== 'undefined') { payload['isEuRegion'] = isEuRegion; } - if (typeof fromName !== 'undefined') { payload['fromName'] = fromName; } - if (typeof fromEmail !== 'undefined') { payload['fromEmail'] = fromEmail; } - if (typeof replyToName !== 'undefined') { payload['replyToName'] = replyToName; } - if (typeof replyToEmail !== 'undefined') { payload['replyToEmail'] = replyToEmail; } - if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Update Mailgun provider * @@ -964,58 +935,54 @@ export class Messaging extends Service { * @param {string} replyToName * @param {string} replyToEmail * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateMailgunProvider(providerId: string, name?: string, apiKey?: string, domain?: string, isEuRegion?: boolean, enabled?: boolean, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string): Promise { if (typeof providerId === 'undefined') { throw new AppwriteException('Missing required parameter: "providerId"'); } - const apiPath = '/messaging/providers/mailgun/{providerId}'.replace('{providerId}', providerId); const payload: Payload = {}; - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof apiKey !== 'undefined') { payload['apiKey'] = apiKey; } - if (typeof domain !== 'undefined') { payload['domain'] = domain; } - if (typeof isEuRegion !== 'undefined') { payload['isEuRegion'] = isEuRegion; } - if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - if (typeof fromName !== 'undefined') { payload['fromName'] = fromName; } - if (typeof fromEmail !== 'undefined') { payload['fromEmail'] = fromEmail; } - if (typeof replyToName !== 'undefined') { payload['replyToName'] = replyToName; } - if (typeof replyToEmail !== 'undefined') { payload['replyToEmail'] = replyToEmail; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Create Msg91 provider * @@ -1028,50 +995,48 @@ export class Messaging extends Service { * @param {string} authKey * @param {boolean} enabled * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createMsg91Provider(providerId: string, name: string, templateId?: string, senderId?: string, authKey?: string, enabled?: boolean): Promise { if (typeof providerId === 'undefined') { throw new AppwriteException('Missing required parameter: "providerId"'); } - if (typeof name === 'undefined') { throw new AppwriteException('Missing required parameter: "name"'); } - const apiPath = '/messaging/providers/msg91'; const payload: Payload = {}; - if (typeof providerId !== 'undefined') { payload['providerId'] = providerId; } - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof templateId !== 'undefined') { payload['templateId'] = templateId; } - if (typeof senderId !== 'undefined') { payload['senderId'] = senderId; } - if (typeof authKey !== 'undefined') { payload['authKey'] = authKey; } - if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Update Msg91 provider * @@ -1084,42 +1049,42 @@ export class Messaging extends Service { * @param {string} senderId * @param {string} authKey * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateMsg91Provider(providerId: string, name?: string, enabled?: boolean, templateId?: string, senderId?: string, authKey?: string): Promise { if (typeof providerId === 'undefined') { throw new AppwriteException('Missing required parameter: "providerId"'); } - const apiPath = '/messaging/providers/msg91/{providerId}'.replace('{providerId}', providerId); const payload: Payload = {}; - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - if (typeof templateId !== 'undefined') { payload['templateId'] = templateId; } - if (typeof senderId !== 'undefined') { payload['senderId'] = senderId; } - if (typeof authKey !== 'undefined') { payload['authKey'] = authKey; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Create Sendgrid provider * @@ -1134,58 +1099,54 @@ export class Messaging extends Service { * @param {string} replyToEmail * @param {boolean} enabled * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createSendgridProvider(providerId: string, name: string, apiKey?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise { if (typeof providerId === 'undefined') { throw new AppwriteException('Missing required parameter: "providerId"'); } - if (typeof name === 'undefined') { throw new AppwriteException('Missing required parameter: "name"'); } - const apiPath = '/messaging/providers/sendgrid'; const payload: Payload = {}; - if (typeof providerId !== 'undefined') { payload['providerId'] = providerId; } - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof apiKey !== 'undefined') { payload['apiKey'] = apiKey; } - if (typeof fromName !== 'undefined') { payload['fromName'] = fromName; } - if (typeof fromEmail !== 'undefined') { payload['fromEmail'] = fromEmail; } - if (typeof replyToName !== 'undefined') { payload['replyToName'] = replyToName; } - if (typeof replyToEmail !== 'undefined') { payload['replyToEmail'] = replyToEmail; } - if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Update Sendgrid provider * @@ -1200,50 +1161,48 @@ export class Messaging extends Service { * @param {string} replyToName * @param {string} replyToEmail * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateSendgridProvider(providerId: string, name?: string, enabled?: boolean, apiKey?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string): Promise { if (typeof providerId === 'undefined') { throw new AppwriteException('Missing required parameter: "providerId"'); } - const apiPath = '/messaging/providers/sendgrid/{providerId}'.replace('{providerId}', providerId); const payload: Payload = {}; - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - if (typeof apiKey !== 'undefined') { payload['apiKey'] = apiKey; } - if (typeof fromName !== 'undefined') { payload['fromName'] = fromName; } - if (typeof fromEmail !== 'undefined') { payload['fromEmail'] = fromEmail; } - if (typeof replyToName !== 'undefined') { payload['replyToName'] = replyToName; } - if (typeof replyToEmail !== 'undefined') { payload['replyToEmail'] = replyToEmail; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Create SMTP provider * @@ -1264,86 +1223,75 @@ export class Messaging extends Service { * @param {string} replyToEmail * @param {boolean} enabled * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createSmtpProvider(providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise { if (typeof providerId === 'undefined') { throw new AppwriteException('Missing required parameter: "providerId"'); } - if (typeof name === 'undefined') { throw new AppwriteException('Missing required parameter: "name"'); } - if (typeof host === 'undefined') { throw new AppwriteException('Missing required parameter: "host"'); } - const apiPath = '/messaging/providers/smtp'; const payload: Payload = {}; - if (typeof providerId !== 'undefined') { payload['providerId'] = providerId; } - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof host !== 'undefined') { payload['host'] = host; } - if (typeof port !== 'undefined') { payload['port'] = port; } - if (typeof username !== 'undefined') { payload['username'] = username; } - if (typeof password !== 'undefined') { payload['password'] = password; } - if (typeof encryption !== 'undefined') { payload['encryption'] = encryption; } - if (typeof autoTLS !== 'undefined') { payload['autoTLS'] = autoTLS; } - if (typeof mailer !== 'undefined') { payload['mailer'] = mailer; } - if (typeof fromName !== 'undefined') { payload['fromName'] = fromName; } - if (typeof fromEmail !== 'undefined') { payload['fromEmail'] = fromEmail; } - if (typeof replyToName !== 'undefined') { payload['replyToName'] = replyToName; } - if (typeof replyToEmail !== 'undefined') { payload['replyToEmail'] = replyToEmail; } - if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Update SMTP provider * @@ -1364,74 +1312,66 @@ export class Messaging extends Service { * @param {string} replyToEmail * @param {boolean} enabled * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateSmtpProvider(providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise { if (typeof providerId === 'undefined') { throw new AppwriteException('Missing required parameter: "providerId"'); } - const apiPath = '/messaging/providers/smtp/{providerId}'.replace('{providerId}', providerId); const payload: Payload = {}; - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof host !== 'undefined') { payload['host'] = host; } - if (typeof port !== 'undefined') { payload['port'] = port; } - if (typeof username !== 'undefined') { payload['username'] = username; } - if (typeof password !== 'undefined') { payload['password'] = password; } - if (typeof encryption !== 'undefined') { payload['encryption'] = encryption; } - if (typeof autoTLS !== 'undefined') { payload['autoTLS'] = autoTLS; } - if (typeof mailer !== 'undefined') { payload['mailer'] = mailer; } - if (typeof fromName !== 'undefined') { payload['fromName'] = fromName; } - if (typeof fromEmail !== 'undefined') { payload['fromEmail'] = fromEmail; } - if (typeof replyToName !== 'undefined') { payload['replyToName'] = replyToName; } - if (typeof replyToEmail !== 'undefined') { payload['replyToEmail'] = replyToEmail; } - if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Create Telesign provider * @@ -1444,50 +1384,48 @@ export class Messaging extends Service { * @param {string} apiKey * @param {boolean} enabled * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createTelesignProvider(providerId: string, name: string, from?: string, customerId?: string, apiKey?: string, enabled?: boolean): Promise { if (typeof providerId === 'undefined') { throw new AppwriteException('Missing required parameter: "providerId"'); } - if (typeof name === 'undefined') { throw new AppwriteException('Missing required parameter: "name"'); } - const apiPath = '/messaging/providers/telesign'; const payload: Payload = {}; - if (typeof providerId !== 'undefined') { payload['providerId'] = providerId; } - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof from !== 'undefined') { payload['from'] = from; } - if (typeof customerId !== 'undefined') { payload['customerId'] = customerId; } - if (typeof apiKey !== 'undefined') { payload['apiKey'] = apiKey; } - if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Update Telesign provider * @@ -1500,42 +1438,42 @@ export class Messaging extends Service { * @param {string} apiKey * @param {string} from * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateTelesignProvider(providerId: string, name?: string, enabled?: boolean, customerId?: string, apiKey?: string, from?: string): Promise { if (typeof providerId === 'undefined') { throw new AppwriteException('Missing required parameter: "providerId"'); } - const apiPath = '/messaging/providers/telesign/{providerId}'.replace('{providerId}', providerId); const payload: Payload = {}; - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - if (typeof customerId !== 'undefined') { payload['customerId'] = customerId; } - if (typeof apiKey !== 'undefined') { payload['apiKey'] = apiKey; } - if (typeof from !== 'undefined') { payload['from'] = from; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Create Textmagic provider * @@ -1548,50 +1486,48 @@ export class Messaging extends Service { * @param {string} apiKey * @param {boolean} enabled * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createTextmagicProvider(providerId: string, name: string, from?: string, username?: string, apiKey?: string, enabled?: boolean): Promise { if (typeof providerId === 'undefined') { throw new AppwriteException('Missing required parameter: "providerId"'); } - if (typeof name === 'undefined') { throw new AppwriteException('Missing required parameter: "name"'); } - const apiPath = '/messaging/providers/textmagic'; const payload: Payload = {}; - if (typeof providerId !== 'undefined') { payload['providerId'] = providerId; } - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof from !== 'undefined') { payload['from'] = from; } - if (typeof username !== 'undefined') { payload['username'] = username; } - if (typeof apiKey !== 'undefined') { payload['apiKey'] = apiKey; } - if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Update Textmagic provider * @@ -1604,42 +1540,42 @@ export class Messaging extends Service { * @param {string} apiKey * @param {string} from * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateTextmagicProvider(providerId: string, name?: string, enabled?: boolean, username?: string, apiKey?: string, from?: string): Promise { if (typeof providerId === 'undefined') { throw new AppwriteException('Missing required parameter: "providerId"'); } - const apiPath = '/messaging/providers/textmagic/{providerId}'.replace('{providerId}', providerId); const payload: Payload = {}; - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - if (typeof username !== 'undefined') { payload['username'] = username; } - if (typeof apiKey !== 'undefined') { payload['apiKey'] = apiKey; } - if (typeof from !== 'undefined') { payload['from'] = from; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Create Twilio provider * @@ -1652,50 +1588,48 @@ export class Messaging extends Service { * @param {string} authToken * @param {boolean} enabled * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createTwilioProvider(providerId: string, name: string, from?: string, accountSid?: string, authToken?: string, enabled?: boolean): Promise { if (typeof providerId === 'undefined') { throw new AppwriteException('Missing required parameter: "providerId"'); } - if (typeof name === 'undefined') { throw new AppwriteException('Missing required parameter: "name"'); } - const apiPath = '/messaging/providers/twilio'; const payload: Payload = {}; - if (typeof providerId !== 'undefined') { payload['providerId'] = providerId; } - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof from !== 'undefined') { payload['from'] = from; } - if (typeof accountSid !== 'undefined') { payload['accountSid'] = accountSid; } - if (typeof authToken !== 'undefined') { payload['authToken'] = authToken; } - if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Update Twilio provider * @@ -1708,42 +1642,42 @@ export class Messaging extends Service { * @param {string} authToken * @param {string} from * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateTwilioProvider(providerId: string, name?: string, enabled?: boolean, accountSid?: string, authToken?: string, from?: string): Promise { if (typeof providerId === 'undefined') { throw new AppwriteException('Missing required parameter: "providerId"'); } - const apiPath = '/messaging/providers/twilio/{providerId}'.replace('{providerId}', providerId); const payload: Payload = {}; - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - if (typeof accountSid !== 'undefined') { payload['accountSid'] = accountSid; } - if (typeof authToken !== 'undefined') { payload['authToken'] = authToken; } - if (typeof from !== 'undefined') { payload['from'] = from; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Create Vonage provider * @@ -1756,50 +1690,48 @@ export class Messaging extends Service { * @param {string} apiSecret * @param {boolean} enabled * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createVonageProvider(providerId: string, name: string, from?: string, apiKey?: string, apiSecret?: string, enabled?: boolean): Promise { if (typeof providerId === 'undefined') { throw new AppwriteException('Missing required parameter: "providerId"'); } - if (typeof name === 'undefined') { throw new AppwriteException('Missing required parameter: "name"'); } - const apiPath = '/messaging/providers/vonage'; const payload: Payload = {}; - if (typeof providerId !== 'undefined') { payload['providerId'] = providerId; } - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof from !== 'undefined') { payload['from'] = from; } - if (typeof apiKey !== 'undefined') { payload['apiKey'] = apiKey; } - if (typeof apiSecret !== 'undefined') { payload['apiSecret'] = apiSecret; } - if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Update Vonage provider * @@ -1812,66 +1744,71 @@ export class Messaging extends Service { * @param {string} apiSecret * @param {string} from * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateVonageProvider(providerId: string, name?: string, enabled?: boolean, apiKey?: string, apiSecret?: string, from?: string): Promise { if (typeof providerId === 'undefined') { throw new AppwriteException('Missing required parameter: "providerId"'); } - const apiPath = '/messaging/providers/vonage/{providerId}'.replace('{providerId}', providerId); const payload: Payload = {}; - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - if (typeof apiKey !== 'undefined') { payload['apiKey'] = apiKey; } - if (typeof apiSecret !== 'undefined') { payload['apiSecret'] = apiSecret; } - if (typeof from !== 'undefined') { payload['from'] = from; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Get provider * * Get a provider by its unique ID. - * + * * @param {string} providerId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getProvider(providerId: string): Promise { if (typeof providerId === 'undefined') { throw new AppwriteException('Missing required parameter: "providerId"'); } - const apiPath = '/messaging/providers/{providerId}'.replace('{providerId}', providerId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Delete provider * @@ -1879,22 +1816,27 @@ export class Messaging extends Service { * * @param {string} providerId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async deleteProvider(providerId: string): Promise<{}> { if (typeof providerId === 'undefined') { throw new AppwriteException('Missing required parameter: "providerId"'); } - const apiPath = '/messaging/providers/{providerId}'.replace('{providerId}', providerId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } /** * List provider logs * @@ -1903,26 +1845,30 @@ export class Messaging extends Service { * @param {string} providerId * @param {string[]} queries * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listProviderLogs(providerId: string, queries?: string[]): Promise { if (typeof providerId === 'undefined') { throw new AppwriteException('Missing required parameter: "providerId"'); } - const apiPath = '/messaging/providers/{providerId}/logs'.replace('{providerId}', providerId); const payload: Payload = {}; - if (typeof queries !== 'undefined') { payload['queries'] = queries; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * List subscriber logs * @@ -1931,26 +1877,30 @@ export class Messaging extends Service { * @param {string} subscriberId * @param {string[]} queries * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listSubscriberLogs(subscriberId: string, queries?: string[]): Promise { if (typeof subscriberId === 'undefined') { throw new AppwriteException('Missing required parameter: "subscriberId"'); } - const apiPath = '/messaging/subscribers/{subscriberId}/logs'.replace('{subscriberId}', subscriberId); const payload: Payload = {}; - if (typeof queries !== 'undefined') { payload['queries'] = queries; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * List topics * @@ -1959,26 +1909,30 @@ export class Messaging extends Service { * @param {string[]} queries * @param {string} search * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listTopics(queries?: string[], search?: string): Promise { const apiPath = '/messaging/topics'; const payload: Payload = {}; - if (typeof queries !== 'undefined') { payload['queries'] = queries; } - if (typeof search !== 'undefined') { payload['search'] = search; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Create topic * @@ -1988,96 +1942,105 @@ export class Messaging extends Service { * @param {string} name * @param {string[]} subscribe * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createTopic(topicId: string, name: string, subscribe?: string[]): Promise { if (typeof topicId === 'undefined') { throw new AppwriteException('Missing required parameter: "topicId"'); } - if (typeof name === 'undefined') { throw new AppwriteException('Missing required parameter: "name"'); } - const apiPath = '/messaging/topics'; const payload: Payload = {}; - if (typeof topicId !== 'undefined') { payload['topicId'] = topicId; } - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof subscribe !== 'undefined') { payload['subscribe'] = subscribe; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Get topic * * Get a topic by its unique ID. - * + * * @param {string} topicId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getTopic(topicId: string): Promise { if (typeof topicId === 'undefined') { throw new AppwriteException('Missing required parameter: "topicId"'); } - const apiPath = '/messaging/topics/{topicId}'.replace('{topicId}', topicId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Update topic * * Update a topic by its unique ID. - * + * * @param {string} topicId * @param {string} name * @param {string[]} subscribe * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateTopic(topicId: string, name?: string, subscribe?: string[]): Promise { if (typeof topicId === 'undefined') { throw new AppwriteException('Missing required parameter: "topicId"'); } - const apiPath = '/messaging/topics/{topicId}'.replace('{topicId}', topicId); const payload: Payload = {}; - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof subscribe !== 'undefined') { payload['subscribe'] = subscribe; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Delete topic * @@ -2085,22 +2048,27 @@ export class Messaging extends Service { * * @param {string} topicId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async deleteTopic(topicId: string): Promise<{}> { if (typeof topicId === 'undefined') { throw new AppwriteException('Missing required parameter: "topicId"'); } - const apiPath = '/messaging/topics/{topicId}'.replace('{topicId}', topicId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } /** * List topic logs * @@ -2109,26 +2077,30 @@ export class Messaging extends Service { * @param {string} topicId * @param {string[]} queries * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listTopicLogs(topicId: string, queries?: string[]): Promise { if (typeof topicId === 'undefined') { throw new AppwriteException('Missing required parameter: "topicId"'); } - const apiPath = '/messaging/topics/{topicId}/logs'.replace('{topicId}', topicId); const payload: Payload = {}; - if (typeof queries !== 'undefined') { payload['queries'] = queries; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * List subscribers * @@ -2138,30 +2110,33 @@ export class Messaging extends Service { * @param {string[]} queries * @param {string} search * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listSubscribers(topicId: string, queries?: string[], search?: string): Promise { if (typeof topicId === 'undefined') { throw new AppwriteException('Missing required parameter: "topicId"'); } - const apiPath = '/messaging/topics/{topicId}/subscribers'.replace('{topicId}', topicId); const payload: Payload = {}; - if (typeof queries !== 'undefined') { payload['queries'] = queries; } - if (typeof search !== 'undefined') { payload['search'] = search; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Create subscriber * @@ -2171,67 +2146,72 @@ export class Messaging extends Service { * @param {string} subscriberId * @param {string} targetId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createSubscriber(topicId: string, subscriberId: string, targetId: string): Promise { if (typeof topicId === 'undefined') { throw new AppwriteException('Missing required parameter: "topicId"'); } - if (typeof subscriberId === 'undefined') { throw new AppwriteException('Missing required parameter: "subscriberId"'); } - if (typeof targetId === 'undefined') { throw new AppwriteException('Missing required parameter: "targetId"'); } - const apiPath = '/messaging/topics/{topicId}/subscribers'.replace('{topicId}', topicId); const payload: Payload = {}; - if (typeof subscriberId !== 'undefined') { payload['subscriberId'] = subscriberId; } - if (typeof targetId !== 'undefined') { payload['targetId'] = targetId; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Get subscriber * * Get a subscriber by its unique ID. - * + * * @param {string} topicId * @param {string} subscriberId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getSubscriber(topicId: string, subscriberId: string): Promise { if (typeof topicId === 'undefined') { throw new AppwriteException('Missing required parameter: "topicId"'); } - if (typeof subscriberId === 'undefined') { throw new AppwriteException('Missing required parameter: "subscriberId"'); } - const apiPath = '/messaging/topics/{topicId}/subscribers/{subscriberId}'.replace('{topicId}', topicId).replace('{subscriberId}', subscriberId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Delete subscriber * @@ -2240,23 +2220,28 @@ export class Messaging extends Service { * @param {string} topicId * @param {string} subscriberId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async deleteSubscriber(topicId: string, subscriberId: string): Promise<{}> { if (typeof topicId === 'undefined') { throw new AppwriteException('Missing required parameter: "topicId"'); } - if (typeof subscriberId === 'undefined') { throw new AppwriteException('Missing required parameter: "subscriberId"'); } - const apiPath = '/messaging/topics/{topicId}/subscribers/{subscriberId}'.replace('{topicId}', topicId).replace('{subscriberId}', subscriberId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); + } + + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); } -}; +} diff --git a/src/services/migrations.ts b/src/services/migrations.ts index 18ea195..248f350 100644 --- a/src/services/migrations.ts +++ b/src/services/migrations.ts @@ -1,14 +1,12 @@ -import { Service } from '../service'; -import { AppwriteException, Client } from '../client'; +import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; -import type { UploadProgress, Payload } from '../client'; -export class Migrations extends Service { +export class Migrations { + client: Client; - constructor(client: Client) - { - super(client); - } + constructor(client: Client) { + this.client = client; + } /** * List Migrations @@ -17,26 +15,30 @@ export class Migrations extends Service { * @param {string[]} queries * @param {string} search * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async list(queries?: string[], search?: string): Promise { const apiPath = '/migrations'; const payload: Payload = {}; - if (typeof queries !== 'undefined') { payload['queries'] = queries; } - if (typeof search !== 'undefined') { payload['search'] = search; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Migrate Appwrite Data * @@ -46,50 +48,48 @@ export class Migrations extends Service { * @param {string} projectId * @param {string} apiKey * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createAppwriteMigration(resources: string[], endpoint: string, projectId: string, apiKey: string): Promise { if (typeof resources === 'undefined') { throw new AppwriteException('Missing required parameter: "resources"'); } - if (typeof endpoint === 'undefined') { throw new AppwriteException('Missing required parameter: "endpoint"'); } - if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof apiKey === 'undefined') { throw new AppwriteException('Missing required parameter: "apiKey"'); } - const apiPath = '/migrations/appwrite'; const payload: Payload = {}; - if (typeof resources !== 'undefined') { payload['resources'] = resources; } - if (typeof endpoint !== 'undefined') { payload['endpoint'] = endpoint; } - if (typeof projectId !== 'undefined') { payload['projectId'] = projectId; } - if (typeof apiKey !== 'undefined') { payload['apiKey'] = apiKey; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Generate a report on Appwrite Data * @@ -99,50 +99,48 @@ export class Migrations extends Service { * @param {string} projectID * @param {string} key * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getAppwriteReport(resources: string[], endpoint: string, projectID: string, key: string): Promise { if (typeof resources === 'undefined') { throw new AppwriteException('Missing required parameter: "resources"'); } - if (typeof endpoint === 'undefined') { throw new AppwriteException('Missing required parameter: "endpoint"'); } - if (typeof projectID === 'undefined') { throw new AppwriteException('Missing required parameter: "projectID"'); } - if (typeof key === 'undefined') { throw new AppwriteException('Missing required parameter: "key"'); } - const apiPath = '/migrations/appwrite/report'; const payload: Payload = {}; - if (typeof resources !== 'undefined') { payload['resources'] = resources; } - if (typeof endpoint !== 'undefined') { payload['endpoint'] = endpoint; } - if (typeof projectID !== 'undefined') { payload['projectID'] = projectID; } - if (typeof key !== 'undefined') { payload['key'] = key; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Migrate Firebase Data (Service Account) * @@ -150,51 +148,59 @@ export class Migrations extends Service { * @param {string[]} resources * @param {string} serviceAccount * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createFirebaseMigration(resources: string[], serviceAccount: string): Promise { if (typeof resources === 'undefined') { throw new AppwriteException('Missing required parameter: "resources"'); } - if (typeof serviceAccount === 'undefined') { throw new AppwriteException('Missing required parameter: "serviceAccount"'); } - const apiPath = '/migrations/firebase'; const payload: Payload = {}; - if (typeof resources !== 'undefined') { payload['resources'] = resources; } - if (typeof serviceAccount !== 'undefined') { payload['serviceAccount'] = serviceAccount; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Revoke Appwrite's authorization to access Firebase Projects * * * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async deleteFirebaseAuth(): Promise<{}> { const apiPath = '/migrations/firebase/deauthorize'; const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Migrate Firebase Data (OAuth) * @@ -202,51 +208,59 @@ export class Migrations extends Service { * @param {string[]} resources * @param {string} projectId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createFirebaseOAuthMigration(resources: string[], projectId: string): Promise { if (typeof resources === 'undefined') { throw new AppwriteException('Missing required parameter: "resources"'); } - if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - const apiPath = '/migrations/firebase/oauth'; const payload: Payload = {}; - if (typeof resources !== 'undefined') { payload['resources'] = resources; } - if (typeof projectId !== 'undefined') { payload['projectId'] = projectId; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * List Firebase Projects * * * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listFirebaseProjects(): Promise { const apiPath = '/migrations/firebase/projects'; const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Generate a report on Firebase Data * @@ -254,34 +268,36 @@ export class Migrations extends Service { * @param {string[]} resources * @param {string} serviceAccount * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getFirebaseReport(resources: string[], serviceAccount: string): Promise { if (typeof resources === 'undefined') { throw new AppwriteException('Missing required parameter: "resources"'); } - if (typeof serviceAccount === 'undefined') { throw new AppwriteException('Missing required parameter: "serviceAccount"'); } - const apiPath = '/migrations/firebase/report'; const payload: Payload = {}; - if (typeof resources !== 'undefined') { payload['resources'] = resources; } - if (typeof serviceAccount !== 'undefined') { payload['serviceAccount'] = serviceAccount; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Generate a report on Firebase Data using OAuth * @@ -289,34 +305,36 @@ export class Migrations extends Service { * @param {string[]} resources * @param {string} projectId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getFirebaseReportOAuth(resources: string[], projectId: string): Promise { if (typeof resources === 'undefined') { throw new AppwriteException('Missing required parameter: "resources"'); } - if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - const apiPath = '/migrations/firebase/report/oauth'; const payload: Payload = {}; - if (typeof resources !== 'undefined') { payload['resources'] = resources; } - if (typeof projectId !== 'undefined') { payload['projectId'] = projectId; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Migrate NHost Data * @@ -330,78 +348,69 @@ export class Migrations extends Service { * @param {string} password * @param {number} port * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createNHostMigration(resources: string[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number): Promise { if (typeof resources === 'undefined') { throw new AppwriteException('Missing required parameter: "resources"'); } - if (typeof subdomain === 'undefined') { throw new AppwriteException('Missing required parameter: "subdomain"'); } - if (typeof region === 'undefined') { throw new AppwriteException('Missing required parameter: "region"'); } - if (typeof adminSecret === 'undefined') { throw new AppwriteException('Missing required parameter: "adminSecret"'); } - if (typeof database === 'undefined') { throw new AppwriteException('Missing required parameter: "database"'); } - if (typeof username === 'undefined') { throw new AppwriteException('Missing required parameter: "username"'); } - if (typeof password === 'undefined') { throw new AppwriteException('Missing required parameter: "password"'); } - const apiPath = '/migrations/nhost'; const payload: Payload = {}; - if (typeof resources !== 'undefined') { payload['resources'] = resources; } - if (typeof subdomain !== 'undefined') { payload['subdomain'] = subdomain; } - if (typeof region !== 'undefined') { payload['region'] = region; } - if (typeof adminSecret !== 'undefined') { payload['adminSecret'] = adminSecret; } - if (typeof database !== 'undefined') { payload['database'] = database; } - if (typeof username !== 'undefined') { payload['username'] = username; } - if (typeof password !== 'undefined') { payload['password'] = password; } - if (typeof port !== 'undefined') { payload['port'] = port; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Generate a report on NHost Data * @@ -415,78 +424,69 @@ export class Migrations extends Service { * @param {string} password * @param {number} port * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getNHostReport(resources: string[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number): Promise { if (typeof resources === 'undefined') { throw new AppwriteException('Missing required parameter: "resources"'); } - if (typeof subdomain === 'undefined') { throw new AppwriteException('Missing required parameter: "subdomain"'); } - if (typeof region === 'undefined') { throw new AppwriteException('Missing required parameter: "region"'); } - if (typeof adminSecret === 'undefined') { throw new AppwriteException('Missing required parameter: "adminSecret"'); } - if (typeof database === 'undefined') { throw new AppwriteException('Missing required parameter: "database"'); } - if (typeof username === 'undefined') { throw new AppwriteException('Missing required parameter: "username"'); } - if (typeof password === 'undefined') { throw new AppwriteException('Missing required parameter: "password"'); } - const apiPath = '/migrations/nhost/report'; const payload: Payload = {}; - if (typeof resources !== 'undefined') { payload['resources'] = resources; } - if (typeof subdomain !== 'undefined') { payload['subdomain'] = subdomain; } - if (typeof region !== 'undefined') { payload['region'] = region; } - if (typeof adminSecret !== 'undefined') { payload['adminSecret'] = adminSecret; } - if (typeof database !== 'undefined') { payload['database'] = database; } - if (typeof username !== 'undefined') { payload['username'] = username; } - if (typeof password !== 'undefined') { payload['password'] = password; } - if (typeof port !== 'undefined') { payload['port'] = port; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Migrate Supabase Data * @@ -499,70 +499,63 @@ export class Migrations extends Service { * @param {string} password * @param {number} port * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createSupabaseMigration(resources: string[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number): Promise { if (typeof resources === 'undefined') { throw new AppwriteException('Missing required parameter: "resources"'); } - if (typeof endpoint === 'undefined') { throw new AppwriteException('Missing required parameter: "endpoint"'); } - if (typeof apiKey === 'undefined') { throw new AppwriteException('Missing required parameter: "apiKey"'); } - if (typeof databaseHost === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseHost"'); } - if (typeof username === 'undefined') { throw new AppwriteException('Missing required parameter: "username"'); } - if (typeof password === 'undefined') { throw new AppwriteException('Missing required parameter: "password"'); } - const apiPath = '/migrations/supabase'; const payload: Payload = {}; - if (typeof resources !== 'undefined') { payload['resources'] = resources; } - if (typeof endpoint !== 'undefined') { payload['endpoint'] = endpoint; } - if (typeof apiKey !== 'undefined') { payload['apiKey'] = apiKey; } - if (typeof databaseHost !== 'undefined') { payload['databaseHost'] = databaseHost; } - if (typeof username !== 'undefined') { payload['username'] = username; } - if (typeof password !== 'undefined') { payload['password'] = password; } - if (typeof port !== 'undefined') { payload['port'] = port; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Generate a report on Supabase Data * @@ -575,133 +568,142 @@ export class Migrations extends Service { * @param {string} password * @param {number} port * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getSupabaseReport(resources: string[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number): Promise { if (typeof resources === 'undefined') { throw new AppwriteException('Missing required parameter: "resources"'); } - if (typeof endpoint === 'undefined') { throw new AppwriteException('Missing required parameter: "endpoint"'); } - if (typeof apiKey === 'undefined') { throw new AppwriteException('Missing required parameter: "apiKey"'); } - if (typeof databaseHost === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseHost"'); } - if (typeof username === 'undefined') { throw new AppwriteException('Missing required parameter: "username"'); } - if (typeof password === 'undefined') { throw new AppwriteException('Missing required parameter: "password"'); } - const apiPath = '/migrations/supabase/report'; const payload: Payload = {}; - if (typeof resources !== 'undefined') { payload['resources'] = resources; } - if (typeof endpoint !== 'undefined') { payload['endpoint'] = endpoint; } - if (typeof apiKey !== 'undefined') { payload['apiKey'] = apiKey; } - if (typeof databaseHost !== 'undefined') { payload['databaseHost'] = databaseHost; } - if (typeof username !== 'undefined') { payload['username'] = username; } - if (typeof password !== 'undefined') { payload['password'] = password; } - if (typeof port !== 'undefined') { payload['port'] = port; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Get Migration * * * @param {string} migrationId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async get(migrationId: string): Promise { if (typeof migrationId === 'undefined') { throw new AppwriteException('Missing required parameter: "migrationId"'); } - const apiPath = '/migrations/{migrationId}'.replace('{migrationId}', migrationId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Retry Migration * * * @param {string} migrationId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async retry(migrationId: string): Promise { if (typeof migrationId === 'undefined') { throw new AppwriteException('Missing required parameter: "migrationId"'); } - const apiPath = '/migrations/{migrationId}'.replace('{migrationId}', migrationId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Delete Migration * * * @param {string} migrationId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async delete(migrationId: string): Promise<{}> { if (typeof migrationId === 'undefined') { throw new AppwriteException('Missing required parameter: "migrationId"'); } - const apiPath = '/migrations/{migrationId}'.replace('{migrationId}', migrationId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); + } + + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); } -}; +} diff --git a/src/services/project.ts b/src/services/project.ts index c3e1262..757da9c 100644 --- a/src/services/project.ts +++ b/src/services/project.ts @@ -1,15 +1,13 @@ -import { Service } from '../service'; -import { AppwriteException, Client } from '../client'; +import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; -import type { UploadProgress, Payload } from '../client'; import { ProjectUsageRange } from '../enums/project-usage-range'; -export class Project extends Service { +export class Project { + client: Client; - constructor(client: Client) - { - super(client); - } + constructor(client: Client) { + this.client = client; + } /** * Get project usage stats @@ -19,94 +17,101 @@ export class Project extends Service { * @param {string} endDate * @param {ProjectUsageRange} period * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getUsage(startDate: string, endDate: string, period?: ProjectUsageRange): Promise { if (typeof startDate === 'undefined') { throw new AppwriteException('Missing required parameter: "startDate"'); } - if (typeof endDate === 'undefined') { throw new AppwriteException('Missing required parameter: "endDate"'); } - const apiPath = '/project/usage'; const payload: Payload = {}; - if (typeof startDate !== 'undefined') { payload['startDate'] = startDate; } - if (typeof endDate !== 'undefined') { payload['endDate'] = endDate; } - if (typeof period !== 'undefined') { payload['period'] = period; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * List Variables * - * Get a list of all project variables. These variables will be accessible in - * all Appwrite Functions at runtime. + * Get a list of all project variables. These variables will be accessible in all Appwrite Functions at runtime. * * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listVariables(): Promise { const apiPath = '/project/variables'; const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Create Variable * - * Create a new project variable. This variable will be accessible in all - * Appwrite Functions at runtime. + * Create a new project variable. This variable will be accessible in all Appwrite Functions at runtime. * * @param {string} key * @param {string} value * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createVariable(key: string, value: string): Promise { if (typeof key === 'undefined') { throw new AppwriteException('Missing required parameter: "key"'); } - if (typeof value === 'undefined') { throw new AppwriteException('Missing required parameter: "value"'); } - const apiPath = '/project/variables'; const payload: Payload = {}; - if (typeof key !== 'undefined') { payload['key'] = key; } - if (typeof value !== 'undefined') { payload['value'] = value; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Get Variable * @@ -114,60 +119,66 @@ export class Project extends Service { * * @param {string} variableId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getVariable(variableId: string): Promise { if (typeof variableId === 'undefined') { throw new AppwriteException('Missing required parameter: "variableId"'); } - const apiPath = '/project/variables/{variableId}'.replace('{variableId}', variableId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Update Variable * - * Update project variable by its unique ID. This variable will be accessible - * in all Appwrite Functions at runtime. + * Update project variable by its unique ID. This variable will be accessible in all Appwrite Functions at runtime. * * @param {string} variableId * @param {string} key * @param {string} value * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateVariable(variableId: string, key: string, value?: string): Promise { if (typeof variableId === 'undefined') { throw new AppwriteException('Missing required parameter: "variableId"'); } - if (typeof key === 'undefined') { throw new AppwriteException('Missing required parameter: "key"'); } - const apiPath = '/project/variables/{variableId}'.replace('{variableId}', variableId); const payload: Payload = {}; - if (typeof key !== 'undefined') { payload['key'] = key; } - if (typeof value !== 'undefined') { payload['value'] = value; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('put', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'put', + uri, + apiHeaders, + payload + ); + } /** * Delete Variable * @@ -175,19 +186,25 @@ export class Project extends Service { * * @param {string} variableId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async deleteVariable(variableId: string): Promise<{}> { if (typeof variableId === 'undefined') { throw new AppwriteException('Missing required parameter: "variableId"'); } - const apiPath = '/project/variables/{variableId}'.replace('{variableId}', variableId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); + } + + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); } -}; +} diff --git a/src/services/projects.ts b/src/services/projects.ts index e3e0f8d..4aa5ba7 100644 --- a/src/services/projects.ts +++ b/src/services/projects.ts @@ -1,7 +1,5 @@ -import { Service } from '../service'; -import { AppwriteException, Client } from '../client'; +import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; -import type { UploadProgress, Payload } from '../client'; import { Region } from '../enums/region'; import { Api } from '../enums/api'; import { AuthMethod } from '../enums/auth-method'; @@ -14,12 +12,12 @@ import { EmailTemplateLocale } from '../enums/email-template-locale'; import { SmsTemplateType } from '../enums/sms-template-type'; import { SmsTemplateLocale } from '../enums/sms-template-locale'; -export class Projects extends Service { +export class Projects { + client: Client; - constructor(client: Client) - { - super(client); - } + constructor(client: Client) { + this.client = client; + } /** * List projects @@ -28,26 +26,30 @@ export class Projects extends Service { * @param {string[]} queries * @param {string} search * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async list(queries?: string[], search?: string): Promise { const apiPath = '/projects'; const payload: Payload = {}; - if (typeof queries !== 'undefined') { payload['queries'] = queries; } - if (typeof search !== 'undefined') { payload['search'] = search; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Create project * @@ -66,104 +68,99 @@ export class Projects extends Service { * @param {string} legalAddress * @param {string} legalTaxId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async create(projectId: string, name: string, teamId: string, region?: Region, description?: string, logo?: string, url?: string, legalName?: string, legalCountry?: string, legalState?: string, legalCity?: string, legalAddress?: string, legalTaxId?: string): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof name === 'undefined') { throw new AppwriteException('Missing required parameter: "name"'); } - if (typeof teamId === 'undefined') { throw new AppwriteException('Missing required parameter: "teamId"'); } - const apiPath = '/projects'; const payload: Payload = {}; - if (typeof projectId !== 'undefined') { payload['projectId'] = projectId; } - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof teamId !== 'undefined') { payload['teamId'] = teamId; } - if (typeof region !== 'undefined') { payload['region'] = region; } - if (typeof description !== 'undefined') { payload['description'] = description; } - if (typeof logo !== 'undefined') { payload['logo'] = logo; } - if (typeof url !== 'undefined') { payload['url'] = url; } - if (typeof legalName !== 'undefined') { payload['legalName'] = legalName; } - if (typeof legalCountry !== 'undefined') { payload['legalCountry'] = legalCountry; } - if (typeof legalState !== 'undefined') { payload['legalState'] = legalState; } - if (typeof legalCity !== 'undefined') { payload['legalCity'] = legalCity; } - if (typeof legalAddress !== 'undefined') { payload['legalAddress'] = legalAddress; } - if (typeof legalTaxId !== 'undefined') { payload['legalTaxId'] = legalTaxId; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Get project * * * @param {string} projectId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async get(projectId: string): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - const apiPath = '/projects/{projectId}'.replace('{projectId}', projectId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Update project * @@ -180,88 +177,87 @@ export class Projects extends Service { * @param {string} legalAddress * @param {string} legalTaxId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async update(projectId: string, name: string, description?: string, logo?: string, url?: string, legalName?: string, legalCountry?: string, legalState?: string, legalCity?: string, legalAddress?: string, legalTaxId?: string): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof name === 'undefined') { throw new AppwriteException('Missing required parameter: "name"'); } - const apiPath = '/projects/{projectId}'.replace('{projectId}', projectId); const payload: Payload = {}; - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof description !== 'undefined') { payload['description'] = description; } - if (typeof logo !== 'undefined') { payload['logo'] = logo; } - if (typeof url !== 'undefined') { payload['url'] = url; } - if (typeof legalName !== 'undefined') { payload['legalName'] = legalName; } - if (typeof legalCountry !== 'undefined') { payload['legalCountry'] = legalCountry; } - if (typeof legalState !== 'undefined') { payload['legalState'] = legalState; } - if (typeof legalCity !== 'undefined') { payload['legalCity'] = legalCity; } - if (typeof legalAddress !== 'undefined') { payload['legalAddress'] = legalAddress; } - if (typeof legalTaxId !== 'undefined') { payload['legalTaxId'] = legalTaxId; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Delete project * * * @param {string} projectId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async delete(projectId: string): Promise<{}> { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - const apiPath = '/projects/{projectId}'.replace('{projectId}', projectId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } /** * Update API status * @@ -270,38 +266,39 @@ export class Projects extends Service { * @param {Api} api * @param {boolean} status * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateApiStatus(projectId: string, api: Api, status: boolean): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof api === 'undefined') { throw new AppwriteException('Missing required parameter: "api"'); } - if (typeof status === 'undefined') { throw new AppwriteException('Missing required parameter: "status"'); } - const apiPath = '/projects/{projectId}/api'.replace('{projectId}', projectId); const payload: Payload = {}; - if (typeof api !== 'undefined') { payload['api'] = api; } - if (typeof status !== 'undefined') { payload['status'] = status; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Update all API status * @@ -309,30 +306,33 @@ export class Projects extends Service { * @param {string} projectId * @param {boolean} status * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateApiStatusAll(projectId: string, status: boolean): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof status === 'undefined') { throw new AppwriteException('Missing required parameter: "status"'); } - const apiPath = '/projects/{projectId}/api/all'.replace('{projectId}', projectId); const payload: Payload = {}; - if (typeof status !== 'undefined') { payload['status'] = status; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Update project authentication duration * @@ -340,30 +340,33 @@ export class Projects extends Service { * @param {string} projectId * @param {number} duration * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateAuthDuration(projectId: string, duration: number): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof duration === 'undefined') { throw new AppwriteException('Missing required parameter: "duration"'); } - const apiPath = '/projects/{projectId}/auth/duration'.replace('{projectId}', projectId); const payload: Payload = {}; - if (typeof duration !== 'undefined') { payload['duration'] = duration; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Update project users limit * @@ -371,30 +374,33 @@ export class Projects extends Service { * @param {string} projectId * @param {number} limit * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateAuthLimit(projectId: string, limit: number): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof limit === 'undefined') { throw new AppwriteException('Missing required parameter: "limit"'); } - const apiPath = '/projects/{projectId}/auth/limit'.replace('{projectId}', projectId); const payload: Payload = {}; - if (typeof limit !== 'undefined') { payload['limit'] = limit; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Update project user sessions limit * @@ -402,30 +408,33 @@ export class Projects extends Service { * @param {string} projectId * @param {number} limit * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateAuthSessionsLimit(projectId: string, limit: number): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof limit === 'undefined') { throw new AppwriteException('Missing required parameter: "limit"'); } - const apiPath = '/projects/{projectId}/auth/max-sessions'.replace('{projectId}', projectId); const payload: Payload = {}; - if (typeof limit !== 'undefined') { payload['limit'] = limit; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Update the mock numbers for the project * @@ -433,30 +442,33 @@ export class Projects extends Service { * @param {string} projectId * @param {object[]} numbers * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateMockNumbers(projectId: string, numbers: object[]): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof numbers === 'undefined') { throw new AppwriteException('Missing required parameter: "numbers"'); } - const apiPath = '/projects/{projectId}/auth/mock-numbers'.replace('{projectId}', projectId); const payload: Payload = {}; - if (typeof numbers !== 'undefined') { payload['numbers'] = numbers; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Update authentication password dictionary status. Use this endpoint to enable or disable the dicitonary check for user password * @@ -464,30 +476,33 @@ export class Projects extends Service { * @param {string} projectId * @param {boolean} enabled * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateAuthPasswordDictionary(projectId: string, enabled: boolean): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof enabled === 'undefined') { throw new AppwriteException('Missing required parameter: "enabled"'); } - const apiPath = '/projects/{projectId}/auth/password-dictionary'.replace('{projectId}', projectId); const payload: Payload = {}; - if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Update authentication password history. Use this endpoint to set the number of password history to save and 0 to disable password history. * @@ -495,30 +510,33 @@ export class Projects extends Service { * @param {string} projectId * @param {number} limit * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateAuthPasswordHistory(projectId: string, limit: number): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof limit === 'undefined') { throw new AppwriteException('Missing required parameter: "limit"'); } - const apiPath = '/projects/{projectId}/auth/password-history'.replace('{projectId}', projectId); const payload: Payload = {}; - if (typeof limit !== 'undefined') { payload['limit'] = limit; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Enable or disable checking user passwords for similarity with their personal data. * @@ -526,30 +544,33 @@ export class Projects extends Service { * @param {string} projectId * @param {boolean} enabled * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updatePersonalDataCheck(projectId: string, enabled: boolean): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof enabled === 'undefined') { throw new AppwriteException('Missing required parameter: "enabled"'); } - const apiPath = '/projects/{projectId}/auth/personal-data'.replace('{projectId}', projectId); const payload: Payload = {}; - if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Update project sessions emails * @@ -557,30 +578,33 @@ export class Projects extends Service { * @param {string} projectId * @param {boolean} alerts * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateSessionAlerts(projectId: string, alerts: boolean): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof alerts === 'undefined') { throw new AppwriteException('Missing required parameter: "alerts"'); } - const apiPath = '/projects/{projectId}/auth/session-alerts'.replace('{projectId}', projectId); const payload: Payload = {}; - if (typeof alerts !== 'undefined') { payload['alerts'] = alerts; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Update project auth method status. Use this endpoint to enable or disable a given auth method for this project. * @@ -589,34 +613,36 @@ export class Projects extends Service { * @param {AuthMethod} method * @param {boolean} status * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateAuthStatus(projectId: string, method: AuthMethod, status: boolean): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof method === 'undefined') { throw new AppwriteException('Missing required parameter: "method"'); } - if (typeof status === 'undefined') { throw new AppwriteException('Missing required parameter: "status"'); } - const apiPath = '/projects/{projectId}/auth/{method}'.replace('{projectId}', projectId).replace('{method}', method); const payload: Payload = {}; - if (typeof status !== 'undefined') { payload['status'] = status; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Create JWT * @@ -625,56 +651,63 @@ export class Projects extends Service { * @param {string[]} scopes * @param {number} duration * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createJWT(projectId: string, scopes: string[], duration?: number): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof scopes === 'undefined') { throw new AppwriteException('Missing required parameter: "scopes"'); } - const apiPath = '/projects/{projectId}/jwts'.replace('{projectId}', projectId); const payload: Payload = {}; - if (typeof scopes !== 'undefined') { payload['scopes'] = scopes; } - if (typeof duration !== 'undefined') { payload['duration'] = duration; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * List keys * * * @param {string} projectId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listKeys(projectId: string): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - const apiPath = '/projects/{projectId}/keys'.replace('{projectId}', projectId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Create key * @@ -684,42 +717,42 @@ export class Projects extends Service { * @param {string[]} scopes * @param {string} expire * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createKey(projectId: string, name: string, scopes: string[], expire?: string): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof name === 'undefined') { throw new AppwriteException('Missing required parameter: "name"'); } - if (typeof scopes === 'undefined') { throw new AppwriteException('Missing required parameter: "scopes"'); } - const apiPath = '/projects/{projectId}/keys'.replace('{projectId}', projectId); const payload: Payload = {}; - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof scopes !== 'undefined') { payload['scopes'] = scopes; } - if (typeof expire !== 'undefined') { payload['expire'] = expire; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Get key * @@ -727,26 +760,30 @@ export class Projects extends Service { * @param {string} projectId * @param {string} keyId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getKey(projectId: string, keyId: string): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof keyId === 'undefined') { throw new AppwriteException('Missing required parameter: "keyId"'); } - const apiPath = '/projects/{projectId}/keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Update key * @@ -757,46 +794,45 @@ export class Projects extends Service { * @param {string[]} scopes * @param {string} expire * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateKey(projectId: string, keyId: string, name: string, scopes: string[], expire?: string): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof keyId === 'undefined') { throw new AppwriteException('Missing required parameter: "keyId"'); } - if (typeof name === 'undefined') { throw new AppwriteException('Missing required parameter: "name"'); } - if (typeof scopes === 'undefined') { throw new AppwriteException('Missing required parameter: "scopes"'); } - const apiPath = '/projects/{projectId}/keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId); const payload: Payload = {}; - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof scopes !== 'undefined') { payload['scopes'] = scopes; } - if (typeof expire !== 'undefined') { payload['expire'] = expire; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('put', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'put', + uri, + apiHeaders, + payload + ); + } /** * Delete key * @@ -804,26 +840,30 @@ export class Projects extends Service { * @param {string} projectId * @param {string} keyId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async deleteKey(projectId: string, keyId: string): Promise<{}> { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof keyId === 'undefined') { throw new AppwriteException('Missing required parameter: "keyId"'); } - const apiPath = '/projects/{projectId}/keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } /** * Update project OAuth2 * @@ -834,64 +874,69 @@ export class Projects extends Service { * @param {string} secret * @param {boolean} enabled * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateOAuth2(projectId: string, provider: OAuthProvider, appId?: string, secret?: string, enabled?: boolean): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof provider === 'undefined') { throw new AppwriteException('Missing required parameter: "provider"'); } - const apiPath = '/projects/{projectId}/oauth2'.replace('{projectId}', projectId); const payload: Payload = {}; - if (typeof provider !== 'undefined') { payload['provider'] = provider; } - if (typeof appId !== 'undefined') { payload['appId'] = appId; } - if (typeof secret !== 'undefined') { payload['secret'] = secret; } - if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * List platforms * * * @param {string} projectId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listPlatforms(projectId: string): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - const apiPath = '/projects/{projectId}/platforms'.replace('{projectId}', projectId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Create platform * @@ -903,50 +948,48 @@ export class Projects extends Service { * @param {string} store * @param {string} hostname * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createPlatform(projectId: string, type: PlatformType, name: string, key?: string, store?: string, hostname?: string): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof type === 'undefined') { throw new AppwriteException('Missing required parameter: "type"'); } - if (typeof name === 'undefined') { throw new AppwriteException('Missing required parameter: "name"'); } - const apiPath = '/projects/{projectId}/platforms'.replace('{projectId}', projectId); const payload: Payload = {}; - if (typeof type !== 'undefined') { payload['type'] = type; } - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof key !== 'undefined') { payload['key'] = key; } - if (typeof store !== 'undefined') { payload['store'] = store; } - if (typeof hostname !== 'undefined') { payload['hostname'] = hostname; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Get platform * @@ -954,26 +997,30 @@ export class Projects extends Service { * @param {string} projectId * @param {string} platformId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getPlatform(projectId: string, platformId: string): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof platformId === 'undefined') { throw new AppwriteException('Missing required parameter: "platformId"'); } - const apiPath = '/projects/{projectId}/platforms/{platformId}'.replace('{projectId}', projectId).replace('{platformId}', platformId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Update platform * @@ -985,46 +1032,45 @@ export class Projects extends Service { * @param {string} store * @param {string} hostname * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updatePlatform(projectId: string, platformId: string, name: string, key?: string, store?: string, hostname?: string): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof platformId === 'undefined') { throw new AppwriteException('Missing required parameter: "platformId"'); } - if (typeof name === 'undefined') { throw new AppwriteException('Missing required parameter: "name"'); } - const apiPath = '/projects/{projectId}/platforms/{platformId}'.replace('{projectId}', projectId).replace('{platformId}', platformId); const payload: Payload = {}; - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof key !== 'undefined') { payload['key'] = key; } - if (typeof store !== 'undefined') { payload['store'] = store; } - if (typeof hostname !== 'undefined') { payload['hostname'] = hostname; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('put', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'put', + uri, + apiHeaders, + payload + ); + } /** * Delete platform * @@ -1032,26 +1078,30 @@ export class Projects extends Service { * @param {string} projectId * @param {string} platformId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async deletePlatform(projectId: string, platformId: string): Promise<{}> { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof platformId === 'undefined') { throw new AppwriteException('Missing required parameter: "platformId"'); } - const apiPath = '/projects/{projectId}/platforms/{platformId}'.replace('{projectId}', projectId).replace('{platformId}', platformId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } /** * Update service status * @@ -1060,38 +1110,39 @@ export class Projects extends Service { * @param {ApiService} service * @param {boolean} status * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateServiceStatus(projectId: string, service: ApiService, status: boolean): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof service === 'undefined') { throw new AppwriteException('Missing required parameter: "service"'); } - if (typeof status === 'undefined') { throw new AppwriteException('Missing required parameter: "status"'); } - const apiPath = '/projects/{projectId}/service'.replace('{projectId}', projectId); const payload: Payload = {}; - if (typeof service !== 'undefined') { payload['service'] = service; } - if (typeof status !== 'undefined') { payload['status'] = status; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Update all service status * @@ -1099,30 +1150,33 @@ export class Projects extends Service { * @param {string} projectId * @param {boolean} status * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateServiceStatusAll(projectId: string, status: boolean): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof status === 'undefined') { throw new AppwriteException('Missing required parameter: "status"'); } - const apiPath = '/projects/{projectId}/service/all'.replace('{projectId}', projectId); const payload: Payload = {}; - if (typeof status !== 'undefined') { payload['status'] = status; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Update SMTP * @@ -1138,62 +1192,57 @@ export class Projects extends Service { * @param {string} password * @param {SMTPSecure} secure * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateSmtp(projectId: string, enabled: boolean, senderName?: string, senderEmail?: string, replyTo?: string, host?: string, port?: number, username?: string, password?: string, secure?: SMTPSecure): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof enabled === 'undefined') { throw new AppwriteException('Missing required parameter: "enabled"'); } - const apiPath = '/projects/{projectId}/smtp'.replace('{projectId}', projectId); const payload: Payload = {}; - if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - if (typeof senderName !== 'undefined') { payload['senderName'] = senderName; } - if (typeof senderEmail !== 'undefined') { payload['senderEmail'] = senderEmail; } - if (typeof replyTo !== 'undefined') { payload['replyTo'] = replyTo; } - if (typeof host !== 'undefined') { payload['host'] = host; } - if (typeof port !== 'undefined') { payload['port'] = port; } - if (typeof username !== 'undefined') { payload['username'] = username; } - if (typeof password !== 'undefined') { payload['password'] = password; } - if (typeof secure !== 'undefined') { payload['secure'] = secure; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Create SMTP test * @@ -1209,74 +1258,66 @@ export class Projects extends Service { * @param {string} password * @param {SMTPSecure} secure * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async createSmtpTest(projectId: string, emails: string[], senderName: string, senderEmail: string, host: string, replyTo?: string, port?: number, username?: string, password?: string, secure?: SMTPSecure): Promise<{}> { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof emails === 'undefined') { throw new AppwriteException('Missing required parameter: "emails"'); } - if (typeof senderName === 'undefined') { throw new AppwriteException('Missing required parameter: "senderName"'); } - if (typeof senderEmail === 'undefined') { throw new AppwriteException('Missing required parameter: "senderEmail"'); } - if (typeof host === 'undefined') { throw new AppwriteException('Missing required parameter: "host"'); } - const apiPath = '/projects/{projectId}/smtp/tests'.replace('{projectId}', projectId); const payload: Payload = {}; - if (typeof emails !== 'undefined') { payload['emails'] = emails; } - if (typeof senderName !== 'undefined') { payload['senderName'] = senderName; } - if (typeof senderEmail !== 'undefined') { payload['senderEmail'] = senderEmail; } - if (typeof replyTo !== 'undefined') { payload['replyTo'] = replyTo; } - if (typeof host !== 'undefined') { payload['host'] = host; } - if (typeof port !== 'undefined') { payload['port'] = port; } - if (typeof username !== 'undefined') { payload['username'] = username; } - if (typeof password !== 'undefined') { payload['password'] = password; } - if (typeof secure !== 'undefined') { payload['secure'] = secure; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Update project team * @@ -1284,30 +1325,33 @@ export class Projects extends Service { * @param {string} projectId * @param {string} teamId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateTeam(projectId: string, teamId: string): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof teamId === 'undefined') { throw new AppwriteException('Missing required parameter: "teamId"'); } - const apiPath = '/projects/{projectId}/team'.replace('{projectId}', projectId); const payload: Payload = {}; - if (typeof teamId !== 'undefined') { payload['teamId'] = teamId; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Get custom email template * @@ -1316,30 +1360,33 @@ export class Projects extends Service { * @param {EmailTemplateType} type * @param {EmailTemplateLocale} locale * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getEmailTemplate(projectId: string, type: EmailTemplateType, locale: EmailTemplateLocale): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof type === 'undefined') { throw new AppwriteException('Missing required parameter: "type"'); } - if (typeof locale === 'undefined') { throw new AppwriteException('Missing required parameter: "locale"'); } - const apiPath = '/projects/{projectId}/templates/email/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Update custom email templates * @@ -1353,58 +1400,54 @@ export class Projects extends Service { * @param {string} senderEmail * @param {string} replyTo * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateEmailTemplate(projectId: string, type: EmailTemplateType, locale: EmailTemplateLocale, subject: string, message: string, senderName?: string, senderEmail?: string, replyTo?: string): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof type === 'undefined') { throw new AppwriteException('Missing required parameter: "type"'); } - if (typeof locale === 'undefined') { throw new AppwriteException('Missing required parameter: "locale"'); } - if (typeof subject === 'undefined') { throw new AppwriteException('Missing required parameter: "subject"'); } - if (typeof message === 'undefined') { throw new AppwriteException('Missing required parameter: "message"'); } - const apiPath = '/projects/{projectId}/templates/email/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale); const payload: Payload = {}; - if (typeof subject !== 'undefined') { payload['subject'] = subject; } - if (typeof message !== 'undefined') { payload['message'] = message; } - if (typeof senderName !== 'undefined') { payload['senderName'] = senderName; } - if (typeof senderEmail !== 'undefined') { payload['senderEmail'] = senderEmail; } - if (typeof replyTo !== 'undefined') { payload['replyTo'] = replyTo; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Reset custom email template * @@ -1413,30 +1456,33 @@ export class Projects extends Service { * @param {EmailTemplateType} type * @param {EmailTemplateLocale} locale * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async deleteEmailTemplate(projectId: string, type: EmailTemplateType, locale: EmailTemplateLocale): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof type === 'undefined') { throw new AppwriteException('Missing required parameter: "type"'); } - if (typeof locale === 'undefined') { throw new AppwriteException('Missing required parameter: "locale"'); } - const apiPath = '/projects/{projectId}/templates/email/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } /** * Get custom SMS template * @@ -1445,30 +1491,33 @@ export class Projects extends Service { * @param {SmsTemplateType} type * @param {SmsTemplateLocale} locale * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getSmsTemplate(projectId: string, type: SmsTemplateType, locale: SmsTemplateLocale): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof type === 'undefined') { throw new AppwriteException('Missing required parameter: "type"'); } - if (typeof locale === 'undefined') { throw new AppwriteException('Missing required parameter: "locale"'); } - const apiPath = '/projects/{projectId}/templates/sms/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Update custom SMS template * @@ -1478,38 +1527,39 @@ export class Projects extends Service { * @param {SmsTemplateLocale} locale * @param {string} message * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateSmsTemplate(projectId: string, type: SmsTemplateType, locale: SmsTemplateLocale, message: string): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof type === 'undefined') { throw new AppwriteException('Missing required parameter: "type"'); } - if (typeof locale === 'undefined') { throw new AppwriteException('Missing required parameter: "locale"'); } - if (typeof message === 'undefined') { throw new AppwriteException('Missing required parameter: "message"'); } - const apiPath = '/projects/{projectId}/templates/sms/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale); const payload: Payload = {}; - if (typeof message !== 'undefined') { payload['message'] = message; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Reset custom SMS template * @@ -1518,52 +1568,60 @@ export class Projects extends Service { * @param {SmsTemplateType} type * @param {SmsTemplateLocale} locale * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async deleteSmsTemplate(projectId: string, type: SmsTemplateType, locale: SmsTemplateLocale): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof type === 'undefined') { throw new AppwriteException('Missing required parameter: "type"'); } - if (typeof locale === 'undefined') { throw new AppwriteException('Missing required parameter: "locale"'); } - const apiPath = '/projects/{projectId}/templates/sms/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } /** * List webhooks * * * @param {string} projectId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listWebhooks(projectId: string): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - const apiPath = '/projects/{projectId}/webhooks'.replace('{projectId}', projectId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Create webhook * @@ -1577,66 +1635,60 @@ export class Projects extends Service { * @param {string} httpUser * @param {string} httpPass * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createWebhook(projectId: string, name: string, events: string[], url: string, security: boolean, enabled?: boolean, httpUser?: string, httpPass?: string): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof name === 'undefined') { throw new AppwriteException('Missing required parameter: "name"'); } - if (typeof events === 'undefined') { throw new AppwriteException('Missing required parameter: "events"'); } - if (typeof url === 'undefined') { throw new AppwriteException('Missing required parameter: "url"'); } - if (typeof security === 'undefined') { throw new AppwriteException('Missing required parameter: "security"'); } - const apiPath = '/projects/{projectId}/webhooks'.replace('{projectId}', projectId); const payload: Payload = {}; - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - if (typeof events !== 'undefined') { payload['events'] = events; } - if (typeof url !== 'undefined') { payload['url'] = url; } - if (typeof security !== 'undefined') { payload['security'] = security; } - if (typeof httpUser !== 'undefined') { payload['httpUser'] = httpUser; } - if (typeof httpPass !== 'undefined') { payload['httpPass'] = httpPass; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Get webhook * @@ -1644,26 +1696,30 @@ export class Projects extends Service { * @param {string} projectId * @param {string} webhookId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getWebhook(projectId: string, webhookId: string): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof webhookId === 'undefined') { throw new AppwriteException('Missing required parameter: "webhookId"'); } - const apiPath = '/projects/{projectId}/webhooks/{webhookId}'.replace('{projectId}', projectId).replace('{webhookId}', webhookId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Update webhook * @@ -1678,70 +1734,63 @@ export class Projects extends Service { * @param {string} httpUser * @param {string} httpPass * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateWebhook(projectId: string, webhookId: string, name: string, events: string[], url: string, security: boolean, enabled?: boolean, httpUser?: string, httpPass?: string): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof webhookId === 'undefined') { throw new AppwriteException('Missing required parameter: "webhookId"'); } - if (typeof name === 'undefined') { throw new AppwriteException('Missing required parameter: "name"'); } - if (typeof events === 'undefined') { throw new AppwriteException('Missing required parameter: "events"'); } - if (typeof url === 'undefined') { throw new AppwriteException('Missing required parameter: "url"'); } - if (typeof security === 'undefined') { throw new AppwriteException('Missing required parameter: "security"'); } - const apiPath = '/projects/{projectId}/webhooks/{webhookId}'.replace('{projectId}', projectId).replace('{webhookId}', webhookId); const payload: Payload = {}; - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - if (typeof events !== 'undefined') { payload['events'] = events; } - if (typeof url !== 'undefined') { payload['url'] = url; } - if (typeof security !== 'undefined') { payload['security'] = security; } - if (typeof httpUser !== 'undefined') { payload['httpUser'] = httpUser; } - if (typeof httpPass !== 'undefined') { payload['httpPass'] = httpPass; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('put', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'put', + uri, + apiHeaders, + payload + ); + } /** * Delete webhook * @@ -1749,26 +1798,30 @@ export class Projects extends Service { * @param {string} projectId * @param {string} webhookId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async deleteWebhook(projectId: string, webhookId: string): Promise<{}> { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof webhookId === 'undefined') { throw new AppwriteException('Missing required parameter: "webhookId"'); } - const apiPath = '/projects/{projectId}/webhooks/{webhookId}'.replace('{projectId}', projectId).replace('{webhookId}', webhookId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } /** * Update webhook signature key * @@ -1776,23 +1829,28 @@ export class Projects extends Service { * @param {string} projectId * @param {string} webhookId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateWebhookSignature(projectId: string, webhookId: string): Promise { if (typeof projectId === 'undefined') { throw new AppwriteException('Missing required parameter: "projectId"'); } - if (typeof webhookId === 'undefined') { throw new AppwriteException('Missing required parameter: "webhookId"'); } - const apiPath = '/projects/{projectId}/webhooks/{webhookId}/signature'.replace('{projectId}', projectId).replace('{webhookId}', webhookId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); + } + + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); } -}; +} diff --git a/src/services/proxy.ts b/src/services/proxy.ts index b00688e..68de40e 100644 --- a/src/services/proxy.ts +++ b/src/services/proxy.ts @@ -1,45 +1,46 @@ -import { Service } from '../service'; -import { AppwriteException, Client } from '../client'; +import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; -import type { UploadProgress, Payload } from '../client'; import { ResourceType } from '../enums/resource-type'; -export class Proxy extends Service { +export class Proxy { + client: Client; - constructor(client: Client) - { - super(client); - } + constructor(client: Client) { + this.client = client; + } /** * List Rules * - * Get a list of all the proxy rules. You can use the query params to filter - * your results. + * Get a list of all the proxy rules. You can use the query params to filter your results. * * @param {string[]} queries * @param {string} search * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listRules(queries?: string[], search?: string): Promise { const apiPath = '/proxy/rules'; const payload: Payload = {}; - if (typeof queries !== 'undefined') { payload['queries'] = queries; } - if (typeof search !== 'undefined') { payload['search'] = search; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Create Rule * @@ -49,38 +50,39 @@ export class Proxy extends Service { * @param {ResourceType} resourceType * @param {string} resourceId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createRule(domain: string, resourceType: ResourceType, resourceId?: string): Promise { if (typeof domain === 'undefined') { throw new AppwriteException('Missing required parameter: "domain"'); } - if (typeof resourceType === 'undefined') { throw new AppwriteException('Missing required parameter: "resourceType"'); } - const apiPath = '/proxy/rules'; const payload: Payload = {}; - if (typeof domain !== 'undefined') { payload['domain'] = domain; } - if (typeof resourceType !== 'undefined') { payload['resourceType'] = resourceType; } - if (typeof resourceId !== 'undefined') { payload['resourceId'] = resourceId; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Get Rule * @@ -88,22 +90,27 @@ export class Proxy extends Service { * * @param {string} ruleId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getRule(ruleId: string): Promise { if (typeof ruleId === 'undefined') { throw new AppwriteException('Missing required parameter: "ruleId"'); } - const apiPath = '/proxy/rules/{ruleId}'.replace('{ruleId}', ruleId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Delete Rule * @@ -111,41 +118,52 @@ export class Proxy extends Service { * * @param {string} ruleId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async deleteRule(ruleId: string): Promise<{}> { if (typeof ruleId === 'undefined') { throw new AppwriteException('Missing required parameter: "ruleId"'); } - const apiPath = '/proxy/rules/{ruleId}'.replace('{ruleId}', ruleId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } /** * Update Rule Verification Status * * * @param {string} ruleId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateRuleVerification(ruleId: string): Promise { if (typeof ruleId === 'undefined') { throw new AppwriteException('Missing required parameter: "ruleId"'); } - const apiPath = '/proxy/rules/{ruleId}/verification'.replace('{ruleId}', ruleId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); + } + + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); } -}; +} diff --git a/src/services/storage.ts b/src/services/storage.ts index 696da13..5355d96 100644 --- a/src/services/storage.ts +++ b/src/services/storage.ts @@ -1,48 +1,49 @@ -import { Service } from '../service'; -import { AppwriteException, Client } from '../client'; +import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; -import type { UploadProgress, Payload } from '../client'; import { Compression } from '../enums/compression'; import { ImageGravity } from '../enums/image-gravity'; import { ImageFormat } from '../enums/image-format'; import { StorageUsageRange } from '../enums/storage-usage-range'; -export class Storage extends Service { +export class Storage { + client: Client; - constructor(client: Client) - { - super(client); - } + constructor(client: Client) { + this.client = client; + } /** * List buckets * - * Get a list of all the storage buckets. You can use the query params to - * filter your results. + * Get a list of all the storage buckets. You can use the query params to filter your results. * * @param {string[]} queries * @param {string} search * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listBuckets(queries?: string[], search?: string): Promise { const apiPath = '/storage/buckets'; const payload: Payload = {}; - if (typeof queries !== 'undefined') { payload['queries'] = queries; } - if (typeof search !== 'undefined') { payload['search'] = search; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Create bucket * @@ -59,90 +60,88 @@ export class Storage extends Service { * @param {boolean} encryption * @param {boolean} antivirus * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createBucket(bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean): Promise { if (typeof bucketId === 'undefined') { throw new AppwriteException('Missing required parameter: "bucketId"'); } - if (typeof name === 'undefined') { throw new AppwriteException('Missing required parameter: "name"'); } - const apiPath = '/storage/buckets'; const payload: Payload = {}; - if (typeof bucketId !== 'undefined') { payload['bucketId'] = bucketId; } - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof permissions !== 'undefined') { payload['permissions'] = permissions; } - if (typeof fileSecurity !== 'undefined') { payload['fileSecurity'] = fileSecurity; } - if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - if (typeof maximumFileSize !== 'undefined') { payload['maximumFileSize'] = maximumFileSize; } - if (typeof allowedFileExtensions !== 'undefined') { payload['allowedFileExtensions'] = allowedFileExtensions; } - if (typeof compression !== 'undefined') { payload['compression'] = compression; } - if (typeof encryption !== 'undefined') { payload['encryption'] = encryption; } - if (typeof antivirus !== 'undefined') { payload['antivirus'] = antivirus; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Get bucket * - * Get a storage bucket by its unique ID. This endpoint response returns a - * JSON object with the storage bucket metadata. + * Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata. * * @param {string} bucketId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getBucket(bucketId: string): Promise { if (typeof bucketId === 'undefined') { throw new AppwriteException('Missing required parameter: "bucketId"'); } - const apiPath = '/storage/buckets/{bucketId}'.replace('{bucketId}', bucketId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Update bucket * @@ -159,62 +158,57 @@ export class Storage extends Service { * @param {boolean} encryption * @param {boolean} antivirus * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateBucket(bucketId: string, name: string, permissions?: string[], fileSecurity?: boolean, enabled?: boolean, maximumFileSize?: number, allowedFileExtensions?: string[], compression?: Compression, encryption?: boolean, antivirus?: boolean): Promise { if (typeof bucketId === 'undefined') { throw new AppwriteException('Missing required parameter: "bucketId"'); } - if (typeof name === 'undefined') { throw new AppwriteException('Missing required parameter: "name"'); } - const apiPath = '/storage/buckets/{bucketId}'.replace('{bucketId}', bucketId); const payload: Payload = {}; - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof permissions !== 'undefined') { payload['permissions'] = permissions; } - if (typeof fileSecurity !== 'undefined') { payload['fileSecurity'] = fileSecurity; } - if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - if (typeof maximumFileSize !== 'undefined') { payload['maximumFileSize'] = maximumFileSize; } - if (typeof allowedFileExtensions !== 'undefined') { payload['allowedFileExtensions'] = allowedFileExtensions; } - if (typeof compression !== 'undefined') { payload['compression'] = compression; } - if (typeof encryption !== 'undefined') { payload['encryption'] = encryption; } - if (typeof antivirus !== 'undefined') { payload['antivirus'] = antivirus; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('put', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'put', + uri, + apiHeaders, + payload + ); + } /** * Delete bucket * @@ -222,306 +216,258 @@ export class Storage extends Service { * * @param {string} bucketId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async deleteBucket(bucketId: string): Promise<{}> { if (typeof bucketId === 'undefined') { throw new AppwriteException('Missing required parameter: "bucketId"'); } - const apiPath = '/storage/buckets/{bucketId}'.replace('{bucketId}', bucketId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } /** * List files * - * Get a list of all the user files. You can use the query params to filter - * your results. + * Get a list of all the user files. You can use the query params to filter your results. * * @param {string} bucketId * @param {string[]} queries * @param {string} search * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listFiles(bucketId: string, queries?: string[], search?: string): Promise { if (typeof bucketId === 'undefined') { throw new AppwriteException('Missing required parameter: "bucketId"'); } - const apiPath = '/storage/buckets/{bucketId}/files'.replace('{bucketId}', bucketId); const payload: Payload = {}; - if (typeof queries !== 'undefined') { payload['queries'] = queries; } - if (typeof search !== 'undefined') { payload['search'] = search; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Create file * - * Create a new file. Before using this route, you should create a new bucket - * resource using either a [server - * integration](https://appwrite.io/docs/server/storage#storageCreateBucket) - * API or directly from your Appwrite console. - * - * Larger files should be uploaded using multiple requests with the - * [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) - * header to send a partial request with a maximum supported chunk of `5MB`. - * The `content-range` header values should always be in bytes. - * - * When the first request is sent, the server will return the **File** object, - * and the subsequent part request must include the file's **id** in - * `x-appwrite-id` header to allow the server to know that the partial upload - * is for the existing file and not for a new one. - * - * If you're creating a new file using one of the Appwrite SDKs, all the - * chunking logic will be managed by the SDK internally. - * + * Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https://appwrite.io/docs/server/storage#storageCreateBucket) API or directly from your Appwrite console. + +Larger files should be uploaded using multiple requests with the [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes. + +When the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one. + +If you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally. + * * @param {string} bucketId * @param {string} fileId * @param {File} file * @param {string[]} permissions * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createFile(bucketId: string, fileId: string, file: File, permissions?: string[], onProgress = (progress: UploadProgress) => {}): Promise { if (typeof bucketId === 'undefined') { throw new AppwriteException('Missing required parameter: "bucketId"'); } - if (typeof fileId === 'undefined') { throw new AppwriteException('Missing required parameter: "fileId"'); } - if (typeof file === 'undefined') { throw new AppwriteException('Missing required parameter: "file"'); } - const apiPath = '/storage/buckets/{bucketId}/files'.replace('{bucketId}', bucketId); const payload: Payload = {}; - if (typeof fileId !== 'undefined') { payload['fileId'] = fileId; } - if (typeof file !== 'undefined') { payload['file'] = file; } - if (typeof permissions !== 'undefined') { payload['permissions'] = permissions; } - const uri = new URL(this.client.config.endpoint + apiPath); - if(!(file instanceof File)) { - throw new AppwriteException('Parameter "file" has to be a File.'); - } - - const size = file.size; - - if (size <= Service.CHUNK_SIZE) { - return await this.client.call('post', uri, { - 'content-type': 'multipart/form-data', - }, payload); - } - const apiHeaders: { [header: string]: string } = { 'content-type': 'multipart/form-data', } - let offset = 0; - let response = undefined; - if(fileId != 'unique()') { - try { - response = await this.client.call('GET', new URL(this.client.config.endpoint + apiPath + '/' + fileId), apiHeaders); - offset = response.chunksUploaded * Service.CHUNK_SIZE; - } catch(e) { - } - } - - while (offset < size) { - let end = Math.min(offset + Service.CHUNK_SIZE - 1, size - 1); - - apiHeaders['content-range'] = 'bytes ' + offset + '-' + end + '/' + size; - if (response && response.$id) { - apiHeaders['x-appwrite-id'] = response.$id; - } - - const chunk = file.slice(offset, end + 1); - payload['file'] = new File([chunk], file.name); - response = await this.client.call('post', uri, apiHeaders, payload); - - if (onProgress) { - onProgress({ - $id: response.$id, - progress: (offset / size) * 100, - sizeUploaded: offset, - chunksTotal: response.chunksTotal, - chunksUploaded: response.chunksUploaded - }); - } - offset += Service.CHUNK_SIZE; - } - return response; + return await this.client.chunkedUpload( + 'post', + uri, + apiHeaders, + payload, + onProgress + ); } - /** * Get file * - * Get a file by its unique ID. This endpoint response returns a JSON object - * with the file metadata. + * Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata. * * @param {string} bucketId * @param {string} fileId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getFile(bucketId: string, fileId: string): Promise { if (typeof bucketId === 'undefined') { throw new AppwriteException('Missing required parameter: "bucketId"'); } - if (typeof fileId === 'undefined') { throw new AppwriteException('Missing required parameter: "fileId"'); } - const apiPath = '/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', bucketId).replace('{fileId}', fileId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Update file * - * Update a file by its unique ID. Only users with write permissions have - * access to update this resource. + * Update a file by its unique ID. Only users with write permissions have access to update this resource. * * @param {string} bucketId * @param {string} fileId * @param {string} name * @param {string[]} permissions * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateFile(bucketId: string, fileId: string, name?: string, permissions?: string[]): Promise { if (typeof bucketId === 'undefined') { throw new AppwriteException('Missing required parameter: "bucketId"'); } - if (typeof fileId === 'undefined') { throw new AppwriteException('Missing required parameter: "fileId"'); } - const apiPath = '/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', bucketId).replace('{fileId}', fileId); const payload: Payload = {}; - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof permissions !== 'undefined') { payload['permissions'] = permissions; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('put', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'put', + uri, + apiHeaders, + payload + ); + } /** * Delete File * - * Delete a file by its unique ID. Only users with write permissions have - * access to delete this resource. + * Delete a file by its unique ID. Only users with write permissions have access to delete this resource. * * @param {string} bucketId * @param {string} fileId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async deleteFile(bucketId: string, fileId: string): Promise<{}> { if (typeof bucketId === 'undefined') { throw new AppwriteException('Missing required parameter: "bucketId"'); } - if (typeof fileId === 'undefined') { throw new AppwriteException('Missing required parameter: "fileId"'); } - const apiPath = '/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', bucketId).replace('{fileId}', fileId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } /** * Get file for download * - * Get a file content by its unique ID. The endpoint response return with a - * 'Content-Disposition: attachment' header that tells the browser to start - * downloading the file to user downloads directory. + * Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. * * @param {string} bucketId * @param {string} fileId * @throws {AppwriteException} - * @returns {URL} - */ - getFileDownload(bucketId: string, fileId: string): URL { + * @returns {string} + */ + getFileDownload(bucketId: string, fileId: string): string { if (typeof bucketId === 'undefined') { throw new AppwriteException('Missing required parameter: "bucketId"'); } - if (typeof fileId === 'undefined') { throw new AppwriteException('Missing required parameter: "fileId"'); } - const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/download'.replace('{bucketId}', bucketId).replace('{fileId}', fileId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - payload['project'] = this.client.config.project; + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + payload['project'] = this.client.config.project; - for (const [key, value] of Object.entries(Service.flatten(payload))) { + for (const [key, value] of Object.entries(Client.flatten(payload))) { uri.searchParams.append(key, value); } - return uri; - } + return uri.toString(); + } /** * Get file preview * - * Get a file preview image. Currently, this method supports preview for image - * files (jpg, png, and gif), other supported formats, like pdf, docs, slides, - * and spreadsheets, will return the file icon image. You can also pass query - * string arguments for cutting and resizing your preview image. Preview is - * supported only for image files smaller than 10MB. + * Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB. * * @param {string} bucketId * @param {string} fileId @@ -537,130 +483,124 @@ export class Storage extends Service { * @param {string} background * @param {ImageFormat} output * @throws {AppwriteException} - * @returns {URL} - */ - getFilePreview(bucketId: string, fileId: string, width?: number, height?: number, gravity?: ImageGravity, quality?: number, borderWidth?: number, borderColor?: string, borderRadius?: number, opacity?: number, rotation?: number, background?: string, output?: ImageFormat): URL { + * @returns {string} + */ + getFilePreview(bucketId: string, fileId: string, width?: number, height?: number, gravity?: ImageGravity, quality?: number, borderWidth?: number, borderColor?: string, borderRadius?: number, opacity?: number, rotation?: number, background?: string, output?: ImageFormat): string { if (typeof bucketId === 'undefined') { throw new AppwriteException('Missing required parameter: "bucketId"'); } - if (typeof fileId === 'undefined') { throw new AppwriteException('Missing required parameter: "fileId"'); } - const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/preview'.replace('{bucketId}', bucketId).replace('{fileId}', fileId); const payload: Payload = {}; - if (typeof width !== 'undefined') { payload['width'] = width; } - if (typeof height !== 'undefined') { payload['height'] = height; } - if (typeof gravity !== 'undefined') { payload['gravity'] = gravity; } - if (typeof quality !== 'undefined') { payload['quality'] = quality; } - if (typeof borderWidth !== 'undefined') { payload['borderWidth'] = borderWidth; } - if (typeof borderColor !== 'undefined') { payload['borderColor'] = borderColor; } - if (typeof borderRadius !== 'undefined') { payload['borderRadius'] = borderRadius; } - if (typeof opacity !== 'undefined') { payload['opacity'] = opacity; } - if (typeof rotation !== 'undefined') { payload['rotation'] = rotation; } - if (typeof background !== 'undefined') { payload['background'] = background; } - if (typeof output !== 'undefined') { payload['output'] = output; } - const uri = new URL(this.client.config.endpoint + apiPath); - payload['project'] = this.client.config.project; + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } - for (const [key, value] of Object.entries(Service.flatten(payload))) { + payload['project'] = this.client.config.project; + + for (const [key, value] of Object.entries(Client.flatten(payload))) { uri.searchParams.append(key, value); } - return uri; - } + return uri.toString(); + } /** * Get file for view * - * Get a file content by its unique ID. This endpoint is similar to the - * download method but returns with no 'Content-Disposition: attachment' - * header. + * Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header. * * @param {string} bucketId * @param {string} fileId * @throws {AppwriteException} - * @returns {URL} - */ - getFileView(bucketId: string, fileId: string): URL { + * @returns {string} + */ + getFileView(bucketId: string, fileId: string): string { if (typeof bucketId === 'undefined') { throw new AppwriteException('Missing required parameter: "bucketId"'); } - if (typeof fileId === 'undefined') { throw new AppwriteException('Missing required parameter: "fileId"'); } - const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/view'.replace('{bucketId}', bucketId).replace('{fileId}', fileId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - payload['project'] = this.client.config.project; + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } - for (const [key, value] of Object.entries(Service.flatten(payload))) { + payload['project'] = this.client.config.project; + + for (const [key, value] of Object.entries(Client.flatten(payload))) { uri.searchParams.append(key, value); } - return uri; - } + return uri.toString(); + } /** * Get storage usage stats * * * @param {StorageUsageRange} range * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getUsage(range?: StorageUsageRange): Promise { const apiPath = '/storage/usage'; const payload: Payload = {}; - if (typeof range !== 'undefined') { payload['range'] = range; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Get bucket usage stats * @@ -668,23 +608,28 @@ export class Storage extends Service { * @param {string} bucketId * @param {StorageUsageRange} range * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getBucketUsage(bucketId: string, range?: StorageUsageRange): Promise { if (typeof bucketId === 'undefined') { throw new AppwriteException('Missing required parameter: "bucketId"'); } - const apiPath = '/storage/{bucketId}/usage'.replace('{bucketId}', bucketId); const payload: Payload = {}; - if (typeof range !== 'undefined') { payload['range'] = range; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); + } + + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); } -}; +} diff --git a/src/services/teams.ts b/src/services/teams.ts index 1422282..8982c25 100644 --- a/src/services/teams.ts +++ b/src/services/teams.ts @@ -1,87 +1,87 @@ -import { Service } from '../service'; -import { AppwriteException, Client } from '../client'; +import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; -import type { UploadProgress, Payload } from '../client'; -export class Teams extends Service { +export class Teams { + client: Client; - constructor(client: Client) - { - super(client); - } + constructor(client: Client) { + this.client = client; + } /** * List teams * - * Get a list of all the teams in which the current user is a member. You can - * use the parameters to filter your results. + * Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results. * * @param {string[]} queries * @param {string} search * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise>} + */ async list(queries?: string[], search?: string): Promise> { const apiPath = '/teams'; const payload: Payload = {}; - if (typeof queries !== 'undefined') { payload['queries'] = queries; } - if (typeof search !== 'undefined') { payload['search'] = search; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Create team * - * 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. + * 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. * * @param {string} teamId * @param {string} name * @param {string[]} roles * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise>} + */ async create(teamId: string, name: string, roles?: string[]): Promise> { if (typeof teamId === 'undefined') { throw new AppwriteException('Missing required parameter: "teamId"'); } - if (typeof name === 'undefined') { throw new AppwriteException('Missing required parameter: "name"'); } - const apiPath = '/teams'; const payload: Payload = {}; - if (typeof teamId !== 'undefined') { payload['teamId'] = teamId; } - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof roles !== 'undefined') { payload['roles'] = roles; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Get team * @@ -89,78 +89,90 @@ export class Teams extends Service { * * @param {string} teamId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise>} + */ async get(teamId: string): Promise> { if (typeof teamId === 'undefined') { throw new AppwriteException('Missing required parameter: "teamId"'); } - const apiPath = '/teams/{teamId}'.replace('{teamId}', teamId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Update name * - * Update the team's name by its unique ID. + * Update the team's name by its unique ID. * * @param {string} teamId * @param {string} name * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise>} + */ async updateName(teamId: string, name: string): Promise> { if (typeof teamId === 'undefined') { throw new AppwriteException('Missing required parameter: "teamId"'); } - if (typeof name === 'undefined') { throw new AppwriteException('Missing required parameter: "name"'); } - const apiPath = '/teams/{teamId}'.replace('{teamId}', teamId); const payload: Payload = {}; - if (typeof name !== 'undefined') { payload['name'] = name; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('put', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'put', + uri, + apiHeaders, + payload + ); + } /** * Delete team * - * Delete a team using its ID. Only team members with the owner role can - * delete the team. + * Delete a team using its ID. Only team members with the owner role can delete the team. * * @param {string} teamId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async delete(teamId: string): Promise<{}> { if (typeof teamId === 'undefined') { throw new AppwriteException('Missing required parameter: "teamId"'); } - const apiPath = '/teams/{teamId}'.replace('{teamId}', teamId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } /** * List team logs * @@ -169,84 +181,77 @@ export class Teams extends Service { * @param {string} teamId * @param {string[]} queries * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listLogs(teamId: string, queries?: string[]): Promise { if (typeof teamId === 'undefined') { throw new AppwriteException('Missing required parameter: "teamId"'); } - const apiPath = '/teams/{teamId}/logs'.replace('{teamId}', teamId); const payload: Payload = {}; - if (typeof queries !== 'undefined') { payload['queries'] = queries; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * List team memberships * - * Use this endpoint to list a team's members using the team's ID. All team - * members have read access to this endpoint. + * Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. * * @param {string} teamId * @param {string[]} queries * @param {string} search * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listMemberships(teamId: string, queries?: string[], search?: string): Promise { if (typeof teamId === 'undefined') { throw new AppwriteException('Missing required parameter: "teamId"'); } - const apiPath = '/teams/{teamId}/memberships'.replace('{teamId}', teamId); const payload: Payload = {}; - if (typeof queries !== 'undefined') { payload['queries'] = queries; } - if (typeof search !== 'undefined') { payload['search'] = search; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Create team membership * - * 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. - * - * 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. - * - * 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. - * - * 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. - * + * 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. + +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. + +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. + +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. + * * @param {string} teamId * @param {string[]} roles @@ -256,257 +261,262 @@ export class Teams extends Service { * @param {string} url * @param {string} name * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createMembership(teamId: string, roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string): Promise { if (typeof teamId === 'undefined') { throw new AppwriteException('Missing required parameter: "teamId"'); } - if (typeof roles === 'undefined') { throw new AppwriteException('Missing required parameter: "roles"'); } - const apiPath = '/teams/{teamId}/memberships'.replace('{teamId}', teamId); const payload: Payload = {}; - if (typeof email !== 'undefined') { payload['email'] = email; } - if (typeof userId !== 'undefined') { payload['userId'] = userId; } - if (typeof phone !== 'undefined') { payload['phone'] = phone; } - if (typeof roles !== 'undefined') { payload['roles'] = roles; } - if (typeof url !== 'undefined') { payload['url'] = url; } - if (typeof name !== 'undefined') { payload['name'] = name; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Get team membership * - * Get a team member by the membership unique id. All team members have read - * access for this resource. + * Get a team member by the membership unique id. All team members have read access for this resource. * * @param {string} teamId * @param {string} membershipId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getMembership(teamId: string, membershipId: string): Promise { if (typeof teamId === 'undefined') { throw new AppwriteException('Missing required parameter: "teamId"'); } - if (typeof membershipId === 'undefined') { throw new AppwriteException('Missing required parameter: "membershipId"'); } - const apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Update membership * - * 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). - * + * 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). + * * @param {string} teamId * @param {string} membershipId * @param {string[]} roles * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateMembership(teamId: string, membershipId: string, roles: string[]): Promise { if (typeof teamId === 'undefined') { throw new AppwriteException('Missing required parameter: "teamId"'); } - if (typeof membershipId === 'undefined') { throw new AppwriteException('Missing required parameter: "membershipId"'); } - if (typeof roles === 'undefined') { throw new AppwriteException('Missing required parameter: "roles"'); } - const apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId); const payload: Payload = {}; - if (typeof roles !== 'undefined') { payload['roles'] = roles; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Delete team membership * - * 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. + * 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. * * @param {string} teamId * @param {string} membershipId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async deleteMembership(teamId: string, membershipId: string): Promise<{}> { if (typeof teamId === 'undefined') { throw new AppwriteException('Missing required parameter: "teamId"'); } - if (typeof membershipId === 'undefined') { throw new AppwriteException('Missing required parameter: "membershipId"'); } - const apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } /** * Update team membership status * - * 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. - * - * If the request is successful, a session for the user is automatically - * created. - * + * 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. + +If the request is successful, a session for the user is automatically created. + * * @param {string} teamId * @param {string} membershipId * @param {string} userId * @param {string} secret * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateMembershipStatus(teamId: string, membershipId: string, userId: string, secret: string): Promise { if (typeof teamId === 'undefined') { throw new AppwriteException('Missing required parameter: "teamId"'); } - if (typeof membershipId === 'undefined') { throw new AppwriteException('Missing required parameter: "membershipId"'); } - if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof secret === 'undefined') { throw new AppwriteException('Missing required parameter: "secret"'); } - const apiPath = '/teams/{teamId}/memberships/{membershipId}/status'.replace('{teamId}', teamId).replace('{membershipId}', membershipId); const payload: Payload = {}; - if (typeof userId !== 'undefined') { payload['userId'] = userId; } - if (typeof secret !== 'undefined') { payload['secret'] = secret; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Get team preferences * - * 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). + * 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). * * @param {string} teamId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getPrefs(teamId: string): Promise { if (typeof teamId === 'undefined') { throw new AppwriteException('Missing required parameter: "teamId"'); } - const apiPath = '/teams/{teamId}/prefs'.replace('{teamId}', teamId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Update preferences * - * 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. + * 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. * * @param {string} teamId * @param {object} prefs * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updatePrefs(teamId: string, prefs: object): Promise { if (typeof teamId === 'undefined') { throw new AppwriteException('Missing required parameter: "teamId"'); } - if (typeof prefs === 'undefined') { throw new AppwriteException('Missing required parameter: "prefs"'); } - const apiPath = '/teams/{teamId}/prefs'.replace('{teamId}', teamId); const payload: Payload = {}; - if (typeof prefs !== 'undefined') { payload['prefs'] = prefs; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('put', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); + } + + return await this.client.call( + 'put', + uri, + apiHeaders, + payload + ); } -}; +} diff --git a/src/services/users.ts b/src/services/users.ts index 403cd6b..9af4e6e 100644 --- a/src/services/users.ts +++ b/src/services/users.ts @@ -1,48 +1,49 @@ -import { Service } from '../service'; -import { AppwriteException, Client } from '../client'; +import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; -import type { UploadProgress, Payload } from '../client'; import { PasswordHash } from '../enums/password-hash'; import { UserUsageRange } from '../enums/user-usage-range'; import { AuthenticatorType } from '../enums/authenticator-type'; import { MessagingProviderType } from '../enums/messaging-provider-type'; -export class Users extends Service { +export class Users { + client: Client; - constructor(client: Client) - { - super(client); - } + constructor(client: Client) { + this.client = client; + } /** * List users * - * Get a list of all the project's users. You can use the query params to - * filter your results. + * Get a list of all the project's users. You can use the query params to filter your results. * * @param {string[]} queries * @param {string} search * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise>} + */ async list(queries?: string[], search?: string): Promise> { const apiPath = '/users'; const payload: Payload = {}; - if (typeof queries !== 'undefined') { payload['queries'] = queries; } - if (typeof search !== 'undefined') { payload['search'] = search; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Create user * @@ -54,148 +55,140 @@ export class Users extends Service { * @param {string} password * @param {string} name * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise>} + */ async create(userId: string, email?: string, phone?: string, password?: string, name?: string): Promise> { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - const apiPath = '/users'; const payload: Payload = {}; - if (typeof userId !== 'undefined') { payload['userId'] = userId; } - if (typeof email !== 'undefined') { payload['email'] = email; } - if (typeof phone !== 'undefined') { payload['phone'] = phone; } - if (typeof password !== 'undefined') { payload['password'] = password; } - if (typeof name !== 'undefined') { payload['name'] = name; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Create user with Argon2 password * - * Create a new user. Password provided must be hashed with the - * [Argon2](https://en.wikipedia.org/wiki/Argon2) algorithm. Use the [POST - * /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to - * create users with a plain text password. + * Create a new user. Password provided must be hashed with the [Argon2](https://en.wikipedia.org/wiki/Argon2) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. * * @param {string} userId * @param {string} email * @param {string} password * @param {string} name * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise>} + */ async createArgon2User(userId: string, email: string, password: string, name?: string): Promise> { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof email === 'undefined') { throw new AppwriteException('Missing required parameter: "email"'); } - if (typeof password === 'undefined') { throw new AppwriteException('Missing required parameter: "password"'); } - const apiPath = '/users/argon2'; const payload: Payload = {}; - if (typeof userId !== 'undefined') { payload['userId'] = userId; } - if (typeof email !== 'undefined') { payload['email'] = email; } - if (typeof password !== 'undefined') { payload['password'] = password; } - if (typeof name !== 'undefined') { payload['name'] = name; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Create user with bcrypt password * - * Create a new user. Password provided must be hashed with the - * [Bcrypt](https://en.wikipedia.org/wiki/Bcrypt) algorithm. Use the [POST - * /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to - * create users with a plain text password. + * Create a new user. Password provided must be hashed with the [Bcrypt](https://en.wikipedia.org/wiki/Bcrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. * * @param {string} userId * @param {string} email * @param {string} password * @param {string} name * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise>} + */ async createBcryptUser(userId: string, email: string, password: string, name?: string): Promise> { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof email === 'undefined') { throw new AppwriteException('Missing required parameter: "email"'); } - if (typeof password === 'undefined') { throw new AppwriteException('Missing required parameter: "password"'); } - const apiPath = '/users/bcrypt'; const payload: Payload = {}; - if (typeof userId !== 'undefined') { payload['userId'] = userId; } - if (typeof email !== 'undefined') { payload['email'] = email; } - if (typeof password !== 'undefined') { payload['password'] = password; } - if (typeof name !== 'undefined') { payload['name'] = name; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * List Identities * @@ -204,26 +197,30 @@ export class Users extends Service { * @param {string[]} queries * @param {string} search * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listIdentities(queries?: string[], search?: string): Promise { const apiPath = '/users/identities'; const payload: Payload = {}; - if (typeof queries !== 'undefined') { payload['queries'] = queries; } - if (typeof search !== 'undefined') { payload['search'] = search; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Delete identity * @@ -231,135 +228,129 @@ export class Users extends Service { * * @param {string} identityId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async deleteIdentity(identityId: string): Promise<{}> { if (typeof identityId === 'undefined') { throw new AppwriteException('Missing required parameter: "identityId"'); } - const apiPath = '/users/identities/{identityId}'.replace('{identityId}', identityId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } /** * Create user with MD5 password * - * Create a new user. Password provided must be hashed with the - * [MD5](https://en.wikipedia.org/wiki/MD5) algorithm. Use the [POST - * /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to - * create users with a plain text password. + * Create a new user. Password provided must be hashed with the [MD5](https://en.wikipedia.org/wiki/MD5) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. * * @param {string} userId * @param {string} email * @param {string} password * @param {string} name * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise>} + */ async createMD5User(userId: string, email: string, password: string, name?: string): Promise> { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof email === 'undefined') { throw new AppwriteException('Missing required parameter: "email"'); } - if (typeof password === 'undefined') { throw new AppwriteException('Missing required parameter: "password"'); } - const apiPath = '/users/md5'; const payload: Payload = {}; - if (typeof userId !== 'undefined') { payload['userId'] = userId; } - if (typeof email !== 'undefined') { payload['email'] = email; } - if (typeof password !== 'undefined') { payload['password'] = password; } - if (typeof name !== 'undefined') { payload['name'] = name; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Create user with PHPass password * - * Create a new user. Password provided must be hashed with the - * [PHPass](https://www.openwall.com/phpass/) algorithm. Use the [POST - * /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to - * create users with a plain text password. + * Create a new user. Password provided must be hashed with the [PHPass](https://www.openwall.com/phpass/) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. * * @param {string} userId * @param {string} email * @param {string} password * @param {string} name * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise>} + */ async createPHPassUser(userId: string, email: string, password: string, name?: string): Promise> { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof email === 'undefined') { throw new AppwriteException('Missing required parameter: "email"'); } - if (typeof password === 'undefined') { throw new AppwriteException('Missing required parameter: "password"'); } - const apiPath = '/users/phpass'; const payload: Payload = {}; - if (typeof userId !== 'undefined') { payload['userId'] = userId; } - if (typeof email !== 'undefined') { payload['email'] = email; } - if (typeof password !== 'undefined') { payload['password'] = password; } - if (typeof name !== 'undefined') { payload['name'] = name; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Create user with Scrypt password * - * Create a new user. Password provided must be hashed with the - * [Scrypt](https://github.com/Tarsnap/scrypt) algorithm. Use the [POST - * /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to - * create users with a plain text password. + * Create a new user. Password provided must be hashed with the [Scrypt](https://github.com/Tarsnap/scrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. * * @param {string} userId * @param {string} email @@ -371,94 +362,79 @@ export class Users extends Service { * @param {number} passwordLength * @param {string} name * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise>} + */ async createScryptUser(userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number, passwordMemory: number, passwordParallel: number, passwordLength: number, name?: string): Promise> { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof email === 'undefined') { throw new AppwriteException('Missing required parameter: "email"'); } - if (typeof password === 'undefined') { throw new AppwriteException('Missing required parameter: "password"'); } - if (typeof passwordSalt === 'undefined') { throw new AppwriteException('Missing required parameter: "passwordSalt"'); } - if (typeof passwordCpu === 'undefined') { throw new AppwriteException('Missing required parameter: "passwordCpu"'); } - if (typeof passwordMemory === 'undefined') { throw new AppwriteException('Missing required parameter: "passwordMemory"'); } - if (typeof passwordParallel === 'undefined') { throw new AppwriteException('Missing required parameter: "passwordParallel"'); } - if (typeof passwordLength === 'undefined') { throw new AppwriteException('Missing required parameter: "passwordLength"'); } - const apiPath = '/users/scrypt'; const payload: Payload = {}; - if (typeof userId !== 'undefined') { payload['userId'] = userId; } - if (typeof email !== 'undefined') { payload['email'] = email; } - if (typeof password !== 'undefined') { payload['password'] = password; } - if (typeof passwordSalt !== 'undefined') { payload['passwordSalt'] = passwordSalt; } - if (typeof passwordCpu !== 'undefined') { payload['passwordCpu'] = passwordCpu; } - if (typeof passwordMemory !== 'undefined') { payload['passwordMemory'] = passwordMemory; } - if (typeof passwordParallel !== 'undefined') { payload['passwordParallel'] = passwordParallel; } - if (typeof passwordLength !== 'undefined') { payload['passwordLength'] = passwordLength; } - if (typeof name !== 'undefined') { payload['name'] = name; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Create user with Scrypt modified password * - * Create a new user. Password provided must be hashed with the [Scrypt - * Modified](https://gist.github.com/Meldiron/eecf84a0225eccb5a378d45bb27462cc) - * algorithm. Use the [POST - * /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to - * create users with a plain text password. + * Create a new user. Password provided must be hashed with the [Scrypt Modified](https://gist.github.com/Meldiron/eecf84a0225eccb5a378d45bb27462cc) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. * * @param {string} userId * @param {string} email @@ -468,77 +444,67 @@ export class Users extends Service { * @param {string} passwordSignerKey * @param {string} name * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise>} + */ async createScryptModifiedUser(userId: string, email: string, password: string, passwordSalt: string, passwordSaltSeparator: string, passwordSignerKey: string, name?: string): Promise> { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof email === 'undefined') { throw new AppwriteException('Missing required parameter: "email"'); } - if (typeof password === 'undefined') { throw new AppwriteException('Missing required parameter: "password"'); } - if (typeof passwordSalt === 'undefined') { throw new AppwriteException('Missing required parameter: "passwordSalt"'); } - if (typeof passwordSaltSeparator === 'undefined') { throw new AppwriteException('Missing required parameter: "passwordSaltSeparator"'); } - if (typeof passwordSignerKey === 'undefined') { throw new AppwriteException('Missing required parameter: "passwordSignerKey"'); } - const apiPath = '/users/scrypt-modified'; const payload: Payload = {}; - if (typeof userId !== 'undefined') { payload['userId'] = userId; } - if (typeof email !== 'undefined') { payload['email'] = email; } - if (typeof password !== 'undefined') { payload['password'] = password; } - if (typeof passwordSalt !== 'undefined') { payload['passwordSalt'] = passwordSalt; } - if (typeof passwordSaltSeparator !== 'undefined') { payload['passwordSaltSeparator'] = passwordSaltSeparator; } - if (typeof passwordSignerKey !== 'undefined') { payload['passwordSignerKey'] = passwordSignerKey; } - if (typeof name !== 'undefined') { payload['name'] = name; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Create user with SHA password * - * Create a new user. Password provided must be hashed with the - * [SHA](https://en.wikipedia.org/wiki/Secure_Hash_Algorithm) algorithm. Use - * the [POST /users](https://appwrite.io/docs/server/users#usersCreate) - * endpoint to create users with a plain text password. + * Create a new user. Password provided must be hashed with the [SHA](https://en.wikipedia.org/wiki/Secure_Hash_Algorithm) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password. * * @param {string} userId * @param {string} email @@ -546,72 +512,75 @@ export class Users extends Service { * @param {PasswordHash} passwordVersion * @param {string} name * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise>} + */ async createSHAUser(userId: string, email: string, password: string, passwordVersion?: PasswordHash, name?: string): Promise> { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof email === 'undefined') { throw new AppwriteException('Missing required parameter: "email"'); } - if (typeof password === 'undefined') { throw new AppwriteException('Missing required parameter: "password"'); } - const apiPath = '/users/sha'; const payload: Payload = {}; - if (typeof userId !== 'undefined') { payload['userId'] = userId; } - if (typeof email !== 'undefined') { payload['email'] = email; } - if (typeof password !== 'undefined') { payload['password'] = password; } - if (typeof passwordVersion !== 'undefined') { payload['passwordVersion'] = passwordVersion; } - if (typeof name !== 'undefined') { payload['name'] = name; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Get users usage stats * * * @param {UserUsageRange} range * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getUsage(range?: UserUsageRange): Promise { const apiPath = '/users/usage'; const payload: Payload = {}; - if (typeof range !== 'undefined') { payload['range'] = range; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Get user * @@ -619,50 +588,55 @@ export class Users extends Service { * * @param {string} userId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise>} + */ async get(userId: string): Promise> { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - const apiPath = '/users/{userId}'.replace('{userId}', userId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Delete user * - * Delete a user by its unique ID, thereby releasing it's ID. Since ID is - * released and can be reused, all user-related resources like documents or - * storage files should be deleted before user deletion. If you want to keep - * ID reserved, use the - * [updateStatus](https://appwrite.io/docs/server/users#usersUpdateStatus) - * endpoint instead. + * Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](https://appwrite.io/docs/server/users#usersUpdateStatus) endpoint instead. * * @param {string} userId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async delete(userId: string): Promise<{}> { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - const apiPath = '/users/{userId}'.replace('{userId}', userId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } /** * Update email * @@ -671,102 +645,106 @@ export class Users extends Service { * @param {string} userId * @param {string} email * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise>} + */ async updateEmail(userId: string, email: string): Promise> { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof email === 'undefined') { throw new AppwriteException('Missing required parameter: "email"'); } - const apiPath = '/users/{userId}/email'.replace('{userId}', userId); const payload: Payload = {}; - if (typeof email !== 'undefined') { payload['email'] = email; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Create user JWT * - * Use this endpoint to create a JSON Web Token for user by its unique ID. You - * can use the resulting JWT to authenticate on behalf of the user. The JWT - * secret will become invalid if the session it uses gets deleted. + * Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted. * * @param {string} userId * @param {string} sessionId * @param {number} duration * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createJWT(userId: string, sessionId?: string, duration?: number): Promise { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - const apiPath = '/users/{userId}/jwts'.replace('{userId}', userId); const payload: Payload = {}; - if (typeof sessionId !== 'undefined') { payload['sessionId'] = sessionId; } - if (typeof duration !== 'undefined') { payload['duration'] = duration; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Update user labels * * Update the user labels by its unique ID. - * - * Labels can be used to grant access to resources. While teams are a way for - * user's to share access to a resource, labels can be defined by the - * developer to grant access without an invitation. See the [Permissions - * docs](https://appwrite.io/docs/permissions) for more info. + +Labels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https://appwrite.io/docs/permissions) for more info. * * @param {string} userId * @param {string[]} labels * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise>} + */ async updateLabels(userId: string, labels: string[]): Promise> { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof labels === 'undefined') { throw new AppwriteException('Missing required parameter: "labels"'); } - const apiPath = '/users/{userId}/labels'.replace('{userId}', userId); const payload: Payload = {}; - if (typeof labels !== 'undefined') { payload['labels'] = labels; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('put', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'put', + uri, + apiHeaders, + payload + ); + } /** * List user logs * @@ -775,26 +753,30 @@ export class Users extends Service { * @param {string} userId * @param {string[]} queries * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listLogs(userId: string, queries?: string[]): Promise { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - const apiPath = '/users/{userId}/logs'.replace('{userId}', userId); const payload: Payload = {}; - if (typeof queries !== 'undefined') { payload['queries'] = queries; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * List user memberships * @@ -802,22 +784,27 @@ export class Users extends Service { * * @param {string} userId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listMemberships(userId: string): Promise { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - const apiPath = '/users/{userId}/memberships'.replace('{userId}', userId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Update MFA * @@ -826,30 +813,33 @@ export class Users extends Service { * @param {string} userId * @param {boolean} mfa * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise>} + */ async updateMfa(userId: string, mfa: boolean): Promise> { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof mfa === 'undefined') { throw new AppwriteException('Missing required parameter: "mfa"'); } - const apiPath = '/users/{userId}/mfa'.replace('{userId}', userId); const payload: Payload = {}; - if (typeof mfa !== 'undefined') { payload['mfa'] = mfa; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Delete Authenticator * @@ -858,26 +848,30 @@ export class Users extends Service { * @param {string} userId * @param {AuthenticatorType} type * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise>} + */ async deleteMfaAuthenticator(userId: string, type: AuthenticatorType): Promise> { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof type === 'undefined') { throw new AppwriteException('Missing required parameter: "type"'); } - const apiPath = '/users/{userId}/mfa/authenticators/{type}'.replace('{userId}', userId).replace('{type}', type); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } /** * List Factors * @@ -885,100 +879,111 @@ export class Users extends Service { * * @param {string} userId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listMfaFactors(userId: string): Promise { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - const apiPath = '/users/{userId}/mfa/factors'.replace('{userId}', userId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Get MFA Recovery Codes * - * Get recovery codes that can be used as backup for MFA flow by User ID. - * Before getting codes, they must be generated using - * [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) - * method. + * Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. * * @param {string} userId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getMfaRecoveryCodes(userId: string): Promise { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Regenerate MFA Recovery Codes * - * Regenerate recovery codes that can be used as backup for MFA flow by User - * ID. Before regenerating codes, they must be first generated using - * [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) - * method. + * Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. * * @param {string} userId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateMfaRecoveryCodes(userId: string): Promise { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('put', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'put', + uri, + apiHeaders, + payload + ); + } /** * Create MFA Recovery Codes * - * Generate recovery codes used as backup for MFA flow for User ID. Recovery - * codes can be used as a MFA verification type in - * [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) - * method by client SDK. + * Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method by client SDK. * * @param {string} userId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createMfaRecoveryCodes(userId: string): Promise { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Update name * @@ -987,30 +992,33 @@ export class Users extends Service { * @param {string} userId * @param {string} name * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise>} + */ async updateName(userId: string, name: string): Promise> { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof name === 'undefined') { throw new AppwriteException('Missing required parameter: "name"'); } - const apiPath = '/users/{userId}/name'.replace('{userId}', userId); const payload: Payload = {}; - if (typeof name !== 'undefined') { payload['name'] = name; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Update password * @@ -1019,30 +1027,33 @@ export class Users extends Service { * @param {string} userId * @param {string} password * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise>} + */ async updatePassword(userId: string, password: string): Promise> { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof password === 'undefined') { throw new AppwriteException('Missing required parameter: "password"'); } - const apiPath = '/users/{userId}/password'.replace('{userId}', userId); const payload: Payload = {}; - if (typeof password !== 'undefined') { payload['password'] = password; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Update phone * @@ -1051,30 +1062,33 @@ export class Users extends Service { * @param {string} userId * @param {string} number * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise>} + */ async updatePhone(userId: string, number: string): Promise> { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof number === 'undefined') { throw new AppwriteException('Missing required parameter: "number"'); } - const apiPath = '/users/{userId}/phone'.replace('{userId}', userId); const payload: Payload = {}; - if (typeof number !== 'undefined') { payload['number'] = number; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Get user preferences * @@ -1082,56 +1096,62 @@ export class Users extends Service { * * @param {string} userId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getPrefs(userId: string): Promise { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - const apiPath = '/users/{userId}/prefs'.replace('{userId}', userId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Update user preferences * - * Update the user 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 error if exceeded. + * Update the user 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 error if exceeded. * * @param {string} userId * @param {object} prefs * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updatePrefs(userId: string, prefs: object): Promise { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof prefs === 'undefined') { throw new AppwriteException('Missing required parameter: "prefs"'); } - const apiPath = '/users/{userId}/prefs'.replace('{userId}', userId); const payload: Payload = {}; - if (typeof prefs !== 'undefined') { payload['prefs'] = prefs; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * List user sessions * @@ -1139,73 +1159,85 @@ export class Users extends Service { * * @param {string} userId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listSessions(userId: string): Promise { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - const apiPath = '/users/{userId}/sessions'.replace('{userId}', userId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Create session * * Creates a session for a user. Returns an immediately usable session object. - * - * If you want to generate a token for a custom authentication flow, use the - * [POST - * /users/{userId}/tokens](https://appwrite.io/docs/server/users#createToken) - * endpoint. + +If you want to generate a token for a custom authentication flow, use the [POST /users/{userId}/tokens](https://appwrite.io/docs/server/users#createToken) endpoint. * * @param {string} userId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createSession(userId: string): Promise { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - const apiPath = '/users/{userId}/sessions'.replace('{userId}', userId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Delete user sessions * - * Delete all user's sessions by using the user's unique ID. + * Delete all user's sessions by using the user's unique ID. * * @param {string} userId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async deleteSessions(userId: string): Promise<{}> { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - const apiPath = '/users/{userId}/sessions'.replace('{userId}', userId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } /** * Delete user session * @@ -1214,59 +1246,65 @@ export class Users extends Service { * @param {string} userId * @param {string} sessionId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async deleteSession(userId: string, sessionId: string): Promise<{}> { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof sessionId === 'undefined') { throw new AppwriteException('Missing required parameter: "sessionId"'); } - const apiPath = '/users/{userId}/sessions/{sessionId}'.replace('{userId}', userId).replace('{sessionId}', sessionId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } /** * Update user status * - * Update the user status by its unique ID. Use this endpoint as an - * alternative to deleting a user if you want to keep user's ID reserved. + * Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved. * * @param {string} userId * @param {boolean} status * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise>} + */ async updateStatus(userId: string, status: boolean): Promise> { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof status === 'undefined') { throw new AppwriteException('Missing required parameter: "status"'); } - const apiPath = '/users/{userId}/status'.replace('{userId}', userId); const payload: Payload = {}; - if (typeof status !== 'undefined') { payload['status'] = status; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * List User Targets * @@ -1275,26 +1313,30 @@ export class Users extends Service { * @param {string} userId * @param {string[]} queries * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listTargets(userId: string, queries?: string[]): Promise { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - const apiPath = '/users/{userId}/targets'.replace('{userId}', userId); const payload: Payload = {}; - if (typeof queries !== 'undefined') { payload['queries'] = queries; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Create User Target * @@ -1307,82 +1349,83 @@ export class Users extends Service { * @param {string} providerId * @param {string} name * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createTarget(userId: string, targetId: string, providerType: MessagingProviderType, identifier: string, providerId?: string, name?: string): Promise { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof targetId === 'undefined') { throw new AppwriteException('Missing required parameter: "targetId"'); } - if (typeof providerType === 'undefined') { throw new AppwriteException('Missing required parameter: "providerType"'); } - if (typeof identifier === 'undefined') { throw new AppwriteException('Missing required parameter: "identifier"'); } - const apiPath = '/users/{userId}/targets'.replace('{userId}', userId); const payload: Payload = {}; - if (typeof targetId !== 'undefined') { payload['targetId'] = targetId; } - if (typeof providerType !== 'undefined') { payload['providerType'] = providerType; } - if (typeof identifier !== 'undefined') { payload['identifier'] = identifier; } - if (typeof providerId !== 'undefined') { payload['providerId'] = providerId; } - if (typeof name !== 'undefined') { payload['name'] = name; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Get User Target * - * Get a user's push notification target by ID. + * Get a user's push notification target by ID. * * @param {string} userId * @param {string} targetId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getTarget(userId: string, targetId: string): Promise { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof targetId === 'undefined') { throw new AppwriteException('Missing required parameter: "targetId"'); } - const apiPath = '/users/{userId}/targets/{targetId}'.replace('{userId}', userId).replace('{targetId}', targetId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Update User target * @@ -1394,38 +1437,39 @@ export class Users extends Service { * @param {string} providerId * @param {string} name * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async updateTarget(userId: string, targetId: string, identifier?: string, providerId?: string, name?: string): Promise { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof targetId === 'undefined') { throw new AppwriteException('Missing required parameter: "targetId"'); } - const apiPath = '/users/{userId}/targets/{targetId}'.replace('{userId}', userId).replace('{targetId}', targetId); const payload: Payload = {}; - if (typeof identifier !== 'undefined') { payload['identifier'] = identifier; } - if (typeof providerId !== 'undefined') { payload['providerId'] = providerId; } - if (typeof name !== 'undefined') { payload['name'] = name; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Delete user target * @@ -1434,63 +1478,67 @@ export class Users extends Service { * @param {string} userId * @param {string} targetId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async deleteTarget(userId: string, targetId: string): Promise<{}> { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof targetId === 'undefined') { throw new AppwriteException('Missing required parameter: "targetId"'); } - const apiPath = '/users/{userId}/targets/{targetId}'.replace('{userId}', userId).replace('{targetId}', targetId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); + } /** * Create token * - * Returns a token with a secret key for creating a session. Use the user ID - * and secret and submit a request to the [PUT - * /account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) - * endpoint to complete the login process. - * + * Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT /account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. + * * @param {string} userId * @param {number} length * @param {number} expire * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createToken(userId: string, length?: number, expire?: number): Promise { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - const apiPath = '/users/{userId}/tokens'.replace('{userId}', userId); const payload: Payload = {}; - if (typeof length !== 'undefined') { payload['length'] = length; } - if (typeof expire !== 'undefined') { payload['expire'] = expire; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Update email verification * @@ -1499,30 +1547,33 @@ export class Users extends Service { * @param {string} userId * @param {boolean} emailVerification * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise>} + */ async updateEmailVerification(userId: string, emailVerification: boolean): Promise> { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof emailVerification === 'undefined') { throw new AppwriteException('Missing required parameter: "emailVerification"'); } - const apiPath = '/users/{userId}/verification'.replace('{userId}', userId); const payload: Payload = {}; - if (typeof emailVerification !== 'undefined') { payload['emailVerification'] = emailVerification; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * Update phone verification * @@ -1531,27 +1582,31 @@ export class Users extends Service { * @param {string} userId * @param {boolean} phoneVerification * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise>} + */ async updatePhoneVerification(userId: string, phoneVerification: boolean): Promise> { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } - if (typeof phoneVerification === 'undefined') { throw new AppwriteException('Missing required parameter: "phoneVerification"'); } - const apiPath = '/users/{userId}/verification/phone'.replace('{userId}', userId); const payload: Payload = {}; - if (typeof phoneVerification !== 'undefined') { payload['phoneVerification'] = phoneVerification; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); + } + + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); } -}; +} diff --git a/src/services/vcs.ts b/src/services/vcs.ts index d376916..e3fc179 100644 --- a/src/services/vcs.ts +++ b/src/services/vcs.ts @@ -1,14 +1,12 @@ -import { Service } from '../service'; -import { AppwriteException, Client } from '../client'; +import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; -import type { UploadProgress, Payload } from '../client'; -export class Vcs extends Service { +export class Vcs { + client: Client; - constructor(client: Client) - { - super(client); - } + constructor(client: Client) { + this.client = client; + } /** * List Repositories @@ -17,26 +15,30 @@ export class Vcs extends Service { * @param {string} installationId * @param {string} search * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listRepositories(installationId: string, search?: string): Promise { if (typeof installationId === 'undefined') { throw new AppwriteException('Missing required parameter: "installationId"'); } - const apiPath = '/vcs/github/installations/{installationId}/providerRepositories'.replace('{installationId}', installationId); const payload: Payload = {}; - if (typeof search !== 'undefined') { payload['search'] = search; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Create repository * @@ -45,38 +47,39 @@ export class Vcs extends Service { * @param {string} name * @param {boolean} xprivate * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createRepository(installationId: string, name: string, xprivate: boolean): Promise { if (typeof installationId === 'undefined') { throw new AppwriteException('Missing required parameter: "installationId"'); } - if (typeof name === 'undefined') { throw new AppwriteException('Missing required parameter: "name"'); } - if (typeof xprivate === 'undefined') { throw new AppwriteException('Missing required parameter: "xprivate"'); } - const apiPath = '/vcs/github/installations/{installationId}/providerRepositories'.replace('{installationId}', installationId); const payload: Payload = {}; - if (typeof name !== 'undefined') { payload['name'] = name; } - if (typeof xprivate !== 'undefined') { payload['private'] = xprivate; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Get repository * @@ -84,26 +87,30 @@ export class Vcs extends Service { * @param {string} installationId * @param {string} providerRepositoryId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getRepository(installationId: string, providerRepositoryId: string): Promise { if (typeof installationId === 'undefined') { throw new AppwriteException('Missing required parameter: "installationId"'); } - if (typeof providerRepositoryId === 'undefined') { throw new AppwriteException('Missing required parameter: "providerRepositoryId"'); } - const apiPath = '/vcs/github/installations/{installationId}/providerRepositories/{providerRepositoryId}'.replace('{installationId}', installationId).replace('{providerRepositoryId}', providerRepositoryId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * List Repository Branches * @@ -111,26 +118,30 @@ export class Vcs extends Service { * @param {string} installationId * @param {string} providerRepositoryId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listRepositoryBranches(installationId: string, providerRepositoryId: string): Promise { if (typeof installationId === 'undefined') { throw new AppwriteException('Missing required parameter: "installationId"'); } - if (typeof providerRepositoryId === 'undefined') { throw new AppwriteException('Missing required parameter: "providerRepositoryId"'); } - const apiPath = '/vcs/github/installations/{installationId}/providerRepositories/{providerRepositoryId}/branches'.replace('{installationId}', installationId).replace('{providerRepositoryId}', providerRepositoryId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Get files and directories of a VCS repository * @@ -139,30 +150,33 @@ export class Vcs extends Service { * @param {string} providerRepositoryId * @param {string} providerRootDirectory * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getRepositoryContents(installationId: string, providerRepositoryId: string, providerRootDirectory?: string): Promise { if (typeof installationId === 'undefined') { throw new AppwriteException('Missing required parameter: "installationId"'); } - if (typeof providerRepositoryId === 'undefined') { throw new AppwriteException('Missing required parameter: "providerRepositoryId"'); } - const apiPath = '/vcs/github/installations/{installationId}/providerRepositories/{providerRepositoryId}/contents'.replace('{installationId}', installationId).replace('{providerRepositoryId}', providerRepositoryId); const payload: Payload = {}; - if (typeof providerRootDirectory !== 'undefined') { payload['providerRootDirectory'] = providerRootDirectory; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Detect runtime settings from source code * @@ -171,30 +185,33 @@ export class Vcs extends Service { * @param {string} providerRepositoryId * @param {string} providerRootDirectory * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async createRepositoryDetection(installationId: string, providerRepositoryId: string, providerRootDirectory?: string): Promise { if (typeof installationId === 'undefined') { throw new AppwriteException('Missing required parameter: "installationId"'); } - if (typeof providerRepositoryId === 'undefined') { throw new AppwriteException('Missing required parameter: "providerRepositoryId"'); } - const apiPath = '/vcs/github/installations/{installationId}/providerRepositories/{providerRepositoryId}/detection'.replace('{installationId}', installationId).replace('{providerRepositoryId}', providerRepositoryId); const payload: Payload = {}; - if (typeof providerRootDirectory !== 'undefined') { payload['providerRootDirectory'] = providerRootDirectory; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('post', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'post', + uri, + apiHeaders, + payload + ); + } /** * Authorize external deployment * @@ -203,34 +220,36 @@ export class Vcs extends Service { * @param {string} repositoryId * @param {string} providerPullRequestId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async updateExternalDeployments(installationId: string, repositoryId: string, providerPullRequestId: string): Promise<{}> { if (typeof installationId === 'undefined') { throw new AppwriteException('Missing required parameter: "installationId"'); } - if (typeof repositoryId === 'undefined') { throw new AppwriteException('Missing required parameter: "repositoryId"'); } - if (typeof providerPullRequestId === 'undefined') { throw new AppwriteException('Missing required parameter: "providerPullRequestId"'); } - const apiPath = '/vcs/github/installations/{installationId}/repositories/{repositoryId}'.replace('{installationId}', installationId).replace('{repositoryId}', repositoryId); const payload: Payload = {}; - if (typeof providerPullRequestId !== 'undefined') { payload['providerPullRequestId'] = providerPullRequestId; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('patch', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'patch', + uri, + apiHeaders, + payload + ); + } /** * List installations * @@ -238,67 +257,82 @@ export class Vcs extends Service { * @param {string[]} queries * @param {string} search * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async listInstallations(queries?: string[], search?: string): Promise { const apiPath = '/vcs/installations'; const payload: Payload = {}; - if (typeof queries !== 'undefined') { payload['queries'] = queries; } - if (typeof search !== 'undefined') { payload['search'] = search; } - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Get installation * * * @param {string} installationId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise} + */ async getInstallation(installationId: string): Promise { if (typeof installationId === 'undefined') { throw new AppwriteException('Missing required parameter: "installationId"'); } - const apiPath = '/vcs/installations/{installationId}'.replace('{installationId}', installationId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('get', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); - } + } + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * Delete Installation * * * @param {string} installationId * @throws {AppwriteException} - * @returns {Promise} - */ + * @returns {Promise<{}>} + */ async deleteInstallation(installationId: string): Promise<{}> { if (typeof installationId === 'undefined') { throw new AppwriteException('Missing required parameter: "installationId"'); } - const apiPath = '/vcs/installations/{installationId}'.replace('{installationId}', installationId); const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - return await this.client.call('delete', uri, { + + const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', - }, payload); + } + + return await this.client.call( + 'delete', + uri, + apiHeaders, + payload + ); } -}; +} From 3d572056041ccc82f2357430c844b377557e463a Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 20 Aug 2024 13:27:27 +0200 Subject: [PATCH 3/9] chore: bump version --- README.md | 2 +- package.json | 2 +- src/client.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1949fc5..039d2ed 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ import { Client, Account } from "@appwrite.io/console"; To install with a CDN (content delivery network) add the following scripts to the bottom of your tag, but before you use any Appwrite services: ```html - + ``` diff --git a/package.json b/package.json index e8a8cd1..0565549 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@appwrite.io/console", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API", - "version": "0.6.3", + "version": "0.7.0-rc.1", "license": "BSD-3-Clause", "main": "dist/cjs/sdk.js", "exports": { diff --git a/src/client.ts b/src/client.ts index cd569c6..2bb2985 100644 --- a/src/client.ts +++ b/src/client.ts @@ -304,7 +304,7 @@ class Client { 'x-sdk-name': 'Console', 'x-sdk-platform': 'console', 'x-sdk-language': 'web', - 'x-sdk-version': '0.6.3', + 'x-sdk-version': '0.7.0-rc.1', 'X-Appwrite-Response-Format': '1.6.0', }; From 2dce7af4c27241952d0ce56612f4aad22e4ec761 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 20 Aug 2024 14:05:25 +0200 Subject: [PATCH 4/9] fix fallback cookie --- README.md | 2 +- package.json | 2 +- src/client.ts | 9 ++++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 039d2ed..76ebade 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ import { Client, Account } from "@appwrite.io/console"; To install with a CDN (content delivery network) add the following scripts to the bottom of your tag, but before you use any Appwrite services: ```html - + ``` diff --git a/package.json b/package.json index 0565549..1a54172 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@appwrite.io/console", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API", - "version": "0.7.0-rc.1", + "version": "0.7.0-rc.2", "license": "BSD-3-Clause", "main": "dist/cjs/sdk.js", "exports": { diff --git a/src/client.ts b/src/client.ts index 2bb2985..50af8a5 100644 --- a/src/client.ts +++ b/src/client.ts @@ -304,7 +304,7 @@ class Client { 'x-sdk-name': 'Console', 'x-sdk-platform': 'console', 'x-sdk-language': 'web', - 'x-sdk-version': '0.7.0-rc.1', + 'x-sdk-version': '0.7.0-rc.2', 'X-Appwrite-Response-Format': '1.6.0', }; @@ -592,6 +592,13 @@ class Client { headers = Object.assign({}, this.headers, headers); + if (typeof window !== 'undefined' && window.localStorage) { + const cookieFallback = window.localStorage.getItem('cookieFallback'); + if (cookieFallback) { + headers['X-Fallback-Cookies'] = cookieFallback; + } + } + let options: RequestInit = { method, headers, From 00be379ea08ec03aba86a1d5a79f4cc83d5dc959 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 23 Aug 2024 10:49:18 +0000 Subject: [PATCH 5/9] chore: updates for next rc release --- README.md | 2 +- .../account/create-anonymous-session.md | 2 +- .../account/create-email-password-session.md | 2 +- docs/examples/account/create-email-token.md | 2 +- docs/examples/account/create-j-w-t.md | 2 +- .../account/create-magic-u-r-l-token.md | 2 +- .../account/create-mfa-authenticator.md | 2 +- docs/examples/account/create-mfa-challenge.md | 2 +- .../account/create-mfa-recovery-codes.md | 2 +- .../examples/account/create-o-auth2session.md | 2 +- docs/examples/account/create-o-auth2token.md | 2 +- docs/examples/account/create-phone-token.md | 2 +- .../account/create-phone-verification.md | 2 +- docs/examples/account/create-push-target.md | 2 +- docs/examples/account/create-recovery.md | 2 +- docs/examples/account/create-session.md | 2 +- docs/examples/account/create-verification.md | 2 +- docs/examples/account/create.md | 2 +- docs/examples/account/delete-identity.md | 2 +- .../account/delete-mfa-authenticator.md | 2 +- docs/examples/account/delete-push-target.md | 2 +- docs/examples/account/delete-session.md | 2 +- docs/examples/account/delete-sessions.md | 2 +- docs/examples/account/delete.md | 2 +- .../account/get-mfa-recovery-codes.md | 2 +- docs/examples/account/get-prefs.md | 2 +- docs/examples/account/get-session.md | 2 +- docs/examples/account/get.md | 2 +- docs/examples/account/list-identities.md | 2 +- docs/examples/account/list-logs.md | 2 +- docs/examples/account/list-mfa-factors.md | 2 +- docs/examples/account/list-sessions.md | 2 +- docs/examples/account/update-email.md | 2 +- docs/examples/account/update-m-f-a.md | 2 +- .../account/update-magic-u-r-l-session.md | 2 +- .../account/update-mfa-authenticator.md | 2 +- docs/examples/account/update-mfa-challenge.md | 2 +- .../account/update-mfa-recovery-codes.md | 2 +- docs/examples/account/update-name.md | 2 +- docs/examples/account/update-password.md | 2 +- docs/examples/account/update-phone-session.md | 2 +- .../account/update-phone-verification.md | 2 +- docs/examples/account/update-phone.md | 2 +- docs/examples/account/update-prefs.md | 2 +- docs/examples/account/update-push-target.md | 2 +- docs/examples/account/update-recovery.md | 2 +- docs/examples/account/update-session.md | 2 +- docs/examples/account/update-status.md | 2 +- docs/examples/account/update-verification.md | 2 +- docs/examples/assistant/chat.md | 2 +- docs/examples/avatars/get-browser.md | 2 +- docs/examples/avatars/get-credit-card.md | 2 +- docs/examples/avatars/get-favicon.md | 2 +- docs/examples/avatars/get-flag.md | 2 +- docs/examples/avatars/get-image.md | 2 +- docs/examples/avatars/get-initials.md | 2 +- docs/examples/avatars/get-q-r.md | 2 +- docs/examples/console/variables.md | 2 +- .../databases/create-boolean-attribute.md | 2 +- docs/examples/databases/create-collection.md | 2 +- .../databases/create-datetime-attribute.md | 2 +- docs/examples/databases/create-document.md | 2 +- .../databases/create-email-attribute.md | 2 +- .../databases/create-enum-attribute.md | 2 +- .../databases/create-float-attribute.md | 2 +- docs/examples/databases/create-index.md | 2 +- .../databases/create-integer-attribute.md | 2 +- .../examples/databases/create-ip-attribute.md | 2 +- .../create-relationship-attribute.md | 2 +- .../databases/create-string-attribute.md | 2 +- .../databases/create-url-attribute.md | 2 +- docs/examples/databases/create.md | 2 +- docs/examples/databases/delete-attribute.md | 2 +- docs/examples/databases/delete-collection.md | 2 +- docs/examples/databases/delete-document.md | 2 +- docs/examples/databases/delete-index.md | 2 +- docs/examples/databases/delete.md | 2 +- docs/examples/databases/get-attribute.md | 2 +- .../databases/get-collection-usage.md | 2 +- docs/examples/databases/get-collection.md | 2 +- docs/examples/databases/get-database-usage.md | 2 +- docs/examples/databases/get-document.md | 2 +- docs/examples/databases/get-index.md | 2 +- docs/examples/databases/get-usage.md | 2 +- docs/examples/databases/get.md | 2 +- docs/examples/databases/list-attributes.md | 2 +- .../databases/list-collection-logs.md | 2 +- docs/examples/databases/list-collections.md | 2 +- docs/examples/databases/list-document-logs.md | 2 +- docs/examples/databases/list-documents.md | 2 +- docs/examples/databases/list-indexes.md | 2 +- docs/examples/databases/list-logs.md | 2 +- docs/examples/databases/list.md | 2 +- .../databases/update-boolean-attribute.md | 2 +- docs/examples/databases/update-collection.md | 2 +- .../databases/update-datetime-attribute.md | 2 +- docs/examples/databases/update-document.md | 2 +- .../databases/update-email-attribute.md | 2 +- .../databases/update-enum-attribute.md | 2 +- .../databases/update-float-attribute.md | 2 +- .../databases/update-integer-attribute.md | 2 +- .../examples/databases/update-ip-attribute.md | 2 +- .../update-relationship-attribute.md | 2 +- .../databases/update-string-attribute.md | 2 +- .../databases/update-url-attribute.md | 2 +- docs/examples/databases/update.md | 2 +- docs/examples/functions/create-build.md | 2 +- docs/examples/functions/create-deployment.md | 2 +- docs/examples/functions/create-execution.md | 2 +- docs/examples/functions/create-variable.md | 2 +- docs/examples/functions/create.md | 5 +- docs/examples/functions/delete-deployment.md | 2 +- docs/examples/functions/delete-execution.md | 2 +- docs/examples/functions/delete-variable.md | 2 +- docs/examples/functions/delete.md | 2 +- .../functions/get-deployment-download.md | 2 +- docs/examples/functions/get-deployment.md | 2 +- docs/examples/functions/get-execution.md | 2 +- docs/examples/functions/get-function-usage.md | 2 +- docs/examples/functions/get-template.md | 2 +- docs/examples/functions/get-usage.md | 2 +- docs/examples/functions/get-variable.md | 2 +- docs/examples/functions/get.md | 2 +- docs/examples/functions/list-deployments.md | 2 +- docs/examples/functions/list-executions.md | 2 +- docs/examples/functions/list-runtimes.md | 2 +- .../examples/functions/list-specifications.md | 11 +++++ docs/examples/functions/list-templates.md | 2 +- docs/examples/functions/list-variables.md | 2 +- docs/examples/functions/list.md | 2 +- .../functions/update-deployment-build.md | 2 +- docs/examples/functions/update-deployment.md | 2 +- docs/examples/functions/update-variable.md | 2 +- docs/examples/functions/update.md | 5 +- docs/examples/graphql/mutation.md | 2 +- docs/examples/graphql/query.md | 2 +- docs/examples/health/get-antivirus.md | 2 +- docs/examples/health/get-cache.md | 2 +- docs/examples/health/get-certificate.md | 2 +- docs/examples/health/get-d-b.md | 2 +- docs/examples/health/get-failed-jobs.md | 2 +- docs/examples/health/get-pub-sub.md | 2 +- docs/examples/health/get-queue-builds.md | 2 +- .../examples/health/get-queue-certificates.md | 2 +- docs/examples/health/get-queue-databases.md | 2 +- docs/examples/health/get-queue-deletes.md | 2 +- docs/examples/health/get-queue-functions.md | 2 +- docs/examples/health/get-queue-logs.md | 2 +- docs/examples/health/get-queue-mails.md | 2 +- docs/examples/health/get-queue-messaging.md | 2 +- docs/examples/health/get-queue-migrations.md | 2 +- docs/examples/health/get-queue-usage-dump.md | 2 +- docs/examples/health/get-queue-usage.md | 2 +- docs/examples/health/get-queue-webhooks.md | 2 +- docs/examples/health/get-queue.md | 2 +- docs/examples/health/get-storage-local.md | 2 +- docs/examples/health/get-storage.md | 2 +- docs/examples/health/get-time.md | 2 +- docs/examples/health/get.md | 2 +- docs/examples/locale/get.md | 2 +- docs/examples/locale/list-codes.md | 2 +- docs/examples/locale/list-continents.md | 2 +- docs/examples/locale/list-countries-e-u.md | 2 +- docs/examples/locale/list-countries-phones.md | 2 +- docs/examples/locale/list-countries.md | 2 +- docs/examples/locale/list-currencies.md | 2 +- docs/examples/locale/list-languages.md | 2 +- .../messaging/create-apns-provider.md | 2 +- docs/examples/messaging/create-email.md | 2 +- .../examples/messaging/create-fcm-provider.md | 2 +- .../messaging/create-mailgun-provider.md | 2 +- .../messaging/create-msg91provider.md | 2 +- docs/examples/messaging/create-push.md | 2 +- .../messaging/create-sendgrid-provider.md | 2 +- docs/examples/messaging/create-sms.md | 2 +- .../messaging/create-smtp-provider.md | 2 +- docs/examples/messaging/create-subscriber.md | 2 +- .../messaging/create-telesign-provider.md | 2 +- .../messaging/create-textmagic-provider.md | 2 +- docs/examples/messaging/create-topic.md | 2 +- .../messaging/create-twilio-provider.md | 2 +- .../messaging/create-vonage-provider.md | 2 +- docs/examples/messaging/delete-provider.md | 2 +- docs/examples/messaging/delete-subscriber.md | 2 +- docs/examples/messaging/delete-topic.md | 2 +- docs/examples/messaging/delete.md | 2 +- docs/examples/messaging/get-message.md | 2 +- docs/examples/messaging/get-provider.md | 2 +- docs/examples/messaging/get-subscriber.md | 2 +- docs/examples/messaging/get-topic.md | 2 +- docs/examples/messaging/list-message-logs.md | 2 +- docs/examples/messaging/list-messages.md | 2 +- docs/examples/messaging/list-provider-logs.md | 2 +- docs/examples/messaging/list-providers.md | 2 +- .../messaging/list-subscriber-logs.md | 2 +- docs/examples/messaging/list-subscribers.md | 2 +- docs/examples/messaging/list-targets.md | 2 +- docs/examples/messaging/list-topic-logs.md | 2 +- docs/examples/messaging/list-topics.md | 2 +- .../messaging/update-apns-provider.md | 2 +- docs/examples/messaging/update-email.md | 2 +- .../examples/messaging/update-fcm-provider.md | 2 +- .../messaging/update-mailgun-provider.md | 2 +- .../messaging/update-msg91provider.md | 2 +- docs/examples/messaging/update-push.md | 2 +- .../messaging/update-sendgrid-provider.md | 2 +- docs/examples/messaging/update-sms.md | 2 +- .../messaging/update-smtp-provider.md | 2 +- .../messaging/update-telesign-provider.md | 2 +- .../messaging/update-textmagic-provider.md | 2 +- docs/examples/messaging/update-topic.md | 2 +- .../messaging/update-twilio-provider.md | 2 +- .../messaging/update-vonage-provider.md | 2 +- .../migrations/create-appwrite-migration.md | 2 +- .../migrations/create-firebase-migration.md | 2 +- .../create-firebase-o-auth-migration.md | 2 +- .../migrations/create-n-host-migration.md | 2 +- .../migrations/create-supabase-migration.md | 2 +- .../migrations/delete-firebase-auth.md | 2 +- docs/examples/migrations/delete.md | 2 +- .../migrations/get-appwrite-report.md | 2 +- .../migrations/get-firebase-report-o-auth.md | 2 +- .../migrations/get-firebase-report.md | 2 +- docs/examples/migrations/get-n-host-report.md | 2 +- .../migrations/get-supabase-report.md | 2 +- docs/examples/migrations/get.md | 2 +- .../migrations/list-firebase-projects.md | 2 +- docs/examples/migrations/list.md | 2 +- docs/examples/migrations/retry.md | 2 +- docs/examples/project/create-variable.md | 2 +- docs/examples/project/delete-variable.md | 2 +- docs/examples/project/get-usage.md | 2 +- docs/examples/project/get-variable.md | 2 +- docs/examples/project/list-variables.md | 2 +- docs/examples/project/update-variable.md | 2 +- docs/examples/projects/create-j-w-t.md | 2 +- docs/examples/projects/create-key.md | 2 +- docs/examples/projects/create-platform.md | 2 +- docs/examples/projects/create-smtp-test.md | 2 +- docs/examples/projects/create-webhook.md | 2 +- docs/examples/projects/create.md | 2 +- .../projects/delete-email-template.md | 2 +- docs/examples/projects/delete-key.md | 2 +- docs/examples/projects/delete-platform.md | 2 +- docs/examples/projects/delete-sms-template.md | 2 +- docs/examples/projects/delete-webhook.md | 2 +- docs/examples/projects/delete.md | 2 +- docs/examples/projects/get-email-template.md | 2 +- docs/examples/projects/get-key.md | 2 +- docs/examples/projects/get-platform.md | 2 +- docs/examples/projects/get-sms-template.md | 2 +- docs/examples/projects/get-webhook.md | 2 +- docs/examples/projects/get.md | 2 +- docs/examples/projects/list-keys.md | 2 +- docs/examples/projects/list-platforms.md | 2 +- docs/examples/projects/list-webhooks.md | 2 +- docs/examples/projects/list.md | 2 +- .../projects/update-api-status-all.md | 2 +- docs/examples/projects/update-api-status.md | 2 +- .../examples/projects/update-auth-duration.md | 2 +- docs/examples/projects/update-auth-limit.md | 2 +- .../update-auth-password-dictionary.md | 2 +- .../projects/update-auth-password-history.md | 2 +- .../projects/update-auth-sessions-limit.md | 2 +- docs/examples/projects/update-auth-status.md | 2 +- .../projects/update-email-template.md | 2 +- docs/examples/projects/update-key.md | 2 +- docs/examples/projects/update-mock-numbers.md | 2 +- docs/examples/projects/update-o-auth2.md | 2 +- .../projects/update-personal-data-check.md | 2 +- docs/examples/projects/update-platform.md | 2 +- .../projects/update-service-status-all.md | 2 +- .../projects/update-service-status.md | 2 +- .../projects/update-session-alerts.md | 2 +- docs/examples/projects/update-sms-template.md | 2 +- docs/examples/projects/update-smtp.md | 2 +- docs/examples/projects/update-team.md | 2 +- .../projects/update-webhook-signature.md | 2 +- docs/examples/projects/update-webhook.md | 2 +- docs/examples/projects/update.md | 2 +- docs/examples/proxy/create-rule.md | 2 +- docs/examples/proxy/delete-rule.md | 2 +- docs/examples/proxy/get-rule.md | 2 +- docs/examples/proxy/list-rules.md | 2 +- .../proxy/update-rule-verification.md | 2 +- docs/examples/storage/create-bucket.md | 2 +- docs/examples/storage/create-file.md | 2 +- docs/examples/storage/delete-bucket.md | 2 +- docs/examples/storage/delete-file.md | 2 +- docs/examples/storage/get-bucket-usage.md | 2 +- docs/examples/storage/get-bucket.md | 2 +- docs/examples/storage/get-file-download.md | 2 +- docs/examples/storage/get-file-preview.md | 2 +- docs/examples/storage/get-file-view.md | 2 +- docs/examples/storage/get-file.md | 2 +- docs/examples/storage/get-usage.md | 2 +- docs/examples/storage/list-buckets.md | 2 +- docs/examples/storage/list-files.md | 2 +- docs/examples/storage/update-bucket.md | 2 +- docs/examples/storage/update-file.md | 2 +- docs/examples/teams/create-membership.md | 2 +- docs/examples/teams/create.md | 2 +- docs/examples/teams/delete-membership.md | 2 +- docs/examples/teams/delete.md | 2 +- docs/examples/teams/get-membership.md | 2 +- docs/examples/teams/get-prefs.md | 2 +- docs/examples/teams/get.md | 2 +- docs/examples/teams/list-logs.md | 2 +- docs/examples/teams/list-memberships.md | 2 +- docs/examples/teams/list.md | 2 +- .../teams/update-membership-status.md | 2 +- docs/examples/teams/update-membership.md | 2 +- docs/examples/teams/update-name.md | 2 +- docs/examples/teams/update-prefs.md | 2 +- docs/examples/users/create-argon2user.md | 2 +- docs/examples/users/create-bcrypt-user.md | 2 +- docs/examples/users/create-j-w-t.md | 2 +- docs/examples/users/create-m-d5user.md | 2 +- .../users/create-mfa-recovery-codes.md | 2 +- docs/examples/users/create-p-h-pass-user.md | 2 +- docs/examples/users/create-s-h-a-user.md | 2 +- .../users/create-scrypt-modified-user.md | 2 +- docs/examples/users/create-scrypt-user.md | 2 +- docs/examples/users/create-session.md | 2 +- docs/examples/users/create-target.md | 2 +- docs/examples/users/create-token.md | 2 +- docs/examples/users/create.md | 2 +- docs/examples/users/delete-identity.md | 2 +- .../users/delete-mfa-authenticator.md | 2 +- docs/examples/users/delete-session.md | 2 +- docs/examples/users/delete-sessions.md | 2 +- docs/examples/users/delete-target.md | 2 +- docs/examples/users/delete.md | 2 +- docs/examples/users/get-mfa-recovery-codes.md | 2 +- docs/examples/users/get-prefs.md | 2 +- docs/examples/users/get-target.md | 2 +- docs/examples/users/get-usage.md | 2 +- docs/examples/users/get.md | 2 +- docs/examples/users/list-identities.md | 2 +- docs/examples/users/list-logs.md | 2 +- docs/examples/users/list-memberships.md | 2 +- docs/examples/users/list-mfa-factors.md | 2 +- docs/examples/users/list-sessions.md | 2 +- docs/examples/users/list-targets.md | 2 +- docs/examples/users/list.md | 2 +- .../users/update-email-verification.md | 2 +- docs/examples/users/update-email.md | 2 +- docs/examples/users/update-labels.md | 2 +- .../users/update-mfa-recovery-codes.md | 2 +- docs/examples/users/update-mfa.md | 2 +- docs/examples/users/update-name.md | 2 +- docs/examples/users/update-password.md | 2 +- .../users/update-phone-verification.md | 2 +- docs/examples/users/update-phone.md | 2 +- docs/examples/users/update-prefs.md | 2 +- docs/examples/users/update-status.md | 2 +- docs/examples/users/update-target.md | 2 +- .../vcs/create-repository-detection.md | 2 +- docs/examples/vcs/create-repository.md | 2 +- docs/examples/vcs/delete-installation.md | 2 +- docs/examples/vcs/get-installation.md | 2 +- docs/examples/vcs/get-repository-contents.md | 2 +- docs/examples/vcs/get-repository.md | 2 +- docs/examples/vcs/list-installations.md | 2 +- docs/examples/vcs/list-repositories.md | 2 +- docs/examples/vcs/list-repository-branches.md | 2 +- .../vcs/update-external-deployments.md | 2 +- package.json | 2 +- src/client.ts | 2 +- src/enums/platform-type.ts | 2 - src/enums/runtime.ts | 2 +- src/models.ts | 42 +++++++++++++++++ src/services/functions.ts | 46 ++++++++++++++++--- 373 files changed, 465 insertions(+), 380 deletions(-) create mode 100644 docs/examples/functions/list-specifications.md diff --git a/README.md b/README.md index 76ebade..e391143 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ import { Client, Account } from "@appwrite.io/console"; To install with a CDN (content delivery network) add the following scripts to the bottom of your tag, but before you use any Appwrite services: ```html - + ``` diff --git a/docs/examples/account/create-anonymous-session.md b/docs/examples/account/create-anonymous-session.md index ff7140d..ef433a8 100644 --- a/docs/examples/account/create-anonymous-session.md +++ b/docs/examples/account/create-anonymous-session.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/create-email-password-session.md b/docs/examples/account/create-email-password-session.md index 2019181..0f51387 100644 --- a/docs/examples/account/create-email-password-session.md +++ b/docs/examples/account/create-email-password-session.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/create-email-token.md b/docs/examples/account/create-email-token.md index 1ebc5b9..b55f7c4 100644 --- a/docs/examples/account/create-email-token.md +++ b/docs/examples/account/create-email-token.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/create-j-w-t.md b/docs/examples/account/create-j-w-t.md index 1bb8b1a..4f47136 100644 --- a/docs/examples/account/create-j-w-t.md +++ b/docs/examples/account/create-j-w-t.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/create-magic-u-r-l-token.md b/docs/examples/account/create-magic-u-r-l-token.md index 2b36a7f..68662b8 100644 --- a/docs/examples/account/create-magic-u-r-l-token.md +++ b/docs/examples/account/create-magic-u-r-l-token.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/create-mfa-authenticator.md b/docs/examples/account/create-mfa-authenticator.md index 840eb77..97bd528 100644 --- a/docs/examples/account/create-mfa-authenticator.md +++ b/docs/examples/account/create-mfa-authenticator.md @@ -2,7 +2,7 @@ import { Client, Account, AuthenticatorType } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/create-mfa-challenge.md b/docs/examples/account/create-mfa-challenge.md index 8057cf3..ed2cd38 100644 --- a/docs/examples/account/create-mfa-challenge.md +++ b/docs/examples/account/create-mfa-challenge.md @@ -2,7 +2,7 @@ import { Client, Account, AuthenticationFactor } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/create-mfa-recovery-codes.md b/docs/examples/account/create-mfa-recovery-codes.md index 3415457..06f25dd 100644 --- a/docs/examples/account/create-mfa-recovery-codes.md +++ b/docs/examples/account/create-mfa-recovery-codes.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/create-o-auth2session.md b/docs/examples/account/create-o-auth2session.md index 593bb5c..e565dd5 100644 --- a/docs/examples/account/create-o-auth2session.md +++ b/docs/examples/account/create-o-auth2session.md @@ -2,7 +2,7 @@ import { Client, Account, OAuthProvider } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/create-o-auth2token.md b/docs/examples/account/create-o-auth2token.md index 033c53e..14c0d00 100644 --- a/docs/examples/account/create-o-auth2token.md +++ b/docs/examples/account/create-o-auth2token.md @@ -2,7 +2,7 @@ import { Client, Account, OAuthProvider } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/create-phone-token.md b/docs/examples/account/create-phone-token.md index 349dd72..21fdb81 100644 --- a/docs/examples/account/create-phone-token.md +++ b/docs/examples/account/create-phone-token.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/create-phone-verification.md b/docs/examples/account/create-phone-verification.md index bdd569d..4d193cb 100644 --- a/docs/examples/account/create-phone-verification.md +++ b/docs/examples/account/create-phone-verification.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/create-push-target.md b/docs/examples/account/create-push-target.md index e5f2445..339b997 100644 --- a/docs/examples/account/create-push-target.md +++ b/docs/examples/account/create-push-target.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/create-recovery.md b/docs/examples/account/create-recovery.md index 69233b2..b28d4f8 100644 --- a/docs/examples/account/create-recovery.md +++ b/docs/examples/account/create-recovery.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/create-session.md b/docs/examples/account/create-session.md index f155142..06e1260 100644 --- a/docs/examples/account/create-session.md +++ b/docs/examples/account/create-session.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/create-verification.md b/docs/examples/account/create-verification.md index 57a5a05..555030a 100644 --- a/docs/examples/account/create-verification.md +++ b/docs/examples/account/create-verification.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md index 6f85726..120aceb 100644 --- a/docs/examples/account/create.md +++ b/docs/examples/account/create.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/delete-identity.md b/docs/examples/account/delete-identity.md index cbf2b69..a541e9b 100644 --- a/docs/examples/account/delete-identity.md +++ b/docs/examples/account/delete-identity.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/delete-mfa-authenticator.md b/docs/examples/account/delete-mfa-authenticator.md index 6e49272..64f27fd 100644 --- a/docs/examples/account/delete-mfa-authenticator.md +++ b/docs/examples/account/delete-mfa-authenticator.md @@ -2,7 +2,7 @@ import { Client, Account, AuthenticatorType } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/delete-push-target.md b/docs/examples/account/delete-push-target.md index 07daa33..017ebd4 100644 --- a/docs/examples/account/delete-push-target.md +++ b/docs/examples/account/delete-push-target.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/delete-session.md b/docs/examples/account/delete-session.md index 8d0fcbc..1045e98 100644 --- a/docs/examples/account/delete-session.md +++ b/docs/examples/account/delete-session.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/delete-sessions.md b/docs/examples/account/delete-sessions.md index d075a34..ff8c069 100644 --- a/docs/examples/account/delete-sessions.md +++ b/docs/examples/account/delete-sessions.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/delete.md b/docs/examples/account/delete.md index ce36229..7fa1ef1 100644 --- a/docs/examples/account/delete.md +++ b/docs/examples/account/delete.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/get-mfa-recovery-codes.md b/docs/examples/account/get-mfa-recovery-codes.md index 0199465..6d47bc3 100644 --- a/docs/examples/account/get-mfa-recovery-codes.md +++ b/docs/examples/account/get-mfa-recovery-codes.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/get-prefs.md b/docs/examples/account/get-prefs.md index f6f2308..1470b68 100644 --- a/docs/examples/account/get-prefs.md +++ b/docs/examples/account/get-prefs.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/get-session.md b/docs/examples/account/get-session.md index ffff775..b7de886 100644 --- a/docs/examples/account/get-session.md +++ b/docs/examples/account/get-session.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/get.md b/docs/examples/account/get.md index 76b90c1..68dbf30 100644 --- a/docs/examples/account/get.md +++ b/docs/examples/account/get.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/list-identities.md b/docs/examples/account/list-identities.md index 0713a8c..f67e581 100644 --- a/docs/examples/account/list-identities.md +++ b/docs/examples/account/list-identities.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/list-logs.md b/docs/examples/account/list-logs.md index 98dc19b..0532a94 100644 --- a/docs/examples/account/list-logs.md +++ b/docs/examples/account/list-logs.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/list-mfa-factors.md b/docs/examples/account/list-mfa-factors.md index 338bd35..3fa9652 100644 --- a/docs/examples/account/list-mfa-factors.md +++ b/docs/examples/account/list-mfa-factors.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/list-sessions.md b/docs/examples/account/list-sessions.md index 587adbd..2cc2663 100644 --- a/docs/examples/account/list-sessions.md +++ b/docs/examples/account/list-sessions.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/update-email.md b/docs/examples/account/update-email.md index 5c8450c..d7b6fb7 100644 --- a/docs/examples/account/update-email.md +++ b/docs/examples/account/update-email.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/update-m-f-a.md b/docs/examples/account/update-m-f-a.md index 7f89c00..3c9dac0 100644 --- a/docs/examples/account/update-m-f-a.md +++ b/docs/examples/account/update-m-f-a.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/update-magic-u-r-l-session.md b/docs/examples/account/update-magic-u-r-l-session.md index f850bb3..6bafae7 100644 --- a/docs/examples/account/update-magic-u-r-l-session.md +++ b/docs/examples/account/update-magic-u-r-l-session.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/update-mfa-authenticator.md b/docs/examples/account/update-mfa-authenticator.md index 1e260be..430bf63 100644 --- a/docs/examples/account/update-mfa-authenticator.md +++ b/docs/examples/account/update-mfa-authenticator.md @@ -2,7 +2,7 @@ import { Client, Account, AuthenticatorType } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/update-mfa-challenge.md b/docs/examples/account/update-mfa-challenge.md index b3e444f..c170cc2 100644 --- a/docs/examples/account/update-mfa-challenge.md +++ b/docs/examples/account/update-mfa-challenge.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/update-mfa-recovery-codes.md b/docs/examples/account/update-mfa-recovery-codes.md index 9910e4c..f61a5a1 100644 --- a/docs/examples/account/update-mfa-recovery-codes.md +++ b/docs/examples/account/update-mfa-recovery-codes.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/update-name.md b/docs/examples/account/update-name.md index ccd224b..b299130 100644 --- a/docs/examples/account/update-name.md +++ b/docs/examples/account/update-name.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/update-password.md b/docs/examples/account/update-password.md index 7e02472..1c6c4ce 100644 --- a/docs/examples/account/update-password.md +++ b/docs/examples/account/update-password.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/update-phone-session.md b/docs/examples/account/update-phone-session.md index 12822cc..a9c7546 100644 --- a/docs/examples/account/update-phone-session.md +++ b/docs/examples/account/update-phone-session.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/update-phone-verification.md b/docs/examples/account/update-phone-verification.md index a5094c0..de1f471 100644 --- a/docs/examples/account/update-phone-verification.md +++ b/docs/examples/account/update-phone-verification.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/update-phone.md b/docs/examples/account/update-phone.md index 82acb97..8c1880b 100644 --- a/docs/examples/account/update-phone.md +++ b/docs/examples/account/update-phone.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/update-prefs.md b/docs/examples/account/update-prefs.md index 5793528..e3581de 100644 --- a/docs/examples/account/update-prefs.md +++ b/docs/examples/account/update-prefs.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/update-push-target.md b/docs/examples/account/update-push-target.md index 53d02ea..1cbf9e9 100644 --- a/docs/examples/account/update-push-target.md +++ b/docs/examples/account/update-push-target.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/update-recovery.md b/docs/examples/account/update-recovery.md index fd8de0f..3acc705 100644 --- a/docs/examples/account/update-recovery.md +++ b/docs/examples/account/update-recovery.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/update-session.md b/docs/examples/account/update-session.md index c66b40d..88f51f1 100644 --- a/docs/examples/account/update-session.md +++ b/docs/examples/account/update-session.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/update-status.md b/docs/examples/account/update-status.md index 87f315a..3ed146c 100644 --- a/docs/examples/account/update-status.md +++ b/docs/examples/account/update-status.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/account/update-verification.md b/docs/examples/account/update-verification.md index 32e6301..42d05ff 100644 --- a/docs/examples/account/update-verification.md +++ b/docs/examples/account/update-verification.md @@ -2,7 +2,7 @@ import { Client, Account } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const account = new Account(client); diff --git a/docs/examples/assistant/chat.md b/docs/examples/assistant/chat.md index 884adbb..9c44d57 100644 --- a/docs/examples/assistant/chat.md +++ b/docs/examples/assistant/chat.md @@ -2,7 +2,7 @@ import { Client, Assistant } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const assistant = new Assistant(client); diff --git a/docs/examples/avatars/get-browser.md b/docs/examples/avatars/get-browser.md index 89bc3ae..3604984 100644 --- a/docs/examples/avatars/get-browser.md +++ b/docs/examples/avatars/get-browser.md @@ -2,7 +2,7 @@ import { Client, Avatars, Browser } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const avatars = new Avatars(client); diff --git a/docs/examples/avatars/get-credit-card.md b/docs/examples/avatars/get-credit-card.md index 874bac8..ec38da8 100644 --- a/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/avatars/get-credit-card.md @@ -2,7 +2,7 @@ import { Client, Avatars, CreditCard } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const avatars = new Avatars(client); diff --git a/docs/examples/avatars/get-favicon.md b/docs/examples/avatars/get-favicon.md index 0cb328d..87a310a 100644 --- a/docs/examples/avatars/get-favicon.md +++ b/docs/examples/avatars/get-favicon.md @@ -2,7 +2,7 @@ import { Client, Avatars } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const avatars = new Avatars(client); diff --git a/docs/examples/avatars/get-flag.md b/docs/examples/avatars/get-flag.md index e17885e..dd9e2f6 100644 --- a/docs/examples/avatars/get-flag.md +++ b/docs/examples/avatars/get-flag.md @@ -2,7 +2,7 @@ import { Client, Avatars, Flag } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const avatars = new Avatars(client); diff --git a/docs/examples/avatars/get-image.md b/docs/examples/avatars/get-image.md index d61b93e..8cb6546 100644 --- a/docs/examples/avatars/get-image.md +++ b/docs/examples/avatars/get-image.md @@ -2,7 +2,7 @@ import { Client, Avatars } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const avatars = new Avatars(client); diff --git a/docs/examples/avatars/get-initials.md b/docs/examples/avatars/get-initials.md index eda96c4..81cfc5c 100644 --- a/docs/examples/avatars/get-initials.md +++ b/docs/examples/avatars/get-initials.md @@ -2,7 +2,7 @@ import { Client, Avatars } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const avatars = new Avatars(client); diff --git a/docs/examples/avatars/get-q-r.md b/docs/examples/avatars/get-q-r.md index 200d852..d685011 100644 --- a/docs/examples/avatars/get-q-r.md +++ b/docs/examples/avatars/get-q-r.md @@ -2,7 +2,7 @@ import { Client, Avatars } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const avatars = new Avatars(client); diff --git a/docs/examples/console/variables.md b/docs/examples/console/variables.md index 2245d4a..0ee1f57 100644 --- a/docs/examples/console/variables.md +++ b/docs/examples/console/variables.md @@ -2,7 +2,7 @@ import { Client, Console } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const console = new Console(client); diff --git a/docs/examples/databases/create-boolean-attribute.md b/docs/examples/databases/create-boolean-attribute.md index 444f58a..ae76596 100644 --- a/docs/examples/databases/create-boolean-attribute.md +++ b/docs/examples/databases/create-boolean-attribute.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/create-collection.md b/docs/examples/databases/create-collection.md index 2941ccf..29e9eee 100644 --- a/docs/examples/databases/create-collection.md +++ b/docs/examples/databases/create-collection.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/create-datetime-attribute.md b/docs/examples/databases/create-datetime-attribute.md index 0168865..7344660 100644 --- a/docs/examples/databases/create-datetime-attribute.md +++ b/docs/examples/databases/create-datetime-attribute.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index 380f337..8f1a69a 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/create-email-attribute.md b/docs/examples/databases/create-email-attribute.md index fd7aff8..32a51c5 100644 --- a/docs/examples/databases/create-email-attribute.md +++ b/docs/examples/databases/create-email-attribute.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/create-enum-attribute.md b/docs/examples/databases/create-enum-attribute.md index 4052f34..ab460cd 100644 --- a/docs/examples/databases/create-enum-attribute.md +++ b/docs/examples/databases/create-enum-attribute.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/create-float-attribute.md b/docs/examples/databases/create-float-attribute.md index aaedd21..7019deb 100644 --- a/docs/examples/databases/create-float-attribute.md +++ b/docs/examples/databases/create-float-attribute.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/create-index.md b/docs/examples/databases/create-index.md index 4203e41..e8a3470 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -2,7 +2,7 @@ import { Client, Databases, IndexType } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/create-integer-attribute.md b/docs/examples/databases/create-integer-attribute.md index 6546c5d..a2cdda2 100644 --- a/docs/examples/databases/create-integer-attribute.md +++ b/docs/examples/databases/create-integer-attribute.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/create-ip-attribute.md b/docs/examples/databases/create-ip-attribute.md index c4995df..daf7e4f 100644 --- a/docs/examples/databases/create-ip-attribute.md +++ b/docs/examples/databases/create-ip-attribute.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/create-relationship-attribute.md b/docs/examples/databases/create-relationship-attribute.md index 17efcd0..a64548c 100644 --- a/docs/examples/databases/create-relationship-attribute.md +++ b/docs/examples/databases/create-relationship-attribute.md @@ -2,7 +2,7 @@ import { Client, Databases, RelationshipType, RelationMutate } from "@appwrite.i const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/create-string-attribute.md b/docs/examples/databases/create-string-attribute.md index 81953eb..6e9541e 100644 --- a/docs/examples/databases/create-string-attribute.md +++ b/docs/examples/databases/create-string-attribute.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/create-url-attribute.md b/docs/examples/databases/create-url-attribute.md index 1a26d92..dc2dfc3 100644 --- a/docs/examples/databases/create-url-attribute.md +++ b/docs/examples/databases/create-url-attribute.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/create.md b/docs/examples/databases/create.md index c37cb14..a7f560e 100644 --- a/docs/examples/databases/create.md +++ b/docs/examples/databases/create.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/delete-attribute.md b/docs/examples/databases/delete-attribute.md index 06861f9..cec93be 100644 --- a/docs/examples/databases/delete-attribute.md +++ b/docs/examples/databases/delete-attribute.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/delete-collection.md b/docs/examples/databases/delete-collection.md index 03253c5..ef2aa90 100644 --- a/docs/examples/databases/delete-collection.md +++ b/docs/examples/databases/delete-collection.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/delete-document.md b/docs/examples/databases/delete-document.md index cf334da..961bc63 100644 --- a/docs/examples/databases/delete-document.md +++ b/docs/examples/databases/delete-document.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/delete-index.md b/docs/examples/databases/delete-index.md index e9bd792..152a93e 100644 --- a/docs/examples/databases/delete-index.md +++ b/docs/examples/databases/delete-index.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/delete.md b/docs/examples/databases/delete.md index 8c2e45e..b6485ad 100644 --- a/docs/examples/databases/delete.md +++ b/docs/examples/databases/delete.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/get-attribute.md b/docs/examples/databases/get-attribute.md index ca8286c..20c555c 100644 --- a/docs/examples/databases/get-attribute.md +++ b/docs/examples/databases/get-attribute.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/get-collection-usage.md b/docs/examples/databases/get-collection-usage.md index c65a2f5..4b14f1f 100644 --- a/docs/examples/databases/get-collection-usage.md +++ b/docs/examples/databases/get-collection-usage.md @@ -2,7 +2,7 @@ import { Client, Databases, DatabaseUsageRange } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/get-collection.md b/docs/examples/databases/get-collection.md index 53d6e19..59ab03b 100644 --- a/docs/examples/databases/get-collection.md +++ b/docs/examples/databases/get-collection.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/get-database-usage.md b/docs/examples/databases/get-database-usage.md index 71dc197..c0f15e4 100644 --- a/docs/examples/databases/get-database-usage.md +++ b/docs/examples/databases/get-database-usage.md @@ -2,7 +2,7 @@ import { Client, Databases, DatabaseUsageRange } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/get-document.md b/docs/examples/databases/get-document.md index a19ffb9..cf16708 100644 --- a/docs/examples/databases/get-document.md +++ b/docs/examples/databases/get-document.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/get-index.md b/docs/examples/databases/get-index.md index 733d226..85a1c03 100644 --- a/docs/examples/databases/get-index.md +++ b/docs/examples/databases/get-index.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/get-usage.md b/docs/examples/databases/get-usage.md index d8262c5..9d926e5 100644 --- a/docs/examples/databases/get-usage.md +++ b/docs/examples/databases/get-usage.md @@ -2,7 +2,7 @@ import { Client, Databases, DatabaseUsageRange } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/get.md b/docs/examples/databases/get.md index 2d71055..8b9e02e 100644 --- a/docs/examples/databases/get.md +++ b/docs/examples/databases/get.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/list-attributes.md b/docs/examples/databases/list-attributes.md index e39b486..987e174 100644 --- a/docs/examples/databases/list-attributes.md +++ b/docs/examples/databases/list-attributes.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/list-collection-logs.md b/docs/examples/databases/list-collection-logs.md index e928ce5..d01a57e 100644 --- a/docs/examples/databases/list-collection-logs.md +++ b/docs/examples/databases/list-collection-logs.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/list-collections.md b/docs/examples/databases/list-collections.md index 1eb7c38..28450a7 100644 --- a/docs/examples/databases/list-collections.md +++ b/docs/examples/databases/list-collections.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/list-document-logs.md b/docs/examples/databases/list-document-logs.md index 89d20b0..c1c2b06 100644 --- a/docs/examples/databases/list-document-logs.md +++ b/docs/examples/databases/list-document-logs.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/list-documents.md b/docs/examples/databases/list-documents.md index 7dda31e..27d4d77 100644 --- a/docs/examples/databases/list-documents.md +++ b/docs/examples/databases/list-documents.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/list-indexes.md b/docs/examples/databases/list-indexes.md index 2b231a7..829f6d7 100644 --- a/docs/examples/databases/list-indexes.md +++ b/docs/examples/databases/list-indexes.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/list-logs.md b/docs/examples/databases/list-logs.md index 27e8eee..ec42922 100644 --- a/docs/examples/databases/list-logs.md +++ b/docs/examples/databases/list-logs.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/list.md b/docs/examples/databases/list.md index fcf0c8c..d41bdab 100644 --- a/docs/examples/databases/list.md +++ b/docs/examples/databases/list.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/update-boolean-attribute.md b/docs/examples/databases/update-boolean-attribute.md index 80dbd50..d6668bf 100644 --- a/docs/examples/databases/update-boolean-attribute.md +++ b/docs/examples/databases/update-boolean-attribute.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/update-collection.md b/docs/examples/databases/update-collection.md index d2537ed..f5e6176 100644 --- a/docs/examples/databases/update-collection.md +++ b/docs/examples/databases/update-collection.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/update-datetime-attribute.md b/docs/examples/databases/update-datetime-attribute.md index e429303..4dc65e7 100644 --- a/docs/examples/databases/update-datetime-attribute.md +++ b/docs/examples/databases/update-datetime-attribute.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/update-document.md b/docs/examples/databases/update-document.md index 440f29f..635c507 100644 --- a/docs/examples/databases/update-document.md +++ b/docs/examples/databases/update-document.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/update-email-attribute.md b/docs/examples/databases/update-email-attribute.md index a9fd86e..39aa718 100644 --- a/docs/examples/databases/update-email-attribute.md +++ b/docs/examples/databases/update-email-attribute.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/update-enum-attribute.md b/docs/examples/databases/update-enum-attribute.md index 04dc791..81a9fa5 100644 --- a/docs/examples/databases/update-enum-attribute.md +++ b/docs/examples/databases/update-enum-attribute.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/update-float-attribute.md b/docs/examples/databases/update-float-attribute.md index 88506bc..6c820f4 100644 --- a/docs/examples/databases/update-float-attribute.md +++ b/docs/examples/databases/update-float-attribute.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/update-integer-attribute.md b/docs/examples/databases/update-integer-attribute.md index cdafd12..5fdfede 100644 --- a/docs/examples/databases/update-integer-attribute.md +++ b/docs/examples/databases/update-integer-attribute.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/update-ip-attribute.md b/docs/examples/databases/update-ip-attribute.md index f1cf749..2a6267d 100644 --- a/docs/examples/databases/update-ip-attribute.md +++ b/docs/examples/databases/update-ip-attribute.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/update-relationship-attribute.md b/docs/examples/databases/update-relationship-attribute.md index ceb5ebf..934590d 100644 --- a/docs/examples/databases/update-relationship-attribute.md +++ b/docs/examples/databases/update-relationship-attribute.md @@ -2,7 +2,7 @@ import { Client, Databases, RelationMutate } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/update-string-attribute.md b/docs/examples/databases/update-string-attribute.md index 765f2f3..0d9bc97 100644 --- a/docs/examples/databases/update-string-attribute.md +++ b/docs/examples/databases/update-string-attribute.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/update-url-attribute.md b/docs/examples/databases/update-url-attribute.md index a4ab424..c1836ed 100644 --- a/docs/examples/databases/update-url-attribute.md +++ b/docs/examples/databases/update-url-attribute.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/databases/update.md b/docs/examples/databases/update.md index 7fc7147..a8c2b33 100644 --- a/docs/examples/databases/update.md +++ b/docs/examples/databases/update.md @@ -2,7 +2,7 @@ import { Client, Databases } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const databases = new Databases(client); diff --git a/docs/examples/functions/create-build.md b/docs/examples/functions/create-build.md index a46bc37..89c7d08 100644 --- a/docs/examples/functions/create-build.md +++ b/docs/examples/functions/create-build.md @@ -2,7 +2,7 @@ import { Client, Functions } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const functions = new Functions(client); diff --git a/docs/examples/functions/create-deployment.md b/docs/examples/functions/create-deployment.md index 09fd57d..7571532 100644 --- a/docs/examples/functions/create-deployment.md +++ b/docs/examples/functions/create-deployment.md @@ -2,7 +2,7 @@ import { Client, Functions } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const functions = new Functions(client); diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index dfd9626..dfaf2ef 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -2,7 +2,7 @@ import { Client, Functions, ExecutionMethod } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const functions = new Functions(client); diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index 2343b34..60d9a10 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -2,7 +2,7 @@ import { Client, Functions } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const functions = new Functions(client); diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index 0ec5e2e..63df3bf 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -2,7 +2,7 @@ import { Client, Functions, } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const functions = new Functions(client); @@ -27,7 +27,8 @@ const result = await functions.create( '', // templateRepository (optional) '', // templateOwner (optional) '', // templateRootDirectory (optional) - '' // templateVersion (optional) + '', // templateVersion (optional) + '' // specification (optional) ); console.log(result); diff --git a/docs/examples/functions/delete-deployment.md b/docs/examples/functions/delete-deployment.md index db2aa5c..28fd5b2 100644 --- a/docs/examples/functions/delete-deployment.md +++ b/docs/examples/functions/delete-deployment.md @@ -2,7 +2,7 @@ import { Client, Functions } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const functions = new Functions(client); diff --git a/docs/examples/functions/delete-execution.md b/docs/examples/functions/delete-execution.md index 3fdcc87..2a857d6 100644 --- a/docs/examples/functions/delete-execution.md +++ b/docs/examples/functions/delete-execution.md @@ -2,7 +2,7 @@ import { Client, Functions } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const functions = new Functions(client); diff --git a/docs/examples/functions/delete-variable.md b/docs/examples/functions/delete-variable.md index 2a814a3..60c4de5 100644 --- a/docs/examples/functions/delete-variable.md +++ b/docs/examples/functions/delete-variable.md @@ -2,7 +2,7 @@ import { Client, Functions } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const functions = new Functions(client); diff --git a/docs/examples/functions/delete.md b/docs/examples/functions/delete.md index 193155b..b6dd5cc 100644 --- a/docs/examples/functions/delete.md +++ b/docs/examples/functions/delete.md @@ -2,7 +2,7 @@ import { Client, Functions } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const functions = new Functions(client); diff --git a/docs/examples/functions/get-deployment-download.md b/docs/examples/functions/get-deployment-download.md index 8324b18..34f5b4e 100644 --- a/docs/examples/functions/get-deployment-download.md +++ b/docs/examples/functions/get-deployment-download.md @@ -2,7 +2,7 @@ import { Client, Functions } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const functions = new Functions(client); diff --git a/docs/examples/functions/get-deployment.md b/docs/examples/functions/get-deployment.md index e329357..242c77c 100644 --- a/docs/examples/functions/get-deployment.md +++ b/docs/examples/functions/get-deployment.md @@ -2,7 +2,7 @@ import { Client, Functions } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const functions = new Functions(client); diff --git a/docs/examples/functions/get-execution.md b/docs/examples/functions/get-execution.md index ea9c9f9..6daf175 100644 --- a/docs/examples/functions/get-execution.md +++ b/docs/examples/functions/get-execution.md @@ -2,7 +2,7 @@ import { Client, Functions } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const functions = new Functions(client); diff --git a/docs/examples/functions/get-function-usage.md b/docs/examples/functions/get-function-usage.md index f6746d6..cfa6c00 100644 --- a/docs/examples/functions/get-function-usage.md +++ b/docs/examples/functions/get-function-usage.md @@ -2,7 +2,7 @@ import { Client, Functions, FunctionUsageRange } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const functions = new Functions(client); diff --git a/docs/examples/functions/get-template.md b/docs/examples/functions/get-template.md index d837032..a230c7a 100644 --- a/docs/examples/functions/get-template.md +++ b/docs/examples/functions/get-template.md @@ -2,7 +2,7 @@ import { Client, Functions } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const functions = new Functions(client); diff --git a/docs/examples/functions/get-usage.md b/docs/examples/functions/get-usage.md index 0efab64..7fdf2d2 100644 --- a/docs/examples/functions/get-usage.md +++ b/docs/examples/functions/get-usage.md @@ -2,7 +2,7 @@ import { Client, Functions, FunctionUsageRange } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const functions = new Functions(client); diff --git a/docs/examples/functions/get-variable.md b/docs/examples/functions/get-variable.md index 39fcfe1..14fd555 100644 --- a/docs/examples/functions/get-variable.md +++ b/docs/examples/functions/get-variable.md @@ -2,7 +2,7 @@ import { Client, Functions } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const functions = new Functions(client); diff --git a/docs/examples/functions/get.md b/docs/examples/functions/get.md index 7794f78..7eb5d29 100644 --- a/docs/examples/functions/get.md +++ b/docs/examples/functions/get.md @@ -2,7 +2,7 @@ import { Client, Functions } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const functions = new Functions(client); diff --git a/docs/examples/functions/list-deployments.md b/docs/examples/functions/list-deployments.md index 5f3638e..453e92c 100644 --- a/docs/examples/functions/list-deployments.md +++ b/docs/examples/functions/list-deployments.md @@ -2,7 +2,7 @@ import { Client, Functions } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const functions = new Functions(client); diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md index ceb4b19..1aad664 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -2,7 +2,7 @@ import { Client, Functions } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const functions = new Functions(client); diff --git a/docs/examples/functions/list-runtimes.md b/docs/examples/functions/list-runtimes.md index 4fa0e60..3601061 100644 --- a/docs/examples/functions/list-runtimes.md +++ b/docs/examples/functions/list-runtimes.md @@ -2,7 +2,7 @@ import { Client, Functions } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const functions = new Functions(client); diff --git a/docs/examples/functions/list-specifications.md b/docs/examples/functions/list-specifications.md new file mode 100644 index 0000000..a3c11f1 --- /dev/null +++ b/docs/examples/functions/list-specifications.md @@ -0,0 +1,11 @@ +import { Client, Functions } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const functions = new Functions(client); + +const result = await functions.listSpecifications(); + +console.log(result); diff --git a/docs/examples/functions/list-templates.md b/docs/examples/functions/list-templates.md index b0df525..3970f8f 100644 --- a/docs/examples/functions/list-templates.md +++ b/docs/examples/functions/list-templates.md @@ -2,7 +2,7 @@ import { Client, Functions } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const functions = new Functions(client); diff --git a/docs/examples/functions/list-variables.md b/docs/examples/functions/list-variables.md index 0de9bdb..fc659e3 100644 --- a/docs/examples/functions/list-variables.md +++ b/docs/examples/functions/list-variables.md @@ -2,7 +2,7 @@ import { Client, Functions } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const functions = new Functions(client); diff --git a/docs/examples/functions/list.md b/docs/examples/functions/list.md index aaa8aaf..26e4864 100644 --- a/docs/examples/functions/list.md +++ b/docs/examples/functions/list.md @@ -2,7 +2,7 @@ import { Client, Functions } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const functions = new Functions(client); diff --git a/docs/examples/functions/update-deployment-build.md b/docs/examples/functions/update-deployment-build.md index bdfdb21..bd11a2a 100644 --- a/docs/examples/functions/update-deployment-build.md +++ b/docs/examples/functions/update-deployment-build.md @@ -2,7 +2,7 @@ import { Client, Functions } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const functions = new Functions(client); diff --git a/docs/examples/functions/update-deployment.md b/docs/examples/functions/update-deployment.md index b5b3e81..3aad019 100644 --- a/docs/examples/functions/update-deployment.md +++ b/docs/examples/functions/update-deployment.md @@ -2,7 +2,7 @@ import { Client, Functions } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const functions = new Functions(client); diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index a4f10df..5046499 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -2,7 +2,7 @@ import { Client, Functions } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const functions = new Functions(client); diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index 7296010..a8d1709 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -2,7 +2,7 @@ import { Client, Functions, } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const functions = new Functions(client); @@ -23,7 +23,8 @@ const result = await functions.update( '', // providerRepositoryId (optional) '', // providerBranch (optional) false, // providerSilentMode (optional) - '' // providerRootDirectory (optional) + '', // providerRootDirectory (optional) + '' // specification (optional) ); console.log(result); diff --git a/docs/examples/graphql/mutation.md b/docs/examples/graphql/mutation.md index bef8ef2..0b9b76a 100644 --- a/docs/examples/graphql/mutation.md +++ b/docs/examples/graphql/mutation.md @@ -2,7 +2,7 @@ import { Client, Graphql } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const graphql = new Graphql(client); diff --git a/docs/examples/graphql/query.md b/docs/examples/graphql/query.md index 8aea5b8..a708c39 100644 --- a/docs/examples/graphql/query.md +++ b/docs/examples/graphql/query.md @@ -2,7 +2,7 @@ import { Client, Graphql } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const graphql = new Graphql(client); diff --git a/docs/examples/health/get-antivirus.md b/docs/examples/health/get-antivirus.md index 7638e5a..3c36cd7 100644 --- a/docs/examples/health/get-antivirus.md +++ b/docs/examples/health/get-antivirus.md @@ -2,7 +2,7 @@ import { Client, Health } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const health = new Health(client); diff --git a/docs/examples/health/get-cache.md b/docs/examples/health/get-cache.md index f9f4eba..0bdb894 100644 --- a/docs/examples/health/get-cache.md +++ b/docs/examples/health/get-cache.md @@ -2,7 +2,7 @@ import { Client, Health } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const health = new Health(client); diff --git a/docs/examples/health/get-certificate.md b/docs/examples/health/get-certificate.md index 3d17b4d..4bd5c8a 100644 --- a/docs/examples/health/get-certificate.md +++ b/docs/examples/health/get-certificate.md @@ -2,7 +2,7 @@ import { Client, Health } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const health = new Health(client); diff --git a/docs/examples/health/get-d-b.md b/docs/examples/health/get-d-b.md index 3c4928d..d18ed28 100644 --- a/docs/examples/health/get-d-b.md +++ b/docs/examples/health/get-d-b.md @@ -2,7 +2,7 @@ import { Client, Health } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const health = new Health(client); diff --git a/docs/examples/health/get-failed-jobs.md b/docs/examples/health/get-failed-jobs.md index 6801851..e1e57b1 100644 --- a/docs/examples/health/get-failed-jobs.md +++ b/docs/examples/health/get-failed-jobs.md @@ -2,7 +2,7 @@ import { Client, Health, } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const health = new Health(client); diff --git a/docs/examples/health/get-pub-sub.md b/docs/examples/health/get-pub-sub.md index 5dab6c8..9b398f5 100644 --- a/docs/examples/health/get-pub-sub.md +++ b/docs/examples/health/get-pub-sub.md @@ -2,7 +2,7 @@ import { Client, Health } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const health = new Health(client); diff --git a/docs/examples/health/get-queue-builds.md b/docs/examples/health/get-queue-builds.md index 0281fc3..0ee109f 100644 --- a/docs/examples/health/get-queue-builds.md +++ b/docs/examples/health/get-queue-builds.md @@ -2,7 +2,7 @@ import { Client, Health } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const health = new Health(client); diff --git a/docs/examples/health/get-queue-certificates.md b/docs/examples/health/get-queue-certificates.md index 5847b33..ce82ab0 100644 --- a/docs/examples/health/get-queue-certificates.md +++ b/docs/examples/health/get-queue-certificates.md @@ -2,7 +2,7 @@ import { Client, Health } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const health = new Health(client); diff --git a/docs/examples/health/get-queue-databases.md b/docs/examples/health/get-queue-databases.md index c2274cb..8a96fcf 100644 --- a/docs/examples/health/get-queue-databases.md +++ b/docs/examples/health/get-queue-databases.md @@ -2,7 +2,7 @@ import { Client, Health } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const health = new Health(client); diff --git a/docs/examples/health/get-queue-deletes.md b/docs/examples/health/get-queue-deletes.md index 190e13b..840607e 100644 --- a/docs/examples/health/get-queue-deletes.md +++ b/docs/examples/health/get-queue-deletes.md @@ -2,7 +2,7 @@ import { Client, Health } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const health = new Health(client); diff --git a/docs/examples/health/get-queue-functions.md b/docs/examples/health/get-queue-functions.md index fd53231..35c612a 100644 --- a/docs/examples/health/get-queue-functions.md +++ b/docs/examples/health/get-queue-functions.md @@ -2,7 +2,7 @@ import { Client, Health } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const health = new Health(client); diff --git a/docs/examples/health/get-queue-logs.md b/docs/examples/health/get-queue-logs.md index ae1eb17..9f5d51d 100644 --- a/docs/examples/health/get-queue-logs.md +++ b/docs/examples/health/get-queue-logs.md @@ -2,7 +2,7 @@ import { Client, Health } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const health = new Health(client); diff --git a/docs/examples/health/get-queue-mails.md b/docs/examples/health/get-queue-mails.md index ddd53af..58d694d 100644 --- a/docs/examples/health/get-queue-mails.md +++ b/docs/examples/health/get-queue-mails.md @@ -2,7 +2,7 @@ import { Client, Health } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const health = new Health(client); diff --git a/docs/examples/health/get-queue-messaging.md b/docs/examples/health/get-queue-messaging.md index fc19878..cfecdf9 100644 --- a/docs/examples/health/get-queue-messaging.md +++ b/docs/examples/health/get-queue-messaging.md @@ -2,7 +2,7 @@ import { Client, Health } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const health = new Health(client); diff --git a/docs/examples/health/get-queue-migrations.md b/docs/examples/health/get-queue-migrations.md index 48f70c2..5a8b74e 100644 --- a/docs/examples/health/get-queue-migrations.md +++ b/docs/examples/health/get-queue-migrations.md @@ -2,7 +2,7 @@ import { Client, Health } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const health = new Health(client); diff --git a/docs/examples/health/get-queue-usage-dump.md b/docs/examples/health/get-queue-usage-dump.md index 7ce52a6..4312ace 100644 --- a/docs/examples/health/get-queue-usage-dump.md +++ b/docs/examples/health/get-queue-usage-dump.md @@ -2,7 +2,7 @@ import { Client, Health } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const health = new Health(client); diff --git a/docs/examples/health/get-queue-usage.md b/docs/examples/health/get-queue-usage.md index 2908407..703574a 100644 --- a/docs/examples/health/get-queue-usage.md +++ b/docs/examples/health/get-queue-usage.md @@ -2,7 +2,7 @@ import { Client, Health } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const health = new Health(client); diff --git a/docs/examples/health/get-queue-webhooks.md b/docs/examples/health/get-queue-webhooks.md index 7ee629e..1c00386 100644 --- a/docs/examples/health/get-queue-webhooks.md +++ b/docs/examples/health/get-queue-webhooks.md @@ -2,7 +2,7 @@ import { Client, Health } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const health = new Health(client); diff --git a/docs/examples/health/get-queue.md b/docs/examples/health/get-queue.md index 16bba54..cef5e8c 100644 --- a/docs/examples/health/get-queue.md +++ b/docs/examples/health/get-queue.md @@ -2,7 +2,7 @@ import { Client, Health } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const health = new Health(client); diff --git a/docs/examples/health/get-storage-local.md b/docs/examples/health/get-storage-local.md index 5c6794a..82c6b8b 100644 --- a/docs/examples/health/get-storage-local.md +++ b/docs/examples/health/get-storage-local.md @@ -2,7 +2,7 @@ import { Client, Health } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const health = new Health(client); diff --git a/docs/examples/health/get-storage.md b/docs/examples/health/get-storage.md index c0a2371..a7a377a 100644 --- a/docs/examples/health/get-storage.md +++ b/docs/examples/health/get-storage.md @@ -2,7 +2,7 @@ import { Client, Health } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const health = new Health(client); diff --git a/docs/examples/health/get-time.md b/docs/examples/health/get-time.md index c2a504d..8e126c0 100644 --- a/docs/examples/health/get-time.md +++ b/docs/examples/health/get-time.md @@ -2,7 +2,7 @@ import { Client, Health } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const health = new Health(client); diff --git a/docs/examples/health/get.md b/docs/examples/health/get.md index d8990c9..3f2f0fb 100644 --- a/docs/examples/health/get.md +++ b/docs/examples/health/get.md @@ -2,7 +2,7 @@ import { Client, Health } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const health = new Health(client); diff --git a/docs/examples/locale/get.md b/docs/examples/locale/get.md index 825d6af..fc4f149 100644 --- a/docs/examples/locale/get.md +++ b/docs/examples/locale/get.md @@ -2,7 +2,7 @@ import { Client, Locale } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const locale = new Locale(client); diff --git a/docs/examples/locale/list-codes.md b/docs/examples/locale/list-codes.md index ef68451..547ff18 100644 --- a/docs/examples/locale/list-codes.md +++ b/docs/examples/locale/list-codes.md @@ -2,7 +2,7 @@ import { Client, Locale } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const locale = new Locale(client); diff --git a/docs/examples/locale/list-continents.md b/docs/examples/locale/list-continents.md index 2ddee46..2c09d6a 100644 --- a/docs/examples/locale/list-continents.md +++ b/docs/examples/locale/list-continents.md @@ -2,7 +2,7 @@ import { Client, Locale } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const locale = new Locale(client); diff --git a/docs/examples/locale/list-countries-e-u.md b/docs/examples/locale/list-countries-e-u.md index d2da2e1..12769b4 100644 --- a/docs/examples/locale/list-countries-e-u.md +++ b/docs/examples/locale/list-countries-e-u.md @@ -2,7 +2,7 @@ import { Client, Locale } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const locale = new Locale(client); diff --git a/docs/examples/locale/list-countries-phones.md b/docs/examples/locale/list-countries-phones.md index a0e6841..6bd09be 100644 --- a/docs/examples/locale/list-countries-phones.md +++ b/docs/examples/locale/list-countries-phones.md @@ -2,7 +2,7 @@ import { Client, Locale } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const locale = new Locale(client); diff --git a/docs/examples/locale/list-countries.md b/docs/examples/locale/list-countries.md index 19ce337..e245f18 100644 --- a/docs/examples/locale/list-countries.md +++ b/docs/examples/locale/list-countries.md @@ -2,7 +2,7 @@ import { Client, Locale } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const locale = new Locale(client); diff --git a/docs/examples/locale/list-currencies.md b/docs/examples/locale/list-currencies.md index 1ec368b..4fabdd6 100644 --- a/docs/examples/locale/list-currencies.md +++ b/docs/examples/locale/list-currencies.md @@ -2,7 +2,7 @@ import { Client, Locale } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const locale = new Locale(client); diff --git a/docs/examples/locale/list-languages.md b/docs/examples/locale/list-languages.md index 4a25d3b..3de7d36 100644 --- a/docs/examples/locale/list-languages.md +++ b/docs/examples/locale/list-languages.md @@ -2,7 +2,7 @@ import { Client, Locale } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const locale = new Locale(client); diff --git a/docs/examples/messaging/create-apns-provider.md b/docs/examples/messaging/create-apns-provider.md index 552b567..2c9592e 100644 --- a/docs/examples/messaging/create-apns-provider.md +++ b/docs/examples/messaging/create-apns-provider.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/create-email.md b/docs/examples/messaging/create-email.md index b7c1d08..cf98008 100644 --- a/docs/examples/messaging/create-email.md +++ b/docs/examples/messaging/create-email.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/create-fcm-provider.md b/docs/examples/messaging/create-fcm-provider.md index d4b87cf..e4db7c5 100644 --- a/docs/examples/messaging/create-fcm-provider.md +++ b/docs/examples/messaging/create-fcm-provider.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/create-mailgun-provider.md b/docs/examples/messaging/create-mailgun-provider.md index f2fb484..e03a7ad 100644 --- a/docs/examples/messaging/create-mailgun-provider.md +++ b/docs/examples/messaging/create-mailgun-provider.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/create-msg91provider.md b/docs/examples/messaging/create-msg91provider.md index 2d2412a..2576d81 100644 --- a/docs/examples/messaging/create-msg91provider.md +++ b/docs/examples/messaging/create-msg91provider.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md index 95e7c7c..fe8eac6 100644 --- a/docs/examples/messaging/create-push.md +++ b/docs/examples/messaging/create-push.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/create-sendgrid-provider.md b/docs/examples/messaging/create-sendgrid-provider.md index 8c9b870..309df22 100644 --- a/docs/examples/messaging/create-sendgrid-provider.md +++ b/docs/examples/messaging/create-sendgrid-provider.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/create-sms.md b/docs/examples/messaging/create-sms.md index 1ceffae..8cdc8ff 100644 --- a/docs/examples/messaging/create-sms.md +++ b/docs/examples/messaging/create-sms.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/create-smtp-provider.md b/docs/examples/messaging/create-smtp-provider.md index 2c1ea54..a1363e6 100644 --- a/docs/examples/messaging/create-smtp-provider.md +++ b/docs/examples/messaging/create-smtp-provider.md @@ -2,7 +2,7 @@ import { Client, Messaging, SmtpEncryption } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/create-subscriber.md b/docs/examples/messaging/create-subscriber.md index 3b0c3f4..9e67054 100644 --- a/docs/examples/messaging/create-subscriber.md +++ b/docs/examples/messaging/create-subscriber.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/create-telesign-provider.md b/docs/examples/messaging/create-telesign-provider.md index a44af4a..03928d1 100644 --- a/docs/examples/messaging/create-telesign-provider.md +++ b/docs/examples/messaging/create-telesign-provider.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/create-textmagic-provider.md b/docs/examples/messaging/create-textmagic-provider.md index e60ee10..f3a4f21 100644 --- a/docs/examples/messaging/create-textmagic-provider.md +++ b/docs/examples/messaging/create-textmagic-provider.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/create-topic.md b/docs/examples/messaging/create-topic.md index 88d1382..46a7a10 100644 --- a/docs/examples/messaging/create-topic.md +++ b/docs/examples/messaging/create-topic.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/create-twilio-provider.md b/docs/examples/messaging/create-twilio-provider.md index ca52c4a..4a1dbef 100644 --- a/docs/examples/messaging/create-twilio-provider.md +++ b/docs/examples/messaging/create-twilio-provider.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/create-vonage-provider.md b/docs/examples/messaging/create-vonage-provider.md index d4af220..97dfed4 100644 --- a/docs/examples/messaging/create-vonage-provider.md +++ b/docs/examples/messaging/create-vonage-provider.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/delete-provider.md b/docs/examples/messaging/delete-provider.md index 6e8f14e..03626ff 100644 --- a/docs/examples/messaging/delete-provider.md +++ b/docs/examples/messaging/delete-provider.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/delete-subscriber.md b/docs/examples/messaging/delete-subscriber.md index 9cc86f3..dc10349 100644 --- a/docs/examples/messaging/delete-subscriber.md +++ b/docs/examples/messaging/delete-subscriber.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/delete-topic.md b/docs/examples/messaging/delete-topic.md index 9a27f00..f009f77 100644 --- a/docs/examples/messaging/delete-topic.md +++ b/docs/examples/messaging/delete-topic.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/delete.md b/docs/examples/messaging/delete.md index eead43e..daf58d2 100644 --- a/docs/examples/messaging/delete.md +++ b/docs/examples/messaging/delete.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/get-message.md b/docs/examples/messaging/get-message.md index 03e92fb..3e141f4 100644 --- a/docs/examples/messaging/get-message.md +++ b/docs/examples/messaging/get-message.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/get-provider.md b/docs/examples/messaging/get-provider.md index 942a6da..834241f 100644 --- a/docs/examples/messaging/get-provider.md +++ b/docs/examples/messaging/get-provider.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/get-subscriber.md b/docs/examples/messaging/get-subscriber.md index fa68a05..2286048 100644 --- a/docs/examples/messaging/get-subscriber.md +++ b/docs/examples/messaging/get-subscriber.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/get-topic.md b/docs/examples/messaging/get-topic.md index e9c5133..dd30034 100644 --- a/docs/examples/messaging/get-topic.md +++ b/docs/examples/messaging/get-topic.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/list-message-logs.md b/docs/examples/messaging/list-message-logs.md index 27471c6..709a433 100644 --- a/docs/examples/messaging/list-message-logs.md +++ b/docs/examples/messaging/list-message-logs.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/list-messages.md b/docs/examples/messaging/list-messages.md index 9e27d9f..42cf887 100644 --- a/docs/examples/messaging/list-messages.md +++ b/docs/examples/messaging/list-messages.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/list-provider-logs.md b/docs/examples/messaging/list-provider-logs.md index 94625b8..228a83e 100644 --- a/docs/examples/messaging/list-provider-logs.md +++ b/docs/examples/messaging/list-provider-logs.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/list-providers.md b/docs/examples/messaging/list-providers.md index d3d82ff..e135b4a 100644 --- a/docs/examples/messaging/list-providers.md +++ b/docs/examples/messaging/list-providers.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/list-subscriber-logs.md b/docs/examples/messaging/list-subscriber-logs.md index 677b137..33f4bdf 100644 --- a/docs/examples/messaging/list-subscriber-logs.md +++ b/docs/examples/messaging/list-subscriber-logs.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/list-subscribers.md b/docs/examples/messaging/list-subscribers.md index 51f8e6f..0981840 100644 --- a/docs/examples/messaging/list-subscribers.md +++ b/docs/examples/messaging/list-subscribers.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/list-targets.md b/docs/examples/messaging/list-targets.md index 10a8b22..92adc0c 100644 --- a/docs/examples/messaging/list-targets.md +++ b/docs/examples/messaging/list-targets.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/list-topic-logs.md b/docs/examples/messaging/list-topic-logs.md index 7631727..2ab33f6 100644 --- a/docs/examples/messaging/list-topic-logs.md +++ b/docs/examples/messaging/list-topic-logs.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/list-topics.md b/docs/examples/messaging/list-topics.md index 708a3f5..8983f83 100644 --- a/docs/examples/messaging/list-topics.md +++ b/docs/examples/messaging/list-topics.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/update-apns-provider.md b/docs/examples/messaging/update-apns-provider.md index 891e1b8..4face78 100644 --- a/docs/examples/messaging/update-apns-provider.md +++ b/docs/examples/messaging/update-apns-provider.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/update-email.md b/docs/examples/messaging/update-email.md index 03ad05f..905ba62 100644 --- a/docs/examples/messaging/update-email.md +++ b/docs/examples/messaging/update-email.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/update-fcm-provider.md b/docs/examples/messaging/update-fcm-provider.md index 2774986..0c1b262 100644 --- a/docs/examples/messaging/update-fcm-provider.md +++ b/docs/examples/messaging/update-fcm-provider.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/update-mailgun-provider.md b/docs/examples/messaging/update-mailgun-provider.md index 2fb1d66..8dbf6b8 100644 --- a/docs/examples/messaging/update-mailgun-provider.md +++ b/docs/examples/messaging/update-mailgun-provider.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/update-msg91provider.md b/docs/examples/messaging/update-msg91provider.md index 124f333..68db8ff 100644 --- a/docs/examples/messaging/update-msg91provider.md +++ b/docs/examples/messaging/update-msg91provider.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md index d8e3d97..9fbb230 100644 --- a/docs/examples/messaging/update-push.md +++ b/docs/examples/messaging/update-push.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/update-sendgrid-provider.md b/docs/examples/messaging/update-sendgrid-provider.md index 699c4ce..5cb6907 100644 --- a/docs/examples/messaging/update-sendgrid-provider.md +++ b/docs/examples/messaging/update-sendgrid-provider.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/update-sms.md b/docs/examples/messaging/update-sms.md index 485b55f..c266626 100644 --- a/docs/examples/messaging/update-sms.md +++ b/docs/examples/messaging/update-sms.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/update-smtp-provider.md b/docs/examples/messaging/update-smtp-provider.md index dbba6d0..aca32d1 100644 --- a/docs/examples/messaging/update-smtp-provider.md +++ b/docs/examples/messaging/update-smtp-provider.md @@ -2,7 +2,7 @@ import { Client, Messaging, SmtpEncryption } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/update-telesign-provider.md b/docs/examples/messaging/update-telesign-provider.md index 8e246de..fcba064 100644 --- a/docs/examples/messaging/update-telesign-provider.md +++ b/docs/examples/messaging/update-telesign-provider.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/update-textmagic-provider.md b/docs/examples/messaging/update-textmagic-provider.md index 2e7f0e9..c2f1c25 100644 --- a/docs/examples/messaging/update-textmagic-provider.md +++ b/docs/examples/messaging/update-textmagic-provider.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/update-topic.md b/docs/examples/messaging/update-topic.md index 22cee4d..d5d9535 100644 --- a/docs/examples/messaging/update-topic.md +++ b/docs/examples/messaging/update-topic.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/update-twilio-provider.md b/docs/examples/messaging/update-twilio-provider.md index b839391..d6a8d07 100644 --- a/docs/examples/messaging/update-twilio-provider.md +++ b/docs/examples/messaging/update-twilio-provider.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/messaging/update-vonage-provider.md b/docs/examples/messaging/update-vonage-provider.md index 8ddd447..939cd82 100644 --- a/docs/examples/messaging/update-vonage-provider.md +++ b/docs/examples/messaging/update-vonage-provider.md @@ -2,7 +2,7 @@ import { Client, Messaging } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const messaging = new Messaging(client); diff --git a/docs/examples/migrations/create-appwrite-migration.md b/docs/examples/migrations/create-appwrite-migration.md index bfffc7f..4e5b463 100644 --- a/docs/examples/migrations/create-appwrite-migration.md +++ b/docs/examples/migrations/create-appwrite-migration.md @@ -2,7 +2,7 @@ import { Client, Migrations } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const migrations = new Migrations(client); diff --git a/docs/examples/migrations/create-firebase-migration.md b/docs/examples/migrations/create-firebase-migration.md index d273eb6..9e59eda 100644 --- a/docs/examples/migrations/create-firebase-migration.md +++ b/docs/examples/migrations/create-firebase-migration.md @@ -2,7 +2,7 @@ import { Client, Migrations } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const migrations = new Migrations(client); diff --git a/docs/examples/migrations/create-firebase-o-auth-migration.md b/docs/examples/migrations/create-firebase-o-auth-migration.md index e8a4bc1..bf57d42 100644 --- a/docs/examples/migrations/create-firebase-o-auth-migration.md +++ b/docs/examples/migrations/create-firebase-o-auth-migration.md @@ -2,7 +2,7 @@ import { Client, Migrations } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const migrations = new Migrations(client); diff --git a/docs/examples/migrations/create-n-host-migration.md b/docs/examples/migrations/create-n-host-migration.md index e002c67..281b584 100644 --- a/docs/examples/migrations/create-n-host-migration.md +++ b/docs/examples/migrations/create-n-host-migration.md @@ -2,7 +2,7 @@ import { Client, Migrations } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const migrations = new Migrations(client); diff --git a/docs/examples/migrations/create-supabase-migration.md b/docs/examples/migrations/create-supabase-migration.md index 5fd36ca..290009b 100644 --- a/docs/examples/migrations/create-supabase-migration.md +++ b/docs/examples/migrations/create-supabase-migration.md @@ -2,7 +2,7 @@ import { Client, Migrations } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const migrations = new Migrations(client); diff --git a/docs/examples/migrations/delete-firebase-auth.md b/docs/examples/migrations/delete-firebase-auth.md index 18b5321..8c7683b 100644 --- a/docs/examples/migrations/delete-firebase-auth.md +++ b/docs/examples/migrations/delete-firebase-auth.md @@ -2,7 +2,7 @@ import { Client, Migrations } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const migrations = new Migrations(client); diff --git a/docs/examples/migrations/delete.md b/docs/examples/migrations/delete.md index d86a349..d5f68ff 100644 --- a/docs/examples/migrations/delete.md +++ b/docs/examples/migrations/delete.md @@ -2,7 +2,7 @@ import { Client, Migrations } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const migrations = new Migrations(client); diff --git a/docs/examples/migrations/get-appwrite-report.md b/docs/examples/migrations/get-appwrite-report.md index d2c96b6..b5de084 100644 --- a/docs/examples/migrations/get-appwrite-report.md +++ b/docs/examples/migrations/get-appwrite-report.md @@ -2,7 +2,7 @@ import { Client, Migrations } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const migrations = new Migrations(client); diff --git a/docs/examples/migrations/get-firebase-report-o-auth.md b/docs/examples/migrations/get-firebase-report-o-auth.md index 155f495..055ddfb 100644 --- a/docs/examples/migrations/get-firebase-report-o-auth.md +++ b/docs/examples/migrations/get-firebase-report-o-auth.md @@ -2,7 +2,7 @@ import { Client, Migrations } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const migrations = new Migrations(client); diff --git a/docs/examples/migrations/get-firebase-report.md b/docs/examples/migrations/get-firebase-report.md index 8e89a29..112dd62 100644 --- a/docs/examples/migrations/get-firebase-report.md +++ b/docs/examples/migrations/get-firebase-report.md @@ -2,7 +2,7 @@ import { Client, Migrations } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const migrations = new Migrations(client); diff --git a/docs/examples/migrations/get-n-host-report.md b/docs/examples/migrations/get-n-host-report.md index afd2444..ec61501 100644 --- a/docs/examples/migrations/get-n-host-report.md +++ b/docs/examples/migrations/get-n-host-report.md @@ -2,7 +2,7 @@ import { Client, Migrations } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const migrations = new Migrations(client); diff --git a/docs/examples/migrations/get-supabase-report.md b/docs/examples/migrations/get-supabase-report.md index 31d9d0e..5f6dd31 100644 --- a/docs/examples/migrations/get-supabase-report.md +++ b/docs/examples/migrations/get-supabase-report.md @@ -2,7 +2,7 @@ import { Client, Migrations } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const migrations = new Migrations(client); diff --git a/docs/examples/migrations/get.md b/docs/examples/migrations/get.md index 5c78aed..3397c2f 100644 --- a/docs/examples/migrations/get.md +++ b/docs/examples/migrations/get.md @@ -2,7 +2,7 @@ import { Client, Migrations } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const migrations = new Migrations(client); diff --git a/docs/examples/migrations/list-firebase-projects.md b/docs/examples/migrations/list-firebase-projects.md index e70ee32..833c05f 100644 --- a/docs/examples/migrations/list-firebase-projects.md +++ b/docs/examples/migrations/list-firebase-projects.md @@ -2,7 +2,7 @@ import { Client, Migrations } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const migrations = new Migrations(client); diff --git a/docs/examples/migrations/list.md b/docs/examples/migrations/list.md index d098bce..05207f4 100644 --- a/docs/examples/migrations/list.md +++ b/docs/examples/migrations/list.md @@ -2,7 +2,7 @@ import { Client, Migrations } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const migrations = new Migrations(client); diff --git a/docs/examples/migrations/retry.md b/docs/examples/migrations/retry.md index e2daeab..e70bc07 100644 --- a/docs/examples/migrations/retry.md +++ b/docs/examples/migrations/retry.md @@ -2,7 +2,7 @@ import { Client, Migrations } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const migrations = new Migrations(client); diff --git a/docs/examples/project/create-variable.md b/docs/examples/project/create-variable.md index d0135be..5d72427 100644 --- a/docs/examples/project/create-variable.md +++ b/docs/examples/project/create-variable.md @@ -2,7 +2,7 @@ import { Client, Project } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const project = new Project(client); diff --git a/docs/examples/project/delete-variable.md b/docs/examples/project/delete-variable.md index 6eb0b69..f7a9cf7 100644 --- a/docs/examples/project/delete-variable.md +++ b/docs/examples/project/delete-variable.md @@ -2,7 +2,7 @@ import { Client, Project } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const project = new Project(client); diff --git a/docs/examples/project/get-usage.md b/docs/examples/project/get-usage.md index 412a5eb..28d2e32 100644 --- a/docs/examples/project/get-usage.md +++ b/docs/examples/project/get-usage.md @@ -2,7 +2,7 @@ import { Client, Project, ProjectUsageRange } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const project = new Project(client); diff --git a/docs/examples/project/get-variable.md b/docs/examples/project/get-variable.md index 3f35d2b..8765cca 100644 --- a/docs/examples/project/get-variable.md +++ b/docs/examples/project/get-variable.md @@ -2,7 +2,7 @@ import { Client, Project } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const project = new Project(client); diff --git a/docs/examples/project/list-variables.md b/docs/examples/project/list-variables.md index 55731bb..fde2ccf 100644 --- a/docs/examples/project/list-variables.md +++ b/docs/examples/project/list-variables.md @@ -2,7 +2,7 @@ import { Client, Project } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const project = new Project(client); diff --git a/docs/examples/project/update-variable.md b/docs/examples/project/update-variable.md index 2bc13f4..7263032 100644 --- a/docs/examples/project/update-variable.md +++ b/docs/examples/project/update-variable.md @@ -2,7 +2,7 @@ import { Client, Project } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const project = new Project(client); diff --git a/docs/examples/projects/create-j-w-t.md b/docs/examples/projects/create-j-w-t.md index 4de595d..2674a12 100644 --- a/docs/examples/projects/create-j-w-t.md +++ b/docs/examples/projects/create-j-w-t.md @@ -2,7 +2,7 @@ import { Client, Projects } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/create-key.md b/docs/examples/projects/create-key.md index 8cc040b..80ab9cc 100644 --- a/docs/examples/projects/create-key.md +++ b/docs/examples/projects/create-key.md @@ -2,7 +2,7 @@ import { Client, Projects } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/create-platform.md b/docs/examples/projects/create-platform.md index f0578df..472517a 100644 --- a/docs/examples/projects/create-platform.md +++ b/docs/examples/projects/create-platform.md @@ -2,7 +2,7 @@ import { Client, Projects, PlatformType } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/create-smtp-test.md b/docs/examples/projects/create-smtp-test.md index 1742ca0..205a608 100644 --- a/docs/examples/projects/create-smtp-test.md +++ b/docs/examples/projects/create-smtp-test.md @@ -2,7 +2,7 @@ import { Client, Projects, SMTPSecure } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/create-webhook.md b/docs/examples/projects/create-webhook.md index b065a5b..066b1b7 100644 --- a/docs/examples/projects/create-webhook.md +++ b/docs/examples/projects/create-webhook.md @@ -2,7 +2,7 @@ import { Client, Projects } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/create.md b/docs/examples/projects/create.md index 4dfe642..8d1eb12 100644 --- a/docs/examples/projects/create.md +++ b/docs/examples/projects/create.md @@ -2,7 +2,7 @@ import { Client, Projects, } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/delete-email-template.md b/docs/examples/projects/delete-email-template.md index 9897498..582c756 100644 --- a/docs/examples/projects/delete-email-template.md +++ b/docs/examples/projects/delete-email-template.md @@ -2,7 +2,7 @@ import { Client, Projects, EmailTemplateType, EmailTemplateLocale } from "@appwr const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/delete-key.md b/docs/examples/projects/delete-key.md index 1a291d6..2164385 100644 --- a/docs/examples/projects/delete-key.md +++ b/docs/examples/projects/delete-key.md @@ -2,7 +2,7 @@ import { Client, Projects } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/delete-platform.md b/docs/examples/projects/delete-platform.md index b16a8d0..8a0dd66 100644 --- a/docs/examples/projects/delete-platform.md +++ b/docs/examples/projects/delete-platform.md @@ -2,7 +2,7 @@ import { Client, Projects } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/delete-sms-template.md b/docs/examples/projects/delete-sms-template.md index a6638d6..cee4736 100644 --- a/docs/examples/projects/delete-sms-template.md +++ b/docs/examples/projects/delete-sms-template.md @@ -2,7 +2,7 @@ import { Client, Projects, SmsTemplateType, SmsTemplateLocale } from "@appwrite. const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/delete-webhook.md b/docs/examples/projects/delete-webhook.md index f0672b8..9b8b0ca 100644 --- a/docs/examples/projects/delete-webhook.md +++ b/docs/examples/projects/delete-webhook.md @@ -2,7 +2,7 @@ import { Client, Projects } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/delete.md b/docs/examples/projects/delete.md index 6171f76..606b449 100644 --- a/docs/examples/projects/delete.md +++ b/docs/examples/projects/delete.md @@ -2,7 +2,7 @@ import { Client, Projects } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/get-email-template.md b/docs/examples/projects/get-email-template.md index 06ac756..41da628 100644 --- a/docs/examples/projects/get-email-template.md +++ b/docs/examples/projects/get-email-template.md @@ -2,7 +2,7 @@ import { Client, Projects, EmailTemplateType, EmailTemplateLocale } from "@appwr const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/get-key.md b/docs/examples/projects/get-key.md index 74a5fdc..8965f72 100644 --- a/docs/examples/projects/get-key.md +++ b/docs/examples/projects/get-key.md @@ -2,7 +2,7 @@ import { Client, Projects } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/get-platform.md b/docs/examples/projects/get-platform.md index bb5e4ff..aa0b084 100644 --- a/docs/examples/projects/get-platform.md +++ b/docs/examples/projects/get-platform.md @@ -2,7 +2,7 @@ import { Client, Projects } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/get-sms-template.md b/docs/examples/projects/get-sms-template.md index 7fa3961..5c424db 100644 --- a/docs/examples/projects/get-sms-template.md +++ b/docs/examples/projects/get-sms-template.md @@ -2,7 +2,7 @@ import { Client, Projects, SmsTemplateType, SmsTemplateLocale } from "@appwrite. const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/get-webhook.md b/docs/examples/projects/get-webhook.md index caaf674..eff61f8 100644 --- a/docs/examples/projects/get-webhook.md +++ b/docs/examples/projects/get-webhook.md @@ -2,7 +2,7 @@ import { Client, Projects } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/get.md b/docs/examples/projects/get.md index f022595..eb537bf 100644 --- a/docs/examples/projects/get.md +++ b/docs/examples/projects/get.md @@ -2,7 +2,7 @@ import { Client, Projects } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/list-keys.md b/docs/examples/projects/list-keys.md index 4fdb513..a381e9f 100644 --- a/docs/examples/projects/list-keys.md +++ b/docs/examples/projects/list-keys.md @@ -2,7 +2,7 @@ import { Client, Projects } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/list-platforms.md b/docs/examples/projects/list-platforms.md index 9501f4f..d2dbc82 100644 --- a/docs/examples/projects/list-platforms.md +++ b/docs/examples/projects/list-platforms.md @@ -2,7 +2,7 @@ import { Client, Projects } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/list-webhooks.md b/docs/examples/projects/list-webhooks.md index 7498344..c0e90e9 100644 --- a/docs/examples/projects/list-webhooks.md +++ b/docs/examples/projects/list-webhooks.md @@ -2,7 +2,7 @@ import { Client, Projects } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/list.md b/docs/examples/projects/list.md index 551d0c9..01d68f4 100644 --- a/docs/examples/projects/list.md +++ b/docs/examples/projects/list.md @@ -2,7 +2,7 @@ import { Client, Projects } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/update-api-status-all.md b/docs/examples/projects/update-api-status-all.md index 6ebe810..5378a35 100644 --- a/docs/examples/projects/update-api-status-all.md +++ b/docs/examples/projects/update-api-status-all.md @@ -2,7 +2,7 @@ import { Client, Projects } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/update-api-status.md b/docs/examples/projects/update-api-status.md index 0b8048f..63328d4 100644 --- a/docs/examples/projects/update-api-status.md +++ b/docs/examples/projects/update-api-status.md @@ -2,7 +2,7 @@ import { Client, Projects, } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/update-auth-duration.md b/docs/examples/projects/update-auth-duration.md index 6e5fe91..82738f3 100644 --- a/docs/examples/projects/update-auth-duration.md +++ b/docs/examples/projects/update-auth-duration.md @@ -2,7 +2,7 @@ import { Client, Projects } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/update-auth-limit.md b/docs/examples/projects/update-auth-limit.md index 4949206..e76582e 100644 --- a/docs/examples/projects/update-auth-limit.md +++ b/docs/examples/projects/update-auth-limit.md @@ -2,7 +2,7 @@ import { Client, Projects } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/update-auth-password-dictionary.md b/docs/examples/projects/update-auth-password-dictionary.md index 4eb1f1e..bd76c9b 100644 --- a/docs/examples/projects/update-auth-password-dictionary.md +++ b/docs/examples/projects/update-auth-password-dictionary.md @@ -2,7 +2,7 @@ import { Client, Projects } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/update-auth-password-history.md b/docs/examples/projects/update-auth-password-history.md index 1aaacf1..02aa65b 100644 --- a/docs/examples/projects/update-auth-password-history.md +++ b/docs/examples/projects/update-auth-password-history.md @@ -2,7 +2,7 @@ import { Client, Projects } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/update-auth-sessions-limit.md b/docs/examples/projects/update-auth-sessions-limit.md index ed0b658..69efff8 100644 --- a/docs/examples/projects/update-auth-sessions-limit.md +++ b/docs/examples/projects/update-auth-sessions-limit.md @@ -2,7 +2,7 @@ import { Client, Projects } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/update-auth-status.md b/docs/examples/projects/update-auth-status.md index c1c3c7d..fc38aa6 100644 --- a/docs/examples/projects/update-auth-status.md +++ b/docs/examples/projects/update-auth-status.md @@ -2,7 +2,7 @@ import { Client, Projects, AuthMethod } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/update-email-template.md b/docs/examples/projects/update-email-template.md index 637b881..178193b 100644 --- a/docs/examples/projects/update-email-template.md +++ b/docs/examples/projects/update-email-template.md @@ -2,7 +2,7 @@ import { Client, Projects, EmailTemplateType, EmailTemplateLocale } from "@appwr const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/update-key.md b/docs/examples/projects/update-key.md index a3f904a..287133d 100644 --- a/docs/examples/projects/update-key.md +++ b/docs/examples/projects/update-key.md @@ -2,7 +2,7 @@ import { Client, Projects } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/update-mock-numbers.md b/docs/examples/projects/update-mock-numbers.md index 313a126..c371e72 100644 --- a/docs/examples/projects/update-mock-numbers.md +++ b/docs/examples/projects/update-mock-numbers.md @@ -2,7 +2,7 @@ import { Client, Projects } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/update-o-auth2.md b/docs/examples/projects/update-o-auth2.md index e44a554..fc9cd5a 100644 --- a/docs/examples/projects/update-o-auth2.md +++ b/docs/examples/projects/update-o-auth2.md @@ -2,7 +2,7 @@ import { Client, Projects, OAuthProvider } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/update-personal-data-check.md b/docs/examples/projects/update-personal-data-check.md index 3d1a3d6..be52d71 100644 --- a/docs/examples/projects/update-personal-data-check.md +++ b/docs/examples/projects/update-personal-data-check.md @@ -2,7 +2,7 @@ import { Client, Projects } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/update-platform.md b/docs/examples/projects/update-platform.md index 6ebfc23..a34d5cc 100644 --- a/docs/examples/projects/update-platform.md +++ b/docs/examples/projects/update-platform.md @@ -2,7 +2,7 @@ import { Client, Projects } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/update-service-status-all.md b/docs/examples/projects/update-service-status-all.md index 9687333..9a64f37 100644 --- a/docs/examples/projects/update-service-status-all.md +++ b/docs/examples/projects/update-service-status-all.md @@ -2,7 +2,7 @@ import { Client, Projects } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/update-service-status.md b/docs/examples/projects/update-service-status.md index 1a6ecd6..e1af528 100644 --- a/docs/examples/projects/update-service-status.md +++ b/docs/examples/projects/update-service-status.md @@ -2,7 +2,7 @@ import { Client, Projects, ApiService } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/update-session-alerts.md b/docs/examples/projects/update-session-alerts.md index 607c440..f718d25 100644 --- a/docs/examples/projects/update-session-alerts.md +++ b/docs/examples/projects/update-session-alerts.md @@ -2,7 +2,7 @@ import { Client, Projects } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/update-sms-template.md b/docs/examples/projects/update-sms-template.md index ab034a7..97e7001 100644 --- a/docs/examples/projects/update-sms-template.md +++ b/docs/examples/projects/update-sms-template.md @@ -2,7 +2,7 @@ import { Client, Projects, SmsTemplateType, SmsTemplateLocale } from "@appwrite. const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/update-smtp.md b/docs/examples/projects/update-smtp.md index 3852028..d2cba5c 100644 --- a/docs/examples/projects/update-smtp.md +++ b/docs/examples/projects/update-smtp.md @@ -2,7 +2,7 @@ import { Client, Projects, SMTPSecure } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/update-team.md b/docs/examples/projects/update-team.md index a93d985..71ef96c 100644 --- a/docs/examples/projects/update-team.md +++ b/docs/examples/projects/update-team.md @@ -2,7 +2,7 @@ import { Client, Projects } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/update-webhook-signature.md b/docs/examples/projects/update-webhook-signature.md index a7e5cd8..14a277c 100644 --- a/docs/examples/projects/update-webhook-signature.md +++ b/docs/examples/projects/update-webhook-signature.md @@ -2,7 +2,7 @@ import { Client, Projects } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/update-webhook.md b/docs/examples/projects/update-webhook.md index c36581b..3b248a8 100644 --- a/docs/examples/projects/update-webhook.md +++ b/docs/examples/projects/update-webhook.md @@ -2,7 +2,7 @@ import { Client, Projects } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/projects/update.md b/docs/examples/projects/update.md index 2aa5593..c5d2961 100644 --- a/docs/examples/projects/update.md +++ b/docs/examples/projects/update.md @@ -2,7 +2,7 @@ import { Client, Projects } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const projects = new Projects(client); diff --git a/docs/examples/proxy/create-rule.md b/docs/examples/proxy/create-rule.md index eabb21a..e2eecb0 100644 --- a/docs/examples/proxy/create-rule.md +++ b/docs/examples/proxy/create-rule.md @@ -2,7 +2,7 @@ import { Client, Proxy, } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const proxy = new Proxy(client); diff --git a/docs/examples/proxy/delete-rule.md b/docs/examples/proxy/delete-rule.md index 972ca06..4e8cc42 100644 --- a/docs/examples/proxy/delete-rule.md +++ b/docs/examples/proxy/delete-rule.md @@ -2,7 +2,7 @@ import { Client, Proxy } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const proxy = new Proxy(client); diff --git a/docs/examples/proxy/get-rule.md b/docs/examples/proxy/get-rule.md index 6e7add1..3e4ae78 100644 --- a/docs/examples/proxy/get-rule.md +++ b/docs/examples/proxy/get-rule.md @@ -2,7 +2,7 @@ import { Client, Proxy } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const proxy = new Proxy(client); diff --git a/docs/examples/proxy/list-rules.md b/docs/examples/proxy/list-rules.md index c634984..01b5cc0 100644 --- a/docs/examples/proxy/list-rules.md +++ b/docs/examples/proxy/list-rules.md @@ -2,7 +2,7 @@ import { Client, Proxy } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const proxy = new Proxy(client); diff --git a/docs/examples/proxy/update-rule-verification.md b/docs/examples/proxy/update-rule-verification.md index 9553223..6ae0a02 100644 --- a/docs/examples/proxy/update-rule-verification.md +++ b/docs/examples/proxy/update-rule-verification.md @@ -2,7 +2,7 @@ import { Client, Proxy } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const proxy = new Proxy(client); diff --git a/docs/examples/storage/create-bucket.md b/docs/examples/storage/create-bucket.md index 7e4908a..eec0272 100644 --- a/docs/examples/storage/create-bucket.md +++ b/docs/examples/storage/create-bucket.md @@ -2,7 +2,7 @@ import { Client, Storage, } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const storage = new Storage(client); diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index 8cf4ede..21c58dc 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -2,7 +2,7 @@ import { Client, Storage } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const storage = new Storage(client); diff --git a/docs/examples/storage/delete-bucket.md b/docs/examples/storage/delete-bucket.md index c4e9828..c209898 100644 --- a/docs/examples/storage/delete-bucket.md +++ b/docs/examples/storage/delete-bucket.md @@ -2,7 +2,7 @@ import { Client, Storage } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const storage = new Storage(client); diff --git a/docs/examples/storage/delete-file.md b/docs/examples/storage/delete-file.md index b083bdf..3e2010a 100644 --- a/docs/examples/storage/delete-file.md +++ b/docs/examples/storage/delete-file.md @@ -2,7 +2,7 @@ import { Client, Storage } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const storage = new Storage(client); diff --git a/docs/examples/storage/get-bucket-usage.md b/docs/examples/storage/get-bucket-usage.md index 6178279..f28d217 100644 --- a/docs/examples/storage/get-bucket-usage.md +++ b/docs/examples/storage/get-bucket-usage.md @@ -2,7 +2,7 @@ import { Client, Storage, StorageUsageRange } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const storage = new Storage(client); diff --git a/docs/examples/storage/get-bucket.md b/docs/examples/storage/get-bucket.md index c16cd46..b69202d 100644 --- a/docs/examples/storage/get-bucket.md +++ b/docs/examples/storage/get-bucket.md @@ -2,7 +2,7 @@ import { Client, Storage } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const storage = new Storage(client); diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md index 53e6a84..2376adc 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -2,7 +2,7 @@ import { Client, Storage } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const storage = new Storage(client); diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index 43c3582..ee390c5 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -2,7 +2,7 @@ import { Client, Storage, ImageGravity, ImageFormat } from "@appwrite.io/console const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const storage = new Storage(client); diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md index 787bd67..82689b5 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -2,7 +2,7 @@ import { Client, Storage } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const storage = new Storage(client); diff --git a/docs/examples/storage/get-file.md b/docs/examples/storage/get-file.md index e503f5f..f4c0aa9 100644 --- a/docs/examples/storage/get-file.md +++ b/docs/examples/storage/get-file.md @@ -2,7 +2,7 @@ import { Client, Storage } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const storage = new Storage(client); diff --git a/docs/examples/storage/get-usage.md b/docs/examples/storage/get-usage.md index 5fa84fa..6090311 100644 --- a/docs/examples/storage/get-usage.md +++ b/docs/examples/storage/get-usage.md @@ -2,7 +2,7 @@ import { Client, Storage, StorageUsageRange } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const storage = new Storage(client); diff --git a/docs/examples/storage/list-buckets.md b/docs/examples/storage/list-buckets.md index c48d5d8..eb4c561 100644 --- a/docs/examples/storage/list-buckets.md +++ b/docs/examples/storage/list-buckets.md @@ -2,7 +2,7 @@ import { Client, Storage } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const storage = new Storage(client); diff --git a/docs/examples/storage/list-files.md b/docs/examples/storage/list-files.md index 7fc7067..e503913 100644 --- a/docs/examples/storage/list-files.md +++ b/docs/examples/storage/list-files.md @@ -2,7 +2,7 @@ import { Client, Storage } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const storage = new Storage(client); diff --git a/docs/examples/storage/update-bucket.md b/docs/examples/storage/update-bucket.md index 821ec7a..8959395 100644 --- a/docs/examples/storage/update-bucket.md +++ b/docs/examples/storage/update-bucket.md @@ -2,7 +2,7 @@ import { Client, Storage, } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const storage = new Storage(client); diff --git a/docs/examples/storage/update-file.md b/docs/examples/storage/update-file.md index 5fa19f1..2d3fedb 100644 --- a/docs/examples/storage/update-file.md +++ b/docs/examples/storage/update-file.md @@ -2,7 +2,7 @@ import { Client, Storage } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const storage = new Storage(client); diff --git a/docs/examples/teams/create-membership.md b/docs/examples/teams/create-membership.md index da7ff89..2ea76b1 100644 --- a/docs/examples/teams/create-membership.md +++ b/docs/examples/teams/create-membership.md @@ -2,7 +2,7 @@ import { Client, Teams } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const teams = new Teams(client); diff --git a/docs/examples/teams/create.md b/docs/examples/teams/create.md index e64c11c..40cd476 100644 --- a/docs/examples/teams/create.md +++ b/docs/examples/teams/create.md @@ -2,7 +2,7 @@ import { Client, Teams } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const teams = new Teams(client); diff --git a/docs/examples/teams/delete-membership.md b/docs/examples/teams/delete-membership.md index e28663c..c7a307d 100644 --- a/docs/examples/teams/delete-membership.md +++ b/docs/examples/teams/delete-membership.md @@ -2,7 +2,7 @@ import { Client, Teams } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const teams = new Teams(client); diff --git a/docs/examples/teams/delete.md b/docs/examples/teams/delete.md index 4853107..fe71dee 100644 --- a/docs/examples/teams/delete.md +++ b/docs/examples/teams/delete.md @@ -2,7 +2,7 @@ import { Client, Teams } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const teams = new Teams(client); diff --git a/docs/examples/teams/get-membership.md b/docs/examples/teams/get-membership.md index 1a1ab24..99e67ea 100644 --- a/docs/examples/teams/get-membership.md +++ b/docs/examples/teams/get-membership.md @@ -2,7 +2,7 @@ import { Client, Teams } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const teams = new Teams(client); diff --git a/docs/examples/teams/get-prefs.md b/docs/examples/teams/get-prefs.md index 48e44d5..9b5c724 100644 --- a/docs/examples/teams/get-prefs.md +++ b/docs/examples/teams/get-prefs.md @@ -2,7 +2,7 @@ import { Client, Teams } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const teams = new Teams(client); diff --git a/docs/examples/teams/get.md b/docs/examples/teams/get.md index d3d788e..d87b58f 100644 --- a/docs/examples/teams/get.md +++ b/docs/examples/teams/get.md @@ -2,7 +2,7 @@ import { Client, Teams } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const teams = new Teams(client); diff --git a/docs/examples/teams/list-logs.md b/docs/examples/teams/list-logs.md index 7e7e949..76ba484 100644 --- a/docs/examples/teams/list-logs.md +++ b/docs/examples/teams/list-logs.md @@ -2,7 +2,7 @@ import { Client, Teams } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const teams = new Teams(client); diff --git a/docs/examples/teams/list-memberships.md b/docs/examples/teams/list-memberships.md index c777c51..9f1a6f9 100644 --- a/docs/examples/teams/list-memberships.md +++ b/docs/examples/teams/list-memberships.md @@ -2,7 +2,7 @@ import { Client, Teams } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const teams = new Teams(client); diff --git a/docs/examples/teams/list.md b/docs/examples/teams/list.md index 35b3f6d..b738fe9 100644 --- a/docs/examples/teams/list.md +++ b/docs/examples/teams/list.md @@ -2,7 +2,7 @@ import { Client, Teams } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const teams = new Teams(client); diff --git a/docs/examples/teams/update-membership-status.md b/docs/examples/teams/update-membership-status.md index 8c179bc..b7fe25d 100644 --- a/docs/examples/teams/update-membership-status.md +++ b/docs/examples/teams/update-membership-status.md @@ -2,7 +2,7 @@ import { Client, Teams } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const teams = new Teams(client); diff --git a/docs/examples/teams/update-membership.md b/docs/examples/teams/update-membership.md index 70c3917..2e6f759 100644 --- a/docs/examples/teams/update-membership.md +++ b/docs/examples/teams/update-membership.md @@ -2,7 +2,7 @@ import { Client, Teams } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const teams = new Teams(client); diff --git a/docs/examples/teams/update-name.md b/docs/examples/teams/update-name.md index 7a4257a..c879263 100644 --- a/docs/examples/teams/update-name.md +++ b/docs/examples/teams/update-name.md @@ -2,7 +2,7 @@ import { Client, Teams } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const teams = new Teams(client); diff --git a/docs/examples/teams/update-prefs.md b/docs/examples/teams/update-prefs.md index 7132d11..d81c93d 100644 --- a/docs/examples/teams/update-prefs.md +++ b/docs/examples/teams/update-prefs.md @@ -2,7 +2,7 @@ import { Client, Teams } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const teams = new Teams(client); diff --git a/docs/examples/users/create-argon2user.md b/docs/examples/users/create-argon2user.md index ec2710b..b39f688 100644 --- a/docs/examples/users/create-argon2user.md +++ b/docs/examples/users/create-argon2user.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/create-bcrypt-user.md b/docs/examples/users/create-bcrypt-user.md index 2d79439..874b4e7 100644 --- a/docs/examples/users/create-bcrypt-user.md +++ b/docs/examples/users/create-bcrypt-user.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/create-j-w-t.md b/docs/examples/users/create-j-w-t.md index 393acd6..aefc620 100644 --- a/docs/examples/users/create-j-w-t.md +++ b/docs/examples/users/create-j-w-t.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/create-m-d5user.md b/docs/examples/users/create-m-d5user.md index 4b4ec19..da6d106 100644 --- a/docs/examples/users/create-m-d5user.md +++ b/docs/examples/users/create-m-d5user.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/create-mfa-recovery-codes.md b/docs/examples/users/create-mfa-recovery-codes.md index 7c10a62..6689014 100644 --- a/docs/examples/users/create-mfa-recovery-codes.md +++ b/docs/examples/users/create-mfa-recovery-codes.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/create-p-h-pass-user.md b/docs/examples/users/create-p-h-pass-user.md index 9578039..235df14 100644 --- a/docs/examples/users/create-p-h-pass-user.md +++ b/docs/examples/users/create-p-h-pass-user.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/create-s-h-a-user.md b/docs/examples/users/create-s-h-a-user.md index 9456a97..a13d034 100644 --- a/docs/examples/users/create-s-h-a-user.md +++ b/docs/examples/users/create-s-h-a-user.md @@ -2,7 +2,7 @@ import { Client, Users, PasswordHash } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/create-scrypt-modified-user.md b/docs/examples/users/create-scrypt-modified-user.md index 3c37a2f..e6e1c42 100644 --- a/docs/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/users/create-scrypt-modified-user.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/create-scrypt-user.md b/docs/examples/users/create-scrypt-user.md index 11b59aa..c8e9340 100644 --- a/docs/examples/users/create-scrypt-user.md +++ b/docs/examples/users/create-scrypt-user.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/create-session.md b/docs/examples/users/create-session.md index 43d8bab..55704e5 100644 --- a/docs/examples/users/create-session.md +++ b/docs/examples/users/create-session.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/create-target.md b/docs/examples/users/create-target.md index 9dcb19a..28daa91 100644 --- a/docs/examples/users/create-target.md +++ b/docs/examples/users/create-target.md @@ -2,7 +2,7 @@ import { Client, Users, MessagingProviderType } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/create-token.md b/docs/examples/users/create-token.md index 2b5cd21..6c91898 100644 --- a/docs/examples/users/create-token.md +++ b/docs/examples/users/create-token.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/create.md b/docs/examples/users/create.md index e2b7b8d..8959c12 100644 --- a/docs/examples/users/create.md +++ b/docs/examples/users/create.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/delete-identity.md b/docs/examples/users/delete-identity.md index f006c4e..b8ef32e 100644 --- a/docs/examples/users/delete-identity.md +++ b/docs/examples/users/delete-identity.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/delete-mfa-authenticator.md b/docs/examples/users/delete-mfa-authenticator.md index a6eb078..586940e 100644 --- a/docs/examples/users/delete-mfa-authenticator.md +++ b/docs/examples/users/delete-mfa-authenticator.md @@ -2,7 +2,7 @@ import { Client, Users, AuthenticatorType } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/delete-session.md b/docs/examples/users/delete-session.md index f447039..3380f90 100644 --- a/docs/examples/users/delete-session.md +++ b/docs/examples/users/delete-session.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/delete-sessions.md b/docs/examples/users/delete-sessions.md index b96efbe..3b0e153 100644 --- a/docs/examples/users/delete-sessions.md +++ b/docs/examples/users/delete-sessions.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/delete-target.md b/docs/examples/users/delete-target.md index b5caecc..1877265 100644 --- a/docs/examples/users/delete-target.md +++ b/docs/examples/users/delete-target.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/delete.md b/docs/examples/users/delete.md index 3ddfe26..60a7e16 100644 --- a/docs/examples/users/delete.md +++ b/docs/examples/users/delete.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/get-mfa-recovery-codes.md b/docs/examples/users/get-mfa-recovery-codes.md index 7576851..7b74479 100644 --- a/docs/examples/users/get-mfa-recovery-codes.md +++ b/docs/examples/users/get-mfa-recovery-codes.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/get-prefs.md b/docs/examples/users/get-prefs.md index 242fb30..882cbd6 100644 --- a/docs/examples/users/get-prefs.md +++ b/docs/examples/users/get-prefs.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/get-target.md b/docs/examples/users/get-target.md index 8516cf4..a6b8962 100644 --- a/docs/examples/users/get-target.md +++ b/docs/examples/users/get-target.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/get-usage.md b/docs/examples/users/get-usage.md index a8118f9..5b55915 100644 --- a/docs/examples/users/get-usage.md +++ b/docs/examples/users/get-usage.md @@ -2,7 +2,7 @@ import { Client, Users, UserUsageRange } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/get.md b/docs/examples/users/get.md index fe3ead0..84f0f33 100644 --- a/docs/examples/users/get.md +++ b/docs/examples/users/get.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/list-identities.md b/docs/examples/users/list-identities.md index 31892a5..0836749 100644 --- a/docs/examples/users/list-identities.md +++ b/docs/examples/users/list-identities.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/list-logs.md b/docs/examples/users/list-logs.md index 6e6f6e1..246cf26 100644 --- a/docs/examples/users/list-logs.md +++ b/docs/examples/users/list-logs.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/list-memberships.md b/docs/examples/users/list-memberships.md index 059af09..9818942 100644 --- a/docs/examples/users/list-memberships.md +++ b/docs/examples/users/list-memberships.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/list-mfa-factors.md b/docs/examples/users/list-mfa-factors.md index 85fefb4..13d5571 100644 --- a/docs/examples/users/list-mfa-factors.md +++ b/docs/examples/users/list-mfa-factors.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/list-sessions.md b/docs/examples/users/list-sessions.md index be1d9cc..b99d79b 100644 --- a/docs/examples/users/list-sessions.md +++ b/docs/examples/users/list-sessions.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/list-targets.md b/docs/examples/users/list-targets.md index e3fb352..3374bf9 100644 --- a/docs/examples/users/list-targets.md +++ b/docs/examples/users/list-targets.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/list.md b/docs/examples/users/list.md index ffc7004..0876ef3 100644 --- a/docs/examples/users/list.md +++ b/docs/examples/users/list.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/update-email-verification.md b/docs/examples/users/update-email-verification.md index afd0f09..869424d 100644 --- a/docs/examples/users/update-email-verification.md +++ b/docs/examples/users/update-email-verification.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/update-email.md b/docs/examples/users/update-email.md index 7e34a7e..2e47e01 100644 --- a/docs/examples/users/update-email.md +++ b/docs/examples/users/update-email.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/update-labels.md b/docs/examples/users/update-labels.md index 1a0c6c9..5c8cdda 100644 --- a/docs/examples/users/update-labels.md +++ b/docs/examples/users/update-labels.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/update-mfa-recovery-codes.md b/docs/examples/users/update-mfa-recovery-codes.md index ae777cd..2705a2a 100644 --- a/docs/examples/users/update-mfa-recovery-codes.md +++ b/docs/examples/users/update-mfa-recovery-codes.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/update-mfa.md b/docs/examples/users/update-mfa.md index 1daa6af..50a8a1d 100644 --- a/docs/examples/users/update-mfa.md +++ b/docs/examples/users/update-mfa.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/update-name.md b/docs/examples/users/update-name.md index 3c562a2..e615c46 100644 --- a/docs/examples/users/update-name.md +++ b/docs/examples/users/update-name.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/update-password.md b/docs/examples/users/update-password.md index a490da3..3e8c33c 100644 --- a/docs/examples/users/update-password.md +++ b/docs/examples/users/update-password.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/update-phone-verification.md b/docs/examples/users/update-phone-verification.md index 21ed93e..87cc8ee 100644 --- a/docs/examples/users/update-phone-verification.md +++ b/docs/examples/users/update-phone-verification.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/update-phone.md b/docs/examples/users/update-phone.md index 49d56ee..6544853 100644 --- a/docs/examples/users/update-phone.md +++ b/docs/examples/users/update-phone.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/update-prefs.md b/docs/examples/users/update-prefs.md index ed52376..d65a5e7 100644 --- a/docs/examples/users/update-prefs.md +++ b/docs/examples/users/update-prefs.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/update-status.md b/docs/examples/users/update-status.md index aaf3813..4e61a50 100644 --- a/docs/examples/users/update-status.md +++ b/docs/examples/users/update-status.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/users/update-target.md b/docs/examples/users/update-target.md index ca432af..2872b9a 100644 --- a/docs/examples/users/update-target.md +++ b/docs/examples/users/update-target.md @@ -2,7 +2,7 @@ import { Client, Users } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const users = new Users(client); diff --git a/docs/examples/vcs/create-repository-detection.md b/docs/examples/vcs/create-repository-detection.md index d4c82f6..4f269bf 100644 --- a/docs/examples/vcs/create-repository-detection.md +++ b/docs/examples/vcs/create-repository-detection.md @@ -2,7 +2,7 @@ import { Client, Vcs } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const vcs = new Vcs(client); diff --git a/docs/examples/vcs/create-repository.md b/docs/examples/vcs/create-repository.md index 4fab34b..d48e174 100644 --- a/docs/examples/vcs/create-repository.md +++ b/docs/examples/vcs/create-repository.md @@ -2,7 +2,7 @@ import { Client, Vcs } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const vcs = new Vcs(client); diff --git a/docs/examples/vcs/delete-installation.md b/docs/examples/vcs/delete-installation.md index 3edd5df..0f49408 100644 --- a/docs/examples/vcs/delete-installation.md +++ b/docs/examples/vcs/delete-installation.md @@ -2,7 +2,7 @@ import { Client, Vcs } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const vcs = new Vcs(client); diff --git a/docs/examples/vcs/get-installation.md b/docs/examples/vcs/get-installation.md index 11c39a8..ec4b6d6 100644 --- a/docs/examples/vcs/get-installation.md +++ b/docs/examples/vcs/get-installation.md @@ -2,7 +2,7 @@ import { Client, Vcs } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const vcs = new Vcs(client); diff --git a/docs/examples/vcs/get-repository-contents.md b/docs/examples/vcs/get-repository-contents.md index 9845e3a..8a2fc29 100644 --- a/docs/examples/vcs/get-repository-contents.md +++ b/docs/examples/vcs/get-repository-contents.md @@ -2,7 +2,7 @@ import { Client, Vcs } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const vcs = new Vcs(client); diff --git a/docs/examples/vcs/get-repository.md b/docs/examples/vcs/get-repository.md index 12b528e..2161d0c 100644 --- a/docs/examples/vcs/get-repository.md +++ b/docs/examples/vcs/get-repository.md @@ -2,7 +2,7 @@ import { Client, Vcs } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const vcs = new Vcs(client); diff --git a/docs/examples/vcs/list-installations.md b/docs/examples/vcs/list-installations.md index 4bef271..8213b83 100644 --- a/docs/examples/vcs/list-installations.md +++ b/docs/examples/vcs/list-installations.md @@ -2,7 +2,7 @@ import { Client, Vcs } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const vcs = new Vcs(client); diff --git a/docs/examples/vcs/list-repositories.md b/docs/examples/vcs/list-repositories.md index 31d6b2f..e69f9ee 100644 --- a/docs/examples/vcs/list-repositories.md +++ b/docs/examples/vcs/list-repositories.md @@ -2,7 +2,7 @@ import { Client, Vcs } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const vcs = new Vcs(client); diff --git a/docs/examples/vcs/list-repository-branches.md b/docs/examples/vcs/list-repository-branches.md index 29f1565..4d3ab49 100644 --- a/docs/examples/vcs/list-repository-branches.md +++ b/docs/examples/vcs/list-repository-branches.md @@ -2,7 +2,7 @@ import { Client, Vcs } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const vcs = new Vcs(client); diff --git a/docs/examples/vcs/update-external-deployments.md b/docs/examples/vcs/update-external-deployments.md index ce11633..8ad52a6 100644 --- a/docs/examples/vcs/update-external-deployments.md +++ b/docs/examples/vcs/update-external-deployments.md @@ -2,7 +2,7 @@ import { Client, Vcs } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint - .setProject('<YOUR_PROJECT_ID>'); // Your project ID + .setProject(''); // Your project ID const vcs = new Vcs(client); diff --git a/package.json b/package.json index 1a54172..d4d5f83 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@appwrite.io/console", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API", - "version": "0.7.0-rc.2", + "version": "0.6.5-rc.3", "license": "BSD-3-Clause", "main": "dist/cjs/sdk.js", "exports": { diff --git a/src/client.ts b/src/client.ts index 50af8a5..34d6aae 100644 --- a/src/client.ts +++ b/src/client.ts @@ -304,7 +304,7 @@ class Client { 'x-sdk-name': 'Console', 'x-sdk-platform': 'console', 'x-sdk-language': 'web', - 'x-sdk-version': '0.7.0-rc.2', + 'x-sdk-version': '0.6.5-rc.3', 'X-Appwrite-Response-Format': '1.6.0', }; diff --git a/src/enums/platform-type.ts b/src/enums/platform-type.ts index e7c72fd..914dda8 100644 --- a/src/enums/platform-type.ts +++ b/src/enums/platform-type.ts @@ -12,6 +12,4 @@ export enum PlatformType { Appletvos = 'apple-tvos', Android = 'android', Unity = 'unity', - Reactnativeios = 'react-native-ios', - Reactnativeandroid = 'react-native-android', } \ No newline at end of file diff --git a/src/enums/runtime.ts b/src/enums/runtime.ts index 8a2326b..f0524b5 100644 --- a/src/enums/runtime.ts +++ b/src/enums/runtime.ts @@ -44,5 +44,5 @@ export enum Runtime { Cpp17 = 'cpp-17', Cpp20 = 'cpp-20', Bun10 = 'bun-1.0', - Go122 = 'go-1.22', + Go123 = 'go-1.23', } \ No newline at end of file diff --git a/src/models.ts b/src/models.ts index 4ece510..6835d08 100644 --- a/src/models.ts +++ b/src/models.ts @@ -509,6 +509,19 @@ export namespace Models { */ projects: FirebaseProject[]; } + /** + * Specifications List + */ + export type SpecificationList = { + /** + * Total number of specifications documents that matched your query. + */ + total: number; + /** + * List of specifications. + */ + specifications: Specification[]; + } /** * VCS Content List */ @@ -1871,6 +1884,10 @@ export namespace Models { * Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests */ providerSilentMode: boolean; + /** + * Machine specification for builds and executions. + */ + specification: string; } /** * Template Function @@ -2165,6 +2182,10 @@ export namespace Models { * The code size in bytes. */ size: number; + /** + * The build output size in bytes. + */ + buildSize: number; /** * The current build ID. */ @@ -3397,6 +3418,27 @@ export namespace Models { */ value: string; } + /** + * Specification + */ + export type Specification = { + /** + * Memory size in MB. + */ + memory: number; + /** + * Number of CPUs. + */ + cpus: number; + /** + * Is size enabled. + */ + enabled: boolean; + /** + * Size slug. + */ + slug: string; + } /** * Rule */ diff --git a/src/services/functions.ts b/src/services/functions.ts index 8b0ac4e..12eac72 100644 --- a/src/services/functions.ts +++ b/src/services/functions.ts @@ -69,10 +69,11 @@ export class Functions { * @param {string} templateOwner * @param {string} templateRootDirectory * @param {string} templateVersion + * @param {string} specification * @throws {AppwriteException} * @returns {Promise} */ - async create(functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, templateRepository?: string, templateOwner?: string, templateRootDirectory?: string, templateVersion?: string): Promise { + async create(functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, templateRepository?: string, templateOwner?: string, templateRootDirectory?: string, templateVersion?: string, specification?: string): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -147,6 +148,9 @@ export class Functions { if (typeof templateVersion !== 'undefined') { payload['templateVersion'] = templateVersion; } + if (typeof specification !== 'undefined') { + payload['specification'] = specification; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -184,6 +188,31 @@ export class Functions { payload ); } + /** + * List available function runtime specifications + * + * List allowed function specifications for this instance. + + * + * @throws {AppwriteException} + * @returns {Promise} + */ + async listSpecifications(): Promise { + const apiPath = '/functions/specifications'; + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return await this.client.call( + 'get', + uri, + apiHeaders, + payload + ); + } /** * List function templates * @@ -329,10 +358,11 @@ export class Functions { * @param {string} providerBranch * @param {boolean} providerSilentMode * @param {string} providerRootDirectory + * @param {string} specification * @throws {AppwriteException} * @returns {Promise} */ - async update(functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string): Promise { + async update(functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -389,6 +419,9 @@ export class Functions { if (typeof providerRootDirectory !== 'undefined') { payload['providerRootDirectory'] = providerRootDirectory; } + if (typeof specification !== 'undefined') { + payload['specification'] = specification; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -767,7 +800,7 @@ Use the "command" param to set the entrypoint used to execute your cod * @throws {AppwriteException} * @returns {Promise} */ - async createExecution(functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string, onProgress = (progress: UploadProgress) => {}): Promise { + async createExecution(functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -794,15 +827,14 @@ Use the "command" param to set the entrypoint used to execute your cod const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { - 'content-type': 'multipart/form-data', + 'content-type': 'application/json', } - return await this.client.chunkedUpload( + return await this.client.call( 'post', uri, apiHeaders, - payload, - onProgress + payload ); } /** From 596b987fb1e6ff3e94f3541e6e582e4ac505bb5e Mon Sep 17 00:00:00 2001 From: root Date: Fri, 23 Aug 2024 15:26:06 +0000 Subject: [PATCH 6/9] chore: update SDKs for appwrite 1.6.0 --- README.md | 2 +- package.json | 2 +- src/client.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e391143..fe94057 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ import { Client, Account } from "@appwrite.io/console"; To install with a CDN (content delivery network) add the following scripts to the bottom of your tag, but before you use any Appwrite services: ```html - + ``` diff --git a/package.json b/package.json index d4d5f83..459caa4 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@appwrite.io/console", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API", - "version": "0.6.5-rc.3", + "version": "0.6.5", "license": "BSD-3-Clause", "main": "dist/cjs/sdk.js", "exports": { diff --git a/src/client.ts b/src/client.ts index 34d6aae..2faa468 100644 --- a/src/client.ts +++ b/src/client.ts @@ -304,7 +304,7 @@ class Client { 'x-sdk-name': 'Console', 'x-sdk-platform': 'console', 'x-sdk-language': 'web', - 'x-sdk-version': '0.6.5-rc.3', + 'x-sdk-version': '0.6.5', 'X-Appwrite-Response-Format': '1.6.0', }; From 772277e01aff3ac127e6c5f3bd3cfc2c97da5122 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Fri, 23 Aug 2024 21:48:20 +0200 Subject: [PATCH 7/9] feat: final push --- README.md | 2 +- package.json | 2 +- src/client.ts | 2 +- src/enums/platform-type.ts | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index fe94057..534aa79 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ import { Client, Account } from "@appwrite.io/console"; To install with a CDN (content delivery network) add the following scripts to the bottom of your tag, but before you use any Appwrite services: ```html - + ``` diff --git a/package.json b/package.json index 459caa4..6adfc5b 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@appwrite.io/console", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API", - "version": "0.6.5", + "version": "1.0.0", "license": "BSD-3-Clause", "main": "dist/cjs/sdk.js", "exports": { diff --git a/src/client.ts b/src/client.ts index 2faa468..b12c535 100644 --- a/src/client.ts +++ b/src/client.ts @@ -304,7 +304,7 @@ class Client { 'x-sdk-name': 'Console', 'x-sdk-platform': 'console', 'x-sdk-language': 'web', - 'x-sdk-version': '0.6.5', + 'x-sdk-version': '1.0.0', 'X-Appwrite-Response-Format': '1.6.0', }; diff --git a/src/enums/platform-type.ts b/src/enums/platform-type.ts index 914dda8..e7c72fd 100644 --- a/src/enums/platform-type.ts +++ b/src/enums/platform-type.ts @@ -12,4 +12,6 @@ export enum PlatformType { Appletvos = 'apple-tvos', Android = 'android', Unity = 'unity', + Reactnativeios = 'react-native-ios', + Reactnativeandroid = 'react-native-android', } \ No newline at end of file From 4fa261f1e895bc3b411922b5041b987c9e8ffceb Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Mon, 26 Aug 2024 17:13:37 +0200 Subject: [PATCH 8/9] fix: url redirect --- src/client.ts | 21 ++-------- src/services/account.ts | 85 ++++++++++++++++++++++++++++++-------- src/services/assistant.ts | 2 + src/services/avatars.ts | 36 ++++++++++++++++ src/services/console.ts | 2 + src/services/databases.ts | 49 ++++++++++++++++++++++ src/services/functions.ts | 33 +++++++++++++++ src/services/graphql.ts | 3 ++ src/services/health.ts | 24 +++++++++++ src/services/locale.ts | 9 ++++ src/services/messaging.ts | 47 +++++++++++++++++++++ src/services/migrations.ts | 17 ++++++++ src/services/project.ts | 7 ++++ src/services/projects.ts | 46 +++++++++++++++++++++ src/services/proxy.ts | 6 +++ src/services/storage.ts | 28 +++++++++++++ src/services/teams.ts | 15 +++++++ src/services/users.ts | 44 ++++++++++++++++++++ src/services/vcs.ts | 11 +++++ 19 files changed, 449 insertions(+), 36 deletions(-) diff --git a/src/client.ts b/src/client.ts index b12c535..806c7a9 100644 --- a/src/client.ts +++ b/src/client.ts @@ -545,10 +545,10 @@ class Client { /** * Subscribes to Appwrite events and passes you the payload in realtime. - * - * @param {string|string[]} channels + * + * @param {string|string[]} channels * Channel to subscribe - pass a single channel as a string or multiple with an array of strings. - * + * * Possible channels are: * - account * - collections @@ -681,21 +681,6 @@ class Client { return response; } - async redirect(method: string, url: URL, headers: Headers = {}, params: Payload = {}): Promise { - const { uri, options } = this.prepareRequest(method, url, headers, params); - - const response = await fetch(uri, { - ...options, - redirect: 'manual' - }); - - if (response.status !== 301 && response.status !== 302) { - throw new AppwriteException('Invalid redirect', response.status); - } - - return response.headers.get('location') || ''; - } - async call(method: string, url: URL, headers: Headers = {}, params: Payload = {}, responseType = 'json'): Promise { const { uri, options } = this.prepareRequest(method, url, headers, params); diff --git a/src/services/account.ts b/src/services/account.ts index 4dc514b..291699b 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -1,3 +1,4 @@ +import { Service } from '../service'; import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; import { AuthenticatorType } from '../enums/authenticator-type'; @@ -28,6 +29,7 @@ export class Account { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -77,6 +79,7 @@ export class Account { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -101,6 +104,7 @@ export class Account { 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, @@ -141,6 +145,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -169,6 +174,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -197,6 +203,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, @@ -221,6 +228,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -249,6 +257,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -280,6 +289,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -308,6 +318,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -343,6 +354,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + return await this.client.call( 'put', uri, @@ -371,6 +383,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, @@ -402,6 +415,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -440,6 +454,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + return await this.client.call( 'put', uri, @@ -464,6 +479,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -488,6 +504,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -512,6 +529,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -536,6 +554,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -567,6 +586,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -602,6 +622,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -640,6 +661,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -664,6 +686,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -695,6 +718,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -733,6 +757,7 @@ This endpoint can also be used to convert an anonymous account to a normal one, 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -780,6 +805,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ 'content-type': 'application/json', } + return await this.client.call( 'put', uri, @@ -804,6 +830,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -828,6 +855,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, @@ -852,6 +880,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -892,6 +921,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -930,6 +960,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } + return await this.client.call( 'put', uri, @@ -975,16 +1006,17 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } - const location = await this.client.redirect( - 'get', - uri, - apiHeaders, - payload - ); - if (typeof window !== 'undefined') { - window.location.href = location; + payload['project'] = this.client.config.project; + for (const [key, value] of Object.entries(Service.flatten(payload))) { + uri.searchParams.append(key, value); + } + + if (typeof window !== 'undefined' && window?.location) { + window.location.href = uri.toString(); + return; + } else { + return uri.toString(); } - return location.toString(); } /** * Update phone session @@ -1017,6 +1049,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } + return await this.client.call( 'put', uri, @@ -1055,6 +1088,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -1083,6 +1117,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -1111,6 +1146,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -1139,6 +1175,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, @@ -1163,6 +1200,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -1204,6 +1242,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -1238,6 +1277,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } + return await this.client.call( 'put', uri, @@ -1265,6 +1305,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, @@ -1309,6 +1350,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -1358,6 +1400,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -1402,16 +1445,17 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } - const location = await this.client.redirect( - 'get', - uri, - apiHeaders, - payload - ); - if (typeof window !== 'undefined') { - window.location.href = location; + payload['project'] = this.client.config.project; + for (const [key, value] of Object.entries(Service.flatten(payload))) { + uri.searchParams.append(key, value); + } + + if (typeof window !== 'undefined' && window?.location) { + window.location.href = uri.toString(); + return; + } else { + return uri.toString(); } - return location.toString(); } /** * Create phone token @@ -1446,6 +1490,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -1480,6 +1525,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -1518,6 +1564,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ 'content-type': 'application/json', } + return await this.client.call( 'put', uri, @@ -1542,6 +1589,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -1580,6 +1628,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/ 'content-type': 'application/json', } + return await this.client.call( 'put', uri, diff --git a/src/services/assistant.ts b/src/services/assistant.ts index 610a008..4c3f0d0 100644 --- a/src/services/assistant.ts +++ b/src/services/assistant.ts @@ -1,3 +1,4 @@ +import { Service } from '../service'; import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; @@ -31,6 +32,7 @@ export class Assistant { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, diff --git a/src/services/avatars.ts b/src/services/avatars.ts index ab76ccb..21376ea 100644 --- a/src/services/avatars.ts +++ b/src/services/avatars.ts @@ -1,3 +1,4 @@ +import { Service } from '../service'; import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; import { Browser } from '../enums/browser'; @@ -46,6 +47,11 @@ When one dimension is specified and the other is 0, the image is scaled with pre 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + for (const [key, value] of Object.entries(Service.flatten(payload))) { + uri.searchParams.append(key, value); + } + payload['project'] = this.client.config.project; for (const [key, value] of Object.entries(Client.flatten(payload))) { @@ -90,6 +96,11 @@ When one dimension is specified and the other is 0, the image is scaled with pre 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + for (const [key, value] of Object.entries(Service.flatten(payload))) { + uri.searchParams.append(key, value); + } + payload['project'] = this.client.config.project; for (const [key, value] of Object.entries(Client.flatten(payload))) { @@ -124,6 +135,11 @@ This endpoint does not follow HTTP redirects. 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + for (const [key, value] of Object.entries(Service.flatten(payload))) { + uri.searchParams.append(key, value); + } + payload['project'] = this.client.config.project; for (const [key, value] of Object.entries(Client.flatten(payload))) { @@ -168,6 +184,11 @@ When one dimension is specified and the other is 0, the image is scaled with pre 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + for (const [key, value] of Object.entries(Service.flatten(payload))) { + uri.searchParams.append(key, value); + } + payload['project'] = this.client.config.project; for (const [key, value] of Object.entries(Client.flatten(payload))) { @@ -212,6 +233,11 @@ This endpoint does not follow HTTP redirects. 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + for (const [key, value] of Object.entries(Service.flatten(payload))) { + uri.searchParams.append(key, value); + } + payload['project'] = this.client.config.project; for (const [key, value] of Object.entries(Client.flatten(payload))) { @@ -258,6 +284,11 @@ When one dimension is specified and the other is 0, the image is scaled with pre 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + for (const [key, value] of Object.entries(Service.flatten(payload))) { + uri.searchParams.append(key, value); + } + payload['project'] = this.client.config.project; for (const [key, value] of Object.entries(Client.flatten(payload))) { @@ -303,6 +334,11 @@ When one dimension is specified and the other is 0, the image is scaled with pre 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + for (const [key, value] of Object.entries(Service.flatten(payload))) { + uri.searchParams.append(key, value); + } + payload['project'] = this.client.config.project; for (const [key, value] of Object.entries(Client.flatten(payload))) { diff --git a/src/services/console.ts b/src/services/console.ts index dddba0b..7749d18 100644 --- a/src/services/console.ts +++ b/src/services/console.ts @@ -1,3 +1,4 @@ +import { Service } from '../service'; import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; @@ -25,6 +26,7 @@ export class Console { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, diff --git a/src/services/databases.ts b/src/services/databases.ts index 2ce4821..5821e62 100644 --- a/src/services/databases.ts +++ b/src/services/databases.ts @@ -1,3 +1,4 @@ +import { Service } from '../service'; import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; import { DatabaseUsageRange } from '../enums/database-usage-range'; @@ -37,6 +38,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -80,6 +82,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -107,6 +110,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -135,6 +139,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -174,6 +179,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'put', uri, @@ -202,6 +208,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, @@ -238,6 +245,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -292,6 +300,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -324,6 +333,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -375,6 +385,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'put', uri, @@ -407,6 +418,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, @@ -443,6 +455,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -498,6 +511,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -548,6 +562,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -602,6 +617,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -652,6 +668,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -707,6 +724,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -758,6 +776,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -820,6 +839,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -878,6 +898,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -941,6 +962,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -1006,6 +1028,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -1069,6 +1092,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -1134,6 +1158,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -1189,6 +1214,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -1240,6 +1266,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -1303,6 +1330,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -1369,6 +1397,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -1420,6 +1449,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -1475,6 +1505,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -1526,6 +1557,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -1562,6 +1594,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -1598,6 +1631,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, @@ -1639,6 +1673,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -1675,6 +1710,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -1725,6 +1761,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -1765,6 +1802,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -1809,6 +1847,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -1845,6 +1884,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, @@ -1885,6 +1925,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -1921,6 +1962,7 @@ export class Databases { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -1979,6 +2021,7 @@ Attributes can be `key`, `fulltext`, and `unique`. 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -2015,6 +2058,7 @@ Attributes can be `key`, `fulltext`, and `unique`. 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -2051,6 +2095,7 @@ Attributes can be `key`, `fulltext`, and `unique`. 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, @@ -2087,6 +2132,7 @@ Attributes can be `key`, `fulltext`, and `unique`. 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -2122,6 +2168,7 @@ Attributes can be `key`, `fulltext`, and `unique`. 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -2154,6 +2201,7 @@ Attributes can be `key`, `fulltext`, and `unique`. 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -2185,6 +2233,7 @@ Attributes can be `key`, `fulltext`, and `unique`. 'content-type': 'application/json', } + return await this.client.call( 'get', uri, diff --git a/src/services/functions.ts b/src/services/functions.ts index 12eac72..5bce133 100644 --- a/src/services/functions.ts +++ b/src/services/functions.ts @@ -1,3 +1,4 @@ +import { Service } from '../service'; import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; import { Runtime } from '../enums/runtime'; @@ -36,6 +37,7 @@ export class Functions { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -157,6 +159,7 @@ export class Functions { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -181,6 +184,7 @@ export class Functions { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -206,6 +210,7 @@ export class Functions { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -246,6 +251,7 @@ export class Functions { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -274,6 +280,7 @@ export class Functions { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -301,6 +308,7 @@ export class Functions { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -329,6 +337,7 @@ export class Functions { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -428,6 +437,7 @@ export class Functions { 'content-type': 'application/json', } + return await this.client.call( 'put', uri, @@ -456,6 +466,7 @@ export class Functions { 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, @@ -492,6 +503,7 @@ export class Functions { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -546,6 +558,7 @@ Use the "command" param to set the entrypoint used to execute your cod 'content-type': 'multipart/form-data', } + return await this.client.chunkedUpload( 'post', uri, @@ -579,6 +592,7 @@ Use the "command" param to set the entrypoint used to execute your cod 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -611,6 +625,7 @@ Use the "command" param to set the entrypoint used to execute your cod 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -643,6 +658,7 @@ Use the "command" param to set the entrypoint used to execute your cod 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, @@ -678,6 +694,7 @@ Use the "command" param to set the entrypoint used to execute your cod 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -709,6 +726,7 @@ Use the "command" param to set the entrypoint used to execute your cod 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -741,6 +759,11 @@ Use the "command" param to set the entrypoint used to execute your cod 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + for (const [key, value] of Object.entries(Service.flatten(payload))) { + uri.searchParams.append(key, value); + } + payload['project'] = this.client.config.project; for (const [key, value] of Object.entries(Client.flatten(payload))) { @@ -778,6 +801,7 @@ Use the "command" param to set the entrypoint used to execute your cod 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -830,6 +854,7 @@ Use the "command" param to set the entrypoint used to execute your cod 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -862,6 +887,7 @@ Use the "command" param to set the entrypoint used to execute your cod 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -895,6 +921,7 @@ Use the "command" param to set the entrypoint used to execute your cod 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, @@ -926,6 +953,7 @@ Use the "command" param to set the entrypoint used to execute your cod 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -954,6 +982,7 @@ Use the "command" param to set the entrypoint used to execute your cod 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -996,6 +1025,7 @@ Use the "command" param to set the entrypoint used to execute your cod 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -1028,6 +1058,7 @@ Use the "command" param to set the entrypoint used to execute your cod 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -1071,6 +1102,7 @@ Use the "command" param to set the entrypoint used to execute your cod 'content-type': 'application/json', } + return await this.client.call( 'put', uri, @@ -1103,6 +1135,7 @@ Use the "command" param to set the entrypoint used to execute your cod 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, diff --git a/src/services/graphql.ts b/src/services/graphql.ts index b68e7b5..e8b27ec 100644 --- a/src/services/graphql.ts +++ b/src/services/graphql.ts @@ -1,3 +1,4 @@ +import { Service } from '../service'; import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; @@ -33,6 +34,7 @@ export class Graphql { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -65,6 +67,7 @@ export class Graphql { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, diff --git a/src/services/health.ts b/src/services/health.ts index 446b687..ec7e6fc 100644 --- a/src/services/health.ts +++ b/src/services/health.ts @@ -1,3 +1,4 @@ +import { Service } from '../service'; import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; import { Name } from '../enums/name'; @@ -26,6 +27,7 @@ export class Health { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -50,6 +52,7 @@ export class Health { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -74,6 +77,7 @@ export class Health { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -102,6 +106,7 @@ export class Health { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -126,6 +131,7 @@ export class Health { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -150,6 +156,7 @@ export class Health { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -174,6 +181,7 @@ export class Health { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -202,6 +210,7 @@ export class Health { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -230,6 +239,7 @@ export class Health { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -262,6 +272,7 @@ export class Health { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -290,6 +301,7 @@ export class Health { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -323,6 +335,7 @@ export class Health { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -351,6 +364,7 @@ export class Health { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -379,6 +393,7 @@ export class Health { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -407,6 +422,7 @@ export class Health { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -435,6 +451,7 @@ export class Health { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -463,6 +480,7 @@ export class Health { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -491,6 +509,7 @@ export class Health { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -519,6 +538,7 @@ export class Health { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -547,6 +567,7 @@ export class Health { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -571,6 +592,7 @@ export class Health { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -595,6 +617,7 @@ export class Health { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -619,6 +642,7 @@ export class Health { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, diff --git a/src/services/locale.ts b/src/services/locale.ts index d1c94b7..5439c13 100644 --- a/src/services/locale.ts +++ b/src/services/locale.ts @@ -1,3 +1,4 @@ +import { Service } from '../service'; import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; @@ -27,6 +28,7 @@ export class Locale { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -51,6 +53,7 @@ export class Locale { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -75,6 +78,7 @@ export class Locale { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -99,6 +103,7 @@ export class Locale { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -123,6 +128,7 @@ export class Locale { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -147,6 +153,7 @@ export class Locale { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -171,6 +178,7 @@ export class Locale { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -195,6 +203,7 @@ export class Locale { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, diff --git a/src/services/messaging.ts b/src/services/messaging.ts index 560e30c..d40f8e5 100644 --- a/src/services/messaging.ts +++ b/src/services/messaging.ts @@ -1,3 +1,4 @@ +import { Service } from '../service'; import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; import { SmtpEncryption } from '../enums/smtp-encryption'; @@ -34,6 +35,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -115,6 +117,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -188,6 +191,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -285,6 +289,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -374,6 +379,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -432,6 +438,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -485,6 +492,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -514,6 +522,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -542,6 +551,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, @@ -574,6 +584,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -606,6 +617,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -638,6 +650,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -700,6 +713,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -756,6 +770,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -802,6 +817,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -842,6 +858,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -912,6 +929,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -976,6 +994,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -1030,6 +1049,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -1078,6 +1098,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -1140,6 +1161,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -1196,6 +1218,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -1285,6 +1308,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -1365,6 +1389,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -1419,6 +1444,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -1467,6 +1493,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -1521,6 +1548,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -1569,6 +1597,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -1623,6 +1652,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -1671,6 +1701,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -1725,6 +1756,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -1773,6 +1805,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -1802,6 +1835,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -1830,6 +1864,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, @@ -1862,6 +1897,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -1894,6 +1930,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -1926,6 +1963,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -1968,6 +2006,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -1997,6 +2036,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -2034,6 +2074,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -2062,6 +2103,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, @@ -2094,6 +2136,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -2130,6 +2173,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -2172,6 +2216,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -2205,6 +2250,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -2237,6 +2283,7 @@ export class Messaging { 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, diff --git a/src/services/migrations.ts b/src/services/migrations.ts index 248f350..5a8619c 100644 --- a/src/services/migrations.ts +++ b/src/services/migrations.ts @@ -1,3 +1,4 @@ +import { Service } from '../service'; import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; @@ -32,6 +33,7 @@ export class Migrations { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -83,6 +85,7 @@ export class Migrations { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -134,6 +137,7 @@ export class Migrations { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -171,6 +175,7 @@ export class Migrations { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -194,6 +199,7 @@ export class Migrations { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -231,6 +237,7 @@ export class Migrations { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -254,6 +261,7 @@ export class Migrations { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -291,6 +299,7 @@ export class Migrations { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -328,6 +337,7 @@ export class Migrations { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -404,6 +414,7 @@ export class Migrations { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -480,6 +491,7 @@ export class Migrations { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -549,6 +561,7 @@ export class Migrations { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -618,6 +631,7 @@ export class Migrations { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -645,6 +659,7 @@ export class Migrations { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -672,6 +687,7 @@ export class Migrations { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -699,6 +715,7 @@ export class Migrations { 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, diff --git a/src/services/project.ts b/src/services/project.ts index 757da9c..fc48774 100644 --- a/src/services/project.ts +++ b/src/services/project.ts @@ -1,3 +1,4 @@ +import { Service } from '../service'; import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; import { ProjectUsageRange } from '../enums/project-usage-range'; @@ -43,6 +44,7 @@ export class Project { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -67,6 +69,7 @@ export class Project { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -105,6 +108,7 @@ export class Project { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -133,6 +137,7 @@ export class Project { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -172,6 +177,7 @@ export class Project { 'content-type': 'application/json', } + return await this.client.call( 'put', uri, @@ -200,6 +206,7 @@ export class Project { 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, diff --git a/src/services/projects.ts b/src/services/projects.ts index 4aa5ba7..c1de5a4 100644 --- a/src/services/projects.ts +++ b/src/services/projects.ts @@ -1,3 +1,4 @@ +import { Service } from '../service'; import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; import { Region } from '../enums/region'; @@ -43,6 +44,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -127,6 +129,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -154,6 +157,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -224,6 +228,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -251,6 +256,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, @@ -292,6 +298,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -326,6 +333,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -360,6 +368,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -394,6 +403,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -428,6 +438,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -462,6 +473,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -496,6 +508,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -530,6 +543,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -564,6 +578,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -598,6 +613,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -636,6 +652,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -674,6 +691,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -701,6 +719,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -746,6 +765,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -777,6 +797,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -826,6 +847,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'put', uri, @@ -857,6 +879,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, @@ -903,6 +926,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -930,6 +954,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -983,6 +1008,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -1014,6 +1040,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -1064,6 +1091,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'put', uri, @@ -1095,6 +1123,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, @@ -1136,6 +1165,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -1170,6 +1200,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -1236,6 +1267,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -1311,6 +1343,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -1345,6 +1378,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -1380,6 +1414,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -1441,6 +1476,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -1476,6 +1512,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, @@ -1511,6 +1548,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -1553,6 +1591,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -1588,6 +1627,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, @@ -1615,6 +1655,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -1682,6 +1723,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -1713,6 +1755,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -1784,6 +1827,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'put', uri, @@ -1815,6 +1859,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, @@ -1846,6 +1891,7 @@ export class Projects { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, diff --git a/src/services/proxy.ts b/src/services/proxy.ts index 68de40e..3269946 100644 --- a/src/services/proxy.ts +++ b/src/services/proxy.ts @@ -1,3 +1,4 @@ +import { Service } from '../service'; import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; import { ResourceType } from '../enums/resource-type'; @@ -34,6 +35,7 @@ export class Proxy { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -76,6 +78,7 @@ export class Proxy { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -104,6 +107,7 @@ export class Proxy { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -132,6 +136,7 @@ export class Proxy { 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, @@ -159,6 +164,7 @@ export class Proxy { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, diff --git a/src/services/storage.ts b/src/services/storage.ts index 5355d96..842b8f4 100644 --- a/src/services/storage.ts +++ b/src/services/storage.ts @@ -1,3 +1,4 @@ +import { Service } from '../service'; import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; import { Compression } from '../enums/compression'; @@ -37,6 +38,7 @@ export class Storage { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -107,6 +109,7 @@ export class Storage { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -135,6 +138,7 @@ export class Storage { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -202,6 +206,7 @@ export class Storage { 'content-type': 'application/json', } + return await this.client.call( 'put', uri, @@ -230,6 +235,7 @@ export class Storage { 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, @@ -266,6 +272,7 @@ export class Storage { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -319,6 +326,7 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk 'content-type': 'multipart/form-data', } + return await this.client.chunkedUpload( 'post', uri, @@ -352,6 +360,7 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -392,6 +401,7 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk 'content-type': 'application/json', } + return await this.client.call( 'put', uri, @@ -424,6 +434,7 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, @@ -456,6 +467,11 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + for (const [key, value] of Object.entries(Service.flatten(payload))) { + uri.searchParams.append(key, value); + } + payload['project'] = this.client.config.project; for (const [key, value] of Object.entries(Client.flatten(payload))) { @@ -533,6 +549,11 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + for (const [key, value] of Object.entries(Service.flatten(payload))) { + uri.searchParams.append(key, value); + } + payload['project'] = this.client.config.project; for (const [key, value] of Object.entries(Client.flatten(payload))) { @@ -566,6 +587,11 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk 'content-type': 'application/json', } + payload['project'] = this.client.config.project; + for (const [key, value] of Object.entries(Service.flatten(payload))) { + uri.searchParams.append(key, value); + } + payload['project'] = this.client.config.project; for (const [key, value] of Object.entries(Client.flatten(payload))) { @@ -594,6 +620,7 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -625,6 +652,7 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk 'content-type': 'application/json', } + return await this.client.call( 'get', uri, diff --git a/src/services/teams.ts b/src/services/teams.ts index 8982c25..91a6db7 100644 --- a/src/services/teams.ts +++ b/src/services/teams.ts @@ -1,3 +1,4 @@ +import { Service } from '../service'; import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; @@ -33,6 +34,7 @@ export class Teams { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -75,6 +77,7 @@ export class Teams { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -103,6 +106,7 @@ export class Teams { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -138,6 +142,7 @@ export class Teams { 'content-type': 'application/json', } + return await this.client.call( 'put', uri, @@ -166,6 +171,7 @@ export class Teams { 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, @@ -198,6 +204,7 @@ export class Teams { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -234,6 +241,7 @@ export class Teams { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -296,6 +304,7 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -328,6 +337,7 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -368,6 +378,7 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -400,6 +411,7 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, @@ -449,6 +461,7 @@ If the request is successful, a session for the user is automatically created. 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -477,6 +490,7 @@ If the request is successful, a session for the user is automatically created. 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -512,6 +526,7 @@ If the request is successful, a session for the user is automatically created. 'content-type': 'application/json', } + return await this.client.call( 'put', uri, diff --git a/src/services/users.ts b/src/services/users.ts index 9af4e6e..9b9355d 100644 --- a/src/services/users.ts +++ b/src/services/users.ts @@ -1,3 +1,4 @@ +import { Service } from '../service'; import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; import { PasswordHash } from '../enums/password-hash'; @@ -37,6 +38,7 @@ export class Users { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -84,6 +86,7 @@ export class Users { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -133,6 +136,7 @@ export class Users { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -182,6 +186,7 @@ export class Users { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -214,6 +219,7 @@ export class Users { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -242,6 +248,7 @@ export class Users { 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, @@ -291,6 +298,7 @@ export class Users { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -340,6 +348,7 @@ export class Users { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -424,6 +433,7 @@ export class Users { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -494,6 +504,7 @@ export class Users { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -547,6 +558,7 @@ export class Users { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -574,6 +586,7 @@ export class Users { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -602,6 +615,7 @@ export class Users { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -630,6 +644,7 @@ export class Users { 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, @@ -665,6 +680,7 @@ export class Users { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -701,6 +717,7 @@ export class Users { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -738,6 +755,7 @@ Labels can be used to grant access to resources. While teams are a way for user& 'content-type': 'application/json', } + return await this.client.call( 'put', uri, @@ -770,6 +788,7 @@ Labels can be used to grant access to resources. While teams are a way for user& 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -798,6 +817,7 @@ Labels can be used to grant access to resources. While teams are a way for user& 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -833,6 +853,7 @@ Labels can be used to grant access to resources. While teams are a way for user& 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -865,6 +886,7 @@ Labels can be used to grant access to resources. While teams are a way for user& 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, @@ -893,6 +915,7 @@ Labels can be used to grant access to resources. While teams are a way for user& 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -921,6 +944,7 @@ Labels can be used to grant access to resources. While teams are a way for user& 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -949,6 +973,7 @@ Labels can be used to grant access to resources. While teams are a way for user& 'content-type': 'application/json', } + return await this.client.call( 'put', uri, @@ -977,6 +1002,7 @@ Labels can be used to grant access to resources. While teams are a way for user& 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -1012,6 +1038,7 @@ Labels can be used to grant access to resources. While teams are a way for user& 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -1047,6 +1074,7 @@ Labels can be used to grant access to resources. While teams are a way for user& 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -1082,6 +1110,7 @@ Labels can be used to grant access to resources. While teams are a way for user& 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -1110,6 +1139,7 @@ Labels can be used to grant access to resources. While teams are a way for user& 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -1145,6 +1175,7 @@ Labels can be used to grant access to resources. While teams are a way for user& 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -1173,6 +1204,7 @@ Labels can be used to grant access to resources. While teams are a way for user& 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -1203,6 +1235,7 @@ If you want to generate a token for a custom authentication flow, use the [POST 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -1231,6 +1264,7 @@ If you want to generate a token for a custom authentication flow, use the [POST 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, @@ -1263,6 +1297,7 @@ If you want to generate a token for a custom authentication flow, use the [POST 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, @@ -1298,6 +1333,7 @@ If you want to generate a token for a custom authentication flow, use the [POST 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -1330,6 +1366,7 @@ If you want to generate a token for a custom authentication flow, use the [POST 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -1387,6 +1424,7 @@ If you want to generate a token for a custom authentication flow, use the [POST 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -1419,6 +1457,7 @@ If you want to generate a token for a custom authentication flow, use the [POST 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -1463,6 +1502,7 @@ If you want to generate a token for a custom authentication flow, use the [POST 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -1495,6 +1535,7 @@ If you want to generate a token for a custom authentication flow, use the [POST 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, @@ -1532,6 +1573,7 @@ If you want to generate a token for a custom authentication flow, use the [POST 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -1567,6 +1609,7 @@ If you want to generate a token for a custom authentication flow, use the [POST 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -1602,6 +1645,7 @@ If you want to generate a token for a custom authentication flow, use the [POST 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, diff --git a/src/services/vcs.ts b/src/services/vcs.ts index e3fc179..e871f25 100644 --- a/src/services/vcs.ts +++ b/src/services/vcs.ts @@ -1,3 +1,4 @@ +import { Service } from '../service'; import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; @@ -32,6 +33,7 @@ export class Vcs { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -73,6 +75,7 @@ export class Vcs { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -104,6 +107,7 @@ export class Vcs { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -135,6 +139,7 @@ export class Vcs { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -170,6 +175,7 @@ export class Vcs { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -205,6 +211,7 @@ export class Vcs { 'content-type': 'application/json', } + return await this.client.call( 'post', uri, @@ -243,6 +250,7 @@ export class Vcs { 'content-type': 'application/json', } + return await this.client.call( 'patch', uri, @@ -274,6 +282,7 @@ export class Vcs { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -301,6 +310,7 @@ export class Vcs { 'content-type': 'application/json', } + return await this.client.call( 'get', uri, @@ -328,6 +338,7 @@ export class Vcs { 'content-type': 'application/json', } + return await this.client.call( 'delete', uri, From 6b91740b2d190bb62df6936027e06c6b22751a4a Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Mon, 26 Aug 2024 17:14:07 +0200 Subject: [PATCH 9/9] chore: bump version --- README.md | 2 +- package.json | 2 +- src/client.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 534aa79..0eb1a20 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ import { Client, Account } from "@appwrite.io/console"; To install with a CDN (content delivery network) add the following scripts to the bottom of your tag, but before you use any Appwrite services: ```html - + ``` diff --git a/package.json b/package.json index 6adfc5b..a2c02e6 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@appwrite.io/console", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API", - "version": "1.0.0", + "version": "1.0.1", "license": "BSD-3-Clause", "main": "dist/cjs/sdk.js", "exports": { diff --git a/src/client.ts b/src/client.ts index 806c7a9..ed21bc2 100644 --- a/src/client.ts +++ b/src/client.ts @@ -304,7 +304,7 @@ class Client { 'x-sdk-name': 'Console', 'x-sdk-platform': 'console', 'x-sdk-language': 'web', - 'x-sdk-version': '1.0.0', + 'x-sdk-version': '1.0.1', 'X-Appwrite-Response-Format': '1.6.0', };