diff --git a/CHANGELOG.md b/CHANGELOG.md index 86e993ed..3a7be5f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,29 @@ # Change Log +## 14.0.0 + +* Breaking: Removed `getDatabaseMetrics`, `getDatabaseInsights`, `getDatabaseSchema`, and `createDatabaseSchemaPreview` from `Compute` service +* Breaking: Removed `region` and `type` parameters from `createDatabase` on `Compute` service +* Breaking: Replaced `highAvailability` and `highAvailabilityReplicaCount` with `replicas` on `createDatabase` and `updateDatabase` +* Breaking: Removed `type`, `region`, and `highAvailability` fields from `DedicatedDatabase` model +* Breaking: Removed `DedicatedDatabaseMetrics`, `DedicatedDatabaseSchema`, `DedicatedDatabaseSchemaPreview`, and performance insights models +* Breaking: Removed OS, client, and device fields from `ActivityEvent` model +* Breaking: Removed `internal` parameter and field from `Apps` service and `App` model +* Breaking: `getInvoiceDownload` and `getInvoiceView` on `Organizations` now return a URL string +* Breaking: Geometric attribute and column models now type `default` as number arrays instead of `any[]` +* Added: OAuth2 Device Authorization Grant support with `deviceFlow` on apps and device code settings on `updateOAuth2Server` +* Added: Consent metadata on `Apps` service (`description`, `clientUri`, `logoUri`, `privacyPolicyUrl`, `termsUrl`, `contacts`) +* Added: `authorizationDetailsTypes` parameter on `updateOAuth2Server` for RFC 9396 support +* Added: `dedicatedDatabaseId` parameter on `create` for `TablesDB`, `DocumentsDB`, and `VectorsDB` +* Added: `api` parameter on `createDatabase` and `DedicatedDatabasesExecute` key scope +* Added: `userAccessedAt` membership privacy setting and field on `Membership` model +* Added: Email classification fields on `User` model (`emailCanonical`, `emailIsFree`, `emailIsDisposable`, `emailIsCorporate`, `emailIsCanonical`) +* Added: Connection details on `Branch` model and TCP connection fields on dedicated database connection model +* Added: `type` field on backup policies for full or incremental backups +* Added: `hint` field on app secret models for identifying secrets +* Updated: SQL API allowed statements now support DDL and DCL types as opt-in +* Updated: All requests now send an explicit `accept` header + ## 13.2.0 * Added: `Apps` service for managing OAuth2 apps, secrets, and tokens diff --git a/README.md b/README.md index a58f3c0a..18c484f9 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ import { Client, Account } from "@appwrite.io/console"; To install with a CDN (content delivery network) add the following scripts to the bottom of your tag, but before you use any Appwrite services: ```html - + ``` diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md index 060f3188..f1696abd 100644 --- a/docs/examples/account/create.md +++ b/docs/examples/account/create.md @@ -10,7 +10,7 @@ const account = new Account(client); const result = await account.create({ userId: '', email: 'email@example.com', - password: '', + password: 'password', name: '' // optional }); diff --git a/docs/examples/account/update-password.md b/docs/examples/account/update-password.md index c3f841ec..f85a28b9 100644 --- a/docs/examples/account/update-password.md +++ b/docs/examples/account/update-password.md @@ -8,8 +8,8 @@ const client = new Client() const account = new Account(client); const result = await account.updatePassword({ - password: '', - oldPassword: '' // optional + password: 'password', + oldPassword: 'password' // optional }); console.log(result); diff --git a/docs/examples/account/update-recovery.md b/docs/examples/account/update-recovery.md index e283313b..001a77eb 100644 --- a/docs/examples/account/update-recovery.md +++ b/docs/examples/account/update-recovery.md @@ -10,7 +10,7 @@ const account = new Account(client); const result = await account.updateRecovery({ userId: '', secret: '', - password: '' + password: 'password' }); console.log(result); diff --git a/docs/examples/apps/create.md b/docs/examples/apps/create.md index 75cf2997..c59f6fb6 100644 --- a/docs/examples/apps/create.md +++ b/docs/examples/apps/create.md @@ -11,9 +11,15 @@ const result = await apps.create({ appId: '', name: '', redirectUris: [], + description: '', // optional + clientUri: 'https://example.com', // optional + logoUri: 'https://example.com', // optional + privacyPolicyUrl: 'https://example.com', // optional + termsUrl: 'https://example.com', // optional + contacts: [], // optional enabled: false, // optional - internal: false, // optional type: 'public', // optional + deviceFlow: false, // optional teamId: '' // optional }); diff --git a/docs/examples/apps/update.md b/docs/examples/apps/update.md index 292ad93e..4d1b12fb 100644 --- a/docs/examples/apps/update.md +++ b/docs/examples/apps/update.md @@ -10,10 +10,16 @@ const apps = new Apps(client); const result = await apps.update({ appId: '', name: '', + description: '', // optional + clientUri: 'https://example.com', // optional + logoUri: 'https://example.com', // optional + privacyPolicyUrl: 'https://example.com', // optional + termsUrl: 'https://example.com', // optional + contacts: [], // optional enabled: false, // optional - internal: false, // optional redirectUris: [], // optional - type: 'public' // optional + type: 'public', // optional + deviceFlow: false // optional }); console.log(result); diff --git a/docs/examples/avatars/get-browser.md b/docs/examples/avatars/get-browser.md index b28ec7d9..c0c83e4e 100644 --- a/docs/examples/avatars/get-browser.md +++ b/docs/examples/avatars/get-browser.md @@ -3,7 +3,8 @@ import { Client, Avatars, Browser } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setImpersonateUserId(''); // Impersonate a user by ID on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data. const avatars = new Avatars(client); diff --git a/docs/examples/avatars/get-credit-card.md b/docs/examples/avatars/get-credit-card.md index 8949b1f4..29119121 100644 --- a/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/avatars/get-credit-card.md @@ -3,7 +3,8 @@ import { Client, Avatars, CreditCard } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setImpersonateUserId(''); // Impersonate a user by ID on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data. const avatars = new Avatars(client); diff --git a/docs/examples/avatars/get-favicon.md b/docs/examples/avatars/get-favicon.md index 0df25533..afccc951 100644 --- a/docs/examples/avatars/get-favicon.md +++ b/docs/examples/avatars/get-favicon.md @@ -3,7 +3,8 @@ import { Client, Avatars } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setImpersonateUserId(''); // Impersonate a user by ID on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data. const avatars = new Avatars(client); diff --git a/docs/examples/avatars/get-flag.md b/docs/examples/avatars/get-flag.md index 122c988f..5921e5c5 100644 --- a/docs/examples/avatars/get-flag.md +++ b/docs/examples/avatars/get-flag.md @@ -3,7 +3,8 @@ import { Client, Avatars, Flag } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setImpersonateUserId(''); // Impersonate a user by ID on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data. const avatars = new Avatars(client); diff --git a/docs/examples/avatars/get-image.md b/docs/examples/avatars/get-image.md index d24f49ef..d0f1349d 100644 --- a/docs/examples/avatars/get-image.md +++ b/docs/examples/avatars/get-image.md @@ -3,7 +3,8 @@ import { Client, Avatars } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setImpersonateUserId(''); // Impersonate a user by ID on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data. const avatars = new Avatars(client); diff --git a/docs/examples/avatars/get-initials.md b/docs/examples/avatars/get-initials.md index 892497b2..ecac3f54 100644 --- a/docs/examples/avatars/get-initials.md +++ b/docs/examples/avatars/get-initials.md @@ -3,7 +3,8 @@ import { Client, Avatars } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setImpersonateUserId(''); // Impersonate a user by ID on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data. const avatars = new Avatars(client); diff --git a/docs/examples/avatars/get-qr.md b/docs/examples/avatars/get-qr.md index f15fa6e9..b42160dd 100644 --- a/docs/examples/avatars/get-qr.md +++ b/docs/examples/avatars/get-qr.md @@ -3,7 +3,8 @@ import { Client, Avatars } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setImpersonateUserId(''); // Impersonate a user by ID on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data. const avatars = new Avatars(client); diff --git a/docs/examples/avatars/get-screenshot.md b/docs/examples/avatars/get-screenshot.md index 45e3517f..1025b344 100644 --- a/docs/examples/avatars/get-screenshot.md +++ b/docs/examples/avatars/get-screenshot.md @@ -3,7 +3,8 @@ import { Client, Avatars, BrowserTheme, Timezone, BrowserPermission, ImageFormat const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setImpersonateUserId(''); // Impersonate a user by ID on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data. const avatars = new Avatars(client); diff --git a/docs/examples/compute/create-database-schema-preview.md b/docs/examples/compute/create-database-schema-preview.md deleted file mode 100644 index f0fecfa6..00000000 --- a/docs/examples/compute/create-database-schema-preview.md +++ /dev/null @@ -1,16 +0,0 @@ -```javascript -import { Client, Compute } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const compute = new Compute(client); - -const result = await compute.createDatabaseSchemaPreview({ - databaseId: '', - sql: '' -}); - -console.log(result); -``` diff --git a/docs/examples/compute/create-database.md b/docs/examples/compute/create-database.md index d3738db2..11378046 100644 --- a/docs/examples/compute/create-database.md +++ b/docs/examples/compute/create-database.md @@ -13,8 +13,6 @@ const result = await compute.createDatabase({ database: '', // optional engine: 'postgres', // optional version: '17', // optional - region: 'fra', // optional - type: 'shared', // optional specification: '', // optional backend: 'prisma', // optional cpu: 125, // optional @@ -22,8 +20,7 @@ const result = await compute.createDatabase({ storage: 1, // optional storageClass: 'ssd', // optional storageMaxGb: 0, // optional - highAvailability: false, // optional - highAvailabilityReplicaCount: 0, // optional + replicas: 0, // optional highAvailabilitySyncMode: 'async', // optional networkMaxConnections: 10, // optional networkIdleTimeoutSeconds: 60, // optional @@ -38,7 +35,8 @@ const result = await compute.createDatabase({ storageAutoscalingThresholdPercent: 50, // optional storageAutoscalingMaxGb: 0, // optional metricsEnabled: false, // optional - poolerEnabled: false // optional + poolerEnabled: false, // optional + api: 'compute' // optional }); console.log(result); diff --git a/docs/examples/compute/get-database-insights.md b/docs/examples/compute/get-database-insights.md deleted file mode 100644 index 42598c39..00000000 --- a/docs/examples/compute/get-database-insights.md +++ /dev/null @@ -1,17 +0,0 @@ -```javascript -import { Client, Compute } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const compute = new Compute(client); - -const result = await compute.getDatabaseInsights({ - databaseId: '', - period: '1h', // optional - limit: null // optional -}); - -console.log(result); -``` diff --git a/docs/examples/compute/get-database-metrics.md b/docs/examples/compute/get-database-metrics.md deleted file mode 100644 index 2feccab2..00000000 --- a/docs/examples/compute/get-database-metrics.md +++ /dev/null @@ -1,16 +0,0 @@ -```javascript -import { Client, Compute } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const compute = new Compute(client); - -const result = await compute.getDatabaseMetrics({ - databaseId: '', - period: '1h' // optional -}); - -console.log(result); -``` diff --git a/docs/examples/compute/get-database-schema.md b/docs/examples/compute/get-database-schema.md deleted file mode 100644 index fcff3bab..00000000 --- a/docs/examples/compute/get-database-schema.md +++ /dev/null @@ -1,15 +0,0 @@ -```javascript -import { Client, Compute } from "@appwrite.io/console"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const compute = new Compute(client); - -const result = await compute.getDatabaseSchema({ - databaseId: '' -}); - -console.log(result); -``` diff --git a/docs/examples/compute/update-database.md b/docs/examples/compute/update-database.md index e99feeb8..f773287b 100644 --- a/docs/examples/compute/update-database.md +++ b/docs/examples/compute/update-database.md @@ -16,8 +16,7 @@ const result = await compute.updateDatabase({ memory: 128, // optional storage: 1, // optional storageClass: 'ssd', // optional - highAvailability: false, // optional - highAvailabilityReplicaCount: 0, // optional + replicas: 0, // optional highAvailabilitySyncMode: 'async', // optional networkMaxConnections: 10, // optional networkIdleTimeoutSeconds: 60, // optional diff --git a/docs/examples/documentsdb/create.md b/docs/examples/documentsdb/create.md index a0cc85ab..dbe14008 100644 --- a/docs/examples/documentsdb/create.md +++ b/docs/examples/documentsdb/create.md @@ -10,7 +10,8 @@ const documentsDB = new DocumentsDB(client); const result = await documentsDB.create({ databaseId: '', name: '', - enabled: false // optional + enabled: false, // optional + dedicatedDatabaseId: '' // optional }); console.log(result); diff --git a/docs/examples/functions/get-deployment-download.md b/docs/examples/functions/get-deployment-download.md index d6b46f1d..5b024563 100644 --- a/docs/examples/functions/get-deployment-download.md +++ b/docs/examples/functions/get-deployment-download.md @@ -3,7 +3,8 @@ import { Client, Functions, DeploymentDownloadType } from "@appwrite.io/console" const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setImpersonateUserId(''); // Impersonate a user by ID on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data. const functions = new Functions(client); diff --git a/docs/examples/messaging/create-smtp-provider.md b/docs/examples/messaging/create-smtp-provider.md index 5e7099ad..aa0b8bcc 100644 --- a/docs/examples/messaging/create-smtp-provider.md +++ b/docs/examples/messaging/create-smtp-provider.md @@ -13,7 +13,7 @@ const result = await messaging.createSMTPProvider({ host: '', port: 1, // optional username: '', // optional - password: '', // optional + password: 'password', // optional encryption: SmtpEncryption.None, // optional autoTLS: false, // optional mailer: '', // optional diff --git a/docs/examples/messaging/update-smtp-provider.md b/docs/examples/messaging/update-smtp-provider.md index ebd649b7..353ad3c9 100644 --- a/docs/examples/messaging/update-smtp-provider.md +++ b/docs/examples/messaging/update-smtp-provider.md @@ -13,7 +13,7 @@ const result = await messaging.updateSMTPProvider({ host: '', // optional port: 1, // optional username: '', // optional - password: '', // optional + password: 'password', // optional encryption: SmtpEncryption.None, // optional autoTLS: false, // optional mailer: '', // optional diff --git a/docs/examples/migrations/create-n-host-migration.md b/docs/examples/migrations/create-n-host-migration.md index cd17162a..1b7faec8 100644 --- a/docs/examples/migrations/create-n-host-migration.md +++ b/docs/examples/migrations/create-n-host-migration.md @@ -14,7 +14,7 @@ const result = await migrations.createNHostMigration({ adminSecret: '', database: '', username: '', - password: '', + password: 'password', port: null // optional }); diff --git a/docs/examples/migrations/create-supabase-migration.md b/docs/examples/migrations/create-supabase-migration.md index 6463d358..35940039 100644 --- a/docs/examples/migrations/create-supabase-migration.md +++ b/docs/examples/migrations/create-supabase-migration.md @@ -13,7 +13,7 @@ const result = await migrations.createSupabaseMigration({ apiKey: '', databaseHost: '', username: '', - password: '', + password: 'password', port: null // optional }); diff --git a/docs/examples/migrations/get-n-host-report.md b/docs/examples/migrations/get-n-host-report.md index 4ed95ea9..c4f5285a 100644 --- a/docs/examples/migrations/get-n-host-report.md +++ b/docs/examples/migrations/get-n-host-report.md @@ -14,7 +14,7 @@ const result = await migrations.getNHostReport({ adminSecret: '', database: '', username: '', - password: '', + password: 'password', port: null // optional }); diff --git a/docs/examples/migrations/get-supabase-report.md b/docs/examples/migrations/get-supabase-report.md index 834dd6bb..9beeeceb 100644 --- a/docs/examples/migrations/get-supabase-report.md +++ b/docs/examples/migrations/get-supabase-report.md @@ -13,7 +13,7 @@ const result = await migrations.getSupabaseReport({ apiKey: '', databaseHost: '', username: '', - password: '', + password: 'password', port: null // optional }); diff --git a/docs/examples/organizations/get-invoice-download.md b/docs/examples/organizations/get-invoice-download.md index d20191ee..e35da2fe 100644 --- a/docs/examples/organizations/get-invoice-download.md +++ b/docs/examples/organizations/get-invoice-download.md @@ -3,11 +3,12 @@ import { Client, Organizations } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setImpersonateUserId(''); // Impersonate a user by ID on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data. const organizations = new Organizations(client); -const result = await organizations.getInvoiceDownload({ +const result = organizations.getInvoiceDownload({ organizationId: '', invoiceId: '' }); diff --git a/docs/examples/organizations/get-invoice-view.md b/docs/examples/organizations/get-invoice-view.md index 58d822e5..1a5b2425 100644 --- a/docs/examples/organizations/get-invoice-view.md +++ b/docs/examples/organizations/get-invoice-view.md @@ -3,11 +3,12 @@ import { Client, Organizations } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setImpersonateUserId(''); // Impersonate a user by ID on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data. const organizations = new Organizations(client); -const result = await organizations.getInvoiceView({ +const result = organizations.getInvoiceView({ organizationId: '', invoiceId: '' }); diff --git a/docs/examples/project/update-membership-privacy-policy.md b/docs/examples/project/update-membership-privacy-policy.md index 006f1f82..ae8ef978 100644 --- a/docs/examples/project/update-membership-privacy-policy.md +++ b/docs/examples/project/update-membership-privacy-policy.md @@ -12,7 +12,8 @@ const result = await project.updateMembershipPrivacyPolicy({ userEmail: false, // optional userPhone: false, // optional userName: false, // optional - userMFA: false // optional + userMFA: false, // optional + userAccessedAt: false // optional }); console.log(result); diff --git a/docs/examples/project/update-o-auth-2-server.md b/docs/examples/project/update-o-auth-2-server.md index 1c92a89f..860e4f71 100644 --- a/docs/examples/project/update-o-auth-2-server.md +++ b/docs/examples/project/update-o-auth-2-server.md @@ -11,11 +11,16 @@ const result = await project.updateOAuth2Server({ enabled: false, authorizationUrl: 'https://example.com', scopes: [], // optional + authorizationDetailsTypes: [], // optional accessTokenDuration: 60, // optional refreshTokenDuration: 60, // optional publicAccessTokenDuration: 60, // optional publicRefreshTokenDuration: 60, // optional - confidentialPkce: false // optional + confidentialPkce: false, // optional + verificationUrl: 'https://example.com', // optional + userCodeLength: 6, // optional + userCodeFormat: 'numeric', // optional + deviceCodeDuration: 60 // optional }); console.log(result); diff --git a/docs/examples/project/update-smtp.md b/docs/examples/project/update-smtp.md index c2236be5..0dda510a 100644 --- a/docs/examples/project/update-smtp.md +++ b/docs/examples/project/update-smtp.md @@ -11,7 +11,7 @@ const result = await project.updateSMTP({ host: '', // optional port: null, // optional username: '', // optional - password: '', // optional + password: 'password', // optional senderEmail: 'email@example.com', // optional senderName: '', // optional replyToEmail: 'email@example.com', // optional diff --git a/docs/examples/sites/get-deployment-download.md b/docs/examples/sites/get-deployment-download.md index 2645bd51..288d3f8b 100644 --- a/docs/examples/sites/get-deployment-download.md +++ b/docs/examples/sites/get-deployment-download.md @@ -3,7 +3,8 @@ import { Client, Sites, DeploymentDownloadType } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setImpersonateUserId(''); // Impersonate a user by ID on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data. const sites = new Sites(client); diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md index 1e940d16..227a9c3e 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -3,7 +3,8 @@ import { Client, Storage } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setImpersonateUserId(''); // Impersonate a user by ID on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data. const storage = new Storage(client); diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index 781c5cc4..0dcbc325 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -3,7 +3,8 @@ import { Client, Storage, ImageGravity, ImageFormat } from "@appwrite.io/console const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setImpersonateUserId(''); // Impersonate a user by ID on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data. const storage = new Storage(client); diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md index 800f3f93..4984a010 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -3,7 +3,8 @@ import { Client, Storage } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setImpersonateUserId(''); // Impersonate a user by ID on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data. const storage = new Storage(client); diff --git a/docs/examples/tablesdb/create.md b/docs/examples/tablesdb/create.md index d64f3963..2f33a89f 100644 --- a/docs/examples/tablesdb/create.md +++ b/docs/examples/tablesdb/create.md @@ -10,7 +10,8 @@ const tablesDB = new TablesDB(client); const result = await tablesDB.create({ databaseId: '', name: '', - enabled: false // optional + enabled: false, // optional + dedicatedDatabaseId: '' // optional }); console.log(result); diff --git a/docs/examples/users/create.md b/docs/examples/users/create.md index 1dcd2c24..83fa0bd7 100644 --- a/docs/examples/users/create.md +++ b/docs/examples/users/create.md @@ -11,7 +11,7 @@ const result = await users.create({ userId: '', email: 'email@example.com', // optional phone: '+12065550100', // optional - password: '', // optional + password: 'password', // optional name: '' // optional }); diff --git a/docs/examples/users/update-password.md b/docs/examples/users/update-password.md index 04b1a9a5..48920f14 100644 --- a/docs/examples/users/update-password.md +++ b/docs/examples/users/update-password.md @@ -9,7 +9,7 @@ const users = new Users(client); const result = await users.updatePassword({ userId: '', - password: '' + password: 'password' }); console.log(result); diff --git a/docs/examples/vectorsdb/create.md b/docs/examples/vectorsdb/create.md index d37467a0..10d3b15b 100644 --- a/docs/examples/vectorsdb/create.md +++ b/docs/examples/vectorsdb/create.md @@ -10,7 +10,8 @@ const vectorsDB = new VectorsDB(client); const result = await vectorsDB.create({ databaseId: '', name: '', - enabled: false // optional + enabled: false, // optional + dedicatedDatabaseId: '' // optional }); console.log(result); diff --git a/docs/examples/webhooks/create.md b/docs/examples/webhooks/create.md index 72661fd4..e44da2bb 100644 --- a/docs/examples/webhooks/create.md +++ b/docs/examples/webhooks/create.md @@ -15,7 +15,7 @@ const result = await webhooks.create({ enabled: false, // optional tls: false, // optional authUsername: '', // optional - authPassword: '', // optional + authPassword: 'password', // optional secret: '' // optional }); diff --git a/docs/examples/webhooks/update.md b/docs/examples/webhooks/update.md index fb1b70b6..6d3bf024 100644 --- a/docs/examples/webhooks/update.md +++ b/docs/examples/webhooks/update.md @@ -15,7 +15,7 @@ const result = await webhooks.update({ enabled: false, // optional tls: false, // optional authUsername: '', // optional - authPassword: '' // optional + authPassword: 'password' // optional }); console.log(result); diff --git a/package-lock.json b/package-lock.json index 32619248..07331d05 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@appwrite.io/console", - "version": "13.2.0", + "version": "14.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@appwrite.io/console", - "version": "13.2.0", + "version": "14.0.0", "license": "BSD-3-Clause", "dependencies": { "json-bigint": "1.0.0" diff --git a/package.json b/package.json index 6ae615b6..0f7d6f7a 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@appwrite.io/console", "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": "13.2.0", + "version": "14.0.0", "license": "BSD-3-Clause", "main": "dist/cjs/sdk.js", "exports": { diff --git a/src/client.ts b/src/client.ts index 4c9069a3..96c1e5b7 100644 --- a/src/client.ts +++ b/src/client.ts @@ -390,7 +390,7 @@ class Client { 'x-sdk-name': 'Console', 'x-sdk-platform': 'console', 'x-sdk-language': 'web', - 'x-sdk-version': '13.2.0', + 'x-sdk-version': '14.0.0', 'X-Appwrite-Response-Format': '1.9.5', }; diff --git a/src/enums/project-key-scopes.ts b/src/enums/project-key-scopes.ts index 47125ddc..927acf8d 100644 --- a/src/enums/project-key-scopes.ts +++ b/src/enums/project-key-scopes.ts @@ -89,6 +89,7 @@ export enum ProjectKeyScopes { ArchivesWrite = 'archives.write', RestorationsRead = 'restorations.read', RestorationsWrite = 'restorations.write', + DedicatedDatabasesExecute = 'dedicatedDatabases.execute', DomainsRead = 'domains.read', DomainsWrite = 'domains.write', EventsRead = 'events.read', diff --git a/src/models.ts b/src/models.ts index b3350c01..5a77d092 100644 --- a/src/models.ts +++ b/src/models.ts @@ -1567,7 +1567,7 @@ export namespace Models { /** * Default value for attribute when not provided. Cannot be set when attribute is required. */ - default?: any[]; + default?: number[]; } /** @@ -1609,7 +1609,7 @@ export namespace Models { /** * Default value for attribute when not provided. Cannot be set when attribute is required. */ - default?: any[]; + default?: number[][]; } /** @@ -1651,7 +1651,7 @@ export namespace Models { /** * Default value for attribute when not provided. Cannot be set when attribute is required. */ - default?: any[]; + default?: number[][][]; } /** @@ -2783,7 +2783,7 @@ export namespace Models { /** * Default value for column when not provided. Cannot be set when column is required. */ - default?: any[]; + default?: number[]; } /** @@ -2825,7 +2825,7 @@ export namespace Models { /** * Default value for column when not provided. Cannot be set when column is required. */ - default?: any[]; + default?: number[][]; } /** @@ -2867,7 +2867,7 @@ export namespace Models { /** * Default value for column when not provided. Cannot be set when column is required. */ - default?: any[]; + default?: number[][][]; } /** @@ -3424,6 +3424,26 @@ export namespace Models { * Email verification status. */ emailVerification: boolean; + /** + * Canonical form of the user email address. + */ + emailCanonical?: string; + /** + * Whether the user email is from a free email provider. + */ + emailIsFree?: boolean; + /** + * Whether the user email is from a disposable email provider. + */ + emailIsDisposable?: boolean; + /** + * Whether the user email is from a corporate domain. + */ + emailIsCorporate?: boolean; + /** + * Whether the user email is in its canonical form. + */ + emailIsCanonical?: boolean; /** * Phone verification status. */ @@ -4075,6 +4095,10 @@ export namespace Models { * Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console. */ mfa: boolean; + /** + * Most recent access date in ISO 8601 format. Show this attribute by toggling membership privacy in the Console. + */ + userAccessedAt: string; /** * User list of roles */ @@ -5267,6 +5291,10 @@ export namespace Models { * OAuth2 server allowed scopes */ oAuth2ServerScopes: string[]; + /** + * OAuth2 server accepted RFC 9396 authorization_details types + */ + oAuth2ServerAuthorizationDetailsTypes: string[]; /** * OAuth2 server access token duration in seconds for confidential clients */ @@ -5287,6 +5315,22 @@ export namespace Models { * When enabled, PKCE is required for confidential clients (server-side flows using client_secret). PKCE is always required for public clients regardless of this setting. */ oAuth2ServerConfidentialPkce: boolean; + /** + * URL to your application page where users enter the device flow user code. Empty when the Device Authorization Grant is not configured. + */ + oAuth2ServerVerificationUrl: string; + /** + * Number of characters in the device flow user code, excluding the formatting separator. + */ + oAuth2ServerUserCodeLength: number; + /** + * Character set for device flow user codes: `numeric`, `alphabetic`, or `alphanumeric`. + */ + oAuth2ServerUserCodeFormat: string; + /** + * Lifetime in seconds of device flow device codes and user codes. + */ + oAuth2ServerDeviceCodeDuration: number; /** * OAuth2 server discovery URL */ @@ -6665,6 +6709,10 @@ export namespace Models { * Whether user MFA status is visible in memberships. */ userMFA: boolean; + /** + * Whether user last access time is visible in memberships. + */ + userAccessedAt: boolean; } /** @@ -9267,54 +9315,6 @@ export namespace Models { * Hostname. */ hostname: string; - /** - * Operating system code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/os.json). - */ - osCode: string; - /** - * Operating system name. - */ - osName: string; - /** - * Operating system version. - */ - osVersion: string; - /** - * Client type. - */ - clientType: string; - /** - * Client code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/clients.json). - */ - clientCode: string; - /** - * Client name. - */ - clientName: string; - /** - * Client version. - */ - clientVersion: string; - /** - * Client engine name. - */ - clientEngine: string; - /** - * Client engine name. - */ - clientEngineVersion: string; - /** - * Device name. - */ - deviceName: string; - /** - * Device brand name. - */ - deviceBrand: string; - /** - * Device model name. - */ - deviceModel: string; /** * Country two-character ISO 3166-1 alpha code. */ @@ -10237,6 +10237,38 @@ export namespace Models { * Unix timestamp when the branch expires. */ expiresAt: number; + /** + * Branch hostname for direct connections. + */ + host: string; + /** + * Branch port. + */ + port: number; + /** + * Database name the client sends for routing to the branch. + */ + database: string; + /** + * Database username. Shared with the parent database. + */ + username: string; + /** + * Database password. Shared with the parent database. + */ + password: string; + /** + * Whether SSL is required. + */ + ssl: boolean; + /** + * Database engine. Possible values: postgres, mysql, mariadb, mongodb. + */ + engine: string; + /** + * Full connection string for the branch. + */ + connectionString: string; } /** @@ -10395,6 +10427,18 @@ export namespace Models { * Database name. */ database: string; + /** + * Database TCP hostname or address. + */ + tcpHost: string; + /** + * Database TCP port. + */ + tcpPort: number; + /** + * Database name for direct TCP connections. + */ + tcpDatabase: string; /** * Database engine. Possible values: postgres, mysql, mariadb, mongodb. */ @@ -10487,56 +10531,6 @@ export namespace Models { available: number; } - /** - * DatabaseMetrics - */ - export type DedicatedDatabaseMetrics = { - /** - * Metrics aggregation period. Possible values: 1h (last hour), 24h (last 24 hours), 7d (last 7 days), 30d (last 30 days). - */ - period: string; - /** - * Average CPU usage percentage. - */ - cpuPercent: number; - /** - * Average memory usage percentage. - */ - memoryPercent: number; - /** - * Memory used in bytes. - */ - memoryUsedBytes: number; - /** - * Maximum memory available in bytes. - */ - memoryMaxBytes: number; - /** - * Storage used in bytes. - */ - storageUsedBytes: number; - /** - * Current active connections. - */ - connectionsActive: number; - /** - * Maximum connections configured. - */ - connectionsMax: number; - /** - * Average read IOPS. - */ - iopsRead: number; - /** - * Average write IOPS. - */ - iopsWrite: number; - /** - * Queries per second. - */ - qps: number; - } - /** * DedicatedDatabase */ @@ -10561,18 +10555,10 @@ export namespace Models { * Database display name. */ name: string; - /** - * Database type: shared (serverless) or dedicated (always-on). - */ - type: string; /** * Product API that owns this database: compute, documentsdb, or vectorsdb. */ api: string; - /** - * Region identifier (e.g., fra, nyc, syd). - */ - region: string; /** * Database engine: postgres, mysql, mariadb, or mongodb. */ @@ -10614,7 +10600,7 @@ export namespace Models { */ status: string; /** - * Container status for shared databases: active or inactive. + * Container status for lifecycle-managed database runtimes: active or inactive. */ containerStatus: string; /** @@ -10654,13 +10640,9 @@ export namespace Models { */ nodePool: string; /** - * Whether high availability is enabled. - */ - highAvailability: boolean; - /** - * Number of high availability replicas. + * Number of high availability replicas. High availability is enabled when greater than 0. */ - highAvailabilityReplicaCount: number; + replicas: number; /** * Replication sync mode: async, sync, or quorum. */ @@ -10726,7 +10708,7 @@ export namespace Models { */ sqlApiEnabled: boolean; /** - * Statement types accepted by the SQL API. Allowed values: SELECT, INSERT, UPDATE, DELETE. + * Statement types accepted by the SQL API. Defaults to DML only; DDL/DCL types (CREATE, ALTER, DROP, TRUNCATE, GRANT, REVOKE) are opt-in per database. Allowed values: SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, TRUNCATE, GRANT, REVOKE. */ sqlApiAllowedStatements: string[]; /** @@ -11707,80 +11689,6 @@ export namespace Models { failed: boolean; } - /** - * PerformanceInsights - */ - export type DedicatedDatabasePerformanceInsights = { - /** - * Top queries by total execution time. - */ - topQueries: DedicatedDatabasePerformanceInsightsQuery[]; - /** - * Active wait events. - */ - waitEvents: DedicatedDatabasePerformanceInsightsWaitEvent[]; - /** - * Total number of query calls. - */ - totalCalls: number; - /** - * Total query execution time in milliseconds. - */ - totalTimeMs: number; - /** - * Average query execution time in milliseconds. - */ - avgTimeMs: number; - } - - /** - * PerformanceInsightsQuery - */ - export type DedicatedDatabasePerformanceInsightsQuery = { - /** - * The SQL query text. - */ - query: string; - /** - * Number of times this query has been executed. - */ - calls: number; - /** - * Total execution time in milliseconds. - */ - totalTimeMs: number; - /** - * Mean execution time in milliseconds. - */ - meanTimeMs: number; - /** - * Total rows returned or affected. - */ - rows: number; - } - - /** - * PerformanceInsightsWaitEvent - */ - export type DedicatedDatabasePerformanceInsightsWaitEvent = { - /** - * Wait event name. - */ - event: string; - /** - * Wait event type or category. - */ - type: string; - /** - * Number of occurrences. - */ - count: number; - /** - * Total wait time in milliseconds. - */ - totalWaitMs: number; - } - /** * PITRWindows */ @@ -11963,6 +11871,10 @@ export namespace Models { * Policy backup schedule in CRON format. */ schedule: string; + /** + * Backup type. Possible values: full (complete database snapshot), incremental (changes since last backup). + */ + type: string; /** * Is this policy enabled. */ @@ -12243,38 +12155,6 @@ export namespace Models { roles: string[]; } - /** - * Schema - */ - export type DedicatedDatabaseSchema = { - /** - * List of tables with columns, types, and constraints. - */ - tables: Record[]; - /** - * List of indexes across all tables. - */ - indexes: Record[]; - } - - /** - * SchemaPreview - */ - export type DedicatedDatabaseSchemaPreview = { - /** - * Whether the engine supports transactional DDL for safe preview. - */ - supportsTransactionalDDL: boolean; - /** - * Schema change preview output. - */ - preview: string; - /** - * List of tables in the database after the change. - */ - tables: string[]; - } - /** * SlowQuery */ @@ -12846,13 +12726,33 @@ export namespace Models { */ name: string; /** - * List of authorized redirect URIs. These URIs can be used to redirect users after they authenticate. + * Application description shown to users during OAuth2 consent. */ - redirectUris: string[]; + description: string; + /** + * Application homepage URL shown to users during OAuth2 consent. + */ + clientUri: string; + /** + * Application logo URL shown to users during OAuth2 consent. + */ + logoUri: string; + /** + * Application privacy policy URL shown to users during OAuth2 consent. + */ + privacyPolicyUrl: string; /** - * When true, the application is restricted to the owner user (if `userId` is set) or members of `teamId` (if set). When false, any user in the project can authorize against the app. + * Application terms of service URL shown to users during OAuth2 consent. */ - internal: boolean; + termsUrl: string; + /** + * Application support or security contact emails. + */ + contacts: string[]; + /** + * List of authorized redirect URIs. These URIs can be used to redirect users after they authenticate. + */ + redirectUris: string[]; /** * Whether the app is enabled or not. */ @@ -12861,6 +12761,10 @@ export namespace Models { * OAuth2 client type. `public` for SPAs, mobile, and native apps that cannot keep a client secret (PKCE required); `confidential` for server-side clients that authenticate with a client secret. */ type: string; + /** + * Whether this client may use the OAuth2 Device Authorization Grant (RFC 8628). + */ + deviceFlow: boolean; /** * ID of team that owns the application, if owned by team. Otherwise, user ID will be used. */ @@ -12896,9 +12800,13 @@ export namespace Models { */ appId: string; /** - * Masked application client secret. Only the last 6 characters are returned. + * Hashed application client secret. */ secret: string; + /** + * Last few characters of the client secret, used to help identify it. + */ + hint: string; /** * ID of the user who created the secret. */ @@ -12937,6 +12845,10 @@ export namespace Models { * Application client secret. Returned in full only when the secret is created; subsequent reads return a masked value. */ secret: string; + /** + * Last few characters of the client secret, used to help identify it. + */ + hint: string; /** * ID of the user who created the secret. */ diff --git a/src/services/account.ts b/src/services/account.ts index f78cb6c8..56eca85a 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -28,6 +28,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -112,6 +113,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -189,6 +191,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -287,6 +290,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -339,6 +343,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -444,6 +449,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -497,6 +503,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -549,6 +556,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -620,6 +628,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -680,6 +689,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -785,6 +795,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -838,6 +849,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -890,6 +902,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -964,6 +977,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1016,6 +1030,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1097,6 +1112,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1150,6 +1166,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1210,6 +1227,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1266,6 +1284,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1320,6 +1339,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1373,6 +1393,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1438,6 +1459,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1502,6 +1524,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1666,6 +1689,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1722,6 +1746,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1790,6 +1815,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1857,6 +1883,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1882,6 +1909,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1906,6 +1934,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1931,6 +1960,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1955,6 +1985,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1981,6 +2012,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2006,6 +2038,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2032,6 +2065,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2057,6 +2091,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2113,6 +2148,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2177,6 +2213,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2229,6 +2266,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -2254,6 +2292,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2306,6 +2345,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -2387,6 +2427,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2440,6 +2481,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2521,6 +2563,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2574,6 +2617,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2641,6 +2685,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2665,6 +2710,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -2721,6 +2767,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2788,6 +2835,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2869,6 +2917,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2893,6 +2942,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -2943,6 +2993,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3014,6 +3065,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3082,6 +3134,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3166,6 +3219,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'text/html', } payload['project'] = this.client.config.project; @@ -3240,6 +3294,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3307,6 +3362,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3359,6 +3415,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -3412,6 +3469,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3490,6 +3548,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3564,6 +3623,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3628,6 +3688,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3761,6 +3822,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3848,6 +3910,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3930,6 +3993,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'text/html', } payload['project'] = this.client.config.project; @@ -4007,6 +4071,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4069,6 +4134,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4132,6 +4198,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4199,6 +4266,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4267,6 +4335,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4292,6 +4361,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4359,6 +4429,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/activities.ts b/src/services/activities.ts index a8d30333..279bded2 100644 --- a/src/services/activities.ts +++ b/src/services/activities.ts @@ -52,6 +52,7 @@ export class Activities { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -106,6 +107,7 @@ export class Activities { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/advisor.ts b/src/services/advisor.ts index e8a7edca..4c020442 100644 --- a/src/services/advisor.ts +++ b/src/services/advisor.ts @@ -62,6 +62,7 @@ export class Advisor { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -116,6 +117,7 @@ export class Advisor { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -240,6 +242,7 @@ export class Advisor { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -302,6 +305,7 @@ export class Advisor { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/apps.ts b/src/services/apps.ts index dcae06f3..1dbe12c4 100644 --- a/src/services/apps.ts +++ b/src/services/apps.ts @@ -60,6 +60,7 @@ export class Apps { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -76,55 +77,79 @@ export class Apps { * @param {string} params.appId - Application 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 - Application name. * @param {string[]} params.redirectUris - Redirect URIs (array of valid URLs). + * @param {string} params.description - Application description shown to users during OAuth2 consent. + * @param {string} params.clientUri - Application homepage URL shown to users during OAuth2 consent. + * @param {string} params.logoUri - Application logo URL shown to users during OAuth2 consent. + * @param {string} params.privacyPolicyUrl - Application privacy policy URL shown to users during OAuth2 consent. + * @param {string} params.termsUrl - Application terms of service URL shown to users during OAuth2 consent. + * @param {string[]} params.contacts - Application support or security contact emails. Maximum of 100 contacts are allowed. * @param {boolean} params.enabled - Is application enabled? - * @param {boolean} params.internal - When true, the application is restricted to the owner user or members of the configured team. Defaults to false (any user in the project can authorize). * @param {string} params.type - OAuth2 client type. Use `public` for SPAs, mobile, and native apps that cannot keep a `client_secret` — PKCE is then required at the token endpoint. Use `confidential` for server-side clients that present a `client_secret`. Defaults to `confidential`. + * @param {boolean} params.deviceFlow - Allow this client to use the OAuth2 Device Authorization Grant (RFC 8628) for input-constrained devices such as TVs and CLIs. Defaults to false. * @param {string} params.teamId - Team unique ID. * @throws {AppwriteException} * @returns {Promise} */ - create(params: { appId: string, name: string, redirectUris: string[], enabled?: boolean, internal?: boolean, type?: string, teamId?: string }): Promise; + create(params: { appId: string, name: string, redirectUris: string[], description?: string, clientUri?: string, logoUri?: string, privacyPolicyUrl?: string, termsUrl?: string, contacts?: string[], enabled?: boolean, type?: string, deviceFlow?: boolean, teamId?: string }): Promise; /** * Create a new application. * * @param {string} appId - Application 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 - Application name. * @param {string[]} redirectUris - Redirect URIs (array of valid URLs). + * @param {string} description - Application description shown to users during OAuth2 consent. + * @param {string} clientUri - Application homepage URL shown to users during OAuth2 consent. + * @param {string} logoUri - Application logo URL shown to users during OAuth2 consent. + * @param {string} privacyPolicyUrl - Application privacy policy URL shown to users during OAuth2 consent. + * @param {string} termsUrl - Application terms of service URL shown to users during OAuth2 consent. + * @param {string[]} contacts - Application support or security contact emails. Maximum of 100 contacts are allowed. * @param {boolean} enabled - Is application enabled? - * @param {boolean} internal - When true, the application is restricted to the owner user or members of the configured team. Defaults to false (any user in the project can authorize). * @param {string} type - OAuth2 client type. Use `public` for SPAs, mobile, and native apps that cannot keep a `client_secret` — PKCE is then required at the token endpoint. Use `confidential` for server-side clients that present a `client_secret`. Defaults to `confidential`. + * @param {boolean} deviceFlow - Allow this client to use the OAuth2 Device Authorization Grant (RFC 8628) for input-constrained devices such as TVs and CLIs. Defaults to false. * @param {string} teamId - Team unique ID. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - create(appId: string, name: string, redirectUris: string[], enabled?: boolean, internal?: boolean, type?: string, teamId?: string): Promise; + create(appId: string, name: string, redirectUris: string[], description?: string, clientUri?: string, logoUri?: string, privacyPolicyUrl?: string, termsUrl?: string, contacts?: string[], enabled?: boolean, type?: string, deviceFlow?: boolean, teamId?: string): Promise; create( - paramsOrFirst: { appId: string, name: string, redirectUris: string[], enabled?: boolean, internal?: boolean, type?: string, teamId?: string } | string, - ...rest: [(string)?, (string[])?, (boolean)?, (boolean)?, (string)?, (string)?] + paramsOrFirst: { appId: string, name: string, redirectUris: string[], description?: string, clientUri?: string, logoUri?: string, privacyPolicyUrl?: string, termsUrl?: string, contacts?: string[], enabled?: boolean, type?: string, deviceFlow?: boolean, teamId?: string } | string, + ...rest: [(string)?, (string[])?, (string)?, (string)?, (string)?, (string)?, (string)?, (string[])?, (boolean)?, (string)?, (boolean)?, (string)?] ): Promise { - let params: { appId: string, name: string, redirectUris: string[], enabled?: boolean, internal?: boolean, type?: string, teamId?: string }; + let params: { appId: string, name: string, redirectUris: string[], description?: string, clientUri?: string, logoUri?: string, privacyPolicyUrl?: string, termsUrl?: string, contacts?: string[], enabled?: boolean, type?: string, deviceFlow?: boolean, teamId?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { appId: string, name: string, redirectUris: string[], enabled?: boolean, internal?: boolean, type?: string, teamId?: string }; + params = (paramsOrFirst || {}) as { appId: string, name: string, redirectUris: string[], description?: string, clientUri?: string, logoUri?: string, privacyPolicyUrl?: string, termsUrl?: string, contacts?: string[], enabled?: boolean, type?: string, deviceFlow?: boolean, teamId?: string }; } else { params = { appId: paramsOrFirst as string, name: rest[0] as string, redirectUris: rest[1] as string[], - enabled: rest[2] as boolean, - internal: rest[3] as boolean, - type: rest[4] as string, - teamId: rest[5] as string + description: rest[2] as string, + clientUri: rest[3] as string, + logoUri: rest[4] as string, + privacyPolicyUrl: rest[5] as string, + termsUrl: rest[6] as string, + contacts: rest[7] as string[], + enabled: rest[8] as boolean, + type: rest[9] as string, + deviceFlow: rest[10] as boolean, + teamId: rest[11] as string }; } const appId = params.appId; const name = params.name; const redirectUris = params.redirectUris; + const description = params.description; + const clientUri = params.clientUri; + const logoUri = params.logoUri; + const privacyPolicyUrl = params.privacyPolicyUrl; + const termsUrl = params.termsUrl; + const contacts = params.contacts; const enabled = params.enabled; - const internal = params.internal; const type = params.type; + const deviceFlow = params.deviceFlow; const teamId = params.teamId; if (typeof appId === 'undefined') { @@ -145,18 +170,36 @@ export class Apps { if (typeof name !== 'undefined') { payload['name'] = name; } + if (typeof description !== 'undefined') { + payload['description'] = description; + } + if (typeof clientUri !== 'undefined') { + payload['clientUri'] = clientUri; + } + if (typeof logoUri !== 'undefined') { + payload['logoUri'] = logoUri; + } + if (typeof privacyPolicyUrl !== 'undefined') { + payload['privacyPolicyUrl'] = privacyPolicyUrl; + } + if (typeof termsUrl !== 'undefined') { + payload['termsUrl'] = termsUrl; + } + if (typeof contacts !== 'undefined') { + payload['contacts'] = contacts; + } if (typeof redirectUris !== 'undefined') { payload['redirectUris'] = redirectUris; } if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - if (typeof internal !== 'undefined') { - payload['internal'] = internal; - } if (typeof type !== 'undefined') { payload['type'] = type; } + if (typeof deviceFlow !== 'undefined') { + payload['deviceFlow'] = deviceFlow; + } if (typeof teamId !== 'undefined') { payload['teamId'] = teamId; } @@ -165,6 +208,7 @@ export class Apps { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -217,6 +261,7 @@ export class Apps { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -232,53 +277,77 @@ export class Apps { * * @param {string} params.appId - Application unique ID. * @param {string} params.name - Application name. + * @param {string} params.description - Application description shown to users during OAuth2 consent. + * @param {string} params.clientUri - Application homepage URL shown to users during OAuth2 consent. + * @param {string} params.logoUri - Application logo URL shown to users during OAuth2 consent. + * @param {string} params.privacyPolicyUrl - Application privacy policy URL shown to users during OAuth2 consent. + * @param {string} params.termsUrl - Application terms of service URL shown to users during OAuth2 consent. + * @param {string[]} params.contacts - Application support or security contact emails. Maximum of 100 contacts are allowed. * @param {boolean} params.enabled - Is application enabled? - * @param {boolean} params.internal - When true, the application is restricted to the owner user or members of the configured team. Defaults to false (any user in the project can authorize). * @param {string[]} params.redirectUris - Redirect URIs (array of valid URLs). * @param {string} params.type - OAuth2 client type. Use `public` for SPAs, mobile, and native apps that cannot keep a `client_secret` — PKCE is then required at the token endpoint. Use `confidential` for server-side clients that present a `client_secret`. Defaults to `confidential`. + * @param {boolean} params.deviceFlow - Allow this client to use the OAuth2 Device Authorization Grant (RFC 8628) for input-constrained devices such as TVs and CLIs. Defaults to false. * @throws {AppwriteException} * @returns {Promise} */ - update(params: { appId: string, name: string, enabled?: boolean, internal?: boolean, redirectUris?: string[], type?: string }): Promise; + update(params: { appId: string, name: string, description?: string, clientUri?: string, logoUri?: string, privacyPolicyUrl?: string, termsUrl?: string, contacts?: string[], enabled?: boolean, redirectUris?: string[], type?: string, deviceFlow?: boolean }): Promise; /** * Update an application by its unique ID. * * @param {string} appId - Application unique ID. * @param {string} name - Application name. + * @param {string} description - Application description shown to users during OAuth2 consent. + * @param {string} clientUri - Application homepage URL shown to users during OAuth2 consent. + * @param {string} logoUri - Application logo URL shown to users during OAuth2 consent. + * @param {string} privacyPolicyUrl - Application privacy policy URL shown to users during OAuth2 consent. + * @param {string} termsUrl - Application terms of service URL shown to users during OAuth2 consent. + * @param {string[]} contacts - Application support or security contact emails. Maximum of 100 contacts are allowed. * @param {boolean} enabled - Is application enabled? - * @param {boolean} internal - When true, the application is restricted to the owner user or members of the configured team. Defaults to false (any user in the project can authorize). * @param {string[]} redirectUris - Redirect URIs (array of valid URLs). * @param {string} type - OAuth2 client type. Use `public` for SPAs, mobile, and native apps that cannot keep a `client_secret` — PKCE is then required at the token endpoint. Use `confidential` for server-side clients that present a `client_secret`. Defaults to `confidential`. + * @param {boolean} deviceFlow - Allow this client to use the OAuth2 Device Authorization Grant (RFC 8628) for input-constrained devices such as TVs and CLIs. Defaults to false. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - update(appId: string, name: string, enabled?: boolean, internal?: boolean, redirectUris?: string[], type?: string): Promise; + update(appId: string, name: string, description?: string, clientUri?: string, logoUri?: string, privacyPolicyUrl?: string, termsUrl?: string, contacts?: string[], enabled?: boolean, redirectUris?: string[], type?: string, deviceFlow?: boolean): Promise; update( - paramsOrFirst: { appId: string, name: string, enabled?: boolean, internal?: boolean, redirectUris?: string[], type?: string } | string, - ...rest: [(string)?, (boolean)?, (boolean)?, (string[])?, (string)?] + paramsOrFirst: { appId: string, name: string, description?: string, clientUri?: string, logoUri?: string, privacyPolicyUrl?: string, termsUrl?: string, contacts?: string[], enabled?: boolean, redirectUris?: string[], type?: string, deviceFlow?: boolean } | string, + ...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string[])?, (boolean)?, (string[])?, (string)?, (boolean)?] ): Promise { - let params: { appId: string, name: string, enabled?: boolean, internal?: boolean, redirectUris?: string[], type?: string }; + let params: { appId: string, name: string, description?: string, clientUri?: string, logoUri?: string, privacyPolicyUrl?: string, termsUrl?: string, contacts?: string[], enabled?: boolean, redirectUris?: string[], type?: string, deviceFlow?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { appId: string, name: string, enabled?: boolean, internal?: boolean, redirectUris?: string[], type?: string }; + params = (paramsOrFirst || {}) as { appId: string, name: string, description?: string, clientUri?: string, logoUri?: string, privacyPolicyUrl?: string, termsUrl?: string, contacts?: string[], enabled?: boolean, redirectUris?: string[], type?: string, deviceFlow?: boolean }; } else { params = { appId: paramsOrFirst as string, name: rest[0] as string, - enabled: rest[1] as boolean, - internal: rest[2] as boolean, - redirectUris: rest[3] as string[], - type: rest[4] as string + description: rest[1] as string, + clientUri: rest[2] as string, + logoUri: rest[3] as string, + privacyPolicyUrl: rest[4] as string, + termsUrl: rest[5] as string, + contacts: rest[6] as string[], + enabled: rest[7] as boolean, + redirectUris: rest[8] as string[], + type: rest[9] as string, + deviceFlow: rest[10] as boolean }; } const appId = params.appId; const name = params.name; + const description = params.description; + const clientUri = params.clientUri; + const logoUri = params.logoUri; + const privacyPolicyUrl = params.privacyPolicyUrl; + const termsUrl = params.termsUrl; + const contacts = params.contacts; const enabled = params.enabled; - const internal = params.internal; const redirectUris = params.redirectUris; const type = params.type; + const deviceFlow = params.deviceFlow; if (typeof appId === 'undefined') { throw new AppwriteException('Missing required parameter: "appId"'); @@ -292,23 +361,42 @@ export class Apps { if (typeof name !== 'undefined') { payload['name'] = name; } + if (typeof description !== 'undefined') { + payload['description'] = description; + } + if (typeof clientUri !== 'undefined') { + payload['clientUri'] = clientUri; + } + if (typeof logoUri !== 'undefined') { + payload['logoUri'] = logoUri; + } + if (typeof privacyPolicyUrl !== 'undefined') { + payload['privacyPolicyUrl'] = privacyPolicyUrl; + } + if (typeof termsUrl !== 'undefined') { + payload['termsUrl'] = termsUrl; + } + if (typeof contacts !== 'undefined') { + payload['contacts'] = contacts; + } if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - if (typeof internal !== 'undefined') { - payload['internal'] = internal; - } if (typeof redirectUris !== 'undefined') { payload['redirectUris'] = redirectUris; } if (typeof type !== 'undefined') { payload['type'] = type; } + if (typeof deviceFlow !== 'undefined') { + payload['deviceFlow'] = deviceFlow; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -362,6 +450,7 @@ export class Apps { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -429,6 +518,7 @@ export class Apps { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -482,6 +572,7 @@ export class Apps { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -542,6 +633,7 @@ export class Apps { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -603,6 +695,7 @@ export class Apps { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -667,6 +760,7 @@ export class Apps { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -720,6 +814,7 @@ export class Apps { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/assistant.ts b/src/services/assistant.ts index dc3b5725..a8b12ee3 100644 --- a/src/services/assistant.ts +++ b/src/services/assistant.ts @@ -56,6 +56,7 @@ export class Assistant { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'text/plain', } return this.client.call( diff --git a/src/services/avatars.ts b/src/services/avatars.ts index 1acf6df2..cc552f46 100644 --- a/src/services/avatars.ts +++ b/src/services/avatars.ts @@ -85,9 +85,11 @@ export class Avatars { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'image/png', } payload['project'] = this.client.config.project; + payload['impersonateuserid'] = this.client.config.impersonateuserid; for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); @@ -166,9 +168,11 @@ export class Avatars { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'image/png', } payload['project'] = this.client.config.project; + payload['impersonateuserid'] = this.client.config.impersonateuserid; for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); @@ -226,9 +230,11 @@ export class Avatars { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'image/*', } payload['project'] = this.client.config.project; + payload['impersonateuserid'] = this.client.config.impersonateuserid; for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); @@ -307,9 +313,11 @@ export class Avatars { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'image/png', } payload['project'] = this.client.config.project; + payload['impersonateuserid'] = this.client.config.impersonateuserid; for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); @@ -386,9 +394,11 @@ export class Avatars { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'image/*', } payload['project'] = this.client.config.project; + payload['impersonateuserid'] = this.client.config.impersonateuserid; for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); @@ -471,9 +481,11 @@ export class Avatars { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'image/png', } payload['project'] = this.client.config.project; + payload['impersonateuserid'] = this.client.config.impersonateuserid; for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); @@ -551,9 +563,11 @@ export class Avatars { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'image/png', } payload['project'] = this.client.config.project; + payload['impersonateuserid'] = this.client.config.impersonateuserid; for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); @@ -749,9 +763,11 @@ export class Avatars { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'image/png', } payload['project'] = this.client.config.project; + payload['impersonateuserid'] = this.client.config.impersonateuserid; for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); diff --git a/src/services/backups.ts b/src/services/backups.ts index 7df0eaec..e6edc566 100644 --- a/src/services/backups.ts +++ b/src/services/backups.ts @@ -53,6 +53,7 @@ export class Backups { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -117,6 +118,7 @@ export class Backups { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -169,6 +171,7 @@ export class Backups { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -222,6 +225,7 @@ export class Backups { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -274,6 +278,7 @@ export class Backups { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -382,6 +387,7 @@ export class Backups { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -434,6 +440,7 @@ export class Backups { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -516,6 +523,7 @@ export class Backups { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -569,6 +577,7 @@ export class Backups { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -650,6 +659,7 @@ export class Backups { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -702,6 +712,7 @@ export class Backups { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -754,6 +765,7 @@ export class Backups { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/compute.ts b/src/services/compute.ts index 464f14fe..119b03f7 100644 --- a/src/services/compute.ts +++ b/src/services/compute.ts @@ -52,6 +52,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -70,8 +71,6 @@ export class Compute { * @param {string} params.database - Physical database/catalog name. Defaults to databaseId. * @param {string} params.engine - Database engine: postgres, mysql, mariadb, or mongodb. * @param {string} params.version - Database engine version. Defaults to latest for selected engine. - * @param {string} params.region - Region identifier. Use one of the enabled region codes (e.g., fra, nyc, syd). - * @param {string} params.type - Database type: shared (serverless) or dedicated (always-on). * @param {string} params.specification - Specification identifier. * @param {string} params.backend - Database backend provider: prisma, or edge. * @param {number} params.cpu - CPU in millicores (125-16000). @@ -79,8 +78,7 @@ export class Compute { * @param {number} params.storage - Storage in GB to allocate (1-16384). * @param {string} params.storageClass - Storage class: ssd, nvme, or hdd. * @param {number} params.storageMaxGb - Maximum storage limit in GB. 0 uses system default. - * @param {boolean} params.highAvailability - Enable high availability. - * @param {number} params.highAvailabilityReplicaCount - Number of high availability replicas (0-5). + * @param {number} params.replicas - Number of high availability replicas (0-5). High availability is enabled when greater than 0. * @param {string} params.highAvailabilitySyncMode - Replication sync mode preference. Allowed values: async, sync, quorum. * @param {number} params.networkMaxConnections - Maximum concurrent connections. * @param {number} params.networkIdleTimeoutSeconds - Connection idle timeout in seconds. @@ -96,10 +94,11 @@ export class Compute { * @param {number} params.storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. 0 means no limit. * @param {boolean} params.metricsEnabled - Enable metrics collection. * @param {boolean} params.poolerEnabled - Enable connection pooler on provision. + * @param {string} params.api - Product API that owns this database: compute (raw, direct-access), tablesdb, documentsdb, or vectorsdb. tablesdb/documentsdb/vectorsdb computes are reached only through their product APIs. * @throws {AppwriteException} * @returns {Promise} */ - createDatabase(params: { databaseId: string, name: string, database?: string, engine?: string, version?: string, region?: string, type?: string, specification?: string, backend?: string, cpu?: number, memory?: number, storage?: number, storageClass?: string, storageMaxGb?: number, highAvailability?: boolean, highAvailabilityReplicaCount?: number, highAvailabilitySyncMode?: string, networkMaxConnections?: number, networkIdleTimeoutSeconds?: number, networkIPAllowlist?: string[], idleTimeoutMinutes?: number, backupEnabled?: boolean, backupPitr?: boolean, backupCron?: string, backupRetentionDays?: number, pitrRetentionDays?: number, storageAutoscaling?: boolean, storageAutoscalingThresholdPercent?: number, storageAutoscalingMaxGb?: number, metricsEnabled?: boolean, poolerEnabled?: boolean }): Promise; + createDatabase(params: { databaseId: string, name: string, database?: string, engine?: string, version?: string, specification?: string, backend?: string, cpu?: number, memory?: number, storage?: number, storageClass?: string, storageMaxGb?: number, replicas?: number, highAvailabilitySyncMode?: string, networkMaxConnections?: number, networkIdleTimeoutSeconds?: number, networkIPAllowlist?: string[], idleTimeoutMinutes?: number, backupEnabled?: boolean, backupPitr?: boolean, backupCron?: string, backupRetentionDays?: number, pitrRetentionDays?: number, storageAutoscaling?: boolean, storageAutoscalingThresholdPercent?: number, storageAutoscalingMaxGb?: number, metricsEnabled?: boolean, poolerEnabled?: boolean, api?: string }): Promise; /** * Create a new dedicated database with the chosen engine and configuration. Status will be 'provisioning' until the database is ready. * @@ -108,8 +107,6 @@ export class Compute { * @param {string} database - Physical database/catalog name. Defaults to databaseId. * @param {string} engine - Database engine: postgres, mysql, mariadb, or mongodb. * @param {string} version - Database engine version. Defaults to latest for selected engine. - * @param {string} region - Region identifier. Use one of the enabled region codes (e.g., fra, nyc, syd). - * @param {string} type - Database type: shared (serverless) or dedicated (always-on). * @param {string} specification - Specification identifier. * @param {string} backend - Database backend provider: prisma, or edge. * @param {number} cpu - CPU in millicores (125-16000). @@ -117,8 +114,7 @@ export class Compute { * @param {number} storage - Storage in GB to allocate (1-16384). * @param {string} storageClass - Storage class: ssd, nvme, or hdd. * @param {number} storageMaxGb - Maximum storage limit in GB. 0 uses system default. - * @param {boolean} highAvailability - Enable high availability. - * @param {number} highAvailabilityReplicaCount - Number of high availability replicas (0-5). + * @param {number} replicas - Number of high availability replicas (0-5). High availability is enabled when greater than 0. * @param {string} highAvailabilitySyncMode - Replication sync mode preference. Allowed values: async, sync, quorum. * @param {number} networkMaxConnections - Maximum concurrent connections. * @param {number} networkIdleTimeoutSeconds - Connection idle timeout in seconds. @@ -134,19 +130,20 @@ export class Compute { * @param {number} storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. 0 means no limit. * @param {boolean} metricsEnabled - Enable metrics collection. * @param {boolean} poolerEnabled - Enable connection pooler on provision. + * @param {string} api - Product API that owns this database: compute (raw, direct-access), tablesdb, documentsdb, or vectorsdb. tablesdb/documentsdb/vectorsdb computes are reached only through their product APIs. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createDatabase(databaseId: string, name: string, database?: string, engine?: string, version?: string, region?: string, type?: string, specification?: string, backend?: string, cpu?: number, memory?: number, storage?: number, storageClass?: string, storageMaxGb?: number, highAvailability?: boolean, highAvailabilityReplicaCount?: number, highAvailabilitySyncMode?: string, networkMaxConnections?: number, networkIdleTimeoutSeconds?: number, networkIPAllowlist?: string[], idleTimeoutMinutes?: number, backupEnabled?: boolean, backupPitr?: boolean, backupCron?: string, backupRetentionDays?: number, pitrRetentionDays?: number, storageAutoscaling?: boolean, storageAutoscalingThresholdPercent?: number, storageAutoscalingMaxGb?: number, metricsEnabled?: boolean, poolerEnabled?: boolean): Promise; + createDatabase(databaseId: string, name: string, database?: string, engine?: string, version?: string, specification?: string, backend?: string, cpu?: number, memory?: number, storage?: number, storageClass?: string, storageMaxGb?: number, replicas?: number, highAvailabilitySyncMode?: string, networkMaxConnections?: number, networkIdleTimeoutSeconds?: number, networkIPAllowlist?: string[], idleTimeoutMinutes?: number, backupEnabled?: boolean, backupPitr?: boolean, backupCron?: string, backupRetentionDays?: number, pitrRetentionDays?: number, storageAutoscaling?: boolean, storageAutoscalingThresholdPercent?: number, storageAutoscalingMaxGb?: number, metricsEnabled?: boolean, poolerEnabled?: boolean, api?: string): Promise; createDatabase( - paramsOrFirst: { databaseId: string, name: string, database?: string, engine?: string, version?: string, region?: string, type?: string, specification?: string, backend?: string, cpu?: number, memory?: number, storage?: number, storageClass?: string, storageMaxGb?: number, highAvailability?: boolean, highAvailabilityReplicaCount?: number, highAvailabilitySyncMode?: string, networkMaxConnections?: number, networkIdleTimeoutSeconds?: number, networkIPAllowlist?: string[], idleTimeoutMinutes?: number, backupEnabled?: boolean, backupPitr?: boolean, backupCron?: string, backupRetentionDays?: number, pitrRetentionDays?: number, storageAutoscaling?: boolean, storageAutoscalingThresholdPercent?: number, storageAutoscalingMaxGb?: number, metricsEnabled?: boolean, poolerEnabled?: boolean } | string, - ...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (number)?, (number)?, (number)?, (string)?, (number)?, (boolean)?, (number)?, (string)?, (number)?, (number)?, (string[])?, (number)?, (boolean)?, (boolean)?, (string)?, (number)?, (number)?, (boolean)?, (number)?, (number)?, (boolean)?, (boolean)?] + paramsOrFirst: { databaseId: string, name: string, database?: string, engine?: string, version?: string, specification?: string, backend?: string, cpu?: number, memory?: number, storage?: number, storageClass?: string, storageMaxGb?: number, replicas?: number, highAvailabilitySyncMode?: string, networkMaxConnections?: number, networkIdleTimeoutSeconds?: number, networkIPAllowlist?: string[], idleTimeoutMinutes?: number, backupEnabled?: boolean, backupPitr?: boolean, backupCron?: string, backupRetentionDays?: number, pitrRetentionDays?: number, storageAutoscaling?: boolean, storageAutoscalingThresholdPercent?: number, storageAutoscalingMaxGb?: number, metricsEnabled?: boolean, poolerEnabled?: boolean, api?: string } | string, + ...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (number)?, (number)?, (number)?, (string)?, (number)?, (number)?, (string)?, (number)?, (number)?, (string[])?, (number)?, (boolean)?, (boolean)?, (string)?, (number)?, (number)?, (boolean)?, (number)?, (number)?, (boolean)?, (boolean)?, (string)?] ): Promise { - let params: { databaseId: string, name: string, database?: string, engine?: string, version?: string, region?: string, type?: string, specification?: string, backend?: string, cpu?: number, memory?: number, storage?: number, storageClass?: string, storageMaxGb?: number, highAvailability?: boolean, highAvailabilityReplicaCount?: number, highAvailabilitySyncMode?: string, networkMaxConnections?: number, networkIdleTimeoutSeconds?: number, networkIPAllowlist?: string[], idleTimeoutMinutes?: number, backupEnabled?: boolean, backupPitr?: boolean, backupCron?: string, backupRetentionDays?: number, pitrRetentionDays?: number, storageAutoscaling?: boolean, storageAutoscalingThresholdPercent?: number, storageAutoscalingMaxGb?: number, metricsEnabled?: boolean, poolerEnabled?: boolean }; + let params: { databaseId: string, name: string, database?: string, engine?: string, version?: string, specification?: string, backend?: string, cpu?: number, memory?: number, storage?: number, storageClass?: string, storageMaxGb?: number, replicas?: number, highAvailabilitySyncMode?: string, networkMaxConnections?: number, networkIdleTimeoutSeconds?: number, networkIPAllowlist?: string[], idleTimeoutMinutes?: number, backupEnabled?: boolean, backupPitr?: boolean, backupCron?: string, backupRetentionDays?: number, pitrRetentionDays?: number, storageAutoscaling?: boolean, storageAutoscalingThresholdPercent?: number, storageAutoscalingMaxGb?: number, metricsEnabled?: boolean, poolerEnabled?: boolean, api?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, name: string, database?: string, engine?: string, version?: string, region?: string, type?: string, specification?: string, backend?: string, cpu?: number, memory?: number, storage?: number, storageClass?: string, storageMaxGb?: number, highAvailability?: boolean, highAvailabilityReplicaCount?: number, highAvailabilitySyncMode?: string, networkMaxConnections?: number, networkIdleTimeoutSeconds?: number, networkIPAllowlist?: string[], idleTimeoutMinutes?: number, backupEnabled?: boolean, backupPitr?: boolean, backupCron?: string, backupRetentionDays?: number, pitrRetentionDays?: number, storageAutoscaling?: boolean, storageAutoscalingThresholdPercent?: number, storageAutoscalingMaxGb?: number, metricsEnabled?: boolean, poolerEnabled?: boolean }; + params = (paramsOrFirst || {}) as { databaseId: string, name: string, database?: string, engine?: string, version?: string, specification?: string, backend?: string, cpu?: number, memory?: number, storage?: number, storageClass?: string, storageMaxGb?: number, replicas?: number, highAvailabilitySyncMode?: string, networkMaxConnections?: number, networkIdleTimeoutSeconds?: number, networkIPAllowlist?: string[], idleTimeoutMinutes?: number, backupEnabled?: boolean, backupPitr?: boolean, backupCron?: string, backupRetentionDays?: number, pitrRetentionDays?: number, storageAutoscaling?: boolean, storageAutoscalingThresholdPercent?: number, storageAutoscalingMaxGb?: number, metricsEnabled?: boolean, poolerEnabled?: boolean, api?: string }; } else { params = { databaseId: paramsOrFirst as string, @@ -154,32 +151,30 @@ export class Compute { database: rest[1] as string, engine: rest[2] as string, version: rest[3] as string, - region: rest[4] as string, - type: rest[5] as string, - specification: rest[6] as string, - backend: rest[7] as string, - cpu: rest[8] as number, - memory: rest[9] as number, - storage: rest[10] as number, - storageClass: rest[11] as string, - storageMaxGb: rest[12] as number, - highAvailability: rest[13] as boolean, - highAvailabilityReplicaCount: rest[14] as number, - highAvailabilitySyncMode: rest[15] as string, - networkMaxConnections: rest[16] as number, - networkIdleTimeoutSeconds: rest[17] as number, - networkIPAllowlist: rest[18] as string[], - idleTimeoutMinutes: rest[19] as number, - backupEnabled: rest[20] as boolean, - backupPitr: rest[21] as boolean, - backupCron: rest[22] as string, - backupRetentionDays: rest[23] as number, - pitrRetentionDays: rest[24] as number, - storageAutoscaling: rest[25] as boolean, - storageAutoscalingThresholdPercent: rest[26] as number, - storageAutoscalingMaxGb: rest[27] as number, - metricsEnabled: rest[28] as boolean, - poolerEnabled: rest[29] as boolean + specification: rest[4] as string, + backend: rest[5] as string, + cpu: rest[6] as number, + memory: rest[7] as number, + storage: rest[8] as number, + storageClass: rest[9] as string, + storageMaxGb: rest[10] as number, + replicas: rest[11] as number, + highAvailabilitySyncMode: rest[12] as string, + networkMaxConnections: rest[13] as number, + networkIdleTimeoutSeconds: rest[14] as number, + networkIPAllowlist: rest[15] as string[], + idleTimeoutMinutes: rest[16] as number, + backupEnabled: rest[17] as boolean, + backupPitr: rest[18] as boolean, + backupCron: rest[19] as string, + backupRetentionDays: rest[20] as number, + pitrRetentionDays: rest[21] as number, + storageAutoscaling: rest[22] as boolean, + storageAutoscalingThresholdPercent: rest[23] as number, + storageAutoscalingMaxGb: rest[24] as number, + metricsEnabled: rest[25] as boolean, + poolerEnabled: rest[26] as boolean, + api: rest[27] as string }; } @@ -188,8 +183,6 @@ export class Compute { const database = params.database; const engine = params.engine; const version = params.version; - const region = params.region; - const type = params.type; const specification = params.specification; const backend = params.backend; const cpu = params.cpu; @@ -197,8 +190,7 @@ export class Compute { const storage = params.storage; const storageClass = params.storageClass; const storageMaxGb = params.storageMaxGb; - const highAvailability = params.highAvailability; - const highAvailabilityReplicaCount = params.highAvailabilityReplicaCount; + const replicas = params.replicas; const highAvailabilitySyncMode = params.highAvailabilitySyncMode; const networkMaxConnections = params.networkMaxConnections; const networkIdleTimeoutSeconds = params.networkIdleTimeoutSeconds; @@ -214,6 +206,7 @@ export class Compute { const storageAutoscalingMaxGb = params.storageAutoscalingMaxGb; const metricsEnabled = params.metricsEnabled; const poolerEnabled = params.poolerEnabled; + const api = params.api; if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); @@ -239,12 +232,6 @@ export class Compute { if (typeof version !== 'undefined') { payload['version'] = version; } - if (typeof region !== 'undefined') { - payload['region'] = region; - } - if (typeof type !== 'undefined') { - payload['type'] = type; - } if (typeof specification !== 'undefined') { payload['specification'] = specification; } @@ -266,11 +253,8 @@ export class Compute { if (typeof storageMaxGb !== 'undefined') { payload['storageMaxGb'] = storageMaxGb; } - if (typeof highAvailability !== 'undefined') { - payload['highAvailability'] = highAvailability; - } - if (typeof highAvailabilityReplicaCount !== 'undefined') { - payload['highAvailabilityReplicaCount'] = highAvailabilityReplicaCount; + if (typeof replicas !== 'undefined') { + payload['replicas'] = replicas; } if (typeof highAvailabilitySyncMode !== 'undefined') { payload['highAvailabilitySyncMode'] = highAvailabilitySyncMode; @@ -317,11 +301,15 @@ export class Compute { if (typeof poolerEnabled !== 'undefined') { payload['poolerEnabled'] = poolerEnabled; } + if (typeof api !== 'undefined') { + payload['api'] = api; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -346,6 +334,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -398,6 +387,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -413,14 +403,13 @@ export class Compute { * * @param {string} params.databaseId - Database ID. * @param {string} params.name - Database display name. - * @param {string} params.status - Database status. Allowed values: ready, paused, inactive. Set to "paused" to pause, "ready" to resume, or "inactive" to spin down a shared database. - * @param {string} params.specification - Specification. Changes cpu, memory, and type based on specification config. + * @param {string} params.status - Database status. Allowed values: ready, paused, inactive. Set to "paused" to pause, "ready" to resume, or "inactive" to spin down a shared-pool database. + * @param {string} params.specification - Specification. Changes cpu, memory, and node pool based on specification config. * @param {number} params.cpu - CPU cores to allocate (125-16000). * @param {number} params.memory - Memory in MB to allocate (128-65536). * @param {number} params.storage - Storage in GB to allocate (1-16384). * @param {string} params.storageClass - Storage class. Allowed values: ssd, nvme, hdd. - * @param {boolean} params.highAvailability - Enable high availability. - * @param {number} params.highAvailabilityReplicaCount - Number of high availability replicas (0-5). + * @param {number} params.replicas - Number of high availability replicas (0-5). High availability is enabled when greater than 0. * @param {string} params.highAvailabilitySyncMode - Replication sync mode preference. Allowed values: async, sync, quorum. * @param {number} params.networkMaxConnections - Maximum concurrent connections. * @param {number} params.networkIdleTimeoutSeconds - Connection idle timeout in seconds (60-86400). @@ -439,27 +428,26 @@ export class Compute { * @param {number} params.metricsTraceSampleRate - Fraction of queries to trace (0.0–1.0). Forwarded to the sidecar. * @param {number} params.metricsSlowQueryLogThresholdMs - Threshold in ms above which queries are logged as slow. Forwarded to the sidecar. * @param {boolean} params.sqlApiEnabled - Enable the SQL API sidecar for this database. - * @param {string[]} params.sqlApiAllowedStatements - Statement types the SQL API accepts. Allowed values: SELECT, INSERT, UPDATE, DELETE. + * @param {string[]} params.sqlApiAllowedStatements - Statement types the SQL API accepts. Allowed values: SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, TRUNCATE, GRANT, REVOKE. * @param {number} params.sqlApiMaxRows - Maximum rows returned per SQL API execution (1-1000000). * @param {number} params.sqlApiMaxBytes - Maximum serialised SQL API result payload in bytes (1024-104857600). * @param {number} params.sqlApiTimeoutSeconds - Per-call SQL API execution timeout in seconds (1-300). * @throws {AppwriteException} * @returns {Promise} */ - updateDatabase(params: { databaseId: string, name?: string, status?: string, specification?: string, cpu?: number, memory?: number, storage?: number, storageClass?: string, highAvailability?: boolean, highAvailabilityReplicaCount?: number, highAvailabilitySyncMode?: string, networkMaxConnections?: number, networkIdleTimeoutSeconds?: number, networkIPAllowlist?: string[], idleTimeoutMinutes?: number, backupEnabled?: boolean, backupPitr?: boolean, backupCron?: string, backupRetentionDays?: number, pitrRetentionDays?: number, storageAutoscaling?: boolean, storageAutoscalingThresholdPercent?: number, storageAutoscalingMaxGb?: number, poolerEnabled?: boolean, metricsEnabled?: boolean, metricsTraceSampleRate?: number, metricsSlowQueryLogThresholdMs?: number, sqlApiEnabled?: boolean, sqlApiAllowedStatements?: string[], sqlApiMaxRows?: number, sqlApiMaxBytes?: number, sqlApiTimeoutSeconds?: number }): Promise; + updateDatabase(params: { databaseId: string, name?: string, status?: string, specification?: string, cpu?: number, memory?: number, storage?: number, storageClass?: string, replicas?: number, highAvailabilitySyncMode?: string, networkMaxConnections?: number, networkIdleTimeoutSeconds?: number, networkIPAllowlist?: string[], idleTimeoutMinutes?: number, backupEnabled?: boolean, backupPitr?: boolean, backupCron?: string, backupRetentionDays?: number, pitrRetentionDays?: number, storageAutoscaling?: boolean, storageAutoscalingThresholdPercent?: number, storageAutoscalingMaxGb?: number, poolerEnabled?: boolean, metricsEnabled?: boolean, metricsTraceSampleRate?: number, metricsSlowQueryLogThresholdMs?: number, sqlApiEnabled?: boolean, sqlApiAllowedStatements?: string[], sqlApiMaxRows?: number, sqlApiMaxBytes?: number, sqlApiTimeoutSeconds?: number }): Promise; /** * Update a dedicated database configuration. All changes are applied with zero downtime. Resource changes (cpu, memory) are handled via rolling cutover. Storage expansion is done online. All other settings are applied in-place. * * @param {string} databaseId - Database ID. * @param {string} name - Database display name. - * @param {string} status - Database status. Allowed values: ready, paused, inactive. Set to "paused" to pause, "ready" to resume, or "inactive" to spin down a shared database. - * @param {string} specification - Specification. Changes cpu, memory, and type based on specification config. + * @param {string} status - Database status. Allowed values: ready, paused, inactive. Set to "paused" to pause, "ready" to resume, or "inactive" to spin down a shared-pool database. + * @param {string} specification - Specification. Changes cpu, memory, and node pool based on specification config. * @param {number} cpu - CPU cores to allocate (125-16000). * @param {number} memory - Memory in MB to allocate (128-65536). * @param {number} storage - Storage in GB to allocate (1-16384). * @param {string} storageClass - Storage class. Allowed values: ssd, nvme, hdd. - * @param {boolean} highAvailability - Enable high availability. - * @param {number} highAvailabilityReplicaCount - Number of high availability replicas (0-5). + * @param {number} replicas - Number of high availability replicas (0-5). High availability is enabled when greater than 0. * @param {string} highAvailabilitySyncMode - Replication sync mode preference. Allowed values: async, sync, quorum. * @param {number} networkMaxConnections - Maximum concurrent connections. * @param {number} networkIdleTimeoutSeconds - Connection idle timeout in seconds (60-86400). @@ -478,7 +466,7 @@ export class Compute { * @param {number} metricsTraceSampleRate - Fraction of queries to trace (0.0–1.0). Forwarded to the sidecar. * @param {number} metricsSlowQueryLogThresholdMs - Threshold in ms above which queries are logged as slow. Forwarded to the sidecar. * @param {boolean} sqlApiEnabled - Enable the SQL API sidecar for this database. - * @param {string[]} sqlApiAllowedStatements - Statement types the SQL API accepts. Allowed values: SELECT, INSERT, UPDATE, DELETE. + * @param {string[]} sqlApiAllowedStatements - Statement types the SQL API accepts. Allowed values: SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, TRUNCATE, GRANT, REVOKE. * @param {number} sqlApiMaxRows - Maximum rows returned per SQL API execution (1-1000000). * @param {number} sqlApiMaxBytes - Maximum serialised SQL API result payload in bytes (1024-104857600). * @param {number} sqlApiTimeoutSeconds - Per-call SQL API execution timeout in seconds (1-300). @@ -486,15 +474,15 @@ export class Compute { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateDatabase(databaseId: string, name?: string, status?: string, specification?: string, cpu?: number, memory?: number, storage?: number, storageClass?: string, highAvailability?: boolean, highAvailabilityReplicaCount?: number, highAvailabilitySyncMode?: string, networkMaxConnections?: number, networkIdleTimeoutSeconds?: number, networkIPAllowlist?: string[], idleTimeoutMinutes?: number, backupEnabled?: boolean, backupPitr?: boolean, backupCron?: string, backupRetentionDays?: number, pitrRetentionDays?: number, storageAutoscaling?: boolean, storageAutoscalingThresholdPercent?: number, storageAutoscalingMaxGb?: number, poolerEnabled?: boolean, metricsEnabled?: boolean, metricsTraceSampleRate?: number, metricsSlowQueryLogThresholdMs?: number, sqlApiEnabled?: boolean, sqlApiAllowedStatements?: string[], sqlApiMaxRows?: number, sqlApiMaxBytes?: number, sqlApiTimeoutSeconds?: number): Promise; + updateDatabase(databaseId: string, name?: string, status?: string, specification?: string, cpu?: number, memory?: number, storage?: number, storageClass?: string, replicas?: number, highAvailabilitySyncMode?: string, networkMaxConnections?: number, networkIdleTimeoutSeconds?: number, networkIPAllowlist?: string[], idleTimeoutMinutes?: number, backupEnabled?: boolean, backupPitr?: boolean, backupCron?: string, backupRetentionDays?: number, pitrRetentionDays?: number, storageAutoscaling?: boolean, storageAutoscalingThresholdPercent?: number, storageAutoscalingMaxGb?: number, poolerEnabled?: boolean, metricsEnabled?: boolean, metricsTraceSampleRate?: number, metricsSlowQueryLogThresholdMs?: number, sqlApiEnabled?: boolean, sqlApiAllowedStatements?: string[], sqlApiMaxRows?: number, sqlApiMaxBytes?: number, sqlApiTimeoutSeconds?: number): Promise; updateDatabase( - paramsOrFirst: { databaseId: string, name?: string, status?: string, specification?: string, cpu?: number, memory?: number, storage?: number, storageClass?: string, highAvailability?: boolean, highAvailabilityReplicaCount?: number, highAvailabilitySyncMode?: string, networkMaxConnections?: number, networkIdleTimeoutSeconds?: number, networkIPAllowlist?: string[], idleTimeoutMinutes?: number, backupEnabled?: boolean, backupPitr?: boolean, backupCron?: string, backupRetentionDays?: number, pitrRetentionDays?: number, storageAutoscaling?: boolean, storageAutoscalingThresholdPercent?: number, storageAutoscalingMaxGb?: number, poolerEnabled?: boolean, metricsEnabled?: boolean, metricsTraceSampleRate?: number, metricsSlowQueryLogThresholdMs?: number, sqlApiEnabled?: boolean, sqlApiAllowedStatements?: string[], sqlApiMaxRows?: number, sqlApiMaxBytes?: number, sqlApiTimeoutSeconds?: number } | string, - ...rest: [(string)?, (string)?, (string)?, (number)?, (number)?, (number)?, (string)?, (boolean)?, (number)?, (string)?, (number)?, (number)?, (string[])?, (number)?, (boolean)?, (boolean)?, (string)?, (number)?, (number)?, (boolean)?, (number)?, (number)?, (boolean)?, (boolean)?, (number)?, (number)?, (boolean)?, (string[])?, (number)?, (number)?, (number)?] + paramsOrFirst: { databaseId: string, name?: string, status?: string, specification?: string, cpu?: number, memory?: number, storage?: number, storageClass?: string, replicas?: number, highAvailabilitySyncMode?: string, networkMaxConnections?: number, networkIdleTimeoutSeconds?: number, networkIPAllowlist?: string[], idleTimeoutMinutes?: number, backupEnabled?: boolean, backupPitr?: boolean, backupCron?: string, backupRetentionDays?: number, pitrRetentionDays?: number, storageAutoscaling?: boolean, storageAutoscalingThresholdPercent?: number, storageAutoscalingMaxGb?: number, poolerEnabled?: boolean, metricsEnabled?: boolean, metricsTraceSampleRate?: number, metricsSlowQueryLogThresholdMs?: number, sqlApiEnabled?: boolean, sqlApiAllowedStatements?: string[], sqlApiMaxRows?: number, sqlApiMaxBytes?: number, sqlApiTimeoutSeconds?: number } | string, + ...rest: [(string)?, (string)?, (string)?, (number)?, (number)?, (number)?, (string)?, (number)?, (string)?, (number)?, (number)?, (string[])?, (number)?, (boolean)?, (boolean)?, (string)?, (number)?, (number)?, (boolean)?, (number)?, (number)?, (boolean)?, (boolean)?, (number)?, (number)?, (boolean)?, (string[])?, (number)?, (number)?, (number)?] ): Promise { - let params: { databaseId: string, name?: string, status?: string, specification?: string, cpu?: number, memory?: number, storage?: number, storageClass?: string, highAvailability?: boolean, highAvailabilityReplicaCount?: number, highAvailabilitySyncMode?: string, networkMaxConnections?: number, networkIdleTimeoutSeconds?: number, networkIPAllowlist?: string[], idleTimeoutMinutes?: number, backupEnabled?: boolean, backupPitr?: boolean, backupCron?: string, backupRetentionDays?: number, pitrRetentionDays?: number, storageAutoscaling?: boolean, storageAutoscalingThresholdPercent?: number, storageAutoscalingMaxGb?: number, poolerEnabled?: boolean, metricsEnabled?: boolean, metricsTraceSampleRate?: number, metricsSlowQueryLogThresholdMs?: number, sqlApiEnabled?: boolean, sqlApiAllowedStatements?: string[], sqlApiMaxRows?: number, sqlApiMaxBytes?: number, sqlApiTimeoutSeconds?: number }; + let params: { databaseId: string, name?: string, status?: string, specification?: string, cpu?: number, memory?: number, storage?: number, storageClass?: string, replicas?: number, highAvailabilitySyncMode?: string, networkMaxConnections?: number, networkIdleTimeoutSeconds?: number, networkIPAllowlist?: string[], idleTimeoutMinutes?: number, backupEnabled?: boolean, backupPitr?: boolean, backupCron?: string, backupRetentionDays?: number, pitrRetentionDays?: number, storageAutoscaling?: boolean, storageAutoscalingThresholdPercent?: number, storageAutoscalingMaxGb?: number, poolerEnabled?: boolean, metricsEnabled?: boolean, metricsTraceSampleRate?: number, metricsSlowQueryLogThresholdMs?: number, sqlApiEnabled?: boolean, sqlApiAllowedStatements?: string[], sqlApiMaxRows?: number, sqlApiMaxBytes?: number, sqlApiTimeoutSeconds?: number }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, name?: string, status?: string, specification?: string, cpu?: number, memory?: number, storage?: number, storageClass?: string, highAvailability?: boolean, highAvailabilityReplicaCount?: number, highAvailabilitySyncMode?: string, networkMaxConnections?: number, networkIdleTimeoutSeconds?: number, networkIPAllowlist?: string[], idleTimeoutMinutes?: number, backupEnabled?: boolean, backupPitr?: boolean, backupCron?: string, backupRetentionDays?: number, pitrRetentionDays?: number, storageAutoscaling?: boolean, storageAutoscalingThresholdPercent?: number, storageAutoscalingMaxGb?: number, poolerEnabled?: boolean, metricsEnabled?: boolean, metricsTraceSampleRate?: number, metricsSlowQueryLogThresholdMs?: number, sqlApiEnabled?: boolean, sqlApiAllowedStatements?: string[], sqlApiMaxRows?: number, sqlApiMaxBytes?: number, sqlApiTimeoutSeconds?: number }; + params = (paramsOrFirst || {}) as { databaseId: string, name?: string, status?: string, specification?: string, cpu?: number, memory?: number, storage?: number, storageClass?: string, replicas?: number, highAvailabilitySyncMode?: string, networkMaxConnections?: number, networkIdleTimeoutSeconds?: number, networkIPAllowlist?: string[], idleTimeoutMinutes?: number, backupEnabled?: boolean, backupPitr?: boolean, backupCron?: string, backupRetentionDays?: number, pitrRetentionDays?: number, storageAutoscaling?: boolean, storageAutoscalingThresholdPercent?: number, storageAutoscalingMaxGb?: number, poolerEnabled?: boolean, metricsEnabled?: boolean, metricsTraceSampleRate?: number, metricsSlowQueryLogThresholdMs?: number, sqlApiEnabled?: boolean, sqlApiAllowedStatements?: string[], sqlApiMaxRows?: number, sqlApiMaxBytes?: number, sqlApiTimeoutSeconds?: number }; } else { params = { databaseId: paramsOrFirst as string, @@ -505,30 +493,29 @@ export class Compute { memory: rest[4] as number, storage: rest[5] as number, storageClass: rest[6] as string, - highAvailability: rest[7] as boolean, - highAvailabilityReplicaCount: rest[8] as number, - highAvailabilitySyncMode: rest[9] as string, - networkMaxConnections: rest[10] as number, - networkIdleTimeoutSeconds: rest[11] as number, - networkIPAllowlist: rest[12] as string[], - idleTimeoutMinutes: rest[13] as number, - backupEnabled: rest[14] as boolean, - backupPitr: rest[15] as boolean, - backupCron: rest[16] as string, - backupRetentionDays: rest[17] as number, - pitrRetentionDays: rest[18] as number, - storageAutoscaling: rest[19] as boolean, - storageAutoscalingThresholdPercent: rest[20] as number, - storageAutoscalingMaxGb: rest[21] as number, - poolerEnabled: rest[22] as boolean, - metricsEnabled: rest[23] as boolean, - metricsTraceSampleRate: rest[24] as number, - metricsSlowQueryLogThresholdMs: rest[25] as number, - sqlApiEnabled: rest[26] as boolean, - sqlApiAllowedStatements: rest[27] as string[], - sqlApiMaxRows: rest[28] as number, - sqlApiMaxBytes: rest[29] as number, - sqlApiTimeoutSeconds: rest[30] as number + replicas: rest[7] as number, + highAvailabilitySyncMode: rest[8] as string, + networkMaxConnections: rest[9] as number, + networkIdleTimeoutSeconds: rest[10] as number, + networkIPAllowlist: rest[11] as string[], + idleTimeoutMinutes: rest[12] as number, + backupEnabled: rest[13] as boolean, + backupPitr: rest[14] as boolean, + backupCron: rest[15] as string, + backupRetentionDays: rest[16] as number, + pitrRetentionDays: rest[17] as number, + storageAutoscaling: rest[18] as boolean, + storageAutoscalingThresholdPercent: rest[19] as number, + storageAutoscalingMaxGb: rest[20] as number, + poolerEnabled: rest[21] as boolean, + metricsEnabled: rest[22] as boolean, + metricsTraceSampleRate: rest[23] as number, + metricsSlowQueryLogThresholdMs: rest[24] as number, + sqlApiEnabled: rest[25] as boolean, + sqlApiAllowedStatements: rest[26] as string[], + sqlApiMaxRows: rest[27] as number, + sqlApiMaxBytes: rest[28] as number, + sqlApiTimeoutSeconds: rest[29] as number }; } @@ -540,8 +527,7 @@ export class Compute { const memory = params.memory; const storage = params.storage; const storageClass = params.storageClass; - const highAvailability = params.highAvailability; - const highAvailabilityReplicaCount = params.highAvailabilityReplicaCount; + const replicas = params.replicas; const highAvailabilitySyncMode = params.highAvailabilitySyncMode; const networkMaxConnections = params.networkMaxConnections; const networkIdleTimeoutSeconds = params.networkIdleTimeoutSeconds; @@ -592,11 +578,8 @@ export class Compute { if (typeof storageClass !== 'undefined') { payload['storageClass'] = storageClass; } - if (typeof highAvailability !== 'undefined') { - payload['highAvailability'] = highAvailability; - } - if (typeof highAvailabilityReplicaCount !== 'undefined') { - payload['highAvailabilityReplicaCount'] = highAvailabilityReplicaCount; + if (typeof replicas !== 'undefined') { + payload['replicas'] = replicas; } if (typeof highAvailabilitySyncMode !== 'undefined') { payload['highAvailabilitySyncMode'] = highAvailabilitySyncMode; @@ -669,6 +652,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -680,7 +664,7 @@ export class Compute { } /** - * Delete a dedicated database. This action is irreversible. The database status will be set to 'deleting' and all resources will be cleaned up. + * Delete a dedicated database. This action is irreversible. The database status will be set to 'deleting' and all resources will be cleaned up. Deletion is allowed from any state, and repeating the call re-dispatches the cleanup. * * @param {string} params.databaseId - Database ID. * @throws {AppwriteException} @@ -688,7 +672,7 @@ export class Compute { */ deleteDatabase(params: { databaseId: string }): Promise<{}>; /** - * Delete a dedicated database. This action is irreversible. The database status will be set to 'deleting' and all resources will be cleaned up. + * Delete a dedicated database. This action is irreversible. The database status will be set to 'deleting' and all resources will be cleaned up. Deletion is allowed from any state, and repeating the call re-dispatches the cleanup. * * @param {string} databaseId - Database ID. * @throws {AppwriteException} @@ -722,6 +706,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -782,6 +767,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -843,6 +829,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -854,7 +841,7 @@ export class Compute { } /** - * List scheduled backup policies for a dedicated database. + * List scheduled backup policies for a dedicated database. * * @param {string} params.databaseId - Database ID. * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. @@ -863,7 +850,7 @@ export class Compute { */ listDatabaseBackupPolicies(params: { databaseId: string, queries?: string[] }): Promise; /** - * List scheduled backup policies for a dedicated database. + * List scheduled backup policies for a dedicated database. * * @param {string} databaseId - Database ID. * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. @@ -903,6 +890,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -914,7 +902,7 @@ export class Compute { } /** - * Create a scheduled backup policy for a dedicated database. + * Create a scheduled backup policy for a dedicated database. * * @param {string} params.databaseId - Database ID. * @param {string} params.policyId - Policy ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -928,7 +916,7 @@ export class Compute { */ createDatabaseBackupPolicy(params: { databaseId: string, policyId: string, name: string, schedule: string, retention: number, type?: string, enabled?: boolean }): Promise; /** - * Create a scheduled backup policy for a dedicated database. + * Create a scheduled backup policy for a dedicated database. * * @param {string} databaseId - Database ID. * @param {string} policyId - Policy ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -1011,6 +999,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1126,6 +1115,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1186,6 +1176,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1247,6 +1238,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1299,6 +1291,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1367,6 +1360,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1428,6 +1422,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1480,6 +1475,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1551,6 +1547,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1612,6 +1609,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1664,6 +1662,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1717,6 +1716,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1795,6 +1795,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1866,6 +1867,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1918,6 +1920,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1982,6 +1985,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2043,6 +2047,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2095,6 +2100,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -2156,6 +2162,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2166,73 +2173,6 @@ export class Compute { ); } - /** - * Get query-level performance insights for a dedicated database. Returns top queries by execution time, wait events, and aggregate query statistics. - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.period - Analysis period for performance insights. Allowed values: 1h (last hour), 24h (last 24 hours), 7d (last 7 days). - * @param {number} params.limit - Maximum number of queries to return. - * @throws {AppwriteException} - * @returns {Promise} - */ - getDatabaseInsights(params: { databaseId: string, period?: string, limit?: number }): Promise; - /** - * Get query-level performance insights for a dedicated database. Returns top queries by execution time, wait events, and aggregate query statistics. - * - * @param {string} databaseId - Database ID. - * @param {string} period - Analysis period for performance insights. Allowed values: 1h (last hour), 24h (last 24 hours), 7d (last 7 days). - * @param {number} limit - Maximum number of queries to return. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getDatabaseInsights(databaseId: string, period?: string, limit?: number): Promise; - getDatabaseInsights( - paramsOrFirst: { databaseId: string, period?: string, limit?: number } | string, - ...rest: [(string)?, (number)?] - ): Promise { - let params: { databaseId: string, period?: string, limit?: number }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, period?: string, limit?: number }; - } else { - params = { - databaseId: paramsOrFirst as string, - period: rest[0] as string, - limit: rest[1] as number - }; - } - - const databaseId = params.databaseId; - const period = params.period; - const limit = params.limit; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - - const apiPath = '/compute/databases/{databaseId}/insights'.replace('{databaseId}', databaseId); - const payload: Payload = {}; - if (typeof period !== 'undefined') { - payload['period'] = period; - } - if (typeof limit !== 'undefined') { - payload['limit'] = limit; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'X-Appwrite-Project': this.client.config.project, - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload - ); - } - /** * Update the maintenance window for a dedicated database. Maintenance operations like minor version upgrades will be performed during this window. * @@ -2297,6 +2237,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2307,66 +2248,6 @@ export class Compute { ); } - /** - * Get detailed performance metrics for a dedicated database. Returns CPU, memory, storage, IOPS, QPS, and connection metrics. - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.period - Metrics aggregation period. Allowed values: 1h (last hour), 24h (last 24 hours), 7d (last 7 days), 30d (last 30 days). - * @throws {AppwriteException} - * @returns {Promise} - */ - getDatabaseMetrics(params: { databaseId: string, period?: string }): Promise; - /** - * Get detailed performance metrics for a dedicated database. Returns CPU, memory, storage, IOPS, QPS, and connection metrics. - * - * @param {string} databaseId - Database ID. - * @param {string} period - Metrics aggregation period. Allowed values: 1h (last hour), 24h (last 24 hours), 7d (last 7 days), 30d (last 30 days). - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getDatabaseMetrics(databaseId: string, period?: string): Promise; - getDatabaseMetrics( - paramsOrFirst: { databaseId: string, period?: string } | string, - ...rest: [(string)?] - ): Promise { - let params: { databaseId: string, period?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, period?: string }; - } else { - params = { - databaseId: paramsOrFirst as string, - period: rest[0] as string - }; - } - - const databaseId = params.databaseId; - const period = params.period; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - - const apiPath = '/compute/databases/{databaseId}/metrics'.replace('{databaseId}', databaseId); - const payload: Payload = {}; - if (typeof period !== 'undefined') { - payload['period'] = period; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'X-Appwrite-Project': this.client.config.project, - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload - ); - } - /** * Migrate a database between shared and dedicated types. Shared to dedicated provisions an always-on dedicated instance; dedicated to shared converts to a serverless instance that scales to zero when idle. Data is copied to the target with a brief read-only window during cutover. * @@ -2428,6 +2309,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2480,6 +2362,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -2532,6 +2415,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -2642,6 +2526,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2723,6 +2608,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -2798,6 +2684,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2858,6 +2745,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -2868,122 +2756,6 @@ export class Compute { ); } - /** - * Get the current schema for a dedicated database. Returns collections, fields, data types, constraints, and indexes. - * - * @param {string} params.databaseId - Database ID. - * @throws {AppwriteException} - * @returns {Promise} - */ - getDatabaseSchema(params: { databaseId: string }): Promise; - /** - * Get the current schema for a dedicated database. Returns collections, fields, data types, constraints, and indexes. - * - * @param {string} databaseId - Database ID. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getDatabaseSchema(databaseId: string): Promise; - getDatabaseSchema( - paramsOrFirst: { databaseId: string } | string - ): Promise { - let params: { databaseId: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string }; - } else { - params = { - databaseId: paramsOrFirst as string - }; - } - - const databaseId = params.databaseId; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - - const apiPath = '/compute/databases/{databaseId}/schema'.replace('{databaseId}', databaseId); - const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'X-Appwrite-Project': this.client.config.project, - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload - ); - } - - /** - * Preview a schema change against a dedicated database. Returns the expected impact including affected collections, records, and a dry-run diff of the schema before and after the change. - * - * @param {string} params.databaseId - Database ID. - * @param {string} params.sql - Schema statement to preview. - * @throws {AppwriteException} - * @returns {Promise} - */ - createDatabaseSchemaPreview(params: { databaseId: string, sql: string }): Promise; - /** - * Preview a schema change against a dedicated database. Returns the expected impact including affected collections, records, and a dry-run diff of the schema before and after the change. - * - * @param {string} databaseId - Database ID. - * @param {string} sql - Schema statement to preview. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - createDatabaseSchemaPreview(databaseId: string, sql: string): Promise; - createDatabaseSchemaPreview( - paramsOrFirst: { databaseId: string, sql: string } | string, - ...rest: [(string)?] - ): Promise { - let params: { databaseId: string, sql: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, sql: string }; - } else { - params = { - databaseId: paramsOrFirst as string, - sql: rest[0] as string - }; - } - - const databaseId = params.databaseId; - const sql = params.sql; - - if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); - } - if (typeof sql === 'undefined') { - throw new AppwriteException('Missing required parameter: "sql"'); - } - - const apiPath = '/compute/databases/{databaseId}/schema/preview'.replace('{databaseId}', databaseId); - const payload: Payload = {}; - if (typeof sql !== 'undefined') { - payload['sql'] = sql; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - } - - return this.client.call( - 'post', - uri, - apiHeaders, - payload - ); - } - /** * List slow queries for a dedicated database. Returns queries that exceeded the specified threshold. * @@ -3041,6 +2813,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -3093,6 +2866,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -3157,6 +2931,7 @@ export class Compute { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/console.ts b/src/services/console.ts index 816e7bfd..76a2a906 100644 --- a/src/services/console.ts +++ b/src/services/console.ts @@ -57,6 +57,7 @@ export class Console { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -109,6 +110,7 @@ export class Console { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -133,6 +135,7 @@ export class Console { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -185,6 +188,7 @@ export class Console { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -237,6 +241,7 @@ export class Console { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -289,6 +294,7 @@ export class Console { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -342,6 +348,7 @@ export class Console { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -366,6 +373,7 @@ export class Console { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -456,6 +464,7 @@ export class Console { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -480,6 +489,7 @@ export class Console { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -562,6 +572,7 @@ export class Console { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -649,6 +660,7 @@ export class Console { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -729,6 +741,7 @@ export class Console { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -811,6 +824,7 @@ export class Console { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -871,6 +885,7 @@ export class Console { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -895,6 +910,7 @@ export class Console { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/databases.ts b/src/services/databases.ts index f1edf163..6ccd399c 100644 --- a/src/services/databases.ts +++ b/src/services/databases.ts @@ -73,6 +73,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -150,6 +151,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -202,6 +204,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -255,6 +258,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -307,6 +311,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -375,6 +380,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -489,6 +495,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -542,6 +549,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -595,6 +603,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -664,6 +673,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -793,6 +803,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -903,6 +914,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -964,6 +976,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1061,6 +1074,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1198,6 +1212,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1310,6 +1325,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1422,6 +1438,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1520,6 +1537,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1616,6 +1634,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1712,6 +1731,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1808,6 +1828,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1906,6 +1927,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2004,6 +2026,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2112,6 +2135,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2220,6 +2244,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2332,6 +2357,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2444,6 +2470,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2556,6 +2583,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2668,6 +2696,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2766,6 +2795,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2864,6 +2894,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2881,12 +2912,12 @@ export class Databases { * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? - * @param {any[]} params.xdefault - Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required. + * @param {any[][]} params.xdefault - Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required. * @throws {AppwriteException} * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createLineColumn` instead. */ - createLineAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] }): Promise; + createLineAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][] }): Promise; /** * Create a geometric line attribute. * @@ -2894,27 +2925,27 @@ export class Databases { * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? - * @param {any[]} xdefault - Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required. + * @param {any[][]} xdefault - Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createLineAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[]): Promise; + createLineAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][]): Promise; createLineAttribute( - paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] } | string, - ...rest: [(string)?, (string)?, (boolean)?, (any[])?] + paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][] } | string, + ...rest: [(string)?, (string)?, (boolean)?, (any[][])?] ): Promise { - let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] }; + let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][] }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] }; + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][] }; } else { params = { databaseId: paramsOrFirst as string, collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as any[] + xdefault: rest[3] as any[][] }; } @@ -2953,6 +2984,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2970,13 +3002,13 @@ export class Databases { * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection). * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? - * @param {any[]} params.xdefault - Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required. + * @param {any[][]} params.xdefault - Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required. * @param {string} params.newKey - New attribute key. * @throws {AppwriteException} * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateLineColumn` instead. */ - updateLineAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }): Promise; + updateLineAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string }): Promise; /** * Update a line attribute. Changing the `default` value will not update already existing documents. * @@ -2984,28 +3016,28 @@ export class Databases { * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection). * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? - * @param {any[]} xdefault - Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required. + * @param {any[][]} xdefault - Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required. * @param {string} newKey - New attribute key. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateLineAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string): Promise; + updateLineAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string): Promise; updateLineAttribute( - paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string } | string, - ...rest: [(string)?, (string)?, (boolean)?, (any[])?, (string)?] + paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string } | string, + ...rest: [(string)?, (string)?, (boolean)?, (any[][])?, (string)?] ): Promise { - let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }; + let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }; + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string }; } else { params = { databaseId: paramsOrFirst as string, collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as any[], + xdefault: rest[3] as any[][], newKey: rest[4] as string }; } @@ -3046,6 +3078,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3150,6 +3183,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3247,6 +3281,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3351,6 +3386,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3448,6 +3484,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3465,12 +3502,12 @@ export class Databases { * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? - * @param {any[]} params.xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required. + * @param {number[]} params.xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required. * @throws {AppwriteException} * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createPointColumn` instead. */ - createPointAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] }): Promise; + createPointAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number[] }): Promise; /** * Create a geometric point attribute. * @@ -3478,27 +3515,27 @@ export class Databases { * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? - * @param {any[]} xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required. + * @param {number[]} xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createPointAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[]): Promise; + createPointAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number[]): Promise; createPointAttribute( - paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] } | string, - ...rest: [(string)?, (string)?, (boolean)?, (any[])?] + paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number[] } | string, + ...rest: [(string)?, (string)?, (boolean)?, (number[])?] ): Promise { - let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] }; + let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number[] }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] }; + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number[] }; } else { params = { databaseId: paramsOrFirst as string, collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as any[] + xdefault: rest[3] as number[] }; } @@ -3537,6 +3574,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3554,13 +3592,13 @@ export class Databases { * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection). * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? - * @param {any[]} params.xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required. + * @param {number[]} params.xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required. * @param {string} params.newKey - New attribute key. * @throws {AppwriteException} * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updatePointColumn` instead. */ - updatePointAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }): Promise; + updatePointAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number[], newKey?: string }): Promise; /** * Update a point attribute. Changing the `default` value will not update already existing documents. * @@ -3568,28 +3606,28 @@ export class Databases { * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection). * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? - * @param {any[]} xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required. + * @param {number[]} xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required. * @param {string} newKey - New attribute key. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updatePointAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string): Promise; + updatePointAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number[], newKey?: string): Promise; updatePointAttribute( - paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string } | string, - ...rest: [(string)?, (string)?, (boolean)?, (any[])?, (string)?] + paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number[], newKey?: string } | string, + ...rest: [(string)?, (string)?, (boolean)?, (number[])?, (string)?] ): Promise { - let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }; + let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number[], newKey?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }; + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number[], newKey?: string }; } else { params = { databaseId: paramsOrFirst as string, collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as any[], + xdefault: rest[3] as number[], newKey: rest[4] as string }; } @@ -3630,6 +3668,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3647,12 +3686,12 @@ export class Databases { * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? - * @param {any[]} params.xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required. + * @param {any[][]} params.xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required. * @throws {AppwriteException} * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createPolygonColumn` instead. */ - createPolygonAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] }): Promise; + createPolygonAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][] }): Promise; /** * Create a geometric polygon attribute. * @@ -3660,27 +3699,27 @@ export class Databases { * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? - * @param {any[]} xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required. + * @param {any[][]} xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createPolygonAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[]): Promise; + createPolygonAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][]): Promise; createPolygonAttribute( - paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] } | string, - ...rest: [(string)?, (string)?, (boolean)?, (any[])?] + paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][] } | string, + ...rest: [(string)?, (string)?, (boolean)?, (any[][])?] ): Promise { - let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] }; + let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][] }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] }; + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][] }; } else { params = { databaseId: paramsOrFirst as string, collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as any[] + xdefault: rest[3] as any[][] }; } @@ -3719,6 +3758,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3736,13 +3776,13 @@ export class Databases { * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection). * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? - * @param {any[]} params.xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required. + * @param {any[][]} params.xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required. * @param {string} params.newKey - New attribute key. * @throws {AppwriteException} * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updatePolygonColumn` instead. */ - updatePolygonAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }): Promise; + updatePolygonAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string }): Promise; /** * Update a polygon attribute. Changing the `default` value will not update already existing documents. * @@ -3750,28 +3790,28 @@ export class Databases { * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection). * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? - * @param {any[]} xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required. + * @param {any[][]} xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required. * @param {string} newKey - New attribute key. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updatePolygonAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string): Promise; + updatePolygonAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string): Promise; updatePolygonAttribute( - paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string } | string, - ...rest: [(string)?, (string)?, (boolean)?, (any[])?, (string)?] + paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string } | string, + ...rest: [(string)?, (string)?, (boolean)?, (any[][])?, (string)?] ): Promise { - let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }; + let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }; + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string }; } else { params = { databaseId: paramsOrFirst as string, collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as any[], + xdefault: rest[3] as any[][], newKey: rest[4] as string }; } @@ -3812,6 +3852,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3924,6 +3965,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4009,6 +4051,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4124,6 +4167,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4229,6 +4273,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4333,6 +4378,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4430,6 +4476,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4528,6 +4575,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4626,6 +4674,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4740,6 +4789,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4844,6 +4894,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4912,6 +4963,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -5070,6 +5122,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -5166,6 +5219,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5245,6 +5299,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5326,6 +5381,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5409,6 +5465,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5485,6 +5542,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5567,6 +5625,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -5657,6 +5716,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5747,6 +5807,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5898,6 +5959,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -5995,6 +6057,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -6092,6 +6155,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -6167,6 +6231,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -6275,6 +6340,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -6343,6 +6409,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -6480,6 +6547,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -6548,6 +6616,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -6609,6 +6678,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -6670,6 +6740,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/documents-db.ts b/src/services/documents-db.ts index 820987c4..da5d1587 100644 --- a/src/services/documents-db.ts +++ b/src/services/documents-db.ts @@ -63,6 +63,7 @@ export class DocumentsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -80,10 +81,11 @@ export class DocumentsDB { * @param {string} params.databaseId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {string} params.name - Database name. Max length: 128 chars. * @param {boolean} params.enabled - Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + * @param {string} params.dedicatedDatabaseId - Optional dedicated database (compute) ID to attach this database to. Leave empty to create a database on the shared pool. * @throws {AppwriteException} * @returns {Promise} */ - create(params: { databaseId: string, name: string, enabled?: boolean }): Promise; + create(params: { databaseId: string, name: string, enabled?: boolean, dedicatedDatabaseId?: string }): Promise; /** * Create a new Database. * @@ -91,30 +93,33 @@ export class DocumentsDB { * @param {string} databaseId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {string} name - Database name. Max length: 128 chars. * @param {boolean} enabled - Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + * @param {string} dedicatedDatabaseId - Optional dedicated database (compute) ID to attach this database to. Leave empty to create a database on the shared pool. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - create(databaseId: string, name: string, enabled?: boolean): Promise; + create(databaseId: string, name: string, enabled?: boolean, dedicatedDatabaseId?: string): Promise; create( - paramsOrFirst: { databaseId: string, name: string, enabled?: boolean } | string, - ...rest: [(string)?, (boolean)?] + paramsOrFirst: { databaseId: string, name: string, enabled?: boolean, dedicatedDatabaseId?: string } | string, + ...rest: [(string)?, (boolean)?, (string)?] ): Promise { - let params: { databaseId: string, name: string, enabled?: boolean }; + let params: { databaseId: string, name: string, enabled?: boolean, dedicatedDatabaseId?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, name: string, enabled?: boolean }; + params = (paramsOrFirst || {}) as { databaseId: string, name: string, enabled?: boolean, dedicatedDatabaseId?: string }; } else { params = { databaseId: paramsOrFirst as string, name: rest[0] as string, - enabled: rest[1] as boolean + enabled: rest[1] as boolean, + dedicatedDatabaseId: rest[2] as string }; } const databaseId = params.databaseId; const name = params.name; const enabled = params.enabled; + const dedicatedDatabaseId = params.dedicatedDatabaseId; if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); @@ -134,11 +139,15 @@ export class DocumentsDB { if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } + if (typeof dedicatedDatabaseId !== 'undefined') { + payload['dedicatedDatabaseId'] = dedicatedDatabaseId; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -191,6 +200,7 @@ export class DocumentsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -244,6 +254,7 @@ export class DocumentsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -296,6 +307,7 @@ export class DocumentsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -364,6 +376,7 @@ export class DocumentsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -469,6 +482,7 @@ export class DocumentsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -521,6 +535,7 @@ export class DocumentsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -592,6 +607,7 @@ export class DocumentsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -719,6 +735,7 @@ export class DocumentsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -828,6 +845,7 @@ export class DocumentsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -888,6 +906,7 @@ export class DocumentsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -987,6 +1006,7 @@ export class DocumentsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1136,6 +1156,7 @@ export class DocumentsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1224,6 +1245,7 @@ export class DocumentsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1295,6 +1317,7 @@ export class DocumentsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1375,6 +1398,7 @@ export class DocumentsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1457,6 +1481,7 @@ export class DocumentsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1532,6 +1557,7 @@ export class DocumentsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1613,6 +1639,7 @@ export class DocumentsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1702,6 +1729,7 @@ export class DocumentsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1791,6 +1819,7 @@ export class DocumentsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1962,6 +1991,7 @@ export class DocumentsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2058,6 +2088,7 @@ export class DocumentsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2132,6 +2163,7 @@ export class DocumentsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -2239,6 +2271,7 @@ export class DocumentsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2306,6 +2339,7 @@ export class DocumentsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -2441,6 +2475,7 @@ export class DocumentsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -2501,6 +2536,7 @@ export class DocumentsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/domains.ts b/src/services/domains.ts index a2eb3f32..2e256060 100644 --- a/src/services/domains.ts +++ b/src/services/domains.ts @@ -62,6 +62,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -129,6 +130,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -199,6 +201,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -354,6 +357,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -418,6 +422,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -509,6 +514,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -603,6 +609,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -667,6 +674,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -734,6 +742,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -786,6 +795,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -841,6 +851,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -905,6 +916,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -962,6 +974,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1014,6 +1027,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1069,6 +1083,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1121,6 +1136,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1176,6 +1192,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1228,6 +1245,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1283,6 +1301,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1335,6 +1354,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1390,6 +1410,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1442,6 +1463,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1497,6 +1519,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1549,6 +1572,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1604,6 +1628,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1666,6 +1691,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1759,6 +1785,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1861,6 +1888,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1954,6 +1982,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2056,6 +2085,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2151,6 +2181,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2257,6 +2288,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2350,6 +2382,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2452,6 +2485,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2551,6 +2585,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2649,6 +2684,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2742,6 +2778,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2844,6 +2881,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2951,6 +2989,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3059,6 +3098,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3152,6 +3192,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3256,6 +3297,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3381,6 +3423,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3535,6 +3578,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3627,6 +3671,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3731,6 +3776,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3799,6 +3845,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -3862,6 +3909,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3932,6 +3980,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3984,6 +4033,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -4038,6 +4088,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'text/plain', } return this.client.call( @@ -4104,6 +4155,7 @@ export class Domains { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/functions.ts b/src/services/functions.ts index d8c9d167..b72ddac1 100644 --- a/src/services/functions.ts +++ b/src/services/functions.ts @@ -75,6 +75,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -285,6 +286,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -309,6 +311,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -333,6 +336,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -414,6 +418,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -466,6 +471,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -518,6 +524,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -570,6 +577,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -774,6 +782,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -891,6 +900,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -965,6 +975,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1064,6 +1075,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'multipart/form-data', + 'accept': 'application/json', } return this.client.chunkedUpload( @@ -1136,6 +1148,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1251,6 +1264,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1336,6 +1350,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1396,6 +1411,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1524,9 +1540,11 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': '*/*', } payload['project'] = this.client.config.project; + payload['impersonateuserid'] = this.client.config.impersonateuserid; for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); @@ -1586,6 +1604,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1653,6 +1672,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1749,6 +1769,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1809,6 +1830,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1930,6 +1952,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1997,6 +2020,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -2088,6 +2112,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2148,6 +2173,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -2230,6 +2256,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/graphql.ts b/src/services/graphql.ts index 71f1fd5d..0823f622 100644 --- a/src/services/graphql.ts +++ b/src/services/graphql.ts @@ -57,6 +57,7 @@ export class Graphql { 'X-Appwrite-Project': this.client.config.project, 'x-sdk-graphql': 'true', 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -114,6 +115,7 @@ export class Graphql { 'X-Appwrite-Project': this.client.config.project, 'x-sdk-graphql': 'true', 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/health.ts b/src/services/health.ts index 4ba85533..cf2ae30c 100644 --- a/src/services/health.ts +++ b/src/services/health.ts @@ -25,6 +25,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -49,6 +50,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -74,6 +76,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -98,6 +101,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -150,6 +154,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -212,6 +217,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -236,6 +242,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -260,6 +267,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -314,6 +322,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -366,6 +375,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -418,6 +428,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -470,6 +481,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -522,6 +534,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -574,6 +587,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -634,6 +648,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -686,6 +701,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -748,6 +764,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -800,6 +817,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -852,6 +870,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -904,6 +923,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -956,6 +976,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1008,6 +1029,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1060,6 +1082,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1112,6 +1135,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1164,6 +1188,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1216,6 +1241,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1268,6 +1294,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1292,6 +1319,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1316,6 +1344,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1340,6 +1369,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/locale.ts b/src/services/locale.ts index 813bd8d2..41583e29 100644 --- a/src/services/locale.ts +++ b/src/services/locale.ts @@ -26,6 +26,7 @@ export class Locale { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -50,6 +51,7 @@ export class Locale { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -74,6 +76,7 @@ export class Locale { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -98,6 +101,7 @@ export class Locale { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -122,6 +126,7 @@ export class Locale { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -146,6 +151,7 @@ export class Locale { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -170,6 +176,7 @@ export class Locale { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -194,6 +201,7 @@ export class Locale { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/manager.ts b/src/services/manager.ts index a099bafb..c6c70ccc 100644 --- a/src/services/manager.ts +++ b/src/services/manager.ts @@ -91,6 +91,7 @@ export class Manager { const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -164,6 +165,7 @@ export class Manager { const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -215,6 +217,7 @@ export class Manager { const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { + 'accept': 'application/json', } return this.client.call( @@ -310,6 +313,7 @@ export class Manager { const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -387,6 +391,7 @@ export class Manager { const apiHeaders: { [header: string]: string } = { 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/messaging.ts b/src/services/messaging.ts index 33ba3687..b2a0a5cc 100644 --- a/src/services/messaging.ts +++ b/src/services/messaging.ts @@ -69,6 +69,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -209,6 +210,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -342,6 +344,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -525,6 +528,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -707,6 +711,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -810,6 +815,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -912,6 +918,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1011,6 +1018,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1109,6 +1117,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1163,6 +1172,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1283,6 +1293,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1350,6 +1361,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1417,6 +1429,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1527,6 +1540,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1636,6 +1650,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1740,6 +1755,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1843,6 +1859,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1925,6 +1942,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2006,6 +2024,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2082,6 +2101,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2157,6 +2177,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2280,6 +2301,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2397,6 +2419,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2492,6 +2515,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2581,6 +2605,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2690,6 +2715,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2793,6 +2819,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2902,6 +2929,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3005,6 +3033,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3128,6 +3157,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3245,6 +3275,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3400,6 +3431,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3554,6 +3586,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3700,6 +3733,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3845,6 +3879,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3940,6 +3975,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4029,6 +4065,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4124,6 +4161,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4213,6 +4251,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4308,6 +4347,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4397,6 +4437,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4492,6 +4533,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4581,6 +4623,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4635,6 +4678,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -4755,6 +4799,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -4822,6 +4867,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -4889,6 +4935,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -4963,6 +5010,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5017,6 +5065,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -5087,6 +5136,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5207,6 +5257,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -5281,6 +5332,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -5355,6 +5407,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5417,6 +5470,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/migrations.ts b/src/services/migrations.ts index 4b448733..298694fc 100644 --- a/src/services/migrations.ts +++ b/src/services/migrations.ts @@ -72,6 +72,7 @@ export class Migrations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -166,6 +167,7 @@ export class Migrations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -252,6 +254,7 @@ export class Migrations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -368,6 +371,7 @@ export class Migrations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -459,6 +463,7 @@ export class Migrations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -526,6 +531,7 @@ export class Migrations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -592,6 +598,7 @@ export class Migrations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -682,6 +689,7 @@ export class Migrations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -775,6 +783,7 @@ export class Migrations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -899,6 +908,7 @@ export class Migrations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1022,6 +1032,7 @@ export class Migrations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1136,6 +1147,7 @@ export class Migrations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1249,6 +1261,7 @@ export class Migrations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1301,6 +1314,7 @@ export class Migrations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1354,6 +1368,7 @@ export class Migrations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/organization.ts b/src/services/organization.ts index 34bc940c..786394be 100644 --- a/src/services/organization.ts +++ b/src/services/organization.ts @@ -62,6 +62,7 @@ export class Organization { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -146,6 +147,7 @@ export class Organization { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -198,6 +200,7 @@ export class Organization { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -279,6 +282,7 @@ export class Organization { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -399,6 +403,7 @@ export class Organization { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -473,6 +478,7 @@ export class Organization { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -589,6 +595,7 @@ export class Organization { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/organizations.ts b/src/services/organizations.ts index ba24d89c..a18306d3 100644 --- a/src/services/organizations.ts +++ b/src/services/organizations.ts @@ -62,6 +62,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -190,6 +191,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -275,6 +277,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -328,6 +331,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -382,6 +386,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -437,6 +442,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -499,6 +505,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -562,6 +569,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -625,6 +633,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -687,6 +696,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -747,6 +757,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -821,6 +832,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -885,6 +897,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -938,6 +951,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -998,6 +1012,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1062,6 +1077,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1133,6 +1149,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1195,6 +1212,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1259,6 +1277,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1311,6 +1330,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1371,6 +1391,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1424,6 +1445,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1502,6 +1524,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1598,6 +1621,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1658,6 +1682,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1718,6 +1743,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1734,23 +1760,23 @@ export class Organizations { * @param {string} params.organizationId - Organization ID * @param {string} params.invoiceId - Invoice unique ID * @throws {AppwriteException} - * @returns {Promise} + * @returns {string} */ - getInvoiceDownload(params: { organizationId: string, invoiceId: string }): Promise; + getInvoiceDownload(params: { organizationId: string, invoiceId: string }): string; /** * Download invoice in PDF * * @param {string} organizationId - Organization ID * @param {string} invoiceId - Invoice unique ID * @throws {AppwriteException} - * @returns {Promise} + * @returns {string} * @deprecated Use the object parameter style method for a better developer experience. */ - getInvoiceDownload(organizationId: string, invoiceId: string): Promise; + getInvoiceDownload(organizationId: string, invoiceId: string): string; getInvoiceDownload( paramsOrFirst: { organizationId: string, invoiceId: string } | string, ...rest: [(string)?] - ): Promise { + ): string { let params: { organizationId: string, invoiceId: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { @@ -1778,14 +1804,17 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } - return this.client.call( - 'get', - uri, - apiHeaders, - payload - ); + payload['project'] = this.client.config.project; + payload['impersonateuserid'] = this.client.config.impersonateuserid; + + for (const [key, value] of Object.entries(Service.flatten(payload))) { + uri.searchParams.append(key, value); + } + + return uri.toString(); } /** @@ -1849,6 +1878,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1910,6 +1940,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1926,23 +1957,23 @@ export class Organizations { * @param {string} params.organizationId - Organization ID * @param {string} params.invoiceId - Invoice unique ID * @throws {AppwriteException} - * @returns {Promise} + * @returns {string} */ - getInvoiceView(params: { organizationId: string, invoiceId: string }): Promise; + getInvoiceView(params: { organizationId: string, invoiceId: string }): string; /** * View invoice in PDF * * @param {string} organizationId - Organization ID * @param {string} invoiceId - Invoice unique ID * @throws {AppwriteException} - * @returns {Promise} + * @returns {string} * @deprecated Use the object parameter style method for a better developer experience. */ - getInvoiceView(organizationId: string, invoiceId: string): Promise; + getInvoiceView(organizationId: string, invoiceId: string): string; getInvoiceView( paramsOrFirst: { organizationId: string, invoiceId: string } | string, ...rest: [(string)?] - ): Promise { + ): string { let params: { organizationId: string, invoiceId: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { @@ -1970,14 +2001,17 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } - return this.client.call( - 'get', - uri, - apiHeaders, - payload - ); + payload['project'] = this.client.config.project; + payload['impersonateuserid'] = this.client.config.impersonateuserid; + + for (const [key, value] of Object.entries(Service.flatten(payload))) { + uri.searchParams.append(key, value); + } + + return uri.toString(); } /** @@ -2034,6 +2068,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2087,6 +2122,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2153,6 +2189,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2206,6 +2243,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2266,6 +2304,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -2318,6 +2357,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -2424,6 +2464,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2477,6 +2518,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2557,6 +2599,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2609,6 +2652,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -2669,6 +2713,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -2733,6 +2778,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2800,6 +2846,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -2861,6 +2908,7 @@ export class Organizations { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/presences.ts b/src/services/presences.ts index 0b2c35a0..13f81691 100644 --- a/src/services/presences.ts +++ b/src/services/presences.ts @@ -70,6 +70,7 @@ export class Presences { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -124,6 +125,7 @@ export class Presences { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -178,6 +180,7 @@ export class Presences { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -265,6 +268,7 @@ export class Presences { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -356,6 +360,7 @@ export class Presences { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/project.ts b/src/services/project.ts index 666e6cc7..418a1853 100644 --- a/src/services/project.ts +++ b/src/services/project.ts @@ -124,6 +124,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -184,6 +185,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -272,6 +274,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -343,6 +346,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -395,6 +399,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -476,6 +481,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -585,6 +591,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -645,6 +652,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -712,6 +720,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -764,6 +773,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -828,6 +838,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -941,6 +952,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -957,60 +969,80 @@ export class Project { * @param {boolean} params.enabled - Enable or disable the OAuth2 server. * @param {string} params.authorizationUrl - URL to your application with consent screen. * @param {string[]} params.scopes - List of allowed OAuth2 scopes. Maximum of 100 scopes are allowed, each up to 128 characters long. + * @param {string[]} params.authorizationDetailsTypes - List of accepted `authorization_details` types. Maximum of 100 types are allowed, each up to 128 characters long. * @param {number} params.accessTokenDuration - Access token duration in seconds for confidential clients (server-side apps that authenticate with a client secret). Leave empty to use default 8 hours. * @param {number} params.refreshTokenDuration - Refresh token duration in seconds for confidential clients (server-side apps that authenticate with a client secret). Leave empty to use default 1 year. * @param {number} params.publicAccessTokenDuration - Access token duration in seconds for public clients (SPAs, mobile, and native apps that cannot keep a client secret). Leave empty to use default 1 hour. * @param {number} params.publicRefreshTokenDuration - Refresh token duration in seconds for public clients (SPAs, mobile, and native apps that cannot keep a client secret). Leave empty to use default 30 days. * @param {boolean} params.confidentialPkce - When enabled, PKCE is required for confidential clients (server-side flows using client_secret). PKCE is always required for public clients regardless of this setting. + * @param {string} params.verificationUrl - URL to your application page where users enter the device flow user code. Required to enable the Device Authorization Grant. + * @param {number} params.userCodeLength - Number of characters in the device flow user code, excluding the formatting separator. Shorter codes are easier to type but weaker; pair short codes with short expiry. Leave empty to use default 8. + * @param {string} params.userCodeFormat - Character set for device flow user codes: `numeric` (digits only — best for numeric keypads and TV remotes), `alphabetic` (letters only), or `alphanumeric` (letters and digits — highest entropy per character). Defaults to `alphanumeric`. + * @param {number} params.deviceCodeDuration - Lifetime in seconds of device flow device codes and user codes. Device codes are intentionally short-lived. Leave empty to use default 600. * @throws {AppwriteException} * @returns {Promise} */ - updateOAuth2Server(params: { enabled: boolean, authorizationUrl: string, scopes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, confidentialPkce?: boolean }): Promise; + updateOAuth2Server(params: { enabled: boolean, authorizationUrl: string, scopes?: string[], authorizationDetailsTypes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, confidentialPkce?: boolean, verificationUrl?: string, userCodeLength?: number, userCodeFormat?: string, deviceCodeDuration?: number }): Promise; /** * Update the OAuth2 server (OIDC provider) configuration. * * @param {boolean} enabled - Enable or disable the OAuth2 server. * @param {string} authorizationUrl - URL to your application with consent screen. * @param {string[]} scopes - List of allowed OAuth2 scopes. Maximum of 100 scopes are allowed, each up to 128 characters long. + * @param {string[]} authorizationDetailsTypes - List of accepted `authorization_details` types. Maximum of 100 types are allowed, each up to 128 characters long. * @param {number} accessTokenDuration - Access token duration in seconds for confidential clients (server-side apps that authenticate with a client secret). Leave empty to use default 8 hours. * @param {number} refreshTokenDuration - Refresh token duration in seconds for confidential clients (server-side apps that authenticate with a client secret). Leave empty to use default 1 year. * @param {number} publicAccessTokenDuration - Access token duration in seconds for public clients (SPAs, mobile, and native apps that cannot keep a client secret). Leave empty to use default 1 hour. * @param {number} publicRefreshTokenDuration - Refresh token duration in seconds for public clients (SPAs, mobile, and native apps that cannot keep a client secret). Leave empty to use default 30 days. * @param {boolean} confidentialPkce - When enabled, PKCE is required for confidential clients (server-side flows using client_secret). PKCE is always required for public clients regardless of this setting. + * @param {string} verificationUrl - URL to your application page where users enter the device flow user code. Required to enable the Device Authorization Grant. + * @param {number} userCodeLength - Number of characters in the device flow user code, excluding the formatting separator. Shorter codes are easier to type but weaker; pair short codes with short expiry. Leave empty to use default 8. + * @param {string} userCodeFormat - Character set for device flow user codes: `numeric` (digits only — best for numeric keypads and TV remotes), `alphabetic` (letters only), or `alphanumeric` (letters and digits — highest entropy per character). Defaults to `alphanumeric`. + * @param {number} deviceCodeDuration - Lifetime in seconds of device flow device codes and user codes. Device codes are intentionally short-lived. Leave empty to use default 600. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateOAuth2Server(enabled: boolean, authorizationUrl: string, scopes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, confidentialPkce?: boolean): Promise; + updateOAuth2Server(enabled: boolean, authorizationUrl: string, scopes?: string[], authorizationDetailsTypes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, confidentialPkce?: boolean, verificationUrl?: string, userCodeLength?: number, userCodeFormat?: string, deviceCodeDuration?: number): Promise; updateOAuth2Server( - paramsOrFirst: { enabled: boolean, authorizationUrl: string, scopes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, confidentialPkce?: boolean } | boolean, - ...rest: [(string)?, (string[])?, (number)?, (number)?, (number)?, (number)?, (boolean)?] + paramsOrFirst: { enabled: boolean, authorizationUrl: string, scopes?: string[], authorizationDetailsTypes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, confidentialPkce?: boolean, verificationUrl?: string, userCodeLength?: number, userCodeFormat?: string, deviceCodeDuration?: number } | boolean, + ...rest: [(string)?, (string[])?, (string[])?, (number)?, (number)?, (number)?, (number)?, (boolean)?, (string)?, (number)?, (string)?, (number)?] ): Promise { - let params: { enabled: boolean, authorizationUrl: string, scopes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, confidentialPkce?: boolean }; + let params: { enabled: boolean, authorizationUrl: string, scopes?: string[], authorizationDetailsTypes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, confidentialPkce?: boolean, verificationUrl?: string, userCodeLength?: number, userCodeFormat?: string, deviceCodeDuration?: number }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { enabled: boolean, authorizationUrl: string, scopes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, confidentialPkce?: boolean }; + params = (paramsOrFirst || {}) as { enabled: boolean, authorizationUrl: string, scopes?: string[], authorizationDetailsTypes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, confidentialPkce?: boolean, verificationUrl?: string, userCodeLength?: number, userCodeFormat?: string, deviceCodeDuration?: number }; } else { params = { enabled: paramsOrFirst as boolean, authorizationUrl: rest[0] as string, scopes: rest[1] as string[], - accessTokenDuration: rest[2] as number, - refreshTokenDuration: rest[3] as number, - publicAccessTokenDuration: rest[4] as number, - publicRefreshTokenDuration: rest[5] as number, - confidentialPkce: rest[6] as boolean + authorizationDetailsTypes: rest[2] as string[], + accessTokenDuration: rest[3] as number, + refreshTokenDuration: rest[4] as number, + publicAccessTokenDuration: rest[5] as number, + publicRefreshTokenDuration: rest[6] as number, + confidentialPkce: rest[7] as boolean, + verificationUrl: rest[8] as string, + userCodeLength: rest[9] as number, + userCodeFormat: rest[10] as string, + deviceCodeDuration: rest[11] as number }; } const enabled = params.enabled; const authorizationUrl = params.authorizationUrl; const scopes = params.scopes; + const authorizationDetailsTypes = params.authorizationDetailsTypes; const accessTokenDuration = params.accessTokenDuration; const refreshTokenDuration = params.refreshTokenDuration; const publicAccessTokenDuration = params.publicAccessTokenDuration; const publicRefreshTokenDuration = params.publicRefreshTokenDuration; const confidentialPkce = params.confidentialPkce; + const verificationUrl = params.verificationUrl; + const userCodeLength = params.userCodeLength; + const userCodeFormat = params.userCodeFormat; + const deviceCodeDuration = params.deviceCodeDuration; if (typeof enabled === 'undefined') { throw new AppwriteException('Missing required parameter: "enabled"'); @@ -1030,6 +1062,9 @@ export class Project { if (typeof scopes !== 'undefined') { payload['scopes'] = scopes; } + if (typeof authorizationDetailsTypes !== 'undefined') { + payload['authorizationDetailsTypes'] = authorizationDetailsTypes; + } if (typeof accessTokenDuration !== 'undefined') { payload['accessTokenDuration'] = accessTokenDuration; } @@ -1045,11 +1080,24 @@ export class Project { if (typeof confidentialPkce !== 'undefined') { payload['confidentialPkce'] = confidentialPkce; } + if (typeof verificationUrl !== 'undefined') { + payload['verificationUrl'] = verificationUrl; + } + if (typeof userCodeLength !== 'undefined') { + payload['userCodeLength'] = userCodeLength; + } + if (typeof userCodeFormat !== 'undefined') { + payload['userCodeFormat'] = userCodeFormat; + } + if (typeof deviceCodeDuration !== 'undefined') { + payload['deviceCodeDuration'] = deviceCodeDuration; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1118,6 +1166,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1200,6 +1249,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1275,6 +1325,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1350,6 +1401,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1418,6 +1470,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1486,6 +1539,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1554,6 +1608,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1622,6 +1677,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1690,6 +1746,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1758,6 +1815,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1826,6 +1884,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1894,6 +1953,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1962,6 +2022,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2030,6 +2091,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2098,6 +2160,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2173,6 +2236,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2241,6 +2305,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2316,6 +2381,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2391,6 +2457,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2473,6 +2540,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2541,6 +2609,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2609,6 +2678,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2684,6 +2754,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2752,6 +2823,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2848,6 +2920,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2930,6 +3003,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2998,6 +3072,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3066,6 +3141,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3134,6 +3210,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3202,6 +3279,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3270,6 +3348,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3338,6 +3417,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3406,6 +3486,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3474,6 +3555,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3542,6 +3624,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3610,6 +3693,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3678,6 +3762,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3746,6 +3831,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3814,6 +3900,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3882,6 +3969,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3950,6 +4038,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4018,6 +4107,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4070,6 +4160,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -4130,6 +4221,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -4207,6 +4299,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4281,6 +4374,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4358,6 +4452,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4432,6 +4527,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4509,6 +4605,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4583,6 +4680,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4660,6 +4758,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4734,6 +4833,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4811,6 +4911,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4885,6 +4986,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4937,6 +5039,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -5050,6 +5153,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -5106,6 +5210,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5162,6 +5267,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5218,6 +5324,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5236,10 +5343,11 @@ export class Project { * @param {boolean} params.userPhone - Set to true if you want make user phone number visible to all team members, or false to hide it. * @param {boolean} params.userName - Set to true if you want make user name visible to all team members, or false to hide it. * @param {boolean} params.userMFA - Set to true if you want make user MFA status visible to all team members, or false to hide it. + * @param {boolean} params.userAccessedAt - Set to true if you want make user last access time visible to all team members, or false to hide it. * @throws {AppwriteException} * @returns {Promise} */ - updateMembershipPrivacyPolicy(params?: { userId?: boolean, userEmail?: boolean, userPhone?: boolean, userName?: boolean, userMFA?: boolean }): Promise; + updateMembershipPrivacyPolicy(params?: { userId?: boolean, userEmail?: boolean, userPhone?: boolean, userName?: boolean, userMFA?: boolean, userAccessedAt?: boolean }): Promise; /** * Updating this policy allows you to control if team members can see other members information. When enabled, all team members can see ID, name, email, phone number, and MFA status of other members.. * @@ -5248,26 +5356,28 @@ export class Project { * @param {boolean} userPhone - Set to true if you want make user phone number visible to all team members, or false to hide it. * @param {boolean} userName - Set to true if you want make user name visible to all team members, or false to hide it. * @param {boolean} userMFA - Set to true if you want make user MFA status visible to all team members, or false to hide it. + * @param {boolean} userAccessedAt - Set to true if you want make user last access time visible to all team members, or false to hide it. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateMembershipPrivacyPolicy(userId?: boolean, userEmail?: boolean, userPhone?: boolean, userName?: boolean, userMFA?: boolean): Promise; + updateMembershipPrivacyPolicy(userId?: boolean, userEmail?: boolean, userPhone?: boolean, userName?: boolean, userMFA?: boolean, userAccessedAt?: boolean): Promise; updateMembershipPrivacyPolicy( - paramsOrFirst?: { userId?: boolean, userEmail?: boolean, userPhone?: boolean, userName?: boolean, userMFA?: boolean } | boolean, - ...rest: [(boolean)?, (boolean)?, (boolean)?, (boolean)?] + paramsOrFirst?: { userId?: boolean, userEmail?: boolean, userPhone?: boolean, userName?: boolean, userMFA?: boolean, userAccessedAt?: boolean } | boolean, + ...rest: [(boolean)?, (boolean)?, (boolean)?, (boolean)?, (boolean)?] ): Promise { - let params: { userId?: boolean, userEmail?: boolean, userPhone?: boolean, userName?: boolean, userMFA?: boolean }; + let params: { userId?: boolean, userEmail?: boolean, userPhone?: boolean, userName?: boolean, userMFA?: boolean, userAccessedAt?: boolean }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { userId?: boolean, userEmail?: boolean, userPhone?: boolean, userName?: boolean, userMFA?: boolean }; + params = (paramsOrFirst || {}) as { userId?: boolean, userEmail?: boolean, userPhone?: boolean, userName?: boolean, userMFA?: boolean, userAccessedAt?: boolean }; } else { params = { userId: paramsOrFirst as boolean, userEmail: rest[0] as boolean, userPhone: rest[1] as boolean, userName: rest[2] as boolean, - userMFA: rest[3] as boolean + userMFA: rest[3] as boolean, + userAccessedAt: rest[4] as boolean }; } @@ -5276,6 +5386,7 @@ export class Project { const userPhone = params.userPhone; const userName = params.userName; const userMFA = params.userMFA; + const userAccessedAt = params.userAccessedAt; const apiPath = '/project/policies/membership-privacy'; @@ -5295,11 +5406,15 @@ export class Project { if (typeof userMFA !== 'undefined') { payload['userMFA'] = userMFA; } + if (typeof userAccessedAt !== 'undefined') { + payload['userAccessedAt'] = userAccessedAt; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5356,6 +5471,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5416,6 +5532,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5472,6 +5589,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5554,6 +5672,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5610,6 +5729,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5666,6 +5786,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5722,6 +5843,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5778,6 +5900,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5834,6 +5957,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5886,6 +6010,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -5950,6 +6075,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -6014,6 +6140,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -6131,6 +6258,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -6247,6 +6375,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -6353,6 +6482,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -6413,6 +6543,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -6486,6 +6617,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -6546,6 +6678,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -6630,6 +6763,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -6682,6 +6816,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -6757,6 +6892,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/projects.ts b/src/services/projects.ts index c8e0a52c..77f3066c 100644 --- a/src/services/projects.ts +++ b/src/services/projects.ts @@ -57,6 +57,7 @@ export class Projects { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -117,6 +118,7 @@ export class Projects { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -191,6 +193,7 @@ export class Projects { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -251,6 +254,7 @@ export class Projects { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -332,6 +336,7 @@ export class Projects { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -460,6 +465,7 @@ export class Projects { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -558,6 +564,7 @@ export class Projects { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -618,6 +625,7 @@ export class Projects { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -684,6 +692,7 @@ export class Projects { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -748,6 +757,7 @@ export class Projects { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/proxy.ts b/src/services/proxy.ts index 080c6605..7925479a 100644 --- a/src/services/proxy.ts +++ b/src/services/proxy.ts @@ -62,6 +62,7 @@ export class Proxy { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -122,6 +123,7 @@ export class Proxy { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -200,6 +202,7 @@ export class Proxy { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -301,6 +304,7 @@ export class Proxy { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -379,6 +383,7 @@ export class Proxy { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -431,6 +436,7 @@ export class Proxy { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -537,6 +543,7 @@ export class Proxy { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/sites.ts b/src/services/sites.ts index f5af6ff5..2a72c51e 100644 --- a/src/services/sites.ts +++ b/src/services/sites.ts @@ -75,6 +75,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -295,6 +296,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -319,6 +321,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -343,6 +346,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -417,6 +421,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -469,6 +474,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -521,6 +527,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -573,6 +580,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -787,6 +795,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -904,6 +913,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -978,6 +988,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1073,6 +1084,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'multipart/form-data', + 'accept': 'application/json', } return this.client.chunkedUpload( @@ -1138,6 +1150,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1253,6 +1266,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1338,6 +1352,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1398,6 +1413,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1526,9 +1542,11 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': '*/*', } payload['project'] = this.client.config.project; + payload['impersonateuserid'] = this.client.config.impersonateuserid; for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); @@ -1588,6 +1606,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1655,6 +1674,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1715,6 +1735,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1776,6 +1797,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1836,6 +1858,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1903,6 +1926,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1994,6 +2018,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2054,6 +2079,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -2136,6 +2162,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/storage.ts b/src/services/storage.ts index 58266754..63e06012 100644 --- a/src/services/storage.ts +++ b/src/services/storage.ts @@ -71,6 +71,7 @@ export class Storage { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -201,6 +202,7 @@ export class Storage { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -253,6 +255,7 @@ export class Storage { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -380,6 +383,7 @@ export class Storage { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -507,6 +511,7 @@ export class Storage { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -605,6 +610,7 @@ export class Storage { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'multipart/form-data', + 'accept': 'application/json', } return this.client.chunkedUpload( @@ -666,6 +672,7 @@ export class Storage { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -741,6 +748,7 @@ export class Storage { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -869,9 +877,11 @@ export class Storage { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': '*/*', } payload['project'] = this.client.config.project; + payload['impersonateuserid'] = this.client.config.impersonateuserid; for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); @@ -1014,9 +1024,11 @@ export class Storage { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'image/*', } payload['project'] = this.client.config.project; + payload['impersonateuserid'] = this.client.config.impersonateuserid; for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); @@ -1082,9 +1094,11 @@ export class Storage { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': '*/*', } payload['project'] = this.client.config.project; + payload['impersonateuserid'] = this.client.config.impersonateuserid; for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); @@ -1137,6 +1151,7 @@ export class Storage { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1199,6 +1214,7 @@ export class Storage { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/tables-db.ts b/src/services/tables-db.ts index 486b5da5..b2c5f821 100644 --- a/src/services/tables-db.ts +++ b/src/services/tables-db.ts @@ -72,6 +72,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -89,10 +90,11 @@ export class TablesDB { * @param {string} params.databaseId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {string} params.name - Database name. Max length: 128 chars. * @param {boolean} params.enabled - Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + * @param {string} params.dedicatedDatabaseId - Optional dedicated database (compute) ID to attach this database to. Leave empty to create a database on the shared pool. * @throws {AppwriteException} * @returns {Promise} */ - create(params: { databaseId: string, name: string, enabled?: boolean }): Promise; + create(params: { databaseId: string, name: string, enabled?: boolean, dedicatedDatabaseId?: string }): Promise; /** * Create a new Database. * @@ -100,30 +102,33 @@ export class TablesDB { * @param {string} databaseId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {string} name - Database name. Max length: 128 chars. * @param {boolean} enabled - Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + * @param {string} dedicatedDatabaseId - Optional dedicated database (compute) ID to attach this database to. Leave empty to create a database on the shared pool. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - create(databaseId: string, name: string, enabled?: boolean): Promise; + create(databaseId: string, name: string, enabled?: boolean, dedicatedDatabaseId?: string): Promise; create( - paramsOrFirst: { databaseId: string, name: string, enabled?: boolean } | string, - ...rest: [(string)?, (boolean)?] + paramsOrFirst: { databaseId: string, name: string, enabled?: boolean, dedicatedDatabaseId?: string } | string, + ...rest: [(string)?, (boolean)?, (string)?] ): Promise { - let params: { databaseId: string, name: string, enabled?: boolean }; + let params: { databaseId: string, name: string, enabled?: boolean, dedicatedDatabaseId?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, name: string, enabled?: boolean }; + params = (paramsOrFirst || {}) as { databaseId: string, name: string, enabled?: boolean, dedicatedDatabaseId?: string }; } else { params = { databaseId: paramsOrFirst as string, name: rest[0] as string, - enabled: rest[1] as boolean + enabled: rest[1] as boolean, + dedicatedDatabaseId: rest[2] as string }; } const databaseId = params.databaseId; const name = params.name; const enabled = params.enabled; + const dedicatedDatabaseId = params.dedicatedDatabaseId; if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); @@ -143,11 +148,15 @@ export class TablesDB { if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } + if (typeof dedicatedDatabaseId !== 'undefined') { + payload['dedicatedDatabaseId'] = dedicatedDatabaseId; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -200,6 +209,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -253,6 +263,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -305,6 +316,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -373,6 +385,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -487,6 +500,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -539,6 +553,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -591,6 +606,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -659,6 +675,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -786,6 +803,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -895,6 +913,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -955,6 +974,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1051,6 +1071,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1186,6 +1207,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1297,6 +1319,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1408,6 +1431,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1505,6 +1529,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1600,6 +1625,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1695,6 +1721,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1790,6 +1817,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1887,6 +1915,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1984,6 +2013,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2089,6 +2119,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2196,6 +2227,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2307,6 +2339,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2418,6 +2451,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2529,6 +2563,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2640,6 +2675,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2737,6 +2773,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2834,6 +2871,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2851,11 +2889,11 @@ export class TablesDB { * @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? - * @param {any[]} params.xdefault - Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required. + * @param {any[][]} params.xdefault - Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required. * @throws {AppwriteException} * @returns {Promise} */ - createLineColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[] }): Promise; + createLineColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][] }): Promise; /** * Create a geometric line column. * @@ -2863,27 +2901,27 @@ export class TablesDB { * @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} key - Column Key. * @param {boolean} required - Is column required? - * @param {any[]} xdefault - Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required. + * @param {any[][]} xdefault - Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createLineColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[]): Promise; + createLineColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][]): Promise; createLineColumn( - paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[] } | string, - ...rest: [(string)?, (string)?, (boolean)?, (any[])?] + paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][] } | string, + ...rest: [(string)?, (string)?, (boolean)?, (any[][])?] ): Promise { - let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[] }; + let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][] }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[] }; + params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][] }; } else { params = { databaseId: paramsOrFirst as string, tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as any[] + xdefault: rest[3] as any[][] }; } @@ -2922,6 +2960,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2939,12 +2978,12 @@ export class TablesDB { * @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? - * @param {any[]} params.xdefault - Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required. + * @param {any[][]} params.xdefault - Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required. * @param {string} params.newKey - New Column Key. * @throws {AppwriteException} * @returns {Promise} */ - updateLineColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }): Promise; + updateLineColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string }): Promise; /** * Update a line column. Changing the `default` value will not update already existing rows. * @@ -2952,28 +2991,28 @@ export class TablesDB { * @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} key - Column Key. * @param {boolean} required - Is column required? - * @param {any[]} xdefault - Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required. + * @param {any[][]} xdefault - Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required. * @param {string} newKey - New Column Key. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateLineColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[], newKey?: string): Promise; + updateLineColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string): Promise; updateLineColumn( - paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[], newKey?: string } | string, - ...rest: [(string)?, (string)?, (boolean)?, (any[])?, (string)?] + paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string } | string, + ...rest: [(string)?, (string)?, (boolean)?, (any[][])?, (string)?] ): Promise { - let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }; + let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }; + params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string }; } else { params = { databaseId: paramsOrFirst as string, tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as any[], + xdefault: rest[3] as any[][], newKey: rest[4] as string }; } @@ -3014,6 +3053,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3118,6 +3158,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3215,6 +3256,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3319,6 +3361,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3416,6 +3459,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3433,11 +3477,11 @@ export class TablesDB { * @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? - * @param {any[]} params.xdefault - Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required. + * @param {number[]} params.xdefault - Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required. * @throws {AppwriteException} * @returns {Promise} */ - createPointColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[] }): Promise; + createPointColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number[] }): Promise; /** * Create a geometric point column. * @@ -3445,27 +3489,27 @@ export class TablesDB { * @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} key - Column Key. * @param {boolean} required - Is column required? - * @param {any[]} xdefault - Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required. + * @param {number[]} xdefault - Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createPointColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[]): Promise; + createPointColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number[]): Promise; createPointColumn( - paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[] } | string, - ...rest: [(string)?, (string)?, (boolean)?, (any[])?] + paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number[] } | string, + ...rest: [(string)?, (string)?, (boolean)?, (number[])?] ): Promise { - let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[] }; + let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number[] }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[] }; + params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number[] }; } else { params = { databaseId: paramsOrFirst as string, tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as any[] + xdefault: rest[3] as number[] }; } @@ -3504,6 +3548,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3521,12 +3566,12 @@ export class TablesDB { * @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? - * @param {any[]} params.xdefault - Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required. + * @param {number[]} params.xdefault - Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required. * @param {string} params.newKey - New Column Key. * @throws {AppwriteException} * @returns {Promise} */ - updatePointColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }): Promise; + updatePointColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number[], newKey?: string }): Promise; /** * Update a point column. Changing the `default` value will not update already existing rows. * @@ -3534,28 +3579,28 @@ export class TablesDB { * @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} key - Column Key. * @param {boolean} required - Is column required? - * @param {any[]} xdefault - Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required. + * @param {number[]} xdefault - Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required. * @param {string} newKey - New Column Key. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updatePointColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[], newKey?: string): Promise; + updatePointColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number[], newKey?: string): Promise; updatePointColumn( - paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[], newKey?: string } | string, - ...rest: [(string)?, (string)?, (boolean)?, (any[])?, (string)?] + paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number[], newKey?: string } | string, + ...rest: [(string)?, (string)?, (boolean)?, (number[])?, (string)?] ): Promise { - let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }; + let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number[], newKey?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }; + params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number[], newKey?: string }; } else { params = { databaseId: paramsOrFirst as string, tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as any[], + xdefault: rest[3] as number[], newKey: rest[4] as string }; } @@ -3596,6 +3641,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3613,11 +3659,11 @@ export class TablesDB { * @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? - * @param {any[]} params.xdefault - Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required. + * @param {any[][]} params.xdefault - Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required. * @throws {AppwriteException} * @returns {Promise} */ - createPolygonColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[] }): Promise; + createPolygonColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][] }): Promise; /** * Create a geometric polygon column. * @@ -3625,27 +3671,27 @@ export class TablesDB { * @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} key - Column Key. * @param {boolean} required - Is column required? - * @param {any[]} xdefault - Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required. + * @param {any[][]} xdefault - Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createPolygonColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[]): Promise; + createPolygonColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][]): Promise; createPolygonColumn( - paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[] } | string, - ...rest: [(string)?, (string)?, (boolean)?, (any[])?] + paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][] } | string, + ...rest: [(string)?, (string)?, (boolean)?, (any[][])?] ): Promise { - let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[] }; + let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][] }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[] }; + params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][] }; } else { params = { databaseId: paramsOrFirst as string, tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as any[] + xdefault: rest[3] as any[][] }; } @@ -3684,6 +3730,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3701,12 +3748,12 @@ export class TablesDB { * @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? - * @param {any[]} params.xdefault - Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required. + * @param {any[][]} params.xdefault - Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required. * @param {string} params.newKey - New Column Key. * @throws {AppwriteException} * @returns {Promise} */ - updatePolygonColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }): Promise; + updatePolygonColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string }): Promise; /** * Update a polygon column. Changing the `default` value will not update already existing rows. * @@ -3714,28 +3761,28 @@ export class TablesDB { * @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} key - Column Key. * @param {boolean} required - Is column required? - * @param {any[]} xdefault - Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required. + * @param {any[][]} xdefault - Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required. * @param {string} newKey - New Column Key. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updatePolygonColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[], newKey?: string): Promise; + updatePolygonColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string): Promise; updatePolygonColumn( - paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[], newKey?: string } | string, - ...rest: [(string)?, (string)?, (boolean)?, (any[])?, (string)?] + paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string } | string, + ...rest: [(string)?, (string)?, (boolean)?, (any[][])?, (string)?] ): Promise { - let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }; + let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }; + params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string }; } else { params = { databaseId: paramsOrFirst as string, tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as any[], + xdefault: rest[3] as any[][], newKey: rest[4] as string }; } @@ -3776,6 +3823,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3887,6 +3935,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4002,6 +4051,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4107,6 +4157,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4211,6 +4262,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4308,6 +4360,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4405,6 +4458,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4502,6 +4556,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4616,6 +4671,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4720,6 +4776,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4787,6 +4844,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -4939,6 +4997,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5013,6 +5072,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -5120,6 +5180,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5187,6 +5248,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -5322,6 +5384,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -5410,6 +5473,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -5505,6 +5569,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5583,6 +5648,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5663,6 +5729,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5745,6 +5812,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5820,6 +5888,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5901,6 +5970,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -5990,6 +6060,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -6079,6 +6150,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -6228,6 +6300,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -6324,6 +6397,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -6420,6 +6494,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -6487,6 +6562,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -6547,6 +6623,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/teams.ts b/src/services/teams.ts index 11e3b4db..23a7cf20 100644 --- a/src/services/teams.ts +++ b/src/services/teams.ts @@ -67,6 +67,7 @@ export class Teams { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -141,6 +142,7 @@ export class Teams { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -193,6 +195,7 @@ export class Teams { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -257,6 +260,7 @@ export class Teams { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -377,6 +381,7 @@ export class Teams { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -451,6 +456,7 @@ export class Teams { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -564,6 +570,7 @@ export class Teams { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -624,6 +631,7 @@ export class Teams { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -697,6 +705,7 @@ export class Teams { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -845,6 +854,7 @@ export class Teams { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -897,6 +907,7 @@ export class Teams { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -961,6 +972,7 @@ export class Teams { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/tokens.ts b/src/services/tokens.ts index 36cd10f7..274d4207 100644 --- a/src/services/tokens.ts +++ b/src/services/tokens.ts @@ -74,6 +74,7 @@ export class Tokens { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -142,6 +143,7 @@ export class Tokens { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -194,6 +196,7 @@ export class Tokens { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -255,6 +258,7 @@ export class Tokens { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/usage.ts b/src/services/usage.ts index f503bf41..fbebe9b0 100644 --- a/src/services/usage.ts +++ b/src/services/usage.ts @@ -60,6 +60,7 @@ export class Usage { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -120,6 +121,7 @@ export class Usage { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/users.ts b/src/services/users.ts index b5621600..ef402d50 100644 --- a/src/services/users.ts +++ b/src/services/users.ts @@ -71,6 +71,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -156,6 +157,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -240,6 +242,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -324,6 +327,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -391,6 +395,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -528,6 +533,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -612,6 +618,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -746,6 +753,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -860,6 +868,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -951,6 +960,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1005,6 +1015,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1057,6 +1068,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1174,6 +1186,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1240,6 +1253,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1308,6 +1322,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1376,6 +1391,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1443,6 +1459,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1517,6 +1534,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1582,6 +1600,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1646,6 +1665,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1822,6 +1842,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1874,6 +1895,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1927,6 +1949,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1979,6 +2002,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -2033,6 +2057,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2086,6 +2111,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2140,6 +2166,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2193,6 +2220,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2257,6 +2285,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2321,6 +2350,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2385,6 +2415,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2437,6 +2468,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -2501,6 +2533,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2561,6 +2594,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -2618,6 +2652,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2796,6 +2831,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2863,6 +2899,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -2961,6 +2998,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3021,6 +3059,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -3103,6 +3142,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3234,6 +3274,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3298,6 +3339,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3362,6 +3404,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/vcs.ts b/src/services/vcs.ts index 35d6b77c..2322264b 100644 --- a/src/services/vcs.ts +++ b/src/services/vcs.ts @@ -82,6 +82,7 @@ export class Vcs { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -159,6 +160,7 @@ export class Vcs { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -233,6 +235,7 @@ export class Vcs { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -293,6 +296,7 @@ export class Vcs { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -369,6 +373,7 @@ export class Vcs { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -443,6 +448,7 @@ export class Vcs { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -514,6 +520,7 @@ export class Vcs { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -583,6 +590,7 @@ export class Vcs { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -635,6 +643,7 @@ export class Vcs { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/vectors-db.ts b/src/services/vectors-db.ts index e3fd854e..5d07c92e 100644 --- a/src/services/vectors-db.ts +++ b/src/services/vectors-db.ts @@ -64,6 +64,7 @@ export class VectorsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -81,10 +82,11 @@ export class VectorsDB { * @param {string} params.databaseId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {string} params.name - Database name. Max length: 128 chars. * @param {boolean} params.enabled - Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + * @param {string} params.dedicatedDatabaseId - Optional dedicated database (compute) ID to attach this database to. Leave empty to create a database on the shared pool. * @throws {AppwriteException} * @returns {Promise} */ - create(params: { databaseId: string, name: string, enabled?: boolean }): Promise; + create(params: { databaseId: string, name: string, enabled?: boolean, dedicatedDatabaseId?: string }): Promise; /** * Create a new Database. * @@ -92,30 +94,33 @@ export class VectorsDB { * @param {string} databaseId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {string} name - Database name. Max length: 128 chars. * @param {boolean} enabled - Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + * @param {string} dedicatedDatabaseId - Optional dedicated database (compute) ID to attach this database to. Leave empty to create a database on the shared pool. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - create(databaseId: string, name: string, enabled?: boolean): Promise; + create(databaseId: string, name: string, enabled?: boolean, dedicatedDatabaseId?: string): Promise; create( - paramsOrFirst: { databaseId: string, name: string, enabled?: boolean } | string, - ...rest: [(string)?, (boolean)?] + paramsOrFirst: { databaseId: string, name: string, enabled?: boolean, dedicatedDatabaseId?: string } | string, + ...rest: [(string)?, (boolean)?, (string)?] ): Promise { - let params: { databaseId: string, name: string, enabled?: boolean }; + let params: { databaseId: string, name: string, enabled?: boolean, dedicatedDatabaseId?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, name: string, enabled?: boolean }; + params = (paramsOrFirst || {}) as { databaseId: string, name: string, enabled?: boolean, dedicatedDatabaseId?: string }; } else { params = { databaseId: paramsOrFirst as string, name: rest[0] as string, - enabled: rest[1] as boolean + enabled: rest[1] as boolean, + dedicatedDatabaseId: rest[2] as string }; } const databaseId = params.databaseId; const name = params.name; const enabled = params.enabled; + const dedicatedDatabaseId = params.dedicatedDatabaseId; if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); @@ -135,11 +140,15 @@ export class VectorsDB { if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } + if (typeof dedicatedDatabaseId !== 'undefined') { + payload['dedicatedDatabaseId'] = dedicatedDatabaseId; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -204,6 +213,7 @@ export class VectorsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -256,6 +266,7 @@ export class VectorsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -309,6 +320,7 @@ export class VectorsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -361,6 +373,7 @@ export class VectorsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -429,6 +442,7 @@ export class VectorsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -543,6 +557,7 @@ export class VectorsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -595,6 +610,7 @@ export class VectorsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -647,6 +663,7 @@ export class VectorsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -718,6 +735,7 @@ export class VectorsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -845,6 +863,7 @@ export class VectorsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -950,6 +969,7 @@ export class VectorsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1010,6 +1030,7 @@ export class VectorsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1109,6 +1130,7 @@ export class VectorsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1258,6 +1280,7 @@ export class VectorsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1346,6 +1369,7 @@ export class VectorsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1417,6 +1441,7 @@ export class VectorsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1497,6 +1522,7 @@ export class VectorsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1579,6 +1605,7 @@ export class VectorsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1654,6 +1681,7 @@ export class VectorsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1735,6 +1763,7 @@ export class VectorsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1824,6 +1853,7 @@ export class VectorsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1913,6 +1943,7 @@ export class VectorsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2062,6 +2093,7 @@ export class VectorsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -2169,6 +2201,7 @@ export class VectorsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2236,6 +2269,7 @@ export class VectorsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -2371,6 +2405,7 @@ export class VectorsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -2431,6 +2466,7 @@ export class VectorsDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/webhooks.ts b/src/services/webhooks.ts index 25b186b9..9d42e267 100644 --- a/src/services/webhooks.ts +++ b/src/services/webhooks.ts @@ -60,6 +60,7 @@ export class Webhooks { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -182,6 +183,7 @@ export class Webhooks { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -234,6 +236,7 @@ export class Webhooks { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -346,6 +349,7 @@ export class Webhooks { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -460,6 +464,7 @@ export class Webhooks { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call(