From c863c4235eb7a504c100db16b58bc6f65d742d87 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 8 May 2025 23:26:07 +1200 Subject: [PATCH 1/4] Add bulk API methods --- .../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-o-auth2token.md | 2 +- docs/examples/account/create-phone-token.md | 2 +- .../account/create-phone-verification.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-session.md | 2 +- docs/examples/account/delete-sessions.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-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/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 +- .../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 +- docs/examples/databases/create-documents.md | 14 ++ .../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-documents.md | 14 ++ docs/examples/databases/delete-index.md | 2 +- docs/examples/databases/delete.md | 2 +- docs/examples/databases/get-attribute.md | 2 +- docs/examples/databases/get-collection.md | 2 +- docs/examples/databases/get-document.md | 2 +- docs/examples/databases/get-index.md | 2 +- docs/examples/databases/get.md | 2 +- docs/examples/databases/list-attributes.md | 2 +- docs/examples/databases/list-collections.md | 2 +- docs/examples/databases/list-documents.md | 2 +- docs/examples/databases/list-indexes.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 +- docs/examples/databases/update-documents.md | 15 ++ .../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/databases/upsert-documents.md | 14 ++ 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 | 2 +- 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-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 | 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 | 2 +- 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 +- .../health/get-queue-stats-resources.md | 2 +- docs/examples/health/get-queue-usage.md | 2 +- docs/examples/health/get-queue-webhooks.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 +- 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.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/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-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.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 +- package.json | 2 +- src/client.ts | 4 +- src/services/databases.ts | 146 +++++++++++++++++- 269 files changed, 467 insertions(+), 266 deletions(-) create mode 100644 docs/examples/databases/create-documents.md create mode 100644 docs/examples/databases/delete-documents.md create mode 100644 docs/examples/databases/update-documents.md create mode 100644 docs/examples/databases/upsert-documents.md diff --git a/docs/examples/account/create-anonymous-session.md b/docs/examples/account/create-anonymous-session.md index 90a91614..d8590b03 100644 --- a/docs/examples/account/create-anonymous-session.md +++ b/docs/examples/account/create-anonymous-session.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject(''); // Your project ID const account = new sdk.Account(client); diff --git a/docs/examples/account/create-email-password-session.md b/docs/examples/account/create-email-password-session.md index 34aabdda..6c940f54 100644 --- a/docs/examples/account/create-email-password-session.md +++ b/docs/examples/account/create-email-password-session.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject(''); // Your project ID const account = new sdk.Account(client); diff --git a/docs/examples/account/create-email-token.md b/docs/examples/account/create-email-token.md index 0f218a2b..b6be71d4 100644 --- a/docs/examples/account/create-email-token.md +++ b/docs/examples/account/create-email-token.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject(''); // Your project ID const account = new sdk.Account(client); diff --git a/docs/examples/account/create-j-w-t.md b/docs/examples/account/create-j-w-t.md index 673e1e07..22736466 100644 --- a/docs/examples/account/create-j-w-t.md +++ b/docs/examples/account/create-j-w-t.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject(''); // Your project ID const account = new sdk.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 cb6ef367..6dbdc3d9 100644 --- a/docs/examples/account/create-magic-u-r-l-token.md +++ b/docs/examples/account/create-magic-u-r-l-token.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject(''); // Your project ID const account = new sdk.Account(client); diff --git a/docs/examples/account/create-mfa-authenticator.md b/docs/examples/account/create-mfa-authenticator.md index 0305e029..e52658b5 100644 --- a/docs/examples/account/create-mfa-authenticator.md +++ b/docs/examples/account/create-mfa-authenticator.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/create-mfa-challenge.md b/docs/examples/account/create-mfa-challenge.md index 301d83d0..79d5e89e 100644 --- a/docs/examples/account/create-mfa-challenge.md +++ b/docs/examples/account/create-mfa-challenge.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject(''); // Your project ID const account = new sdk.Account(client); diff --git a/docs/examples/account/create-mfa-recovery-codes.md b/docs/examples/account/create-mfa-recovery-codes.md index c653ae55..42b3c8c6 100644 --- a/docs/examples/account/create-mfa-recovery-codes.md +++ b/docs/examples/account/create-mfa-recovery-codes.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/create-o-auth2token.md b/docs/examples/account/create-o-auth2token.md index 7538a9d0..adae0951 100644 --- a/docs/examples/account/create-o-auth2token.md +++ b/docs/examples/account/create-o-auth2token.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject(''); // Your project ID const account = new sdk.Account(client); diff --git a/docs/examples/account/create-phone-token.md b/docs/examples/account/create-phone-token.md index 04d5bc08..aca0bd2d 100644 --- a/docs/examples/account/create-phone-token.md +++ b/docs/examples/account/create-phone-token.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject(''); // Your project ID const account = new sdk.Account(client); diff --git a/docs/examples/account/create-phone-verification.md b/docs/examples/account/create-phone-verification.md index 15dcf8a1..f7c87f06 100644 --- a/docs/examples/account/create-phone-verification.md +++ b/docs/examples/account/create-phone-verification.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/create-recovery.md b/docs/examples/account/create-recovery.md index ed83848e..660942af 100644 --- a/docs/examples/account/create-recovery.md +++ b/docs/examples/account/create-recovery.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/create-session.md b/docs/examples/account/create-session.md index 8b2751b1..8c6b9100 100644 --- a/docs/examples/account/create-session.md +++ b/docs/examples/account/create-session.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject(''); // Your project ID const account = new sdk.Account(client); diff --git a/docs/examples/account/create-verification.md b/docs/examples/account/create-verification.md index 14456ef6..1f1db27e 100644 --- a/docs/examples/account/create-verification.md +++ b/docs/examples/account/create-verification.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md index 860e341a..85e3d2fc 100644 --- a/docs/examples/account/create.md +++ b/docs/examples/account/create.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject(''); // Your project ID const account = new sdk.Account(client); diff --git a/docs/examples/account/delete-identity.md b/docs/examples/account/delete-identity.md index 07113346..0424ab24 100644 --- a/docs/examples/account/delete-identity.md +++ b/docs/examples/account/delete-identity.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/delete-mfa-authenticator.md b/docs/examples/account/delete-mfa-authenticator.md index 1cf8154a..5979c3a6 100644 --- a/docs/examples/account/delete-mfa-authenticator.md +++ b/docs/examples/account/delete-mfa-authenticator.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/delete-session.md b/docs/examples/account/delete-session.md index d29810f2..4276ccad 100644 --- a/docs/examples/account/delete-session.md +++ b/docs/examples/account/delete-session.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/delete-sessions.md b/docs/examples/account/delete-sessions.md index 496bd4a5..884c0e0e 100644 --- a/docs/examples/account/delete-sessions.md +++ b/docs/examples/account/delete-sessions.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/get-mfa-recovery-codes.md b/docs/examples/account/get-mfa-recovery-codes.md index 2bada1ba..27f90242 100644 --- a/docs/examples/account/get-mfa-recovery-codes.md +++ b/docs/examples/account/get-mfa-recovery-codes.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/get-prefs.md b/docs/examples/account/get-prefs.md index 9ed003c6..d0d7d31a 100644 --- a/docs/examples/account/get-prefs.md +++ b/docs/examples/account/get-prefs.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/get-session.md b/docs/examples/account/get-session.md index aeaaa149..63b6f089 100644 --- a/docs/examples/account/get-session.md +++ b/docs/examples/account/get-session.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/get.md b/docs/examples/account/get.md index b1fc61f1..6ebb605a 100644 --- a/docs/examples/account/get.md +++ b/docs/examples/account/get.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/list-identities.md b/docs/examples/account/list-identities.md index 642034d7..c49894c8 100644 --- a/docs/examples/account/list-identities.md +++ b/docs/examples/account/list-identities.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/list-logs.md b/docs/examples/account/list-logs.md index 08dcf812..4260a72e 100644 --- a/docs/examples/account/list-logs.md +++ b/docs/examples/account/list-logs.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/list-mfa-factors.md b/docs/examples/account/list-mfa-factors.md index e2c9683e..a993e31a 100644 --- a/docs/examples/account/list-mfa-factors.md +++ b/docs/examples/account/list-mfa-factors.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/list-sessions.md b/docs/examples/account/list-sessions.md index a8b423f9..33fb5274 100644 --- a/docs/examples/account/list-sessions.md +++ b/docs/examples/account/list-sessions.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-email.md b/docs/examples/account/update-email.md index 4c0c6c23..6111f0e5 100644 --- a/docs/examples/account/update-email.md +++ b/docs/examples/account/update-email.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-m-f-a.md b/docs/examples/account/update-m-f-a.md index 30c36230..58629cda 100644 --- a/docs/examples/account/update-m-f-a.md +++ b/docs/examples/account/update-m-f-a.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with 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 56d2b02f..3e059d88 100644 --- a/docs/examples/account/update-magic-u-r-l-session.md +++ b/docs/examples/account/update-magic-u-r-l-session.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject(''); // Your project ID const account = new sdk.Account(client); diff --git a/docs/examples/account/update-mfa-authenticator.md b/docs/examples/account/update-mfa-authenticator.md index c8f1773d..7b24dc87 100644 --- a/docs/examples/account/update-mfa-authenticator.md +++ b/docs/examples/account/update-mfa-authenticator.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-mfa-challenge.md b/docs/examples/account/update-mfa-challenge.md index bdb1a538..4d309991 100644 --- a/docs/examples/account/update-mfa-challenge.md +++ b/docs/examples/account/update-mfa-challenge.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-mfa-recovery-codes.md b/docs/examples/account/update-mfa-recovery-codes.md index 16a3d3cc..9db82175 100644 --- a/docs/examples/account/update-mfa-recovery-codes.md +++ b/docs/examples/account/update-mfa-recovery-codes.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-name.md b/docs/examples/account/update-name.md index df510029..f47d2152 100644 --- a/docs/examples/account/update-name.md +++ b/docs/examples/account/update-name.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-password.md b/docs/examples/account/update-password.md index 76021bcb..aa9d67ae 100644 --- a/docs/examples/account/update-password.md +++ b/docs/examples/account/update-password.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-phone-session.md b/docs/examples/account/update-phone-session.md index 40fccba9..c208714a 100644 --- a/docs/examples/account/update-phone-session.md +++ b/docs/examples/account/update-phone-session.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject(''); // Your project ID const account = new sdk.Account(client); diff --git a/docs/examples/account/update-phone-verification.md b/docs/examples/account/update-phone-verification.md index 93f35a8d..116d171c 100644 --- a/docs/examples/account/update-phone-verification.md +++ b/docs/examples/account/update-phone-verification.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-phone.md b/docs/examples/account/update-phone.md index 11982b7c..c6c02fde 100644 --- a/docs/examples/account/update-phone.md +++ b/docs/examples/account/update-phone.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-prefs.md b/docs/examples/account/update-prefs.md index 6f270035..ee8b0426 100644 --- a/docs/examples/account/update-prefs.md +++ b/docs/examples/account/update-prefs.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-recovery.md b/docs/examples/account/update-recovery.md index 09bfc64d..bd4a87c3 100644 --- a/docs/examples/account/update-recovery.md +++ b/docs/examples/account/update-recovery.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-session.md b/docs/examples/account/update-session.md index 64ec68eb..be80c857 100644 --- a/docs/examples/account/update-session.md +++ b/docs/examples/account/update-session.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-status.md b/docs/examples/account/update-status.md index cf65e828..1b70af53 100644 --- a/docs/examples/account/update-status.md +++ b/docs/examples/account/update-status.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/account/update-verification.md b/docs/examples/account/update-verification.md index cc3678ec..0abb562a 100644 --- a/docs/examples/account/update-verification.md +++ b/docs/examples/account/update-verification.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/avatars/get-browser.md b/docs/examples/avatars/get-browser.md index ad6d0d4b..3bcd70d0 100644 --- a/docs/examples/avatars/get-browser.md +++ b/docs/examples/avatars/get-browser.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/avatars/get-credit-card.md b/docs/examples/avatars/get-credit-card.md index 5ffcc344..a60c2da8 100644 --- a/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/avatars/get-credit-card.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/avatars/get-favicon.md b/docs/examples/avatars/get-favicon.md index 09804035..6056354e 100644 --- a/docs/examples/avatars/get-favicon.md +++ b/docs/examples/avatars/get-favicon.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/avatars/get-flag.md b/docs/examples/avatars/get-flag.md index 53b912f5..df0164d2 100644 --- a/docs/examples/avatars/get-flag.md +++ b/docs/examples/avatars/get-flag.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/avatars/get-image.md b/docs/examples/avatars/get-image.md index 5a72fe3b..7dac2423 100644 --- a/docs/examples/avatars/get-image.md +++ b/docs/examples/avatars/get-image.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/avatars/get-initials.md b/docs/examples/avatars/get-initials.md index b9d41fc2..2cd45bfa 100644 --- a/docs/examples/avatars/get-initials.md +++ b/docs/examples/avatars/get-initials.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/avatars/get-q-r.md b/docs/examples/avatars/get-q-r.md index 0a272356..cfd649ea 100644 --- a/docs/examples/avatars/get-q-r.md +++ b/docs/examples/avatars/get-q-r.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/databases/create-boolean-attribute.md b/docs/examples/databases/create-boolean-attribute.md index 7a04ed02..b6239698 100644 --- a/docs/examples/databases/create-boolean-attribute.md +++ b/docs/examples/databases/create-boolean-attribute.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/create-collection.md b/docs/examples/databases/create-collection.md index 7119a4e5..fc5c7983 100644 --- a/docs/examples/databases/create-collection.md +++ b/docs/examples/databases/create-collection.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/create-datetime-attribute.md b/docs/examples/databases/create-datetime-attribute.md index ba40de8b..4c7328ce 100644 --- a/docs/examples/databases/create-datetime-attribute.md +++ b/docs/examples/databases/create-datetime-attribute.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index 3e1c7694..a2e77b92 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/databases/create-documents.md b/docs/examples/databases/create-documents.md new file mode 100644 index 00000000..cc8fd01a --- /dev/null +++ b/docs/examples/databases/create-documents.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with + +const databases = new sdk.Databases(client); + +const result = await databases.createDocuments( + '', // databaseId + '', // collectionId + [] // documents +); diff --git a/docs/examples/databases/create-email-attribute.md b/docs/examples/databases/create-email-attribute.md index 6f2da81f..47b27508 100644 --- a/docs/examples/databases/create-email-attribute.md +++ b/docs/examples/databases/create-email-attribute.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/create-enum-attribute.md b/docs/examples/databases/create-enum-attribute.md index 9439f8f5..61c1d77f 100644 --- a/docs/examples/databases/create-enum-attribute.md +++ b/docs/examples/databases/create-enum-attribute.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/create-float-attribute.md b/docs/examples/databases/create-float-attribute.md index 7ed62239..3e605001 100644 --- a/docs/examples/databases/create-float-attribute.md +++ b/docs/examples/databases/create-float-attribute.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/create-index.md b/docs/examples/databases/create-index.md index 73cdf391..bd616222 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/create-integer-attribute.md b/docs/examples/databases/create-integer-attribute.md index 479b9d87..ce626240 100644 --- a/docs/examples/databases/create-integer-attribute.md +++ b/docs/examples/databases/create-integer-attribute.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/create-ip-attribute.md b/docs/examples/databases/create-ip-attribute.md index c88087f9..e3bbffe2 100644 --- a/docs/examples/databases/create-ip-attribute.md +++ b/docs/examples/databases/create-ip-attribute.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/create-relationship-attribute.md b/docs/examples/databases/create-relationship-attribute.md index 7be4bae6..bb77bc00 100644 --- a/docs/examples/databases/create-relationship-attribute.md +++ b/docs/examples/databases/create-relationship-attribute.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/create-string-attribute.md b/docs/examples/databases/create-string-attribute.md index 03905f4e..94793e86 100644 --- a/docs/examples/databases/create-string-attribute.md +++ b/docs/examples/databases/create-string-attribute.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/create-url-attribute.md b/docs/examples/databases/create-url-attribute.md index 741249bb..6b6b1daa 100644 --- a/docs/examples/databases/create-url-attribute.md +++ b/docs/examples/databases/create-url-attribute.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/create.md b/docs/examples/databases/create.md index 792bbf1c..c1fd4eca 100644 --- a/docs/examples/databases/create.md +++ b/docs/examples/databases/create.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/delete-attribute.md b/docs/examples/databases/delete-attribute.md index b8b2d47a..8291fc09 100644 --- a/docs/examples/databases/delete-attribute.md +++ b/docs/examples/databases/delete-attribute.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/delete-collection.md b/docs/examples/databases/delete-collection.md index bb72b9eb..9551c558 100644 --- a/docs/examples/databases/delete-collection.md +++ b/docs/examples/databases/delete-collection.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/delete-document.md b/docs/examples/databases/delete-document.md index 05183b5e..526f00eb 100644 --- a/docs/examples/databases/delete-document.md +++ b/docs/examples/databases/delete-document.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/databases/delete-documents.md b/docs/examples/databases/delete-documents.md new file mode 100644 index 00000000..01814e50 --- /dev/null +++ b/docs/examples/databases/delete-documents.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.deleteDocuments( + '', // databaseId + '', // collectionId + [] // queries (optional) +); diff --git a/docs/examples/databases/delete-index.md b/docs/examples/databases/delete-index.md index 0f50d7d2..90353ea4 100644 --- a/docs/examples/databases/delete-index.md +++ b/docs/examples/databases/delete-index.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/delete.md b/docs/examples/databases/delete.md index 79ca89dd..65179d2b 100644 --- a/docs/examples/databases/delete.md +++ b/docs/examples/databases/delete.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/get-attribute.md b/docs/examples/databases/get-attribute.md index 86dccff4..8757265e 100644 --- a/docs/examples/databases/get-attribute.md +++ b/docs/examples/databases/get-attribute.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/get-collection.md b/docs/examples/databases/get-collection.md index f107c149..79c56749 100644 --- a/docs/examples/databases/get-collection.md +++ b/docs/examples/databases/get-collection.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/get-document.md b/docs/examples/databases/get-document.md index edd2cb21..eee515bf 100644 --- a/docs/examples/databases/get-document.md +++ b/docs/examples/databases/get-document.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/databases/get-index.md b/docs/examples/databases/get-index.md index 3c1039cd..a4b3a45e 100644 --- a/docs/examples/databases/get-index.md +++ b/docs/examples/databases/get-index.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/get.md b/docs/examples/databases/get.md index ca5dd328..a8e80846 100644 --- a/docs/examples/databases/get.md +++ b/docs/examples/databases/get.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/list-attributes.md b/docs/examples/databases/list-attributes.md index fb0264f8..e7b48fb9 100644 --- a/docs/examples/databases/list-attributes.md +++ b/docs/examples/databases/list-attributes.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/list-collections.md b/docs/examples/databases/list-collections.md index e5f725d1..bc31eadf 100644 --- a/docs/examples/databases/list-collections.md +++ b/docs/examples/databases/list-collections.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/list-documents.md b/docs/examples/databases/list-documents.md index 346fba0a..d2514850 100644 --- a/docs/examples/databases/list-documents.md +++ b/docs/examples/databases/list-documents.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/databases/list-indexes.md b/docs/examples/databases/list-indexes.md index 7acfc918..86c6c26e 100644 --- a/docs/examples/databases/list-indexes.md +++ b/docs/examples/databases/list-indexes.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/list.md b/docs/examples/databases/list.md index f887719c..06fe6a84 100644 --- a/docs/examples/databases/list.md +++ b/docs/examples/databases/list.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/update-boolean-attribute.md b/docs/examples/databases/update-boolean-attribute.md index e6329b66..d0d551c3 100644 --- a/docs/examples/databases/update-boolean-attribute.md +++ b/docs/examples/databases/update-boolean-attribute.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/update-collection.md b/docs/examples/databases/update-collection.md index b9bbeb8c..2618fc73 100644 --- a/docs/examples/databases/update-collection.md +++ b/docs/examples/databases/update-collection.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/update-datetime-attribute.md b/docs/examples/databases/update-datetime-attribute.md index ef69c7e4..d2378f93 100644 --- a/docs/examples/databases/update-datetime-attribute.md +++ b/docs/examples/databases/update-datetime-attribute.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/update-document.md b/docs/examples/databases/update-document.md index 2e087ca7..96468037 100644 --- a/docs/examples/databases/update-document.md +++ b/docs/examples/databases/update-document.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/databases/update-documents.md b/docs/examples/databases/update-documents.md new file mode 100644 index 00000000..62b2271b --- /dev/null +++ b/docs/examples/databases/update-documents.md @@ -0,0 +1,15 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.updateDocuments( + '', // databaseId + '', // collectionId + {}, // data (optional) + [] // queries (optional) +); diff --git a/docs/examples/databases/update-email-attribute.md b/docs/examples/databases/update-email-attribute.md index 1fe9e572..8b7afbeb 100644 --- a/docs/examples/databases/update-email-attribute.md +++ b/docs/examples/databases/update-email-attribute.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/update-enum-attribute.md b/docs/examples/databases/update-enum-attribute.md index ec9e3bd2..f3281325 100644 --- a/docs/examples/databases/update-enum-attribute.md +++ b/docs/examples/databases/update-enum-attribute.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/update-float-attribute.md b/docs/examples/databases/update-float-attribute.md index b064bf7c..abb93c28 100644 --- a/docs/examples/databases/update-float-attribute.md +++ b/docs/examples/databases/update-float-attribute.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/update-integer-attribute.md b/docs/examples/databases/update-integer-attribute.md index f686612f..e126f31f 100644 --- a/docs/examples/databases/update-integer-attribute.md +++ b/docs/examples/databases/update-integer-attribute.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/update-ip-attribute.md b/docs/examples/databases/update-ip-attribute.md index 019b4f2d..1c8ac79d 100644 --- a/docs/examples/databases/update-ip-attribute.md +++ b/docs/examples/databases/update-ip-attribute.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/update-relationship-attribute.md b/docs/examples/databases/update-relationship-attribute.md index 2668380b..1a7a26cc 100644 --- a/docs/examples/databases/update-relationship-attribute.md +++ b/docs/examples/databases/update-relationship-attribute.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/update-string-attribute.md b/docs/examples/databases/update-string-attribute.md index 6aecbb59..0e0656ef 100644 --- a/docs/examples/databases/update-string-attribute.md +++ b/docs/examples/databases/update-string-attribute.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/update-url-attribute.md b/docs/examples/databases/update-url-attribute.md index 36d10953..4a2aca0f 100644 --- a/docs/examples/databases/update-url-attribute.md +++ b/docs/examples/databases/update-url-attribute.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/update.md b/docs/examples/databases/update.md index 4b24cddd..9c69bfd2 100644 --- a/docs/examples/databases/update.md +++ b/docs/examples/databases/update.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/databases/upsert-documents.md b/docs/examples/databases/upsert-documents.md new file mode 100644 index 00000000..5b479562 --- /dev/null +++ b/docs/examples/databases/upsert-documents.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const databases = new sdk.Databases(client); + +const result = await databases.upsertDocuments( + '', // databaseId + '', // collectionId + [] // documents (optional) +); diff --git a/docs/examples/functions/create-build.md b/docs/examples/functions/create-build.md index c026a960..c9434c07 100644 --- a/docs/examples/functions/create-build.md +++ b/docs/examples/functions/create-build.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/functions/create-deployment.md b/docs/examples/functions/create-deployment.md index 1928e4c5..5ede9549 100644 --- a/docs/examples/functions/create-deployment.md +++ b/docs/examples/functions/create-deployment.md @@ -2,7 +2,7 @@ const sdk = require('node-appwrite'); const fs = require('fs'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index 4eec409e..3c89030c 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index 60a93666..7146591b 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index cb446482..90b4300e 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/functions/delete-deployment.md b/docs/examples/functions/delete-deployment.md index a9038bc6..f6768ec7 100644 --- a/docs/examples/functions/delete-deployment.md +++ b/docs/examples/functions/delete-deployment.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/functions/delete-execution.md b/docs/examples/functions/delete-execution.md index 28b5e415..c3e77a68 100644 --- a/docs/examples/functions/delete-execution.md +++ b/docs/examples/functions/delete-execution.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/functions/delete-variable.md b/docs/examples/functions/delete-variable.md index f3cf0186..7840b1d5 100644 --- a/docs/examples/functions/delete-variable.md +++ b/docs/examples/functions/delete-variable.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/functions/delete.md b/docs/examples/functions/delete.md index 43acc4b1..a2e0a23a 100644 --- a/docs/examples/functions/delete.md +++ b/docs/examples/functions/delete.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/functions/get-deployment-download.md b/docs/examples/functions/get-deployment-download.md index a15215dd..cde26a43 100644 --- a/docs/examples/functions/get-deployment-download.md +++ b/docs/examples/functions/get-deployment-download.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/functions/get-deployment.md b/docs/examples/functions/get-deployment.md index 1c10a92d..6a55534a 100644 --- a/docs/examples/functions/get-deployment.md +++ b/docs/examples/functions/get-deployment.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/functions/get-execution.md b/docs/examples/functions/get-execution.md index 7be4378c..b9fed557 100644 --- a/docs/examples/functions/get-execution.md +++ b/docs/examples/functions/get-execution.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/functions/get-variable.md b/docs/examples/functions/get-variable.md index 64150e0f..3b6135f7 100644 --- a/docs/examples/functions/get-variable.md +++ b/docs/examples/functions/get-variable.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/functions/get.md b/docs/examples/functions/get.md index 26807e79..b8860925 100644 --- a/docs/examples/functions/get.md +++ b/docs/examples/functions/get.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/functions/list-deployments.md b/docs/examples/functions/list-deployments.md index 67c3c3c5..731d1c46 100644 --- a/docs/examples/functions/list-deployments.md +++ b/docs/examples/functions/list-deployments.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md index 26aa02e1..81e2379f 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/functions/list-runtimes.md b/docs/examples/functions/list-runtimes.md index 729cce7c..a0f83b22 100644 --- a/docs/examples/functions/list-runtimes.md +++ b/docs/examples/functions/list-runtimes.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/functions/list-specifications.md b/docs/examples/functions/list-specifications.md index 4942bc39..f918c440 100644 --- a/docs/examples/functions/list-specifications.md +++ b/docs/examples/functions/list-specifications.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/functions/list-variables.md b/docs/examples/functions/list-variables.md index f213d0ce..4220918f 100644 --- a/docs/examples/functions/list-variables.md +++ b/docs/examples/functions/list-variables.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/functions/list.md b/docs/examples/functions/list.md index ba7365f9..af5082c2 100644 --- a/docs/examples/functions/list.md +++ b/docs/examples/functions/list.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/functions/update-deployment-build.md b/docs/examples/functions/update-deployment-build.md index b492af82..7b5594c0 100644 --- a/docs/examples/functions/update-deployment-build.md +++ b/docs/examples/functions/update-deployment-build.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/functions/update-deployment.md b/docs/examples/functions/update-deployment.md index 82543900..e27bad4d 100644 --- a/docs/examples/functions/update-deployment.md +++ b/docs/examples/functions/update-deployment.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index 657b0bd1..e24ff882 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index b82dc35f..b6de177c 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/graphql/mutation.md b/docs/examples/graphql/mutation.md index 64b23934..8031a528 100644 --- a/docs/examples/graphql/mutation.md +++ b/docs/examples/graphql/mutation.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/graphql/query.md b/docs/examples/graphql/query.md index 24a6e56e..15456754 100644 --- a/docs/examples/graphql/query.md +++ b/docs/examples/graphql/query.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-antivirus.md b/docs/examples/health/get-antivirus.md index fc98ff93..9efa2d80 100644 --- a/docs/examples/health/get-antivirus.md +++ b/docs/examples/health/get-antivirus.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-cache.md b/docs/examples/health/get-cache.md index 9289cad7..01434012 100644 --- a/docs/examples/health/get-cache.md +++ b/docs/examples/health/get-cache.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-certificate.md b/docs/examples/health/get-certificate.md index 637f30bd..ec912934 100644 --- a/docs/examples/health/get-certificate.md +++ b/docs/examples/health/get-certificate.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-d-b.md b/docs/examples/health/get-d-b.md index 6cca907b..0d86d08d 100644 --- a/docs/examples/health/get-d-b.md +++ b/docs/examples/health/get-d-b.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-failed-jobs.md b/docs/examples/health/get-failed-jobs.md index 2ce2dfb6..d88b7f2b 100644 --- a/docs/examples/health/get-failed-jobs.md +++ b/docs/examples/health/get-failed-jobs.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-pub-sub.md b/docs/examples/health/get-pub-sub.md index 36dc5ba3..b5b97374 100644 --- a/docs/examples/health/get-pub-sub.md +++ b/docs/examples/health/get-pub-sub.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-queue-builds.md b/docs/examples/health/get-queue-builds.md index ef09f92d..929f9769 100644 --- a/docs/examples/health/get-queue-builds.md +++ b/docs/examples/health/get-queue-builds.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-queue-certificates.md b/docs/examples/health/get-queue-certificates.md index 1095c398..33e71eca 100644 --- a/docs/examples/health/get-queue-certificates.md +++ b/docs/examples/health/get-queue-certificates.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-queue-databases.md b/docs/examples/health/get-queue-databases.md index fcd113aa..ca409c1b 100644 --- a/docs/examples/health/get-queue-databases.md +++ b/docs/examples/health/get-queue-databases.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-queue-deletes.md b/docs/examples/health/get-queue-deletes.md index 6a6f5175..9f2d6f8c 100644 --- a/docs/examples/health/get-queue-deletes.md +++ b/docs/examples/health/get-queue-deletes.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-queue-functions.md b/docs/examples/health/get-queue-functions.md index 05cd6e63..0392db10 100644 --- a/docs/examples/health/get-queue-functions.md +++ b/docs/examples/health/get-queue-functions.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-queue-logs.md b/docs/examples/health/get-queue-logs.md index e0a75b8d..a71ff133 100644 --- a/docs/examples/health/get-queue-logs.md +++ b/docs/examples/health/get-queue-logs.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-queue-mails.md b/docs/examples/health/get-queue-mails.md index 253e9ba0..8c45c1a1 100644 --- a/docs/examples/health/get-queue-mails.md +++ b/docs/examples/health/get-queue-mails.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-queue-messaging.md b/docs/examples/health/get-queue-messaging.md index 3db1f6f5..46160a0e 100644 --- a/docs/examples/health/get-queue-messaging.md +++ b/docs/examples/health/get-queue-messaging.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-queue-migrations.md b/docs/examples/health/get-queue-migrations.md index a2034495..5f8d262e 100644 --- a/docs/examples/health/get-queue-migrations.md +++ b/docs/examples/health/get-queue-migrations.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-queue-stats-resources.md b/docs/examples/health/get-queue-stats-resources.md index e4693914..1b16e6d5 100644 --- a/docs/examples/health/get-queue-stats-resources.md +++ b/docs/examples/health/get-queue-stats-resources.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-queue-usage.md b/docs/examples/health/get-queue-usage.md index 919d0973..2a20620c 100644 --- a/docs/examples/health/get-queue-usage.md +++ b/docs/examples/health/get-queue-usage.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-queue-webhooks.md b/docs/examples/health/get-queue-webhooks.md index 54b6ba4d..acc20983 100644 --- a/docs/examples/health/get-queue-webhooks.md +++ b/docs/examples/health/get-queue-webhooks.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-storage-local.md b/docs/examples/health/get-storage-local.md index d04610df..0ea8e0e2 100644 --- a/docs/examples/health/get-storage-local.md +++ b/docs/examples/health/get-storage-local.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-storage.md b/docs/examples/health/get-storage.md index cd6d494d..d1998005 100644 --- a/docs/examples/health/get-storage.md +++ b/docs/examples/health/get-storage.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get-time.md b/docs/examples/health/get-time.md index 71caa3ff..cd4f42e3 100644 --- a/docs/examples/health/get-time.md +++ b/docs/examples/health/get-time.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/health/get.md b/docs/examples/health/get.md index d92cb944..e10c4e28 100644 --- a/docs/examples/health/get.md +++ b/docs/examples/health/get.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/locale/get.md b/docs/examples/locale/get.md index eb7353d3..d57eb8f2 100644 --- a/docs/examples/locale/get.md +++ b/docs/examples/locale/get.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/locale/list-codes.md b/docs/examples/locale/list-codes.md index c95a8522..280d14ae 100644 --- a/docs/examples/locale/list-codes.md +++ b/docs/examples/locale/list-codes.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/locale/list-continents.md b/docs/examples/locale/list-continents.md index ffce38e7..d04d6d6a 100644 --- a/docs/examples/locale/list-continents.md +++ b/docs/examples/locale/list-continents.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/locale/list-countries-e-u.md b/docs/examples/locale/list-countries-e-u.md index 3bd63b33..6e41074b 100644 --- a/docs/examples/locale/list-countries-e-u.md +++ b/docs/examples/locale/list-countries-e-u.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/locale/list-countries-phones.md b/docs/examples/locale/list-countries-phones.md index be39d0f8..9621e9cb 100644 --- a/docs/examples/locale/list-countries-phones.md +++ b/docs/examples/locale/list-countries-phones.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/locale/list-countries.md b/docs/examples/locale/list-countries.md index 5496a1f7..a81b1581 100644 --- a/docs/examples/locale/list-countries.md +++ b/docs/examples/locale/list-countries.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/locale/list-currencies.md b/docs/examples/locale/list-currencies.md index ff67f9f7..a585fd33 100644 --- a/docs/examples/locale/list-currencies.md +++ b/docs/examples/locale/list-currencies.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/locale/list-languages.md b/docs/examples/locale/list-languages.md index d6753d33..aea0fadf 100644 --- a/docs/examples/locale/list-languages.md +++ b/docs/examples/locale/list-languages.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/messaging/create-apns-provider.md b/docs/examples/messaging/create-apns-provider.md index fedbc556..a2830902 100644 --- a/docs/examples/messaging/create-apns-provider.md +++ b/docs/examples/messaging/create-apns-provider.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-email.md b/docs/examples/messaging/create-email.md index 35ac684b..b4b1f662 100644 --- a/docs/examples/messaging/create-email.md +++ b/docs/examples/messaging/create-email.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-fcm-provider.md b/docs/examples/messaging/create-fcm-provider.md index 80ffa583..a8af6ba1 100644 --- a/docs/examples/messaging/create-fcm-provider.md +++ b/docs/examples/messaging/create-fcm-provider.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-mailgun-provider.md b/docs/examples/messaging/create-mailgun-provider.md index 2b5f6571..ee49f64f 100644 --- a/docs/examples/messaging/create-mailgun-provider.md +++ b/docs/examples/messaging/create-mailgun-provider.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-msg91provider.md b/docs/examples/messaging/create-msg91provider.md index c8dcb385..e7075dc3 100644 --- a/docs/examples/messaging/create-msg91provider.md +++ b/docs/examples/messaging/create-msg91provider.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md index bb985387..bd89f761 100644 --- a/docs/examples/messaging/create-push.md +++ b/docs/examples/messaging/create-push.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-sendgrid-provider.md b/docs/examples/messaging/create-sendgrid-provider.md index 65d4f402..8cde02e8 100644 --- a/docs/examples/messaging/create-sendgrid-provider.md +++ b/docs/examples/messaging/create-sendgrid-provider.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-sms.md b/docs/examples/messaging/create-sms.md index 75dce904..226f47c8 100644 --- a/docs/examples/messaging/create-sms.md +++ b/docs/examples/messaging/create-sms.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-smtp-provider.md b/docs/examples/messaging/create-smtp-provider.md index 9c69f276..50a8d202 100644 --- a/docs/examples/messaging/create-smtp-provider.md +++ b/docs/examples/messaging/create-smtp-provider.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-subscriber.md b/docs/examples/messaging/create-subscriber.md index e5d2a977..9874d072 100644 --- a/docs/examples/messaging/create-subscriber.md +++ b/docs/examples/messaging/create-subscriber.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setJWT(''); // Your secret JSON Web Token diff --git a/docs/examples/messaging/create-telesign-provider.md b/docs/examples/messaging/create-telesign-provider.md index 544be15a..b8771721 100644 --- a/docs/examples/messaging/create-telesign-provider.md +++ b/docs/examples/messaging/create-telesign-provider.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-textmagic-provider.md b/docs/examples/messaging/create-textmagic-provider.md index ef41b803..b40d5ee4 100644 --- a/docs/examples/messaging/create-textmagic-provider.md +++ b/docs/examples/messaging/create-textmagic-provider.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-topic.md b/docs/examples/messaging/create-topic.md index 22fe4121..35c93ead 100644 --- a/docs/examples/messaging/create-topic.md +++ b/docs/examples/messaging/create-topic.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-twilio-provider.md b/docs/examples/messaging/create-twilio-provider.md index 908f09ed..4dcb9a84 100644 --- a/docs/examples/messaging/create-twilio-provider.md +++ b/docs/examples/messaging/create-twilio-provider.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/create-vonage-provider.md b/docs/examples/messaging/create-vonage-provider.md index 78270b7f..493cd2b6 100644 --- a/docs/examples/messaging/create-vonage-provider.md +++ b/docs/examples/messaging/create-vonage-provider.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/delete-provider.md b/docs/examples/messaging/delete-provider.md index fd664515..23b474f7 100644 --- a/docs/examples/messaging/delete-provider.md +++ b/docs/examples/messaging/delete-provider.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/delete-subscriber.md b/docs/examples/messaging/delete-subscriber.md index aec3a7ed..1f5e21af 100644 --- a/docs/examples/messaging/delete-subscriber.md +++ b/docs/examples/messaging/delete-subscriber.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setJWT(''); // Your secret JSON Web Token diff --git a/docs/examples/messaging/delete-topic.md b/docs/examples/messaging/delete-topic.md index 7b4a360e..af39f734 100644 --- a/docs/examples/messaging/delete-topic.md +++ b/docs/examples/messaging/delete-topic.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/delete.md b/docs/examples/messaging/delete.md index d4f8bfcc..fd49104a 100644 --- a/docs/examples/messaging/delete.md +++ b/docs/examples/messaging/delete.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/get-message.md b/docs/examples/messaging/get-message.md index 7b466226..f83ab51c 100644 --- a/docs/examples/messaging/get-message.md +++ b/docs/examples/messaging/get-message.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/get-provider.md b/docs/examples/messaging/get-provider.md index 796bcbc7..2f52698b 100644 --- a/docs/examples/messaging/get-provider.md +++ b/docs/examples/messaging/get-provider.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/get-subscriber.md b/docs/examples/messaging/get-subscriber.md index 3930e54b..5132f177 100644 --- a/docs/examples/messaging/get-subscriber.md +++ b/docs/examples/messaging/get-subscriber.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/get-topic.md b/docs/examples/messaging/get-topic.md index 68fda14e..98e38383 100644 --- a/docs/examples/messaging/get-topic.md +++ b/docs/examples/messaging/get-topic.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/list-message-logs.md b/docs/examples/messaging/list-message-logs.md index 01b941b6..56e1288a 100644 --- a/docs/examples/messaging/list-message-logs.md +++ b/docs/examples/messaging/list-message-logs.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/list-messages.md b/docs/examples/messaging/list-messages.md index 4c0ee7a3..db0785ec 100644 --- a/docs/examples/messaging/list-messages.md +++ b/docs/examples/messaging/list-messages.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/list-provider-logs.md b/docs/examples/messaging/list-provider-logs.md index 625fedb2..6cb2a01d 100644 --- a/docs/examples/messaging/list-provider-logs.md +++ b/docs/examples/messaging/list-provider-logs.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/list-providers.md b/docs/examples/messaging/list-providers.md index 4d3a63b9..aefb41d1 100644 --- a/docs/examples/messaging/list-providers.md +++ b/docs/examples/messaging/list-providers.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/list-subscriber-logs.md b/docs/examples/messaging/list-subscriber-logs.md index 61077f29..8d46a085 100644 --- a/docs/examples/messaging/list-subscriber-logs.md +++ b/docs/examples/messaging/list-subscriber-logs.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/list-subscribers.md b/docs/examples/messaging/list-subscribers.md index 85b91ca5..167b48e9 100644 --- a/docs/examples/messaging/list-subscribers.md +++ b/docs/examples/messaging/list-subscribers.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/list-targets.md b/docs/examples/messaging/list-targets.md index cafdf9ba..971285d8 100644 --- a/docs/examples/messaging/list-targets.md +++ b/docs/examples/messaging/list-targets.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/list-topic-logs.md b/docs/examples/messaging/list-topic-logs.md index fe0a0948..39e82954 100644 --- a/docs/examples/messaging/list-topic-logs.md +++ b/docs/examples/messaging/list-topic-logs.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/list-topics.md b/docs/examples/messaging/list-topics.md index 5d0419a7..6fd94bba 100644 --- a/docs/examples/messaging/list-topics.md +++ b/docs/examples/messaging/list-topics.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-apns-provider.md b/docs/examples/messaging/update-apns-provider.md index 23d806e0..e782b8c3 100644 --- a/docs/examples/messaging/update-apns-provider.md +++ b/docs/examples/messaging/update-apns-provider.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-email.md b/docs/examples/messaging/update-email.md index a6798eeb..2ea2941e 100644 --- a/docs/examples/messaging/update-email.md +++ b/docs/examples/messaging/update-email.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-fcm-provider.md b/docs/examples/messaging/update-fcm-provider.md index 3d343993..9184f283 100644 --- a/docs/examples/messaging/update-fcm-provider.md +++ b/docs/examples/messaging/update-fcm-provider.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-mailgun-provider.md b/docs/examples/messaging/update-mailgun-provider.md index 5bcc4d1a..a1ac18fd 100644 --- a/docs/examples/messaging/update-mailgun-provider.md +++ b/docs/examples/messaging/update-mailgun-provider.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-msg91provider.md b/docs/examples/messaging/update-msg91provider.md index 02f091f3..c66b91f8 100644 --- a/docs/examples/messaging/update-msg91provider.md +++ b/docs/examples/messaging/update-msg91provider.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md index 700c3a99..db52bee3 100644 --- a/docs/examples/messaging/update-push.md +++ b/docs/examples/messaging/update-push.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-sendgrid-provider.md b/docs/examples/messaging/update-sendgrid-provider.md index 22a5fe59..8420a2fa 100644 --- a/docs/examples/messaging/update-sendgrid-provider.md +++ b/docs/examples/messaging/update-sendgrid-provider.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-sms.md b/docs/examples/messaging/update-sms.md index 03c266be..98ee6feb 100644 --- a/docs/examples/messaging/update-sms.md +++ b/docs/examples/messaging/update-sms.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-smtp-provider.md b/docs/examples/messaging/update-smtp-provider.md index 35b74434..0bbe4cd2 100644 --- a/docs/examples/messaging/update-smtp-provider.md +++ b/docs/examples/messaging/update-smtp-provider.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-telesign-provider.md b/docs/examples/messaging/update-telesign-provider.md index dd668f82..2f23a3b1 100644 --- a/docs/examples/messaging/update-telesign-provider.md +++ b/docs/examples/messaging/update-telesign-provider.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-textmagic-provider.md b/docs/examples/messaging/update-textmagic-provider.md index d90c95d8..6fb6c82e 100644 --- a/docs/examples/messaging/update-textmagic-provider.md +++ b/docs/examples/messaging/update-textmagic-provider.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-topic.md b/docs/examples/messaging/update-topic.md index 08690a19..63309700 100644 --- a/docs/examples/messaging/update-topic.md +++ b/docs/examples/messaging/update-topic.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-twilio-provider.md b/docs/examples/messaging/update-twilio-provider.md index c6d2b8c0..e4667f56 100644 --- a/docs/examples/messaging/update-twilio-provider.md +++ b/docs/examples/messaging/update-twilio-provider.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/messaging/update-vonage-provider.md b/docs/examples/messaging/update-vonage-provider.md index ba9f1029..b95398b4 100644 --- a/docs/examples/messaging/update-vonage-provider.md +++ b/docs/examples/messaging/update-vonage-provider.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/storage/create-bucket.md b/docs/examples/storage/create-bucket.md index 91a5126e..fc318f16 100644 --- a/docs/examples/storage/create-bucket.md +++ b/docs/examples/storage/create-bucket.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index 067307cc..b84d9ac6 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -2,7 +2,7 @@ const sdk = require('node-appwrite'); const fs = require('fs'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/storage/delete-bucket.md b/docs/examples/storage/delete-bucket.md index 606ffba7..c2067efd 100644 --- a/docs/examples/storage/delete-bucket.md +++ b/docs/examples/storage/delete-bucket.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/storage/delete-file.md b/docs/examples/storage/delete-file.md index c5b9df92..4d2e7128 100644 --- a/docs/examples/storage/delete-file.md +++ b/docs/examples/storage/delete-file.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/storage/get-bucket.md b/docs/examples/storage/get-bucket.md index 711753d4..c8a0b1c5 100644 --- a/docs/examples/storage/get-bucket.md +++ b/docs/examples/storage/get-bucket.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md index cbd4c161..051f51c8 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index be7b974b..45da053c 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md index f5722d06..fd06b308 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/storage/get-file.md b/docs/examples/storage/get-file.md index 61b14e6b..1a6b5000 100644 --- a/docs/examples/storage/get-file.md +++ b/docs/examples/storage/get-file.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/storage/list-buckets.md b/docs/examples/storage/list-buckets.md index ce012c45..3c4d4b14 100644 --- a/docs/examples/storage/list-buckets.md +++ b/docs/examples/storage/list-buckets.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/storage/list-files.md b/docs/examples/storage/list-files.md index a9dbaa8f..fb595efc 100644 --- a/docs/examples/storage/list-files.md +++ b/docs/examples/storage/list-files.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/storage/update-bucket.md b/docs/examples/storage/update-bucket.md index 31e13167..24e4872d 100644 --- a/docs/examples/storage/update-bucket.md +++ b/docs/examples/storage/update-bucket.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/storage/update-file.md b/docs/examples/storage/update-file.md index c60b2e4a..7eed687c 100644 --- a/docs/examples/storage/update-file.md +++ b/docs/examples/storage/update-file.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/create-membership.md b/docs/examples/teams/create-membership.md index 46066241..7994423b 100644 --- a/docs/examples/teams/create-membership.md +++ b/docs/examples/teams/create-membership.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/create.md b/docs/examples/teams/create.md index cecf4f60..94de494b 100644 --- a/docs/examples/teams/create.md +++ b/docs/examples/teams/create.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/delete-membership.md b/docs/examples/teams/delete-membership.md index 933cd7cc..5264af7f 100644 --- a/docs/examples/teams/delete-membership.md +++ b/docs/examples/teams/delete-membership.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/delete.md b/docs/examples/teams/delete.md index 50963b3e..151bfb3f 100644 --- a/docs/examples/teams/delete.md +++ b/docs/examples/teams/delete.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/get-membership.md b/docs/examples/teams/get-membership.md index b638adeb..a8e9fc73 100644 --- a/docs/examples/teams/get-membership.md +++ b/docs/examples/teams/get-membership.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/get-prefs.md b/docs/examples/teams/get-prefs.md index 68f19a41..18afdaa6 100644 --- a/docs/examples/teams/get-prefs.md +++ b/docs/examples/teams/get-prefs.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/get.md b/docs/examples/teams/get.md index 38ee6e4c..8afc800a 100644 --- a/docs/examples/teams/get.md +++ b/docs/examples/teams/get.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/list-memberships.md b/docs/examples/teams/list-memberships.md index c66ec7d6..4fead97b 100644 --- a/docs/examples/teams/list-memberships.md +++ b/docs/examples/teams/list-memberships.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/list.md b/docs/examples/teams/list.md index d50527bf..17fe5852 100644 --- a/docs/examples/teams/list.md +++ b/docs/examples/teams/list.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/update-membership-status.md b/docs/examples/teams/update-membership-status.md index 80660e94..74fd9580 100644 --- a/docs/examples/teams/update-membership-status.md +++ b/docs/examples/teams/update-membership-status.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/update-membership.md b/docs/examples/teams/update-membership.md index 068cc55b..649630de 100644 --- a/docs/examples/teams/update-membership.md +++ b/docs/examples/teams/update-membership.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/update-name.md b/docs/examples/teams/update-name.md index 21741202..571f7ce3 100644 --- a/docs/examples/teams/update-name.md +++ b/docs/examples/teams/update-name.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/teams/update-prefs.md b/docs/examples/teams/update-prefs.md index 9d6a6f5f..b054694d 100644 --- a/docs/examples/teams/update-prefs.md +++ b/docs/examples/teams/update-prefs.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setSession(''); // The user session to authenticate with diff --git a/docs/examples/users/create-argon2user.md b/docs/examples/users/create-argon2user.md index e96a797d..dce3646a 100644 --- a/docs/examples/users/create-argon2user.md +++ b/docs/examples/users/create-argon2user.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/create-bcrypt-user.md b/docs/examples/users/create-bcrypt-user.md index be14d217..d010676d 100644 --- a/docs/examples/users/create-bcrypt-user.md +++ b/docs/examples/users/create-bcrypt-user.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/create-j-w-t.md b/docs/examples/users/create-j-w-t.md index e615b1ee..a2c9b590 100644 --- a/docs/examples/users/create-j-w-t.md +++ b/docs/examples/users/create-j-w-t.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/create-m-d5user.md b/docs/examples/users/create-m-d5user.md index 77a7d708..954374c3 100644 --- a/docs/examples/users/create-m-d5user.md +++ b/docs/examples/users/create-m-d5user.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/create-mfa-recovery-codes.md b/docs/examples/users/create-mfa-recovery-codes.md index 42945293..8b2ed93b 100644 --- a/docs/examples/users/create-mfa-recovery-codes.md +++ b/docs/examples/users/create-mfa-recovery-codes.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/create-p-h-pass-user.md b/docs/examples/users/create-p-h-pass-user.md index a5784d7d..eca31fe6 100644 --- a/docs/examples/users/create-p-h-pass-user.md +++ b/docs/examples/users/create-p-h-pass-user.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/create-s-h-a-user.md b/docs/examples/users/create-s-h-a-user.md index a72e3730..e7d8588f 100644 --- a/docs/examples/users/create-s-h-a-user.md +++ b/docs/examples/users/create-s-h-a-user.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/create-scrypt-modified-user.md b/docs/examples/users/create-scrypt-modified-user.md index b27fe318..831107b5 100644 --- a/docs/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/users/create-scrypt-modified-user.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/create-scrypt-user.md b/docs/examples/users/create-scrypt-user.md index 60b61be4..2c2da7e0 100644 --- a/docs/examples/users/create-scrypt-user.md +++ b/docs/examples/users/create-scrypt-user.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/create-session.md b/docs/examples/users/create-session.md index 2672905e..9d8cc03b 100644 --- a/docs/examples/users/create-session.md +++ b/docs/examples/users/create-session.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/create-target.md b/docs/examples/users/create-target.md index 099b0037..7b9e6b03 100644 --- a/docs/examples/users/create-target.md +++ b/docs/examples/users/create-target.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/create-token.md b/docs/examples/users/create-token.md index a3993131..de7d866e 100644 --- a/docs/examples/users/create-token.md +++ b/docs/examples/users/create-token.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/create.md b/docs/examples/users/create.md index e8fb4cd9..025c15ad 100644 --- a/docs/examples/users/create.md +++ b/docs/examples/users/create.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/delete-identity.md b/docs/examples/users/delete-identity.md index 46f5203d..4c92f27d 100644 --- a/docs/examples/users/delete-identity.md +++ b/docs/examples/users/delete-identity.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/delete-mfa-authenticator.md b/docs/examples/users/delete-mfa-authenticator.md index 1f00e963..456242e2 100644 --- a/docs/examples/users/delete-mfa-authenticator.md +++ b/docs/examples/users/delete-mfa-authenticator.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/delete-session.md b/docs/examples/users/delete-session.md index 168f4948..3f08370f 100644 --- a/docs/examples/users/delete-session.md +++ b/docs/examples/users/delete-session.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/delete-sessions.md b/docs/examples/users/delete-sessions.md index 4c320fc4..48714a0d 100644 --- a/docs/examples/users/delete-sessions.md +++ b/docs/examples/users/delete-sessions.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/delete-target.md b/docs/examples/users/delete-target.md index 6505a8bb..ba7e6afd 100644 --- a/docs/examples/users/delete-target.md +++ b/docs/examples/users/delete-target.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/delete.md b/docs/examples/users/delete.md index 4d6c9963..8fdd9e90 100644 --- a/docs/examples/users/delete.md +++ b/docs/examples/users/delete.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/get-mfa-recovery-codes.md b/docs/examples/users/get-mfa-recovery-codes.md index 3e97065f..233c3375 100644 --- a/docs/examples/users/get-mfa-recovery-codes.md +++ b/docs/examples/users/get-mfa-recovery-codes.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/get-prefs.md b/docs/examples/users/get-prefs.md index fda205b0..61933872 100644 --- a/docs/examples/users/get-prefs.md +++ b/docs/examples/users/get-prefs.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/get-target.md b/docs/examples/users/get-target.md index 1d93a1b1..00dc1f11 100644 --- a/docs/examples/users/get-target.md +++ b/docs/examples/users/get-target.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/get.md b/docs/examples/users/get.md index 9d361573..640aa631 100644 --- a/docs/examples/users/get.md +++ b/docs/examples/users/get.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/list-identities.md b/docs/examples/users/list-identities.md index 0ba13453..819b1688 100644 --- a/docs/examples/users/list-identities.md +++ b/docs/examples/users/list-identities.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/list-logs.md b/docs/examples/users/list-logs.md index 5636e021..c1155d55 100644 --- a/docs/examples/users/list-logs.md +++ b/docs/examples/users/list-logs.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/list-memberships.md b/docs/examples/users/list-memberships.md index bc4ce5e8..080688a9 100644 --- a/docs/examples/users/list-memberships.md +++ b/docs/examples/users/list-memberships.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/list-mfa-factors.md b/docs/examples/users/list-mfa-factors.md index 6396a694..8bffa288 100644 --- a/docs/examples/users/list-mfa-factors.md +++ b/docs/examples/users/list-mfa-factors.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/list-sessions.md b/docs/examples/users/list-sessions.md index de4aa3d4..51ba0814 100644 --- a/docs/examples/users/list-sessions.md +++ b/docs/examples/users/list-sessions.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/list-targets.md b/docs/examples/users/list-targets.md index 2d2a6d26..d991dcca 100644 --- a/docs/examples/users/list-targets.md +++ b/docs/examples/users/list-targets.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/list.md b/docs/examples/users/list.md index 664d32c6..2bf765be 100644 --- a/docs/examples/users/list.md +++ b/docs/examples/users/list.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/update-email-verification.md b/docs/examples/users/update-email-verification.md index 560ca3e8..9dac2d0e 100644 --- a/docs/examples/users/update-email-verification.md +++ b/docs/examples/users/update-email-verification.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/update-email.md b/docs/examples/users/update-email.md index eef17615..0a8b1aa7 100644 --- a/docs/examples/users/update-email.md +++ b/docs/examples/users/update-email.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/update-labels.md b/docs/examples/users/update-labels.md index ec270942..db9e8778 100644 --- a/docs/examples/users/update-labels.md +++ b/docs/examples/users/update-labels.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/update-mfa-recovery-codes.md b/docs/examples/users/update-mfa-recovery-codes.md index 56ef9b20..9d470853 100644 --- a/docs/examples/users/update-mfa-recovery-codes.md +++ b/docs/examples/users/update-mfa-recovery-codes.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/update-mfa.md b/docs/examples/users/update-mfa.md index 7c794442..b4acc799 100644 --- a/docs/examples/users/update-mfa.md +++ b/docs/examples/users/update-mfa.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/update-name.md b/docs/examples/users/update-name.md index 5478a78b..581e57b7 100644 --- a/docs/examples/users/update-name.md +++ b/docs/examples/users/update-name.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/update-password.md b/docs/examples/users/update-password.md index 856e3a85..f4af49d6 100644 --- a/docs/examples/users/update-password.md +++ b/docs/examples/users/update-password.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/update-phone-verification.md b/docs/examples/users/update-phone-verification.md index 654e7833..ecbe7591 100644 --- a/docs/examples/users/update-phone-verification.md +++ b/docs/examples/users/update-phone-verification.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/update-phone.md b/docs/examples/users/update-phone.md index 8cc4af05..45e5a658 100644 --- a/docs/examples/users/update-phone.md +++ b/docs/examples/users/update-phone.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/update-prefs.md b/docs/examples/users/update-prefs.md index f80dae11..bb7eff8d 100644 --- a/docs/examples/users/update-prefs.md +++ b/docs/examples/users/update-prefs.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/update-status.md b/docs/examples/users/update-status.md index 04a18a26..57f64ce9 100644 --- a/docs/examples/users/update-status.md +++ b/docs/examples/users/update-status.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/docs/examples/users/update-target.md b/docs/examples/users/update-target.md index 3322867d..c6e4d9a1 100644 --- a/docs/examples/users/update-target.md +++ b/docs/examples/users/update-target.md @@ -1,7 +1,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/package.json b/package.json index d10ade19..aa940b32 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "node-appwrite", "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": "16.0.0", + "version": "16.1.0-rc.1", "license": "BSD-3-Clause", "main": "dist/index.js", "type": "commonjs", diff --git a/src/client.ts b/src/client.ts index 8d8ef2f2..70b7ad5a 100644 --- a/src/client.ts +++ b/src/client.ts @@ -33,7 +33,7 @@ class AppwriteException extends Error { } function getUserAgent() { - let ua = 'AppwriteNodeJSSDK/16.0.0'; + let ua = 'AppwriteNodeJSSDK/16.1.0-rc.1'; // `process` is a global in Node.js, but not fully available in all runtimes. const platform: string[] = []; @@ -82,7 +82,7 @@ class Client { 'x-sdk-name': 'Node.js', 'x-sdk-platform': 'server', 'x-sdk-language': 'nodejs', - 'x-sdk-version': '16.0.0', + 'x-sdk-version': '16.1.0-rc.1', 'user-agent' : getUserAgent(), 'X-Appwrite-Response-Format': '1.6.0', }; diff --git a/src/services/databases.ts b/src/services/databases.ts index 265b72ad..42112792 100644 --- a/src/services/databases.ts +++ b/src/services/databases.ts @@ -1613,7 +1613,6 @@ export class Databases { } /** * 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 @@ -1660,6 +1659,151 @@ export class Databases { payload, ); } + /** + * Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. + + * + * @param {string} databaseId + * @param {string} collectionId + * @param {object[]} documents + * @throws {AppwriteException} + * @returns {Promise>} + */ + createDocuments(databaseId: string, collectionId: string, documents: object[]): 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 documents === 'undefined') { + throw new AppwriteException('Missing required parameter: "documents"'); + } + const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const payload: Payload = {}; + if (typeof documents !== 'undefined') { + payload['documents'] = documents; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + /** + * Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. + + * + * @param {string} databaseId + * @param {string} collectionId + * @param {object[]} documents + * @throws {AppwriteException} + * @returns {Promise>} + */ + upsertDocuments(databaseId: string, collectionId: string, documents?: object[]): 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 documents !== 'undefined') { + payload['documents'] = documents; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload, + ); + } + /** + * Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated. + * + * @param {string} databaseId + * @param {string} collectionId + * @param {object} data + * @param {string[]} queries + * @throws {AppwriteException} + * @returns {Promise>} + */ + updateDocuments(databaseId: string, collectionId: string, data?: object, 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 data !== 'undefined') { + payload['data'] = data; + } + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + /** + * Bulk delete documents using queries, if no queries are passed then all documents are deleted. + * + * @param {string} databaseId + * @param {string} collectionId + * @param {string[]} queries + * @throws {AppwriteException} + * @returns {Promise>} + */ + deleteDocuments(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); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload, + ); + } /** * Get a document by its unique ID. This endpoint response returns a JSON object with the document data. * From aade39b12860c0fed9f8ffa1130a35b22b9049e4 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Sun, 18 May 2025 00:04:05 +1200 Subject: [PATCH 2/4] Add support for 1.7 --- README.md | 4 +- docs/examples/avatars/get-browser.md | 2 +- docs/examples/avatars/get-credit-card.md | 2 +- docs/examples/avatars/get-flag.md | 2 +- docs/examples/databases/create-document.md | 5 +- docs/examples/databases/create-documents.md | 3 +- docs/examples/databases/create-index.md | 3 +- ...uild.md => create-duplicate-deployment.md} | 2 +- .../functions/create-template-deployment.md | 17 + docs/examples/functions/create-variable.md | 3 +- .../functions/create-vcs-deployment.md | 15 + docs/examples/functions/create.md | 4 - .../functions/get-deployment-download.md | 3 +- docs/examples/functions/list-executions.md | 3 +- ...t-build.md => update-deployment-status.md} | 2 +- ...yment.md => update-function-deployment.md} | 2 +- docs/examples/functions/update-variable.md | 3 +- docs/examples/sites/create-deployment.md | 18 + .../sites/create-duplicate-deployment.md | 13 + .../sites/create-template-deployment.md | 17 + docs/examples/sites/create-variable.md | 15 + docs/examples/sites/create-vcs-deployment.md | 15 + docs/examples/sites/create.md | 29 + docs/examples/sites/delete-deployment.md | 13 + docs/examples/sites/delete-log.md | 13 + docs/examples/sites/delete-variable.md | 13 + docs/examples/sites/delete.md | 12 + .../examples/sites/get-deployment-download.md | 14 + docs/examples/sites/get-deployment.md | 13 + docs/examples/sites/get-log.md | 13 + docs/examples/sites/get-variable.md | 13 + docs/examples/sites/get.md | 12 + docs/examples/sites/list-deployments.md | 14 + docs/examples/sites/list-frameworks.md | 10 + docs/examples/sites/list-logs.md | 13 + docs/examples/sites/list-specifications.md | 10 + docs/examples/sites/list-variables.md | 12 + docs/examples/sites/list.md | 13 + .../sites/update-deployment-status.md | 13 + docs/examples/sites/update-site-deployment.md | 13 + docs/examples/sites/update-variable.md | 16 + docs/examples/sites/update.md | 29 + docs/examples/storage/get-file-download.md | 3 +- docs/examples/storage/get-file-preview.md | 5 +- docs/examples/storage/get-file-view.md | 3 +- docs/examples/tokens/create-file-token.md | 14 + docs/examples/tokens/delete.md | 12 + docs/examples/tokens/get.md | 12 + docs/examples/tokens/list.md | 14 + docs/examples/tokens/update.md | 13 + docs/examples/users/list-memberships.md | 4 +- package.json | 2 +- src/client.ts | 6 +- src/enums/adapter.ts | 4 + src/enums/build-runtime.ts | 65 ++ src/enums/deployment-download-type.ts | 4 + src/enums/framework.ts | 16 + src/enums/image-format.ts | 1 - src/enums/runtime.ts | 4 + src/enums/v-c-s-deployment-type.ts | 5 + src/index.ts | 7 + src/models.ts | 334 +++++- src/services/databases.ts | 7 +- src/services/functions.ts | 232 +++-- src/services/sites.ts | 986 ++++++++++++++++++ src/services/storage.ts | 18 +- src/services/tokens.ts | 159 +++ src/services/users.ts | 10 +- 68 files changed, 2231 insertions(+), 150 deletions(-) rename docs/examples/functions/{create-build.md => create-duplicate-deployment.md} (87%) create mode 100644 docs/examples/functions/create-template-deployment.md create mode 100644 docs/examples/functions/create-vcs-deployment.md rename docs/examples/functions/{update-deployment-build.md => update-deployment-status.md} (87%) rename docs/examples/functions/{update-deployment.md => update-function-deployment.md} (87%) create mode 100644 docs/examples/sites/create-deployment.md create mode 100644 docs/examples/sites/create-duplicate-deployment.md create mode 100644 docs/examples/sites/create-template-deployment.md create mode 100644 docs/examples/sites/create-variable.md create mode 100644 docs/examples/sites/create-vcs-deployment.md create mode 100644 docs/examples/sites/create.md create mode 100644 docs/examples/sites/delete-deployment.md create mode 100644 docs/examples/sites/delete-log.md create mode 100644 docs/examples/sites/delete-variable.md create mode 100644 docs/examples/sites/delete.md create mode 100644 docs/examples/sites/get-deployment-download.md create mode 100644 docs/examples/sites/get-deployment.md create mode 100644 docs/examples/sites/get-log.md create mode 100644 docs/examples/sites/get-variable.md create mode 100644 docs/examples/sites/get.md create mode 100644 docs/examples/sites/list-deployments.md create mode 100644 docs/examples/sites/list-frameworks.md create mode 100644 docs/examples/sites/list-logs.md create mode 100644 docs/examples/sites/list-specifications.md create mode 100644 docs/examples/sites/list-variables.md create mode 100644 docs/examples/sites/list.md create mode 100644 docs/examples/sites/update-deployment-status.md create mode 100644 docs/examples/sites/update-site-deployment.md create mode 100644 docs/examples/sites/update-variable.md create mode 100644 docs/examples/sites/update.md create mode 100644 docs/examples/tokens/create-file-token.md create mode 100644 docs/examples/tokens/delete.md create mode 100644 docs/examples/tokens/get.md create mode 100644 docs/examples/tokens/list.md create mode 100644 docs/examples/tokens/update.md create mode 100644 src/enums/adapter.ts create mode 100644 src/enums/build-runtime.ts create mode 100644 src/enums/deployment-download-type.ts create mode 100644 src/enums/framework.ts create mode 100644 src/enums/v-c-s-deployment-type.ts create mode 100644 src/services/sites.ts create mode 100644 src/services/tokens.ts diff --git a/README.md b/README.md index b7fd5664..687a2dc6 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # Appwrite Node.js SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-node.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.6.2-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.7.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.6.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-node/releases).** +**This SDK is compatible with Appwrite server version 1.7.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-node/releases).** > This is the Node.js SDK for integrating with Appwrite from your Node.js server-side code. If you're looking to integrate from the browser, you should check [appwrite/sdk-for-web](https://github.com/appwrite/sdk-for-web) diff --git a/docs/examples/avatars/get-browser.md b/docs/examples/avatars/get-browser.md index 3bcd70d0..1cc825d9 100644 --- a/docs/examples/avatars/get-browser.md +++ b/docs/examples/avatars/get-browser.md @@ -11,5 +11,5 @@ const result = await avatars.getBrowser( sdk.Browser.AvantBrowser, // code 0, // width (optional) 0, // height (optional) - 0 // quality (optional) + -1 // quality (optional) ); diff --git a/docs/examples/avatars/get-credit-card.md b/docs/examples/avatars/get-credit-card.md index a60c2da8..7d62a960 100644 --- a/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/avatars/get-credit-card.md @@ -11,5 +11,5 @@ const result = await avatars.getCreditCard( sdk.CreditCard.AmericanExpress, // code 0, // width (optional) 0, // height (optional) - 0 // quality (optional) + -1 // quality (optional) ); diff --git a/docs/examples/avatars/get-flag.md b/docs/examples/avatars/get-flag.md index df0164d2..a62f56dd 100644 --- a/docs/examples/avatars/get-flag.md +++ b/docs/examples/avatars/get-flag.md @@ -11,5 +11,5 @@ const result = await avatars.getFlag( sdk.Flag.Afghanistan, // code 0, // width (optional) 0, // height (optional) - 0 // quality (optional) + -1 // quality (optional) ); diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index a2e77b92..44cfc3c1 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -2,8 +2,9 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setSession(''); // The user session to authenticate with + .setSession('') // The user session to authenticate with + .setKey('') // Your secret API key + .setJWT(''); // Your secret JSON Web Token const databases = new sdk.Databases(client); diff --git a/docs/examples/databases/create-documents.md b/docs/examples/databases/create-documents.md index cc8fd01a..1b208822 100644 --- a/docs/examples/databases/create-documents.md +++ b/docs/examples/databases/create-documents.md @@ -2,8 +2,7 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setSession(''); // The user session to authenticate with + .setKey(''); // Your secret API key const databases = new sdk.Databases(client); diff --git a/docs/examples/databases/create-index.md b/docs/examples/databases/create-index.md index bd616222..ed03322c 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -13,5 +13,6 @@ const result = await databases.createIndex( '', // key sdk.IndexType.Key, // type [], // attributes - [] // orders (optional) + [], // orders (optional) + [] // lengths (optional) ); diff --git a/docs/examples/functions/create-build.md b/docs/examples/functions/create-duplicate-deployment.md similarity index 87% rename from docs/examples/functions/create-build.md rename to docs/examples/functions/create-duplicate-deployment.md index c9434c07..33f77ffd 100644 --- a/docs/examples/functions/create-build.md +++ b/docs/examples/functions/create-duplicate-deployment.md @@ -7,7 +7,7 @@ const client = new sdk.Client() const functions = new sdk.Functions(client); -const result = await functions.createBuild( +const result = await functions.createDuplicateDeployment( '', // functionId '', // deploymentId '' // buildId (optional) diff --git a/docs/examples/functions/create-template-deployment.md b/docs/examples/functions/create-template-deployment.md new file mode 100644 index 00000000..eef7148f --- /dev/null +++ b/docs/examples/functions/create-template-deployment.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.createTemplateDeployment( + '', // functionId + '', // repository + '', // owner + '', // rootDirectory + '', // version + false // activate (optional) +); diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index 7146591b..5e75d19b 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -10,5 +10,6 @@ const functions = new sdk.Functions(client); const result = await functions.createVariable( '', // functionId '', // key - '' // value + '', // value + false // secret (optional) ); diff --git a/docs/examples/functions/create-vcs-deployment.md b/docs/examples/functions/create-vcs-deployment.md new file mode 100644 index 00000000..ba1067f5 --- /dev/null +++ b/docs/examples/functions/create-vcs-deployment.md @@ -0,0 +1,15 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const functions = new sdk.Functions(client); + +const result = await functions.createVcsDeployment( + '', // functionId + sdk.VCSDeploymentType.Branch, // type + '', // reference + false // activate (optional) +); diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index 90b4300e..646e2e5b 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -25,9 +25,5 @@ const result = await functions.create( '', // providerBranch (optional) false, // providerSilentMode (optional) '', // providerRootDirectory (optional) - '', // templateRepository (optional) - '', // templateOwner (optional) - '', // templateRootDirectory (optional) - '', // templateVersion (optional) '' // specification (optional) ); diff --git a/docs/examples/functions/get-deployment-download.md b/docs/examples/functions/get-deployment-download.md index cde26a43..5ba10353 100644 --- a/docs/examples/functions/get-deployment-download.md +++ b/docs/examples/functions/get-deployment-download.md @@ -9,5 +9,6 @@ const functions = new sdk.Functions(client); const result = await functions.getDeploymentDownload( '', // functionId - '' // deploymentId + '', // deploymentId + sdk.DeploymentDownloadType.Source // type (optional) ); diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md index 81e2379f..24d3e54e 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -9,6 +9,5 @@ const functions = new sdk.Functions(client); const result = await functions.listExecutions( '', // functionId - [], // queries (optional) - '' // search (optional) + [] // queries (optional) ); diff --git a/docs/examples/functions/update-deployment-build.md b/docs/examples/functions/update-deployment-status.md similarity index 87% rename from docs/examples/functions/update-deployment-build.md rename to docs/examples/functions/update-deployment-status.md index 7b5594c0..e7ce4a81 100644 --- a/docs/examples/functions/update-deployment-build.md +++ b/docs/examples/functions/update-deployment-status.md @@ -7,7 +7,7 @@ const client = new sdk.Client() const functions = new sdk.Functions(client); -const result = await functions.updateDeploymentBuild( +const result = await functions.updateDeploymentStatus( '', // functionId '' // deploymentId ); diff --git a/docs/examples/functions/update-deployment.md b/docs/examples/functions/update-function-deployment.md similarity index 87% rename from docs/examples/functions/update-deployment.md rename to docs/examples/functions/update-function-deployment.md index e27bad4d..feef831e 100644 --- a/docs/examples/functions/update-deployment.md +++ b/docs/examples/functions/update-function-deployment.md @@ -7,7 +7,7 @@ const client = new sdk.Client() const functions = new sdk.Functions(client); -const result = await functions.updateDeployment( +const result = await functions.updateFunctionDeployment( '', // functionId '' // deploymentId ); diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index e24ff882..d9a7ac7e 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -11,5 +11,6 @@ const result = await functions.updateVariable( '', // functionId '', // variableId '', // key - '' // value (optional) + '', // value (optional) + false // secret (optional) ); diff --git a/docs/examples/sites/create-deployment.md b/docs/examples/sites/create-deployment.md new file mode 100644 index 00000000..010da729 --- /dev/null +++ b/docs/examples/sites/create-deployment.md @@ -0,0 +1,18 @@ +const sdk = require('node-appwrite'); +const fs = require('fs'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.createDeployment( + '', // siteId + InputFile.fromPath('/path/to/file', 'filename'), // code + false, // activate + '', // installCommand (optional) + '', // buildCommand (optional) + '' // outputDirectory (optional) +); diff --git a/docs/examples/sites/create-duplicate-deployment.md b/docs/examples/sites/create-duplicate-deployment.md new file mode 100644 index 00000000..3ce35ff5 --- /dev/null +++ b/docs/examples/sites/create-duplicate-deployment.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.createDuplicateDeployment( + '', // siteId + '' // deploymentId +); diff --git a/docs/examples/sites/create-template-deployment.md b/docs/examples/sites/create-template-deployment.md new file mode 100644 index 00000000..aebc2b8f --- /dev/null +++ b/docs/examples/sites/create-template-deployment.md @@ -0,0 +1,17 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.createTemplateDeployment( + '', // siteId + '', // repository + '', // owner + '', // rootDirectory + '', // version + false // activate (optional) +); diff --git a/docs/examples/sites/create-variable.md b/docs/examples/sites/create-variable.md new file mode 100644 index 00000000..59a51eea --- /dev/null +++ b/docs/examples/sites/create-variable.md @@ -0,0 +1,15 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.createVariable( + '', // siteId + '', // key + '', // value + false // secret (optional) +); diff --git a/docs/examples/sites/create-vcs-deployment.md b/docs/examples/sites/create-vcs-deployment.md new file mode 100644 index 00000000..4bd84977 --- /dev/null +++ b/docs/examples/sites/create-vcs-deployment.md @@ -0,0 +1,15 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.createVcsDeployment( + '', // siteId + sdk.VCSDeploymentType.Branch, // type + '', // reference + false // activate (optional) +); diff --git a/docs/examples/sites/create.md b/docs/examples/sites/create.md new file mode 100644 index 00000000..ad680592 --- /dev/null +++ b/docs/examples/sites/create.md @@ -0,0 +1,29 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.create( + '', // siteId + '', // name + sdk..Analog, // framework + sdk..Node145, // buildRuntime + false, // enabled (optional) + false, // logging (optional) + 1, // timeout (optional) + '', // installCommand (optional) + '', // buildCommand (optional) + '', // outputDirectory (optional) + sdk..Static, // adapter (optional) + '', // installationId (optional) + '', // fallbackFile (optional) + '', // providerRepositoryId (optional) + '', // providerBranch (optional) + false, // providerSilentMode (optional) + '', // providerRootDirectory (optional) + '' // specification (optional) +); diff --git a/docs/examples/sites/delete-deployment.md b/docs/examples/sites/delete-deployment.md new file mode 100644 index 00000000..c04a5c38 --- /dev/null +++ b/docs/examples/sites/delete-deployment.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.deleteDeployment( + '', // siteId + '' // deploymentId +); diff --git a/docs/examples/sites/delete-log.md b/docs/examples/sites/delete-log.md new file mode 100644 index 00000000..88e58a5f --- /dev/null +++ b/docs/examples/sites/delete-log.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.deleteLog( + '', // siteId + '' // logId +); diff --git a/docs/examples/sites/delete-variable.md b/docs/examples/sites/delete-variable.md new file mode 100644 index 00000000..abc7e3ac --- /dev/null +++ b/docs/examples/sites/delete-variable.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.deleteVariable( + '', // siteId + '' // variableId +); diff --git a/docs/examples/sites/delete.md b/docs/examples/sites/delete.md new file mode 100644 index 00000000..87fd7d23 --- /dev/null +++ b/docs/examples/sites/delete.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.delete( + '' // siteId +); diff --git a/docs/examples/sites/get-deployment-download.md b/docs/examples/sites/get-deployment-download.md new file mode 100644 index 00000000..414d50d4 --- /dev/null +++ b/docs/examples/sites/get-deployment-download.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.getDeploymentDownload( + '', // siteId + '', // deploymentId + sdk.DeploymentDownloadType.Source // type (optional) +); diff --git a/docs/examples/sites/get-deployment.md b/docs/examples/sites/get-deployment.md new file mode 100644 index 00000000..3f06b1ab --- /dev/null +++ b/docs/examples/sites/get-deployment.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.getDeployment( + '', // siteId + '' // deploymentId +); diff --git a/docs/examples/sites/get-log.md b/docs/examples/sites/get-log.md new file mode 100644 index 00000000..4318882c --- /dev/null +++ b/docs/examples/sites/get-log.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.getLog( + '', // siteId + '' // logId +); diff --git a/docs/examples/sites/get-variable.md b/docs/examples/sites/get-variable.md new file mode 100644 index 00000000..287336fd --- /dev/null +++ b/docs/examples/sites/get-variable.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.getVariable( + '', // siteId + '' // variableId +); diff --git a/docs/examples/sites/get.md b/docs/examples/sites/get.md new file mode 100644 index 00000000..d382efa2 --- /dev/null +++ b/docs/examples/sites/get.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.get( + '' // siteId +); diff --git a/docs/examples/sites/list-deployments.md b/docs/examples/sites/list-deployments.md new file mode 100644 index 00000000..dce44ed1 --- /dev/null +++ b/docs/examples/sites/list-deployments.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.listDeployments( + '', // siteId + [], // queries (optional) + '' // search (optional) +); diff --git a/docs/examples/sites/list-frameworks.md b/docs/examples/sites/list-frameworks.md new file mode 100644 index 00000000..0376e4b5 --- /dev/null +++ b/docs/examples/sites/list-frameworks.md @@ -0,0 +1,10 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.listFrameworks(); diff --git a/docs/examples/sites/list-logs.md b/docs/examples/sites/list-logs.md new file mode 100644 index 00000000..faaf3d35 --- /dev/null +++ b/docs/examples/sites/list-logs.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.listLogs( + '', // siteId + [] // queries (optional) +); diff --git a/docs/examples/sites/list-specifications.md b/docs/examples/sites/list-specifications.md new file mode 100644 index 00000000..24ec74c4 --- /dev/null +++ b/docs/examples/sites/list-specifications.md @@ -0,0 +1,10 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.listSpecifications(); diff --git a/docs/examples/sites/list-variables.md b/docs/examples/sites/list-variables.md new file mode 100644 index 00000000..948e977a --- /dev/null +++ b/docs/examples/sites/list-variables.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.listVariables( + '' // siteId +); diff --git a/docs/examples/sites/list.md b/docs/examples/sites/list.md new file mode 100644 index 00000000..184f4f3f --- /dev/null +++ b/docs/examples/sites/list.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.list( + [], // queries (optional) + '' // search (optional) +); diff --git a/docs/examples/sites/update-deployment-status.md b/docs/examples/sites/update-deployment-status.md new file mode 100644 index 00000000..77564245 --- /dev/null +++ b/docs/examples/sites/update-deployment-status.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.updateDeploymentStatus( + '', // siteId + '' // deploymentId +); diff --git a/docs/examples/sites/update-site-deployment.md b/docs/examples/sites/update-site-deployment.md new file mode 100644 index 00000000..bfbc0f35 --- /dev/null +++ b/docs/examples/sites/update-site-deployment.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.updateSiteDeployment( + '', // siteId + '' // deploymentId +); diff --git a/docs/examples/sites/update-variable.md b/docs/examples/sites/update-variable.md new file mode 100644 index 00000000..c790ca10 --- /dev/null +++ b/docs/examples/sites/update-variable.md @@ -0,0 +1,16 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.updateVariable( + '', // siteId + '', // variableId + '', // key + '', // value (optional) + false // secret (optional) +); diff --git a/docs/examples/sites/update.md b/docs/examples/sites/update.md new file mode 100644 index 00000000..e801aed1 --- /dev/null +++ b/docs/examples/sites/update.md @@ -0,0 +1,29 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new sdk.Sites(client); + +const result = await sites.update( + '', // siteId + '', // name + sdk..Analog, // framework + false, // enabled (optional) + false, // logging (optional) + 1, // timeout (optional) + '', // installCommand (optional) + '', // buildCommand (optional) + '', // outputDirectory (optional) + sdk..Node145, // buildRuntime (optional) + sdk..Static, // adapter (optional) + '', // fallbackFile (optional) + '', // installationId (optional) + '', // providerRepositoryId (optional) + '', // providerBranch (optional) + false, // providerSilentMode (optional) + '', // providerRootDirectory (optional) + '' // specification (optional) +); diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md index 051f51c8..6935bede 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -9,5 +9,6 @@ const storage = new sdk.Storage(client); const result = await storage.getFileDownload( '', // bucketId - '' // fileId + '', // fileId + '' // token (optional) ); diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index 45da053c..fe24419c 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -13,12 +13,13 @@ const result = await storage.getFilePreview( 0, // width (optional) 0, // height (optional) sdk.ImageGravity.Center, // gravity (optional) - 0, // quality (optional) + -1, // quality (optional) 0, // borderWidth (optional) '', // borderColor (optional) 0, // borderRadius (optional) 0, // opacity (optional) -360, // rotation (optional) '', // background (optional) - sdk.ImageFormat.Jpg // output (optional) + sdk.ImageFormat.Jpg, // output (optional) + '' // token (optional) ); diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md index fd06b308..9493cfb0 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -9,5 +9,6 @@ const storage = new sdk.Storage(client); const result = await storage.getFileView( '', // bucketId - '' // fileId + '', // fileId + '' // token (optional) ); diff --git a/docs/examples/tokens/create-file-token.md b/docs/examples/tokens/create-file-token.md new file mode 100644 index 00000000..d1409c4a --- /dev/null +++ b/docs/examples/tokens/create-file-token.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tokens = new sdk.Tokens(client); + +const result = await tokens.createFileToken( + '', // bucketId + '', // fileId + '' // expire (optional) +); diff --git a/docs/examples/tokens/delete.md b/docs/examples/tokens/delete.md new file mode 100644 index 00000000..1249839f --- /dev/null +++ b/docs/examples/tokens/delete.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tokens = new sdk.Tokens(client); + +const result = await tokens.delete( + '' // tokenId +); diff --git a/docs/examples/tokens/get.md b/docs/examples/tokens/get.md new file mode 100644 index 00000000..efb2b8c1 --- /dev/null +++ b/docs/examples/tokens/get.md @@ -0,0 +1,12 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tokens = new sdk.Tokens(client); + +const result = await tokens.get( + '' // tokenId +); diff --git a/docs/examples/tokens/list.md b/docs/examples/tokens/list.md new file mode 100644 index 00000000..8b708f27 --- /dev/null +++ b/docs/examples/tokens/list.md @@ -0,0 +1,14 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tokens = new sdk.Tokens(client); + +const result = await tokens.list( + '', // bucketId + '', // fileId + [] // queries (optional) +); diff --git a/docs/examples/tokens/update.md b/docs/examples/tokens/update.md new file mode 100644 index 00000000..ebf5aa9b --- /dev/null +++ b/docs/examples/tokens/update.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tokens = new sdk.Tokens(client); + +const result = await tokens.update( + '', // tokenId + '' // expire (optional) +); diff --git a/docs/examples/users/list-memberships.md b/docs/examples/users/list-memberships.md index 080688a9..bbe4ed37 100644 --- a/docs/examples/users/list-memberships.md +++ b/docs/examples/users/list-memberships.md @@ -8,5 +8,7 @@ const client = new sdk.Client() const users = new sdk.Users(client); const result = await users.listMemberships( - '' // userId + '', // userId + [], // queries (optional) + '' // search (optional) ); diff --git a/package.json b/package.json index aa940b32..9d099c54 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "node-appwrite", "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": "16.1.0-rc.1", + "version": "16.2.0", "license": "BSD-3-Clause", "main": "dist/index.js", "type": "commonjs", diff --git a/src/client.ts b/src/client.ts index 70b7ad5a..9f3631e0 100644 --- a/src/client.ts +++ b/src/client.ts @@ -33,7 +33,7 @@ class AppwriteException extends Error { } function getUserAgent() { - let ua = 'AppwriteNodeJSSDK/16.1.0-rc.1'; + let ua = 'AppwriteNodeJSSDK/16.2.0'; // `process` is a global in Node.js, but not fully available in all runtimes. const platform: string[] = []; @@ -82,9 +82,9 @@ class Client { 'x-sdk-name': 'Node.js', 'x-sdk-platform': 'server', 'x-sdk-language': 'nodejs', - 'x-sdk-version': '16.1.0-rc.1', + 'x-sdk-version': '16.2.0', 'user-agent' : getUserAgent(), - 'X-Appwrite-Response-Format': '1.6.0', + 'X-Appwrite-Response-Format': '1.7.0', }; /** diff --git a/src/enums/adapter.ts b/src/enums/adapter.ts new file mode 100644 index 00000000..a3b1ae0c --- /dev/null +++ b/src/enums/adapter.ts @@ -0,0 +1,4 @@ +export enum Adapter { + Static = 'static', + Ssr = 'ssr', +} \ No newline at end of file diff --git a/src/enums/build-runtime.ts b/src/enums/build-runtime.ts new file mode 100644 index 00000000..a2180ef7 --- /dev/null +++ b/src/enums/build-runtime.ts @@ -0,0 +1,65 @@ +export enum BuildRuntime { + Node145 = 'node-14.5', + Node160 = 'node-16.0', + Node180 = 'node-18.0', + Node190 = 'node-19.0', + Node200 = 'node-20.0', + Node210 = 'node-21.0', + Node22 = 'node-22', + Php80 = 'php-8.0', + Php81 = 'php-8.1', + Php82 = 'php-8.2', + Php83 = 'php-8.3', + Ruby30 = 'ruby-3.0', + Ruby31 = 'ruby-3.1', + Ruby32 = 'ruby-3.2', + Ruby33 = 'ruby-3.3', + Python38 = 'python-3.8', + Python39 = 'python-3.9', + Python310 = 'python-3.10', + Python311 = 'python-3.11', + Python312 = 'python-3.12', + Pythonml311 = 'python-ml-3.11', + Pythonml312 = 'python-ml-3.12', + Deno121 = 'deno-1.21', + Deno124 = 'deno-1.24', + Deno135 = 'deno-1.35', + Deno140 = 'deno-1.40', + Deno146 = 'deno-1.46', + Deno20 = 'deno-2.0', + Dart215 = 'dart-2.15', + Dart216 = 'dart-2.16', + Dart217 = 'dart-2.17', + Dart218 = 'dart-2.18', + Dart219 = 'dart-2.19', + Dart30 = 'dart-3.0', + Dart31 = 'dart-3.1', + Dart33 = 'dart-3.3', + Dart35 = 'dart-3.5', + Dotnet60 = 'dotnet-6.0', + Dotnet70 = 'dotnet-7.0', + Dotnet80 = 'dotnet-8.0', + Java80 = 'java-8.0', + Java110 = 'java-11.0', + Java170 = 'java-17.0', + Java180 = 'java-18.0', + Java210 = 'java-21.0', + Java22 = 'java-22', + Swift55 = 'swift-5.5', + Swift58 = 'swift-5.8', + Swift59 = 'swift-5.9', + Swift510 = 'swift-5.10', + Kotlin16 = 'kotlin-1.6', + Kotlin18 = 'kotlin-1.8', + Kotlin19 = 'kotlin-1.9', + Kotlin20 = 'kotlin-2.0', + Cpp17 = 'cpp-17', + Cpp20 = 'cpp-20', + Bun10 = 'bun-1.0', + Bun11 = 'bun-1.1', + Go123 = 'go-1.23', + Static1 = 'static-1', + Flutter324 = 'flutter-3.24', + Flutter327 = 'flutter-3.27', + Flutter329 = 'flutter-3.29', +} \ No newline at end of file diff --git a/src/enums/deployment-download-type.ts b/src/enums/deployment-download-type.ts new file mode 100644 index 00000000..538709bc --- /dev/null +++ b/src/enums/deployment-download-type.ts @@ -0,0 +1,4 @@ +export enum DeploymentDownloadType { + Source = 'source', + Output = 'output', +} \ No newline at end of file diff --git a/src/enums/framework.ts b/src/enums/framework.ts new file mode 100644 index 00000000..497c1b27 --- /dev/null +++ b/src/enums/framework.ts @@ -0,0 +1,16 @@ +export enum Framework { + Analog = 'analog', + Angular = 'angular', + Nextjs = 'nextjs', + React = 'react', + Nuxt = 'nuxt', + Vue = 'vue', + Sveltekit = 'sveltekit', + Astro = 'astro', + Remix = 'remix', + Lynx = 'lynx', + Flutter = 'flutter', + Reactnative = 'react-native', + Vite = 'vite', + Other = 'other', +} \ No newline at end of file diff --git a/src/enums/image-format.ts b/src/enums/image-format.ts index bcbe3e93..5aad5f08 100644 --- a/src/enums/image-format.ts +++ b/src/enums/image-format.ts @@ -1,7 +1,6 @@ export enum ImageFormat { Jpg = 'jpg', Jpeg = 'jpeg', - Gif = 'gif', Png = 'png', Webp = 'webp', Heic = 'heic', diff --git a/src/enums/runtime.ts b/src/enums/runtime.ts index a4042bb8..3955557d 100644 --- a/src/enums/runtime.ts +++ b/src/enums/runtime.ts @@ -20,6 +20,7 @@ export enum Runtime { Python311 = 'python-3.11', Python312 = 'python-3.12', Pythonml311 = 'python-ml-3.11', + Pythonml312 = 'python-ml-3.12', Deno121 = 'deno-1.21', Deno124 = 'deno-1.24', Deno135 = 'deno-1.35', @@ -30,6 +31,7 @@ export enum Runtime { Dart216 = 'dart-2.16', Dart217 = 'dart-2.17', Dart218 = 'dart-2.18', + Dart219 = 'dart-2.19', Dart30 = 'dart-3.0', Dart31 = 'dart-3.1', Dart33 = 'dart-3.3', @@ -58,4 +60,6 @@ export enum Runtime { Go123 = 'go-1.23', Static1 = 'static-1', Flutter324 = 'flutter-3.24', + Flutter327 = 'flutter-3.27', + Flutter329 = 'flutter-3.29', } \ No newline at end of file diff --git a/src/enums/v-c-s-deployment-type.ts b/src/enums/v-c-s-deployment-type.ts new file mode 100644 index 00000000..e685a49c --- /dev/null +++ b/src/enums/v-c-s-deployment-type.ts @@ -0,0 +1,5 @@ +export enum VCSDeploymentType { + Branch = 'branch', + Commit = 'commit', + Tag = 'tag', +} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index bb343747..849d8b10 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,8 +7,10 @@ export { Graphql } from './services/graphql'; export { Health } from './services/health'; export { Locale } from './services/locale'; export { Messaging } from './services/messaging'; +export { Sites } from './services/sites'; export { Storage } from './services/storage'; export { Teams } from './services/teams'; +export { Tokens } from './services/tokens'; export { Users } from './services/users'; export type { Models, Payload, UploadProgress } from './client'; export type { QueryTypes, QueryTypesList } from './query'; @@ -25,10 +27,15 @@ export { RelationshipType } from './enums/relationship-type'; export { RelationMutate } from './enums/relation-mutate'; export { IndexType } from './enums/index-type'; export { Runtime } from './enums/runtime'; +export { VCSDeploymentType } from './enums/v-c-s-deployment-type'; +export { DeploymentDownloadType } from './enums/deployment-download-type'; export { ExecutionMethod } from './enums/execution-method'; export { Name } from './enums/name'; export { MessagePriority } from './enums/message-priority'; export { SmtpEncryption } from './enums/smtp-encryption'; +export { Framework } from './enums/framework'; +export { BuildRuntime } from './enums/build-runtime'; +export { Adapter } from './enums/adapter'; export { Compression } from './enums/compression'; export { ImageGravity } from './enums/image-gravity'; export { ImageFormat } from './enums/image-format'; diff --git a/src/models.ts b/src/models.ts index 47c1010c..ed9cf513 100644 --- a/src/models.ts +++ b/src/models.ts @@ -132,6 +132,19 @@ export namespace Models { */ buckets: Bucket[]; } + /** + * Resource Tokens List + */ + export type ResourceTokenList = { + /** + * Total number of tokens documents that matched your query. + */ + total: number; + /** + * List of tokens. + */ + tokens: ResourceToken[]; + } /** * Teams List */ @@ -158,6 +171,19 @@ export namespace Models { */ memberships: Membership[]; } + /** + * Sites List + */ + export type SiteList = { + /** + * Total number of sites documents that matched your query. + */ + total: number; + /** + * List of sites. + */ + sites: Site[]; + } /** * Functions List */ @@ -171,6 +197,19 @@ export namespace Models { */ functions: Function[]; } + /** + * Frameworks List + */ + export type FrameworkList = { + /** + * Total number of frameworks documents that matched your query. + */ + total: number; + /** + * List of frameworks. + */ + frameworks: Framework[]; + } /** * Runtimes List */ @@ -960,6 +999,10 @@ export namespace Models { * Index attributes. */ attributes: string[]; + /** + * Index attributes length. + */ + lengths: number[]; /** * Index orders. */ @@ -1634,6 +1677,39 @@ export namespace Models { */ antivirus: boolean; } + /** + * ResourceToken + */ + export type ResourceToken = { + /** + * Token ID. + */ + $id: string; + /** + * Token creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Resource ID. + */ + resourceId: string; + /** + * Resource type. + */ + resourceType: string; + /** + * Token expiration date in ISO 8601 format. + */ + expire: string; + /** + * JWT encoded string. + */ + secret: string; + /** + * Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours. + */ + accessedAt: string; + } /** * Team */ @@ -1720,6 +1796,127 @@ export namespace Models { */ roles: string[]; } + /** + * Site + */ + export type Site = { + /** + * Site ID. + */ + $id: string; + /** + * Site creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Site update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Site name. + */ + name: string; + /** + * Site enabled. + */ + enabled: boolean; + /** + * Is the site deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the site to update it with the latest configuration. + */ + live: boolean; + /** + * When disabled, request logs will exclude logs and errors, and site responses will be slightly faster. + */ + logging: boolean; + /** + * Site framework. + */ + framework: string; + /** + * Site's active deployment ID. + */ + deploymentId: string; + /** + * Active deployment creation date in ISO 8601 format. + */ + deploymentCreatedAt: string; + /** + * Screenshot of active deployment with light theme preference file ID. + */ + deploymentScreenshotLight: string; + /** + * Screenshot of active deployment with dark theme preference file ID. + */ + deploymentScreenshotDark: string; + /** + * Site's latest deployment ID. + */ + latestDeploymentId: string; + /** + * Latest deployment creation date in ISO 8601 format. + */ + latestDeploymentCreatedAt: string; + /** + * Status of latest deployment. Possible values are "waiting", "processing", "building", "ready", and "failed". + */ + latestDeploymentStatus: string; + /** + * Site variables. + */ + vars: Variable[]; + /** + * Site request timeout in seconds. + */ + timeout: number; + /** + * The install command used to install the site dependencies. + */ + installCommand: string; + /** + * The build command used to build the site. + */ + buildCommand: string; + /** + * The directory where the site build output is located. + */ + outputDirectory: string; + /** + * Site VCS (Version Control System) installation id. + */ + installationId: string; + /** + * VCS (Version Control System) Repository ID + */ + providerRepositoryId: string; + /** + * VCS (Version Control System) branch name + */ + providerBranch: string; + /** + * Path to site in VCS (Version Control System) repository + */ + providerRootDirectory: string; + /** + * 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; + /** + * Site build runtime. + */ + buildRuntime: string; + /** + * Site framework adapter. + */ + adapter: string; + /** + * Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed. + */ + fallbackFile: string; + } /** * Function */ @@ -1753,17 +1950,33 @@ export namespace Models { */ live: boolean; /** - * Whether executions will be logged. When set to false, executions will not be logged, but will reduce resource used by your Appwrite project. + * When disabled, executions will exclude logs and errors, and will be slightly faster. */ logging: boolean; /** - * Function execution runtime. + * Function execution and build runtime. */ runtime: string; /** * Function's active deployment ID. */ - deployment: string; + deploymentId: string; + /** + * Active deployment creation date in ISO 8601 format. + */ + deploymentCreatedAt: string; + /** + * Function's latest deployment ID. + */ + latestDeploymentId: string; + /** + * Latest deployment creation date in ISO 8601 format. + */ + latestDeploymentCreatedAt: string; + /** + * Status of latest deployment. Possible values are "waiting", "processing", "building", "ready", and "failed". + */ + latestDeploymentStatus: string; /** * Allowed permission scopes. */ @@ -1858,6 +2071,56 @@ export namespace Models { */ supports: string[]; } + /** + * Framework + */ + export type Framework = { + /** + * Framework key. + */ + key: string; + /** + * Framework Name. + */ + name: string; + /** + * Default runtime version. + */ + buildRuntime: string; + /** + * List of supported runtime versions. + */ + runtimes: string[]; + /** + * List of supported adapters. + */ + adapters: FrameworkAdapter[]; + } + /** + * Framework Adapter + */ + export type FrameworkAdapter = { + /** + * Adapter key. + */ + key: string; + /** + * Default command to download dependencies. + */ + installCommand: string; + /** + * Default command to build site into output directory. + */ + buildCommand: string; + /** + * Default output directory of build. + */ + outputDirectory: string; + /** + * Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed. + */ + fallbackFile: string; + } /** * Deployment */ @@ -1893,11 +2156,15 @@ export namespace Models { /** * The code size in bytes. */ - size: number; + sourceSize: number; /** * The build output size in bytes. */ buildSize: number; + /** + * The total size in bytes (source and build output). + */ + totalSize: number; /** * The current build ID. */ @@ -1907,7 +2174,15 @@ export namespace Models { */ activate: boolean; /** - * The deployment status. Possible values are "processing", "building", "waiting", "ready", and "failed". + * Screenshot with light theme preference file ID. + */ + screenshotLight: string; + /** + * Screenshot with dark theme preference file ID. + */ + screenshotDark: string; + /** + * The deployment status. Possible values are "waiting", "processing", "building", "ready", and "failed". */ status: string; /** @@ -1917,7 +2192,7 @@ export namespace Models { /** * The current build time in seconds. */ - buildTime: number; + buildDuration: number; /** * The name of the vcs provider repository */ @@ -2024,7 +2299,7 @@ export namespace Models { */ errors: string; /** - * Function execution duration in seconds. + * Resource(function/site) execution duration in seconds. */ duration: number; /** @@ -2032,47 +2307,6 @@ export namespace Models { */ 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; - } /** * Variable */ @@ -2097,6 +2331,10 @@ export namespace Models { * Variable value. */ value: string; + /** + * Variable secret flag. Secret variables can only be updated or deleted, but never read. + */ + secret: boolean; /** * Service to which the variable belongs. Possible values are "project", "function" */ diff --git a/src/services/databases.ts b/src/services/databases.ts index 42112792..80d1a6a5 100644 --- a/src/services/databases.ts +++ b/src/services/databases.ts @@ -1661,7 +1661,6 @@ export class Databases { } /** * Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. - * * @param {string} databaseId * @param {string} collectionId @@ -1960,10 +1959,11 @@ Attributes can be `key`, `fulltext`, and `unique`. * @param {IndexType} type * @param {string[]} attributes * @param {string[]} orders + * @param {number[]} lengths * @throws {AppwriteException} * @returns {Promise} */ - createIndex(databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[]): Promise { + createIndex(databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[], lengths?: number[]): Promise { if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); } @@ -1993,6 +1993,9 @@ Attributes can be `key`, `fulltext`, and `unique`. if (typeof orders !== 'undefined') { payload['orders'] = orders; } + if (typeof lengths !== 'undefined') { + payload['lengths'] = lengths; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { diff --git a/src/services/functions.ts b/src/services/functions.ts index 0c77700f..7ed681f1 100644 --- a/src/services/functions.ts +++ b/src/services/functions.ts @@ -1,6 +1,8 @@ import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; import { Runtime } from '../enums/runtime'; +import { VCSDeploymentType } from '../enums/v-c-s-deployment-type'; +import { DeploymentDownloadType } from '../enums/deployment-download-type'; import { ExecutionMethod } from '../enums/execution-method'; export class Functions { @@ -59,15 +61,11 @@ export class Functions { * @param {string} providerBranch * @param {boolean} providerSilentMode * @param {string} providerRootDirectory - * @param {string} templateRepository - * @param {string} templateOwner - * @param {string} templateRootDirectory - * @param {string} templateVersion * @param {string} specification * @throws {AppwriteException} * @returns {Promise} */ - 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 { + 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, specification?: string): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -130,18 +128,6 @@ export class Functions { 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; - } if (typeof specification !== 'undefined') { payload['specification'] = specification; } @@ -181,7 +167,6 @@ export class Functions { } /** * List allowed function specifications for this instance. - * * @throws {AppwriteException} * @returns {Promise} @@ -350,7 +335,40 @@ export class Functions { ); } /** - * Get a list of all the project's code deployments. You can use the query params to filter your results. + * Update the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function. + * + * @param {string} functionId + * @param {string} deploymentId + * @throws {AppwriteException} + * @returns {Promise} + */ + updateFunctionDeployment(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}/deployment'.replace('{functionId}', functionId); + const payload: Payload = {}; + if (typeof deploymentId !== 'undefined') { + payload['deploymentId'] = deploymentId; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + /** + * Get a list of all the function's code deployments. You can use the query params to filter your results. * * @param {string} functionId * @param {string[]} queries @@ -436,51 +454,89 @@ Use the "command" param to set the entrypoint used to execute your cod ); } /** - * Get a code deployment by its unique ID. + * Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build. * * @param {string} functionId * @param {string} deploymentId + * @param {string} buildId * @throws {AppwriteException} * @returns {Promise} */ - getDeployment(functionId: string, deploymentId: string): Promise { + createDuplicateDeployment(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}'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId); + const apiPath = '/functions/{functionId}/deployments/duplicate'.replace('{functionId}', functionId); const payload: Payload = {}; + if (typeof deploymentId !== 'undefined') { + payload['deploymentId'] = deploymentId; + } + if (typeof buildId !== 'undefined') { + payload['buildId'] = buildId; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', } return this.client.call( - 'get', + 'post', uri, apiHeaders, payload, ); } /** - * 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. + * Create a deployment based on a template. + +Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/server/functions#listTemplates) to find the template details. * * @param {string} functionId - * @param {string} deploymentId + * @param {string} repository + * @param {string} owner + * @param {string} rootDirectory + * @param {string} version + * @param {boolean} activate * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} */ - updateDeployment(functionId: string, deploymentId: string): Promise { + createTemplateDeployment(functionId: string, repository: string, owner: string, rootDirectory: string, version: string, activate?: boolean): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } - if (typeof deploymentId === 'undefined') { - throw new AppwriteException('Missing required parameter: "deploymentId"'); + if (typeof repository === 'undefined') { + throw new AppwriteException('Missing required parameter: "repository"'); } - const apiPath = '/functions/{functionId}/deployments/{deploymentId}'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId); + if (typeof owner === 'undefined') { + throw new AppwriteException('Missing required parameter: "owner"'); + } + if (typeof rootDirectory === 'undefined') { + throw new AppwriteException('Missing required parameter: "rootDirectory"'); + } + if (typeof version === 'undefined') { + throw new AppwriteException('Missing required parameter: "version"'); + } + const apiPath = '/functions/{functionId}/deployments/template'.replace('{functionId}', functionId); const payload: Payload = {}; + if (typeof repository !== 'undefined') { + payload['repository'] = repository; + } + if (typeof owner !== 'undefined') { + payload['owner'] = owner; + } + if (typeof rootDirectory !== 'undefined') { + payload['rootDirectory'] = rootDirectory; + } + if (typeof version !== 'undefined') { + payload['version'] = version; + } + if (typeof activate !== 'undefined') { + payload['activate'] = activate; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -488,29 +544,45 @@ Use the "command" param to set the entrypoint used to execute your cod } return this.client.call( - 'patch', + 'post', uri, apiHeaders, payload, ); } /** - * Delete a code deployment by its unique ID. + * Create a deployment when a function is connected to VCS. + +This endpoint lets you create deployment from a branch, commit, or a tag. * * @param {string} functionId - * @param {string} deploymentId + * @param {VCSDeploymentType} type + * @param {string} reference + * @param {boolean} activate * @throws {AppwriteException} - * @returns {Promise<{}>} + * @returns {Promise} */ - deleteDeployment(functionId: string, deploymentId: string): Promise<{}> { + createVcsDeployment(functionId: string, type: VCSDeploymentType, reference: string, activate?: boolean): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } - if (typeof deploymentId === 'undefined') { - throw new AppwriteException('Missing required parameter: "deploymentId"'); + if (typeof type === 'undefined') { + throw new AppwriteException('Missing required parameter: "type"'); } - const apiPath = '/functions/{functionId}/deployments/{deploymentId}'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId); + if (typeof reference === 'undefined') { + throw new AppwriteException('Missing required parameter: "reference"'); + } + const apiPath = '/functions/{functionId}/deployments/vcs'.replace('{functionId}', functionId); const payload: Payload = {}; + if (typeof type !== 'undefined') { + payload['type'] = type; + } + if (typeof reference !== 'undefined') { + payload['reference'] = reference; + } + if (typeof activate !== 'undefined') { + payload['activate'] = activate; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -518,62 +590,57 @@ Use the "command" param to set the entrypoint used to execute your cod } return this.client.call( - 'delete', + 'post', uri, apiHeaders, payload, ); } /** - * Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build. + * Get a function deployment by its unique ID. * * @param {string} functionId * @param {string} deploymentId - * @param {string} buildId * @throws {AppwriteException} - * @returns {Promise<{}>} + * @returns {Promise} */ - createBuild(functionId: string, deploymentId: string, buildId?: string): Promise<{}> { + 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}/build'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId); + const apiPath = '/functions/{functionId}/deployments/{deploymentId}'.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); const apiHeaders: { [header: string]: string } = { - 'content-type': 'application/json', } return this.client.call( - 'post', + 'get', uri, apiHeaders, payload, ); } /** - * Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details. + * Delete a code deployment by its unique ID. * * @param {string} functionId * @param {string} deploymentId * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise<{}>} */ - updateDeploymentBuild(functionId: string, deploymentId: string): Promise { + 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}/build'.replace('{functionId}', functionId).replace('{deploymentId}', 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); @@ -582,21 +649,22 @@ Use the "command" param to set the entrypoint used to execute your cod } return this.client.call( - 'patch', + 'delete', uri, apiHeaders, payload, ); } /** - * Get a Deployment's contents by its unique ID. This endpoint supports range requests for partial or streaming file download. + * Get a function deployment 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} functionId * @param {string} deploymentId + * @param {DeploymentDownloadType} type * @throws {AppwriteException} * @returns {Promise} */ - getDeploymentDownload(functionId: string, deploymentId: string): Promise { + getDeploymentDownload(functionId: string, deploymentId: string, type?: DeploymentDownloadType): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -605,6 +673,9 @@ Use the "command" param to set the entrypoint used to execute your cod } const apiPath = '/functions/{functionId}/deployments/{deploymentId}/download'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId); const payload: Payload = {}; + if (typeof type !== 'undefined') { + payload['type'] = type; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -618,16 +689,45 @@ Use the "command" param to set the entrypoint used to execute your cod 'arrayBuffer' ); } + /** + * Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details. + * + * @param {string} functionId + * @param {string} deploymentId + * @throws {AppwriteException} + * @returns {Promise} + */ + updateDeploymentStatus(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}/status'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } /** * 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} */ - listExecutions(functionId: string, queries?: string[], search?: string): Promise { + listExecutions(functionId: string, queries?: string[]): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -636,9 +736,6 @@ Use the "command" param to set the entrypoint used to execute your cod if (typeof queries !== 'undefined') { payload['queries'] = queries; } - if (typeof search !== 'undefined') { - payload['search'] = search; - } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -732,7 +829,6 @@ Use the "command" param to set the entrypoint used to execute your cod } /** * Delete a function execution by its unique ID. - * * @param {string} functionId * @param {string} executionId @@ -792,10 +888,11 @@ Use the "command" param to set the entrypoint used to execute your cod * @param {string} functionId * @param {string} key * @param {string} value + * @param {boolean} secret * @throws {AppwriteException} * @returns {Promise} */ - createVariable(functionId: string, key: string, value: string): Promise { + createVariable(functionId: string, key: string, value: string, secret?: boolean): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -813,6 +910,9 @@ Use the "command" param to set the entrypoint used to execute your cod if (typeof value !== 'undefined') { payload['value'] = value; } + if (typeof secret !== 'undefined') { + payload['secret'] = secret; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -862,10 +962,11 @@ Use the "command" param to set the entrypoint used to execute your cod * @param {string} variableId * @param {string} key * @param {string} value + * @param {boolean} secret * @throws {AppwriteException} * @returns {Promise} */ - updateVariable(functionId: string, variableId: string, key: string, value?: string): Promise { + updateVariable(functionId: string, variableId: string, key: string, value?: string, secret?: boolean): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -883,6 +984,9 @@ Use the "command" param to set the entrypoint used to execute your cod if (typeof value !== 'undefined') { payload['value'] = value; } + if (typeof secret !== 'undefined') { + payload['secret'] = secret; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { diff --git a/src/services/sites.ts b/src/services/sites.ts new file mode 100644 index 00000000..3f857043 --- /dev/null +++ b/src/services/sites.ts @@ -0,0 +1,986 @@ +import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; +import type { Models } from '../models'; +import { Framework } from '../enums/framework'; +import { BuildRuntime } from '../enums/build-runtime'; +import { Adapter } from '../enums/adapter'; +import { VCSDeploymentType } from '../enums/v-c-s-deployment-type'; +import { DeploymentDownloadType } from '../enums/deployment-download-type'; + +export class Sites { + client: Client; + + constructor(client: Client) { + this.client = client; + } + + /** + * Get a list of all the project's sites. You can use the query params to filter your results. + * + * @param {string[]} queries + * @param {string} search + * @throws {AppwriteException} + * @returns {Promise} + */ + list(queries?: string[], search?: string): Promise { + const apiPath = '/sites'; + 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); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + /** + * Create a new site. + * + * @param {string} siteId + * @param {string} name + * @param {Framework} framework + * @param {BuildRuntime} buildRuntime + * @param {boolean} enabled + * @param {boolean} logging + * @param {number} timeout + * @param {string} installCommand + * @param {string} buildCommand + * @param {string} outputDirectory + * @param {Adapter} adapter + * @param {string} installationId + * @param {string} fallbackFile + * @param {string} providerRepositoryId + * @param {string} providerBranch + * @param {boolean} providerSilentMode + * @param {string} providerRootDirectory + * @param {string} specification + * @throws {AppwriteException} + * @returns {Promise} + */ + create(siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise { + if (typeof siteId === 'undefined') { + throw new AppwriteException('Missing required parameter: "siteId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof framework === 'undefined') { + throw new AppwriteException('Missing required parameter: "framework"'); + } + if (typeof buildRuntime === 'undefined') { + throw new AppwriteException('Missing required parameter: "buildRuntime"'); + } + const apiPath = '/sites'; + const payload: Payload = {}; + if (typeof siteId !== 'undefined') { + payload['siteId'] = siteId; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof framework !== 'undefined') { + payload['framework'] = framework; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + if (typeof logging !== 'undefined') { + payload['logging'] = logging; + } + if (typeof timeout !== 'undefined') { + payload['timeout'] = timeout; + } + if (typeof installCommand !== 'undefined') { + payload['installCommand'] = installCommand; + } + if (typeof buildCommand !== 'undefined') { + payload['buildCommand'] = buildCommand; + } + if (typeof outputDirectory !== 'undefined') { + payload['outputDirectory'] = outputDirectory; + } + if (typeof buildRuntime !== 'undefined') { + payload['buildRuntime'] = buildRuntime; + } + if (typeof adapter !== 'undefined') { + payload['adapter'] = adapter; + } + if (typeof installationId !== 'undefined') { + payload['installationId'] = installationId; + } + if (typeof fallbackFile !== 'undefined') { + payload['fallbackFile'] = fallbackFile; + } + 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 specification !== 'undefined') { + payload['specification'] = specification; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + /** + * Get a list of all frameworks that are currently available on the server instance. + * + * @throws {AppwriteException} + * @returns {Promise} + */ + listFrameworks(): Promise { + const apiPath = '/sites/frameworks'; + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + /** + * List allowed site specifications for this instance. + * + * @throws {AppwriteException} + * @returns {Promise} + */ + listSpecifications(): Promise { + const apiPath = '/sites/specifications'; + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + /** + * Get a site by its unique ID. + * + * @param {string} siteId + * @throws {AppwriteException} + * @returns {Promise} + */ + get(siteId: string): Promise { + if (typeof siteId === 'undefined') { + throw new AppwriteException('Missing required parameter: "siteId"'); + } + const apiPath = '/sites/{siteId}'.replace('{siteId}', siteId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + /** + * Update site by its unique ID. + * + * @param {string} siteId + * @param {string} name + * @param {Framework} framework + * @param {boolean} enabled + * @param {boolean} logging + * @param {number} timeout + * @param {string} installCommand + * @param {string} buildCommand + * @param {string} outputDirectory + * @param {BuildRuntime} buildRuntime + * @param {Adapter} adapter + * @param {string} fallbackFile + * @param {string} installationId + * @param {string} providerRepositoryId + * @param {string} providerBranch + * @param {boolean} providerSilentMode + * @param {string} providerRootDirectory + * @param {string} specification + * @throws {AppwriteException} + * @returns {Promise} + */ + update(siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise { + if (typeof siteId === 'undefined') { + throw new AppwriteException('Missing required parameter: "siteId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof framework === 'undefined') { + throw new AppwriteException('Missing required parameter: "framework"'); + } + const apiPath = '/sites/{siteId}'.replace('{siteId}', siteId); + const payload: Payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof framework !== 'undefined') { + payload['framework'] = framework; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + if (typeof logging !== 'undefined') { + payload['logging'] = logging; + } + if (typeof timeout !== 'undefined') { + payload['timeout'] = timeout; + } + if (typeof installCommand !== 'undefined') { + payload['installCommand'] = installCommand; + } + if (typeof buildCommand !== 'undefined') { + payload['buildCommand'] = buildCommand; + } + if (typeof outputDirectory !== 'undefined') { + payload['outputDirectory'] = outputDirectory; + } + if (typeof buildRuntime !== 'undefined') { + payload['buildRuntime'] = buildRuntime; + } + if (typeof adapter !== 'undefined') { + payload['adapter'] = adapter; + } + if (typeof fallbackFile !== 'undefined') { + payload['fallbackFile'] = fallbackFile; + } + 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 specification !== 'undefined') { + payload['specification'] = specification; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload, + ); + } + /** + * Delete a site by its unique ID. + * + * @param {string} siteId + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + delete(siteId: string): Promise<{}> { + if (typeof siteId === 'undefined') { + throw new AppwriteException('Missing required parameter: "siteId"'); + } + const apiPath = '/sites/{siteId}'.replace('{siteId}', siteId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload, + ); + } + /** + * Update the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site. + * + * @param {string} siteId + * @param {string} deploymentId + * @throws {AppwriteException} + * @returns {Promise} + */ + updateSiteDeployment(siteId: string, deploymentId: string): Promise { + if (typeof siteId === 'undefined') { + throw new AppwriteException('Missing required parameter: "siteId"'); + } + if (typeof deploymentId === 'undefined') { + throw new AppwriteException('Missing required parameter: "deploymentId"'); + } + const apiPath = '/sites/{siteId}/deployment'.replace('{siteId}', siteId); + const payload: Payload = {}; + if (typeof deploymentId !== 'undefined') { + payload['deploymentId'] = deploymentId; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + /** + * Get a list of all the site's code deployments. You can use the query params to filter your results. + * + * @param {string} siteId + * @param {string[]} queries + * @param {string} search + * @throws {AppwriteException} + * @returns {Promise} + */ + listDeployments(siteId: string, queries?: string[], search?: string): Promise { + if (typeof siteId === 'undefined') { + throw new AppwriteException('Missing required parameter: "siteId"'); + } + const apiPath = '/sites/{siteId}/deployments'.replace('{siteId}', siteId); + 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); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + /** + * Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the function's deployment to use your new deployment ID. + * + * @param {string} siteId + * @param {File} code + * @param {boolean} activate + * @param {string} installCommand + * @param {string} buildCommand + * @param {string} outputDirectory + * @throws {AppwriteException} + * @returns {Promise} + */ + createDeployment(siteId: string, code: File, activate: boolean, installCommand?: string, buildCommand?: string, outputDirectory?: string, onProgress = (progress: UploadProgress) => {}): Promise { + if (typeof siteId === 'undefined') { + throw new AppwriteException('Missing required parameter: "siteId"'); + } + if (typeof code === 'undefined') { + throw new AppwriteException('Missing required parameter: "code"'); + } + if (typeof activate === 'undefined') { + throw new AppwriteException('Missing required parameter: "activate"'); + } + const apiPath = '/sites/{siteId}/deployments'.replace('{siteId}', siteId); + const payload: Payload = {}; + if (typeof installCommand !== 'undefined') { + payload['installCommand'] = installCommand; + } + if (typeof buildCommand !== 'undefined') { + payload['buildCommand'] = buildCommand; + } + if (typeof outputDirectory !== 'undefined') { + payload['outputDirectory'] = outputDirectory; + } + if (typeof code !== 'undefined') { + payload['code'] = code; + } + if (typeof activate !== 'undefined') { + payload['activate'] = activate; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'multipart/form-data', + } + + return this.client.chunkedUpload( + 'post', + uri, + apiHeaders, + payload, + onProgress + ); + } + /** + * Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build. + * + * @param {string} siteId + * @param {string} deploymentId + * @throws {AppwriteException} + * @returns {Promise} + */ + createDuplicateDeployment(siteId: string, deploymentId: string): Promise { + if (typeof siteId === 'undefined') { + throw new AppwriteException('Missing required parameter: "siteId"'); + } + if (typeof deploymentId === 'undefined') { + throw new AppwriteException('Missing required parameter: "deploymentId"'); + } + const apiPath = '/sites/{siteId}/deployments/duplicate'.replace('{siteId}', siteId); + const payload: Payload = {}; + if (typeof deploymentId !== 'undefined') { + payload['deploymentId'] = deploymentId; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + /** + * Create a deployment based on a template. + +Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/server/sites#listTemplates) to find the template details. + * + * @param {string} siteId + * @param {string} repository + * @param {string} owner + * @param {string} rootDirectory + * @param {string} version + * @param {boolean} activate + * @throws {AppwriteException} + * @returns {Promise} + */ + createTemplateDeployment(siteId: string, repository: string, owner: string, rootDirectory: string, version: string, activate?: boolean): Promise { + if (typeof siteId === 'undefined') { + throw new AppwriteException('Missing required parameter: "siteId"'); + } + if (typeof repository === 'undefined') { + throw new AppwriteException('Missing required parameter: "repository"'); + } + if (typeof owner === 'undefined') { + throw new AppwriteException('Missing required parameter: "owner"'); + } + if (typeof rootDirectory === 'undefined') { + throw new AppwriteException('Missing required parameter: "rootDirectory"'); + } + if (typeof version === 'undefined') { + throw new AppwriteException('Missing required parameter: "version"'); + } + const apiPath = '/sites/{siteId}/deployments/template'.replace('{siteId}', siteId); + const payload: Payload = {}; + if (typeof repository !== 'undefined') { + payload['repository'] = repository; + } + if (typeof owner !== 'undefined') { + payload['owner'] = owner; + } + if (typeof rootDirectory !== 'undefined') { + payload['rootDirectory'] = rootDirectory; + } + if (typeof version !== 'undefined') { + payload['version'] = version; + } + if (typeof activate !== 'undefined') { + payload['activate'] = activate; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + /** + * Create a deployment when a site is connected to VCS. + +This endpoint lets you create deployment from a branch, commit, or a tag. + * + * @param {string} siteId + * @param {VCSDeploymentType} type + * @param {string} reference + * @param {boolean} activate + * @throws {AppwriteException} + * @returns {Promise} + */ + createVcsDeployment(siteId: string, type: VCSDeploymentType, reference: string, activate?: boolean): Promise { + if (typeof siteId === 'undefined') { + throw new AppwriteException('Missing required parameter: "siteId"'); + } + if (typeof type === 'undefined') { + throw new AppwriteException('Missing required parameter: "type"'); + } + if (typeof reference === 'undefined') { + throw new AppwriteException('Missing required parameter: "reference"'); + } + const apiPath = '/sites/{siteId}/deployments/vcs'.replace('{siteId}', siteId); + const payload: Payload = {}; + if (typeof type !== 'undefined') { + payload['type'] = type; + } + if (typeof reference !== 'undefined') { + payload['reference'] = reference; + } + if (typeof activate !== 'undefined') { + payload['activate'] = activate; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + /** + * Get a site deployment by its unique ID. + * + * @param {string} siteId + * @param {string} deploymentId + * @throws {AppwriteException} + * @returns {Promise} + */ + getDeployment(siteId: string, deploymentId: string): Promise { + if (typeof siteId === 'undefined') { + throw new AppwriteException('Missing required parameter: "siteId"'); + } + if (typeof deploymentId === 'undefined') { + throw new AppwriteException('Missing required parameter: "deploymentId"'); + } + const apiPath = '/sites/{siteId}/deployments/{deploymentId}'.replace('{siteId}', siteId).replace('{deploymentId}', deploymentId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + /** + * Delete a site deployment by its unique ID. + * + * @param {string} siteId + * @param {string} deploymentId + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deleteDeployment(siteId: string, deploymentId: string): Promise<{}> { + if (typeof siteId === 'undefined') { + throw new AppwriteException('Missing required parameter: "siteId"'); + } + if (typeof deploymentId === 'undefined') { + throw new AppwriteException('Missing required parameter: "deploymentId"'); + } + const apiPath = '/sites/{siteId}/deployments/{deploymentId}'.replace('{siteId}', siteId).replace('{deploymentId}', deploymentId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload, + ); + } + /** + * Get a site deployment 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} siteId + * @param {string} deploymentId + * @param {DeploymentDownloadType} type + * @throws {AppwriteException} + * @returns {Promise} + */ + getDeploymentDownload(siteId: string, deploymentId: string, type?: DeploymentDownloadType): Promise { + if (typeof siteId === 'undefined') { + throw new AppwriteException('Missing required parameter: "siteId"'); + } + if (typeof deploymentId === 'undefined') { + throw new AppwriteException('Missing required parameter: "deploymentId"'); + } + const apiPath = '/sites/{siteId}/deployments/{deploymentId}/download'.replace('{siteId}', siteId).replace('{deploymentId}', deploymentId); + const payload: Payload = {}; + if (typeof type !== 'undefined') { + payload['type'] = type; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + 'arrayBuffer' + ); + } + /** + * Cancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details. + * + * @param {string} siteId + * @param {string} deploymentId + * @throws {AppwriteException} + * @returns {Promise} + */ + updateDeploymentStatus(siteId: string, deploymentId: string): Promise { + if (typeof siteId === 'undefined') { + throw new AppwriteException('Missing required parameter: "siteId"'); + } + if (typeof deploymentId === 'undefined') { + throw new AppwriteException('Missing required parameter: "deploymentId"'); + } + const apiPath = '/sites/{siteId}/deployments/{deploymentId}/status'.replace('{siteId}', siteId).replace('{deploymentId}', deploymentId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + /** + * Get a list of all site logs. You can use the query params to filter your results. + * + * @param {string} siteId + * @param {string[]} queries + * @throws {AppwriteException} + * @returns {Promise} + */ + listLogs(siteId: string, queries?: string[]): Promise { + if (typeof siteId === 'undefined') { + throw new AppwriteException('Missing required parameter: "siteId"'); + } + const apiPath = '/sites/{siteId}/logs'.replace('{siteId}', siteId); + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + /** + * Get a site request log by its unique ID. + * + * @param {string} siteId + * @param {string} logId + * @throws {AppwriteException} + * @returns {Promise} + */ + getLog(siteId: string, logId: string): Promise { + if (typeof siteId === 'undefined') { + throw new AppwriteException('Missing required parameter: "siteId"'); + } + if (typeof logId === 'undefined') { + throw new AppwriteException('Missing required parameter: "logId"'); + } + const apiPath = '/sites/{siteId}/logs/{logId}'.replace('{siteId}', siteId).replace('{logId}', logId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + /** + * Delete a site log by its unique ID. + * + * @param {string} siteId + * @param {string} logId + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deleteLog(siteId: string, logId: string): Promise<{}> { + if (typeof siteId === 'undefined') { + throw new AppwriteException('Missing required parameter: "siteId"'); + } + if (typeof logId === 'undefined') { + throw new AppwriteException('Missing required parameter: "logId"'); + } + const apiPath = '/sites/{siteId}/logs/{logId}'.replace('{siteId}', siteId).replace('{logId}', logId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload, + ); + } + /** + * Get a list of all variables of a specific site. + * + * @param {string} siteId + * @throws {AppwriteException} + * @returns {Promise} + */ + listVariables(siteId: string): Promise { + if (typeof siteId === 'undefined') { + throw new AppwriteException('Missing required parameter: "siteId"'); + } + const apiPath = '/sites/{siteId}/variables'.replace('{siteId}', siteId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + /** + * Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables. + * + * @param {string} siteId + * @param {string} key + * @param {string} value + * @param {boolean} secret + * @throws {AppwriteException} + * @returns {Promise} + */ + createVariable(siteId: string, key: string, value: string, secret?: boolean): Promise { + if (typeof siteId === 'undefined') { + throw new AppwriteException('Missing required parameter: "siteId"'); + } + if (typeof key === 'undefined') { + throw new AppwriteException('Missing required parameter: "key"'); + } + if (typeof value === 'undefined') { + throw new AppwriteException('Missing required parameter: "value"'); + } + const apiPath = '/sites/{siteId}/variables'.replace('{siteId}', siteId); + const payload: Payload = {}; + if (typeof key !== 'undefined') { + payload['key'] = key; + } + if (typeof value !== 'undefined') { + payload['value'] = value; + } + if (typeof secret !== 'undefined') { + payload['secret'] = secret; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + /** + * Get a variable by its unique ID. + * + * @param {string} siteId + * @param {string} variableId + * @throws {AppwriteException} + * @returns {Promise} + */ + getVariable(siteId: string, variableId: string): Promise { + if (typeof siteId === 'undefined') { + throw new AppwriteException('Missing required parameter: "siteId"'); + } + if (typeof variableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "variableId"'); + } + const apiPath = '/sites/{siteId}/variables/{variableId}'.replace('{siteId}', siteId).replace('{variableId}', variableId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + /** + * Update variable by its unique ID. + * + * @param {string} siteId + * @param {string} variableId + * @param {string} key + * @param {string} value + * @param {boolean} secret + * @throws {AppwriteException} + * @returns {Promise} + */ + updateVariable(siteId: string, variableId: string, key: string, value?: string, secret?: boolean): Promise { + if (typeof siteId === 'undefined') { + throw new AppwriteException('Missing required parameter: "siteId"'); + } + if (typeof variableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "variableId"'); + } + if (typeof key === 'undefined') { + throw new AppwriteException('Missing required parameter: "key"'); + } + const apiPath = '/sites/{siteId}/variables/{variableId}'.replace('{siteId}', siteId).replace('{variableId}', variableId); + const payload: Payload = {}; + if (typeof key !== 'undefined') { + payload['key'] = key; + } + if (typeof value !== 'undefined') { + payload['value'] = value; + } + if (typeof secret !== 'undefined') { + payload['secret'] = secret; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload, + ); + } + /** + * Delete a variable by its unique ID. + * + * @param {string} siteId + * @param {string} variableId + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deleteVariable(siteId: string, variableId: string): Promise<{}> { + if (typeof siteId === 'undefined') { + throw new AppwriteException('Missing required parameter: "siteId"'); + } + if (typeof variableId === 'undefined') { + throw new AppwriteException('Missing required parameter: "variableId"'); + } + const apiPath = '/sites/{siteId}/variables/{variableId}'.replace('{siteId}', siteId).replace('{variableId}', variableId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload, + ); + } +} diff --git a/src/services/storage.ts b/src/services/storage.ts index 4a27f225..f20b5235 100644 --- a/src/services/storage.ts +++ b/src/services/storage.ts @@ -411,10 +411,11 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk * * @param {string} bucketId * @param {string} fileId + * @param {string} token * @throws {AppwriteException} * @returns {Promise} */ - getFileDownload(bucketId: string, fileId: string): Promise { + getFileDownload(bucketId: string, fileId: string, token?: string): Promise { if (typeof bucketId === 'undefined') { throw new AppwriteException('Missing required parameter: "bucketId"'); } @@ -423,6 +424,9 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk } const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/download'.replace('{bucketId}', bucketId).replace('{fileId}', fileId); const payload: Payload = {}; + if (typeof token !== 'undefined') { + payload['token'] = token; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -452,10 +456,11 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk * @param {number} rotation * @param {string} background * @param {ImageFormat} output + * @param {string} token * @throws {AppwriteException} * @returns {Promise} */ - 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): Promise { + 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, token?: string): Promise { if (typeof bucketId === 'undefined') { throw new AppwriteException('Missing required parameter: "bucketId"'); } @@ -497,6 +502,9 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk if (typeof output !== 'undefined') { payload['output'] = output; } + if (typeof token !== 'undefined') { + payload['token'] = token; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -515,10 +523,11 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk * * @param {string} bucketId * @param {string} fileId + * @param {string} token * @throws {AppwriteException} * @returns {Promise} */ - getFileView(bucketId: string, fileId: string): Promise { + getFileView(bucketId: string, fileId: string, token?: string): Promise { if (typeof bucketId === 'undefined') { throw new AppwriteException('Missing required parameter: "bucketId"'); } @@ -527,6 +536,9 @@ If you're creating a new file using one of the Appwrite SDKs, all the chunk } const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/view'.replace('{bucketId}', bucketId).replace('{fileId}', fileId); const payload: Payload = {}; + if (typeof token !== 'undefined') { + payload['token'] = token; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { diff --git a/src/services/tokens.ts b/src/services/tokens.ts new file mode 100644 index 00000000..81804ca1 --- /dev/null +++ b/src/services/tokens.ts @@ -0,0 +1,159 @@ +import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; +import type { Models } from '../models'; + +export class Tokens { + client: Client; + + constructor(client: Client) { + this.client = client; + } + + /** + * List all the tokens created for a specific file or bucket. You can use the query params to filter your results. + * + * @param {string} bucketId + * @param {string} fileId + * @param {string[]} queries + * @throws {AppwriteException} + * @returns {Promise} + */ + list(bucketId: string, fileId: string, queries?: 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 = '/tokens/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', bucketId).replace('{fileId}', fileId); + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + /** + * Create a new token. A token is linked to a file. Token can be passed as a header or request get parameter. + * + * @param {string} bucketId + * @param {string} fileId + * @param {string} expire + * @throws {AppwriteException} + * @returns {Promise} + */ + createFileToken(bucketId: string, fileId: string, expire?: 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 = '/tokens/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', bucketId).replace('{fileId}', fileId); + const payload: Payload = {}; + if (typeof expire !== 'undefined') { + payload['expire'] = expire; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + /** + * Get a token by its unique ID. + * + * @param {string} tokenId + * @throws {AppwriteException} + * @returns {Promise} + */ + get(tokenId: string): Promise { + if (typeof tokenId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tokenId"'); + } + const apiPath = '/tokens/{tokenId}'.replace('{tokenId}', tokenId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + /** + * Update a token by its unique ID. Use this endpoint to update a token's expiry date. + * + * @param {string} tokenId + * @param {string} expire + * @throws {AppwriteException} + * @returns {Promise} + */ + update(tokenId: string, expire?: string): Promise { + if (typeof tokenId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tokenId"'); + } + const apiPath = '/tokens/{tokenId}'.replace('{tokenId}', tokenId); + const payload: Payload = {}; + if (typeof expire !== 'undefined') { + payload['expire'] = expire; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + /** + * Delete a token by its unique ID. + * + * @param {string} tokenId + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + delete(tokenId: string): Promise<{}> { + if (typeof tokenId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tokenId"'); + } + const apiPath = '/tokens/{tokenId}'.replace('{tokenId}', tokenId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload, + ); + } +} diff --git a/src/services/users.ts b/src/services/users.ts index 84b0a545..8a1392d4 100644 --- a/src/services/users.ts +++ b/src/services/users.ts @@ -715,15 +715,23 @@ Labels can be used to grant access to resources. While teams are a way for user& * Get the user membership list by its unique ID. * * @param {string} userId + * @param {string[]} queries + * @param {string} search * @throws {AppwriteException} * @returns {Promise} */ - listMemberships(userId: string): Promise { + listMemberships(userId: string, queries?: string[], search?: string): Promise { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } const apiPath = '/users/{userId}/memberships'.replace('{userId}', userId); 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); const apiHeaders: { [header: string]: string } = { From 208844d3d245709a59c9425d3c4b2a2b6d0169f2 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 18 May 2025 07:36:37 +0000 Subject: [PATCH 3/4] chore: bump to next major versions --- package.json | 2 +- src/client.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 9d099c54..1c8ed638 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "node-appwrite", "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": "16.2.0", + "version": "17.0.0", "license": "BSD-3-Clause", "main": "dist/index.js", "type": "commonjs", diff --git a/src/client.ts b/src/client.ts index 9f3631e0..3682e15a 100644 --- a/src/client.ts +++ b/src/client.ts @@ -33,7 +33,7 @@ class AppwriteException extends Error { } function getUserAgent() { - let ua = 'AppwriteNodeJSSDK/16.2.0'; + let ua = 'AppwriteNodeJSSDK/17.0.0'; // `process` is a global in Node.js, but not fully available in all runtimes. const platform: string[] = []; @@ -82,7 +82,7 @@ class Client { 'x-sdk-name': 'Node.js', 'x-sdk-platform': 'server', 'x-sdk-language': 'nodejs', - 'x-sdk-version': '16.2.0', + 'x-sdk-version': '17.0.0', 'user-agent' : getUserAgent(), 'X-Appwrite-Response-Format': '1.7.0', }; From 0f198cac66c4fd18ec80f36cac921c65c9c9705e Mon Sep 17 00:00:00 2001 From: root Date: Sun, 18 May 2025 07:55:19 +0000 Subject: [PATCH 4/4] chore: add changelog --- CHANGELOG.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa4d35e6..8e186177 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1 +1,13 @@ -# Change Log \ No newline at end of file +# Change Log + +## 17.0.0 + +* Add `<REGION>` to doc examples due to the new multi region endpoints +* Add doc examples and methods for bulk api transactions: `createDocuments`, `deleteDocuments` etc. +* Add doc examples, class and methods for new `Sites` service +* Add doc examples, class and methods for new `Tokens` service +* Add enums for `BuildRuntime `, `Adapter`, `Framework`, `DeploymentDownloadType` and `VCSDeploymentType` +* Updates enum for `runtimes` with Pythonml312, Dart219, Flutter327 and Flutter329 +* Add `token` param to `getFilePreview` and `getFileView` for File tokens usage +* Add `queries` and `search` params to `listMemberships` method +* Removes `search` param from `listExecutions` method \ No newline at end of file