diff --git a/CHANGELOG.md b/CHANGELOG.md index fa4d35e..8e18617 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 diff --git a/README.md b/README.md index b7fd566..687a2dc 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/account/create-anonymous-session.md b/docs/examples/account/create-anonymous-session.md index 90a9161..d8590b0 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 34aabdd..6c940f5 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 0f218a2..b6be71d 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 673e1e0..2273646 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 cb6ef36..6dbdc3d 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 0305e02..e52658b 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 301d83d..79d5e89 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 c653ae5..42b3c8c 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 7538a9d..adae095 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 04d5bc0..aca0bd2 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 15dcf8a..f7c87f0 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 ed83848..660942a 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 8b2751b..8c6b910 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 14456ef..1f1db27 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 860e341..85e3d2f 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 0711334..0424ab2 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 1cf8154..5979c3a 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 d29810f..4276cca 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 496bd4a..884c0e0 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 2bada1b..27f9024 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 9ed003c..d0d7d31 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 aeaaa14..63b6f08 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 b1fc61f..6ebb605 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 642034d..c49894c 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 08dcf81..4260a72 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 e2c9683..a993e31 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 a8b423f..33fb527 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 4c0c6c2..6111f0e 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 30c3623..58629cd 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 56d2b02..3e059d8 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 c8f1773..7b24dc8 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 bdb1a53..4d30999 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 16a3d3c..9db8217 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 df51002..f47d215 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 76021bc..aa9d67a 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 40fccba..c208714 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 93f35a8..116d171 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 11982b7..c6c02fd 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 6f27003..ee8b042 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 09bfc64..bd4a87c 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 64ec68e..be80c85 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 cf65e82..1b70af5 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 cc3678e..0abb562 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 ad6d0d4..1cc825d 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 @@ -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 5ffcc34..7d62a96 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 @@ -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-favicon.md b/docs/examples/avatars/get-favicon.md index 0980403..6056354 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 53b912f..a62f56d 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 @@ -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/avatars/get-image.md b/docs/examples/avatars/get-image.md index 5a72fe3..7dac242 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 b9d41fc..2cd45bf 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 0a27235..cfd649e 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 7a04ed0..b623969 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 7119a4e..fc5c798 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 ba40de8..4c7328c 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 3e1c769..44cfc3c 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -1,9 +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 - .setSession(''); // The user session to authenticate with + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .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 new file mode 100644 index 0000000..1b20882 --- /dev/null +++ b/docs/examples/databases/create-documents.md @@ -0,0 +1,13 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setKey(''); // Your secret API key + +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 6f2da81..47b2750 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 9439f8f..61c1d77 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 7ed6223..3e60500 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 73cdf39..ed03322 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 @@ -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/databases/create-integer-attribute.md b/docs/examples/databases/create-integer-attribute.md index 479b9d8..ce62624 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 c88087f..e3bbffe 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 7be4bae..bb77bc0 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 03905f4..94793e8 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 741249b..6b6b1da 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 792bbf1..c1fd4ec 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 b8b2d47..8291fc0 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 bb72b9e..9551c55 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 05183b5..526f00e 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 0000000..01814e5 --- /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 0f50d7d..90353ea 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 79ca89d..65179d2 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 86dccff..8757265 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 f107c14..79c5674 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 edd2cb2..eee515b 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 3c1039c..a4b3a45 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 ca5dd32..a8e8084 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 fb0264f..e7b48fb 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 e5f725d..bc31ead 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 346fba0..d251485 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 7acfc91..86c6c26 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 f887719..06fe6a8 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 e6329b6..d0d551c 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 b9bbeb8..2618fc7 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 ef69c7e..d2378f9 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 2e087ca..9646803 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 0000000..62b2271 --- /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 1fe9e57..8b7afbe 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 ec9e3bd..f328132 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 b064bf7..abb93c2 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 f686612..e126f31 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 019b4f2..1c8ac79 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 2668380..1a7a26c 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 6aecbb5..0e0656e 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 36d1095..4a2aca0 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 4b24cdd..9c69bfd 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 0000000..5b47956 --- /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-deployment.md b/docs/examples/functions/create-deployment.md index 1928e4c..5ede954 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-build.md b/docs/examples/functions/create-duplicate-deployment.md similarity index 71% rename from docs/examples/functions/create-build.md rename to docs/examples/functions/create-duplicate-deployment.md index c026a96..33f77ff 100644 --- a/docs/examples/functions/create-build.md +++ b/docs/examples/functions/create-duplicate-deployment.md @@ -1,13 +1,13 @@ const sdk = require('node-appwrite'); const client = new 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 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-execution.md b/docs/examples/functions/create-execution.md index 4eec409..3c89030 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-template-deployment.md b/docs/examples/functions/create-template-deployment.md new file mode 100644 index 0000000..eef7148 --- /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 60a9366..5e75d19 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 @@ -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 0000000..ba1067f --- /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 cb44648..646e2e5 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 @@ -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/delete-deployment.md b/docs/examples/functions/delete-deployment.md index a9038bc..f6768ec 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 28b5e41..c3e77a6 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 f3cf018..7840b1d 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 43acc4b..a2e0a23 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 a15215d..5ba1035 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 @@ -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/get-deployment.md b/docs/examples/functions/get-deployment.md index 1c10a92..6a55534 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 7be4378..b9fed55 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 64150e0..3b6135f 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 26807e7..b886092 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 67c3c3c..731d1c4 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 26aa02e..24d3e54 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 @@ -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/list-runtimes.md b/docs/examples/functions/list-runtimes.md index 729cce7..a0f83b2 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 4942bc3..f918c44 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 f213d0c..4220918 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 ba7365f..af5082c 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-status.md similarity index 69% rename from docs/examples/functions/update-deployment-build.md rename to docs/examples/functions/update-deployment-status.md index b492af8..e7ce4a8 100644 --- a/docs/examples/functions/update-deployment-build.md +++ b/docs/examples/functions/update-deployment-status.md @@ -1,13 +1,13 @@ const sdk = require('node-appwrite'); const client = new 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 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 69% rename from docs/examples/functions/update-deployment.md rename to docs/examples/functions/update-function-deployment.md index 8254390..feef831 100644 --- a/docs/examples/functions/update-deployment.md +++ b/docs/examples/functions/update-function-deployment.md @@ -1,13 +1,13 @@ const sdk = require('node-appwrite'); const client = new 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 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 657b0bd..d9a7ac7 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 @@ -11,5 +11,6 @@ const result = await functions.updateVariable( '', // functionId '', // variableId '', // key - '' // value (optional) + '', // value (optional) + false // secret (optional) ); diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index b82dc35..b6de177 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 64b2393..8031a52 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 24a6e56..1545675 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 fc98ff9..9efa2d8 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 9289cad..0143401 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 637f30b..ec91293 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 6cca907..0d86d08 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 2ce2dfb..d88b7f2 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 36dc5ba..b5b9737 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 ef09f92..929f976 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 1095c39..33e71ec 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 fcd113a..ca409c1 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 6a6f517..9f2d6f8 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 05cd6e6..0392db1 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 e0a75b8..a71ff13 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 253e9ba..8c45c1a 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 3db1f6f..46160a0 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 a203449..5f8d262 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 e469391..1b16e6d 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 919d097..2a20620 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 54b6ba4..acc2098 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 d04610d..0ea8e0e 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 cd6d494..d199800 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 71caa3f..cd4f42e 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 d92cb94..e10c4e2 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 eb7353d..d57eb8f 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 c95a852..280d14a 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 ffce38e..d04d6d6 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 3bd63b3..6e41074 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 be39d0f..9621e9c 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 5496a1f..a81b158 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 ff67f9f..a585fd3 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 d6753d3..aea0fad 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 fedbc55..a283090 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 35ac684..b4b1f66 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 80ffa58..a8af6ba 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 2b5f657..ee49f64 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 c8dcb38..e7075dc 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 bb98538..bd89f76 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 65d4f40..8cde02e 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 75dce90..226f47c 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 9c69f27..50a8d20 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 e5d2a97..9874d07 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 544be15..b877172 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 ef41b80..b40d5ee 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 22fe412..35c93ea 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 908f09e..4dcb9a8 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 78270b7..493cd2b 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 fd66451..23b474f 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 aec3a7e..1f5e21a 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 7b4a360..af39f73 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 d4f8bfc..fd49104 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 7b46622..f83ab51 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 796bcbc..2f52698 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 3930e54..5132f17 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 68fda14..98e3838 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 01b941b..56e1288 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 4c0ee7a..db0785e 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 625fedb..6cb2a01 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 4d3a63b..aefb41d 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 61077f2..8d46a08 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 85b91ca..167b48e 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 cafdf9b..971285d 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 fe0a094..39e8295 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 5d0419a..6fd94bb 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 23d806e..e782b8c 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 a6798ee..2ea2941 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 3d34399..9184f28 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 5bcc4d1..a1ac18f 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 02f091f..c66b91f 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 700c3a9..db52bee 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 22a5fe5..8420a2f 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 03c266b..98ee6fe 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 35b7443..0bbe4cd 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 dd668f8..2f23a3b 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 d90c95d..6fb6c82 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 08690a1..6330970 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 c6d2b8c..e4667f5 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 ba9f102..b95398b 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/sites/create-deployment.md b/docs/examples/sites/create-deployment.md new file mode 100644 index 0000000..010da72 --- /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 0000000..3ce35ff --- /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 0000000..aebc2b8 --- /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 0000000..59a51ee --- /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 0000000..4bd8497 --- /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 0000000..ad68059 --- /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 0000000..c04a5c3 --- /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 0000000..88e58a5 --- /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 0000000..abc7e3a --- /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 0000000..87fd7d2 --- /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 0000000..414d50d --- /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 0000000..3f06b1a --- /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 0000000..4318882 --- /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 0000000..287336f --- /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 0000000..d382efa --- /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 0000000..dce44ed --- /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 0000000..0376e4b --- /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 0000000..faaf3d3 --- /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 0000000..24ec74c --- /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 0000000..948e977 --- /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 0000000..184f4f3 --- /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 0000000..7756424 --- /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 0000000..bfbc0f3 --- /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 0000000..c790ca1 --- /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 0000000..e801aed --- /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/create-bucket.md b/docs/examples/storage/create-bucket.md index 91a5126..fc318f1 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 067307c..b84d9ac 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 606ffba..c2067ef 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 c5b9df9..4d2e712 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 711753d..c8a0b1c 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 cbd4c16..6935bed 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 @@ -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 be7b974..fe24419 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 @@ -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 f5722d0..9493cfb 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 @@ -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/storage/get-file.md b/docs/examples/storage/get-file.md index 61b14e6..1a6b500 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 ce012c4..3c4d4b1 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 a9dbaa8..fb595ef 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 31e1316..24e4872 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 c60b2e4..7eed687 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 4606624..7994423 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 cecf4f6..94de494 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 933cd7c..5264af7 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 50963b3..151bfb3 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 b638ade..a8e9fc7 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 68f19a4..18afdaa 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 38ee6e4..8afc800 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 c66ec7d..4fead97 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 d50527b..17fe585 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 80660e9..74fd958 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 068cc55..649630d 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 2174120..571f7ce 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 9d6a6f5..b054694 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/tokens/create-file-token.md b/docs/examples/tokens/create-file-token.md new file mode 100644 index 0000000..d1409c4 --- /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 0000000..1249839 --- /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 0000000..efb2b8c --- /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 0000000..8b708f2 --- /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 0000000..ebf5aa9 --- /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/create-argon2user.md b/docs/examples/users/create-argon2user.md index e96a797..dce3646 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 be14d21..d010676 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 e615b1e..a2c9b59 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 77a7d70..954374c 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 4294529..8b2ed93 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 a5784d7..eca31fe 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 a72e373..e7d8588 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 b27fe31..831107b 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 60b61be..2c2da7e 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 2672905..9d8cc03 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 099b003..7b9e6b0 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 a399313..de7d866 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 e8fb4cd..025c15a 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 46f5203..4c92f27 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 1f00e96..456242e 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 168f494..3f08370 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 4c320fc..48714a0 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 6505a8b..ba7e6af 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 4d6c996..8fdd9e9 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 3e97065..233c337 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 fda205b..6193387 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 1d93a1b..00dc1f1 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 9d36157..640aa63 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 0ba1345..819b168 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 5636e02..c1155d5 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 bc4ce5e..bbe4ed3 100644 --- a/docs/examples/users/list-memberships.md +++ b/docs/examples/users/list-memberships.md @@ -1,12 +1,14 @@ const sdk = require('node-appwrite'); const client = new 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 const users = new sdk.Users(client); const result = await users.listMemberships( - '' // userId + '', // userId + [], // queries (optional) + '' // search (optional) ); diff --git a/docs/examples/users/list-mfa-factors.md b/docs/examples/users/list-mfa-factors.md index 6396a69..8bffa28 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 de4aa3d..51ba081 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 2d2a6d2..d991dcc 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 664d32c..2bf765b 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 560ca3e..9dac2d0 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 eef1761..0a8b1aa 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 ec27094..db9e877 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 56ef9b2..9d47085 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 7c79444..b4acc79 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 5478a78..581e57b 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 856e3a8..f4af49d 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 654e783..ecbe759 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 8cc4af0..45e5a65 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 f80dae1..bb7eff8 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 04a18a2..57f64ce 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 3322867..c6e4d9a 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 d10ade1..1c8ed63 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": "17.0.0", "license": "BSD-3-Clause", "main": "dist/index.js", "type": "commonjs", diff --git a/src/client.ts b/src/client.ts index 8d8ef2f..3682e15 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/17.0.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.0.0', + 'x-sdk-version': '17.0.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 0000000..a3b1ae0 --- /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 0000000..a2180ef --- /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 0000000..538709b --- /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 0000000..497c1b2 --- /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 bcbe3e9..5aad5f0 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 a4042bb..3955557 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 0000000..e685a49 --- /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 bb34374..849d8b1 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 47c1010..ed9cf51 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 265b72a..80d1a6a 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,150 @@ 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. * @@ -1816,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"'); } @@ -1849,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 0c77700..7ed681f 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 0000000..3f85704 --- /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 4a27f22..f20b523 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 0000000..81804ca --- /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 84b0a54..8a1392d 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 } = {