diff --git a/README.md b/README.md index f6901ca..a0b273f 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # Appwrite Deno SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-deno.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-deno/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-deno/releases).** Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Deno SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) diff --git a/docs/examples/account/create-anonymous-session.md b/docs/examples/account/create-anonymous-session.md index f71baa9..62ad345 100644 --- a/docs/examples/account/create-anonymous-session.md +++ b/docs/examples/account/create-anonymous-session.md @@ -1,7 +1,7 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 Account(client); diff --git a/docs/examples/account/create-email-password-session.md b/docs/examples/account/create-email-password-session.md index ad62b88..d08a92d 100644 --- a/docs/examples/account/create-email-password-session.md +++ b/docs/examples/account/create-email-password-session.md @@ -1,7 +1,7 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 Account(client); diff --git a/docs/examples/account/create-email-token.md b/docs/examples/account/create-email-token.md index 2e33d2b..384a3fb 100644 --- a/docs/examples/account/create-email-token.md +++ b/docs/examples/account/create-email-token.md @@ -1,7 +1,7 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 Account(client); diff --git a/docs/examples/account/create-j-w-t.md b/docs/examples/account/create-j-w-t.md index 15197d0..a0a7f72 100644 --- a/docs/examples/account/create-j-w-t.md +++ b/docs/examples/account/create-j-w-t.md @@ -1,7 +1,7 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 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 57697d4..29e552a 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 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 Account(client); diff --git a/docs/examples/account/create-mfa-authenticator.md b/docs/examples/account/create-mfa-authenticator.md index be345dc..52c193a 100644 --- a/docs/examples/account/create-mfa-authenticator.md +++ b/docs/examples/account/create-mfa-authenticator.md @@ -1,7 +1,7 @@ import { Client, Account, AuthenticatorType } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 877c203..296e36d 100644 --- a/docs/examples/account/create-mfa-challenge.md +++ b/docs/examples/account/create-mfa-challenge.md @@ -1,7 +1,7 @@ import { Client, Account, AuthenticationFactor } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 Account(client); diff --git a/docs/examples/account/create-mfa-recovery-codes.md b/docs/examples/account/create-mfa-recovery-codes.md index 18ce21a..cfd9aa2 100644 --- a/docs/examples/account/create-mfa-recovery-codes.md +++ b/docs/examples/account/create-mfa-recovery-codes.md @@ -1,7 +1,7 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 037da38..24e43a9 100644 --- a/docs/examples/account/create-o-auth2token.md +++ b/docs/examples/account/create-o-auth2token.md @@ -1,7 +1,7 @@ import { Client, Account, OAuthProvider } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 Account(client); diff --git a/docs/examples/account/create-phone-token.md b/docs/examples/account/create-phone-token.md index 800f021..77e4adc 100644 --- a/docs/examples/account/create-phone-token.md +++ b/docs/examples/account/create-phone-token.md @@ -1,7 +1,7 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 Account(client); diff --git a/docs/examples/account/create-phone-verification.md b/docs/examples/account/create-phone-verification.md index 5a9c87b..8f01304 100644 --- a/docs/examples/account/create-phone-verification.md +++ b/docs/examples/account/create-phone-verification.md @@ -1,7 +1,7 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 e326001..a3d92d8 100644 --- a/docs/examples/account/create-recovery.md +++ b/docs/examples/account/create-recovery.md @@ -1,7 +1,7 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 a34d3e3..888493a 100644 --- a/docs/examples/account/create-session.md +++ b/docs/examples/account/create-session.md @@ -1,7 +1,7 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 Account(client); diff --git a/docs/examples/account/create-verification.md b/docs/examples/account/create-verification.md index fd11e13..438feee 100644 --- a/docs/examples/account/create-verification.md +++ b/docs/examples/account/create-verification.md @@ -1,7 +1,7 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 9f1b16b..c410a0f 100644 --- a/docs/examples/account/create.md +++ b/docs/examples/account/create.md @@ -1,7 +1,7 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 Account(client); diff --git a/docs/examples/account/delete-identity.md b/docs/examples/account/delete-identity.md index 30b1468..359c7a3 100644 --- a/docs/examples/account/delete-identity.md +++ b/docs/examples/account/delete-identity.md @@ -1,7 +1,7 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 7247155..f4b164b 100644 --- a/docs/examples/account/delete-mfa-authenticator.md +++ b/docs/examples/account/delete-mfa-authenticator.md @@ -1,7 +1,7 @@ import { Client, Account, AuthenticatorType } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 5fd77c1..a0b7d19 100644 --- a/docs/examples/account/delete-session.md +++ b/docs/examples/account/delete-session.md @@ -1,7 +1,7 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 6d676cf..864c505 100644 --- a/docs/examples/account/delete-sessions.md +++ b/docs/examples/account/delete-sessions.md @@ -1,7 +1,7 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 5861c1b..73fc143 100644 --- a/docs/examples/account/get-mfa-recovery-codes.md +++ b/docs/examples/account/get-mfa-recovery-codes.md @@ -1,7 +1,7 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 685aa63..4479df7 100644 --- a/docs/examples/account/get-prefs.md +++ b/docs/examples/account/get-prefs.md @@ -1,7 +1,7 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 91242d4..c380b72 100644 --- a/docs/examples/account/get-session.md +++ b/docs/examples/account/get-session.md @@ -1,7 +1,7 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 59f91ca..5abdc95 100644 --- a/docs/examples/account/get.md +++ b/docs/examples/account/get.md @@ -1,7 +1,7 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 5010421..1c612f9 100644 --- a/docs/examples/account/list-identities.md +++ b/docs/examples/account/list-identities.md @@ -1,7 +1,7 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 230c3f4..28ab351 100644 --- a/docs/examples/account/list-logs.md +++ b/docs/examples/account/list-logs.md @@ -1,7 +1,7 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 bf9d6b4..35fb749 100644 --- a/docs/examples/account/list-mfa-factors.md +++ b/docs/examples/account/list-mfa-factors.md @@ -1,7 +1,7 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 927ccfc..e34da16 100644 --- a/docs/examples/account/list-sessions.md +++ b/docs/examples/account/list-sessions.md @@ -1,7 +1,7 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 9136450..0753cff 100644 --- a/docs/examples/account/update-email.md +++ b/docs/examples/account/update-email.md @@ -1,7 +1,7 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 db315e5..24611aa 100644 --- a/docs/examples/account/update-m-f-a.md +++ b/docs/examples/account/update-m-f-a.md @@ -1,7 +1,7 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 99243ec..a83c1d9 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 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 Account(client); diff --git a/docs/examples/account/update-mfa-authenticator.md b/docs/examples/account/update-mfa-authenticator.md index 5c43719..6b95818 100644 --- a/docs/examples/account/update-mfa-authenticator.md +++ b/docs/examples/account/update-mfa-authenticator.md @@ -1,7 +1,7 @@ import { Client, Account, AuthenticatorType } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 4e0638e..61a7b44 100644 --- a/docs/examples/account/update-mfa-challenge.md +++ b/docs/examples/account/update-mfa-challenge.md @@ -1,7 +1,7 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 3d604f6..2030e1c 100644 --- a/docs/examples/account/update-mfa-recovery-codes.md +++ b/docs/examples/account/update-mfa-recovery-codes.md @@ -1,7 +1,7 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 7e0e012..a02591b 100644 --- a/docs/examples/account/update-name.md +++ b/docs/examples/account/update-name.md @@ -1,7 +1,7 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 6d54629..088bea8 100644 --- a/docs/examples/account/update-password.md +++ b/docs/examples/account/update-password.md @@ -1,7 +1,7 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 1d91048..4710a45 100644 --- a/docs/examples/account/update-phone-session.md +++ b/docs/examples/account/update-phone-session.md @@ -1,7 +1,7 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 Account(client); diff --git a/docs/examples/account/update-phone-verification.md b/docs/examples/account/update-phone-verification.md index 9737de0..3b150c8 100644 --- a/docs/examples/account/update-phone-verification.md +++ b/docs/examples/account/update-phone-verification.md @@ -1,7 +1,7 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 8b1bc7c..9c1923c 100644 --- a/docs/examples/account/update-phone.md +++ b/docs/examples/account/update-phone.md @@ -1,7 +1,7 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 58582c6..4b37a64 100644 --- a/docs/examples/account/update-prefs.md +++ b/docs/examples/account/update-prefs.md @@ -1,7 +1,7 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 1b64a3b..5d0d80f 100644 --- a/docs/examples/account/update-recovery.md +++ b/docs/examples/account/update-recovery.md @@ -1,7 +1,7 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 93dd40f..cb36b94 100644 --- a/docs/examples/account/update-session.md +++ b/docs/examples/account/update-session.md @@ -1,7 +1,7 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 60a3d51..0c70c88 100644 --- a/docs/examples/account/update-status.md +++ b/docs/examples/account/update-status.md @@ -1,7 +1,7 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 2089888..9637085 100644 --- a/docs/examples/account/update-verification.md +++ b/docs/examples/account/update-verification.md @@ -1,7 +1,7 @@ import { Client, Account } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 c8e7264..5443200 100644 --- a/docs/examples/avatars/get-browser.md +++ b/docs/examples/avatars/get-browser.md @@ -1,7 +1,7 @@ import { Client, Avatars, Browser } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 = avatars.getBrowser( 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 8e1b3db..8bcc67e 100644 --- a/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/avatars/get-credit-card.md @@ -1,7 +1,7 @@ import { Client, Avatars, CreditCard } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 = avatars.getCreditCard( 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 5f50687..cca313a 100644 --- a/docs/examples/avatars/get-favicon.md +++ b/docs/examples/avatars/get-favicon.md @@ -1,7 +1,7 @@ import { Client, Avatars } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 daa488e..6837438 100644 --- a/docs/examples/avatars/get-flag.md +++ b/docs/examples/avatars/get-flag.md @@ -1,7 +1,7 @@ import { Client, Avatars, Flag } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 = avatars.getFlag( 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 fc72b74..2960dab 100644 --- a/docs/examples/avatars/get-image.md +++ b/docs/examples/avatars/get-image.md @@ -1,7 +1,7 @@ import { Client, Avatars } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 d6d8dc8..10eb2d8 100644 --- a/docs/examples/avatars/get-initials.md +++ b/docs/examples/avatars/get-initials.md @@ -1,7 +1,7 @@ import { Client, Avatars } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 bfa7833..d9ccc0d 100644 --- a/docs/examples/avatars/get-q-r.md +++ b/docs/examples/avatars/get-q-r.md @@ -1,7 +1,7 @@ import { Client, Avatars } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 232efa1..b216c2e 100644 --- a/docs/examples/databases/create-boolean-attribute.md +++ b/docs/examples/databases/create-boolean-attribute.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 8ae3e6a..c7e8026 100644 --- a/docs/examples/databases/create-collection.md +++ b/docs/examples/databases/create-collection.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 10017f2..664da19 100644 --- a/docs/examples/databases/create-datetime-attribute.md +++ b/docs/examples/databases/create-datetime-attribute.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 f0f54b7..f18b4f3 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -1,9 +1,10 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 Databases(client); diff --git a/docs/examples/databases/create-documents.md b/docs/examples/databases/create-documents.md new file mode 100644 index 0000000..f5e320e --- /dev/null +++ b/docs/examples/databases/create-documents.md @@ -0,0 +1,13 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setKey(''); // Your secret API key + +const databases = new Databases(client); + +const response = 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 979c513..6c667ed 100644 --- a/docs/examples/databases/create-email-attribute.md +++ b/docs/examples/databases/create-email-attribute.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 163a9e4..6fdd277 100644 --- a/docs/examples/databases/create-enum-attribute.md +++ b/docs/examples/databases/create-enum-attribute.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 3b0e419..c5991d4 100644 --- a/docs/examples/databases/create-float-attribute.md +++ b/docs/examples/databases/create-float-attribute.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 8b7d9c6..3ab3c7a 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -1,7 +1,7 @@ import { Client, Databases, IndexType } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.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 response = await databases.createIndex( '', // key 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 1a2e394..4a306cd 100644 --- a/docs/examples/databases/create-integer-attribute.md +++ b/docs/examples/databases/create-integer-attribute.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 e0acc27..c043b25 100644 --- a/docs/examples/databases/create-ip-attribute.md +++ b/docs/examples/databases/create-ip-attribute.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 83b3e58..d96ee59 100644 --- a/docs/examples/databases/create-relationship-attribute.md +++ b/docs/examples/databases/create-relationship-attribute.md @@ -1,7 +1,7 @@ import { Client, Databases, RelationshipType, RelationMutate } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 d35b8a7..5f8e955 100644 --- a/docs/examples/databases/create-string-attribute.md +++ b/docs/examples/databases/create-string-attribute.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 9127e3a..4639f75 100644 --- a/docs/examples/databases/create-url-attribute.md +++ b/docs/examples/databases/create-url-attribute.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 a4252aa..86795eb 100644 --- a/docs/examples/databases/create.md +++ b/docs/examples/databases/create.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 142ae5a..f7ad6b1 100644 --- a/docs/examples/databases/delete-attribute.md +++ b/docs/examples/databases/delete-attribute.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 3d72fa0..828d48a 100644 --- a/docs/examples/databases/delete-collection.md +++ b/docs/examples/databases/delete-collection.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 ade8151..47d5df4 100644 --- a/docs/examples/databases/delete-document.md +++ b/docs/examples/databases/delete-document.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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..4768ed4 --- /dev/null +++ b/docs/examples/databases/delete-documents.md @@ -0,0 +1,14 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.deleteDocuments( + '', // databaseId + '', // collectionId + [] // queries (optional) +); diff --git a/docs/examples/databases/delete-index.md b/docs/examples/databases/delete-index.md index 5bca23a..eee1613 100644 --- a/docs/examples/databases/delete-index.md +++ b/docs/examples/databases/delete-index.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 c729b97..39b3f53 100644 --- a/docs/examples/databases/delete.md +++ b/docs/examples/databases/delete.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 a8300ea..f2b801b 100644 --- a/docs/examples/databases/get-attribute.md +++ b/docs/examples/databases/get-attribute.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 b521394..b94f4fd 100644 --- a/docs/examples/databases/get-collection.md +++ b/docs/examples/databases/get-collection.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 1e5669a..5cb02c4 100644 --- a/docs/examples/databases/get-document.md +++ b/docs/examples/databases/get-document.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 bfd7402..6c3a3de 100644 --- a/docs/examples/databases/get-index.md +++ b/docs/examples/databases/get-index.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 386fbfe..403e467 100644 --- a/docs/examples/databases/get.md +++ b/docs/examples/databases/get.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 bedab6c..2171ffe 100644 --- a/docs/examples/databases/list-attributes.md +++ b/docs/examples/databases/list-attributes.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 9b4f76c..408ea2d 100644 --- a/docs/examples/databases/list-collections.md +++ b/docs/examples/databases/list-collections.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 0aa7b3f..528e979 100644 --- a/docs/examples/databases/list-documents.md +++ b/docs/examples/databases/list-documents.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 58222cb..88af3b7 100644 --- a/docs/examples/databases/list-indexes.md +++ b/docs/examples/databases/list-indexes.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 8c8374e..dcae151 100644 --- a/docs/examples/databases/list.md +++ b/docs/examples/databases/list.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 dc10766..fe1b800 100644 --- a/docs/examples/databases/update-boolean-attribute.md +++ b/docs/examples/databases/update-boolean-attribute.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 88a3493..47f1c02 100644 --- a/docs/examples/databases/update-collection.md +++ b/docs/examples/databases/update-collection.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 7de5a2c..ad18d93 100644 --- a/docs/examples/databases/update-datetime-attribute.md +++ b/docs/examples/databases/update-datetime-attribute.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 fe9947e..31cce5e 100644 --- a/docs/examples/databases/update-document.md +++ b/docs/examples/databases/update-document.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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..1eef779 --- /dev/null +++ b/docs/examples/databases/update-documents.md @@ -0,0 +1,15 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const databases = new Databases(client); + +const response = 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 41df182..116fadc 100644 --- a/docs/examples/databases/update-email-attribute.md +++ b/docs/examples/databases/update-email-attribute.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 6c0f912..663e44b 100644 --- a/docs/examples/databases/update-enum-attribute.md +++ b/docs/examples/databases/update-enum-attribute.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 9511a68..d9eab5a 100644 --- a/docs/examples/databases/update-float-attribute.md +++ b/docs/examples/databases/update-float-attribute.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 92aed87..369b49d 100644 --- a/docs/examples/databases/update-integer-attribute.md +++ b/docs/examples/databases/update-integer-attribute.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 9348cfa..049a527 100644 --- a/docs/examples/databases/update-ip-attribute.md +++ b/docs/examples/databases/update-ip-attribute.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 3d0bfdd..7fae26b 100644 --- a/docs/examples/databases/update-relationship-attribute.md +++ b/docs/examples/databases/update-relationship-attribute.md @@ -1,7 +1,7 @@ import { Client, Databases, RelationMutate } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 d57f8fd..ec91d33 100644 --- a/docs/examples/databases/update-string-attribute.md +++ b/docs/examples/databases/update-string-attribute.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 f1027d8..32f44b7 100644 --- a/docs/examples/databases/update-url-attribute.md +++ b/docs/examples/databases/update-url-attribute.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 2e19221..b87ad82 100644 --- a/docs/examples/databases/update.md +++ b/docs/examples/databases/update.md @@ -1,7 +1,7 @@ import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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..c0ee477 --- /dev/null +++ b/docs/examples/databases/upsert-documents.md @@ -0,0 +1,14 @@ +import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const databases = new Databases(client); + +const response = await databases.upsertDocuments( + '', // databaseId + '', // collectionId + [] // documents (optional) +); diff --git a/docs/examples/functions/create-deployment.md b/docs/examples/functions/create-deployment.md index 5b976e6..a134a38 100644 --- a/docs/examples/functions/create-deployment.md +++ b/docs/examples/functions/create-deployment.md @@ -1,7 +1,7 @@ import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 72% rename from docs/examples/functions/create-build.md rename to docs/examples/functions/create-duplicate-deployment.md index c68fb25..e22d1da 100644 --- a/docs/examples/functions/create-build.md +++ b/docs/examples/functions/create-duplicate-deployment.md @@ -1,13 +1,13 @@ import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.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 Functions(client); -const response = await functions.createBuild( +const response = await functions.createDuplicateDeployment( '', // functionId '', // deploymentId '' // buildId (optional) diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index c794d72..bec6a17 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -1,7 +1,7 @@ import { Client, Functions, ExecutionMethod } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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..69503da --- /dev/null +++ b/docs/examples/functions/create-template-deployment.md @@ -0,0 +1,17 @@ +import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const functions = new Functions(client); + +const response = 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 472a798..2864890 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -1,7 +1,7 @@ import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.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 Functions(client); const response = 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..d501b0e --- /dev/null +++ b/docs/examples/functions/create-vcs-deployment.md @@ -0,0 +1,15 @@ +import { Client, Functions, VCSDeploymentType } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const functions = new Functions(client); + +const response = await functions.createVcsDeployment( + '', // functionId + VCSDeploymentType.Branch, // type + '', // reference + false // activate (optional) +); diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index 2bb31f7..32265de 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -1,7 +1,7 @@ import { Client, Functions, } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.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 response = 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 b640055..179bbaf 100644 --- a/docs/examples/functions/delete-deployment.md +++ b/docs/examples/functions/delete-deployment.md @@ -1,7 +1,7 @@ import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 1785a0e..4ab7c37 100644 --- a/docs/examples/functions/delete-execution.md +++ b/docs/examples/functions/delete-execution.md @@ -1,7 +1,7 @@ import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 c4786ff..39a9428 100644 --- a/docs/examples/functions/delete-variable.md +++ b/docs/examples/functions/delete-variable.md @@ -1,7 +1,7 @@ import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 7155610..94d58c3 100644 --- a/docs/examples/functions/delete.md +++ b/docs/examples/functions/delete.md @@ -1,7 +1,7 @@ import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 c619208..d153036 100644 --- a/docs/examples/functions/get-deployment-download.md +++ b/docs/examples/functions/get-deployment-download.md @@ -1,7 +1,7 @@ -import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, Functions, DeploymentDownloadType } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.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 Functions(client); const result = functions.getDeploymentDownload( '', // functionId - '' // deploymentId + '', // deploymentId + DeploymentDownloadType.Source // type (optional) ); diff --git a/docs/examples/functions/get-deployment.md b/docs/examples/functions/get-deployment.md index 50e4cc5..339b99d 100644 --- a/docs/examples/functions/get-deployment.md +++ b/docs/examples/functions/get-deployment.md @@ -1,7 +1,7 @@ import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 af68d74..adeff02 100644 --- a/docs/examples/functions/get-execution.md +++ b/docs/examples/functions/get-execution.md @@ -1,7 +1,7 @@ import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 2352321..cbbdd2f 100644 --- a/docs/examples/functions/get-variable.md +++ b/docs/examples/functions/get-variable.md @@ -1,7 +1,7 @@ import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 f90767d..8fec17e 100644 --- a/docs/examples/functions/get.md +++ b/docs/examples/functions/get.md @@ -1,7 +1,7 @@ import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 2f4c345..849fe23 100644 --- a/docs/examples/functions/list-deployments.md +++ b/docs/examples/functions/list-deployments.md @@ -1,7 +1,7 @@ import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 b8ce317..cd597fb 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -1,7 +1,7 @@ import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 Functions(client); const response = 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 f78dfd0..a45afe4 100644 --- a/docs/examples/functions/list-runtimes.md +++ b/docs/examples/functions/list-runtimes.md @@ -1,7 +1,7 @@ import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 5dff435..3bf0d08 100644 --- a/docs/examples/functions/list-specifications.md +++ b/docs/examples/functions/list-specifications.md @@ -1,7 +1,7 @@ import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 991292a..173d5aa 100644 --- a/docs/examples/functions/list-variables.md +++ b/docs/examples/functions/list-variables.md @@ -1,7 +1,7 @@ import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 6d1e09b..ecc43d1 100644 --- a/docs/examples/functions/list.md +++ b/docs/examples/functions/list.md @@ -1,7 +1,7 @@ import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 70% rename from docs/examples/functions/update-deployment-build.md rename to docs/examples/functions/update-deployment-status.md index 65ea3a9..4c7e805 100644 --- a/docs/examples/functions/update-deployment-build.md +++ b/docs/examples/functions/update-deployment-status.md @@ -1,13 +1,13 @@ import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.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 Functions(client); -const response = await functions.updateDeploymentBuild( +const response = await functions.updateDeploymentStatus( '', // functionId '' // deploymentId ); diff --git a/docs/examples/functions/update-deployment.md b/docs/examples/functions/update-function-deployment.md similarity index 70% rename from docs/examples/functions/update-deployment.md rename to docs/examples/functions/update-function-deployment.md index 87af2f3..55196c1 100644 --- a/docs/examples/functions/update-deployment.md +++ b/docs/examples/functions/update-function-deployment.md @@ -1,13 +1,13 @@ import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.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 Functions(client); -const response = await functions.updateDeployment( +const response = await functions.updateFunctionDeployment( '', // functionId '' // deploymentId ); diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index 5213a92..3da706d 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -1,7 +1,7 @@ import { Client, Functions } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.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 response = 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 ab27525..399af05 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -1,7 +1,7 @@ import { Client, Functions, } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 68c06aa..200120f 100644 --- a/docs/examples/graphql/mutation.md +++ b/docs/examples/graphql/mutation.md @@ -1,7 +1,7 @@ import { Client, Graphql } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 480c481..bb01162 100644 --- a/docs/examples/graphql/query.md +++ b/docs/examples/graphql/query.md @@ -1,7 +1,7 @@ import { Client, Graphql } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 ccf2968..d8dcc1f 100644 --- a/docs/examples/health/get-antivirus.md +++ b/docs/examples/health/get-antivirus.md @@ -1,7 +1,7 @@ import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 2811f01..e138b50 100644 --- a/docs/examples/health/get-cache.md +++ b/docs/examples/health/get-cache.md @@ -1,7 +1,7 @@ import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 5bde913..828e53d 100644 --- a/docs/examples/health/get-certificate.md +++ b/docs/examples/health/get-certificate.md @@ -1,7 +1,7 @@ import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 598c163..bded9eb 100644 --- a/docs/examples/health/get-d-b.md +++ b/docs/examples/health/get-d-b.md @@ -1,7 +1,7 @@ import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 dd44711..5e40f76 100644 --- a/docs/examples/health/get-failed-jobs.md +++ b/docs/examples/health/get-failed-jobs.md @@ -1,7 +1,7 @@ import { Client, Health, } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 9ecda7d..ecc05a3 100644 --- a/docs/examples/health/get-pub-sub.md +++ b/docs/examples/health/get-pub-sub.md @@ -1,7 +1,7 @@ import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 3b05fe6..f6b9388 100644 --- a/docs/examples/health/get-queue-builds.md +++ b/docs/examples/health/get-queue-builds.md @@ -1,7 +1,7 @@ import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 73139a0..e783fa5 100644 --- a/docs/examples/health/get-queue-certificates.md +++ b/docs/examples/health/get-queue-certificates.md @@ -1,7 +1,7 @@ import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 9130cb8..e33c7a2 100644 --- a/docs/examples/health/get-queue-databases.md +++ b/docs/examples/health/get-queue-databases.md @@ -1,7 +1,7 @@ import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 967e27d..ea7da5b 100644 --- a/docs/examples/health/get-queue-deletes.md +++ b/docs/examples/health/get-queue-deletes.md @@ -1,7 +1,7 @@ import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 a621d14..e075a65 100644 --- a/docs/examples/health/get-queue-functions.md +++ b/docs/examples/health/get-queue-functions.md @@ -1,7 +1,7 @@ import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 7443b04..eb7ffb0 100644 --- a/docs/examples/health/get-queue-logs.md +++ b/docs/examples/health/get-queue-logs.md @@ -1,7 +1,7 @@ import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 f794deb..d9f61bc 100644 --- a/docs/examples/health/get-queue-mails.md +++ b/docs/examples/health/get-queue-mails.md @@ -1,7 +1,7 @@ import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 f04652e..8bc7639 100644 --- a/docs/examples/health/get-queue-messaging.md +++ b/docs/examples/health/get-queue-messaging.md @@ -1,7 +1,7 @@ import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 5b3ba57..e6f7bf5 100644 --- a/docs/examples/health/get-queue-migrations.md +++ b/docs/examples/health/get-queue-migrations.md @@ -1,7 +1,7 @@ import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 03f48be..ecc7ebd 100644 --- a/docs/examples/health/get-queue-stats-resources.md +++ b/docs/examples/health/get-queue-stats-resources.md @@ -1,7 +1,7 @@ import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 54dc92f..46aa4db 100644 --- a/docs/examples/health/get-queue-usage.md +++ b/docs/examples/health/get-queue-usage.md @@ -1,7 +1,7 @@ import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 b1c8b54..75a1c1f 100644 --- a/docs/examples/health/get-queue-webhooks.md +++ b/docs/examples/health/get-queue-webhooks.md @@ -1,7 +1,7 @@ import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 afffff6..0e64e1a 100644 --- a/docs/examples/health/get-storage-local.md +++ b/docs/examples/health/get-storage-local.md @@ -1,7 +1,7 @@ import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 c7fe435..698e33b 100644 --- a/docs/examples/health/get-storage.md +++ b/docs/examples/health/get-storage.md @@ -1,7 +1,7 @@ import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 658ce30..1bb1ae0 100644 --- a/docs/examples/health/get-time.md +++ b/docs/examples/health/get-time.md @@ -1,7 +1,7 @@ import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 4483f95..87d7ea5 100644 --- a/docs/examples/health/get.md +++ b/docs/examples/health/get.md @@ -1,7 +1,7 @@ import { Client, Health } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 5d52acb..960ee6f 100644 --- a/docs/examples/locale/get.md +++ b/docs/examples/locale/get.md @@ -1,7 +1,7 @@ import { Client, Locale } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 bed3b4c..8f91c21 100644 --- a/docs/examples/locale/list-codes.md +++ b/docs/examples/locale/list-codes.md @@ -1,7 +1,7 @@ import { Client, Locale } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 61b5385..55b208c 100644 --- a/docs/examples/locale/list-continents.md +++ b/docs/examples/locale/list-continents.md @@ -1,7 +1,7 @@ import { Client, Locale } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 231c2f7..b4fbfa0 100644 --- a/docs/examples/locale/list-countries-e-u.md +++ b/docs/examples/locale/list-countries-e-u.md @@ -1,7 +1,7 @@ import { Client, Locale } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 34be4cb..19ac0a0 100644 --- a/docs/examples/locale/list-countries-phones.md +++ b/docs/examples/locale/list-countries-phones.md @@ -1,7 +1,7 @@ import { Client, Locale } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 dfa085b..67ba0fe 100644 --- a/docs/examples/locale/list-countries.md +++ b/docs/examples/locale/list-countries.md @@ -1,7 +1,7 @@ import { Client, Locale } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 0c80928..986f09d 100644 --- a/docs/examples/locale/list-currencies.md +++ b/docs/examples/locale/list-currencies.md @@ -1,7 +1,7 @@ import { Client, Locale } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 8625649..91b4a85 100644 --- a/docs/examples/locale/list-languages.md +++ b/docs/examples/locale/list-languages.md @@ -1,7 +1,7 @@ import { Client, Locale } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 8b89092..e2c33fe 100644 --- a/docs/examples/messaging/create-apns-provider.md +++ b/docs/examples/messaging/create-apns-provider.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 552e9e3..8db2879 100644 --- a/docs/examples/messaging/create-email.md +++ b/docs/examples/messaging/create-email.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 bd9f075..3f443d6 100644 --- a/docs/examples/messaging/create-fcm-provider.md +++ b/docs/examples/messaging/create-fcm-provider.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 3192bb2..32f7c94 100644 --- a/docs/examples/messaging/create-mailgun-provider.md +++ b/docs/examples/messaging/create-mailgun-provider.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 bd6b030..57e9418 100644 --- a/docs/examples/messaging/create-msg91provider.md +++ b/docs/examples/messaging/create-msg91provider.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 7b41911..7523c29 100644 --- a/docs/examples/messaging/create-push.md +++ b/docs/examples/messaging/create-push.md @@ -1,7 +1,7 @@ import { Client, Messaging, MessagePriority } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 c6d4e2a..15fe7b8 100644 --- a/docs/examples/messaging/create-sendgrid-provider.md +++ b/docs/examples/messaging/create-sendgrid-provider.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 c316ea5..264203a 100644 --- a/docs/examples/messaging/create-sms.md +++ b/docs/examples/messaging/create-sms.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 c1fb9ec..2d6d33c 100644 --- a/docs/examples/messaging/create-smtp-provider.md +++ b/docs/examples/messaging/create-smtp-provider.md @@ -1,7 +1,7 @@ import { Client, Messaging, SmtpEncryption } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 26d7a97..8be79f3 100644 --- a/docs/examples/messaging/create-subscriber.md +++ b/docs/examples/messaging/create-subscriber.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 391483a..2bb95c4 100644 --- a/docs/examples/messaging/create-telesign-provider.md +++ b/docs/examples/messaging/create-telesign-provider.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 934372f..4657493 100644 --- a/docs/examples/messaging/create-textmagic-provider.md +++ b/docs/examples/messaging/create-textmagic-provider.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 75d1103..c2ca3a4 100644 --- a/docs/examples/messaging/create-topic.md +++ b/docs/examples/messaging/create-topic.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 ee17992..aa7bbf6 100644 --- a/docs/examples/messaging/create-twilio-provider.md +++ b/docs/examples/messaging/create-twilio-provider.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 3e8dd36..5fe734f 100644 --- a/docs/examples/messaging/create-vonage-provider.md +++ b/docs/examples/messaging/create-vonage-provider.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 8ade161..7bc99ef 100644 --- a/docs/examples/messaging/delete-provider.md +++ b/docs/examples/messaging/delete-provider.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 1df3175..1474568 100644 --- a/docs/examples/messaging/delete-subscriber.md +++ b/docs/examples/messaging/delete-subscriber.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 fb50be8..aa1359c 100644 --- a/docs/examples/messaging/delete-topic.md +++ b/docs/examples/messaging/delete-topic.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 edd3456..0442da1 100644 --- a/docs/examples/messaging/delete.md +++ b/docs/examples/messaging/delete.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 42d4613..9565a61 100644 --- a/docs/examples/messaging/get-message.md +++ b/docs/examples/messaging/get-message.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 fe44476..8e5d426 100644 --- a/docs/examples/messaging/get-provider.md +++ b/docs/examples/messaging/get-provider.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 abfc167..e9377a5 100644 --- a/docs/examples/messaging/get-subscriber.md +++ b/docs/examples/messaging/get-subscriber.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 0e10488..35f1853 100644 --- a/docs/examples/messaging/get-topic.md +++ b/docs/examples/messaging/get-topic.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 b9424fa..f39a900 100644 --- a/docs/examples/messaging/list-message-logs.md +++ b/docs/examples/messaging/list-message-logs.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 159d61b..50b1a10 100644 --- a/docs/examples/messaging/list-messages.md +++ b/docs/examples/messaging/list-messages.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 af33244..c4b20a8 100644 --- a/docs/examples/messaging/list-provider-logs.md +++ b/docs/examples/messaging/list-provider-logs.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 8aa51c4..7c877c2 100644 --- a/docs/examples/messaging/list-providers.md +++ b/docs/examples/messaging/list-providers.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 036b69a..0d14f85 100644 --- a/docs/examples/messaging/list-subscriber-logs.md +++ b/docs/examples/messaging/list-subscriber-logs.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 bc820a4..384bb8f 100644 --- a/docs/examples/messaging/list-subscribers.md +++ b/docs/examples/messaging/list-subscribers.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 f2e7d47..5ce2082 100644 --- a/docs/examples/messaging/list-targets.md +++ b/docs/examples/messaging/list-targets.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 bb57ea9..d2c771d 100644 --- a/docs/examples/messaging/list-topic-logs.md +++ b/docs/examples/messaging/list-topic-logs.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 4933b22..1d0ec43 100644 --- a/docs/examples/messaging/list-topics.md +++ b/docs/examples/messaging/list-topics.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 1786ad4..71bd038 100644 --- a/docs/examples/messaging/update-apns-provider.md +++ b/docs/examples/messaging/update-apns-provider.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 534bc3f..c8b0558 100644 --- a/docs/examples/messaging/update-email.md +++ b/docs/examples/messaging/update-email.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 f9d1533..eb71ddd 100644 --- a/docs/examples/messaging/update-fcm-provider.md +++ b/docs/examples/messaging/update-fcm-provider.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 7de8939..f80d6a4 100644 --- a/docs/examples/messaging/update-mailgun-provider.md +++ b/docs/examples/messaging/update-mailgun-provider.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 5cbb3d9..36943f2 100644 --- a/docs/examples/messaging/update-msg91provider.md +++ b/docs/examples/messaging/update-msg91provider.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 11437fa..c7f0686 100644 --- a/docs/examples/messaging/update-push.md +++ b/docs/examples/messaging/update-push.md @@ -1,7 +1,7 @@ import { Client, Messaging, MessagePriority } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 66dffb1..0ec96db 100644 --- a/docs/examples/messaging/update-sendgrid-provider.md +++ b/docs/examples/messaging/update-sendgrid-provider.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 a027f1d..9c1dc4a 100644 --- a/docs/examples/messaging/update-sms.md +++ b/docs/examples/messaging/update-sms.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 6eb90ce..9d59bb3 100644 --- a/docs/examples/messaging/update-smtp-provider.md +++ b/docs/examples/messaging/update-smtp-provider.md @@ -1,7 +1,7 @@ import { Client, Messaging, SmtpEncryption } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 cc8448f..052d394 100644 --- a/docs/examples/messaging/update-telesign-provider.md +++ b/docs/examples/messaging/update-telesign-provider.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 fa12103..2163792 100644 --- a/docs/examples/messaging/update-textmagic-provider.md +++ b/docs/examples/messaging/update-textmagic-provider.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 1b60af0..5f7f779 100644 --- a/docs/examples/messaging/update-topic.md +++ b/docs/examples/messaging/update-topic.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 e63a54c..5abdd65 100644 --- a/docs/examples/messaging/update-twilio-provider.md +++ b/docs/examples/messaging/update-twilio-provider.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 c4c68b2..c8fa90d 100644 --- a/docs/examples/messaging/update-vonage-provider.md +++ b/docs/examples/messaging/update-vonage-provider.md @@ -1,7 +1,7 @@ import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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..f674553 --- /dev/null +++ b/docs/examples/sites/create-deployment.md @@ -0,0 +1,17 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new Sites(client); + +const response = await sites.createDeployment( + '', // siteId + InputFile.fromPath('/path/to/file.png', 'file.png'), // 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..317e80b --- /dev/null +++ b/docs/examples/sites/create-duplicate-deployment.md @@ -0,0 +1,13 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new Sites(client); + +const response = 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..4ef245b --- /dev/null +++ b/docs/examples/sites/create-template-deployment.md @@ -0,0 +1,17 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new Sites(client); + +const response = 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..7b07a08 --- /dev/null +++ b/docs/examples/sites/create-variable.md @@ -0,0 +1,15 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new Sites(client); + +const response = 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..5c49808 --- /dev/null +++ b/docs/examples/sites/create-vcs-deployment.md @@ -0,0 +1,15 @@ +import { Client, Sites, VCSDeploymentType } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new Sites(client); + +const response = await sites.createVcsDeployment( + '', // siteId + 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..420b362 --- /dev/null +++ b/docs/examples/sites/create.md @@ -0,0 +1,29 @@ +import { Client, Sites, , , } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new Sites(client); + +const response = await sites.create( + '', // siteId + '', // name + .Analog, // framework + .Node145, // buildRuntime + false, // enabled (optional) + false, // logging (optional) + 1, // timeout (optional) + '', // installCommand (optional) + '', // buildCommand (optional) + '', // outputDirectory (optional) + .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..cd97673 --- /dev/null +++ b/docs/examples/sites/delete-deployment.md @@ -0,0 +1,13 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new Sites(client); + +const response = 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..0b70eb3 --- /dev/null +++ b/docs/examples/sites/delete-log.md @@ -0,0 +1,13 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new Sites(client); + +const response = 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..0bbc2e3 --- /dev/null +++ b/docs/examples/sites/delete-variable.md @@ -0,0 +1,13 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new Sites(client); + +const response = 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..af5dbed --- /dev/null +++ b/docs/examples/sites/delete.md @@ -0,0 +1,12 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new Sites(client); + +const response = 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..4c3ceca --- /dev/null +++ b/docs/examples/sites/get-deployment-download.md @@ -0,0 +1,14 @@ +import { Client, Sites, DeploymentDownloadType } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new Sites(client); + +const result = sites.getDeploymentDownload( + '', // siteId + '', // deploymentId + 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..4e614b0 --- /dev/null +++ b/docs/examples/sites/get-deployment.md @@ -0,0 +1,13 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new Sites(client); + +const response = 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..9495030 --- /dev/null +++ b/docs/examples/sites/get-log.md @@ -0,0 +1,13 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new Sites(client); + +const response = 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..12ab553 --- /dev/null +++ b/docs/examples/sites/get-variable.md @@ -0,0 +1,13 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new Sites(client); + +const response = 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..769f426 --- /dev/null +++ b/docs/examples/sites/get.md @@ -0,0 +1,12 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new Sites(client); + +const response = 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..09cc521 --- /dev/null +++ b/docs/examples/sites/list-deployments.md @@ -0,0 +1,14 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new Sites(client); + +const response = 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..5623960 --- /dev/null +++ b/docs/examples/sites/list-frameworks.md @@ -0,0 +1,10 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new Sites(client); + +const response = 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..3249903 --- /dev/null +++ b/docs/examples/sites/list-logs.md @@ -0,0 +1,13 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new Sites(client); + +const response = 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..a1b0b33 --- /dev/null +++ b/docs/examples/sites/list-specifications.md @@ -0,0 +1,10 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new Sites(client); + +const response = 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..0aac319 --- /dev/null +++ b/docs/examples/sites/list-variables.md @@ -0,0 +1,12 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new Sites(client); + +const response = await sites.listVariables( + '' // siteId +); diff --git a/docs/examples/sites/list.md b/docs/examples/sites/list.md new file mode 100644 index 0000000..f21433d --- /dev/null +++ b/docs/examples/sites/list.md @@ -0,0 +1,13 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new Sites(client); + +const response = 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..83fe6f8 --- /dev/null +++ b/docs/examples/sites/update-deployment-status.md @@ -0,0 +1,13 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new Sites(client); + +const response = 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..1d9d697 --- /dev/null +++ b/docs/examples/sites/update-site-deployment.md @@ -0,0 +1,13 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new Sites(client); + +const response = 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..6776af7 --- /dev/null +++ b/docs/examples/sites/update-variable.md @@ -0,0 +1,16 @@ +import { Client, Sites } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new Sites(client); + +const response = 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..ba7d195 --- /dev/null +++ b/docs/examples/sites/update.md @@ -0,0 +1,29 @@ +import { Client, Sites, , , } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const sites = new Sites(client); + +const response = await sites.update( + '', // siteId + '', // name + .Analog, // framework + false, // enabled (optional) + false, // logging (optional) + 1, // timeout (optional) + '', // installCommand (optional) + '', // buildCommand (optional) + '', // outputDirectory (optional) + .Node145, // buildRuntime (optional) + .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 095f390..e7d3e90 100644 --- a/docs/examples/storage/create-bucket.md +++ b/docs/examples/storage/create-bucket.md @@ -1,7 +1,7 @@ import { Client, Storage, } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 9a420bb..d8912c6 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -1,7 +1,7 @@ import { Client, Storage } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 eafb60e..f0d7146 100644 --- a/docs/examples/storage/delete-bucket.md +++ b/docs/examples/storage/delete-bucket.md @@ -1,7 +1,7 @@ import { Client, Storage } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 554dbeb..2a1f95e 100644 --- a/docs/examples/storage/delete-file.md +++ b/docs/examples/storage/delete-file.md @@ -1,7 +1,7 @@ import { Client, Storage } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 1e0107e..a695021 100644 --- a/docs/examples/storage/get-bucket.md +++ b/docs/examples/storage/get-bucket.md @@ -1,7 +1,7 @@ import { Client, Storage } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 b3612f2..df11f40 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -1,7 +1,7 @@ import { Client, Storage } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 Storage(client); const result = 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 d1a91c2..6457c78 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -1,7 +1,7 @@ import { Client, Storage, ImageGravity, ImageFormat } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 = storage.getFilePreview( 0, // width (optional) 0, // height (optional) 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) - ImageFormat.Jpg // output (optional) + 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 14e28a0..5a1dbac 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -1,7 +1,7 @@ import { Client, Storage } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 Storage(client); const result = storage.getFileView( '', // bucketId - '' // fileId + '', // fileId + '' // token (optional) ); diff --git a/docs/examples/storage/get-file.md b/docs/examples/storage/get-file.md index 0ad049a..5479dc5 100644 --- a/docs/examples/storage/get-file.md +++ b/docs/examples/storage/get-file.md @@ -1,7 +1,7 @@ import { Client, Storage } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 667f65f..9286bd4 100644 --- a/docs/examples/storage/list-buckets.md +++ b/docs/examples/storage/list-buckets.md @@ -1,7 +1,7 @@ import { Client, Storage } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 7d18165..316875c 100644 --- a/docs/examples/storage/list-files.md +++ b/docs/examples/storage/list-files.md @@ -1,7 +1,7 @@ import { Client, Storage } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 7af2c1a..1e70f16 100644 --- a/docs/examples/storage/update-bucket.md +++ b/docs/examples/storage/update-bucket.md @@ -1,7 +1,7 @@ import { Client, Storage, } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 153ce08..683b0b7 100644 --- a/docs/examples/storage/update-file.md +++ b/docs/examples/storage/update-file.md @@ -1,7 +1,7 @@ import { Client, Storage } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 69465f5..d8e855f 100644 --- a/docs/examples/teams/create-membership.md +++ b/docs/examples/teams/create-membership.md @@ -1,7 +1,7 @@ import { Client, Teams } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 abcc0fd..495f26e 100644 --- a/docs/examples/teams/create.md +++ b/docs/examples/teams/create.md @@ -1,7 +1,7 @@ import { Client, Teams } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 a2a4807..a5b0387 100644 --- a/docs/examples/teams/delete-membership.md +++ b/docs/examples/teams/delete-membership.md @@ -1,7 +1,7 @@ import { Client, Teams } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 05d35f0..556fbb5 100644 --- a/docs/examples/teams/delete.md +++ b/docs/examples/teams/delete.md @@ -1,7 +1,7 @@ import { Client, Teams } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 9f9722e..75283bf 100644 --- a/docs/examples/teams/get-membership.md +++ b/docs/examples/teams/get-membership.md @@ -1,7 +1,7 @@ import { Client, Teams } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 d741911..442d8b1 100644 --- a/docs/examples/teams/get-prefs.md +++ b/docs/examples/teams/get-prefs.md @@ -1,7 +1,7 @@ import { Client, Teams } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 f5d7c12..2e5803c 100644 --- a/docs/examples/teams/get.md +++ b/docs/examples/teams/get.md @@ -1,7 +1,7 @@ import { Client, Teams } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 01988a7..0b7e663 100644 --- a/docs/examples/teams/list-memberships.md +++ b/docs/examples/teams/list-memberships.md @@ -1,7 +1,7 @@ import { Client, Teams } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 dd295a0..6c08b5c 100644 --- a/docs/examples/teams/list.md +++ b/docs/examples/teams/list.md @@ -1,7 +1,7 @@ import { Client, Teams } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 349ae6d..48fc9cd 100644 --- a/docs/examples/teams/update-membership-status.md +++ b/docs/examples/teams/update-membership-status.md @@ -1,7 +1,7 @@ import { Client, Teams } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 0f03ecb..be8651d 100644 --- a/docs/examples/teams/update-membership.md +++ b/docs/examples/teams/update-membership.md @@ -1,7 +1,7 @@ import { Client, Teams } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 4e678ea..6e2144b 100644 --- a/docs/examples/teams/update-name.md +++ b/docs/examples/teams/update-name.md @@ -1,7 +1,7 @@ import { Client, Teams } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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 9d11a5d..dea8a36 100644 --- a/docs/examples/teams/update-prefs.md +++ b/docs/examples/teams/update-prefs.md @@ -1,7 +1,7 @@ import { Client, Teams } from "https://deno.land/x/appwrite/mod.ts"; const client = new 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..7c24738 --- /dev/null +++ b/docs/examples/tokens/create-file-token.md @@ -0,0 +1,14 @@ +import { Client, Tokens } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tokens = new Tokens(client); + +const response = 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..b5e3adf --- /dev/null +++ b/docs/examples/tokens/delete.md @@ -0,0 +1,12 @@ +import { Client, Tokens } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tokens = new Tokens(client); + +const response = await tokens.delete( + '' // tokenId +); diff --git a/docs/examples/tokens/get.md b/docs/examples/tokens/get.md new file mode 100644 index 0000000..2bb827d --- /dev/null +++ b/docs/examples/tokens/get.md @@ -0,0 +1,12 @@ +import { Client, Tokens } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tokens = new Tokens(client); + +const response = await tokens.get( + '' // tokenId +); diff --git a/docs/examples/tokens/list.md b/docs/examples/tokens/list.md new file mode 100644 index 0000000..7208a53 --- /dev/null +++ b/docs/examples/tokens/list.md @@ -0,0 +1,14 @@ +import { Client, Tokens } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tokens = new Tokens(client); + +const response = 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..4464a0c --- /dev/null +++ b/docs/examples/tokens/update.md @@ -0,0 +1,13 @@ +import { Client, Tokens } from "https://deno.land/x/appwrite/mod.ts"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tokens = new Tokens(client); + +const response = await tokens.update( + '', // tokenId + '' // expire (optional) +); diff --git a/docs/examples/users/create-argon2user.md b/docs/examples/users/create-argon2user.md index 1dec8dc..7a6e0fb 100644 --- a/docs/examples/users/create-argon2user.md +++ b/docs/examples/users/create-argon2user.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 a57d1ae..ddfb7f3 100644 --- a/docs/examples/users/create-bcrypt-user.md +++ b/docs/examples/users/create-bcrypt-user.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 bc5205d..4c433ae 100644 --- a/docs/examples/users/create-j-w-t.md +++ b/docs/examples/users/create-j-w-t.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 095d19f..8cc63ce 100644 --- a/docs/examples/users/create-m-d5user.md +++ b/docs/examples/users/create-m-d5user.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 da3741a..98ba71a 100644 --- a/docs/examples/users/create-mfa-recovery-codes.md +++ b/docs/examples/users/create-mfa-recovery-codes.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 d3ada29..750b299 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 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 0d63f1b..e243a1d 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 @@ import { Client, Users, PasswordHash } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 0ee061e..0d6a65b 100644 --- a/docs/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/users/create-scrypt-modified-user.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 fcf4231..87f2dbb 100644 --- a/docs/examples/users/create-scrypt-user.md +++ b/docs/examples/users/create-scrypt-user.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 07c1623..37d6948 100644 --- a/docs/examples/users/create-session.md +++ b/docs/examples/users/create-session.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 82a44f9..a36072a 100644 --- a/docs/examples/users/create-target.md +++ b/docs/examples/users/create-target.md @@ -1,7 +1,7 @@ import { Client, Users, MessagingProviderType } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 aa15668..91885e1 100644 --- a/docs/examples/users/create-token.md +++ b/docs/examples/users/create-token.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 cd7c5b1..e0eb585 100644 --- a/docs/examples/users/create.md +++ b/docs/examples/users/create.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 3a4280c..7aea654 100644 --- a/docs/examples/users/delete-identity.md +++ b/docs/examples/users/delete-identity.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 92078bb..2d75950 100644 --- a/docs/examples/users/delete-mfa-authenticator.md +++ b/docs/examples/users/delete-mfa-authenticator.md @@ -1,7 +1,7 @@ import { Client, Users, AuthenticatorType } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 0f9c12b..0ce82fe 100644 --- a/docs/examples/users/delete-session.md +++ b/docs/examples/users/delete-session.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 94e2f84..f80300b 100644 --- a/docs/examples/users/delete-sessions.md +++ b/docs/examples/users/delete-sessions.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 ee6a280..9080a96 100644 --- a/docs/examples/users/delete-target.md +++ b/docs/examples/users/delete-target.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 3c43d5a..7ac1bf1 100644 --- a/docs/examples/users/delete.md +++ b/docs/examples/users/delete.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 e63ae70..f78c0bf 100644 --- a/docs/examples/users/get-mfa-recovery-codes.md +++ b/docs/examples/users/get-mfa-recovery-codes.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 ef38e96..ef1be1e 100644 --- a/docs/examples/users/get-prefs.md +++ b/docs/examples/users/get-prefs.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 e3d8568..301ee6e 100644 --- a/docs/examples/users/get-target.md +++ b/docs/examples/users/get-target.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 d5c2155..8e41ed6 100644 --- a/docs/examples/users/get.md +++ b/docs/examples/users/get.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 c12a37e..6ac4395 100644 --- a/docs/examples/users/list-identities.md +++ b/docs/examples/users/list-identities.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 4fc2e60..983ffba 100644 --- a/docs/examples/users/list-logs.md +++ b/docs/examples/users/list-logs.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 55ca259..afdd4d4 100644 --- a/docs/examples/users/list-memberships.md +++ b/docs/examples/users/list-memberships.md @@ -1,12 +1,14 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.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 Users(client); const response = 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 7d368b3..34b65af 100644 --- a/docs/examples/users/list-mfa-factors.md +++ b/docs/examples/users/list-mfa-factors.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 c425ded..314f277 100644 --- a/docs/examples/users/list-sessions.md +++ b/docs/examples/users/list-sessions.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 e9a26ff..9ed2dda 100644 --- a/docs/examples/users/list-targets.md +++ b/docs/examples/users/list-targets.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 d4d9da3..488fbdc 100644 --- a/docs/examples/users/list.md +++ b/docs/examples/users/list.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 76f6e44..3243f21 100644 --- a/docs/examples/users/update-email-verification.md +++ b/docs/examples/users/update-email-verification.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 80b727b..f609cab 100644 --- a/docs/examples/users/update-email.md +++ b/docs/examples/users/update-email.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 c41955c..5a23298 100644 --- a/docs/examples/users/update-labels.md +++ b/docs/examples/users/update-labels.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 201ffba..a74577e 100644 --- a/docs/examples/users/update-mfa-recovery-codes.md +++ b/docs/examples/users/update-mfa-recovery-codes.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 3f061ef..717f8d6 100644 --- a/docs/examples/users/update-mfa.md +++ b/docs/examples/users/update-mfa.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 df53c0f..35fc853 100644 --- a/docs/examples/users/update-name.md +++ b/docs/examples/users/update-name.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 451604f..8366b5c 100644 --- a/docs/examples/users/update-password.md +++ b/docs/examples/users/update-password.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 4f97a18..088fd1e 100644 --- a/docs/examples/users/update-phone-verification.md +++ b/docs/examples/users/update-phone-verification.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 d0ae0d7..a8e47a6 100644 --- a/docs/examples/users/update-phone.md +++ b/docs/examples/users/update-phone.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 81a3294..cb8919a 100644 --- a/docs/examples/users/update-prefs.md +++ b/docs/examples/users/update-prefs.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 5b1c989..1c672a4 100644 --- a/docs/examples/users/update-status.md +++ b/docs/examples/users/update-status.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API 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 8a816c8..4524748 100644 --- a/docs/examples/users/update-target.md +++ b/docs/examples/users/update-target.md @@ -1,7 +1,7 @@ import { Client, Users } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() - .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint .setProject('') // Your project ID .setKey(''); // Your secret API key diff --git a/mod.ts b/mod.ts index 6f75bbc..35c4e91 100644 --- a/mod.ts +++ b/mod.ts @@ -13,8 +13,10 @@ import { Graphql } from "./src/services/graphql.ts"; import { Health } from "./src/services/health.ts"; import { Locale } from "./src/services/locale.ts"; import { Messaging } from "./src/services/messaging.ts"; +import { Sites } from "./src/services/sites.ts"; import { Storage } from "./src/services/storage.ts"; import { Teams } from "./src/services/teams.ts"; +import { Tokens } from "./src/services/tokens.ts"; import { Users } from "./src/services/users.ts"; import { AuthenticatorType } from "./src/enums/authenticator-type.ts"; import { AuthenticationFactor } from "./src/enums/authentication-factor.ts"; @@ -26,10 +28,15 @@ import { RelationshipType } from "./src/enums/relationship-type.ts"; import { RelationMutate } from "./src/enums/relation-mutate.ts"; import { IndexType } from "./src/enums/index-type.ts"; import { Runtime } from "./src/enums/runtime.ts"; +import { VCSDeploymentType } from "./src/enums/v-c-s-deployment-type.ts"; +import { DeploymentDownloadType } from "./src/enums/deployment-download-type.ts"; import { ExecutionMethod } from "./src/enums/execution-method.ts"; import { Name } from "./src/enums/name.ts"; import { MessagePriority } from "./src/enums/message-priority.ts"; import { SmtpEncryption } from "./src/enums/smtp-encryption.ts"; +import { Framework } from "./src/enums/framework.ts"; +import { BuildRuntime } from "./src/enums/build-runtime.ts"; +import { Adapter } from "./src/enums/adapter.ts"; import { Compression } from "./src/enums/compression.ts"; import { ImageGravity } from "./src/enums/image-gravity.ts"; import { ImageFormat } from "./src/enums/image-format.ts"; @@ -52,8 +59,10 @@ export { Health, Locale, Messaging, + Sites, Storage, Teams, + Tokens, Users, AuthenticatorType, AuthenticationFactor, @@ -65,10 +74,15 @@ export { RelationMutate, IndexType, Runtime, + VCSDeploymentType, + DeploymentDownloadType, ExecutionMethod, Name, MessagePriority, SmtpEncryption, + Framework, + BuildRuntime, + Adapter, Compression, ImageGravity, ImageFormat, diff --git a/src/client.ts b/src/client.ts index 2c8f81d..5e5780f 100644 --- a/src/client.ts +++ b/src/client.ts @@ -11,12 +11,12 @@ export class Client { endpoint: string = 'https://cloud.appwrite.io/v1'; headers: Payload = { 'content-type': '', - 'user-agent' : `AppwriteDenoSDK/14.0.0 (${Deno.build.os}; ${Deno.build.arch})`, + 'user-agent' : `AppwriteDenoSDK/15.0.0 (${Deno.build.os}; ${Deno.build.arch})`, 'x-sdk-name': 'Deno', 'x-sdk-platform': 'server', 'x-sdk-language': 'deno', - 'x-sdk-version': '14.0.0', - 'X-Appwrite-Response-Format':'1.6.0', + 'x-sdk-version': '15.0.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..71b0beb --- /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..5888ce5 --- /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 66f3560..d9f2e41 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/models.d.ts b/src/models.d.ts index e27ef3d..1fd8be1 100644 --- a/src/models.d.ts +++ b/src/models.d.ts @@ -129,6 +129,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 */ @@ -155,6 +168,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 */ @@ -168,6 +194,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 */ @@ -957,6 +996,10 @@ export namespace Models { * Index attributes. */ attributes: string[]; + /** + * Index attributes length. + */ + lengths: number[]; /** * Index orders. */ @@ -1629,6 +1672,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 */ @@ -1715,6 +1791,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 */ @@ -1748,17 +1945,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. */ @@ -1853,6 +2066,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 */ @@ -1888,11 +2151,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. */ @@ -1902,7 +2169,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; /** @@ -1912,7 +2187,7 @@ export namespace Models { /** * The current build time in seconds. */ - buildTime: number; + buildDuration: number; /** * The name of the vcs provider repository */ @@ -2019,7 +2294,7 @@ export namespace Models { */ errors: string; /** - * Function execution duration in seconds. + * Resource(function/site) execution duration in seconds. */ duration: number; /** @@ -2027,47 +2302,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 */ @@ -2092,6 +2326,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 24570a3..5c5207f 100644 --- a/src/services/databases.ts +++ b/src/services/databases.ts @@ -1709,7 +1709,6 @@ export class Databases extends Service { * 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 @@ -1758,6 +1757,160 @@ export class Databases extends Service { 'json' ); } + /** + * 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} + */ + async 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; + } + return await this.client.call( + 'post', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * 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} + */ + async 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; + } + return await this.client.call( + 'put', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * 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} + */ + async 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; + } + return await this.client.call( + 'patch', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * 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} + */ + async 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; + } + return await this.client.call( + 'delete', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } /** * Get a document by its unique ID. This endpoint response returns a JSON * object with the document data. @@ -1922,10 +2075,11 @@ export class Databases extends Service { * @param {IndexType} type * @param {string[]} attributes * @param {string[]} orders + * @param {number[]} lengths * @throws {AppwriteException} * @returns {Promise} */ - async createIndex(databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: string[]): Promise { + async 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"'); } @@ -1961,6 +2115,9 @@ export class Databases extends Service { if (typeof orders !== 'undefined') { payload['orders'] = orders; } + if (typeof lengths !== 'undefined') { + payload['lengths'] = lengths; + } return await this.client.call( 'post', apiPath, diff --git a/src/services/functions.ts b/src/services/functions.ts index 06bcecf..2a5b345 100644 --- a/src/services/functions.ts +++ b/src/services/functions.ts @@ -6,6 +6,8 @@ import { AppwriteException } from '../exception.ts'; import type { Models } from '../models.d.ts'; import { Query } from '../query.ts'; import { Runtime } from '../enums/runtime.ts'; +import { VCSDeploymentType } from '../enums/v-c-s-deployment-type.ts'; +import { DeploymentDownloadType } from '../enums/deployment-download-type.ts'; import { ExecutionMethod } from '../enums/execution-method.ts'; export type UploadProgress = { @@ -76,15 +78,11 @@ export class Functions extends Service { * @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} */ - async create(functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, templateRepository?: string, templateOwner?: string, templateRootDirectory?: string, templateVersion?: string, specification?: string): Promise { + async create(functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -151,18 +149,6 @@ export class Functions extends Service { 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; } @@ -197,7 +183,6 @@ export class Functions extends Service { } /** * List allowed function specifications for this instance. - * * * @throws {AppwriteException} * @returns {Promise} @@ -362,7 +347,41 @@ export class Functions extends Service { ); } /** - * Get a list of all the project's code deployments. You can use the query + * 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} + */ + async 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; + } + return await this.client.call( + 'patch', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Get a list of all the function's code deployments. You can use the query * params to filter your results. * * @param {string} functionId @@ -535,14 +554,19 @@ export class Functions extends Service { return response; } /** - * 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} */ - async getDeployment(functionId: string, deploymentId: string): Promise { + async createDuplicateDeployment(functionId: string, deploymentId: string, buildId?: string): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -551,42 +575,82 @@ export class Functions extends Service { 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; + } return await this.client.call( - 'get', + 'post', apiPath, { + 'content-type': 'application/json', }, payload, 'json' ); } /** - * 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} */ - async updateDeployment(functionId: string, deploymentId: string): Promise { + async 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; + } return await this.client.call( - 'patch', + 'post', apiPath, { 'content-type': 'application/json', @@ -596,27 +660,44 @@ export class Functions extends Service { ); } /** - * 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} */ - async deleteDeployment(functionId: string, deploymentId: string): Promise { + async 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; + } return await this.client.call( - 'delete', + 'post', apiPath, { 'content-type': 'application/json', @@ -626,19 +707,14 @@ export class Functions extends Service { ); } /** - * 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} */ - async createBuild(functionId: string, deploymentId: string, buildId?: string): Promise { + async getDeployment(functionId: string, deploymentId: string): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -647,35 +723,27 @@ export class Functions extends Service { 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; - } return await this.client.call( - 'post', + 'get', apiPath, { - 'content-type': 'application/json', }, payload, 'json' ); } /** - * 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} */ - async updateDeploymentBuild(functionId: string, deploymentId: string): Promise { + async deleteDeployment(functionId: string, deploymentId: string): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -684,11 +752,11 @@ export class Functions extends Service { 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 = {}; return await this.client.call( - 'patch', + 'delete', apiPath, { 'content-type': 'application/json', @@ -698,15 +766,17 @@ export class Functions extends Service { ); } /** - * 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} */ - async getDeploymentDownload(functionId: string, deploymentId: string): Promise { + async getDeploymentDownload(functionId: string, deploymentId: string, type?: DeploymentDownloadType): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -718,6 +788,10 @@ export class Functions extends Service { const apiPath = '/functions/{functionId}/deployments/{deploymentId}/download'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId); const payload: Payload = {}; + if (typeof type !== 'undefined') { + payload['type'] = type; + } + return await this.client.call( 'get', apiPath, @@ -727,17 +801,50 @@ export class Functions extends Service { '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} + */ + async 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 = {}; + + return await this.client.call( + 'patch', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } /** * 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} */ - async listExecutions(functionId: string, queries?: string[], search?: string): Promise { + async listExecutions(functionId: string, queries?: string[]): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -749,10 +856,6 @@ export class Functions extends Service { payload['queries'] = queries; } - if (typeof search !== 'undefined') { - payload['search'] = search; - } - return await this.client.call( 'get', apiPath, @@ -845,7 +948,6 @@ export class Functions extends Service { } /** * Delete a function execution by its unique ID. - * * * @param {string} functionId * @param {string} executionId @@ -905,10 +1007,11 @@ export class Functions extends Service { * @param {string} functionId * @param {string} key * @param {string} value + * @param {boolean} secret * @throws {AppwriteException} * @returns {Promise} */ - async createVariable(functionId: string, key: string, value: string): Promise { + async createVariable(functionId: string, key: string, value: string, secret?: boolean): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -930,6 +1033,9 @@ export class Functions extends Service { if (typeof value !== 'undefined') { payload['value'] = value; } + if (typeof secret !== 'undefined') { + payload['secret'] = secret; + } return await this.client.call( 'post', apiPath, @@ -976,10 +1082,11 @@ export class Functions extends Service { * @param {string} variableId * @param {string} key * @param {string} value + * @param {boolean} secret * @throws {AppwriteException} * @returns {Promise} */ - async updateVariable(functionId: string, variableId: string, key: string, value?: string): Promise { + async updateVariable(functionId: string, variableId: string, key: string, value?: string, secret?: boolean): Promise { if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); } @@ -1001,6 +1108,9 @@ export class Functions extends Service { if (typeof value !== 'undefined') { payload['value'] = value; } + if (typeof secret !== 'undefined') { + payload['secret'] = secret; + } return await this.client.call( 'put', apiPath, diff --git a/src/services/sites.ts b/src/services/sites.ts new file mode 100644 index 0000000..f0b06b9 --- /dev/null +++ b/src/services/sites.ts @@ -0,0 +1,1102 @@ +import { basename } from "https://deno.land/std@0.122.0/path/mod.ts"; +import { Service } from '../service.ts'; +import { Payload, Client } from '../client.ts'; +import { InputFile } from '../inputFile.ts'; +import { AppwriteException } from '../exception.ts'; +import type { Models } from '../models.d.ts'; +import { Query } from '../query.ts'; +import { Framework } from '../enums/framework.ts'; +import { BuildRuntime } from '../enums/build-runtime.ts'; +import { Adapter } from '../enums/adapter.ts'; +import { VCSDeploymentType } from '../enums/v-c-s-deployment-type.ts'; +import { DeploymentDownloadType } from '../enums/deployment-download-type.ts'; + +export type UploadProgress = { + $id: string; + progress: number; + sizeUploaded: number; + chunksTotal: number; + chunksUploaded: number; +} + +export class Sites extends Service { + + constructor(client: Client) + { + super(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} + */ + async 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; + } + + return await this.client.call( + 'get', + apiPath, + { + }, + payload, + 'json' + ); + } + /** + * 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} + */ + async 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; + } + return await this.client.call( + 'post', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Get a list of all frameworks that are currently available on the server + * instance. + * + * @throws {AppwriteException} + * @returns {Promise} + */ + async listFrameworks(): Promise { + const apiPath = '/sites/frameworks'; + const payload: Payload = {}; + + return await this.client.call( + 'get', + apiPath, + { + }, + payload, + 'json' + ); + } + /** + * List allowed site specifications for this instance. + * + * @throws {AppwriteException} + * @returns {Promise} + */ + async listSpecifications(): Promise { + const apiPath = '/sites/specifications'; + const payload: Payload = {}; + + return await this.client.call( + 'get', + apiPath, + { + }, + payload, + 'json' + ); + } + /** + * Get a site by its unique ID. + * + * @param {string} siteId + * @throws {AppwriteException} + * @returns {Promise} + */ + async 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 = {}; + + return await this.client.call( + 'get', + apiPath, + { + }, + payload, + 'json' + ); + } + /** + * 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} + */ + async 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; + } + return await this.client.call( + 'put', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Delete a site by its unique ID. + * + * @param {string} siteId + * @throws {AppwriteException} + * @returns {Promise} + */ + async 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 = {}; + + return await this.client.call( + 'delete', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * 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} + */ + async 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; + } + return await this.client.call( + 'patch', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * 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} + */ + async 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; + } + + return await this.client.call( + 'get', + apiPath, + { + }, + payload, + 'json' + ); + } + /** + * 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 {InputFile} code + * @param {boolean} activate + * @param {string} installCommand + * @param {string} buildCommand + * @param {string} outputDirectory + * @throws {AppwriteException} + * @returns {Promise} + */ + async createDeployment(siteId: string, code: InputFile, 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.toString(); + } + + const size = code.size; + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'multipart/form-data', + }; + + let id: string | undefined = undefined; + let response: any = undefined; + + let chunksUploaded = 0; + + + let currentChunk = 1; + let currentPosition = 0; + let uploadableChunk = new Uint8Array(Client.CHUNK_SIZE); + + const uploadChunk = async (lastUpload = false) => { + if(currentChunk <= chunksUploaded) { + return; + } + + const start = ((currentChunk - 1) * Client.CHUNK_SIZE); + let end = start + currentPosition; + + if (end === size) { + end -= 1; + } + + if(!lastUpload || currentChunk !== 1) { + apiHeaders['content-range'] = 'bytes ' + start + '-' + end + '/' + size; + } + + let uploadableChunkTrimmed: Uint8Array; + + if(currentPosition + 1 >= Client.CHUNK_SIZE) { + uploadableChunkTrimmed = uploadableChunk; + } else { + uploadableChunkTrimmed = new Uint8Array(currentPosition); + for(let i = 0; i <= currentPosition; i++) { + uploadableChunkTrimmed[i] = uploadableChunk[i]; + } + } + + if (id) { + apiHeaders['x-appwrite-id'] = id; + } + + payload['code'] = { type: 'file', file: new File([uploadableChunkTrimmed], code.filename), filename: code.filename }; + + response = await this.client.call('post', apiPath, apiHeaders, payload); + + if (!id) { + id = response['$id']; + } + + if (onProgress !== null) { + onProgress({ + $id: response['$id'], + progress: Math.min((currentChunk) * Client.CHUNK_SIZE, size) / size * 100, + sizeUploaded: end+1, + chunksTotal: response['chunksTotal'], + chunksUploaded: response['chunksUploaded'] + }); + } + + uploadableChunk = new Uint8Array(Client.CHUNK_SIZE); + currentPosition = 0; + currentChunk++; + } + + for await (const chunk of code.stream) { + let i = 0; + for(const b of chunk) { + uploadableChunk[currentPosition] = chunk[i]; + + if(currentPosition + 1 >= Client.CHUNK_SIZE) { + await uploadChunk(); + currentPosition--; + } + + i++; + currentPosition++; + } + } + + await uploadChunk(true); + + return response; + } + /** + * 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} + */ + async 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; + } + return await this.client.call( + 'post', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * 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} + */ + async 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; + } + return await this.client.call( + 'post', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * 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} + */ + async 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; + } + return await this.client.call( + 'post', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Get a site deployment by its unique ID. + * + * @param {string} siteId + * @param {string} deploymentId + * @throws {AppwriteException} + * @returns {Promise} + */ + async 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 = {}; + + return await this.client.call( + 'get', + apiPath, + { + }, + payload, + 'json' + ); + } + /** + * Delete a site deployment by its unique ID. + * + * @param {string} siteId + * @param {string} deploymentId + * @throws {AppwriteException} + * @returns {Promise} + */ + async 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 = {}; + + return await this.client.call( + 'delete', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * 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} + */ + async 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; + } + + return await this.client.call( + 'get', + apiPath, + { + }, + 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} + */ + async 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 = {}; + + return await this.client.call( + 'patch', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * 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} + */ + async 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; + } + + return await this.client.call( + 'get', + apiPath, + { + }, + payload, + 'json' + ); + } + /** + * Get a site request log by its unique ID. + * + * @param {string} siteId + * @param {string} logId + * @throws {AppwriteException} + * @returns {Promise} + */ + async 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 = {}; + + return await this.client.call( + 'get', + apiPath, + { + }, + payload, + 'json' + ); + } + /** + * Delete a site log by its unique ID. + * + * @param {string} siteId + * @param {string} logId + * @throws {AppwriteException} + * @returns {Promise} + */ + async 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 = {}; + + return await this.client.call( + 'delete', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Get a list of all variables of a specific site. + * + * @param {string} siteId + * @throws {AppwriteException} + * @returns {Promise} + */ + async 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 = {}; + + return await this.client.call( + 'get', + apiPath, + { + }, + payload, + 'json' + ); + } + /** + * 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} + */ + async 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; + } + return await this.client.call( + 'post', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Get a variable by its unique ID. + * + * @param {string} siteId + * @param {string} variableId + * @throws {AppwriteException} + * @returns {Promise} + */ + async 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 = {}; + + return await this.client.call( + 'get', + apiPath, + { + }, + payload, + 'json' + ); + } + /** + * 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} + */ + async 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; + } + return await this.client.call( + 'put', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Delete a variable by its unique ID. + * + * @param {string} siteId + * @param {string} variableId + * @throws {AppwriteException} + * @returns {Promise} + */ + async 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 = {}; + + return await this.client.call( + 'delete', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } +} diff --git a/src/services/storage.ts b/src/services/storage.ts index e751553..4d535cb 100644 --- a/src/services/storage.ts +++ b/src/services/storage.ts @@ -530,10 +530,11 @@ export class Storage extends Service { * * @param {string} bucketId * @param {string} fileId + * @param {string} token * @throws {AppwriteException} * @returns {Promise} */ - async getFileDownload(bucketId: string, fileId: string): Promise { + async getFileDownload(bucketId: string, fileId: string, token?: string): Promise { if (typeof bucketId === 'undefined') { throw new AppwriteException('Missing required parameter: "bucketId"'); } @@ -545,6 +546,10 @@ export class Storage extends Service { const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/download'.replace('{bucketId}', bucketId).replace('{fileId}', fileId); const payload: Payload = {}; + if (typeof token !== 'undefined') { + payload['token'] = token; + } + return await this.client.call( 'get', apiPath, @@ -574,10 +579,11 @@ export class Storage extends Service { * @param {number} rotation * @param {string} background * @param {ImageFormat} output + * @param {string} token * @throws {AppwriteException} * @returns {Promise} */ - async 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 { + async 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"'); } @@ -633,6 +639,10 @@ export class Storage extends Service { payload['output'] = output; } + if (typeof token !== 'undefined') { + payload['token'] = token; + } + return await this.client.call( 'get', apiPath, @@ -649,10 +659,11 @@ export class Storage extends Service { * * @param {string} bucketId * @param {string} fileId + * @param {string} token * @throws {AppwriteException} * @returns {Promise} */ - async getFileView(bucketId: string, fileId: string): Promise { + async getFileView(bucketId: string, fileId: string, token?: string): Promise { if (typeof bucketId === 'undefined') { throw new AppwriteException('Missing required parameter: "bucketId"'); } @@ -664,6 +675,10 @@ export class Storage extends Service { const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/view'.replace('{bucketId}', bucketId).replace('{fileId}', fileId); const payload: Payload = {}; + if (typeof token !== 'undefined') { + payload['token'] = token; + } + return await this.client.call( 'get', apiPath, diff --git a/src/services/tokens.ts b/src/services/tokens.ts new file mode 100644 index 0000000..2aac6fe --- /dev/null +++ b/src/services/tokens.ts @@ -0,0 +1,173 @@ +import { basename } from "https://deno.land/std@0.122.0/path/mod.ts"; +import { Service } from '../service.ts'; +import { Payload, Client } from '../client.ts'; +import { InputFile } from '../inputFile.ts'; +import { AppwriteException } from '../exception.ts'; +import type { Models } from '../models.d.ts'; +import { Query } from '../query.ts'; + +export type UploadProgress = { + $id: string; + progress: number; + sizeUploaded: number; + chunksTotal: number; + chunksUploaded: number; +} + +export class Tokens extends Service { + + constructor(client: Client) + { + super(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} + */ + async 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; + } + + return await this.client.call( + 'get', + apiPath, + { + }, + payload, + 'json' + ); + } + /** + * 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} + */ + async 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; + } + return await this.client.call( + 'post', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Get a token by its unique ID. + * + * @param {string} tokenId + * @throws {AppwriteException} + * @returns {Promise} + */ + async 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 = {}; + + return await this.client.call( + 'get', + apiPath, + { + }, + payload, + 'json' + ); + } + /** + * 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} + */ + async 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; + } + return await this.client.call( + 'patch', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } + /** + * Delete a token by its unique ID. + * + * @param {string} tokenId + * @throws {AppwriteException} + * @returns {Promise} + */ + async 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 = {}; + + return await this.client.call( + 'delete', + apiPath, + { + 'content-type': 'application/json', + }, + payload, + 'json' + ); + } +} diff --git a/src/services/users.ts b/src/services/users.ts index b4a5249..3805fe1 100644 --- a/src/services/users.ts +++ b/src/services/users.ts @@ -771,10 +771,12 @@ export class Users extends Service { * Get the user membership list by its unique ID. * * @param {string} userId + * @param {string[]} queries + * @param {string} search * @throws {AppwriteException} * @returns {Promise} */ - async listMemberships(userId: string): Promise { + async listMemberships(userId: string, queries?: string[], search?: string): Promise { if (typeof userId === 'undefined') { throw new AppwriteException('Missing required parameter: "userId"'); } @@ -782,6 +784,14 @@ export class Users extends Service { 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; + } + return await this.client.call( 'get', apiPath, diff --git a/test/services/databases.test.ts b/test/services/databases.test.ts index 2f16ee3..4385b65 100644 --- a/test/services/databases.test.ts +++ b/test/services/databases.test.ts @@ -818,6 +818,75 @@ describe('Databases service', () => { }); + test('test method createDocuments()', async () => { + const data = { + 'total': 5, + 'documents': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await databases.createDocuments( + '', + '', + [], + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method upsertDocuments()', async () => { + const data = { + 'total': 5, + 'documents': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await databases.upsertDocuments( + '', + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method updateDocuments()', async () => { + const data = { + 'total': 5, + 'documents': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await databases.updateDocuments( + '', + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method deleteDocuments()', async () => { + const data = { + 'total': 5, + 'documents': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await databases.deleteDocuments( + '', + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + test('test method getDocument()', async () => { const data = { '\$id': '5e5ea5c16897e', @@ -903,6 +972,7 @@ describe('Databases service', () => { 'status': 'available', 'error': 'string', 'attributes': [], + 'lengths': [], '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00',}; @@ -928,6 +998,7 @@ describe('Databases service', () => { 'status': 'available', 'error': 'string', 'attributes': [], + 'lengths': [], '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00',}; diff --git a/test/services/functions.test.ts b/test/services/functions.test.ts index 71f8139..cd16ee0 100644 --- a/test/services/functions.test.ts +++ b/test/services/functions.test.ts @@ -38,7 +38,11 @@ describe('Functions service', () => { 'live': true, 'logging': true, 'runtime': 'python-3.8', - 'deployment': '5e5ea5c16897e', + 'deploymentId': '5e5ea5c16897e', + 'deploymentCreatedAt': '2020-10-15T06:38:00.000+00:00', + 'latestDeploymentId': '5e5ea5c16897e', + 'latestDeploymentCreatedAt': '2020-10-15T06:38:00.000+00:00', + 'latestDeploymentStatus': 'ready', 'scopes': [], 'vars': [], 'events': [], @@ -108,7 +112,11 @@ describe('Functions service', () => { 'live': true, 'logging': true, 'runtime': 'python-3.8', - 'deployment': '5e5ea5c16897e', + 'deploymentId': '5e5ea5c16897e', + 'deploymentCreatedAt': '2020-10-15T06:38:00.000+00:00', + 'latestDeploymentId': '5e5ea5c16897e', + 'latestDeploymentCreatedAt': '2020-10-15T06:38:00.000+00:00', + 'latestDeploymentStatus': 'ready', 'scopes': [], 'vars': [], 'events': [], @@ -146,7 +154,11 @@ describe('Functions service', () => { 'live': true, 'logging': true, 'runtime': 'python-3.8', - 'deployment': '5e5ea5c16897e', + 'deploymentId': '5e5ea5c16897e', + 'deploymentCreatedAt': '2020-10-15T06:38:00.000+00:00', + 'latestDeploymentId': '5e5ea5c16897e', + 'latestDeploymentCreatedAt': '2020-10-15T06:38:00.000+00:00', + 'latestDeploymentStatus': 'ready', 'scopes': [], 'vars': [], 'events': [], @@ -189,6 +201,49 @@ describe('Functions service', () => { }); + test('test method updateFunctionDeployment()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'execute': [], + 'name': 'My Function', + 'enabled': true, + 'live': true, + 'logging': true, + 'runtime': 'python-3.8', + 'deploymentId': '5e5ea5c16897e', + 'deploymentCreatedAt': '2020-10-15T06:38:00.000+00:00', + 'latestDeploymentId': '5e5ea5c16897e', + 'latestDeploymentCreatedAt': '2020-10-15T06:38:00.000+00:00', + 'latestDeploymentStatus': 'ready', + 'scopes': [], + 'vars': [], + 'events': [], + 'schedule': '5 4 * * *', + 'timeout': 300, + 'entrypoint': 'index.js', + 'commands': 'npm install', + 'version': 'v2', + 'installationId': '6m40at4ejk5h2u9s1hboo', + 'providerRepositoryId': 'appwrite', + 'providerBranch': 'main', + 'providerRootDirectory': 'functions/helloWorld', + 'providerSilentMode': true, + 'specification': 's-1vcpu-512mb',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await functions.updateFunctionDeployment( + '', + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + test('test method listDeployments()', async () => { const data = { 'total': 5, @@ -214,13 +269,16 @@ describe('Functions service', () => { 'resourceId': '5e5ea6g16897e', 'resourceType': 'functions', 'entrypoint': 'index.js', - 'size': 128, + 'sourceSize': 128, 'buildSize': 128, + 'totalSize': 128, 'buildId': '5e5ea5c16897e', 'activate': true, + 'screenshotLight': '5e5ea5c16897e', + 'screenshotDark': '5e5ea5c16897e', 'status': 'ready', 'buildLogs': 'Compiling source files...', - 'buildTime': 128, + 'buildDuration': 128, 'providerRepositoryName': 'database', 'providerRepositoryOwner': 'utopia', 'providerRepositoryUrl': 'https://github.com/vermakhushboo/g4-node-function', @@ -245,7 +303,7 @@ describe('Functions service', () => { }); - test('test method getDeployment()', async () => { + test('test method createDuplicateDeployment()', async () => { const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', @@ -254,13 +312,16 @@ describe('Functions service', () => { 'resourceId': '5e5ea6g16897e', 'resourceType': 'functions', 'entrypoint': 'index.js', - 'size': 128, + 'sourceSize': 128, 'buildSize': 128, + 'totalSize': 128, 'buildId': '5e5ea5c16897e', 'activate': true, + 'screenshotLight': '5e5ea5c16897e', + 'screenshotDark': '5e5ea5c16897e', 'status': 'ready', 'buildLogs': 'Compiling source files...', - 'buildTime': 128, + 'buildDuration': 128, 'providerRepositoryName': 'database', 'providerRepositoryOwner': 'utopia', 'providerRepositoryUrl': 'https://github.com/vermakhushboo/g4-node-function', @@ -274,7 +335,7 @@ describe('Functions service', () => { const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await functions.getDeployment( + const response = await functions.createDuplicateDeployment( '', '', ); @@ -284,38 +345,44 @@ describe('Functions service', () => { }); - test('test method updateDeployment()', async () => { + test('test method createTemplateDeployment()', async () => { const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', - 'execute': [], - 'name': 'My Function', - 'enabled': true, - 'live': true, - 'logging': true, - 'runtime': 'python-3.8', - 'deployment': '5e5ea5c16897e', - 'scopes': [], - 'vars': [], - 'events': [], - 'schedule': '5 4 * * *', - 'timeout': 300, + 'type': 'vcs', + 'resourceId': '5e5ea6g16897e', + 'resourceType': 'functions', 'entrypoint': 'index.js', - 'commands': 'npm install', - 'version': 'v2', - 'installationId': '6m40at4ejk5h2u9s1hboo', - 'providerRepositoryId': 'appwrite', - 'providerBranch': 'main', - 'providerRootDirectory': 'functions/helloWorld', - 'providerSilentMode': true, - 'specification': 's-1vcpu-512mb',}; + 'sourceSize': 128, + 'buildSize': 128, + 'totalSize': 128, + 'buildId': '5e5ea5c16897e', + 'activate': true, + 'screenshotLight': '5e5ea5c16897e', + 'screenshotDark': '5e5ea5c16897e', + 'status': 'ready', + 'buildLogs': 'Compiling source files...', + 'buildDuration': 128, + 'providerRepositoryName': 'database', + 'providerRepositoryOwner': 'utopia', + 'providerRepositoryUrl': 'https://github.com/vermakhushboo/g4-node-function', + 'providerBranch': '0.7.x', + 'providerCommitHash': '7c3f25d', + 'providerCommitAuthorUrl': 'https://github.com/vermakhushboo', + 'providerCommitAuthor': 'Khushboo Verma', + 'providerCommitMessage': 'Update index.js', + 'providerCommitUrl': 'https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb', + 'providerBranchUrl': 'https://github.com/vermakhushboo/appwrite/tree/0.7.x',}; const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await functions.updateDeployment( + const response = await functions.createTemplateDeployment( '', - '', + '', + '', + '', + '', ); assertEquals(response, data); @@ -323,58 +390,103 @@ describe('Functions service', () => { }); - test('test method deleteDeployment()', async () => { - const data = ''; + test('test method createVcsDeployment()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'type': 'vcs', + 'resourceId': '5e5ea6g16897e', + 'resourceType': 'functions', + 'entrypoint': 'index.js', + 'sourceSize': 128, + 'buildSize': 128, + 'totalSize': 128, + 'buildId': '5e5ea5c16897e', + 'activate': true, + 'screenshotLight': '5e5ea5c16897e', + 'screenshotDark': '5e5ea5c16897e', + 'status': 'ready', + 'buildLogs': 'Compiling source files...', + 'buildDuration': 128, + 'providerRepositoryName': 'database', + 'providerRepositoryOwner': 'utopia', + 'providerRepositoryUrl': 'https://github.com/vermakhushboo/g4-node-function', + 'providerBranch': '0.7.x', + 'providerCommitHash': '7c3f25d', + 'providerCommitAuthorUrl': 'https://github.com/vermakhushboo', + 'providerCommitAuthor': 'Khushboo Verma', + 'providerCommitMessage': 'Update index.js', + 'providerCommitUrl': 'https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb', + 'providerBranchUrl': 'https://github.com/vermakhushboo/appwrite/tree/0.7.x',}; - const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(new Response(data))) + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await functions.deleteDeployment( + const response = await functions.createVcsDeployment( '', - '', + 'branch', + '', ); - const text = await response.text(); - assertEquals(text, data); + assertEquals(response, data); stubbedFetch.restore(); }); - test('test method createBuild()', async () => { - const data = ''; + test('test method getDeployment()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'type': 'vcs', + 'resourceId': '5e5ea6g16897e', + 'resourceType': 'functions', + 'entrypoint': 'index.js', + 'sourceSize': 128, + 'buildSize': 128, + 'totalSize': 128, + 'buildId': '5e5ea5c16897e', + 'activate': true, + 'screenshotLight': '5e5ea5c16897e', + 'screenshotDark': '5e5ea5c16897e', + 'status': 'ready', + 'buildLogs': 'Compiling source files...', + 'buildDuration': 128, + 'providerRepositoryName': 'database', + 'providerRepositoryOwner': 'utopia', + 'providerRepositoryUrl': 'https://github.com/vermakhushboo/g4-node-function', + 'providerBranch': '0.7.x', + 'providerCommitHash': '7c3f25d', + 'providerCommitAuthorUrl': 'https://github.com/vermakhushboo', + 'providerCommitAuthor': 'Khushboo Verma', + 'providerCommitMessage': 'Update index.js', + 'providerCommitUrl': 'https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb', + 'providerBranchUrl': 'https://github.com/vermakhushboo/appwrite/tree/0.7.x',}; - const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(new Response(data))) + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); - const response = await functions.createBuild( + const response = await functions.getDeployment( '', '', ); - const text = await response.text(); - assertEquals(text, data); + assertEquals(response, data); stubbedFetch.restore(); }); - test('test method updateDeploymentBuild()', async () => { - const data = { - '\$id': '5e5ea5c16897e', - 'deploymentId': '5e5ea5c16897e', - 'status': 'ready', - 'stdout': '', - 'stderr': '', - 'startTime': '2020-10-15T06:38:00.000+00:00', - 'endTime': '2020-10-15T06:38:00.000+00:00', - 'duration': 0, - 'size': 128,}; + test('test method deleteDeployment()', async () => { + const data = ''; - const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(new Response(data))) - const response = await functions.updateDeploymentBuild( + const response = await functions.deleteDeployment( '', '', ); - assertEquals(response, data); + const text = await response.text(); + assertEquals(text, data); stubbedFetch.restore(); }); @@ -395,6 +507,48 @@ describe('Functions service', () => { }); + test('test method updateDeploymentStatus()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'type': 'vcs', + 'resourceId': '5e5ea6g16897e', + 'resourceType': 'functions', + 'entrypoint': 'index.js', + 'sourceSize': 128, + 'buildSize': 128, + 'totalSize': 128, + 'buildId': '5e5ea5c16897e', + 'activate': true, + 'screenshotLight': '5e5ea5c16897e', + 'screenshotDark': '5e5ea5c16897e', + 'status': 'ready', + 'buildLogs': 'Compiling source files...', + 'buildDuration': 128, + 'providerRepositoryName': 'database', + 'providerRepositoryOwner': 'utopia', + 'providerRepositoryUrl': 'https://github.com/vermakhushboo/g4-node-function', + 'providerBranch': '0.7.x', + 'providerCommitHash': '7c3f25d', + 'providerCommitAuthorUrl': 'https://github.com/vermakhushboo', + 'providerCommitAuthor': 'Khushboo Verma', + 'providerCommitMessage': 'Update index.js', + 'providerCommitUrl': 'https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb', + 'providerBranchUrl': 'https://github.com/vermakhushboo/appwrite/tree/0.7.x',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await functions.updateDeploymentStatus( + '', + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + test('test method listExecutions()', async () => { const data = { 'total': 5, @@ -511,6 +665,7 @@ describe('Functions service', () => { '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'key': 'API_KEY', 'value': 'myPa\$\$word1', + 'secret': true, 'resourceType': 'function', 'resourceId': 'myAwesomeFunction',}; @@ -534,6 +689,7 @@ describe('Functions service', () => { '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'key': 'API_KEY', 'value': 'myPa\$\$word1', + 'secret': true, 'resourceType': 'function', 'resourceId': 'myAwesomeFunction',}; @@ -556,6 +712,7 @@ describe('Functions service', () => { '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'key': 'API_KEY', 'value': 'myPa\$\$word1', + 'secret': true, 'resourceType': 'function', 'resourceId': 'myAwesomeFunction',}; diff --git a/test/services/sites.test.ts b/test/services/sites.test.ts new file mode 100644 index 0000000..1dd1116 --- /dev/null +++ b/test/services/sites.test.ts @@ -0,0 +1,723 @@ +import {afterEach, describe, it as test} from "https://deno.land/std@0.204.0/testing/bdd.ts"; +import {restore, stub} from "https://deno.land/std@0.204.0/testing/mock.ts"; +import {assertEquals} from "https://deno.land/std@0.204.0/assert/assert_equals.ts"; +import { Sites } from "../../src/services/sites.ts"; +import {Client} from "../../src/client.ts"; +import {InputFile} from "../../src/inputFile.ts" + +describe('Sites service', () => { + const client = new Client(); + const sites = new Sites(client); + + afterEach(() => restore()) + + + test('test method list()', async () => { + const data = { + 'total': 5, + 'sites': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await sites.list( + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method create()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Site', + 'enabled': true, + 'live': true, + 'logging': true, + 'framework': 'react', + 'deploymentId': '5e5ea5c16897e', + 'deploymentCreatedAt': '2020-10-15T06:38:00.000+00:00', + 'deploymentScreenshotLight': '5e5ea5c16897e', + 'deploymentScreenshotDark': '5e5ea5c16897e', + 'latestDeploymentId': '5e5ea5c16897e', + 'latestDeploymentCreatedAt': '2020-10-15T06:38:00.000+00:00', + 'latestDeploymentStatus': 'ready', + 'vars': [], + 'timeout': 300, + 'installCommand': 'npm install', + 'buildCommand': 'npm run build', + 'outputDirectory': 'build', + 'installationId': '6m40at4ejk5h2u9s1hboo', + 'providerRepositoryId': 'appwrite', + 'providerBranch': 'main', + 'providerRootDirectory': 'sites/helloWorld', + 'providerSilentMode': true, + 'specification': 's-1vcpu-512mb', + 'buildRuntime': 'node-22', + 'adapter': 'static', + 'fallbackFile': 'index.html',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await sites.create( + '', + '', + 'analog', + 'node-14.5', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method listFrameworks()', async () => { + const data = { + 'total': 5, + 'frameworks': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await sites.listFrameworks( + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method listSpecifications()', async () => { + const data = { + 'total': 5, + 'specifications': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await sites.listSpecifications( + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method get()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Site', + 'enabled': true, + 'live': true, + 'logging': true, + 'framework': 'react', + 'deploymentId': '5e5ea5c16897e', + 'deploymentCreatedAt': '2020-10-15T06:38:00.000+00:00', + 'deploymentScreenshotLight': '5e5ea5c16897e', + 'deploymentScreenshotDark': '5e5ea5c16897e', + 'latestDeploymentId': '5e5ea5c16897e', + 'latestDeploymentCreatedAt': '2020-10-15T06:38:00.000+00:00', + 'latestDeploymentStatus': 'ready', + 'vars': [], + 'timeout': 300, + 'installCommand': 'npm install', + 'buildCommand': 'npm run build', + 'outputDirectory': 'build', + 'installationId': '6m40at4ejk5h2u9s1hboo', + 'providerRepositoryId': 'appwrite', + 'providerBranch': 'main', + 'providerRootDirectory': 'sites/helloWorld', + 'providerSilentMode': true, + 'specification': 's-1vcpu-512mb', + 'buildRuntime': 'node-22', + 'adapter': 'static', + 'fallbackFile': 'index.html',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await sites.get( + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method update()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Site', + 'enabled': true, + 'live': true, + 'logging': true, + 'framework': 'react', + 'deploymentId': '5e5ea5c16897e', + 'deploymentCreatedAt': '2020-10-15T06:38:00.000+00:00', + 'deploymentScreenshotLight': '5e5ea5c16897e', + 'deploymentScreenshotDark': '5e5ea5c16897e', + 'latestDeploymentId': '5e5ea5c16897e', + 'latestDeploymentCreatedAt': '2020-10-15T06:38:00.000+00:00', + 'latestDeploymentStatus': 'ready', + 'vars': [], + 'timeout': 300, + 'installCommand': 'npm install', + 'buildCommand': 'npm run build', + 'outputDirectory': 'build', + 'installationId': '6m40at4ejk5h2u9s1hboo', + 'providerRepositoryId': 'appwrite', + 'providerBranch': 'main', + 'providerRootDirectory': 'sites/helloWorld', + 'providerSilentMode': true, + 'specification': 's-1vcpu-512mb', + 'buildRuntime': 'node-22', + 'adapter': 'static', + 'fallbackFile': 'index.html',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await sites.update( + '', + '', + 'analog', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method delete()', async () => { + const data = ''; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(new Response(data))) + + const response = await sites.delete( + '', + ); + + const text = await response.text(); + assertEquals(text, data); + stubbedFetch.restore(); + }); + + + test('test method updateSiteDeployment()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Site', + 'enabled': true, + 'live': true, + 'logging': true, + 'framework': 'react', + 'deploymentId': '5e5ea5c16897e', + 'deploymentCreatedAt': '2020-10-15T06:38:00.000+00:00', + 'deploymentScreenshotLight': '5e5ea5c16897e', + 'deploymentScreenshotDark': '5e5ea5c16897e', + 'latestDeploymentId': '5e5ea5c16897e', + 'latestDeploymentCreatedAt': '2020-10-15T06:38:00.000+00:00', + 'latestDeploymentStatus': 'ready', + 'vars': [], + 'timeout': 300, + 'installCommand': 'npm install', + 'buildCommand': 'npm run build', + 'outputDirectory': 'build', + 'installationId': '6m40at4ejk5h2u9s1hboo', + 'providerRepositoryId': 'appwrite', + 'providerBranch': 'main', + 'providerRootDirectory': 'sites/helloWorld', + 'providerSilentMode': true, + 'specification': 's-1vcpu-512mb', + 'buildRuntime': 'node-22', + 'adapter': 'static', + 'fallbackFile': 'index.html',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await sites.updateSiteDeployment( + '', + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method listDeployments()', async () => { + const data = { + 'total': 5, + 'deployments': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await sites.listDeployments( + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method createDeployment()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'type': 'vcs', + 'resourceId': '5e5ea6g16897e', + 'resourceType': 'functions', + 'entrypoint': 'index.js', + 'sourceSize': 128, + 'buildSize': 128, + 'totalSize': 128, + 'buildId': '5e5ea5c16897e', + 'activate': true, + 'screenshotLight': '5e5ea5c16897e', + 'screenshotDark': '5e5ea5c16897e', + 'status': 'ready', + 'buildLogs': 'Compiling source files...', + 'buildDuration': 128, + 'providerRepositoryName': 'database', + 'providerRepositoryOwner': 'utopia', + 'providerRepositoryUrl': 'https://github.com/vermakhushboo/g4-node-function', + 'providerBranch': '0.7.x', + 'providerCommitHash': '7c3f25d', + 'providerCommitAuthorUrl': 'https://github.com/vermakhushboo', + 'providerCommitAuthor': 'Khushboo Verma', + 'providerCommitMessage': 'Update index.js', + 'providerCommitUrl': 'https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb', + 'providerBranchUrl': 'https://github.com/vermakhushboo/appwrite/tree/0.7.x',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await sites.createDeployment( + '', + InputFile.fromBuffer(new Uint8Array(0), 'image.png'), + true, + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method createDuplicateDeployment()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'type': 'vcs', + 'resourceId': '5e5ea6g16897e', + 'resourceType': 'functions', + 'entrypoint': 'index.js', + 'sourceSize': 128, + 'buildSize': 128, + 'totalSize': 128, + 'buildId': '5e5ea5c16897e', + 'activate': true, + 'screenshotLight': '5e5ea5c16897e', + 'screenshotDark': '5e5ea5c16897e', + 'status': 'ready', + 'buildLogs': 'Compiling source files...', + 'buildDuration': 128, + 'providerRepositoryName': 'database', + 'providerRepositoryOwner': 'utopia', + 'providerRepositoryUrl': 'https://github.com/vermakhushboo/g4-node-function', + 'providerBranch': '0.7.x', + 'providerCommitHash': '7c3f25d', + 'providerCommitAuthorUrl': 'https://github.com/vermakhushboo', + 'providerCommitAuthor': 'Khushboo Verma', + 'providerCommitMessage': 'Update index.js', + 'providerCommitUrl': 'https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb', + 'providerBranchUrl': 'https://github.com/vermakhushboo/appwrite/tree/0.7.x',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await sites.createDuplicateDeployment( + '', + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method createTemplateDeployment()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'type': 'vcs', + 'resourceId': '5e5ea6g16897e', + 'resourceType': 'functions', + 'entrypoint': 'index.js', + 'sourceSize': 128, + 'buildSize': 128, + 'totalSize': 128, + 'buildId': '5e5ea5c16897e', + 'activate': true, + 'screenshotLight': '5e5ea5c16897e', + 'screenshotDark': '5e5ea5c16897e', + 'status': 'ready', + 'buildLogs': 'Compiling source files...', + 'buildDuration': 128, + 'providerRepositoryName': 'database', + 'providerRepositoryOwner': 'utopia', + 'providerRepositoryUrl': 'https://github.com/vermakhushboo/g4-node-function', + 'providerBranch': '0.7.x', + 'providerCommitHash': '7c3f25d', + 'providerCommitAuthorUrl': 'https://github.com/vermakhushboo', + 'providerCommitAuthor': 'Khushboo Verma', + 'providerCommitMessage': 'Update index.js', + 'providerCommitUrl': 'https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb', + 'providerBranchUrl': 'https://github.com/vermakhushboo/appwrite/tree/0.7.x',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await sites.createTemplateDeployment( + '', + '', + '', + '', + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method createVcsDeployment()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'type': 'vcs', + 'resourceId': '5e5ea6g16897e', + 'resourceType': 'functions', + 'entrypoint': 'index.js', + 'sourceSize': 128, + 'buildSize': 128, + 'totalSize': 128, + 'buildId': '5e5ea5c16897e', + 'activate': true, + 'screenshotLight': '5e5ea5c16897e', + 'screenshotDark': '5e5ea5c16897e', + 'status': 'ready', + 'buildLogs': 'Compiling source files...', + 'buildDuration': 128, + 'providerRepositoryName': 'database', + 'providerRepositoryOwner': 'utopia', + 'providerRepositoryUrl': 'https://github.com/vermakhushboo/g4-node-function', + 'providerBranch': '0.7.x', + 'providerCommitHash': '7c3f25d', + 'providerCommitAuthorUrl': 'https://github.com/vermakhushboo', + 'providerCommitAuthor': 'Khushboo Verma', + 'providerCommitMessage': 'Update index.js', + 'providerCommitUrl': 'https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb', + 'providerBranchUrl': 'https://github.com/vermakhushboo/appwrite/tree/0.7.x',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await sites.createVcsDeployment( + '', + 'branch', + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method getDeployment()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'type': 'vcs', + 'resourceId': '5e5ea6g16897e', + 'resourceType': 'functions', + 'entrypoint': 'index.js', + 'sourceSize': 128, + 'buildSize': 128, + 'totalSize': 128, + 'buildId': '5e5ea5c16897e', + 'activate': true, + 'screenshotLight': '5e5ea5c16897e', + 'screenshotDark': '5e5ea5c16897e', + 'status': 'ready', + 'buildLogs': 'Compiling source files...', + 'buildDuration': 128, + 'providerRepositoryName': 'database', + 'providerRepositoryOwner': 'utopia', + 'providerRepositoryUrl': 'https://github.com/vermakhushboo/g4-node-function', + 'providerBranch': '0.7.x', + 'providerCommitHash': '7c3f25d', + 'providerCommitAuthorUrl': 'https://github.com/vermakhushboo', + 'providerCommitAuthor': 'Khushboo Verma', + 'providerCommitMessage': 'Update index.js', + 'providerCommitUrl': 'https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb', + 'providerBranchUrl': 'https://github.com/vermakhushboo/appwrite/tree/0.7.x',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await sites.getDeployment( + '', + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method deleteDeployment()', async () => { + const data = ''; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(new Response(data))) + + const response = await sites.deleteDeployment( + '', + '', + ); + + const text = await response.text(); + assertEquals(text, data); + stubbedFetch.restore(); + }); + + + test('test method getDeploymentDownload()', async () => { + const data = new Uint8Array(0); + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(new Response(data.buffer))); + + const response = await sites.getDeploymentDownload( + '', + '', + ); + + const buffer = await response.arrayBuffer(); + assertEquals(buffer.byteLength, 0); + stubbedFetch.restore(); + }); + + + test('test method updateDeploymentStatus()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'type': 'vcs', + 'resourceId': '5e5ea6g16897e', + 'resourceType': 'functions', + 'entrypoint': 'index.js', + 'sourceSize': 128, + 'buildSize': 128, + 'totalSize': 128, + 'buildId': '5e5ea5c16897e', + 'activate': true, + 'screenshotLight': '5e5ea5c16897e', + 'screenshotDark': '5e5ea5c16897e', + 'status': 'ready', + 'buildLogs': 'Compiling source files...', + 'buildDuration': 128, + 'providerRepositoryName': 'database', + 'providerRepositoryOwner': 'utopia', + 'providerRepositoryUrl': 'https://github.com/vermakhushboo/g4-node-function', + 'providerBranch': '0.7.x', + 'providerCommitHash': '7c3f25d', + 'providerCommitAuthorUrl': 'https://github.com/vermakhushboo', + 'providerCommitAuthor': 'Khushboo Verma', + 'providerCommitMessage': 'Update index.js', + 'providerCommitUrl': 'https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb', + 'providerBranchUrl': 'https://github.com/vermakhushboo/appwrite/tree/0.7.x',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await sites.updateDeploymentStatus( + '', + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method listLogs()', async () => { + const data = { + 'total': 5, + 'executions': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await sites.listLogs( + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method getLog()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + '\$permissions': [], + 'functionId': '5e5ea6g16897e', + 'trigger': 'http', + 'status': 'processing', + 'requestMethod': 'GET', + 'requestPath': '/articles?id=5', + 'requestHeaders': [], + 'responseStatusCode': 200, + 'responseBody': '', + 'responseHeaders': [], + 'logs': '', + 'errors': '', + 'duration': 0.4,}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await sites.getLog( + '', + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method deleteLog()', async () => { + const data = ''; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(new Response(data))) + + const response = await sites.deleteLog( + '', + '', + ); + + const text = await response.text(); + assertEquals(text, data); + stubbedFetch.restore(); + }); + + + test('test method listVariables()', async () => { + const data = { + 'total': 5, + 'variables': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await sites.listVariables( + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method createVariable()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'key': 'API_KEY', + 'value': 'myPa\$\$word1', + 'secret': true, + 'resourceType': 'function', + 'resourceId': 'myAwesomeFunction',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await sites.createVariable( + '', + '', + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method getVariable()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'key': 'API_KEY', + 'value': 'myPa\$\$word1', + 'secret': true, + 'resourceType': 'function', + 'resourceId': 'myAwesomeFunction',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await sites.getVariable( + '', + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method updateVariable()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'key': 'API_KEY', + 'value': 'myPa\$\$word1', + 'secret': true, + 'resourceType': 'function', + 'resourceId': 'myAwesomeFunction',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await sites.updateVariable( + '', + '', + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method deleteVariable()', async () => { + const data = ''; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(new Response(data))) + + const response = await sites.deleteVariable( + '', + '', + ); + + const text = await response.text(); + assertEquals(text, data); + stubbedFetch.restore(); + }); + + }) diff --git a/test/services/tokens.test.ts b/test/services/tokens.test.ts new file mode 100644 index 0000000..94e2bd9 --- /dev/null +++ b/test/services/tokens.test.ts @@ -0,0 +1,110 @@ +import {afterEach, describe, it as test} from "https://deno.land/std@0.204.0/testing/bdd.ts"; +import {restore, stub} from "https://deno.land/std@0.204.0/testing/mock.ts"; +import {assertEquals} from "https://deno.land/std@0.204.0/assert/assert_equals.ts"; +import { Tokens } from "../../src/services/tokens.ts"; +import {Client} from "../../src/client.ts"; +import {InputFile} from "../../src/inputFile.ts" + +describe('Tokens service', () => { + const client = new Client(); + const tokens = new Tokens(client); + + afterEach(() => restore()) + + + test('test method list()', async () => { + const data = { + 'total': 5, + 'tokens': [],}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tokens.list( + '', + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method createFileToken()', async () => { + const data = { + '\$id': 'bb8ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + 'resourceId': '5e5ea5c168bb8:5e5ea5c168bb8', + 'resourceType': 'files', + 'expire': '2020-10-15T06:38:00.000+00:00', + 'secret': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c', + 'accessedAt': '2020-10-15T06:38:00.000+00:00',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tokens.createFileToken( + '', + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method get()', async () => { + const data = { + '\$id': 'bb8ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + 'resourceId': '5e5ea5c168bb8:5e5ea5c168bb8', + 'resourceType': 'files', + 'expire': '2020-10-15T06:38:00.000+00:00', + 'secret': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c', + 'accessedAt': '2020-10-15T06:38:00.000+00:00',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tokens.get( + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method update()', async () => { + const data = { + '\$id': 'bb8ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + 'resourceId': '5e5ea5c168bb8:5e5ea5c168bb8', + 'resourceType': 'files', + 'expire': '2020-10-15T06:38:00.000+00:00', + 'secret': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c', + 'accessedAt': '2020-10-15T06:38:00.000+00:00',}; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(Response.json(data))); + + const response = await tokens.update( + '', + ); + + assertEquals(response, data); + stubbedFetch.restore(); + }); + + + test('test method delete()', async () => { + const data = ''; + + const stubbedFetch = stub(globalThis, 'fetch', () => Promise.resolve(new Response(data))) + + const response = await tokens.delete( + '', + ); + + const text = await response.text(); + assertEquals(text, data); + stubbedFetch.restore(); + }); + + })