diff --git a/CHANGELOG.md b/CHANGELOG.md index a6755c3..e2cc3f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,22 +1,11 @@ # Change Log -## 22.0.0 +## 22.0.1 -* Add array-based enum parameters (e.g., `permissions: BrowserPermission[]`). -* Breaking change: `Output` enum has been removed; use `ImageFormat` instead. -* Add `getQueueAudits` support to `Health` service. -* Add longtext/mediumtext/text/varchar attribute and column helpers to `Databases` and `TablesDB` services. - -## 21.1.0 - -* Added ability to create columns and indexes synchronously while creating a table - -## 21.0.0 - -* Rename `VCSDeploymentType` enum to `VCSReferenceType` -* Change `createTemplateDeployment` method signature: replace `version` parameter with `type` (TemplateReferenceType) and `reference` parameters -* Add `getScreenshot` method to `Avatars` service -* Add `Theme`, `Timezone` and `Output` enums +* Update SDK as per latest server specs, these include - + * Introduces Backups module for managing Database backups + * Introduces Organization module + * Introduce Account level keys, Backup Service & Models ## 20.3.0 @@ -61,7 +50,8 @@ ## 16.0.0 * Fix: remove content-type from GET requests -* Update (breaking): min and max params are now optional in `updateFloatAttribute` and `updateIntegerAttribute` methods (changes their positioning in method definition) +* Update (breaking): min and max params are now optional in `updateFloatAttribute` and `updateIntegerAttribute` + methods (changes their positioning in method definition) ## 15.0.1 @@ -103,4 +93,5 @@ * 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`. \ No newline at end of file diff --git a/docs/examples/account/create-anonymous-session.md b/docs/examples/account/create-anonymous-session.md index 0ec4807..036df9b 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 582ca29..125d73b 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 6bb7254..cebf1f6 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 e2aaf80..6c74da9 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 f5ddd7b..c7204e0 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-key.md b/docs/examples/account/create-key.md new file mode 100644 index 0000000..b46eba0 --- /dev/null +++ b/docs/examples/account/create-key.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.createKey({ + name: '', + scopes: [sdk.Scopes.Account], + expire: '' // optional +}); +``` diff --git a/docs/examples/account/create-magic-url-token.md b/docs/examples/account/create-magic-url-token.md index d5194c5..ee5f143 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 8dd6a59..25081e2 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 9588fa1..af4e044 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 1392f44..5e8e402 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 7f9e229..7bc8a24 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 b5bb586..999f3e1 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 f7c87f0..0570815 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 eab8af6..4dd41d7 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 9e6f068..3ab786f 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 02b9e78..95dec7e 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 48ef1aa..db31f30 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 222d4bf..53a043b 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-key.md b/docs/examples/account/delete-key.md new file mode 100644 index 0000000..3560e90 --- /dev/null +++ b/docs/examples/account/delete-key.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 + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.deleteKey({ + keyId: '' +}); +``` diff --git a/docs/examples/account/delete-mfa-authenticator.md b/docs/examples/account/delete-mfa-authenticator.md index f3d8093..18522f2 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 82e1bd6..7fe49e3 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 884c0e0..912575c 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-key.md b/docs/examples/account/get-key.md new file mode 100644 index 0000000..b60a59a --- /dev/null +++ b/docs/examples/account/get-key.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 + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.getKey({ + keyId: '' +}); +``` diff --git a/docs/examples/account/get-mfa-recovery-codes.md b/docs/examples/account/get-mfa-recovery-codes.md index 6461e6b..cb08fe7 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 d0d7d31..67edf19 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 edf3836..dab8159 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 6ebb605..e755aa4 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 b5541bf..00d60b9 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-keys.md b/docs/examples/account/list-keys.md new file mode 100644 index 0000000..e7d6468 --- /dev/null +++ b/docs/examples/account/list-keys.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 + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.listKeys({ + total: false // optional +}); +``` diff --git a/docs/examples/account/list-logs.md b/docs/examples/account/list-logs.md index 06b36e5..d7e8933 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 97f7f5f..3136219 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 33fb527..0bbd093 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 eb6507e..4fd5953 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 58fea36..985c189 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-key.md b/docs/examples/account/update-key.md new file mode 100644 index 0000000..09ae392 --- /dev/null +++ b/docs/examples/account/update-key.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 + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.updateKey({ + keyId: '', + name: '', + scopes: [sdk.Scopes.Account], + expire: '' // optional +}); +``` diff --git a/docs/examples/account/update-magic-url-session.md b/docs/examples/account/update-magic-url-session.md index 65221b5..1811200 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 18e1575..fa34ef4 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 4903e1e..a584356 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 fd5c1fd..c893c23 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 378c23f..38604a3 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 f812116..24fb869 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 e7e8437..f6b7bb5 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 d2e7543..204c33a 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 af05baf..c5e1abd 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 b1f1daa..c676302 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 ba41cf8..65c70e0 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 c88b435..268f3e9 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 c189f68..9dfcbf2 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 1b70af5..ffb3f25 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 d64b402..0486ce3 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 9f3b2cc..6ffb388 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 1337d05..ea806ba 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 6f79cb6..bd9ae2c 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 672c18b..d05b666 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 12aef10..6f013db 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 584786f..3d35c6d 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 fd08380..e4235a3 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 58522c7..1aab6cd 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 0000000..1a11d45 --- /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 0000000..7167092 --- /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 0000000..f41a234 --- /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 0000000..f0c5615 --- /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 0000000..493e89e --- /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 0000000..ade4e22 --- /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 0000000..391c019 --- /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 0000000..46d18f3 --- /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 0000000..d6f51c5 --- /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 0000000..7f87b1d --- /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 0000000..4475a17 --- /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 0000000..5912b39 --- /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 2e9b562..8202b7a 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 562b538..b58e091 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 7ca8b55..328bf68 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 e6b9b49..3c38b69 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 8815d8d..60f4eab 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 4afebf6..c4c674f 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 5866eab..b6f982a 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 7843c16..583750c 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 97cae64..1d0280d 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 e375266..ea7e766 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 110e3a8..147b00a 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 160bb5b..518a252 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 f3b8874..9d35805 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 5fbda08..2ea9b87 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 da8452e..06a3c46 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 e65f5bd..d958150 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 3d51887..51f239d 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 b09c6a3..30d4dfd 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 57ed8f4..18aeaf5 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 4a2af55..5d49ed3 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 f3da291..8785149 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 af3177f..43225e4 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 3c443ae..dd5511d 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 7392a85..d35731b 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 c01b250..80fe248 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 166aa19..3050105 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 f915076..2da5c20 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 bfc1977..22bc714 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 9440d20..4851243 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 24f74c6..b7a8f0c 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 53d676e..b89214b 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 fc9ace4..0000948 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 4c68303..eade77d 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 4855471..8b96aba 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 7abea4e..9a66df4 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 d7edb84..1900b0f 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 9b7297c..09c0255 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 eb83ef7..9533a73 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 843d163..cb24d70 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 2937e54..635391c 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 7e11fae..38f1f3e 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 40fb680..be2b370 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 ad3dbb3..c641109 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 9a36eb0..4707b13 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 0aee1a9..d88d05e 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 224fc8e..00952c3 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 a1cb513..bd2e7dd 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 2003448..5a4fe63 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 7e1a8c5..cae4ccf 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 038ed1a..168074c 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 738c533..e7da572 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 f240cb0..937af7a 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 877cad1..5af5be0 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 cf7101e..14e7da9 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 d41bb85..0f4d2a3 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 3c4d785..3b8acec 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 efb82f4..ca39b69 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 aea41d0..d08373e 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 0da3b33..410ce3c 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 c7767cb..fa4ebe1 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 aa476c4..9dc8ebd 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 b0d7bea..0c75201 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 9d1453e..766c7f0 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 5765449..a83cb03 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 48d9281..64177d5 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 d28a306..27f3b23 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 5325acf..36ff3bd 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 55156bd..13e882a 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 16ed70f..2a30492 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 77946a7..0cd67cb 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 03c68e7..f5abb22 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 5b2c18c..63f7d6f 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 f1efd7b..2097755 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 4592839..0d8dcfa 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 c648625..4bf9d23 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 42fa14b..292a0e4 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 9f9815b..20120eb 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 cf9d107..4d78ad9 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 70ee4f7..b8ed9d5 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 635f271..446ca2a 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 9e82998..5e9a956 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 c47081c..29d9b2e 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 ad3ff48..c987772 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 9f47331..abc2e91 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 463054d..97050f0 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 62f1155..c53aaa4 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 8a9b93a..b549100 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 a0f83b2..fdaefd3 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 f918c44..0fc8b8d 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 962a810..166effa 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 3f88308..faeeaae 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 32b8a61..5d45a02 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 b0d3132..0dfd06f 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 73ae49f..abd2dad 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 e1004de..459b5f3 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 dffb7b3..31aa4bf 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 1f873ed..3bd436e 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 9efa2d8..3f0c834 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 0143401..a952506 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 ccb8800..571b3cd 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 0d86d08..45a840c 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 32c0342..e495453 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 b5b9737..c03bb59 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 5b337f1..dcc7c6c 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 0000000..5b2fd2e --- /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 0000000..61b4500 --- /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 8e28054..da49e02 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 89383ed..ef065d5 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 7845255..181621e 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 8248b5c..e1b5bc0 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 5832a27..f40904a 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 055c525..437a86b 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 fb29d08..3da627b 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 cc8eb4b..504ad1d 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 ddc7f51..59e4550 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 0000000..c37bcd6 --- /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 0000000..e02b302 --- /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 dacf04c..542d11e 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 0000000..9b166ca --- /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 5d06a7c..86dbfb8 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 f4d0af8..36c3037 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 0ea8e0e..1593339 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 d199800..75ec5cb 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 cd4f42e..86d8617 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 e10c4e2..bfb883b 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 d57eb8f..004a932 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 280d14a..136992f 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 d04d6d6..aa58ec5 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 6e41074..538b492 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 9621e9c..c270141 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 a81b158..99ee2d3 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 a585fd3..c381774 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 aea0fad..cfd522c 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 cd1a53b..dc203a3 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 93fb2ef..f12d0d5 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 8041e7f..78b6d06 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 dd8a0f6..f2961b6 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 7168e8b..ba6829a 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 4c64813..032a208 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 8f00367..d1c391d 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 8b26b2f..9c3be00 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 c477643..2cee66c 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 241a0f0..e17fdc1 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 f86a424..51410af 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 b558fbd..baf83a6 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 82141ae..655a224 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 ce91b54..4625517 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 b3d9ba6..0db5543 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 b7a94ff..cf8cd38 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 590b807..53fc2ae 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 77f2f89..99c61d7 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 58ca2fb..3ffa99f 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 c2c0560..62e7d61 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 503da48..894a74a 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 f7c7058..c7e91ff 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 befc566..8a91534 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 f537973..f352c9d 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 b7d0701..c9c8a47 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 ecbaf74..053adc9 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 e91c69c..92b4c2f 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 1a05f22..603ff0b 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 a613829..2f89225 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 ba2cbc5..bba6aae 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 ceede50..dc05396 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 f4d0746..ee76366 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 be321b9..62fecb6 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 f57fe6a..6cd012d 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 575b463..a761b7f 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 0a3134a..4d76843 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 fbe2d07..5725f1e 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 7ecb3f0..d66ba73 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 6f5899f..b77e10a 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 ab96217..563c907 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 340f275..ece8ae7 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 a325b5a..b4bd058 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 7b2a811..d860736 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 8e1e236..b8b7ea0 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 8656723..bf35cef 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 cf34080..8ec3073 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 6a20141..da83c43 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 d99c076..caefea0 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/organizations/delete.md b/docs/examples/organizations/delete.md new file mode 100644 index 0000000..c1cf487 --- /dev/null +++ b/docs/examples/organizations/delete.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 + .setSession(''); // The user session to authenticate with + +const organizations = new sdk.Organizations(client); + +const result = await organizations.delete({ + organizationId: '' +}); +``` diff --git a/docs/examples/organizations/estimation-delete-organization.md b/docs/examples/organizations/estimation-delete-organization.md new file mode 100644 index 0000000..db8eaba --- /dev/null +++ b/docs/examples/organizations/estimation-delete-organization.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 + .setSession(''); // The user session to authenticate with + +const organizations = new sdk.Organizations(client); + +const result = await organizations.estimationDeleteOrganization({ + organizationId: '' +}); +``` diff --git a/docs/examples/sites/create-deployment.md b/docs/examples/sites/create-deployment.md index dbd78e0..1fea605 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 8d2bd4f..e14d858 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 3728f7f..b08d94a 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 2ec774c..be07336 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 95cefea..6d28546 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 397d2d3..fe5c264 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 292f9e0..533f298 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 d1850e1..38f7c3a 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 069ff8d..11ebaca 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 7f6ad8b..03bd1a5 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 05e8705..6e7ee4a 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 68b6dcf..1f1430c 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 3a22d90..f8190b4 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 7d0a759..cafb71b 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 6d81808..0b21b2b 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 4684938..1b544a0 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 0376e4b..9a417bf 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 09791a4..62b1694 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 24ec74c..6e88289 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 498584e..0451b1e 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 7066ca9..518aa70 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 88d55b0..73a7475 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 bb3adc4..1221d37 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 a7e3f6a..40a9810 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 1a919f5..28f2e80 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 7ef4bef..47dc8b3 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 8dc1745..055e5ab 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 a59844d..bf6fa1b 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 d973b5a..d49838e 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 2dd16cc..380db53 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 253e638..c0a10d9 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 d188e0d..984333d 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 35c6ba2..a20c4ac 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 a6c54c8..d8bdf4d 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 1ddc3da..c17389e 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 a8e8480..f51fad9 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 d528a77..c17c969 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 1316821..8d2294f 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 129e646..2bbb32a 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 dcc6c1e..4aedd36 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 a250d4a..873d86f 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 f1e1830..3aedee7 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 6dd4dfc..84649b7 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 ca45922..989110f 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 b682db4..e7dd69d 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 eaeb64a..eacbd4b 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 84b941c..195bf1f 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 fd16d70..68e4d7b 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 109db51..ac8108d 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 2549239..d1823aa 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 c59e420..a7d97ed 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 36f2f4c..5dc84d7 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 09ebd96..6f2c0fa 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 d437501..485afcd 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 20807c1..0536421 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 dbe0632..cd79574 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 120f5de..b429f79 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 a1d0ca8..e7cfa7b 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 249406e..c737347 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 a37424e..d511362 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 34ccacd..debd75d 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 a16191d..0571906 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 0310399..2fafbbb 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 890393a..51fd96e 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 472b5de..4c7ad1e 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 68a965d..20d4e95 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 ce1d0f4..3dd8f1e 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 3c526e5..f3071a4 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 28d086b..3daa0bd 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 351a40f..018b3a9 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 66bde58..8daf93d 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 6dfa732..164f833 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 fe67e2f..6cbf26f 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 6d14204..e825435 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 208368b..c39cfe1 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 1372966..38d5ce7 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 aaa6cd6..1388043 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 8f6c66b..59b2bfb 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 7d8ab89..7ff6df5 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 ed4fab2..1f6894b 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 602b41d..8277901 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 3ad0c95..892bd28 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 1b3fce7..3514e2d 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 aa1d523..6b61889 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 10badcc..f1fb75e 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 ff40472..9d38063 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 ccc70b1..b35e3c8 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 73add7d..0fca144 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 18cceb0..54f874f 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 c0313d1..56b1962 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 4ec0abe..98bc6ad 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 9888bba..90bf467 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 84befdd..8dc2cdd 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 cddb198..05cbc3d 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 963db8b..80f97f1 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 a91b479..86f935a 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 8c003bf..bac92af 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 b41f0c2..09ab860 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 f30614e..590dc84 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 7a650b8..f698a39 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 0324b9c..1a6a151 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 03501d2..d060747 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 cb2440a..e579761 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 7dd2a1a..1e118dc 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 bc7f53e..7cbf6f5 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 2905b31..f544bc0 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 c985c95..7bbf2ed 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 f820002..910bb75 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 8b1bd1d..8e5702b 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 6fe5912..7dd1160 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 ebccae9..8593956 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 a8deb55..4ecf078 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 bf9d722..0238bdb 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 2f4cc11..bd01c5c 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 228c997..1185380 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 1d1b714..b4525fb 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 f3b8ba2..614737e 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 64f15ae..95a5c37 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 aaad80f..0c64d2b 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 7f16f62..180e322 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 2353720..3be6b54 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 659c03e..f3b4089 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 68371c3..383ea5f 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 13699a3..13e4848 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 8178dd0..c36998d 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 46badb7..4f45f7f 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 9c94632..5510041 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 d46b9c6..c2e6eaa 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 c922274..004c3b7 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 5ebb6ac..2f71202 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 0a2207f..945f747 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 bd30b25..fc8a5e0 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 76f9e2f..e9a3535 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 869e67f..04e3768 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 bb940be..47c0d74 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 d856f3f..bc19f2b 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 9f11692..5978df6 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 3095dd1..5610f06 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 bcd0e9e..1a730d8 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 16061c7..a5d4e3d 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 ce301fb..d39eccd 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 5495fcb..9331435 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 33278f4..3f57930 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 1321044..8714dc5 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 25f4e0b..3e37992 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 cb9d54f..d81539e 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 0c320bf..97ee964 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 594f034..3f86f8c 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 34414b4..e25c26f 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 a768eb1..7cb97e2 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 9de178b..0a758c0 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 79ffcff..9272a20 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 6f85fdd..d941dcf 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 8fa4033..aa7be74 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 0148c9e..916dabc 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 14ab8fb..7a43202 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 b8990cd..10cf002 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 8e6588d..28f2893 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 66513ae..41fa921 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 f867b06..c62e10f 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 914f2a3..03369c9 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 dd32ede..ab572ca 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 bccc61a..4489902 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 de534f6..d45d5ed 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 9b5d9d4..3bb011a 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 c222030..ec7d5bd 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 e77dbb5..d1dcf74 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 d30899d..5b25687 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.0.1", "license": "BSD-3-Clause", "main": "dist/index.js", "type": "commonjs", diff --git a/src/client.ts b/src/client.ts index 9e66d01..a656aba 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.0.1'; // `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.0.1', '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 0000000..f0f829a --- /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 25dca77..d9394ae 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/o-auth-provider.ts b/src/enums/o-auth-provider.ts index 3382e3b..66833df 100644 --- a/src/enums/o-auth-provider.ts +++ b/src/enums/o-auth-provider.ts @@ -38,4 +38,6 @@ export enum OAuthProvider { Yandex = 'yandex', Zoho = 'zoho', Zoom = 'zoom', + GithubImagine = 'githubImagine', + GoogleImagine = 'googleImagine', } \ No newline at end of file diff --git a/src/enums/roles.ts b/src/enums/roles.ts deleted file mode 100644 index f548f93..0000000 --- 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 ecdc452..3b6f9f3 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 70ef50f..4ac98a1 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 781f13a..cc3fe18 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,12 +1,14 @@ 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'; export { Health } from './services/health'; export { Locale } from './services/locale'; export { Messaging } from './services/messaging'; +export { Organizations } from './services/organizations'; export { Sites } from './services/sites'; export { Storage } from './services/storage'; export { TablesDB } from './services/tables-db'; @@ -19,6 +21,7 @@ export { Permission } from './permission'; export { Role } from './role'; export { ID } from './id'; export { Operator, Condition } from './operator'; +export { Scopes } from './enums/scopes'; export { AuthenticatorType } from './enums/authenticator-type'; export { AuthenticationFactor } from './enums/authentication-factor'; export { OAuthProvider } from './enums/o-auth-provider'; @@ -29,12 +32,12 @@ 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'; export { OrderBy } from './enums/order-by'; export { Runtime } from './enums/runtime'; -export { Scopes } from './enums/scopes'; export { TemplateReferenceType } from './enums/template-reference-type'; export { VCSReferenceType } from './enums/vcs-reference-type'; export { DeploymentDownloadType } from './enums/deployment-download-type'; @@ -47,7 +50,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 f534a0d..a34228e 100644 --- a/src/models.ts +++ b/src/models.ts @@ -324,6 +324,20 @@ export namespace Models { executions: Execution[]; } + /** + * API Keys List + */ + export type KeyList = { + /** + * Total number of keys that matched your query. + */ + total: number; + /** + * List of keys. + */ + keys: Key[]; + } + /** * Countries List */ @@ -562,6 +576,14 @@ export namespace Models { * Database type. */ type: DatabaseType; + /** + * Database backup policies. + */ + policies: Index[]; + /** + * Database backup archives. + */ + archives: Collection[]; } /** @@ -608,6 +630,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 +1479,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 +1505,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)[]; } /** @@ -3739,6 +3777,48 @@ export namespace Models { scheduledAt?: string; } + /** + * Key + */ + export type Key = { + /** + * Key ID. + */ + $id: string; + /** + * Key creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Key update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Key name. + */ + name: string; + /** + * Key expiration date in ISO 8601 format. + */ + expire: string; + /** + * Allowed permission scopes. + */ + scopes: string[]; + /** + * Secret key. + */ + secret: string; + /** + * Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours. + */ + accessedAt: string; + /** + * List of SDK user agents that used this key. + */ + sdks: string[]; + } + /** * Variable */ @@ -4320,4 +4400,334 @@ 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; + } + + /** + * Invoice + */ + export type Invoice = { + /** + * Invoice ID. + */ + $id: string; + /** + * Invoice creation time in ISO 8601 format. + */ + $createdAt: string; + /** + * Invoice update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Invoice permissions. [Learn more about permissions](/docs/permissions). + */ + $permissions: string[]; + /** + * Project ID + */ + teamId: string; + /** + * Aggregation ID + */ + aggregationId: string; + /** + * Billing plan selected. Can be one of `tier-0`, `tier-1` or `tier-2`. + */ + plan: string; + /** + * Usage breakdown per resource + */ + usage: UsageResources[]; + /** + * Invoice Amount + */ + amount: number; + /** + * Tax percentage + */ + tax: number; + /** + * Tax amount + */ + taxAmount: number; + /** + * VAT percentage + */ + vat: number; + /** + * VAT amount + */ + vatAmount: number; + /** + * Gross amount after vat, tax, and discounts applied. + */ + grossAmount: number; + /** + * Credits used. + */ + creditsUsed: number; + /** + * Currency the invoice is in + */ + currency: string; + /** + * Client secret for processing failed payments in front-end + */ + clientSecret: string; + /** + * Invoice status + */ + status: string; + /** + * Last payment error associated with the invoice + */ + lastError: string; + /** + * Invoice due date. + */ + dueAt: string; + /** + * Beginning date of the invoice + */ + from: string; + /** + * End date of the invoice + */ + to: 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; + } + + /** + * UsageResource + */ + export type UsageResources = { + /** + * Invoice name + */ + name: string; + /** + * Invoice value + */ + value: number; + /** + * Invoice amount + */ + amount: number; + /** + * Invoice rate + */ + rate: number; + /** + * Invoice description + */ + desc: string; + /** + * Resource ID + */ + resourceId: string; + } + + /** + * EstimationDeleteOrganization + */ + export type EstimationDeleteOrganization = { + /** + * List of unpaid invoices + */ + unpaidInvoices: Invoice[]; + } + + /** + * 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 2f16469..65751c6 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -1,6 +1,7 @@ import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; +import { Scopes } from '../enums/scopes'; import { AuthenticatorType } from '../enums/authenticator-type'; import { AuthenticationFactor } from '../enums/authentication-factor'; import { OAuthProvider } from '../enums/o-auth-provider'; @@ -351,6 +352,313 @@ export class Account { ); } + /** + * Get a list of all API keys from the current account. + * + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + */ + listKeys(params?: { total?: boolean }): Promise; + /** + * Get a list of all API keys from the current account. + * + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listKeys(total?: boolean): Promise; + listKeys( + paramsOrFirst?: { total?: boolean } | boolean + ): Promise { + let params: { total?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { total?: boolean }; + } else { + params = { + total: paramsOrFirst as boolean + }; + } + + const total = params.total; + + + const apiPath = '/account/keys'; + const payload: Payload = {}; + if (typeof total !== 'undefined') { + payload['total'] = total; + } + 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 account API key. + * + * @param {string} params.name - Key name. Max length: 128 chars. + * @param {Scopes[]} params.scopes - Key scopes list. Maximum of 100 scopes are allowed. + * @param {string} params.expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @throws {AppwriteException} + * @returns {Promise} + */ + createKey(params: { name: string, scopes: Scopes[], expire?: string }): Promise; + /** + * Create a new account API key. + * + * @param {string} name - Key name. Max length: 128 chars. + * @param {Scopes[]} scopes - Key scopes list. Maximum of 100 scopes are allowed. + * @param {string} expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createKey(name: string, scopes: Scopes[], expire?: string): Promise; + createKey( + paramsOrFirst: { name: string, scopes: Scopes[], expire?: string } | string, + ...rest: [(Scopes[])?, (string)?] + ): Promise { + let params: { name: string, scopes: Scopes[], expire?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { name: string, scopes: Scopes[], expire?: string }; + } else { + params = { + name: paramsOrFirst as string, + scopes: rest[0] as Scopes[], + expire: rest[1] as string + }; + } + + const name = params.name; + const scopes = params.scopes; + const expire = params.expire; + + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof scopes === 'undefined') { + throw new AppwriteException('Missing required parameter: "scopes"'); + } + + const apiPath = '/account/keys'; + const payload: Payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof scopes !== 'undefined') { + payload['scopes'] = scopes; + } + if (typeof expire !== 'undefined') { + payload['expire'] = expire; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Get a key by its unique ID. This endpoint returns details about a specific API key in your account including it's scopes. + * + * @param {string} params.keyId - Key unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + getKey(params: { keyId: string }): Promise; + /** + * Get a key by its unique ID. This endpoint returns details about a specific API key in your account including it's scopes. + * + * @param {string} keyId - Key unique ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getKey(keyId: string): Promise; + getKey( + paramsOrFirst: { keyId: string } | string + ): Promise { + let params: { keyId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { keyId: string }; + } else { + params = { + keyId: paramsOrFirst as string + }; + } + + const keyId = params.keyId; + + if (typeof keyId === 'undefined') { + throw new AppwriteException('Missing required parameter: "keyId"'); + } + + const apiPath = '/account/keys/{keyId}'.replace('{keyId}', keyId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. + * + * @param {string} params.keyId - Key unique ID. + * @param {string} params.name - Key name. Max length: 128 chars. + * @param {Scopes[]} params.scopes - Key scopes list. Maximum of 100 scopes are allowed. + * @param {string} params.expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateKey(params: { keyId: string, name: string, scopes: Scopes[], expire?: string }): Promise; + /** + * Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. + * + * @param {string} keyId - Key unique ID. + * @param {string} name - Key name. Max length: 128 chars. + * @param {Scopes[]} scopes - Key scopes list. Maximum of 100 scopes are allowed. + * @param {string} expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateKey(keyId: string, name: string, scopes: Scopes[], expire?: string): Promise; + updateKey( + paramsOrFirst: { keyId: string, name: string, scopes: Scopes[], expire?: string } | string, + ...rest: [(string)?, (Scopes[])?, (string)?] + ): Promise { + let params: { keyId: string, name: string, scopes: Scopes[], expire?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { keyId: string, name: string, scopes: Scopes[], expire?: string }; + } else { + params = { + keyId: paramsOrFirst as string, + name: rest[0] as string, + scopes: rest[1] as Scopes[], + expire: rest[2] as string + }; + } + + const keyId = params.keyId; + const name = params.name; + const scopes = params.scopes; + const expire = params.expire; + + if (typeof keyId === 'undefined') { + throw new AppwriteException('Missing required parameter: "keyId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof scopes === 'undefined') { + throw new AppwriteException('Missing required parameter: "scopes"'); + } + + const apiPath = '/account/keys/{keyId}'.replace('{keyId}', keyId); + const payload: Payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof scopes !== 'undefined') { + payload['scopes'] = scopes; + } + if (typeof expire !== 'undefined') { + payload['expire'] = expire; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload, + ); + } + + /** + * Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls. + * + * @param {string} params.keyId - Key unique ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deleteKey(params: { keyId: string }): Promise<{}>; + /** + * Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls. + * + * @param {string} keyId - Key unique ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deleteKey(keyId: string): Promise<{}>; + deleteKey( + paramsOrFirst: { keyId: string } | string + ): Promise<{}> { + let params: { keyId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { keyId: string }; + } else { + params = { + keyId: paramsOrFirst as string + }; + } + + const keyId = params.keyId; + + if (typeof keyId === 'undefined') { + throw new AppwriteException('Missing required parameter: "keyId"'); + } + + const apiPath = '/account/keys/{keyId}'.replace('{keyId}', keyId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload, + ); + } + /** * Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log. * @@ -2338,7 +2646,7 @@ export class Account { * * A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). * - * @param {OAuthProvider} params.provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom. + * @param {OAuthProvider} params.provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom, githubImagine, googleImagine. * @param {string} params.success - URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param {string} params.failure - URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param {string[]} params.scopes - A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long. @@ -2353,7 +2661,7 @@ export class Account { * * A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). * - * @param {OAuthProvider} provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom. + * @param {OAuthProvider} provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom, githubImagine, googleImagine. * @param {string} success - URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param {string} failure - URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param {string[]} scopes - A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long. diff --git a/src/services/backups.ts b/src/services/backups.ts new file mode 100644 index 0000000..bce1d01 --- /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)) { + 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/health.ts b/src/services/health.ts index 67dce2f..bfe2994 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. * @@ -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/organizations.ts b/src/services/organizations.ts new file mode 100644 index 0000000..52a8ab0 --- /dev/null +++ b/src/services/organizations.ts @@ -0,0 +1,115 @@ +import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; +import type { Models } from '../models'; + + +export class Organizations { + client: Client; + + constructor(client: Client) { + this.client = client; + } + + /** + * Delete an organization. + * + * @param {string} params.organizationId - Team ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + delete(params: { organizationId: string }): Promise<{}>; + /** + * Delete an organization. + * + * @param {string} organizationId - Team ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + delete(organizationId: string): Promise<{}>; + delete( + paramsOrFirst: { organizationId: string } | string + ): Promise<{}> { + let params: { organizationId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { organizationId: string }; + } else { + params = { + organizationId: paramsOrFirst as string + }; + } + + const organizationId = params.organizationId; + + if (typeof organizationId === 'undefined') { + throw new AppwriteException('Missing required parameter: "organizationId"'); + } + + const apiPath = '/organizations/{organizationId}'.replace('{organizationId}', organizationId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload, + ); + } + + /** + * Get estimation for deleting an organization. + * + * @param {string} params.organizationId - Team ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + estimationDeleteOrganization(params: { organizationId: string }): Promise; + /** + * Get estimation for deleting an organization. + * + * @param {string} organizationId - Team ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + estimationDeleteOrganization(organizationId: string): Promise; + estimationDeleteOrganization( + paramsOrFirst: { organizationId: string } | string + ): Promise { + let params: { organizationId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { organizationId: string }; + } else { + params = { + organizationId: paramsOrFirst as string + }; + } + + const organizationId = params.organizationId; + + if (typeof organizationId === 'undefined') { + throw new AppwriteException('Missing required parameter: "organizationId"'); + } + + const apiPath = '/organizations/{organizationId}/estimations/delete-organization'.replace('{organizationId}', organizationId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } +} diff --git a/src/services/storage.ts b/src/services/storage.ts index ec5046e..794ac76 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 69c0cf5..099111b 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[] }; }