diff --git a/CHANGELOG.md b/CHANGELOG.md index a47aa7fc..ad6fd074 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,19 @@ # Change Log -## 25.1.0 - -* Added `sizeActual` property to file model for actual stored size after compression -* Added `Deno121`, `Deno124`, and `Deno135` runtime options to `BuildRuntime` and `Runtime` enums -* Updated advisor authentication examples to use API key instead of session -* Updated billing limits properties to be optional in project models +## 26.0.0 + +* Breaking: Removed generic type parameters from `presences` service methods +* Breaking: Removed `githubImagine` and `googleImagine` from `ProjectOAuthProviderId` +* Breaking: Removed `deno-1.21`, `deno-1.24`, and `deno-1.35` from `Runtime` and `BuildRuntime` +* Breaking: Dropped numeric suffixes from `StatusCode` redirect members +* 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 +* 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 +* Updated: Renamed `updatePresence` to `update` in the `presences` service ## 25.0.0 diff --git a/docs/examples/avatars/get-screenshot.md b/docs/examples/avatars/get-screenshot.md index 1aab6cd3..d83f24ab 100644 --- a/docs/examples/avatars/get-screenshot.md +++ b/docs/examples/avatars/get-screenshot.md @@ -17,11 +17,11 @@ const result = await avatars.getScreenshot({ viewportWidth: 1920, // optional viewportHeight: 1080, // optional scale: 2, // optional - theme: sdk.Theme.Dark, // optional + theme: sdk.BrowserTheme.Dark, // optional userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15', // optional fullpage: true, // optional locale: 'en-US', // optional - timezone: sdk.Timezone.AmericaNewYork, // optional + timezone: sdk.Timezone.AfricaAbidjan, // optional latitude: 37.7749, // optional longitude: -122.4194, // optional accuracy: 100, // optional diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index 4e3d5e95..cb9c3e8c 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -20,12 +20,14 @@ const result = await functions.create({ logging: false, // optional entrypoint: '', // optional commands: '', // optional - scopes: [sdk.Scopes.ProjectRead], // optional + scopes: [sdk.ProjectKeyScopes.ProjectRead], // optional installationId: '', // optional providerRepositoryId: '', // optional providerBranch: '', // optional providerSilentMode: false, // optional providerRootDirectory: '', // optional + providerBranches: [], // optional + providerPaths: [], // optional buildSpecification: '', // optional runtimeSpecification: '', // optional deploymentRetention: 0 // optional diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index fe60cad3..7d64aa26 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -20,12 +20,14 @@ const result = await functions.update({ logging: false, // optional entrypoint: '', // optional commands: '', // optional - scopes: [sdk.Scopes.ProjectRead], // optional + scopes: [sdk.ProjectKeyScopes.ProjectRead], // optional installationId: '', // optional providerRepositoryId: '', // optional providerBranch: '', // optional providerSilentMode: false, // optional providerRootDirectory: '', // optional + providerBranches: [], // optional + providerPaths: [], // optional buildSpecification: '', // optional runtimeSpecification: '', // optional deploymentRetention: 0 // optional diff --git a/docs/examples/health/get-failed-jobs.md b/docs/examples/health/get-failed-jobs.md index e495453c..3f41e638 100644 --- a/docs/examples/health/get-failed-jobs.md +++ b/docs/examples/health/get-failed-jobs.md @@ -9,7 +9,7 @@ const client = new sdk.Client() const health = new sdk.Health(client); const result = await health.getFailedJobs({ - name: sdk.Name.V1Database, + name: sdk.HealthQueueName.V1Database, threshold: null // optional }); ``` diff --git a/docs/examples/organization/create-key.md b/docs/examples/organization/create-key.md new file mode 100644 index 00000000..b4e06acf --- /dev/null +++ b/docs/examples/organization/create-key.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const organization = new sdk.Organization(client); + +const result = await organization.createKey({ + keyId: '', + name: '', + scopes: [sdk.OrganizationKeyScopes.ProjectsRead], + expire: '2020-10-15T06:38:00.000+00:00' // optional +}); +``` diff --git a/docs/examples/organization/create-project.md b/docs/examples/organization/create-project.md new file mode 100644 index 00000000..0c4547c5 --- /dev/null +++ b/docs/examples/organization/create-project.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const organization = new sdk.Organization(client); + +const result = await organization.createProject({ + projectId: '', + name: '', + region: sdk.Region.Fra // optional +}); +``` diff --git a/docs/examples/organization/delete-key.md b/docs/examples/organization/delete-key.md new file mode 100644 index 00000000..c3bce992 --- /dev/null +++ b/docs/examples/organization/delete-key.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const organization = new sdk.Organization(client); + +const result = await organization.deleteKey({ + keyId: '' +}); +``` diff --git a/docs/examples/organization/delete-project.md b/docs/examples/organization/delete-project.md new file mode 100644 index 00000000..01b3b845 --- /dev/null +++ b/docs/examples/organization/delete-project.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const organization = new sdk.Organization(client); + +const result = await organization.deleteProject({ + projectId: '' +}); +``` diff --git a/docs/examples/organization/get-key.md b/docs/examples/organization/get-key.md new file mode 100644 index 00000000..13317b6a --- /dev/null +++ b/docs/examples/organization/get-key.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const organization = new sdk.Organization(client); + +const result = await organization.getKey({ + keyId: '' +}); +``` diff --git a/docs/examples/organization/get-project.md b/docs/examples/organization/get-project.md new file mode 100644 index 00000000..85576d62 --- /dev/null +++ b/docs/examples/organization/get-project.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const organization = new sdk.Organization(client); + +const result = await organization.getProject({ + projectId: '' +}); +``` diff --git a/docs/examples/organization/list-keys.md b/docs/examples/organization/list-keys.md new file mode 100644 index 00000000..61348e5a --- /dev/null +++ b/docs/examples/organization/list-keys.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const organization = new sdk.Organization(client); + +const result = await organization.listKeys({ + queries: [], // optional + total: false // optional +}); +``` diff --git a/docs/examples/organization/list-projects.md b/docs/examples/organization/list-projects.md new file mode 100644 index 00000000..fa7f9c00 --- /dev/null +++ b/docs/examples/organization/list-projects.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const organization = new sdk.Organization(client); + +const result = await organization.listProjects({ + queries: [], // optional + search: '', // optional + total: false // optional +}); +``` diff --git a/docs/examples/organization/update-key.md b/docs/examples/organization/update-key.md new file mode 100644 index 00000000..ade0116e --- /dev/null +++ b/docs/examples/organization/update-key.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const organization = new sdk.Organization(client); + +const result = await organization.updateKey({ + keyId: '', + name: '', + scopes: [sdk.OrganizationKeyScopes.ProjectsRead], + expire: '2020-10-15T06:38:00.000+00:00' // optional +}); +``` diff --git a/docs/examples/organization/update-project.md b/docs/examples/organization/update-project.md new file mode 100644 index 00000000..f457ec2e --- /dev/null +++ b/docs/examples/organization/update-project.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const organization = new sdk.Organization(client); + +const result = await organization.updateProject({ + projectId: '', + name: '' +}); +``` diff --git a/docs/examples/presences/update-presence.md b/docs/examples/presences/update.md similarity index 92% rename from docs/examples/presences/update-presence.md rename to docs/examples/presences/update.md index ffb1272f..0056a50c 100644 --- a/docs/examples/presences/update-presence.md +++ b/docs/examples/presences/update.md @@ -8,7 +8,7 @@ const client = new sdk.Client() const presences = new sdk.Presences(client); -const result = await presences.updatePresence({ +const result = await presences.update({ presenceId: '', userId: '', status: '', // optional diff --git a/docs/examples/proxy/create-redirect-rule.md b/docs/examples/proxy/create-redirect-rule.md index 0f33abd6..bb028c15 100644 --- a/docs/examples/proxy/create-redirect-rule.md +++ b/docs/examples/proxy/create-redirect-rule.md @@ -11,7 +11,7 @@ const proxy = new sdk.Proxy(client); const result = await proxy.createRedirectRule({ domain: '', url: 'https://example.com', - statusCode: sdk.StatusCode.MovedPermanently301, + statusCode: sdk.StatusCode.MovedPermanently, resourceId: '', resourceType: sdk.ProxyResourceType.Site }); diff --git a/docs/examples/sites/create.md b/docs/examples/sites/create.md index 65e5c64c..dc4e3ef7 100644 --- a/docs/examples/sites/create.md +++ b/docs/examples/sites/create.md @@ -27,6 +27,8 @@ const result = await sites.create({ providerBranch: '', // optional providerSilentMode: false, // optional providerRootDirectory: '', // optional + providerBranches: [], // optional + providerPaths: [], // optional buildSpecification: '', // optional runtimeSpecification: '', // optional deploymentRetention: 0 // optional diff --git a/docs/examples/sites/update.md b/docs/examples/sites/update.md index 0411752f..30928f1d 100644 --- a/docs/examples/sites/update.md +++ b/docs/examples/sites/update.md @@ -27,6 +27,8 @@ const result = await sites.update({ providerBranch: '', // optional providerSilentMode: false, // optional providerRootDirectory: '', // optional + providerBranches: [], // optional + providerPaths: [], // optional buildSpecification: '', // optional runtimeSpecification: '', // optional deploymentRetention: 0 // optional diff --git a/package-lock.json b/package-lock.json index 867bc0d7..d7778205 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "node-appwrite", - "version": "25.2.0", + "version": "26.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "node-appwrite", - "version": "25.2.0", + "version": "26.0.0", "dependencies": { "json-bigint": "1.0.0", "node-fetch-native-with-agent": "1.7.2" diff --git a/package.json b/package.json index d098457b..3f5d760e 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": "25.2.0", + "version": "26.0.0", "license": "BSD-3-Clause", "main": "dist/index.js", "type": "commonjs", diff --git a/src/client.ts b/src/client.ts index 6bc2ce80..f9de6718 100644 --- a/src/client.ts +++ b/src/client.ts @@ -74,7 +74,7 @@ class AppwriteException extends Error { } function getUserAgent() { - let ua = 'AppwriteNodeJSSDK/25.2.0'; + let ua = 'AppwriteNodeJSSDK/26.0.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': '25.2.0', + 'x-sdk-version': '26.0.0', 'user-agent' : getUserAgent(), 'X-Appwrite-Response-Format': '1.9.5', }; @@ -695,7 +695,12 @@ class Client { } if (data && typeof data === 'object') { - data.toString = () => JSONbig.stringify(data); + Object.defineProperty(data, 'toString', { + value: () => JSONbig.stringify(data), + writable: true, + enumerable: false, + configurable: true, + }); } return data; diff --git a/src/enums/backup-services.ts b/src/enums/backup-services.ts index bd0582ce..adef40d2 100644 --- a/src/enums/backup-services.ts +++ b/src/enums/backup-services.ts @@ -3,6 +3,7 @@ export enum BackupServices { Tablesdb = 'tablesdb', Documentsdb = 'documentsdb', Vectorsdb = 'vectorsdb', + DedicatedDatabases = 'dedicatedDatabases', Functions = 'functions', Storage = 'storage', } \ No newline at end of file diff --git a/src/enums/theme.ts b/src/enums/browser-theme.ts similarity index 60% rename from src/enums/theme.ts rename to src/enums/browser-theme.ts index 5e823a9b..9f8c382a 100644 --- a/src/enums/theme.ts +++ b/src/enums/browser-theme.ts @@ -1,4 +1,4 @@ -export enum Theme { +export enum BrowserTheme { Light = 'light', Dark = 'dark', } \ No newline at end of file diff --git a/src/enums/build-runtime.ts b/src/enums/build-runtime.ts index dddeeb2b..6c0f0008 100644 --- a/src/enums/build-runtime.ts +++ b/src/enums/build-runtime.ts @@ -30,9 +30,6 @@ export enum BuildRuntime { Pythonml311 = 'python-ml-3.11', Pythonml312 = 'python-ml-3.12', Pythonml313 = 'python-ml-3.13', - Deno121 = 'deno-1.21', - Deno124 = 'deno-1.24', - Deno135 = 'deno-1.35', Deno140 = 'deno-1.40', Deno146 = 'deno-1.46', Deno20 = 'deno-2.0', @@ -51,6 +48,7 @@ export enum BuildRuntime { Dart39 = 'dart-3.9', Dart310 = 'dart-3.10', Dart311 = 'dart-3.11', + Dart312 = 'dart-3.12', Dotnet60 = 'dotnet-6.0', Dotnet70 = 'dotnet-7.0', Dotnet80 = 'dotnet-8.0', @@ -91,4 +89,5 @@ export enum BuildRuntime { Flutter335 = 'flutter-3.35', Flutter338 = 'flutter-3.38', Flutter341 = 'flutter-3.41', + Flutter344 = 'flutter-3.44', } \ No newline at end of file diff --git a/src/enums/name.ts b/src/enums/health-queue-name.ts similarity index 93% rename from src/enums/name.ts rename to src/enums/health-queue-name.ts index 8cd297bc..81320f8d 100644 --- a/src/enums/name.ts +++ b/src/enums/health-queue-name.ts @@ -1,4 +1,4 @@ -export enum Name { +export enum HealthQueueName { V1database = 'v1-database', V1deletes = 'v1-deletes', V1audits = 'v1-audits', diff --git a/src/enums/organization-key-scopes.ts b/src/enums/organization-key-scopes.ts new file mode 100644 index 00000000..05c96d22 --- /dev/null +++ b/src/enums/organization-key-scopes.ts @@ -0,0 +1,12 @@ +export enum OrganizationKeyScopes { + ProjectsRead = 'projects.read', + ProjectsWrite = 'projects.write', + DevKeysRead = 'devKeys.read', + DevKeysWrite = 'devKeys.write', + OrganizationKeysRead = 'organization.keys.read', + OrganizationKeysWrite = 'organization.keys.write', + DomainsRead = 'domains.read', + DomainsWrite = 'domains.write', + KeysRead = 'keys.read', + KeysWrite = 'keys.write', +} \ No newline at end of file diff --git a/src/enums/project-o-auth-provider-id.ts b/src/enums/project-o-auth-provider-id.ts index e35d6ef0..e1ed1b85 100644 --- a/src/enums/project-o-auth-provider-id.ts +++ b/src/enums/project-o-auth-provider-id.ts @@ -42,6 +42,4 @@ export enum ProjectOAuthProviderId { Yandex = 'yandex', Zoho = 'zoho', Zoom = 'zoom', - GithubImagine = 'githubImagine', - GoogleImagine = 'googleImagine', } \ No newline at end of file diff --git a/src/enums/project-policy-id.ts b/src/enums/project-policy-id.ts index 2031ce9b..3e2eceec 100644 --- a/src/enums/project-policy-id.ts +++ b/src/enums/project-policy-id.ts @@ -8,4 +8,7 @@ export enum ProjectPolicyId { Sessionlimit = 'session-limit', Userlimit = 'user-limit', Membershipprivacy = 'membership-privacy', + Denyaliasedemail = 'deny-aliased-email', + Denydisposableemail = 'deny-disposable-email', + Denyfreeemail = 'deny-free-email', } \ No newline at end of file diff --git a/src/enums/region.ts b/src/enums/region.ts new file mode 100644 index 00000000..948dd0b8 --- /dev/null +++ b/src/enums/region.ts @@ -0,0 +1,8 @@ +export enum Region { + Fra = 'fra', + Nyc = 'nyc', + Syd = 'syd', + Sfo = 'sfo', + Sgp = 'sgp', + Tor = 'tor', +} \ No newline at end of file diff --git a/src/enums/runtime.ts b/src/enums/runtime.ts index a2b22ef0..40616625 100644 --- a/src/enums/runtime.ts +++ b/src/enums/runtime.ts @@ -30,9 +30,6 @@ export enum Runtime { Pythonml311 = 'python-ml-3.11', Pythonml312 = 'python-ml-3.12', Pythonml313 = 'python-ml-3.13', - Deno121 = 'deno-1.21', - Deno124 = 'deno-1.24', - Deno135 = 'deno-1.35', Deno140 = 'deno-1.40', Deno146 = 'deno-1.46', Deno20 = 'deno-2.0', @@ -51,6 +48,7 @@ export enum Runtime { Dart39 = 'dart-3.9', Dart310 = 'dart-3.10', Dart311 = 'dart-3.11', + Dart312 = 'dart-3.12', Dotnet60 = 'dotnet-6.0', Dotnet70 = 'dotnet-7.0', Dotnet80 = 'dotnet-8.0', @@ -91,4 +89,5 @@ export enum Runtime { Flutter335 = 'flutter-3.35', Flutter338 = 'flutter-3.38', Flutter341 = 'flutter-3.41', + Flutter344 = 'flutter-3.44', } \ No newline at end of file diff --git a/src/enums/scopes.ts b/src/enums/scopes.ts deleted file mode 100644 index 54e9cb31..00000000 --- a/src/enums/scopes.ts +++ /dev/null @@ -1,96 +0,0 @@ -export enum Scopes { - ProjectRead = 'project.read', - ProjectWrite = 'project.write', - KeysRead = 'keys.read', - KeysWrite = 'keys.write', - PlatformsRead = 'platforms.read', - PlatformsWrite = 'platforms.write', - MocksRead = 'mocks.read', - MocksWrite = 'mocks.write', - PoliciesRead = 'policies.read', - PoliciesWrite = 'policies.write', - ProjectPoliciesRead = 'project.policies.read', - ProjectPoliciesWrite = 'project.policies.write', - TemplatesRead = 'templates.read', - TemplatesWrite = 'templates.write', - Oauth2Read = 'oauth2.read', - Oauth2Write = 'oauth2.write', - UsersRead = 'users.read', - UsersWrite = 'users.write', - SessionsRead = 'sessions.read', - SessionsWrite = 'sessions.write', - TeamsRead = 'teams.read', - TeamsWrite = 'teams.write', - DatabasesRead = 'databases.read', - DatabasesWrite = 'databases.write', - TablesRead = 'tables.read', - TablesWrite = 'tables.write', - ColumnsRead = 'columns.read', - ColumnsWrite = 'columns.write', - IndexesRead = 'indexes.read', - IndexesWrite = 'indexes.write', - RowsRead = 'rows.read', - RowsWrite = 'rows.write', - CollectionsRead = 'collections.read', - CollectionsWrite = 'collections.write', - AttributesRead = 'attributes.read', - AttributesWrite = 'attributes.write', - DocumentsRead = 'documents.read', - DocumentsWrite = 'documents.write', - BucketsRead = 'buckets.read', - BucketsWrite = 'buckets.write', - FilesRead = 'files.read', - FilesWrite = 'files.write', - TokensRead = 'tokens.read', - TokensWrite = 'tokens.write', - FunctionsRead = 'functions.read', - FunctionsWrite = 'functions.write', - ExecutionsRead = 'executions.read', - ExecutionsWrite = 'executions.write', - ExecutionRead = 'execution.read', - ExecutionWrite = 'execution.write', - SitesRead = 'sites.read', - SitesWrite = 'sites.write', - LogRead = 'log.read', - LogWrite = 'log.write', - ProvidersRead = 'providers.read', - ProvidersWrite = 'providers.write', - TopicsRead = 'topics.read', - TopicsWrite = 'topics.write', - SubscribersRead = 'subscribers.read', - SubscribersWrite = 'subscribers.write', - TargetsRead = 'targets.read', - TargetsWrite = 'targets.write', - MessagesRead = 'messages.read', - MessagesWrite = 'messages.write', - RulesRead = 'rules.read', - RulesWrite = 'rules.write', - WebhooksRead = 'webhooks.read', - WebhooksWrite = 'webhooks.write', - LocaleRead = 'locale.read', - AvatarsRead = 'avatars.read', - HealthRead = 'health.read', - AssistantRead = 'assistant.read', - MigrationsRead = 'migrations.read', - MigrationsWrite = 'migrations.write', - SchedulesRead = 'schedules.read', - SchedulesWrite = 'schedules.write', - VcsRead = 'vcs.read', - VcsWrite = 'vcs.write', - InsightsRead = 'insights.read', - InsightsWrite = 'insights.write', - ReportsRead = 'reports.read', - ReportsWrite = 'reports.write', - PresencesRead = 'presences.read', - PresencesWrite = 'presences.write', - BackupsPoliciesRead = 'backups.policies.read', - BackupsPoliciesWrite = 'backups.policies.write', - ArchivesRead = 'archives.read', - ArchivesWrite = 'archives.write', - RestorationsRead = 'restorations.read', - RestorationsWrite = 'restorations.write', - DomainsRead = 'domains.read', - DomainsWrite = 'domains.write', - EventsRead = 'events.read', - UsageRead = 'usage.read', -} \ No newline at end of file diff --git a/src/enums/status-code.ts b/src/enums/status-code.ts index 1f3adf8b..425d65c3 100644 --- a/src/enums/status-code.ts +++ b/src/enums/status-code.ts @@ -1,6 +1,6 @@ export enum StatusCode { - MovedPermanently301 = '301', - Found302 = '302', - TemporaryRedirect307 = '307', - PermanentRedirect308 = '308', + MovedPermanently = '301', + Found = '302', + TemporaryRedirect = '307', + PermanentRedirect = '308', } \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 1932e75b..6e11f54e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -9,6 +9,7 @@ export { Graphql } from './services/graphql'; export { Health } from './services/health'; export { Locale } from './services/locale'; export { Messaging } from './services/messaging'; +export { Organization } from './services/organization'; export { Presences } from './services/presences'; export { Project } from './services/project'; export { Proxy } from './services/proxy'; @@ -33,7 +34,7 @@ export { OAuthProvider } from './enums/o-auth-provider'; export { Browser } from './enums/browser'; export { CreditCard } from './enums/credit-card'; export { Flag } from './enums/flag'; -export { Theme } from './enums/theme'; +export { BrowserTheme } from './enums/browser-theme'; export { Timezone } from './enums/timezone'; export { BrowserPermission } from './enums/browser-permission'; export { ImageFormat } from './enums/image-format'; @@ -43,16 +44,17 @@ export { RelationMutate } from './enums/relation-mutate'; export { DatabasesIndexType } from './enums/databases-index-type'; export { OrderBy } from './enums/order-by'; export { Runtime } from './enums/runtime'; -export { Scopes } from './enums/scopes'; +export { ProjectKeyScopes } from './enums/project-key-scopes'; export { TemplateReferenceType } from './enums/template-reference-type'; export { VCSReferenceType } from './enums/vcs-reference-type'; export { DeploymentDownloadType } from './enums/deployment-download-type'; export { ExecutionMethod } from './enums/execution-method'; -export { Name } from './enums/name'; +export { HealthQueueName } from './enums/health-queue-name'; export { MessagePriority } from './enums/message-priority'; export { SmtpEncryption } from './enums/smtp-encryption'; +export { OrganizationKeyScopes } from './enums/organization-key-scopes'; +export { Region } from './enums/region'; export { ProjectAuthMethodId } from './enums/project-auth-method-id'; -export { ProjectKeyScopes } from './enums/project-key-scopes'; export { ProjectOAuth2GooglePrompt } from './enums/project-o-auth-2-google-prompt'; export { ProjectOAuthProviderId } from './enums/project-o-auth-provider-id'; export { ProjectPolicyId } from './enums/project-policy-id'; diff --git a/src/models.ts b/src/models.ts index de934950..95e661a6 100644 --- a/src/models.ts +++ b/src/models.ts @@ -54,7 +54,7 @@ export namespace Models { /** * Presences List */ - export type PresenceList = { + export type PresenceList = { /** * Total number of presences that matched your query. */ @@ -345,6 +345,20 @@ export namespace Models { executions: Execution[]; } + /** + * Projects List + */ + export type ProjectList = { + /** + * Total number of projects that matched your query. + */ + total: number; + /** + * List of projects. + */ + projects: Project[]; + } + /** * Webhooks List */ @@ -482,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)[]; + 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)[]; } /** @@ -2751,13 +2765,12 @@ export namespace Models { * Presence expiry date in ISO 8601 format. */ expiresAt?: string; + /** + * Presence metadata. + */ + metadata?: object; } - export type DefaultPresence = Presence & { - [key: string]: any; - [__default]: true; - }; - /** * Log */ @@ -3681,6 +3694,14 @@ export namespace Models { * Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests */ providerSilentMode: boolean; + /** + * List of branch name patterns that trigger automatic deployments. Supports glob wildcards. Empty list deploys on all branches. + */ + providerBranches: string[]; + /** + * List of file path patterns that trigger automatic deployments. Supports glob wildcards. Empty list deploys on all file changes. + */ + providerPaths: string[]; /** * Machine specification for deployment builds. */ @@ -3819,6 +3840,14 @@ export namespace Models { * Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests */ providerSilentMode: boolean; + /** + * List of branch name patterns that trigger automatic deployments. Supports glob wildcards. Empty list deploys on all branches. + */ + providerBranches: string[]; + /** + * List of file path patterns that trigger automatic deployments. Supports glob wildcards. Empty list deploys on all file changes. + */ + providerPaths: string[]; /** * Machine specification for deployment builds. */ @@ -6578,21 +6607,21 @@ export namespace Models { */ $id: string; /** - * User type. + * Actor type. */ - userType: string; + actorType: string; /** - * User ID. + * Actor ID. */ - userId: string; + actorId: string; /** - * User Email. + * Actor Email. */ - userEmail: string; + actorEmail: string; /** - * User Name. + * Actor Name. */ - userName: string; + actorName: string; /** * Resource parent. */ @@ -6758,7 +6787,7 @@ export namespace Models { } /** - * BillingLimits + * Limits */ export type BillingLimits = { /** @@ -6891,6 +6920,48 @@ export namespace Models { enabled: boolean; } + /** + * Policy Deny Aliased Email + */ + export type PolicyDenyAliasedEmail = { + /** + * Policy ID. + */ + $id: string; + /** + * Whether the deny aliased email policy is enabled. + */ + enabled: boolean; + } + + /** + * Policy Deny Disposable Email + */ + export type PolicyDenyDisposableEmail = { + /** + * Policy ID. + */ + $id: string; + /** + * Whether the deny disposable email policy is enabled. + */ + enabled: boolean; + } + + /** + * Policy Deny Free Email + */ + export type PolicyDenyFreeEmail = { + /** + * Policy ID. + */ + $id: string; + /** + * Whether the deny free email policy is enabled. + */ + enabled: boolean; + } + /** * Restoration */ @@ -6987,20 +7058,6 @@ export namespace Models { userAgent: string; } - /** - * Usage events list - */ - export type UsageEventList = { - /** - * Total number of events that matched your query. - */ - total: number; - /** - * List of events. - */ - events: UsageEvent[]; - } - /** * usageGauge */ @@ -7017,20 +7074,14 @@ export namespace Models { * The snapshot timestamp. */ time: string; - } - - /** - * Usage gauges list - */ - export type UsageGaugeList = { /** - * Total number of gauges that matched your query. + * The resource type. */ - total: number; + resourceType: string; /** - * List of gauges. + * The resource ID. */ - gauges: UsageGauge[]; + resourceId: string; } /** @@ -7088,4 +7139,32 @@ export namespace Models { */ restorations: BackupRestoration[]; } + + /** + * Usage events list + */ + export type UsageEventList = { + /** + * Total number of events that matched your query. + */ + total: number; + /** + * List of events. + */ + events: UsageEvent[]; + } + + /** + * Usage gauges list + */ + export type UsageGaugeList = { + /** + * Total number of gauges that matched your query. + */ + total: number; + /** + * List of gauges. + */ + gauges: UsageGauge[]; + } } diff --git a/src/services/avatars.ts b/src/services/avatars.ts index 37ed3bd3..1a27ab04 100644 --- a/src/services/avatars.ts +++ b/src/services/avatars.ts @@ -5,7 +5,7 @@ import type { Models } from '../models'; import { Browser } from '../enums/browser'; import { CreditCard } from '../enums/credit-card'; import { Flag } from '../enums/flag'; -import { Theme } from '../enums/theme'; +import { BrowserTheme } from '../enums/browser-theme'; import { Timezone } from '../enums/timezone'; import { BrowserPermission } from '../enums/browser-permission'; import { ImageFormat } from '../enums/image-format'; @@ -567,7 +567,7 @@ export class Avatars { * @param {number} params.viewportWidth - Browser viewport width. Pass an integer between 1 to 1920. Defaults to 1280. * @param {number} params.viewportHeight - Browser viewport height. Pass an integer between 1 to 1080. Defaults to 720. * @param {number} params.scale - Browser scale factor. Pass a number between 0.1 to 3. Defaults to 1. - * @param {Theme} params.theme - Browser theme. Pass "light" or "dark". Defaults to "light". + * @param {BrowserTheme} params.theme - Browser theme. Pass "light" or "dark". Defaults to "light". * @param {string} params.userAgent - Custom user agent string. Defaults to browser default. * @param {boolean} params.fullpage - Capture full page scroll. Pass 0 for viewport only, or 1 for full page. Defaults to 0. * @param {string} params.locale - Browser locale (e.g., "en-US", "fr-FR"). Defaults to browser default. @@ -585,7 +585,7 @@ export class Avatars { * @throws {AppwriteException} * @returns {Promise} */ - getScreenshot(params: { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat }): Promise; + getScreenshot(params: { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: BrowserTheme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat }): Promise; /** * Use this endpoint to capture a screenshot of any website URL. This endpoint uses a headless browser to render the webpage and capture it as an image. * @@ -598,7 +598,7 @@ export class Avatars { * @param {number} viewportWidth - Browser viewport width. Pass an integer between 1 to 1920. Defaults to 1280. * @param {number} viewportHeight - Browser viewport height. Pass an integer between 1 to 1080. Defaults to 720. * @param {number} scale - Browser scale factor. Pass a number between 0.1 to 3. Defaults to 1. - * @param {Theme} theme - Browser theme. Pass "light" or "dark". Defaults to "light". + * @param {BrowserTheme} theme - Browser theme. Pass "light" or "dark". Defaults to "light". * @param {string} userAgent - Custom user agent string. Defaults to browser default. * @param {boolean} fullpage - Capture full page scroll. Pass 0 for viewport only, or 1 for full page. Defaults to 0. * @param {string} locale - Browser locale (e.g., "en-US", "fr-FR"). Defaults to browser default. @@ -617,15 +617,15 @@ export class Avatars { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getScreenshot(url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat): Promise; + getScreenshot(url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: BrowserTheme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat): Promise; getScreenshot( - paramsOrFirst: { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat } | string, - ...rest: [(object)?, (number)?, (number)?, (number)?, (Theme)?, (string)?, (boolean)?, (string)?, (Timezone)?, (number)?, (number)?, (number)?, (boolean)?, (BrowserPermission[])?, (number)?, (number)?, (number)?, (number)?, (ImageFormat)?] + paramsOrFirst: { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: BrowserTheme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat } | string, + ...rest: [(object)?, (number)?, (number)?, (number)?, (BrowserTheme)?, (string)?, (boolean)?, (string)?, (Timezone)?, (number)?, (number)?, (number)?, (boolean)?, (BrowserPermission[])?, (number)?, (number)?, (number)?, (number)?, (ImageFormat)?] ): Promise { - let params: { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat }; + let params: { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: BrowserTheme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat }; + params = (paramsOrFirst || {}) as { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: BrowserTheme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat }; } else { params = { url: paramsOrFirst as string, @@ -633,7 +633,7 @@ export class Avatars { viewportWidth: rest[1] as number, viewportHeight: rest[2] as number, scale: rest[3] as number, - theme: rest[4] as Theme, + theme: rest[4] as BrowserTheme, userAgent: rest[5] as string, fullpage: rest[6] as boolean, locale: rest[7] as string, diff --git a/src/services/functions.ts b/src/services/functions.ts index 75835a0b..abaec3aa 100644 --- a/src/services/functions.ts +++ b/src/services/functions.ts @@ -4,7 +4,7 @@ import type { Models } from '../models'; import { InputFile } from '../inputFile'; import { Runtime } from '../enums/runtime'; -import { Scopes } from '../enums/scopes'; +import { ProjectKeyScopes } from '../enums/project-key-scopes'; import { TemplateReferenceType } from '../enums/template-reference-type'; import { VCSReferenceType } from '../enums/vcs-reference-type'; import { DeploymentDownloadType } from '../enums/deployment-download-type'; @@ -97,19 +97,21 @@ export class Functions { * @param {boolean} params.logging - When disabled, executions will exclude logs and errors, and will be slightly faster. * @param {string} params.entrypoint - Entrypoint File. This path is relative to the "providerRootDirectory". * @param {string} params.commands - Build Commands. - * @param {Scopes[]} params.scopes - List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed. + * @param {ProjectKeyScopes[]} params.scopes - List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed. * @param {string} params.installationId - Appwrite Installation ID for VCS (Version Control System) deployment. * @param {string} params.providerRepositoryId - Repository ID of the repo linked to the function. * @param {string} params.providerBranch - Production branch for the repo linked to the function. * @param {boolean} params.providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests. * @param {string} params.providerRootDirectory - Path to function code in the linked repo. + * @param {string[]} params.providerBranches - List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches. + * @param {string[]} params.providerPaths - List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes. * @param {string} params.buildSpecification - Build specification for the function deployments. * @param {string} params.runtimeSpecification - Runtime specification for the function executions. * @param {number} params.deploymentRetention - Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept. * @throws {AppwriteException} * @returns {Promise} */ - create(params: { functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: Scopes[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number }): Promise; + create(params: { functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: ProjectKeyScopes[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, providerBranches?: string[], providerPaths?: string[], buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number }): Promise; /** * Create a new function. You can pass a list of [permissions](https://appwrite.io/docs/permissions) to allow different project users or team with access to execute the function using the client API. * @@ -124,12 +126,14 @@ export class Functions { * @param {boolean} logging - When disabled, executions will exclude logs and errors, and will be slightly faster. * @param {string} entrypoint - Entrypoint File. This path is relative to the "providerRootDirectory". * @param {string} commands - Build Commands. - * @param {Scopes[]} scopes - List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed. + * @param {ProjectKeyScopes[]} scopes - List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed. * @param {string} installationId - Appwrite Installation ID for VCS (Version Control System) deployment. * @param {string} providerRepositoryId - Repository ID of the repo linked to the function. * @param {string} providerBranch - Production branch for the repo linked to the function. * @param {boolean} providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests. * @param {string} providerRootDirectory - Path to function code in the linked repo. + * @param {string[]} providerBranches - List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches. + * @param {string[]} providerPaths - List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes. * @param {string} buildSpecification - Build specification for the function deployments. * @param {string} runtimeSpecification - Runtime specification for the function executions. * @param {number} deploymentRetention - Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept. @@ -137,15 +141,15 @@ export class Functions { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - create(functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: Scopes[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number): Promise; + create(functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: ProjectKeyScopes[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, providerBranches?: string[], providerPaths?: string[], buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number): Promise; create( - paramsOrFirst: { functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: Scopes[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number } | string, - ...rest: [(string)?, (Runtime)?, (string[])?, (string[])?, (string)?, (number)?, (boolean)?, (boolean)?, (string)?, (string)?, (Scopes[])?, (string)?, (string)?, (string)?, (boolean)?, (string)?, (string)?, (string)?, (number)?] + paramsOrFirst: { functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: ProjectKeyScopes[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, providerBranches?: string[], providerPaths?: string[], buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number } | string, + ...rest: [(string)?, (Runtime)?, (string[])?, (string[])?, (string)?, (number)?, (boolean)?, (boolean)?, (string)?, (string)?, (ProjectKeyScopes[])?, (string)?, (string)?, (string)?, (boolean)?, (string)?, (string[])?, (string[])?, (string)?, (string)?, (number)?] ): Promise { - let params: { functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: Scopes[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number }; + let params: { functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: ProjectKeyScopes[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, providerBranches?: string[], providerPaths?: string[], buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: Scopes[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number }; + params = (paramsOrFirst || {}) as { functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: ProjectKeyScopes[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, providerBranches?: string[], providerPaths?: string[], buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number }; } else { params = { functionId: paramsOrFirst as string, @@ -159,15 +163,17 @@ export class Functions { logging: rest[7] as boolean, entrypoint: rest[8] as string, commands: rest[9] as string, - scopes: rest[10] as Scopes[], + scopes: rest[10] as ProjectKeyScopes[], installationId: rest[11] as string, providerRepositoryId: rest[12] as string, providerBranch: rest[13] as string, providerSilentMode: rest[14] as boolean, providerRootDirectory: rest[15] as string, - buildSpecification: rest[16] as string, - runtimeSpecification: rest[17] as string, - deploymentRetention: rest[18] as number + providerBranches: rest[16] as string[], + providerPaths: rest[17] as string[], + buildSpecification: rest[18] as string, + runtimeSpecification: rest[19] as string, + deploymentRetention: rest[20] as number }; } @@ -188,6 +194,8 @@ export class Functions { const providerBranch = params.providerBranch; const providerSilentMode = params.providerSilentMode; const providerRootDirectory = params.providerRootDirectory; + const providerBranches = params.providerBranches; + const providerPaths = params.providerPaths; const buildSpecification = params.buildSpecification; const runtimeSpecification = params.runtimeSpecification; const deploymentRetention = params.deploymentRetention; @@ -255,6 +263,12 @@ export class Functions { if (typeof providerRootDirectory !== 'undefined') { payload['providerRootDirectory'] = providerRootDirectory; } + if (typeof providerBranches !== 'undefined') { + payload['providerBranches'] = providerBranches; + } + if (typeof providerPaths !== 'undefined') { + payload['providerPaths'] = providerPaths; + } if (typeof buildSpecification !== 'undefined') { payload['buildSpecification'] = buildSpecification; } @@ -389,19 +403,21 @@ export class Functions { * @param {boolean} params.logging - When disabled, executions will exclude logs and errors, and will be slightly faster. * @param {string} params.entrypoint - Entrypoint File. This path is relative to the "providerRootDirectory". * @param {string} params.commands - Build Commands. - * @param {Scopes[]} params.scopes - List of scopes allowed for API Key auto-generated for every execution. Maximum of 100 scopes are allowed. + * @param {ProjectKeyScopes[]} params.scopes - List of scopes allowed for API Key auto-generated for every execution. Maximum of 100 scopes are allowed. * @param {string} params.installationId - Appwrite Installation ID for VCS (Version Controle System) deployment. * @param {string} params.providerRepositoryId - Repository ID of the repo linked to the function * @param {string} params.providerBranch - Production branch for the repo linked to the function * @param {boolean} params.providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests. * @param {string} params.providerRootDirectory - Path to function code in the linked repo. + * @param {string[]} params.providerBranches - List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches. + * @param {string[]} params.providerPaths - List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes. * @param {string} params.buildSpecification - Build specification for the function deployments. * @param {string} params.runtimeSpecification - Runtime specification for the function executions. * @param {number} params.deploymentRetention - Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept. * @throws {AppwriteException} * @returns {Promise} */ - update(params: { functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: Scopes[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number }): Promise; + update(params: { functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: ProjectKeyScopes[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, providerBranches?: string[], providerPaths?: string[], buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number }): Promise; /** * Update function by its unique ID. * @@ -416,12 +432,14 @@ export class Functions { * @param {boolean} logging - When disabled, executions will exclude logs and errors, and will be slightly faster. * @param {string} entrypoint - Entrypoint File. This path is relative to the "providerRootDirectory". * @param {string} commands - Build Commands. - * @param {Scopes[]} scopes - List of scopes allowed for API Key auto-generated for every execution. Maximum of 100 scopes are allowed. + * @param {ProjectKeyScopes[]} scopes - List of scopes allowed for API Key auto-generated for every execution. Maximum of 100 scopes are allowed. * @param {string} installationId - Appwrite Installation ID for VCS (Version Controle System) deployment. * @param {string} providerRepositoryId - Repository ID of the repo linked to the function * @param {string} providerBranch - Production branch for the repo linked to the function * @param {boolean} providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests. * @param {string} providerRootDirectory - Path to function code in the linked repo. + * @param {string[]} providerBranches - List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches. + * @param {string[]} providerPaths - List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes. * @param {string} buildSpecification - Build specification for the function deployments. * @param {string} runtimeSpecification - Runtime specification for the function executions. * @param {number} deploymentRetention - Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept. @@ -429,15 +447,15 @@ export class Functions { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - update(functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: Scopes[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number): Promise; + update(functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: ProjectKeyScopes[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, providerBranches?: string[], providerPaths?: string[], buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number): Promise; update( - paramsOrFirst: { functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: Scopes[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number } | string, - ...rest: [(string)?, (Runtime)?, (string[])?, (string[])?, (string)?, (number)?, (boolean)?, (boolean)?, (string)?, (string)?, (Scopes[])?, (string)?, (string)?, (string)?, (boolean)?, (string)?, (string)?, (string)?, (number)?] + paramsOrFirst: { functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: ProjectKeyScopes[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, providerBranches?: string[], providerPaths?: string[], buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number } | string, + ...rest: [(string)?, (Runtime)?, (string[])?, (string[])?, (string)?, (number)?, (boolean)?, (boolean)?, (string)?, (string)?, (ProjectKeyScopes[])?, (string)?, (string)?, (string)?, (boolean)?, (string)?, (string[])?, (string[])?, (string)?, (string)?, (number)?] ): Promise { - let params: { functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: Scopes[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number }; + let params: { functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: ProjectKeyScopes[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, providerBranches?: string[], providerPaths?: string[], buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: Scopes[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number }; + params = (paramsOrFirst || {}) as { functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: ProjectKeyScopes[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, providerBranches?: string[], providerPaths?: string[], buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number }; } else { params = { functionId: paramsOrFirst as string, @@ -451,15 +469,17 @@ export class Functions { logging: rest[7] as boolean, entrypoint: rest[8] as string, commands: rest[9] as string, - scopes: rest[10] as Scopes[], + scopes: rest[10] as ProjectKeyScopes[], installationId: rest[11] as string, providerRepositoryId: rest[12] as string, providerBranch: rest[13] as string, providerSilentMode: rest[14] as boolean, providerRootDirectory: rest[15] as string, - buildSpecification: rest[16] as string, - runtimeSpecification: rest[17] as string, - deploymentRetention: rest[18] as number + providerBranches: rest[16] as string[], + providerPaths: rest[17] as string[], + buildSpecification: rest[18] as string, + runtimeSpecification: rest[19] as string, + deploymentRetention: rest[20] as number }; } @@ -480,6 +500,8 @@ export class Functions { const providerBranch = params.providerBranch; const providerSilentMode = params.providerSilentMode; const providerRootDirectory = params.providerRootDirectory; + const providerBranches = params.providerBranches; + const providerPaths = params.providerPaths; const buildSpecification = params.buildSpecification; const runtimeSpecification = params.runtimeSpecification; const deploymentRetention = params.deploymentRetention; @@ -541,6 +563,12 @@ export class Functions { if (typeof providerRootDirectory !== 'undefined') { payload['providerRootDirectory'] = providerRootDirectory; } + if (typeof providerBranches !== 'undefined') { + payload['providerBranches'] = providerBranches; + } + if (typeof providerPaths !== 'undefined') { + payload['providerPaths'] = providerPaths; + } if (typeof buildSpecification !== 'undefined') { payload['buildSpecification'] = buildSpecification; } diff --git a/src/services/health.ts b/src/services/health.ts index 1bd2cf03..6d4f6a85 100644 --- a/src/services/health.ts +++ b/src/services/health.ts @@ -2,7 +2,7 @@ import { AppwriteException, Client, type Payload, UploadProgress } from '../clie import type { Models } from '../models'; -import { Name } from '../enums/name'; +import { HealthQueueName } from '../enums/health-queue-name'; export class Health { client: Client; @@ -507,34 +507,34 @@ export class Health { * Returns the amount of failed jobs in a given queue. * * - * @param {Name} params.name - The name of the queue + * @param {HealthQueueName} params.name - The name of the queue * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} */ - getFailedJobs(params: { name: Name, threshold?: number }): Promise; + getFailedJobs(params: { name: HealthQueueName, threshold?: number }): Promise; /** * Returns the amount of failed jobs in a given queue. * * - * @param {Name} name - The name of the queue + * @param {HealthQueueName} name - The name of the queue * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getFailedJobs(name: Name, threshold?: number): Promise; + getFailedJobs(name: HealthQueueName, threshold?: number): Promise; getFailedJobs( - paramsOrFirst: { name: Name, threshold?: number } | Name, + paramsOrFirst: { name: HealthQueueName, threshold?: number } | HealthQueueName, ...rest: [(number)?] ): Promise { - let params: { name: Name, threshold?: number }; + let params: { name: HealthQueueName, threshold?: number }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('name' in paramsOrFirst || 'threshold' in paramsOrFirst))) { - params = (paramsOrFirst || {}) as { name: Name, threshold?: number }; + params = (paramsOrFirst || {}) as { name: HealthQueueName, threshold?: number }; } else { params = { - name: paramsOrFirst as Name, + name: paramsOrFirst as HealthQueueName, threshold: rest[0] as number }; } diff --git a/src/services/organization.ts b/src/services/organization.ts new file mode 100644 index 00000000..baa874fb --- /dev/null +++ b/src/services/organization.ts @@ -0,0 +1,644 @@ +import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; +import type { Models } from '../models'; + + +import { OrganizationKeyScopes } from '../enums/organization-key-scopes'; +import { Region } from '../enums/region'; + +export class Organization { + client: Client; + + constructor(client: Client) { + this.client = client; + } + + /** + * Get a list of all API keys from the current organization. + * + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire, accessedAt, name, scopes + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + */ + listKeys(params?: { queries?: string[], total?: boolean }): Promise; + /** + * Get a list of all API keys from the current organization. + * + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire, accessedAt, name, scopes + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listKeys(queries?: string[], total?: boolean): Promise; + listKeys( + paramsOrFirst?: { queries?: string[], total?: boolean } | string[], + ...rest: [(boolean)?] + ): Promise { + let params: { queries?: string[], total?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { queries?: string[], total?: boolean }; + } else { + params = { + queries: paramsOrFirst as string[], + total: rest[0] as boolean + }; + } + + const queries = params.queries; + const total = params.total; + + + const apiPath = '/organization/keys'; + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof total !== 'undefined') { + payload['total'] = total; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Create a new organization API key. + * + * @param {string} params.keyId - Key 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 - Key name. Max length: 128 chars. + * @param {OrganizationKeyScopes[]} params.scopes - Key scopes list. Maximum of 100 scopes are allowed. + * @param {string} params.expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @throws {AppwriteException} + * @returns {Promise} + */ + createKey(params: { keyId: string, name: string, scopes: OrganizationKeyScopes[], expire?: string }): Promise; + /** + * Create a new organization API key. + * + * @param {string} keyId - Key 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 - Key name. Max length: 128 chars. + * @param {OrganizationKeyScopes[]} scopes - Key scopes list. Maximum of 100 scopes are allowed. + * @param {string} expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createKey(keyId: string, name: string, scopes: OrganizationKeyScopes[], expire?: string): Promise; + createKey( + paramsOrFirst: { keyId: string, name: string, scopes: OrganizationKeyScopes[], expire?: string } | string, + ...rest: [(string)?, (OrganizationKeyScopes[])?, (string)?] + ): Promise { + let params: { keyId: string, name: string, scopes: OrganizationKeyScopes[], expire?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { keyId: string, name: string, scopes: OrganizationKeyScopes[], expire?: string }; + } else { + params = { + keyId: paramsOrFirst as string, + name: rest[0] as string, + scopes: rest[1] as OrganizationKeyScopes[], + expire: rest[2] as string + }; + } + + const keyId = params.keyId; + const name = params.name; + const scopes = params.scopes; + const expire = params.expire; + + if (typeof keyId === 'undefined') { + throw new AppwriteException('Missing required parameter: "keyId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof scopes === 'undefined') { + throw new AppwriteException('Missing required parameter: "scopes"'); + } + + const apiPath = '/organization/keys'; + const payload: Payload = {}; + if (typeof keyId !== 'undefined') { + payload['keyId'] = keyId; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof scopes !== 'undefined') { + payload['scopes'] = scopes; + } + if (typeof expire !== 'undefined') { + payload['expire'] = expire; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Get a key by its unique ID. This endpoint returns details about a specific API key in your organization including its scopes. + * + * @param {string} params.keyId - Key unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + getKey(params: { keyId: string }): Promise; + /** + * Get a key by its unique ID. This endpoint returns details about a specific API key in your organization including its scopes. + * + * @param {string} keyId - Key unique ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getKey(keyId: string): Promise; + getKey( + paramsOrFirst: { keyId: string } | string + ): Promise { + let params: { keyId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { keyId: string }; + } else { + params = { + keyId: paramsOrFirst as string + }; + } + + const keyId = params.keyId; + + if (typeof keyId === 'undefined') { + throw new AppwriteException('Missing required parameter: "keyId"'); + } + + const apiPath = '/organization/keys/{keyId}'.replace('{keyId}', keyId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. + * + * @param {string} params.keyId - Key unique ID. + * @param {string} params.name - Key name. Max length: 128 chars. + * @param {OrganizationKeyScopes[]} params.scopes - Key scopes list. Maximum of 100 scopes are allowed. + * @param {string} params.expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateKey(params: { keyId: string, name: string, scopes: OrganizationKeyScopes[], expire?: string }): Promise; + /** + * Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. + * + * @param {string} keyId - Key unique ID. + * @param {string} name - Key name. Max length: 128 chars. + * @param {OrganizationKeyScopes[]} scopes - Key scopes list. Maximum of 100 scopes are allowed. + * @param {string} expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateKey(keyId: string, name: string, scopes: OrganizationKeyScopes[], expire?: string): Promise; + updateKey( + paramsOrFirst: { keyId: string, name: string, scopes: OrganizationKeyScopes[], expire?: string } | string, + ...rest: [(string)?, (OrganizationKeyScopes[])?, (string)?] + ): Promise { + let params: { keyId: string, name: string, scopes: OrganizationKeyScopes[], expire?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { keyId: string, name: string, scopes: OrganizationKeyScopes[], expire?: string }; + } else { + params = { + keyId: paramsOrFirst as string, + name: rest[0] as string, + scopes: rest[1] as OrganizationKeyScopes[], + expire: rest[2] as string + }; + } + + const keyId = params.keyId; + const name = params.name; + const scopes = params.scopes; + const expire = params.expire; + + if (typeof keyId === 'undefined') { + throw new AppwriteException('Missing required parameter: "keyId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof scopes === 'undefined') { + throw new AppwriteException('Missing required parameter: "scopes"'); + } + + const apiPath = '/organization/keys/{keyId}'.replace('{keyId}', keyId); + const payload: Payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof scopes !== 'undefined') { + payload['scopes'] = scopes; + } + if (typeof expire !== 'undefined') { + payload['expire'] = expire; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload, + ); + } + + /** + * Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls. + * + * @param {string} params.keyId - Key unique ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deleteKey(params: { keyId: string }): Promise<{}>; + /** + * Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls. + * + * @param {string} keyId - Key unique ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deleteKey(keyId: string): Promise<{}>; + deleteKey( + paramsOrFirst: { keyId: string } | string + ): Promise<{}> { + let params: { keyId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { keyId: string }; + } else { + params = { + keyId: paramsOrFirst as string + }; + } + + const keyId = params.keyId; + + if (typeof keyId === 'undefined') { + throw new AppwriteException('Missing required parameter: "keyId"'); + } + + const apiPath = '/organization/keys/{keyId}'.replace('{keyId}', keyId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload, + ); + } + + /** + * Get a list of all projects. You can use the query params to filter your results. + * + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, teamId, labels, search + * @param {string} params.search - Search term to filter your list results. Max length: 256 chars. + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + */ + listProjects(params?: { queries?: string[], search?: string, total?: boolean }): Promise; + /** + * Get a list of all projects. You can use the query params to filter your results. + * + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, teamId, labels, search + * @param {string} search - Search term to filter your list results. Max length: 256 chars. + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listProjects(queries?: string[], search?: string, total?: boolean): Promise; + listProjects( + paramsOrFirst?: { queries?: string[], search?: string, total?: boolean } | string[], + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { queries?: string[], search?: string, total?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { queries?: string[], search?: string, total?: boolean }; + } else { + params = { + queries: paramsOrFirst as string[], + search: rest[0] as string, + total: rest[1] as boolean + }; + } + + const queries = params.queries; + const search = params.search; + const total = params.total; + + + const apiPath = '/organization/projects'; + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof search !== 'undefined') { + payload['search'] = search; + } + if (typeof total !== 'undefined') { + payload['total'] = total; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Create a new project. + * + * @param {string} params.projectId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, and hyphen. Can't start with a special char. Max length is 36 chars. + * @param {string} params.name - Project name. Max length: 128 chars. + * @param {Region} params.region - Project Region. + * @throws {AppwriteException} + * @returns {Promise} + */ + createProject(params: { projectId: string, name: string, region?: Region }): Promise; + /** + * Create a new project. + * + * @param {string} projectId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, and hyphen. Can't start with a special char. Max length is 36 chars. + * @param {string} name - Project name. Max length: 128 chars. + * @param {Region} region - Project Region. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createProject(projectId: string, name: string, region?: Region): Promise; + createProject( + paramsOrFirst: { projectId: string, name: string, region?: Region } | string, + ...rest: [(string)?, (Region)?] + ): Promise { + let params: { projectId: string, name: string, region?: Region }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { projectId: string, name: string, region?: Region }; + } else { + params = { + projectId: paramsOrFirst as string, + name: rest[0] as string, + region: rest[1] as Region + }; + } + + const projectId = params.projectId; + const name = params.name; + const region = params.region; + + if (typeof projectId === 'undefined') { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + + const apiPath = '/organization/projects'; + const payload: Payload = {}; + if (typeof projectId !== 'undefined') { + payload['projectId'] = projectId; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof region !== 'undefined') { + payload['region'] = region; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Get a project. + * + * @param {string} params.projectId - Project unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + getProject(params: { projectId: string }): Promise; + /** + * Get a project. + * + * @param {string} projectId - Project unique ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getProject(projectId: string): Promise; + getProject( + paramsOrFirst: { projectId: string } | string + ): Promise { + let params: { projectId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { projectId: string }; + } else { + params = { + projectId: paramsOrFirst as string + }; + } + + const projectId = params.projectId; + + if (typeof projectId === 'undefined') { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + + const apiPath = '/organization/projects/{projectId}'.replace('{projectId}', projectId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update a project by its unique ID. + * + * @param {string} params.projectId - Project unique ID. + * @param {string} params.name - Project name. Max length: 128 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateProject(params: { projectId: string, name: string }): Promise; + /** + * Update a project by its unique ID. + * + * @param {string} projectId - Project unique ID. + * @param {string} name - Project name. Max length: 128 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateProject(projectId: string, name: string): Promise; + updateProject( + paramsOrFirst: { projectId: string, name: string } | string, + ...rest: [(string)?] + ): Promise { + let params: { projectId: string, name: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { projectId: string, name: string }; + } else { + params = { + projectId: paramsOrFirst as string, + name: rest[0] as string + }; + } + + const projectId = params.projectId; + const name = params.name; + + if (typeof projectId === 'undefined') { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + + const apiPath = '/organization/projects/{projectId}'.replace('{projectId}', projectId); + const payload: Payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Delete a project by its unique ID. + * + * @param {string} params.projectId - Project unique ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deleteProject(params: { projectId: string }): Promise<{}>; + /** + * Delete a project by its unique ID. + * + * @param {string} projectId - Project unique ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deleteProject(projectId: string): Promise<{}>; + deleteProject( + paramsOrFirst: { projectId: string } | string + ): Promise<{}> { + let params: { projectId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { projectId: string }; + } else { + params = { + projectId: paramsOrFirst as string + }; + } + + const projectId = params.projectId; + + if (typeof projectId === 'undefined') { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + + const apiPath = '/organization/projects/{projectId}'.replace('{projectId}', projectId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload, + ); + } +} diff --git a/src/services/presences.ts b/src/services/presences.ts index 80cfb5b3..0088c90e 100644 --- a/src/services/presences.ts +++ b/src/services/presences.ts @@ -18,9 +18,9 @@ export class Presences { * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @param {number} params.ttl - TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours). * @throws {AppwriteException} - * @returns {Promise>} + * @returns {Promise} */ - list(params?: { queries?: string[], total?: boolean, ttl?: number }): Promise>; + list(params?: { queries?: string[], total?: boolean, ttl?: number }): Promise; /** * List presence logs. Expired entries are filtered out automatically. * @@ -29,14 +29,14 @@ export class Presences { * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @param {number} ttl - TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours). * @throws {AppwriteException} - * @returns {Promise>} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - list(queries?: string[], total?: boolean, ttl?: number): Promise>; - list( + list(queries?: string[], total?: boolean, ttl?: number): Promise; + list( paramsOrFirst?: { queries?: string[], total?: boolean, ttl?: number } | string[], ...rest: [(boolean)?, (number)?] - ): Promise> { + ): Promise { let params: { queries?: string[], total?: boolean, ttl?: number }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { @@ -84,22 +84,22 @@ export class Presences { * * @param {string} params.presenceId - Presence unique ID. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} */ - get(params: { presenceId: string }): Promise; + get(params: { presenceId: string }): Promise; /** * Get a presence log by its unique ID. Entries whose `expiresAt` is in the past are treated as not found. * * * @param {string} presenceId - Presence unique ID. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - get(presenceId: string): Promise; - get( + get(presenceId: string): Promise; + get( paramsOrFirst: { presenceId: string } | string - ): Promise { + ): Promise { let params: { presenceId: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { @@ -142,9 +142,9 @@ export class Presences { * @param {string} params.expiresAt - Presence expiry datetime. * @param {object} params.metadata - Presence metadata object. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} */ - upsert(params: { presenceId: string, userId: string, status: string, permissions?: string[], expiresAt?: string, metadata?: object }): Promise; + upsert(params: { presenceId: string, userId: string, status: string, permissions?: string[], expiresAt?: string, metadata?: object }): Promise; /** * Create or update a presence log by its user ID. * @@ -156,14 +156,14 @@ export class Presences { * @param {string} expiresAt - Presence expiry datetime. * @param {object} metadata - Presence metadata object. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - upsert(presenceId: string, userId: string, status: string, permissions?: string[], expiresAt?: string, metadata?: object): Promise; - upsert( + upsert(presenceId: string, userId: string, status: string, permissions?: string[], expiresAt?: string, metadata?: object): Promise; + upsert( paramsOrFirst: { presenceId: string, userId: string, status: string, permissions?: string[], expiresAt?: string, metadata?: object } | string, ...rest: [(string)?, (string)?, (string[])?, (string)?, (object)?] - ): Promise { + ): Promise { let params: { presenceId: string, userId: string, status: string, permissions?: string[], expiresAt?: string, metadata?: object }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { @@ -239,9 +239,9 @@ export class Presences { * @param {string[]} params.permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} params.purge - When true, purge cached responses used by list presences endpoint. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} */ - updatePresence(params: { presenceId: string, userId: string, status?: string, expiresAt?: string, metadata?: object, permissions?: string[], purge?: boolean }): Promise; + update(params: { presenceId: string, userId: string, status?: string, expiresAt?: string, metadata?: object, permissions?: string[], purge?: boolean }): Promise; /** * Update a presence log by its unique ID. Using the patch method you can pass only specific fields that will get updated. * @@ -254,14 +254,14 @@ export class Presences { * @param {string[]} permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} purge - When true, purge cached responses used by list presences endpoint. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updatePresence(presenceId: string, userId: string, status?: string, expiresAt?: string, metadata?: object, permissions?: string[], purge?: boolean): Promise; - updatePresence( + update(presenceId: string, userId: string, status?: string, expiresAt?: string, metadata?: object, permissions?: string[], purge?: boolean): Promise; + update( paramsOrFirst: { presenceId: string, userId: string, status?: string, expiresAt?: string, metadata?: object, permissions?: string[], purge?: boolean } | string, ...rest: [(string)?, (string)?, (string)?, (object)?, (string[])?, (boolean)?] - ): Promise { + ): Promise { let params: { presenceId: string, userId: string, status?: string, expiresAt?: string, metadata?: object, permissions?: string[], purge?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { diff --git a/src/services/project.ts b/src/services/project.ts index 898b6973..3fcec931 100644 --- a/src/services/project.ts +++ b/src/services/project.ts @@ -938,7 +938,7 @@ export class Project { * 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: 79ffe4000000000000000000000000000000000000000000000000000002de55 + * @param {string} params.clientSecret - 'Client Secret' of Amazon OAuth2 app. For example: your-oauth2-client-secret * @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 +948,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: 79ffe4000000000000000000000000000000000000000000000000000002de55 + * @param {string} clientSecret - 'Client Secret' of Amazon OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -1086,7 +1086,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: zXz0000-00000000000000000000000000000-00000000000000000000PJafnF + * @param {string} params.clientSecret - 'Client Secret' of Auth0 OAuth2 app. For example: your-oauth2-client-secret * @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 +1097,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: zXz0000-00000000000000000000000000000-00000000000000000000PJafnF + * @param {string} clientSecret - 'Client Secret' of Auth0 OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -1160,7 +1160,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: ntQadq000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Hp5WK + * @param {string} params.clientSecret - 'Client Secret' of Authentik OAuth2 app. For example: your-oauth2-client-secret * @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 +1171,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: ntQadq000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Hp5WK + * @param {string} clientSecret - 'Client Secret' of Authentik OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -1234,7 +1234,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: 7I000000000000MW + * @param {string} params.clientSecret - 'Client Secret' of Autodesk OAuth2 app. For example: your-oauth2-client-secret * @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 +1244,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: 7I000000000000MW + * @param {string} clientSecret - 'Client Secret' of Autodesk OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -1301,7 +1301,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: NMfLZJ00000000000000000000TLQdDx + * @param {string} params.secret - 'Secret' of Bitbucket OAuth2 app. For example: your-oauth2-client-secret * @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 +1311,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: NMfLZJ00000000000000000000TLQdDx + * @param {string} secret - 'Secret' of Bitbucket OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -1368,7 +1368,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: a13e250000000000000000000000000000d73095 + * @param {string} params.clientSecret - 'Client Secret' of Bitly OAuth2 app. For example: your-oauth2-client-secret * @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 +1378,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: a13e250000000000000000000000000000d73095 + * @param {string} clientSecret - 'Client Secret' of Bitly OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -1435,7 +1435,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: OKM1f100000000000000000000eshEif + * @param {string} params.clientSecret - 'Client Secret' of Box OAuth2 app. For example: your-oauth2-client-secret * @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 +1445,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: OKM1f100000000000000000000eshEif + * @param {string} clientSecret - 'Client Secret' of Box OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -1502,7 +1502,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: a399a90000000000000000000000000000d90639 + * @param {string} params.apiSecret - 'API Secret' of Dailymotion OAuth2 app. For example: your-oauth2-client-secret * @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 +1512,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: a399a90000000000000000000000000000d90639 + * @param {string} apiSecret - 'API Secret' of Dailymotion OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -1569,7 +1569,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: YmPXnM000000000000000000002zFg5D + * @param {string} params.clientSecret - 'Client Secret' of Discord OAuth2 app. For example: your-oauth2-client-secret * @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 +1579,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: YmPXnM000000000000000000002zFg5D + * @param {string} clientSecret - 'Client Secret' of Discord OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -1636,7 +1636,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: W7Bykj00000000000000000000000000000000000000000000000000003o43w9 + * @param {string} params.secretKey - 'Secret Key, also known as API Secret' of Disqus OAuth2 app. For example: your-oauth2-client-secret * @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 +1646,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: W7Bykj00000000000000000000000000000000000000000000000000003o43w9 + * @param {string} secretKey - 'Secret Key, also known as API Secret' of Disqus OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -1703,7 +1703,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: g200000000000vw + * @param {string} params.appSecret - 'App Secret' of Dropbox OAuth2 app. For example: your-oauth2-client-secret * @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 +1713,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: g200000000000vw + * @param {string} appSecret - 'App Secret' of Dropbox OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -1770,7 +1770,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: tp000000ru + * @param {string} params.sharedSecret - 'Shared Secret' of Etsy OAuth2 app. For example: your-oauth2-client-secret * @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 +1780,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: tp000000ru + * @param {string} sharedSecret - 'Shared Secret' of Etsy OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -1837,7 +1837,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: 2d0b2800000000000000000000d38af4 + * @param {string} params.appSecret - 'App Secret' of Facebook OAuth2 app. For example: your-oauth2-client-secret * @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 +1847,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: 2d0b2800000000000000000000d38af4 + * @param {string} appSecret - 'App Secret' of Facebook OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -1904,7 +1904,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: yEpOYn0000000000000000004iIsU5 + * @param {string} params.clientSecret - 'Client Secret' of Figma OAuth2 app. For example: your-oauth2-client-secret * @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 +1914,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: yEpOYn0000000000000000004iIsU5 + * @param {string} clientSecret - 'Client Secret' of Figma OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -1971,7 +1971,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: Jx4s0C0000000000000000000000000000000wGqLsc + * @param {string} params.clientSecret - 'Client Secret' of FusionAuth OAuth2 app. For example: your-oauth2-client-secret * @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 +1982,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: Jx4s0C0000000000000000000000000000000wGqLsc + * @param {string} clientSecret - 'Client Secret' of FusionAuth OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -2045,7 +2045,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: 5e07c00000000000000000000000000000198bcc + * @param {string} params.clientSecret - 'Client Secret' of GitHub OAuth2 app. For example: your-oauth2-client-secret * @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 +2055,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: 5e07c00000000000000000000000000000198bcc + * @param {string} clientSecret - 'Client Secret' of GitHub OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -2112,7 +2112,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: gloas-838cfa0000000000000000000000000000000000000000000000000000ecbb38 + * @param {string} params.secret - 'Secret' of Gitlab OAuth2 app. For example: your-oauth2-client-secret * @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 +2123,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: gloas-838cfa0000000000000000000000000000000000000000000000000000ecbb38 + * @param {string} secret - 'Secret' of Gitlab OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -2186,7 +2186,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: example-google-client-secret + * @param {string} params.clientSecret - 'Client Secret' of Google OAuth2 app. For example: your-oauth2-client-secret * @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 +2197,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: example-google-client-secret + * @param {string} clientSecret - 'Client Secret' of Google OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -2260,7 +2260,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: jdjrJd00000000000000000000HUsaZO + * @param {string} params.clientSecret - 'Client Secret' of Keycloak OAuth2 app. For example: your-oauth2-client-secret * @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 +2272,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: jdjrJd00000000000000000000HUsaZO + * @param {string} clientSecret - 'Client Secret' of Keycloak OAuth2 app. For example: your-oauth2-client-secret * @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. @@ -2341,7 +2341,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: 34ac5600000000000000000000000000000000000000000000000000e830c8b + * @param {string} params.clientSecret - 'Client Secret' of Kick OAuth2 app. For example: your-oauth2-client-secret * @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 +2351,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: 34ac5600000000000000000000000000000000000000000000000000e830c8b + * @param {string} clientSecret - 'Client Secret' of Kick OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -2408,7 +2408,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: example-linkedin-client-secret + * @param {string} params.primaryClientSecret - 'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: your-oauth2-client-secret * @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 +2418,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: example-linkedin-client-secret + * @param {string} primaryClientSecret - 'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -2475,7 +2475,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: A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u + * @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.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 +2486,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: A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u + * @param {string} applicationSecret - 'Entra ID Application Secret, also known as Client Secret' of Microsoft OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -2549,7 +2549,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: secret_dLUr4b000000000000000000000000000000lFHAa9 + * @param {string} params.oauthClientSecret - 'OAuth Client Secret' of Notion OAuth2 app. For example: your-oauth2-client-secret * @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 +2559,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: secret_dLUr4b000000000000000000000000000000lFHAa9 + * @param {string} oauthClientSecret - 'OAuth Client Secret' of Notion OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -2616,7 +2616,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: Ah68ed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003qpcHV + * @param {string} params.clientSecret - 'Client Secret' of Oidc OAuth2 app. For example: your-oauth2-client-secret * @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 +2630,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: Ah68ed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003qpcHV + * @param {string} clientSecret - 'Client Secret' of Oidc OAuth2 app. For example: your-oauth2-client-secret * @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 @@ -2711,7 +2711,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: Kiq0000000000000000000000000000000000000-00000000000H2L5-3SJ-vRV + * @param {string} params.clientSecret - 'Client Secret' of Okta OAuth2 app. For example: your-oauth2-client-secret * @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 +2723,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: Kiq0000000000000000000000000000000000000-00000000000H2L5-3SJ-vRV + * @param {string} clientSecret - 'Client Secret' of Okta OAuth2 app. For example: your-oauth2-client-secret * @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. @@ -2792,7 +2792,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: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp + * @param {string} params.secretKey - 'Secret Key 1 or Secret Key 2' of Paypal OAuth2 app. For example: your-oauth2-client-secret * @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 +2802,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: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp + * @param {string} secretKey - 'Secret Key 1 or Secret Key 2' of Paypal OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -2859,7 +2859,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: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp + * @param {string} params.secretKey - 'Secret Key 1 or Secret Key 2' of PaypalSandbox OAuth2 app. For example: your-oauth2-client-secret * @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 +2869,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: EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp + * @param {string} secretKey - 'Secret Key 1 or Secret Key 2' of PaypalSandbox OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -2926,7 +2926,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: Rn247T0000000000000000000000000000000000000000000000000000W2zWTN + * @param {string} params.clientSecret - 'Client Secret' of Podio OAuth2 app. For example: your-oauth2-client-secret * @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 +2936,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: Rn247T0000000000000000000000000000000000000000000000000000W2zWTN + * @param {string} clientSecret - 'Client Secret' of Podio OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -2993,7 +2993,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: 3w000000000000e2 + * @param {string} params.customerSecret - 'Consumer Secret' of Salesforce OAuth2 app. For example: your-oauth2-client-secret * @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 +3003,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: 3w000000000000e2 + * @param {string} customerSecret - 'Consumer Secret' of Salesforce OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -3060,7 +3060,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: 81656000000000000000000000f3d2fd + * @param {string} params.clientSecret - 'Client Secret' of Slack OAuth2 app. For example: your-oauth2-client-secret * @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 +3070,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: 81656000000000000000000000f3d2fd + * @param {string} clientSecret - 'Client Secret' of Slack OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -3127,7 +3127,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: db068a000000000000000000008b5b9f + * @param {string} params.clientSecret - 'Client Secret' of Spotify OAuth2 app. For example: your-oauth2-client-secret * @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 +3137,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: db068a000000000000000000008b5b9f + * @param {string} clientSecret - 'Client Secret' of Spotify OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -3194,7 +3194,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: sk_51SfOd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000QGWYfp + * @param {string} params.apiSecretKey - 'API Secret Key' of Stripe OAuth2 app. For example: your-oauth2-client-secret * @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 +3204,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: sk_51SfOd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000QGWYfp + * @param {string} apiSecretKey - 'API Secret Key' of Stripe OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -3261,7 +3261,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: 7cb52700-0000-0000-0000-000000ca5b83 + * @param {string} params.oauth2ClientSecret - 'OAuth2 Client Secret' of Tradeshift OAuth2 app. For example: your-oauth2-client-secret * @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 +3271,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: 7cb52700-0000-0000-0000-000000ca5b83 + * @param {string} oauth2ClientSecret - 'OAuth2 Client Secret' of Tradeshift OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -3328,7 +3328,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: 7cb52700-0000-0000-0000-000000ca5b83 + * @param {string} params.oauth2ClientSecret - 'OAuth2 Client Secret' of Tradeshift Sandbox OAuth2 app. For example: your-oauth2-client-secret * @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 +3338,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: 7cb52700-0000-0000-0000-000000ca5b83 + * @param {string} oauth2ClientSecret - 'OAuth2 Client Secret' of Tradeshift Sandbox OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -3395,7 +3395,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: pmapue000000000000000000zylw3v + * @param {string} params.clientSecret - 'Client Secret' of Twitch OAuth2 app. For example: your-oauth2-client-secret * @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 +3405,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: pmapue000000000000000000zylw3v + * @param {string} clientSecret - 'Client Secret' of Twitch OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -3462,7 +3462,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: PlBfJS0000000000000000000000000000000000000000000000000000EdUZJk + * @param {string} params.clientSecret - 'Client Secret' of WordPress OAuth2 app. For example: your-oauth2-client-secret * @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 +3472,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: PlBfJS0000000000000000000000000000000000000000000000000000EdUZJk + * @param {string} clientSecret - 'Client Secret' of WordPress OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -3529,7 +3529,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: tkEPkp00000000000000000000000000000000000000FTxbI9 + * @param {string} params.secretKey - 'Secret Key' of X OAuth2 app. For example: your-oauth2-client-secret * @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 +3539,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: tkEPkp00000000000000000000000000000000000000FTxbI9 + * @param {string} secretKey - 'Secret Key' of X OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -3596,7 +3596,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: cf978f0000000000000000000000000000c5e2e9 + * @param {string} params.clientSecret - 'Client Secret, also known as Customer Secret' of Yahoo OAuth2 app. For example: your-oauth2-client-secret * @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 +3606,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: cf978f0000000000000000000000000000c5e2e9 + * @param {string} clientSecret - 'Client Secret, also known as Customer Secret' of Yahoo OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -3663,7 +3663,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: bbf98500000000000000000000c75a63 + * @param {string} params.clientSecret - 'Client Secret' of Yandex OAuth2 app. For example: your-oauth2-client-secret * @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 +3673,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: bbf98500000000000000000000c75a63 + * @param {string} clientSecret - 'Client Secret' of Yandex OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -3730,7 +3730,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: fb5cac000000000000000000000000000000a68f6e + * @param {string} params.clientSecret - 'Client Secret' of Zoho OAuth2 app. For example: your-oauth2-client-secret * @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 +3740,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: fb5cac000000000000000000000000000000a68f6e + * @param {string} clientSecret - 'Client Secret' of Zoho OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -3797,7 +3797,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: GAWsG4000000000000000000007U01ON + * @param {string} params.clientSecret - 'Client Secret' of Zoom OAuth2 app. For example: your-oauth2-client-secret * @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 +3807,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: GAWsG4000000000000000000007U01ON + * @param {string} clientSecret - 'Client Secret' of Zoom OAuth2 app. For example: your-oauth2-client-secret * @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} @@ -5570,23 +5570,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. + * @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. * @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. + * @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. * @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))) { @@ -5749,12 +5749,12 @@ export class Project { * * @param {string} params.host - SMTP server hostname (domain) * @param {number} params.port - SMTP server port - * @param {string} params.username - SMTP server username. Leave empty for no authorization. - * @param {string} params.password - SMTP server password. Leave empty for no authorization. This property is stored securely and cannot be read in future (write-only). - * @param {string} params.senderEmail - Email address shown in inbox as the sender of the email. - * @param {string} params.senderName - Name shown in inbox as the sender of the email. - * @param {string} params.replyToEmail - Email used when user replies to the email. - * @param {string} params.replyToName - Name used when user replies to the email. + * @param {string} params.username - SMTP server username. Pass an empty string to clear a previously set value. + * @param {string} params.password - SMTP server password. Pass an empty string to clear a previously set value. This property is stored securely and cannot be read in future (write-only). + * @param {string} params.senderEmail - Email address shown in inbox as the sender of the email. Pass an empty string to clear a previously set value. + * @param {string} params.senderName - Name shown in inbox as the sender of the email. Pass an empty string to clear a previously set value. + * @param {string} params.replyToEmail - Email used when user replies to the email. Pass an empty string to clear a previously set value. + * @param {string} params.replyToName - Name used when user replies to the email. Pass an empty string to clear a previously set value. * @param {ProjectSMTPSecure} params.secure - Configures if communication with SMTP server is encrypted. Allowed values are: tls, ssl. Leave empty for no encryption. * @param {boolean} params.enabled - Enable or disable custom SMTP. Custom SMTP is useful for branding purposes, but also allows use of custom email templates. * @throws {AppwriteException} @@ -5766,12 +5766,12 @@ export class Project { * * @param {string} host - SMTP server hostname (domain) * @param {number} port - SMTP server port - * @param {string} username - SMTP server username. Leave empty for no authorization. - * @param {string} password - SMTP server password. Leave empty for no authorization. This property is stored securely and cannot be read in future (write-only). - * @param {string} senderEmail - Email address shown in inbox as the sender of the email. - * @param {string} senderName - Name shown in inbox as the sender of the email. - * @param {string} replyToEmail - Email used when user replies to the email. - * @param {string} replyToName - Name used when user replies to the email. + * @param {string} username - SMTP server username. Pass an empty string to clear a previously set value. + * @param {string} password - SMTP server password. Pass an empty string to clear a previously set value. This property is stored securely and cannot be read in future (write-only). + * @param {string} senderEmail - Email address shown in inbox as the sender of the email. Pass an empty string to clear a previously set value. + * @param {string} senderName - Name shown in inbox as the sender of the email. Pass an empty string to clear a previously set value. + * @param {string} replyToEmail - Email used when user replies to the email. Pass an empty string to clear a previously set value. + * @param {string} replyToName - Name used when user replies to the email. Pass an empty string to clear a previously set value. * @param {ProjectSMTPSecure} secure - Configures if communication with SMTP server is encrypted. Allowed values are: tls, ssl. Leave empty for no encryption. * @param {boolean} enabled - Enable or disable custom SMTP. Custom SMTP is useful for branding purposes, but also allows use of custom email templates. * @throws {AppwriteException} @@ -5982,8 +5982,8 @@ export class Project { * @param {string} params.subject - Subject of the email template. Can be up to 255 characters. * @param {string} params.message - Plain or HTML body of the email template message. Can be up to 10MB of content. * @param {string} params.senderName - Name of the email sender. - * @param {string} params.senderEmail - Email of the sender. - * @param {string} params.replyToEmail - Reply to email. + * @param {string} params.senderEmail - Email of the sender. Pass an empty string to clear a previously set value. + * @param {string} params.replyToEmail - Reply to email. Pass an empty string to clear a previously set value. * @param {string} params.replyToName - Reply to name. * @throws {AppwriteException} * @returns {Promise} @@ -5997,8 +5997,8 @@ export class Project { * @param {string} subject - Subject of the email template. Can be up to 255 characters. * @param {string} message - Plain or HTML body of the email template message. Can be up to 10MB of content. * @param {string} senderName - Name of the email sender. - * @param {string} senderEmail - Email of the sender. - * @param {string} replyToEmail - Reply to email. + * @param {string} senderEmail - Email of the sender. Pass an empty string to clear a previously set value. + * @param {string} replyToEmail - Reply to email. Pass an empty string to clear a previously set value. * @param {string} replyToName - Reply to name. * @throws {AppwriteException} * @returns {Promise} diff --git a/src/services/sites.ts b/src/services/sites.ts index a45f6478..d935cda7 100644 --- a/src/services/sites.ts +++ b/src/services/sites.ts @@ -104,13 +104,15 @@ export class Sites { * @param {string} params.providerBranch - Production branch for the repo linked to the site. * @param {boolean} params.providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests. * @param {string} params.providerRootDirectory - Path to site code in the linked repo. + * @param {string[]} params.providerBranches - List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches. + * @param {string[]} params.providerPaths - List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes. * @param {string} params.buildSpecification - Build specification for the site deployments. * @param {string} params.runtimeSpecification - Runtime specification for the SSR executions. * @param {number} params.deploymentRetention - Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept. * @throws {AppwriteException} * @returns {Promise} */ - create(params: { siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, startCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number }): Promise; + create(params: { siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, startCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, providerBranches?: string[], providerPaths?: string[], buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number }): Promise; /** * Create a new site. * @@ -132,6 +134,8 @@ export class Sites { * @param {string} providerBranch - Production branch for the repo linked to the site. * @param {boolean} providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests. * @param {string} providerRootDirectory - Path to site code in the linked repo. + * @param {string[]} providerBranches - List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches. + * @param {string[]} providerPaths - List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes. * @param {string} buildSpecification - Build specification for the site deployments. * @param {string} runtimeSpecification - Runtime specification for the SSR executions. * @param {number} deploymentRetention - Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept. @@ -139,15 +143,15 @@ export class Sites { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - create(siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, startCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number): Promise; + create(siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, startCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, providerBranches?: string[], providerPaths?: string[], buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number): Promise; create( - paramsOrFirst: { siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, startCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number } | string, - ...rest: [(string)?, (Framework)?, (BuildRuntime)?, (boolean)?, (boolean)?, (number)?, (string)?, (string)?, (string)?, (string)?, (Adapter)?, (string)?, (string)?, (string)?, (string)?, (boolean)?, (string)?, (string)?, (string)?, (number)?] + paramsOrFirst: { siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, startCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, providerBranches?: string[], providerPaths?: string[], buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number } | string, + ...rest: [(string)?, (Framework)?, (BuildRuntime)?, (boolean)?, (boolean)?, (number)?, (string)?, (string)?, (string)?, (string)?, (Adapter)?, (string)?, (string)?, (string)?, (string)?, (boolean)?, (string)?, (string[])?, (string[])?, (string)?, (string)?, (number)?] ): Promise { - let params: { siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, startCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number }; + let params: { siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, startCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, providerBranches?: string[], providerPaths?: string[], buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, startCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number }; + params = (paramsOrFirst || {}) as { siteId: string, name: string, framework: Framework, buildRuntime: BuildRuntime, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, startCommand?: string, outputDirectory?: string, adapter?: Adapter, installationId?: string, fallbackFile?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, providerBranches?: string[], providerPaths?: string[], buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number }; } else { params = { siteId: paramsOrFirst as string, @@ -168,9 +172,11 @@ export class Sites { providerBranch: rest[14] as string, providerSilentMode: rest[15] as boolean, providerRootDirectory: rest[16] as string, - buildSpecification: rest[17] as string, - runtimeSpecification: rest[18] as string, - deploymentRetention: rest[19] as number + providerBranches: rest[17] as string[], + providerPaths: rest[18] as string[], + buildSpecification: rest[19] as string, + runtimeSpecification: rest[20] as string, + deploymentRetention: rest[21] as number }; } @@ -192,6 +198,8 @@ export class Sites { const providerBranch = params.providerBranch; const providerSilentMode = params.providerSilentMode; const providerRootDirectory = params.providerRootDirectory; + const providerBranches = params.providerBranches; + const providerPaths = params.providerPaths; const buildSpecification = params.buildSpecification; const runtimeSpecification = params.runtimeSpecification; const deploymentRetention = params.deploymentRetention; @@ -265,6 +273,12 @@ export class Sites { if (typeof providerRootDirectory !== 'undefined') { payload['providerRootDirectory'] = providerRootDirectory; } + if (typeof providerBranches !== 'undefined') { + payload['providerBranches'] = providerBranches; + } + if (typeof providerPaths !== 'undefined') { + payload['providerPaths'] = providerPaths; + } if (typeof buildSpecification !== 'undefined') { payload['buildSpecification'] = buildSpecification; } @@ -406,13 +420,15 @@ export class Sites { * @param {string} params.providerBranch - Production branch for the repo linked to the site. * @param {boolean} params.providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests. * @param {string} params.providerRootDirectory - Path to site code in the linked repo. + * @param {string[]} params.providerBranches - List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches. + * @param {string[]} params.providerPaths - List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes. * @param {string} params.buildSpecification - Build specification for the site deployments. * @param {string} params.runtimeSpecification - Runtime specification for the SSR executions. * @param {number} params.deploymentRetention - Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept. * @throws {AppwriteException} * @returns {Promise} */ - update(params: { siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, startCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number }): Promise; + update(params: { siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, startCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, providerBranches?: string[], providerPaths?: string[], buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number }): Promise; /** * Update site by its unique ID. * @@ -434,6 +450,8 @@ export class Sites { * @param {string} providerBranch - Production branch for the repo linked to the site. * @param {boolean} providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests. * @param {string} providerRootDirectory - Path to site code in the linked repo. + * @param {string[]} providerBranches - List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches. + * @param {string[]} providerPaths - List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes. * @param {string} buildSpecification - Build specification for the site deployments. * @param {string} runtimeSpecification - Runtime specification for the SSR executions. * @param {number} deploymentRetention - Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept. @@ -441,15 +459,15 @@ export class Sites { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - update(siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, startCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number): Promise; + update(siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, startCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, providerBranches?: string[], providerPaths?: string[], buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number): Promise; update( - paramsOrFirst: { siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, startCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number } | string, - ...rest: [(string)?, (Framework)?, (boolean)?, (boolean)?, (number)?, (string)?, (string)?, (string)?, (string)?, (BuildRuntime)?, (Adapter)?, (string)?, (string)?, (string)?, (string)?, (boolean)?, (string)?, (string)?, (string)?, (number)?] + paramsOrFirst: { siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, startCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, providerBranches?: string[], providerPaths?: string[], buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number } | string, + ...rest: [(string)?, (Framework)?, (boolean)?, (boolean)?, (number)?, (string)?, (string)?, (string)?, (string)?, (BuildRuntime)?, (Adapter)?, (string)?, (string)?, (string)?, (string)?, (boolean)?, (string)?, (string[])?, (string[])?, (string)?, (string)?, (number)?] ): Promise { - let params: { siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, startCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number }; + let params: { siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, startCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, providerBranches?: string[], providerPaths?: string[], buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, startCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number }; + params = (paramsOrFirst || {}) as { siteId: string, name: string, framework: Framework, enabled?: boolean, logging?: boolean, timeout?: number, installCommand?: string, buildCommand?: string, startCommand?: string, outputDirectory?: string, buildRuntime?: BuildRuntime, adapter?: Adapter, fallbackFile?: string, installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, providerBranches?: string[], providerPaths?: string[], buildSpecification?: string, runtimeSpecification?: string, deploymentRetention?: number }; } else { params = { siteId: paramsOrFirst as string, @@ -470,9 +488,11 @@ export class Sites { providerBranch: rest[14] as string, providerSilentMode: rest[15] as boolean, providerRootDirectory: rest[16] as string, - buildSpecification: rest[17] as string, - runtimeSpecification: rest[18] as string, - deploymentRetention: rest[19] as number + providerBranches: rest[17] as string[], + providerPaths: rest[18] as string[], + buildSpecification: rest[19] as string, + runtimeSpecification: rest[20] as string, + deploymentRetention: rest[21] as number }; } @@ -494,6 +514,8 @@ export class Sites { const providerBranch = params.providerBranch; const providerSilentMode = params.providerSilentMode; const providerRootDirectory = params.providerRootDirectory; + const providerBranches = params.providerBranches; + const providerPaths = params.providerPaths; const buildSpecification = params.buildSpecification; const runtimeSpecification = params.runtimeSpecification; const deploymentRetention = params.deploymentRetention; @@ -561,6 +583,12 @@ export class Sites { if (typeof providerRootDirectory !== 'undefined') { payload['providerRootDirectory'] = providerRootDirectory; } + if (typeof providerBranches !== 'undefined') { + payload['providerBranches'] = providerBranches; + } + if (typeof providerPaths !== 'undefined') { + payload['providerPaths'] = providerPaths; + } if (typeof buildSpecification !== 'undefined') { payload['buildSpecification'] = buildSpecification; } diff --git a/src/services/usage.ts b/src/services/usage.ts index 84c654ab..551274ee 100644 --- a/src/services/usage.ts +++ b/src/services/usage.ts @@ -70,7 +70,7 @@ export class Usage { } /** - * Query usage gauge metrics (point-in-time resource snapshots) from the usage database. Returns individual gauge snapshots with metric, value, and timestamp. Pass Query objects as JSON strings to filter, paginate, and order results. Supported query methods: equal, greaterThanEqual, lessThanEqual, orderAsc, orderDesc, limit, offset. Supported filter attributes: metric, time. Use `orderDesc("time"), limit(1)` to fetch the most recent snapshot. When no time filter is supplied the endpoint defaults to the last 7 days. Default `limit(100)` is applied if none is given; user-supplied limits are capped at 500. The `total` field is capped at 5000 to keep counts predictable — pass `total=false` to skip the count entirely. + * Query usage gauge metrics (point-in-time resource snapshots) from the usage database. Returns individual gauge snapshots with metric, value, timestamp, resourceType, and resourceId. Pass Query objects as JSON strings to filter, paginate, and order results. Supported query methods: equal, greaterThanEqual, lessThanEqual, orderAsc, orderDesc, limit, offset. Supported filter attributes: metric, time. Use `orderDesc("time"), limit(1)` to fetch the most recent snapshot. When no time filter is supplied the endpoint defaults to the last 7 days. Default `limit(100)` is applied if none is given; user-supplied limits are capped at 500. The `total` field is capped at 5000 to keep counts predictable — pass `total=false` to skip the count entirely. * * @param {string[]} params.queries - Array of query strings as JSON. Supported: equal("metric", [...]), greaterThanEqual("time", "..."), lessThanEqual("time", "..."), orderAsc("time"), orderDesc("time"), limit(N), offset(N). * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. @@ -79,7 +79,7 @@ export class Usage { */ listGauges(params?: { queries?: string[], total?: boolean }): Promise; /** - * Query usage gauge metrics (point-in-time resource snapshots) from the usage database. Returns individual gauge snapshots with metric, value, and timestamp. Pass Query objects as JSON strings to filter, paginate, and order results. Supported query methods: equal, greaterThanEqual, lessThanEqual, orderAsc, orderDesc, limit, offset. Supported filter attributes: metric, time. Use `orderDesc("time"), limit(1)` to fetch the most recent snapshot. When no time filter is supplied the endpoint defaults to the last 7 days. Default `limit(100)` is applied if none is given; user-supplied limits are capped at 500. The `total` field is capped at 5000 to keep counts predictable — pass `total=false` to skip the count entirely. + * Query usage gauge metrics (point-in-time resource snapshots) from the usage database. Returns individual gauge snapshots with metric, value, timestamp, resourceType, and resourceId. Pass Query objects as JSON strings to filter, paginate, and order results. Supported query methods: equal, greaterThanEqual, lessThanEqual, orderAsc, orderDesc, limit, offset. Supported filter attributes: metric, time. Use `orderDesc("time"), limit(1)` to fetch the most recent snapshot. When no time filter is supplied the endpoint defaults to the last 7 days. Default `limit(100)` is applied if none is given; user-supplied limits are capped at 500. The `total` field is capped at 5000 to keep counts predictable — pass `total=false` to skip the count entirely. * * @param {string[]} queries - Array of query strings as JSON. Supported: equal("metric", [...]), greaterThanEqual("time", "..."), lessThanEqual("time", "..."), orderAsc("time"), orderDesc("time"), limit(N), offset(N). * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. diff --git a/test/services/activities.test.js b/test/services/activities.test.js index 667ecc56..08d0d906 100644 --- a/test/services/activities.test.js +++ b/test/services/activities.test.js @@ -28,10 +28,10 @@ describe('Activities', () => { test('test method getEvent()', async () => { const data = { '\$id': '5e5ea5c16897e', - 'userType': 'user', - 'userId': '610fc2f985ee0', - 'userEmail': 'john@appwrite.io', - 'userName': 'John Doe', + 'actorType': 'user', + 'actorId': '610fc2f985ee0', + 'actorEmail': 'john@appwrite.io', + 'actorName': 'John Doe', 'resourceParent': 'database/ID', 'resourceType': 'collection', 'resourceId': '610fc2f985ee0', diff --git a/test/services/functions.test.js b/test/services/functions.test.js index f5e19c8d..02dd3d2c 100644 --- a/test/services/functions.test.js +++ b/test/services/functions.test.js @@ -55,6 +55,8 @@ describe('Functions', () => { 'providerBranch': 'main', 'providerRootDirectory': 'functions/helloWorld', 'providerSilentMode': true, + 'providerBranches': [], + 'providerPaths': [], 'buildSpecification': 's-1vcpu-512mb', 'runtimeSpecification': 's-1vcpu-512mb',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -131,6 +133,8 @@ describe('Functions', () => { 'providerBranch': 'main', 'providerRootDirectory': 'functions/helloWorld', 'providerSilentMode': true, + 'providerBranches': [], + 'providerPaths': [], 'buildSpecification': 's-1vcpu-512mb', 'runtimeSpecification': 's-1vcpu-512mb',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -175,6 +179,8 @@ describe('Functions', () => { 'providerBranch': 'main', 'providerRootDirectory': 'functions/helloWorld', 'providerSilentMode': true, + 'providerBranches': [], + 'providerPaths': [], 'buildSpecification': 's-1vcpu-512mb', 'runtimeSpecification': 's-1vcpu-512mb',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -234,6 +240,8 @@ describe('Functions', () => { 'providerBranch': 'main', 'providerRootDirectory': 'functions/helloWorld', 'providerSilentMode': true, + 'providerBranches': [], + 'providerPaths': [], 'buildSpecification': 's-1vcpu-512mb', 'runtimeSpecification': 's-1vcpu-512mb',}; mockedFetch.mockImplementation(() => Response.json(data)); diff --git a/test/services/organization.test.js b/test/services/organization.test.js new file mode 100644 index 00000000..b9ede1fc --- /dev/null +++ b/test/services/organization.test.js @@ -0,0 +1,265 @@ +const { Client } = require("../../dist/client"); +const { InputFile } = require("../../dist/inputFile"); +const { Organization } = require("../../dist/services/organization"); + +const { fetch: mockedFetch, Response } = require("node-fetch-native-with-agent"); +jest.mock('node-fetch-native-with-agent', () => ({ ...jest.requireActual('node-fetch-native-with-agent'), fetch: jest.fn() })); + +describe('Organization', () => { + const client = new Client(); + const organization = new Organization(client); + + + test('test method listKeys()', async () => { + const data = { + 'total': 5, + 'keys': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await organization.listKeys( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method createKey()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My API Key', + 'expire': '2020-10-15T06:38:00.000+00:00', + 'scopes': [], + 'secret': '919c2d18fb5d4...a2ae413da83346ad2', + 'accessedAt': '2020-10-15T06:38:00.000+00:00', + 'sdks': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await organization.createKey( + '', + '', + [], + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method getKey()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My API Key', + 'expire': '2020-10-15T06:38:00.000+00:00', + 'scopes': [], + 'secret': '919c2d18fb5d4...a2ae413da83346ad2', + 'accessedAt': '2020-10-15T06:38:00.000+00:00', + 'sdks': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await organization.getKey( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateKey()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My API Key', + 'expire': '2020-10-15T06:38:00.000+00:00', + 'scopes': [], + 'secret': '919c2d18fb5d4...a2ae413da83346ad2', + 'accessedAt': '2020-10-15T06:38:00.000+00:00', + 'sdks': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await organization.updateKey( + '', + '', + [], + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method deleteKey()', async () => { + const data = {message: ""}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await organization.deleteKey( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method listProjects()', async () => { + const data = { + 'total': 5, + 'projects': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await organization.listProjects( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method createProject()', 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', + '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': [], + 'region': 'fra', + 'blocks': [], + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await organization.createProject( + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method getProject()', 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', + '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': [], + 'region': 'fra', + 'blocks': [], + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await organization.getProject( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateProject()', 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', + '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': [], + 'region': 'fra', + 'blocks': [], + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await organization.updateProject( + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method deleteProject()', async () => { + const data = {message: ""}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await organization.deleteProject( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + }) diff --git a/test/services/presences.test.js b/test/services/presences.test.js index 2b43154c..e6e25bb8 100644 --- a/test/services/presences.test.js +++ b/test/services/presences.test.js @@ -67,7 +67,7 @@ describe('Presences', () => { expect(response).toEqual(data); }); - test('test method updatePresence()', async () => { + test('test method update()', async () => { const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', @@ -77,7 +77,7 @@ describe('Presences', () => { 'source': 'HTTP',}; mockedFetch.mockImplementation(() => Response.json(data)); - const response = await presences.updatePresence( + const response = await presences.update( '', '', ); diff --git a/test/services/project.test.js b/test/services/project.test.js index 7a18b7e7..3f46e8c9 100644 --- a/test/services/project.test.js +++ b/test/services/project.test.js @@ -374,7 +374,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'amzn1.application-oa2-client.87400c00000000000000000000063d5b2', - 'clientSecret': '79ffe4000000000000000000000000000000000000000000000000000002de55',}; + 'clientSecret': 'your-oauth2-client-secret',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Amazon( @@ -410,7 +410,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'OaOkIA000000000000000000005KLSYq', - 'clientSecret': 'zXz0000-00000000000000000000000000000-00000000000000000000PJafnF', + 'clientSecret': 'your-oauth2-client-secret', 'endpoint': 'example.us.auth0.com',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -428,7 +428,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'dTKOPa0000000000000000000000000000e7G8hv', - 'clientSecret': 'ntQadq000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Hp5WK', + 'clientSecret': 'your-oauth2-client-secret', 'endpoint': 'example.authentik.com',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -446,7 +446,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': '5zw90v00000000000000000000kVYXN7', - 'clientSecret': '7I000000000000MW',}; + 'clientSecret': 'your-oauth2-client-secret',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Autodesk( @@ -463,7 +463,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'key': 'Knt70000000000ByRc', - 'secret': 'NMfLZJ00000000000000000000TLQdDx',}; + 'secret': 'your-oauth2-client-secret',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Bitbucket( @@ -480,7 +480,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'd95151000000000000000000000000000067af9b', - 'clientSecret': 'a13e250000000000000000000000000000d73095',}; + 'clientSecret': 'your-oauth2-client-secret',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Bitly( @@ -497,7 +497,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'deglcs00000000000000000000x2og6y', - 'clientSecret': 'OKM1f100000000000000000000eshEif',}; + 'clientSecret': 'your-oauth2-client-secret',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Box( @@ -514,7 +514,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'apiKey': '07a9000000000000067f', - 'apiSecret': 'a399a90000000000000000000000000000d90639',}; + 'apiSecret': 'your-oauth2-client-secret',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Dailymotion( @@ -531,7 +531,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': '950722000000343754', - 'clientSecret': 'YmPXnM000000000000000000002zFg5D',}; + 'clientSecret': 'your-oauth2-client-secret',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Discord( @@ -548,7 +548,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'publicKey': 'cgegH70000000000000000000000000000000000000000000000000000Hr1nYX', - 'secretKey': 'W7Bykj00000000000000000000000000000000000000000000000000003o43w9',}; + 'secretKey': 'your-oauth2-client-secret',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Disqus( @@ -565,7 +565,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'appKey': 'jl000000000009t', - 'appSecret': 'g200000000000vw',}; + 'appSecret': 'your-oauth2-client-secret',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Dropbox( @@ -582,7 +582,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'keyString': 'nsgzxh0000000000008j85a2', - 'sharedSecret': 'tp000000ru',}; + 'sharedSecret': 'your-oauth2-client-secret',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Etsy( @@ -599,7 +599,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'appId': '260600000007694', - 'appSecret': '2d0b2800000000000000000000d38af4',}; + 'appSecret': 'your-oauth2-client-secret',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Facebook( @@ -616,7 +616,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'byay5H0000000000VtiI40', - 'clientSecret': 'yEpOYn0000000000000000004iIsU5',}; + 'clientSecret': 'your-oauth2-client-secret',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Figma( @@ -633,7 +633,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'b2222c00-0000-0000-0000-000000862097', - 'clientSecret': 'Jx4s0C0000000000000000000000000000000wGqLsc', + 'clientSecret': 'your-oauth2-client-secret', 'endpoint': 'example.fusionauth.io',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -651,7 +651,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'e4d87900000000540733', - 'clientSecret': '5e07c00000000000000000000000000000198bcc',}; + 'clientSecret': 'your-oauth2-client-secret',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2GitHub( @@ -668,7 +668,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'applicationId': 'd41ffe0000000000000000000000000000000000000000000000000000d5e252', - 'secret': 'gloas-838cfa0000000000000000000000000000000000000000000000000000ecbb38', + 'secret': 'your-oauth2-client-secret', 'endpoint': 'https://gitlab.com',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -686,7 +686,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': '120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com', - 'clientSecret': 'example-google-client-secret', + 'clientSecret': 'your-oauth2-client-secret', 'prompt': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -704,7 +704,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'appwrite-o0000000st-app', - 'clientSecret': 'jdjrJd00000000000000000000HUsaZO', + 'clientSecret': 'your-oauth2-client-secret', 'endpoint': 'keycloak.example.com', 'realmName': 'appwrite-realm',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -723,7 +723,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': '01KQ7C00000000000001MFHS32', - 'clientSecret': '34ac5600000000000000000000000000000000000000000000000000e830c8b',}; + 'clientSecret': 'your-oauth2-client-secret',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Kick( @@ -740,7 +740,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': '770000000000dv', - 'primaryClientSecret': 'example-linkedin-client-secret',}; + 'primaryClientSecret': 'your-oauth2-client-secret',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Linkedin( @@ -757,7 +757,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'applicationId': '00001111-aaaa-2222-bbbb-3333cccc4444', - 'applicationSecret': 'A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u', + 'applicationSecret': 'your-oauth2-client-secret', 'tenant': 'common',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -775,7 +775,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'oauthClientId': '341d8700-0000-0000-0000-000000446ee3', - 'oauthClientSecret': 'secret_dLUr4b000000000000000000000000000000lFHAa9',}; + 'oauthClientSecret': 'your-oauth2-client-secret',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Notion( @@ -792,7 +792,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'qibI2x0000000000000000000000000006L2YFoG', - 'clientSecret': 'Ah68ed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003qpcHV', + 'clientSecret': 'your-oauth2-client-secret', 'wellKnownURL': 'https://myoauth.com/.well-known/openid-configuration', 'authorizationURL': 'https://myoauth.com/oauth2/authorize', 'tokenURL': 'https://myoauth.com/oauth2/token', @@ -813,7 +813,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': '0oa00000000000000698', - 'clientSecret': 'Kiq0000000000000000000000000000000000000-00000000000H2L5-3SJ-vRV', + 'clientSecret': 'your-oauth2-client-secret', 'domain': 'trial-6400025.okta.com', 'authorizationServerId': 'aus000000000000000h7z',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -832,7 +832,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB', - 'secretKey': 'EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp',}; + 'secretKey': 'your-oauth2-client-secret',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Paypal( @@ -849,7 +849,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'AdhIEG7-000000000000-0000000000000000000000000000000-0000000000000000000000-2pyB', - 'secretKey': 'EH8KCXtew--000000000000000000000000000000000000000_C-1_5UP_000000000000000CB7KDp',}; + 'secretKey': 'your-oauth2-client-secret',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2PaypalSandbox( @@ -866,7 +866,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'appwrite-oauth-test-app', - 'clientSecret': 'Rn247T0000000000000000000000000000000000000000000000000000W2zWTN',}; + 'clientSecret': 'your-oauth2-client-secret',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Podio( @@ -883,7 +883,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'customerKey': '3MVG9I0000000000000000000000000000000000000000000000000000000000000000000000000C5Aejq', - 'customerSecret': '3w000000000000e2',}; + 'customerSecret': 'your-oauth2-client-secret',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Salesforce( @@ -900,7 +900,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': '23000000089.15000000000023', - 'clientSecret': '81656000000000000000000000f3d2fd',}; + 'clientSecret': 'your-oauth2-client-secret',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Slack( @@ -917,7 +917,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': '6ec271000000000000000000009beace', - 'clientSecret': 'db068a000000000000000000008b5b9f',}; + 'clientSecret': 'your-oauth2-client-secret',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Spotify( @@ -934,7 +934,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'ca_UKibXX0000000000000000000006byvR', - 'apiSecretKey': 'sk_51SfOd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000QGWYfp',}; + 'apiSecretKey': 'your-oauth2-client-secret',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Stripe( @@ -951,7 +951,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'oauth2ClientId': 'appwrite-test-org.appwrite-test-app', - 'oauth2ClientSecret': '7cb52700-0000-0000-0000-000000ca5b83',}; + 'oauth2ClientSecret': 'your-oauth2-client-secret',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Tradeshift( @@ -968,7 +968,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'oauth2ClientId': 'appwrite-test-org.appwrite-test-app', - 'oauth2ClientSecret': '7cb52700-0000-0000-0000-000000ca5b83',}; + 'oauth2ClientSecret': 'your-oauth2-client-secret',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2TradeshiftSandbox( @@ -985,7 +985,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'vvi0in000000000000000000ikmt9p', - 'clientSecret': 'pmapue000000000000000000zylw3v',}; + 'clientSecret': 'your-oauth2-client-secret',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Twitch( @@ -1002,7 +1002,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': '130005', - 'clientSecret': 'PlBfJS0000000000000000000000000000000000000000000000000000EdUZJk',}; + 'clientSecret': 'your-oauth2-client-secret',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2WordPress( @@ -1019,7 +1019,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'customerKey': 'slzZV0000000000000NFLaWT', - 'secretKey': 'tkEPkp00000000000000000000000000000000000000FTxbI9',}; + 'secretKey': 'your-oauth2-client-secret',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2X( @@ -1036,7 +1036,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'dj0yJm000000000000000000000000000000000000000000000000000000000000000000000000000000000000Z4PWRm', - 'clientSecret': 'cf978f0000000000000000000000000000c5e2e9',}; + 'clientSecret': 'your-oauth2-client-secret',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Yahoo( @@ -1053,7 +1053,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': '6a8a6a0000000000000000000091483c', - 'clientSecret': 'bbf98500000000000000000000c75a63',}; + 'clientSecret': 'your-oauth2-client-secret',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Yandex( @@ -1070,7 +1070,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': '1000.83C178000000000000000000RPNX0B', - 'clientSecret': 'fb5cac000000000000000000000000000000a68f6e',}; + 'clientSecret': 'your-oauth2-client-secret',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Zoho( @@ -1087,7 +1087,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'clientId': 'QMAC00000000000000w0AQ', - 'clientSecret': 'GAWsG4000000000000000000007U01ON',}; + 'clientSecret': 'your-oauth2-client-secret',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Zoom( @@ -1104,7 +1104,7 @@ describe('Project', () => { '\$id': 'github', 'enabled': true, 'applicationId': '00001111-aaaa-2222-bbbb-3333cccc4444', - 'applicationSecret': 'A1bC2dE3fH4iJ5kL6mN7oP8qR9sT0u', + 'applicationSecret': 'your-oauth2-client-secret', 'tenant': 'common',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -1884,11 +1884,7 @@ describe('Project', () => { test('test method getPolicy()', async () => { const data = { '\$id': 'password-dictionary', - 'userId': true, - 'userEmail': true, - 'userPhone': true, - 'userName': true, - 'userMFA': true,}; + 'enabled': true,}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.getPolicy( diff --git a/test/services/sites.test.js b/test/services/sites.test.js index 11e9f6da..64525f11 100644 --- a/test/services/sites.test.js +++ b/test/services/sites.test.js @@ -54,6 +54,8 @@ describe('Sites', () => { 'providerBranch': 'main', 'providerRootDirectory': 'sites/helloWorld', 'providerSilentMode': true, + 'providerBranches': [], + 'providerPaths': [], 'buildSpecification': 's-1vcpu-512mb', 'runtimeSpecification': 's-1vcpu-512mb', 'buildRuntime': 'node-22', @@ -133,6 +135,8 @@ describe('Sites', () => { 'providerBranch': 'main', 'providerRootDirectory': 'sites/helloWorld', 'providerSilentMode': true, + 'providerBranches': [], + 'providerPaths': [], 'buildSpecification': 's-1vcpu-512mb', 'runtimeSpecification': 's-1vcpu-512mb', 'buildRuntime': 'node-22', @@ -179,6 +183,8 @@ describe('Sites', () => { 'providerBranch': 'main', 'providerRootDirectory': 'sites/helloWorld', 'providerSilentMode': true, + 'providerBranches': [], + 'providerPaths': [], 'buildSpecification': 's-1vcpu-512mb', 'runtimeSpecification': 's-1vcpu-512mb', 'buildRuntime': 'node-22', @@ -241,6 +247,8 @@ describe('Sites', () => { 'providerBranch': 'main', 'providerRootDirectory': 'sites/helloWorld', 'providerSilentMode': true, + 'providerBranches': [], + 'providerPaths': [], 'buildSpecification': 's-1vcpu-512mb', 'runtimeSpecification': 's-1vcpu-512mb', 'buildRuntime': 'node-22',