diff --git a/CHANGELOG.md b/CHANGELOG.md index fc358534..6b5d09b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Change Log +## 28.0.0 + +* Breaking: removed `account.createJWT`; use `users.createJWT` instead. A leaked JWT could mint further JWTs, letting a credential outlive its own expiry — a session cannot duplicate itself to live forever either +* Breaking: removed `project.createKey`. A leaked key could mint further hidden keys, making a compromise far harder to contain and revoke +* Breaking: `activities.listEvents` `queries` now takes an array instead of a string +* Added: `embeddings` service with `createTextEmbeddings`, plus the `EmbeddingModel` enum +* Added: TablesDB migration methods `listMigrations`, `createMigration`, `getMigration`, `deleteMigration`, `cutoverMigration`, and `listOperations` +* Added: `proxy.createInvalidation` for purging cached edge responses, plus the `InvalidationType` enum +* Added: `apps.deleteInstallation` +* Added: `users.getMFAChallenge` and the `MfaChallengeSecret` model +* Added: `project.updateMFAFactorsPolicy` and the `PolicyMfaFactors` model +* Added: `client.setOrganization` for organization-scoped requests +* Added: `folder` parameter to `storage.createFile` +* Added: `syncMode` parameter to `tablesDB.create` and `tablesDB.update`, and `specification` to `tablesDB.update` +* Added: `installationScopes` parameter to `project.updateOAuth2Server` +* Added: `custom` authentication factor, `node-26` runtime, `mfa-factors` project policy, and the `embeddings.write` and `proxy.invalidations.write` key scopes +* Updated: response format to `1.9.6` + ## 27.1.0 * Added: `Apps` service for managing OAuth2 applications, keys, and installations diff --git a/README.md b/README.md index 62fd49f6..714b8bda 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.5-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-1.9.6-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/activities/list-events.md b/docs/examples/activities/list-events.md index 11407e89..99263951 100644 --- a/docs/examples/activities/list-events.md +++ b/docs/examples/activities/list-events.md @@ -9,6 +9,6 @@ const client = new sdk.Client() const activities = new sdk.Activities(client); const result = await activities.listEvents({ - queries: '' // optional + queries: [] // optional }); ``` diff --git a/docs/examples/apps/create-installation-token.md b/docs/examples/apps/create-installation-token.md index f60d495b..2b414528 100644 --- a/docs/examples/apps/create-installation-token.md +++ b/docs/examples/apps/create-installation-token.md @@ -4,7 +4,7 @@ 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 + .setSession(''); // The user session to authenticate with const apps = new sdk.Apps(client); diff --git a/docs/examples/account/create-jwt.md b/docs/examples/apps/delete-installation.md similarity index 66% rename from docs/examples/account/create-jwt.md rename to docs/examples/apps/delete-installation.md index c7204e0f..b9933fb9 100644 --- a/docs/examples/account/create-jwt.md +++ b/docs/examples/apps/delete-installation.md @@ -6,9 +6,10 @@ const client = new sdk.Client() .setProject('') // Your project ID .setSession(''); // The user session to authenticate with -const account = new sdk.Account(client); +const apps = new sdk.Apps(client); -const result = await account.createJWT({ - duration: 0 // optional +const result = await apps.deleteInstallation({ + appId: '', + installationId: '' }); ``` diff --git a/docs/examples/apps/get-installation.md b/docs/examples/apps/get-installation.md index eb483b23..ceddee24 100644 --- a/docs/examples/apps/get-installation.md +++ b/docs/examples/apps/get-installation.md @@ -4,7 +4,7 @@ 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 + .setSession(''); // The user session to authenticate with const apps = new sdk.Apps(client); diff --git a/docs/examples/apps/list-installations.md b/docs/examples/apps/list-installations.md index e410f666..4bb71973 100644 --- a/docs/examples/apps/list-installations.md +++ b/docs/examples/apps/list-installations.md @@ -4,7 +4,7 @@ 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 + .setSession(''); // The user session to authenticate with const apps = new sdk.Apps(client); diff --git a/docs/examples/embeddings/create-text-embeddings.md b/docs/examples/embeddings/create-text-embeddings.md new file mode 100644 index 00000000..5beebf51 --- /dev/null +++ b/docs/examples/embeddings/create-text-embeddings.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 embeddings = new sdk.Embeddings(client); + +const result = await embeddings.createTextEmbeddings({ + texts: [], + model: sdk.EmbeddingModel.NomicEmbedText // optional +}); +``` diff --git a/docs/examples/project/create-key.md b/docs/examples/project/update-mfa-factors-policy.md similarity index 63% rename from docs/examples/project/create-key.md rename to docs/examples/project/update-mfa-factors-policy.md index 362821b3..5fea9961 100644 --- a/docs/examples/project/create-key.md +++ b/docs/examples/project/update-mfa-factors-policy.md @@ -8,10 +8,10 @@ const client = new sdk.Client() const project = new sdk.Project(client); -const result = await project.createKey({ - keyId: '', - name: '', - scopes: [sdk.ProjectKeyScopes.ProjectRead], - expire: '2020-10-15T06:38:00.000+00:00' // optional +const result = await project.updateMFAFactorsPolicy({ + totp: false, // optional + email: false, // optional + phone: false, // optional + custom: false // optional }); ``` diff --git a/docs/examples/project/update-o-auth-2-server.md b/docs/examples/project/update-o-auth-2-server.md index a34a5fc6..2ea2f48a 100644 --- a/docs/examples/project/update-o-auth-2-server.md +++ b/docs/examples/project/update-o-auth-2-server.md @@ -23,6 +23,7 @@ const result = await project.updateOAuth2Server({ userCodeLength: 6, // optional userCodeFormat: 'numeric', // optional deviceCodeDuration: 60, // optional - defaultScopes: [] // optional + defaultScopes: [], // optional + installationScopes: [] // optional }); ``` diff --git a/docs/examples/project/update-session-duration-policy.md b/docs/examples/project/update-session-duration-policy.md index 2a4873be..35ae13df 100644 --- a/docs/examples/project/update-session-duration-policy.md +++ b/docs/examples/project/update-session-duration-policy.md @@ -9,6 +9,6 @@ const client = new sdk.Client() const project = new sdk.Project(client); const result = await project.updateSessionDurationPolicy({ - duration: 5 + duration: 60 }); ``` diff --git a/docs/examples/project/update-user-limit-policy.md b/docs/examples/project/update-user-limit-policy.md index bb372042..a631e0fa 100644 --- a/docs/examples/project/update-user-limit-policy.md +++ b/docs/examples/project/update-user-limit-policy.md @@ -9,6 +9,6 @@ const client = new sdk.Client() const project = new sdk.Project(client); const result = await project.updateUserLimitPolicy({ - total: 1 + total: 0 }); ``` diff --git a/docs/examples/proxy/create-invalidation.md b/docs/examples/proxy/create-invalidation.md new file mode 100644 index 00000000..8239fc40 --- /dev/null +++ b/docs/examples/proxy/create-invalidation.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 proxy = new sdk.Proxy(client); + +const result = await proxy.createInvalidation({ + domain: '', + type: sdk.InvalidationType.Tag, + reference: '' // optional +}); +``` diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index 055e5ab5..6a09ee7c 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -13,6 +13,7 @@ const result = await storage.createFile({ bucketId: '', fileId: '', file: InputFile.fromPath('/path/to/file', 'filename'), - permissions: [sdk.Permission.read(sdk.Role.any())] // optional + permissions: [sdk.Permission.read(sdk.Role.any())], // optional + folder: '' // optional }); ``` diff --git a/docs/examples/tablesdb/create-migration.md b/docs/examples/tablesdb/create-migration.md new file mode 100644 index 00000000..8338b362 --- /dev/null +++ b/docs/examples/tablesdb/create-migration.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 tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.createMigration({ + databaseId: '', + specification: 's-1vcpu-1gb', + autoCutover: false // optional +}); +``` diff --git a/docs/examples/tablesdb/create.md b/docs/examples/tablesdb/create.md index 27bf661f..cd18253c 100644 --- a/docs/examples/tablesdb/create.md +++ b/docs/examples/tablesdb/create.md @@ -13,6 +13,7 @@ const result = await tablesDB.create({ name: '', enabled: false, // optional specification: 'serverless', // optional - replicas: 0 // optional + replicas: 0, // optional + syncMode: 'async' // optional }); ``` diff --git a/docs/examples/tablesdb/cutover-migration.md b/docs/examples/tablesdb/cutover-migration.md new file mode 100644 index 00000000..1cf02168 --- /dev/null +++ b/docs/examples/tablesdb/cutover-migration.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 tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.cutoverMigration({ + databaseId: '', + migrationId: '' +}); +``` diff --git a/docs/examples/tablesdb/delete-migration.md b/docs/examples/tablesdb/delete-migration.md new file mode 100644 index 00000000..7a85305c --- /dev/null +++ b/docs/examples/tablesdb/delete-migration.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 tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.deleteMigration({ + databaseId: '', + migrationId: '' +}); +``` diff --git a/docs/examples/tablesdb/get-migration.md b/docs/examples/tablesdb/get-migration.md new file mode 100644 index 00000000..8900aa69 --- /dev/null +++ b/docs/examples/tablesdb/get-migration.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 tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.getMigration({ + databaseId: '', + migrationId: '' +}); +``` diff --git a/docs/examples/tablesdb/list-migrations.md b/docs/examples/tablesdb/list-migrations.md new file mode 100644 index 00000000..c3275a5a --- /dev/null +++ b/docs/examples/tablesdb/list-migrations.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 tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.listMigrations({ + databaseId: '' +}); +``` diff --git a/docs/examples/tablesdb/list-operations.md b/docs/examples/tablesdb/list-operations.md new file mode 100644 index 00000000..62fcb0ce --- /dev/null +++ b/docs/examples/tablesdb/list-operations.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 tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.listOperations({ + databaseId: '', + status: 'running', // optional + limit: 1, // optional + offset: 0 // optional +}); +``` diff --git a/docs/examples/tablesdb/update.md b/docs/examples/tablesdb/update.md index 034eb940..8be0bfda 100644 --- a/docs/examples/tablesdb/update.md +++ b/docs/examples/tablesdb/update.md @@ -12,6 +12,8 @@ const result = await tablesDB.update({ databaseId: '', name: '', // optional enabled: false, // optional - replicas: 0 // optional + specification: 'serverless', // optional + replicas: 0, // optional + syncMode: 'async' // optional }); ``` diff --git a/docs/examples/users/get-mfa-challenge.md b/docs/examples/users/get-mfa-challenge.md new file mode 100644 index 00000000..b20e2c22 --- /dev/null +++ b/docs/examples/users/get-mfa-challenge.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 users = new sdk.Users(client); + +const result = await users.getMFAChallenge({ + userId: '', + challengeId: '' +}); +``` diff --git a/package-lock.json b/package-lock.json index 5e4de244..ddaddf75 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "node-appwrite", - "version": "27.1.0", + "version": "28.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "node-appwrite", - "version": "27.1.0", + "version": "28.0.0", "license": "BSD-3-Clause", "dependencies": { "json-bigint": "1.0.0", @@ -14,7 +14,7 @@ }, "devDependencies": { "@types/json-bigint": "1.0.4", - "@types/node": "26.1.1", + "@types/node": "26.2.0", "esbuild-plugin-file-path-extensions": "^2.0.0", "jest": "^30.4.2", "tslib": "2.8.1", @@ -23,7 +23,8 @@ }, "overrides": { "esbuild": "^0.28.1", - "js-yaml": "^4.2.0" + "js-yaml": "^4.2.0", + "brace-expansion": "5.0.9" } }, "node_modules/@babel/code-frame": { @@ -83,14 +84,14 @@ } }, "node_modules/@babel/generator": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.7.tgz", - "integrity": "sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ==", + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.8.tgz", + "integrity": "sha512-gZbepsdh3WDtgZKWL+vTPh71LSBrm/Y4/QDZBVCcYfmeTEEuoOYwlSy+G1StfJg+/Zy550u/3TATbm7qDbbMtg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/parser": "^7.29.7", - "@babel/types": "^7.29.7", + "@babel/parser": "^7.29.8", + "@babel/types": "^7.29.8", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" @@ -213,13 +214,13 @@ } }, "node_modules/@babel/parser": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.7.tgz", - "integrity": "sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg==", + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.8.tgz", + "integrity": "sha512-E8lTAYNB1KW+FH+VGJuZM1ioAx2E6oVlvQFRrf5P8ZZmsiJXYAD9vTFV7yyEURNzgh1dFqMZuO6tUwcARbqFCA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.29.7" + "@babel/types": "^7.29.8" }, "bin": { "parser": "bin/babel-parser.js" @@ -483,18 +484,18 @@ } }, "node_modules/@babel/traverse": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.7.tgz", - "integrity": "sha512-EhlfNQtZ+NK22w5BM61ciuiq1m58ed33Wr1Xan//ZRTy6hgjnwyCffRYwzsGXdASJSUJ1guZILsErh1eQcl+zw==", + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.8.tgz", + "integrity": "sha512-I5z7H3bf/41ktsNVLtpN0wAa336HkqIHQ5BuPLEhTkt1jVSyZpeNKIzTgEWmlxjdg81R0IgUCcaE+Ok3NvrfZg==", "dev": true, "license": "MIT", "dependencies": { "@babel/code-frame": "^7.29.7", - "@babel/generator": "^7.29.7", + "@babel/generator": "^7.29.8", "@babel/helper-globals": "^7.29.7", - "@babel/parser": "^7.29.7", + "@babel/parser": "^7.29.8", "@babel/template": "^7.29.7", - "@babel/types": "^7.29.7", + "@babel/types": "^7.29.8", "debug": "^4.3.1" }, "engines": { @@ -502,9 +503,9 @@ } }, "node_modules/@babel/types": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.7.tgz", - "integrity": "sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==", + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.8.tgz", + "integrity": "sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg==", "dev": true, "license": "MIT", "dependencies": { @@ -557,9 +558,9 @@ } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.1.tgz", - "integrity": "sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz", + "integrity": "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==", "cpu": [ "ppc64" ], @@ -574,9 +575,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.1.tgz", - "integrity": "sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.2.tgz", + "integrity": "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==", "cpu": [ "arm" ], @@ -591,9 +592,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.1.tgz", - "integrity": "sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.2.tgz", + "integrity": "sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==", "cpu": [ "arm64" ], @@ -608,9 +609,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.1.tgz", - "integrity": "sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.2.tgz", + "integrity": "sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==", "cpu": [ "x64" ], @@ -625,9 +626,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.1.tgz", - "integrity": "sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.2.tgz", + "integrity": "sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==", "cpu": [ "arm64" ], @@ -642,9 +643,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.1.tgz", - "integrity": "sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.2.tgz", + "integrity": "sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==", "cpu": [ "x64" ], @@ -659,9 +660,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.1.tgz", - "integrity": "sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.2.tgz", + "integrity": "sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==", "cpu": [ "arm64" ], @@ -676,9 +677,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.1.tgz", - "integrity": "sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.2.tgz", + "integrity": "sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==", "cpu": [ "x64" ], @@ -693,9 +694,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.1.tgz", - "integrity": "sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.2.tgz", + "integrity": "sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==", "cpu": [ "arm" ], @@ -710,9 +711,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.1.tgz", - "integrity": "sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.2.tgz", + "integrity": "sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==", "cpu": [ "arm64" ], @@ -727,9 +728,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.1.tgz", - "integrity": "sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.2.tgz", + "integrity": "sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==", "cpu": [ "ia32" ], @@ -744,9 +745,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.1.tgz", - "integrity": "sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.2.tgz", + "integrity": "sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==", "cpu": [ "loong64" ], @@ -761,9 +762,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.1.tgz", - "integrity": "sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.2.tgz", + "integrity": "sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==", "cpu": [ "mips64el" ], @@ -778,9 +779,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.1.tgz", - "integrity": "sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.2.tgz", + "integrity": "sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==", "cpu": [ "ppc64" ], @@ -795,9 +796,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.1.tgz", - "integrity": "sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.2.tgz", + "integrity": "sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==", "cpu": [ "riscv64" ], @@ -812,9 +813,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.1.tgz", - "integrity": "sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.2.tgz", + "integrity": "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==", "cpu": [ "s390x" ], @@ -829,9 +830,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.1.tgz", - "integrity": "sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.2.tgz", + "integrity": "sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ==", "cpu": [ "x64" ], @@ -846,9 +847,9 @@ } }, "node_modules/@esbuild/netbsd-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.1.tgz", - "integrity": "sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.2.tgz", + "integrity": "sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==", "cpu": [ "arm64" ], @@ -863,9 +864,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.1.tgz", - "integrity": "sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.2.tgz", + "integrity": "sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==", "cpu": [ "x64" ], @@ -880,9 +881,9 @@ } }, "node_modules/@esbuild/openbsd-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.1.tgz", - "integrity": "sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.2.tgz", + "integrity": "sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==", "cpu": [ "arm64" ], @@ -897,9 +898,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.1.tgz", - "integrity": "sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.2.tgz", + "integrity": "sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==", "cpu": [ "x64" ], @@ -914,9 +915,9 @@ } }, "node_modules/@esbuild/openharmony-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.1.tgz", - "integrity": "sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.2.tgz", + "integrity": "sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==", "cpu": [ "arm64" ], @@ -931,9 +932,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.1.tgz", - "integrity": "sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.2.tgz", + "integrity": "sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==", "cpu": [ "x64" ], @@ -948,9 +949,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.1.tgz", - "integrity": "sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.2.tgz", + "integrity": "sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==", "cpu": [ "arm64" ], @@ -965,9 +966,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.1.tgz", - "integrity": "sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.2.tgz", + "integrity": "sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==", "cpu": [ "ia32" ], @@ -982,9 +983,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.1.tgz", - "integrity": "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.2.tgz", + "integrity": "sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==", "cpu": [ "x64" ], @@ -1434,23 +1435,46 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@napi-rs/lzma-linux-x64-gnu": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@napi-rs/lzma-linux-x64-gnu/-/lzma-linux-x64-gnu-1.5.1.tgz", + "integrity": "sha512-oTXEIha4SsuXdTA4Iyskj0kpdx2yVXdhd75c2v3xGrHFfVMsbhTPZU/nMPL4sWKo4pBHm3aucLaqGlF696dTyQ==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^22.20 || ^24.12 || >=25" + } + }, "node_modules/@napi-rs/wasm-runtime": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.6.tgz", - "integrity": "sha512-ZLv/JdUfkvOy9eCnnBaGfiO+XimbjebAeO+MRQqD/B+FR1tnRN0tpKSJHRbE8sFfS6aqsXZ67TQjfwfsxULVbg==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.2.2.tgz", + "integrity": "sha512-JfB4kuJQjaoHuCTseIINHtHWeJnvgEcxjwA5t/Y00ZgaOO1Crz3fjT/p8kT28zA/Caz7oiUMn3d6H2yOVCVwuw==", "dev": true, "license": "MIT", "optional": true, "dependencies": { "@tybys/wasm-util": "^0.10.3" }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=23.5.0" + }, "funding": { "type": "github", "url": "https://github.com/sponsors/Brooooooklyn" }, "peerDependencies": { - "@emnapi/core": "^1.7.1", - "@emnapi/runtime": "^1.7.1" + "@emnapi/core": "^1.7.1 || ^2.0.0-alpha.3", + "@emnapi/runtime": "^1.7.1 || ^2.0.0-alpha.3" } }, "node_modules/@pkgjs/parseargs": { @@ -1478,9 +1502,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.62.2.tgz", - "integrity": "sha512-6o7ZLZK+BeenkZCFNDXqpbjw9bD6nuWonvS/lwQJp7NoVVxm6p3qE7qQ5jGuBjiFsgvqjD8mZAU5oWxTmbOeOg==", + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.62.4.tgz", + "integrity": "sha512-RrPokAb7dmbxFoeO3TloqHyOjgye8RkBhSqmp4aJMIex4c9r46ZstPnleDQOq1t46VOVjwIuwNogIqbodV1Vvg==", "cpu": [ "arm" ], @@ -1492,9 +1516,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.62.2.tgz", - "integrity": "sha512-BaH7BllCACHoH1LguOU56UItGfUWjujlO65kS9LAodViaN4bwIKd7oeW/ZHJ/4ljr/7MIiENnNy3HJ0zXv8Zkw==", + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.62.4.tgz", + "integrity": "sha512-JKuJc+pnpks2pjy7L/N3v/cAkZxYlnmuZoD840ldbMI5KDbC4iO9NKwPKYdjYFCMAIIlBzYSFHxIJVYzRo2/8A==", "cpu": [ "arm64" ], @@ -1506,9 +1530,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.62.2.tgz", - "integrity": "sha512-v39RCCvj4He82I9sFmk+M1VZ0PLM9sfsLVikjfx2hYBNALhrrOR2D3JjQA6AhlaSOgcR+RzrKY7e1+bT6SUO/A==", + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.62.4.tgz", + "integrity": "sha512-krw5uS2STmvJ02x0uTXHbqQNuz+9eZ1iw+qXk9dmW2gvV4jV7O2hEoOnuhFrpOPiel1mBFtqbxYZZtC46hXLOw==", "cpu": [ "arm64" ], @@ -1520,9 +1544,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.62.2.tgz", - "integrity": "sha512-yl0y2vq3S3lHeuXhEdss6TWfKW8vkujImO12tn4ZkG/4oghr09LvdYm2RElVjokTQiUvDUGXLGsYeLqUMCKpGA==", + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.62.4.tgz", + "integrity": "sha512-wsTxtgApb4PrOsNJIm0FZ1h3WvCC+k9uxLJ4ad75hgoS4NiRes2SoJFlDAyMwiUY8IssDqGcHbXuN0sx1tfF1A==", "cpu": [ "x64" ], @@ -1534,9 +1558,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.62.2.tgz", - "integrity": "sha512-tT4pvt4qXD+vEoezupCWi+a1F0vvDiksiHc+PxRlYTOH1I6/X4id9jPxTP+Fg+545euaFT1jJVs4CEdHZAU1vw==", + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.62.4.tgz", + "integrity": "sha512-GUOnQlyZe3yAXhWOtOMsn5Qkrv5E5mZXa0thbARWi5Ei2szlVXJFQhddZ4HbAzh8q92w5twp+CQvs/eFanz9YQ==", "cpu": [ "arm64" ], @@ -1548,9 +1572,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.62.2.tgz", - "integrity": "sha512-6nU5F2wCW+qvCBhTn1pdIU3bzsIoF7EUwsCDRxilWGprQR6yd508YnH9+OKFCwpfS8pjZqDUmnCAr7exax0XCg==", + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.62.4.tgz", + "integrity": "sha512-/Y7f3QuxjzPKsjA/rfEDa3+0vXqyjmJ50Ln8dPpCmWkKTrUoWHG1cWhTqaAMLob2m2nESWuC7yGrREz019Ztqg==", "cpu": [ "x64" ], @@ -1562,9 +1586,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.62.2.tgz", - "integrity": "sha512-n1GJHPOvpIfhi3TmrCeh6S6URt9BFCt0KQE3qvexyGCTAKpR4Lg+eWvNZEqu7epxwus/8ElT3hacYEucm49SZg==", + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.62.4.tgz", + "integrity": "sha512-81wiiX3v7aqy+T+bT61TJ78yJjRquqFFTTbAPt08imfQQzkPIW8t6aJbkTagtCCrXMNc9D66+geqlK7ydLPNqA==", "cpu": [ "arm" ], @@ -1579,9 +1603,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.62.2.tgz", - "integrity": "sha512-JqgflS8wEB+UXV/vS1RpRbifGBeN4D5lz8D8oOFbFZw4vedvdOgCFAjfBmIMdW3yL10XpQQ0Ambepw6MXrhOnA==", + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.62.4.tgz", + "integrity": "sha512-9kmDIvNZqdoHOBZgNtpTBeLWYO/LVipM3H/j62P8848/l/VPEQL6N3uxU9pvP1oZAsXyC2MEnFP3ovRjo7WYNQ==", "cpu": [ "arm" ], @@ -1596,9 +1620,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.62.2.tgz", - "integrity": "sha512-wnFJkogWvN4jm/hQRF2UBaeUmk20j5+DmHvoyWii2b8HJDyvz1MF2OU/6ynXt2KR63rbZLWkFpoytpdc/yBuSA==", + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.62.4.tgz", + "integrity": "sha512-CcnXHWnXg69g+DX5VWL3FHts3qMRN2uVEHX+BZvGLdd07/gXkn3ePjYtO1LDJvxkGKVHMclKBRa1QUTH+6toYQ==", "cpu": [ "arm64" ], @@ -1613,9 +1637,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.62.2.tgz", - "integrity": "sha512-HVu2bp0zhvJ8xHEV9+UUs7S90VadmBSY3LcIMvozbPo4AuMGDWlz3ymHLHZPX4hR67TKTt8Qp5PJ5RBg/i+RMQ==", + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.62.4.tgz", + "integrity": "sha512-iFOibiHnTRuhrWLlRsOQFdZJJIa7S8OwkneJr4ocALP16u5yk6lWLINFwhHaEqBFMsKDUZofLkGos7+CPzGB3g==", "cpu": [ "arm64" ], @@ -1630,9 +1654,9 @@ ] }, "node_modules/@rollup/rollup-linux-loong64-gnu": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.62.2.tgz", - "integrity": "sha512-mQqqAV8QaoSgr9I2fKDLY2BAVvmKjWoGiu/cSYQonsLvtqwEn1E4QYfnCOcp5zoEqNhsDYin1s6jx/VJmrxlZg==", + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.62.4.tgz", + "integrity": "sha512-XnWYMI7euHlb5a871xPja+Gm7DRCFU+FGRrtS2sMq9N8FvqtpagUy6gD4YOemC5MRk9xbh8+jYMEJbigFQwsgA==", "cpu": [ "loong64" ], @@ -1647,9 +1671,9 @@ ] }, "node_modules/@rollup/rollup-linux-loong64-musl": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.62.2.tgz", - "integrity": "sha512-IxKLoxCQ2IWi6bT2akyDUBGsOImDKB+sPp4EsTmwFQ/fMwpCKm8uLSSgP/Kx/QYUgKis6SEZ5/Nlhup0DIA0PQ==", + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.62.4.tgz", + "integrity": "sha512-qGDAlO0U8xedCcsdRm9oaoQY8DAx/QT7uIxJWhCdx0ceIWX783UC9QSYkdpzAe29wNiVfp24+bZdQmn49o45SQ==", "cpu": [ "loong64" ], @@ -1664,9 +1688,9 @@ ] }, "node_modules/@rollup/rollup-linux-ppc64-gnu": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.62.2.tgz", - "integrity": "sha512-Mk5ha2RQSgyFfmYYLkBpPnUk8D8FriBxesO1u9O75X0mHgXL1UQcH5Itl2lurWL2tj0RxV9b9tJgipac0hRY9A==", + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.62.4.tgz", + "integrity": "sha512-ru4H6ezD7ysA5EiEK6qkkaEb4modH8CTej6kUy/gQi20u3kB3G7Zn8snXXkeJSCOFKG/rbPPtM/+9Wgas1961w==", "cpu": [ "ppc64" ], @@ -1681,9 +1705,9 @@ ] }, "node_modules/@rollup/rollup-linux-ppc64-musl": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.62.2.tgz", - "integrity": "sha512-CjvEnqJL/0/TQ3TXX3OPIJ/kmBellrWd4heXUmHeJlTnmwjKpSJzoehLaL6Xk0ZnMHBu9dZuFADNOrtjF4v+2w==", + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.62.4.tgz", + "integrity": "sha512-2W4MO5WQVJnbJaZdvDb9rhBDuFU1nKIepPFpJUBsTh2k1YY2g+ODViaWuyOAjQ5cOP7NvrvLzt3wvHOoiAvc7w==", "cpu": [ "ppc64" ], @@ -1698,9 +1722,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.62.2.tgz", - "integrity": "sha512-1SiZbzwdkaDURsew/tSOrooKiYy7EQGT6m8ufavAi9NEyQb/6VuIxFXAL1fqa4iZe3g4NbNk4P7J32z2tw5Mgg==", + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.62.4.tgz", + "integrity": "sha512-+fxjfuoAmVMCYV5QyjoIpu0cp5DOiOTeqYFk1AVaxGr+/ravWLX89XfQmptsoWcaVy/TGf2hexzbUOrCQIL1CQ==", "cpu": [ "riscv64" ], @@ -1715,9 +1739,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.62.2.tgz", - "integrity": "sha512-nQts12zJ3NQRoE6uYljOH89v7szzLDvG2JD/vsX+vGXU8w/At1GowTZ5/7qeFQ8m7L55rpR8Okugnuo5bgjy2Q==", + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.62.4.tgz", + "integrity": "sha512-jTn8JfHGL4djjFxPuM06LmNUJDsst2jeVlsd9OmIH6zc5sC9K6rIuO4YajXatLUpBmBKl6b35ro1QZocLi+tcA==", "cpu": [ "riscv64" ], @@ -1732,9 +1756,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.62.2.tgz", - "integrity": "sha512-E9/ll019jhPIJgpzfZoIkBGhcz+kKNgVWYRY0zr9srBdPPFVpvOKW8VaJKUbeK+eZXyQF9ltME+Kk6affeaPgg==", + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.62.4.tgz", + "integrity": "sha512-oCJCJL4pXsoDcP2QZ+JVlPTIRc6266zsIaeJJsWImmF7HO0W8nb6HuSgZlMWxJwaPf8ehbSw8yo0EUw925hKsA==", "cpu": [ "s390x" ], @@ -1749,9 +1773,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.62.2.tgz", - "integrity": "sha512-5BqxR/pshjey51iliyzTD5Xi3EN0aLmQ2lZ3lvefVV9c82BvrLo2/6OT55iifpWBufs6kdwWbuOKS841DrmK9A==", + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.62.4.tgz", + "integrity": "sha512-W69hukhZ3KKNRCaMIEzKvcFye42hh0FE1+YoYaf5+Ikacuftoco6yO/xouz0hc5d5W/s3yBro5jRiuEE/Q5vUw==", "cpu": [ "x64" ], @@ -1766,9 +1790,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.62.2.tgz", - "integrity": "sha512-uNN83XxQrRAh/w0/pmAfibcwyb6YWt4gP+dpnQKPVJshAloQ785ii8CT8ZCIxkGg9opVsvAlGhFitSm6D1Jjpg==", + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.62.4.tgz", + "integrity": "sha512-qiXbGG2jkjXhzXpsFZSR2Xpb8DN/UaxYsbb/STbuR/6fpaDgRmmaq1B/LmtF2wQFOFOSsK2jdE0RZ3a0zHn4QA==", "cpu": [ "x64" ], @@ -1783,9 +1807,9 @@ ] }, "node_modules/@rollup/rollup-openbsd-x64": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.62.2.tgz", - "integrity": "sha512-srjEIxSH3LRnJN6THczDHWQplqEMFiAJrTab0msUryh9kwNpkICf3Ea6q6MN/2cZwRFUNx5w+h6Hpi4QuHS6Zg==", + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.62.4.tgz", + "integrity": "sha512-nWeM//hxv8mIo6jD7Hu4o48DVmV9pbV6gsKaWU+4NFyqHoPKwrkRiZGLKUhOBk8qNmDmpwFtPKg80Bo/Tn4xiQ==", "cpu": [ "x64" ], @@ -1797,9 +1821,9 @@ ] }, "node_modules/@rollup/rollup-openharmony-arm64": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.62.2.tgz", - "integrity": "sha512-8hOJnxgbyObnCm5AlRA3A931xX19xq80RjVTKgJOvEKWqJruP/Uf12IbAOaDjjEXYRewwHLfmF0YRIdK3OwKWA==", + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.62.4.tgz", + "integrity": "sha512-s62SQ/vgsRSvMwDkOEfTqfgASF0f26ZNaQuTA6Aok5lrikf89yI2W0gFHvZb2Jpgc6N8JnOKZgCK2iciO3CsxQ==", "cpu": [ "arm64" ], @@ -1811,9 +1835,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.62.2.tgz", - "integrity": "sha512-mmF4AY1i0hG/bLWUctUq59gtmgaSIRa3cu/A3JFRp/sCNEme2bgDEiDS22P9FbnJB8NJNF4jPJiSP5RHQpUTDg==", + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.62.4.tgz", + "integrity": "sha512-J6wGf8TVGbXJq+HH+ttTvrcfNKPbuZecV6KT1B8I18BC5IURUh5kl4Yl5OEP5eFIUoI5BWxCsyYMhFsDx8kekw==", "cpu": [ "arm64" ], @@ -1825,9 +1849,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.62.2.tgz", - "integrity": "sha512-DZgkknc6jhHrk46V25vbAM0zZkyP0nSDkJB8/dRkLTxv470dOmWDqGoEJl/9A0dFfS7yE3REOwNDxpHwSLSt0Q==", + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.62.4.tgz", + "integrity": "sha512-zmfrQd/0wu6oJs8Vq8KwY/YtsKSsLtKe/HwAP4Wqy8LhWjeT55fHRAkOhYQ12wI3ayS4Tt12d5CDRD7N96SAYQ==", "cpu": [ "ia32" ], @@ -1839,9 +1863,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-gnu": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.62.2.tgz", - "integrity": "sha512-T6xr6ucWSFto+VGajA8YH26LdpHRuP4YLHEKAtCWvJDOlnmWcDZVCI2Jmjr+IFHDlt2zRaTAKE4tfjTaWLgJBg==", + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.62.4.tgz", + "integrity": "sha512-qPzHqdj9rfUD+w79dtE07zi/kFwKyCJqplp5K5ygeLTp7jLpAoc16OAH39HSmRC9UpozaecsleI8uAdEj6v2yw==", "cpu": [ "x64" ], @@ -1853,9 +1877,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.62.2.tgz", - "integrity": "sha512-BfzEnDJOt9T8M989/lA37EcJgat01wLRnoi5dQf3QzOH7jzpqTAzdDbVfRljVr5r+jzKqpbHeyOfAaXxAd0PAA==", + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.62.4.tgz", + "integrity": "sha512-zD6NdeWEByGE9QF9vCrlJ5YQB4oq9q91kPZS37Jwj5hOkvR1lTBSpsKhKDw4IJtbQ35LsTS1HD9DZYGKIshU1Q==", "cpu": [ "x64" ], @@ -1867,9 +1891,9 @@ ] }, "node_modules/@sinclair/typebox": { - "version": "0.34.51", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.34.51.tgz", - "integrity": "sha512-Nu4sNPT4G3QgAvxmdUCR/NBmsi23F2tEIcbMOZJVHS+qEgk+rmXxQikEeoKFyaX+UEggAoTvHUvIlj8MfYPzXQ==", + "version": "0.34.52", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.34.52.tgz", + "integrity": "sha512-XiMQh7qqVlxZzcVD+kkGMNGMzcTrDMLWI7S4x7z1MkCkbDPrekpZXEUK0eZqZFMuHQg2a2DZOcDIh9o5v3Gonw==", "dev": true, "license": "MIT" }, @@ -1991,9 +2015,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "26.1.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-26.1.1.tgz", - "integrity": "sha512-nxAkRSVkN1Y0JC1W8ky/fTfkGsMmcrRsbx+3XoZE+rMOX71kLYTV7fLXpqud1GpbpP5TuffXFqfX7fH2GgZREw==", + "version": "26.2.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-26.2.0.tgz", + "integrity": "sha512-5IviulTZeRNp2vAJ514cc/HUlY5nZ9fCbq9DMyC52BrhFZACo3nI0R7qBxhQmo/d27NFe96ur/b7Wwxklda+kg==", "dev": true, "license": "MIT", "dependencies": { @@ -2375,9 +2399,9 @@ ] }, "node_modules/acorn": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.17.0.tgz", - "integrity": "sha512-xRQbDb9BnwDafYNn6Vwl839DYVjqXYb1XVGtWAZ1kcDc6iwAL4hg3B1dZlRiuENFeO2H53gFG3in621AdERVAg==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.18.0.tgz", + "integrity": "sha512-lGq+9yr1/GuAWaVYIHRjvvySG5/4VfKIvC8EWxStPdcDh/Ka7FG3twP6v4d5BkravUilhIAsG4Qj83t02LWUPQ==", "dev": true, "license": "MIT", "bin": { @@ -2573,16 +2597,19 @@ } }, "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", "dev": true, - "license": "MIT" + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } }, "node_modules/baseline-browser-mapping": { - "version": "2.10.42", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.42.tgz", - "integrity": "sha512-c/jurFrDLyui7o1J86yLkRu4LMsTYcBohveus7/I2Hzdn9KIP2bdJPTue/lR1KH46enoPbD77GKeSYNdyPoD3Q==", + "version": "2.11.13", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.13.tgz", + "integrity": "sha512-k9HNuUVMlqVjQ9UHzfPjIqiDbWw7WqT1AoT7GL8VwvF3r0ZfArtgiSPAlmupyNquNgOJHTuH4CKYf8ttMTWBTQ==", "dev": true, "license": "Apache-2.0", "bin": { @@ -2602,19 +2629,22 @@ } }, "node_modules/brace-expansion": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.2.tgz", - "integrity": "sha512-w5JZcKgdhDOgOwm8H+KgbosopHMuGcl6qbulwjtz3SM7I7P3yW1eAjzMPLrIE+NQ9vjgANKHWeMHnrT0OXW1oA==", + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz", + "integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==", "dev": true, "license": "MIT", "dependencies": { - "balanced-match": "^1.0.0" + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "20 || >=22" } }, "node_modules/browserslist": { - "version": "4.28.5", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.5.tgz", - "integrity": "sha512-Cu2E6QejHWzuDMTkuwgpABFgDfZrXLQq5V13YOACZx4mFAG4IwGTbTfHPMr4WtxlHoXSM8FIuRwYYCz5XiabaQ==", + "version": "4.28.8", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.8.tgz", + "integrity": "sha512-V2NpofLblG64mfOtSgDhOJESZEGogzDMBv/q+W6oc4LXWP/q75eOXoOaaOu1EOadB9U4Bwx/e0yzbvwKH8zalA==", "dev": true, "funding": [ { @@ -2632,11 +2662,11 @@ ], "license": "MIT", "dependencies": { - "baseline-browser-mapping": "^2.10.42", - "caniuse-lite": "^1.0.30001800", - "electron-to-chromium": "^1.5.387", - "node-releases": "^2.0.50", - "update-browserslist-db": "^1.2.3" + "baseline-browser-mapping": "^2.11.12", + "caniuse-lite": "^1.0.30001809", + "electron-to-chromium": "^1.5.402", + "node-releases": "^2.0.53", + "update-browserslist-db": "^1.3.0" }, "bin": { "browserslist": "cli.js" @@ -2709,9 +2739,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001803", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001803.tgz", - "integrity": "sha512-g/uHREV2ZpK9qMalCsWaxmA6ol+DX8GYhuf3T40RKoP+oL7vhRJh8LNt73PCjpnR6l14FzfPrB5Yux4PKm2meg==", + "version": "1.0.30001809", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001809.tgz", + "integrity": "sha512-xxWVywk6a6Arlk+hymeycyn/VgqEfLDxupvhH/xiY5SJ/18kmi9o6MiO320DCUzypORHLtvh0I4i04tUhCNHNQ==", "dev": true, "funding": [ { @@ -2921,13 +2951,6 @@ "node": ">= 6" } }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true, - "license": "MIT" - }, "node_modules/confbox": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz", @@ -3028,9 +3051,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.389", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.389.tgz", - "integrity": "sha512-cEto7aeOqBfU1D+c5py5pE+ooscKE75JifxLBdFUZsqAxRS6y7kebtxAZvICszSl05gPjYHDTjY+lXpyGvpJbg==", + "version": "1.5.404", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.404.tgz", + "integrity": "sha512-3WJtd7/lVq2Jnuz6wed1l9+1ZD2u2Tet1/1NBc4Iedkmgbu+I7YuAqdAQ8T+VZtnwysMsAf3IqSq9D1gyZjA2g==", "dev": true, "license": "ISC" }, @@ -3065,9 +3088,9 @@ } }, "node_modules/esbuild": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.1.tgz", - "integrity": "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.2.tgz", + "integrity": "sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -3078,32 +3101,32 @@ "node": ">=18" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.28.1", - "@esbuild/android-arm": "0.28.1", - "@esbuild/android-arm64": "0.28.1", - "@esbuild/android-x64": "0.28.1", - "@esbuild/darwin-arm64": "0.28.1", - "@esbuild/darwin-x64": "0.28.1", - "@esbuild/freebsd-arm64": "0.28.1", - "@esbuild/freebsd-x64": "0.28.1", - "@esbuild/linux-arm": "0.28.1", - "@esbuild/linux-arm64": "0.28.1", - "@esbuild/linux-ia32": "0.28.1", - "@esbuild/linux-loong64": "0.28.1", - "@esbuild/linux-mips64el": "0.28.1", - "@esbuild/linux-ppc64": "0.28.1", - "@esbuild/linux-riscv64": "0.28.1", - "@esbuild/linux-s390x": "0.28.1", - "@esbuild/linux-x64": "0.28.1", - "@esbuild/netbsd-arm64": "0.28.1", - "@esbuild/netbsd-x64": "0.28.1", - "@esbuild/openbsd-arm64": "0.28.1", - "@esbuild/openbsd-x64": "0.28.1", - "@esbuild/openharmony-arm64": "0.28.1", - "@esbuild/sunos-x64": "0.28.1", - "@esbuild/win32-arm64": "0.28.1", - "@esbuild/win32-ia32": "0.28.1", - "@esbuild/win32-x64": "0.28.1" + "@esbuild/aix-ppc64": "0.28.2", + "@esbuild/android-arm": "0.28.2", + "@esbuild/android-arm64": "0.28.2", + "@esbuild/android-x64": "0.28.2", + "@esbuild/darwin-arm64": "0.28.2", + "@esbuild/darwin-x64": "0.28.2", + "@esbuild/freebsd-arm64": "0.28.2", + "@esbuild/freebsd-x64": "0.28.2", + "@esbuild/linux-arm": "0.28.2", + "@esbuild/linux-arm64": "0.28.2", + "@esbuild/linux-ia32": "0.28.2", + "@esbuild/linux-loong64": "0.28.2", + "@esbuild/linux-mips64el": "0.28.2", + "@esbuild/linux-ppc64": "0.28.2", + "@esbuild/linux-riscv64": "0.28.2", + "@esbuild/linux-s390x": "0.28.2", + "@esbuild/linux-x64": "0.28.2", + "@esbuild/netbsd-arm64": "0.28.2", + "@esbuild/netbsd-x64": "0.28.2", + "@esbuild/openbsd-arm64": "0.28.2", + "@esbuild/openbsd-x64": "0.28.2", + "@esbuild/openharmony-arm64": "0.28.2", + "@esbuild/sunos-x64": "0.28.2", + "@esbuild/win32-arm64": "0.28.2", + "@esbuild/win32-ia32": "0.28.2", + "@esbuild/win32-x64": "0.28.2" } }, "node_modules/esbuild-plugin-file-path-extensions": { @@ -4202,9 +4225,9 @@ "license": "MIT" }, "node_modules/js-yaml": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.0.tgz", - "integrity": "sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.1.tgz", + "integrity": "sha512-CY6crGq313MX8GkwvB7tzgp99vjQxY1++5y10/BKN/GUfHqWaOGQMNZkBvqSzsZKWk/ijwHlWzzkLulsGHhjWQ==", "dev": true, "funding": [ { @@ -4484,9 +4507,9 @@ "license": "MIT" }, "node_modules/node-releases": { - "version": "2.0.51", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.51.tgz", - "integrity": "sha512-wRNIrw4DmVLKQlbgOMdkMx27Wrpzes2hh5Jtbi2bjPd+4wJstWIqP5A+lscnqbm0xxmT5Bpg8Lec5ItEBwx6BQ==", + "version": "2.0.53", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.53.tgz", + "integrity": "sha512-D9UOmYG3UH1V+ENW56t5QXBwJw1YEY18ruVeus89Rw+SyIgjPkCO84bRzO3uNIYosJbNwiabWVn48o3uJLjxFQ==", "dev": true, "license": "MIT", "engines": { @@ -4848,9 +4871,9 @@ }, "node_modules/react-is-19": { "name": "react-is", - "version": "19.2.7", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-19.2.7.tgz", - "integrity": "sha512-kZFnouyVv7eP/Phmrlo9FK+zcAdriZJvzxXHF1Sl1P377WSGe2G/JxVolhTrB/jeV47lKImhNUsijjHAAbcl/A==", + "version": "19.2.8", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-19.2.8.tgz", + "integrity": "sha512-s5un28nYxKJw5gvUHyW5PCC28CvBqLu9r3cWgzHT4Vo/5fqqkFcdRYsGcKf50WMPpjjFZS5d76fn3YCo2njKwQ==", "dev": true, "license": "MIT" }, @@ -4902,9 +4925,9 @@ } }, "node_modules/rollup": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.62.2.tgz", - "integrity": "sha512-RFnrW4lhXA3s3eqHDZvN654g8OTjzRfqpIRJYczCGB6HzphckVAi/Qh4tbPUbRuDi7s1Llv8g/NspLkttY3gTA==", + "version": "4.62.4", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.62.4.tgz", + "integrity": "sha512-RXOqwaPsBGjMNMa4sQjDjHieHEZDFoj/Rdr46l2MU5DfEs16wHJPC2RPTPHWhNl+M3aI472LLqFkFKut4SblOg==", "dev": true, "license": "MIT", "dependencies": { @@ -4918,31 +4941,32 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.62.2", - "@rollup/rollup-android-arm64": "4.62.2", - "@rollup/rollup-darwin-arm64": "4.62.2", - "@rollup/rollup-darwin-x64": "4.62.2", - "@rollup/rollup-freebsd-arm64": "4.62.2", - "@rollup/rollup-freebsd-x64": "4.62.2", - "@rollup/rollup-linux-arm-gnueabihf": "4.62.2", - "@rollup/rollup-linux-arm-musleabihf": "4.62.2", - "@rollup/rollup-linux-arm64-gnu": "4.62.2", - "@rollup/rollup-linux-arm64-musl": "4.62.2", - "@rollup/rollup-linux-loong64-gnu": "4.62.2", - "@rollup/rollup-linux-loong64-musl": "4.62.2", - "@rollup/rollup-linux-ppc64-gnu": "4.62.2", - "@rollup/rollup-linux-ppc64-musl": "4.62.2", - "@rollup/rollup-linux-riscv64-gnu": "4.62.2", - "@rollup/rollup-linux-riscv64-musl": "4.62.2", - "@rollup/rollup-linux-s390x-gnu": "4.62.2", - "@rollup/rollup-linux-x64-gnu": "4.62.2", - "@rollup/rollup-linux-x64-musl": "4.62.2", - "@rollup/rollup-openbsd-x64": "4.62.2", - "@rollup/rollup-openharmony-arm64": "4.62.2", - "@rollup/rollup-win32-arm64-msvc": "4.62.2", - "@rollup/rollup-win32-ia32-msvc": "4.62.2", - "@rollup/rollup-win32-x64-gnu": "4.62.2", - "@rollup/rollup-win32-x64-msvc": "4.62.2", + "@napi-rs/lzma-linux-x64-gnu": "1.5.1", + "@rollup/rollup-android-arm-eabi": "4.62.4", + "@rollup/rollup-android-arm64": "4.62.4", + "@rollup/rollup-darwin-arm64": "4.62.4", + "@rollup/rollup-darwin-x64": "4.62.4", + "@rollup/rollup-freebsd-arm64": "4.62.4", + "@rollup/rollup-freebsd-x64": "4.62.4", + "@rollup/rollup-linux-arm-gnueabihf": "4.62.4", + "@rollup/rollup-linux-arm-musleabihf": "4.62.4", + "@rollup/rollup-linux-arm64-gnu": "4.62.4", + "@rollup/rollup-linux-arm64-musl": "4.62.4", + "@rollup/rollup-linux-loong64-gnu": "4.62.4", + "@rollup/rollup-linux-loong64-musl": "4.62.4", + "@rollup/rollup-linux-ppc64-gnu": "4.62.4", + "@rollup/rollup-linux-ppc64-musl": "4.62.4", + "@rollup/rollup-linux-riscv64-gnu": "4.62.4", + "@rollup/rollup-linux-riscv64-musl": "4.62.4", + "@rollup/rollup-linux-s390x-gnu": "4.62.4", + "@rollup/rollup-linux-x64-gnu": "4.62.4", + "@rollup/rollup-linux-x64-musl": "4.62.4", + "@rollup/rollup-openbsd-x64": "4.62.4", + "@rollup/rollup-openharmony-arm64": "4.62.4", + "@rollup/rollup-win32-arm64-msvc": "4.62.4", + "@rollup/rollup-win32-ia32-msvc": "4.62.4", + "@rollup/rollup-win32-x64-gnu": "4.62.4", + "@rollup/rollup-win32-x64-msvc": "4.62.4", "fsevents": "~2.3.2" } }, @@ -5277,17 +5301,6 @@ "node": ">=8" } }, - "node_modules/test-exclude/node_modules/brace-expansion": { - "version": "1.1.16", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.16.tgz", - "integrity": "sha512-IDw48K2/2kRkg9LdJxurvq3lV3aBgq0REY89duEqFRthjlPdXHKMj7EnQOXVckxzgisinf3nHfrcE2FufFLXMw==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/test-exclude/node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -5509,9 +5522,9 @@ "license": "MIT" }, "node_modules/undici": { - "version": "6.27.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.27.0.tgz", - "integrity": "sha512-YmfV3YnEDzXRC5lZ2jWtWWHKGUm1zIt8AhesR1tens+HTNv+YZlN/dp6G727LOvMJ8xjP9Be7Y2Sdr96LDm+pg==", + "version": "6.28.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.28.0.tgz", + "integrity": "sha512-LIY910g9TI13YS95lrMFrs8Rm/u/irgHeTWoKCoteeJ04CUJ92eEfj0rVn+7VKMPBpUPiUoBKfhNyLI23EE/KA==", "license": "MIT", "engines": { "node": ">=18.17" @@ -5563,9 +5576,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", - "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.1.tgz", + "integrity": "sha512-ZZ61DsRsOnakl74HAmp3oSN4aXUmEWXf+i/yv0h7tIBfICc3VdrFErQKUUKPgu3AMsTUMbcongALEN4l6GSUrQ==", "dev": true, "funding": [ { diff --git a/package.json b/package.json index 898eb6bd..7187f8b4 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": "27.1.0", + "version": "28.0.0", "license": "BSD-3-Clause", "main": "dist/index.js", "type": "commonjs", @@ -43,7 +43,7 @@ }, "devDependencies": { "@types/json-bigint": "1.0.4", - "@types/node": "26.1.1", + "@types/node": "26.2.0", "tsup": "^8.5.1", "esbuild-plugin-file-path-extensions": "^2.0.0", "tslib": "2.8.1", @@ -56,6 +56,7 @@ }, "overrides": { "esbuild": "^0.28.1", - "js-yaml": "^4.2.0" + "js-yaml": "^4.2.0", + "brace-expansion": "5.0.9" } } diff --git a/src/client.ts b/src/client.ts index 8051af74..3575fc6a 100644 --- a/src/client.ts +++ b/src/client.ts @@ -73,7 +73,7 @@ class AppwriteException extends Error { } function getUserAgent() { - let ua = 'AppwriteNodeJSSDK/27.1.0'; + let ua = 'AppwriteNodeJSSDK/28.0.0'; // `process` is a global in Node.js, but not fully available in all runtimes. const platform: string[] = []; @@ -114,6 +114,7 @@ class Client { selfSigned: false, project: '', key: '', + organization: '', jwt: '', bearer: '', locale: '', @@ -129,9 +130,9 @@ class Client { 'x-sdk-name': 'Node.js', 'x-sdk-platform': 'server', 'x-sdk-language': 'nodejs', - 'x-sdk-version': '27.1.0', + 'x-sdk-version': '28.0.0', 'user-agent' : getUserAgent(), - 'X-Appwrite-Response-Format': '1.9.5', + 'X-Appwrite-Response-Format': '1.9.6', }; /** @@ -232,6 +233,20 @@ class Client { this.config.key = value; return this; } + /** + * Set Organization + * + * Your organization ID + * + * @param value string + * + * @return {this} + */ + setOrganization(value: string): this { + this.headers['X-Appwrite-Organization'] = value; + this.config.organization = value; + return this; + } /** * Set JWT * diff --git a/src/enums/authentication-factor.ts b/src/enums/authentication-factor.ts index 928c4074..e3260d71 100644 --- a/src/enums/authentication-factor.ts +++ b/src/enums/authentication-factor.ts @@ -3,4 +3,5 @@ export enum AuthenticationFactor { Phone = 'phone', Totp = 'totp', Recoverycode = 'recoverycode', + Custom = 'custom', } \ No newline at end of file diff --git a/src/enums/build-runtime.ts b/src/enums/build-runtime.ts index 6c0f0008..50f152ac 100644 --- a/src/enums/build-runtime.ts +++ b/src/enums/build-runtime.ts @@ -9,6 +9,7 @@ export enum BuildRuntime { Node23 = 'node-23', Node24 = 'node-24', Node25 = 'node-25', + Node26 = 'node-26', Php80 = 'php-8.0', Php81 = 'php-8.1', Php82 = 'php-8.2', diff --git a/src/enums/embedding-model.ts b/src/enums/embedding-model.ts new file mode 100644 index 00000000..d06bb77b --- /dev/null +++ b/src/enums/embedding-model.ts @@ -0,0 +1,6 @@ +export enum EmbeddingModel { + Nomicembedtext = 'nomic-embed-text', + Embeddinggemma = 'embedding-gemma', + Allminilm = 'all-minilm', + Bgesmall = 'bge-small', +} \ No newline at end of file diff --git a/src/enums/invalidation-type.ts b/src/enums/invalidation-type.ts new file mode 100644 index 00000000..828f5402 --- /dev/null +++ b/src/enums/invalidation-type.ts @@ -0,0 +1,5 @@ +export enum InvalidationType { + Tag = 'tag', + Path = 'path', + All = 'all', +} \ No newline at end of file diff --git a/src/enums/project-key-scopes.ts b/src/enums/project-key-scopes.ts index b0ac3cdf..d4b5c7c9 100644 --- a/src/enums/project-key-scopes.ts +++ b/src/enums/project-key-scopes.ts @@ -33,6 +33,7 @@ export enum ProjectKeyScopes { IndexesWrite = 'indexes.write', RowsRead = 'rows.read', RowsWrite = 'rows.write', + EmbeddingsWrite = 'embeddings.write', CollectionsRead = 'collections.read', CollectionsWrite = 'collections.write', AttributesRead = 'attributes.read', @@ -97,6 +98,7 @@ export enum ProjectKeyScopes { WafRulesRead = 'wafRules.read', WafRulesWrite = 'wafRules.write', EventsRead = 'events.read', + ProxyInvalidationsWrite = 'proxy.invalidations.write', AppsRead = 'apps.read', AppsWrite = 'apps.write', Oauth2Read = 'oauth2.read', diff --git a/src/enums/project-policy-id.ts b/src/enums/project-policy-id.ts index 823727a0..4e287f49 100644 --- a/src/enums/project-policy-id.ts +++ b/src/enums/project-policy-id.ts @@ -9,6 +9,7 @@ export enum ProjectPolicyId { Sessionlimit = 'session-limit', Userlimit = 'user-limit', Membershipprivacy = 'membership-privacy', + Mfafactors = 'mfa-factors', Denyaliasedemail = 'deny-aliased-email', Denydisposableemail = 'deny-disposable-email', Denyfreeemail = 'deny-free-email', diff --git a/src/enums/runtime.ts b/src/enums/runtime.ts index 40616625..63e04b2a 100644 --- a/src/enums/runtime.ts +++ b/src/enums/runtime.ts @@ -9,6 +9,7 @@ export enum Runtime { Node23 = 'node-23', Node24 = 'node-24', Node25 = 'node-25', + Node26 = 'node-26', Php80 = 'php-8.0', Php81 = 'php-8.1', Php82 = 'php-8.2', diff --git a/src/index.ts b/src/index.ts index 0226923d..58388a19 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,6 +5,7 @@ export { Apps } from './services/apps'; export { Avatars } from './services/avatars'; export { Backups } from './services/backups'; export { Databases } from './services/databases'; +export { Embeddings } from './services/embeddings'; export { Functions } from './services/functions'; export { Graphql } from './services/graphql'; export { Locale } from './services/locale'; @@ -43,6 +44,7 @@ export { RelationshipType } from './enums/relationship-type'; export { RelationMutate } from './enums/relation-mutate'; export { DatabasesIndexType } from './enums/databases-index-type'; export { OrderBy } from './enums/order-by'; +export { EmbeddingModel } from './enums/embedding-model'; export { Runtime } from './enums/runtime'; export { ProjectKeyScopes } from './enums/project-key-scopes'; export { TemplateReferenceType } from './enums/template-reference-type'; @@ -63,6 +65,7 @@ export { ProjectServiceId } from './enums/project-service-id'; export { ProjectSMTPSecure } from './enums/project-smtp-secure'; export { ProjectEmailTemplateId } from './enums/project-email-template-id'; export { ProjectEmailTemplateLocale } from './enums/project-email-template-locale'; +export { InvalidationType } from './enums/invalidation-type'; export { StatusCode } from './enums/status-code'; export { ProxyResourceType } from './enums/proxy-resource-type'; export { Framework } from './enums/framework'; diff --git a/src/models.ts b/src/models.ts index 91002847..14faf011 100644 --- a/src/models.ts +++ b/src/models.ts @@ -497,7 +497,7 @@ export namespace Models { /** * List of policies. */ - policies: (Models.PolicyPasswordDictionary | Models.PolicyPasswordHistory | Models.PolicyPasswordStrength | Models.PolicyPasswordPersonalData | Models.PolicySessionAlert | Models.PolicySessionDuration | Models.PolicySessionInvalidation | Models.PolicySessionLimit | Models.PolicyUserLimit | Models.PolicyMembershipPrivacy | Models.PolicyDenyAliasedEmail | Models.PolicyDenyDisposableEmail | Models.PolicyDenyFreeEmail | Models.PolicyDenyCorporateEmail)[]; + policies: (Models.PolicyPasswordDictionary | Models.PolicyPasswordHistory | Models.PolicyPasswordStrength | Models.PolicyPasswordPersonalData | Models.PolicySessionAlert | Models.PolicySessionDuration | Models.PolicySessionInvalidation | Models.PolicySessionLimit | Models.PolicyUserLimit | Models.PolicyMembershipPrivacy | Models.PolicyMfaFactors | Models.PolicyDenyAliasedEmail | Models.PolicyDenyDisposableEmail | Models.PolicyDenyFreeEmail | Models.PolicyDenyCorporateEmail)[]; } /** @@ -640,6 +640,20 @@ export namespace Models { specifications: Specification[]; } + /** + * Embedding list + */ + export type EmbeddingList = { + /** + * Total number of embeddings that matched your query. + */ + total: number; + /** + * List of embeddings. + */ + embeddings: Embedding[]; + } + /** * Insights List */ @@ -701,7 +715,7 @@ export namespace Models { */ status?: DatabaseStatus; /** - * Underlying engine of the dedicated backing: postgresql, mysql, mariadb, or mongodb. A managed product (tablesdb, documentsdb, vectorsdb) reports the engine it runs on, so its type and engine can differ. Null when the database has no dedicated backing. + * Underlying engine of the dedicated backing: postgresql, mysql, or mongodb. A managed product (tablesdb, documentsdb, vectorsdb) reports the engine it runs on, so its type and engine can differ. Null when the database has no dedicated backing. */ engine?: string; /** @@ -722,6 +736,28 @@ export namespace Models { archives?: BackupArchive[]; } + /** + * Embedding + */ + export type Embedding = { + /** + * Embedding model used to generate embeddings. + */ + model: string; + /** + * Number of dimensions for each embedding vector. + */ + dimension: number; + /** + * Embedding vector values. If an error occurs, this will be an empty array. + */ + embedding: number[]; + /** + * Error message if embedding generation fails. Empty string if no error. + */ + error: string; + } + /** * Collection */ @@ -3427,6 +3463,14 @@ export namespace Models { * File name. */ name: string; + /** + * Virtual folder containing the file, with a trailing slash. Empty for the bucket root. + */ + folder: string; + /** + * Full virtual path of the file: the folder followed by the file name. + */ + key: string; /** * File MD5 signature. */ @@ -4347,6 +4391,10 @@ export namespace Models { * OAuth2 server scopes used when an authorization request omits the scope parameter */ oAuth2ServerDefaultScopes?: string[]; + /** + * Scopes an application may request when installed on a team + */ + oAuth2ServerInstallationScopes?: string[]; /** * OAuth2 server accepted RFC 9396 authorization_details types */ @@ -5805,6 +5853,32 @@ export namespace Models { userAccessedAt: boolean; } + /** + * Policy MFA Factors + */ + export type PolicyMfaFactors = { + /** + * Policy ID. + */ + $id: string; + /** + * Whether TOTP can be used to complete an MFA challenge. + */ + totp: boolean; + /** + * Whether email can be used to complete an MFA challenge. + */ + email: boolean; + /** + * Whether phone (SMS) can be used to complete an MFA challenge. + */ + phone: boolean; + /** + * Whether the custom factor can be used to complete an MFA challenge. + */ + custom: boolean; + } + /** * Platform Web */ @@ -6267,6 +6341,32 @@ export namespace Models { expire: string; } + /** + * MFA Challenge Secret + */ + export type MfaChallengeSecret = { + /** + * Token ID. + */ + $id: string; + /** + * Token creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * User ID. + */ + userId: string; + /** + * Token expiration date in ISO 8601 format. + */ + expire: string; + /** + * Challenge code to be delivered to the end user through a custom channel. + */ + code: string; + } + /** * MFA Recovery Codes */ @@ -6311,6 +6411,10 @@ export namespace Models { * Can recovery code be used for MFA challenge for this account. */ recoveryCode: boolean; + /** + * Can custom factor be used for MFA challenge for this account. + */ + custom: boolean; } /** @@ -7006,7 +7110,7 @@ export namespace Models { /** * Members */ - members: number; + members?: number; /** * Webhooks */ @@ -7102,7 +7206,7 @@ export namespace Models { /** * Activity log days */ - activityLogs: number; + activityLogs?: number; /** * Usage history days */ @@ -7198,7 +7302,7 @@ export namespace Models { /** * Does plan support backup policies. */ - backupsEnabled: boolean; + backupsEnabled?: boolean; /** * Whether usage addons are calculated per project. */ @@ -7210,7 +7314,7 @@ export namespace Models { /** * How many policies does plan support */ - backupPolicies: number; + backupPolicies?: number; /** * Maximum function and site deployment size in MB */ @@ -7248,11 +7352,11 @@ export namespace Models { /** * Addon seats */ - seats: BillingPlanAddonDetails; + seats?: BillingPlanAddonDetails; /** * Addon projects */ - projects: BillingPlanAddonDetails; + projects?: BillingPlanAddonDetails; } /** @@ -7278,7 +7382,7 @@ export namespace Models { /** * Price currency */ - currency: string; + currency?: string; /** * Price */ @@ -7457,6 +7561,76 @@ export namespace Models { billingPlan: string; } + /** + * Database Migration + */ + export type DatabaseMigration = { + /** + * Database migration ID. + */ + $id: string; + /** + * Migration creation time in ISO 8601 format. + */ + $createdAt: string; + /** + * Migration update time in ISO 8601 format. + */ + $updatedAt: string; + /** + * Project ID that owns the migrating database. + */ + projectId: string; + /** + * Logical database ID being migrated. + */ + databaseId: string; + /** + * Dedicated compute specification provisioned for the migration target. + */ + specification: string; + /** + * Migration phase. Possible values: pending, provisioned, capturing, backfilling, catching_up, verifying, ready_to_cutover, cutover, soaking, done, failed, rolled_back. + */ + phase: string; + /** + * Number of times a migration step has failed and been recorded. + */ + attempt: number; + /** + * Reason the most recent migration step failed, empty while none has. + */ + lastError: string; + /** + * Number of documents still pending replication to the target. + */ + lagDocuments: number; + /** + * Time the migrated data was verified against the source in ISO 8601 format. + */ + verifiedAt: string; + /** + * Time routing was flipped to the target in ISO 8601 format. + */ + cutoverAt: string; + /** + * Time the post-cutover soak window ends in ISO 8601 format. + */ + soakUntil: string; + /** + * Whether the migration cuts over automatically once ready. Set when the migration is created and never changed afterwards, so it always reports what was asked for. + */ + autoCutover: boolean; + /** + * Whether a cutover has been requested and not yet attempted. Set by the cutover endpoint and cleared when the attempt is made, so a cutover that fails a check parks the migration again rather than retrying on its own. + */ + cutoverRequested: boolean; + /** + * Whether the migration is paused. + */ + paused: boolean; + } + /** * DedicatedDatabase */ @@ -7486,7 +7660,7 @@ export namespace Models { */ api: string; /** - * Database engine: postgresql, mysql, mariadb, or mongodb. + * Database engine: postgresql, mysql, or mongodb. Null until the backing reports one. */ engine: string; /** @@ -7506,7 +7680,7 @@ export namespace Models { */ hostname: string; /** - * Database port for connections. + * Database port for connections. Derived from the engine when the backing has not reported one yet. */ connectionPort: number; /** @@ -7582,11 +7756,7 @@ export namespace Models { */ syncMode: string; /** - * Number of cross-region replicas. Cross-region availability is enabled when greater than 0. - */ - crossRegionReplicas: number; - /** - * Maximum concurrent connections. + * Maximum concurrent client connections. This is the limit a client pool may reach; the engine's own max_connections reported by the status endpoint is a smaller backend limit the pooler multiplexes onto and does not constrain a client pool. */ networkMaxConnections: number; /** @@ -7664,7 +7834,7 @@ export namespace Models { */ export type DatabaseStatus = { /** - * Overall health status: healthy, degraded, or unhealthy. + * Overall health status: healthy, degraded, unhealthy, or unknown when nothing could be measured. */ health: string; /** @@ -7672,7 +7842,7 @@ export namespace Models { */ ready: boolean; /** - * Database engine: postgresql, mysql, mariadb, or mongodb. + * Database engine: postgresql, mysql, or mongodb. */ engine: string; /** @@ -7688,7 +7858,31 @@ export namespace Models { */ connections: DatabaseStatusConnections; /** - * List of database replicas and their status. + * Requested replication sync mode. Possible values: async, sync, quorum. Compare with effectiveSyncMode for what the primary is enforcing. + */ + syncMode: string; + /** + * Replication sync mode the primary is actually enforcing. Null when high availability is disabled or the state could not be read. + */ + effectiveSyncMode?: string; + /** + * Whether the enforced replication is weaker than the requested syncMode. + */ + syncDegraded: boolean; + /** + * Number of standby acknowledgements the primary waits for before a write is committed. + */ + syncAcknowledgements: number; + /** + * Number of standbys registered with the primary for synchronous replication. + */ + syncStandbyCount: number; + /** + * Whether the other sync fields are an engine reading rather than a recorded estimate. True when the primary answered what it is enforcing, including when that answer contradicted the record, in which case the contradicted values are replaced by the ones the engine reports. False when the reading could not be taken: the probe did not answer, there was no engine to ask, or the values describe a configuration change just applied rather than anything measured. Absent when no engine was asked at all, so an unprobed database is distinguishable from an unconfirmed one. False never means a standby was found lagging, because it is the absence of a reading rather than a negative one, so draw no conclusion about replication health from it or from a response that omits it. + */ + syncStateConfirmed?: boolean; + /** + * List of database replicas and their status. Every configured member appears, including one the backend has not brought up, which is reported as not healthy. */ replicas: DatabaseStatusReplica[]; /** @@ -7706,17 +7900,81 @@ export namespace Models { */ $id: string; /** - * Member role. Possible values: primary (accepts reads and writes), replica (read-only follower). + * Member role. Possible values: primary (accepts reads and writes), replica (read-only follower), unknown (placement not established; reported while a transition is moving or restarting the topology and this member has not been probed, so no member can be named the write target). */ role: string; /** - * Member pod status. Possible values: provisioning (pod missing or Pending), starting (Running but not Ready), active (Running and Ready), failed (Failed phase or CrashLoopBackOff container), or the lowercased pod phase reported by the cluster. + * Member pod status. Possible values: pending (configured but absent from the backend topology, so nothing is bringing it up), provisioning (pod missing or Pending), starting (Running but not Ready), active (Running and Ready), failed (Failed phase or CrashLoopBackOff container), or the lowercased pod phase reported by the cluster. */ status: string; /** - * Replication lag in seconds. + * Replication lag in seconds. Null when the lag is not known: a primary has none to report, and a member the backend has not probed has none yet. */ - lagSeconds: number; + lagSeconds?: number; + } + + /** + * Operation + */ + export type DedicatedDatabaseOperation = { + /** + * Operation ID. + */ + $id: string; + /** + * Operation creation time in ISO 8601 format. + */ + $createdAt: string; + /** + * Database ID the operation ran against. + */ + databaseId: string; + /** + * Operation type, such as provision, update, restore, pausing, resuming, failover, backup-create or cross-region-enable. + */ + type: string; + /** + * Operation status. Possible values: running (in progress), completed (finished successfully), failed (ended in an error). + */ + status: string; + /** + * Number of times this operation has been attempted. + */ + attempts: number; + /** + * Time the operation was requested, in ISO 8601 format. + */ + requestedAt?: string; + /** + * Time the operation started, in ISO 8601 format. + */ + startedAt?: string; + /** + * Time the operation reached a terminal state, in ISO 8601 format. + */ + completedAt?: string; + /** + * Machine-readable failure code. `Interrupted` marks an attempt that ended before its outcome could be confirmed. + */ + errorCode: string; + /** + * Failure message if the operation failed. + */ + errorMessage: string; + } + + /** + * OperationList + */ + export type DedicatedDatabaseOperationList = { + /** + * Total number of operations. + */ + total: number; + /** + * List of operations. + */ + operations: DedicatedDatabaseOperation[]; } /** @@ -7728,15 +7986,57 @@ export namespace Models { */ replicas: number; /** - * Replication sync mode. Possible values: async (asynchronous, fastest), sync (synchronous, strong consistency), quorum (quorum-based, majority of replicas must confirm). + * Requested replication sync mode. Possible values: async (asynchronous, fastest), sync (synchronous, strong consistency), quorum (quorum-based, majority of replicas must confirm). This is what was asked for; compare it with effectiveSyncMode for what the primary is enforcing. */ syncMode: string; + /** + * Replication sync mode the primary is actually enforcing. Null when high availability is disabled or the state could not be read. A value below the requested syncMode means writes are being acknowledged with weaker durability than configured. + */ + effectiveSyncMode?: string; + /** + * Whether the enforced replication is weaker than the requested syncMode. + */ + syncDegraded: boolean; + /** + * Number of standby acknowledgements the primary waits for before a write is committed. Zero means writes are acknowledged locally. + */ + syncAcknowledgements: number; + /** + * Number of standbys registered with the primary for synchronous replication. + */ + syncStandbyCount: number; + /** + * Whether the other sync fields are an engine reading rather than a recorded estimate. True when the primary answered what it is enforcing, including when that answer contradicted the record, in which case the contradicted values are replaced by the ones the engine reports. False when the reading could not be taken: the probe did not answer, there was no engine to ask, or the values describe a configuration change just applied rather than anything measured. Absent when no engine was asked at all, so an unprobed database is distinguishable from an unconfirmed one. False never means a standby was found lagging, because it is the absence of a reading rather than a negative one, so draw no conclusion about replication health from it or from a response that omits it. + */ + syncStateConfirmed?: boolean; /** * Per-pod statuses for the primary and every replica. */ members: DedicatedDatabaseMember[]; } + /** + * Invalidation + */ + export type ProxyInvalidation = { + /** + * Domain name. + */ + domain: string; + /** + * Invalidation type. Possible values are "tag", "path", or "all". + */ + type: string; + /** + * Invalidated reference. Depending on type this is a cache tag name, a URL path, or empty when type is all. + */ + reference: string; + /** + * Invalidation status. + */ + status: string; + } + /** * Organization */ @@ -7766,9 +8066,9 @@ export namespace Models { */ prefs: Preferences; /** - * Project budget limit + * Project budget limit. Null when no budget is set. */ - billingBudget: number; + billingBudget?: number; /** * Project budget limit */ @@ -7804,7 +8104,7 @@ export namespace Models { /** * Start date of trial. */ - billingTrialStartDate: string; + billingTrialStartDate?: string; /** * Number of trial days. */ @@ -7824,11 +8124,11 @@ export namespace Models { /** * Default payment method. */ - billingAddressId: string; + billingAddressId?: string; /** * Backup payment method. */ - backupPaymentMethodId: string; + backupPaymentMethodId?: string; /** * Team status. */ @@ -7836,27 +8136,27 @@ export namespace Models { /** * Remarks on team status. */ - remarks: string; + remarks?: string; /** * Organization agreements */ - agreementBAA: string; + agreementBAA?: string; /** * Program manager's name. */ - programManagerName: string; + programManagerName?: string; /** * Program manager's calendar link. */ - programManagerCalendar: string; + programManagerCalendar?: string; /** * Program's discord channel name. */ - programDiscordChannelName: string; + programDiscordChannelName?: string; /** * Program's discord channel URL. */ - programDiscordChannelUrl: string; + programDiscordChannelUrl?: string; /** * Billing limits reached */ @@ -7864,11 +8164,11 @@ export namespace Models { /** * Billing plan selected for downgrade. */ - billingPlanDowngrade: string; + billingPlanDowngrade?: string; /** * Tax Id */ - billingTaxId: string; + billingTaxId?: string; /** * Marked for deletion */ @@ -8161,10 +8461,6 @@ export namespace Models { * High availability replica price as a fraction of the specification cost. */ replicaRate: number; - /** - * Cross-region replica price as a fraction of the specification cost. - */ - crossRegionReplicaRate: number; /** * Point-in-time recovery price as a fraction of the specification cost. */ @@ -8180,7 +8476,7 @@ export namespace Models { */ current: number; /** - * Maximum allowed connections. + * The engine's own max_connections. On a pooled database this is the backend limit the pooler multiplexes onto, not the ceiling a client pool may reach — that is networkMaxConnections on the database resource. */ max: number; } @@ -8190,11 +8486,11 @@ export namespace Models { */ export type DatabaseStatusReplica = { /** - * StatefulSet pod index (0 = primary, 1+ = replicas). + * Member index within the database. Read `role` for which member accepts writes: a failover moves the primary without renumbering the indexes. */ index: number; /** - * Replica role: primary or replica. + * Member role. Possible values: primary (accepts reads and writes), replica (read-only follower), unknown (placement not established; reported while a transition is moving or restarting the topology, so no member can be named the write target). */ role: string; /** @@ -8244,7 +8540,7 @@ export namespace Models { /** * Member additional resources */ - member: AdditionalResource; + member?: AdditionalResource; /** * Realtime additional resources */ @@ -8256,7 +8552,7 @@ export namespace Models { /** * Realtime bandwidth additional resources */ - realtimeBandwidth: AdditionalResource; + realtimeBandwidth?: AdditionalResource; /** * Storage additional resources */ @@ -8276,7 +8572,7 @@ export namespace Models { /** * Credits additional resources */ - credits: AdditionalResource; + credits?: AdditionalResource; } /** @@ -8989,6 +9285,20 @@ export namespace Models { restorations: BackupRestoration[]; } + /** + * Database Migrations List + */ + export type DatabaseMigrationList = { + /** + * Total number of migrations that matched your query. + */ + total: number; + /** + * List of migrations. + */ + migrations: DatabaseMigration[]; + } + /** * Apps list */ diff --git a/src/services/account.ts b/src/services/account.ts index 3443e136..849902c5 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -668,60 +668,6 @@ export class Account { ); } - /** - * Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame. - * - * @param {number} params.duration - Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds. - * @throws {AppwriteException} - * @returns {Promise} - */ - createJWT(params?: { duration?: number }): Promise; - /** - * Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame. - * - * @param {number} duration - Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - createJWT(duration?: number): Promise; - createJWT( - paramsOrFirst?: { duration?: number } | number - ): Promise { - let params: { duration?: number }; - - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { duration?: number }; - } else { - params = { - duration: paramsOrFirst as number - }; - } - - const duration = params.duration; - - - const apiPath = '/account/jwts'; - const payload: Payload = {}; - if (typeof duration !== 'undefined') { - payload['duration'] = duration; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - } - - return this.client.call( - 'post', - uri, - apiHeaders, - payload, - ); - } - /** * Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log. * @@ -1190,7 +1136,7 @@ export class Account { /** * Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method. * - * @param {AuthenticationFactor} params.factor - Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`. + * @param {AuthenticationFactor} params.factor - Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`, `custom`. * @throws {AppwriteException} * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `Account.createMFAChallenge` instead. @@ -1199,7 +1145,7 @@ export class Account { /** * Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method. * - * @param {AuthenticationFactor} factor - Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`. + * @param {AuthenticationFactor} factor - Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`, `custom`. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. @@ -1248,7 +1194,7 @@ export class Account { /** * Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method. * - * @param {AuthenticationFactor} params.factor - Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`. + * @param {AuthenticationFactor} params.factor - Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`, `custom`. * @throws {AppwriteException} * @returns {Promise} */ @@ -1256,7 +1202,7 @@ export class Account { /** * Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method. * - * @param {AuthenticationFactor} factor - Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`. + * @param {AuthenticationFactor} factor - Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`, `custom`. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. diff --git a/src/services/activities.ts b/src/services/activities.ts index e473154b..53fca89c 100644 --- a/src/services/activities.ts +++ b/src/services/activities.ts @@ -13,30 +13,30 @@ export class Activities { /** * List all events for selected filters. * - * @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/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on attributes such as userId, teamId, etc. + * @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/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on attributes such as userId, teamId, etc. * @throws {AppwriteException} * @returns {Promise} */ - listEvents(params?: { queries?: string }): Promise; + listEvents(params?: { queries?: string[] }): Promise; /** * List all events for selected filters. * - * @param {string} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on attributes such as userId, teamId, etc. + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on attributes such as userId, teamId, etc. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - listEvents(queries?: string): Promise; + listEvents(queries?: string[]): Promise; listEvents( - paramsOrFirst?: { queries?: string } | string + paramsOrFirst?: { queries?: string[] } | string[] ): Promise { - let params: { queries?: string }; + let params: { queries?: string[] }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { queries?: string }; + params = (paramsOrFirst || {}) as { queries?: string[] }; } else { params = { - queries: paramsOrFirst as string + queries: paramsOrFirst as string[] }; } diff --git a/src/services/apps.ts b/src/services/apps.ts index bdee84f4..f47da03c 100644 --- a/src/services/apps.ts +++ b/src/services/apps.ts @@ -314,7 +314,7 @@ export class Apps { /** * Get an application by its unique ID. * - * @param {string} params.appId - Application unique ID or HTTPS client ID metadata document URL. + * @param {string} params.appId - Application unique ID. * @throws {AppwriteException} * @returns {Promise} */ @@ -322,7 +322,7 @@ export class Apps { /** * Get an application by its unique ID. * - * @param {string} appId - Application unique ID or HTTPS client ID metadata document URL. + * @param {string} appId - Application unique ID. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. @@ -385,7 +385,7 @@ export class Apps { * @param {string[]} params.postLogoutRedirectUris - Post-logout redirect URIs for OpenID Connect RP-Initiated Logout. Each must be an https URL, an http loopback URL, or a private-use scheme URI, and must not contain a fragment. After ending the user session, the logout endpoint only redirects to URIs in this list. * @param {string} params.type - OAuth2 client type. Use `public` for SPAs, mobile, and native apps that cannot keep a `client_secret` — PKCE is then required at the token endpoint. Use `confidential` for server-side clients that present a `client_secret`. Defaults to `confidential`. * @param {boolean} params.deviceFlow - Allow this client to use the OAuth2 Device Authorization Grant (RFC 8628) for input-constrained devices such as TVs and CLIs. Defaults to false. - * @param {string[]} params.installationScopes - Scopes the application requests when installed on a team. Organization-level and project-level scopes only; use the list scopes endpoint with `type=installation` to discover available values. Maximum of 100 scopes are allowed. + * @param {string[]} params.installationScopes - Scopes the application requests when installed on a team. Only scopes allowed by the project's OAuth2 server installation scopes configuration are accepted; use the list installation scopes endpoint to discover available values. Maximum of 100 scopes are allowed. * @param {string} params.installationRedirectUrl - URL users are redirected to after creating or updating an installation of this application. Must be an https URL, an http loopback URL (localhost, 127.0.0.1, [::1]), or a private-use scheme URI, and must not contain a fragment. Leave empty for no redirect. * @throws {AppwriteException} * @returns {Promise} @@ -412,7 +412,7 @@ export class Apps { * @param {string[]} postLogoutRedirectUris - Post-logout redirect URIs for OpenID Connect RP-Initiated Logout. Each must be an https URL, an http loopback URL, or a private-use scheme URI, and must not contain a fragment. After ending the user session, the logout endpoint only redirects to URIs in this list. * @param {string} type - OAuth2 client type. Use `public` for SPAs, mobile, and native apps that cannot keep a `client_secret` — PKCE is then required at the token endpoint. Use `confidential` for server-side clients that present a `client_secret`. Defaults to `confidential`. * @param {boolean} deviceFlow - Allow this client to use the OAuth2 Device Authorization Grant (RFC 8628) for input-constrained devices such as TVs and CLIs. Defaults to false. - * @param {string[]} installationScopes - Scopes the application requests when installed on a team. Organization-level and project-level scopes only; use the list scopes endpoint with `type=installation` to discover available values. Maximum of 100 scopes are allowed. + * @param {string[]} installationScopes - Scopes the application requests when installed on a team. Only scopes allowed by the project's OAuth2 server installation scopes configuration are accepted; use the list installation scopes endpoint to discover available values. Maximum of 100 scopes are allowed. * @param {string} installationRedirectUrl - URL users are redirected to after creating or updating an installation of this application. Must be an https URL, an http loopback URL (localhost, 127.0.0.1, [::1]), or a private-use scheme URI, and must not contain a fragment. Leave empty for no redirect. * @throws {AppwriteException} * @returns {Promise} @@ -610,7 +610,7 @@ export class Apps { } /** - * List installations of an application. Requires an app key sent in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header. + * List installations of an application. Requires an app key sent in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header, or a caller with update access to the app. * * @param {string} params.appId - Application unique ID. * @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. @@ -620,7 +620,7 @@ export class Apps { */ listInstallations(params: { appId: string, queries?: string[], total?: boolean }): Promise; /** - * List installations of an application. Requires an app key sent in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header. + * List installations of an application. Requires an app key sent in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header, or a caller with update access to the app. * * @param {string} appId - Application unique ID. * @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. @@ -678,7 +678,7 @@ export class Apps { } /** - * Get an installation of an application by its unique ID. Requires an app key sent in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header. + * Get an installation of an application by its unique ID. Requires an app key sent in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header, or a caller with update access to the app. * * @param {string} params.appId - Application unique ID. * @param {string} params.installationId - Installation unique ID. @@ -687,7 +687,7 @@ export class Apps { */ getInstallation(params: { appId: string, installationId: string }): Promise; /** - * Get an installation of an application by its unique ID. Requires an app key sent in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header. + * Get an installation of an application by its unique ID. Requires an app key sent in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header, or a caller with update access to the app. * * @param {string} appId - Application unique ID. * @param {string} installationId - Installation unique ID. @@ -739,7 +739,69 @@ export class Apps { } /** - * Create a token for an installation of an application. Requires an app key sent in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header. The returned token carries the scopes and authorization details granted to the installation, and can be used as an `Authorization: Bearer` header everywhere OAuth2 access tokens are accepted. Multiple tokens can be active for the same installation at once; each token stays valid until it expires or the installation is updated or deleted. + * Delete an installation of an application by its unique ID. Requires a caller with update access to the app. Previously issued installation access tokens are revoked. + * + * @param {string} params.appId - Application unique ID. + * @param {string} params.installationId - Installation unique ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deleteInstallation(params: { appId: string, installationId: string }): Promise<{}>; + /** + * Delete an installation of an application by its unique ID. Requires a caller with update access to the app. Previously issued installation access tokens are revoked. + * + * @param {string} appId - Application unique ID. + * @param {string} installationId - Installation unique ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deleteInstallation(appId: string, installationId: string): Promise<{}>; + deleteInstallation( + paramsOrFirst: { appId: string, installationId: string } | string, + ...rest: [(string)?] + ): Promise<{}> { + let params: { appId: string, installationId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { appId: string, installationId: string }; + } else { + params = { + appId: paramsOrFirst as string, + installationId: rest[0] as string + }; + } + + const appId = params.appId; + const installationId = params.installationId; + + if (typeof appId === 'undefined') { + throw new AppwriteException('Missing required parameter: "appId"'); + } + if (typeof installationId === 'undefined') { + throw new AppwriteException('Missing required parameter: "installationId"'); + } + + const apiPath = '/apps/{appId}/installations/{installationId}'.replace('{appId}', encodeURIComponent(String(appId))).replace('{installationId}', encodeURIComponent(String(installationId))); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + 'accept': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload, + ); + } + + /** + * Create a token for an installation of an application. Requires an app key sent in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header, or a caller with update access to the app. The returned token carries the scopes and authorization details granted to the installation, and can be used as an `Authorization: Bearer` header everywhere OAuth2 access tokens are accepted. Multiple tokens can be active for the same installation at once; each token stays valid until it expires or the installation is updated or deleted. * * @param {string} params.appId - Application unique ID. * @param {string} params.installationId - Installation unique ID. @@ -748,7 +810,7 @@ export class Apps { */ createInstallationToken(params: { appId: string, installationId: string }): Promise; /** - * Create a token for an installation of an application. Requires an app key sent in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header. The returned token carries the scopes and authorization details granted to the installation, and can be used as an `Authorization: Bearer` header everywhere OAuth2 access tokens are accepted. Multiple tokens can be active for the same installation at once; each token stays valid until it expires or the installation is updated or deleted. + * Create a token for an installation of an application. Requires an app key sent in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header, or a caller with update access to the app. The returned token carries the scopes and authorization details granted to the installation, and can be used as an `Authorization: Bearer` header everywhere OAuth2 access tokens are accepted. Multiple tokens can be active for the same installation at once; each token stays valid until it expires or the installation is updated or deleted. * * @param {string} appId - Application unique ID. * @param {string} installationId - Installation unique ID. diff --git a/src/services/backups.ts b/src/services/backups.ts index ee83d6ad..7902c675 100644 --- a/src/services/backups.ts +++ b/src/services/backups.ts @@ -591,18 +591,18 @@ export class Backups { /** * Create and trigger a new restoration for a backup on a project. * - * For a backup of one database, the restoration resolves its destination before it is queued. Pass `newResourceId` to restore into that database ID, including the archived database ID to overwrite it. When `newResourceId` is omitted, a new database ID is generated and returned in `options`. + * For a backup of one database, the restoration resolves its destination before it is queued. When `newResourceId` is omitted, the archived database is restored in place and its own ID is returned in `options`. Pass a different `newResourceId` to restore alongside it as a new database instead. * * The restoration migration records the archived database in `resourceId` and `resourceType`, and the resolved database in `destinationResourceId` and `destinationResourceType`. Database types are stored canonically as `database`, `documentsdb`, or `vectorsdb`. Project-wide restorations leave these fields empty because they do not have a single source or destination database. * * To list every migration related to one database, use its canonical type in a nested `OR(AND(...), AND(...), AND(...))` across the root, parent, and destination relation pairs: `(resourceType, resourceId)`, `(parentResourceType, parentResourceId)`, and `(destinationResourceType, destinationResourceId)`. Legacy and TablesDB databases use `database`; the operational `resourceType` of a table migration is not rewritten to `tablesdb`. * - * When restoring a DocumentsDB or VectorsDB database to a new resource from a dedicated source, the restore provisions a fresh dedicated backing database at the source database's own specification. + * When restoring a DocumentsDB or VectorsDB database from a dedicated source, the restore provisions a fresh dedicated backing database at the source database's own specification and lands the data there. An in-place restore swaps the database onto that backing only once the restore has succeeded, and retires the backing it displaced only once that swap is confirmed, so the source keeps serving its own data until the restored data is in place and any failure leaves it untouched. A serverless source has no dedicated backing to clone and restores onto the archived database instead. * * * @param {string} params.archiveId - Backup archive ID to restore * @param {BackupServices[]} params.services - Array of services to restore - * @param {string} params.newResourceId - Destination resource ID. Omit to generate a new ID, or pass the archived resource ID to overwrite it. 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.newResourceId - Destination resource ID. Omit to restore the archived resource in place, or pass a different ID to restore alongside it as a new resource. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {string} params.newResourceName - Database name. Max length: 128 chars. * @throws {AppwriteException} * @returns {Promise} @@ -611,18 +611,18 @@ export class Backups { /** * Create and trigger a new restoration for a backup on a project. * - * For a backup of one database, the restoration resolves its destination before it is queued. Pass `newResourceId` to restore into that database ID, including the archived database ID to overwrite it. When `newResourceId` is omitted, a new database ID is generated and returned in `options`. + * For a backup of one database, the restoration resolves its destination before it is queued. When `newResourceId` is omitted, the archived database is restored in place and its own ID is returned in `options`. Pass a different `newResourceId` to restore alongside it as a new database instead. * * The restoration migration records the archived database in `resourceId` and `resourceType`, and the resolved database in `destinationResourceId` and `destinationResourceType`. Database types are stored canonically as `database`, `documentsdb`, or `vectorsdb`. Project-wide restorations leave these fields empty because they do not have a single source or destination database. * * To list every migration related to one database, use its canonical type in a nested `OR(AND(...), AND(...), AND(...))` across the root, parent, and destination relation pairs: `(resourceType, resourceId)`, `(parentResourceType, parentResourceId)`, and `(destinationResourceType, destinationResourceId)`. Legacy and TablesDB databases use `database`; the operational `resourceType` of a table migration is not rewritten to `tablesdb`. * - * When restoring a DocumentsDB or VectorsDB database to a new resource from a dedicated source, the restore provisions a fresh dedicated backing database at the source database's own specification. + * When restoring a DocumentsDB or VectorsDB database from a dedicated source, the restore provisions a fresh dedicated backing database at the source database's own specification and lands the data there. An in-place restore swaps the database onto that backing only once the restore has succeeded, and retires the backing it displaced only once that swap is confirmed, so the source keeps serving its own data until the restored data is in place and any failure leaves it untouched. A serverless source has no dedicated backing to clone and restores onto the archived database instead. * * * @param {string} archiveId - Backup archive ID to restore * @param {BackupServices[]} services - Array of services to restore - * @param {string} newResourceId - Destination resource ID. Omit to generate a new ID, or pass the archived resource ID to overwrite it. 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} newResourceId - Destination resource ID. Omit to restore the archived resource in place, or pass a different ID to restore alongside it as a new resource. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {string} newResourceName - Database name. Max length: 128 chars. * @throws {AppwriteException} * @returns {Promise} diff --git a/src/services/databases.ts b/src/services/databases.ts index ee501f83..6a3ee13e 100644 --- a/src/services/databases.ts +++ b/src/services/databases.ts @@ -774,7 +774,7 @@ export class Databases { * @param {string[]} params.permissions - An array of permissions strings. By default, no user is granted with any permissions. [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 {object[]} params.attributes - Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, integer, float, boolean, datetime), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options. + * @param {object[]} params.attributes - Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, varchar, text, mediumtext, longtext, integer, bigint, double, boolean, datetime, point, linestring, polygon, email, url, ip, enum), size (integer, required for string and varchar types), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options. * @param {object[]} params.indexes - Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of attribute keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional). * @throws {AppwriteException} * @returns {Promise} @@ -790,7 +790,7 @@ export class Databases { * @param {string[]} permissions - An array of permissions strings. By default, no user is granted with any permissions. [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 {object[]} attributes - Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, integer, float, boolean, datetime), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options. + * @param {object[]} attributes - Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, varchar, text, mediumtext, longtext, integer, bigint, double, boolean, datetime, point, linestring, polygon, email, url, ip, enum), size (integer, required for string and varchar types), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options. * @param {object[]} indexes - Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of attribute keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional). * @throws {AppwriteException} * @returns {Promise} @@ -3825,11 +3825,11 @@ export class Databases { * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. * @param {string} params.relatedCollectionId - Related Collection ID. - * @param {RelationshipType} params.type - Relation type + * @param {RelationshipType} params.type - Relationship type. Possible values are: oneToOne, oneToMany, manyToOne, manyToMany. * @param {boolean} params.twoWay - Is Two Way? * @param {string} params.key - Attribute Key. * @param {string} params.twoWayKey - Two Way Attribute Key. - * @param {RelationMutate} params.onDelete - Constraints option + * @param {RelationMutate} params.onDelete - Delete constraint. Possible values are: cascade, restrict, setNull. * @throws {AppwriteException} * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createRelationshipColumn` instead. @@ -3842,11 +3842,11 @@ export class Databases { * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. * @param {string} relatedCollectionId - Related Collection ID. - * @param {RelationshipType} type - Relation type + * @param {RelationshipType} type - Relationship type. Possible values are: oneToOne, oneToMany, manyToOne, manyToMany. * @param {boolean} twoWay - Is Two Way? * @param {string} key - Attribute Key. * @param {string} twoWayKey - Two Way Attribute Key. - * @param {RelationMutate} onDelete - Constraints option + * @param {RelationMutate} onDelete - Delete constraint. Possible values are: cascade, restrict, setNull. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. @@ -3938,7 +3938,7 @@ export class Databases { * @param {string} params.databaseId - Database ID. * @param {string} params.collectionId - Collection ID. * @param {string} params.key - Attribute Key. - * @param {RelationMutate} params.onDelete - Constraints option + * @param {RelationMutate} params.onDelete - Delete constraint. Possible values are: cascade, restrict, setNull. * @param {string} params.newKey - New Attribute Key. * @throws {AppwriteException} * @returns {Promise} @@ -3952,7 +3952,7 @@ export class Databases { * @param {string} databaseId - Database ID. * @param {string} collectionId - Collection ID. * @param {string} key - Attribute Key. - * @param {RelationMutate} onDelete - Constraints option + * @param {RelationMutate} onDelete - Delete constraint. Possible values are: cascade, restrict, setNull. * @param {string} newKey - New Attribute Key. * @throws {AppwriteException} * @returns {Promise} diff --git a/src/services/embeddings.ts b/src/services/embeddings.ts new file mode 100644 index 00000000..0a38c3a7 --- /dev/null +++ b/src/services/embeddings.ts @@ -0,0 +1,80 @@ +import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; +import type { Models } from '../models'; + + +import { EmbeddingModel } from '../enums/embedding-model'; + +export class Embeddings { + client: Client; + + constructor(client: Client) { + this.client = client; + } + + /** + * Generate vector embeddings for an array of text using the selected embedding model. Use the returned vectors to power semantic search and similarity queries against your vector collections. + * + * + * @param {string[]} params.texts - Array of text to generate embeddings. + * @param {EmbeddingModel} params.model - The embedding model to use for generating vector embeddings. + * @throws {AppwriteException} + * @returns {Promise} + */ + createTextEmbeddings(params: { texts: string[], model?: EmbeddingModel }): Promise; + /** + * Generate vector embeddings for an array of text using the selected embedding model. Use the returned vectors to power semantic search and similarity queries against your vector collections. + * + * + * @param {string[]} texts - Array of text to generate embeddings. + * @param {EmbeddingModel} model - The embedding model to use for generating vector embeddings. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createTextEmbeddings(texts: string[], model?: EmbeddingModel): Promise; + createTextEmbeddings( + paramsOrFirst: { texts: string[], model?: EmbeddingModel } | string[], + ...rest: [(EmbeddingModel)?] + ): Promise { + let params: { texts: string[], model?: EmbeddingModel }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { texts: string[], model?: EmbeddingModel }; + } else { + params = { + texts: paramsOrFirst as string[], + model: rest[0] as EmbeddingModel + }; + } + + const texts = params.texts; + const model = params.model; + + if (typeof texts === 'undefined') { + throw new AppwriteException('Missing required parameter: "texts"'); + } + + const apiPath = '/embeddings/text'; + const payload: Payload = {}; + if (typeof texts !== 'undefined') { + payload['texts'] = texts; + } + if (typeof model !== 'undefined') { + payload['model'] = model; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + 'accept': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } +} diff --git a/src/services/functions.ts b/src/services/functions.ts index 99573812..66c218f8 100644 --- a/src/services/functions.ts +++ b/src/services/functions.ts @@ -324,7 +324,7 @@ export class Functions { /** * List allowed function specifications for this instance. * - * @param {string} params.type - Specification type to list. Can be one of: runtimes, builds. + * @param {string} params.type - Specification type to list. Can be one of: runtimes, builds. Defaults to runtimes. * @throws {AppwriteException} * @returns {Promise} */ @@ -332,7 +332,7 @@ export class Functions { /** * List allowed function specifications for this instance. * - * @param {string} type - Specification type to list. Can be one of: runtimes, builds. + * @param {string} type - Specification type to list. Can be one of: runtimes, builds. Defaults to runtimes. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. diff --git a/src/services/project.ts b/src/services/project.ts index 747b5410..990a2303 100644 --- a/src/services/project.ts +++ b/src/services/project.ts @@ -196,95 +196,6 @@ export class Project { ); } - /** - * Create a new API key. It's recommended to have multiple API keys with strict scopes for separate functions within your project. - * - * You can also create an ephemeral API key if you need a short-lived key instead. - * - * @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 {ProjectKeyScopes[]} params.scopes - Key scopes list. Maximum of 200 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: ProjectKeyScopes[], 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. - * - * You can also create an ephemeral API key if you need a short-lived key instead. - * - * @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 {ProjectKeyScopes[]} scopes - Key scopes list. Maximum of 200 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: ProjectKeyScopes[], expire?: string): Promise; - createKey( - paramsOrFirst: { keyId: string, name: string, scopes: ProjectKeyScopes[], expire?: string } | string, - ...rest: [(string)?, (ProjectKeyScopes[])?, (string)?] - ): Promise { - let params: { keyId: string, name: string, scopes: ProjectKeyScopes[], expire?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { keyId: string, name: string, scopes: ProjectKeyScopes[], expire?: string }; - } else { - params = { - keyId: paramsOrFirst as string, - name: rest[0] as string, - scopes: rest[1] as ProjectKeyScopes[], - 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 } = { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - } - - return this.client.call( - 'post', - uri, - apiHeaders, - payload, - ); - } - /** * Create a new ephemeral API key. It's recommended to have multiple API keys with strict scopes for separate functions within your project. * @@ -981,10 +892,11 @@ export class Project { * @param {string} params.userCodeFormat - Character set for device flow user codes: `numeric` (digits only — best for numeric keypads and TV remotes), `alphabetic` (letters only), or `alphanumeric` (letters and digits — highest entropy per character). Defaults to `alphanumeric`. * @param {number} params.deviceCodeDuration - Lifetime in seconds of device flow device codes and user codes. Device codes are intentionally short-lived. Leave empty to use default 600. * @param {string[]} params.defaultScopes - List of OAuth2 scopes used when an authorization request omits the scope parameter. Every default scope must also be allowed by the OAuth2 server. Maximum of 100 scopes are allowed, each up to 128 characters long. + * @param {string[]} params.installationScopes - List of scopes an application may request when installed on a team. Omitting the parameter clears the list, so no installation scopes can be granted. Maximum of 100 scopes are allowed, each up to 128 characters long. * @throws {AppwriteException} * @returns {Promise} */ - updateOAuth2Server(params: { enabled: boolean, authorizationUrl: string, scopes?: string[], authorizationDetailsTypes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, installationAccessTokenDuration?: number, confidentialPkce?: boolean, verificationUrl?: string, userCodeLength?: number, userCodeFormat?: string, deviceCodeDuration?: number, defaultScopes?: string[] }): Promise; + updateOAuth2Server(params: { enabled: boolean, authorizationUrl: string, scopes?: string[], authorizationDetailsTypes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, installationAccessTokenDuration?: number, confidentialPkce?: boolean, verificationUrl?: string, userCodeLength?: number, userCodeFormat?: string, deviceCodeDuration?: number, defaultScopes?: string[], installationScopes?: string[] }): Promise; /** * Update the OAuth2 server (OIDC provider) configuration. * @@ -1003,19 +915,20 @@ export class Project { * @param {string} userCodeFormat - Character set for device flow user codes: `numeric` (digits only — best for numeric keypads and TV remotes), `alphabetic` (letters only), or `alphanumeric` (letters and digits — highest entropy per character). Defaults to `alphanumeric`. * @param {number} deviceCodeDuration - Lifetime in seconds of device flow device codes and user codes. Device codes are intentionally short-lived. Leave empty to use default 600. * @param {string[]} defaultScopes - List of OAuth2 scopes used when an authorization request omits the scope parameter. Every default scope must also be allowed by the OAuth2 server. Maximum of 100 scopes are allowed, each up to 128 characters long. + * @param {string[]} installationScopes - List of scopes an application may request when installed on a team. Omitting the parameter clears the list, so no installation scopes can be granted. Maximum of 100 scopes are allowed, each up to 128 characters long. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateOAuth2Server(enabled: boolean, authorizationUrl: string, scopes?: string[], authorizationDetailsTypes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, installationAccessTokenDuration?: number, confidentialPkce?: boolean, verificationUrl?: string, userCodeLength?: number, userCodeFormat?: string, deviceCodeDuration?: number, defaultScopes?: string[]): Promise; + updateOAuth2Server(enabled: boolean, authorizationUrl: string, scopes?: string[], authorizationDetailsTypes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, installationAccessTokenDuration?: number, confidentialPkce?: boolean, verificationUrl?: string, userCodeLength?: number, userCodeFormat?: string, deviceCodeDuration?: number, defaultScopes?: string[], installationScopes?: string[]): Promise; updateOAuth2Server( - paramsOrFirst: { enabled: boolean, authorizationUrl: string, scopes?: string[], authorizationDetailsTypes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, installationAccessTokenDuration?: number, confidentialPkce?: boolean, verificationUrl?: string, userCodeLength?: number, userCodeFormat?: string, deviceCodeDuration?: number, defaultScopes?: string[] } | boolean, - ...rest: [(string)?, (string[])?, (string[])?, (number)?, (number)?, (number)?, (number)?, (number)?, (boolean)?, (string)?, (number)?, (string)?, (number)?, (string[])?] + paramsOrFirst: { enabled: boolean, authorizationUrl: string, scopes?: string[], authorizationDetailsTypes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, installationAccessTokenDuration?: number, confidentialPkce?: boolean, verificationUrl?: string, userCodeLength?: number, userCodeFormat?: string, deviceCodeDuration?: number, defaultScopes?: string[], installationScopes?: string[] } | boolean, + ...rest: [(string)?, (string[])?, (string[])?, (number)?, (number)?, (number)?, (number)?, (number)?, (boolean)?, (string)?, (number)?, (string)?, (number)?, (string[])?, (string[])?] ): Promise { - let params: { enabled: boolean, authorizationUrl: string, scopes?: string[], authorizationDetailsTypes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, installationAccessTokenDuration?: number, confidentialPkce?: boolean, verificationUrl?: string, userCodeLength?: number, userCodeFormat?: string, deviceCodeDuration?: number, defaultScopes?: string[] }; + let params: { enabled: boolean, authorizationUrl: string, scopes?: string[], authorizationDetailsTypes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, installationAccessTokenDuration?: number, confidentialPkce?: boolean, verificationUrl?: string, userCodeLength?: number, userCodeFormat?: string, deviceCodeDuration?: number, defaultScopes?: string[], installationScopes?: string[] }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { enabled: boolean, authorizationUrl: string, scopes?: string[], authorizationDetailsTypes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, installationAccessTokenDuration?: number, confidentialPkce?: boolean, verificationUrl?: string, userCodeLength?: number, userCodeFormat?: string, deviceCodeDuration?: number, defaultScopes?: string[] }; + params = (paramsOrFirst || {}) as { enabled: boolean, authorizationUrl: string, scopes?: string[], authorizationDetailsTypes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, installationAccessTokenDuration?: number, confidentialPkce?: boolean, verificationUrl?: string, userCodeLength?: number, userCodeFormat?: string, deviceCodeDuration?: number, defaultScopes?: string[], installationScopes?: string[] }; } else { params = { enabled: paramsOrFirst as boolean, @@ -1032,7 +945,8 @@ export class Project { userCodeLength: rest[10] as number, userCodeFormat: rest[11] as string, deviceCodeDuration: rest[12] as number, - defaultScopes: rest[13] as string[] + defaultScopes: rest[13] as string[], + installationScopes: rest[14] as string[] }; } @@ -1051,6 +965,7 @@ export class Project { const userCodeFormat = params.userCodeFormat; const deviceCodeDuration = params.deviceCodeDuration; const defaultScopes = params.defaultScopes; + const installationScopes = params.installationScopes; if (typeof enabled === 'undefined') { throw new AppwriteException('Missing required parameter: "enabled"'); @@ -1106,6 +1021,9 @@ export class Project { if (typeof defaultScopes !== 'undefined') { payload['defaultScopes'] = defaultScopes; } + if (typeof installationScopes !== 'undefined') { + payload['installationScopes'] = installationScopes; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -5579,6 +5497,82 @@ export class Project { ); } + /** + * Updating this policy allows you to control which factors users can use to complete an MFA challenge. Disabled factors cannot be used to create a challenge and are reported as unavailable when listing factors. The custom factor is disabled by default; enable it to deliver challenge codes through your own channel. Recovery codes always remain available as a fallback. + * + * @param {boolean} params.totp - Set to true to allow TOTP to complete an MFA challenge, or false to disable it. + * @param {boolean} params.email - Set to true to allow email to complete an MFA challenge, or false to disable it. + * @param {boolean} params.phone - Set to true to allow phone (SMS) to complete an MFA challenge, or false to disable it. + * @param {boolean} params.custom - Set to true to allow the custom factor to complete an MFA challenge, or false to disable it. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateMFAFactorsPolicy(params?: { totp?: boolean, email?: boolean, phone?: boolean, custom?: boolean }): Promise; + /** + * Updating this policy allows you to control which factors users can use to complete an MFA challenge. Disabled factors cannot be used to create a challenge and are reported as unavailable when listing factors. The custom factor is disabled by default; enable it to deliver challenge codes through your own channel. Recovery codes always remain available as a fallback. + * + * @param {boolean} totp - Set to true to allow TOTP to complete an MFA challenge, or false to disable it. + * @param {boolean} email - Set to true to allow email to complete an MFA challenge, or false to disable it. + * @param {boolean} phone - Set to true to allow phone (SMS) to complete an MFA challenge, or false to disable it. + * @param {boolean} custom - Set to true to allow the custom factor to complete an MFA challenge, or false to disable it. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateMFAFactorsPolicy(totp?: boolean, email?: boolean, phone?: boolean, custom?: boolean): Promise; + updateMFAFactorsPolicy( + paramsOrFirst?: { totp?: boolean, email?: boolean, phone?: boolean, custom?: boolean } | boolean, + ...rest: [(boolean)?, (boolean)?, (boolean)?] + ): Promise { + let params: { totp?: boolean, email?: boolean, phone?: boolean, custom?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { totp?: boolean, email?: boolean, phone?: boolean, custom?: boolean }; + } else { + params = { + totp: paramsOrFirst as boolean, + email: rest[0] as boolean, + phone: rest[1] as boolean, + custom: rest[2] as boolean + }; + } + + const totp = params.totp; + const email = params.email; + const phone = params.phone; + const custom = params.custom; + + + const apiPath = '/project/policies/mfa-factors'; + const payload: Payload = {}; + if (typeof totp !== 'undefined') { + payload['totp'] = totp; + } + if (typeof email !== 'undefined') { + payload['email'] = email; + } + if (typeof phone !== 'undefined') { + payload['phone'] = phone; + } + if (typeof custom !== 'undefined') { + payload['custom'] = custom; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + 'accept': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + /** * Updating this policy allows you to control if new passwords are checked against most common passwords dictionary. When enabled, and user changes their password, password must not be contained in the dictionary. * @@ -5641,7 +5635,7 @@ export class Project { * * Keep in mind, while password history policy is disabled, the history is not being stored. Enabling the policy will not have any history on existing users, and it will only start to collect and enforce the policy on password changes since the policy is enabled. * - * @param {number} params.total - Set the password history length per user. Value can be between 1 and 5000, or null to disable the limit. + * @param {number} params.total - Set the password history length per user. Value can be between 1 and 20, or null to disable the limit. * @throws {AppwriteException} * @returns {Promise} */ @@ -5651,7 +5645,7 @@ export class Project { * * Keep in mind, while password history policy is disabled, the history is not being stored. Enabling the policy will not have any history on existing users, and it will only start to collect and enforce the policy on password changes since the policy is enabled. * - * @param {number} total - Set the password history length per user. Value can be between 1 and 5000, or null to disable the limit. + * @param {number} total - Set the password history length per user. Value can be between 1 and 20, or null to disable the limit. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. @@ -5897,7 +5891,7 @@ export class Project { /** * Update maximum duration how long sessions created within a project should stay active for. * - * @param {number} params.duration - Maximum session length in seconds. Minium allowed value is 5 second, and maximum is 1 year, which is 31536000 seconds. + * @param {number} params.duration - Maximum session length in seconds. Minium allowed value is 60 seconds, and maximum is 1 year, which is 31536000 seconds. * @throws {AppwriteException} * @returns {Promise} */ @@ -5905,7 +5899,7 @@ export class Project { /** * Update maximum duration how long sessions created within a project should stay active for. * - * @param {number} duration - Maximum session length in seconds. Minium allowed value is 5 second, and maximum is 1 year, which is 31536000 seconds. + * @param {number} duration - Maximum session length in seconds. Minium allowed value is 60 seconds, and maximum is 1 year, which is 31536000 seconds. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. @@ -6011,27 +6005,27 @@ export class Project { /** * Update the maximum number of sessions allowed per user. When the limit is hit, the oldest session will be deleted to make room for new one. * - * @param {number} params.total - Set the maximum number of sessions allowed per user. Value can be between 1 and 5000, or null to disable the limit. + * @param {number} params.total - Set the maximum number of sessions allowed per user. Value can be between 1 and 100. * @throws {AppwriteException} * @returns {Promise} */ - updateSessionLimitPolicy(params: { total?: number }): Promise; + updateSessionLimitPolicy(params: { total: number }): Promise; /** * Update the maximum number of sessions allowed per user. When the limit is hit, the oldest session will be deleted to make room for new one. * - * @param {number} total - Set the maximum number of sessions allowed per user. Value can be between 1 and 5000, or null to disable the limit. + * @param {number} total - Set the maximum number of sessions allowed per user. Value can be between 1 and 100. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateSessionLimitPolicy(total?: number): Promise; + updateSessionLimitPolicy(total: number): Promise; updateSessionLimitPolicy( - paramsOrFirst?: { total?: number } | number + paramsOrFirst: { total: number } | number ): Promise { - let params: { total?: number }; + let params: { total: number }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { total?: number }; + params = (paramsOrFirst || {}) as { total: number }; } else { params = { total: paramsOrFirst as number @@ -6068,7 +6062,7 @@ export class Project { /** * Update the maximum number of users in the project. When the limit is hit or amount of existing users already exceeded the limit, all users remain active, but new user sign up will be prohibited. * - * @param {number} params.total - Set the maximum number of users allowed in the project. Value can be between 1 and 5000, or null to disable the limit. + * @param {number} params.total - Set the maximum number of users allowed in the project. Value can be between 0 and 10000. Use 0 or null to disable the limit. * @throws {AppwriteException} * @returns {Promise} */ @@ -6076,7 +6070,7 @@ export class Project { /** * Update the maximum number of users in the project. When the limit is hit or amount of existing users already exceeded the limit, all users remain active, but new user sign up will be prohibited. * - * @param {number} total - Set the maximum number of users allowed in the project. Value can be between 1 and 5000, or null to disable the limit. + * @param {number} total - Set the maximum number of users allowed in the project. Value can be between 0 and 10000. Use 0 or null to disable the limit. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. @@ -6125,23 +6119,23 @@ export class Project { /** * Get a policy by its unique ID. This endpoint returns the current configuration for the requested project policy. * - * @param {ProjectPolicyId} params.policyId - Policy ID. Can be one of: password-dictionary, password-history, password-strength, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy, deny-aliased-email, deny-disposable-email, deny-free-email, deny-corporate-email. + * @param {ProjectPolicyId} params.policyId - Policy ID. Can be one of: password-dictionary, password-history, password-strength, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy, mfa-factors, deny-aliased-email, deny-disposable-email, deny-free-email, deny-corporate-email. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} */ - getPolicy(params: { policyId: ProjectPolicyId }): Promise; + getPolicy(params: { policyId: ProjectPolicyId }): Promise; /** * Get a policy by its unique ID. This endpoint returns the current configuration for the requested project policy. * - * @param {ProjectPolicyId} policyId - Policy ID. Can be one of: password-dictionary, password-history, password-strength, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy, deny-aliased-email, deny-disposable-email, deny-free-email, deny-corporate-email. + * @param {ProjectPolicyId} policyId - Policy ID. Can be one of: password-dictionary, password-history, password-strength, password-personal-data, session-alert, session-duration, session-invalidation, session-limit, user-limit, membership-privacy, mfa-factors, deny-aliased-email, deny-disposable-email, deny-free-email, deny-corporate-email. * @throws {AppwriteException} - * @returns {Promise} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getPolicy(policyId: ProjectPolicyId): Promise; + getPolicy(policyId: ProjectPolicyId): Promise; getPolicy( paramsOrFirst: { policyId: ProjectPolicyId } | ProjectPolicyId - ): Promise { + ): Promise { let params: { policyId: ProjectPolicyId }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('policyId' in paramsOrFirst))) { diff --git a/src/services/proxy.ts b/src/services/proxy.ts index 04379aa6..78584510 100644 --- a/src/services/proxy.ts +++ b/src/services/proxy.ts @@ -2,6 +2,7 @@ import { AppwriteException, Client, type Payload, UploadProgress } from '../clie import type { Models } from '../models'; +import { InvalidationType } from '../enums/invalidation-type'; import { StatusCode } from '../enums/status-code'; import { ProxyResourceType } from '../enums/proxy-resource-type'; @@ -12,6 +13,85 @@ export class Proxy { this.client = client; } + /** + * Create a new CDN cache invalidation for a domain. Executes a hard purge of cached content. + * + * Depending on type, the invalidation purges a single cache tag, a single URL path, or all cached content for the domain. + * + * @param {string} params.domain - Domain name. + * @param {InvalidationType} params.type - Type of reference passed. Allowed values are: tag, path, all + * @param {string} params.reference - Reference to invalidate. Depending on type this can be: cache tag name (up to 128 characters), URL path (up to 2048 characters). Not required when type is all. + * @throws {AppwriteException} + * @returns {Promise} + */ + createInvalidation(params: { domain: string, type: InvalidationType, reference?: string }): Promise; + /** + * Create a new CDN cache invalidation for a domain. Executes a hard purge of cached content. + * + * Depending on type, the invalidation purges a single cache tag, a single URL path, or all cached content for the domain. + * + * @param {string} domain - Domain name. + * @param {InvalidationType} type - Type of reference passed. Allowed values are: tag, path, all + * @param {string} reference - Reference to invalidate. Depending on type this can be: cache tag name (up to 128 characters), URL path (up to 2048 characters). Not required when type is all. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createInvalidation(domain: string, type: InvalidationType, reference?: string): Promise; + createInvalidation( + paramsOrFirst: { domain: string, type: InvalidationType, reference?: string } | string, + ...rest: [(InvalidationType)?, (string)?] + ): Promise { + let params: { domain: string, type: InvalidationType, reference?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { domain: string, type: InvalidationType, reference?: string }; + } else { + params = { + domain: paramsOrFirst as string, + type: rest[0] as InvalidationType, + reference: rest[1] as string + }; + } + + const domain = params.domain; + const type = params.type; + const reference = params.reference; + + if (typeof domain === 'undefined') { + throw new AppwriteException('Missing required parameter: "domain"'); + } + if (typeof type === 'undefined') { + throw new AppwriteException('Missing required parameter: "type"'); + } + + const apiPath = '/proxy/invalidations'; + const payload: Payload = {}; + if (typeof domain !== 'undefined') { + payload['domain'] = domain; + } + if (typeof type !== 'undefined') { + payload['type'] = type; + } + if (typeof reference !== 'undefined') { + payload['reference'] = reference; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + 'accept': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + /** * Get a list of all the proxy rules. You can use the query params to filter your results. * diff --git a/src/services/sites.ts b/src/services/sites.ts index 8fde491b..f74f2dd0 100644 --- a/src/services/sites.ts +++ b/src/services/sites.ts @@ -334,7 +334,7 @@ export class Sites { /** * List allowed site specifications for this instance. * - * @param {string} params.type - Specification type to list. Can be one of: runtimes, builds. + * @param {string} params.type - Specification type to list. Can be one of: runtimes, builds. Defaults to runtimes. * @throws {AppwriteException} * @returns {Promise} */ @@ -342,7 +342,7 @@ export class Sites { /** * List allowed site specifications for this instance. * - * @param {string} type - Specification type to list. Can be one of: runtimes, builds. + * @param {string} type - Specification type to list. Can be one of: runtimes, builds. Defaults to runtimes. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. diff --git a/src/services/storage.ts b/src/services/storage.ts index 7ff19320..8424bfac 100644 --- a/src/services/storage.ts +++ b/src/services/storage.ts @@ -451,7 +451,7 @@ export class Storage { * Get a list of all the user files. You can use the query params to filter your results. * * @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). - * @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, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded + * @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, folder, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded * @param {string} params.search - Search term to filter your list results. Max length: 256 chars. * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} @@ -462,7 +462,7 @@ export class Storage { * Get a list of all the user files. You can use the query params to filter your results. * * @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). - * @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, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded + * @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, folder, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded * @param {string} search - Search term to filter your list results. Max length: 256 chars. * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} @@ -536,10 +536,11 @@ export class Storage { * @param {string} params.fileId - File 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 {File | InputFile} params.file - Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https://appwrite.io/docs/products/storage/upload-download#input-file). * @param {string[]} params.permissions - An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string} params.folder - Virtual folder to place the file in, for example "photos/2026". Nest folders with `/`. Defaults to the bucket root. * @throws {AppwriteException} * @returns {Promise} */ - createFile(params: { bucketId: string, fileId: string, file: File | InputFile, permissions?: string[], onProgress?: (progress: UploadProgress) => void }): Promise; + createFile(params: { bucketId: string, fileId: string, file: File | InputFile, permissions?: string[], folder?: string, onProgress?: (progress: UploadProgress) => void }): Promise; /** * Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https://appwrite.io/docs/server/storage#storageCreateBucket) API or directly from your Appwrite console. * @@ -554,35 +555,38 @@ export class Storage { * @param {string} fileId - File 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 {File | InputFile} file - Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https://appwrite.io/docs/products/storage/upload-download#input-file). * @param {string[]} permissions - An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string} folder - Virtual folder to place the file in, for example "photos/2026". Nest folders with `/`. Defaults to the bucket root. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createFile(bucketId: string, fileId: string, file: File | InputFile, permissions?: string[], onProgress?: (progress: UploadProgress) => void): Promise; + createFile(bucketId: string, fileId: string, file: File | InputFile, permissions?: string[], folder?: string, onProgress?: (progress: UploadProgress) => void): Promise; createFile( - paramsOrFirst: { bucketId: string, fileId: string, file: File | InputFile, permissions?: string[], onProgress?: (progress: UploadProgress) => void } | string, - ...rest: [(string)?, (File | InputFile)?, (string[])?,((progress: UploadProgress) => void)?] + paramsOrFirst: { bucketId: string, fileId: string, file: File | InputFile, permissions?: string[], folder?: string, onProgress?: (progress: UploadProgress) => void } | string, + ...rest: [(string)?, (File | InputFile)?, (string[])?, (string)?,((progress: UploadProgress) => void)?] ): Promise { - let params: { bucketId: string, fileId: string, file: File | InputFile, permissions?: string[] }; + let params: { bucketId: string, fileId: string, file: File | InputFile, permissions?: string[], folder?: string }; let onProgress: ((progress: UploadProgress) => void); if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { bucketId: string, fileId: string, file: File | InputFile, permissions?: string[] }; + params = (paramsOrFirst || {}) as { bucketId: string, fileId: string, file: File | InputFile, permissions?: string[], folder?: string }; onProgress = paramsOrFirst?.onProgress as ((progress: UploadProgress) => void); } else { params = { bucketId: paramsOrFirst as string, fileId: rest[0] as string, file: rest[1] as File | InputFile, - permissions: rest[2] as string[] + permissions: rest[2] as string[], + folder: rest[3] as string }; - onProgress = rest[3] as ((progress: UploadProgress) => void); + onProgress = rest[4] as ((progress: UploadProgress) => void); } const bucketId = params.bucketId; const fileId = params.fileId; const file = params.file; const permissions = params.permissions; + const folder = params.folder; if (typeof bucketId === 'undefined') { throw new AppwriteException('Missing required parameter: "bucketId"'); @@ -605,6 +609,9 @@ export class Storage { if (typeof permissions !== 'undefined') { payload['permissions'] = permissions; } + if (typeof folder !== 'undefined') { + payload['folder'] = folder; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { diff --git a/src/services/tables-db.ts b/src/services/tables-db.ts index 70bfec60..ab832a42 100644 --- a/src/services/tables-db.ts +++ b/src/services/tables-db.ts @@ -91,10 +91,11 @@ export class TablesDB { * @param {boolean} params.enabled - Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. * @param {string} params.specification - Database specification. Defaults to `serverless`, which creates the database on the shared pool. Any other value provisions a dedicated database on that specification. * @param {number} params.replicas - Number of high availability replicas (0-5) for the dedicated database backing this database. Requires a dedicated `specification`; must be 0 for a serverless database. High availability is enabled when greater than 0. + * @param {string} params.syncMode - Replication sync mode for the dedicated database backing this database. Requires a dedicated `specification`; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum. * @throws {AppwriteException} * @returns {Promise} */ - create(params: { databaseId: string, name: string, enabled?: boolean, specification?: string, replicas?: number }): Promise; + create(params: { databaseId: string, name: string, enabled?: boolean, specification?: string, replicas?: number, syncMode?: string }): Promise; /** * Create a new Database. * @@ -104,26 +105,28 @@ export class TablesDB { * @param {boolean} enabled - Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. * @param {string} specification - Database specification. Defaults to `serverless`, which creates the database on the shared pool. Any other value provisions a dedicated database on that specification. * @param {number} replicas - Number of high availability replicas (0-5) for the dedicated database backing this database. Requires a dedicated `specification`; must be 0 for a serverless database. High availability is enabled when greater than 0. + * @param {string} syncMode - Replication sync mode for the dedicated database backing this database. Requires a dedicated `specification`; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - create(databaseId: string, name: string, enabled?: boolean, specification?: string, replicas?: number): Promise; + create(databaseId: string, name: string, enabled?: boolean, specification?: string, replicas?: number, syncMode?: string): Promise; create( - paramsOrFirst: { databaseId: string, name: string, enabled?: boolean, specification?: string, replicas?: number } | string, - ...rest: [(string)?, (boolean)?, (string)?, (number)?] + paramsOrFirst: { databaseId: string, name: string, enabled?: boolean, specification?: string, replicas?: number, syncMode?: string } | string, + ...rest: [(string)?, (boolean)?, (string)?, (number)?, (string)?] ): Promise { - let params: { databaseId: string, name: string, enabled?: boolean, specification?: string, replicas?: number }; + let params: { databaseId: string, name: string, enabled?: boolean, specification?: string, replicas?: number, syncMode?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, name: string, enabled?: boolean, specification?: string, replicas?: number }; + params = (paramsOrFirst || {}) as { databaseId: string, name: string, enabled?: boolean, specification?: string, replicas?: number, syncMode?: string }; } else { params = { databaseId: paramsOrFirst as string, name: rest[0] as string, enabled: rest[1] as boolean, specification: rest[2] as string, - replicas: rest[3] as number + replicas: rest[3] as number, + syncMode: rest[4] as string }; } @@ -132,6 +135,7 @@ export class TablesDB { const enabled = params.enabled; const specification = params.specification; const replicas = params.replicas; + const syncMode = params.syncMode; if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); @@ -157,6 +161,9 @@ export class TablesDB { if (typeof replicas !== 'undefined') { payload['replicas'] = replicas; } + if (typeof syncMode !== 'undefined') { + payload['syncMode'] = syncMode; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -601,44 +608,52 @@ export class TablesDB { * @param {string} params.databaseId - Database ID. * @param {string} params.name - Database name. Max length: 128 chars. * @param {boolean} params.enabled - Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + * @param {string} params.specification - Database specification. Resizing between dedicated specifications changes cpu, memory, storage and the connection ceiling via a rolling cutover with zero downtime. Moving a `serverless` database onto a dedicated specification is a data migration, not a resize. * @param {number} params.replicas - Number of high availability replicas (0-5) for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification. High availability is enabled when greater than 0. + * @param {string} params.syncMode - Replication sync mode for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum. * @throws {AppwriteException} * @returns {Promise} */ - update(params: { databaseId: string, name?: string, enabled?: boolean, replicas?: number }): Promise; + update(params: { databaseId: string, name?: string, enabled?: boolean, specification?: string, replicas?: number, syncMode?: string }): Promise; /** * Update a database by its unique ID. * * @param {string} databaseId - Database ID. * @param {string} name - Database name. Max length: 128 chars. * @param {boolean} enabled - Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + * @param {string} specification - Database specification. Resizing between dedicated specifications changes cpu, memory, storage and the connection ceiling via a rolling cutover with zero downtime. Moving a `serverless` database onto a dedicated specification is a data migration, not a resize. * @param {number} replicas - Number of high availability replicas (0-5) for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification. High availability is enabled when greater than 0. + * @param {string} syncMode - Replication sync mode for the dedicated database backing this database. Only valid when the database is backed by a dedicated specification; the mode is only in force once there is at least one replica. Allowed values: async, sync, quorum. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - update(databaseId: string, name?: string, enabled?: boolean, replicas?: number): Promise; + update(databaseId: string, name?: string, enabled?: boolean, specification?: string, replicas?: number, syncMode?: string): Promise; update( - paramsOrFirst: { databaseId: string, name?: string, enabled?: boolean, replicas?: number } | string, - ...rest: [(string)?, (boolean)?, (number)?] + paramsOrFirst: { databaseId: string, name?: string, enabled?: boolean, specification?: string, replicas?: number, syncMode?: string } | string, + ...rest: [(string)?, (boolean)?, (string)?, (number)?, (string)?] ): Promise { - let params: { databaseId: string, name?: string, enabled?: boolean, replicas?: number }; + let params: { databaseId: string, name?: string, enabled?: boolean, specification?: string, replicas?: number, syncMode?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, name?: string, enabled?: boolean, replicas?: number }; + params = (paramsOrFirst || {}) as { databaseId: string, name?: string, enabled?: boolean, specification?: string, replicas?: number, syncMode?: string }; } else { params = { databaseId: paramsOrFirst as string, name: rest[0] as string, enabled: rest[1] as boolean, - replicas: rest[2] as number + specification: rest[2] as string, + replicas: rest[3] as number, + syncMode: rest[4] as string }; } const databaseId = params.databaseId; const name = params.name; const enabled = params.enabled; + const specification = params.specification; const replicas = params.replicas; + const syncMode = params.syncMode; if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); @@ -652,9 +667,15 @@ export class TablesDB { if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } + if (typeof specification !== 'undefined') { + payload['specification'] = specification; + } if (typeof replicas !== 'undefined') { payload['replicas'] = replicas; } + if (typeof syncMode !== 'undefined') { + payload['syncMode'] = syncMode; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -725,7 +746,7 @@ export class TablesDB { } /** - * Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. + * Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation by a failover that did not finish also accepts this call as a repair, provided `targetReplicaId` names the member to promote. * * @param {string} params.databaseId - Database ID. * @param {string} params.targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected. @@ -734,7 +755,7 @@ export class TablesDB { */ createFailover(params: { databaseId: string, targetReplicaId?: string }): Promise; /** - * Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. + * Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation by a failover that did not finish also accepts this call as a repair, provided `targetReplicaId` names the member to promote. * * @param {string} databaseId - Database ID. * @param {string} targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected. @@ -786,6 +807,391 @@ export class TablesDB { ); } + /** + * List the dedicated migrations for a TablesDB database. A database has at most one in-flight migration. + * + * @param {string} params.databaseId - Database ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + listMigrations(params: { databaseId: string }): Promise; + /** + * List the dedicated migrations for a TablesDB database. A database has at most one in-flight migration. + * + * @param {string} databaseId - Database ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listMigrations(databaseId: string): Promise; + listMigrations( + paramsOrFirst: { databaseId: string } | string + ): Promise { + let params: { databaseId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string }; + } else { + params = { + databaseId: paramsOrFirst as string + }; + } + + const databaseId = params.databaseId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + const apiPath = '/tablesdb/{databaseId}/migrations'.replace('{databaseId}', encodeURIComponent(String(databaseId))); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Start migrating a serverless TablesDB database onto a dedicated MySQL compute. Data is copied to the target while the source stays live, with a brief read-only window during cutover. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.specification - Dedicated compute specification to provision as the migration target (e.g. s-2vcpu-4gb). The migration always targets a dedicated compute, so `serverless` is not accepted. + * @param {boolean} params.autoCutover - Whether to cut over automatically once the copy is verified. When disabled the migration parks at ready_to_cutover and holds there until the cutover is performed manually. + * @throws {AppwriteException} + * @returns {Promise} + */ + createMigration(params: { databaseId: string, specification: string, autoCutover?: boolean }): Promise; + /** + * Start migrating a serverless TablesDB database onto a dedicated MySQL compute. Data is copied to the target while the source stays live, with a brief read-only window during cutover. + * + * @param {string} databaseId - Database ID. + * @param {string} specification - Dedicated compute specification to provision as the migration target (e.g. s-2vcpu-4gb). The migration always targets a dedicated compute, so `serverless` is not accepted. + * @param {boolean} autoCutover - Whether to cut over automatically once the copy is verified. When disabled the migration parks at ready_to_cutover and holds there until the cutover is performed manually. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createMigration(databaseId: string, specification: string, autoCutover?: boolean): Promise; + createMigration( + paramsOrFirst: { databaseId: string, specification: string, autoCutover?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { databaseId: string, specification: string, autoCutover?: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, specification: string, autoCutover?: boolean }; + } else { + params = { + databaseId: paramsOrFirst as string, + specification: rest[0] as string, + autoCutover: rest[1] as boolean + }; + } + + const databaseId = params.databaseId; + const specification = params.specification; + const autoCutover = params.autoCutover; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof specification === 'undefined') { + throw new AppwriteException('Missing required parameter: "specification"'); + } + + const apiPath = '/tablesdb/{databaseId}/migrations'.replace('{databaseId}', encodeURIComponent(String(databaseId))); + const payload: Payload = {}; + if (typeof specification !== 'undefined') { + payload['specification'] = specification; + } + if (typeof autoCutover !== 'undefined') { + payload['autoCutover'] = autoCutover; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + 'accept': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Get a single dedicated migration for a TablesDB database by its ID. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.migrationId - Migration ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + getMigration(params: { databaseId: string, migrationId: string }): Promise; + /** + * Get a single dedicated migration for a TablesDB database by its ID. + * + * @param {string} databaseId - Database ID. + * @param {string} migrationId - Migration ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getMigration(databaseId: string, migrationId: string): Promise; + getMigration( + paramsOrFirst: { databaseId: string, migrationId: string } | string, + ...rest: [(string)?] + ): Promise { + let params: { databaseId: string, migrationId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, migrationId: string }; + } else { + params = { + databaseId: paramsOrFirst as string, + migrationId: rest[0] as string + }; + } + + const databaseId = params.databaseId; + const migrationId = params.migrationId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof migrationId === 'undefined') { + throw new AppwriteException('Missing required parameter: "migrationId"'); + } + + const apiPath = '/tablesdb/{databaseId}/migrations/{migrationId}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{migrationId}', encodeURIComponent(String(migrationId))); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Abort an in-flight TablesDB dedicated migration. Only allowed before cutover; once the migration has cut over it cannot be aborted. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.migrationId - Migration ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deleteMigration(params: { databaseId: string, migrationId: string }): Promise<{}>; + /** + * Abort an in-flight TablesDB dedicated migration. Only allowed before cutover; once the migration has cut over it cannot be aborted. + * + * @param {string} databaseId - Database ID. + * @param {string} migrationId - Migration ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deleteMigration(databaseId: string, migrationId: string): Promise<{}>; + deleteMigration( + paramsOrFirst: { databaseId: string, migrationId: string } | string, + ...rest: [(string)?] + ): Promise<{}> { + let params: { databaseId: string, migrationId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, migrationId: string }; + } else { + params = { + databaseId: paramsOrFirst as string, + migrationId: rest[0] as string + }; + } + + const databaseId = params.databaseId; + const migrationId = params.migrationId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof migrationId === 'undefined') { + throw new AppwriteException('Missing required parameter: "migrationId"'); + } + + const apiPath = '/tablesdb/{databaseId}/migrations/{migrationId}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{migrationId}', encodeURIComponent(String(migrationId))); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + 'accept': 'application/json', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload, + ); + } + + /** + * Cut a verified TablesDB migration over to its dedicated compute. Only applies to a migration created with `autoCutover` disabled, which waits at `ready_to_cutover` until this is called. The routing flip happens shortly after this returns, with a brief read-only window. One call buys one attempt: a cutover that fails a check returns the migration to `verifying` and parks it again, so call this once more to retry. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.migrationId - Migration ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + cutoverMigration(params: { databaseId: string, migrationId: string }): Promise; + /** + * Cut a verified TablesDB migration over to its dedicated compute. Only applies to a migration created with `autoCutover` disabled, which waits at `ready_to_cutover` until this is called. The routing flip happens shortly after this returns, with a brief read-only window. One call buys one attempt: a cutover that fails a check returns the migration to `verifying` and parks it again, so call this once more to retry. + * + * @param {string} databaseId - Database ID. + * @param {string} migrationId - Migration ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + cutoverMigration(databaseId: string, migrationId: string): Promise; + cutoverMigration( + paramsOrFirst: { databaseId: string, migrationId: string } | string, + ...rest: [(string)?] + ): Promise { + let params: { databaseId: string, migrationId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, migrationId: string }; + } else { + params = { + databaseId: paramsOrFirst as string, + migrationId: rest[0] as string + }; + } + + const databaseId = params.databaseId; + const migrationId = params.migrationId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + if (typeof migrationId === 'undefined') { + throw new AppwriteException('Missing required parameter: "migrationId"'); + } + + const apiPath = '/tablesdb/{databaseId}/migrations/{migrationId}/cutover'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{migrationId}', encodeURIComponent(String(migrationId))); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + 'accept': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * List the lifecycle operations recorded for a dedicated database, newest first. Every provision, update, restore, backup and replication action is recorded here with its outcome, including an attempt that was abandoned because another worker took over the database. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.status - Filter by operation status. + * @param {number} params.limit - Maximum number of operations to return. + * @param {number} params.offset - Number of operations to skip. + * @throws {AppwriteException} + * @returns {Promise} + */ + listOperations(params: { databaseId: string, status?: string, limit?: number, offset?: number }): Promise; + /** + * List the lifecycle operations recorded for a dedicated database, newest first. Every provision, update, restore, backup and replication action is recorded here with its outcome, including an attempt that was abandoned because another worker took over the database. + * + * @param {string} databaseId - Database ID. + * @param {string} status - Filter by operation status. + * @param {number} limit - Maximum number of operations to return. + * @param {number} offset - Number of operations to skip. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listOperations(databaseId: string, status?: string, limit?: number, offset?: number): Promise; + listOperations( + paramsOrFirst: { databaseId: string, status?: string, limit?: number, offset?: number } | string, + ...rest: [(string)?, (number)?, (number)?] + ): Promise { + let params: { databaseId: string, status?: string, limit?: number, offset?: number }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, status?: string, limit?: number, offset?: number }; + } else { + params = { + databaseId: paramsOrFirst as string, + status: rest[0] as string, + limit: rest[1] as number, + offset: rest[2] as number + }; + } + + const databaseId = params.databaseId; + const status = params.status; + const limit = params.limit; + const offset = params.offset; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + const apiPath = '/tablesdb/{databaseId}/operations'.replace('{databaseId}', encodeURIComponent(String(databaseId))); + const payload: Payload = {}; + if (typeof status !== 'undefined') { + payload['status'] = status; + } + if (typeof limit !== 'undefined') { + payload['limit'] = limit; + } + if (typeof offset !== 'undefined') { + payload['offset'] = offset; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + /** * Get high availability status for a dedicated database. Returns replica statuses, replication lag, and sync mode. * @@ -976,7 +1382,7 @@ export class TablesDB { * @param {string[]} params.permissions - An array of permissions strings. By default, no user is granted with any permissions. [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 {object[]} params.columns - Array of column definitions to create. Each column should contain: key (string), type (string: string, integer, float, boolean, datetime, relationship), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options. + * @param {object[]} params.columns - Array of column definitions to create. Each column should contain: key (string), type (string: string, varchar, text, mediumtext, longtext, integer, bigint, double, boolean, datetime, point, linestring, polygon, email, url, ip, enum), size (integer, required for string and varchar types), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options. * @param {object[]} params.indexes - Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of column keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional). * @throws {AppwriteException} * @returns {Promise} @@ -991,7 +1397,7 @@ export class TablesDB { * @param {string[]} permissions - An array of permissions strings. By default, no user is granted with any permissions. [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 {object[]} columns - Array of column definitions to create. Each column should contain: key (string), type (string: string, integer, float, boolean, datetime, relationship), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options. + * @param {object[]} columns - Array of column definitions to create. Each column should contain: key (string), type (string: string, varchar, text, mediumtext, longtext, integer, bigint, double, boolean, datetime, point, linestring, polygon, email, url, ip, enum), size (integer, required for string and varchar types), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options. * @param {object[]} indexes - Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of column keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional). * @throws {AppwriteException} * @returns {Promise} @@ -3994,11 +4400,11 @@ export class TablesDB { * @param {string} params.databaseId - Database ID. * @param {string} params.tableId - Table ID. * @param {string} params.relatedTableId - Related Table ID. - * @param {RelationshipType} params.type - Relation type + * @param {RelationshipType} params.type - Relationship type. Possible values are: oneToOne, oneToMany, manyToOne, manyToMany. * @param {boolean} params.twoWay - Is Two Way? * @param {string} params.key - Column Key. * @param {string} params.twoWayKey - Two Way Column Key. - * @param {RelationMutate} params.onDelete - Constraints option + * @param {RelationMutate} params.onDelete - Delete constraint. Possible values are: cascade, restrict, setNull. * @throws {AppwriteException} * @returns {Promise} */ @@ -4010,11 +4416,11 @@ export class TablesDB { * @param {string} databaseId - Database ID. * @param {string} tableId - Table ID. * @param {string} relatedTableId - Related Table ID. - * @param {RelationshipType} type - Relation type + * @param {RelationshipType} type - Relationship type. Possible values are: oneToOne, oneToMany, manyToOne, manyToMany. * @param {boolean} twoWay - Is Two Way? * @param {string} key - Column Key. * @param {string} twoWayKey - Two Way Column Key. - * @param {RelationMutate} onDelete - Constraints option + * @param {RelationMutate} onDelete - Delete constraint. Possible values are: cascade, restrict, setNull. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. @@ -5083,7 +5489,7 @@ export class TablesDB { * @param {string} params.databaseId - Database ID. * @param {string} params.tableId - Table ID. * @param {string} params.key - Column Key. - * @param {RelationMutate} params.onDelete - Constraints option + * @param {RelationMutate} params.onDelete - Delete constraint. Possible values are: cascade, restrict, setNull. * @param {string} params.newKey - New Column Key. * @throws {AppwriteException} * @returns {Promise} @@ -5096,7 +5502,7 @@ export class TablesDB { * @param {string} databaseId - Database ID. * @param {string} tableId - Table ID. * @param {string} key - Column Key. - * @param {RelationMutate} onDelete - Constraints option + * @param {RelationMutate} onDelete - Delete constraint. Possible values are: cascade, restrict, setNull. * @param {string} newKey - New Column Key. * @throws {AppwriteException} * @returns {Promise} diff --git a/src/services/users.ts b/src/services/users.ts index 6b9985c7..a79375f4 100644 --- a/src/services/users.ts +++ b/src/services/users.ts @@ -1743,6 +1743,67 @@ export class Users { ); } + /** + * Get a custom MFA challenge for a user, including the code to be delivered through your own channel. + * + * @param {string} params.userId - User ID. + * @param {string} params.challengeId - ID of the challenge. + * @throws {AppwriteException} + * @returns {Promise} + */ + getMFAChallenge(params: { userId: string, challengeId: string }): Promise; + /** + * Get a custom MFA challenge for a user, including the code to be delivered through your own channel. + * + * @param {string} userId - User ID. + * @param {string} challengeId - ID of the challenge. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getMFAChallenge(userId: string, challengeId: string): Promise; + getMFAChallenge( + paramsOrFirst: { userId: string, challengeId: string } | string, + ...rest: [(string)?] + ): Promise { + let params: { userId: string, challengeId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { userId: string, challengeId: string }; + } else { + params = { + userId: paramsOrFirst as string, + challengeId: rest[0] as string + }; + } + + const userId = params.userId; + const challengeId = params.challengeId; + + if (typeof userId === 'undefined') { + throw new AppwriteException('Missing required parameter: "userId"'); + } + if (typeof challengeId === 'undefined') { + throw new AppwriteException('Missing required parameter: "challengeId"'); + } + + const apiPath = '/users/{userId}/mfa/challenges/{challengeId}'.replace('{userId}', encodeURIComponent(String(userId))).replace('{challengeId}', encodeURIComponent(String(challengeId))); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + /** * List the factors available on the account to be used as a MFA challange. * diff --git a/test/services/account.test.js b/test/services/account.test.js index e541ba35..09473055 100644 --- a/test/services/account.test.js +++ b/test/services/account.test.js @@ -241,20 +241,6 @@ describe('Account', () => { expect(response).toEqual(data); }); - test('test method createJWT()', async () => { - const data = { - 'jwt': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c',}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await account.createJWT( - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - test('test method listLogs()', async () => { const data = { 'total': 5, @@ -551,7 +537,8 @@ describe('Account', () => { 'totp': true, 'phone': true, 'email': true, - 'recoveryCode': true,}; + 'recoveryCode': true, + 'custom': true,}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await account.listMfaFactors( @@ -568,7 +555,8 @@ describe('Account', () => { 'totp': true, 'phone': true, 'email': true, - 'recoveryCode': true,}; + 'recoveryCode': true, + 'custom': true,}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await account.listMFAFactors( diff --git a/test/services/apps.test.js b/test/services/apps.test.js index 34305b36..2026c43c 100644 --- a/test/services/apps.test.js +++ b/test/services/apps.test.js @@ -232,6 +232,21 @@ describe('Apps', () => { expect(response).toEqual(data); }); + test('test method deleteInstallation()', async () => { + const data = {message: ""}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await apps.deleteInstallation( + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method createInstallationToken()', async () => { const data = { 'access_token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9...', diff --git a/test/services/embeddings.test.js b/test/services/embeddings.test.js new file mode 100644 index 00000000..02e84edf --- /dev/null +++ b/test/services/embeddings.test.js @@ -0,0 +1,28 @@ +const { Client } = require("../../dist/client"); +const { InputFile } = require("../../dist/inputFile"); +const { Embeddings } = require("../../dist/services/embeddings"); + +const { fetch: mockedFetch, Response } = require("undici"); +jest.mock('undici', () => ({ ...jest.requireActual('undici'), fetch: jest.fn() })); + +describe('Embeddings', () => { + const client = new Client(); + const embeddings = new Embeddings(client); + + + test('test method createTextEmbeddings()', async () => { + const data = { + 'total': 5, + 'embeddings': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await embeddings.createTextEmbeddings( + [], + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + }) diff --git a/test/services/organization.test.js b/test/services/organization.test.js index e4d05321..70ae6049 100644 --- a/test/services/organization.test.js +++ b/test/services/organization.test.js @@ -18,7 +18,6 @@ describe('Organization', () => { 'name': 'VIP', 'total': 7, 'prefs': {}, - 'billingBudget': 50, 'budgetAlerts': [], 'billingPlan': 'tier-1', 'billingPlanId': 'tier-1', @@ -27,22 +26,11 @@ describe('Organization', () => { 'billingStartDate': '2020-10-15T06:38:00.000+00:00', 'billingCurrentInvoiceDate': '2020-10-15T06:38:00.000+00:00', 'billingNextInvoiceDate': '2020-10-15T06:38:00.000+00:00', - 'billingTrialStartDate': '2020-10-15T06:38:00.000+00:00', 'billingTrialDays': 14, 'billingAggregationId': 'adbc3de4rddfsd', 'billingInvoiceId': 'adbc3de4rddfsd', 'paymentMethodId': 'adbc3de4rddfsd', - 'billingAddressId': 'adbc3de4rddfsd', - 'backupPaymentMethodId': 'adbc3de4rddfsd', 'status': 'active', - 'remarks': 'Pending initial payment', - 'agreementBAA': '', - 'programManagerName': '', - 'programManagerCalendar': '', - 'programDiscordChannelName': '', - 'programDiscordChannelUrl': '', - 'billingPlanDowngrade': 'tier-1', - 'billingTaxId': '', 'markedForDeletion': true, 'platform': 'imagine', 'projects': [],}; @@ -65,7 +53,6 @@ describe('Organization', () => { 'name': 'VIP', 'total': 7, 'prefs': {}, - 'billingBudget': 50, 'budgetAlerts': [], 'billingPlan': 'tier-1', 'billingPlanId': 'tier-1', @@ -74,22 +61,11 @@ describe('Organization', () => { 'billingStartDate': '2020-10-15T06:38:00.000+00:00', 'billingCurrentInvoiceDate': '2020-10-15T06:38:00.000+00:00', 'billingNextInvoiceDate': '2020-10-15T06:38:00.000+00:00', - 'billingTrialStartDate': '2020-10-15T06:38:00.000+00:00', 'billingTrialDays': 14, 'billingAggregationId': 'adbc3de4rddfsd', 'billingInvoiceId': 'adbc3de4rddfsd', 'paymentMethodId': 'adbc3de4rddfsd', - 'billingAddressId': 'adbc3de4rddfsd', - 'backupPaymentMethodId': 'adbc3de4rddfsd', 'status': 'active', - 'remarks': 'Pending initial payment', - 'agreementBAA': '', - 'programManagerName': '', - 'programManagerCalendar': '', - 'programDiscordChannelName': '', - 'programDiscordChannelUrl': '', - 'billingPlanDowngrade': 'tier-1', - 'billingTaxId': '', 'markedForDeletion': true, 'platform': 'imagine', 'projects': [],}; diff --git a/test/services/project.test.js b/test/services/project.test.js index 3f535e93..44703bc7 100644 --- a/test/services/project.test.js +++ b/test/services/project.test.js @@ -122,31 +122,6 @@ describe('Project', () => { 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 createEphemeralKey()', async () => { const data = { '\$id': '5e5ea5c16897e', @@ -1678,6 +1653,47 @@ describe('Project', () => { expect(response).toEqual(data); }); + test('test method updateMFAFactorsPolicy()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'New Project', + 'teamId': '1592981250', + 'region': 'fra', + 'devKeys': [], + 'smtpEnabled': true, + 'smtpSenderName': 'John Appwrite', + 'smtpSenderEmail': 'john@appwrite.io', + 'smtpReplyToName': 'Support Team', + 'smtpReplyToEmail': 'support@appwrite.io', + 'smtpHost': 'mail.appwrite.io', + 'smtpPort': 25, + 'smtpUsername': 'emailuser', + 'smtpPassword': 'smtp-password', + 'smtpSecure': 'tls', + 'pingCount': 1, + 'pingedAt': '2020-10-15T06:38:00.000+00:00', + 'labels': [], + 'status': 'active', + 'onboarding': {}, + 'authMethods': [], + 'services': [], + 'protocols': [], + 'blocks': [], + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'wafEnabled': true,}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateMFAFactorsPolicy( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method updatePasswordDictionaryPolicy()', async () => { const data = { '\$id': '5e5ea5c16897e', diff --git a/test/services/proxy.test.js b/test/services/proxy.test.js index 57aa087f..ebe46255 100644 --- a/test/services/proxy.test.js +++ b/test/services/proxy.test.js @@ -10,6 +10,25 @@ describe('Proxy', () => { const proxy = new Proxy(client); + test('test method createInvalidation()', async () => { + const data = { + 'domain': 'appwrite.company.com', + 'type': 'tag', + 'reference': 'products', + 'status': 'success',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await proxy.createInvalidation( + '', + 'tag', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method listRules()', async () => { const data = { 'total': 5, diff --git a/test/services/storage.test.js b/test/services/storage.test.js index ce79f08a..761c156f 100644 --- a/test/services/storage.test.js +++ b/test/services/storage.test.js @@ -149,6 +149,8 @@ describe('Storage', () => { '\$updatedAt': '2020-10-15T06:38:00.000+00:00', '\$permissions': [], 'name': 'Pink.png', + 'folder': 'photos/2026/', + 'key': 'photos/2026/Pink.png', 'signature': '5d529fd02b544198ae075bd57c1762bb', 'mimeType': 'image/png', 'sizeOriginal': 17890, @@ -179,6 +181,8 @@ describe('Storage', () => { '\$updatedAt': '2020-10-15T06:38:00.000+00:00', '\$permissions': [], 'name': 'Pink.png', + 'folder': 'photos/2026/', + 'key': 'photos/2026/Pink.png', 'signature': '5d529fd02b544198ae075bd57c1762bb', 'mimeType': 'image/png', 'sizeOriginal': 17890, @@ -208,6 +212,8 @@ describe('Storage', () => { '\$updatedAt': '2020-10-15T06:38:00.000+00:00', '\$permissions': [], 'name': 'Pink.png', + 'folder': 'photos/2026/', + 'key': 'photos/2026/Pink.png', 'signature': '5d529fd02b544198ae075bd57c1762bb', 'mimeType': 'image/png', 'sizeOriginal': 17890, diff --git a/test/services/tables-d-b.test.js b/test/services/tables-d-b.test.js index 654a20a7..c0393409 100644 --- a/test/services/tables-d-b.test.js +++ b/test/services/tables-d-b.test.js @@ -254,7 +254,6 @@ describe('TablesDB', () => { 'nodePool': 'db-pool-4vcpu-8gb', 'replicas': 2, 'syncMode': 'async', - 'crossRegionReplicas': 1, 'networkMaxConnections': 500, 'networkIdleTimeoutSeconds': 900, 'networkIPAllowlist': [], @@ -285,10 +284,153 @@ describe('TablesDB', () => { expect(response).toEqual(data); }); + test('test method listMigrations()', async () => { + const data = { + 'total': 5, + 'migrations': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await tablesDB.listMigrations( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method createMigration()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'projectId': '5e5ea5c16897e', + 'databaseId': '5e5ea5c16897e', + 'specification': 's-2vcpu-4gb', + 'phase': 'pending', + 'attempt': 0, + 'lastError': '', + 'lagDocuments': 0, + 'verifiedAt': '2020-10-15T06:38:00.000+00:00', + 'cutoverAt': '2020-10-15T06:38:00.000+00:00', + 'soakUntil': '2020-10-15T06:38:00.000+00:00', + 'autoCutover': true, + 'cutoverRequested': true, + 'paused': true,}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await tablesDB.createMigration( + '', + 's-1vcpu-1gb', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method getMigration()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'projectId': '5e5ea5c16897e', + 'databaseId': '5e5ea5c16897e', + 'specification': 's-2vcpu-4gb', + 'phase': 'pending', + 'attempt': 0, + 'lastError': '', + 'lagDocuments': 0, + 'verifiedAt': '2020-10-15T06:38:00.000+00:00', + 'cutoverAt': '2020-10-15T06:38:00.000+00:00', + 'soakUntil': '2020-10-15T06:38:00.000+00:00', + 'autoCutover': true, + 'cutoverRequested': true, + 'paused': true,}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await tablesDB.getMigration( + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method deleteMigration()', async () => { + const data = {message: ""}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await tablesDB.deleteMigration( + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method cutoverMigration()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'projectId': '5e5ea5c16897e', + 'databaseId': '5e5ea5c16897e', + 'specification': 's-2vcpu-4gb', + 'phase': 'pending', + 'attempt': 0, + 'lastError': '', + 'lagDocuments': 0, + 'verifiedAt': '2020-10-15T06:38:00.000+00:00', + 'cutoverAt': '2020-10-15T06:38:00.000+00:00', + 'soakUntil': '2020-10-15T06:38:00.000+00:00', + 'autoCutover': true, + 'cutoverRequested': true, + 'paused': true,}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await tablesDB.cutoverMigration( + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method listOperations()', async () => { + const data = { + 'total': 5, + 'operations': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await tablesDB.listOperations( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method getReplicas()', async () => { const data = { 'replicas': 2, 'syncMode': 'async', + 'syncDegraded': true, + 'syncAcknowledgements': 1, + 'syncStandbyCount': 2, 'members': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -310,6 +452,10 @@ describe('TablesDB', () => { 'version': '17', 'uptime': 86400, 'connections': {}, + 'syncMode': 'async', + 'syncDegraded': true, + 'syncAcknowledgements': 1, + 'syncStandbyCount': 2, 'replicas': [], 'volumes': [],}; mockedFetch.mockImplementation(() => Response.json(data)); diff --git a/test/services/users.test.js b/test/services/users.test.js index f9ea2b14..04ef4223 100644 --- a/test/services/users.test.js +++ b/test/services/users.test.js @@ -592,12 +592,33 @@ describe('Users', () => { expect(response).toEqual(data); }); + test('test method getMFAChallenge()', async () => { + const data = { + '\$id': 'bb8ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + 'userId': '5e5ea5c168bb8', + 'expire': '2020-10-15T06:38:00.000+00:00', + 'code': '446372',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await users.getMFAChallenge( + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method listMfaFactors()', async () => { const data = { 'totp': true, 'phone': true, 'email': true, - 'recoveryCode': true,}; + 'recoveryCode': true, + 'custom': true,}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await users.listMfaFactors( @@ -615,7 +636,8 @@ describe('Users', () => { 'totp': true, 'phone': true, 'email': true, - 'recoveryCode': true,}; + 'recoveryCode': true, + 'custom': true,}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await users.listMFAFactors(