diff --git a/CHANGELOG.md b/CHANGELOG.md index a6755c3f..f0bbbef3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change Log +## 22.1.0 + +* Fix doc examples with proper formatting +* Add support for the new `Backups` service + ## 22.0.0 * Add array-based enum parameters (e.g., `permissions: BrowserPermission[]`). @@ -103,4 +108,4 @@ * Rename `templateBranch` to `templateVersion` in `createFunction()`. * Rename `downloadDeployment()` to `getDeploymentDownload()` -> You can find the new syntax for breaking changes in the [Appwrite API references](https://appwrite.io/docs/references). Select version `1.6.x`. \ No newline at end of file +> You can find the new syntax for breaking changes in the [Appwrite API references](https://appwrite.io/docs/references). Select version `1.6.x`. diff --git a/README.md b/README.md index 4be156d7..764e488d 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![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.8.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-node/releases).** +**This SDK is compatible with Appwrite server version latest. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-node/releases).** > This is the Node.js SDK for integrating with Appwrite from your Node.js server-side code. If you're looking to integrate from the browser, you should check [appwrite/sdk-for-web](https://github.com/appwrite/sdk-for-web) diff --git a/docs/examples/account/create-anonymous-session.md b/docs/examples/account/create-anonymous-session.md index 0ec4807a..036df9b9 100644 --- a/docs/examples/account/create-anonymous-session.md +++ b/docs/examples/account/create-anonymous-session.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -8,3 +9,4 @@ const client = new sdk.Client() const account = new sdk.Account(client); const result = await account.createAnonymousSession(); +``` diff --git a/docs/examples/account/create-email-password-session.md b/docs/examples/account/create-email-password-session.md index 582ca297..125d73bb 100644 --- a/docs/examples/account/create-email-password-session.md +++ b/docs/examples/account/create-email-password-session.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await account.createEmailPasswordSession({ email: 'email@example.com', password: 'password' }); +``` diff --git a/docs/examples/account/create-email-token.md b/docs/examples/account/create-email-token.md index 6bb7254e..cebf1f61 100644 --- a/docs/examples/account/create-email-token.md +++ b/docs/examples/account/create-email-token.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await account.createEmailToken({ email: 'email@example.com', phrase: false // optional }); +``` diff --git a/docs/examples/account/create-email-verification.md b/docs/examples/account/create-email-verification.md index e2aaf801..6c74da96 100644 --- a/docs/examples/account/create-email-verification.md +++ b/docs/examples/account/create-email-verification.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const account = new sdk.Account(client); const result = await account.createEmailVerification({ url: 'https://example.com' }); +``` diff --git a/docs/examples/account/create-jwt.md b/docs/examples/account/create-jwt.md index f5ddd7b5..c7204e0f 100644 --- a/docs/examples/account/create-jwt.md +++ b/docs/examples/account/create-jwt.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const account = new sdk.Account(client); const result = await account.createJWT({ duration: 0 // optional }); +``` diff --git a/docs/examples/account/create-magic-url-token.md b/docs/examples/account/create-magic-url-token.md index d5194c5c..ee5f1432 100644 --- a/docs/examples/account/create-magic-url-token.md +++ b/docs/examples/account/create-magic-url-token.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await account.createMagicURLToken({ url: 'https://example.com', // optional phrase: false // optional }); +``` diff --git a/docs/examples/account/create-mfa-authenticator.md b/docs/examples/account/create-mfa-authenticator.md index 8dd6a599..25081e27 100644 --- a/docs/examples/account/create-mfa-authenticator.md +++ b/docs/examples/account/create-mfa-authenticator.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const account = new sdk.Account(client); const result = await account.createMFAAuthenticator({ type: sdk.AuthenticatorType.Totp }); +``` diff --git a/docs/examples/account/create-mfa-challenge.md b/docs/examples/account/create-mfa-challenge.md index 9588fa16..af4e0448 100644 --- a/docs/examples/account/create-mfa-challenge.md +++ b/docs/examples/account/create-mfa-challenge.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const account = new sdk.Account(client); const result = await account.createMFAChallenge({ factor: sdk.AuthenticationFactor.Email }); +``` diff --git a/docs/examples/account/create-mfa-recovery-codes.md b/docs/examples/account/create-mfa-recovery-codes.md index 1392f443..5e8e4021 100644 --- a/docs/examples/account/create-mfa-recovery-codes.md +++ b/docs/examples/account/create-mfa-recovery-codes.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -8,3 +9,4 @@ const client = new sdk.Client() const account = new sdk.Account(client); const result = await account.createMFARecoveryCodes(); +``` diff --git a/docs/examples/account/create-o-auth-2-token.md b/docs/examples/account/create-o-auth-2-token.md index 7f9e2297..7bc8a243 100644 --- a/docs/examples/account/create-o-auth-2-token.md +++ b/docs/examples/account/create-o-auth-2-token.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await account.createOAuth2Token({ failure: 'https://example.com', // optional scopes: [] // optional }); +``` diff --git a/docs/examples/account/create-phone-token.md b/docs/examples/account/create-phone-token.md index b5bb586f..999f3e10 100644 --- a/docs/examples/account/create-phone-token.md +++ b/docs/examples/account/create-phone-token.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await account.createPhoneToken({ userId: '', phone: '+12065550100' }); +``` diff --git a/docs/examples/account/create-phone-verification.md b/docs/examples/account/create-phone-verification.md index f7c87f06..05708153 100644 --- a/docs/examples/account/create-phone-verification.md +++ b/docs/examples/account/create-phone-verification.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -8,3 +9,4 @@ const client = new sdk.Client() const account = new sdk.Account(client); const result = await account.createPhoneVerification(); +``` diff --git a/docs/examples/account/create-recovery.md b/docs/examples/account/create-recovery.md index eab8af6d..4dd41d7e 100644 --- a/docs/examples/account/create-recovery.md +++ b/docs/examples/account/create-recovery.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await account.createRecovery({ email: 'email@example.com', url: 'https://example.com' }); +``` diff --git a/docs/examples/account/create-session.md b/docs/examples/account/create-session.md index 9e6f068d..3ab786f9 100644 --- a/docs/examples/account/create-session.md +++ b/docs/examples/account/create-session.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await account.createSession({ userId: '', secret: '' }); +``` diff --git a/docs/examples/account/create-verification.md b/docs/examples/account/create-verification.md index 02b9e78d..95dec7e3 100644 --- a/docs/examples/account/create-verification.md +++ b/docs/examples/account/create-verification.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const account = new sdk.Account(client); const result = await account.createVerification({ url: 'https://example.com' }); +``` diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md index 48ef1aaf..db31f30b 100644 --- a/docs/examples/account/create.md +++ b/docs/examples/account/create.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await account.create({ password: '', name: '' // optional }); +``` diff --git a/docs/examples/account/delete-identity.md b/docs/examples/account/delete-identity.md index 222d4bf2..53a043bf 100644 --- a/docs/examples/account/delete-identity.md +++ b/docs/examples/account/delete-identity.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const account = new sdk.Account(client); const result = await account.deleteIdentity({ identityId: '' }); +``` diff --git a/docs/examples/account/delete-mfa-authenticator.md b/docs/examples/account/delete-mfa-authenticator.md index f3d8093c..18522f2d 100644 --- a/docs/examples/account/delete-mfa-authenticator.md +++ b/docs/examples/account/delete-mfa-authenticator.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const account = new sdk.Account(client); const result = await account.deleteMFAAuthenticator({ type: sdk.AuthenticatorType.Totp }); +``` diff --git a/docs/examples/account/delete-session.md b/docs/examples/account/delete-session.md index 82e1bd67..7fe49e3f 100644 --- a/docs/examples/account/delete-session.md +++ b/docs/examples/account/delete-session.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const account = new sdk.Account(client); const result = await account.deleteSession({ sessionId: '' }); +``` diff --git a/docs/examples/account/delete-sessions.md b/docs/examples/account/delete-sessions.md index 884c0e0e..912575ce 100644 --- a/docs/examples/account/delete-sessions.md +++ b/docs/examples/account/delete-sessions.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -8,3 +9,4 @@ const client = new sdk.Client() const account = new sdk.Account(client); const result = await account.deleteSessions(); +``` diff --git a/docs/examples/account/get-mfa-recovery-codes.md b/docs/examples/account/get-mfa-recovery-codes.md index 6461e6b5..cb08fe7c 100644 --- a/docs/examples/account/get-mfa-recovery-codes.md +++ b/docs/examples/account/get-mfa-recovery-codes.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -8,3 +9,4 @@ const client = new sdk.Client() const account = new sdk.Account(client); const result = await account.getMFARecoveryCodes(); +``` diff --git a/docs/examples/account/get-prefs.md b/docs/examples/account/get-prefs.md index d0d7d31a..67edf19f 100644 --- a/docs/examples/account/get-prefs.md +++ b/docs/examples/account/get-prefs.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -8,3 +9,4 @@ const client = new sdk.Client() const account = new sdk.Account(client); const result = await account.getPrefs(); +``` diff --git a/docs/examples/account/get-session.md b/docs/examples/account/get-session.md index edf38368..dab81595 100644 --- a/docs/examples/account/get-session.md +++ b/docs/examples/account/get-session.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const account = new sdk.Account(client); const result = await account.getSession({ sessionId: '' }); +``` diff --git a/docs/examples/account/get.md b/docs/examples/account/get.md index 6ebb605a..e755aa46 100644 --- a/docs/examples/account/get.md +++ b/docs/examples/account/get.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -8,3 +9,4 @@ const client = new sdk.Client() const account = new sdk.Account(client); const result = await account.get(); +``` diff --git a/docs/examples/account/list-identities.md b/docs/examples/account/list-identities.md index b5541bf3..00d60b9e 100644 --- a/docs/examples/account/list-identities.md +++ b/docs/examples/account/list-identities.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await account.listIdentities({ queries: [], // optional total: false // optional }); +``` diff --git a/docs/examples/account/list-logs.md b/docs/examples/account/list-logs.md index 06b36e55..d7e89331 100644 --- a/docs/examples/account/list-logs.md +++ b/docs/examples/account/list-logs.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await account.listLogs({ queries: [], // optional total: false // optional }); +``` diff --git a/docs/examples/account/list-mfa-factors.md b/docs/examples/account/list-mfa-factors.md index 97f7f5fb..31362190 100644 --- a/docs/examples/account/list-mfa-factors.md +++ b/docs/examples/account/list-mfa-factors.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -8,3 +9,4 @@ const client = new sdk.Client() const account = new sdk.Account(client); const result = await account.listMFAFactors(); +``` diff --git a/docs/examples/account/list-sessions.md b/docs/examples/account/list-sessions.md index 33fb5274..0bbd093e 100644 --- a/docs/examples/account/list-sessions.md +++ b/docs/examples/account/list-sessions.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -8,3 +9,4 @@ const client = new sdk.Client() const account = new sdk.Account(client); const result = await account.listSessions(); +``` diff --git a/docs/examples/account/update-email-verification.md b/docs/examples/account/update-email-verification.md index eb6507e3..4fd5953b 100644 --- a/docs/examples/account/update-email-verification.md +++ b/docs/examples/account/update-email-verification.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await account.updateEmailVerification({ userId: '', secret: '' }); +``` diff --git a/docs/examples/account/update-email.md b/docs/examples/account/update-email.md index 58fea36b..985c189b 100644 --- a/docs/examples/account/update-email.md +++ b/docs/examples/account/update-email.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await account.updateEmail({ email: 'email@example.com', password: 'password' }); +``` diff --git a/docs/examples/account/update-magic-url-session.md b/docs/examples/account/update-magic-url-session.md index 65221b59..1811200a 100644 --- a/docs/examples/account/update-magic-url-session.md +++ b/docs/examples/account/update-magic-url-session.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await account.updateMagicURLSession({ userId: '', secret: '' }); +``` diff --git a/docs/examples/account/update-mfa-authenticator.md b/docs/examples/account/update-mfa-authenticator.md index 18e15754..fa34ef45 100644 --- a/docs/examples/account/update-mfa-authenticator.md +++ b/docs/examples/account/update-mfa-authenticator.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await account.updateMFAAuthenticator({ type: sdk.AuthenticatorType.Totp, otp: '' }); +``` diff --git a/docs/examples/account/update-mfa-challenge.md b/docs/examples/account/update-mfa-challenge.md index 4903e1e2..a584356b 100644 --- a/docs/examples/account/update-mfa-challenge.md +++ b/docs/examples/account/update-mfa-challenge.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await account.updateMFAChallenge({ challengeId: '', otp: '' }); +``` diff --git a/docs/examples/account/update-mfa-recovery-codes.md b/docs/examples/account/update-mfa-recovery-codes.md index fd5c1fd5..c893c231 100644 --- a/docs/examples/account/update-mfa-recovery-codes.md +++ b/docs/examples/account/update-mfa-recovery-codes.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -8,3 +9,4 @@ const client = new sdk.Client() const account = new sdk.Account(client); const result = await account.updateMFARecoveryCodes(); +``` diff --git a/docs/examples/account/update-mfa.md b/docs/examples/account/update-mfa.md index 378c23fc..38604a3b 100644 --- a/docs/examples/account/update-mfa.md +++ b/docs/examples/account/update-mfa.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const account = new sdk.Account(client); const result = await account.updateMFA({ mfa: false }); +``` diff --git a/docs/examples/account/update-name.md b/docs/examples/account/update-name.md index f812116e..24fb8692 100644 --- a/docs/examples/account/update-name.md +++ b/docs/examples/account/update-name.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const account = new sdk.Account(client); const result = await account.updateName({ name: '' }); +``` diff --git a/docs/examples/account/update-password.md b/docs/examples/account/update-password.md index e7e8437f..f6b7bb54 100644 --- a/docs/examples/account/update-password.md +++ b/docs/examples/account/update-password.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await account.updatePassword({ password: '', oldPassword: 'password' // optional }); +``` diff --git a/docs/examples/account/update-phone-session.md b/docs/examples/account/update-phone-session.md index d2e75436..204c33a7 100644 --- a/docs/examples/account/update-phone-session.md +++ b/docs/examples/account/update-phone-session.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await account.updatePhoneSession({ userId: '', secret: '' }); +``` diff --git a/docs/examples/account/update-phone-verification.md b/docs/examples/account/update-phone-verification.md index af05baf5..c5e1abd3 100644 --- a/docs/examples/account/update-phone-verification.md +++ b/docs/examples/account/update-phone-verification.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await account.updatePhoneVerification({ userId: '', secret: '' }); +``` diff --git a/docs/examples/account/update-phone.md b/docs/examples/account/update-phone.md index b1f1daa6..c6763022 100644 --- a/docs/examples/account/update-phone.md +++ b/docs/examples/account/update-phone.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await account.updatePhone({ phone: '+12065550100', password: 'password' }); +``` diff --git a/docs/examples/account/update-prefs.md b/docs/examples/account/update-prefs.md index ba41cf80..65c70e0e 100644 --- a/docs/examples/account/update-prefs.md +++ b/docs/examples/account/update-prefs.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -14,3 +15,4 @@ const result = await account.updatePrefs({ "darkTheme": true } }); +``` diff --git a/docs/examples/account/update-recovery.md b/docs/examples/account/update-recovery.md index c88b4352..268f3e97 100644 --- a/docs/examples/account/update-recovery.md +++ b/docs/examples/account/update-recovery.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await account.updateRecovery({ secret: '', password: '' }); +``` diff --git a/docs/examples/account/update-session.md b/docs/examples/account/update-session.md index c189f68e..9dfcbf26 100644 --- a/docs/examples/account/update-session.md +++ b/docs/examples/account/update-session.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const account = new sdk.Account(client); const result = await account.updateSession({ sessionId: '' }); +``` diff --git a/docs/examples/account/update-status.md b/docs/examples/account/update-status.md index 1b70af53..ffb3f25e 100644 --- a/docs/examples/account/update-status.md +++ b/docs/examples/account/update-status.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -8,3 +9,4 @@ const client = new sdk.Client() const account = new sdk.Account(client); const result = await account.updateStatus(); +``` diff --git a/docs/examples/account/update-verification.md b/docs/examples/account/update-verification.md index d64b402e..0486ce39 100644 --- a/docs/examples/account/update-verification.md +++ b/docs/examples/account/update-verification.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await account.updateVerification({ userId: '', secret: '' }); +``` diff --git a/docs/examples/avatars/get-browser.md b/docs/examples/avatars/get-browser.md index 9f3b2cce..6ffb388d 100644 --- a/docs/examples/avatars/get-browser.md +++ b/docs/examples/avatars/get-browser.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await avatars.getBrowser({ height: 0, // optional quality: -1 // optional }); +``` diff --git a/docs/examples/avatars/get-credit-card.md b/docs/examples/avatars/get-credit-card.md index 1337d05f..ea806baf 100644 --- a/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/avatars/get-credit-card.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await avatars.getCreditCard({ height: 0, // optional quality: -1 // optional }); +``` diff --git a/docs/examples/avatars/get-favicon.md b/docs/examples/avatars/get-favicon.md index 6f79cb66..bd9ae2ca 100644 --- a/docs/examples/avatars/get-favicon.md +++ b/docs/examples/avatars/get-favicon.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const avatars = new sdk.Avatars(client); const result = await avatars.getFavicon({ url: 'https://example.com' }); +``` diff --git a/docs/examples/avatars/get-flag.md b/docs/examples/avatars/get-flag.md index 672c18bb..d05b666b 100644 --- a/docs/examples/avatars/get-flag.md +++ b/docs/examples/avatars/get-flag.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await avatars.getFlag({ height: 0, // optional quality: -1 // optional }); +``` diff --git a/docs/examples/avatars/get-image.md b/docs/examples/avatars/get-image.md index 12aef103..6f013db1 100644 --- a/docs/examples/avatars/get-image.md +++ b/docs/examples/avatars/get-image.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await avatars.getImage({ width: 0, // optional height: 0 // optional }); +``` diff --git a/docs/examples/avatars/get-initials.md b/docs/examples/avatars/get-initials.md index 584786f6..3d35c6df 100644 --- a/docs/examples/avatars/get-initials.md +++ b/docs/examples/avatars/get-initials.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await avatars.getInitials({ height: 0, // optional background: '' // optional }); +``` diff --git a/docs/examples/avatars/get-qr.md b/docs/examples/avatars/get-qr.md index fd083807..e4235a38 100644 --- a/docs/examples/avatars/get-qr.md +++ b/docs/examples/avatars/get-qr.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await avatars.getQR({ margin: 0, // optional download: false // optional }); +``` diff --git a/docs/examples/avatars/get-screenshot.md b/docs/examples/avatars/get-screenshot.md index 58522c76..1aab6cd3 100644 --- a/docs/examples/avatars/get-screenshot.md +++ b/docs/examples/avatars/get-screenshot.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -32,3 +33,4 @@ const result = await avatars.getScreenshot({ quality: 85, // optional output: sdk.ImageFormat.Jpeg // optional }); +``` diff --git a/docs/examples/backups/create-archive.md b/docs/examples/backups/create-archive.md new file mode 100644 index 00000000..1a11d459 --- /dev/null +++ b/docs/examples/backups/create-archive.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const backups = new sdk.Backups(client); + +const result = await backups.createArchive({ + services: [sdk.BackupServices.Databases], + resourceId: '' // optional +}); +``` diff --git a/docs/examples/backups/create-policy.md b/docs/examples/backups/create-policy.md new file mode 100644 index 00000000..71670929 --- /dev/null +++ b/docs/examples/backups/create-policy.md @@ -0,0 +1,20 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const backups = new sdk.Backups(client); + +const result = await backups.createPolicy({ + policyId: '', + services: [sdk.BackupServices.Databases], + retention: 1, + schedule: '', + name: '', // optional + resourceId: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/backups/create-restoration.md b/docs/examples/backups/create-restoration.md new file mode 100644 index 00000000..f41a2344 --- /dev/null +++ b/docs/examples/backups/create-restoration.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const backups = new sdk.Backups(client); + +const result = await backups.createRestoration({ + archiveId: '', + services: [sdk.BackupServices.Databases], + newResourceId: '', // optional + newResourceName: '' // optional +}); +``` diff --git a/docs/examples/backups/delete-archive.md b/docs/examples/backups/delete-archive.md new file mode 100644 index 00000000..f0c5615d --- /dev/null +++ b/docs/examples/backups/delete-archive.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const backups = new sdk.Backups(client); + +const result = await backups.deleteArchive({ + archiveId: '' +}); +``` diff --git a/docs/examples/backups/delete-policy.md b/docs/examples/backups/delete-policy.md new file mode 100644 index 00000000..493e89ef --- /dev/null +++ b/docs/examples/backups/delete-policy.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const backups = new sdk.Backups(client); + +const result = await backups.deletePolicy({ + policyId: '' +}); +``` diff --git a/docs/examples/backups/get-archive.md b/docs/examples/backups/get-archive.md new file mode 100644 index 00000000..ade4e222 --- /dev/null +++ b/docs/examples/backups/get-archive.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const backups = new sdk.Backups(client); + +const result = await backups.getArchive({ + archiveId: '' +}); +``` diff --git a/docs/examples/backups/get-policy.md b/docs/examples/backups/get-policy.md new file mode 100644 index 00000000..391c0196 --- /dev/null +++ b/docs/examples/backups/get-policy.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const backups = new sdk.Backups(client); + +const result = await backups.getPolicy({ + policyId: '' +}); +``` diff --git a/docs/examples/backups/get-restoration.md b/docs/examples/backups/get-restoration.md new file mode 100644 index 00000000..46d18f3a --- /dev/null +++ b/docs/examples/backups/get-restoration.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const backups = new sdk.Backups(client); + +const result = await backups.getRestoration({ + restorationId: '' +}); +``` diff --git a/docs/examples/backups/list-archives.md b/docs/examples/backups/list-archives.md new file mode 100644 index 00000000..d6f51c56 --- /dev/null +++ b/docs/examples/backups/list-archives.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const backups = new sdk.Backups(client); + +const result = await backups.listArchives({ + queries: [] // optional +}); +``` diff --git a/docs/examples/backups/list-policies.md b/docs/examples/backups/list-policies.md new file mode 100644 index 00000000..7f87b1d6 --- /dev/null +++ b/docs/examples/backups/list-policies.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const backups = new sdk.Backups(client); + +const result = await backups.listPolicies({ + queries: [] // optional +}); +``` diff --git a/docs/examples/backups/list-restorations.md b/docs/examples/backups/list-restorations.md new file mode 100644 index 00000000..4475a17d --- /dev/null +++ b/docs/examples/backups/list-restorations.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const backups = new sdk.Backups(client); + +const result = await backups.listRestorations({ + queries: [] // optional +}); +``` diff --git a/docs/examples/backups/update-policy.md b/docs/examples/backups/update-policy.md new file mode 100644 index 00000000..5912b39f --- /dev/null +++ b/docs/examples/backups/update-policy.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const backups = new sdk.Backups(client); + +const result = await backups.updatePolicy({ + policyId: '', + name: '', // optional + retention: 1, // optional + schedule: '', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/databases/create-boolean-attribute.md b/docs/examples/databases/create-boolean-attribute.md index 2e9b5629..8202b7a0 100644 --- a/docs/examples/databases/create-boolean-attribute.md +++ b/docs/examples/databases/create-boolean-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await databases.createBooleanAttribute({ default: false, // optional array: false // optional }); +``` diff --git a/docs/examples/databases/create-collection.md b/docs/examples/databases/create-collection.md index 562b5380..b58e0919 100644 --- a/docs/examples/databases/create-collection.md +++ b/docs/examples/databases/create-collection.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -17,3 +18,4 @@ const result = await databases.createCollection({ attributes: [], // optional indexes: [] // optional }); +``` diff --git a/docs/examples/databases/create-datetime-attribute.md b/docs/examples/databases/create-datetime-attribute.md index 7ca8b553..328bf685 100644 --- a/docs/examples/databases/create-datetime-attribute.md +++ b/docs/examples/databases/create-datetime-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await databases.createDatetimeAttribute({ default: '', // optional array: false // optional }); +``` diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index e6b9b495..3c38b69e 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -21,3 +22,4 @@ const result = await databases.createDocument({ permissions: [sdk.Permission.read(sdk.Role.any())], // optional transactionId: '' // optional }); +``` diff --git a/docs/examples/databases/create-documents.md b/docs/examples/databases/create-documents.md index 8815d8d9..60f4eab8 100644 --- a/docs/examples/databases/create-documents.md +++ b/docs/examples/databases/create-documents.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await databases.createDocuments({ documents: [], transactionId: '' // optional }); +``` diff --git a/docs/examples/databases/create-email-attribute.md b/docs/examples/databases/create-email-attribute.md index 4afebf65..c4c674fa 100644 --- a/docs/examples/databases/create-email-attribute.md +++ b/docs/examples/databases/create-email-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await databases.createEmailAttribute({ default: 'email@example.com', // optional array: false // optional }); +``` diff --git a/docs/examples/databases/create-enum-attribute.md b/docs/examples/databases/create-enum-attribute.md index 5866eabb..b6f982a7 100644 --- a/docs/examples/databases/create-enum-attribute.md +++ b/docs/examples/databases/create-enum-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -16,3 +17,4 @@ const result = await databases.createEnumAttribute({ default: '', // optional array: false // optional }); +``` diff --git a/docs/examples/databases/create-float-attribute.md b/docs/examples/databases/create-float-attribute.md index 7843c165..583750c8 100644 --- a/docs/examples/databases/create-float-attribute.md +++ b/docs/examples/databases/create-float-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -17,3 +18,4 @@ const result = await databases.createFloatAttribute({ default: null, // optional array: false // optional }); +``` diff --git a/docs/examples/databases/create-index.md b/docs/examples/databases/create-index.md index 97cae642..1d0280d1 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -16,3 +17,4 @@ const result = await databases.createIndex({ orders: [sdk.OrderBy.Asc], // optional lengths: [] // optional }); +``` diff --git a/docs/examples/databases/create-integer-attribute.md b/docs/examples/databases/create-integer-attribute.md index e3752669..ea7e766c 100644 --- a/docs/examples/databases/create-integer-attribute.md +++ b/docs/examples/databases/create-integer-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -17,3 +18,4 @@ const result = await databases.createIntegerAttribute({ default: null, // optional array: false // optional }); +``` diff --git a/docs/examples/databases/create-ip-attribute.md b/docs/examples/databases/create-ip-attribute.md index 110e3a81..147b00a1 100644 --- a/docs/examples/databases/create-ip-attribute.md +++ b/docs/examples/databases/create-ip-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await databases.createIpAttribute({ default: '', // optional array: false // optional }); +``` diff --git a/docs/examples/databases/create-line-attribute.md b/docs/examples/databases/create-line-attribute.md index 160bb5b9..518a2529 100644 --- a/docs/examples/databases/create-line-attribute.md +++ b/docs/examples/databases/create-line-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -14,3 +15,4 @@ const result = await databases.createLineAttribute({ required: false, default: [[1, 2], [3, 4], [5, 6]] // optional }); +``` diff --git a/docs/examples/databases/create-longtext-attribute.md b/docs/examples/databases/create-longtext-attribute.md index f3b8874e..9d358055 100644 --- a/docs/examples/databases/create-longtext-attribute.md +++ b/docs/examples/databases/create-longtext-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await databases.createLongtextAttribute({ default: '', // optional array: false // optional }); +``` diff --git a/docs/examples/databases/create-mediumtext-attribute.md b/docs/examples/databases/create-mediumtext-attribute.md index 5fbda08e..2ea9b87b 100644 --- a/docs/examples/databases/create-mediumtext-attribute.md +++ b/docs/examples/databases/create-mediumtext-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await databases.createMediumtextAttribute({ default: '', // optional array: false // optional }); +``` diff --git a/docs/examples/databases/create-operations.md b/docs/examples/databases/create-operations.md index da8452e3..06a3c468 100644 --- a/docs/examples/databases/create-operations.md +++ b/docs/examples/databases/create-operations.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -21,3 +22,4 @@ const result = await databases.createOperations({ } ] // optional }); +``` diff --git a/docs/examples/databases/create-point-attribute.md b/docs/examples/databases/create-point-attribute.md index e65f5bd5..d9581503 100644 --- a/docs/examples/databases/create-point-attribute.md +++ b/docs/examples/databases/create-point-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -14,3 +15,4 @@ const result = await databases.createPointAttribute({ required: false, default: [1, 2] // optional }); +``` diff --git a/docs/examples/databases/create-polygon-attribute.md b/docs/examples/databases/create-polygon-attribute.md index 3d518874..51f239da 100644 --- a/docs/examples/databases/create-polygon-attribute.md +++ b/docs/examples/databases/create-polygon-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -14,3 +15,4 @@ const result = await databases.createPolygonAttribute({ required: false, default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional }); +``` diff --git a/docs/examples/databases/create-relationship-attribute.md b/docs/examples/databases/create-relationship-attribute.md index b09c6a3b..30d4dfd7 100644 --- a/docs/examples/databases/create-relationship-attribute.md +++ b/docs/examples/databases/create-relationship-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -17,3 +18,4 @@ const result = await databases.createRelationshipAttribute({ twoWayKey: '', // optional onDelete: sdk.RelationMutate.Cascade // optional }); +``` diff --git a/docs/examples/databases/create-string-attribute.md b/docs/examples/databases/create-string-attribute.md index 57ed8f4e..18aeaf53 100644 --- a/docs/examples/databases/create-string-attribute.md +++ b/docs/examples/databases/create-string-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -17,3 +18,4 @@ const result = await databases.createStringAttribute({ array: false, // optional encrypt: false // optional }); +``` diff --git a/docs/examples/databases/create-text-attribute.md b/docs/examples/databases/create-text-attribute.md index 4a2af55b..5d49ed31 100644 --- a/docs/examples/databases/create-text-attribute.md +++ b/docs/examples/databases/create-text-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await databases.createTextAttribute({ default: '', // optional array: false // optional }); +``` diff --git a/docs/examples/databases/create-transaction.md b/docs/examples/databases/create-transaction.md index f3da2919..8785149a 100644 --- a/docs/examples/databases/create-transaction.md +++ b/docs/examples/databases/create-transaction.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const databases = new sdk.Databases(client); const result = await databases.createTransaction({ ttl: 60 // optional }); +``` diff --git a/docs/examples/databases/create-url-attribute.md b/docs/examples/databases/create-url-attribute.md index af3177f8..43225e40 100644 --- a/docs/examples/databases/create-url-attribute.md +++ b/docs/examples/databases/create-url-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await databases.createUrlAttribute({ default: 'https://example.com', // optional array: false // optional }); +``` diff --git a/docs/examples/databases/create-varchar-attribute.md b/docs/examples/databases/create-varchar-attribute.md index 3c443aeb..dd5511d8 100644 --- a/docs/examples/databases/create-varchar-attribute.md +++ b/docs/examples/databases/create-varchar-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -16,3 +17,4 @@ const result = await databases.createVarcharAttribute({ default: '', // optional array: false // optional }); +``` diff --git a/docs/examples/databases/create.md b/docs/examples/databases/create.md index 7392a85f..d35731b6 100644 --- a/docs/examples/databases/create.md +++ b/docs/examples/databases/create.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await databases.create({ name: '', enabled: false // optional }); +``` diff --git a/docs/examples/databases/decrement-document-attribute.md b/docs/examples/databases/decrement-document-attribute.md index c01b250b..80fe2486 100644 --- a/docs/examples/databases/decrement-document-attribute.md +++ b/docs/examples/databases/decrement-document-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -16,3 +17,4 @@ const result = await databases.decrementDocumentAttribute({ min: null, // optional transactionId: '' // optional }); +``` diff --git a/docs/examples/databases/delete-attribute.md b/docs/examples/databases/delete-attribute.md index 166aa196..30501051 100644 --- a/docs/examples/databases/delete-attribute.md +++ b/docs/examples/databases/delete-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await databases.deleteAttribute({ collectionId: '', key: '' }); +``` diff --git a/docs/examples/databases/delete-collection.md b/docs/examples/databases/delete-collection.md index f915076c..2da5c205 100644 --- a/docs/examples/databases/delete-collection.md +++ b/docs/examples/databases/delete-collection.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await databases.deleteCollection({ databaseId: '', collectionId: '' }); +``` diff --git a/docs/examples/databases/delete-document.md b/docs/examples/databases/delete-document.md index bfc19777..22bc7143 100644 --- a/docs/examples/databases/delete-document.md +++ b/docs/examples/databases/delete-document.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await databases.deleteDocument({ documentId: '', transactionId: '' // optional }); +``` diff --git a/docs/examples/databases/delete-documents.md b/docs/examples/databases/delete-documents.md index 9440d209..4851243e 100644 --- a/docs/examples/databases/delete-documents.md +++ b/docs/examples/databases/delete-documents.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await databases.deleteDocuments({ queries: [], // optional transactionId: '' // optional }); +``` diff --git a/docs/examples/databases/delete-index.md b/docs/examples/databases/delete-index.md index 24f74c69..b7a8f0c3 100644 --- a/docs/examples/databases/delete-index.md +++ b/docs/examples/databases/delete-index.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await databases.deleteIndex({ collectionId: '', key: '' }); +``` diff --git a/docs/examples/databases/delete-transaction.md b/docs/examples/databases/delete-transaction.md index 53d676e7..b89214ba 100644 --- a/docs/examples/databases/delete-transaction.md +++ b/docs/examples/databases/delete-transaction.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const databases = new sdk.Databases(client); const result = await databases.deleteTransaction({ transactionId: '' }); +``` diff --git a/docs/examples/databases/delete.md b/docs/examples/databases/delete.md index fc9ace49..00009485 100644 --- a/docs/examples/databases/delete.md +++ b/docs/examples/databases/delete.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const databases = new sdk.Databases(client); const result = await databases.delete({ databaseId: '' }); +``` diff --git a/docs/examples/databases/get-attribute.md b/docs/examples/databases/get-attribute.md index 4c683034..eade77dd 100644 --- a/docs/examples/databases/get-attribute.md +++ b/docs/examples/databases/get-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await databases.getAttribute({ collectionId: '', key: '' }); +``` diff --git a/docs/examples/databases/get-collection.md b/docs/examples/databases/get-collection.md index 48554719..8b96abaf 100644 --- a/docs/examples/databases/get-collection.md +++ b/docs/examples/databases/get-collection.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await databases.getCollection({ databaseId: '', collectionId: '' }); +``` diff --git a/docs/examples/databases/get-document.md b/docs/examples/databases/get-document.md index 7abea4e4..9a66df4f 100644 --- a/docs/examples/databases/get-document.md +++ b/docs/examples/databases/get-document.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -14,3 +15,4 @@ const result = await databases.getDocument({ queries: [], // optional transactionId: '' // optional }); +``` diff --git a/docs/examples/databases/get-index.md b/docs/examples/databases/get-index.md index d7edb84e..1900b0f5 100644 --- a/docs/examples/databases/get-index.md +++ b/docs/examples/databases/get-index.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await databases.getIndex({ collectionId: '', key: '' }); +``` diff --git a/docs/examples/databases/get-transaction.md b/docs/examples/databases/get-transaction.md index 9b7297c7..09c0255a 100644 --- a/docs/examples/databases/get-transaction.md +++ b/docs/examples/databases/get-transaction.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const databases = new sdk.Databases(client); const result = await databases.getTransaction({ transactionId: '' }); +``` diff --git a/docs/examples/databases/get.md b/docs/examples/databases/get.md index eb83ef7a..9533a738 100644 --- a/docs/examples/databases/get.md +++ b/docs/examples/databases/get.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const databases = new sdk.Databases(client); const result = await databases.get({ databaseId: '' }); +``` diff --git a/docs/examples/databases/increment-document-attribute.md b/docs/examples/databases/increment-document-attribute.md index 843d163b..cb24d704 100644 --- a/docs/examples/databases/increment-document-attribute.md +++ b/docs/examples/databases/increment-document-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -16,3 +17,4 @@ const result = await databases.incrementDocumentAttribute({ max: null, // optional transactionId: '' // optional }); +``` diff --git a/docs/examples/databases/list-attributes.md b/docs/examples/databases/list-attributes.md index 2937e547..635391cd 100644 --- a/docs/examples/databases/list-attributes.md +++ b/docs/examples/databases/list-attributes.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await databases.listAttributes({ queries: [], // optional total: false // optional }); +``` diff --git a/docs/examples/databases/list-collections.md b/docs/examples/databases/list-collections.md index 7e11fae6..38f1f3eb 100644 --- a/docs/examples/databases/list-collections.md +++ b/docs/examples/databases/list-collections.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await databases.listCollections({ search: '', // optional total: false // optional }); +``` diff --git a/docs/examples/databases/list-documents.md b/docs/examples/databases/list-documents.md index 40fb6800..be2b3703 100644 --- a/docs/examples/databases/list-documents.md +++ b/docs/examples/databases/list-documents.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -14,3 +15,4 @@ const result = await databases.listDocuments({ transactionId: '', // optional total: false // optional }); +``` diff --git a/docs/examples/databases/list-indexes.md b/docs/examples/databases/list-indexes.md index ad3dbb33..c6411092 100644 --- a/docs/examples/databases/list-indexes.md +++ b/docs/examples/databases/list-indexes.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await databases.listIndexes({ queries: [], // optional total: false // optional }); +``` diff --git a/docs/examples/databases/list-transactions.md b/docs/examples/databases/list-transactions.md index 9a36eb0f..4707b131 100644 --- a/docs/examples/databases/list-transactions.md +++ b/docs/examples/databases/list-transactions.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const databases = new sdk.Databases(client); const result = await databases.listTransactions({ queries: [] // optional }); +``` diff --git a/docs/examples/databases/list.md b/docs/examples/databases/list.md index 0aee1a93..d88d05ee 100644 --- a/docs/examples/databases/list.md +++ b/docs/examples/databases/list.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await databases.list({ search: '', // optional total: false // optional }); +``` diff --git a/docs/examples/databases/update-boolean-attribute.md b/docs/examples/databases/update-boolean-attribute.md index 224fc8e6..00952c3a 100644 --- a/docs/examples/databases/update-boolean-attribute.md +++ b/docs/examples/databases/update-boolean-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await databases.updateBooleanAttribute({ default: false, newKey: '' // optional }); +``` diff --git a/docs/examples/databases/update-collection.md b/docs/examples/databases/update-collection.md index a1cb513f..bd2e7dd0 100644 --- a/docs/examples/databases/update-collection.md +++ b/docs/examples/databases/update-collection.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await databases.updateCollection({ documentSecurity: false, // optional enabled: false // optional }); +``` diff --git a/docs/examples/databases/update-datetime-attribute.md b/docs/examples/databases/update-datetime-attribute.md index 20034486..5a4fe633 100644 --- a/docs/examples/databases/update-datetime-attribute.md +++ b/docs/examples/databases/update-datetime-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await databases.updateDatetimeAttribute({ default: '', newKey: '' // optional }); +``` diff --git a/docs/examples/databases/update-document.md b/docs/examples/databases/update-document.md index 7e1a8c50..cae4ccfe 100644 --- a/docs/examples/databases/update-document.md +++ b/docs/examples/databases/update-document.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -21,3 +22,4 @@ const result = await databases.updateDocument({ permissions: [sdk.Permission.read(sdk.Role.any())], // optional transactionId: '' // optional }); +``` diff --git a/docs/examples/databases/update-documents.md b/docs/examples/databases/update-documents.md index 038ed1a7..168074c1 100644 --- a/docs/examples/databases/update-documents.md +++ b/docs/examples/databases/update-documents.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -20,3 +21,4 @@ const result = await databases.updateDocuments({ queries: [], // optional transactionId: '' // optional }); +``` diff --git a/docs/examples/databases/update-email-attribute.md b/docs/examples/databases/update-email-attribute.md index 738c533c..e7da572a 100644 --- a/docs/examples/databases/update-email-attribute.md +++ b/docs/examples/databases/update-email-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await databases.updateEmailAttribute({ default: 'email@example.com', newKey: '' // optional }); +``` diff --git a/docs/examples/databases/update-enum-attribute.md b/docs/examples/databases/update-enum-attribute.md index f240cb05..937af7a6 100644 --- a/docs/examples/databases/update-enum-attribute.md +++ b/docs/examples/databases/update-enum-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -16,3 +17,4 @@ const result = await databases.updateEnumAttribute({ default: '', newKey: '' // optional }); +``` diff --git a/docs/examples/databases/update-float-attribute.md b/docs/examples/databases/update-float-attribute.md index 877cad18..5af5be0c 100644 --- a/docs/examples/databases/update-float-attribute.md +++ b/docs/examples/databases/update-float-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -17,3 +18,4 @@ const result = await databases.updateFloatAttribute({ max: null, // optional newKey: '' // optional }); +``` diff --git a/docs/examples/databases/update-integer-attribute.md b/docs/examples/databases/update-integer-attribute.md index cf7101e5..14e7da96 100644 --- a/docs/examples/databases/update-integer-attribute.md +++ b/docs/examples/databases/update-integer-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -17,3 +18,4 @@ const result = await databases.updateIntegerAttribute({ max: null, // optional newKey: '' // optional }); +``` diff --git a/docs/examples/databases/update-ip-attribute.md b/docs/examples/databases/update-ip-attribute.md index d41bb850..0f4d2a3a 100644 --- a/docs/examples/databases/update-ip-attribute.md +++ b/docs/examples/databases/update-ip-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await databases.updateIpAttribute({ default: '', newKey: '' // optional }); +``` diff --git a/docs/examples/databases/update-line-attribute.md b/docs/examples/databases/update-line-attribute.md index 3c4d785d..3b8acece 100644 --- a/docs/examples/databases/update-line-attribute.md +++ b/docs/examples/databases/update-line-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await databases.updateLineAttribute({ default: [[1, 2], [3, 4], [5, 6]], // optional newKey: '' // optional }); +``` diff --git a/docs/examples/databases/update-longtext-attribute.md b/docs/examples/databases/update-longtext-attribute.md index efb82f46..ca39b69a 100644 --- a/docs/examples/databases/update-longtext-attribute.md +++ b/docs/examples/databases/update-longtext-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await databases.updateLongtextAttribute({ default: '', newKey: '' // optional }); +``` diff --git a/docs/examples/databases/update-mediumtext-attribute.md b/docs/examples/databases/update-mediumtext-attribute.md index aea41d08..d08373e3 100644 --- a/docs/examples/databases/update-mediumtext-attribute.md +++ b/docs/examples/databases/update-mediumtext-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await databases.updateMediumtextAttribute({ default: '', newKey: '' // optional }); +``` diff --git a/docs/examples/databases/update-point-attribute.md b/docs/examples/databases/update-point-attribute.md index 0da3b338..410ce3c5 100644 --- a/docs/examples/databases/update-point-attribute.md +++ b/docs/examples/databases/update-point-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await databases.updatePointAttribute({ default: [1, 2], // optional newKey: '' // optional }); +``` diff --git a/docs/examples/databases/update-polygon-attribute.md b/docs/examples/databases/update-polygon-attribute.md index c7767cb9..fa4ebe1f 100644 --- a/docs/examples/databases/update-polygon-attribute.md +++ b/docs/examples/databases/update-polygon-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await databases.updatePolygonAttribute({ default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional newKey: '' // optional }); +``` diff --git a/docs/examples/databases/update-relationship-attribute.md b/docs/examples/databases/update-relationship-attribute.md index aa476c41..9dc8ebd7 100644 --- a/docs/examples/databases/update-relationship-attribute.md +++ b/docs/examples/databases/update-relationship-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -14,3 +15,4 @@ const result = await databases.updateRelationshipAttribute({ onDelete: sdk.RelationMutate.Cascade, // optional newKey: '' // optional }); +``` diff --git a/docs/examples/databases/update-string-attribute.md b/docs/examples/databases/update-string-attribute.md index b0d7bea5..0c75201b 100644 --- a/docs/examples/databases/update-string-attribute.md +++ b/docs/examples/databases/update-string-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -16,3 +17,4 @@ const result = await databases.updateStringAttribute({ size: 1, // optional newKey: '' // optional }); +``` diff --git a/docs/examples/databases/update-text-attribute.md b/docs/examples/databases/update-text-attribute.md index 9d1453ee..766c7f0a 100644 --- a/docs/examples/databases/update-text-attribute.md +++ b/docs/examples/databases/update-text-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await databases.updateTextAttribute({ default: '', newKey: '' // optional }); +``` diff --git a/docs/examples/databases/update-transaction.md b/docs/examples/databases/update-transaction.md index 57654495..a83cb03b 100644 --- a/docs/examples/databases/update-transaction.md +++ b/docs/examples/databases/update-transaction.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await databases.updateTransaction({ commit: false, // optional rollback: false // optional }); +``` diff --git a/docs/examples/databases/update-url-attribute.md b/docs/examples/databases/update-url-attribute.md index 48d92815..64177d53 100644 --- a/docs/examples/databases/update-url-attribute.md +++ b/docs/examples/databases/update-url-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await databases.updateUrlAttribute({ default: 'https://example.com', newKey: '' // optional }); +``` diff --git a/docs/examples/databases/update-varchar-attribute.md b/docs/examples/databases/update-varchar-attribute.md index d28a3067..27f3b23b 100644 --- a/docs/examples/databases/update-varchar-attribute.md +++ b/docs/examples/databases/update-varchar-attribute.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -16,3 +17,4 @@ const result = await databases.updateVarcharAttribute({ size: 1, // optional newKey: '' // optional }); +``` diff --git a/docs/examples/databases/update.md b/docs/examples/databases/update.md index 5325acfc..36ff3bd1 100644 --- a/docs/examples/databases/update.md +++ b/docs/examples/databases/update.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await databases.update({ name: '', // optional enabled: false // optional }); +``` diff --git a/docs/examples/databases/upsert-document.md b/docs/examples/databases/upsert-document.md index 55156bd6..13e882ad 100644 --- a/docs/examples/databases/upsert-document.md +++ b/docs/examples/databases/upsert-document.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -21,3 +22,4 @@ const result = await databases.upsertDocument({ permissions: [sdk.Permission.read(sdk.Role.any())], // optional transactionId: '' // optional }); +``` diff --git a/docs/examples/databases/upsert-documents.md b/docs/examples/databases/upsert-documents.md index 16ed70fa..2a304924 100644 --- a/docs/examples/databases/upsert-documents.md +++ b/docs/examples/databases/upsert-documents.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await databases.upsertDocuments({ documents: [], transactionId: '' // optional }); +``` diff --git a/docs/examples/functions/create-deployment.md b/docs/examples/functions/create-deployment.md index 77946a70..0cd67cbf 100644 --- a/docs/examples/functions/create-deployment.md +++ b/docs/examples/functions/create-deployment.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const fs = require('fs'); @@ -15,3 +16,4 @@ const result = await functions.createDeployment({ entrypoint: '', // optional commands: '' // optional }); +``` diff --git a/docs/examples/functions/create-duplicate-deployment.md b/docs/examples/functions/create-duplicate-deployment.md index 03c68e74..f5abb222 100644 --- a/docs/examples/functions/create-duplicate-deployment.md +++ b/docs/examples/functions/create-duplicate-deployment.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await functions.createDuplicateDeployment({ deploymentId: '', buildId: '' // optional }); +``` diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index 5b2c18cc..63f7d6f4 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -16,3 +17,4 @@ const result = await functions.createExecution({ headers: {}, // optional scheduledAt: '' // optional }); +``` diff --git a/docs/examples/functions/create-template-deployment.md b/docs/examples/functions/create-template-deployment.md index f1efd7b1..20977559 100644 --- a/docs/examples/functions/create-template-deployment.md +++ b/docs/examples/functions/create-template-deployment.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -16,3 +17,4 @@ const result = await functions.createTemplateDeployment({ reference: '', activate: false // optional }); +``` diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index 45928395..0d8dcfaa 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await functions.createVariable({ value: '', secret: false // optional }); +``` diff --git a/docs/examples/functions/create-vcs-deployment.md b/docs/examples/functions/create-vcs-deployment.md index c6486255..4bf9d23b 100644 --- a/docs/examples/functions/create-vcs-deployment.md +++ b/docs/examples/functions/create-vcs-deployment.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await functions.createVcsDeployment({ reference: '', activate: false // optional }); +``` diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index 42fa14b7..292a0e40 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -27,3 +28,4 @@ const result = await functions.create({ providerRootDirectory: '', // optional specification: '' // optional }); +``` diff --git a/docs/examples/functions/delete-deployment.md b/docs/examples/functions/delete-deployment.md index 9f9815b9..20120ebd 100644 --- a/docs/examples/functions/delete-deployment.md +++ b/docs/examples/functions/delete-deployment.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await functions.deleteDeployment({ functionId: '', deploymentId: '' }); +``` diff --git a/docs/examples/functions/delete-execution.md b/docs/examples/functions/delete-execution.md index cf9d1079..4d78ad9c 100644 --- a/docs/examples/functions/delete-execution.md +++ b/docs/examples/functions/delete-execution.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await functions.deleteExecution({ functionId: '', executionId: '' }); +``` diff --git a/docs/examples/functions/delete-variable.md b/docs/examples/functions/delete-variable.md index 70ee4f7a..b8ed9d54 100644 --- a/docs/examples/functions/delete-variable.md +++ b/docs/examples/functions/delete-variable.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await functions.deleteVariable({ functionId: '', variableId: '' }); +``` diff --git a/docs/examples/functions/delete.md b/docs/examples/functions/delete.md index 635f271a..446ca2a5 100644 --- a/docs/examples/functions/delete.md +++ b/docs/examples/functions/delete.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const functions = new sdk.Functions(client); const result = await functions.delete({ functionId: '' }); +``` diff --git a/docs/examples/functions/get-deployment-download.md b/docs/examples/functions/get-deployment-download.md index 9e829985..5e9a956d 100644 --- a/docs/examples/functions/get-deployment-download.md +++ b/docs/examples/functions/get-deployment-download.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await functions.getDeploymentDownload({ deploymentId: '', type: sdk.DeploymentDownloadType.Source // optional }); +``` diff --git a/docs/examples/functions/get-deployment.md b/docs/examples/functions/get-deployment.md index c47081c7..29d9b2e6 100644 --- a/docs/examples/functions/get-deployment.md +++ b/docs/examples/functions/get-deployment.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await functions.getDeployment({ functionId: '', deploymentId: '' }); +``` diff --git a/docs/examples/functions/get-execution.md b/docs/examples/functions/get-execution.md index ad3ff487..c987772d 100644 --- a/docs/examples/functions/get-execution.md +++ b/docs/examples/functions/get-execution.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await functions.getExecution({ functionId: '', executionId: '' }); +``` diff --git a/docs/examples/functions/get-variable.md b/docs/examples/functions/get-variable.md index 9f473312..abc2e91d 100644 --- a/docs/examples/functions/get-variable.md +++ b/docs/examples/functions/get-variable.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await functions.getVariable({ functionId: '', variableId: '' }); +``` diff --git a/docs/examples/functions/get.md b/docs/examples/functions/get.md index 463054d4..97050f04 100644 --- a/docs/examples/functions/get.md +++ b/docs/examples/functions/get.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const functions = new sdk.Functions(client); const result = await functions.get({ functionId: '' }); +``` diff --git a/docs/examples/functions/list-deployments.md b/docs/examples/functions/list-deployments.md index 62f11553..c53aaa45 100644 --- a/docs/examples/functions/list-deployments.md +++ b/docs/examples/functions/list-deployments.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await functions.listDeployments({ search: '', // optional total: false // optional }); +``` diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md index 8a9b93a4..b549100f 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await functions.listExecutions({ queries: [], // optional total: false // optional }); +``` diff --git a/docs/examples/functions/list-runtimes.md b/docs/examples/functions/list-runtimes.md index a0f83b22..fdaefd3a 100644 --- a/docs/examples/functions/list-runtimes.md +++ b/docs/examples/functions/list-runtimes.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -8,3 +9,4 @@ const client = new sdk.Client() const functions = new sdk.Functions(client); const result = await functions.listRuntimes(); +``` diff --git a/docs/examples/functions/list-specifications.md b/docs/examples/functions/list-specifications.md index f918c440..0fc8b8d7 100644 --- a/docs/examples/functions/list-specifications.md +++ b/docs/examples/functions/list-specifications.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -8,3 +9,4 @@ const client = new sdk.Client() const functions = new sdk.Functions(client); const result = await functions.listSpecifications(); +``` diff --git a/docs/examples/functions/list-variables.md b/docs/examples/functions/list-variables.md index 962a8100..166effad 100644 --- a/docs/examples/functions/list-variables.md +++ b/docs/examples/functions/list-variables.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const functions = new sdk.Functions(client); const result = await functions.listVariables({ functionId: '' }); +``` diff --git a/docs/examples/functions/list.md b/docs/examples/functions/list.md index 3f883087..faeeaae7 100644 --- a/docs/examples/functions/list.md +++ b/docs/examples/functions/list.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await functions.list({ search: '', // optional total: false // optional }); +``` diff --git a/docs/examples/functions/update-deployment-status.md b/docs/examples/functions/update-deployment-status.md index 32b8a619..5d45a02a 100644 --- a/docs/examples/functions/update-deployment-status.md +++ b/docs/examples/functions/update-deployment-status.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await functions.updateDeploymentStatus({ functionId: '', deploymentId: '' }); +``` diff --git a/docs/examples/functions/update-function-deployment.md b/docs/examples/functions/update-function-deployment.md index b0d31325..0dfd06f5 100644 --- a/docs/examples/functions/update-function-deployment.md +++ b/docs/examples/functions/update-function-deployment.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await functions.updateFunctionDeployment({ functionId: '', deploymentId: '' }); +``` diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index 73ae49fb..abd2dad5 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -14,3 +15,4 @@ const result = await functions.updateVariable({ value: '', // optional secret: false // optional }); +``` diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index e1004def..459b5f37 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -27,3 +28,4 @@ const result = await functions.update({ providerRootDirectory: '', // optional specification: '' // optional }); +``` diff --git a/docs/examples/graphql/mutation.md b/docs/examples/graphql/mutation.md index dffb7b3f..31aa4bf3 100644 --- a/docs/examples/graphql/mutation.md +++ b/docs/examples/graphql/mutation.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const graphql = new sdk.Graphql(client); const result = await graphql.mutation({ query: {} }); +``` diff --git a/docs/examples/graphql/query.md b/docs/examples/graphql/query.md index 1f873ed9..3bd436e0 100644 --- a/docs/examples/graphql/query.md +++ b/docs/examples/graphql/query.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const graphql = new sdk.Graphql(client); const result = await graphql.query({ query: {} }); +``` diff --git a/docs/examples/health/get-antivirus.md b/docs/examples/health/get-antivirus.md index 9efa2d80..3f0c8345 100644 --- a/docs/examples/health/get-antivirus.md +++ b/docs/examples/health/get-antivirus.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -8,3 +9,4 @@ const client = new sdk.Client() const health = new sdk.Health(client); const result = await health.getAntivirus(); +``` diff --git a/docs/examples/health/get-cache.md b/docs/examples/health/get-cache.md index 01434012..a9525064 100644 --- a/docs/examples/health/get-cache.md +++ b/docs/examples/health/get-cache.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -8,3 +9,4 @@ const client = new sdk.Client() const health = new sdk.Health(client); const result = await health.getCache(); +``` diff --git a/docs/examples/health/get-certificate.md b/docs/examples/health/get-certificate.md index ccb88007..571b3cdc 100644 --- a/docs/examples/health/get-certificate.md +++ b/docs/examples/health/get-certificate.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const health = new sdk.Health(client); const result = await health.getCertificate({ domain: '' // optional }); +``` diff --git a/docs/examples/health/get-db.md b/docs/examples/health/get-db.md index 0d86d08d..45a840c9 100644 --- a/docs/examples/health/get-db.md +++ b/docs/examples/health/get-db.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -8,3 +9,4 @@ const client = new sdk.Client() const health = new sdk.Health(client); const result = await health.getDB(); +``` diff --git a/docs/examples/health/get-failed-jobs.md b/docs/examples/health/get-failed-jobs.md index 32c03426..e495453c 100644 --- a/docs/examples/health/get-failed-jobs.md +++ b/docs/examples/health/get-failed-jobs.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await health.getFailedJobs({ name: sdk.Name.V1Database, threshold: null // optional }); +``` diff --git a/docs/examples/health/get-pub-sub.md b/docs/examples/health/get-pub-sub.md index b5b97374..c03bb59e 100644 --- a/docs/examples/health/get-pub-sub.md +++ b/docs/examples/health/get-pub-sub.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -8,3 +9,4 @@ const client = new sdk.Client() const health = new sdk.Health(client); const result = await health.getPubSub(); +``` diff --git a/docs/examples/health/get-queue-audits.md b/docs/examples/health/get-queue-audits.md index 5b337f1a..dcc7c6ce 100644 --- a/docs/examples/health/get-queue-audits.md +++ b/docs/examples/health/get-queue-audits.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const health = new sdk.Health(client); const result = await health.getQueueAudits({ threshold: null // optional }); +``` diff --git a/docs/examples/health/get-queue-billing-project-aggregation.md b/docs/examples/health/get-queue-billing-project-aggregation.md new file mode 100644 index 00000000..5b2fd2e2 --- /dev/null +++ b/docs/examples/health/get-queue-billing-project-aggregation.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const health = new sdk.Health(client); + +const result = await health.getQueueBillingProjectAggregation({ + threshold: null // optional +}); +``` diff --git a/docs/examples/health/get-queue-billing-team-aggregation.md b/docs/examples/health/get-queue-billing-team-aggregation.md new file mode 100644 index 00000000..61b45003 --- /dev/null +++ b/docs/examples/health/get-queue-billing-team-aggregation.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const health = new sdk.Health(client); + +const result = await health.getQueueBillingTeamAggregation({ + threshold: null // optional +}); +``` diff --git a/docs/examples/health/get-queue-builds.md b/docs/examples/health/get-queue-builds.md index 8e280547..da49e020 100644 --- a/docs/examples/health/get-queue-builds.md +++ b/docs/examples/health/get-queue-builds.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const health = new sdk.Health(client); const result = await health.getQueueBuilds({ threshold: null // optional }); +``` diff --git a/docs/examples/health/get-queue-certificates.md b/docs/examples/health/get-queue-certificates.md index 89383ede..ef065d59 100644 --- a/docs/examples/health/get-queue-certificates.md +++ b/docs/examples/health/get-queue-certificates.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const health = new sdk.Health(client); const result = await health.getQueueCertificates({ threshold: null // optional }); +``` diff --git a/docs/examples/health/get-queue-databases.md b/docs/examples/health/get-queue-databases.md index 78452557..181621ec 100644 --- a/docs/examples/health/get-queue-databases.md +++ b/docs/examples/health/get-queue-databases.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await health.getQueueDatabases({ name: '', // optional threshold: null // optional }); +``` diff --git a/docs/examples/health/get-queue-deletes.md b/docs/examples/health/get-queue-deletes.md index 8248b5c4..e1b5bc00 100644 --- a/docs/examples/health/get-queue-deletes.md +++ b/docs/examples/health/get-queue-deletes.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const health = new sdk.Health(client); const result = await health.getQueueDeletes({ threshold: null // optional }); +``` diff --git a/docs/examples/health/get-queue-functions.md b/docs/examples/health/get-queue-functions.md index 5832a274..f40904a2 100644 --- a/docs/examples/health/get-queue-functions.md +++ b/docs/examples/health/get-queue-functions.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const health = new sdk.Health(client); const result = await health.getQueueFunctions({ threshold: null // optional }); +``` diff --git a/docs/examples/health/get-queue-logs.md b/docs/examples/health/get-queue-logs.md index 055c525b..437a86b0 100644 --- a/docs/examples/health/get-queue-logs.md +++ b/docs/examples/health/get-queue-logs.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const health = new sdk.Health(client); const result = await health.getQueueLogs({ threshold: null // optional }); +``` diff --git a/docs/examples/health/get-queue-mails.md b/docs/examples/health/get-queue-mails.md index fb29d081..3da627b8 100644 --- a/docs/examples/health/get-queue-mails.md +++ b/docs/examples/health/get-queue-mails.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const health = new sdk.Health(client); const result = await health.getQueueMails({ threshold: null // optional }); +``` diff --git a/docs/examples/health/get-queue-messaging.md b/docs/examples/health/get-queue-messaging.md index cc8eb4be..504ad1de 100644 --- a/docs/examples/health/get-queue-messaging.md +++ b/docs/examples/health/get-queue-messaging.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const health = new sdk.Health(client); const result = await health.getQueueMessaging({ threshold: null // optional }); +``` diff --git a/docs/examples/health/get-queue-migrations.md b/docs/examples/health/get-queue-migrations.md index ddc7f517..59e45509 100644 --- a/docs/examples/health/get-queue-migrations.md +++ b/docs/examples/health/get-queue-migrations.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const health = new sdk.Health(client); const result = await health.getQueueMigrations({ threshold: null // optional }); +``` diff --git a/docs/examples/health/get-queue-priority-builds.md b/docs/examples/health/get-queue-priority-builds.md new file mode 100644 index 00000000..c37bcd66 --- /dev/null +++ b/docs/examples/health/get-queue-priority-builds.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const health = new sdk.Health(client); + +const result = await health.getQueuePriorityBuilds({ + threshold: null // optional +}); +``` diff --git a/docs/examples/health/get-queue-region-manager.md b/docs/examples/health/get-queue-region-manager.md new file mode 100644 index 00000000..e02b3022 --- /dev/null +++ b/docs/examples/health/get-queue-region-manager.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const health = new sdk.Health(client); + +const result = await health.getQueueRegionManager({ + threshold: null // optional +}); +``` diff --git a/docs/examples/health/get-queue-stats-resources.md b/docs/examples/health/get-queue-stats-resources.md index dacf04c3..542d11e0 100644 --- a/docs/examples/health/get-queue-stats-resources.md +++ b/docs/examples/health/get-queue-stats-resources.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const health = new sdk.Health(client); const result = await health.getQueueStatsResources({ threshold: null // optional }); +``` diff --git a/docs/examples/health/get-queue-threats.md b/docs/examples/health/get-queue-threats.md new file mode 100644 index 00000000..9b166cac --- /dev/null +++ b/docs/examples/health/get-queue-threats.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const health = new sdk.Health(client); + +const result = await health.getQueueThreats({ + threshold: null // optional +}); +``` diff --git a/docs/examples/health/get-queue-usage.md b/docs/examples/health/get-queue-usage.md index 5d06a7ce..86dbfb83 100644 --- a/docs/examples/health/get-queue-usage.md +++ b/docs/examples/health/get-queue-usage.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const health = new sdk.Health(client); const result = await health.getQueueUsage({ threshold: null // optional }); +``` diff --git a/docs/examples/health/get-queue-webhooks.md b/docs/examples/health/get-queue-webhooks.md index f4d0af8a..36c3037a 100644 --- a/docs/examples/health/get-queue-webhooks.md +++ b/docs/examples/health/get-queue-webhooks.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const health = new sdk.Health(client); const result = await health.getQueueWebhooks({ threshold: null // optional }); +``` diff --git a/docs/examples/health/get-storage-local.md b/docs/examples/health/get-storage-local.md index 0ea8e0e2..15933394 100644 --- a/docs/examples/health/get-storage-local.md +++ b/docs/examples/health/get-storage-local.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -8,3 +9,4 @@ const client = new sdk.Client() const health = new sdk.Health(client); const result = await health.getStorageLocal(); +``` diff --git a/docs/examples/health/get-storage.md b/docs/examples/health/get-storage.md index d1998005..75ec5cb8 100644 --- a/docs/examples/health/get-storage.md +++ b/docs/examples/health/get-storage.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -8,3 +9,4 @@ const client = new sdk.Client() const health = new sdk.Health(client); const result = await health.getStorage(); +``` diff --git a/docs/examples/health/get-time.md b/docs/examples/health/get-time.md index cd4f42e3..86d86174 100644 --- a/docs/examples/health/get-time.md +++ b/docs/examples/health/get-time.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -8,3 +9,4 @@ const client = new sdk.Client() const health = new sdk.Health(client); const result = await health.getTime(); +``` diff --git a/docs/examples/health/get.md b/docs/examples/health/get.md index e10c4e28..bfb883b6 100644 --- a/docs/examples/health/get.md +++ b/docs/examples/health/get.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -8,3 +9,4 @@ const client = new sdk.Client() const health = new sdk.Health(client); const result = await health.get(); +``` diff --git a/docs/examples/locale/get.md b/docs/examples/locale/get.md index d57eb8f2..004a9325 100644 --- a/docs/examples/locale/get.md +++ b/docs/examples/locale/get.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -8,3 +9,4 @@ const client = new sdk.Client() const locale = new sdk.Locale(client); const result = await locale.get(); +``` diff --git a/docs/examples/locale/list-codes.md b/docs/examples/locale/list-codes.md index 280d14ae..136992f4 100644 --- a/docs/examples/locale/list-codes.md +++ b/docs/examples/locale/list-codes.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -8,3 +9,4 @@ const client = new sdk.Client() const locale = new sdk.Locale(client); const result = await locale.listCodes(); +``` diff --git a/docs/examples/locale/list-continents.md b/docs/examples/locale/list-continents.md index d04d6d6a..aa58ec57 100644 --- a/docs/examples/locale/list-continents.md +++ b/docs/examples/locale/list-continents.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -8,3 +9,4 @@ const client = new sdk.Client() const locale = new sdk.Locale(client); const result = await locale.listContinents(); +``` diff --git a/docs/examples/locale/list-countries-eu.md b/docs/examples/locale/list-countries-eu.md index 6e41074b..538b4927 100644 --- a/docs/examples/locale/list-countries-eu.md +++ b/docs/examples/locale/list-countries-eu.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -8,3 +9,4 @@ const client = new sdk.Client() const locale = new sdk.Locale(client); const result = await locale.listCountriesEU(); +``` diff --git a/docs/examples/locale/list-countries-phones.md b/docs/examples/locale/list-countries-phones.md index 9621e9cb..c2701418 100644 --- a/docs/examples/locale/list-countries-phones.md +++ b/docs/examples/locale/list-countries-phones.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -8,3 +9,4 @@ const client = new sdk.Client() const locale = new sdk.Locale(client); const result = await locale.listCountriesPhones(); +``` diff --git a/docs/examples/locale/list-countries.md b/docs/examples/locale/list-countries.md index a81b1581..99ee2d35 100644 --- a/docs/examples/locale/list-countries.md +++ b/docs/examples/locale/list-countries.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -8,3 +9,4 @@ const client = new sdk.Client() const locale = new sdk.Locale(client); const result = await locale.listCountries(); +``` diff --git a/docs/examples/locale/list-currencies.md b/docs/examples/locale/list-currencies.md index a585fd33..c381774d 100644 --- a/docs/examples/locale/list-currencies.md +++ b/docs/examples/locale/list-currencies.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -8,3 +9,4 @@ const client = new sdk.Client() const locale = new sdk.Locale(client); const result = await locale.listCurrencies(); +``` diff --git a/docs/examples/locale/list-languages.md b/docs/examples/locale/list-languages.md index aea0fadf..cfd522c6 100644 --- a/docs/examples/locale/list-languages.md +++ b/docs/examples/locale/list-languages.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -8,3 +9,4 @@ const client = new sdk.Client() const locale = new sdk.Locale(client); const result = await locale.listLanguages(); +``` diff --git a/docs/examples/messaging/create-apns-provider.md b/docs/examples/messaging/create-apns-provider.md index cd1a53b3..dc203a39 100644 --- a/docs/examples/messaging/create-apns-provider.md +++ b/docs/examples/messaging/create-apns-provider.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -17,3 +18,4 @@ const result = await messaging.createAPNSProvider({ sandbox: false, // optional enabled: false // optional }); +``` diff --git a/docs/examples/messaging/create-email.md b/docs/examples/messaging/create-email.md index 93fb2ef3..f12d0d5e 100644 --- a/docs/examples/messaging/create-email.md +++ b/docs/examples/messaging/create-email.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -21,3 +22,4 @@ const result = await messaging.createEmail({ html: false, // optional scheduledAt: '' // optional }); +``` diff --git a/docs/examples/messaging/create-fcm-provider.md b/docs/examples/messaging/create-fcm-provider.md index 8041e7f2..78b6d06c 100644 --- a/docs/examples/messaging/create-fcm-provider.md +++ b/docs/examples/messaging/create-fcm-provider.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await messaging.createFCMProvider({ serviceAccountJSON: {}, // optional enabled: false // optional }); +``` diff --git a/docs/examples/messaging/create-mailgun-provider.md b/docs/examples/messaging/create-mailgun-provider.md index dd8a0f6a..f2961b6d 100644 --- a/docs/examples/messaging/create-mailgun-provider.md +++ b/docs/examples/messaging/create-mailgun-provider.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -19,3 +20,4 @@ const result = await messaging.createMailgunProvider({ replyToEmail: 'email@example.com', // optional enabled: false // optional }); +``` diff --git a/docs/examples/messaging/create-msg-91-provider.md b/docs/examples/messaging/create-msg-91-provider.md index 7168e8bb..ba6829a6 100644 --- a/docs/examples/messaging/create-msg-91-provider.md +++ b/docs/examples/messaging/create-msg-91-provider.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await messaging.createMsg91Provider({ authKey: '', // optional enabled: false // optional }); +``` diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md index 4c64813f..032a2082 100644 --- a/docs/examples/messaging/create-push.md +++ b/docs/examples/messaging/create-push.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -28,3 +29,4 @@ const result = await messaging.createPush({ critical: false, // optional priority: sdk.MessagePriority.Normal // optional }); +``` diff --git a/docs/examples/messaging/create-resend-provider.md b/docs/examples/messaging/create-resend-provider.md index 8f00367e..d1c391d0 100644 --- a/docs/examples/messaging/create-resend-provider.md +++ b/docs/examples/messaging/create-resend-provider.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -17,3 +18,4 @@ const result = await messaging.createResendProvider({ replyToEmail: 'email@example.com', // optional enabled: false // optional }); +``` diff --git a/docs/examples/messaging/create-sendgrid-provider.md b/docs/examples/messaging/create-sendgrid-provider.md index 8b26b2f3..9c3be00c 100644 --- a/docs/examples/messaging/create-sendgrid-provider.md +++ b/docs/examples/messaging/create-sendgrid-provider.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -17,3 +18,4 @@ const result = await messaging.createSendgridProvider({ replyToEmail: 'email@example.com', // optional enabled: false // optional }); +``` diff --git a/docs/examples/messaging/create-sms.md b/docs/examples/messaging/create-sms.md index c477643b..2cee66cc 100644 --- a/docs/examples/messaging/create-sms.md +++ b/docs/examples/messaging/create-sms.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -16,3 +17,4 @@ const result = await messaging.createSMS({ draft: false, // optional scheduledAt: '' // optional }); +``` diff --git a/docs/examples/messaging/create-smtp-provider.md b/docs/examples/messaging/create-smtp-provider.md index 241a0f09..e17fdc19 100644 --- a/docs/examples/messaging/create-smtp-provider.md +++ b/docs/examples/messaging/create-smtp-provider.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -23,3 +24,4 @@ const result = await messaging.createSMTPProvider({ replyToEmail: 'email@example.com', // optional enabled: false // optional }); +``` diff --git a/docs/examples/messaging/create-subscriber.md b/docs/examples/messaging/create-subscriber.md index f86a424c..51410af7 100644 --- a/docs/examples/messaging/create-subscriber.md +++ b/docs/examples/messaging/create-subscriber.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await messaging.createSubscriber({ subscriberId: '', targetId: '' }); +``` diff --git a/docs/examples/messaging/create-telesign-provider.md b/docs/examples/messaging/create-telesign-provider.md index b558fbd2..baf83a6c 100644 --- a/docs/examples/messaging/create-telesign-provider.md +++ b/docs/examples/messaging/create-telesign-provider.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await messaging.createTelesignProvider({ apiKey: '', // optional enabled: false // optional }); +``` diff --git a/docs/examples/messaging/create-textmagic-provider.md b/docs/examples/messaging/create-textmagic-provider.md index 82141aea..655a2248 100644 --- a/docs/examples/messaging/create-textmagic-provider.md +++ b/docs/examples/messaging/create-textmagic-provider.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await messaging.createTextmagicProvider({ apiKey: '', // optional enabled: false // optional }); +``` diff --git a/docs/examples/messaging/create-topic.md b/docs/examples/messaging/create-topic.md index ce91b542..4625517a 100644 --- a/docs/examples/messaging/create-topic.md +++ b/docs/examples/messaging/create-topic.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await messaging.createTopic({ name: '', subscribe: ["any"] // optional }); +``` diff --git a/docs/examples/messaging/create-twilio-provider.md b/docs/examples/messaging/create-twilio-provider.md index b3d9ba6b..0db55435 100644 --- a/docs/examples/messaging/create-twilio-provider.md +++ b/docs/examples/messaging/create-twilio-provider.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await messaging.createTwilioProvider({ authToken: '', // optional enabled: false // optional }); +``` diff --git a/docs/examples/messaging/create-vonage-provider.md b/docs/examples/messaging/create-vonage-provider.md index b7a94ff5..cf8cd38a 100644 --- a/docs/examples/messaging/create-vonage-provider.md +++ b/docs/examples/messaging/create-vonage-provider.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await messaging.createVonageProvider({ apiSecret: '', // optional enabled: false // optional }); +``` diff --git a/docs/examples/messaging/delete-provider.md b/docs/examples/messaging/delete-provider.md index 590b8078..53fc2aea 100644 --- a/docs/examples/messaging/delete-provider.md +++ b/docs/examples/messaging/delete-provider.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const messaging = new sdk.Messaging(client); const result = await messaging.deleteProvider({ providerId: '' }); +``` diff --git a/docs/examples/messaging/delete-subscriber.md b/docs/examples/messaging/delete-subscriber.md index 77f2f896..99c61d7a 100644 --- a/docs/examples/messaging/delete-subscriber.md +++ b/docs/examples/messaging/delete-subscriber.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await messaging.deleteSubscriber({ topicId: '', subscriberId: '' }); +``` diff --git a/docs/examples/messaging/delete-topic.md b/docs/examples/messaging/delete-topic.md index 58ca2fb3..3ffa99f9 100644 --- a/docs/examples/messaging/delete-topic.md +++ b/docs/examples/messaging/delete-topic.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const messaging = new sdk.Messaging(client); const result = await messaging.deleteTopic({ topicId: '' }); +``` diff --git a/docs/examples/messaging/delete.md b/docs/examples/messaging/delete.md index c2c0560d..62e7d61a 100644 --- a/docs/examples/messaging/delete.md +++ b/docs/examples/messaging/delete.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const messaging = new sdk.Messaging(client); const result = await messaging.delete({ messageId: '' }); +``` diff --git a/docs/examples/messaging/get-message.md b/docs/examples/messaging/get-message.md index 503da482..894a74ac 100644 --- a/docs/examples/messaging/get-message.md +++ b/docs/examples/messaging/get-message.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const messaging = new sdk.Messaging(client); const result = await messaging.getMessage({ messageId: '' }); +``` diff --git a/docs/examples/messaging/get-provider.md b/docs/examples/messaging/get-provider.md index f7c70587..c7e91ff0 100644 --- a/docs/examples/messaging/get-provider.md +++ b/docs/examples/messaging/get-provider.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const messaging = new sdk.Messaging(client); const result = await messaging.getProvider({ providerId: '' }); +``` diff --git a/docs/examples/messaging/get-subscriber.md b/docs/examples/messaging/get-subscriber.md index befc566b..8a915341 100644 --- a/docs/examples/messaging/get-subscriber.md +++ b/docs/examples/messaging/get-subscriber.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await messaging.getSubscriber({ topicId: '', subscriberId: '' }); +``` diff --git a/docs/examples/messaging/get-topic.md b/docs/examples/messaging/get-topic.md index f537973f..f352c9d7 100644 --- a/docs/examples/messaging/get-topic.md +++ b/docs/examples/messaging/get-topic.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const messaging = new sdk.Messaging(client); const result = await messaging.getTopic({ topicId: '' }); +``` diff --git a/docs/examples/messaging/list-message-logs.md b/docs/examples/messaging/list-message-logs.md index b7d0701a..c9c8a471 100644 --- a/docs/examples/messaging/list-message-logs.md +++ b/docs/examples/messaging/list-message-logs.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await messaging.listMessageLogs({ queries: [], // optional total: false // optional }); +``` diff --git a/docs/examples/messaging/list-messages.md b/docs/examples/messaging/list-messages.md index ecbaf742..053adc9f 100644 --- a/docs/examples/messaging/list-messages.md +++ b/docs/examples/messaging/list-messages.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await messaging.listMessages({ search: '', // optional total: false // optional }); +``` diff --git a/docs/examples/messaging/list-provider-logs.md b/docs/examples/messaging/list-provider-logs.md index e91c69c2..92b4c2f4 100644 --- a/docs/examples/messaging/list-provider-logs.md +++ b/docs/examples/messaging/list-provider-logs.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await messaging.listProviderLogs({ queries: [], // optional total: false // optional }); +``` diff --git a/docs/examples/messaging/list-providers.md b/docs/examples/messaging/list-providers.md index 1a05f22a..603ff0bd 100644 --- a/docs/examples/messaging/list-providers.md +++ b/docs/examples/messaging/list-providers.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await messaging.listProviders({ search: '', // optional total: false // optional }); +``` diff --git a/docs/examples/messaging/list-subscriber-logs.md b/docs/examples/messaging/list-subscriber-logs.md index a613829b..2f892254 100644 --- a/docs/examples/messaging/list-subscriber-logs.md +++ b/docs/examples/messaging/list-subscriber-logs.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await messaging.listSubscriberLogs({ queries: [], // optional total: false // optional }); +``` diff --git a/docs/examples/messaging/list-subscribers.md b/docs/examples/messaging/list-subscribers.md index ba2cbc51..bba6aae4 100644 --- a/docs/examples/messaging/list-subscribers.md +++ b/docs/examples/messaging/list-subscribers.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await messaging.listSubscribers({ search: '', // optional total: false // optional }); +``` diff --git a/docs/examples/messaging/list-targets.md b/docs/examples/messaging/list-targets.md index ceede50b..dc053961 100644 --- a/docs/examples/messaging/list-targets.md +++ b/docs/examples/messaging/list-targets.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await messaging.listTargets({ queries: [], // optional total: false // optional }); +``` diff --git a/docs/examples/messaging/list-topic-logs.md b/docs/examples/messaging/list-topic-logs.md index f4d0746e..ee76366c 100644 --- a/docs/examples/messaging/list-topic-logs.md +++ b/docs/examples/messaging/list-topic-logs.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await messaging.listTopicLogs({ queries: [], // optional total: false // optional }); +``` diff --git a/docs/examples/messaging/list-topics.md b/docs/examples/messaging/list-topics.md index be321b97..62fecb61 100644 --- a/docs/examples/messaging/list-topics.md +++ b/docs/examples/messaging/list-topics.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await messaging.listTopics({ search: '', // optional total: false // optional }); +``` diff --git a/docs/examples/messaging/update-apns-provider.md b/docs/examples/messaging/update-apns-provider.md index f57fe6ab..6cd012d9 100644 --- a/docs/examples/messaging/update-apns-provider.md +++ b/docs/examples/messaging/update-apns-provider.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -17,3 +18,4 @@ const result = await messaging.updateAPNSProvider({ bundleId: '', // optional sandbox: false // optional }); +``` diff --git a/docs/examples/messaging/update-email.md b/docs/examples/messaging/update-email.md index 575b4635..a761b7f9 100644 --- a/docs/examples/messaging/update-email.md +++ b/docs/examples/messaging/update-email.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -21,3 +22,4 @@ const result = await messaging.updateEmail({ scheduledAt: '', // optional attachments: [] // optional }); +``` diff --git a/docs/examples/messaging/update-fcm-provider.md b/docs/examples/messaging/update-fcm-provider.md index 0a3134a9..4d76843e 100644 --- a/docs/examples/messaging/update-fcm-provider.md +++ b/docs/examples/messaging/update-fcm-provider.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await messaging.updateFCMProvider({ enabled: false, // optional serviceAccountJSON: {} // optional }); +``` diff --git a/docs/examples/messaging/update-mailgun-provider.md b/docs/examples/messaging/update-mailgun-provider.md index fbe2d076..5725f1eb 100644 --- a/docs/examples/messaging/update-mailgun-provider.md +++ b/docs/examples/messaging/update-mailgun-provider.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -19,3 +20,4 @@ const result = await messaging.updateMailgunProvider({ replyToName: '', // optional replyToEmail: '' // optional }); +``` diff --git a/docs/examples/messaging/update-msg-91-provider.md b/docs/examples/messaging/update-msg-91-provider.md index 7ecb3f03..d66ba73f 100644 --- a/docs/examples/messaging/update-msg-91-provider.md +++ b/docs/examples/messaging/update-msg-91-provider.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await messaging.updateMsg91Provider({ senderId: '', // optional authKey: '' // optional }); +``` diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md index 6f5899f8..b77e10ae 100644 --- a/docs/examples/messaging/update-push.md +++ b/docs/examples/messaging/update-push.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -28,3 +29,4 @@ const result = await messaging.updatePush({ critical: false, // optional priority: sdk.MessagePriority.Normal // optional }); +``` diff --git a/docs/examples/messaging/update-resend-provider.md b/docs/examples/messaging/update-resend-provider.md index ab962178..563c907f 100644 --- a/docs/examples/messaging/update-resend-provider.md +++ b/docs/examples/messaging/update-resend-provider.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -17,3 +18,4 @@ const result = await messaging.updateResendProvider({ replyToName: '', // optional replyToEmail: '' // optional }); +``` diff --git a/docs/examples/messaging/update-sendgrid-provider.md b/docs/examples/messaging/update-sendgrid-provider.md index 340f2758..ece8ae7c 100644 --- a/docs/examples/messaging/update-sendgrid-provider.md +++ b/docs/examples/messaging/update-sendgrid-provider.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -17,3 +18,4 @@ const result = await messaging.updateSendgridProvider({ replyToName: '', // optional replyToEmail: '' // optional }); +``` diff --git a/docs/examples/messaging/update-sms.md b/docs/examples/messaging/update-sms.md index a325b5af..b4bd058a 100644 --- a/docs/examples/messaging/update-sms.md +++ b/docs/examples/messaging/update-sms.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -16,3 +17,4 @@ const result = await messaging.updateSMS({ draft: false, // optional scheduledAt: '' // optional }); +``` diff --git a/docs/examples/messaging/update-smtp-provider.md b/docs/examples/messaging/update-smtp-provider.md index 7b2a8116..d860736f 100644 --- a/docs/examples/messaging/update-smtp-provider.md +++ b/docs/examples/messaging/update-smtp-provider.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -23,3 +24,4 @@ const result = await messaging.updateSMTPProvider({ replyToEmail: '', // optional enabled: false // optional }); +``` diff --git a/docs/examples/messaging/update-telesign-provider.md b/docs/examples/messaging/update-telesign-provider.md index 8e1e2364..b8b7ea08 100644 --- a/docs/examples/messaging/update-telesign-provider.md +++ b/docs/examples/messaging/update-telesign-provider.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await messaging.updateTelesignProvider({ apiKey: '', // optional from: '' // optional }); +``` diff --git a/docs/examples/messaging/update-textmagic-provider.md b/docs/examples/messaging/update-textmagic-provider.md index 8656723d..bf35cef8 100644 --- a/docs/examples/messaging/update-textmagic-provider.md +++ b/docs/examples/messaging/update-textmagic-provider.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await messaging.updateTextmagicProvider({ apiKey: '', // optional from: '' // optional }); +``` diff --git a/docs/examples/messaging/update-topic.md b/docs/examples/messaging/update-topic.md index cf34080f..8ec30739 100644 --- a/docs/examples/messaging/update-topic.md +++ b/docs/examples/messaging/update-topic.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await messaging.updateTopic({ name: '', // optional subscribe: ["any"] // optional }); +``` diff --git a/docs/examples/messaging/update-twilio-provider.md b/docs/examples/messaging/update-twilio-provider.md index 6a201415..da83c43c 100644 --- a/docs/examples/messaging/update-twilio-provider.md +++ b/docs/examples/messaging/update-twilio-provider.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await messaging.updateTwilioProvider({ authToken: '', // optional from: '' // optional }); +``` diff --git a/docs/examples/messaging/update-vonage-provider.md b/docs/examples/messaging/update-vonage-provider.md index d99c0762..caefea0d 100644 --- a/docs/examples/messaging/update-vonage-provider.md +++ b/docs/examples/messaging/update-vonage-provider.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await messaging.updateVonageProvider({ apiSecret: '', // optional from: '' // optional }); +``` diff --git a/docs/examples/sites/create-deployment.md b/docs/examples/sites/create-deployment.md index dbd78e09..1fea6050 100644 --- a/docs/examples/sites/create-deployment.md +++ b/docs/examples/sites/create-deployment.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const fs = require('fs'); @@ -16,3 +17,4 @@ const result = await sites.createDeployment({ buildCommand: '', // optional outputDirectory: '' // optional }); +``` diff --git a/docs/examples/sites/create-duplicate-deployment.md b/docs/examples/sites/create-duplicate-deployment.md index 8d2bd4f6..e14d8585 100644 --- a/docs/examples/sites/create-duplicate-deployment.md +++ b/docs/examples/sites/create-duplicate-deployment.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await sites.createDuplicateDeployment({ siteId: '', deploymentId: '' }); +``` diff --git a/docs/examples/sites/create-template-deployment.md b/docs/examples/sites/create-template-deployment.md index 3728f7f8..b08d94ab 100644 --- a/docs/examples/sites/create-template-deployment.md +++ b/docs/examples/sites/create-template-deployment.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -16,3 +17,4 @@ const result = await sites.createTemplateDeployment({ reference: '', activate: false // optional }); +``` diff --git a/docs/examples/sites/create-variable.md b/docs/examples/sites/create-variable.md index 2ec774c7..be07336b 100644 --- a/docs/examples/sites/create-variable.md +++ b/docs/examples/sites/create-variable.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await sites.createVariable({ value: '', secret: false // optional }); +``` diff --git a/docs/examples/sites/create-vcs-deployment.md b/docs/examples/sites/create-vcs-deployment.md index 95cefea9..6d28546e 100644 --- a/docs/examples/sites/create-vcs-deployment.md +++ b/docs/examples/sites/create-vcs-deployment.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await sites.createVcsDeployment({ reference: '', activate: false // optional }); +``` diff --git a/docs/examples/sites/create.md b/docs/examples/sites/create.md index 397d2d39..fe5c2649 100644 --- a/docs/examples/sites/create.md +++ b/docs/examples/sites/create.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -27,3 +28,4 @@ const result = await sites.create({ providerRootDirectory: '', // optional specification: '' // optional }); +``` diff --git a/docs/examples/sites/delete-deployment.md b/docs/examples/sites/delete-deployment.md index 292f9e05..533f2985 100644 --- a/docs/examples/sites/delete-deployment.md +++ b/docs/examples/sites/delete-deployment.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await sites.deleteDeployment({ siteId: '', deploymentId: '' }); +``` diff --git a/docs/examples/sites/delete-log.md b/docs/examples/sites/delete-log.md index d1850e1e..38f7c3a3 100644 --- a/docs/examples/sites/delete-log.md +++ b/docs/examples/sites/delete-log.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await sites.deleteLog({ siteId: '', logId: '' }); +``` diff --git a/docs/examples/sites/delete-variable.md b/docs/examples/sites/delete-variable.md index 069ff8dc..11ebaca9 100644 --- a/docs/examples/sites/delete-variable.md +++ b/docs/examples/sites/delete-variable.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await sites.deleteVariable({ siteId: '', variableId: '' }); +``` diff --git a/docs/examples/sites/delete.md b/docs/examples/sites/delete.md index 7f6ad8bc..03bd1a57 100644 --- a/docs/examples/sites/delete.md +++ b/docs/examples/sites/delete.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const sites = new sdk.Sites(client); const result = await sites.delete({ siteId: '' }); +``` diff --git a/docs/examples/sites/get-deployment-download.md b/docs/examples/sites/get-deployment-download.md index 05e87058..6e7ee4aa 100644 --- a/docs/examples/sites/get-deployment-download.md +++ b/docs/examples/sites/get-deployment-download.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await sites.getDeploymentDownload({ deploymentId: '', type: sdk.DeploymentDownloadType.Source // optional }); +``` diff --git a/docs/examples/sites/get-deployment.md b/docs/examples/sites/get-deployment.md index 68b6dcf5..1f1430ca 100644 --- a/docs/examples/sites/get-deployment.md +++ b/docs/examples/sites/get-deployment.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await sites.getDeployment({ siteId: '', deploymentId: '' }); +``` diff --git a/docs/examples/sites/get-log.md b/docs/examples/sites/get-log.md index 3a22d90f..f8190b4a 100644 --- a/docs/examples/sites/get-log.md +++ b/docs/examples/sites/get-log.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await sites.getLog({ siteId: '', logId: '' }); +``` diff --git a/docs/examples/sites/get-variable.md b/docs/examples/sites/get-variable.md index 7d0a759e..cafb71b1 100644 --- a/docs/examples/sites/get-variable.md +++ b/docs/examples/sites/get-variable.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await sites.getVariable({ siteId: '', variableId: '' }); +``` diff --git a/docs/examples/sites/get.md b/docs/examples/sites/get.md index 6d818080..0b21b2bb 100644 --- a/docs/examples/sites/get.md +++ b/docs/examples/sites/get.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const sites = new sdk.Sites(client); const result = await sites.get({ siteId: '' }); +``` diff --git a/docs/examples/sites/list-deployments.md b/docs/examples/sites/list-deployments.md index 4684938b..1b544a0a 100644 --- a/docs/examples/sites/list-deployments.md +++ b/docs/examples/sites/list-deployments.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await sites.listDeployments({ search: '', // optional total: false // optional }); +``` diff --git a/docs/examples/sites/list-frameworks.md b/docs/examples/sites/list-frameworks.md index 0376e4b5..9a417bfd 100644 --- a/docs/examples/sites/list-frameworks.md +++ b/docs/examples/sites/list-frameworks.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -8,3 +9,4 @@ const client = new sdk.Client() const sites = new sdk.Sites(client); const result = await sites.listFrameworks(); +``` diff --git a/docs/examples/sites/list-logs.md b/docs/examples/sites/list-logs.md index 09791a4a..62b16945 100644 --- a/docs/examples/sites/list-logs.md +++ b/docs/examples/sites/list-logs.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await sites.listLogs({ queries: [], // optional total: false // optional }); +``` diff --git a/docs/examples/sites/list-specifications.md b/docs/examples/sites/list-specifications.md index 24ec74c4..6e882891 100644 --- a/docs/examples/sites/list-specifications.md +++ b/docs/examples/sites/list-specifications.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -8,3 +9,4 @@ const client = new sdk.Client() const sites = new sdk.Sites(client); const result = await sites.listSpecifications(); +``` diff --git a/docs/examples/sites/list-variables.md b/docs/examples/sites/list-variables.md index 498584ee..0451b1eb 100644 --- a/docs/examples/sites/list-variables.md +++ b/docs/examples/sites/list-variables.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const sites = new sdk.Sites(client); const result = await sites.listVariables({ siteId: '' }); +``` diff --git a/docs/examples/sites/list.md b/docs/examples/sites/list.md index 7066ca98..518aa709 100644 --- a/docs/examples/sites/list.md +++ b/docs/examples/sites/list.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await sites.list({ search: '', // optional total: false // optional }); +``` diff --git a/docs/examples/sites/update-deployment-status.md b/docs/examples/sites/update-deployment-status.md index 88d55b0d..73a74758 100644 --- a/docs/examples/sites/update-deployment-status.md +++ b/docs/examples/sites/update-deployment-status.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await sites.updateDeploymentStatus({ siteId: '', deploymentId: '' }); +``` diff --git a/docs/examples/sites/update-site-deployment.md b/docs/examples/sites/update-site-deployment.md index bb3adc43..1221d370 100644 --- a/docs/examples/sites/update-site-deployment.md +++ b/docs/examples/sites/update-site-deployment.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await sites.updateSiteDeployment({ siteId: '', deploymentId: '' }); +``` diff --git a/docs/examples/sites/update-variable.md b/docs/examples/sites/update-variable.md index a7e3f6a1..40a98106 100644 --- a/docs/examples/sites/update-variable.md +++ b/docs/examples/sites/update-variable.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -14,3 +15,4 @@ const result = await sites.updateVariable({ value: '', // optional secret: false // optional }); +``` diff --git a/docs/examples/sites/update.md b/docs/examples/sites/update.md index 1a919f5d..28f2e80f 100644 --- a/docs/examples/sites/update.md +++ b/docs/examples/sites/update.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -27,3 +28,4 @@ const result = await sites.update({ providerRootDirectory: '', // optional specification: '' // optional }); +``` diff --git a/docs/examples/storage/create-bucket.md b/docs/examples/storage/create-bucket.md index 7ef4befc..47dc8b31 100644 --- a/docs/examples/storage/create-bucket.md +++ b/docs/examples/storage/create-bucket.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -20,3 +21,4 @@ const result = await storage.createBucket({ antivirus: false, // optional transformations: false // optional }); +``` diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index 8dc17455..055e5ab5 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const fs = require('fs'); @@ -14,3 +15,4 @@ const result = await storage.createFile({ file: InputFile.fromPath('/path/to/file', 'filename'), permissions: [sdk.Permission.read(sdk.Role.any())] // optional }); +``` diff --git a/docs/examples/storage/delete-bucket.md b/docs/examples/storage/delete-bucket.md index a59844dd..bf6fa1b6 100644 --- a/docs/examples/storage/delete-bucket.md +++ b/docs/examples/storage/delete-bucket.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const storage = new sdk.Storage(client); const result = await storage.deleteBucket({ bucketId: '' }); +``` diff --git a/docs/examples/storage/delete-file.md b/docs/examples/storage/delete-file.md index d973b5a5..d49838e1 100644 --- a/docs/examples/storage/delete-file.md +++ b/docs/examples/storage/delete-file.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await storage.deleteFile({ bucketId: '', fileId: '' }); +``` diff --git a/docs/examples/storage/get-bucket.md b/docs/examples/storage/get-bucket.md index 2dd16cc1..380db535 100644 --- a/docs/examples/storage/get-bucket.md +++ b/docs/examples/storage/get-bucket.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const storage = new sdk.Storage(client); const result = await storage.getBucket({ bucketId: '' }); +``` diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md index 253e6385..c0a10d96 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await storage.getFileDownload({ fileId: '', token: '' // optional }); +``` diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index d188e0d8..984333db 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -23,3 +24,4 @@ const result = await storage.getFilePreview({ output: sdk.ImageFormat.Jpg, // optional token: '' // optional }); +``` diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md index 35c6ba22..a20c4ac2 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await storage.getFileView({ fileId: '', token: '' // optional }); +``` diff --git a/docs/examples/storage/get-file.md b/docs/examples/storage/get-file.md index a6c54c86..d8bdf4dd 100644 --- a/docs/examples/storage/get-file.md +++ b/docs/examples/storage/get-file.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await storage.getFile({ bucketId: '', fileId: '' }); +``` diff --git a/docs/examples/storage/list-buckets.md b/docs/examples/storage/list-buckets.md index 1ddc3daa..c17389e5 100644 --- a/docs/examples/storage/list-buckets.md +++ b/docs/examples/storage/list-buckets.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await storage.listBuckets({ search: '', // optional total: false // optional }); +``` diff --git a/docs/examples/storage/list-files.md b/docs/examples/storage/list-files.md index a8e8480e..f51fad9d 100644 --- a/docs/examples/storage/list-files.md +++ b/docs/examples/storage/list-files.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await storage.listFiles({ search: '', // optional total: false // optional }); +``` diff --git a/docs/examples/storage/update-bucket.md b/docs/examples/storage/update-bucket.md index d528a779..c17c9691 100644 --- a/docs/examples/storage/update-bucket.md +++ b/docs/examples/storage/update-bucket.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -20,3 +21,4 @@ const result = await storage.updateBucket({ antivirus: false, // optional transformations: false // optional }); +``` diff --git a/docs/examples/storage/update-file.md b/docs/examples/storage/update-file.md index 13168213..8d2294ff 100644 --- a/docs/examples/storage/update-file.md +++ b/docs/examples/storage/update-file.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await storage.updateFile({ name: '', // optional permissions: [sdk.Permission.read(sdk.Role.any())] // optional }); +``` diff --git a/docs/examples/tablesdb/create-boolean-column.md b/docs/examples/tablesdb/create-boolean-column.md index 129e646a..2bbb32ad 100644 --- a/docs/examples/tablesdb/create-boolean-column.md +++ b/docs/examples/tablesdb/create-boolean-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await tablesDB.createBooleanColumn({ default: false, // optional array: false // optional }); +``` diff --git a/docs/examples/tablesdb/create-datetime-column.md b/docs/examples/tablesdb/create-datetime-column.md index dcc6c1ed..4aedd362 100644 --- a/docs/examples/tablesdb/create-datetime-column.md +++ b/docs/examples/tablesdb/create-datetime-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await tablesDB.createDatetimeColumn({ default: '', // optional array: false // optional }); +``` diff --git a/docs/examples/tablesdb/create-email-column.md b/docs/examples/tablesdb/create-email-column.md index a250d4a9..873d86f2 100644 --- a/docs/examples/tablesdb/create-email-column.md +++ b/docs/examples/tablesdb/create-email-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await tablesDB.createEmailColumn({ default: 'email@example.com', // optional array: false // optional }); +``` diff --git a/docs/examples/tablesdb/create-enum-column.md b/docs/examples/tablesdb/create-enum-column.md index f1e18308..3aedee72 100644 --- a/docs/examples/tablesdb/create-enum-column.md +++ b/docs/examples/tablesdb/create-enum-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -16,3 +17,4 @@ const result = await tablesDB.createEnumColumn({ default: '', // optional array: false // optional }); +``` diff --git a/docs/examples/tablesdb/create-float-column.md b/docs/examples/tablesdb/create-float-column.md index 6dd4dfcf..84649b79 100644 --- a/docs/examples/tablesdb/create-float-column.md +++ b/docs/examples/tablesdb/create-float-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -17,3 +18,4 @@ const result = await tablesDB.createFloatColumn({ default: null, // optional array: false // optional }); +``` diff --git a/docs/examples/tablesdb/create-index.md b/docs/examples/tablesdb/create-index.md index ca459221..989110f2 100644 --- a/docs/examples/tablesdb/create-index.md +++ b/docs/examples/tablesdb/create-index.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -16,3 +17,4 @@ const result = await tablesDB.createIndex({ orders: [sdk.OrderBy.Asc], // optional lengths: [] // optional }); +``` diff --git a/docs/examples/tablesdb/create-integer-column.md b/docs/examples/tablesdb/create-integer-column.md index b682db47..e7dd69db 100644 --- a/docs/examples/tablesdb/create-integer-column.md +++ b/docs/examples/tablesdb/create-integer-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -17,3 +18,4 @@ const result = await tablesDB.createIntegerColumn({ default: null, // optional array: false // optional }); +``` diff --git a/docs/examples/tablesdb/create-ip-column.md b/docs/examples/tablesdb/create-ip-column.md index eaeb64aa..eacbd4b8 100644 --- a/docs/examples/tablesdb/create-ip-column.md +++ b/docs/examples/tablesdb/create-ip-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await tablesDB.createIpColumn({ default: '', // optional array: false // optional }); +``` diff --git a/docs/examples/tablesdb/create-line-column.md b/docs/examples/tablesdb/create-line-column.md index 84b941c3..195bf1f1 100644 --- a/docs/examples/tablesdb/create-line-column.md +++ b/docs/examples/tablesdb/create-line-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -14,3 +15,4 @@ const result = await tablesDB.createLineColumn({ required: false, default: [[1, 2], [3, 4], [5, 6]] // optional }); +``` diff --git a/docs/examples/tablesdb/create-longtext-column.md b/docs/examples/tablesdb/create-longtext-column.md index fd16d70e..68e4d7b8 100644 --- a/docs/examples/tablesdb/create-longtext-column.md +++ b/docs/examples/tablesdb/create-longtext-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await tablesDB.createLongtextColumn({ default: '', // optional array: false // optional }); +``` diff --git a/docs/examples/tablesdb/create-mediumtext-column.md b/docs/examples/tablesdb/create-mediumtext-column.md index 109db51c..ac8108d3 100644 --- a/docs/examples/tablesdb/create-mediumtext-column.md +++ b/docs/examples/tablesdb/create-mediumtext-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await tablesDB.createMediumtextColumn({ default: '', // optional array: false // optional }); +``` diff --git a/docs/examples/tablesdb/create-operations.md b/docs/examples/tablesdb/create-operations.md index 25492396..d1823aa8 100644 --- a/docs/examples/tablesdb/create-operations.md +++ b/docs/examples/tablesdb/create-operations.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -21,3 +22,4 @@ const result = await tablesDB.createOperations({ } ] // optional }); +``` diff --git a/docs/examples/tablesdb/create-point-column.md b/docs/examples/tablesdb/create-point-column.md index c59e420e..a7d97ede 100644 --- a/docs/examples/tablesdb/create-point-column.md +++ b/docs/examples/tablesdb/create-point-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -14,3 +15,4 @@ const result = await tablesDB.createPointColumn({ required: false, default: [1, 2] // optional }); +``` diff --git a/docs/examples/tablesdb/create-polygon-column.md b/docs/examples/tablesdb/create-polygon-column.md index 36f2f4ca..5dc84d79 100644 --- a/docs/examples/tablesdb/create-polygon-column.md +++ b/docs/examples/tablesdb/create-polygon-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -14,3 +15,4 @@ const result = await tablesDB.createPolygonColumn({ required: false, default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional }); +``` diff --git a/docs/examples/tablesdb/create-relationship-column.md b/docs/examples/tablesdb/create-relationship-column.md index 09ebd96e..6f2c0fa9 100644 --- a/docs/examples/tablesdb/create-relationship-column.md +++ b/docs/examples/tablesdb/create-relationship-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -17,3 +18,4 @@ const result = await tablesDB.createRelationshipColumn({ twoWayKey: '', // optional onDelete: sdk.RelationMutate.Cascade // optional }); +``` diff --git a/docs/examples/tablesdb/create-row.md b/docs/examples/tablesdb/create-row.md index d437501b..485afcde 100644 --- a/docs/examples/tablesdb/create-row.md +++ b/docs/examples/tablesdb/create-row.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -21,3 +22,4 @@ const result = await tablesDB.createRow({ permissions: [sdk.Permission.read(sdk.Role.any())], // optional transactionId: '' // optional }); +``` diff --git a/docs/examples/tablesdb/create-rows.md b/docs/examples/tablesdb/create-rows.md index 20807c16..05364214 100644 --- a/docs/examples/tablesdb/create-rows.md +++ b/docs/examples/tablesdb/create-rows.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await tablesDB.createRows({ rows: [], transactionId: '' // optional }); +``` diff --git a/docs/examples/tablesdb/create-string-column.md b/docs/examples/tablesdb/create-string-column.md index dbe06329..cd795740 100644 --- a/docs/examples/tablesdb/create-string-column.md +++ b/docs/examples/tablesdb/create-string-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -17,3 +18,4 @@ const result = await tablesDB.createStringColumn({ array: false, // optional encrypt: false // optional }); +``` diff --git a/docs/examples/tablesdb/create-table.md b/docs/examples/tablesdb/create-table.md index 120f5de8..b429f797 100644 --- a/docs/examples/tablesdb/create-table.md +++ b/docs/examples/tablesdb/create-table.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -17,3 +18,4 @@ const result = await tablesDB.createTable({ columns: [], // optional indexes: [] // optional }); +``` diff --git a/docs/examples/tablesdb/create-text-column.md b/docs/examples/tablesdb/create-text-column.md index a1d0ca89..e7cfa7bc 100644 --- a/docs/examples/tablesdb/create-text-column.md +++ b/docs/examples/tablesdb/create-text-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await tablesDB.createTextColumn({ default: '', // optional array: false // optional }); +``` diff --git a/docs/examples/tablesdb/create-transaction.md b/docs/examples/tablesdb/create-transaction.md index 249406e3..c737347f 100644 --- a/docs/examples/tablesdb/create-transaction.md +++ b/docs/examples/tablesdb/create-transaction.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const tablesDB = new sdk.TablesDB(client); const result = await tablesDB.createTransaction({ ttl: 60 // optional }); +``` diff --git a/docs/examples/tablesdb/create-url-column.md b/docs/examples/tablesdb/create-url-column.md index a37424e7..d511362a 100644 --- a/docs/examples/tablesdb/create-url-column.md +++ b/docs/examples/tablesdb/create-url-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await tablesDB.createUrlColumn({ default: 'https://example.com', // optional array: false // optional }); +``` diff --git a/docs/examples/tablesdb/create-varchar-column.md b/docs/examples/tablesdb/create-varchar-column.md index 34ccacd1..debd75d8 100644 --- a/docs/examples/tablesdb/create-varchar-column.md +++ b/docs/examples/tablesdb/create-varchar-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -16,3 +17,4 @@ const result = await tablesDB.createVarcharColumn({ default: '', // optional array: false // optional }); +``` diff --git a/docs/examples/tablesdb/create.md b/docs/examples/tablesdb/create.md index a16191d4..0571906c 100644 --- a/docs/examples/tablesdb/create.md +++ b/docs/examples/tablesdb/create.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await tablesDB.create({ name: '', enabled: false // optional }); +``` diff --git a/docs/examples/tablesdb/decrement-row-column.md b/docs/examples/tablesdb/decrement-row-column.md index 03103992..2fafbbbf 100644 --- a/docs/examples/tablesdb/decrement-row-column.md +++ b/docs/examples/tablesdb/decrement-row-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -16,3 +17,4 @@ const result = await tablesDB.decrementRowColumn({ min: null, // optional transactionId: '' // optional }); +``` diff --git a/docs/examples/tablesdb/delete-column.md b/docs/examples/tablesdb/delete-column.md index 890393a2..51fd96e3 100644 --- a/docs/examples/tablesdb/delete-column.md +++ b/docs/examples/tablesdb/delete-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await tablesDB.deleteColumn({ tableId: '', key: '' }); +``` diff --git a/docs/examples/tablesdb/delete-index.md b/docs/examples/tablesdb/delete-index.md index 472b5de8..4c7ad1ee 100644 --- a/docs/examples/tablesdb/delete-index.md +++ b/docs/examples/tablesdb/delete-index.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await tablesDB.deleteIndex({ tableId: '', key: '' }); +``` diff --git a/docs/examples/tablesdb/delete-row.md b/docs/examples/tablesdb/delete-row.md index 68a965dc..20d4e95b 100644 --- a/docs/examples/tablesdb/delete-row.md +++ b/docs/examples/tablesdb/delete-row.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await tablesDB.deleteRow({ rowId: '', transactionId: '' // optional }); +``` diff --git a/docs/examples/tablesdb/delete-rows.md b/docs/examples/tablesdb/delete-rows.md index ce1d0f4b..3dd8f1e0 100644 --- a/docs/examples/tablesdb/delete-rows.md +++ b/docs/examples/tablesdb/delete-rows.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await tablesDB.deleteRows({ queries: [], // optional transactionId: '' // optional }); +``` diff --git a/docs/examples/tablesdb/delete-table.md b/docs/examples/tablesdb/delete-table.md index 3c526e5d..f3071a45 100644 --- a/docs/examples/tablesdb/delete-table.md +++ b/docs/examples/tablesdb/delete-table.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await tablesDB.deleteTable({ databaseId: '', tableId: '' }); +``` diff --git a/docs/examples/tablesdb/delete-transaction.md b/docs/examples/tablesdb/delete-transaction.md index 28d086b9..3daa0bd6 100644 --- a/docs/examples/tablesdb/delete-transaction.md +++ b/docs/examples/tablesdb/delete-transaction.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const tablesDB = new sdk.TablesDB(client); const result = await tablesDB.deleteTransaction({ transactionId: '' }); +``` diff --git a/docs/examples/tablesdb/delete.md b/docs/examples/tablesdb/delete.md index 351a40f5..018b3a9c 100644 --- a/docs/examples/tablesdb/delete.md +++ b/docs/examples/tablesdb/delete.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const tablesDB = new sdk.TablesDB(client); const result = await tablesDB.delete({ databaseId: '' }); +``` diff --git a/docs/examples/tablesdb/get-column.md b/docs/examples/tablesdb/get-column.md index 66bde581..8daf93d4 100644 --- a/docs/examples/tablesdb/get-column.md +++ b/docs/examples/tablesdb/get-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await tablesDB.getColumn({ tableId: '', key: '' }); +``` diff --git a/docs/examples/tablesdb/get-index.md b/docs/examples/tablesdb/get-index.md index 6dfa7320..164f833e 100644 --- a/docs/examples/tablesdb/get-index.md +++ b/docs/examples/tablesdb/get-index.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await tablesDB.getIndex({ tableId: '', key: '' }); +``` diff --git a/docs/examples/tablesdb/get-row.md b/docs/examples/tablesdb/get-row.md index fe67e2fd..6cbf26f0 100644 --- a/docs/examples/tablesdb/get-row.md +++ b/docs/examples/tablesdb/get-row.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -14,3 +15,4 @@ const result = await tablesDB.getRow({ queries: [], // optional transactionId: '' // optional }); +``` diff --git a/docs/examples/tablesdb/get-table.md b/docs/examples/tablesdb/get-table.md index 6d14204d..e8254356 100644 --- a/docs/examples/tablesdb/get-table.md +++ b/docs/examples/tablesdb/get-table.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await tablesDB.getTable({ databaseId: '', tableId: '' }); +``` diff --git a/docs/examples/tablesdb/get-transaction.md b/docs/examples/tablesdb/get-transaction.md index 208368bc..c39cfe11 100644 --- a/docs/examples/tablesdb/get-transaction.md +++ b/docs/examples/tablesdb/get-transaction.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const tablesDB = new sdk.TablesDB(client); const result = await tablesDB.getTransaction({ transactionId: '' }); +``` diff --git a/docs/examples/tablesdb/get.md b/docs/examples/tablesdb/get.md index 13729661..38d5ce7a 100644 --- a/docs/examples/tablesdb/get.md +++ b/docs/examples/tablesdb/get.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const tablesDB = new sdk.TablesDB(client); const result = await tablesDB.get({ databaseId: '' }); +``` diff --git a/docs/examples/tablesdb/increment-row-column.md b/docs/examples/tablesdb/increment-row-column.md index aaa6cd62..1388043a 100644 --- a/docs/examples/tablesdb/increment-row-column.md +++ b/docs/examples/tablesdb/increment-row-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -16,3 +17,4 @@ const result = await tablesDB.incrementRowColumn({ max: null, // optional transactionId: '' // optional }); +``` diff --git a/docs/examples/tablesdb/list-columns.md b/docs/examples/tablesdb/list-columns.md index 8f6c66be..59b2bfbf 100644 --- a/docs/examples/tablesdb/list-columns.md +++ b/docs/examples/tablesdb/list-columns.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await tablesDB.listColumns({ queries: [], // optional total: false // optional }); +``` diff --git a/docs/examples/tablesdb/list-indexes.md b/docs/examples/tablesdb/list-indexes.md index 7d8ab895..7ff6df55 100644 --- a/docs/examples/tablesdb/list-indexes.md +++ b/docs/examples/tablesdb/list-indexes.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await tablesDB.listIndexes({ queries: [], // optional total: false // optional }); +``` diff --git a/docs/examples/tablesdb/list-rows.md b/docs/examples/tablesdb/list-rows.md index ed4fab21..1f6894b3 100644 --- a/docs/examples/tablesdb/list-rows.md +++ b/docs/examples/tablesdb/list-rows.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -14,3 +15,4 @@ const result = await tablesDB.listRows({ transactionId: '', // optional total: false // optional }); +``` diff --git a/docs/examples/tablesdb/list-tables.md b/docs/examples/tablesdb/list-tables.md index 602b41db..82779015 100644 --- a/docs/examples/tablesdb/list-tables.md +++ b/docs/examples/tablesdb/list-tables.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await tablesDB.listTables({ search: '', // optional total: false // optional }); +``` diff --git a/docs/examples/tablesdb/list-transactions.md b/docs/examples/tablesdb/list-transactions.md index 3ad0c954..892bd288 100644 --- a/docs/examples/tablesdb/list-transactions.md +++ b/docs/examples/tablesdb/list-transactions.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const tablesDB = new sdk.TablesDB(client); const result = await tablesDB.listTransactions({ queries: [] // optional }); +``` diff --git a/docs/examples/tablesdb/list.md b/docs/examples/tablesdb/list.md index 1b3fce7a..3514e2dc 100644 --- a/docs/examples/tablesdb/list.md +++ b/docs/examples/tablesdb/list.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await tablesDB.list({ search: '', // optional total: false // optional }); +``` diff --git a/docs/examples/tablesdb/update-boolean-column.md b/docs/examples/tablesdb/update-boolean-column.md index aa1d5239..6b61889b 100644 --- a/docs/examples/tablesdb/update-boolean-column.md +++ b/docs/examples/tablesdb/update-boolean-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await tablesDB.updateBooleanColumn({ default: false, newKey: '' // optional }); +``` diff --git a/docs/examples/tablesdb/update-datetime-column.md b/docs/examples/tablesdb/update-datetime-column.md index 10badccd..f1fb75e8 100644 --- a/docs/examples/tablesdb/update-datetime-column.md +++ b/docs/examples/tablesdb/update-datetime-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await tablesDB.updateDatetimeColumn({ default: '', newKey: '' // optional }); +``` diff --git a/docs/examples/tablesdb/update-email-column.md b/docs/examples/tablesdb/update-email-column.md index ff404722..9d380636 100644 --- a/docs/examples/tablesdb/update-email-column.md +++ b/docs/examples/tablesdb/update-email-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await tablesDB.updateEmailColumn({ default: 'email@example.com', newKey: '' // optional }); +``` diff --git a/docs/examples/tablesdb/update-enum-column.md b/docs/examples/tablesdb/update-enum-column.md index ccc70b11..b35e3c8a 100644 --- a/docs/examples/tablesdb/update-enum-column.md +++ b/docs/examples/tablesdb/update-enum-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -16,3 +17,4 @@ const result = await tablesDB.updateEnumColumn({ default: '', newKey: '' // optional }); +``` diff --git a/docs/examples/tablesdb/update-float-column.md b/docs/examples/tablesdb/update-float-column.md index 73add7d5..0fca144e 100644 --- a/docs/examples/tablesdb/update-float-column.md +++ b/docs/examples/tablesdb/update-float-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -17,3 +18,4 @@ const result = await tablesDB.updateFloatColumn({ max: null, // optional newKey: '' // optional }); +``` diff --git a/docs/examples/tablesdb/update-integer-column.md b/docs/examples/tablesdb/update-integer-column.md index 18cceb05..54f874f8 100644 --- a/docs/examples/tablesdb/update-integer-column.md +++ b/docs/examples/tablesdb/update-integer-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -17,3 +18,4 @@ const result = await tablesDB.updateIntegerColumn({ max: null, // optional newKey: '' // optional }); +``` diff --git a/docs/examples/tablesdb/update-ip-column.md b/docs/examples/tablesdb/update-ip-column.md index c0313d12..56b1962a 100644 --- a/docs/examples/tablesdb/update-ip-column.md +++ b/docs/examples/tablesdb/update-ip-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await tablesDB.updateIpColumn({ default: '', newKey: '' // optional }); +``` diff --git a/docs/examples/tablesdb/update-line-column.md b/docs/examples/tablesdb/update-line-column.md index 4ec0abe5..98bc6ad5 100644 --- a/docs/examples/tablesdb/update-line-column.md +++ b/docs/examples/tablesdb/update-line-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await tablesDB.updateLineColumn({ default: [[1, 2], [3, 4], [5, 6]], // optional newKey: '' // optional }); +``` diff --git a/docs/examples/tablesdb/update-longtext-column.md b/docs/examples/tablesdb/update-longtext-column.md index 9888bbae..90bf4679 100644 --- a/docs/examples/tablesdb/update-longtext-column.md +++ b/docs/examples/tablesdb/update-longtext-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await tablesDB.updateLongtextColumn({ default: '', newKey: '' // optional }); +``` diff --git a/docs/examples/tablesdb/update-mediumtext-column.md b/docs/examples/tablesdb/update-mediumtext-column.md index 84befdd0..8dc2cdd5 100644 --- a/docs/examples/tablesdb/update-mediumtext-column.md +++ b/docs/examples/tablesdb/update-mediumtext-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await tablesDB.updateMediumtextColumn({ default: '', newKey: '' // optional }); +``` diff --git a/docs/examples/tablesdb/update-point-column.md b/docs/examples/tablesdb/update-point-column.md index cddb1989..05cbc3df 100644 --- a/docs/examples/tablesdb/update-point-column.md +++ b/docs/examples/tablesdb/update-point-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await tablesDB.updatePointColumn({ default: [1, 2], // optional newKey: '' // optional }); +``` diff --git a/docs/examples/tablesdb/update-polygon-column.md b/docs/examples/tablesdb/update-polygon-column.md index 963db8ba..80f97f1b 100644 --- a/docs/examples/tablesdb/update-polygon-column.md +++ b/docs/examples/tablesdb/update-polygon-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await tablesDB.updatePolygonColumn({ default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional newKey: '' // optional }); +``` diff --git a/docs/examples/tablesdb/update-relationship-column.md b/docs/examples/tablesdb/update-relationship-column.md index a91b4798..86f935a5 100644 --- a/docs/examples/tablesdb/update-relationship-column.md +++ b/docs/examples/tablesdb/update-relationship-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -14,3 +15,4 @@ const result = await tablesDB.updateRelationshipColumn({ onDelete: sdk.RelationMutate.Cascade, // optional newKey: '' // optional }); +``` diff --git a/docs/examples/tablesdb/update-row.md b/docs/examples/tablesdb/update-row.md index 8c003bfe..bac92af2 100644 --- a/docs/examples/tablesdb/update-row.md +++ b/docs/examples/tablesdb/update-row.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -21,3 +22,4 @@ const result = await tablesDB.updateRow({ permissions: [sdk.Permission.read(sdk.Role.any())], // optional transactionId: '' // optional }); +``` diff --git a/docs/examples/tablesdb/update-rows.md b/docs/examples/tablesdb/update-rows.md index b41f0c2e..09ab8601 100644 --- a/docs/examples/tablesdb/update-rows.md +++ b/docs/examples/tablesdb/update-rows.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -20,3 +21,4 @@ const result = await tablesDB.updateRows({ queries: [], // optional transactionId: '' // optional }); +``` diff --git a/docs/examples/tablesdb/update-string-column.md b/docs/examples/tablesdb/update-string-column.md index f30614e8..590dc84f 100644 --- a/docs/examples/tablesdb/update-string-column.md +++ b/docs/examples/tablesdb/update-string-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -16,3 +17,4 @@ const result = await tablesDB.updateStringColumn({ size: 1, // optional newKey: '' // optional }); +``` diff --git a/docs/examples/tablesdb/update-table.md b/docs/examples/tablesdb/update-table.md index 7a650b82..f698a398 100644 --- a/docs/examples/tablesdb/update-table.md +++ b/docs/examples/tablesdb/update-table.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await tablesDB.updateTable({ rowSecurity: false, // optional enabled: false // optional }); +``` diff --git a/docs/examples/tablesdb/update-text-column.md b/docs/examples/tablesdb/update-text-column.md index 0324b9cd..1a6a1513 100644 --- a/docs/examples/tablesdb/update-text-column.md +++ b/docs/examples/tablesdb/update-text-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await tablesDB.updateTextColumn({ default: '', newKey: '' // optional }); +``` diff --git a/docs/examples/tablesdb/update-transaction.md b/docs/examples/tablesdb/update-transaction.md index 03501d2c..d0607478 100644 --- a/docs/examples/tablesdb/update-transaction.md +++ b/docs/examples/tablesdb/update-transaction.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await tablesDB.updateTransaction({ commit: false, // optional rollback: false // optional }); +``` diff --git a/docs/examples/tablesdb/update-url-column.md b/docs/examples/tablesdb/update-url-column.md index cb2440a9..e5797619 100644 --- a/docs/examples/tablesdb/update-url-column.md +++ b/docs/examples/tablesdb/update-url-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await tablesDB.updateUrlColumn({ default: 'https://example.com', newKey: '' // optional }); +``` diff --git a/docs/examples/tablesdb/update-varchar-column.md b/docs/examples/tablesdb/update-varchar-column.md index 7dd2a1a6..1e118dcd 100644 --- a/docs/examples/tablesdb/update-varchar-column.md +++ b/docs/examples/tablesdb/update-varchar-column.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -16,3 +17,4 @@ const result = await tablesDB.updateVarcharColumn({ size: 1, // optional newKey: '' // optional }); +``` diff --git a/docs/examples/tablesdb/update.md b/docs/examples/tablesdb/update.md index bc7f53e0..7cbf6f58 100644 --- a/docs/examples/tablesdb/update.md +++ b/docs/examples/tablesdb/update.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await tablesDB.update({ name: '', // optional enabled: false // optional }); +``` diff --git a/docs/examples/tablesdb/upsert-row.md b/docs/examples/tablesdb/upsert-row.md index 2905b31f..f544bc06 100644 --- a/docs/examples/tablesdb/upsert-row.md +++ b/docs/examples/tablesdb/upsert-row.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -21,3 +22,4 @@ const result = await tablesDB.upsertRow({ permissions: [sdk.Permission.read(sdk.Role.any())], // optional transactionId: '' // optional }); +``` diff --git a/docs/examples/tablesdb/upsert-rows.md b/docs/examples/tablesdb/upsert-rows.md index c985c951..7bbf2ed3 100644 --- a/docs/examples/tablesdb/upsert-rows.md +++ b/docs/examples/tablesdb/upsert-rows.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await tablesDB.upsertRows({ rows: [], transactionId: '' // optional }); +``` diff --git a/docs/examples/teams/create-membership.md b/docs/examples/teams/create-membership.md index f820002e..910bb757 100644 --- a/docs/examples/teams/create-membership.md +++ b/docs/examples/teams/create-membership.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -9,10 +10,11 @@ const teams = new sdk.Teams(client); const result = await teams.createMembership({ teamId: '', - roles: [sdk.Roles.Admin], + roles: [], email: 'email@example.com', // optional userId: '', // optional phone: '+12065550100', // optional url: 'https://example.com', // optional name: '' // optional }); +``` diff --git a/docs/examples/teams/create.md b/docs/examples/teams/create.md index 8b1bd1d7..8e5702b2 100644 --- a/docs/examples/teams/create.md +++ b/docs/examples/teams/create.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await teams.create({ name: '', roles: [] // optional }); +``` diff --git a/docs/examples/teams/delete-membership.md b/docs/examples/teams/delete-membership.md index 6fe59123..7dd11603 100644 --- a/docs/examples/teams/delete-membership.md +++ b/docs/examples/teams/delete-membership.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await teams.deleteMembership({ teamId: '', membershipId: '' }); +``` diff --git a/docs/examples/teams/delete.md b/docs/examples/teams/delete.md index ebccae91..8593956f 100644 --- a/docs/examples/teams/delete.md +++ b/docs/examples/teams/delete.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const teams = new sdk.Teams(client); const result = await teams.delete({ teamId: '' }); +``` diff --git a/docs/examples/teams/get-membership.md b/docs/examples/teams/get-membership.md index a8deb551..4ecf078d 100644 --- a/docs/examples/teams/get-membership.md +++ b/docs/examples/teams/get-membership.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await teams.getMembership({ teamId: '', membershipId: '' }); +``` diff --git a/docs/examples/teams/get-prefs.md b/docs/examples/teams/get-prefs.md index bf9d7220..0238bdba 100644 --- a/docs/examples/teams/get-prefs.md +++ b/docs/examples/teams/get-prefs.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const teams = new sdk.Teams(client); const result = await teams.getPrefs({ teamId: '' }); +``` diff --git a/docs/examples/teams/get.md b/docs/examples/teams/get.md index 2f4cc115..bd01c5c5 100644 --- a/docs/examples/teams/get.md +++ b/docs/examples/teams/get.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const teams = new sdk.Teams(client); const result = await teams.get({ teamId: '' }); +``` diff --git a/docs/examples/teams/list-memberships.md b/docs/examples/teams/list-memberships.md index 228c9972..1185380b 100644 --- a/docs/examples/teams/list-memberships.md +++ b/docs/examples/teams/list-memberships.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await teams.listMemberships({ search: '', // optional total: false // optional }); +``` diff --git a/docs/examples/teams/list.md b/docs/examples/teams/list.md index 1d1b7147..b4525fba 100644 --- a/docs/examples/teams/list.md +++ b/docs/examples/teams/list.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await teams.list({ search: '', // optional total: false // optional }); +``` diff --git a/docs/examples/teams/update-membership-status.md b/docs/examples/teams/update-membership-status.md index f3b8ba2a..614737ec 100644 --- a/docs/examples/teams/update-membership-status.md +++ b/docs/examples/teams/update-membership-status.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await teams.updateMembershipStatus({ userId: '', secret: '' }); +``` diff --git a/docs/examples/teams/update-membership.md b/docs/examples/teams/update-membership.md index 64f15aef..95a5c375 100644 --- a/docs/examples/teams/update-membership.md +++ b/docs/examples/teams/update-membership.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,5 +11,6 @@ const teams = new sdk.Teams(client); const result = await teams.updateMembership({ teamId: '', membershipId: '', - roles: [sdk.Roles.Admin] + roles: [] }); +``` diff --git a/docs/examples/teams/update-name.md b/docs/examples/teams/update-name.md index aaad80f9..0c64d2ba 100644 --- a/docs/examples/teams/update-name.md +++ b/docs/examples/teams/update-name.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await teams.updateName({ teamId: '', name: '' }); +``` diff --git a/docs/examples/teams/update-prefs.md b/docs/examples/teams/update-prefs.md index 7f16f629..180e3224 100644 --- a/docs/examples/teams/update-prefs.md +++ b/docs/examples/teams/update-prefs.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await teams.updatePrefs({ teamId: '', prefs: {} }); +``` diff --git a/docs/examples/tokens/create-file-token.md b/docs/examples/tokens/create-file-token.md index 23537206..3be6b549 100644 --- a/docs/examples/tokens/create-file-token.md +++ b/docs/examples/tokens/create-file-token.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await tokens.createFileToken({ fileId: '', expire: '' // optional }); +``` diff --git a/docs/examples/tokens/delete.md b/docs/examples/tokens/delete.md index 659c03e5..f3b40894 100644 --- a/docs/examples/tokens/delete.md +++ b/docs/examples/tokens/delete.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const tokens = new sdk.Tokens(client); const result = await tokens.delete({ tokenId: '' }); +``` diff --git a/docs/examples/tokens/get.md b/docs/examples/tokens/get.md index 68371c32..383ea5f3 100644 --- a/docs/examples/tokens/get.md +++ b/docs/examples/tokens/get.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const tokens = new sdk.Tokens(client); const result = await tokens.get({ tokenId: '' }); +``` diff --git a/docs/examples/tokens/list.md b/docs/examples/tokens/list.md index 13699a30..13e48480 100644 --- a/docs/examples/tokens/list.md +++ b/docs/examples/tokens/list.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await tokens.list({ queries: [], // optional total: false // optional }); +``` diff --git a/docs/examples/tokens/update.md b/docs/examples/tokens/update.md index 8178dd05..c36998dd 100644 --- a/docs/examples/tokens/update.md +++ b/docs/examples/tokens/update.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await tokens.update({ tokenId: '', expire: '' // optional }); +``` diff --git a/docs/examples/users/create-argon-2-user.md b/docs/examples/users/create-argon-2-user.md index 46badb7a..4f45f7fd 100644 --- a/docs/examples/users/create-argon-2-user.md +++ b/docs/examples/users/create-argon-2-user.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await users.createArgon2User({ password: 'password', name: '' // optional }); +``` diff --git a/docs/examples/users/create-bcrypt-user.md b/docs/examples/users/create-bcrypt-user.md index 9c946328..55100412 100644 --- a/docs/examples/users/create-bcrypt-user.md +++ b/docs/examples/users/create-bcrypt-user.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await users.createBcryptUser({ password: 'password', name: '' // optional }); +``` diff --git a/docs/examples/users/create-jwt.md b/docs/examples/users/create-jwt.md index d46b9c6a..c2e6eaa4 100644 --- a/docs/examples/users/create-jwt.md +++ b/docs/examples/users/create-jwt.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await users.createJWT({ sessionId: '', // optional duration: 0 // optional }); +``` diff --git a/docs/examples/users/create-md-5-user.md b/docs/examples/users/create-md-5-user.md index c9222748..004c3b74 100644 --- a/docs/examples/users/create-md-5-user.md +++ b/docs/examples/users/create-md-5-user.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await users.createMD5User({ password: 'password', name: '' // optional }); +``` diff --git a/docs/examples/users/create-mfa-recovery-codes.md b/docs/examples/users/create-mfa-recovery-codes.md index 5ebb6ac2..2f712022 100644 --- a/docs/examples/users/create-mfa-recovery-codes.md +++ b/docs/examples/users/create-mfa-recovery-codes.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const users = new sdk.Users(client); const result = await users.createMFARecoveryCodes({ userId: '' }); +``` diff --git a/docs/examples/users/create-ph-pass-user.md b/docs/examples/users/create-ph-pass-user.md index 0a2207fc..945f7476 100644 --- a/docs/examples/users/create-ph-pass-user.md +++ b/docs/examples/users/create-ph-pass-user.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await users.createPHPassUser({ password: 'password', name: '' // optional }); +``` diff --git a/docs/examples/users/create-scrypt-modified-user.md b/docs/examples/users/create-scrypt-modified-user.md index bd30b25c..fc8a5e00 100644 --- a/docs/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/users/create-scrypt-modified-user.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -16,3 +17,4 @@ const result = await users.createScryptModifiedUser({ passwordSignerKey: '', name: '' // optional }); +``` diff --git a/docs/examples/users/create-scrypt-user.md b/docs/examples/users/create-scrypt-user.md index 76f9e2fa..e9a35358 100644 --- a/docs/examples/users/create-scrypt-user.md +++ b/docs/examples/users/create-scrypt-user.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -18,3 +19,4 @@ const result = await users.createScryptUser({ passwordLength: null, name: '' // optional }); +``` diff --git a/docs/examples/users/create-session.md b/docs/examples/users/create-session.md index 869e67f3..04e37680 100644 --- a/docs/examples/users/create-session.md +++ b/docs/examples/users/create-session.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const users = new sdk.Users(client); const result = await users.createSession({ userId: '' }); +``` diff --git a/docs/examples/users/create-sha-user.md b/docs/examples/users/create-sha-user.md index bb940be6..47c0d74b 100644 --- a/docs/examples/users/create-sha-user.md +++ b/docs/examples/users/create-sha-user.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -14,3 +15,4 @@ const result = await users.createSHAUser({ passwordVersion: sdk.PasswordHash.Sha1, // optional name: '' // optional }); +``` diff --git a/docs/examples/users/create-target.md b/docs/examples/users/create-target.md index d856f3f9..bc19f2bf 100644 --- a/docs/examples/users/create-target.md +++ b/docs/examples/users/create-target.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -15,3 +16,4 @@ const result = await users.createTarget({ providerId: '', // optional name: '' // optional }); +``` diff --git a/docs/examples/users/create-token.md b/docs/examples/users/create-token.md index 9f116920..5978df65 100644 --- a/docs/examples/users/create-token.md +++ b/docs/examples/users/create-token.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await users.createToken({ length: 4, // optional expire: 60 // optional }); +``` diff --git a/docs/examples/users/create.md b/docs/examples/users/create.md index 3095dd1b..5610f062 100644 --- a/docs/examples/users/create.md +++ b/docs/examples/users/create.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -14,3 +15,4 @@ const result = await users.create({ password: '', // optional name: '' // optional }); +``` diff --git a/docs/examples/users/delete-identity.md b/docs/examples/users/delete-identity.md index bcd0e9ef..1a730d8d 100644 --- a/docs/examples/users/delete-identity.md +++ b/docs/examples/users/delete-identity.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const users = new sdk.Users(client); const result = await users.deleteIdentity({ identityId: '' }); +``` diff --git a/docs/examples/users/delete-mfa-authenticator.md b/docs/examples/users/delete-mfa-authenticator.md index 16061c7a..a5d4e3d0 100644 --- a/docs/examples/users/delete-mfa-authenticator.md +++ b/docs/examples/users/delete-mfa-authenticator.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await users.deleteMFAAuthenticator({ userId: '', type: sdk.AuthenticatorType.Totp }); +``` diff --git a/docs/examples/users/delete-session.md b/docs/examples/users/delete-session.md index ce301fba..d39eccd0 100644 --- a/docs/examples/users/delete-session.md +++ b/docs/examples/users/delete-session.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await users.deleteSession({ userId: '', sessionId: '' }); +``` diff --git a/docs/examples/users/delete-sessions.md b/docs/examples/users/delete-sessions.md index 5495fcbc..9331435b 100644 --- a/docs/examples/users/delete-sessions.md +++ b/docs/examples/users/delete-sessions.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const users = new sdk.Users(client); const result = await users.deleteSessions({ userId: '' }); +``` diff --git a/docs/examples/users/delete-target.md b/docs/examples/users/delete-target.md index 33278f4a..3f579302 100644 --- a/docs/examples/users/delete-target.md +++ b/docs/examples/users/delete-target.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await users.deleteTarget({ userId: '', targetId: '' }); +``` diff --git a/docs/examples/users/delete.md b/docs/examples/users/delete.md index 13210442..8714dc59 100644 --- a/docs/examples/users/delete.md +++ b/docs/examples/users/delete.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const users = new sdk.Users(client); const result = await users.delete({ userId: '' }); +``` diff --git a/docs/examples/users/get-mfa-recovery-codes.md b/docs/examples/users/get-mfa-recovery-codes.md index 25f4e0b3..3e379926 100644 --- a/docs/examples/users/get-mfa-recovery-codes.md +++ b/docs/examples/users/get-mfa-recovery-codes.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const users = new sdk.Users(client); const result = await users.getMFARecoveryCodes({ userId: '' }); +``` diff --git a/docs/examples/users/get-prefs.md b/docs/examples/users/get-prefs.md index cb9d54fd..d81539e9 100644 --- a/docs/examples/users/get-prefs.md +++ b/docs/examples/users/get-prefs.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const users = new sdk.Users(client); const result = await users.getPrefs({ userId: '' }); +``` diff --git a/docs/examples/users/get-target.md b/docs/examples/users/get-target.md index 0c320bf4..97ee9647 100644 --- a/docs/examples/users/get-target.md +++ b/docs/examples/users/get-target.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await users.getTarget({ userId: '', targetId: '' }); +``` diff --git a/docs/examples/users/get.md b/docs/examples/users/get.md index 594f034e..3f86f8c9 100644 --- a/docs/examples/users/get.md +++ b/docs/examples/users/get.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const users = new sdk.Users(client); const result = await users.get({ userId: '' }); +``` diff --git a/docs/examples/users/list-identities.md b/docs/examples/users/list-identities.md index 34414b44..e25c26f4 100644 --- a/docs/examples/users/list-identities.md +++ b/docs/examples/users/list-identities.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await users.listIdentities({ search: '', // optional total: false // optional }); +``` diff --git a/docs/examples/users/list-logs.md b/docs/examples/users/list-logs.md index a768eb17..7cb97e27 100644 --- a/docs/examples/users/list-logs.md +++ b/docs/examples/users/list-logs.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await users.listLogs({ queries: [], // optional total: false // optional }); +``` diff --git a/docs/examples/users/list-memberships.md b/docs/examples/users/list-memberships.md index 9de178b1..0a758c00 100644 --- a/docs/examples/users/list-memberships.md +++ b/docs/examples/users/list-memberships.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -13,3 +14,4 @@ const result = await users.listMemberships({ search: '', // optional total: false // optional }); +``` diff --git a/docs/examples/users/list-mfa-factors.md b/docs/examples/users/list-mfa-factors.md index 79ffcff7..9272a20c 100644 --- a/docs/examples/users/list-mfa-factors.md +++ b/docs/examples/users/list-mfa-factors.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const users = new sdk.Users(client); const result = await users.listMFAFactors({ userId: '' }); +``` diff --git a/docs/examples/users/list-sessions.md b/docs/examples/users/list-sessions.md index 6f85fdd3..d941dcfb 100644 --- a/docs/examples/users/list-sessions.md +++ b/docs/examples/users/list-sessions.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await users.listSessions({ userId: '', total: false // optional }); +``` diff --git a/docs/examples/users/list-targets.md b/docs/examples/users/list-targets.md index 8fa40335..aa7be748 100644 --- a/docs/examples/users/list-targets.md +++ b/docs/examples/users/list-targets.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await users.listTargets({ queries: [], // optional total: false // optional }); +``` diff --git a/docs/examples/users/list.md b/docs/examples/users/list.md index 0148c9ed..916dabc0 100644 --- a/docs/examples/users/list.md +++ b/docs/examples/users/list.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -12,3 +13,4 @@ const result = await users.list({ search: '', // optional total: false // optional }); +``` diff --git a/docs/examples/users/update-email-verification.md b/docs/examples/users/update-email-verification.md index 14ab8fb4..7a43202d 100644 --- a/docs/examples/users/update-email-verification.md +++ b/docs/examples/users/update-email-verification.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await users.updateEmailVerification({ userId: '', emailVerification: false }); +``` diff --git a/docs/examples/users/update-email.md b/docs/examples/users/update-email.md index b8990cd1..10cf0027 100644 --- a/docs/examples/users/update-email.md +++ b/docs/examples/users/update-email.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await users.updateEmail({ userId: '', email: 'email@example.com' }); +``` diff --git a/docs/examples/users/update-labels.md b/docs/examples/users/update-labels.md index 8e6588d5..28f28931 100644 --- a/docs/examples/users/update-labels.md +++ b/docs/examples/users/update-labels.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await users.updateLabels({ userId: '', labels: [] }); +``` diff --git a/docs/examples/users/update-mfa-recovery-codes.md b/docs/examples/users/update-mfa-recovery-codes.md index 66513ae4..41fa921e 100644 --- a/docs/examples/users/update-mfa-recovery-codes.md +++ b/docs/examples/users/update-mfa-recovery-codes.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -10,3 +11,4 @@ const users = new sdk.Users(client); const result = await users.updateMFARecoveryCodes({ userId: '' }); +``` diff --git a/docs/examples/users/update-mfa.md b/docs/examples/users/update-mfa.md index f867b069..c62e10fc 100644 --- a/docs/examples/users/update-mfa.md +++ b/docs/examples/users/update-mfa.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await users.updateMFA({ userId: '', mfa: false }); +``` diff --git a/docs/examples/users/update-name.md b/docs/examples/users/update-name.md index 914f2a31..03369c9c 100644 --- a/docs/examples/users/update-name.md +++ b/docs/examples/users/update-name.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await users.updateName({ userId: '', name: '' }); +``` diff --git a/docs/examples/users/update-password.md b/docs/examples/users/update-password.md index dd32ede7..ab572ca0 100644 --- a/docs/examples/users/update-password.md +++ b/docs/examples/users/update-password.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await users.updatePassword({ userId: '', password: '' }); +``` diff --git a/docs/examples/users/update-phone-verification.md b/docs/examples/users/update-phone-verification.md index bccc61a7..4489902d 100644 --- a/docs/examples/users/update-phone-verification.md +++ b/docs/examples/users/update-phone-verification.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await users.updatePhoneVerification({ userId: '', phoneVerification: false }); +``` diff --git a/docs/examples/users/update-phone.md b/docs/examples/users/update-phone.md index de534f6f..d45d5ed0 100644 --- a/docs/examples/users/update-phone.md +++ b/docs/examples/users/update-phone.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await users.updatePhone({ userId: '', number: '+12065550100' }); +``` diff --git a/docs/examples/users/update-prefs.md b/docs/examples/users/update-prefs.md index 9b5d9d48..3bb011ae 100644 --- a/docs/examples/users/update-prefs.md +++ b/docs/examples/users/update-prefs.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await users.updatePrefs({ userId: '', prefs: {} }); +``` diff --git a/docs/examples/users/update-status.md b/docs/examples/users/update-status.md index c2220308..ec7d5bdb 100644 --- a/docs/examples/users/update-status.md +++ b/docs/examples/users/update-status.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -11,3 +12,4 @@ const result = await users.updateStatus({ userId: '', status: false }); +``` diff --git a/docs/examples/users/update-target.md b/docs/examples/users/update-target.md index e77dbb5d..d1dcf74a 100644 --- a/docs/examples/users/update-target.md +++ b/docs/examples/users/update-target.md @@ -1,3 +1,4 @@ +```javascript const sdk = require('node-appwrite'); const client = new sdk.Client() @@ -14,3 +15,4 @@ const result = await users.updateTarget({ providerId: '', // optional name: '' // optional }); +``` diff --git a/package.json b/package.json index d30899d9..8c5c8807 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "node-appwrite", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API", - "version": "22.0.0", + "version": "22.1.0", "license": "BSD-3-Clause", "main": "dist/index.js", "type": "commonjs", diff --git a/src/client.ts b/src/client.ts index 9e66d017..8413e7ef 100644 --- a/src/client.ts +++ b/src/client.ts @@ -60,7 +60,7 @@ class AppwriteException extends Error { } function getUserAgent() { - let ua = 'AppwriteNodeJSSDK/22.0.0'; + let ua = 'AppwriteNodeJSSDK/22.1.0'; // `process` is a global in Node.js, but not fully available in all runtimes. const platform: string[] = []; @@ -109,7 +109,7 @@ class Client { 'x-sdk-name': 'Node.js', 'x-sdk-platform': 'server', 'x-sdk-language': 'nodejs', - 'x-sdk-version': '22.0.0', + 'x-sdk-version': '22.1.0', 'user-agent' : getUserAgent(), 'X-Appwrite-Response-Format': '1.8.0', }; diff --git a/src/enums/backup-services.ts b/src/enums/backup-services.ts new file mode 100644 index 00000000..f0f829ab --- /dev/null +++ b/src/enums/backup-services.ts @@ -0,0 +1,5 @@ +export enum BackupServices { + Databases = 'databases', + Functions = 'functions', + Storage = 'storage', +} \ No newline at end of file diff --git a/src/enums/build-runtime.ts b/src/enums/build-runtime.ts index 25dca774..d9394ae9 100644 --- a/src/enums/build-runtime.ts +++ b/src/enums/build-runtime.ts @@ -21,9 +21,6 @@ export enum BuildRuntime { 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', @@ -38,6 +35,7 @@ export enum BuildRuntime { Dart35 = 'dart-3.5', Dart38 = 'dart-3.8', Dart39 = 'dart-3.9', + Dart310 = 'dart-3.10', Dotnet60 = 'dotnet-6.0', Dotnet70 = 'dotnet-7.0', Dotnet80 = 'dotnet-8.0', @@ -66,4 +64,5 @@ export enum BuildRuntime { Flutter329 = 'flutter-3.29', Flutter332 = 'flutter-3.32', Flutter335 = 'flutter-3.35', + Flutter338 = 'flutter-3.38', } \ No newline at end of file diff --git a/src/enums/roles.ts b/src/enums/roles.ts deleted file mode 100644 index f548f935..00000000 --- a/src/enums/roles.ts +++ /dev/null @@ -1,5 +0,0 @@ -export enum Roles { - Admin = 'admin', - Developer = 'developer', - Owner = 'owner', -} \ No newline at end of file diff --git a/src/enums/runtime.ts b/src/enums/runtime.ts index ecdc4525..3b6f9f3b 100644 --- a/src/enums/runtime.ts +++ b/src/enums/runtime.ts @@ -21,9 +21,6 @@ export enum Runtime { 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', @@ -38,6 +35,7 @@ export enum Runtime { Dart35 = 'dart-3.5', Dart38 = 'dart-3.8', Dart39 = 'dart-3.9', + Dart310 = 'dart-3.10', Dotnet60 = 'dotnet-6.0', Dotnet70 = 'dotnet-7.0', Dotnet80 = 'dotnet-8.0', @@ -66,4 +64,5 @@ export enum Runtime { Flutter329 = 'flutter-3.29', Flutter332 = 'flutter-3.32', Flutter335 = 'flutter-3.35', + Flutter338 = 'flutter-3.38', } \ No newline at end of file diff --git a/src/enums/scopes.ts b/src/enums/scopes.ts index 70ef50fc..4ac98a12 100644 --- a/src/enums/scopes.ts +++ b/src/enums/scopes.ts @@ -54,4 +54,12 @@ export enum Scopes { AssistantRead = 'assistant.read', TokensRead = 'tokens.read', TokensWrite = 'tokens.write', + PoliciesWrite = 'policies.write', + PoliciesRead = 'policies.read', + ArchivesRead = 'archives.read', + ArchivesWrite = 'archives.write', + RestorationsRead = 'restorations.read', + RestorationsWrite = 'restorations.write', + DomainsRead = 'domains.read', + DomainsWrite = 'domains.write', } \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 781f13a6..c356102b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,7 @@ export { Client, Query, AppwriteException } from './client'; export { Account } from './services/account'; export { Avatars } from './services/avatars'; +export { Backups } from './services/backups'; export { Databases } from './services/databases'; export { Functions } from './services/functions'; export { Graphql } from './services/graphql'; @@ -29,6 +30,7 @@ export { Theme } from './enums/theme'; export { Timezone } from './enums/timezone'; export { BrowserPermission } from './enums/browser-permission'; export { ImageFormat } from './enums/image-format'; +export { BackupServices } from './enums/backup-services'; export { RelationshipType } from './enums/relationship-type'; export { RelationMutate } from './enums/relation-mutate'; export { IndexType } from './enums/index-type'; @@ -47,7 +49,6 @@ export { BuildRuntime } from './enums/build-runtime'; export { Adapter } from './enums/adapter'; export { Compression } from './enums/compression'; export { ImageGravity } from './enums/image-gravity'; -export { Roles } from './enums/roles'; export { PasswordHash } from './enums/password-hash'; export { MessagingProviderType } from './enums/messaging-provider-type'; export { DatabaseType } from './enums/database-type'; diff --git a/src/models.ts b/src/models.ts index f534a0da..8f9521eb 100644 --- a/src/models.ts +++ b/src/models.ts @@ -562,6 +562,14 @@ export namespace Models { * Database type. */ type: DatabaseType; + /** + * Database backup policies. + */ + policies: Index[]; + /** + * Database backup archives. + */ + archives: Collection[]; } /** @@ -608,6 +616,14 @@ export namespace Models { * Collection indexes. */ indexes: Index[]; + /** + * Maximum document size in bytes. Returns 0 when no limit applies. + */ + bytesMax: number; + /** + * Currently used document size in bytes based on defined attributes. + */ + bytesUsed: number; } /** @@ -1449,11 +1465,19 @@ export namespace Models { /** * Table columns. */ - columns: (Models.ColumnBoolean | Models.ColumnInteger | Models.ColumnFloat | Models.ColumnEmail | Models.ColumnEnum | Models.ColumnUrl | Models.ColumnIp | Models.ColumnDatetime | Models.ColumnRelationship | Models.ColumnPoint | Models.ColumnLine | Models.ColumnPolygon | Models.ColumnString)[]; + columns: (Models.ColumnBoolean | Models.ColumnInteger | Models.ColumnFloat | Models.ColumnEmail | Models.ColumnEnum | Models.ColumnUrl | Models.ColumnIp | Models.ColumnDatetime | Models.ColumnRelationship | Models.ColumnPoint | Models.ColumnLine | Models.ColumnPolygon | Models.ColumnVarchar | Models.ColumnText | Models.ColumnMediumtext | Models.ColumnLongtext | Models.ColumnString)[]; /** * Table indexes. */ indexes: ColumnIndex[]; + /** + * Maximum row size in bytes. Returns 0 when no limit applies. + */ + bytesMax: number; + /** + * Currently used row size in bytes based on defined columns. + */ + bytesUsed: number; } /** @@ -1467,7 +1491,7 @@ export namespace Models { /** * List of columns. */ - columns: (Models.ColumnBoolean | Models.ColumnInteger | Models.ColumnFloat | Models.ColumnEmail | Models.ColumnEnum | Models.ColumnUrl | Models.ColumnIp | Models.ColumnDatetime | Models.ColumnRelationship | Models.ColumnPoint | Models.ColumnLine | Models.ColumnPolygon | Models.ColumnString)[]; + columns: (Models.ColumnBoolean | Models.ColumnInteger | Models.ColumnFloat | Models.ColumnEmail | Models.ColumnEnum | Models.ColumnUrl | Models.ColumnIp | Models.ColumnDatetime | Models.ColumnRelationship | Models.ColumnPoint | Models.ColumnLine | Models.ColumnPolygon | Models.ColumnVarchar | Models.ColumnText | Models.ColumnMediumtext | Models.ColumnLongtext | Models.ColumnString)[]; } /** @@ -4320,4 +4344,200 @@ export namespace Models { */ expired: boolean; } + + /** + * Archive + */ + export type BackupArchive = { + /** + * Archive ID. + */ + $id: string; + /** + * Archive creation time in ISO 8601 format. + */ + $createdAt: string; + /** + * Archive update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Archive policy ID. + */ + policyId: string; + /** + * Archive size in bytes. + */ + size: number; + /** + * The status of the archive creation. Possible values: pending, processing, uploading, completed, failed. + */ + status: string; + /** + * The backup start time. + */ + startedAt: string; + /** + * Migration ID. + */ + migrationId: string; + /** + * The services that are backed up by this archive. + */ + services: string[]; + /** + * The resources that are backed up by this archive. + */ + resources: string[]; + /** + * The resource ID to backup. Set only if this archive should backup a single resource. + */ + resourceId?: string; + /** + * The resource type to backup. Set only if this archive should backup a single resource. + */ + resourceType?: string; + } + + /** + * backup + */ + export type BackupPolicy = { + /** + * Backup policy ID. + */ + $id: string; + /** + * Backup policy name. + */ + name: string; + /** + * Policy creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Policy update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * The services that are backed up by this policy. + */ + services: string[]; + /** + * The resources that are backed up by this policy. + */ + resources: string[]; + /** + * The resource ID to backup. Set only if this policy should backup a single resource. + */ + resourceId?: string; + /** + * The resource type to backup. Set only if this policy should backup a single resource. + */ + resourceType?: string; + /** + * How many days to keep the backup before it will be automatically deleted. + */ + retention: number; + /** + * Policy backup schedule in CRON format. + */ + schedule: string; + /** + * Is this policy enabled. + */ + enabled: boolean; + } + + /** + * Restoration + */ + export type BackupRestoration = { + /** + * Restoration ID. + */ + $id: string; + /** + * Restoration creation time in ISO 8601 format. + */ + $createdAt: string; + /** + * Restoration update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Backup archive ID. + */ + archiveId: string; + /** + * Backup policy ID. + */ + policyId: string; + /** + * The status of the restoration. Possible values: pending, downloading, processing, completed, failed. + */ + status: string; + /** + * The backup start time. + */ + startedAt: string; + /** + * Migration ID. + */ + migrationId: string; + /** + * The services that are backed up by this policy. + */ + services: string[]; + /** + * The resources that are backed up by this policy. + */ + resources: string[]; + /** + * Optional data in key-value object. + */ + options: string; + } + + /** + * Backup archive list + */ + export type BackupArchiveList = { + /** + * Total number of archives that matched your query. + */ + total: number; + /** + * List of archives. + */ + archives: BackupArchive[]; + } + + /** + * Backup policy list + */ + export type BackupPolicyList = { + /** + * Total number of policies that matched your query. + */ + total: number; + /** + * List of policies. + */ + policies: BackupPolicy[]; + } + + /** + * Backup restoration list + */ + export type BackupRestorationList = { + /** + * Total number of restorations that matched your query. + */ + total: number; + /** + * List of restorations. + */ + restorations: BackupRestoration[]; + } } diff --git a/src/services/account.ts b/src/services/account.ts index 2f164696..9784f06d 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -488,7 +488,7 @@ export class Account { ): Promise { let params: { type: AuthenticatorType }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) { + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('type' in paramsOrFirst))) { params = (paramsOrFirst || {}) as { type: AuthenticatorType }; } else { params = { @@ -540,7 +540,7 @@ export class Account { ): Promise { let params: { type: AuthenticatorType }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) { + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('type' in paramsOrFirst))) { params = (paramsOrFirst || {}) as { type: AuthenticatorType }; } else { params = { @@ -596,7 +596,7 @@ export class Account { ): Promise> { let params: { type: AuthenticatorType, otp: string }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) { + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('type' in paramsOrFirst || 'otp' in paramsOrFirst))) { params = (paramsOrFirst || {}) as { type: AuthenticatorType, otp: string }; } else { params = { @@ -659,7 +659,7 @@ export class Account { ): Promise> { let params: { type: AuthenticatorType, otp: string }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) { + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('type' in paramsOrFirst || 'otp' in paramsOrFirst))) { params = (paramsOrFirst || {}) as { type: AuthenticatorType, otp: string }; } else { params = { @@ -720,7 +720,7 @@ export class Account { ): Promise<{}> { let params: { type: AuthenticatorType }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) { + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('type' in paramsOrFirst))) { params = (paramsOrFirst || {}) as { type: AuthenticatorType }; } else { params = { @@ -772,7 +772,7 @@ export class Account { ): Promise<{}> { let params: { type: AuthenticatorType }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) { + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('type' in paramsOrFirst))) { params = (paramsOrFirst || {}) as { type: AuthenticatorType }; } else { params = { @@ -825,7 +825,7 @@ export class Account { ): Promise { let params: { factor: AuthenticationFactor }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'factor' in paramsOrFirst)) { + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('factor' in paramsOrFirst))) { params = (paramsOrFirst || {}) as { factor: AuthenticationFactor }; } else { params = { @@ -880,7 +880,7 @@ export class Account { ): Promise { let params: { factor: AuthenticationFactor }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'factor' in paramsOrFirst)) { + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('factor' in paramsOrFirst))) { params = (paramsOrFirst || {}) as { factor: AuthenticationFactor }; } else { params = { @@ -1467,7 +1467,7 @@ export class Account { ): Promise> { let params: { prefs: Partial }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'prefs' in paramsOrFirst)) { + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('prefs' in paramsOrFirst))) { params = (paramsOrFirst || {}) as { prefs: Partial }; } else { params = { @@ -2368,7 +2368,7 @@ export class Account { ): Promise { let params: { provider: OAuthProvider, success?: string, failure?: string, scopes?: string[] }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'provider' in paramsOrFirst)) { + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('provider' in paramsOrFirst || 'success' in paramsOrFirst || 'failure' in paramsOrFirst || 'scopes' in paramsOrFirst))) { params = (paramsOrFirst || {}) as { provider: OAuthProvider, success?: string, failure?: string, scopes?: string[] }; } else { params = { diff --git a/src/services/avatars.ts b/src/services/avatars.ts index 0700aaa0..5090ba03 100644 --- a/src/services/avatars.ts +++ b/src/services/avatars.ts @@ -49,7 +49,7 @@ export class Avatars { ): Promise { let params: { code: Browser, width?: number, height?: number, quality?: number }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) { + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('code' in paramsOrFirst || 'width' in paramsOrFirst || 'height' in paramsOrFirst || 'quality' in paramsOrFirst))) { params = (paramsOrFirst || {}) as { code: Browser, width?: number, height?: number, quality?: number }; } else { params = { @@ -129,7 +129,7 @@ export class Avatars { ): Promise { let params: { code: CreditCard, width?: number, height?: number, quality?: number }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) { + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('code' in paramsOrFirst || 'width' in paramsOrFirst || 'height' in paramsOrFirst || 'quality' in paramsOrFirst))) { params = (paramsOrFirst || {}) as { code: CreditCard, width?: number, height?: number, quality?: number }; } else { params = { @@ -268,7 +268,7 @@ export class Avatars { ): Promise { let params: { code: Flag, width?: number, height?: number, quality?: number }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) { + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('code' in paramsOrFirst || 'width' in paramsOrFirst || 'height' in paramsOrFirst || 'quality' in paramsOrFirst))) { params = (paramsOrFirst || {}) as { code: Flag, width?: number, height?: number, quality?: number }; } else { params = { diff --git a/src/services/backups.ts b/src/services/backups.ts new file mode 100644 index 00000000..32774270 --- /dev/null +++ b/src/services/backups.ts @@ -0,0 +1,753 @@ +import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; +import type { Models } from '../models'; + +import { BackupServices } from '../enums/backup-services'; + +export class Backups { + client: Client; + + constructor(client: Client) { + this.client = client; + } + + /** + * List all archives for a project. + * + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @throws {AppwriteException} + * @returns {Promise} + */ + listArchives(params?: { queries?: string[] }): Promise; + /** + * List all archives for a project. + * + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listArchives(queries?: string[]): Promise; + listArchives( + paramsOrFirst?: { queries?: string[] } | string[] + ): Promise { + let params: { queries?: string[] }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { queries?: string[] }; + } else { + params = { + queries: paramsOrFirst as string[] + }; + } + + const queries = params.queries; + + + const apiPath = '/backups/archives'; + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Create a new archive asynchronously for a project. + * + * @param {BackupServices[]} params.services - Array of services to backup + * @param {string} params.resourceId - Resource ID. When set, only this single resource will be backed up. + * @throws {AppwriteException} + * @returns {Promise} + */ + createArchive(params: { services: BackupServices[], resourceId?: string }): Promise; + /** + * Create a new archive asynchronously for a project. + * + * @param {BackupServices[]} services - Array of services to backup + * @param {string} resourceId - Resource ID. When set, only this single resource will be backed up. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createArchive(services: BackupServices[], resourceId?: string): Promise; + createArchive( + paramsOrFirst: { services: BackupServices[], resourceId?: string } | BackupServices[], + ...rest: [(string)?] + ): Promise { + let params: { services: BackupServices[], resourceId?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('services' in paramsOrFirst || 'resourceId' in paramsOrFirst))) { + params = (paramsOrFirst || {}) as { services: BackupServices[], resourceId?: string }; + } else { + params = { + services: paramsOrFirst as BackupServices[], + resourceId: rest[0] as string + }; + } + + const services = params.services; + const resourceId = params.resourceId; + + if (typeof services === 'undefined') { + throw new AppwriteException('Missing required parameter: "services"'); + } + + const apiPath = '/backups/archives'; + const payload: Payload = {}; + if (typeof services !== 'undefined') { + payload['services'] = services; + } + if (typeof resourceId !== 'undefined') { + payload['resourceId'] = resourceId; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Get a backup archive using it's ID. + * + * @param {string} params.archiveId - Archive ID. Choose a custom ID`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + getArchive(params: { archiveId: string }): Promise; + /** + * Get a backup archive using it's ID. + * + * @param {string} archiveId - Archive ID. Choose a custom ID`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getArchive(archiveId: string): Promise; + getArchive( + paramsOrFirst: { archiveId: string } | string + ): Promise { + let params: { archiveId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { archiveId: string }; + } else { + params = { + archiveId: paramsOrFirst as string + }; + } + + const archiveId = params.archiveId; + + if (typeof archiveId === 'undefined') { + throw new AppwriteException('Missing required parameter: "archiveId"'); + } + + const apiPath = '/backups/archives/{archiveId}'.replace('{archiveId}', archiveId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Delete an existing archive for a project. + * + * @param {string} params.archiveId - Policy ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deleteArchive(params: { archiveId: string }): Promise<{}>; + /** + * Delete an existing archive for a project. + * + * @param {string} archiveId - Policy ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deleteArchive(archiveId: string): Promise<{}>; + deleteArchive( + paramsOrFirst: { archiveId: string } | string + ): Promise<{}> { + let params: { archiveId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { archiveId: string }; + } else { + params = { + archiveId: paramsOrFirst as string + }; + } + + const archiveId = params.archiveId; + + if (typeof archiveId === 'undefined') { + throw new AppwriteException('Missing required parameter: "archiveId"'); + } + + const apiPath = '/backups/archives/{archiveId}'.replace('{archiveId}', archiveId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload, + ); + } + + /** + * List all policies for a project. + * + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @throws {AppwriteException} + * @returns {Promise} + */ + listPolicies(params?: { queries?: string[] }): Promise; + /** + * List all policies for a project. + * + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listPolicies(queries?: string[]): Promise; + listPolicies( + paramsOrFirst?: { queries?: string[] } | string[] + ): Promise { + let params: { queries?: string[] }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { queries?: string[] }; + } else { + params = { + queries: paramsOrFirst as string[] + }; + } + + const queries = params.queries; + + + const apiPath = '/backups/policies'; + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Create a new backup policy. + * + * @param {string} params.policyId - Policy ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {BackupServices[]} params.services - Array of services to backup + * @param {number} params.retention - Days to keep backups before deletion + * @param {string} params.schedule - Schedule CRON syntax. + * @param {string} params.name - Policy name. Max length: 128 chars. + * @param {string} params.resourceId - Resource ID. When set, only this single resource will be backed up. + * @param {boolean} params.enabled - Is policy enabled? When set to 'disabled', no backups will be taken + * @throws {AppwriteException} + * @returns {Promise} + */ + createPolicy(params: { policyId: string, services: BackupServices[], retention: number, schedule: string, name?: string, resourceId?: string, enabled?: boolean }): Promise; + /** + * Create a new backup policy. + * + * @param {string} policyId - Policy ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {BackupServices[]} services - Array of services to backup + * @param {number} retention - Days to keep backups before deletion + * @param {string} schedule - Schedule CRON syntax. + * @param {string} name - Policy name. Max length: 128 chars. + * @param {string} resourceId - Resource ID. When set, only this single resource will be backed up. + * @param {boolean} enabled - Is policy enabled? When set to 'disabled', no backups will be taken + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createPolicy(policyId: string, services: BackupServices[], retention: number, schedule: string, name?: string, resourceId?: string, enabled?: boolean): Promise; + createPolicy( + paramsOrFirst: { policyId: string, services: BackupServices[], retention: number, schedule: string, name?: string, resourceId?: string, enabled?: boolean } | string, + ...rest: [(BackupServices[])?, (number)?, (string)?, (string)?, (string)?, (boolean)?] + ): Promise { + let params: { policyId: string, services: BackupServices[], retention: number, schedule: string, name?: string, resourceId?: string, enabled?: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { policyId: string, services: BackupServices[], retention: number, schedule: string, name?: string, resourceId?: string, enabled?: boolean }; + } else { + params = { + policyId: paramsOrFirst as string, + services: rest[0] as BackupServices[], + retention: rest[1] as number, + schedule: rest[2] as string, + name: rest[3] as string, + resourceId: rest[4] as string, + enabled: rest[5] as boolean + }; + } + + const policyId = params.policyId; + const services = params.services; + const retention = params.retention; + const schedule = params.schedule; + const name = params.name; + const resourceId = params.resourceId; + const enabled = params.enabled; + + if (typeof policyId === 'undefined') { + throw new AppwriteException('Missing required parameter: "policyId"'); + } + if (typeof services === 'undefined') { + throw new AppwriteException('Missing required parameter: "services"'); + } + if (typeof retention === 'undefined') { + throw new AppwriteException('Missing required parameter: "retention"'); + } + if (typeof schedule === 'undefined') { + throw new AppwriteException('Missing required parameter: "schedule"'); + } + + const apiPath = '/backups/policies'; + const payload: Payload = {}; + if (typeof policyId !== 'undefined') { + payload['policyId'] = policyId; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof services !== 'undefined') { + payload['services'] = services; + } + if (typeof resourceId !== 'undefined') { + payload['resourceId'] = resourceId; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + if (typeof retention !== 'undefined') { + payload['retention'] = retention; + } + if (typeof schedule !== 'undefined') { + payload['schedule'] = schedule; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Get a backup policy using it's ID. + * + * @param {string} params.policyId - Policy ID. Choose a custom ID`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + getPolicy(params: { policyId: string }): Promise; + /** + * Get a backup policy using it's ID. + * + * @param {string} policyId - Policy ID. Choose a custom ID`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getPolicy(policyId: string): Promise; + getPolicy( + paramsOrFirst: { policyId: string } | string + ): Promise { + let params: { policyId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { policyId: string }; + } else { + params = { + policyId: paramsOrFirst as string + }; + } + + const policyId = params.policyId; + + if (typeof policyId === 'undefined') { + throw new AppwriteException('Missing required parameter: "policyId"'); + } + + const apiPath = '/backups/policies/{policyId}'.replace('{policyId}', policyId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update an existing policy using it's ID. + * + * @param {string} params.policyId - Policy ID. Choose a custom ID`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} params.name - Policy name. Max length: 128 chars. + * @param {number} params.retention - Days to keep backups before deletion + * @param {string} params.schedule - Cron expression + * @param {boolean} params.enabled - Is Backup enabled? When set to 'disabled', No backup will be taken + * @throws {AppwriteException} + * @returns {Promise} + */ + updatePolicy(params: { policyId: string, name?: string, retention?: number, schedule?: string, enabled?: boolean }): Promise; + /** + * Update an existing policy using it's ID. + * + * @param {string} policyId - Policy ID. Choose a custom ID`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} name - Policy name. Max length: 128 chars. + * @param {number} retention - Days to keep backups before deletion + * @param {string} schedule - Cron expression + * @param {boolean} enabled - Is Backup enabled? When set to 'disabled', No backup will be taken + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updatePolicy(policyId: string, name?: string, retention?: number, schedule?: string, enabled?: boolean): Promise; + updatePolicy( + paramsOrFirst: { policyId: string, name?: string, retention?: number, schedule?: string, enabled?: boolean } | string, + ...rest: [(string)?, (number)?, (string)?, (boolean)?] + ): Promise { + let params: { policyId: string, name?: string, retention?: number, schedule?: string, enabled?: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { policyId: string, name?: string, retention?: number, schedule?: string, enabled?: boolean }; + } else { + params = { + policyId: paramsOrFirst as string, + name: rest[0] as string, + retention: rest[1] as number, + schedule: rest[2] as string, + enabled: rest[3] as boolean + }; + } + + const policyId = params.policyId; + const name = params.name; + const retention = params.retention; + const schedule = params.schedule; + const enabled = params.enabled; + + if (typeof policyId === 'undefined') { + throw new AppwriteException('Missing required parameter: "policyId"'); + } + + const apiPath = '/backups/policies/{policyId}'.replace('{policyId}', policyId); + const payload: Payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof retention !== 'undefined') { + payload['retention'] = retention; + } + if (typeof schedule !== 'undefined') { + payload['schedule'] = schedule; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Delete a policy using it's ID. + * + * @param {string} params.policyId - Policy ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deletePolicy(params: { policyId: string }): Promise<{}>; + /** + * Delete a policy using it's ID. + * + * @param {string} policyId - Policy ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deletePolicy(policyId: string): Promise<{}>; + deletePolicy( + paramsOrFirst: { policyId: string } | string + ): Promise<{}> { + let params: { policyId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { policyId: string }; + } else { + params = { + policyId: paramsOrFirst as string + }; + } + + const policyId = params.policyId; + + if (typeof policyId === 'undefined') { + throw new AppwriteException('Missing required parameter: "policyId"'); + } + + const apiPath = '/backups/policies/{policyId}'.replace('{policyId}', policyId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload, + ); + } + + /** + * Create and trigger a new restoration for a backup on a project. + * + * @param {string} params.archiveId - Backup archive ID to restore + * @param {BackupServices[]} params.services - Array of services to restore + * @param {string} params.newResourceId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} params.newResourceName - Database name. Max length: 128 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + createRestoration(params: { archiveId: string, services: BackupServices[], newResourceId?: string, newResourceName?: string }): Promise; + /** + * Create and trigger a new restoration for a backup on a project. + * + * @param {string} archiveId - Backup archive ID to restore + * @param {BackupServices[]} services - Array of services to restore + * @param {string} newResourceId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} newResourceName - Database name. Max length: 128 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createRestoration(archiveId: string, services: BackupServices[], newResourceId?: string, newResourceName?: string): Promise; + createRestoration( + paramsOrFirst: { archiveId: string, services: BackupServices[], newResourceId?: string, newResourceName?: string } | string, + ...rest: [(BackupServices[])?, (string)?, (string)?] + ): Promise { + let params: { archiveId: string, services: BackupServices[], newResourceId?: string, newResourceName?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { archiveId: string, services: BackupServices[], newResourceId?: string, newResourceName?: string }; + } else { + params = { + archiveId: paramsOrFirst as string, + services: rest[0] as BackupServices[], + newResourceId: rest[1] as string, + newResourceName: rest[2] as string + }; + } + + const archiveId = params.archiveId; + const services = params.services; + const newResourceId = params.newResourceId; + const newResourceName = params.newResourceName; + + if (typeof archiveId === 'undefined') { + throw new AppwriteException('Missing required parameter: "archiveId"'); + } + if (typeof services === 'undefined') { + throw new AppwriteException('Missing required parameter: "services"'); + } + + const apiPath = '/backups/restoration'; + const payload: Payload = {}; + if (typeof archiveId !== 'undefined') { + payload['archiveId'] = archiveId; + } + if (typeof services !== 'undefined') { + payload['services'] = services; + } + if (typeof newResourceId !== 'undefined') { + payload['newResourceId'] = newResourceId; + } + if (typeof newResourceName !== 'undefined') { + payload['newResourceName'] = newResourceName; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * List all backup restorations for a project. + * + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @throws {AppwriteException} + * @returns {Promise} + */ + listRestorations(params?: { queries?: string[] }): Promise; + /** + * List all backup restorations for a project. + * + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listRestorations(queries?: string[]): Promise; + listRestorations( + paramsOrFirst?: { queries?: string[] } | string[] + ): Promise { + let params: { queries?: string[] }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { queries?: string[] }; + } else { + params = { + queries: paramsOrFirst as string[] + }; + } + + const queries = params.queries; + + + const apiPath = '/backups/restorations'; + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Get the current status of a backup restoration. + * + * @param {string} params.restorationId - Restoration ID. Choose a custom ID`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + getRestoration(params: { restorationId: string }): Promise; + /** + * Get the current status of a backup restoration. + * + * @param {string} restorationId - Restoration ID. Choose a custom ID`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getRestoration(restorationId: string): Promise; + getRestoration( + paramsOrFirst: { restorationId: string } | string + ): Promise { + let params: { restorationId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { restorationId: string }; + } else { + params = { + restorationId: paramsOrFirst as string + }; + } + + const restorationId = params.restorationId; + + if (typeof restorationId === 'undefined') { + throw new AppwriteException('Missing required parameter: "restorationId"'); + } + + const apiPath = '/backups/restorations/{restorationId}'.replace('{restorationId}', restorationId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } +} diff --git a/src/services/graphql.ts b/src/services/graphql.ts index e9986a77..b5f9ffcf 100644 --- a/src/services/graphql.ts +++ b/src/services/graphql.ts @@ -31,7 +31,7 @@ export class Graphql { ): Promise<{}> { let params: { query: object }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'query' in paramsOrFirst)) { + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('query' in paramsOrFirst))) { params = (paramsOrFirst || {}) as { query: object }; } else { params = { @@ -87,7 +87,7 @@ export class Graphql { ): Promise<{}> { let params: { query: object }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'query' in paramsOrFirst)) { + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('query' in paramsOrFirst))) { params = (paramsOrFirst || {}) as { query: object }; } else { params = { diff --git a/src/services/health.ts b/src/services/health.ts index 67dce2f5..f3598669 100644 --- a/src/services/health.ts +++ b/src/services/health.ts @@ -227,6 +227,108 @@ export class Health { ); } + /** + * Get billing project aggregation queue. + * + * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @throws {AppwriteException} + * @returns {Promise} + */ + getQueueBillingProjectAggregation(params?: { threshold?: number }): Promise; + /** + * Get billing project aggregation queue. + * + * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getQueueBillingProjectAggregation(threshold?: number): Promise; + getQueueBillingProjectAggregation( + paramsOrFirst?: { threshold?: number } | number + ): Promise { + let params: { threshold?: number }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { threshold?: number }; + } else { + params = { + threshold: paramsOrFirst as number + }; + } + + const threshold = params.threshold; + + + const apiPath = '/health/queue/billing-project-aggregation'; + const payload: Payload = {}; + if (typeof threshold !== 'undefined') { + payload['threshold'] = threshold; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Get billing team aggregation queue. + * + * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @throws {AppwriteException} + * @returns {Promise} + */ + getQueueBillingTeamAggregation(params?: { threshold?: number }): Promise; + /** + * Get billing team aggregation queue. + * + * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getQueueBillingTeamAggregation(threshold?: number): Promise; + getQueueBillingTeamAggregation( + paramsOrFirst?: { threshold?: number } | number + ): Promise { + let params: { threshold?: number }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { threshold?: number }; + } else { + params = { + threshold: paramsOrFirst as number + }; + } + + const threshold = params.threshold; + + + const apiPath = '/health/queue/billing-team-aggregation'; + const payload: Payload = {}; + if (typeof threshold !== 'undefined') { + payload['threshold'] = threshold; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + /** * Get the number of builds that are waiting to be processed in the Appwrite internal queue server. * @@ -278,6 +380,57 @@ export class Health { ); } + /** + * Get the priority builds queue size. + * + * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 500. + * @throws {AppwriteException} + * @returns {Promise} + */ + getQueuePriorityBuilds(params?: { threshold?: number }): Promise; + /** + * Get the priority builds queue size. + * + * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 500. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getQueuePriorityBuilds(threshold?: number): Promise; + getQueuePriorityBuilds( + paramsOrFirst?: { threshold?: number } | number + ): Promise { + let params: { threshold?: number }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { threshold?: number }; + } else { + params = { + threshold: paramsOrFirst as number + }; + } + + const threshold = params.threshold; + + + const apiPath = '/health/queue/builds-priority'; + const payload: Payload = {}; + if (typeof threshold !== 'undefined') { + payload['threshold'] = threshold; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + /** * Get the number of certificates that are waiting to be issued against [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue server. * @@ -466,7 +619,7 @@ export class Health { ): Promise { let params: { name: Name, threshold?: number }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'name' in paramsOrFirst)) { + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('name' in paramsOrFirst || 'threshold' in paramsOrFirst))) { params = (paramsOrFirst || {}) as { name: Name, threshold?: number }; } else { params = { @@ -755,6 +908,57 @@ export class Health { ); } + /** + * Get region manager queue. + * + * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 100. + * @throws {AppwriteException} + * @returns {Promise} + */ + getQueueRegionManager(params?: { threshold?: number }): Promise; + /** + * Get region manager queue. + * + * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 100. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getQueueRegionManager(threshold?: number): Promise; + getQueueRegionManager( + paramsOrFirst?: { threshold?: number } | number + ): Promise { + let params: { threshold?: number }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { threshold?: number }; + } else { + params = { + threshold: paramsOrFirst as number + }; + } + + const threshold = params.threshold; + + + const apiPath = '/health/queue/region-manager'; + const payload: Payload = {}; + if (typeof threshold !== 'undefined') { + payload['threshold'] = threshold; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + /** * Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue. * @@ -857,6 +1061,57 @@ export class Health { ); } + /** + * Get threats queue. + * + * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 100. + * @throws {AppwriteException} + * @returns {Promise} + */ + getQueueThreats(params?: { threshold?: number }): Promise; + /** + * Get threats queue. + * + * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 100. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getQueueThreats(threshold?: number): Promise; + getQueueThreats( + paramsOrFirst?: { threshold?: number } | number + ): Promise { + let params: { threshold?: number }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { threshold?: number }; + } else { + params = { + threshold: paramsOrFirst as number + }; + } + + const threshold = params.threshold; + + + const apiPath = '/health/queue/threats'; + const payload: Payload = {}; + if (typeof threshold !== 'undefined') { + payload['threshold'] = threshold; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + /** * Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server. * diff --git a/src/services/storage.ts b/src/services/storage.ts index ec5046ef..794ac76d 100644 --- a/src/services/storage.ts +++ b/src/services/storage.ts @@ -86,7 +86,7 @@ export class Storage { * @param {string[]} params.permissions - An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} params.fileSecurity - Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} params.enabled - Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled. - * @param {number} params.maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 30MB. + * @param {number} params.maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 5GB. * @param {string[]} params.allowedFileExtensions - Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long. * @param {Compression} params.compression - Compression algorithm chosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled * @param {boolean} params.encryption - Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled @@ -104,7 +104,7 @@ export class Storage { * @param {string[]} permissions - An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} fileSecurity - Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} enabled - Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled. - * @param {number} maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 30MB. + * @param {number} maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 5GB. * @param {string[]} allowedFileExtensions - Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long. * @param {Compression} compression - Compression algorithm chosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled * @param {boolean} encryption - Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled @@ -266,7 +266,7 @@ export class Storage { * @param {string[]} params.permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} params.fileSecurity - Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} params.enabled - Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled. - * @param {number} params.maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 30MB. + * @param {number} params.maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 5GB. * @param {string[]} params.allowedFileExtensions - Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long. * @param {Compression} params.compression - Compression algorithm chosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled * @param {boolean} params.encryption - Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled @@ -284,7 +284,7 @@ export class Storage { * @param {string[]} permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} fileSecurity - Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} enabled - Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled. - * @param {number} maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 30MB. + * @param {number} maximumFileSize - Maximum file size allowed in bytes. Maximum allowed value is 5GB. * @param {string[]} allowedFileExtensions - Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long. * @param {Compression} compression - Compression algorithm chosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled * @param {boolean} encryption - Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled diff --git a/src/services/teams.ts b/src/services/teams.ts index 69c0cf55..099111b3 100644 --- a/src/services/teams.ts +++ b/src/services/teams.ts @@ -1,7 +1,6 @@ import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; -import { Roles } from '../enums/roles'; export class Teams { client: Client; @@ -399,7 +398,7 @@ export class Teams { * * * @param {string} params.teamId - Team ID. - * @param {Roles[]} params.roles - Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long. + * @param {string[]} params.roles - Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long. * @param {string} params.email - Email of the new team member. * @param {string} params.userId - ID of the user to be added to a team. * @param {string} params.phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. @@ -408,7 +407,7 @@ export class Teams { * @throws {AppwriteException} * @returns {Promise} */ - createMembership(params: { teamId: string, roles: Roles[], email?: string, userId?: string, phone?: string, url?: string, name?: string }): Promise; + createMembership(params: { teamId: string, roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string }): Promise; /** * Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team. * @@ -420,7 +419,7 @@ export class Teams { * * * @param {string} teamId - Team ID. - * @param {Roles[]} roles - Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long. + * @param {string[]} roles - Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long. * @param {string} email - Email of the new team member. * @param {string} userId - ID of the user to be added to a team. * @param {string} phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. @@ -430,19 +429,19 @@ export class Teams { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createMembership(teamId: string, roles: Roles[], email?: string, userId?: string, phone?: string, url?: string, name?: string): Promise; + createMembership(teamId: string, roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string): Promise; createMembership( - paramsOrFirst: { teamId: string, roles: Roles[], email?: string, userId?: string, phone?: string, url?: string, name?: string } | string, - ...rest: [(Roles[])?, (string)?, (string)?, (string)?, (string)?, (string)?] + paramsOrFirst: { teamId: string, roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string } | string, + ...rest: [(string[])?, (string)?, (string)?, (string)?, (string)?, (string)?] ): Promise { - let params: { teamId: string, roles: Roles[], email?: string, userId?: string, phone?: string, url?: string, name?: string }; + let params: { teamId: string, roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { teamId: string, roles: Roles[], email?: string, userId?: string, phone?: string, url?: string, name?: string }; + params = (paramsOrFirst || {}) as { teamId: string, roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string }; } else { params = { teamId: paramsOrFirst as string, - roles: rest[0] as Roles[], + roles: rest[0] as string[], email: rest[1] as string, userId: rest[2] as string, phone: rest[3] as string, @@ -565,36 +564,36 @@ export class Teams { * * @param {string} params.teamId - Team ID. * @param {string} params.membershipId - Membership ID. - * @param {Roles[]} params.roles - An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long. + * @param {string[]} params.roles - An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long. * @throws {AppwriteException} * @returns {Promise} */ - updateMembership(params: { teamId: string, membershipId: string, roles: Roles[] }): Promise; + updateMembership(params: { teamId: string, membershipId: string, roles: string[] }): Promise; /** * Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). * * * @param {string} teamId - Team ID. * @param {string} membershipId - Membership ID. - * @param {Roles[]} roles - An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long. + * @param {string[]} roles - An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateMembership(teamId: string, membershipId: string, roles: Roles[]): Promise; + updateMembership(teamId: string, membershipId: string, roles: string[]): Promise; updateMembership( - paramsOrFirst: { teamId: string, membershipId: string, roles: Roles[] } | string, - ...rest: [(string)?, (Roles[])?] + paramsOrFirst: { teamId: string, membershipId: string, roles: string[] } | string, + ...rest: [(string)?, (string[])?] ): Promise { - let params: { teamId: string, membershipId: string, roles: Roles[] }; + let params: { teamId: string, membershipId: string, roles: string[] }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { teamId: string, membershipId: string, roles: Roles[] }; + params = (paramsOrFirst || {}) as { teamId: string, membershipId: string, roles: string[] }; } else { params = { teamId: paramsOrFirst as string, membershipId: rest[0] as string, - roles: rest[1] as Roles[] + roles: rest[1] as string[] }; }