diff --git a/CHANGELOG.md b/CHANGELOG.md index ad6fd074..effca6fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Change Log +## 26.1.0 + +* Added: `createSesProvider` and `updateSesProvider` to `messaging` +* Added: `updateOAuth2Server` to `project` for OAuth2 server settings +* Added: `updatePasswordStrengthPolicy` and `PolicyPasswordStrength` to `project` +* Added: `getAuditsDB` health check to `health` +* Added: `password-strength` to `ProjectPolicyId` +* Added: `apps.read` and `apps.write` to `ProjectKeyScopes` + + ## 26.0.0 * Breaking: Removed generic type parameters from `presences` service methods @@ -9,7 +19,7 @@ * Added: `Organization` service for managing projects and API keys * Added: `PolicyDenyAliasedEmail`, `PolicyDenyDisposableEmail`, and `PolicyDenyFreeEmail` policy models * Added: `deny-aliased-email`, `deny-disposable-email`, and `deny-free-email` to `ProjectPolicyId` -* Added: `BrowserTheme`, `HealthQueueName`, `OrganizationKeyScopes`, and `Region` enums +* Replaced: `BrowserTheme`, `HealthQueueName`, `OrganizationKeyScopes`, and `Region` enums * Added: `dart-3.12` and `flutter-3.44` runtimes * Added: `ProjectList` model and new attributes on `Function`, `Site`, and `UsageGauge` * Updated: `functions`, `sites`, `usage`, `health`, and `avatars` services diff --git a/docs/examples/account/update-password.md b/docs/examples/account/update-password.md index f6b7bb54..0e6cd7b6 100644 --- a/docs/examples/account/update-password.md +++ b/docs/examples/account/update-password.md @@ -10,6 +10,6 @@ const account = new sdk.Account(client); const result = await account.updatePassword({ password: '', - oldPassword: 'password' // optional + oldPassword: '' // optional }); ``` diff --git a/docs/examples/health/get-audits-db.md b/docs/examples/health/get-audits-db.md new file mode 100644 index 00000000..50d2eff8 --- /dev/null +++ b/docs/examples/health/get-audits-db.md @@ -0,0 +1,12 @@ +```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.getAuditsDB(); +``` diff --git a/docs/examples/messaging/create-ses-provider.md b/docs/examples/messaging/create-ses-provider.md new file mode 100644 index 00000000..c25a7fea --- /dev/null +++ b/docs/examples/messaging/create-ses-provider.md @@ -0,0 +1,23 @@ +```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 messaging = new sdk.Messaging(client); + +const result = await messaging.createSesProvider({ + providerId: '', + name: '', + accessKey: '', // optional + secretKey: '', // optional + region: '', // optional + fromName: '', // optional + fromEmail: 'email@example.com', // optional + replyToName: '', // optional + replyToEmail: 'email@example.com', // optional + enabled: false // optional +}); +``` diff --git a/docs/examples/messaging/update-ses-provider.md b/docs/examples/messaging/update-ses-provider.md new file mode 100644 index 00000000..2858646f --- /dev/null +++ b/docs/examples/messaging/update-ses-provider.md @@ -0,0 +1,23 @@ +```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 messaging = new sdk.Messaging(client); + +const result = await messaging.updateSesProvider({ + providerId: '', + name: '', // optional + enabled: false, // optional + accessKey: '', // optional + secretKey: '', // optional + region: '', // optional + fromName: '', // optional + fromEmail: 'email@example.com', // optional + replyToName: '', // optional + replyToEmail: '' // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-server.md b/docs/examples/project/update-o-auth-2-server.md new file mode 100644 index 00000000..d8526770 --- /dev/null +++ b/docs/examples/project/update-o-auth-2-server.md @@ -0,0 +1,21 @@ +```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 project = new sdk.Project(client); + +const result = await project.updateOAuth2Server({ + enabled: false, + authorizationUrl: 'https://example.com', + scopes: [], // optional + accessTokenDuration: 60, // optional + refreshTokenDuration: 60, // optional + publicAccessTokenDuration: 60, // optional + publicRefreshTokenDuration: 60, // optional + confidentialPkce: false // optional +}); +``` diff --git a/docs/examples/project/update-password-strength-policy.md b/docs/examples/project/update-password-strength-policy.md new file mode 100644 index 00000000..3d2648df --- /dev/null +++ b/docs/examples/project/update-password-strength-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 project = new sdk.Project(client); + +const result = await project.updatePasswordStrengthPolicy({ + min: 8, // optional + uppercase: false, // optional + lowercase: false, // optional + number: false, // optional + symbols: false // optional +}); +``` diff --git a/package-lock.json b/package-lock.json index d7778205..a4840dc3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "node-appwrite", - "version": "26.0.0", + "version": "26.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "node-appwrite", - "version": "26.0.0", + "version": "26.1.0", "dependencies": { "json-bigint": "1.0.0", "node-fetch-native-with-agent": "1.7.2" diff --git a/package.json b/package.json index 3f5d760e..c72d435e 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": "26.0.0", + "version": "26.1.0", "license": "BSD-3-Clause", "main": "dist/index.js", "type": "commonjs", diff --git a/src/client.ts b/src/client.ts index f9de6718..f5e360e3 100644 --- a/src/client.ts +++ b/src/client.ts @@ -74,7 +74,7 @@ class AppwriteException extends Error { } function getUserAgent() { - let ua = 'AppwriteNodeJSSDK/26.0.0'; + let ua = 'AppwriteNodeJSSDK/26.1.0'; // `process` is a global in Node.js, but not fully available in all runtimes. const platform: string[] = []; @@ -128,7 +128,7 @@ class Client { 'x-sdk-name': 'Node.js', 'x-sdk-platform': 'server', 'x-sdk-language': 'nodejs', - 'x-sdk-version': '26.0.0', + 'x-sdk-version': '26.1.0', 'user-agent' : getUserAgent(), 'X-Appwrite-Response-Format': '1.9.5', }; @@ -209,7 +209,6 @@ class Client { * @return {this} */ setProject(value: string): this { - this.headers['X-Appwrite-Project'] = value; this.config.project = value; return this; } @@ -644,7 +643,9 @@ class Client { } async ping(): Promise { - return this.call('GET', new URL(this.config.endpoint + '/ping')); + return this.call('GET', new URL(this.config.endpoint + '/ping'), { + 'X-Appwrite-Project': this.config.project, + }); } async redirect(method: string, url: URL, headers: Headers = {}, params: Payload = {}): Promise { diff --git a/src/enums/project-key-scopes.ts b/src/enums/project-key-scopes.ts index fe019965..47125ddc 100644 --- a/src/enums/project-key-scopes.ts +++ b/src/enums/project-key-scopes.ts @@ -92,5 +92,7 @@ export enum ProjectKeyScopes { DomainsRead = 'domains.read', DomainsWrite = 'domains.write', EventsRead = 'events.read', + AppsRead = 'apps.read', + AppsWrite = 'apps.write', UsageRead = 'usage.read', } \ No newline at end of file diff --git a/src/enums/project-policy-id.ts b/src/enums/project-policy-id.ts index 3e2eceec..be2ea723 100644 --- a/src/enums/project-policy-id.ts +++ b/src/enums/project-policy-id.ts @@ -1,6 +1,7 @@ export enum ProjectPolicyId { Passworddictionary = 'password-dictionary', Passwordhistory = 'password-history', + Passwordstrength = 'password-strength', Passwordpersonaldata = 'password-personal-data', Sessionalert = 'session-alert', Sessionduration = 'session-duration', diff --git a/src/models.ts b/src/models.ts index 95e661a6..e0813442 100644 --- a/src/models.ts +++ b/src/models.ts @@ -496,7 +496,7 @@ export namespace Models { /** * List of policies. */ - policies: (Models.PolicyPasswordDictionary | Models.PolicyPasswordHistory | Models.PolicyPasswordPersonalData | Models.PolicySessionAlert | Models.PolicySessionDuration | Models.PolicySessionInvalidation | Models.PolicySessionLimit | Models.PolicyUserLimit | Models.PolicyMembershipPrivacy | Models.PolicyDenyAliasedEmail | Models.PolicyDenyDisposableEmail | Models.PolicyDenyFreeEmail)[]; + policies: (Models.PolicyPasswordDictionary | Models.PolicyPasswordHistory | Models.PolicyPasswordStrength | Models.PolicyPasswordPersonalData | Models.PolicySessionAlert | Models.PolicySessionDuration | Models.PolicySessionInvalidation | Models.PolicySessionLimit | Models.PolicyUserLimit | Models.PolicyMembershipPrivacy | Models.PolicyDenyAliasedEmail | Models.PolicyDenyDisposableEmail | Models.PolicyDenyFreeEmail)[]; } /** @@ -4164,6 +4164,10 @@ export namespace Models { * Project team ID. */ teamId: string; + /** + * Project region + */ + region: string; /** * Deprecated since 1.9.5: List of dev keys. */ @@ -4237,21 +4241,53 @@ export namespace Models { */ protocols: ProjectProtocol[]; /** - * Project region + * Project blocks information */ - region: string; + blocks: Block[]; + /** + * Last time the project was accessed via console. Used with plan's projectInactivityDays to determine if project is paused. + */ + consoleAccessedAt: string; /** * Billing limits reached */ billingLimits?: BillingLimits; /** - * Project blocks information + * OAuth2 server status */ - blocks: Block[]; + oAuth2ServerEnabled: boolean; /** - * Last time the project was accessed via console. Used with plan's projectInactivityDays to determine if project is paused. + * OAuth2 server authorization URL */ - consoleAccessedAt: string; + oAuth2ServerAuthorizationUrl: string; + /** + * OAuth2 server allowed scopes + */ + oAuth2ServerScopes: string[]; + /** + * OAuth2 server access token duration in seconds for confidential clients + */ + oAuth2ServerAccessTokenDuration: number; + /** + * OAuth2 server refresh token duration in seconds for confidential clients + */ + oAuth2ServerRefreshTokenDuration: number; + /** + * OAuth2 server access token duration in seconds for public clients (SPAs, mobile, native) + */ + oAuth2ServerPublicAccessTokenDuration: number; + /** + * OAuth2 server refresh token duration in seconds for public clients (SPAs, mobile, native) + */ + oAuth2ServerPublicRefreshTokenDuration: number; + /** + * When enabled, PKCE is required for confidential clients (server-side flows using client_secret). PKCE is always required for public clients regardless of this setting. + */ + oAuth2ServerConfidentialPkce: boolean; + /** + * OAuth2 server discovery URL + */ + oAuth2ServerDiscoveryUrl: string; } /** @@ -5484,6 +5520,36 @@ export namespace Models { total: number; } + /** + * Policy Password Strength + */ + export type PolicyPasswordStrength = { + /** + * Policy ID. + */ + $id: string; + /** + * Minimum password length required for user passwords. + */ + min: number; + /** + * Whether passwords must include at least one uppercase letter. + */ + uppercase: boolean; + /** + * Whether passwords must include at least one lowercase letter. + */ + lowercase: boolean; + /** + * Whether passwords must include at least one number. + */ + number: boolean; + /** + * Whether passwords must include at least one symbol. + */ + symbols: boolean; + } + /** * Policy Password Personal Data */ diff --git a/src/services/account.ts b/src/services/account.ts index c98e454b..4519e3f9 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -26,6 +26,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -108,6 +109,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -178,6 +180,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -238,6 +241,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -289,6 +293,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -341,6 +346,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -401,6 +407,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -455,6 +462,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -508,6 +516,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -560,6 +569,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -624,6 +634,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -687,6 +698,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -740,6 +752,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -792,6 +805,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -848,6 +862,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -903,6 +918,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -970,6 +986,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1036,6 +1053,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1061,6 +1079,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -1084,6 +1103,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -1108,6 +1128,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -1131,6 +1152,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -1155,6 +1177,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1179,6 +1202,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1204,6 +1228,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1228,6 +1253,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1283,6 +1309,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1298,7 +1325,7 @@ export class Account { * Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional. * * @param {string} params.password - New user password. Must be at least 8 chars. - * @param {string} params.oldPassword - Current user password. Must be at least 8 chars. + * @param {string} params.oldPassword - Current user password. Max length: 256 chars. * @throws {AppwriteException} * @returns {Promise>} */ @@ -1307,7 +1334,7 @@ export class Account { * Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional. * * @param {string} password - New user password. Must be at least 8 chars. - * @param {string} oldPassword - Current user password. Must be at least 8 chars. + * @param {string} oldPassword - Current user password. Max length: 256 chars. * @throws {AppwriteException} * @returns {Promise>} * @deprecated Use the object parameter style method for a better developer experience. @@ -1346,6 +1373,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1412,6 +1440,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1436,6 +1465,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -1490,6 +1520,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1556,6 +1587,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1636,6 +1668,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1660,6 +1693,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -1683,6 +1717,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1707,6 +1742,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1777,6 +1813,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1844,6 +1881,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1911,6 +1949,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1977,6 +2016,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2029,6 +2069,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -2080,6 +2121,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2132,6 +2174,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2156,6 +2199,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2235,6 +2279,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2321,6 +2366,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2403,6 +2449,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.redirect( @@ -2472,6 +2519,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2533,6 +2581,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2595,6 +2644,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2661,6 +2711,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2728,6 +2779,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2752,6 +2804,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2818,6 +2871,7 @@ export class Account { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } diff --git a/src/services/activities.ts b/src/services/activities.ts index 64e79410..0e86ab74 100644 --- a/src/services/activities.ts +++ b/src/services/activities.ts @@ -51,6 +51,7 @@ export class Activities { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -104,6 +105,7 @@ export class Activities { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( diff --git a/src/services/advisor.ts b/src/services/advisor.ts index 02587b99..2264c579 100644 --- a/src/services/advisor.ts +++ b/src/services/advisor.ts @@ -61,6 +61,7 @@ export class Advisor { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -114,6 +115,7 @@ export class Advisor { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -167,6 +169,7 @@ export class Advisor { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -236,6 +239,7 @@ export class Advisor { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -297,6 +301,7 @@ export class Advisor { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( diff --git a/src/services/avatars.ts b/src/services/avatars.ts index 1a27ab04..2297c78f 100644 --- a/src/services/avatars.ts +++ b/src/services/avatars.ts @@ -84,6 +84,7 @@ export class Avatars { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -164,6 +165,7 @@ export class Avatars { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -223,6 +225,7 @@ export class Avatars { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -303,6 +306,7 @@ export class Avatars { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -381,6 +385,7 @@ export class Avatars { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -465,6 +470,7 @@ export class Avatars { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -544,6 +550,7 @@ export class Avatars { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -741,6 +748,7 @@ export class Avatars { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( diff --git a/src/services/backups.ts b/src/services/backups.ts index ef8dbc03..ea371f14 100644 --- a/src/services/backups.ts +++ b/src/services/backups.ts @@ -52,6 +52,7 @@ export class Backups { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -114,6 +115,7 @@ export class Backups { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -166,6 +168,7 @@ export class Backups { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -217,6 +220,7 @@ export class Backups { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -269,6 +273,7 @@ export class Backups { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -375,6 +380,7 @@ export class Backups { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -427,6 +433,7 @@ export class Backups { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -507,6 +514,7 @@ export class Backups { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -559,6 +567,7 @@ export class Backups { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -639,6 +648,7 @@ export class Backups { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -691,6 +701,7 @@ export class Backups { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -742,6 +753,7 @@ export class Backups { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( diff --git a/src/services/databases.ts b/src/services/databases.ts index 9a2e744c..8f3b589d 100644 --- a/src/services/databases.ts +++ b/src/services/databases.ts @@ -71,6 +71,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -146,6 +147,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -198,6 +200,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -249,6 +252,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -301,6 +305,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -367,6 +372,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -419,6 +425,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -479,6 +486,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -532,6 +540,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -599,6 +608,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -652,6 +662,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -727,6 +738,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -835,6 +847,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -896,6 +909,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -991,6 +1005,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1052,6 +1067,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1127,6 +1143,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -1237,6 +1254,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1348,6 +1366,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1445,6 +1464,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1540,6 +1560,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1635,6 +1656,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1730,6 +1752,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1827,6 +1850,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1924,6 +1948,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2031,6 +2056,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2138,6 +2164,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2249,6 +2276,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2360,6 +2388,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2471,6 +2500,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2582,6 +2612,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2679,6 +2710,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2776,6 +2808,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2864,6 +2897,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2956,6 +2990,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3059,6 +3094,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3155,6 +3191,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3258,6 +3295,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3354,6 +3392,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3442,6 +3481,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3534,6 +3574,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3622,6 +3663,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3714,6 +3756,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3825,6 +3868,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3909,6 +3953,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4023,6 +4068,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4127,6 +4173,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4230,6 +4277,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4326,6 +4374,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4423,6 +4472,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4520,6 +4570,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4633,6 +4684,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4736,6 +4788,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4804,6 +4857,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -4871,6 +4925,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4960,6 +5015,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -5054,6 +5110,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -5132,6 +5189,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -5212,6 +5270,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -5294,6 +5353,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -5369,6 +5429,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -5451,6 +5512,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -5539,6 +5601,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -5628,6 +5691,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -5703,6 +5767,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -5799,6 +5864,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -5895,6 +5961,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -5970,6 +6037,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -6076,6 +6144,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -6144,6 +6213,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -6211,6 +6281,7 @@ export class Databases { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } diff --git a/src/services/functions.ts b/src/services/functions.ts index abaec3aa..9941b3cc 100644 --- a/src/services/functions.ts +++ b/src/services/functions.ts @@ -73,6 +73,7 @@ export class Functions { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -281,6 +282,7 @@ export class Functions { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -305,6 +307,7 @@ export class Functions { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -328,6 +331,7 @@ export class Functions { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -379,6 +383,7 @@ export class Functions { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -581,6 +586,7 @@ export class Functions { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -633,6 +639,7 @@ export class Functions { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -696,6 +703,7 @@ export class Functions { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -770,6 +778,7 @@ export class Functions { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -867,6 +876,7 @@ export class Functions { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'multipart/form-data', } @@ -938,6 +948,7 @@ export class Functions { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1052,6 +1063,7 @@ export class Functions { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1136,6 +1148,7 @@ export class Functions { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1196,6 +1209,7 @@ export class Functions { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -1255,6 +1269,7 @@ export class Functions { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1322,6 +1337,7 @@ export class Functions { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -1382,6 +1398,7 @@ export class Functions { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1449,6 +1466,7 @@ export class Functions { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -1543,6 +1561,7 @@ export class Functions { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1603,6 +1622,7 @@ export class Functions { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -1662,6 +1682,7 @@ export class Functions { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1729,6 +1750,7 @@ export class Functions { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -1818,6 +1840,7 @@ export class Functions { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1878,6 +1901,7 @@ export class Functions { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -1958,6 +1982,7 @@ export class Functions { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2018,6 +2043,7 @@ export class Functions { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } diff --git a/src/services/graphql.ts b/src/services/graphql.ts index fc553978..1dd39ff8 100644 --- a/src/services/graphql.ts +++ b/src/services/graphql.ts @@ -54,6 +54,7 @@ export class Graphql { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'x-sdk-graphql': 'true', 'content-type': 'application/json', } @@ -110,6 +111,7 @@ export class Graphql { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'x-sdk-graphql': 'true', 'content-type': 'application/json', } diff --git a/src/services/health.ts b/src/services/health.ts index 6d4f6a85..21009168 100644 --- a/src/services/health.ts +++ b/src/services/health.ts @@ -24,6 +24,7 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -47,6 +48,32 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Check the database that backs the audit and activity store. When the connection is reachable the endpoint returns a passing status with its response time. + * + * + * @throws {AppwriteException} + * @returns {Promise} + */ + getAuditsDB(): Promise { + + const apiPath = '/health/audits-db'; + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -70,6 +97,7 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -121,6 +149,7 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -182,6 +211,7 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -205,6 +235,7 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -228,6 +259,7 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -281,6 +313,7 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -332,6 +365,7 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -383,6 +417,7 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -442,6 +477,7 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -493,6 +529,7 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -554,6 +591,7 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -605,6 +643,7 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -656,6 +695,7 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -707,6 +747,7 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -758,6 +799,7 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -809,6 +851,7 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -860,6 +903,7 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -911,6 +955,7 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -962,6 +1007,7 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -985,6 +1031,7 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -1008,6 +1055,7 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -1031,6 +1079,7 @@ export class Health { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( diff --git a/src/services/locale.ts b/src/services/locale.ts index 865a085f..c5abcf9d 100644 --- a/src/services/locale.ts +++ b/src/services/locale.ts @@ -25,6 +25,7 @@ export class Locale { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -48,6 +49,7 @@ export class Locale { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -71,6 +73,7 @@ export class Locale { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -94,6 +97,7 @@ export class Locale { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -117,6 +121,7 @@ export class Locale { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -140,6 +145,7 @@ export class Locale { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -163,6 +169,7 @@ export class Locale { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -186,6 +193,7 @@ export class Locale { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( diff --git a/src/services/messaging.ts b/src/services/messaging.ts index 1b8ac968..cddcf902 100644 --- a/src/services/messaging.ts +++ b/src/services/messaging.ts @@ -68,6 +68,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -206,6 +207,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -338,6 +340,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -520,6 +523,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -701,6 +705,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -803,6 +808,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -904,6 +910,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1002,6 +1009,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1099,6 +1107,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1153,6 +1162,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -1204,6 +1214,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1271,6 +1282,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -1337,6 +1349,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -1403,6 +1416,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -1511,6 +1525,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1619,6 +1634,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1722,6 +1738,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1824,6 +1841,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1905,6 +1923,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1985,6 +2004,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2060,6 +2080,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2134,6 +2155,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2256,6 +2278,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2372,6 +2395,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2466,6 +2490,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2554,6 +2579,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2662,6 +2688,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2764,6 +2791,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2872,6 +2900,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2974,6 +3003,247 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Create a new Amazon SES provider. + * + * @param {string} params.providerId - Provider 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.name - Provider name. + * @param {string} params.accessKey - AWS access key ID. + * @param {string} params.secretKey - AWS secret access key. + * @param {string} params.region - AWS region, for example us-east-1. + * @param {string} params.fromName - Sender Name. + * @param {string} params.fromEmail - Sender email address. + * @param {string} params.replyToName - Name set in the reply to field for the mail. Default value is sender name. + * @param {string} params.replyToEmail - Email set in the reply to field for the mail. Default value is sender email. + * @param {boolean} params.enabled - Set as enabled. + * @throws {AppwriteException} + * @returns {Promise} + */ + createSesProvider(params: { providerId: string, name: string, accessKey?: string, secretKey?: string, region?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }): Promise; + /** + * Create a new Amazon SES provider. + * + * @param {string} providerId - Provider 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} name - Provider name. + * @param {string} accessKey - AWS access key ID. + * @param {string} secretKey - AWS secret access key. + * @param {string} region - AWS region, for example us-east-1. + * @param {string} fromName - Sender Name. + * @param {string} fromEmail - Sender email address. + * @param {string} replyToName - Name set in the reply to field for the mail. Default value is sender name. + * @param {string} replyToEmail - Email set in the reply to field for the mail. Default value is sender email. + * @param {boolean} enabled - Set as enabled. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createSesProvider(providerId: string, name: string, accessKey?: string, secretKey?: string, region?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise; + createSesProvider( + paramsOrFirst: { providerId: string, name: string, accessKey?: string, secretKey?: string, region?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean } | string, + ...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?] + ): Promise { + let params: { providerId: string, name: string, accessKey?: string, secretKey?: string, region?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { providerId: string, name: string, accessKey?: string, secretKey?: string, region?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean }; + } else { + params = { + providerId: paramsOrFirst as string, + name: rest[0] as string, + accessKey: rest[1] as string, + secretKey: rest[2] as string, + region: rest[3] as string, + fromName: rest[4] as string, + fromEmail: rest[5] as string, + replyToName: rest[6] as string, + replyToEmail: rest[7] as string, + enabled: rest[8] as boolean + }; + } + + const providerId = params.providerId; + const name = params.name; + const accessKey = params.accessKey; + const secretKey = params.secretKey; + const region = params.region; + const fromName = params.fromName; + const fromEmail = params.fromEmail; + const replyToName = params.replyToName; + const replyToEmail = params.replyToEmail; + const enabled = params.enabled; + + if (typeof providerId === 'undefined') { + throw new AppwriteException('Missing required parameter: "providerId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + + const apiPath = '/messaging/providers/ses'; + const payload: Payload = {}; + if (typeof providerId !== 'undefined') { + payload['providerId'] = providerId; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof accessKey !== 'undefined') { + payload['accessKey'] = accessKey; + } + if (typeof secretKey !== 'undefined') { + payload['secretKey'] = secretKey; + } + if (typeof region !== 'undefined') { + payload['region'] = region; + } + if (typeof fromName !== 'undefined') { + payload['fromName'] = fromName; + } + if (typeof fromEmail !== 'undefined') { + payload['fromEmail'] = fromEmail; + } + if (typeof replyToName !== 'undefined') { + payload['replyToName'] = replyToName; + } + if (typeof replyToEmail !== 'undefined') { + payload['replyToEmail'] = replyToEmail; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update an Amazon SES provider by its unique ID. + * + * @param {string} params.providerId - Provider ID. + * @param {string} params.name - Provider name. + * @param {boolean} params.enabled - Set as enabled. + * @param {string} params.accessKey - AWS access key ID. + * @param {string} params.secretKey - AWS secret access key. + * @param {string} params.region - AWS region, for example us-east-1. + * @param {string} params.fromName - Sender Name. + * @param {string} params.fromEmail - Sender email address. + * @param {string} params.replyToName - Name set in the Reply To field for the mail. Default value is Sender Name. + * @param {string} params.replyToEmail - Email set in the Reply To field for the mail. Default value is Sender Email. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateSesProvider(params: { providerId: string, name?: string, enabled?: boolean, accessKey?: string, secretKey?: string, region?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string }): Promise; + /** + * Update an Amazon SES provider by its unique ID. + * + * @param {string} providerId - Provider ID. + * @param {string} name - Provider name. + * @param {boolean} enabled - Set as enabled. + * @param {string} accessKey - AWS access key ID. + * @param {string} secretKey - AWS secret access key. + * @param {string} region - AWS region, for example us-east-1. + * @param {string} fromName - Sender Name. + * @param {string} fromEmail - Sender email address. + * @param {string} replyToName - Name set in the Reply To field for the mail. Default value is Sender Name. + * @param {string} replyToEmail - Email set in the Reply To field for the mail. Default value is Sender Email. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateSesProvider(providerId: string, name?: string, enabled?: boolean, accessKey?: string, secretKey?: string, region?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string): Promise; + updateSesProvider( + paramsOrFirst: { providerId: string, name?: string, enabled?: boolean, accessKey?: string, secretKey?: string, region?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string } | string, + ...rest: [(string)?, (boolean)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?] + ): Promise { + let params: { providerId: string, name?: string, enabled?: boolean, accessKey?: string, secretKey?: string, region?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { providerId: string, name?: string, enabled?: boolean, accessKey?: string, secretKey?: string, region?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string }; + } else { + params = { + providerId: paramsOrFirst as string, + name: rest[0] as string, + enabled: rest[1] as boolean, + accessKey: rest[2] as string, + secretKey: rest[3] as string, + region: rest[4] as string, + fromName: rest[5] as string, + fromEmail: rest[6] as string, + replyToName: rest[7] as string, + replyToEmail: rest[8] as string + }; + } + + const providerId = params.providerId; + const name = params.name; + const enabled = params.enabled; + const accessKey = params.accessKey; + const secretKey = params.secretKey; + const region = params.region; + const fromName = params.fromName; + const fromEmail = params.fromEmail; + const replyToName = params.replyToName; + const replyToEmail = params.replyToEmail; + + if (typeof providerId === 'undefined') { + throw new AppwriteException('Missing required parameter: "providerId"'); + } + + const apiPath = '/messaging/providers/ses/{providerId}'.replace('{providerId}', providerId); + const payload: Payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + if (typeof accessKey !== 'undefined') { + payload['accessKey'] = accessKey; + } + if (typeof secretKey !== 'undefined') { + payload['secretKey'] = secretKey; + } + if (typeof region !== 'undefined') { + payload['region'] = region; + } + if (typeof fromName !== 'undefined') { + payload['fromName'] = fromName; + } + if (typeof fromEmail !== 'undefined') { + payload['fromEmail'] = fromEmail; + } + if (typeof replyToName !== 'undefined') { + payload['replyToName'] = replyToName; + } + if (typeof replyToEmail !== 'undefined') { + payload['replyToEmail'] = replyToEmail; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3128,6 +3398,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3281,6 +3552,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3426,6 +3698,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3570,6 +3843,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3664,6 +3938,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3752,6 +4027,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3846,6 +4122,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3934,6 +4211,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4028,6 +4306,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4116,6 +4395,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4210,6 +4490,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4298,6 +4579,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4352,6 +4634,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -4403,6 +4686,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4470,6 +4754,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -4536,6 +4821,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -4602,6 +4888,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -4674,6 +4961,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4728,6 +5016,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -4796,6 +5085,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4848,6 +5138,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4915,6 +5206,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -4988,6 +5280,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -5060,6 +5353,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -5122,6 +5416,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -5181,6 +5476,7 @@ export class Messaging { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } diff --git a/src/services/organization.ts b/src/services/organization.ts index baa874fb..a3b45453 100644 --- a/src/services/organization.ts +++ b/src/services/organization.ts @@ -61,6 +61,7 @@ export class Organization { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -143,6 +144,7 @@ export class Organization { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -195,6 +197,7 @@ export class Organization { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -274,6 +277,7 @@ export class Organization { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -326,6 +330,7 @@ export class Organization { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -393,6 +398,7 @@ export class Organization { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -465,6 +471,7 @@ export class Organization { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -517,6 +524,7 @@ export class Organization { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -579,6 +587,7 @@ export class Organization { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -631,6 +640,7 @@ export class Organization { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } diff --git a/src/services/presences.ts b/src/services/presences.ts index 0088c90e..939aa929 100644 --- a/src/services/presences.ts +++ b/src/services/presences.ts @@ -68,6 +68,7 @@ export class Presences { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -121,6 +122,7 @@ export class Presences { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -216,6 +218,7 @@ export class Presences { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -316,6 +319,7 @@ export class Presences { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -370,6 +374,7 @@ export class Presences { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } diff --git a/src/services/project.ts b/src/services/project.ts index 3fcec931..decbca9c 100644 --- a/src/services/project.ts +++ b/src/services/project.ts @@ -33,6 +33,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -56,6 +57,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -119,6 +121,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -179,6 +182,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -265,6 +269,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -335,6 +340,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -387,6 +393,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -466,6 +473,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -518,6 +526,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -573,6 +582,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -633,6 +643,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -698,6 +709,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -750,6 +762,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -812,6 +825,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -864,6 +878,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -924,6 +939,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -934,11 +950,120 @@ export class Project { ); } + /** + * Update the OAuth2 server (OIDC provider) configuration. + * + * @param {boolean} params.enabled - Enable or disable the OAuth2 server. + * @param {string} params.authorizationUrl - URL to your application with consent screen. + * @param {string[]} params.scopes - List of allowed OAuth2 scopes. Maximum of 100 scopes are allowed, each up to 128 characters long. + * @param {number} params.accessTokenDuration - Access token duration in seconds for confidential clients (server-side apps that authenticate with a client secret). Leave empty to use default 8 hours. + * @param {number} params.refreshTokenDuration - Refresh token duration in seconds for confidential clients (server-side apps that authenticate with a client secret). Leave empty to use default 1 year. + * @param {number} params.publicAccessTokenDuration - Access token duration in seconds for public clients (SPAs, mobile, and native apps that cannot keep a client secret). Leave empty to use default 1 hour. + * @param {number} params.publicRefreshTokenDuration - Refresh token duration in seconds for public clients (SPAs, mobile, and native apps that cannot keep a client secret). Leave empty to use default 30 days. + * @param {boolean} params.confidentialPkce - When enabled, PKCE is required for confidential clients (server-side flows using client_secret). PKCE is always required for public clients regardless of this setting. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Server(params: { enabled: boolean, authorizationUrl: string, scopes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, confidentialPkce?: boolean }): Promise; + /** + * Update the OAuth2 server (OIDC provider) configuration. + * + * @param {boolean} enabled - Enable or disable the OAuth2 server. + * @param {string} authorizationUrl - URL to your application with consent screen. + * @param {string[]} scopes - List of allowed OAuth2 scopes. Maximum of 100 scopes are allowed, each up to 128 characters long. + * @param {number} accessTokenDuration - Access token duration in seconds for confidential clients (server-side apps that authenticate with a client secret). Leave empty to use default 8 hours. + * @param {number} refreshTokenDuration - Refresh token duration in seconds for confidential clients (server-side apps that authenticate with a client secret). Leave empty to use default 1 year. + * @param {number} publicAccessTokenDuration - Access token duration in seconds for public clients (SPAs, mobile, and native apps that cannot keep a client secret). Leave empty to use default 1 hour. + * @param {number} publicRefreshTokenDuration - Refresh token duration in seconds for public clients (SPAs, mobile, and native apps that cannot keep a client secret). Leave empty to use default 30 days. + * @param {boolean} confidentialPkce - When enabled, PKCE is required for confidential clients (server-side flows using client_secret). PKCE is always required for public clients regardless of this setting. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Server(enabled: boolean, authorizationUrl: string, scopes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, confidentialPkce?: boolean): Promise; + updateOAuth2Server( + paramsOrFirst: { enabled: boolean, authorizationUrl: string, scopes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, confidentialPkce?: boolean } | boolean, + ...rest: [(string)?, (string[])?, (number)?, (number)?, (number)?, (number)?, (boolean)?] + ): Promise { + let params: { enabled: boolean, authorizationUrl: string, scopes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, confidentialPkce?: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { enabled: boolean, authorizationUrl: string, scopes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, confidentialPkce?: boolean }; + } else { + params = { + enabled: paramsOrFirst as boolean, + authorizationUrl: rest[0] as string, + scopes: rest[1] as string[], + accessTokenDuration: rest[2] as number, + refreshTokenDuration: rest[3] as number, + publicAccessTokenDuration: rest[4] as number, + publicRefreshTokenDuration: rest[5] as number, + confidentialPkce: rest[6] as boolean + }; + } + + const enabled = params.enabled; + const authorizationUrl = params.authorizationUrl; + const scopes = params.scopes; + const accessTokenDuration = params.accessTokenDuration; + const refreshTokenDuration = params.refreshTokenDuration; + const publicAccessTokenDuration = params.publicAccessTokenDuration; + const publicRefreshTokenDuration = params.publicRefreshTokenDuration; + const confidentialPkce = params.confidentialPkce; + + if (typeof enabled === 'undefined') { + throw new AppwriteException('Missing required parameter: "enabled"'); + } + if (typeof authorizationUrl === 'undefined') { + throw new AppwriteException('Missing required parameter: "authorizationUrl"'); + } + + const apiPath = '/project/oauth2-server'; + const payload: Payload = {}; + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + if (typeof authorizationUrl !== 'undefined') { + payload['authorizationUrl'] = authorizationUrl; + } + if (typeof scopes !== 'undefined') { + payload['scopes'] = scopes; + } + if (typeof accessTokenDuration !== 'undefined') { + payload['accessTokenDuration'] = accessTokenDuration; + } + if (typeof refreshTokenDuration !== 'undefined') { + payload['refreshTokenDuration'] = refreshTokenDuration; + } + if (typeof publicAccessTokenDuration !== 'undefined') { + payload['publicAccessTokenDuration'] = publicAccessTokenDuration; + } + if (typeof publicRefreshTokenDuration !== 'undefined') { + payload['publicRefreshTokenDuration'] = publicRefreshTokenDuration; + } + if (typeof confidentialPkce !== 'undefined') { + payload['confidentialPkce'] = confidentialPkce; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload, + ); + } + /** * Update the project OAuth2 Amazon configuration. * * @param {string} params.clientId - 'Client ID' of Amazon OAuth2 app. For example: amzn1.application-oa2-client.87400c00000000000000000000063d5b2 - * @param {string} params.clientSecret - 'Client Secret' of Amazon OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.clientSecret - 'Client Secret' of Amazon OAuth2 app. For example: 79ffe4000000000000000000000000000000000000000000000000000002de55 * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -948,7 +1073,7 @@ export class Project { * Update the project OAuth2 Amazon configuration. * * @param {string} clientId - 'Client ID' of Amazon OAuth2 app. For example: amzn1.application-oa2-client.87400c00000000000000000000063d5b2 - * @param {string} clientSecret - 'Client Secret' of Amazon OAuth2 app. For example: your-oauth2-client-secret + * @param {string} clientSecret - 'Client Secret' of Amazon OAuth2 app. For example: 79ffe4000000000000000000000000000000000000000000000000000002de55 * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -990,6 +1115,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1071,6 +1197,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1086,7 +1213,7 @@ export class Project { * Update the project OAuth2 Auth0 configuration. * * @param {string} params.clientId - 'Client ID' of Auth0 OAuth2 app. For example: OaOkIA000000000000000000005KLSYq - * @param {string} params.clientSecret - 'Client Secret' of Auth0 OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.clientSecret - 'Client Secret' of Auth0 OAuth2 app. For example: zXz0000-00000000000000000000000000000-00000000000000000000PJafnF * @param {string} params.endpoint - Domain of Auth0 instance. For example: example.us.auth0.com * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} @@ -1097,7 +1224,7 @@ export class Project { * Update the project OAuth2 Auth0 configuration. * * @param {string} clientId - 'Client ID' of Auth0 OAuth2 app. For example: OaOkIA000000000000000000005KLSYq - * @param {string} clientSecret - 'Client Secret' of Auth0 OAuth2 app. For example: your-oauth2-client-secret + * @param {string} clientSecret - 'Client Secret' of Auth0 OAuth2 app. For example: zXz0000-00000000000000000000000000000-00000000000000000000PJafnF * @param {string} endpoint - Domain of Auth0 instance. For example: example.us.auth0.com * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} @@ -1145,6 +1272,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1160,7 +1288,7 @@ export class Project { * Update the project OAuth2 Authentik configuration. * * @param {string} params.clientId - 'Client ID' of Authentik OAuth2 app. For example: dTKOPa0000000000000000000000000000e7G8hv - * @param {string} params.clientSecret - 'Client Secret' of Authentik OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.clientSecret - 'Client Secret' of Authentik OAuth2 app. For example: ntQadq000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Hp5WK * @param {string} params.endpoint - Domain of Authentik instance. For example: example.authentik.com * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} @@ -1171,7 +1299,7 @@ export class Project { * Update the project OAuth2 Authentik configuration. * * @param {string} clientId - 'Client ID' of Authentik OAuth2 app. For example: dTKOPa0000000000000000000000000000e7G8hv - * @param {string} clientSecret - 'Client Secret' of Authentik OAuth2 app. For example: your-oauth2-client-secret + * @param {string} clientSecret - 'Client Secret' of Authentik OAuth2 app. For example: ntQadq000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Hp5WK * @param {string} endpoint - Domain of Authentik instance. For example: example.authentik.com * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} @@ -1219,6 +1347,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1234,7 +1363,7 @@ export class Project { * Update the project OAuth2 Autodesk configuration. * * @param {string} params.clientId - 'Client ID' of Autodesk OAuth2 app. For example: 5zw90v00000000000000000000kVYXN7 - * @param {string} params.clientSecret - 'Client Secret' of Autodesk OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.clientSecret - 'Client Secret' of Autodesk OAuth2 app. For example: 7I000000000000MW * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1244,7 +1373,7 @@ export class Project { * Update the project OAuth2 Autodesk configuration. * * @param {string} clientId - 'Client ID' of Autodesk OAuth2 app. For example: 5zw90v00000000000000000000kVYXN7 - * @param {string} clientSecret - 'Client Secret' of Autodesk OAuth2 app. For example: your-oauth2-client-secret + * @param {string} clientSecret - 'Client Secret' of Autodesk OAuth2 app. For example: 7I000000000000MW * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1286,6 +1415,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1301,7 +1431,7 @@ export class Project { * Update the project OAuth2 Bitbucket configuration. * * @param {string} params.key - 'Key' of Bitbucket OAuth2 app. For example: Knt70000000000ByRc - * @param {string} params.secret - 'Secret' of Bitbucket OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.secret - 'Secret' of Bitbucket OAuth2 app. For example: NMfLZJ00000000000000000000TLQdDx * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1311,7 +1441,7 @@ export class Project { * Update the project OAuth2 Bitbucket configuration. * * @param {string} key - 'Key' of Bitbucket OAuth2 app. For example: Knt70000000000ByRc - * @param {string} secret - 'Secret' of Bitbucket OAuth2 app. For example: your-oauth2-client-secret + * @param {string} secret - 'Secret' of Bitbucket OAuth2 app. For example: NMfLZJ00000000000000000000TLQdDx * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1353,6 +1483,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1368,7 +1499,7 @@ export class Project { * Update the project OAuth2 Bitly configuration. * * @param {string} params.clientId - 'Client ID' of Bitly OAuth2 app. For example: d95151000000000000000000000000000067af9b - * @param {string} params.clientSecret - 'Client Secret' of Bitly OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.clientSecret - 'Client Secret' of Bitly OAuth2 app. For example: a13e250000000000000000000000000000d73095 * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1378,7 +1509,7 @@ export class Project { * Update the project OAuth2 Bitly configuration. * * @param {string} clientId - 'Client ID' of Bitly OAuth2 app. For example: d95151000000000000000000000000000067af9b - * @param {string} clientSecret - 'Client Secret' of Bitly OAuth2 app. For example: your-oauth2-client-secret + * @param {string} clientSecret - 'Client Secret' of Bitly OAuth2 app. For example: a13e250000000000000000000000000000d73095 * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1420,6 +1551,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1435,7 +1567,7 @@ export class Project { * Update the project OAuth2 Box configuration. * * @param {string} params.clientId - 'Client ID' of Box OAuth2 app. For example: deglcs00000000000000000000x2og6y - * @param {string} params.clientSecret - 'Client Secret' of Box OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.clientSecret - 'Client Secret' of Box OAuth2 app. For example: OKM1f100000000000000000000eshEif * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1445,7 +1577,7 @@ export class Project { * Update the project OAuth2 Box configuration. * * @param {string} clientId - 'Client ID' of Box OAuth2 app. For example: deglcs00000000000000000000x2og6y - * @param {string} clientSecret - 'Client Secret' of Box OAuth2 app. For example: your-oauth2-client-secret + * @param {string} clientSecret - 'Client Secret' of Box OAuth2 app. For example: OKM1f100000000000000000000eshEif * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1487,6 +1619,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1502,7 +1635,7 @@ export class Project { * Update the project OAuth2 Dailymotion configuration. * * @param {string} params.apiKey - 'API Key' of Dailymotion OAuth2 app. For example: 07a9000000000000067f - * @param {string} params.apiSecret - 'API Secret' of Dailymotion OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.apiSecret - 'API Secret' of Dailymotion OAuth2 app. For example: a399a90000000000000000000000000000d90639 * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1512,7 +1645,7 @@ export class Project { * Update the project OAuth2 Dailymotion configuration. * * @param {string} apiKey - 'API Key' of Dailymotion OAuth2 app. For example: 07a9000000000000067f - * @param {string} apiSecret - 'API Secret' of Dailymotion OAuth2 app. For example: your-oauth2-client-secret + * @param {string} apiSecret - 'API Secret' of Dailymotion OAuth2 app. For example: a399a90000000000000000000000000000d90639 * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1554,6 +1687,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1569,7 +1703,7 @@ export class Project { * Update the project OAuth2 Discord configuration. * * @param {string} params.clientId - 'Client ID' of Discord OAuth2 app. For example: 950722000000343754 - * @param {string} params.clientSecret - 'Client Secret' of Discord OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.clientSecret - 'Client Secret' of Discord OAuth2 app. For example: YmPXnM000000000000000000002zFg5D * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1579,7 +1713,7 @@ export class Project { * Update the project OAuth2 Discord configuration. * * @param {string} clientId - 'Client ID' of Discord OAuth2 app. For example: 950722000000343754 - * @param {string} clientSecret - 'Client Secret' of Discord OAuth2 app. For example: your-oauth2-client-secret + * @param {string} clientSecret - 'Client Secret' of Discord OAuth2 app. For example: YmPXnM000000000000000000002zFg5D * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1621,6 +1755,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1636,7 +1771,7 @@ export class Project { * Update the project OAuth2 Disqus configuration. * * @param {string} params.publicKey - 'Public Key, also known as API Key' of Disqus OAuth2 app. For example: cgegH70000000000000000000000000000000000000000000000000000Hr1nYX - * @param {string} params.secretKey - 'Secret Key, also known as API Secret' of Disqus OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.secretKey - 'Secret Key, also known as API Secret' of Disqus OAuth2 app. For example: W7Bykj00000000000000000000000000000000000000000000000000003o43w9 * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1646,7 +1781,7 @@ export class Project { * Update the project OAuth2 Disqus configuration. * * @param {string} publicKey - 'Public Key, also known as API Key' of Disqus OAuth2 app. For example: cgegH70000000000000000000000000000000000000000000000000000Hr1nYX - * @param {string} secretKey - 'Secret Key, also known as API Secret' of Disqus OAuth2 app. For example: your-oauth2-client-secret + * @param {string} secretKey - 'Secret Key, also known as API Secret' of Disqus OAuth2 app. For example: W7Bykj00000000000000000000000000000000000000000000000000003o43w9 * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1688,6 +1823,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1703,7 +1839,7 @@ export class Project { * Update the project OAuth2 Dropbox configuration. * * @param {string} params.appKey - 'App Key' of Dropbox OAuth2 app. For example: jl000000000009t - * @param {string} params.appSecret - 'App Secret' of Dropbox OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.appSecret - 'App Secret' of Dropbox OAuth2 app. For example: g200000000000vw * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1713,7 +1849,7 @@ export class Project { * Update the project OAuth2 Dropbox configuration. * * @param {string} appKey - 'App Key' of Dropbox OAuth2 app. For example: jl000000000009t - * @param {string} appSecret - 'App Secret' of Dropbox OAuth2 app. For example: your-oauth2-client-secret + * @param {string} appSecret - 'App Secret' of Dropbox OAuth2 app. For example: g200000000000vw * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1755,6 +1891,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1770,7 +1907,7 @@ export class Project { * Update the project OAuth2 Etsy configuration. * * @param {string} params.keyString - 'Keystring' of Etsy OAuth2 app. For example: nsgzxh0000000000008j85a2 - * @param {string} params.sharedSecret - 'Shared Secret' of Etsy OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.sharedSecret - 'Shared Secret' of Etsy OAuth2 app. For example: tp000000ru * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1780,7 +1917,7 @@ export class Project { * Update the project OAuth2 Etsy configuration. * * @param {string} keyString - 'Keystring' of Etsy OAuth2 app. For example: nsgzxh0000000000008j85a2 - * @param {string} sharedSecret - 'Shared Secret' of Etsy OAuth2 app. For example: your-oauth2-client-secret + * @param {string} sharedSecret - 'Shared Secret' of Etsy OAuth2 app. For example: tp000000ru * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1822,6 +1959,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1837,7 +1975,7 @@ export class Project { * Update the project OAuth2 Facebook configuration. * * @param {string} params.appId - 'App ID' of Facebook OAuth2 app. For example: 260600000007694 - * @param {string} params.appSecret - 'App Secret' of Facebook OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.appSecret - 'App Secret' of Facebook OAuth2 app. For example: 2d0b2800000000000000000000d38af4 * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1847,7 +1985,7 @@ export class Project { * Update the project OAuth2 Facebook configuration. * * @param {string} appId - 'App ID' of Facebook OAuth2 app. For example: 260600000007694 - * @param {string} appSecret - 'App Secret' of Facebook OAuth2 app. For example: your-oauth2-client-secret + * @param {string} appSecret - 'App Secret' of Facebook OAuth2 app. For example: 2d0b2800000000000000000000d38af4 * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1889,6 +2027,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1904,7 +2043,7 @@ export class Project { * Update the project OAuth2 Figma configuration. * * @param {string} params.clientId - 'Client ID' of Figma OAuth2 app. For example: byay5H0000000000VtiI40 - * @param {string} params.clientSecret - 'Client Secret' of Figma OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.clientSecret - 'Client Secret' of Figma OAuth2 app. For example: yEpOYn0000000000000000004iIsU5 * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1914,7 +2053,7 @@ export class Project { * Update the project OAuth2 Figma configuration. * * @param {string} clientId - 'Client ID' of Figma OAuth2 app. For example: byay5H0000000000VtiI40 - * @param {string} clientSecret - 'Client Secret' of Figma OAuth2 app. For example: your-oauth2-client-secret + * @param {string} clientSecret - 'Client Secret' of Figma OAuth2 app. For example: yEpOYn0000000000000000004iIsU5 * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -1956,6 +2095,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1971,7 +2111,7 @@ export class Project { * Update the project OAuth2 FusionAuth configuration. * * @param {string} params.clientId - 'Client ID' of FusionAuth OAuth2 app. For example: b2222c00-0000-0000-0000-000000862097 - * @param {string} params.clientSecret - 'Client Secret' of FusionAuth OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.clientSecret - 'Client Secret' of FusionAuth OAuth2 app. For example: Jx4s0C0000000000000000000000000000000wGqLsc * @param {string} params.endpoint - Domain of FusionAuth instance. For example: example.fusionauth.io * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} @@ -1982,7 +2122,7 @@ export class Project { * Update the project OAuth2 FusionAuth configuration. * * @param {string} clientId - 'Client ID' of FusionAuth OAuth2 app. For example: b2222c00-0000-0000-0000-000000862097 - * @param {string} clientSecret - 'Client Secret' of FusionAuth OAuth2 app. For example: your-oauth2-client-secret + * @param {string} clientSecret - 'Client Secret' of FusionAuth OAuth2 app. For example: Jx4s0C0000000000000000000000000000000wGqLsc * @param {string} endpoint - Domain of FusionAuth instance. For example: example.fusionauth.io * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} @@ -2030,6 +2170,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2045,7 +2186,7 @@ export class Project { * Update the project OAuth2 GitHub configuration. * * @param {string} params.clientId - 'OAuth2 app Client ID, or App ID' of GitHub OAuth2 app. For example: e4d87900000000540733. Example of wrong value: 370006 - * @param {string} params.clientSecret - 'Client Secret' of GitHub OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.clientSecret - 'Client Secret' of GitHub OAuth2 app. For example: 5e07c00000000000000000000000000000198bcc * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -2055,7 +2196,7 @@ export class Project { * Update the project OAuth2 GitHub configuration. * * @param {string} clientId - 'OAuth2 app Client ID, or App ID' of GitHub OAuth2 app. For example: e4d87900000000540733. Example of wrong value: 370006 - * @param {string} clientSecret - 'Client Secret' of GitHub OAuth2 app. For example: your-oauth2-client-secret + * @param {string} clientSecret - 'Client Secret' of GitHub OAuth2 app. For example: 5e07c00000000000000000000000000000198bcc * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -2097,6 +2238,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2112,7 +2254,7 @@ export class Project { * Update the project OAuth2 Gitlab configuration. * * @param {string} params.applicationId - 'Application ID' of Gitlab OAuth2 app. For example: d41ffe0000000000000000000000000000000000000000000000000000d5e252 - * @param {string} params.secret - 'Secret' of Gitlab OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.secret - 'Secret' of Gitlab OAuth2 app. For example: gloas-838cfa0000000000000000000000000000000000000000000000000000ecbb38 * @param {string} params.endpoint - Endpoint URL of self-hosted GitLab instance. For example: https://gitlab.com * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} @@ -2123,7 +2265,7 @@ export class Project { * Update the project OAuth2 Gitlab configuration. * * @param {string} applicationId - 'Application ID' of Gitlab OAuth2 app. For example: d41ffe0000000000000000000000000000000000000000000000000000d5e252 - * @param {string} secret - 'Secret' of Gitlab OAuth2 app. For example: your-oauth2-client-secret + * @param {string} secret - 'Secret' of Gitlab OAuth2 app. For example: gloas-838cfa0000000000000000000000000000000000000000000000000000ecbb38 * @param {string} endpoint - Endpoint URL of self-hosted GitLab instance. For example: https://gitlab.com * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} @@ -2171,6 +2313,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2186,7 +2329,7 @@ export class Project { * Update the project OAuth2 Google configuration. * * @param {string} params.clientId - 'Client ID' of Google OAuth2 app. For example: 120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com - * @param {string} params.clientSecret - 'Client Secret' of Google OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.clientSecret - 'Client Secret' of Google OAuth2 app. For example: GOCSPX-2k8gsR0000000000000000VNahJj * @param {ProjectOAuth2GooglePrompt[]} params.prompt - Array of Google OAuth2 prompt values. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. Must not be specified with other values. "consent" means: prompt the user for consent. "select_account" means: prompt the user to select an account. * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} @@ -2197,7 +2340,7 @@ export class Project { * Update the project OAuth2 Google configuration. * * @param {string} clientId - 'Client ID' of Google OAuth2 app. For example: 120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com - * @param {string} clientSecret - 'Client Secret' of Google OAuth2 app. For example: your-oauth2-client-secret + * @param {string} clientSecret - 'Client Secret' of Google OAuth2 app. For example: GOCSPX-2k8gsR0000000000000000VNahJj * @param {ProjectOAuth2GooglePrompt[]} prompt - Array of Google OAuth2 prompt values. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. Must not be specified with other values. "consent" means: prompt the user for consent. "select_account" means: prompt the user to select an account. * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} @@ -2245,6 +2388,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2260,7 +2404,7 @@ export class Project { * Update the project OAuth2 Keycloak configuration. * * @param {string} params.clientId - 'Client ID' of Keycloak OAuth2 app. For example: appwrite-o0000000st-app - * @param {string} params.clientSecret - 'Client Secret' of Keycloak OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.clientSecret - 'Client Secret' of Keycloak OAuth2 app. For example: jdjrJd00000000000000000000HUsaZO * @param {string} params.endpoint - Domain of Keycloak instance. For example: keycloak.example.com * @param {string} params.realmName - Keycloak realm name. For example: appwrite-realm * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. @@ -2272,7 +2416,7 @@ export class Project { * Update the project OAuth2 Keycloak configuration. * * @param {string} clientId - 'Client ID' of Keycloak OAuth2 app. For example: appwrite-o0000000st-app - * @param {string} clientSecret - 'Client Secret' of Keycloak OAuth2 app. For example: your-oauth2-client-secret + * @param {string} clientSecret - 'Client Secret' of Keycloak OAuth2 app. For example: jdjrJd00000000000000000000HUsaZO * @param {string} endpoint - Domain of Keycloak instance. For example: keycloak.example.com * @param {string} realmName - Keycloak realm name. For example: appwrite-realm * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. @@ -2326,6 +2470,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2341,7 +2486,7 @@ export class Project { * Update the project OAuth2 Kick configuration. * * @param {string} params.clientId - 'Client ID' of Kick OAuth2 app. For example: 01KQ7C00000000000001MFHS32 - * @param {string} params.clientSecret - 'Client Secret' of Kick OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.clientSecret - 'Client Secret' of Kick OAuth2 app. For example: 34ac5600000000000000000000000000000000000000000000000000e830c8b * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -2351,7 +2496,7 @@ export class Project { * Update the project OAuth2 Kick configuration. * * @param {string} clientId - 'Client ID' of Kick OAuth2 app. For example: 01KQ7C00000000000001MFHS32 - * @param {string} clientSecret - 'Client Secret' of Kick OAuth2 app. For example: your-oauth2-client-secret + * @param {string} clientSecret - 'Client Secret' of Kick OAuth2 app. For example: 34ac5600000000000000000000000000000000000000000000000000e830c8b * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -2393,6 +2538,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2408,7 +2554,7 @@ export class Project { * Update the project OAuth2 Linkedin configuration. * * @param {string} params.clientId - 'Client ID' of Linkedin OAuth2 app. For example: 770000000000dv - * @param {string} params.primaryClientSecret - 'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.primaryClientSecret - 'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: WPL_AP1.2Bf0000000000000./HtlYw== * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -2418,7 +2564,7 @@ export class Project { * Update the project OAuth2 Linkedin configuration. * * @param {string} clientId - 'Client ID' of Linkedin OAuth2 app. For example: 770000000000dv - * @param {string} primaryClientSecret - 'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: your-oauth2-client-secret + * @param {string} primaryClientSecret - 'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: WPL_AP1.2Bf0000000000000./HtlYw== * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -2460,6 +2606,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2475,7 +2622,7 @@ export class Project { * Update the project OAuth2 Microsoft configuration. * * @param {string} params.applicationId - 'Entra ID Application ID, also known as Client ID' of Microsoft OAuth2 app. For example: 00001111-aaaa-2222-bbbb-3333cccc4444 - * @param {string} params.applicationSecret - 'Entra ID Application Secret, also known as Client Secret' of Microsoft OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.applicationSecret - 'Entra ID Application Secret, also known as Client Secret' of Microsoft OAuth2 app. For example: A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u * @param {string} params.tenant - Microsoft Entra ID tenant identifier. Use 'common', 'organizations', 'consumers' or a specific tenant ID. For example: common * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} @@ -2486,7 +2633,7 @@ export class Project { * Update the project OAuth2 Microsoft configuration. * * @param {string} applicationId - 'Entra ID Application ID, also known as Client ID' of Microsoft OAuth2 app. For example: 00001111-aaaa-2222-bbbb-3333cccc4444 - * @param {string} applicationSecret - 'Entra ID Application Secret, also known as Client Secret' of Microsoft OAuth2 app. For example: your-oauth2-client-secret + * @param {string} applicationSecret - 'Entra ID Application Secret, also known as Client Secret' of Microsoft OAuth2 app. For example: A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u * @param {string} tenant - Microsoft Entra ID tenant identifier. Use 'common', 'organizations', 'consumers' or a specific tenant ID. For example: common * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} @@ -2534,6 +2681,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2549,7 +2697,7 @@ export class Project { * Update the project OAuth2 Notion configuration. * * @param {string} params.oauthClientId - 'OAuth Client ID' of Notion OAuth2 app. For example: 341d8700-0000-0000-0000-000000446ee3 - * @param {string} params.oauthClientSecret - 'OAuth Client Secret' of Notion OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.oauthClientSecret - 'OAuth Client Secret' of Notion OAuth2 app. For example: secret_dLUr4b000000000000000000000000000000lFHAa9 * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -2559,7 +2707,7 @@ export class Project { * Update the project OAuth2 Notion configuration. * * @param {string} oauthClientId - 'OAuth Client ID' of Notion OAuth2 app. For example: 341d8700-0000-0000-0000-000000446ee3 - * @param {string} oauthClientSecret - 'OAuth Client Secret' of Notion OAuth2 app. For example: your-oauth2-client-secret + * @param {string} oauthClientSecret - 'OAuth Client Secret' of Notion OAuth2 app. For example: secret_dLUr4b000000000000000000000000000000lFHAa9 * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -2601,6 +2749,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2616,7 +2765,7 @@ export class Project { * Update the project OAuth2 Oidc configuration. * * @param {string} params.clientId - 'Client ID' of Oidc OAuth2 app. For example: qibI2x0000000000000000000000000006L2YFoG - * @param {string} params.clientSecret - 'Client Secret' of Oidc OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.clientSecret - 'Client Secret' of Oidc OAuth2 app. For example: Ah68ed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003qpcHV * @param {string} params.wellKnownURL - OpenID Connect well-known configuration URL. When provided, authorization, token, and user info endpoints can be discovered automatically. For example: https://myoauth.com/.well-known/openid-configuration * @param {string} params.authorizationURL - OpenID Connect authorization endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/authorize * @param {string} params.tokenURL - OpenID Connect token endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/token @@ -2630,7 +2779,7 @@ export class Project { * Update the project OAuth2 Oidc configuration. * * @param {string} clientId - 'Client ID' of Oidc OAuth2 app. For example: qibI2x0000000000000000000000000006L2YFoG - * @param {string} clientSecret - 'Client Secret' of Oidc OAuth2 app. For example: your-oauth2-client-secret + * @param {string} clientSecret - 'Client Secret' of Oidc OAuth2 app. For example: Ah68ed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003qpcHV * @param {string} wellKnownURL - OpenID Connect well-known configuration URL. When provided, authorization, token, and user info endpoints can be discovered automatically. For example: https://myoauth.com/.well-known/openid-configuration * @param {string} authorizationURL - OpenID Connect authorization endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/authorize * @param {string} tokenURL - OpenID Connect token endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/token @@ -2696,6 +2845,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2711,7 +2861,7 @@ export class Project { * Update the project OAuth2 Okta configuration. * * @param {string} params.clientId - 'Client ID' of Okta OAuth2 app. For example: 0oa00000000000000698 - * @param {string} params.clientSecret - 'Client Secret' of Okta OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.clientSecret - 'Client Secret' of Okta OAuth2 app. For example: Kiq0000000000000000000000000000000000000-00000000000H2L5-3SJ-vRV * @param {string} params.domain - Okta company domain. Required when enabling the provider. For example: trial-6400025.okta.com. Example of wrong value: trial-6400025-admin.okta.com, or https://trial-6400025.okta.com/ * @param {string} params.authorizationServerId - Custom Authorization Servers. Optional, can be left empty or unconfigured. For example: aus000000000000000h7z * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. @@ -2723,7 +2873,7 @@ export class Project { * Update the project OAuth2 Okta configuration. * * @param {string} clientId - 'Client ID' of Okta OAuth2 app. For example: 0oa00000000000000698 - * @param {string} clientSecret - 'Client Secret' of Okta OAuth2 app. For example: your-oauth2-client-secret + * @param {string} clientSecret - 'Client Secret' of Okta OAuth2 app. For example: Kiq0000000000000000000000000000000000000-00000000000H2L5-3SJ-vRV * @param {string} domain - Okta company domain. Required when enabling the provider. For example: trial-6400025.okta.com. Example of wrong value: trial-6400025-admin.okta.com, or https://trial-6400025.okta.com/ * @param {string} authorizationServerId - Custom Authorization Servers. Optional, can be left empty or unconfigured. For example: aus000000000000000h7z * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. @@ -2777,6 +2927,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2792,7 +2943,7 @@ export class Project { * Update the project OAuth2 Paypal configuration. * * @param {string} params.clientId - 'Client ID' of Paypal OAuth2 app. For example: AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB - * @param {string} params.secretKey - 'Secret Key 1 or Secret Key 2' of Paypal OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.secretKey - 'Secret Key 1 or Secret Key 2' of Paypal OAuth2 app. For example: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -2802,7 +2953,7 @@ export class Project { * Update the project OAuth2 Paypal configuration. * * @param {string} clientId - 'Client ID' of Paypal OAuth2 app. For example: AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB - * @param {string} secretKey - 'Secret Key 1 or Secret Key 2' of Paypal OAuth2 app. For example: your-oauth2-client-secret + * @param {string} secretKey - 'Secret Key 1 or Secret Key 2' of Paypal OAuth2 app. For example: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -2844,6 +2995,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2859,7 +3011,7 @@ export class Project { * Update the project OAuth2 PaypalSandbox configuration. * * @param {string} params.clientId - 'Client ID' of PaypalSandbox OAuth2 app. For example: AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB - * @param {string} params.secretKey - 'Secret Key 1 or Secret Key 2' of PaypalSandbox OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.secretKey - 'Secret Key 1 or Secret Key 2' of PaypalSandbox OAuth2 app. For example: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -2869,7 +3021,7 @@ export class Project { * Update the project OAuth2 PaypalSandbox configuration. * * @param {string} clientId - 'Client ID' of PaypalSandbox OAuth2 app. For example: AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB - * @param {string} secretKey - 'Secret Key 1 or Secret Key 2' of PaypalSandbox OAuth2 app. For example: your-oauth2-client-secret + * @param {string} secretKey - 'Secret Key 1 or Secret Key 2' of PaypalSandbox OAuth2 app. For example: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -2911,6 +3063,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2926,7 +3079,7 @@ export class Project { * Update the project OAuth2 Podio configuration. * * @param {string} params.clientId - 'Client ID' of Podio OAuth2 app. For example: appwrite-o0000000st-app - * @param {string} params.clientSecret - 'Client Secret' of Podio OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.clientSecret - 'Client Secret' of Podio OAuth2 app. For example: Rn247T0000000000000000000000000000000000000000000000000000W2zWTN * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -2936,7 +3089,7 @@ export class Project { * Update the project OAuth2 Podio configuration. * * @param {string} clientId - 'Client ID' of Podio OAuth2 app. For example: appwrite-o0000000st-app - * @param {string} clientSecret - 'Client Secret' of Podio OAuth2 app. For example: your-oauth2-client-secret + * @param {string} clientSecret - 'Client Secret' of Podio OAuth2 app. For example: Rn247T0000000000000000000000000000000000000000000000000000W2zWTN * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -2978,6 +3131,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2993,7 +3147,7 @@ export class Project { * Update the project OAuth2 Salesforce configuration. * * @param {string} params.customerKey - 'Consumer Key' of Salesforce OAuth2 app. For example: 3MVG9I0000000000000000000000000000000000000000000000000000000000000000000000000C5Aejq - * @param {string} params.customerSecret - 'Consumer Secret' of Salesforce OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.customerSecret - 'Consumer Secret' of Salesforce OAuth2 app. For example: 3w000000000000e2 * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3003,7 +3157,7 @@ export class Project { * Update the project OAuth2 Salesforce configuration. * * @param {string} customerKey - 'Consumer Key' of Salesforce OAuth2 app. For example: 3MVG9I0000000000000000000000000000000000000000000000000000000000000000000000000C5Aejq - * @param {string} customerSecret - 'Consumer Secret' of Salesforce OAuth2 app. For example: your-oauth2-client-secret + * @param {string} customerSecret - 'Consumer Secret' of Salesforce OAuth2 app. For example: 3w000000000000e2 * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3045,6 +3199,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3060,7 +3215,7 @@ export class Project { * Update the project OAuth2 Slack configuration. * * @param {string} params.clientId - 'Client ID' of Slack OAuth2 app. For example: 23000000089.15000000000023 - * @param {string} params.clientSecret - 'Client Secret' of Slack OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.clientSecret - 'Client Secret' of Slack OAuth2 app. For example: 81656000000000000000000000f3d2fd * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3070,7 +3225,7 @@ export class Project { * Update the project OAuth2 Slack configuration. * * @param {string} clientId - 'Client ID' of Slack OAuth2 app. For example: 23000000089.15000000000023 - * @param {string} clientSecret - 'Client Secret' of Slack OAuth2 app. For example: your-oauth2-client-secret + * @param {string} clientSecret - 'Client Secret' of Slack OAuth2 app. For example: 81656000000000000000000000f3d2fd * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3112,6 +3267,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3127,7 +3283,7 @@ export class Project { * Update the project OAuth2 Spotify configuration. * * @param {string} params.clientId - 'Client ID' of Spotify OAuth2 app. For example: 6ec271000000000000000000009beace - * @param {string} params.clientSecret - 'Client Secret' of Spotify OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.clientSecret - 'Client Secret' of Spotify OAuth2 app. For example: db068a000000000000000000008b5b9f * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3137,7 +3293,7 @@ export class Project { * Update the project OAuth2 Spotify configuration. * * @param {string} clientId - 'Client ID' of Spotify OAuth2 app. For example: 6ec271000000000000000000009beace - * @param {string} clientSecret - 'Client Secret' of Spotify OAuth2 app. For example: your-oauth2-client-secret + * @param {string} clientSecret - 'Client Secret' of Spotify OAuth2 app. For example: db068a000000000000000000008b5b9f * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3179,6 +3335,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3194,7 +3351,7 @@ export class Project { * Update the project OAuth2 Stripe configuration. * * @param {string} params.clientId - 'Client ID' of Stripe OAuth2 app. For example: ca_UKibXX0000000000000000000006byvR - * @param {string} params.apiSecretKey - 'API Secret Key' of Stripe OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.apiSecretKey - 'API Secret Key' of Stripe OAuth2 app. For example: sk_51SfOd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000QGWYfp * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3204,7 +3361,7 @@ export class Project { * Update the project OAuth2 Stripe configuration. * * @param {string} clientId - 'Client ID' of Stripe OAuth2 app. For example: ca_UKibXX0000000000000000000006byvR - * @param {string} apiSecretKey - 'API Secret Key' of Stripe OAuth2 app. For example: your-oauth2-client-secret + * @param {string} apiSecretKey - 'API Secret Key' of Stripe OAuth2 app. For example: sk_51SfOd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000QGWYfp * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3246,6 +3403,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3261,7 +3419,7 @@ export class Project { * Update the project OAuth2 Tradeshift configuration. * * @param {string} params.oauth2ClientId - 'OAuth2 Client ID' of Tradeshift OAuth2 app. For example: appwrite-tes00000.0000000000est-app - * @param {string} params.oauth2ClientSecret - 'OAuth2 Client Secret' of Tradeshift OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.oauth2ClientSecret - 'OAuth2 Client Secret' of Tradeshift OAuth2 app. For example: 7cb52700-0000-0000-0000-000000ca5b83 * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3271,7 +3429,7 @@ export class Project { * Update the project OAuth2 Tradeshift configuration. * * @param {string} oauth2ClientId - 'OAuth2 Client ID' of Tradeshift OAuth2 app. For example: appwrite-tes00000.0000000000est-app - * @param {string} oauth2ClientSecret - 'OAuth2 Client Secret' of Tradeshift OAuth2 app. For example: your-oauth2-client-secret + * @param {string} oauth2ClientSecret - 'OAuth2 Client Secret' of Tradeshift OAuth2 app. For example: 7cb52700-0000-0000-0000-000000ca5b83 * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3313,6 +3471,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3328,7 +3487,7 @@ export class Project { * Update the project OAuth2 Tradeshift Sandbox configuration. * * @param {string} params.oauth2ClientId - 'OAuth2 Client ID' of Tradeshift Sandbox OAuth2 app. For example: appwrite-tes00000.0000000000est-app - * @param {string} params.oauth2ClientSecret - 'OAuth2 Client Secret' of Tradeshift Sandbox OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.oauth2ClientSecret - 'OAuth2 Client Secret' of Tradeshift Sandbox OAuth2 app. For example: 7cb52700-0000-0000-0000-000000ca5b83 * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3338,7 +3497,7 @@ export class Project { * Update the project OAuth2 Tradeshift Sandbox configuration. * * @param {string} oauth2ClientId - 'OAuth2 Client ID' of Tradeshift Sandbox OAuth2 app. For example: appwrite-tes00000.0000000000est-app - * @param {string} oauth2ClientSecret - 'OAuth2 Client Secret' of Tradeshift Sandbox OAuth2 app. For example: your-oauth2-client-secret + * @param {string} oauth2ClientSecret - 'OAuth2 Client Secret' of Tradeshift Sandbox OAuth2 app. For example: 7cb52700-0000-0000-0000-000000ca5b83 * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3380,6 +3539,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3395,7 +3555,7 @@ export class Project { * Update the project OAuth2 Twitch configuration. * * @param {string} params.clientId - 'Client ID' of Twitch OAuth2 app. For example: vvi0in000000000000000000ikmt9p - * @param {string} params.clientSecret - 'Client Secret' of Twitch OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.clientSecret - 'Client Secret' of Twitch OAuth2 app. For example: pmapue000000000000000000zylw3v * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3405,7 +3565,7 @@ export class Project { * Update the project OAuth2 Twitch configuration. * * @param {string} clientId - 'Client ID' of Twitch OAuth2 app. For example: vvi0in000000000000000000ikmt9p - * @param {string} clientSecret - 'Client Secret' of Twitch OAuth2 app. For example: your-oauth2-client-secret + * @param {string} clientSecret - 'Client Secret' of Twitch OAuth2 app. For example: pmapue000000000000000000zylw3v * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3447,6 +3607,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3462,7 +3623,7 @@ export class Project { * Update the project OAuth2 WordPress configuration. * * @param {string} params.clientId - 'Client ID' of WordPress OAuth2 app. For example: 130005 - * @param {string} params.clientSecret - 'Client Secret' of WordPress OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.clientSecret - 'Client Secret' of WordPress OAuth2 app. For example: PlBfJS0000000000000000000000000000000000000000000000000000EdUZJk * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3472,7 +3633,7 @@ export class Project { * Update the project OAuth2 WordPress configuration. * * @param {string} clientId - 'Client ID' of WordPress OAuth2 app. For example: 130005 - * @param {string} clientSecret - 'Client Secret' of WordPress OAuth2 app. For example: your-oauth2-client-secret + * @param {string} clientSecret - 'Client Secret' of WordPress OAuth2 app. For example: PlBfJS0000000000000000000000000000000000000000000000000000EdUZJk * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3514,6 +3675,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3529,7 +3691,7 @@ export class Project { * Update the project OAuth2 X configuration. * * @param {string} params.customerKey - 'Customer Key' of X OAuth2 app. For example: slzZV0000000000000NFLaWT - * @param {string} params.secretKey - 'Secret Key' of X OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.secretKey - 'Secret Key' of X OAuth2 app. For example: tkEPkp00000000000000000000000000000000000000FTxbI9 * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3539,7 +3701,7 @@ export class Project { * Update the project OAuth2 X configuration. * * @param {string} customerKey - 'Customer Key' of X OAuth2 app. For example: slzZV0000000000000NFLaWT - * @param {string} secretKey - 'Secret Key' of X OAuth2 app. For example: your-oauth2-client-secret + * @param {string} secretKey - 'Secret Key' of X OAuth2 app. For example: tkEPkp00000000000000000000000000000000000000FTxbI9 * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3581,6 +3743,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3596,7 +3759,7 @@ export class Project { * Update the project OAuth2 Yahoo configuration. * * @param {string} params.clientId - 'Client ID, also known as Customer Key' of Yahoo OAuth2 app. For example: dj0yJm000000000000000000000000000000000000000000000000000000000000000000000000000000000000Z4PWRm - * @param {string} params.clientSecret - 'Client Secret, also known as Customer Secret' of Yahoo OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.clientSecret - 'Client Secret, also known as Customer Secret' of Yahoo OAuth2 app. For example: cf978f0000000000000000000000000000c5e2e9 * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3606,7 +3769,7 @@ export class Project { * Update the project OAuth2 Yahoo configuration. * * @param {string} clientId - 'Client ID, also known as Customer Key' of Yahoo OAuth2 app. For example: dj0yJm000000000000000000000000000000000000000000000000000000000000000000000000000000000000Z4PWRm - * @param {string} clientSecret - 'Client Secret, also known as Customer Secret' of Yahoo OAuth2 app. For example: your-oauth2-client-secret + * @param {string} clientSecret - 'Client Secret, also known as Customer Secret' of Yahoo OAuth2 app. For example: cf978f0000000000000000000000000000c5e2e9 * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3648,6 +3811,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3663,7 +3827,7 @@ export class Project { * Update the project OAuth2 Yandex configuration. * * @param {string} params.clientId - 'Client ID' of Yandex OAuth2 app. For example: 6a8a6a0000000000000000000091483c - * @param {string} params.clientSecret - 'Client Secret' of Yandex OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.clientSecret - 'Client Secret' of Yandex OAuth2 app. For example: bbf98500000000000000000000c75a63 * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3673,7 +3837,7 @@ export class Project { * Update the project OAuth2 Yandex configuration. * * @param {string} clientId - 'Client ID' of Yandex OAuth2 app. For example: 6a8a6a0000000000000000000091483c - * @param {string} clientSecret - 'Client Secret' of Yandex OAuth2 app. For example: your-oauth2-client-secret + * @param {string} clientSecret - 'Client Secret' of Yandex OAuth2 app. For example: bbf98500000000000000000000c75a63 * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3715,6 +3879,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3730,7 +3895,7 @@ export class Project { * Update the project OAuth2 Zoho configuration. * * @param {string} params.clientId - 'Client ID' of Zoho OAuth2 app. For example: 1000.83C178000000000000000000RPNX0B - * @param {string} params.clientSecret - 'Client Secret' of Zoho OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.clientSecret - 'Client Secret' of Zoho OAuth2 app. For example: fb5cac000000000000000000000000000000a68f6e * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3740,7 +3905,7 @@ export class Project { * Update the project OAuth2 Zoho configuration. * * @param {string} clientId - 'Client ID' of Zoho OAuth2 app. For example: 1000.83C178000000000000000000RPNX0B - * @param {string} clientSecret - 'Client Secret' of Zoho OAuth2 app. For example: your-oauth2-client-secret + * @param {string} clientSecret - 'Client Secret' of Zoho OAuth2 app. For example: fb5cac000000000000000000000000000000a68f6e * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3782,6 +3947,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3797,7 +3963,7 @@ export class Project { * Update the project OAuth2 Zoom configuration. * * @param {string} params.clientId - 'Client ID' of Zoom OAuth2 app. For example: QMAC00000000000000w0AQ - * @param {string} params.clientSecret - 'Client Secret' of Zoom OAuth2 app. For example: your-oauth2-client-secret + * @param {string} params.clientSecret - 'Client Secret' of Zoom OAuth2 app. For example: GAWsG4000000000000000000007U01ON * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3807,7 +3973,7 @@ export class Project { * Update the project OAuth2 Zoom configuration. * * @param {string} clientId - 'Client ID' of Zoom OAuth2 app. For example: QMAC00000000000000w0AQ - * @param {string} clientSecret - 'Client Secret' of Zoom OAuth2 app. For example: your-oauth2-client-secret + * @param {string} clientSecret - 'Client Secret' of Zoom OAuth2 app. For example: GAWsG4000000000000000000007U01ON * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} @@ -3849,6 +4015,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3901,6 +4068,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -3960,6 +4128,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -4035,6 +4204,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4108,6 +4278,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4184,6 +4355,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4257,6 +4429,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4333,6 +4506,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4406,6 +4580,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4482,6 +4657,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4555,6 +4731,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4631,6 +4808,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4704,6 +4882,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4756,6 +4935,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -4807,6 +4987,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4867,6 +5048,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -4921,6 +5103,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4976,6 +5159,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -5031,6 +5215,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -5112,6 +5297,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -5167,6 +5353,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -5226,6 +5413,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -5281,6 +5469,89 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the password strength requirements for users in the project. + * + * @param {number} params.min - Minimum password length. Value must be between 8 and 256. Default is 8. + * @param {boolean} params.uppercase - Whether passwords must include at least one uppercase letter. + * @param {boolean} params.lowercase - Whether passwords must include at least one lowercase letter. + * @param {boolean} params.number - Whether passwords must include at least one number. + * @param {boolean} params.symbols - Whether passwords must include at least one symbol. + * @throws {AppwriteException} + * @returns {Promise} + */ + updatePasswordStrengthPolicy(params?: { min?: number, uppercase?: boolean, lowercase?: boolean, number?: boolean, symbols?: boolean }): Promise; + /** + * Update the password strength requirements for users in the project. + * + * @param {number} min - Minimum password length. Value must be between 8 and 256. Default is 8. + * @param {boolean} uppercase - Whether passwords must include at least one uppercase letter. + * @param {boolean} lowercase - Whether passwords must include at least one lowercase letter. + * @param {boolean} number - Whether passwords must include at least one number. + * @param {boolean} symbols - Whether passwords must include at least one symbol. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updatePasswordStrengthPolicy(min?: number, uppercase?: boolean, lowercase?: boolean, number?: boolean, symbols?: boolean): Promise; + updatePasswordStrengthPolicy( + paramsOrFirst?: { min?: number, uppercase?: boolean, lowercase?: boolean, number?: boolean, symbols?: boolean } | number, + ...rest: [(boolean)?, (boolean)?, (boolean)?, (boolean)?] + ): Promise { + let params: { min?: number, uppercase?: boolean, lowercase?: boolean, number?: boolean, symbols?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { min?: number, uppercase?: boolean, lowercase?: boolean, number?: boolean, symbols?: boolean }; + } else { + params = { + min: paramsOrFirst as number, + uppercase: rest[0] as boolean, + lowercase: rest[1] as boolean, + number: rest[2] as boolean, + symbols: rest[3] as boolean + }; + } + + const min = params.min; + const uppercase = params.uppercase; + const lowercase = params.lowercase; + const number = params.number; + const symbols = params.symbols; + + + const apiPath = '/project/policies/password-strength'; + const payload: Payload = {}; + if (typeof min !== 'undefined') { + payload['min'] = min; + } + if (typeof uppercase !== 'undefined') { + payload['uppercase'] = uppercase; + } + if (typeof lowercase !== 'undefined') { + payload['lowercase'] = lowercase; + } + if (typeof number !== 'undefined') { + payload['number'] = number; + } + if (typeof symbols !== 'undefined') { + payload['symbols'] = symbols; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -5336,6 +5607,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -5391,6 +5663,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -5446,6 +5719,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -5501,6 +5775,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -5556,6 +5831,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -5570,23 +5846,23 @@ export class Project { /** * Get a policy by its unique ID. This endpoint returns the current configuration for the requested project policy. * - * @param {ProjectPolicyId} params.policyId - Policy ID. Can be one of: password-dictionary, password-history, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy, deny-aliased-email, deny-disposable-email, deny-free-email. + * @param {ProjectPolicyId} params.policyId - Policy ID. Can be one of: password-dictionary, password-history, password-strength, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy, deny-aliased-email, deny-disposable-email, deny-free-email. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} */ - getPolicy(params: { policyId: ProjectPolicyId }): Promise; + getPolicy(params: { policyId: ProjectPolicyId }): Promise; /** * Get a policy by its unique ID. This endpoint returns the current configuration for the requested project policy. * - * @param {ProjectPolicyId} policyId - Policy ID. Can be one of: password-dictionary, password-history, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy, deny-aliased-email, deny-disposable-email, deny-free-email. + * @param {ProjectPolicyId} policyId - Policy ID. Can be one of: password-dictionary, password-history, password-strength, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy, deny-aliased-email, deny-disposable-email, deny-free-email. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getPolicy(policyId: ProjectPolicyId): Promise; + getPolicy(policyId: ProjectPolicyId): Promise; getPolicy( paramsOrFirst: { policyId: ProjectPolicyId } | ProjectPolicyId - ): Promise { + ): Promise { let params: { policyId: ProjectPolicyId }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('policyId' in paramsOrFirst))) { @@ -5608,6 +5884,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -5670,6 +5947,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -5733,6 +6011,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -5849,6 +6128,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -5904,6 +6184,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -5964,6 +6245,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -6068,6 +6350,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -6128,6 +6411,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -6187,6 +6471,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -6269,6 +6554,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -6321,6 +6607,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -6394,6 +6681,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -6446,6 +6734,7 @@ export class Project { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } diff --git a/src/services/proxy.ts b/src/services/proxy.ts index 83e4ecc8..b5a90b5b 100644 --- a/src/services/proxy.ts +++ b/src/services/proxy.ts @@ -61,6 +61,7 @@ export class Proxy { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -119,6 +120,7 @@ export class Proxy { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -196,6 +198,7 @@ export class Proxy { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -296,6 +299,7 @@ export class Proxy { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -373,6 +377,7 @@ export class Proxy { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -425,6 +430,7 @@ export class Proxy { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -476,6 +482,7 @@ export class Proxy { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -528,6 +535,7 @@ export class Proxy { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } diff --git a/src/services/sites.ts b/src/services/sites.ts index d935cda7..6d6cdcef 100644 --- a/src/services/sites.ts +++ b/src/services/sites.ts @@ -73,6 +73,7 @@ export class Sites { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -291,6 +292,7 @@ export class Sites { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -315,6 +317,7 @@ export class Sites { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -338,6 +341,7 @@ export class Sites { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -389,6 +393,7 @@ export class Sites { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -601,6 +606,7 @@ export class Sites { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -653,6 +659,7 @@ export class Sites { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -716,6 +723,7 @@ export class Sites { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -790,6 +798,7 @@ export class Sites { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -883,6 +892,7 @@ export class Sites { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'multipart/form-data', } @@ -947,6 +957,7 @@ export class Sites { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1061,6 +1072,7 @@ export class Sites { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1145,6 +1157,7 @@ export class Sites { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1205,6 +1218,7 @@ export class Sites { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -1264,6 +1278,7 @@ export class Sites { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1331,6 +1346,7 @@ export class Sites { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -1391,6 +1407,7 @@ export class Sites { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1458,6 +1475,7 @@ export class Sites { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -1517,6 +1535,7 @@ export class Sites { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -1576,6 +1595,7 @@ export class Sites { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1643,6 +1663,7 @@ export class Sites { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -1732,6 +1753,7 @@ export class Sites { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1792,6 +1814,7 @@ export class Sites { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -1872,6 +1895,7 @@ export class Sites { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1932,6 +1956,7 @@ export class Sites { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } diff --git a/src/services/storage.ts b/src/services/storage.ts index f38792b7..e9b4d62e 100644 --- a/src/services/storage.ts +++ b/src/services/storage.ts @@ -70,6 +70,7 @@ export class Storage { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -198,6 +199,7 @@ export class Storage { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -250,6 +252,7 @@ export class Storage { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -375,6 +378,7 @@ export class Storage { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -427,6 +431,7 @@ export class Storage { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -501,6 +506,7 @@ export class Storage { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -597,6 +603,7 @@ export class Storage { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'multipart/form-data', } @@ -658,6 +665,7 @@ export class Storage { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -731,6 +739,7 @@ export class Storage { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -791,6 +800,7 @@ export class Storage { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -858,6 +868,7 @@ export class Storage { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -1002,6 +1013,7 @@ export class Storage { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -1069,6 +1081,7 @@ export class Storage { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( diff --git a/src/services/tables-db.ts b/src/services/tables-db.ts index 40766d5e..811cd775 100644 --- a/src/services/tables-db.ts +++ b/src/services/tables-db.ts @@ -70,6 +70,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -144,6 +145,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -196,6 +198,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -247,6 +250,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -299,6 +303,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -365,6 +370,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -417,6 +423,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -477,6 +484,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -529,6 +537,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -595,6 +604,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -647,6 +657,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -721,6 +732,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -828,6 +840,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -888,6 +901,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -982,6 +996,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1042,6 +1057,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1116,6 +1132,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -1225,6 +1242,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1335,6 +1353,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1431,6 +1450,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1525,6 +1545,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1619,6 +1640,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1713,6 +1735,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1809,6 +1832,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1905,6 +1929,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2009,6 +2034,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2115,6 +2141,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2225,6 +2252,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2335,6 +2363,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2445,6 +2474,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2555,6 +2585,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2651,6 +2682,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2747,6 +2779,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2834,6 +2867,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2925,6 +2959,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3028,6 +3063,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3124,6 +3160,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3227,6 +3264,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3323,6 +3361,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3410,6 +3449,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3501,6 +3541,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3588,6 +3629,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3679,6 +3721,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3789,6 +3832,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3903,6 +3947,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4007,6 +4052,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4110,6 +4156,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4206,6 +4253,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4302,6 +4350,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4398,6 +4447,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4511,6 +4561,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4614,6 +4665,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4681,6 +4733,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -4747,6 +4800,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4830,6 +4884,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -4904,6 +4959,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -5009,6 +5065,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -5076,6 +5133,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -5142,6 +5200,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -5230,6 +5289,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -5323,6 +5383,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -5400,6 +5461,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -5479,6 +5541,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -5560,6 +5623,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -5634,6 +5698,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -5715,6 +5780,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -5802,6 +5868,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -5890,6 +5957,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -5964,6 +6032,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -6059,6 +6128,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -6154,6 +6224,7 @@ export class TablesDB { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } diff --git a/src/services/teams.ts b/src/services/teams.ts index 21e81152..9c298cb5 100644 --- a/src/services/teams.ts +++ b/src/services/teams.ts @@ -66,6 +66,7 @@ export class Teams { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -138,6 +139,7 @@ export class Teams { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -190,6 +192,7 @@ export class Teams { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -252,6 +255,7 @@ export class Teams { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -304,6 +308,7 @@ export class Teams { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -378,6 +383,7 @@ export class Teams { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -489,6 +495,7 @@ export class Teams { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -549,6 +556,7 @@ export class Teams { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -620,6 +628,7 @@ export class Teams { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -680,6 +689,7 @@ export class Teams { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -766,6 +776,7 @@ export class Teams { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -818,6 +829,7 @@ export class Teams { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -880,6 +892,7 @@ export class Teams { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } diff --git a/src/services/tokens.ts b/src/services/tokens.ts index 1e453a72..368d4a19 100644 --- a/src/services/tokens.ts +++ b/src/services/tokens.ts @@ -73,6 +73,7 @@ export class Tokens { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -139,6 +140,7 @@ export class Tokens { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -191,6 +193,7 @@ export class Tokens { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -250,6 +253,7 @@ export class Tokens { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -302,6 +306,7 @@ export class Tokens { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } diff --git a/src/services/usage.ts b/src/services/usage.ts index 551274ee..43499c79 100644 --- a/src/services/usage.ts +++ b/src/services/usage.ts @@ -59,6 +59,7 @@ export class Usage { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -118,6 +119,7 @@ export class Usage { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( diff --git a/src/services/users.ts b/src/services/users.ts index 19faa4d1..61f85f90 100644 --- a/src/services/users.ts +++ b/src/services/users.ts @@ -69,6 +69,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -152,6 +153,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -235,6 +237,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -318,6 +321,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -385,6 +389,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -436,6 +441,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -519,6 +525,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -602,6 +609,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -735,6 +743,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -848,6 +857,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -938,6 +948,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -990,6 +1001,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -1041,6 +1053,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1104,6 +1117,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1169,6 +1183,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1236,6 +1251,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1303,6 +1319,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1370,6 +1387,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -1443,6 +1461,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -1506,6 +1525,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1569,6 +1589,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1630,6 +1651,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1690,6 +1712,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -1743,6 +1766,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -1794,6 +1818,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -1846,6 +1871,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -1897,6 +1923,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -1949,6 +1976,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2001,6 +2029,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2054,6 +2083,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2106,6 +2136,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2169,6 +2200,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2232,6 +2264,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2295,6 +2328,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2347,6 +2381,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -2409,6 +2444,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2469,6 +2505,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -2524,6 +2561,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2576,6 +2614,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2636,6 +2675,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2699,6 +2739,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2766,6 +2807,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -2862,6 +2904,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -2922,6 +2965,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -3002,6 +3046,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3062,6 +3107,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3131,6 +3177,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3194,6 +3241,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -3257,6 +3305,7 @@ export class Users { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } diff --git a/src/services/webhooks.ts b/src/services/webhooks.ts index 796cc425..f73792e7 100644 --- a/src/services/webhooks.ts +++ b/src/services/webhooks.ts @@ -59,6 +59,7 @@ export class Webhooks { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -179,6 +180,7 @@ export class Webhooks { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -231,6 +233,7 @@ export class Webhooks { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, } return this.client.call( @@ -341,6 +344,7 @@ export class Webhooks { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -393,6 +397,7 @@ export class Webhooks { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } @@ -453,6 +458,7 @@ export class Webhooks { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', } diff --git a/test/services/health.test.js b/test/services/health.test.js index 17f087e2..afbf5fa0 100644 --- a/test/services/health.test.js +++ b/test/services/health.test.js @@ -41,6 +41,21 @@ describe('Health', () => { expect(response).toEqual(data); }); + test('test method getAuditsDB()', async () => { + const data = { + 'total': 5, + 'statuses': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await health.getAuditsDB( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method getCache()', async () => { const data = { 'total': 5, diff --git a/test/services/messaging.test.js b/test/services/messaging.test.js index f327a32d..39516336 100644 --- a/test/services/messaging.test.js +++ b/test/services/messaging.test.js @@ -666,6 +666,51 @@ describe('Messaging', () => { expect(response).toEqual(data); }); + test('test method createSesProvider()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'Mailgun', + 'provider': 'mailgun', + 'enabled': true, + 'type': 'sms', + 'credentials': {},}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await messaging.createSesProvider( + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateSesProvider()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'Mailgun', + 'provider': 'mailgun', + 'enabled': true, + 'type': 'sms', + 'credentials': {},}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await messaging.updateSesProvider( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method createSmtpProvider()', async () => { const data = { '\$id': '5e5ea5c16897e', diff --git a/test/services/organization.test.js b/test/services/organization.test.js index b9ede1fc..f5bf2d23 100644 --- a/test/services/organization.test.js +++ b/test/services/organization.test.js @@ -134,6 +134,7 @@ describe('Organization', () => { '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'name': 'New Project', 'teamId': '1592981250', + 'region': 'fra', 'devKeys': [], 'smtpEnabled': true, 'smtpSenderName': 'John Appwrite', @@ -152,9 +153,17 @@ describe('Organization', () => { 'authMethods': [], 'services': [], 'protocols': [], - 'region': 'fra', 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'oAuth2ServerEnabled': true, + 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', + 'oAuth2ServerScopes': [], + 'oAuth2ServerAccessTokenDuration': 3600, + 'oAuth2ServerRefreshTokenDuration': 86400, + 'oAuth2ServerPublicAccessTokenDuration': 3600, + 'oAuth2ServerPublicRefreshTokenDuration': 2592000, + 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await organization.createProject( @@ -175,6 +184,7 @@ describe('Organization', () => { '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'name': 'New Project', 'teamId': '1592981250', + 'region': 'fra', 'devKeys': [], 'smtpEnabled': true, 'smtpSenderName': 'John Appwrite', @@ -193,9 +203,17 @@ describe('Organization', () => { 'authMethods': [], 'services': [], 'protocols': [], - 'region': 'fra', 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'oAuth2ServerEnabled': true, + 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', + 'oAuth2ServerScopes': [], + 'oAuth2ServerAccessTokenDuration': 3600, + 'oAuth2ServerRefreshTokenDuration': 86400, + 'oAuth2ServerPublicAccessTokenDuration': 3600, + 'oAuth2ServerPublicRefreshTokenDuration': 2592000, + 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await organization.getProject( @@ -215,6 +233,7 @@ describe('Organization', () => { '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'name': 'New Project', 'teamId': '1592981250', + 'region': 'fra', 'devKeys': [], 'smtpEnabled': true, 'smtpSenderName': 'John Appwrite', @@ -233,9 +252,17 @@ describe('Organization', () => { 'authMethods': [], 'services': [], 'protocols': [], - 'region': 'fra', 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'oAuth2ServerEnabled': true, + 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', + 'oAuth2ServerScopes': [], + 'oAuth2ServerAccessTokenDuration': 3600, + 'oAuth2ServerRefreshTokenDuration': 86400, + 'oAuth2ServerPublicAccessTokenDuration': 3600, + 'oAuth2ServerPublicRefreshTokenDuration': 2592000, + 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await organization.updateProject( diff --git a/test/services/project.test.js b/test/services/project.test.js index 3f46e8c9..6d825d43 100644 --- a/test/services/project.test.js +++ b/test/services/project.test.js @@ -17,6 +17,7 @@ describe('Project', () => { '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'name': 'New Project', 'teamId': '1592981250', + 'region': 'fra', 'devKeys': [], 'smtpEnabled': true, 'smtpSenderName': 'John Appwrite', @@ -35,9 +36,17 @@ describe('Project', () => { 'authMethods': [], 'services': [], 'protocols': [], - 'region': 'fra', 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'oAuth2ServerEnabled': true, + 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', + 'oAuth2ServerScopes': [], + 'oAuth2ServerAccessTokenDuration': 3600, + 'oAuth2ServerRefreshTokenDuration': 86400, + 'oAuth2ServerPublicAccessTokenDuration': 3600, + 'oAuth2ServerPublicRefreshTokenDuration': 2592000, + 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.get( @@ -69,6 +78,7 @@ describe('Project', () => { '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'name': 'New Project', 'teamId': '1592981250', + 'region': 'fra', 'devKeys': [], 'smtpEnabled': true, 'smtpSenderName': 'John Appwrite', @@ -87,9 +97,17 @@ describe('Project', () => { 'authMethods': [], 'services': [], 'protocols': [], - 'region': 'fra', 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'oAuth2ServerEnabled': true, + 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', + 'oAuth2ServerScopes': [], + 'oAuth2ServerAccessTokenDuration': 3600, + 'oAuth2ServerRefreshTokenDuration': 86400, + 'oAuth2ServerPublicAccessTokenDuration': 3600, + 'oAuth2ServerPublicRefreshTokenDuration': 2592000, + 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateAuthMethod( @@ -236,6 +254,7 @@ describe('Project', () => { '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'name': 'New Project', 'teamId': '1592981250', + 'region': 'fra', 'devKeys': [], 'smtpEnabled': true, 'smtpSenderName': 'John Appwrite', @@ -254,9 +273,17 @@ describe('Project', () => { 'authMethods': [], 'services': [], 'protocols': [], - 'region': 'fra', 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'oAuth2ServerEnabled': true, + 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', + 'oAuth2ServerScopes': [], + 'oAuth2ServerAccessTokenDuration': 3600, + 'oAuth2ServerRefreshTokenDuration': 86400, + 'oAuth2ServerPublicAccessTokenDuration': 3600, + 'oAuth2ServerPublicRefreshTokenDuration': 2592000, + 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateLabels( @@ -369,12 +396,62 @@ describe('Project', () => { expect(response).toEqual(data); }); + test('test method updateOAuth2Server()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'New Project', + 'teamId': '1592981250', + 'region': 'fra', + 'devKeys': [], + 'smtpEnabled': true, + 'smtpSenderName': 'John Appwrite', + 'smtpSenderEmail': 'john@appwrite.io', + 'smtpReplyToName': 'Support Team', + 'smtpReplyToEmail': 'support@appwrite.io', + 'smtpHost': 'mail.appwrite.io', + 'smtpPort': 25, + 'smtpUsername': 'emailuser', + 'smtpPassword': '', + 'smtpSecure': 'tls', + 'pingCount': 1, + 'pingedAt': '2020-10-15T06:38:00.000+00:00', + 'labels': [], + 'status': 'active', + 'authMethods': [], + 'services': [], + 'protocols': [], + 'blocks': [], + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'oAuth2ServerEnabled': true, + 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', + 'oAuth2ServerScopes': [], + 'oAuth2ServerAccessTokenDuration': 3600, + 'oAuth2ServerRefreshTokenDuration': 86400, + 'oAuth2ServerPublicAccessTokenDuration': 3600, + 'oAuth2ServerPublicRefreshTokenDuration': 2592000, + 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2Server( + true, + 'https://example.com', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method updateOAuth2Amazon()', async () => { const data = { '\$id': 'github', 'enabled': true, 'clientId': 'amzn1.application-oa2-client.87400c00000000000000000000063d5b2', - 'clientSecret': 'your-oauth2-client-secret',}; + 'clientSecret': '79ffe4000000000000000000000000000000000000000000000000000002de55',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Amazon( @@ -410,7 +487,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'OaOkIA000000000000000000005KLSYq', - 'clientSecret': 'your-oauth2-client-secret', + 'clientSecret': 'zXz0000-00000000000000000000000000000-00000000000000000000PJafnF', 'endpoint': 'example.us.auth0.com',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -428,7 +505,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'dTKOPa0000000000000000000000000000e7G8hv', - 'clientSecret': 'your-oauth2-client-secret', + 'clientSecret': 'ntQadq000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Hp5WK', 'endpoint': 'example.authentik.com',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -446,7 +523,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': '5zw90v00000000000000000000kVYXN7', - 'clientSecret': 'your-oauth2-client-secret',}; + 'clientSecret': '7I000000000000MW',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Autodesk( @@ -463,7 +540,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'key': 'Knt70000000000ByRc', - 'secret': 'your-oauth2-client-secret',}; + 'secret': 'NMfLZJ00000000000000000000TLQdDx',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Bitbucket( @@ -480,7 +557,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'd95151000000000000000000000000000067af9b', - 'clientSecret': 'your-oauth2-client-secret',}; + 'clientSecret': 'a13e250000000000000000000000000000d73095',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Bitly( @@ -497,7 +574,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'deglcs00000000000000000000x2og6y', - 'clientSecret': 'your-oauth2-client-secret',}; + 'clientSecret': 'OKM1f100000000000000000000eshEif',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Box( @@ -514,7 +591,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'apiKey': '07a9000000000000067f', - 'apiSecret': 'your-oauth2-client-secret',}; + 'apiSecret': 'a399a90000000000000000000000000000d90639',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Dailymotion( @@ -531,7 +608,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': '950722000000343754', - 'clientSecret': 'your-oauth2-client-secret',}; + 'clientSecret': 'YmPXnM000000000000000000002zFg5D',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Discord( @@ -548,7 +625,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'publicKey': 'cgegH70000000000000000000000000000000000000000000000000000Hr1nYX', - 'secretKey': 'your-oauth2-client-secret',}; + 'secretKey': 'W7Bykj00000000000000000000000000000000000000000000000000003o43w9',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Disqus( @@ -565,7 +642,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'appKey': 'jl000000000009t', - 'appSecret': 'your-oauth2-client-secret',}; + 'appSecret': 'g200000000000vw',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Dropbox( @@ -582,7 +659,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'keyString': 'nsgzxh0000000000008j85a2', - 'sharedSecret': 'your-oauth2-client-secret',}; + 'sharedSecret': 'tp000000ru',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Etsy( @@ -599,7 +676,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'appId': '260600000007694', - 'appSecret': 'your-oauth2-client-secret',}; + 'appSecret': '2d0b2800000000000000000000d38af4',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Facebook( @@ -616,7 +693,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'byay5H0000000000VtiI40', - 'clientSecret': 'your-oauth2-client-secret',}; + 'clientSecret': 'yEpOYn0000000000000000004iIsU5',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Figma( @@ -633,7 +710,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'b2222c00-0000-0000-0000-000000862097', - 'clientSecret': 'your-oauth2-client-secret', + 'clientSecret': 'Jx4s0C0000000000000000000000000000000wGqLsc', 'endpoint': 'example.fusionauth.io',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -651,7 +728,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'e4d87900000000540733', - 'clientSecret': 'your-oauth2-client-secret',}; + 'clientSecret': '5e07c00000000000000000000000000000198bcc',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2GitHub( @@ -668,7 +745,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'applicationId': 'd41ffe0000000000000000000000000000000000000000000000000000d5e252', - 'secret': 'your-oauth2-client-secret', + 'secret': 'gloas-838cfa0000000000000000000000000000000000000000000000000000ecbb38', 'endpoint': 'https://gitlab.com',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -686,7 +763,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': '120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com', - 'clientSecret': 'your-oauth2-client-secret', + 'clientSecret': 'GOCSPX-2k8gsR0000000000000000VNahJj', 'prompt': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -704,7 +781,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'appwrite-o0000000st-app', - 'clientSecret': 'your-oauth2-client-secret', + 'clientSecret': 'jdjrJd00000000000000000000HUsaZO', 'endpoint': 'keycloak.example.com', 'realmName': 'appwrite-realm',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -723,7 +800,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': '01KQ7C00000000000001MFHS32', - 'clientSecret': 'your-oauth2-client-secret',}; + 'clientSecret': '34ac5600000000000000000000000000000000000000000000000000e830c8b',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Kick( @@ -740,7 +817,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': '770000000000dv', - 'primaryClientSecret': 'your-oauth2-client-secret',}; + 'primaryClientSecret': 'WPL_AP1.2Bf0000000000000./HtlYw==',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Linkedin( @@ -757,7 +834,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'applicationId': '00001111-aaaa-2222-bbbb-3333cccc4444', - 'applicationSecret': 'your-oauth2-client-secret', + 'applicationSecret': 'A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u', 'tenant': 'common',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -775,7 +852,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'oauthClientId': '341d8700-0000-0000-0000-000000446ee3', - 'oauthClientSecret': 'your-oauth2-client-secret',}; + 'oauthClientSecret': 'secret_dLUr4b000000000000000000000000000000lFHAa9',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Notion( @@ -792,7 +869,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'qibI2x0000000000000000000000000006L2YFoG', - 'clientSecret': 'your-oauth2-client-secret', + 'clientSecret': 'Ah68ed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003qpcHV', 'wellKnownURL': 'https://myoauth.com/.well-known/openid-configuration', 'authorizationURL': 'https://myoauth.com/oauth2/authorize', 'tokenURL': 'https://myoauth.com/oauth2/token', @@ -813,7 +890,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': '0oa00000000000000698', - 'clientSecret': 'your-oauth2-client-secret', + 'clientSecret': 'Kiq0000000000000000000000000000000000000-00000000000H2L5-3SJ-vRV', 'domain': 'trial-6400025.okta.com', 'authorizationServerId': 'aus000000000000000h7z',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -832,7 +909,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB', - 'secretKey': 'your-oauth2-client-secret',}; + 'secretKey': 'EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Paypal( @@ -849,7 +926,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB', - 'secretKey': 'your-oauth2-client-secret',}; + 'secretKey': 'EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2PaypalSandbox( @@ -866,7 +943,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'appwrite-oauth-test-app', - 'clientSecret': 'your-oauth2-client-secret',}; + 'clientSecret': 'Rn247T0000000000000000000000000000000000000000000000000000W2zWTN',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Podio( @@ -883,7 +960,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'customerKey': '3MVG9I0000000000000000000000000000000000000000000000000000000000000000000000000C5Aejq', - 'customerSecret': 'your-oauth2-client-secret',}; + 'customerSecret': '3w000000000000e2',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Salesforce( @@ -900,7 +977,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': '23000000089.15000000000023', - 'clientSecret': 'your-oauth2-client-secret',}; + 'clientSecret': '81656000000000000000000000f3d2fd',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Slack( @@ -917,7 +994,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': '6ec271000000000000000000009beace', - 'clientSecret': 'your-oauth2-client-secret',}; + 'clientSecret': 'db068a000000000000000000008b5b9f',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Spotify( @@ -934,7 +1011,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'ca_UKibXX0000000000000000000006byvR', - 'apiSecretKey': 'your-oauth2-client-secret',}; + 'apiSecretKey': 'sk_51SfOd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000QGWYfp',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Stripe( @@ -951,7 +1028,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'oauth2ClientId': 'appwrite-test-org.appwrite-test-app', - 'oauth2ClientSecret': 'your-oauth2-client-secret',}; + 'oauth2ClientSecret': '7cb52700-0000-0000-0000-000000ca5b83',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Tradeshift( @@ -968,7 +1045,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'oauth2ClientId': 'appwrite-test-org.appwrite-test-app', - 'oauth2ClientSecret': 'your-oauth2-client-secret',}; + 'oauth2ClientSecret': '7cb52700-0000-0000-0000-000000ca5b83',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2TradeshiftSandbox( @@ -985,7 +1062,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'vvi0in000000000000000000ikmt9p', - 'clientSecret': 'your-oauth2-client-secret',}; + 'clientSecret': 'pmapue000000000000000000zylw3v',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Twitch( @@ -1002,7 +1079,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': '130005', - 'clientSecret': 'your-oauth2-client-secret',}; + 'clientSecret': 'PlBfJS0000000000000000000000000000000000000000000000000000EdUZJk',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2WordPress( @@ -1019,7 +1096,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'customerKey': 'slzZV0000000000000NFLaWT', - 'secretKey': 'your-oauth2-client-secret',}; + 'secretKey': 'tkEPkp00000000000000000000000000000000000000FTxbI9',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2X( @@ -1036,7 +1113,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'dj0yJm000000000000000000000000000000000000000000000000000000000000000000000000000000000000Z4PWRm', - 'clientSecret': 'your-oauth2-client-secret',}; + 'clientSecret': 'cf978f0000000000000000000000000000c5e2e9',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Yahoo( @@ -1053,7 +1130,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': '6a8a6a0000000000000000000091483c', - 'clientSecret': 'your-oauth2-client-secret',}; + 'clientSecret': 'bbf98500000000000000000000c75a63',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Yandex( @@ -1070,7 +1147,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': '1000.83C178000000000000000000RPNX0B', - 'clientSecret': 'your-oauth2-client-secret',}; + 'clientSecret': 'fb5cac000000000000000000000000000000a68f6e',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Zoho( @@ -1087,7 +1164,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'QMAC00000000000000w0AQ', - 'clientSecret': 'your-oauth2-client-secret',}; + 'clientSecret': 'GAWsG4000000000000000000007U01ON',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Zoom( @@ -1104,7 +1181,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'applicationId': '00001111-aaaa-2222-bbbb-3333cccc4444', - 'applicationSecret': 'your-oauth2-client-secret', + 'applicationSecret': 'A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u', 'tenant': 'common',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -1389,7 +1466,7 @@ describe('Project', () => { test('test method listPolicies()', async () => { const data = { - 'total': 9, + 'total': 10, 'policies': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -1409,6 +1486,7 @@ describe('Project', () => { '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'name': 'New Project', 'teamId': '1592981250', + 'region': 'fra', 'devKeys': [], 'smtpEnabled': true, 'smtpSenderName': 'John Appwrite', @@ -1427,9 +1505,17 @@ describe('Project', () => { 'authMethods': [], 'services': [], 'protocols': [], - 'region': 'fra', 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'oAuth2ServerEnabled': true, + 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', + 'oAuth2ServerScopes': [], + 'oAuth2ServerAccessTokenDuration': 3600, + 'oAuth2ServerRefreshTokenDuration': 86400, + 'oAuth2ServerPublicAccessTokenDuration': 3600, + 'oAuth2ServerPublicRefreshTokenDuration': 2592000, + 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateDenyAliasedEmailPolicy( @@ -1449,6 +1535,7 @@ describe('Project', () => { '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'name': 'New Project', 'teamId': '1592981250', + 'region': 'fra', 'devKeys': [], 'smtpEnabled': true, 'smtpSenderName': 'John Appwrite', @@ -1467,9 +1554,17 @@ describe('Project', () => { 'authMethods': [], 'services': [], 'protocols': [], - 'region': 'fra', 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'oAuth2ServerEnabled': true, + 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', + 'oAuth2ServerScopes': [], + 'oAuth2ServerAccessTokenDuration': 3600, + 'oAuth2ServerRefreshTokenDuration': 86400, + 'oAuth2ServerPublicAccessTokenDuration': 3600, + 'oAuth2ServerPublicRefreshTokenDuration': 2592000, + 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateDenyDisposableEmailPolicy( @@ -1489,6 +1584,7 @@ describe('Project', () => { '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'name': 'New Project', 'teamId': '1592981250', + 'region': 'fra', 'devKeys': [], 'smtpEnabled': true, 'smtpSenderName': 'John Appwrite', @@ -1507,9 +1603,17 @@ describe('Project', () => { 'authMethods': [], 'services': [], 'protocols': [], - 'region': 'fra', 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'oAuth2ServerEnabled': true, + 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', + 'oAuth2ServerScopes': [], + 'oAuth2ServerAccessTokenDuration': 3600, + 'oAuth2ServerRefreshTokenDuration': 86400, + 'oAuth2ServerPublicAccessTokenDuration': 3600, + 'oAuth2ServerPublicRefreshTokenDuration': 2592000, + 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateDenyFreeEmailPolicy( @@ -1529,6 +1633,7 @@ describe('Project', () => { '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'name': 'New Project', 'teamId': '1592981250', + 'region': 'fra', 'devKeys': [], 'smtpEnabled': true, 'smtpSenderName': 'John Appwrite', @@ -1547,9 +1652,17 @@ describe('Project', () => { 'authMethods': [], 'services': [], 'protocols': [], - 'region': 'fra', 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'oAuth2ServerEnabled': true, + 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', + 'oAuth2ServerScopes': [], + 'oAuth2ServerAccessTokenDuration': 3600, + 'oAuth2ServerRefreshTokenDuration': 86400, + 'oAuth2ServerPublicAccessTokenDuration': 3600, + 'oAuth2ServerPublicRefreshTokenDuration': 2592000, + 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateMembershipPrivacyPolicy( @@ -1568,6 +1681,7 @@ describe('Project', () => { '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'name': 'New Project', 'teamId': '1592981250', + 'region': 'fra', 'devKeys': [], 'smtpEnabled': true, 'smtpSenderName': 'John Appwrite', @@ -1586,9 +1700,17 @@ describe('Project', () => { 'authMethods': [], 'services': [], 'protocols': [], - 'region': 'fra', 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'oAuth2ServerEnabled': true, + 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', + 'oAuth2ServerScopes': [], + 'oAuth2ServerAccessTokenDuration': 3600, + 'oAuth2ServerRefreshTokenDuration': 86400, + 'oAuth2ServerPublicAccessTokenDuration': 3600, + 'oAuth2ServerPublicRefreshTokenDuration': 2592000, + 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updatePasswordDictionaryPolicy( @@ -1608,6 +1730,7 @@ describe('Project', () => { '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'name': 'New Project', 'teamId': '1592981250', + 'region': 'fra', 'devKeys': [], 'smtpEnabled': true, 'smtpSenderName': 'John Appwrite', @@ -1626,9 +1749,17 @@ describe('Project', () => { 'authMethods': [], 'services': [], 'protocols': [], - 'region': 'fra', 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'oAuth2ServerEnabled': true, + 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', + 'oAuth2ServerScopes': [], + 'oAuth2ServerAccessTokenDuration': 3600, + 'oAuth2ServerRefreshTokenDuration': 86400, + 'oAuth2ServerPublicAccessTokenDuration': 3600, + 'oAuth2ServerPublicRefreshTokenDuration': 2592000, + 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updatePasswordHistoryPolicy( @@ -1648,6 +1779,7 @@ describe('Project', () => { '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'name': 'New Project', 'teamId': '1592981250', + 'region': 'fra', 'devKeys': [], 'smtpEnabled': true, 'smtpSenderName': 'John Appwrite', @@ -1666,9 +1798,17 @@ describe('Project', () => { 'authMethods': [], 'services': [], 'protocols': [], - 'region': 'fra', 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'oAuth2ServerEnabled': true, + 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', + 'oAuth2ServerScopes': [], + 'oAuth2ServerAccessTokenDuration': 3600, + 'oAuth2ServerRefreshTokenDuration': 86400, + 'oAuth2ServerPublicAccessTokenDuration': 3600, + 'oAuth2ServerPublicRefreshTokenDuration': 2592000, + 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updatePasswordPersonalDataPolicy( @@ -1681,6 +1821,25 @@ describe('Project', () => { expect(response).toEqual(data); }); + test('test method updatePasswordStrengthPolicy()', async () => { + const data = { + '\$id': 'password-dictionary', + 'min': 12, + 'uppercase': true, + 'lowercase': true, + 'number': true, + 'symbols': true,}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updatePasswordStrengthPolicy( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method updateSessionAlertPolicy()', async () => { const data = { '\$id': '5e5ea5c16897e', @@ -1688,6 +1847,7 @@ describe('Project', () => { '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'name': 'New Project', 'teamId': '1592981250', + 'region': 'fra', 'devKeys': [], 'smtpEnabled': true, 'smtpSenderName': 'John Appwrite', @@ -1706,9 +1866,17 @@ describe('Project', () => { 'authMethods': [], 'services': [], 'protocols': [], - 'region': 'fra', 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'oAuth2ServerEnabled': true, + 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', + 'oAuth2ServerScopes': [], + 'oAuth2ServerAccessTokenDuration': 3600, + 'oAuth2ServerRefreshTokenDuration': 86400, + 'oAuth2ServerPublicAccessTokenDuration': 3600, + 'oAuth2ServerPublicRefreshTokenDuration': 2592000, + 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateSessionAlertPolicy( @@ -1728,6 +1896,7 @@ describe('Project', () => { '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'name': 'New Project', 'teamId': '1592981250', + 'region': 'fra', 'devKeys': [], 'smtpEnabled': true, 'smtpSenderName': 'John Appwrite', @@ -1746,9 +1915,17 @@ describe('Project', () => { 'authMethods': [], 'services': [], 'protocols': [], - 'region': 'fra', 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'oAuth2ServerEnabled': true, + 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', + 'oAuth2ServerScopes': [], + 'oAuth2ServerAccessTokenDuration': 3600, + 'oAuth2ServerRefreshTokenDuration': 86400, + 'oAuth2ServerPublicAccessTokenDuration': 3600, + 'oAuth2ServerPublicRefreshTokenDuration': 2592000, + 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateSessionDurationPolicy( @@ -1768,6 +1945,7 @@ describe('Project', () => { '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'name': 'New Project', 'teamId': '1592981250', + 'region': 'fra', 'devKeys': [], 'smtpEnabled': true, 'smtpSenderName': 'John Appwrite', @@ -1786,9 +1964,17 @@ describe('Project', () => { 'authMethods': [], 'services': [], 'protocols': [], - 'region': 'fra', 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'oAuth2ServerEnabled': true, + 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', + 'oAuth2ServerScopes': [], + 'oAuth2ServerAccessTokenDuration': 3600, + 'oAuth2ServerRefreshTokenDuration': 86400, + 'oAuth2ServerPublicAccessTokenDuration': 3600, + 'oAuth2ServerPublicRefreshTokenDuration': 2592000, + 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateSessionInvalidationPolicy( @@ -1808,6 +1994,7 @@ describe('Project', () => { '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'name': 'New Project', 'teamId': '1592981250', + 'region': 'fra', 'devKeys': [], 'smtpEnabled': true, 'smtpSenderName': 'John Appwrite', @@ -1826,9 +2013,17 @@ describe('Project', () => { 'authMethods': [], 'services': [], 'protocols': [], - 'region': 'fra', 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'oAuth2ServerEnabled': true, + 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', + 'oAuth2ServerScopes': [], + 'oAuth2ServerAccessTokenDuration': 3600, + 'oAuth2ServerRefreshTokenDuration': 86400, + 'oAuth2ServerPublicAccessTokenDuration': 3600, + 'oAuth2ServerPublicRefreshTokenDuration': 2592000, + 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateSessionLimitPolicy( @@ -1848,6 +2043,7 @@ describe('Project', () => { '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'name': 'New Project', 'teamId': '1592981250', + 'region': 'fra', 'devKeys': [], 'smtpEnabled': true, 'smtpSenderName': 'John Appwrite', @@ -1866,9 +2062,17 @@ describe('Project', () => { 'authMethods': [], 'services': [], 'protocols': [], - 'region': 'fra', 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'oAuth2ServerEnabled': true, + 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', + 'oAuth2ServerScopes': [], + 'oAuth2ServerAccessTokenDuration': 3600, + 'oAuth2ServerRefreshTokenDuration': 86400, + 'oAuth2ServerPublicAccessTokenDuration': 3600, + 'oAuth2ServerPublicRefreshTokenDuration': 2592000, + 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateUserLimitPolicy( @@ -1904,6 +2108,7 @@ describe('Project', () => { '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'name': 'New Project', 'teamId': '1592981250', + 'region': 'fra', 'devKeys': [], 'smtpEnabled': true, 'smtpSenderName': 'John Appwrite', @@ -1922,9 +2127,17 @@ describe('Project', () => { 'authMethods': [], 'services': [], 'protocols': [], - 'region': 'fra', 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'oAuth2ServerEnabled': true, + 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', + 'oAuth2ServerScopes': [], + 'oAuth2ServerAccessTokenDuration': 3600, + 'oAuth2ServerRefreshTokenDuration': 86400, + 'oAuth2ServerPublicAccessTokenDuration': 3600, + 'oAuth2ServerPublicRefreshTokenDuration': 2592000, + 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateProtocol( @@ -1945,6 +2158,7 @@ describe('Project', () => { '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'name': 'New Project', 'teamId': '1592981250', + 'region': 'fra', 'devKeys': [], 'smtpEnabled': true, 'smtpSenderName': 'John Appwrite', @@ -1963,9 +2177,17 @@ describe('Project', () => { 'authMethods': [], 'services': [], 'protocols': [], - 'region': 'fra', 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'oAuth2ServerEnabled': true, + 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', + 'oAuth2ServerScopes': [], + 'oAuth2ServerAccessTokenDuration': 3600, + 'oAuth2ServerRefreshTokenDuration': 86400, + 'oAuth2ServerPublicAccessTokenDuration': 3600, + 'oAuth2ServerPublicRefreshTokenDuration': 2592000, + 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateService( @@ -1986,6 +2208,7 @@ describe('Project', () => { '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'name': 'New Project', 'teamId': '1592981250', + 'region': 'fra', 'devKeys': [], 'smtpEnabled': true, 'smtpSenderName': 'John Appwrite', @@ -2004,9 +2227,17 @@ describe('Project', () => { 'authMethods': [], 'services': [], 'protocols': [], - 'region': 'fra', 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'oAuth2ServerEnabled': true, + 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', + 'oAuth2ServerScopes': [], + 'oAuth2ServerAccessTokenDuration': 3600, + 'oAuth2ServerRefreshTokenDuration': 86400, + 'oAuth2ServerPublicAccessTokenDuration': 3600, + 'oAuth2ServerPublicRefreshTokenDuration': 2592000, + 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateSMTP(