diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 93199514..e6ea266e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -19,11 +19,11 @@ jobs: - name: Use Node.js uses: actions/setup-node@v4 with: - node-version: '22' + node-version: '24.14.1' registry-url: 'https://registry.npmjs.org' - - name: Update npm to latest version for OIDC support - run: npm install -g npm@latest + - name: Pin npm for trusted publishing + run: npm install -g npm@11.10.0 - name: Determine release tag id: release_tag diff --git a/CHANGELOG.md b/CHANGELOG.md index d2e46bcd..d30e04e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Change Log +## 24.0.0 + +* [BREAKING] Renamed Webhook model fields: `security` → `tls`, `httpUser` → `authUsername`, `httpPass` → `authPassword`, `signatureKey` → `secret` +* [BREAKING] Renamed Webhook service parameters to match: `security` → `tls`, `httpUser` → `authUsername`, `httpPass` → `authPassword` +* Added `secret` parameter to Webhook create and update methods +* Added `x` OAuth provider to `OAuthProvider` enum +* Added `userType` field to `Log` model +* Added `purge` parameter to `updateCollection` and `updateTable` for cache invalidation +* Added Project service: platform CRUD, key CRUD, protocol/service status management +* Added new models: `Key`, `KeyList`, `PlatformAndroid`, `PlatformApple`, `PlatformLinux`, `PlatformList`, and others +* Added new enums: `PlatformType`, `ProtocolId`, `ServiceId` +* Updated `BuildRuntime`, `Runtime`, `Scopes` enums with new values +* Updated `X-Appwrite-Response-Format` header to `1.9.1` +* Updated TTL description for list caching in Databases and TablesDB + ## 23.1.0 * Added: Added `getHeaders()` method to `Client` to expose current request headers diff --git a/README.md b/README.md index 08afc79c..d959a06b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Appwrite Node.js SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-node.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.9.0-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.9.1-blue.svg?style=flat-square) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) diff --git a/docs/examples/databases/create-datetime-attribute.md b/docs/examples/databases/create-datetime-attribute.md index 328bf685..1bd69d11 100644 --- a/docs/examples/databases/create-datetime-attribute.md +++ b/docs/examples/databases/create-datetime-attribute.md @@ -13,7 +13,7 @@ const result = await databases.createDatetimeAttribute({ collectionId: '', key: '', required: false, - default: '', // optional + default: '2020-10-15T06:38:00.000+00:00', // optional array: false // optional }); ``` diff --git a/docs/examples/databases/update-collection.md b/docs/examples/databases/update-collection.md index bd2e7dd0..f7f65c32 100644 --- a/docs/examples/databases/update-collection.md +++ b/docs/examples/databases/update-collection.md @@ -14,6 +14,7 @@ const result = await databases.updateCollection({ name: '', // optional permissions: [sdk.Permission.read(sdk.Role.any())], // optional documentSecurity: false, // optional - enabled: false // optional + enabled: false, // optional + purge: false // optional }); ``` diff --git a/docs/examples/databases/update-datetime-attribute.md b/docs/examples/databases/update-datetime-attribute.md index 5a4fe633..dfbb6005 100644 --- a/docs/examples/databases/update-datetime-attribute.md +++ b/docs/examples/databases/update-datetime-attribute.md @@ -13,7 +13,7 @@ const result = await databases.updateDatetimeAttribute({ collectionId: '', key: '', required: false, - default: '', + default: '2020-10-15T06:38:00.000+00:00', newKey: '' // optional }); ``` diff --git a/docs/examples/messaging/create-email.md b/docs/examples/messaging/create-email.md index f12d0d5e..1662aae1 100644 --- a/docs/examples/messaging/create-email.md +++ b/docs/examples/messaging/create-email.md @@ -20,6 +20,6 @@ const result = await messaging.createEmail({ attachments: [], // optional draft: false, // optional html: false, // optional - scheduledAt: '' // optional + scheduledAt: '2020-10-15T06:38:00.000+00:00' // optional }); ``` diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md index 032a2082..467cde4a 100644 --- a/docs/examples/messaging/create-push.md +++ b/docs/examples/messaging/create-push.md @@ -24,7 +24,7 @@ const result = await messaging.createPush({ tag: '', // optional badge: null, // optional draft: false, // optional - scheduledAt: '', // optional + scheduledAt: '2020-10-15T06:38:00.000+00:00', // optional contentAvailable: false, // optional critical: false, // optional priority: sdk.MessagePriority.Normal // optional diff --git a/docs/examples/messaging/create-sms.md b/docs/examples/messaging/create-sms.md index 2cee66cc..31d75c00 100644 --- a/docs/examples/messaging/create-sms.md +++ b/docs/examples/messaging/create-sms.md @@ -15,6 +15,6 @@ const result = await messaging.createSMS({ users: [], // optional targets: [], // optional draft: false, // optional - scheduledAt: '' // optional + scheduledAt: '2020-10-15T06:38:00.000+00:00' // optional }); ``` diff --git a/docs/examples/messaging/update-email.md b/docs/examples/messaging/update-email.md index a761b7f9..f4e27865 100644 --- a/docs/examples/messaging/update-email.md +++ b/docs/examples/messaging/update-email.md @@ -19,7 +19,7 @@ const result = await messaging.updateEmail({ html: false, // optional cc: [], // optional bcc: [], // optional - scheduledAt: '', // optional + scheduledAt: '2020-10-15T06:38:00.000+00:00', // optional attachments: [] // optional }); ``` diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md index b77e10ae..f0e5e324 100644 --- a/docs/examples/messaging/update-push.md +++ b/docs/examples/messaging/update-push.md @@ -24,7 +24,7 @@ const result = await messaging.updatePush({ tag: '', // optional badge: null, // optional draft: false, // optional - scheduledAt: '', // optional + scheduledAt: '2020-10-15T06:38:00.000+00:00', // optional contentAvailable: false, // optional critical: false, // optional priority: sdk.MessagePriority.Normal // optional diff --git a/docs/examples/messaging/update-sms.md b/docs/examples/messaging/update-sms.md index b4bd058a..074cab2e 100644 --- a/docs/examples/messaging/update-sms.md +++ b/docs/examples/messaging/update-sms.md @@ -15,6 +15,6 @@ const result = await messaging.updateSMS({ targets: [], // optional content: '', // optional draft: false, // optional - scheduledAt: '' // optional + scheduledAt: '2020-10-15T06:38:00.000+00:00' // optional }); ``` diff --git a/docs/examples/project/create-android-platform.md b/docs/examples/project/create-android-platform.md new file mode 100644 index 00000000..09a9f337 --- /dev/null +++ b/docs/examples/project/create-android-platform.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.createAndroidPlatform({ + platformId: '', + name: '', + applicationId: '' +}); +``` diff --git a/docs/examples/project/create-apple-platform.md b/docs/examples/project/create-apple-platform.md new file mode 100644 index 00000000..6ffe87b7 --- /dev/null +++ b/docs/examples/project/create-apple-platform.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.createApplePlatform({ + platformId: '', + name: '', + bundleIdentifier: '' +}); +``` diff --git a/docs/examples/project/create-key.md b/docs/examples/project/create-key.md new file mode 100644 index 00000000..b5274bfc --- /dev/null +++ b/docs/examples/project/create-key.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.createKey({ + keyId: '', + name: '', + scopes: [sdk.Scopes.SessionsWrite], + expire: '2020-10-15T06:38:00.000+00:00' // optional +}); +``` diff --git a/docs/examples/project/create-linux-platform.md b/docs/examples/project/create-linux-platform.md new file mode 100644 index 00000000..aa51173c --- /dev/null +++ b/docs/examples/project/create-linux-platform.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.createLinuxPlatform({ + platformId: '', + name: '', + packageName: '' +}); +``` diff --git a/docs/examples/project/create-web-platform.md b/docs/examples/project/create-web-platform.md new file mode 100644 index 00000000..84e36ce1 --- /dev/null +++ b/docs/examples/project/create-web-platform.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.createWebPlatform({ + platformId: '', + name: '', + hostname: 'app.example.com' +}); +``` diff --git a/docs/examples/project/create-windows-platform.md b/docs/examples/project/create-windows-platform.md new file mode 100644 index 00000000..369f0349 --- /dev/null +++ b/docs/examples/project/create-windows-platform.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.createWindowsPlatform({ + platformId: '', + name: '', + packageIdentifierName: '' +}); +``` diff --git a/docs/examples/project/delete-key.md b/docs/examples/project/delete-key.md new file mode 100644 index 00000000..bbe19c2a --- /dev/null +++ b/docs/examples/project/delete-key.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.deleteKey({ + keyId: '' +}); +``` diff --git a/docs/examples/project/delete-platform.md b/docs/examples/project/delete-platform.md new file mode 100644 index 00000000..cb734805 --- /dev/null +++ b/docs/examples/project/delete-platform.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.deletePlatform({ + platformId: '' +}); +``` diff --git a/docs/examples/project/get-key.md b/docs/examples/project/get-key.md new file mode 100644 index 00000000..81b7e2f1 --- /dev/null +++ b/docs/examples/project/get-key.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.getKey({ + keyId: '' +}); +``` diff --git a/docs/examples/project/get-platform.md b/docs/examples/project/get-platform.md new file mode 100644 index 00000000..4f450e4b --- /dev/null +++ b/docs/examples/project/get-platform.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.getPlatform({ + platformId: '' +}); +``` diff --git a/docs/examples/project/list-keys.md b/docs/examples/project/list-keys.md new file mode 100644 index 00000000..e9266822 --- /dev/null +++ b/docs/examples/project/list-keys.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.listKeys({ + queries: [], // optional + total: false // optional +}); +``` diff --git a/docs/examples/project/list-platforms.md b/docs/examples/project/list-platforms.md new file mode 100644 index 00000000..c180b9d7 --- /dev/null +++ b/docs/examples/project/list-platforms.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.listPlatforms({ + queries: [], // optional + total: false // optional +}); +``` diff --git a/docs/examples/project/update-android-platform.md b/docs/examples/project/update-android-platform.md new file mode 100644 index 00000000..8164b0d0 --- /dev/null +++ b/docs/examples/project/update-android-platform.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateAndroidPlatform({ + platformId: '', + name: '', + applicationId: '' +}); +``` diff --git a/docs/examples/project/update-apple-platform.md b/docs/examples/project/update-apple-platform.md new file mode 100644 index 00000000..93abb676 --- /dev/null +++ b/docs/examples/project/update-apple-platform.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateApplePlatform({ + platformId: '', + name: '', + bundleIdentifier: '' +}); +``` diff --git a/docs/examples/project/update-key.md b/docs/examples/project/update-key.md new file mode 100644 index 00000000..ad191f88 --- /dev/null +++ b/docs/examples/project/update-key.md @@ -0,0 +1,17 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateKey({ + keyId: '', + name: '', + scopes: [sdk.Scopes.SessionsWrite], + expire: '2020-10-15T06:38:00.000+00:00' // optional +}); +``` diff --git a/docs/examples/project/update-labels.md b/docs/examples/project/update-labels.md new file mode 100644 index 00000000..f924ec09 --- /dev/null +++ b/docs/examples/project/update-labels.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateLabels({ + labels: [] +}); +``` diff --git a/docs/examples/project/update-linux-platform.md b/docs/examples/project/update-linux-platform.md new file mode 100644 index 00000000..cb483d60 --- /dev/null +++ b/docs/examples/project/update-linux-platform.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateLinuxPlatform({ + platformId: '', + name: '', + packageName: '' +}); +``` diff --git a/docs/examples/project/update-protocol-status.md b/docs/examples/project/update-protocol-status.md new file mode 100644 index 00000000..b3da4bf3 --- /dev/null +++ b/docs/examples/project/update-protocol-status.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateProtocolStatus({ + protocolId: sdk.ProtocolId.Rest, + enabled: false +}); +``` diff --git a/docs/examples/project/update-service-status.md b/docs/examples/project/update-service-status.md new file mode 100644 index 00000000..fe9514b4 --- /dev/null +++ b/docs/examples/project/update-service-status.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateServiceStatus({ + serviceId: sdk.ServiceId.Account, + enabled: false +}); +``` diff --git a/docs/examples/project/update-web-platform.md b/docs/examples/project/update-web-platform.md new file mode 100644 index 00000000..9c4f9bd1 --- /dev/null +++ b/docs/examples/project/update-web-platform.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateWebPlatform({ + platformId: '', + name: '', + hostname: 'app.example.com' +}); +``` diff --git a/docs/examples/project/update-windows-platform.md b/docs/examples/project/update-windows-platform.md new file mode 100644 index 00000000..3fd19d7d --- /dev/null +++ b/docs/examples/project/update-windows-platform.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const project = new sdk.Project(client); + +const result = await project.updateWindowsPlatform({ + platformId: '', + name: '', + packageIdentifierName: '' +}); +``` diff --git a/docs/examples/tablesdb/create-datetime-column.md b/docs/examples/tablesdb/create-datetime-column.md index 4aedd362..6836b15e 100644 --- a/docs/examples/tablesdb/create-datetime-column.md +++ b/docs/examples/tablesdb/create-datetime-column.md @@ -13,7 +13,7 @@ const result = await tablesDB.createDatetimeColumn({ tableId: '', key: '', required: false, - default: '', // optional + default: '2020-10-15T06:38:00.000+00:00', // optional array: false // optional }); ``` diff --git a/docs/examples/tablesdb/update-datetime-column.md b/docs/examples/tablesdb/update-datetime-column.md index f1fb75e8..24628932 100644 --- a/docs/examples/tablesdb/update-datetime-column.md +++ b/docs/examples/tablesdb/update-datetime-column.md @@ -13,7 +13,7 @@ const result = await tablesDB.updateDatetimeColumn({ tableId: '', key: '', required: false, - default: '', + default: '2020-10-15T06:38:00.000+00:00', newKey: '' // optional }); ``` diff --git a/docs/examples/tablesdb/update-table.md b/docs/examples/tablesdb/update-table.md index f698a398..6aa65c2e 100644 --- a/docs/examples/tablesdb/update-table.md +++ b/docs/examples/tablesdb/update-table.md @@ -14,6 +14,7 @@ const result = await tablesDB.updateTable({ name: '', // optional permissions: [sdk.Permission.read(sdk.Role.any())], // optional rowSecurity: false, // optional - enabled: false // optional + enabled: false, // optional + purge: false // optional }); ``` diff --git a/docs/examples/tokens/create-file-token.md b/docs/examples/tokens/create-file-token.md index 3be6b549..bfb5d8d0 100644 --- a/docs/examples/tokens/create-file-token.md +++ b/docs/examples/tokens/create-file-token.md @@ -11,6 +11,6 @@ const tokens = new sdk.Tokens(client); const result = await tokens.createFileToken({ bucketId: '', fileId: '', - expire: '' // optional + expire: '2020-10-15T06:38:00.000+00:00' // optional }); ``` diff --git a/docs/examples/tokens/update.md b/docs/examples/tokens/update.md index c36998dd..0ab3b168 100644 --- a/docs/examples/tokens/update.md +++ b/docs/examples/tokens/update.md @@ -10,6 +10,6 @@ const tokens = new sdk.Tokens(client); const result = await tokens.update({ tokenId: '', - expire: '' // optional + expire: '2020-10-15T06:38:00.000+00:00' // optional }); ``` diff --git a/docs/examples/webhooks/create.md b/docs/examples/webhooks/create.md index 5641306f..c8603872 100644 --- a/docs/examples/webhooks/create.md +++ b/docs/examples/webhooks/create.md @@ -14,8 +14,9 @@ const result = await webhooks.create({ name: '', events: [], enabled: false, // optional - security: false, // optional - httpUser: '', // optional - httpPass: '' // optional + tls: false, // optional + authUsername: '', // optional + authPassword: '', // optional + secret: '' // optional }); ``` diff --git a/docs/examples/webhooks/update-signature.md b/docs/examples/webhooks/update-secret.md similarity index 74% rename from docs/examples/webhooks/update-signature.md rename to docs/examples/webhooks/update-secret.md index 6257ba58..7c0e504c 100644 --- a/docs/examples/webhooks/update-signature.md +++ b/docs/examples/webhooks/update-secret.md @@ -8,7 +8,8 @@ const client = new sdk.Client() const webhooks = new sdk.Webhooks(client); -const result = await webhooks.updateSignature({ - webhookId: '' +const result = await webhooks.updateSecret({ + webhookId: '', + secret: '' // optional }); ``` diff --git a/docs/examples/webhooks/update.md b/docs/examples/webhooks/update.md index acd6c9a3..6596e900 100644 --- a/docs/examples/webhooks/update.md +++ b/docs/examples/webhooks/update.md @@ -14,8 +14,8 @@ const result = await webhooks.update({ url: '', events: [], enabled: false, // optional - security: false, // optional - httpUser: '', // optional - httpPass: '' // optional + tls: false, // optional + authUsername: '', // optional + authPassword: '' // optional }); ``` diff --git a/package-lock.json b/package-lock.json index ec33f9ed..848f3d9c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,12 @@ { "name": "node-appwrite", - "version": "23.1.0", + "version": "24.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "node-appwrite", - "version": "23.1.0", - "license": "BSD-3-Clause", + "version": "24.0.0", "dependencies": { "json-bigint": "1.0.0", "node-fetch-native-with-agent": "1.7.2" @@ -18,9 +17,10 @@ "esbuild-plugin-file-path-extensions": "^2.0.0", "jest": "^29.7.0", "tslib": "2.6.2", - "tsup": "7.2.0", + "tsup": "^8.5.1", "typescript": "5.4.2" - } + }, + "license": "BSD-3-Clause" }, "node_modules/@babel/code-frame": { "version": "7.29.0", @@ -518,10 +518,27 @@ "dev": true, "license": "MIT" }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.7.tgz", + "integrity": "sha512-EKX3Qwmhz1eMdEJokhALr0YiD0lhQNwDqkPYyPhiSwKrh7/4KRjQc04sZ8db+5DVVnZ1LmbNDI1uAMPEUBnQPg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, "node_modules/@esbuild/android-arm": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz", - "integrity": "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.7.tgz", + "integrity": "sha512-jbPXvB4Yj2yBV7HUfE2KHe4GJX51QplCN1pGbYjvsyCZbQmies29EoJbkEc+vYuU5o45AfQn37vZlyXy4YJ8RQ==", "cpu": [ "arm" ], @@ -532,13 +549,13 @@ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz", - "integrity": "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.7.tgz", + "integrity": "sha512-62dPZHpIXzvChfvfLJow3q5dDtiNMkwiRzPylSCfriLvZeq0a1bWChrGx/BbUbPwOrsWKMn8idSllklzBy+dgQ==", "cpu": [ "arm64" ], @@ -549,13 +566,13 @@ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.20.tgz", - "integrity": "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.7.tgz", + "integrity": "sha512-x5VpMODneVDb70PYV2VQOmIUUiBtY3D3mPBG8NxVk5CogneYhkR7MmM3yR/uMdITLrC1ml/NV1rj4bMJuy9MCg==", "cpu": [ "x64" ], @@ -566,13 +583,13 @@ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz", - "integrity": "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.7.tgz", + "integrity": "sha512-5lckdqeuBPlKUwvoCXIgI2D9/ABmPq3Rdp7IfL70393YgaASt7tbju3Ac+ePVi3KDH6N2RqePfHnXkaDtY9fkw==", "cpu": [ "arm64" ], @@ -583,13 +600,13 @@ "darwin" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz", - "integrity": "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.7.tgz", + "integrity": "sha512-rYnXrKcXuT7Z+WL5K980jVFdvVKhCHhUwid+dDYQpH+qu+TefcomiMAJpIiC2EM3Rjtq0sO3StMV/+3w3MyyqQ==", "cpu": [ "x64" ], @@ -600,13 +617,13 @@ "darwin" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz", - "integrity": "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.7.tgz", + "integrity": "sha512-B48PqeCsEgOtzME2GbNM2roU29AMTuOIN91dsMO30t+Ydis3z/3Ngoj5hhnsOSSwNzS+6JppqWsuhTp6E82l2w==", "cpu": [ "arm64" ], @@ -617,13 +634,13 @@ "freebsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz", - "integrity": "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.7.tgz", + "integrity": "sha512-jOBDK5XEjA4m5IJK3bpAQF9/Lelu/Z9ZcdhTRLf4cajlB+8VEhFFRjWgfy3M1O4rO2GQ/b2dLwCUGpiF/eATNQ==", "cpu": [ "x64" ], @@ -634,13 +651,13 @@ "freebsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-arm": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz", - "integrity": "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.7.tgz", + "integrity": "sha512-RkT/YXYBTSULo3+af8Ib0ykH8u2MBh57o7q/DAs3lTJlyVQkgQvlrPTnjIzzRPQyavxtPtfg0EopvDyIt0j1rA==", "cpu": [ "arm" ], @@ -651,13 +668,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz", - "integrity": "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.7.tgz", + "integrity": "sha512-RZPHBoxXuNnPQO9rvjh5jdkRmVizktkT7TCDkDmQ0W2SwHInKCAV95GRuvdSvA7w4VMwfCjUiPwDi0ZO6Nfe9A==", "cpu": [ "arm64" ], @@ -668,13 +685,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz", - "integrity": "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.7.tgz", + "integrity": "sha512-GA48aKNkyQDbd3KtkplYWT102C5sn/EZTY4XROkxONgruHPU72l+gW+FfF8tf2cFjeHaRbWpOYa/uRBz/Xq1Pg==", "cpu": [ "ia32" ], @@ -685,13 +702,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz", - "integrity": "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.7.tgz", + "integrity": "sha512-a4POruNM2oWsD4WKvBSEKGIiWQF8fZOAsycHOt6JBpZ+JN2n2JH9WAv56SOyu9X5IqAjqSIPTaJkqN8F7XOQ5Q==", "cpu": [ "loong64" ], @@ -702,13 +719,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz", - "integrity": "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.7.tgz", + "integrity": "sha512-KabT5I6StirGfIz0FMgl1I+R1H73Gp0ofL9A3nG3i/cYFJzKHhouBV5VWK1CSgKvVaG4q1RNpCTR2LuTVB3fIw==", "cpu": [ "mips64el" ], @@ -719,13 +736,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz", - "integrity": "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.7.tgz", + "integrity": "sha512-gRsL4x6wsGHGRqhtI+ifpN/vpOFTQtnbsupUF5R5YTAg+y/lKelYR1hXbnBdzDjGbMYjVJLJTd2OFmMewAgwlQ==", "cpu": [ "ppc64" ], @@ -736,13 +753,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz", - "integrity": "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.7.tgz", + "integrity": "sha512-hL25LbxO1QOngGzu2U5xeXtxXcW+/GvMN3ejANqXkxZ/opySAZMrc+9LY/WyjAan41unrR3YrmtTsUpwT66InQ==", "cpu": [ "riscv64" ], @@ -753,13 +770,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz", - "integrity": "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.7.tgz", + "integrity": "sha512-2k8go8Ycu1Kb46vEelhu1vqEP+UeRVj2zY1pSuPdgvbd5ykAw82Lrro28vXUrRmzEsUV0NzCf54yARIK8r0fdw==", "cpu": [ "s390x" ], @@ -770,13 +787,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz", - "integrity": "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.7.tgz", + "integrity": "sha512-hzznmADPt+OmsYzw1EE33ccA+HPdIqiCRq7cQeL1Jlq2gb1+OyWBkMCrYGBJ+sxVzve2ZJEVeePbLM2iEIZSxA==", "cpu": [ "x64" ], @@ -787,13 +804,30 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.7.tgz", + "integrity": "sha512-b6pqtrQdigZBwZxAn1UpazEisvwaIDvdbMbmrly7cDTMFnw/+3lVxxCTGOrkPVnsYIosJJXAsILG9XcQS+Yu6w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz", - "integrity": "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.7.tgz", + "integrity": "sha512-OfatkLojr6U+WN5EDYuoQhtM+1xco+/6FSzJJnuWiUw5eVcicbyK3dq5EeV/QHT1uy6GoDhGbFpprUiHUYggrw==", "cpu": [ "x64" ], @@ -804,13 +838,30 @@ "netbsd" ], "engines": { - "node": ">=12" + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.7.tgz", + "integrity": "sha512-AFuojMQTxAz75Fo8idVcqoQWEHIXFRbOc1TrVcFSgCZtQfSdc1RXgB3tjOn/krRHENUB4j00bfGjyl2mJrU37A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz", - "integrity": "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.7.tgz", + "integrity": "sha512-+A1NJmfM8WNDv5CLVQYJ5PshuRm/4cI6WMZRg1by1GwPIQPCTs1GLEUHwiiQGT5zDdyLiRM/l1G0Pv54gvtKIg==", "cpu": [ "x64" ], @@ -821,13 +872,30 @@ "openbsd" ], "engines": { - "node": ">=12" + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.7.tgz", + "integrity": "sha512-+KrvYb/C8zA9CU/g0sR6w2RBw7IGc5J2BPnc3dYc5VJxHCSF1yNMxTV5LQ7GuKteQXZtspjFbiuW5/dOj7H4Yw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz", - "integrity": "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.7.tgz", + "integrity": "sha512-ikktIhFBzQNt/QDyOL580ti9+5mL/YZeUPKU2ivGtGjdTYoqz6jObj6nOMfhASpS4GU4Q/Clh1QtxWAvcYKamA==", "cpu": [ "x64" ], @@ -838,13 +906,13 @@ "sunos" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz", - "integrity": "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.7.tgz", + "integrity": "sha512-7yRhbHvPqSpRUV7Q20VuDwbjW5kIMwTHpptuUzV+AA46kiPze5Z7qgt6CLCK3pWFrHeNfDd1VKgyP4O+ng17CA==", "cpu": [ "arm64" ], @@ -855,13 +923,13 @@ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz", - "integrity": "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.7.tgz", + "integrity": "sha512-SmwKXe6VHIyZYbBLJrhOoCJRB/Z1tckzmgTLfFYOfpMAx63BJEaL9ExI8x7v0oAO3Zh6D/Oi1gVxEYr5oUCFhw==", "cpu": [ "ia32" ], @@ -872,13 +940,13 @@ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz", - "integrity": "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.7.tgz", + "integrity": "sha512-56hiAJPhwQ1R4i+21FVF7V8kSD5zZTdHcVuRFMW0hn753vVfQN8xlx4uOPT4xoGH0Z/oVATuR82AiqSTDIpaHg==", "cpu": [ "x64" ], @@ -889,7 +957,7 @@ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@istanbuljs/load-nyc-config": { @@ -1261,43 +1329,394 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.60.1.tgz", + "integrity": "sha512-d6FinEBLdIiK+1uACUttJKfgZREXrF0Qc2SmLII7W2AD8FfiZ9Wjd+rD/iRuf5s5dWrr1GgwXCvPqOuDquOowA==", + "cpu": [ + "arm" + ], "dev": true, "license": "MIT", - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } + "optional": true, + "os": [ + "android" + ] }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.60.1.tgz", + "integrity": "sha512-YjG/EwIDvvYI1YvYbHvDz/BYHtkY4ygUIXHnTdLhG+hKIQFBiosfWiACWortsKPKU/+dUwQQCKQM3qrDe8c9BA==", + "cpu": [ + "arm64" + ], "dev": true, "license": "MIT", - "engines": { - "node": ">= 8" - } + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.60.1.tgz", + "integrity": "sha512-mjCpF7GmkRtSJwon+Rq1N8+pI+8l7w5g9Z3vWj4T7abguC4Czwi3Yu/pFaLvA3TTeMVjnu3ctigusqWUfjZzvw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.60.1.tgz", + "integrity": "sha512-haZ7hJ1JT4e9hqkoT9R/19XW2QKqjfJVv+i5AGg57S+nLk9lQnJ1F/eZloRO3o9Scy9CM3wQ9l+dkXtcBgN5Ew==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.60.1.tgz", + "integrity": "sha512-czw90wpQq3ZsAVBlinZjAYTKduOjTywlG7fEeWKUA7oCmpA8xdTkxZZlwNJKWqILlq0wehoZcJYfBvOyhPTQ6w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.60.1.tgz", + "integrity": "sha512-KVB2rqsxTHuBtfOeySEyzEOB7ltlB/ux38iu2rBQzkjbwRVlkhAGIEDiiYnO2kFOkJp+Z7pUXKyrRRFuFUKt+g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.60.1.tgz", + "integrity": "sha512-L+34Qqil+v5uC0zEubW7uByo78WOCIrBvci69E7sFASRl0X7b/MB6Cqd1lky/CtcSVTydWa2WZwFuWexjS5o6g==", + "cpu": [ + "arm" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.60.1.tgz", + "integrity": "sha512-n83O8rt4v34hgFzlkb1ycniJh7IR5RCIqt6mz1VRJD6pmhRi0CXdmfnLu9dIUS6buzh60IvACM842Ffb3xd6Gg==", + "cpu": [ + "arm" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.60.1.tgz", + "integrity": "sha512-Nql7sTeAzhTAja3QXeAI48+/+GjBJ+QmAH13snn0AJSNL50JsDqotyudHyMbO2RbJkskbMbFJfIJKWA6R1LCJQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.60.1.tgz", + "integrity": "sha512-+pUymDhd0ys9GcKZPPWlFiZ67sTWV5UU6zOJat02M1+PiuSGDziyRuI/pPue3hoUwm2uGfxdL+trT6Z9rxnlMA==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.60.1.tgz", + "integrity": "sha512-VSvgvQeIcsEvY4bKDHEDWcpW4Yw7BtlKG1GUT4FzBUlEKQK0rWHYBqQt6Fm2taXS+1bXvJT6kICu5ZwqKCnvlQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.60.1.tgz", + "integrity": "sha512-4LqhUomJqwe641gsPp6xLfhqWMbQV04KtPp7/dIp0nzPxAkNY1AbwL5W0MQpcalLYk07vaW9Kp1PBhdpZYYcEw==", + "cpu": [ + "loong64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.60.1.tgz", + "integrity": "sha512-tLQQ9aPvkBxOc/EUT6j3pyeMD6Hb8QF2BTBnCQWP/uu1lhc9AIrIjKnLYMEroIz/JvtGYgI9dF3AxHZNaEH0rw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.60.1.tgz", + "integrity": "sha512-RMxFhJwc9fSXP6PqmAz4cbv3kAyvD1etJFjTx4ONqFP9DkTkXsAMU4v3Vyc5BgzC+anz7nS/9tp4obsKfqkDHg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.60.1.tgz", + "integrity": "sha512-QKgFl+Yc1eEk6MmOBfRHYF6lTxiiiV3/z/BRrbSiW2I7AFTXoBFvdMEyglohPj//2mZS4hDOqeB0H1ACh3sBbg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.60.1.tgz", + "integrity": "sha512-RAjXjP/8c6ZtzatZcA1RaQr6O1TRhzC+adn8YZDnChliZHviqIjmvFwHcxi4JKPSDAt6Uhf/7vqcBzQJy0PDJg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.60.1.tgz", + "integrity": "sha512-wcuocpaOlaL1COBYiA89O6yfjlp3RwKDeTIA0hM7OpmhR1Bjo9j31G1uQVpDlTvwxGn2nQs65fBFL5UFd76FcQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.60.1.tgz", + "integrity": "sha512-77PpsFQUCOiZR9+LQEFg9GClyfkNXj1MP6wRnzYs0EeWbPcHs02AXu4xuUbM1zhwn3wqaizle3AEYg5aeoohhg==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.60.1.tgz", + "integrity": "sha512-5cIATbk5vynAjqqmyBjlciMJl1+R/CwX9oLk/EyiFXDWd95KpHdrOJT//rnUl4cUcskrd0jCCw3wpZnhIHdD9w==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.60.1.tgz", + "integrity": "sha512-cl0w09WsCi17mcmWqqglez9Gk8isgeWvoUZ3WiJFYSR3zjBQc2J5/ihSjpl+VLjPqjQ/1hJRcqBfLjssREQILw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.60.1.tgz", + "integrity": "sha512-4Cv23ZrONRbNtbZa37mLSueXUCtN7MXccChtKpUnQNgF010rjrjfHx3QxkS2PI7LqGT5xXyYs1a7LbzAwT0iCA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.60.1.tgz", + "integrity": "sha512-i1okWYkA4FJICtr7KpYzFpRTHgy5jdDbZiWfvny21iIKky5YExiDXP+zbXzm3dUcFpkEeYNHgQ5fuG236JPq0g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.60.1.tgz", + "integrity": "sha512-u09m3CuwLzShA0EYKMNiFgcjjzwqtUMLmuCJLeZWjjOYA3IT2Di09KaxGBTP9xVztWyIWjVdsB2E9goMjZvTQg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.60.1.tgz", + "integrity": "sha512-k+600V9Zl1CM7eZxJgMyTUzmrmhB/0XZnF4pRypKAlAgxmedUA+1v9R+XOFv56W4SlHEzfeMtzujLJD22Uz5zg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.60.1.tgz", + "integrity": "sha512-lWMnixq/QzxyhTV6NjQJ4SFo1J6PvOX8vUx5Wb4bBPsEb+8xZ89Bz6kOXpfXj9ak9AHTQVQzlgzBEc1SyM27xQ==", + "cpu": [ + "x64" + ], "dev": true, "license": "MIT", - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } + "optional": true, + "os": [ + "win32" + ] }, "node_modules/@sinclair/typebox": { "version": "0.27.10", @@ -1371,6 +1790,13 @@ "@babel/types": "^7.28.2" } }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/graceful-fs": { "version": "4.1.9", "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", @@ -1449,6 +1875,19 @@ "dev": true, "license": "MIT" }, + "node_modules/acorn": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz", + "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/ansi-escapes": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", @@ -1522,16 +1961,6 @@ "sprintf-js": "~1.0.2" } }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/babel-jest": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", @@ -1677,19 +2106,6 @@ "node": "*" } }, - "node_modules/binary-extensions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", - "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/brace-expansion": { "version": "1.1.13", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.13.tgz", @@ -1766,9 +2182,9 @@ "license": "MIT" }, "node_modules/bundle-require": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/bundle-require/-/bundle-require-4.2.1.tgz", - "integrity": "sha512-7Q/6vkyYAwOmQNRw75x+4yRtZCZJXUDmHHlFdkiV0wgv/reNjtJwpu1jPJ0w2kbEpIM0uoKI3S4/f39dU7AjSA==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/bundle-require/-/bundle-require-5.1.0.tgz", + "integrity": "sha512-3WrrOuZiyaaZPWiEt4G3+IffISVC9HYlWueJEBWED4ZH4aIAC2PnkdnuRrR94M+w6yGWn4AglWtJtBI8YqvgoA==", "dev": true, "license": "MIT", "dependencies": { @@ -1778,7 +2194,7 @@ "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "peerDependencies": { - "esbuild": ">=0.17" + "esbuild": ">=0.18" } }, "node_modules/cac": { @@ -1860,28 +2276,19 @@ } }, "node_modules/chokidar": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", - "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", "dev": true, "license": "MIT", "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" + "readdirp": "^4.0.1" }, "engines": { - "node": ">= 8.10.0" + "node": ">= 14.16.0" }, "funding": { "url": "https://paulmillr.com/funding/" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" } }, "node_modules/ci-info": { @@ -1977,6 +2384,23 @@ "dev": true, "license": "MIT" }, + "node_modules/confbox": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz", + "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==", + "dev": true, + "license": "MIT" + }, + "node_modules/consola": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", + "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.18.0 || >=16.10.0" + } + }, "node_modules/convert-source-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", @@ -2084,19 +2508,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "license": "MIT", - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/electron-to-chromium": { "version": "1.5.329", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.329.tgz", @@ -2135,9 +2546,9 @@ } }, "node_modules/esbuild": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz", - "integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==", + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.7.tgz", + "integrity": "sha512-IxpibTjyVnmrIQo5aqNpCgoACA/dTKLTlhMHihVHhdkxKyPO1uBBthumT0rdHmcsk9uMonIWS0m4FljWzILh3w==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -2145,31 +2556,35 @@ "esbuild": "bin/esbuild" }, "engines": { - "node": ">=12" + "node": ">=18" }, "optionalDependencies": { - "@esbuild/android-arm": "0.18.20", - "@esbuild/android-arm64": "0.18.20", - "@esbuild/android-x64": "0.18.20", - "@esbuild/darwin-arm64": "0.18.20", - "@esbuild/darwin-x64": "0.18.20", - "@esbuild/freebsd-arm64": "0.18.20", - "@esbuild/freebsd-x64": "0.18.20", - "@esbuild/linux-arm": "0.18.20", - "@esbuild/linux-arm64": "0.18.20", - "@esbuild/linux-ia32": "0.18.20", - "@esbuild/linux-loong64": "0.18.20", - "@esbuild/linux-mips64el": "0.18.20", - "@esbuild/linux-ppc64": "0.18.20", - "@esbuild/linux-riscv64": "0.18.20", - "@esbuild/linux-s390x": "0.18.20", - "@esbuild/linux-x64": "0.18.20", - "@esbuild/netbsd-x64": "0.18.20", - "@esbuild/openbsd-x64": "0.18.20", - "@esbuild/sunos-x64": "0.18.20", - "@esbuild/win32-arm64": "0.18.20", - "@esbuild/win32-ia32": "0.18.20", - "@esbuild/win32-x64": "0.18.20" + "@esbuild/aix-ppc64": "0.27.7", + "@esbuild/android-arm": "0.27.7", + "@esbuild/android-arm64": "0.27.7", + "@esbuild/android-x64": "0.27.7", + "@esbuild/darwin-arm64": "0.27.7", + "@esbuild/darwin-x64": "0.27.7", + "@esbuild/freebsd-arm64": "0.27.7", + "@esbuild/freebsd-x64": "0.27.7", + "@esbuild/linux-arm": "0.27.7", + "@esbuild/linux-arm64": "0.27.7", + "@esbuild/linux-ia32": "0.27.7", + "@esbuild/linux-loong64": "0.27.7", + "@esbuild/linux-mips64el": "0.27.7", + "@esbuild/linux-ppc64": "0.27.7", + "@esbuild/linux-riscv64": "0.27.7", + "@esbuild/linux-s390x": "0.27.7", + "@esbuild/linux-x64": "0.27.7", + "@esbuild/netbsd-arm64": "0.27.7", + "@esbuild/netbsd-x64": "0.27.7", + "@esbuild/openbsd-arm64": "0.27.7", + "@esbuild/openbsd-x64": "0.27.7", + "@esbuild/openharmony-arm64": "0.27.7", + "@esbuild/sunos-x64": "0.27.7", + "@esbuild/win32-arm64": "0.27.7", + "@esbuild/win32-ia32": "0.27.7", + "@esbuild/win32-x64": "0.27.7" } }, "node_modules/esbuild-plugin-file-path-extensions": { @@ -2267,23 +2682,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/fast-glob": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", - "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.8" - }, - "engines": { - "node": ">=8.6.0" - } - }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -2291,16 +2689,6 @@ "dev": true, "license": "MIT" }, - "node_modules/fastq": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.1.tgz", - "integrity": "sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==", - "dev": true, - "license": "ISC", - "dependencies": { - "reusify": "^1.0.4" - } - }, "node_modules/fb-watchman": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", @@ -2338,6 +2726,18 @@ "node": ">=8" } }, + "node_modules/fix-dts-default-cjs-exports": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/fix-dts-default-cjs-exports/-/fix-dts-default-cjs-exports-1.0.1.tgz", + "integrity": "sha512-pVIECanWFC61Hzl2+oOCtoJ3F17kglZC/6N94eRWycFgBH35hHx0Li604ZIzhseh97mf2p0cv7vVrOZGoqhlEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "magic-string": "^0.30.17", + "mlly": "^1.7.4", + "rollup": "^4.34.8" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -2435,40 +2835,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "license": "ISC", - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "license": "MIT", - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -2516,16 +2882,6 @@ "node": ">=10.17.0" } }, - "node_modules/ignore": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", - "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 4" - } - }, "node_modules/import-local": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz", @@ -2582,19 +2938,6 @@ "dev": true, "license": "MIT" }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "license": "MIT", - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/is-core-module": { "version": "2.16.1", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", @@ -2611,16 +2954,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -2641,19 +2974,6 @@ "node": ">=6" } }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -3500,13 +3820,6 @@ "node": ">=8" } }, - "node_modules/lodash.sortby": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", - "integrity": "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==", - "dev": true, - "license": "MIT" - }, "node_modules/lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", @@ -3517,6 +3830,16 @@ "yallist": "^3.0.2" } }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, "node_modules/make-dir": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", @@ -3563,16 +3886,6 @@ "dev": true, "license": "MIT" }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 8" - } - }, "node_modules/micromatch": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", @@ -3610,6 +3923,19 @@ "node": "*" } }, + "node_modules/mlly": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.8.2.tgz", + "integrity": "sha512-d+ObxMQFmbt10sretNDytwt85VrbkhhUA/JBGm1MPaWJ65Cl4wOgLaB1NYvJSZ0Ef03MMEU/0xpPMXUIQ29UfA==", + "dev": true, + "license": "MIT", + "dependencies": { + "acorn": "^8.16.0", + "pathe": "^2.0.3", + "pkg-types": "^1.3.1", + "ufo": "^1.6.3" + } + }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -3826,15 +4152,12 @@ "dev": true, "license": "MIT" }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } + "license": "MIT" }, "node_modules/picocolors": { "version": "1.1.1", @@ -3879,10 +4202,22 @@ "node": ">=8" } }, + "node_modules/pkg-types": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.3.1.tgz", + "integrity": "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "confbox": "^0.1.8", + "mlly": "^1.7.4", + "pathe": "^2.0.1" + } + }, "node_modules/postcss-load-config": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-4.0.2.tgz", - "integrity": "sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-6.0.1.tgz", + "integrity": "sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==", "dev": true, "funding": [ { @@ -3896,21 +4231,28 @@ ], "license": "MIT", "dependencies": { - "lilconfig": "^3.0.0", - "yaml": "^2.3.4" + "lilconfig": "^3.1.1" }, "engines": { - "node": ">= 14" + "node": ">= 18" }, "peerDependencies": { + "jiti": ">=1.21.0", "postcss": ">=8.0.9", - "ts-node": ">=9.0.0" + "tsx": "^4.8.1", + "yaml": "^2.4.2" }, "peerDependenciesMeta": { + "jiti": { + "optional": true + }, "postcss": { "optional": true }, - "ts-node": { + "tsx": { + "optional": true + }, + "yaml": { "optional": true } } @@ -3957,16 +4299,6 @@ "node": ">= 6" } }, - "node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/pure-rand": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", @@ -3984,27 +4316,6 @@ ], "license": "MIT" }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, "node_modules/react-is": { "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", @@ -4013,16 +4324,17 @@ "license": "MIT" }, "node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", "dev": true, "license": "MIT", - "dependencies": { - "picomatch": "^2.2.1" - }, "engines": { - "node": ">=8.10.0" + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" } }, "node_modules/require-directory": { @@ -4089,58 +4401,51 @@ "node": ">=10" } }, - "node_modules/reusify": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", - "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", - "dev": true, - "license": "MIT", - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, "node_modules/rollup": { - "version": "3.30.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.30.0.tgz", - "integrity": "sha512-kQvGasUgN+AlWGliFn2POSajRQEsULVYFGTvOZmK06d7vCD+YhZztt70kGk3qaeAXeWYL5eO7zx+rAubBc55eA==", + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.60.1.tgz", + "integrity": "sha512-VmtB2rFU/GroZ4oL8+ZqXgSA38O6GR8KSIvWmEFv63pQ0G6KaBH9s07PO8XTXP4vI+3UJUEypOfjkGfmSBBR0w==", "dev": true, "license": "MIT", + "dependencies": { + "@types/estree": "1.0.8" + }, "bin": { "rollup": "dist/bin/rollup" }, "engines": { - "node": ">=14.18.0", + "node": ">=18.0.0", "npm": ">=8.0.0" }, "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.60.1", + "@rollup/rollup-android-arm64": "4.60.1", + "@rollup/rollup-darwin-arm64": "4.60.1", + "@rollup/rollup-darwin-x64": "4.60.1", + "@rollup/rollup-freebsd-arm64": "4.60.1", + "@rollup/rollup-freebsd-x64": "4.60.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.60.1", + "@rollup/rollup-linux-arm-musleabihf": "4.60.1", + "@rollup/rollup-linux-arm64-gnu": "4.60.1", + "@rollup/rollup-linux-arm64-musl": "4.60.1", + "@rollup/rollup-linux-loong64-gnu": "4.60.1", + "@rollup/rollup-linux-loong64-musl": "4.60.1", + "@rollup/rollup-linux-ppc64-gnu": "4.60.1", + "@rollup/rollup-linux-ppc64-musl": "4.60.1", + "@rollup/rollup-linux-riscv64-gnu": "4.60.1", + "@rollup/rollup-linux-riscv64-musl": "4.60.1", + "@rollup/rollup-linux-s390x-gnu": "4.60.1", + "@rollup/rollup-linux-x64-gnu": "4.60.1", + "@rollup/rollup-linux-x64-musl": "4.60.1", + "@rollup/rollup-openbsd-x64": "4.60.1", + "@rollup/rollup-openharmony-arm64": "4.60.1", + "@rollup/rollup-win32-arm64-msvc": "4.60.1", + "@rollup/rollup-win32-ia32-msvc": "4.60.1", + "@rollup/rollup-win32-x64-gnu": "4.60.1", + "@rollup/rollup-win32-x64-msvc": "4.60.1", "fsevents": "~2.3.2" } }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, "node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -4401,6 +4706,13 @@ "node": ">=0.8" } }, + "node_modules/tinyexec": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", + "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", + "dev": true, + "license": "MIT" + }, "node_modules/tinyglobby": { "version": "0.2.15", "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", @@ -4469,16 +4781,6 @@ "node": ">=8.0" } }, - "node_modules/tr46": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", - "integrity": "sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==", - "dev": true, - "license": "MIT", - "dependencies": { - "punycode": "^2.1.0" - } - }, "node_modules/tree-kill": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", @@ -4504,25 +4806,28 @@ "license": "0BSD" }, "node_modules/tsup": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/tsup/-/tsup-7.2.0.tgz", - "integrity": "sha512-vDHlczXbgUvY3rWvqFEbSqmC1L7woozbzngMqTtL2PGBODTtWlRwGDDawhvWzr5c1QjKe4OAKqJGfE1xeXUvtQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "bundle-require": "^4.0.0", - "cac": "^6.7.12", - "chokidar": "^3.5.1", - "debug": "^4.3.1", - "esbuild": "^0.18.2", - "execa": "^5.0.0", - "globby": "^11.0.3", - "joycon": "^3.0.1", - "postcss-load-config": "^4.0.1", + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/tsup/-/tsup-8.5.1.tgz", + "integrity": "sha512-xtgkqwdhpKWr3tKPmCkvYmS9xnQK3m3XgxZHwSUjvfTjp7YfXe5tT3GgWi0F2N+ZSMsOeWeZFh7ZZFg5iPhing==", + "dev": true, + "license": "MIT", + "dependencies": { + "bundle-require": "^5.1.0", + "cac": "^6.7.14", + "chokidar": "^4.0.3", + "consola": "^3.4.0", + "debug": "^4.4.0", + "esbuild": "^0.27.0", + "fix-dts-default-cjs-exports": "^1.0.0", + "joycon": "^3.1.1", + "picocolors": "^1.1.1", + "postcss-load-config": "^6.0.1", "resolve-from": "^5.0.0", - "rollup": "^3.2.5", - "source-map": "0.8.0-beta.0", - "sucrase": "^3.20.3", + "rollup": "^4.34.8", + "source-map": "^0.7.6", + "sucrase": "^3.35.0", + "tinyexec": "^0.3.2", + "tinyglobby": "^0.2.11", "tree-kill": "^1.2.2" }, "bin": { @@ -4530,14 +4835,18 @@ "tsup-node": "dist/cli-node.js" }, "engines": { - "node": ">=16.14" + "node": ">=18" }, "peerDependencies": { + "@microsoft/api-extractor": "^7.36.0", "@swc/core": "^1", "postcss": "^8.4.12", - "typescript": ">=4.1.0" + "typescript": ">=4.5.0" }, "peerDependenciesMeta": { + "@microsoft/api-extractor": { + "optional": true + }, "@swc/core": { "optional": true }, @@ -4550,17 +4859,13 @@ } }, "node_modules/tsup/node_modules/source-map": { - "version": "0.8.0-beta.0", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.8.0-beta.0.tgz", - "integrity": "sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==", - "deprecated": "The work that was done in this beta branch won't be included in future versions", + "version": "0.7.6", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz", + "integrity": "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==", "dev": true, "license": "BSD-3-Clause", - "dependencies": { - "whatwg-url": "^7.0.0" - }, "engines": { - "node": ">= 8" + "node": ">= 12" } }, "node_modules/type-detect": { @@ -4600,6 +4905,13 @@ "node": ">=14.17" } }, + "node_modules/ufo": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.3.tgz", + "integrity": "sha512-yDJTmhydvl5lJzBmy/hyOAA0d+aqCBuwl818haVdYCRrWV84o7YyeVm4QlVHStqNrrJSTb6jKuFAVqAFsr+K3Q==", + "dev": true, + "license": "MIT" + }, "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", @@ -4663,25 +4975,6 @@ "makeerror": "1.0.12" } }, - "node_modules/webidl-conversions": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", - "dev": true, - "license": "BSD-2-Clause" - }, - "node_modules/whatwg-url": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", - "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", - "dev": true, - "license": "MIT", - "dependencies": { - "lodash.sortby": "^4.7.0", - "tr46": "^1.0.1", - "webidl-conversions": "^4.0.2" - } - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -4754,22 +5047,6 @@ "dev": true, "license": "ISC" }, - "node_modules/yaml": { - "version": "2.8.3", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.3.tgz", - "integrity": "sha512-AvbaCLOO2Otw/lW5bmh9d/WEdcDFdQp2Z2ZUH3pX9U2ihyUY0nvLv7J6TrWowklRGPYbB/IuIMfYgxaCPg5Bpg==", - "dev": true, - "license": "ISC", - "bin": { - "yaml": "bin.mjs" - }, - "engines": { - "node": ">= 14.6" - }, - "funding": { - "url": "https://github.com/sponsors/eemeli" - } - }, "node_modules/yargs": { "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", diff --git a/package.json b/package.json index 77275955..bcf42393 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "node-appwrite", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API", - "version": "23.1.0", + "version": "24.0.0", "license": "BSD-3-Clause", "main": "dist/index.js", "type": "commonjs", @@ -44,7 +44,7 @@ "devDependencies": { "@types/json-bigint": "1.0.4", "@types/node": "20.11.25", - "tsup": "7.2.0", + "tsup": "^8.5.1", "esbuild-plugin-file-path-extensions": "^2.0.0", "tslib": "2.6.2", "typescript": "5.4.2", diff --git a/src/client.ts b/src/client.ts index 50c09291..d413d82b 100644 --- a/src/client.ts +++ b/src/client.ts @@ -73,7 +73,7 @@ class AppwriteException extends Error { } function getUserAgent() { - let ua = 'AppwriteNodeJSSDK/23.1.0'; + let ua = 'AppwriteNodeJSSDK/24.0.0'; // `process` is a global in Node.js, but not fully available in all runtimes. const platform: string[] = []; @@ -125,9 +125,9 @@ class Client { 'x-sdk-name': 'Node.js', 'x-sdk-platform': 'server', 'x-sdk-language': 'nodejs', - 'x-sdk-version': '23.1.0', + 'x-sdk-version': '24.0.0', 'user-agent' : getUserAgent(), - 'X-Appwrite-Response-Format': '1.9.0', + 'X-Appwrite-Response-Format': '1.9.1', }; /** diff --git a/src/enums/build-runtime.ts b/src/enums/build-runtime.ts index 3f85913f..6aea9aa5 100644 --- a/src/enums/build-runtime.ts +++ b/src/enums/build-runtime.ts @@ -47,6 +47,7 @@ export enum BuildRuntime { Dart38 = 'dart-3.8', Dart39 = 'dart-3.9', Dart310 = 'dart-3.10', + Dart311 = 'dart-3.11', Dotnet60 = 'dotnet-6.0', Dotnet70 = 'dotnet-7.0', Dotnet80 = 'dotnet-8.0', @@ -85,4 +86,5 @@ export enum BuildRuntime { Flutter332 = 'flutter-3.32', Flutter335 = 'flutter-3.35', Flutter338 = 'flutter-3.38', + Flutter341 = 'flutter-3.41', } \ No newline at end of file diff --git a/src/enums/o-auth-provider.ts b/src/enums/o-auth-provider.ts index 3382e3bf..efc44844 100644 --- a/src/enums/o-auth-provider.ts +++ b/src/enums/o-auth-provider.ts @@ -33,6 +33,7 @@ export enum OAuthProvider { TradeshiftBox = 'tradeshiftBox', Twitch = 'twitch', Wordpress = 'wordpress', + X = 'x', Yahoo = 'yahoo', Yammer = 'yammer', Yandex = 'yandex', diff --git a/src/enums/platform-type.ts b/src/enums/platform-type.ts new file mode 100644 index 00000000..bde1d30f --- /dev/null +++ b/src/enums/platform-type.ts @@ -0,0 +1,7 @@ +export enum PlatformType { + Windows = 'windows', + Apple = 'apple', + Android = 'android', + Linux = 'linux', + Web = 'web', +} \ No newline at end of file diff --git a/src/enums/protocol-id.ts b/src/enums/protocol-id.ts new file mode 100644 index 00000000..94d9095f --- /dev/null +++ b/src/enums/protocol-id.ts @@ -0,0 +1,5 @@ +export enum ProtocolId { + Rest = 'rest', + Graphql = 'graphql', + Websocket = 'websocket', +} \ No newline at end of file diff --git a/src/enums/runtime.ts b/src/enums/runtime.ts index fda3bab3..3a57958b 100644 --- a/src/enums/runtime.ts +++ b/src/enums/runtime.ts @@ -47,6 +47,7 @@ export enum Runtime { Dart38 = 'dart-3.8', Dart39 = 'dart-3.9', Dart310 = 'dart-3.10', + Dart311 = 'dart-3.11', Dotnet60 = 'dotnet-6.0', Dotnet70 = 'dotnet-7.0', Dotnet80 = 'dotnet-8.0', @@ -85,4 +86,5 @@ export enum Runtime { Flutter332 = 'flutter-3.32', Flutter335 = 'flutter-3.35', Flutter338 = 'flutter-3.38', + Flutter341 = 'flutter-3.41', } \ No newline at end of file diff --git a/src/enums/scopes.ts b/src/enums/scopes.ts index d85b2bb5..d98f20ab 100644 --- a/src/enums/scopes.ts +++ b/src/enums/scopes.ts @@ -60,6 +60,10 @@ export enum Scopes { WebhooksWrite = 'webhooks.write', ProjectRead = 'project.read', ProjectWrite = 'project.write', + KeysRead = 'keys.read', + KeysWrite = 'keys.write', + PlatformsRead = 'platforms.read', + PlatformsWrite = 'platforms.write', PoliciesWrite = 'policies.write', PoliciesRead = 'policies.read', ArchivesRead = 'archives.read', diff --git a/src/enums/service-id.ts b/src/enums/service-id.ts new file mode 100644 index 00000000..29281124 --- /dev/null +++ b/src/enums/service-id.ts @@ -0,0 +1,19 @@ +export enum ServiceId { + Account = 'account', + Avatars = 'avatars', + Databases = 'databases', + Tablesdb = 'tablesdb', + Locale = 'locale', + Health = 'health', + Project = 'project', + Storage = 'storage', + Teams = 'teams', + Users = 'users', + Vcs = 'vcs', + Sites = 'sites', + Functions = 'functions', + Proxy = 'proxy', + Graphql = 'graphql', + Migrations = 'migrations', + Messaging = 'messaging', +} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 99e694ad..743e850e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -47,6 +47,8 @@ export { ExecutionMethod } from './enums/execution-method'; export { Name } from './enums/name'; export { MessagePriority } from './enums/message-priority'; export { SmtpEncryption } from './enums/smtp-encryption'; +export { ProtocolId } from './enums/protocol-id'; +export { ServiceId } from './enums/service-id'; export { Framework } from './enums/framework'; export { BuildRuntime } from './enums/build-runtime'; export { Adapter } from './enums/adapter'; @@ -62,6 +64,7 @@ export { IndexStatus } from './enums/index-status'; export { DeploymentStatus } from './enums/deployment-status'; export { ExecutionTrigger } from './enums/execution-trigger'; export { ExecutionStatus } from './enums/execution-status'; +export { PlatformType } from './enums/platform-type'; export { HealthAntivirusStatus } from './enums/health-antivirus-status'; export { HealthCheckStatus } from './enums/health-check-status'; export { MessageStatus } from './enums/message-status'; diff --git a/src/models.ts b/src/models.ts index 37c65933..0f9546a3 100644 --- a/src/models.ts +++ b/src/models.ts @@ -5,6 +5,7 @@ import { IndexStatus } from "./enums/index-status" import { DeploymentStatus } from "./enums/deployment-status" import { ExecutionTrigger } from "./enums/execution-trigger" import { ExecutionStatus } from "./enums/execution-status" +import { PlatformType } from "./enums/platform-type" import { HealthAntivirusStatus } from "./enums/health-antivirus-status" import { HealthCheckStatus } from "./enums/health-check-status" import { MessageStatus } from "./enums/message-status" @@ -338,6 +339,20 @@ export namespace Models { webhooks: Webhook[]; } + /** + * API Keys List + */ + export type KeyList = { + /** + * Total number of keys that matched your query. + */ + total: number; + /** + * List of keys. + */ + keys: Key[]; + } + /** * Countries List */ @@ -2520,6 +2535,10 @@ export namespace Models { * API mode when event triggered. */ mode: string; + /** + * User type who triggered the audit log. Possible values: user, admin, guest, keyProject, keyAccount, keyOrganization. + */ + userType: string; /** * IP session in use when the session was created. */ @@ -3837,6 +3856,324 @@ export namespace Models { scheduledAt?: string; } + /** + * Project + */ + export type Project = { + /** + * Project ID. + */ + $id: string; + /** + * Project creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Project update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Project name. + */ + name: string; + /** + * Project description. + */ + description: string; + /** + * Project team ID. + */ + teamId: string; + /** + * Project logo file ID. + */ + logo: string; + /** + * Project website URL. + */ + url: string; + /** + * Company legal name. + */ + legalName: string; + /** + * Country code in [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) two-character format. + */ + legalCountry: string; + /** + * State name. + */ + legalState: string; + /** + * City name. + */ + legalCity: string; + /** + * Company Address. + */ + legalAddress: string; + /** + * Company Tax ID. + */ + legalTaxId: string; + /** + * Session duration in seconds. + */ + authDuration: number; + /** + * Max users allowed. 0 is unlimited. + */ + authLimit: number; + /** + * Max sessions allowed per user. 100 maximum. + */ + authSessionsLimit: number; + /** + * Max allowed passwords in the history list per user. Max passwords limit allowed in history is 20. Use 0 for disabling password history. + */ + authPasswordHistory: number; + /** + * Whether or not to check user's password against most commonly used passwords. + */ + authPasswordDictionary: boolean; + /** + * Whether or not to check the user password for similarity with their personal data. + */ + authPersonalDataCheck: boolean; + /** + * Whether or not to disallow disposable email addresses during signup and email updates. + */ + authDisposableEmails: boolean; + /** + * Whether or not to require canonical email addresses during signup and email updates. + */ + authCanonicalEmails: boolean; + /** + * Whether or not to disallow free email addresses during signup and email updates. + */ + authFreeEmails: boolean; + /** + * An array of mock numbers and their corresponding verification codes (OTPs). + */ + authMockNumbers: MockNumber[]; + /** + * Whether or not to send session alert emails to users. + */ + authSessionAlerts: boolean; + /** + * Whether or not to show user names in the teams membership response. + */ + authMembershipsUserName: boolean; + /** + * Whether or not to show user emails in the teams membership response. + */ + authMembershipsUserEmail: boolean; + /** + * Whether or not to show user MFA status in the teams membership response. + */ + authMembershipsMfa: boolean; + /** + * Whether or not all existing sessions should be invalidated on password change + */ + authInvalidateSessions: boolean; + /** + * List of Auth Providers. + */ + oAuthProviders: AuthProvider[]; + /** + * List of Platforms. + */ + platforms: (Models.PlatformWeb | Models.PlatformApple | Models.PlatformAndroid | Models.PlatformWindows | Models.PlatformLinux)[]; + /** + * List of Webhooks. + */ + webhooks: Webhook[]; + /** + * List of API Keys. + */ + keys: Key[]; + /** + * List of dev keys. + */ + devKeys: DevKey[]; + /** + * Status for custom SMTP + */ + smtpEnabled: boolean; + /** + * SMTP sender name + */ + smtpSenderName: string; + /** + * SMTP sender email + */ + smtpSenderEmail: string; + /** + * SMTP reply to email + */ + smtpReplyTo: string; + /** + * SMTP server host name + */ + smtpHost: string; + /** + * SMTP server port + */ + smtpPort: number; + /** + * SMTP server username + */ + smtpUsername: string; + /** + * SMTP server password + */ + smtpPassword: string; + /** + * SMTP server secure protocol + */ + smtpSecure: string; + /** + * Number of times the ping was received for this project. + */ + pingCount: number; + /** + * Last ping datetime in ISO 8601 format. + */ + pingedAt: string; + /** + * Labels for the project. + */ + labels: string[]; + /** + * Project status + */ + status: string; + /** + * Email/Password auth method status + */ + authEmailPassword: boolean; + /** + * Magic URL auth method status + */ + authUsersAuthMagicURL: boolean; + /** + * Email (OTP) auth method status + */ + authEmailOtp: boolean; + /** + * Anonymous auth method status + */ + authAnonymous: boolean; + /** + * Invites auth method status + */ + authInvites: boolean; + /** + * JWT auth method status + */ + authJWT: boolean; + /** + * Phone auth method status + */ + authPhone: boolean; + /** + * Account service status + */ + serviceStatusForAccount: boolean; + /** + * Avatars service status + */ + serviceStatusForAvatars: boolean; + /** + * Databases (legacy) service status + */ + serviceStatusForDatabases: boolean; + /** + * TablesDB service status + */ + serviceStatusForTablesdb: boolean; + /** + * Locale service status + */ + serviceStatusForLocale: boolean; + /** + * Health service status + */ + serviceStatusForHealth: boolean; + /** + * Project service status + */ + serviceStatusForProject: boolean; + /** + * Storage service status + */ + serviceStatusForStorage: boolean; + /** + * Teams service status + */ + serviceStatusForTeams: boolean; + /** + * Users service status + */ + serviceStatusForUsers: boolean; + /** + * VCS service status + */ + serviceStatusForVcs: boolean; + /** + * Sites service status + */ + serviceStatusForSites: boolean; + /** + * Functions service status + */ + serviceStatusForFunctions: boolean; + /** + * Proxy service status + */ + serviceStatusForProxy: boolean; + /** + * GraphQL service status + */ + serviceStatusForGraphql: boolean; + /** + * Migrations service status + */ + serviceStatusForMigrations: boolean; + /** + * Messaging service status + */ + serviceStatusForMessaging: boolean; + /** + * REST protocol status + */ + protocolStatusForRest: boolean; + /** + * GraphQL protocol status + */ + protocolStatusForGraphql: boolean; + /** + * Websocket protocol status + */ + protocolStatusForWebsocket: boolean; + /** + * Project region + */ + region: string; + /** + * Billing limits reached + */ + billingLimits: BillingLimits; + /** + * Project blocks information + */ + blocks: Block[]; + /** + * Last time the project was accessed via console. Used with plan's projectInactivityDays to determine if project is paused. + */ + consoleAccessedAt: string; + } + /** * Webhook */ @@ -3866,21 +4203,21 @@ export namespace Models { */ events: string[]; /** - * Indicated if SSL / TLS Certificate verification is enabled. + * Indicates if SSL / TLS certificate verification is enabled. */ - security: boolean; + tls: boolean; /** * HTTP basic authentication username. */ - httpUser: string; + authUsername: string; /** * HTTP basic authentication password. */ - httpPass: string; + authPassword: string; /** - * Signature key which can be used to validated incoming + * Signature key which can be used to validate incoming webhook payloads. Only returned on creation and secret rotation. */ - signatureKey: string; + secret: string; /** * Indicates if this webhook is enabled. */ @@ -3895,6 +4232,290 @@ export namespace Models { attempts: number; } + /** + * Key + */ + export type Key = { + /** + * Key ID. + */ + $id: string; + /** + * Key creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Key update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Key name. + */ + name: string; + /** + * Key expiration date in ISO 8601 format. + */ + expire: string; + /** + * Allowed permission scopes. + */ + scopes: string[]; + /** + * Secret key. + */ + secret: string; + /** + * Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours. + */ + accessedAt: string; + /** + * List of SDK user agents that used this key. + */ + sdks: string[]; + } + + /** + * DevKey + */ + export type DevKey = { + /** + * Key ID. + */ + $id: string; + /** + * Key creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Key update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Key name. + */ + name: string; + /** + * Key expiration date in ISO 8601 format. + */ + expire: string; + /** + * Secret key. + */ + secret: string; + /** + * Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours. + */ + accessedAt: string; + /** + * List of SDK user agents that used this key. + */ + sdks: string[]; + } + + /** + * Mock Number + */ + export type MockNumber = { + /** + * Mock phone number for testing phone authentication. Useful for testing phone authentication without sending an SMS. + */ + phone: string; + /** + * Mock OTP for the number. + */ + otp: string; + } + + /** + * AuthProvider + */ + export type AuthProvider = { + /** + * Auth Provider. + */ + key: string; + /** + * Auth Provider name. + */ + name: string; + /** + * OAuth 2.0 application ID. + */ + appId: string; + /** + * OAuth 2.0 application secret. Might be JSON string if provider requires extra configuration. + */ + secret: string; + /** + * Auth Provider is active and can be used to create session. + */ + enabled: boolean; + } + + /** + * Platform Web + */ + export type PlatformWeb = { + /** + * Platform ID. + */ + $id: string; + /** + * Platform creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Platform update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Platform name. + */ + name: string; + /** + * Platform type. Possible values are: windows, apple, android, linux, web. + */ + type: PlatformType; + /** + * Web app hostname. Empty string for other platforms. + */ + hostname: string; + } + + /** + * Platform Apple + */ + export type PlatformApple = { + /** + * Platform ID. + */ + $id: string; + /** + * Platform creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Platform update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Platform name. + */ + name: string; + /** + * Platform type. Possible values are: windows, apple, android, linux, web. + */ + type: PlatformType; + /** + * Apple bundle identifier. + */ + bundleIdentifier: string; + } + + /** + * Platform Android + */ + export type PlatformAndroid = { + /** + * Platform ID. + */ + $id: string; + /** + * Platform creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Platform update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Platform name. + */ + name: string; + /** + * Platform type. Possible values are: windows, apple, android, linux, web. + */ + type: PlatformType; + /** + * Android application ID. + */ + applicationId: string; + } + + /** + * Platform Windows + */ + export type PlatformWindows = { + /** + * Platform ID. + */ + $id: string; + /** + * Platform creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Platform update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Platform name. + */ + name: string; + /** + * Platform type. Possible values are: windows, apple, android, linux, web. + */ + type: PlatformType; + /** + * Windows package identifier name. + */ + packageIdentifierName: string; + } + + /** + * Platform Linux + */ + export type PlatformLinux = { + /** + * Platform ID. + */ + $id: string; + /** + * Platform creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Platform update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Platform name. + */ + name: string; + /** + * Platform type. Possible values are: windows, apple, android, linux, web. + */ + type: PlatformType; + /** + * Linux package name. + */ + packageName: string; + } + + /** + * Platforms List + */ + export type PlatformList = { + /** + * Total number of platforms in the given project. + */ + total: number; + /** + * List of platforms. + */ + platforms: (Models.PlatformWeb | Models.PlatformApple | Models.PlatformAndroid | Models.PlatformWindows | Models.PlatformLinux)[]; + } + /** * Variable */ @@ -4665,6 +5286,70 @@ export namespace Models { resourceType?: string; } + /** + * BillingLimits + */ + export type BillingLimits = { + /** + * Bandwidth limit + */ + bandwidth: number; + /** + * Storage limit + */ + storage: number; + /** + * Users limit + */ + users: number; + /** + * Executions limit + */ + executions: number; + /** + * GBHours limit + */ + GBHours: number; + /** + * Image transformations limit + */ + imageTransformations: number; + /** + * Auth phone limit + */ + authPhone: number; + /** + * Budget limit percentage + */ + budgetLimit: number; + } + + /** + * Block + */ + export type Block = { + /** + * Block creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Resource type that is blocked + */ + resourceType: string; + /** + * Resource identifier that is blocked + */ + resourceId: string; + /** + * Reason for the block. Can be null if no reason was provided. + */ + reason?: string; + /** + * Block expiration date in ISO 8601 format. Can be null if the block does not expire. + */ + expiredAt?: string; + } + /** * backup */ diff --git a/src/services/account.ts b/src/services/account.ts index 9784f06d..07b94599 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -2338,7 +2338,7 @@ export class Account { * * A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). * - * @param {OAuthProvider} params.provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom. + * @param {OAuthProvider} params.provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom. * @param {string} params.success - URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param {string} params.failure - URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param {string[]} params.scopes - A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long. @@ -2353,7 +2353,7 @@ export class Account { * * A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). * - * @param {OAuthProvider} provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom. + * @param {OAuthProvider} provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom. * @param {string} success - URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param {string} failure - URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param {string[]} scopes - A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long. diff --git a/src/services/databases.ts b/src/services/databases.ts index 54b2eb0f..54fb8bdc 100644 --- a/src/services/databases.ts +++ b/src/services/databases.ts @@ -914,11 +914,12 @@ export class Databases { * @param {string[]} params.permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} params.documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} params.enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. + * @param {boolean} params.purge - When true, purge all cached list responses for this collection as part of the update. Use this to force readers to see fresh data immediately instead of waiting for the cache TTL to expire. * @throws {AppwriteException} * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateTable` instead. */ - updateCollection(params: { databaseId: string, collectionId: string, name?: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean }): Promise; + updateCollection(params: { databaseId: string, collectionId: string, name?: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean, purge?: boolean }): Promise; /** * Update a collection by its unique ID. * @@ -928,19 +929,20 @@ export class Databases { * @param {string[]} permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled. + * @param {boolean} purge - When true, purge all cached list responses for this collection as part of the update. Use this to force readers to see fresh data immediately instead of waiting for the cache TTL to expire. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateCollection(databaseId: string, collectionId: string, name?: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean): Promise; + updateCollection(databaseId: string, collectionId: string, name?: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean, purge?: boolean): Promise; updateCollection( - paramsOrFirst: { databaseId: string, collectionId: string, name?: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean } | string, - ...rest: [(string)?, (string)?, (string[])?, (boolean)?, (boolean)?] + paramsOrFirst: { databaseId: string, collectionId: string, name?: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean, purge?: boolean } | string, + ...rest: [(string)?, (string)?, (string[])?, (boolean)?, (boolean)?, (boolean)?] ): Promise { - let params: { databaseId: string, collectionId: string, name?: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean }; + let params: { databaseId: string, collectionId: string, name?: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean, purge?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, name?: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean }; + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, name?: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean, purge?: boolean }; } else { params = { databaseId: paramsOrFirst as string, @@ -948,7 +950,8 @@ export class Databases { name: rest[1] as string, permissions: rest[2] as string[], documentSecurity: rest[3] as boolean, - enabled: rest[4] as boolean + enabled: rest[4] as boolean, + purge: rest[5] as boolean }; } @@ -958,6 +961,7 @@ export class Databases { const permissions = params.permissions; const documentSecurity = params.documentSecurity; const enabled = params.enabled; + const purge = params.purge; if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); @@ -980,6 +984,9 @@ export class Databases { if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } + if (typeof purge !== 'undefined') { + payload['purge'] = purge; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -4660,7 +4667,7 @@ export class Databases { * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. * @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction. * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. - * @param {number} params.ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). + * @param {number} params.ttl - TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours). * @throws {AppwriteException} * @returns {Promise>} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.listRows` instead. @@ -4674,7 +4681,7 @@ export class Databases { * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. * @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction. * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. - * @param {number} ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). + * @param {number} ttl - TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours). * @throws {AppwriteException} * @returns {Promise>} * @deprecated Use the object parameter style method for a better developer experience. diff --git a/src/services/health.ts b/src/services/health.ts index 14111566..713f33ba 100644 --- a/src/services/health.ts +++ b/src/services/health.ts @@ -239,6 +239,7 @@ export class Health { /** * Get the number of audit logs that are waiting to be processed in the Appwrite internal queue server. + * * * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} @@ -247,6 +248,7 @@ export class Health { getQueueAudits(params?: { threshold?: number }): Promise; /** * Get the number of audit logs that are waiting to be processed in the Appwrite internal queue server. + * * * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. * @throws {AppwriteException} diff --git a/src/services/project.ts b/src/services/project.ts index ed6fcb19..f2829b93 100644 --- a/src/services/project.ts +++ b/src/services/project.ts @@ -1,6 +1,9 @@ import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; import type { Models } from '../models'; +import { Scopes } from '../enums/scopes'; +import { ProtocolId } from '../enums/protocol-id'; +import { ServiceId } from '../enums/service-id'; export class Project { client: Client; @@ -9,6 +12,1419 @@ export class Project { this.client = client; } + /** + * Get a list of all API keys from the current project. + * + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire, accessedAt, name, scopes + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + */ + listKeys(params?: { queries?: string[], total?: boolean }): Promise; + /** + * Get a list of all API keys from the current project. + * + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire, accessedAt, name, scopes + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listKeys(queries?: string[], total?: boolean): Promise; + listKeys( + paramsOrFirst?: { queries?: string[], total?: boolean } | string[], + ...rest: [(boolean)?] + ): Promise { + let params: { queries?: string[], total?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { queries?: string[], total?: boolean }; + } else { + params = { + queries: paramsOrFirst as string[], + total: rest[0] as boolean + }; + } + + const queries = params.queries; + const total = params.total; + + + const apiPath = '/project/keys'; + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof total !== 'undefined') { + payload['total'] = total; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Create a new API key. It's recommended to have multiple API keys with strict scopes for separate functions within your project. + * + * @param {string} params.keyId - Key ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} params.name - Key name. Max length: 128 chars. + * @param {Scopes[]} params.scopes - Key scopes list. Maximum of 100 scopes are allowed. + * @param {string} params.expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @throws {AppwriteException} + * @returns {Promise} + */ + createKey(params: { keyId: string, name: string, scopes: Scopes[], expire?: string }): Promise; + /** + * Create a new API key. It's recommended to have multiple API keys with strict scopes for separate functions within your project. + * + * @param {string} keyId - Key ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} name - Key name. Max length: 128 chars. + * @param {Scopes[]} scopes - Key scopes list. Maximum of 100 scopes are allowed. + * @param {string} expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createKey(keyId: string, name: string, scopes: Scopes[], expire?: string): Promise; + createKey( + paramsOrFirst: { keyId: string, name: string, scopes: Scopes[], expire?: string } | string, + ...rest: [(string)?, (Scopes[])?, (string)?] + ): Promise { + let params: { keyId: string, name: string, scopes: Scopes[], expire?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { keyId: string, name: string, scopes: Scopes[], expire?: string }; + } else { + params = { + keyId: paramsOrFirst as string, + name: rest[0] as string, + scopes: rest[1] as Scopes[], + expire: rest[2] as string + }; + } + + const keyId = params.keyId; + const name = params.name; + const scopes = params.scopes; + const expire = params.expire; + + if (typeof keyId === 'undefined') { + throw new AppwriteException('Missing required parameter: "keyId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof scopes === 'undefined') { + throw new AppwriteException('Missing required parameter: "scopes"'); + } + + const apiPath = '/project/keys'; + const payload: Payload = {}; + if (typeof keyId !== 'undefined') { + payload['keyId'] = keyId; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof scopes !== 'undefined') { + payload['scopes'] = scopes; + } + if (typeof expire !== 'undefined') { + payload['expire'] = expire; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Get a key by its unique ID. + * + * @param {string} params.keyId - Key ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + getKey(params: { keyId: string }): Promise; + /** + * Get a key by its unique ID. + * + * @param {string} keyId - Key ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getKey(keyId: string): Promise; + getKey( + paramsOrFirst: { keyId: string } | string + ): Promise { + let params: { keyId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { keyId: string }; + } else { + params = { + keyId: paramsOrFirst as string + }; + } + + const keyId = params.keyId; + + if (typeof keyId === 'undefined') { + throw new AppwriteException('Missing required parameter: "keyId"'); + } + + const apiPath = '/project/keys/{keyId}'.replace('{keyId}', keyId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. + * + * @param {string} params.keyId - Key ID. + * @param {string} params.name - Key name. Max length: 128 chars. + * @param {Scopes[]} params.scopes - Key scopes list. Maximum of 100 scopes are allowed. + * @param {string} params.expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateKey(params: { keyId: string, name: string, scopes: Scopes[], expire?: string }): Promise; + /** + * Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. + * + * @param {string} keyId - Key ID. + * @param {string} name - Key name. Max length: 128 chars. + * @param {Scopes[]} scopes - Key scopes list. Maximum of 100 scopes are allowed. + * @param {string} expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateKey(keyId: string, name: string, scopes: Scopes[], expire?: string): Promise; + updateKey( + paramsOrFirst: { keyId: string, name: string, scopes: Scopes[], expire?: string } | string, + ...rest: [(string)?, (Scopes[])?, (string)?] + ): Promise { + let params: { keyId: string, name: string, scopes: Scopes[], expire?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { keyId: string, name: string, scopes: Scopes[], expire?: string }; + } else { + params = { + keyId: paramsOrFirst as string, + name: rest[0] as string, + scopes: rest[1] as Scopes[], + expire: rest[2] as string + }; + } + + const keyId = params.keyId; + const name = params.name; + const scopes = params.scopes; + const expire = params.expire; + + if (typeof keyId === 'undefined') { + throw new AppwriteException('Missing required parameter: "keyId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof scopes === 'undefined') { + throw new AppwriteException('Missing required parameter: "scopes"'); + } + + const apiPath = '/project/keys/{keyId}'.replace('{keyId}', keyId); + const payload: Payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof scopes !== 'undefined') { + payload['scopes'] = scopes; + } + if (typeof expire !== 'undefined') { + payload['expire'] = expire; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload, + ); + } + + /** + * Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls. + * + * @param {string} params.keyId - Key ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deleteKey(params: { keyId: string }): Promise<{}>; + /** + * Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls. + * + * @param {string} keyId - Key ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deleteKey(keyId: string): Promise<{}>; + deleteKey( + paramsOrFirst: { keyId: string } | string + ): Promise<{}> { + let params: { keyId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { keyId: string }; + } else { + params = { + keyId: paramsOrFirst as string + }; + } + + const keyId = params.keyId; + + if (typeof keyId === 'undefined') { + throw new AppwriteException('Missing required parameter: "keyId"'); + } + + const apiPath = '/project/keys/{keyId}'.replace('{keyId}', keyId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the project labels. Labels can be used to easily filter projects in an organization. + * + * @param {string[]} params.labels - Array of project labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateLabels(params: { labels: string[] }): Promise; + /** + * Update the project labels. Labels can be used to easily filter projects in an organization. + * + * @param {string[]} labels - Array of project labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateLabels(labels: string[]): Promise; + updateLabels( + paramsOrFirst: { labels: string[] } | string[] + ): Promise { + let params: { labels: string[] }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { labels: string[] }; + } else { + params = { + labels: paramsOrFirst as string[] + }; + } + + const labels = params.labels; + + if (typeof labels === 'undefined') { + throw new AppwriteException('Missing required parameter: "labels"'); + } + + const apiPath = '/project/labels'; + const payload: Payload = {}; + if (typeof labels !== 'undefined') { + payload['labels'] = labels; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload, + ); + } + + /** + * Get a list of all platforms in the project. This endpoint returns an array of all platforms and their configurations. + * + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: type, name, hostname, bundleIdentifier, applicationId, packageIdentifierName, packageName + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + */ + listPlatforms(params?: { queries?: string[], total?: boolean }): Promise; + /** + * Get a list of all platforms in the project. This endpoint returns an array of all platforms and their configurations. + * + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: type, name, hostname, bundleIdentifier, applicationId, packageIdentifierName, packageName + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listPlatforms(queries?: string[], total?: boolean): Promise; + listPlatforms( + paramsOrFirst?: { queries?: string[], total?: boolean } | string[], + ...rest: [(boolean)?] + ): Promise { + let params: { queries?: string[], total?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { queries?: string[], total?: boolean }; + } else { + params = { + queries: paramsOrFirst as string[], + total: rest[0] as boolean + }; + } + + const queries = params.queries; + const total = params.total; + + + const apiPath = '/project/platforms'; + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof total !== 'undefined') { + payload['total'] = total; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Create a new Android platform for your project. Use this endpoint to register a new Android platform where your users will run your application which will interact with the Appwrite API. + * + * @param {string} params.platformId - Platform 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 - Platform name. Max length: 128 chars. + * @param {string} params.applicationId - Android application ID. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + createAndroidPlatform(params: { platformId: string, name: string, applicationId: string }): Promise; + /** + * Create a new Android platform for your project. Use this endpoint to register a new Android platform where your users will run your application which will interact with the Appwrite API. + * + * @param {string} platformId - Platform 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 - Platform name. Max length: 128 chars. + * @param {string} applicationId - Android application ID. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createAndroidPlatform(platformId: string, name: string, applicationId: string): Promise; + createAndroidPlatform( + paramsOrFirst: { platformId: string, name: string, applicationId: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { platformId: string, name: string, applicationId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { platformId: string, name: string, applicationId: string }; + } else { + params = { + platformId: paramsOrFirst as string, + name: rest[0] as string, + applicationId: rest[1] as string + }; + } + + const platformId = params.platformId; + const name = params.name; + const applicationId = params.applicationId; + + if (typeof platformId === 'undefined') { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof applicationId === 'undefined') { + throw new AppwriteException('Missing required parameter: "applicationId"'); + } + + const apiPath = '/project/platforms/android'; + const payload: Payload = {}; + if (typeof platformId !== 'undefined') { + payload['platformId'] = platformId; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof applicationId !== 'undefined') { + payload['applicationId'] = applicationId; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update an Android platform by its unique ID. Use this endpoint to update the platform's name or application ID. + * + * @param {string} params.platformId - Platform ID. + * @param {string} params.name - Platform name. Max length: 128 chars. + * @param {string} params.applicationId - Android application ID. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateAndroidPlatform(params: { platformId: string, name: string, applicationId: string }): Promise; + /** + * Update an Android platform by its unique ID. Use this endpoint to update the platform's name or application ID. + * + * @param {string} platformId - Platform ID. + * @param {string} name - Platform name. Max length: 128 chars. + * @param {string} applicationId - Android application ID. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateAndroidPlatform(platformId: string, name: string, applicationId: string): Promise; + updateAndroidPlatform( + paramsOrFirst: { platformId: string, name: string, applicationId: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { platformId: string, name: string, applicationId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { platformId: string, name: string, applicationId: string }; + } else { + params = { + platformId: paramsOrFirst as string, + name: rest[0] as string, + applicationId: rest[1] as string + }; + } + + const platformId = params.platformId; + const name = params.name; + const applicationId = params.applicationId; + + if (typeof platformId === 'undefined') { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof applicationId === 'undefined') { + throw new AppwriteException('Missing required parameter: "applicationId"'); + } + + const apiPath = '/project/platforms/android/{platformId}'.replace('{platformId}', platformId); + const payload: Payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof applicationId !== 'undefined') { + payload['applicationId'] = applicationId; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload, + ); + } + + /** + * Create a new Apple platform for your project. Use this endpoint to register a new Apple platform where your users will run your application which will interact with the Appwrite API. + * + * @param {string} params.platformId - Platform 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 - Platform name. Max length: 128 chars. + * @param {string} params.bundleIdentifier - Apple bundle identifier. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + createApplePlatform(params: { platformId: string, name: string, bundleIdentifier: string }): Promise; + /** + * Create a new Apple platform for your project. Use this endpoint to register a new Apple platform where your users will run your application which will interact with the Appwrite API. + * + * @param {string} platformId - Platform 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 - Platform name. Max length: 128 chars. + * @param {string} bundleIdentifier - Apple bundle identifier. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createApplePlatform(platformId: string, name: string, bundleIdentifier: string): Promise; + createApplePlatform( + paramsOrFirst: { platformId: string, name: string, bundleIdentifier: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { platformId: string, name: string, bundleIdentifier: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { platformId: string, name: string, bundleIdentifier: string }; + } else { + params = { + platformId: paramsOrFirst as string, + name: rest[0] as string, + bundleIdentifier: rest[1] as string + }; + } + + const platformId = params.platformId; + const name = params.name; + const bundleIdentifier = params.bundleIdentifier; + + if (typeof platformId === 'undefined') { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof bundleIdentifier === 'undefined') { + throw new AppwriteException('Missing required parameter: "bundleIdentifier"'); + } + + const apiPath = '/project/platforms/apple'; + const payload: Payload = {}; + if (typeof platformId !== 'undefined') { + payload['platformId'] = platformId; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof bundleIdentifier !== 'undefined') { + payload['bundleIdentifier'] = bundleIdentifier; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update an Apple platform by its unique ID. Use this endpoint to update the platform's name or bundle identifier. + * + * @param {string} params.platformId - Platform ID. + * @param {string} params.name - Platform name. Max length: 128 chars. + * @param {string} params.bundleIdentifier - Apple bundle identifier. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateApplePlatform(params: { platformId: string, name: string, bundleIdentifier: string }): Promise; + /** + * Update an Apple platform by its unique ID. Use this endpoint to update the platform's name or bundle identifier. + * + * @param {string} platformId - Platform ID. + * @param {string} name - Platform name. Max length: 128 chars. + * @param {string} bundleIdentifier - Apple bundle identifier. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateApplePlatform(platformId: string, name: string, bundleIdentifier: string): Promise; + updateApplePlatform( + paramsOrFirst: { platformId: string, name: string, bundleIdentifier: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { platformId: string, name: string, bundleIdentifier: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { platformId: string, name: string, bundleIdentifier: string }; + } else { + params = { + platformId: paramsOrFirst as string, + name: rest[0] as string, + bundleIdentifier: rest[1] as string + }; + } + + const platformId = params.platformId; + const name = params.name; + const bundleIdentifier = params.bundleIdentifier; + + if (typeof platformId === 'undefined') { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof bundleIdentifier === 'undefined') { + throw new AppwriteException('Missing required parameter: "bundleIdentifier"'); + } + + const apiPath = '/project/platforms/apple/{platformId}'.replace('{platformId}', platformId); + const payload: Payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof bundleIdentifier !== 'undefined') { + payload['bundleIdentifier'] = bundleIdentifier; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload, + ); + } + + /** + * Create a new Linux platform for your project. Use this endpoint to register a new Linux platform where your users will run your application which will interact with the Appwrite API. + * + * @param {string} params.platformId - Platform 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 - Platform name. Max length: 128 chars. + * @param {string} params.packageName - Linux package name. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + createLinuxPlatform(params: { platformId: string, name: string, packageName: string }): Promise; + /** + * Create a new Linux platform for your project. Use this endpoint to register a new Linux platform where your users will run your application which will interact with the Appwrite API. + * + * @param {string} platformId - Platform 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 - Platform name. Max length: 128 chars. + * @param {string} packageName - Linux package name. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createLinuxPlatform(platformId: string, name: string, packageName: string): Promise; + createLinuxPlatform( + paramsOrFirst: { platformId: string, name: string, packageName: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { platformId: string, name: string, packageName: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { platformId: string, name: string, packageName: string }; + } else { + params = { + platformId: paramsOrFirst as string, + name: rest[0] as string, + packageName: rest[1] as string + }; + } + + const platformId = params.platformId; + const name = params.name; + const packageName = params.packageName; + + if (typeof platformId === 'undefined') { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof packageName === 'undefined') { + throw new AppwriteException('Missing required parameter: "packageName"'); + } + + const apiPath = '/project/platforms/linux'; + const payload: Payload = {}; + if (typeof platformId !== 'undefined') { + payload['platformId'] = platformId; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof packageName !== 'undefined') { + payload['packageName'] = packageName; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update a Linux platform by its unique ID. Use this endpoint to update the platform's name or package name. + * + * @param {string} params.platformId - Platform ID. + * @param {string} params.name - Platform name. Max length: 128 chars. + * @param {string} params.packageName - Linux package name. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateLinuxPlatform(params: { platformId: string, name: string, packageName: string }): Promise; + /** + * Update a Linux platform by its unique ID. Use this endpoint to update the platform's name or package name. + * + * @param {string} platformId - Platform ID. + * @param {string} name - Platform name. Max length: 128 chars. + * @param {string} packageName - Linux package name. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateLinuxPlatform(platformId: string, name: string, packageName: string): Promise; + updateLinuxPlatform( + paramsOrFirst: { platformId: string, name: string, packageName: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { platformId: string, name: string, packageName: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { platformId: string, name: string, packageName: string }; + } else { + params = { + platformId: paramsOrFirst as string, + name: rest[0] as string, + packageName: rest[1] as string + }; + } + + const platformId = params.platformId; + const name = params.name; + const packageName = params.packageName; + + if (typeof platformId === 'undefined') { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof packageName === 'undefined') { + throw new AppwriteException('Missing required parameter: "packageName"'); + } + + const apiPath = '/project/platforms/linux/{platformId}'.replace('{platformId}', platformId); + const payload: Payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof packageName !== 'undefined') { + payload['packageName'] = packageName; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload, + ); + } + + /** + * Create a new web platform for your project. Use this endpoint to register a new platform where your users will run your application which will interact with the Appwrite API. + * + * @param {string} params.platformId - Platform 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 - Platform name. Max length: 128 chars. + * @param {string} params.hostname - Platform web hostname. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + createWebPlatform(params: { platformId: string, name: string, hostname: string }): Promise; + /** + * Create a new web platform for your project. Use this endpoint to register a new platform where your users will run your application which will interact with the Appwrite API. + * + * @param {string} platformId - Platform 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 - Platform name. Max length: 128 chars. + * @param {string} hostname - Platform web hostname. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createWebPlatform(platformId: string, name: string, hostname: string): Promise; + createWebPlatform( + paramsOrFirst: { platformId: string, name: string, hostname: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { platformId: string, name: string, hostname: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { platformId: string, name: string, hostname: string }; + } else { + params = { + platformId: paramsOrFirst as string, + name: rest[0] as string, + hostname: rest[1] as string + }; + } + + const platformId = params.platformId; + const name = params.name; + const hostname = params.hostname; + + if (typeof platformId === 'undefined') { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof hostname === 'undefined') { + throw new AppwriteException('Missing required parameter: "hostname"'); + } + + const apiPath = '/project/platforms/web'; + const payload: Payload = {}; + if (typeof platformId !== 'undefined') { + payload['platformId'] = platformId; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof hostname !== 'undefined') { + payload['hostname'] = hostname; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update a web platform by its unique ID. Use this endpoint to update the platform's name or hostname. + * + * @param {string} params.platformId - Platform ID. + * @param {string} params.name - Platform name. Max length: 128 chars. + * @param {string} params.hostname - Platform web hostname. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateWebPlatform(params: { platformId: string, name: string, hostname: string }): Promise; + /** + * Update a web platform by its unique ID. Use this endpoint to update the platform's name or hostname. + * + * @param {string} platformId - Platform ID. + * @param {string} name - Platform name. Max length: 128 chars. + * @param {string} hostname - Platform web hostname. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateWebPlatform(platformId: string, name: string, hostname: string): Promise; + updateWebPlatform( + paramsOrFirst: { platformId: string, name: string, hostname: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { platformId: string, name: string, hostname: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { platformId: string, name: string, hostname: string }; + } else { + params = { + platformId: paramsOrFirst as string, + name: rest[0] as string, + hostname: rest[1] as string + }; + } + + const platformId = params.platformId; + const name = params.name; + const hostname = params.hostname; + + if (typeof platformId === 'undefined') { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof hostname === 'undefined') { + throw new AppwriteException('Missing required parameter: "hostname"'); + } + + const apiPath = '/project/platforms/web/{platformId}'.replace('{platformId}', platformId); + const payload: Payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof hostname !== 'undefined') { + payload['hostname'] = hostname; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload, + ); + } + + /** + * Create a new Windows platform for your project. Use this endpoint to register a new Windows platform where your users will run your application which will interact with the Appwrite API. + * + * @param {string} params.platformId - Platform 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 - Platform name. Max length: 128 chars. + * @param {string} params.packageIdentifierName - Windows package identifier name. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + createWindowsPlatform(params: { platformId: string, name: string, packageIdentifierName: string }): Promise; + /** + * Create a new Windows platform for your project. Use this endpoint to register a new Windows platform where your users will run your application which will interact with the Appwrite API. + * + * @param {string} platformId - Platform 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 - Platform name. Max length: 128 chars. + * @param {string} packageIdentifierName - Windows package identifier name. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createWindowsPlatform(platformId: string, name: string, packageIdentifierName: string): Promise; + createWindowsPlatform( + paramsOrFirst: { platformId: string, name: string, packageIdentifierName: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { platformId: string, name: string, packageIdentifierName: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { platformId: string, name: string, packageIdentifierName: string }; + } else { + params = { + platformId: paramsOrFirst as string, + name: rest[0] as string, + packageIdentifierName: rest[1] as string + }; + } + + const platformId = params.platformId; + const name = params.name; + const packageIdentifierName = params.packageIdentifierName; + + if (typeof platformId === 'undefined') { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof packageIdentifierName === 'undefined') { + throw new AppwriteException('Missing required parameter: "packageIdentifierName"'); + } + + const apiPath = '/project/platforms/windows'; + const payload: Payload = {}; + if (typeof platformId !== 'undefined') { + payload['platformId'] = platformId; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof packageIdentifierName !== 'undefined') { + payload['packageIdentifierName'] = packageIdentifierName; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update a Windows platform by its unique ID. Use this endpoint to update the platform's name or package identifier name. + * + * @param {string} params.platformId - Platform ID. + * @param {string} params.name - Platform name. Max length: 128 chars. + * @param {string} params.packageIdentifierName - Windows package identifier name. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateWindowsPlatform(params: { platformId: string, name: string, packageIdentifierName: string }): Promise; + /** + * Update a Windows platform by its unique ID. Use this endpoint to update the platform's name or package identifier name. + * + * @param {string} platformId - Platform ID. + * @param {string} name - Platform name. Max length: 128 chars. + * @param {string} packageIdentifierName - Windows package identifier name. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateWindowsPlatform(platformId: string, name: string, packageIdentifierName: string): Promise; + updateWindowsPlatform( + paramsOrFirst: { platformId: string, name: string, packageIdentifierName: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { platformId: string, name: string, packageIdentifierName: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { platformId: string, name: string, packageIdentifierName: string }; + } else { + params = { + platformId: paramsOrFirst as string, + name: rest[0] as string, + packageIdentifierName: rest[1] as string + }; + } + + const platformId = params.platformId; + const name = params.name; + const packageIdentifierName = params.packageIdentifierName; + + if (typeof platformId === 'undefined') { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof packageIdentifierName === 'undefined') { + throw new AppwriteException('Missing required parameter: "packageIdentifierName"'); + } + + const apiPath = '/project/platforms/windows/{platformId}'.replace('{platformId}', platformId); + const payload: Payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof packageIdentifierName !== 'undefined') { + payload['packageIdentifierName'] = packageIdentifierName; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'put', + uri, + apiHeaders, + payload, + ); + } + + /** + * Get a platform by its unique ID. This endpoint returns the platform's details, including its name, type, and key configurations. + * + * @param {string} params.platformId - Platform ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + getPlatform(params: { platformId: string }): Promise; + /** + * Get a platform by its unique ID. This endpoint returns the platform's details, including its name, type, and key configurations. + * + * @param {string} platformId - Platform ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getPlatform(platformId: string): Promise; + getPlatform( + paramsOrFirst: { platformId: string } | string + ): Promise { + let params: { platformId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { platformId: string }; + } else { + params = { + platformId: paramsOrFirst as string + }; + } + + const platformId = params.platformId; + + if (typeof platformId === 'undefined') { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + + const apiPath = '/project/platforms/{platformId}'.replace('{platformId}', platformId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Delete a platform by its unique ID. This endpoint removes the platform and all its configurations from the project. + * + * @param {string} params.platformId - Platform ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deletePlatform(params: { platformId: string }): Promise<{}>; + /** + * Delete a platform by its unique ID. This endpoint removes the platform and all its configurations from the project. + * + * @param {string} platformId - Platform ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deletePlatform(platformId: string): Promise<{}>; + deletePlatform( + paramsOrFirst: { platformId: string } | string + ): Promise<{}> { + let params: { platformId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { platformId: string }; + } else { + params = { + platformId: paramsOrFirst as string + }; + } + + const platformId = params.platformId; + + if (typeof platformId === 'undefined') { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + + const apiPath = '/project/platforms/{platformId}'.replace('{platformId}', platformId); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the status of a specific protocol. Use this endpoint to enable or disable a protocol in your project. + * + * @param {ProtocolId} params.protocolId - Protocol name. Can be one of: rest, graphql, websocket + * @param {boolean} params.enabled - Protocol status. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateProtocolStatus(params: { protocolId: ProtocolId, enabled: boolean }): Promise; + /** + * Update the status of a specific protocol. Use this endpoint to enable or disable a protocol in your project. + * + * @param {ProtocolId} protocolId - Protocol name. Can be one of: rest, graphql, websocket + * @param {boolean} enabled - Protocol status. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateProtocolStatus(protocolId: ProtocolId, enabled: boolean): Promise; + updateProtocolStatus( + paramsOrFirst: { protocolId: ProtocolId, enabled: boolean } | ProtocolId, + ...rest: [(boolean)?] + ): Promise { + let params: { protocolId: ProtocolId, enabled: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('protocolId' in paramsOrFirst || 'enabled' in paramsOrFirst))) { + params = (paramsOrFirst || {}) as { protocolId: ProtocolId, enabled: boolean }; + } else { + params = { + protocolId: paramsOrFirst as ProtocolId, + enabled: rest[0] as boolean + }; + } + + const protocolId = params.protocolId; + const enabled = params.enabled; + + if (typeof protocolId === 'undefined') { + throw new AppwriteException('Missing required parameter: "protocolId"'); + } + if (typeof enabled === 'undefined') { + throw new AppwriteException('Missing required parameter: "enabled"'); + } + + const apiPath = '/project/protocols/{protocolId}/status'.replace('{protocolId}', protocolId); + const payload: Payload = {}; + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update the status of a specific service. Use this endpoint to enable or disable a service in your project. + * + * @param {ServiceId} params.serviceId - Service name. Can be one of: account, avatars, databases, tablesdb, locale, health, project, storage, teams, users, vcs, sites, functions, proxy, graphql, migrations, messaging + * @param {boolean} params.enabled - Service status. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateServiceStatus(params: { serviceId: ServiceId, enabled: boolean }): Promise; + /** + * Update the status of a specific service. Use this endpoint to enable or disable a service in your project. + * + * @param {ServiceId} serviceId - Service name. Can be one of: account, avatars, databases, tablesdb, locale, health, project, storage, teams, users, vcs, sites, functions, proxy, graphql, migrations, messaging + * @param {boolean} enabled - Service status. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateServiceStatus(serviceId: ServiceId, enabled: boolean): Promise; + updateServiceStatus( + paramsOrFirst: { serviceId: ServiceId, enabled: boolean } | ServiceId, + ...rest: [(boolean)?] + ): Promise { + let params: { serviceId: ServiceId, enabled: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('serviceId' in paramsOrFirst || 'enabled' in paramsOrFirst))) { + params = (paramsOrFirst || {}) as { serviceId: ServiceId, enabled: boolean }; + } else { + params = { + serviceId: paramsOrFirst as ServiceId, + enabled: rest[0] as boolean + }; + } + + const serviceId = params.serviceId; + const enabled = params.enabled; + + if (typeof serviceId === 'undefined') { + throw new AppwriteException('Missing required parameter: "serviceId"'); + } + if (typeof enabled === 'undefined') { + throw new AppwriteException('Missing required parameter: "enabled"'); + } + + const apiPath = '/project/services/{serviceId}/status'.replace('{serviceId}', serviceId); + const payload: Payload = {}; + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + /** * Get a list of all project environment variables. * diff --git a/src/services/tables-db.ts b/src/services/tables-db.ts index 509e7554..6ec5cf43 100644 --- a/src/services/tables-db.ts +++ b/src/services/tables-db.ts @@ -906,10 +906,11 @@ export class TablesDB { * @param {string[]} params.permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} params.rowSecurity - Enables configuring permissions for individual rows. A user needs one of row or table-level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} params.enabled - Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled. + * @param {boolean} params.purge - When true, purge all cached list responses for this table as part of the update. Use this to force readers to see fresh data immediately instead of waiting for the cache TTL to expire. * @throws {AppwriteException} * @returns {Promise} */ - updateTable(params: { databaseId: string, tableId: string, name?: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean }): Promise; + updateTable(params: { databaseId: string, tableId: string, name?: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean, purge?: boolean }): Promise; /** * Update a table by its unique ID. * @@ -919,19 +920,20 @@ export class TablesDB { * @param {string[]} permissions - An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} rowSecurity - Enables configuring permissions for individual rows. A user needs one of row or table-level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions). * @param {boolean} enabled - Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled. + * @param {boolean} purge - When true, purge all cached list responses for this table as part of the update. Use this to force readers to see fresh data immediately instead of waiting for the cache TTL to expire. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateTable(databaseId: string, tableId: string, name?: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean): Promise; + updateTable(databaseId: string, tableId: string, name?: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean, purge?: boolean): Promise; updateTable( - paramsOrFirst: { databaseId: string, tableId: string, name?: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean } | string, - ...rest: [(string)?, (string)?, (string[])?, (boolean)?, (boolean)?] + paramsOrFirst: { databaseId: string, tableId: string, name?: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean, purge?: boolean } | string, + ...rest: [(string)?, (string)?, (string[])?, (boolean)?, (boolean)?, (boolean)?] ): Promise { - let params: { databaseId: string, tableId: string, name?: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean }; + let params: { databaseId: string, tableId: string, name?: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean, purge?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, name?: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean }; + params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, name?: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean, purge?: boolean }; } else { params = { databaseId: paramsOrFirst as string, @@ -939,7 +941,8 @@ export class TablesDB { name: rest[1] as string, permissions: rest[2] as string[], rowSecurity: rest[3] as boolean, - enabled: rest[4] as boolean + enabled: rest[4] as boolean, + purge: rest[5] as boolean }; } @@ -949,6 +952,7 @@ export class TablesDB { const permissions = params.permissions; const rowSecurity = params.rowSecurity; const enabled = params.enabled; + const purge = params.purge; if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); @@ -971,6 +975,9 @@ export class TablesDB { if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } + if (typeof purge !== 'undefined') { + payload['purge'] = purge; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -4933,7 +4940,7 @@ export class TablesDB { * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. * @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction. * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. - * @param {number} params.ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). + * @param {number} params.ttl - TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, table, schema version (columns and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; row writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours). * @throws {AppwriteException} * @returns {Promise>} */ @@ -4946,7 +4953,7 @@ export class TablesDB { * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. * @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction. * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. - * @param {number} ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). + * @param {number} ttl - TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, table, schema version (columns and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; row writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours). * @throws {AppwriteException} * @returns {Promise>} * @deprecated Use the object parameter style method for a better developer experience. diff --git a/src/services/webhooks.ts b/src/services/webhooks.ts index daa78ce0..ddad942e 100644 --- a/src/services/webhooks.ts +++ b/src/services/webhooks.ts @@ -12,7 +12,7 @@ export class Webhooks { /** * Get a list of all webhooks belonging to the project. You can use the query params to filter your results. * - * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, url, httpUser, security, events, enabled, logs, attempts + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, url, authUsername, tls, events, enabled, logs, attempts * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise} @@ -21,7 +21,7 @@ export class Webhooks { /** * Get a list of all webhooks belonging to the project. You can use the query params to filter your results. * - * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, url, httpUser, security, events, enabled, logs, attempts + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, url, authUsername, tls, events, enabled, logs, attempts * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise} @@ -76,13 +76,14 @@ export class Webhooks { * @param {string} params.name - Webhook name. Max length: 128 chars. * @param {string[]} params.events - Events list. Maximum of 100 events are allowed. * @param {boolean} params.enabled - Enable or disable a webhook. - * @param {boolean} params.security - Certificate verification, false for disabled or true for enabled. - * @param {string} params.httpUser - Webhook HTTP user. Max length: 256 chars. - * @param {string} params.httpPass - Webhook HTTP password. Max length: 256 chars. + * @param {boolean} params.tls - Certificate verification, false for disabled or true for enabled. + * @param {string} params.authUsername - Webhook HTTP user. Max length: 256 chars. + * @param {string} params.authPassword - Webhook HTTP password. Max length: 256 chars. + * @param {string} params.secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters. * @throws {AppwriteException} * @returns {Promise} */ - create(params: { webhookId: string, url: string, name: string, events: string[], enabled?: boolean, security?: boolean, httpUser?: string, httpPass?: string }): Promise; + create(params: { webhookId: string, url: string, name: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string, secret?: string }): Promise; /** * Create a new webhook. Use this endpoint to configure a URL that will receive events from Appwrite when specific events occur. * @@ -91,22 +92,23 @@ export class Webhooks { * @param {string} name - Webhook name. Max length: 128 chars. * @param {string[]} events - Events list. Maximum of 100 events are allowed. * @param {boolean} enabled - Enable or disable a webhook. - * @param {boolean} security - Certificate verification, false for disabled or true for enabled. - * @param {string} httpUser - Webhook HTTP user. Max length: 256 chars. - * @param {string} httpPass - Webhook HTTP password. Max length: 256 chars. + * @param {boolean} tls - Certificate verification, false for disabled or true for enabled. + * @param {string} authUsername - Webhook HTTP user. Max length: 256 chars. + * @param {string} authPassword - Webhook HTTP password. Max length: 256 chars. + * @param {string} secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - create(webhookId: string, url: string, name: string, events: string[], enabled?: boolean, security?: boolean, httpUser?: string, httpPass?: string): Promise; + create(webhookId: string, url: string, name: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string, secret?: string): Promise; create( - paramsOrFirst: { webhookId: string, url: string, name: string, events: string[], enabled?: boolean, security?: boolean, httpUser?: string, httpPass?: string } | string, - ...rest: [(string)?, (string)?, (string[])?, (boolean)?, (boolean)?, (string)?, (string)?] + paramsOrFirst: { webhookId: string, url: string, name: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string, secret?: string } | string, + ...rest: [(string)?, (string)?, (string[])?, (boolean)?, (boolean)?, (string)?, (string)?, (string)?] ): Promise { - let params: { webhookId: string, url: string, name: string, events: string[], enabled?: boolean, security?: boolean, httpUser?: string, httpPass?: string }; + let params: { webhookId: string, url: string, name: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string, secret?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { webhookId: string, url: string, name: string, events: string[], enabled?: boolean, security?: boolean, httpUser?: string, httpPass?: string }; + params = (paramsOrFirst || {}) as { webhookId: string, url: string, name: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string, secret?: string }; } else { params = { webhookId: paramsOrFirst as string, @@ -114,9 +116,10 @@ export class Webhooks { name: rest[1] as string, events: rest[2] as string[], enabled: rest[3] as boolean, - security: rest[4] as boolean, - httpUser: rest[5] as string, - httpPass: rest[6] as string + tls: rest[4] as boolean, + authUsername: rest[5] as string, + authPassword: rest[6] as string, + secret: rest[7] as string }; } @@ -125,9 +128,10 @@ export class Webhooks { const name = params.name; const events = params.events; const enabled = params.enabled; - const security = params.security; - const httpUser = params.httpUser; - const httpPass = params.httpPass; + const tls = params.tls; + const authUsername = params.authUsername; + const authPassword = params.authPassword; + const secret = params.secret; if (typeof webhookId === 'undefined') { throw new AppwriteException('Missing required parameter: "webhookId"'); @@ -159,14 +163,17 @@ export class Webhooks { if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - if (typeof security !== 'undefined') { - payload['security'] = security; + if (typeof tls !== 'undefined') { + payload['tls'] = tls; + } + if (typeof authUsername !== 'undefined') { + payload['authUsername'] = authUsername; } - if (typeof httpUser !== 'undefined') { - payload['httpUser'] = httpUser; + if (typeof authPassword !== 'undefined') { + payload['authPassword'] = authPassword; } - if (typeof httpPass !== 'undefined') { - payload['httpPass'] = httpPass; + if (typeof secret !== 'undefined') { + payload['secret'] = secret; } const uri = new URL(this.client.config.endpoint + apiPath); @@ -241,13 +248,13 @@ export class Webhooks { * @param {string} params.url - Webhook URL. * @param {string[]} params.events - Events list. Maximum of 100 events are allowed. * @param {boolean} params.enabled - Enable or disable a webhook. - * @param {boolean} params.security - Certificate verification, false for disabled or true for enabled. - * @param {string} params.httpUser - Webhook HTTP user. Max length: 256 chars. - * @param {string} params.httpPass - Webhook HTTP password. Max length: 256 chars. + * @param {boolean} params.tls - Certificate verification, false for disabled or true for enabled. + * @param {string} params.authUsername - Webhook HTTP user. Max length: 256 chars. + * @param {string} params.authPassword - Webhook HTTP password. Max length: 256 chars. * @throws {AppwriteException} * @returns {Promise} */ - update(params: { webhookId: string, name: string, url: string, events: string[], enabled?: boolean, security?: boolean, httpUser?: string, httpPass?: string }): Promise; + update(params: { webhookId: string, name: string, url: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string }): Promise; /** * Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook. * @@ -256,22 +263,22 @@ export class Webhooks { * @param {string} url - Webhook URL. * @param {string[]} events - Events list. Maximum of 100 events are allowed. * @param {boolean} enabled - Enable or disable a webhook. - * @param {boolean} security - Certificate verification, false for disabled or true for enabled. - * @param {string} httpUser - Webhook HTTP user. Max length: 256 chars. - * @param {string} httpPass - Webhook HTTP password. Max length: 256 chars. + * @param {boolean} tls - Certificate verification, false for disabled or true for enabled. + * @param {string} authUsername - Webhook HTTP user. Max length: 256 chars. + * @param {string} authPassword - Webhook HTTP password. Max length: 256 chars. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - update(webhookId: string, name: string, url: string, events: string[], enabled?: boolean, security?: boolean, httpUser?: string, httpPass?: string): Promise; + update(webhookId: string, name: string, url: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string): Promise; update( - paramsOrFirst: { webhookId: string, name: string, url: string, events: string[], enabled?: boolean, security?: boolean, httpUser?: string, httpPass?: string } | string, + paramsOrFirst: { webhookId: string, name: string, url: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string } | string, ...rest: [(string)?, (string)?, (string[])?, (boolean)?, (boolean)?, (string)?, (string)?] ): Promise { - let params: { webhookId: string, name: string, url: string, events: string[], enabled?: boolean, security?: boolean, httpUser?: string, httpPass?: string }; + let params: { webhookId: string, name: string, url: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { webhookId: string, name: string, url: string, events: string[], enabled?: boolean, security?: boolean, httpUser?: string, httpPass?: string }; + params = (paramsOrFirst || {}) as { webhookId: string, name: string, url: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string }; } else { params = { webhookId: paramsOrFirst as string, @@ -279,9 +286,9 @@ export class Webhooks { url: rest[1] as string, events: rest[2] as string[], enabled: rest[3] as boolean, - security: rest[4] as boolean, - httpUser: rest[5] as string, - httpPass: rest[6] as string + tls: rest[4] as boolean, + authUsername: rest[5] as string, + authPassword: rest[6] as string }; } @@ -290,9 +297,9 @@ export class Webhooks { const url = params.url; const events = params.events; const enabled = params.enabled; - const security = params.security; - const httpUser = params.httpUser; - const httpPass = params.httpPass; + const tls = params.tls; + const authUsername = params.authUsername; + const authPassword = params.authPassword; if (typeof webhookId === 'undefined') { throw new AppwriteException('Missing required parameter: "webhookId"'); @@ -321,14 +328,14 @@ export class Webhooks { if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } - if (typeof security !== 'undefined') { - payload['security'] = security; + if (typeof tls !== 'undefined') { + payload['tls'] = tls; } - if (typeof httpUser !== 'undefined') { - payload['httpUser'] = httpUser; + if (typeof authUsername !== 'undefined') { + payload['authUsername'] = authUsername; } - if (typeof httpPass !== 'undefined') { - payload['httpPass'] = httpPass; + if (typeof authPassword !== 'undefined') { + payload['authPassword'] = authPassword; } const uri = new URL(this.client.config.endpoint + apiPath); @@ -397,43 +404,51 @@ export class Webhooks { } /** - * Update the webhook signature key. This endpoint can be used to regenerate the signature key used to sign and validate payload deliveries for a specific webhook. + * Update the webhook signing key. This endpoint can be used to regenerate the signing key used to sign and validate payload deliveries for a specific webhook. * * @param {string} params.webhookId - Webhook ID. + * @param {string} params.secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters. * @throws {AppwriteException} * @returns {Promise} */ - updateSignature(params: { webhookId: string }): Promise; + updateSecret(params: { webhookId: string, secret?: string }): Promise; /** - * Update the webhook signature key. This endpoint can be used to regenerate the signature key used to sign and validate payload deliveries for a specific webhook. + * Update the webhook signing key. This endpoint can be used to regenerate the signing key used to sign and validate payload deliveries for a specific webhook. * * @param {string} webhookId - Webhook ID. + * @param {string} secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateSignature(webhookId: string): Promise; - updateSignature( - paramsOrFirst: { webhookId: string } | string + updateSecret(webhookId: string, secret?: string): Promise; + updateSecret( + paramsOrFirst: { webhookId: string, secret?: string } | string, + ...rest: [(string)?] ): Promise { - let params: { webhookId: string }; + let params: { webhookId: string, secret?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { webhookId: string }; + params = (paramsOrFirst || {}) as { webhookId: string, secret?: string }; } else { params = { - webhookId: paramsOrFirst as string + webhookId: paramsOrFirst as string, + secret: rest[0] as string }; } const webhookId = params.webhookId; + const secret = params.secret; if (typeof webhookId === 'undefined') { throw new AppwriteException('Missing required parameter: "webhookId"'); } - const apiPath = '/webhooks/{webhookId}/signature'.replace('{webhookId}', webhookId); + const apiPath = '/webhooks/{webhookId}/secret'.replace('{webhookId}', webhookId); const payload: Payload = {}; + if (typeof secret !== 'undefined') { + payload['secret'] = secret; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { diff --git a/test/services/databases.test.js b/test/services/databases.test.js index ff809d28..6ed0b897 100644 --- a/test/services/databases.test.js +++ b/test/services/databases.test.js @@ -435,7 +435,7 @@ describe('Databases', () => { '', '', true, - '', + '2020-10-15T06:38:00.000+00:00', ); // Remove custom toString method on the objects to allow for clean data comparison. diff --git a/test/services/project.test.js b/test/services/project.test.js index 81c53b5e..6e273b69 100644 --- a/test/services/project.test.js +++ b/test/services/project.test.js @@ -10,6 +10,655 @@ describe('Project', () => { const project = new Project(client); + test('test method listKeys()', async () => { + const data = { + 'total': 5, + 'keys': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.listKeys( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method createKey()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My API Key', + 'expire': '2020-10-15T06:38:00.000+00:00', + 'scopes': [], + 'secret': '919c2d18fb5d4...a2ae413da83346ad2', + 'accessedAt': '2020-10-15T06:38:00.000+00:00', + 'sdks': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.createKey( + '', + '', + [], + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method getKey()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My API Key', + 'expire': '2020-10-15T06:38:00.000+00:00', + 'scopes': [], + 'secret': '919c2d18fb5d4...a2ae413da83346ad2', + 'accessedAt': '2020-10-15T06:38:00.000+00:00', + 'sdks': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.getKey( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateKey()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My API Key', + 'expire': '2020-10-15T06:38:00.000+00:00', + 'scopes': [], + 'secret': '919c2d18fb5d4...a2ae413da83346ad2', + 'accessedAt': '2020-10-15T06:38:00.000+00:00', + 'sdks': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateKey( + '', + '', + [], + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method deleteKey()', async () => { + const data = {message: ""}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.deleteKey( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateLabels()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'New Project', + 'description': 'This is a new project.', + 'teamId': '1592981250', + 'logo': '5f5c451b403cb', + 'url': '5f5c451b403cb', + 'legalName': 'Company LTD.', + 'legalCountry': 'US', + 'legalState': 'New York', + 'legalCity': 'New York City.', + 'legalAddress': '620 Eighth Avenue, New York, NY 10018', + 'legalTaxId': '131102020', + 'authDuration': 60, + 'authLimit': 100, + 'authSessionsLimit': 10, + 'authPasswordHistory': 5, + 'authPasswordDictionary': true, + 'authPersonalDataCheck': true, + 'authDisposableEmails': true, + 'authCanonicalEmails': true, + 'authFreeEmails': true, + 'authMockNumbers': [], + 'authSessionAlerts': true, + 'authMembershipsUserName': true, + 'authMembershipsUserEmail': true, + 'authMembershipsMfa': true, + 'authInvalidateSessions': true, + 'oAuthProviders': [], + 'platforms': [], + 'webhooks': [], + 'keys': [], + 'devKeys': [], + 'smtpEnabled': true, + 'smtpSenderName': 'John Appwrite', + 'smtpSenderEmail': 'john@appwrite.io', + 'smtpReplyTo': 'support@appwrite.io', + 'smtpHost': 'mail.appwrite.io', + 'smtpPort': 25, + 'smtpUsername': 'emailuser', + 'smtpPassword': 'securepassword', + 'smtpSecure': 'tls', + 'pingCount': 1, + 'pingedAt': '2020-10-15T06:38:00.000+00:00', + 'labels': [], + 'status': 'active', + 'authEmailPassword': true, + 'authUsersAuthMagicURL': true, + 'authEmailOtp': true, + 'authAnonymous': true, + 'authInvites': true, + 'authJWT': true, + 'authPhone': true, + 'serviceStatusForAccount': true, + 'serviceStatusForAvatars': true, + 'serviceStatusForDatabases': true, + 'serviceStatusForTablesdb': true, + 'serviceStatusForLocale': true, + 'serviceStatusForHealth': true, + 'serviceStatusForProject': true, + 'serviceStatusForStorage': true, + 'serviceStatusForTeams': true, + 'serviceStatusForUsers': true, + 'serviceStatusForVcs': true, + 'serviceStatusForSites': true, + 'serviceStatusForFunctions': true, + 'serviceStatusForProxy': true, + 'serviceStatusForGraphql': true, + 'serviceStatusForMigrations': true, + 'serviceStatusForMessaging': true, + 'protocolStatusForRest': true, + 'protocolStatusForGraphql': true, + 'protocolStatusForWebsocket': true, + 'region': 'fra', + 'billingLimits': {}, + 'blocks': [], + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateLabels( + [], + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method listPlatforms()', async () => { + const data = { + 'total': 5, + 'platforms': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.listPlatforms( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method createAndroidPlatform()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Web App', + 'type': 'web', + 'applicationId': 'com.company.appname',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.createAndroidPlatform( + '', + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateAndroidPlatform()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Web App', + 'type': 'web', + 'applicationId': 'com.company.appname',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateAndroidPlatform( + '', + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method createApplePlatform()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Web App', + 'type': 'web', + 'bundleIdentifier': 'com.company.appname',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.createApplePlatform( + '', + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateApplePlatform()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Web App', + 'type': 'web', + 'bundleIdentifier': 'com.company.appname',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateApplePlatform( + '', + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method createLinuxPlatform()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Web App', + 'type': 'web', + 'packageName': 'com.company.appname',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.createLinuxPlatform( + '', + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateLinuxPlatform()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Web App', + 'type': 'web', + 'packageName': 'com.company.appname',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateLinuxPlatform( + '', + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method createWebPlatform()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Web App', + 'type': 'web', + 'hostname': 'app.example.com',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.createWebPlatform( + '', + '', + 'app.example.com', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateWebPlatform()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Web App', + 'type': 'web', + 'hostname': 'app.example.com',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateWebPlatform( + '', + '', + 'app.example.com', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method createWindowsPlatform()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Web App', + 'type': 'web', + 'packageIdentifierName': 'com.company.appname',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.createWindowsPlatform( + '', + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateWindowsPlatform()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Web App', + 'type': 'web', + 'packageIdentifierName': 'com.company.appname',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateWindowsPlatform( + '', + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method getPlatform()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Web App', + 'type': 'web', + 'hostname': 'app.example.com',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.getPlatform( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method deletePlatform()', async () => { + const data = {message: ""}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.deletePlatform( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateProtocolStatus()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'New Project', + 'description': 'This is a new project.', + 'teamId': '1592981250', + 'logo': '5f5c451b403cb', + 'url': '5f5c451b403cb', + 'legalName': 'Company LTD.', + 'legalCountry': 'US', + 'legalState': 'New York', + 'legalCity': 'New York City.', + 'legalAddress': '620 Eighth Avenue, New York, NY 10018', + 'legalTaxId': '131102020', + 'authDuration': 60, + 'authLimit': 100, + 'authSessionsLimit': 10, + 'authPasswordHistory': 5, + 'authPasswordDictionary': true, + 'authPersonalDataCheck': true, + 'authDisposableEmails': true, + 'authCanonicalEmails': true, + 'authFreeEmails': true, + 'authMockNumbers': [], + 'authSessionAlerts': true, + 'authMembershipsUserName': true, + 'authMembershipsUserEmail': true, + 'authMembershipsMfa': true, + 'authInvalidateSessions': true, + 'oAuthProviders': [], + 'platforms': [], + 'webhooks': [], + 'keys': [], + 'devKeys': [], + 'smtpEnabled': true, + 'smtpSenderName': 'John Appwrite', + 'smtpSenderEmail': 'john@appwrite.io', + 'smtpReplyTo': 'support@appwrite.io', + 'smtpHost': 'mail.appwrite.io', + 'smtpPort': 25, + 'smtpUsername': 'emailuser', + 'smtpPassword': 'securepassword', + 'smtpSecure': 'tls', + 'pingCount': 1, + 'pingedAt': '2020-10-15T06:38:00.000+00:00', + 'labels': [], + 'status': 'active', + 'authEmailPassword': true, + 'authUsersAuthMagicURL': true, + 'authEmailOtp': true, + 'authAnonymous': true, + 'authInvites': true, + 'authJWT': true, + 'authPhone': true, + 'serviceStatusForAccount': true, + 'serviceStatusForAvatars': true, + 'serviceStatusForDatabases': true, + 'serviceStatusForTablesdb': true, + 'serviceStatusForLocale': true, + 'serviceStatusForHealth': true, + 'serviceStatusForProject': true, + 'serviceStatusForStorage': true, + 'serviceStatusForTeams': true, + 'serviceStatusForUsers': true, + 'serviceStatusForVcs': true, + 'serviceStatusForSites': true, + 'serviceStatusForFunctions': true, + 'serviceStatusForProxy': true, + 'serviceStatusForGraphql': true, + 'serviceStatusForMigrations': true, + 'serviceStatusForMessaging': true, + 'protocolStatusForRest': true, + 'protocolStatusForGraphql': true, + 'protocolStatusForWebsocket': true, + 'region': 'fra', + 'billingLimits': {}, + 'blocks': [], + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateProtocolStatus( + 'rest', + true, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateServiceStatus()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'New Project', + 'description': 'This is a new project.', + 'teamId': '1592981250', + 'logo': '5f5c451b403cb', + 'url': '5f5c451b403cb', + 'legalName': 'Company LTD.', + 'legalCountry': 'US', + 'legalState': 'New York', + 'legalCity': 'New York City.', + 'legalAddress': '620 Eighth Avenue, New York, NY 10018', + 'legalTaxId': '131102020', + 'authDuration': 60, + 'authLimit': 100, + 'authSessionsLimit': 10, + 'authPasswordHistory': 5, + 'authPasswordDictionary': true, + 'authPersonalDataCheck': true, + 'authDisposableEmails': true, + 'authCanonicalEmails': true, + 'authFreeEmails': true, + 'authMockNumbers': [], + 'authSessionAlerts': true, + 'authMembershipsUserName': true, + 'authMembershipsUserEmail': true, + 'authMembershipsMfa': true, + 'authInvalidateSessions': true, + 'oAuthProviders': [], + 'platforms': [], + 'webhooks': [], + 'keys': [], + 'devKeys': [], + 'smtpEnabled': true, + 'smtpSenderName': 'John Appwrite', + 'smtpSenderEmail': 'john@appwrite.io', + 'smtpReplyTo': 'support@appwrite.io', + 'smtpHost': 'mail.appwrite.io', + 'smtpPort': 25, + 'smtpUsername': 'emailuser', + 'smtpPassword': 'securepassword', + 'smtpSecure': 'tls', + 'pingCount': 1, + 'pingedAt': '2020-10-15T06:38:00.000+00:00', + 'labels': [], + 'status': 'active', + 'authEmailPassword': true, + 'authUsersAuthMagicURL': true, + 'authEmailOtp': true, + 'authAnonymous': true, + 'authInvites': true, + 'authJWT': true, + 'authPhone': true, + 'serviceStatusForAccount': true, + 'serviceStatusForAvatars': true, + 'serviceStatusForDatabases': true, + 'serviceStatusForTablesdb': true, + 'serviceStatusForLocale': true, + 'serviceStatusForHealth': true, + 'serviceStatusForProject': true, + 'serviceStatusForStorage': true, + 'serviceStatusForTeams': true, + 'serviceStatusForUsers': true, + 'serviceStatusForVcs': true, + 'serviceStatusForSites': true, + 'serviceStatusForFunctions': true, + 'serviceStatusForProxy': true, + 'serviceStatusForGraphql': true, + 'serviceStatusForMigrations': true, + 'serviceStatusForMessaging': true, + 'protocolStatusForRest': true, + 'protocolStatusForGraphql': true, + 'protocolStatusForWebsocket': true, + 'region': 'fra', + 'billingLimits': {}, + 'blocks': [], + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateServiceStatus( + 'account', + true, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method listVariables()', async () => { const data = { 'total': 5, diff --git a/test/services/tables-d-b.test.js b/test/services/tables-d-b.test.js index 8b475203..02012d43 100644 --- a/test/services/tables-d-b.test.js +++ b/test/services/tables-d-b.test.js @@ -435,7 +435,7 @@ describe('TablesDB', () => { '', '', true, - '', + '2020-10-15T06:38:00.000+00:00', ); // Remove custom toString method on the objects to allow for clean data comparison. diff --git a/test/services/webhooks.test.js b/test/services/webhooks.test.js index 642b4a73..d254ef7f 100644 --- a/test/services/webhooks.test.js +++ b/test/services/webhooks.test.js @@ -33,10 +33,10 @@ describe('Webhooks', () => { 'name': 'My Webhook', 'url': 'https://example.com/webhook', 'events': [], - 'security': true, - 'httpUser': 'username', - 'httpPass': 'password', - 'signatureKey': 'ad3d581ca230e2b7059c545e5a', + 'tls': true, + 'authUsername': 'username', + 'authPassword': 'password', + 'secret': 'ad3d581ca230e2b7059c545e5a', 'enabled': true, 'logs': 'Failed to connect to remote server.', 'attempts': 10,}; @@ -63,10 +63,10 @@ describe('Webhooks', () => { 'name': 'My Webhook', 'url': 'https://example.com/webhook', 'events': [], - 'security': true, - 'httpUser': 'username', - 'httpPass': 'password', - 'signatureKey': 'ad3d581ca230e2b7059c545e5a', + 'tls': true, + 'authUsername': 'username', + 'authPassword': 'password', + 'secret': 'ad3d581ca230e2b7059c545e5a', 'enabled': true, 'logs': 'Failed to connect to remote server.', 'attempts': 10,}; @@ -90,10 +90,10 @@ describe('Webhooks', () => { 'name': 'My Webhook', 'url': 'https://example.com/webhook', 'events': [], - 'security': true, - 'httpUser': 'username', - 'httpPass': 'password', - 'signatureKey': 'ad3d581ca230e2b7059c545e5a', + 'tls': true, + 'authUsername': 'username', + 'authPassword': 'password', + 'secret': 'ad3d581ca230e2b7059c545e5a', 'enabled': true, 'logs': 'Failed to connect to remote server.', 'attempts': 10,}; @@ -126,7 +126,7 @@ describe('Webhooks', () => { expect(response).toEqual(data); }); - test('test method updateSignature()', async () => { + test('test method updateSecret()', async () => { const data = { '\$id': '5e5ea5c16897e', '\$createdAt': '2020-10-15T06:38:00.000+00:00', @@ -134,16 +134,16 @@ describe('Webhooks', () => { 'name': 'My Webhook', 'url': 'https://example.com/webhook', 'events': [], - 'security': true, - 'httpUser': 'username', - 'httpPass': 'password', - 'signatureKey': 'ad3d581ca230e2b7059c545e5a', + 'tls': true, + 'authUsername': 'username', + 'authPassword': 'password', + 'secret': 'ad3d581ca230e2b7059c545e5a', 'enabled': true, 'logs': 'Failed to connect to remote server.', 'attempts': 10,}; mockedFetch.mockImplementation(() => Response.json(data)); - const response = await webhooks.updateSignature( + const response = await webhooks.updateSecret( '', );