From 8afd7b12a0bc4d1e686bdad668adbb7497fbed85 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 8 Jun 2026 17:16:26 +0530 Subject: [PATCH 1/6] chore: update Node.js SDK to 26.2.0 --- CHANGELOG.md | 11 + .../update-membership-privacy-policy.md | 3 +- .../project/update-o-auth-2-server.md | 7 +- package-lock.json | 574 +++++++++--------- package.json | 4 +- src/client.ts | 25 +- src/enums/project-key-scopes.ts | 1 + src/inputFile.ts | 2 +- src/models.ts | 48 ++ src/services/account.ts | 49 ++ src/services/activities.ts | 2 + src/services/advisor.ts | 4 + src/services/avatars.ts | 8 + src/services/backups.ts | 12 + src/services/databases.ts | 65 ++ src/services/functions.ts | 22 + src/services/graphql.ts | 2 + src/services/health.ts | 25 + src/services/locale.ts | 8 + src/services/messaging.ts | 54 ++ src/services/organization.ts | 7 + src/services/presences.ts | 4 + src/services/project.ts | 171 +++++- src/services/proxy.ts | 7 + src/services/sites.ts | 22 + src/services/storage.ts | 11 + src/services/tables-db.ts | 65 ++ src/services/teams.ts | 11 + src/services/tokens.ts | 4 + src/services/usage.ts | 2 + src/services/users.ts | 42 ++ src/services/webhooks.ts | 5 + test/client.test.js | 34 ++ test/services/account.test.js | 4 +- test/services/activities.test.js | 4 +- test/services/advisor.test.js | 4 +- test/services/avatars.test.js | 4 +- test/services/backups.test.js | 4 +- test/services/databases.test.js | 4 +- test/services/functions.test.js | 4 +- test/services/graphql.test.js | 4 +- test/services/health.test.js | 4 +- test/services/locale.test.js | 4 +- test/services/messaging.test.js | 4 +- test/services/organization.test.js | 19 +- test/services/presences.test.js | 4 +- test/services/project.test.js | 99 ++- test/services/proxy.test.js | 4 +- test/services/sites.test.js | 4 +- test/services/storage.test.js | 4 +- test/services/tables-d-b.test.js | 4 +- test/services/teams.test.js | 8 +- test/services/tokens.test.js | 4 +- test/services/usage.test.js | 4 +- test/services/users.test.js | 4 +- test/services/webhooks.test.js | 4 +- 56 files changed, 1145 insertions(+), 372 deletions(-) create mode 100644 test/client.test.js diff --git a/CHANGELOG.md b/CHANGELOG.md index effca6f..f7617e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Change Log +## 26.2.0 + +* Added: Device Authorization Grant params (`verificationUrl`, `userCodeLength`, `userCodeFormat`, `deviceCodeDuration`) to `updateOAuth2Server` +* Added: `authorizationDetailsTypes` (RFC 9396) param to `updateOAuth2Server` in `project` +* Added: `userAccessedAt` param to `updateMembershipPrivacyPolicy` in `project` +* Added: email classification attributes (`emailCanonical`, `emailIsFree`, `emailIsDisposable`, `emailIsCorporate`, `emailIsCanonical`) to `User` +* Added: `userAccessedAt` attribute to `Membership` +* Added: `dedicatedDatabases.execute` to `ProjectKeyScopes` +* Updated: Replaced HTTP transport with `undici` for requests and self-signed certs + + ## 26.1.0 * Added: `createSesProvider` and `updateSesProvider` to `messaging` diff --git a/docs/examples/project/update-membership-privacy-policy.md b/docs/examples/project/update-membership-privacy-policy.md index 66eff9f..6fda090 100644 --- a/docs/examples/project/update-membership-privacy-policy.md +++ b/docs/examples/project/update-membership-privacy-policy.md @@ -13,6 +13,7 @@ const result = await project.updateMembershipPrivacyPolicy({ userEmail: false, // optional userPhone: false, // optional userName: false, // optional - userMFA: false // optional + userMFA: false, // optional + userAccessedAt: 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 d852677..5feef6a 100644 --- a/docs/examples/project/update-o-auth-2-server.md +++ b/docs/examples/project/update-o-auth-2-server.md @@ -12,10 +12,15 @@ const result = await project.updateOAuth2Server({ enabled: false, authorizationUrl: 'https://example.com', scopes: [], // optional + authorizationDetailsTypes: [], // optional accessTokenDuration: 60, // optional refreshTokenDuration: 60, // optional publicAccessTokenDuration: 60, // optional publicRefreshTokenDuration: 60, // optional - confidentialPkce: false // optional + confidentialPkce: false, // optional + verificationUrl: 'https://example.com', // optional + userCodeLength: 6, // optional + userCodeFormat: 'numeric', // optional + deviceCodeDuration: 60 // optional }); ``` diff --git a/package-lock.json b/package-lock.json index a4840dc..2ac1a1e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,16 @@ { "name": "node-appwrite", - "version": "26.1.0", + "version": "26.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "node-appwrite", - "version": "26.1.0", + "version": "26.2.0", + "license": "BSD-3-Clause", "dependencies": { "json-bigint": "1.0.0", - "node-fetch-native-with-agent": "1.7.2" + "undici": "^6.26.0" }, "devDependencies": { "@types/json-bigint": "1.0.4", @@ -19,17 +20,16 @@ "tslib": "2.6.2", "tsup": "^8.5.1", "typescript": "5.4.2" - }, - "license": "BSD-3-Clause" + } }, "node_modules/@babel/code-frame": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.0.tgz", - "integrity": "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", + "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^7.28.5", + "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" }, @@ -38,9 +38,9 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.0.tgz", - "integrity": "sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz", + "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==", "dev": true, "license": "MIT", "engines": { @@ -48,21 +48,21 @@ } }, "node_modules/@babel/core": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.0.tgz", - "integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.7.tgz", + "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.29.0", - "@babel/generator": "^7.29.0", - "@babel/helper-compilation-targets": "^7.28.6", - "@babel/helper-module-transforms": "^7.28.6", - "@babel/helpers": "^7.28.6", - "@babel/parser": "^7.29.0", - "@babel/template": "^7.28.6", - "@babel/traverse": "^7.29.0", - "@babel/types": "^7.29.0", + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.7", + "@babel/helper-compilation-targets": "^7.29.7", + "@babel/helper-module-transforms": "^7.29.7", + "@babel/helpers": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/template": "^7.29.7", + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", @@ -79,14 +79,14 @@ } }, "node_modules/@babel/generator": { - "version": "7.29.1", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.1.tgz", - "integrity": "sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.7.tgz", + "integrity": "sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/parser": "^7.29.0", - "@babel/types": "^7.29.0", + "@babel/parser": "^7.29.7", + "@babel/types": "^7.29.7", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" @@ -96,14 +96,14 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.28.6", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.28.6.tgz", - "integrity": "sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.7.tgz", + "integrity": "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==", "dev": true, "license": "MIT", "dependencies": { - "@babel/compat-data": "^7.28.6", - "@babel/helper-validator-option": "^7.27.1", + "@babel/compat-data": "^7.29.7", + "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" @@ -113,9 +113,9 @@ } }, "node_modules/@babel/helper-globals": { - "version": "7.28.0", - "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz", - "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz", + "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==", "dev": true, "license": "MIT", "engines": { @@ -123,29 +123,29 @@ } }, "node_modules/@babel/helper-module-imports": { - "version": "7.28.6", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.28.6.tgz", - "integrity": "sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz", + "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==", "dev": true, "license": "MIT", "dependencies": { - "@babel/traverse": "^7.28.6", - "@babel/types": "^7.28.6" + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.28.6", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.6.tgz", - "integrity": "sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.7.tgz", + "integrity": "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-module-imports": "^7.28.6", - "@babel/helper-validator-identifier": "^7.28.5", - "@babel/traverse": "^7.28.6" + "@babel/helper-module-imports": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7", + "@babel/traverse": "^7.29.7" }, "engines": { "node": ">=6.9.0" @@ -155,9 +155,9 @@ } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.28.6", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.28.6.tgz", - "integrity": "sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.29.7.tgz", + "integrity": "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw==", "dev": true, "license": "MIT", "engines": { @@ -165,9 +165,9 @@ } }, "node_modules/@babel/helper-string-parser": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", - "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", + "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==", "dev": true, "license": "MIT", "engines": { @@ -175,9 +175,9 @@ } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.28.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", - "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", "dev": true, "license": "MIT", "engines": { @@ -185,9 +185,9 @@ } }, "node_modules/@babel/helper-validator-option": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz", - "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz", + "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==", "dev": true, "license": "MIT", "engines": { @@ -195,27 +195,27 @@ } }, "node_modules/@babel/helpers": { - "version": "7.29.2", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.2.tgz", - "integrity": "sha512-HoGuUs4sCZNezVEKdVcwqmZN8GoHirLUcLaYVNBK2J0DadGtdcqgr3BCbvH8+XUo4NGjNl3VOtSjEKNzqfFgKw==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.7.tgz", + "integrity": "sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/template": "^7.28.6", - "@babel/types": "^7.29.0" + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/parser": { - "version": "7.29.2", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.2.tgz", - "integrity": "sha512-4GgRzy/+fsBa72/RZVJmGKPmZu9Byn8o4MoLpmNe1m8ZfYnz5emHLQz3U4gLud6Zwl0RZIcgiLD7Uq7ySFuDLA==", + "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==", "dev": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.29.0" + "@babel/types": "^7.29.7" }, "bin": { "parser": "bin/babel-parser.js" @@ -280,13 +280,13 @@ } }, "node_modules/@babel/plugin-syntax-import-attributes": { - "version": "7.28.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.28.6.tgz", - "integrity": "sha512-jiLC0ma9XkQT3TKJ9uYvlakm66Pamywo+qwL+oL8HJOvc6TWdZXVfhqJr8CCzbSGUAbDOzlGHJC1U+vRfLQDvw==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.29.7.tgz", + "integrity": "sha512-zGYcYfq/WmZ4V+kBIXQon9dSSc8ircGZqw9ZaNhhGj9nZkeBu1jHLBDQqYYi5WA9uawvA2sIMbry2nCFhf5Djg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.28.6" + "@babel/helper-plugin-utils": "^7.29.7" }, "engines": { "node": ">=6.9.0" @@ -322,13 +322,13 @@ } }, "node_modules/@babel/plugin-syntax-jsx": { - "version": "7.28.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.28.6.tgz", - "integrity": "sha512-wgEmr06G6sIpqr8YDwA2dSRTE3bJ+V0IfpzfSY3Lfgd7YWOaAdlykvJi13ZKBt8cZHfgH1IXN+CL656W3uUa4w==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.29.7.tgz", + "integrity": "sha512-TSu8+mHCoEaaCDEZ0I3+6mvTBYR4PCxQwf2z9/r5Tbztv6NaLR3B9thGTTxX2WGuGHJqRiAbKPeGTJ5XWXVg6A==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.28.6" + "@babel/helper-plugin-utils": "^7.29.7" }, "engines": { "node": ">=6.9.0" @@ -448,13 +448,13 @@ } }, "node_modules/@babel/plugin-syntax-typescript": { - "version": "7.28.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.28.6.tgz", - "integrity": "sha512-+nDNmQye7nlnuuHDboPbGm00Vqg3oO8niRRL27/4LYHUsHYh0zJ1xWOz0uRwNFmM1Avzk8wZbc6rdiYhomzv/A==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.29.7.tgz", + "integrity": "sha512-ngr+82Sh0xMz25TPCZi+nC2iTzjfCdWS2ONXTp/PtSCHCgaCNBpdMqgvJ2ccdLlClVZ7sisIgB914j/JFe+RZA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.28.6" + "@babel/helper-plugin-utils": "^7.29.7" }, "engines": { "node": ">=6.9.0" @@ -464,33 +464,33 @@ } }, "node_modules/@babel/template": { - "version": "7.28.6", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.28.6.tgz", - "integrity": "sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz", + "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.28.6", - "@babel/parser": "^7.28.6", - "@babel/types": "^7.28.6" + "@babel/code-frame": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/types": "^7.29.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.0.tgz", - "integrity": "sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.7.tgz", + "integrity": "sha512-EhlfNQtZ+NK22w5BM61ciuiq1m58ed33Wr1Xan//ZRTy6hgjnwyCffRYwzsGXdASJSUJ1guZILsErh1eQcl+zw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.29.0", - "@babel/generator": "^7.29.0", - "@babel/helper-globals": "^7.28.0", - "@babel/parser": "^7.29.0", - "@babel/template": "^7.28.6", - "@babel/types": "^7.29.0", + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.7", + "@babel/helper-globals": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.7", "debug": "^4.3.1" }, "engines": { @@ -498,14 +498,14 @@ } }, "node_modules/@babel/types": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.0.tgz", - "integrity": "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.7.tgz", + "integrity": "sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-string-parser": "^7.27.1", - "@babel/helper-validator-identifier": "^7.28.5" + "@babel/helper-string-parser": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7" }, "engines": { "node": ">=6.9.0" @@ -978,9 +978,9 @@ } }, "node_modules/@istanbuljs/schema": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", - "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.6.tgz", + "integrity": "sha512-+Sg6GCR/wy1oSmQDFq4LQDAhm3ETKnorxN+y5nbLULOR3P0c14f2Wurzj3/xqPXtasLFfHd5iRFQ7AJt4KH2cw==", "dev": true, "license": "MIT", "engines": { @@ -1330,9 +1330,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.60.1.tgz", - "integrity": "sha512-d6FinEBLdIiK+1uACUttJKfgZREXrF0Qc2SmLII7W2AD8FfiZ9Wjd+rD/iRuf5s5dWrr1GgwXCvPqOuDquOowA==", + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.61.1.tgz", + "integrity": "sha512-JnBB8MdXj45cajvTuO5FmPlvFVJRQgvrz1uSEl3NwqFnReAPGwb8EanbGi4z2nRaqLzjJSv5/JmycoTKlRZxHA==", "cpu": [ "arm" ], @@ -1344,9 +1344,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.60.1.tgz", - "integrity": "sha512-YjG/EwIDvvYI1YvYbHvDz/BYHtkY4ygUIXHnTdLhG+hKIQFBiosfWiACWortsKPKU/+dUwQQCKQM3qrDe8c9BA==", + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.61.1.tgz", + "integrity": "sha512-Jx2g7iSjw4AOT0HDPHM9RV3GNjRXwybWtSFZiZAYUTjUwjVrYIwq3kBf+LnhqJlzXFAqTAh2F7IGI+O568exPw==", "cpu": [ "arm64" ], @@ -1358,9 +1358,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.60.1.tgz", - "integrity": "sha512-mjCpF7GmkRtSJwon+Rq1N8+pI+8l7w5g9Z3vWj4T7abguC4Czwi3Yu/pFaLvA3TTeMVjnu3ctigusqWUfjZzvw==", + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.61.1.tgz", + "integrity": "sha512-0F1L/Z3Eqv8mT2n3dCpeO8GcTvHvVqkP5/t6DMsn0KzhYVcg+s7Ncl5DS8qjKYEeio6Az0Gt6nyBORay5qIlCA==", "cpu": [ "arm64" ], @@ -1372,9 +1372,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.60.1.tgz", - "integrity": "sha512-haZ7hJ1JT4e9hqkoT9R/19XW2QKqjfJVv+i5AGg57S+nLk9lQnJ1F/eZloRO3o9Scy9CM3wQ9l+dkXtcBgN5Ew==", + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.61.1.tgz", + "integrity": "sha512-qLttcH871ujY4YcVfUSShhOw+CsoTatYz8gRbHO7Bb92QH059/P0y5do1KMs41fY0BpD2x4AJH/gID0zFiqVKQ==", "cpu": [ "x64" ], @@ -1386,9 +1386,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.60.1.tgz", - "integrity": "sha512-czw90wpQq3ZsAVBlinZjAYTKduOjTywlG7fEeWKUA7oCmpA8xdTkxZZlwNJKWqILlq0wehoZcJYfBvOyhPTQ6w==", + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.61.1.tgz", + "integrity": "sha512-fUI4RapGE0Oh3mb8mgfvC1O2nU1RpDZUKnDQm3xB1Ipg7C2wTs5Kstz7G2uWK99a8S2yTMq8/P4uycwNa0nJyw==", "cpu": [ "arm64" ], @@ -1400,9 +1400,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.60.1.tgz", - "integrity": "sha512-KVB2rqsxTHuBtfOeySEyzEOB7ltlB/ux38iu2rBQzkjbwRVlkhAGIEDiiYnO2kFOkJp+Z7pUXKyrRRFuFUKt+g==", + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.61.1.tgz", + "integrity": "sha512-H5YrdvJaDtI/U9/emrD4b++xkvp3y/JvOe4rizHbxvkyMfRS/CiRYdji+Pl8D0brEaNFWUh1drQxgAGIl6Xudw==", "cpu": [ "x64" ], @@ -1414,16 +1414,13 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.60.1.tgz", - "integrity": "sha512-L+34Qqil+v5uC0zEubW7uByo78WOCIrBvci69E7sFASRl0X7b/MB6Cqd1lky/CtcSVTydWa2WZwFuWexjS5o6g==", + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.61.1.tgz", + "integrity": "sha512-Q8CBCCQtDFrYtXoeUXSrnFXKOnyUhx6bz+SkL6A0E7V8kAiCJ5pamq1WtbfpVGhR5TSpXY6ak3avmDc5fHTyJA==", "cpu": [ "arm" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1431,16 +1428,13 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.60.1.tgz", - "integrity": "sha512-n83O8rt4v34hgFzlkb1ycniJh7IR5RCIqt6mz1VRJD6pmhRi0CXdmfnLu9dIUS6buzh60IvACM842Ffb3xd6Gg==", + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.61.1.tgz", + "integrity": "sha512-nwnhk1581l0FBVellGcVCAT0Oi06onEA3WB53sf01VO3I0UPBkMH9sXONYME2K0ovXcNayJfNtHfm6mpJElatQ==", "cpu": [ "arm" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -1448,16 +1442,13 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.60.1.tgz", - "integrity": "sha512-Nql7sTeAzhTAja3QXeAI48+/+GjBJ+QmAH13snn0AJSNL50JsDqotyudHyMbO2RbJkskbMbFJfIJKWA6R1LCJQ==", + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.61.1.tgz", + "integrity": "sha512-x5Xr49hwt3hdW75UOZm3395YwwzPyauktslv29KpWL/T+vVAzoT3azLcTWv0eMciBNrx+DYjH4paehHoLpPvpg==", "cpu": [ "arm64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1465,16 +1456,13 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.60.1.tgz", - "integrity": "sha512-+pUymDhd0ys9GcKZPPWlFiZ67sTWV5UU6zOJat02M1+PiuSGDziyRuI/pPue3hoUwm2uGfxdL+trT6Z9rxnlMA==", + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.61.1.tgz", + "integrity": "sha512-unMS3H73DpaoPyyEVPjGKleM/s0mkmsauTENpw4INQY8y4+IuLNjkueQ5QCtC0D3N38Y38yhAU8OoZ20S2Tm6w==", "cpu": [ "arm64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -1482,16 +1470,13 @@ ] }, "node_modules/@rollup/rollup-linux-loong64-gnu": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.60.1.tgz", - "integrity": "sha512-VSvgvQeIcsEvY4bKDHEDWcpW4Yw7BtlKG1GUT4FzBUlEKQK0rWHYBqQt6Fm2taXS+1bXvJT6kICu5ZwqKCnvlQ==", + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.61.1.tgz", + "integrity": "sha512-zNZzGRnAhwjFEYmvphJRV5XaQGjs62cCmeYYHUT//NbvEnHauw+I85nGG+SiVg5ld4GX8D1IbKIX+ozITQnhMQ==", "cpu": [ "loong64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1499,16 +1484,13 @@ ] }, "node_modules/@rollup/rollup-linux-loong64-musl": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.60.1.tgz", - "integrity": "sha512-4LqhUomJqwe641gsPp6xLfhqWMbQV04KtPp7/dIp0nzPxAkNY1AbwL5W0MQpcalLYk07vaW9Kp1PBhdpZYYcEw==", + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.61.1.tgz", + "integrity": "sha512-LdpWGL8X209B2SIvWjqlc8VZgM6PKfontSerGepuldQmHYrAOtnMCXeJkxXGbC+PPZVOuu5czJo7fNV6aeW8rQ==", "cpu": [ "loong64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -1516,16 +1498,13 @@ ] }, "node_modules/@rollup/rollup-linux-ppc64-gnu": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.60.1.tgz", - "integrity": "sha512-tLQQ9aPvkBxOc/EUT6j3pyeMD6Hb8QF2BTBnCQWP/uu1lhc9AIrIjKnLYMEroIz/JvtGYgI9dF3AxHZNaEH0rw==", + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.61.1.tgz", + "integrity": "sha512-EC5kTtNaNGOmbMGqar8dvJy6y/hg99GAwjfBz++pxZhQATXGcRjd6c5en5wcbru0vkRmiMGsQKdMJOOf6sza4g==", "cpu": [ "ppc64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1533,16 +1512,13 @@ ] }, "node_modules/@rollup/rollup-linux-ppc64-musl": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.60.1.tgz", - "integrity": "sha512-RMxFhJwc9fSXP6PqmAz4cbv3kAyvD1etJFjTx4ONqFP9DkTkXsAMU4v3Vyc5BgzC+anz7nS/9tp4obsKfqkDHg==", + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.61.1.tgz", + "integrity": "sha512-8hiwp6D4acEcNK78I4rP0/XtS1sknWIAMJBPdR4l6zUtyTm5KiTDr5bXmWt4foY7nAN7AThDHgkLIEZOWKbzWw==", "cpu": [ "ppc64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -1550,16 +1526,13 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.60.1.tgz", - "integrity": "sha512-QKgFl+Yc1eEk6MmOBfRHYF6lTxiiiV3/z/BRrbSiW2I7AFTXoBFvdMEyglohPj//2mZS4hDOqeB0H1ACh3sBbg==", + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.61.1.tgz", + "integrity": "sha512-10dh/h/BqA7DuMPWSxkR8uks18FRwnwOEqr5zOTEl+NOwP/OMzKX8OFR/Of9xxDA7D5qef1Nzar5WDD2kCCr1g==", "cpu": [ "riscv64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1567,16 +1540,13 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.60.1.tgz", - "integrity": "sha512-RAjXjP/8c6ZtzatZcA1RaQr6O1TRhzC+adn8YZDnChliZHviqIjmvFwHcxi4JKPSDAt6Uhf/7vqcBzQJy0PDJg==", + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.61.1.tgz", + "integrity": "sha512-YKJ5lg35DP17gcAOggnihe+APw9HLyj1Xn7gsmGumBJAUDa6NGXNixJzmkWLhcK9TOuuyQjdamzvJefkO7qHZQ==", "cpu": [ "riscv64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -1584,16 +1554,13 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.60.1.tgz", - "integrity": "sha512-wcuocpaOlaL1COBYiA89O6yfjlp3RwKDeTIA0hM7OpmhR1Bjo9j31G1uQVpDlTvwxGn2nQs65fBFL5UFd76FcQ==", + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.61.1.tgz", + "integrity": "sha512-Mlil5G2Jj6a7B3LWGctg+XPL9vdXYuzCtNXfxOQ0nPjc2m6ueUktocPGH9bnAM0bNRKb/bAWTujUU7IJQdQA+g==", "cpu": [ "s390x" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1601,16 +1568,13 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.60.1.tgz", - "integrity": "sha512-77PpsFQUCOiZR9+LQEFg9GClyfkNXj1MP6wRnzYs0EeWbPcHs02AXu4xuUbM1zhwn3wqaizle3AEYg5aeoohhg==", + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.61.1.tgz", + "integrity": "sha512-bVWIOIk6pV01p4CdUbPP7CJ/434z+OooYjDuFcR+44N35YvKUC66G8MGnvcWx5mWKW3g61J+t74l3Kj15Kwn2Q==", "cpu": [ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1618,16 +1582,13 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.60.1.tgz", - "integrity": "sha512-5cIATbk5vynAjqqmyBjlciMJl1+R/CwX9oLk/EyiFXDWd95KpHdrOJT//rnUl4cUcskrd0jCCw3wpZnhIHdD9w==", + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.61.1.tgz", + "integrity": "sha512-qy5pBvZbqNFheBz61R1rzsezjm0J7O2oNGoWtGoY89SZYLUfxAJTBAqDChqAIdB4rCiIbi9nF7yZ83GnNiLwSw==", "cpu": [ "x64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -1635,9 +1596,9 @@ ] }, "node_modules/@rollup/rollup-openbsd-x64": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.60.1.tgz", - "integrity": "sha512-cl0w09WsCi17mcmWqqglez9Gk8isgeWvoUZ3WiJFYSR3zjBQc2J5/ihSjpl+VLjPqjQ/1hJRcqBfLjssREQILw==", + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.61.1.tgz", + "integrity": "sha512-E83TXjI4zm0+5f2qO+UOudaCYIhYwpJ5jq6YCZNIZ+6CbfhKrkAGezeiASBL9ElxAxFsRS9ZhESv8mfnj6TKeg==", "cpu": [ "x64" ], @@ -1649,9 +1610,9 @@ ] }, "node_modules/@rollup/rollup-openharmony-arm64": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.60.1.tgz", - "integrity": "sha512-4Cv23ZrONRbNtbZa37mLSueXUCtN7MXccChtKpUnQNgF010rjrjfHx3QxkS2PI7LqGT5xXyYs1a7LbzAwT0iCA==", + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.61.1.tgz", + "integrity": "sha512-fbWnKqVkjrJN38vNe3ahkbk6iejS/3b0Nt7EEtPpE6RBacZcGXNKbzfHN3GUUlXOPghUg0j6XUGrtjX9z1sIvA==", "cpu": [ "arm64" ], @@ -1663,9 +1624,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.60.1.tgz", - "integrity": "sha512-i1okWYkA4FJICtr7KpYzFpRTHgy5jdDbZiWfvny21iIKky5YExiDXP+zbXzm3dUcFpkEeYNHgQ5fuG236JPq0g==", + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.61.1.tgz", + "integrity": "sha512-ArMl38iVAbk0New1ogihQNY6iphLi4ZaRsa037gUzv5yeKPY8TD3Dmy4x2RNC1VztU/uqm+G+/RwFrSka3Oy2g==", "cpu": [ "arm64" ], @@ -1677,9 +1638,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.60.1.tgz", - "integrity": "sha512-u09m3CuwLzShA0EYKMNiFgcjjzwqtUMLmuCJLeZWjjOYA3IT2Di09KaxGBTP9xVztWyIWjVdsB2E9goMjZvTQg==", + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.61.1.tgz", + "integrity": "sha512-0mYtjHS9ucAbcATycCNK9IGBk/cCe/ma7EmSLGZdsxnOA8cjRIyU04wDpVAD9NiOfLUR9KTxdiO53uOkherqjQ==", "cpu": [ "ia32" ], @@ -1691,9 +1652,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-gnu": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.60.1.tgz", - "integrity": "sha512-k+600V9Zl1CM7eZxJgMyTUzmrmhB/0XZnF4pRypKAlAgxmedUA+1v9R+XOFv56W4SlHEzfeMtzujLJD22Uz5zg==", + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.61.1.tgz", + "integrity": "sha512-gK1iCEPfpoSG9wfBihXxvBMi8ZfcWffYkEsC/Eih+iFENTaewvNcrEQ69lIOWYO5pePHKLHHO7nq5AILGO/HQQ==", "cpu": [ "x64" ], @@ -1705,9 +1666,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.60.1.tgz", - "integrity": "sha512-lWMnixq/QzxyhTV6NjQJ4SFo1J6PvOX8vUx5Wb4bBPsEb+8xZ89Bz6kOXpfXj9ak9AHTQVQzlgzBEc1SyM27xQ==", + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.61.1.tgz", + "integrity": "sha512-X+zaP2x+j4RXGfbp/seSoRHWnPxzApilDszisZxbYH5C/jTxFhCtDNdPGZb9lJyYPs24wGxruPF7Y+sIXt9Gzw==", "cpu": [ "x64" ], @@ -1791,9 +1752,9 @@ } }, "node_modules/@types/estree": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", - "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", "dev": true, "license": "MIT" }, @@ -2085,9 +2046,9 @@ "license": "MIT" }, "node_modules/baseline-browser-mapping": { - "version": "2.10.12", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.12.tgz", - "integrity": "sha512-qyq26DxfY4awP2gIRXhhLWfwzwI+N5Nxk6iQi8EFizIaWIjqicQTE4sLnZZVdeKPRcVNoJOkkpfzoIYuvCKaIQ==", + "version": "2.10.34", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.34.tgz", + "integrity": "sha512-IMDedajPifLnHNY0X9n8hKxRTQ6/eTHwr5bDo04WnuqxyKw6LYtQywCuuqPZwhl3aBXMvQpJov42GLCwRRdQzw==", "dev": true, "license": "Apache-2.0", "bin": { @@ -2107,9 +2068,9 @@ } }, "node_modules/brace-expansion": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.13.tgz", - "integrity": "sha512-9ZLprWS6EENmhEOpjCYW2c8VkmOvckIJZfkr7rBW6dObmfgJ/L1GpSYW5Hpo9lDz4D1+n0Ckz8rU7FwHDQiG/w==", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.15.tgz", + "integrity": "sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg==", "dev": true, "license": "MIT", "dependencies": { @@ -2228,9 +2189,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001782", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001782.tgz", - "integrity": "sha512-dZcaJLJeDMh4rELYFw1tvSn1bhZWYFOt468FcbHHxx/Z/dFidd1I6ciyFdi3iwfQCyOjqo9upF6lGQYtMiJWxw==", + "version": "1.0.30001797", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001797.tgz", + "integrity": "sha512-l8xKG+gwAIExZGl9FrF7KUwuOmk6wbEPC9Xoy/RtnWv1XG0Q4LFlagaLpUv3Kiza3W/wm27zy0yWJEieYKAP6w==", "dev": true, "funding": [ { @@ -2509,9 +2470,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.329", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.329.tgz", - "integrity": "sha512-/4t+AS1l4S3ZC0Ja7PHFIWeBIxGA3QGqV8/yKsP36v7NcyUCl+bIcmw6s5zVuMIECWwBrAK/6QLzTmbJChBboQ==", + "version": "1.5.368", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.368.tgz", + "integrity": "sha512-7RckJJK4uESJF9PxvfMWd3TGqIiieUTG4HxnKaKuIpGbcr+r2ZEB3g2gAhCP3Fqm42vJSzLfgab9eva/C4/XVw==", "dev": true, "license": "ISC" }, @@ -2545,6 +2506,16 @@ "is-arrayish": "^0.2.1" } }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/esbuild": { "version": "0.27.7", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.7.tgz", @@ -2853,9 +2824,9 @@ } }, "node_modules/hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", "dev": true, "license": "MIT", "dependencies": { @@ -2939,13 +2910,13 @@ "license": "MIT" }, "node_modules/is-core-module": { - "version": "2.16.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", - "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "version": "2.16.2", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.2.tgz", + "integrity": "sha512-evOr8xfXKxE6qSR0hSXL2r3sd7ALj8+7jQEUvPYcm5sgZFdJ+AYzT6yNmJenvIYQBgIGwfwz08sL8zoL7yq2BA==", "dev": true, "license": "MIT", "dependencies": { - "hasown": "^2.0.2" + "hasown": "^2.0.3" }, "engines": { "node": ">= 0.4" @@ -3032,9 +3003,9 @@ } }, "node_modules/istanbul-lib-instrument/node_modules/semver": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", - "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", + "version": "7.8.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.2.tgz", + "integrity": "sha512-c8jsqUZm3omBOI66G90z1Dyw5z622G8oLG+omfsHBJf3CWQTlOcwOjvOG6wtiNfW6anKm/eA39LMwMtMez2TiQ==", "dev": true, "license": "ISC", "bin": { @@ -3571,9 +3542,9 @@ } }, "node_modules/jest-snapshot/node_modules/semver": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", - "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", + "version": "7.8.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.2.tgz", + "integrity": "sha512-c8jsqUZm3omBOI66G90z1Dyw5z622G8oLG+omfsHBJf3CWQTlOcwOjvOG6wtiNfW6anKm/eA39LMwMtMez2TiQ==", "dev": true, "license": "ISC", "bin": { @@ -3857,9 +3828,9 @@ } }, "node_modules/make-dir/node_modules/semver": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", - "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", + "version": "7.8.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.2.tgz", + "integrity": "sha512-c8jsqUZm3omBOI66G90z1Dyw5z622G8oLG+omfsHBJf3CWQTlOcwOjvOG6wtiNfW6anKm/eA39LMwMtMez2TiQ==", "dev": true, "license": "ISC", "bin": { @@ -3962,12 +3933,6 @@ "dev": true, "license": "MIT" }, - "node_modules/node-fetch-native-with-agent": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/node-fetch-native-with-agent/-/node-fetch-native-with-agent-1.7.2.tgz", - "integrity": "sha512-5MaOOCuJEvcckoz7/tjdx1M6OusOY6Xc5f459IaruGStWnKzlI1qpNgaAwmn4LmFYcsSlj+jBMk84wmmRxfk5g==", - "license": "MIT" - }, "node_modules/node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -3976,11 +3941,14 @@ "license": "MIT" }, "node_modules/node-releases": { - "version": "2.0.36", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.36.tgz", - "integrity": "sha512-TdC8FSgHz8Mwtw9g5L4gR/Sh9XhSP/0DEkQxfEFXOpiul5IiHgHan2VhYYb6agDSfp4KuvltmGApc8HMgUrIkA==", + "version": "2.0.47", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.47.tgz", + "integrity": "sha512-Uzmd6LXpouKo8EUK68IjH4+E01w/hXyV3R3g/geCJo+rXLNfh1xucB+LOzYEOQPSiUK3h/xZf0cQGcSsmyL2Og==", "dev": true, - "license": "MIT" + "license": "MIT", + "engines": { + "node": ">=18" + } }, "node_modules/normalize-path": { "version": "3.0.0", @@ -4348,12 +4316,13 @@ } }, "node_modules/resolve": { - "version": "1.22.11", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.11.tgz", - "integrity": "sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==", + "version": "1.22.12", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.12.tgz", + "integrity": "sha512-TyeJ1zif53BPfHootBGwPRYT1RUt6oGWsaQr8UyZW/eAm9bKoijtvruSDEmZHm92CwS9nj7/fWttqPCgzep8CA==", "dev": true, "license": "MIT", "dependencies": { + "es-errors": "^1.3.0", "is-core-module": "^2.16.1", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" @@ -4402,13 +4371,13 @@ } }, "node_modules/rollup": { - "version": "4.60.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.60.1.tgz", - "integrity": "sha512-VmtB2rFU/GroZ4oL8+ZqXgSA38O6GR8KSIvWmEFv63pQ0G6KaBH9s07PO8XTXP4vI+3UJUEypOfjkGfmSBBR0w==", + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.61.1.tgz", + "integrity": "sha512-I4KW6iuRpuu2uHBLraZ1wNZe0DP7lnRha+VJ9tNaYVaVgKhW0aI3h4RYnoRPeql0flHm/Co55b7snEDcOfOJrA==", "dev": true, "license": "MIT", "dependencies": { - "@types/estree": "1.0.8" + "@types/estree": "1.0.9" }, "bin": { "rollup": "dist/bin/rollup" @@ -4418,31 +4387,31 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.60.1", - "@rollup/rollup-android-arm64": "4.60.1", - "@rollup/rollup-darwin-arm64": "4.60.1", - "@rollup/rollup-darwin-x64": "4.60.1", - "@rollup/rollup-freebsd-arm64": "4.60.1", - "@rollup/rollup-freebsd-x64": "4.60.1", - "@rollup/rollup-linux-arm-gnueabihf": "4.60.1", - "@rollup/rollup-linux-arm-musleabihf": "4.60.1", - "@rollup/rollup-linux-arm64-gnu": "4.60.1", - "@rollup/rollup-linux-arm64-musl": "4.60.1", - "@rollup/rollup-linux-loong64-gnu": "4.60.1", - "@rollup/rollup-linux-loong64-musl": "4.60.1", - "@rollup/rollup-linux-ppc64-gnu": "4.60.1", - "@rollup/rollup-linux-ppc64-musl": "4.60.1", - "@rollup/rollup-linux-riscv64-gnu": "4.60.1", - "@rollup/rollup-linux-riscv64-musl": "4.60.1", - "@rollup/rollup-linux-s390x-gnu": "4.60.1", - "@rollup/rollup-linux-x64-gnu": "4.60.1", - "@rollup/rollup-linux-x64-musl": "4.60.1", - "@rollup/rollup-openbsd-x64": "4.60.1", - "@rollup/rollup-openharmony-arm64": "4.60.1", - "@rollup/rollup-win32-arm64-msvc": "4.60.1", - "@rollup/rollup-win32-ia32-msvc": "4.60.1", - "@rollup/rollup-win32-x64-gnu": "4.60.1", - "@rollup/rollup-win32-x64-msvc": "4.60.1", + "@rollup/rollup-android-arm-eabi": "4.61.1", + "@rollup/rollup-android-arm64": "4.61.1", + "@rollup/rollup-darwin-arm64": "4.61.1", + "@rollup/rollup-darwin-x64": "4.61.1", + "@rollup/rollup-freebsd-arm64": "4.61.1", + "@rollup/rollup-freebsd-x64": "4.61.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.61.1", + "@rollup/rollup-linux-arm-musleabihf": "4.61.1", + "@rollup/rollup-linux-arm64-gnu": "4.61.1", + "@rollup/rollup-linux-arm64-musl": "4.61.1", + "@rollup/rollup-linux-loong64-gnu": "4.61.1", + "@rollup/rollup-linux-loong64-musl": "4.61.1", + "@rollup/rollup-linux-ppc64-gnu": "4.61.1", + "@rollup/rollup-linux-ppc64-musl": "4.61.1", + "@rollup/rollup-linux-riscv64-gnu": "4.61.1", + "@rollup/rollup-linux-riscv64-musl": "4.61.1", + "@rollup/rollup-linux-s390x-gnu": "4.61.1", + "@rollup/rollup-linux-x64-gnu": "4.61.1", + "@rollup/rollup-linux-x64-musl": "4.61.1", + "@rollup/rollup-openbsd-x64": "4.61.1", + "@rollup/rollup-openharmony-arm64": "4.61.1", + "@rollup/rollup-win32-arm64-msvc": "4.61.1", + "@rollup/rollup-win32-ia32-msvc": "4.61.1", + "@rollup/rollup-win32-x64-gnu": "4.61.1", + "@rollup/rollup-win32-x64-msvc": "4.61.1", "fsevents": "~2.3.2" } }, @@ -4714,14 +4683,14 @@ "license": "MIT" }, "node_modules/tinyglobby": { - "version": "0.2.15", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", - "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", "dev": true, "license": "MIT", "dependencies": { "fdir": "^6.5.0", - "picomatch": "^4.0.3" + "picomatch": "^4.0.4" }, "engines": { "node": ">=12.0.0" @@ -4906,12 +4875,21 @@ } }, "node_modules/ufo": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.3.tgz", - "integrity": "sha512-yDJTmhydvl5lJzBmy/hyOAA0d+aqCBuwl818haVdYCRrWV84o7YyeVm4QlVHStqNrrJSTb6jKuFAVqAFsr+K3Q==", + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.4.tgz", + "integrity": "sha512-JFNbkD1Svwe0KvGi8GOeLcP4kAWQ609twvCdcHxq1oSL8svv39ZuSvajcD8B+5D0eL4+s1Is2D/O6KN3qcTeRA==", "dev": true, "license": "MIT" }, + "node_modules/undici": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.26.0.tgz", + "integrity": "sha512-4yqz8a3n5HmGTlsbADNtr/dJlhkh/55Rq798G6ibiULcXbDtaLpTl1pvdqcbFfeoj3iSi52lePFM7h9H21cw/A==", + "license": "MIT", + "engines": { + "node": ">=18.17" + } + }, "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", diff --git a/package.json b/package.json index c72d435..581a191 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "node-appwrite", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API", - "version": "26.1.0", + "version": "26.2.0", "license": "BSD-3-Clause", "main": "dist/index.js", "type": "commonjs", @@ -52,6 +52,6 @@ }, "dependencies": { "json-bigint": "1.0.0", - "node-fetch-native-with-agent": "1.7.2" + "undici": "^6.26.0" } } diff --git a/src/client.ts b/src/client.ts index f5e360e..5bc4e36 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1,5 +1,4 @@ -import { fetch, FormData, File } from 'node-fetch-native-with-agent'; -import { createAgent } from 'node-fetch-native-with-agent/agent'; +import { fetch, FormData, File, Agent, type RequestInit } from 'undici'; import { Models } from './models'; import { InputFile } from './inputFile'; import JSONbigModule from 'json-bigint'; @@ -74,7 +73,7 @@ class AppwriteException extends Error { } function getUserAgent() { - let ua = 'AppwriteNodeJSSDK/26.1.0'; + let ua = 'AppwriteNodeJSSDK/26.2.0'; // `process` is a global in Node.js, but not fully available in all runtimes. const platform: string[] = []; @@ -108,6 +107,7 @@ function getUserAgent() { class Client { static CHUNK_SIZE = 1024 * 1024 * 5; + private selfSignedAgent?: Agent; config = { endpoint: 'https://cloud.appwrite.io/v1', @@ -128,7 +128,7 @@ class Client { 'x-sdk-name': 'Node.js', 'x-sdk-platform': 'server', 'x-sdk-language': 'nodejs', - 'x-sdk-version': '26.1.0', + 'x-sdk-version': '26.2.0', 'user-agent' : getUserAgent(), 'X-Appwrite-Response-Format': '1.9.5', }; @@ -170,6 +170,11 @@ class Client { this.config.selfSigned = selfSigned; + if (!selfSigned && this.selfSignedAgent) { + this.selfSignedAgent.destroy(); + this.selfSignedAgent = undefined; + } + return this; } @@ -359,9 +364,19 @@ class Client { let options: RequestInit = { method, headers, - ...createAgent(this.config.endpoint, { rejectUnauthorized: !this.config.selfSigned }), }; + if (this.config.selfSigned) { + if (!this.selfSignedAgent) { + this.selfSignedAgent = new Agent({ + connect: { + rejectUnauthorized: false, + }, + }); + } + options.dispatcher = this.selfSignedAgent; + } + if (method === 'GET') { for (const [key, value] of Object.entries(Client.flatten(params))) { url.searchParams.append(key, value); diff --git a/src/enums/project-key-scopes.ts b/src/enums/project-key-scopes.ts index 47125dd..927acf8 100644 --- a/src/enums/project-key-scopes.ts +++ b/src/enums/project-key-scopes.ts @@ -89,6 +89,7 @@ export enum ProjectKeyScopes { ArchivesWrite = 'archives.write', RestorationsRead = 'restorations.read', RestorationsWrite = 'restorations.write', + DedicatedDatabasesExecute = 'dedicatedDatabases.execute', DomainsRead = 'domains.read', DomainsWrite = 'domains.write', EventsRead = 'events.read', diff --git a/src/inputFile.ts b/src/inputFile.ts index 94afbe2..0545928 100644 --- a/src/inputFile.ts +++ b/src/inputFile.ts @@ -1,4 +1,4 @@ -import { File } from "node-fetch-native-with-agent"; +import { File } from "undici"; type FsPromises = { stat: (path: string) => Promise<{ size: number }>; diff --git a/src/models.ts b/src/models.ts index e081344..2c72952 100644 --- a/src/models.ts +++ b/src/models.ts @@ -2925,6 +2925,26 @@ export namespace Models { * Email verification status. */ emailVerification: boolean; + /** + * Canonical form of the user email address. + */ + emailCanonical?: string; + /** + * Whether the user email is from a free email provider. + */ + emailIsFree?: boolean; + /** + * Whether the user email is from a disposable email provider. + */ + emailIsDisposable?: boolean; + /** + * Whether the user email is from a corporate domain. + */ + emailIsCorporate?: boolean; + /** + * Whether the user email is in its canonical form. + */ + emailIsCanonical?: boolean; /** * Phone verification status. */ @@ -3576,6 +3596,10 @@ export namespace Models { * Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console. */ mfa: boolean; + /** + * Most recent access date in ISO 8601 format. Show this attribute by toggling membership privacy in the Console. + */ + userAccessedAt: string; /** * User list of roles */ @@ -4264,6 +4288,10 @@ export namespace Models { * OAuth2 server allowed scopes */ oAuth2ServerScopes: string[]; + /** + * OAuth2 server accepted RFC 9396 authorization_details types + */ + oAuth2ServerAuthorizationDetailsTypes: string[]; /** * OAuth2 server access token duration in seconds for confidential clients */ @@ -4284,6 +4312,22 @@ export namespace Models { * When enabled, PKCE is required for confidential clients (server-side flows using client_secret). PKCE is always required for public clients regardless of this setting. */ oAuth2ServerConfidentialPkce: boolean; + /** + * URL to your application page where users enter the device flow user code. Empty when the Device Authorization Grant is not configured. + */ + oAuth2ServerVerificationUrl: string; + /** + * Number of characters in the device flow user code, excluding the formatting separator. + */ + oAuth2ServerUserCodeLength: number; + /** + * Character set for device flow user codes: `numeric`, `alphabetic`, or `alphanumeric`. + */ + oAuth2ServerUserCodeFormat: string; + /** + * Lifetime in seconds of device flow device codes and user codes. + */ + oAuth2ServerDeviceCodeDuration: number; /** * OAuth2 server discovery URL */ @@ -5662,6 +5706,10 @@ export namespace Models { * Whether user MFA status is visible in memberships. */ userMFA: boolean; + /** + * Whether user last access time is visible in memberships. + */ + userAccessedAt: boolean; } /** diff --git a/src/services/account.ts b/src/services/account.ts index 4519e3f..474bfba 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -27,6 +27,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -111,6 +112,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -182,6 +184,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -242,6 +245,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -348,6 +352,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -408,6 +413,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -464,6 +470,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -518,6 +525,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -571,6 +579,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -636,6 +645,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -700,6 +710,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -864,6 +875,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -920,6 +932,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -988,6 +1001,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1055,6 +1069,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1080,6 +1095,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1104,6 +1120,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1129,6 +1146,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1153,6 +1171,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1179,6 +1198,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1204,6 +1224,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1230,6 +1251,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1255,6 +1277,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1311,6 +1334,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1375,6 +1399,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1442,6 +1467,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1466,6 +1492,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1522,6 +1549,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1589,6 +1617,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1670,6 +1699,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1694,6 +1724,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1744,6 +1775,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1815,6 +1847,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1883,6 +1916,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1951,6 +1985,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2018,6 +2053,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2070,6 +2106,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -2123,6 +2160,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2201,6 +2239,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2281,6 +2320,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2368,6 +2408,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2450,6 +2491,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'text/html', } return this.client.redirect( @@ -2521,6 +2563,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2583,6 +2626,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2646,6 +2690,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2713,6 +2758,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2781,6 +2827,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2806,6 +2853,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2873,6 +2921,7 @@ export class Account { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/activities.ts b/src/services/activities.ts index 0e86ab7..10b8062 100644 --- a/src/services/activities.ts +++ b/src/services/activities.ts @@ -52,6 +52,7 @@ export class Activities { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -106,6 +107,7 @@ export class Activities { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/advisor.ts b/src/services/advisor.ts index 2264c57..c735c29 100644 --- a/src/services/advisor.ts +++ b/src/services/advisor.ts @@ -62,6 +62,7 @@ export class Advisor { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -116,6 +117,7 @@ export class Advisor { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -240,6 +242,7 @@ export class Advisor { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -302,6 +305,7 @@ export class Advisor { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/avatars.ts b/src/services/avatars.ts index 2297c78..0e71d1a 100644 --- a/src/services/avatars.ts +++ b/src/services/avatars.ts @@ -85,6 +85,7 @@ export class Avatars { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'image/png', } return this.client.call( @@ -166,6 +167,7 @@ export class Avatars { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'image/png', } return this.client.call( @@ -226,6 +228,7 @@ export class Avatars { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'image/*', } return this.client.call( @@ -307,6 +310,7 @@ export class Avatars { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'image/png', } return this.client.call( @@ -386,6 +390,7 @@ export class Avatars { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'image/*', } return this.client.call( @@ -471,6 +476,7 @@ export class Avatars { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'image/png', } return this.client.call( @@ -551,6 +557,7 @@ export class Avatars { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'image/png', } return this.client.call( @@ -749,6 +756,7 @@ export class Avatars { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'image/png', } return this.client.call( diff --git a/src/services/backups.ts b/src/services/backups.ts index ea371f1..098db6d 100644 --- a/src/services/backups.ts +++ b/src/services/backups.ts @@ -53,6 +53,7 @@ export class Backups { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -117,6 +118,7 @@ export class Backups { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -169,6 +171,7 @@ export class Backups { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -222,6 +225,7 @@ export class Backups { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -274,6 +278,7 @@ export class Backups { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -382,6 +387,7 @@ export class Backups { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -434,6 +440,7 @@ export class Backups { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -516,6 +523,7 @@ export class Backups { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -569,6 +577,7 @@ export class Backups { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -650,6 +659,7 @@ export class Backups { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -702,6 +712,7 @@ export class Backups { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -754,6 +765,7 @@ export class Backups { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/databases.ts b/src/services/databases.ts index 8f3b589..8107a94 100644 --- a/src/services/databases.ts +++ b/src/services/databases.ts @@ -72,6 +72,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -149,6 +150,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -201,6 +203,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -254,6 +257,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -306,6 +310,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -374,6 +379,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -488,6 +494,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -541,6 +548,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -610,6 +618,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -739,6 +748,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -849,6 +859,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -910,6 +921,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1007,6 +1019,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1144,6 +1157,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1256,6 +1270,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1368,6 +1383,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1466,6 +1482,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1562,6 +1579,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1658,6 +1676,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1754,6 +1773,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1852,6 +1872,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1950,6 +1971,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2058,6 +2080,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2166,6 +2189,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2278,6 +2302,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2390,6 +2415,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2502,6 +2528,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2614,6 +2641,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2712,6 +2740,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2810,6 +2839,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2899,6 +2929,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2992,6 +3023,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3096,6 +3128,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3193,6 +3226,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3297,6 +3331,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3394,6 +3429,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3483,6 +3519,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3576,6 +3613,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3665,6 +3703,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3758,6 +3797,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3870,6 +3910,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3955,6 +3996,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4070,6 +4112,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4175,6 +4218,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4279,6 +4323,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4376,6 +4421,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4474,6 +4520,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4572,6 +4619,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4686,6 +4734,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4790,6 +4839,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4858,6 +4908,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -5016,6 +5067,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -5112,6 +5164,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5191,6 +5244,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5272,6 +5326,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5355,6 +5410,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5431,6 +5487,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5513,6 +5570,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -5603,6 +5661,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5693,6 +5752,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5866,6 +5926,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5963,6 +6024,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -6038,6 +6100,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -6146,6 +6209,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -6214,6 +6278,7 @@ export class Databases { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/functions.ts b/src/services/functions.ts index 9941b3c..1a0fb93 100644 --- a/src/services/functions.ts +++ b/src/services/functions.ts @@ -74,6 +74,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -284,6 +285,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -308,6 +310,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -332,6 +335,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -384,6 +388,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -588,6 +593,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -705,6 +711,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -779,6 +786,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -878,6 +886,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'multipart/form-data', + 'accept': 'application/json', } return this.client.chunkedUpload( @@ -950,6 +959,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1065,6 +1075,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1150,6 +1161,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1210,6 +1222,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1338,6 +1351,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': '*/*', } return this.client.call( @@ -1400,6 +1414,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1467,6 +1482,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1563,6 +1579,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1623,6 +1640,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1751,6 +1769,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1842,6 +1861,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1902,6 +1922,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1984,6 +2005,7 @@ export class Functions { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/graphql.ts b/src/services/graphql.ts index 1dd39ff..741f45f 100644 --- a/src/services/graphql.ts +++ b/src/services/graphql.ts @@ -57,6 +57,7 @@ export class Graphql { 'X-Appwrite-Project': this.client.config.project, 'x-sdk-graphql': 'true', 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -114,6 +115,7 @@ export class Graphql { 'X-Appwrite-Project': this.client.config.project, 'x-sdk-graphql': 'true', 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/health.ts b/src/services/health.ts index 2100916..6b8ceda 100644 --- a/src/services/health.ts +++ b/src/services/health.ts @@ -25,6 +25,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -49,6 +50,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -74,6 +76,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -98,6 +101,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -150,6 +154,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -212,6 +217,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -236,6 +242,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -260,6 +267,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -314,6 +322,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -366,6 +375,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -418,6 +428,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -478,6 +489,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -530,6 +542,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -592,6 +605,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -644,6 +658,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -696,6 +711,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -748,6 +764,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -800,6 +817,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -852,6 +870,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -904,6 +923,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -956,6 +976,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1008,6 +1029,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1032,6 +1054,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1056,6 +1079,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1080,6 +1104,7 @@ export class Health { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/locale.ts b/src/services/locale.ts index c5abcf9..56b45d2 100644 --- a/src/services/locale.ts +++ b/src/services/locale.ts @@ -26,6 +26,7 @@ export class Locale { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -50,6 +51,7 @@ export class Locale { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -74,6 +76,7 @@ export class Locale { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -98,6 +101,7 @@ export class Locale { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -122,6 +126,7 @@ export class Locale { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -146,6 +151,7 @@ export class Locale { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -170,6 +176,7 @@ export class Locale { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -194,6 +201,7 @@ export class Locale { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/messaging.ts b/src/services/messaging.ts index cddcf90..a1c719a 100644 --- a/src/services/messaging.ts +++ b/src/services/messaging.ts @@ -69,6 +69,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -209,6 +210,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -342,6 +344,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -525,6 +528,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -707,6 +711,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -810,6 +815,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -912,6 +918,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1011,6 +1018,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1109,6 +1117,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1163,6 +1172,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1283,6 +1293,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1350,6 +1361,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1417,6 +1429,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1527,6 +1540,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1636,6 +1650,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1740,6 +1755,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1843,6 +1859,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1925,6 +1942,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2006,6 +2024,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2082,6 +2101,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2157,6 +2177,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2280,6 +2301,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2397,6 +2419,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2492,6 +2515,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2581,6 +2605,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2690,6 +2715,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2793,6 +2819,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2902,6 +2929,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3005,6 +3033,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3128,6 +3157,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3245,6 +3275,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3400,6 +3431,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3554,6 +3586,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3700,6 +3733,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3845,6 +3879,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3940,6 +3975,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4029,6 +4065,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4124,6 +4161,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4213,6 +4251,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4308,6 +4347,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4397,6 +4437,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4492,6 +4533,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4581,6 +4623,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4635,6 +4678,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -4755,6 +4799,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -4822,6 +4867,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -4889,6 +4935,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -4963,6 +5010,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5017,6 +5065,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -5087,6 +5136,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5207,6 +5257,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -5281,6 +5332,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -5355,6 +5407,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5417,6 +5470,7 @@ export class Messaging { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/organization.ts b/src/services/organization.ts index a3b4545..c28cc7b 100644 --- a/src/services/organization.ts +++ b/src/services/organization.ts @@ -62,6 +62,7 @@ export class Organization { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -146,6 +147,7 @@ export class Organization { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -198,6 +200,7 @@ export class Organization { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -279,6 +282,7 @@ export class Organization { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -399,6 +403,7 @@ export class Organization { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -473,6 +478,7 @@ export class Organization { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -589,6 +595,7 @@ export class Organization { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/presences.ts b/src/services/presences.ts index 939aa92..51fb984 100644 --- a/src/services/presences.ts +++ b/src/services/presences.ts @@ -69,6 +69,7 @@ export class Presences { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -123,6 +124,7 @@ export class Presences { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -220,6 +222,7 @@ export class Presences { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -321,6 +324,7 @@ export class Presences { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/project.ts b/src/services/project.ts index decbca9..45207af 100644 --- a/src/services/project.ts +++ b/src/services/project.ts @@ -123,6 +123,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -183,6 +184,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -271,6 +273,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -342,6 +345,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -394,6 +398,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -475,6 +480,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -584,6 +590,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -644,6 +651,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -711,6 +719,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -763,6 +772,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -827,6 +837,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -940,6 +951,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -956,60 +968,80 @@ export class Project { * @param {boolean} params.enabled - Enable or disable the OAuth2 server. * @param {string} params.authorizationUrl - URL to your application with consent screen. * @param {string[]} params.scopes - List of allowed OAuth2 scopes. Maximum of 100 scopes are allowed, each up to 128 characters long. + * @param {string[]} params.authorizationDetailsTypes - List of accepted `authorization_details` types. Maximum of 100 types are allowed, each up to 128 characters long. * @param {number} params.accessTokenDuration - Access token duration in seconds for confidential clients (server-side apps that authenticate with a client secret). Leave empty to use default 8 hours. * @param {number} params.refreshTokenDuration - Refresh token duration in seconds for confidential clients (server-side apps that authenticate with a client secret). Leave empty to use default 1 year. * @param {number} params.publicAccessTokenDuration - Access token duration in seconds for public clients (SPAs, mobile, and native apps that cannot keep a client secret). Leave empty to use default 1 hour. * @param {number} params.publicRefreshTokenDuration - Refresh token duration in seconds for public clients (SPAs, mobile, and native apps that cannot keep a client secret). Leave empty to use default 30 days. * @param {boolean} params.confidentialPkce - When enabled, PKCE is required for confidential clients (server-side flows using client_secret). PKCE is always required for public clients regardless of this setting. + * @param {string} params.verificationUrl - URL to your application page where users enter the device flow user code. Required to enable the Device Authorization Grant. + * @param {number} params.userCodeLength - Number of characters in the device flow user code, excluding the formatting separator. Shorter codes are easier to type but weaker; pair short codes with short expiry. Leave empty to use default 8. + * @param {string} params.userCodeFormat - Character set for device flow user codes: `numeric` (digits only — best for numeric keypads and TV remotes), `alphabetic` (letters only), or `alphanumeric` (letters and digits — highest entropy per character). Defaults to `alphanumeric`. + * @param {number} params.deviceCodeDuration - Lifetime in seconds of device flow device codes and user codes. Device codes are intentionally short-lived. Leave empty to use default 600. * @throws {AppwriteException} * @returns {Promise} */ - updateOAuth2Server(params: { enabled: boolean, authorizationUrl: string, scopes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, confidentialPkce?: boolean }): Promise; + updateOAuth2Server(params: { enabled: boolean, authorizationUrl: string, scopes?: string[], authorizationDetailsTypes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, confidentialPkce?: boolean, verificationUrl?: string, userCodeLength?: number, userCodeFormat?: string, deviceCodeDuration?: number }): Promise; /** * Update the OAuth2 server (OIDC provider) configuration. * * @param {boolean} enabled - Enable or disable the OAuth2 server. * @param {string} authorizationUrl - URL to your application with consent screen. * @param {string[]} scopes - List of allowed OAuth2 scopes. Maximum of 100 scopes are allowed, each up to 128 characters long. + * @param {string[]} authorizationDetailsTypes - List of accepted `authorization_details` types. Maximum of 100 types are allowed, each up to 128 characters long. * @param {number} accessTokenDuration - Access token duration in seconds for confidential clients (server-side apps that authenticate with a client secret). Leave empty to use default 8 hours. * @param {number} refreshTokenDuration - Refresh token duration in seconds for confidential clients (server-side apps that authenticate with a client secret). Leave empty to use default 1 year. * @param {number} publicAccessTokenDuration - Access token duration in seconds for public clients (SPAs, mobile, and native apps that cannot keep a client secret). Leave empty to use default 1 hour. * @param {number} publicRefreshTokenDuration - Refresh token duration in seconds for public clients (SPAs, mobile, and native apps that cannot keep a client secret). Leave empty to use default 30 days. * @param {boolean} confidentialPkce - When enabled, PKCE is required for confidential clients (server-side flows using client_secret). PKCE is always required for public clients regardless of this setting. + * @param {string} verificationUrl - URL to your application page where users enter the device flow user code. Required to enable the Device Authorization Grant. + * @param {number} userCodeLength - Number of characters in the device flow user code, excluding the formatting separator. Shorter codes are easier to type but weaker; pair short codes with short expiry. Leave empty to use default 8. + * @param {string} userCodeFormat - Character set for device flow user codes: `numeric` (digits only — best for numeric keypads and TV remotes), `alphabetic` (letters only), or `alphanumeric` (letters and digits — highest entropy per character). Defaults to `alphanumeric`. + * @param {number} deviceCodeDuration - Lifetime in seconds of device flow device codes and user codes. Device codes are intentionally short-lived. Leave empty to use default 600. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateOAuth2Server(enabled: boolean, authorizationUrl: string, scopes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, confidentialPkce?: boolean): Promise; + updateOAuth2Server(enabled: boolean, authorizationUrl: string, scopes?: string[], authorizationDetailsTypes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, confidentialPkce?: boolean, verificationUrl?: string, userCodeLength?: number, userCodeFormat?: string, deviceCodeDuration?: number): Promise; updateOAuth2Server( - paramsOrFirst: { enabled: boolean, authorizationUrl: string, scopes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, confidentialPkce?: boolean } | boolean, - ...rest: [(string)?, (string[])?, (number)?, (number)?, (number)?, (number)?, (boolean)?] + paramsOrFirst: { enabled: boolean, authorizationUrl: string, scopes?: string[], authorizationDetailsTypes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, confidentialPkce?: boolean, verificationUrl?: string, userCodeLength?: number, userCodeFormat?: string, deviceCodeDuration?: number } | boolean, + ...rest: [(string)?, (string[])?, (string[])?, (number)?, (number)?, (number)?, (number)?, (boolean)?, (string)?, (number)?, (string)?, (number)?] ): Promise { - let params: { enabled: boolean, authorizationUrl: string, scopes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, confidentialPkce?: boolean }; + let params: { enabled: boolean, authorizationUrl: string, scopes?: string[], authorizationDetailsTypes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, confidentialPkce?: boolean, verificationUrl?: string, userCodeLength?: number, userCodeFormat?: string, deviceCodeDuration?: number }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { enabled: boolean, authorizationUrl: string, scopes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, confidentialPkce?: boolean }; + params = (paramsOrFirst || {}) as { enabled: boolean, authorizationUrl: string, scopes?: string[], authorizationDetailsTypes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, confidentialPkce?: boolean, verificationUrl?: string, userCodeLength?: number, userCodeFormat?: string, deviceCodeDuration?: number }; } else { params = { enabled: paramsOrFirst as boolean, authorizationUrl: rest[0] as string, scopes: rest[1] as string[], - accessTokenDuration: rest[2] as number, - refreshTokenDuration: rest[3] as number, - publicAccessTokenDuration: rest[4] as number, - publicRefreshTokenDuration: rest[5] as number, - confidentialPkce: rest[6] as boolean + authorizationDetailsTypes: rest[2] as string[], + accessTokenDuration: rest[3] as number, + refreshTokenDuration: rest[4] as number, + publicAccessTokenDuration: rest[5] as number, + publicRefreshTokenDuration: rest[6] as number, + confidentialPkce: rest[7] as boolean, + verificationUrl: rest[8] as string, + userCodeLength: rest[9] as number, + userCodeFormat: rest[10] as string, + deviceCodeDuration: rest[11] as number }; } const enabled = params.enabled; const authorizationUrl = params.authorizationUrl; const scopes = params.scopes; + const authorizationDetailsTypes = params.authorizationDetailsTypes; const accessTokenDuration = params.accessTokenDuration; const refreshTokenDuration = params.refreshTokenDuration; const publicAccessTokenDuration = params.publicAccessTokenDuration; const publicRefreshTokenDuration = params.publicRefreshTokenDuration; const confidentialPkce = params.confidentialPkce; + const verificationUrl = params.verificationUrl; + const userCodeLength = params.userCodeLength; + const userCodeFormat = params.userCodeFormat; + const deviceCodeDuration = params.deviceCodeDuration; if (typeof enabled === 'undefined') { throw new AppwriteException('Missing required parameter: "enabled"'); @@ -1029,6 +1061,9 @@ export class Project { if (typeof scopes !== 'undefined') { payload['scopes'] = scopes; } + if (typeof authorizationDetailsTypes !== 'undefined') { + payload['authorizationDetailsTypes'] = authorizationDetailsTypes; + } if (typeof accessTokenDuration !== 'undefined') { payload['accessTokenDuration'] = accessTokenDuration; } @@ -1044,11 +1079,24 @@ export class Project { if (typeof confidentialPkce !== 'undefined') { payload['confidentialPkce'] = confidentialPkce; } + if (typeof verificationUrl !== 'undefined') { + payload['verificationUrl'] = verificationUrl; + } + if (typeof userCodeLength !== 'undefined') { + payload['userCodeLength'] = userCodeLength; + } + if (typeof userCodeFormat !== 'undefined') { + payload['userCodeFormat'] = userCodeFormat; + } + if (typeof deviceCodeDuration !== 'undefined') { + payload['deviceCodeDuration'] = deviceCodeDuration; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1117,6 +1165,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1199,6 +1248,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1274,6 +1324,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1349,6 +1400,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1417,6 +1469,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1485,6 +1538,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1553,6 +1607,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1621,6 +1676,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1689,6 +1745,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1757,6 +1814,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1825,6 +1883,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1893,6 +1952,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1961,6 +2021,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2029,6 +2090,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2097,6 +2159,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2172,6 +2235,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2240,6 +2304,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2315,6 +2380,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2390,6 +2456,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2472,6 +2539,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2540,6 +2608,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2608,6 +2677,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2683,6 +2753,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2751,6 +2822,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2847,6 +2919,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2929,6 +3002,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2997,6 +3071,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3065,6 +3140,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3133,6 +3209,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3201,6 +3278,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3269,6 +3347,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3337,6 +3416,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3405,6 +3485,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3473,6 +3554,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3541,6 +3623,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3609,6 +3692,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3677,6 +3761,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3745,6 +3830,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3813,6 +3899,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3881,6 +3968,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3949,6 +4037,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4017,6 +4106,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4069,6 +4159,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -4129,6 +4220,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -4206,6 +4298,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4280,6 +4373,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4357,6 +4451,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4431,6 +4526,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4508,6 +4604,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4582,6 +4679,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4659,6 +4757,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4733,6 +4832,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4810,6 +4910,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4884,6 +4985,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4936,6 +5038,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -5049,6 +5152,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -5105,6 +5209,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5161,6 +5266,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5217,6 +5323,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5235,10 +5342,11 @@ export class Project { * @param {boolean} params.userPhone - Set to true if you want make user phone number visible to all team members, or false to hide it. * @param {boolean} params.userName - Set to true if you want make user name visible to all team members, or false to hide it. * @param {boolean} params.userMFA - Set to true if you want make user MFA status visible to all team members, or false to hide it. + * @param {boolean} params.userAccessedAt - Set to true if you want make user last access time visible to all team members, or false to hide it. * @throws {AppwriteException} * @returns {Promise} */ - updateMembershipPrivacyPolicy(params?: { userId?: boolean, userEmail?: boolean, userPhone?: boolean, userName?: boolean, userMFA?: boolean }): Promise; + updateMembershipPrivacyPolicy(params?: { userId?: boolean, userEmail?: boolean, userPhone?: boolean, userName?: boolean, userMFA?: boolean, userAccessedAt?: boolean }): Promise; /** * Updating this policy allows you to control if team members can see other members information. When enabled, all team members can see ID, name, email, phone number, and MFA status of other members.. * @@ -5247,26 +5355,28 @@ export class Project { * @param {boolean} userPhone - Set to true if you want make user phone number visible to all team members, or false to hide it. * @param {boolean} userName - Set to true if you want make user name visible to all team members, or false to hide it. * @param {boolean} userMFA - Set to true if you want make user MFA status visible to all team members, or false to hide it. + * @param {boolean} userAccessedAt - Set to true if you want make user last access time visible to all team members, or false to hide it. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateMembershipPrivacyPolicy(userId?: boolean, userEmail?: boolean, userPhone?: boolean, userName?: boolean, userMFA?: boolean): Promise; + updateMembershipPrivacyPolicy(userId?: boolean, userEmail?: boolean, userPhone?: boolean, userName?: boolean, userMFA?: boolean, userAccessedAt?: boolean): Promise; updateMembershipPrivacyPolicy( - paramsOrFirst?: { userId?: boolean, userEmail?: boolean, userPhone?: boolean, userName?: boolean, userMFA?: boolean } | boolean, - ...rest: [(boolean)?, (boolean)?, (boolean)?, (boolean)?] + paramsOrFirst?: { userId?: boolean, userEmail?: boolean, userPhone?: boolean, userName?: boolean, userMFA?: boolean, userAccessedAt?: boolean } | boolean, + ...rest: [(boolean)?, (boolean)?, (boolean)?, (boolean)?, (boolean)?] ): Promise { - let params: { userId?: boolean, userEmail?: boolean, userPhone?: boolean, userName?: boolean, userMFA?: boolean }; + let params: { userId?: boolean, userEmail?: boolean, userPhone?: boolean, userName?: boolean, userMFA?: boolean, userAccessedAt?: boolean }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { userId?: boolean, userEmail?: boolean, userPhone?: boolean, userName?: boolean, userMFA?: boolean }; + params = (paramsOrFirst || {}) as { userId?: boolean, userEmail?: boolean, userPhone?: boolean, userName?: boolean, userMFA?: boolean, userAccessedAt?: boolean }; } else { params = { userId: paramsOrFirst as boolean, userEmail: rest[0] as boolean, userPhone: rest[1] as boolean, userName: rest[2] as boolean, - userMFA: rest[3] as boolean + userMFA: rest[3] as boolean, + userAccessedAt: rest[4] as boolean }; } @@ -5275,6 +5385,7 @@ export class Project { const userPhone = params.userPhone; const userName = params.userName; const userMFA = params.userMFA; + const userAccessedAt = params.userAccessedAt; const apiPath = '/project/policies/membership-privacy'; @@ -5294,11 +5405,15 @@ export class Project { if (typeof userMFA !== 'undefined') { payload['userMFA'] = userMFA; } + if (typeof userAccessedAt !== 'undefined') { + payload['userAccessedAt'] = userAccessedAt; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5355,6 +5470,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5415,6 +5531,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5471,6 +5588,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5553,6 +5671,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5609,6 +5728,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5665,6 +5785,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5721,6 +5842,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5777,6 +5899,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5833,6 +5956,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5885,6 +6009,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -5949,6 +6074,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -6013,6 +6139,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -6130,6 +6257,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -6246,6 +6374,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -6352,6 +6481,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -6412,6 +6542,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -6472,6 +6603,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -6556,6 +6688,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -6608,6 +6741,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -6683,6 +6817,7 @@ export class Project { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/proxy.ts b/src/services/proxy.ts index b5a90b5..b2c53fa 100644 --- a/src/services/proxy.ts +++ b/src/services/proxy.ts @@ -62,6 +62,7 @@ export class Proxy { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -122,6 +123,7 @@ export class Proxy { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -200,6 +202,7 @@ export class Proxy { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -301,6 +304,7 @@ export class Proxy { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -379,6 +383,7 @@ export class Proxy { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -431,6 +436,7 @@ export class Proxy { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -537,6 +543,7 @@ export class Proxy { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/sites.ts b/src/services/sites.ts index 6d6cdce..0de414a 100644 --- a/src/services/sites.ts +++ b/src/services/sites.ts @@ -74,6 +74,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -294,6 +295,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -318,6 +320,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -342,6 +345,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -394,6 +398,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -608,6 +613,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -725,6 +731,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -799,6 +806,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -894,6 +902,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'multipart/form-data', + 'accept': 'application/json', } return this.client.chunkedUpload( @@ -959,6 +968,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1074,6 +1084,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1159,6 +1170,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1219,6 +1231,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1347,6 +1360,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': '*/*', } return this.client.call( @@ -1409,6 +1423,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1476,6 +1491,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1536,6 +1552,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1597,6 +1614,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1664,6 +1682,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1755,6 +1774,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1815,6 +1835,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1897,6 +1918,7 @@ export class Sites { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/storage.ts b/src/services/storage.ts index e9b4d62..f4ae7a0 100644 --- a/src/services/storage.ts +++ b/src/services/storage.ts @@ -71,6 +71,7 @@ export class Storage { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -201,6 +202,7 @@ export class Storage { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -253,6 +255,7 @@ export class Storage { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -380,6 +383,7 @@ export class Storage { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -507,6 +511,7 @@ export class Storage { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -605,6 +610,7 @@ export class Storage { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'multipart/form-data', + 'accept': 'application/json', } return this.client.chunkedUpload( @@ -666,6 +672,7 @@ export class Storage { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -741,6 +748,7 @@ export class Storage { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -869,6 +877,7 @@ export class Storage { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': '*/*', } return this.client.call( @@ -1014,6 +1023,7 @@ export class Storage { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'image/*', } return this.client.call( @@ -1082,6 +1092,7 @@ export class Storage { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': '*/*', } return this.client.call( diff --git a/src/services/tables-db.ts b/src/services/tables-db.ts index 811cd77..aa4248f 100644 --- a/src/services/tables-db.ts +++ b/src/services/tables-db.ts @@ -71,6 +71,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -147,6 +148,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -199,6 +201,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -252,6 +255,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -304,6 +308,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -372,6 +377,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -486,6 +492,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -538,6 +545,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -606,6 +614,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -733,6 +742,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -842,6 +852,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -902,6 +913,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -998,6 +1010,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1133,6 +1146,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1244,6 +1258,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1355,6 +1370,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1452,6 +1468,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1547,6 +1564,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1642,6 +1660,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1737,6 +1756,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1834,6 +1854,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1931,6 +1952,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2036,6 +2058,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2143,6 +2166,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2254,6 +2278,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2365,6 +2390,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2476,6 +2502,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2587,6 +2614,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2684,6 +2712,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2781,6 +2810,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2869,6 +2899,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2961,6 +2992,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3065,6 +3097,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3162,6 +3195,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3266,6 +3300,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3363,6 +3398,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3451,6 +3487,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3543,6 +3580,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3631,6 +3669,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3723,6 +3762,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3834,6 +3874,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3949,6 +3990,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4054,6 +4096,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4158,6 +4201,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4255,6 +4299,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4352,6 +4397,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4449,6 +4495,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4563,6 +4610,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4667,6 +4715,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4734,6 +4783,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -4886,6 +4936,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -4960,6 +5011,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -5067,6 +5119,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5134,6 +5187,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -5290,6 +5344,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -5385,6 +5440,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5463,6 +5519,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5543,6 +5600,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5625,6 +5683,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5700,6 +5759,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5781,6 +5841,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -5870,6 +5931,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -5959,6 +6021,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -6130,6 +6193,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -6226,6 +6290,7 @@ export class TablesDB { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/teams.ts b/src/services/teams.ts index 9c298cb..3a77c58 100644 --- a/src/services/teams.ts +++ b/src/services/teams.ts @@ -67,6 +67,7 @@ export class Teams { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -141,6 +142,7 @@ export class Teams { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -193,6 +195,7 @@ export class Teams { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -257,6 +260,7 @@ export class Teams { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -384,6 +388,7 @@ export class Teams { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -497,6 +502,7 @@ export class Teams { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -557,6 +563,7 @@ export class Teams { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -630,6 +637,7 @@ export class Teams { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -778,6 +786,7 @@ export class Teams { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -830,6 +839,7 @@ export class Teams { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -894,6 +904,7 @@ export class Teams { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/tokens.ts b/src/services/tokens.ts index 368d4a1..18b0fed 100644 --- a/src/services/tokens.ts +++ b/src/services/tokens.ts @@ -74,6 +74,7 @@ export class Tokens { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -142,6 +143,7 @@ export class Tokens { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -194,6 +196,7 @@ export class Tokens { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -255,6 +258,7 @@ export class Tokens { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/usage.ts b/src/services/usage.ts index 43499c7..f7d485e 100644 --- a/src/services/usage.ts +++ b/src/services/usage.ts @@ -60,6 +60,7 @@ export class Usage { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -120,6 +121,7 @@ export class Usage { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/users.ts b/src/services/users.ts index 61f85f9..44a107a 100644 --- a/src/services/users.ts +++ b/src/services/users.ts @@ -70,6 +70,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -155,6 +156,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -239,6 +241,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -323,6 +326,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -390,6 +394,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -527,6 +532,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -611,6 +617,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -745,6 +752,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -859,6 +867,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -950,6 +959,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1002,6 +1012,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1119,6 +1130,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1185,6 +1197,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1253,6 +1266,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1321,6 +1335,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1388,6 +1403,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1462,6 +1478,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1527,6 +1544,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1591,6 +1609,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -1767,6 +1786,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1819,6 +1839,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1872,6 +1893,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1924,6 +1946,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -1978,6 +2001,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2031,6 +2055,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2085,6 +2110,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2138,6 +2164,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2202,6 +2229,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2266,6 +2294,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2330,6 +2359,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2382,6 +2412,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -2446,6 +2477,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2506,6 +2538,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -2563,6 +2596,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2741,6 +2775,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2808,6 +2843,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -2906,6 +2942,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -2966,6 +3003,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -3048,6 +3086,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3179,6 +3218,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3243,6 +3283,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -3307,6 +3348,7 @@ export class Users { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( diff --git a/src/services/webhooks.ts b/src/services/webhooks.ts index f73792e..cf096f8 100644 --- a/src/services/webhooks.ts +++ b/src/services/webhooks.ts @@ -60,6 +60,7 @@ export class Webhooks { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -182,6 +183,7 @@ export class Webhooks { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -234,6 +236,7 @@ export class Webhooks { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', } return this.client.call( @@ -346,6 +349,7 @@ export class Webhooks { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( @@ -460,6 +464,7 @@ export class Webhooks { const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'application/json', + 'accept': 'application/json', } return this.client.call( diff --git a/test/client.test.js b/test/client.test.js new file mode 100644 index 0000000..0e10914 --- /dev/null +++ b/test/client.test.js @@ -0,0 +1,34 @@ +const { Client } = require("../dist/client"); +const { fetch: mockedFetch, Response, Dispatcher } = require("undici"); + +jest.mock("undici", () => ({ ...jest.requireActual("undici"), fetch: jest.fn() })); + +describe("Client", () => { + beforeEach(() => { + mockedFetch.mockReset(); + mockedFetch.mockImplementation(() => Response.json({ ok: true })); + }); + + test("does not include a dispatcher by default", async () => { + const client = new Client(); + + await client.call("GET", new URL("https://cloud.appwrite.io/v1/health")); + + expect(mockedFetch).toHaveBeenCalledTimes(1); + expect(mockedFetch.mock.calls[0][1]).not.toHaveProperty("dispatcher"); + }); + + test("includes a dispatcher for self-signed requests", async () => { + const client = new Client(); + client.setSelfSigned(true); + + try { + await client.call("GET", new URL("https://self-hosted.example/v1/health")); + + expect(mockedFetch).toHaveBeenCalledTimes(1); + expect(mockedFetch.mock.calls[0][1].dispatcher).toBeInstanceOf(Dispatcher); + } finally { + client.setSelfSigned(false); + } + }); +}); diff --git a/test/services/account.test.js b/test/services/account.test.js index a9bbd59..f13cbde 100644 --- a/test/services/account.test.js +++ b/test/services/account.test.js @@ -2,8 +2,8 @@ const { Client } = require("../../dist/client"); const { InputFile } = require("../../dist/inputFile"); const { Account } = require("../../dist/services/account"); -const { fetch: mockedFetch, Response } = require("node-fetch-native-with-agent"); -jest.mock('node-fetch-native-with-agent', () => ({ ...jest.requireActual('node-fetch-native-with-agent'), fetch: jest.fn() })); +const { fetch: mockedFetch, Response } = require("undici"); +jest.mock('undici', () => ({ ...jest.requireActual('undici'), fetch: jest.fn() })); describe('Account', () => { const client = new Client(); diff --git a/test/services/activities.test.js b/test/services/activities.test.js index 08d0d90..e7c258a 100644 --- a/test/services/activities.test.js +++ b/test/services/activities.test.js @@ -2,8 +2,8 @@ const { Client } = require("../../dist/client"); const { InputFile } = require("../../dist/inputFile"); const { Activities } = require("../../dist/services/activities"); -const { fetch: mockedFetch, Response } = require("node-fetch-native-with-agent"); -jest.mock('node-fetch-native-with-agent', () => ({ ...jest.requireActual('node-fetch-native-with-agent'), fetch: jest.fn() })); +const { fetch: mockedFetch, Response } = require("undici"); +jest.mock('undici', () => ({ ...jest.requireActual('undici'), fetch: jest.fn() })); describe('Activities', () => { const client = new Client(); diff --git a/test/services/advisor.test.js b/test/services/advisor.test.js index 5160f13..401e34a 100644 --- a/test/services/advisor.test.js +++ b/test/services/advisor.test.js @@ -2,8 +2,8 @@ const { Client } = require("../../dist/client"); const { InputFile } = require("../../dist/inputFile"); const { Advisor } = require("../../dist/services/advisor"); -const { fetch: mockedFetch, Response } = require("node-fetch-native-with-agent"); -jest.mock('node-fetch-native-with-agent', () => ({ ...jest.requireActual('node-fetch-native-with-agent'), fetch: jest.fn() })); +const { fetch: mockedFetch, Response } = require("undici"); +jest.mock('undici', () => ({ ...jest.requireActual('undici'), fetch: jest.fn() })); describe('Advisor', () => { const client = new Client(); diff --git a/test/services/avatars.test.js b/test/services/avatars.test.js index ea4f379..56da275 100644 --- a/test/services/avatars.test.js +++ b/test/services/avatars.test.js @@ -2,8 +2,8 @@ const { Client } = require("../../dist/client"); const { InputFile } = require("../../dist/inputFile"); const { Avatars } = require("../../dist/services/avatars"); -const { fetch: mockedFetch, Response } = require("node-fetch-native-with-agent"); -jest.mock('node-fetch-native-with-agent', () => ({ ...jest.requireActual('node-fetch-native-with-agent'), fetch: jest.fn() })); +const { fetch: mockedFetch, Response } = require("undici"); +jest.mock('undici', () => ({ ...jest.requireActual('undici'), fetch: jest.fn() })); describe('Avatars', () => { const client = new Client(); diff --git a/test/services/backups.test.js b/test/services/backups.test.js index c888402..a5e5599 100644 --- a/test/services/backups.test.js +++ b/test/services/backups.test.js @@ -2,8 +2,8 @@ const { Client } = require("../../dist/client"); const { InputFile } = require("../../dist/inputFile"); const { Backups } = require("../../dist/services/backups"); -const { fetch: mockedFetch, Response } = require("node-fetch-native-with-agent"); -jest.mock('node-fetch-native-with-agent', () => ({ ...jest.requireActual('node-fetch-native-with-agent'), fetch: jest.fn() })); +const { fetch: mockedFetch, Response } = require("undici"); +jest.mock('undici', () => ({ ...jest.requireActual('undici'), fetch: jest.fn() })); describe('Backups', () => { const client = new Client(); diff --git a/test/services/databases.test.js b/test/services/databases.test.js index 241f44f..2b20a4f 100644 --- a/test/services/databases.test.js +++ b/test/services/databases.test.js @@ -2,8 +2,8 @@ const { Client } = require("../../dist/client"); const { InputFile } = require("../../dist/inputFile"); const { Databases } = require("../../dist/services/databases"); -const { fetch: mockedFetch, Response } = require("node-fetch-native-with-agent"); -jest.mock('node-fetch-native-with-agent', () => ({ ...jest.requireActual('node-fetch-native-with-agent'), fetch: jest.fn() })); +const { fetch: mockedFetch, Response } = require("undici"); +jest.mock('undici', () => ({ ...jest.requireActual('undici'), fetch: jest.fn() })); describe('Databases', () => { const client = new Client(); diff --git a/test/services/functions.test.js b/test/services/functions.test.js index 02dd3d2..e805931 100644 --- a/test/services/functions.test.js +++ b/test/services/functions.test.js @@ -2,8 +2,8 @@ const { Client } = require("../../dist/client"); const { InputFile } = require("../../dist/inputFile"); const { Functions } = require("../../dist/services/functions"); -const { fetch: mockedFetch, Response } = require("node-fetch-native-with-agent"); -jest.mock('node-fetch-native-with-agent', () => ({ ...jest.requireActual('node-fetch-native-with-agent'), fetch: jest.fn() })); +const { fetch: mockedFetch, Response } = require("undici"); +jest.mock('undici', () => ({ ...jest.requireActual('undici'), fetch: jest.fn() })); describe('Functions', () => { const client = new Client(); diff --git a/test/services/graphql.test.js b/test/services/graphql.test.js index da7e49b..6f2577d 100644 --- a/test/services/graphql.test.js +++ b/test/services/graphql.test.js @@ -2,8 +2,8 @@ const { Client } = require("../../dist/client"); const { InputFile } = require("../../dist/inputFile"); const { Graphql } = require("../../dist/services/graphql"); -const { fetch: mockedFetch, Response } = require("node-fetch-native-with-agent"); -jest.mock('node-fetch-native-with-agent', () => ({ ...jest.requireActual('node-fetch-native-with-agent'), fetch: jest.fn() })); +const { fetch: mockedFetch, Response } = require("undici"); +jest.mock('undici', () => ({ ...jest.requireActual('undici'), fetch: jest.fn() })); describe('Graphql', () => { const client = new Client(); diff --git a/test/services/health.test.js b/test/services/health.test.js index afbf5fa..3e306fe 100644 --- a/test/services/health.test.js +++ b/test/services/health.test.js @@ -2,8 +2,8 @@ const { Client } = require("../../dist/client"); const { InputFile } = require("../../dist/inputFile"); const { Health } = require("../../dist/services/health"); -const { fetch: mockedFetch, Response } = require("node-fetch-native-with-agent"); -jest.mock('node-fetch-native-with-agent', () => ({ ...jest.requireActual('node-fetch-native-with-agent'), fetch: jest.fn() })); +const { fetch: mockedFetch, Response } = require("undici"); +jest.mock('undici', () => ({ ...jest.requireActual('undici'), fetch: jest.fn() })); describe('Health', () => { const client = new Client(); diff --git a/test/services/locale.test.js b/test/services/locale.test.js index 51ef111..675b715 100644 --- a/test/services/locale.test.js +++ b/test/services/locale.test.js @@ -2,8 +2,8 @@ const { Client } = require("../../dist/client"); const { InputFile } = require("../../dist/inputFile"); const { Locale } = require("../../dist/services/locale"); -const { fetch: mockedFetch, Response } = require("node-fetch-native-with-agent"); -jest.mock('node-fetch-native-with-agent', () => ({ ...jest.requireActual('node-fetch-native-with-agent'), fetch: jest.fn() })); +const { fetch: mockedFetch, Response } = require("undici"); +jest.mock('undici', () => ({ ...jest.requireActual('undici'), fetch: jest.fn() })); describe('Locale', () => { const client = new Client(); diff --git a/test/services/messaging.test.js b/test/services/messaging.test.js index 3951633..1a08800 100644 --- a/test/services/messaging.test.js +++ b/test/services/messaging.test.js @@ -2,8 +2,8 @@ const { Client } = require("../../dist/client"); const { InputFile } = require("../../dist/inputFile"); const { Messaging } = require("../../dist/services/messaging"); -const { fetch: mockedFetch, Response } = require("node-fetch-native-with-agent"); -jest.mock('node-fetch-native-with-agent', () => ({ ...jest.requireActual('node-fetch-native-with-agent'), fetch: jest.fn() })); +const { fetch: mockedFetch, Response } = require("undici"); +jest.mock('undici', () => ({ ...jest.requireActual('undici'), fetch: jest.fn() })); describe('Messaging', () => { const client = new Client(); diff --git a/test/services/organization.test.js b/test/services/organization.test.js index f5bf2d2..a2a6a29 100644 --- a/test/services/organization.test.js +++ b/test/services/organization.test.js @@ -2,8 +2,8 @@ const { Client } = require("../../dist/client"); const { InputFile } = require("../../dist/inputFile"); const { Organization } = require("../../dist/services/organization"); -const { fetch: mockedFetch, Response } = require("node-fetch-native-with-agent"); -jest.mock('node-fetch-native-with-agent', () => ({ ...jest.requireActual('node-fetch-native-with-agent'), fetch: jest.fn() })); +const { fetch: mockedFetch, Response } = require("undici"); +jest.mock('undici', () => ({ ...jest.requireActual('undici'), fetch: jest.fn() })); describe('Organization', () => { const client = new Client(); @@ -158,11 +158,16 @@ describe('Organization', () => { 'oAuth2ServerEnabled': true, 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', 'oAuth2ServerScopes': [], + 'oAuth2ServerAuthorizationDetailsTypes': [], 'oAuth2ServerAccessTokenDuration': 3600, 'oAuth2ServerRefreshTokenDuration': 86400, 'oAuth2ServerPublicAccessTokenDuration': 3600, 'oAuth2ServerPublicRefreshTokenDuration': 2592000, 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', + 'oAuth2ServerUserCodeLength': 8, + 'oAuth2ServerUserCodeFormat': 'alphanumeric', + 'oAuth2ServerDeviceCodeDuration': 600, 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -208,11 +213,16 @@ describe('Organization', () => { 'oAuth2ServerEnabled': true, 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', 'oAuth2ServerScopes': [], + 'oAuth2ServerAuthorizationDetailsTypes': [], 'oAuth2ServerAccessTokenDuration': 3600, 'oAuth2ServerRefreshTokenDuration': 86400, 'oAuth2ServerPublicAccessTokenDuration': 3600, 'oAuth2ServerPublicRefreshTokenDuration': 2592000, 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', + 'oAuth2ServerUserCodeLength': 8, + 'oAuth2ServerUserCodeFormat': 'alphanumeric', + 'oAuth2ServerDeviceCodeDuration': 600, 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -257,11 +267,16 @@ describe('Organization', () => { 'oAuth2ServerEnabled': true, 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', 'oAuth2ServerScopes': [], + 'oAuth2ServerAuthorizationDetailsTypes': [], 'oAuth2ServerAccessTokenDuration': 3600, 'oAuth2ServerRefreshTokenDuration': 86400, 'oAuth2ServerPublicAccessTokenDuration': 3600, 'oAuth2ServerPublicRefreshTokenDuration': 2592000, 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', + 'oAuth2ServerUserCodeLength': 8, + 'oAuth2ServerUserCodeFormat': 'alphanumeric', + 'oAuth2ServerDeviceCodeDuration': 600, 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); diff --git a/test/services/presences.test.js b/test/services/presences.test.js index e6e25bb..5f570cc 100644 --- a/test/services/presences.test.js +++ b/test/services/presences.test.js @@ -2,8 +2,8 @@ const { Client } = require("../../dist/client"); const { InputFile } = require("../../dist/inputFile"); const { Presences } = require("../../dist/services/presences"); -const { fetch: mockedFetch, Response } = require("node-fetch-native-with-agent"); -jest.mock('node-fetch-native-with-agent', () => ({ ...jest.requireActual('node-fetch-native-with-agent'), fetch: jest.fn() })); +const { fetch: mockedFetch, Response } = require("undici"); +jest.mock('undici', () => ({ ...jest.requireActual('undici'), fetch: jest.fn() })); describe('Presences', () => { const client = new Client(); diff --git a/test/services/project.test.js b/test/services/project.test.js index 6d825d4..d644e0d 100644 --- a/test/services/project.test.js +++ b/test/services/project.test.js @@ -2,8 +2,8 @@ const { Client } = require("../../dist/client"); const { InputFile } = require("../../dist/inputFile"); const { Project } = require("../../dist/services/project"); -const { fetch: mockedFetch, Response } = require("node-fetch-native-with-agent"); -jest.mock('node-fetch-native-with-agent', () => ({ ...jest.requireActual('node-fetch-native-with-agent'), fetch: jest.fn() })); +const { fetch: mockedFetch, Response } = require("undici"); +jest.mock('undici', () => ({ ...jest.requireActual('undici'), fetch: jest.fn() })); describe('Project', () => { const client = new Client(); @@ -41,11 +41,16 @@ describe('Project', () => { 'oAuth2ServerEnabled': true, 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', 'oAuth2ServerScopes': [], + 'oAuth2ServerAuthorizationDetailsTypes': [], 'oAuth2ServerAccessTokenDuration': 3600, 'oAuth2ServerRefreshTokenDuration': 86400, 'oAuth2ServerPublicAccessTokenDuration': 3600, 'oAuth2ServerPublicRefreshTokenDuration': 2592000, 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', + 'oAuth2ServerUserCodeLength': 8, + 'oAuth2ServerUserCodeFormat': 'alphanumeric', + 'oAuth2ServerDeviceCodeDuration': 600, 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -102,11 +107,16 @@ describe('Project', () => { 'oAuth2ServerEnabled': true, 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', 'oAuth2ServerScopes': [], + 'oAuth2ServerAuthorizationDetailsTypes': [], 'oAuth2ServerAccessTokenDuration': 3600, 'oAuth2ServerRefreshTokenDuration': 86400, 'oAuth2ServerPublicAccessTokenDuration': 3600, 'oAuth2ServerPublicRefreshTokenDuration': 2592000, 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', + 'oAuth2ServerUserCodeLength': 8, + 'oAuth2ServerUserCodeFormat': 'alphanumeric', + 'oAuth2ServerDeviceCodeDuration': 600, 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -278,11 +288,16 @@ describe('Project', () => { 'oAuth2ServerEnabled': true, 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', 'oAuth2ServerScopes': [], + 'oAuth2ServerAuthorizationDetailsTypes': [], 'oAuth2ServerAccessTokenDuration': 3600, 'oAuth2ServerRefreshTokenDuration': 86400, 'oAuth2ServerPublicAccessTokenDuration': 3600, 'oAuth2ServerPublicRefreshTokenDuration': 2592000, 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', + 'oAuth2ServerUserCodeLength': 8, + 'oAuth2ServerUserCodeFormat': 'alphanumeric', + 'oAuth2ServerDeviceCodeDuration': 600, 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -427,11 +442,16 @@ describe('Project', () => { 'oAuth2ServerEnabled': true, 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', 'oAuth2ServerScopes': [], + 'oAuth2ServerAuthorizationDetailsTypes': [], 'oAuth2ServerAccessTokenDuration': 3600, 'oAuth2ServerRefreshTokenDuration': 86400, 'oAuth2ServerPublicAccessTokenDuration': 3600, 'oAuth2ServerPublicRefreshTokenDuration': 2592000, 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', + 'oAuth2ServerUserCodeLength': 8, + 'oAuth2ServerUserCodeFormat': 'alphanumeric', + 'oAuth2ServerDeviceCodeDuration': 600, 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -1510,11 +1530,16 @@ describe('Project', () => { 'oAuth2ServerEnabled': true, 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', 'oAuth2ServerScopes': [], + 'oAuth2ServerAuthorizationDetailsTypes': [], 'oAuth2ServerAccessTokenDuration': 3600, 'oAuth2ServerRefreshTokenDuration': 86400, 'oAuth2ServerPublicAccessTokenDuration': 3600, 'oAuth2ServerPublicRefreshTokenDuration': 2592000, 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', + 'oAuth2ServerUserCodeLength': 8, + 'oAuth2ServerUserCodeFormat': 'alphanumeric', + 'oAuth2ServerDeviceCodeDuration': 600, 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -1559,11 +1584,16 @@ describe('Project', () => { 'oAuth2ServerEnabled': true, 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', 'oAuth2ServerScopes': [], + 'oAuth2ServerAuthorizationDetailsTypes': [], 'oAuth2ServerAccessTokenDuration': 3600, 'oAuth2ServerRefreshTokenDuration': 86400, 'oAuth2ServerPublicAccessTokenDuration': 3600, 'oAuth2ServerPublicRefreshTokenDuration': 2592000, 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', + 'oAuth2ServerUserCodeLength': 8, + 'oAuth2ServerUserCodeFormat': 'alphanumeric', + 'oAuth2ServerDeviceCodeDuration': 600, 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -1608,11 +1638,16 @@ describe('Project', () => { 'oAuth2ServerEnabled': true, 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', 'oAuth2ServerScopes': [], + 'oAuth2ServerAuthorizationDetailsTypes': [], 'oAuth2ServerAccessTokenDuration': 3600, 'oAuth2ServerRefreshTokenDuration': 86400, 'oAuth2ServerPublicAccessTokenDuration': 3600, 'oAuth2ServerPublicRefreshTokenDuration': 2592000, 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', + 'oAuth2ServerUserCodeLength': 8, + 'oAuth2ServerUserCodeFormat': 'alphanumeric', + 'oAuth2ServerDeviceCodeDuration': 600, 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -1657,11 +1692,16 @@ describe('Project', () => { 'oAuth2ServerEnabled': true, 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', 'oAuth2ServerScopes': [], + 'oAuth2ServerAuthorizationDetailsTypes': [], 'oAuth2ServerAccessTokenDuration': 3600, 'oAuth2ServerRefreshTokenDuration': 86400, 'oAuth2ServerPublicAccessTokenDuration': 3600, 'oAuth2ServerPublicRefreshTokenDuration': 2592000, 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', + 'oAuth2ServerUserCodeLength': 8, + 'oAuth2ServerUserCodeFormat': 'alphanumeric', + 'oAuth2ServerDeviceCodeDuration': 600, 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -1705,11 +1745,16 @@ describe('Project', () => { 'oAuth2ServerEnabled': true, 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', 'oAuth2ServerScopes': [], + 'oAuth2ServerAuthorizationDetailsTypes': [], 'oAuth2ServerAccessTokenDuration': 3600, 'oAuth2ServerRefreshTokenDuration': 86400, 'oAuth2ServerPublicAccessTokenDuration': 3600, 'oAuth2ServerPublicRefreshTokenDuration': 2592000, 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', + 'oAuth2ServerUserCodeLength': 8, + 'oAuth2ServerUserCodeFormat': 'alphanumeric', + 'oAuth2ServerDeviceCodeDuration': 600, 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -1754,11 +1799,16 @@ describe('Project', () => { 'oAuth2ServerEnabled': true, 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', 'oAuth2ServerScopes': [], + 'oAuth2ServerAuthorizationDetailsTypes': [], 'oAuth2ServerAccessTokenDuration': 3600, 'oAuth2ServerRefreshTokenDuration': 86400, 'oAuth2ServerPublicAccessTokenDuration': 3600, 'oAuth2ServerPublicRefreshTokenDuration': 2592000, 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', + 'oAuth2ServerUserCodeLength': 8, + 'oAuth2ServerUserCodeFormat': 'alphanumeric', + 'oAuth2ServerDeviceCodeDuration': 600, 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -1803,11 +1853,16 @@ describe('Project', () => { 'oAuth2ServerEnabled': true, 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', 'oAuth2ServerScopes': [], + 'oAuth2ServerAuthorizationDetailsTypes': [], 'oAuth2ServerAccessTokenDuration': 3600, 'oAuth2ServerRefreshTokenDuration': 86400, 'oAuth2ServerPublicAccessTokenDuration': 3600, 'oAuth2ServerPublicRefreshTokenDuration': 2592000, 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', + 'oAuth2ServerUserCodeLength': 8, + 'oAuth2ServerUserCodeFormat': 'alphanumeric', + 'oAuth2ServerDeviceCodeDuration': 600, 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -1871,11 +1926,16 @@ describe('Project', () => { 'oAuth2ServerEnabled': true, 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', 'oAuth2ServerScopes': [], + 'oAuth2ServerAuthorizationDetailsTypes': [], 'oAuth2ServerAccessTokenDuration': 3600, 'oAuth2ServerRefreshTokenDuration': 86400, 'oAuth2ServerPublicAccessTokenDuration': 3600, 'oAuth2ServerPublicRefreshTokenDuration': 2592000, 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', + 'oAuth2ServerUserCodeLength': 8, + 'oAuth2ServerUserCodeFormat': 'alphanumeric', + 'oAuth2ServerDeviceCodeDuration': 600, 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -1920,11 +1980,16 @@ describe('Project', () => { 'oAuth2ServerEnabled': true, 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', 'oAuth2ServerScopes': [], + 'oAuth2ServerAuthorizationDetailsTypes': [], 'oAuth2ServerAccessTokenDuration': 3600, 'oAuth2ServerRefreshTokenDuration': 86400, 'oAuth2ServerPublicAccessTokenDuration': 3600, 'oAuth2ServerPublicRefreshTokenDuration': 2592000, 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', + 'oAuth2ServerUserCodeLength': 8, + 'oAuth2ServerUserCodeFormat': 'alphanumeric', + 'oAuth2ServerDeviceCodeDuration': 600, 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -1969,11 +2034,16 @@ describe('Project', () => { 'oAuth2ServerEnabled': true, 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', 'oAuth2ServerScopes': [], + 'oAuth2ServerAuthorizationDetailsTypes': [], 'oAuth2ServerAccessTokenDuration': 3600, 'oAuth2ServerRefreshTokenDuration': 86400, 'oAuth2ServerPublicAccessTokenDuration': 3600, 'oAuth2ServerPublicRefreshTokenDuration': 2592000, 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', + 'oAuth2ServerUserCodeLength': 8, + 'oAuth2ServerUserCodeFormat': 'alphanumeric', + 'oAuth2ServerDeviceCodeDuration': 600, 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -2018,11 +2088,16 @@ describe('Project', () => { 'oAuth2ServerEnabled': true, 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', 'oAuth2ServerScopes': [], + 'oAuth2ServerAuthorizationDetailsTypes': [], 'oAuth2ServerAccessTokenDuration': 3600, 'oAuth2ServerRefreshTokenDuration': 86400, 'oAuth2ServerPublicAccessTokenDuration': 3600, 'oAuth2ServerPublicRefreshTokenDuration': 2592000, 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', + 'oAuth2ServerUserCodeLength': 8, + 'oAuth2ServerUserCodeFormat': 'alphanumeric', + 'oAuth2ServerDeviceCodeDuration': 600, 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -2067,11 +2142,16 @@ describe('Project', () => { 'oAuth2ServerEnabled': true, 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', 'oAuth2ServerScopes': [], + 'oAuth2ServerAuthorizationDetailsTypes': [], 'oAuth2ServerAccessTokenDuration': 3600, 'oAuth2ServerRefreshTokenDuration': 86400, 'oAuth2ServerPublicAccessTokenDuration': 3600, 'oAuth2ServerPublicRefreshTokenDuration': 2592000, 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', + 'oAuth2ServerUserCodeLength': 8, + 'oAuth2ServerUserCodeFormat': 'alphanumeric', + 'oAuth2ServerDeviceCodeDuration': 600, 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -2132,11 +2212,16 @@ describe('Project', () => { 'oAuth2ServerEnabled': true, 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', 'oAuth2ServerScopes': [], + 'oAuth2ServerAuthorizationDetailsTypes': [], 'oAuth2ServerAccessTokenDuration': 3600, 'oAuth2ServerRefreshTokenDuration': 86400, 'oAuth2ServerPublicAccessTokenDuration': 3600, 'oAuth2ServerPublicRefreshTokenDuration': 2592000, 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', + 'oAuth2ServerUserCodeLength': 8, + 'oAuth2ServerUserCodeFormat': 'alphanumeric', + 'oAuth2ServerDeviceCodeDuration': 600, 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -2182,11 +2267,16 @@ describe('Project', () => { 'oAuth2ServerEnabled': true, 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', 'oAuth2ServerScopes': [], + 'oAuth2ServerAuthorizationDetailsTypes': [], 'oAuth2ServerAccessTokenDuration': 3600, 'oAuth2ServerRefreshTokenDuration': 86400, 'oAuth2ServerPublicAccessTokenDuration': 3600, 'oAuth2ServerPublicRefreshTokenDuration': 2592000, 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', + 'oAuth2ServerUserCodeLength': 8, + 'oAuth2ServerUserCodeFormat': 'alphanumeric', + 'oAuth2ServerDeviceCodeDuration': 600, 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -2232,11 +2322,16 @@ describe('Project', () => { 'oAuth2ServerEnabled': true, 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', 'oAuth2ServerScopes': [], + 'oAuth2ServerAuthorizationDetailsTypes': [], 'oAuth2ServerAccessTokenDuration': 3600, 'oAuth2ServerRefreshTokenDuration': 86400, 'oAuth2ServerPublicAccessTokenDuration': 3600, 'oAuth2ServerPublicRefreshTokenDuration': 2592000, 'oAuth2ServerConfidentialPkce': true, + 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', + 'oAuth2ServerUserCodeLength': 8, + 'oAuth2ServerUserCodeFormat': 'alphanumeric', + 'oAuth2ServerDeviceCodeDuration': 600, 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; mockedFetch.mockImplementation(() => Response.json(data)); diff --git a/test/services/proxy.test.js b/test/services/proxy.test.js index 05a556f..57aa087 100644 --- a/test/services/proxy.test.js +++ b/test/services/proxy.test.js @@ -2,8 +2,8 @@ const { Client } = require("../../dist/client"); const { InputFile } = require("../../dist/inputFile"); const { Proxy } = require("../../dist/services/proxy"); -const { fetch: mockedFetch, Response } = require("node-fetch-native-with-agent"); -jest.mock('node-fetch-native-with-agent', () => ({ ...jest.requireActual('node-fetch-native-with-agent'), fetch: jest.fn() })); +const { fetch: mockedFetch, Response } = require("undici"); +jest.mock('undici', () => ({ ...jest.requireActual('undici'), fetch: jest.fn() })); describe('Proxy', () => { const client = new Client(); diff --git a/test/services/sites.test.js b/test/services/sites.test.js index 64525f1..402a5d5 100644 --- a/test/services/sites.test.js +++ b/test/services/sites.test.js @@ -2,8 +2,8 @@ const { Client } = require("../../dist/client"); const { InputFile } = require("../../dist/inputFile"); const { Sites } = require("../../dist/services/sites"); -const { fetch: mockedFetch, Response } = require("node-fetch-native-with-agent"); -jest.mock('node-fetch-native-with-agent', () => ({ ...jest.requireActual('node-fetch-native-with-agent'), fetch: jest.fn() })); +const { fetch: mockedFetch, Response } = require("undici"); +jest.mock('undici', () => ({ ...jest.requireActual('undici'), fetch: jest.fn() })); describe('Sites', () => { const client = new Client(); diff --git a/test/services/storage.test.js b/test/services/storage.test.js index 5b28529..ce79f08 100644 --- a/test/services/storage.test.js +++ b/test/services/storage.test.js @@ -2,8 +2,8 @@ const { Client } = require("../../dist/client"); const { InputFile } = require("../../dist/inputFile"); const { Storage } = require("../../dist/services/storage"); -const { fetch: mockedFetch, Response } = require("node-fetch-native-with-agent"); -jest.mock('node-fetch-native-with-agent', () => ({ ...jest.requireActual('node-fetch-native-with-agent'), fetch: jest.fn() })); +const { fetch: mockedFetch, Response } = require("undici"); +jest.mock('undici', () => ({ ...jest.requireActual('undici'), fetch: jest.fn() })); describe('Storage', () => { const client = new Client(); diff --git a/test/services/tables-d-b.test.js b/test/services/tables-d-b.test.js index 5c89adc..513c5b7 100644 --- a/test/services/tables-d-b.test.js +++ b/test/services/tables-d-b.test.js @@ -2,8 +2,8 @@ const { Client } = require("../../dist/client"); const { InputFile } = require("../../dist/inputFile"); const { TablesDB } = require("../../dist/services/tables-db"); -const { fetch: mockedFetch, Response } = require("node-fetch-native-with-agent"); -jest.mock('node-fetch-native-with-agent', () => ({ ...jest.requireActual('node-fetch-native-with-agent'), fetch: jest.fn() })); +const { fetch: mockedFetch, Response } = require("undici"); +jest.mock('undici', () => ({ ...jest.requireActual('undici'), fetch: jest.fn() })); describe('TablesDB', () => { const client = new Client(); diff --git a/test/services/teams.test.js b/test/services/teams.test.js index dcb4055..0054c3e 100644 --- a/test/services/teams.test.js +++ b/test/services/teams.test.js @@ -2,8 +2,8 @@ const { Client } = require("../../dist/client"); const { InputFile } = require("../../dist/inputFile"); const { Teams } = require("../../dist/services/teams"); -const { fetch: mockedFetch, Response } = require("node-fetch-native-with-agent"); -jest.mock('node-fetch-native-with-agent', () => ({ ...jest.requireActual('node-fetch-native-with-agent'), fetch: jest.fn() })); +const { fetch: mockedFetch, Response } = require("undici"); +jest.mock('undici', () => ({ ...jest.requireActual('undici'), fetch: jest.fn() })); describe('Teams', () => { const client = new Client(); @@ -132,6 +132,7 @@ describe('Teams', () => { 'joined': '2020-10-15T06:38:00.000+00:00', 'confirm': true, 'mfa': true, + 'userAccessedAt': '2020-10-15T06:38:00.000+00:00', 'roles': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -161,6 +162,7 @@ describe('Teams', () => { 'joined': '2020-10-15T06:38:00.000+00:00', 'confirm': true, 'mfa': true, + 'userAccessedAt': '2020-10-15T06:38:00.000+00:00', 'roles': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -190,6 +192,7 @@ describe('Teams', () => { 'joined': '2020-10-15T06:38:00.000+00:00', 'confirm': true, 'mfa': true, + 'userAccessedAt': '2020-10-15T06:38:00.000+00:00', 'roles': [],}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -235,6 +238,7 @@ describe('Teams', () => { 'joined': '2020-10-15T06:38:00.000+00:00', 'confirm': true, 'mfa': true, + 'userAccessedAt': '2020-10-15T06:38:00.000+00:00', 'roles': [],}; mockedFetch.mockImplementation(() => Response.json(data)); diff --git a/test/services/tokens.test.js b/test/services/tokens.test.js index 000f188..491ddbf 100644 --- a/test/services/tokens.test.js +++ b/test/services/tokens.test.js @@ -2,8 +2,8 @@ const { Client } = require("../../dist/client"); const { InputFile } = require("../../dist/inputFile"); const { Tokens } = require("../../dist/services/tokens"); -const { fetch: mockedFetch, Response } = require("node-fetch-native-with-agent"); -jest.mock('node-fetch-native-with-agent', () => ({ ...jest.requireActual('node-fetch-native-with-agent'), fetch: jest.fn() })); +const { fetch: mockedFetch, Response } = require("undici"); +jest.mock('undici', () => ({ ...jest.requireActual('undici'), fetch: jest.fn() })); describe('Tokens', () => { const client = new Client(); diff --git a/test/services/usage.test.js b/test/services/usage.test.js index 0d0428f..44efb8e 100644 --- a/test/services/usage.test.js +++ b/test/services/usage.test.js @@ -2,8 +2,8 @@ const { Client } = require("../../dist/client"); const { InputFile } = require("../../dist/inputFile"); const { Usage } = require("../../dist/services/usage"); -const { fetch: mockedFetch, Response } = require("node-fetch-native-with-agent"); -jest.mock('node-fetch-native-with-agent', () => ({ ...jest.requireActual('node-fetch-native-with-agent'), fetch: jest.fn() })); +const { fetch: mockedFetch, Response } = require("undici"); +jest.mock('undici', () => ({ ...jest.requireActual('undici'), fetch: jest.fn() })); describe('Usage', () => { const client = new Client(); diff --git a/test/services/users.test.js b/test/services/users.test.js index cb5441a..7513e57 100644 --- a/test/services/users.test.js +++ b/test/services/users.test.js @@ -2,8 +2,8 @@ const { Client } = require("../../dist/client"); const { InputFile } = require("../../dist/inputFile"); const { Users } = require("../../dist/services/users"); -const { fetch: mockedFetch, Response } = require("node-fetch-native-with-agent"); -jest.mock('node-fetch-native-with-agent', () => ({ ...jest.requireActual('node-fetch-native-with-agent'), fetch: jest.fn() })); +const { fetch: mockedFetch, Response } = require("undici"); +jest.mock('undici', () => ({ ...jest.requireActual('undici'), fetch: jest.fn() })); describe('Users', () => { const client = new Client(); diff --git a/test/services/webhooks.test.js b/test/services/webhooks.test.js index 01e7abd..7fb1338 100644 --- a/test/services/webhooks.test.js +++ b/test/services/webhooks.test.js @@ -2,8 +2,8 @@ const { Client } = require("../../dist/client"); const { InputFile } = require("../../dist/inputFile"); const { Webhooks } = require("../../dist/services/webhooks"); -const { fetch: mockedFetch, Response } = require("node-fetch-native-with-agent"); -jest.mock('node-fetch-native-with-agent', () => ({ ...jest.requireActual('node-fetch-native-with-agent'), fetch: jest.fn() })); +const { fetch: mockedFetch, Response } = require("undici"); +jest.mock('undici', () => ({ ...jest.requireActual('undici'), fetch: jest.fn() })); describe('Webhooks', () => { const client = new Client(); From 8177977a50a0ca788190ccb89cf662c4dbc47ceb Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 13 Jul 2026 10:47:06 +0530 Subject: [PATCH 2/6] chore: update Node.js SDK to 27.0.0 --- .github/workflows/publish.yml | 3 +- CHANGELOG.md | 18 + docs/examples/account/create.md | 2 +- docs/examples/account/update-password.md | 4 +- docs/examples/account/update-recovery.md | 2 +- docs/examples/backups/create-restoration.md | 3 +- .../functions/get-deployment-download.md | 3 +- .../examples/functions/list-specifications.md | 4 +- docs/examples/health/get-audits-db.md | 12 - docs/examples/health/get-cache.md | 12 - docs/examples/health/get-db.md | 12 - docs/examples/health/get-failed-jobs.md | 15 - docs/examples/health/get-pub-sub.md | 12 - docs/examples/health/get-queue-databases.md | 15 - docs/examples/health/get-queue-deletes.md | 14 - docs/examples/health/get-queue-functions.md | 14 - docs/examples/health/get-queue-logs.md | 14 - docs/examples/health/get-queue-mails.md | 14 - docs/examples/health/get-queue-messaging.md | 14 - docs/examples/health/get-queue-migrations.md | 14 - .../health/get-queue-stats-resources.md | 14 - docs/examples/health/get-queue-usage.md | 14 - docs/examples/health/get-queue-webhooks.md | 14 - docs/examples/health/get-storage-local.md | 12 - docs/examples/health/get-storage.md | 12 - docs/examples/health/get-time.md | 12 - .../messaging/create-smtp-provider.md | 2 +- docs/examples/messaging/list-provider-logs.md | 16 - .../messaging/list-subscriber-logs.md | 16 - docs/examples/messaging/list-topic-logs.md | 16 - .../messaging/update-smtp-provider.md | 2 +- .../organization/create-membership.md | 19 + .../delete-membership.md} | 6 +- .../delete.md} | 4 +- .../get-membership.md} | 6 +- docs/examples/{health => organization}/get.md | 4 +- .../list-memberships.md} | 6 +- .../organization/update-membership.md | 15 + .../update.md} | 6 +- .../update-deny-corporate-email-policy.md} | 6 +- .../update-o-auth-2-appwrite.md} | 9 +- docs/examples/project/update-o-auth-2-oidc.md | 2 + .../project/update-o-auth-2-server.md | 3 +- docs/examples/project/update-smtp.md | 2 +- docs/examples/sites/list-specifications.md | 4 +- docs/examples/tablesdb/create.md | 3 +- docs/examples/usage/list-events.md | 15 - docs/examples/usage/list-gauges.md | 15 - docs/examples/users/create.md | 2 +- docs/examples/users/update-password.md | 2 +- docs/examples/webhooks/create.md | 2 +- docs/examples/webhooks/update.md | 2 +- package-lock.json | 3197 ++++++++++------- package.json | 16 +- src/client.ts | 26 +- src/enums/billing-plan-group.ts | 5 + src/enums/database-status.ts | 5 + src/enums/health-antivirus-status.ts | 5 - src/enums/health-check-status.ts | 4 - src/enums/health-queue-name.ts | 15 - src/enums/o-auth-2-oidc-prompt.ts | 6 + src/enums/o-auth-provider.ts | 1 + src/enums/organization-key-scopes.ts | 4 + src/enums/project-key-scopes.ts | 8 +- src/enums/project-o-auth-2-oidc-prompt.ts | 6 + src/enums/project-o-auth-provider-id.ts | 1 + src/enums/project-policy-id.ts | 1 + src/enums/project-service-id.ts | 1 + src/index.ts | 9 +- src/models.ts | 1233 +++++-- src/query.ts | 30 + src/services/account.ts | 26 +- src/services/activities.ts | 2 +- src/services/advisor.ts | 8 +- src/services/avatars.ts | 6 +- src/services/backups.ts | 39 +- src/services/databases.ts | 256 +- src/services/functions.ts | 103 +- src/services/health.ts | 1117 ------ src/services/messaging.ts | 334 +- src/services/organization.ts | 463 ++- src/services/presences.ts | 8 +- src/services/project.ts | 250 +- src/services/proxy.ts | 6 +- src/services/sites.ts | 72 +- src/services/storage.ts | 22 +- src/services/tables-db.ts | 263 +- src/services/teams.ts | 22 +- src/services/tokens.ts | 10 +- src/services/usage.ts | 134 - src/services/users.ts | 82 +- src/services/webhooks.ts | 8 +- test/services/account.test.js | 6 +- test/services/activities.test.js | 16 +- test/services/backups.test.js | 7 +- test/services/health.test.js | 383 -- test/services/messaging.test.js | 64 - test/services/organization.test.js | 282 +- test/services/project.test.js | 422 +-- test/services/usage.test.js | 42 - test/services/users.test.js | 2 +- test/services/webhooks.test.js | 8 +- 102 files changed, 4656 insertions(+), 4844 deletions(-) delete mode 100644 docs/examples/health/get-audits-db.md delete mode 100644 docs/examples/health/get-cache.md delete mode 100644 docs/examples/health/get-db.md delete mode 100644 docs/examples/health/get-failed-jobs.md delete mode 100644 docs/examples/health/get-pub-sub.md delete mode 100644 docs/examples/health/get-queue-databases.md delete mode 100644 docs/examples/health/get-queue-deletes.md delete mode 100644 docs/examples/health/get-queue-functions.md delete mode 100644 docs/examples/health/get-queue-logs.md delete mode 100644 docs/examples/health/get-queue-mails.md delete mode 100644 docs/examples/health/get-queue-messaging.md delete mode 100644 docs/examples/health/get-queue-migrations.md delete mode 100644 docs/examples/health/get-queue-stats-resources.md delete mode 100644 docs/examples/health/get-queue-usage.md delete mode 100644 docs/examples/health/get-queue-webhooks.md delete mode 100644 docs/examples/health/get-storage-local.md delete mode 100644 docs/examples/health/get-storage.md delete mode 100644 docs/examples/health/get-time.md delete mode 100644 docs/examples/messaging/list-provider-logs.md delete mode 100644 docs/examples/messaging/list-subscriber-logs.md delete mode 100644 docs/examples/messaging/list-topic-logs.md create mode 100644 docs/examples/organization/create-membership.md rename docs/examples/{health/get-queue-certificates.md => organization/delete-membership.md} (66%) rename docs/examples/{health/get-antivirus.md => organization/delete.md} (74%) rename docs/examples/{health/get-queue-builds.md => organization/get-membership.md} (67%) rename docs/examples/{health => organization}/get.md (75%) rename docs/examples/{messaging/list-message-logs.md => organization/list-memberships.md} (71%) create mode 100644 docs/examples/organization/update-membership.md rename docs/examples/{health/get-certificate.md => organization/update.md} (71%) rename docs/examples/{health/get-queue-audits.md => project/update-deny-corporate-email-policy.md} (69%) rename docs/examples/{health/get-console-pausing.md => project/update-o-auth-2-appwrite.md} (57%) delete mode 100644 docs/examples/usage/list-events.md delete mode 100644 docs/examples/usage/list-gauges.md create mode 100644 src/enums/billing-plan-group.ts create mode 100644 src/enums/database-status.ts delete mode 100644 src/enums/health-antivirus-status.ts delete mode 100644 src/enums/health-check-status.ts delete mode 100644 src/enums/health-queue-name.ts create mode 100644 src/enums/o-auth-2-oidc-prompt.ts create mode 100644 src/enums/project-o-auth-2-oidc-prompt.ts delete mode 100644 src/services/health.ts delete mode 100644 src/services/usage.ts delete mode 100644 test/services/health.test.js delete mode 100644 test/services/usage.test.js diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ee63d52..48121d6 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -34,9 +34,10 @@ jobs: echo "tag=latest" >> "$GITHUB_OUTPUT" fi - - name: Install dependencies and build + - name: Install dependencies, audit, and build run: | npm ci + npm audit --audit-level=high --omit=dev npm run build - name: Publish diff --git a/CHANGELOG.md b/CHANGELOG.md index f7617e5..7b9de72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Change Log +## 27.0.0 + +* Breaking: removed `Health` service, health enums, and health response models +* Breaking: removed `Usage` service and `UsageEvent`/`UsageGauge` models +* Breaking: removed messaging `listMessageLogs`, `listProviderLogs`, `listSubscriberLogs`, `listTopicLogs` methods +* Added: `Organization` `get`, `update`, `delete`, and membership CRUD methods +* Added: `Query.vectorCosine`, `Query.vectorDot`, `Query.vectorEuclidean` vector filters +* Added: `Client.setBearer` for OAuth access token authentication +* Added: `updateOAuth2Appwrite` and `updateDenyCorporateEmailPolicy` project methods +* Added: `prompt` and `maxAge` params to `updateOAuth2Oidc`, `defaultScopes` to `updateOAuth2Server` +* Added: `token` param to `getDeploymentDownload`, `type` to `listSpecifications` +* Added: `newSpecification` param to `createRestoration`, `specification` to `tablesDB.create` +* Added: `BillingPlanGroup`, `DatabaseStatus`, `OAuth2OidcPrompt`, `ProjectOAuth2OidcPrompt` enums +* Added: `Appwrite` OAuth provider, `stages` and `project.oauth2` key scopes +* Added: `Organization`, `BillingPlan`, `OAuth2Appwrite`, `PolicyDenyCorporateEmail` models +* Fixed: URL-encoded path parameters in organization key/project endpoints +* Updated: spatial attribute/column `xdefault` types narrowed to `number[]`/`any[][]` + ## 26.2.0 * Added: Device Authorization Grant params (`verificationUrl`, `userCodeLength`, `userCodeFormat`, `deviceCodeDuration`) to `updateOAuth2Server` diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md index db31f30..abc8c13 100644 --- a/docs/examples/account/create.md +++ b/docs/examples/account/create.md @@ -11,7 +11,7 @@ const account = new sdk.Account(client); const result = await account.create({ userId: '', email: 'email@example.com', - password: '', + password: 'password', name: '' // optional }); ``` diff --git a/docs/examples/account/update-password.md b/docs/examples/account/update-password.md index 0e6cd7b..d359b34 100644 --- a/docs/examples/account/update-password.md +++ b/docs/examples/account/update-password.md @@ -9,7 +9,7 @@ const client = new sdk.Client() const account = new sdk.Account(client); const result = await account.updatePassword({ - password: '', - oldPassword: '' // optional + password: 'password', + oldPassword: 'password' // optional }); ``` diff --git a/docs/examples/account/update-recovery.md b/docs/examples/account/update-recovery.md index 268f3e9..9008f67 100644 --- a/docs/examples/account/update-recovery.md +++ b/docs/examples/account/update-recovery.md @@ -11,6 +11,6 @@ const account = new sdk.Account(client); const result = await account.updateRecovery({ userId: '', secret: '', - password: '' + password: 'password' }); ``` diff --git a/docs/examples/backups/create-restoration.md b/docs/examples/backups/create-restoration.md index f41a234..6a8096a 100644 --- a/docs/examples/backups/create-restoration.md +++ b/docs/examples/backups/create-restoration.md @@ -12,6 +12,7 @@ const result = await backups.createRestoration({ archiveId: '', services: [sdk.BackupServices.Databases], newResourceId: '', // optional - newResourceName: '' // optional + newResourceName: '', // optional + newSpecification: 'serverless' // optional }); ``` diff --git a/docs/examples/functions/get-deployment-download.md b/docs/examples/functions/get-deployment-download.md index 5e9a956..6a75bad 100644 --- a/docs/examples/functions/get-deployment-download.md +++ b/docs/examples/functions/get-deployment-download.md @@ -11,6 +11,7 @@ const functions = new sdk.Functions(client); const result = await functions.getDeploymentDownload({ functionId: '', deploymentId: '', - type: sdk.DeploymentDownloadType.Source // optional + type: sdk.DeploymentDownloadType.Source, // optional + token: '' // optional }); ``` diff --git a/docs/examples/functions/list-specifications.md b/docs/examples/functions/list-specifications.md index 0fc8b8d..f9bb52b 100644 --- a/docs/examples/functions/list-specifications.md +++ b/docs/examples/functions/list-specifications.md @@ -8,5 +8,7 @@ const client = new sdk.Client() const functions = new sdk.Functions(client); -const result = await functions.listSpecifications(); +const result = await functions.listSpecifications({ + type: 'runtimes' // optional +}); ``` diff --git a/docs/examples/health/get-audits-db.md b/docs/examples/health/get-audits-db.md deleted file mode 100644 index 50d2eff..0000000 --- a/docs/examples/health/get-audits-db.md +++ /dev/null @@ -1,12 +0,0 @@ -```javascript -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const health = new sdk.Health(client); - -const result = await health.getAuditsDB(); -``` diff --git a/docs/examples/health/get-cache.md b/docs/examples/health/get-cache.md deleted file mode 100644 index a952506..0000000 --- a/docs/examples/health/get-cache.md +++ /dev/null @@ -1,12 +0,0 @@ -```javascript -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const health = new sdk.Health(client); - -const result = await health.getCache(); -``` diff --git a/docs/examples/health/get-db.md b/docs/examples/health/get-db.md deleted file mode 100644 index 45a840c..0000000 --- a/docs/examples/health/get-db.md +++ /dev/null @@ -1,12 +0,0 @@ -```javascript -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const health = new sdk.Health(client); - -const result = await health.getDB(); -``` diff --git a/docs/examples/health/get-failed-jobs.md b/docs/examples/health/get-failed-jobs.md deleted file mode 100644 index 3f41e63..0000000 --- a/docs/examples/health/get-failed-jobs.md +++ /dev/null @@ -1,15 +0,0 @@ -```javascript -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const health = new sdk.Health(client); - -const result = await health.getFailedJobs({ - name: sdk.HealthQueueName.V1Database, - threshold: null // optional -}); -``` diff --git a/docs/examples/health/get-pub-sub.md b/docs/examples/health/get-pub-sub.md deleted file mode 100644 index c03bb59..0000000 --- a/docs/examples/health/get-pub-sub.md +++ /dev/null @@ -1,12 +0,0 @@ -```javascript -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const health = new sdk.Health(client); - -const result = await health.getPubSub(); -``` diff --git a/docs/examples/health/get-queue-databases.md b/docs/examples/health/get-queue-databases.md deleted file mode 100644 index 181621e..0000000 --- a/docs/examples/health/get-queue-databases.md +++ /dev/null @@ -1,15 +0,0 @@ -```javascript -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const health = new sdk.Health(client); - -const result = await health.getQueueDatabases({ - name: '', // optional - threshold: null // optional -}); -``` diff --git a/docs/examples/health/get-queue-deletes.md b/docs/examples/health/get-queue-deletes.md deleted file mode 100644 index e1b5bc0..0000000 --- a/docs/examples/health/get-queue-deletes.md +++ /dev/null @@ -1,14 +0,0 @@ -```javascript -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const health = new sdk.Health(client); - -const result = await health.getQueueDeletes({ - threshold: null // optional -}); -``` diff --git a/docs/examples/health/get-queue-functions.md b/docs/examples/health/get-queue-functions.md deleted file mode 100644 index f40904a..0000000 --- a/docs/examples/health/get-queue-functions.md +++ /dev/null @@ -1,14 +0,0 @@ -```javascript -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const health = new sdk.Health(client); - -const result = await health.getQueueFunctions({ - threshold: null // optional -}); -``` diff --git a/docs/examples/health/get-queue-logs.md b/docs/examples/health/get-queue-logs.md deleted file mode 100644 index 437a86b..0000000 --- a/docs/examples/health/get-queue-logs.md +++ /dev/null @@ -1,14 +0,0 @@ -```javascript -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const health = new sdk.Health(client); - -const result = await health.getQueueLogs({ - threshold: null // optional -}); -``` diff --git a/docs/examples/health/get-queue-mails.md b/docs/examples/health/get-queue-mails.md deleted file mode 100644 index 3da627b..0000000 --- a/docs/examples/health/get-queue-mails.md +++ /dev/null @@ -1,14 +0,0 @@ -```javascript -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const health = new sdk.Health(client); - -const result = await health.getQueueMails({ - threshold: null // optional -}); -``` diff --git a/docs/examples/health/get-queue-messaging.md b/docs/examples/health/get-queue-messaging.md deleted file mode 100644 index 504ad1d..0000000 --- a/docs/examples/health/get-queue-messaging.md +++ /dev/null @@ -1,14 +0,0 @@ -```javascript -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const health = new sdk.Health(client); - -const result = await health.getQueueMessaging({ - threshold: null // optional -}); -``` diff --git a/docs/examples/health/get-queue-migrations.md b/docs/examples/health/get-queue-migrations.md deleted file mode 100644 index 59e4550..0000000 --- a/docs/examples/health/get-queue-migrations.md +++ /dev/null @@ -1,14 +0,0 @@ -```javascript -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const health = new sdk.Health(client); - -const result = await health.getQueueMigrations({ - threshold: null // optional -}); -``` diff --git a/docs/examples/health/get-queue-stats-resources.md b/docs/examples/health/get-queue-stats-resources.md deleted file mode 100644 index 542d11e..0000000 --- a/docs/examples/health/get-queue-stats-resources.md +++ /dev/null @@ -1,14 +0,0 @@ -```javascript -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const health = new sdk.Health(client); - -const result = await health.getQueueStatsResources({ - threshold: null // optional -}); -``` diff --git a/docs/examples/health/get-queue-usage.md b/docs/examples/health/get-queue-usage.md deleted file mode 100644 index 86dbfb8..0000000 --- a/docs/examples/health/get-queue-usage.md +++ /dev/null @@ -1,14 +0,0 @@ -```javascript -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const health = new sdk.Health(client); - -const result = await health.getQueueUsage({ - threshold: null // optional -}); -``` diff --git a/docs/examples/health/get-queue-webhooks.md b/docs/examples/health/get-queue-webhooks.md deleted file mode 100644 index 36c3037..0000000 --- a/docs/examples/health/get-queue-webhooks.md +++ /dev/null @@ -1,14 +0,0 @@ -```javascript -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const health = new sdk.Health(client); - -const result = await health.getQueueWebhooks({ - threshold: null // optional -}); -``` diff --git a/docs/examples/health/get-storage-local.md b/docs/examples/health/get-storage-local.md deleted file mode 100644 index 1593339..0000000 --- a/docs/examples/health/get-storage-local.md +++ /dev/null @@ -1,12 +0,0 @@ -```javascript -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const health = new sdk.Health(client); - -const result = await health.getStorageLocal(); -``` diff --git a/docs/examples/health/get-storage.md b/docs/examples/health/get-storage.md deleted file mode 100644 index 75ec5cb..0000000 --- a/docs/examples/health/get-storage.md +++ /dev/null @@ -1,12 +0,0 @@ -```javascript -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const health = new sdk.Health(client); - -const result = await health.getStorage(); -``` diff --git a/docs/examples/health/get-time.md b/docs/examples/health/get-time.md deleted file mode 100644 index 86d8617..0000000 --- a/docs/examples/health/get-time.md +++ /dev/null @@ -1,12 +0,0 @@ -```javascript -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const health = new sdk.Health(client); - -const result = await health.getTime(); -``` diff --git a/docs/examples/messaging/create-smtp-provider.md b/docs/examples/messaging/create-smtp-provider.md index e17fdc1..b980c3b 100644 --- a/docs/examples/messaging/create-smtp-provider.md +++ b/docs/examples/messaging/create-smtp-provider.md @@ -14,7 +14,7 @@ const result = await messaging.createSMTPProvider({ host: '', port: 1, // optional username: '', // optional - password: '', // optional + password: 'password', // optional encryption: sdk.SmtpEncryption.None, // optional autoTLS: false, // optional mailer: '', // optional diff --git a/docs/examples/messaging/list-provider-logs.md b/docs/examples/messaging/list-provider-logs.md deleted file mode 100644 index 92b4c2f..0000000 --- a/docs/examples/messaging/list-provider-logs.md +++ /dev/null @@ -1,16 +0,0 @@ -```javascript -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const messaging = new sdk.Messaging(client); - -const result = await messaging.listProviderLogs({ - providerId: '', - queries: [], // optional - total: false // optional -}); -``` diff --git a/docs/examples/messaging/list-subscriber-logs.md b/docs/examples/messaging/list-subscriber-logs.md deleted file mode 100644 index 2f89225..0000000 --- a/docs/examples/messaging/list-subscriber-logs.md +++ /dev/null @@ -1,16 +0,0 @@ -```javascript -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const messaging = new sdk.Messaging(client); - -const result = await messaging.listSubscriberLogs({ - subscriberId: '', - queries: [], // optional - total: false // optional -}); -``` diff --git a/docs/examples/messaging/list-topic-logs.md b/docs/examples/messaging/list-topic-logs.md deleted file mode 100644 index ee76366..0000000 --- a/docs/examples/messaging/list-topic-logs.md +++ /dev/null @@ -1,16 +0,0 @@ -```javascript -const sdk = require('node-appwrite'); - -const client = new sdk.Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject('') // Your project ID - .setKey(''); // Your secret API key - -const messaging = new sdk.Messaging(client); - -const result = await messaging.listTopicLogs({ - topicId: '', - queries: [], // optional - total: false // optional -}); -``` diff --git a/docs/examples/messaging/update-smtp-provider.md b/docs/examples/messaging/update-smtp-provider.md index d860736..1b0ec72 100644 --- a/docs/examples/messaging/update-smtp-provider.md +++ b/docs/examples/messaging/update-smtp-provider.md @@ -14,7 +14,7 @@ const result = await messaging.updateSMTPProvider({ host: '', // optional port: 1, // optional username: '', // optional - password: '', // optional + password: 'password', // optional encryption: sdk.SmtpEncryption.None, // optional autoTLS: false, // optional mailer: '', // optional diff --git a/docs/examples/organization/create-membership.md b/docs/examples/organization/create-membership.md new file mode 100644 index 0000000..02450ab --- /dev/null +++ b/docs/examples/organization/create-membership.md @@ -0,0 +1,19 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const organization = new sdk.Organization(client); + +const result = await organization.createMembership({ + roles: [], + email: 'email@example.com', // optional + userId: '', // optional + phone: '+12065550100', // optional + url: 'https://example.com', // optional + name: '' // optional +}); +``` diff --git a/docs/examples/health/get-queue-certificates.md b/docs/examples/organization/delete-membership.md similarity index 66% rename from docs/examples/health/get-queue-certificates.md rename to docs/examples/organization/delete-membership.md index ef065d5..174ffc3 100644 --- a/docs/examples/health/get-queue-certificates.md +++ b/docs/examples/organization/delete-membership.md @@ -6,9 +6,9 @@ const client = new sdk.Client() .setProject('') // Your project ID .setKey(''); // Your secret API key -const health = new sdk.Health(client); +const organization = new sdk.Organization(client); -const result = await health.getQueueCertificates({ - threshold: null // optional +const result = await organization.deleteMembership({ + membershipId: '' }); ``` diff --git a/docs/examples/health/get-antivirus.md b/docs/examples/organization/delete.md similarity index 74% rename from docs/examples/health/get-antivirus.md rename to docs/examples/organization/delete.md index 3f0c834..79b8e08 100644 --- a/docs/examples/health/get-antivirus.md +++ b/docs/examples/organization/delete.md @@ -6,7 +6,7 @@ const client = new sdk.Client() .setProject('') // Your project ID .setKey(''); // Your secret API key -const health = new sdk.Health(client); +const organization = new sdk.Organization(client); -const result = await health.getAntivirus(); +const result = await organization.delete(); ``` diff --git a/docs/examples/health/get-queue-builds.md b/docs/examples/organization/get-membership.md similarity index 67% rename from docs/examples/health/get-queue-builds.md rename to docs/examples/organization/get-membership.md index da49e02..42f6070 100644 --- a/docs/examples/health/get-queue-builds.md +++ b/docs/examples/organization/get-membership.md @@ -6,9 +6,9 @@ const client = new sdk.Client() .setProject('') // Your project ID .setKey(''); // Your secret API key -const health = new sdk.Health(client); +const organization = new sdk.Organization(client); -const result = await health.getQueueBuilds({ - threshold: null // optional +const result = await organization.getMembership({ + membershipId: '' }); ``` diff --git a/docs/examples/health/get.md b/docs/examples/organization/get.md similarity index 75% rename from docs/examples/health/get.md rename to docs/examples/organization/get.md index bfb883b..3b156dd 100644 --- a/docs/examples/health/get.md +++ b/docs/examples/organization/get.md @@ -6,7 +6,7 @@ const client = new sdk.Client() .setProject('') // Your project ID .setKey(''); // Your secret API key -const health = new sdk.Health(client); +const organization = new sdk.Organization(client); -const result = await health.get(); +const result = await organization.get(); ``` diff --git a/docs/examples/messaging/list-message-logs.md b/docs/examples/organization/list-memberships.md similarity index 71% rename from docs/examples/messaging/list-message-logs.md rename to docs/examples/organization/list-memberships.md index c9c8a47..594cfd1 100644 --- a/docs/examples/messaging/list-message-logs.md +++ b/docs/examples/organization/list-memberships.md @@ -6,11 +6,11 @@ const client = new sdk.Client() .setProject('') // Your project ID .setKey(''); // Your secret API key -const messaging = new sdk.Messaging(client); +const organization = new sdk.Organization(client); -const result = await messaging.listMessageLogs({ - messageId: '', +const result = await organization.listMemberships({ queries: [], // optional + search: '', // optional total: false // optional }); ``` diff --git a/docs/examples/organization/update-membership.md b/docs/examples/organization/update-membership.md new file mode 100644 index 0000000..17d7e17 --- /dev/null +++ b/docs/examples/organization/update-membership.md @@ -0,0 +1,15 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const organization = new sdk.Organization(client); + +const result = await organization.updateMembership({ + membershipId: '', + roles: [] +}); +``` diff --git a/docs/examples/health/get-certificate.md b/docs/examples/organization/update.md similarity index 71% rename from docs/examples/health/get-certificate.md rename to docs/examples/organization/update.md index 571b3cd..21485ef 100644 --- a/docs/examples/health/get-certificate.md +++ b/docs/examples/organization/update.md @@ -6,9 +6,9 @@ const client = new sdk.Client() .setProject('') // Your project ID .setKey(''); // Your secret API key -const health = new sdk.Health(client); +const organization = new sdk.Organization(client); -const result = await health.getCertificate({ - domain: '' // optional +const result = await organization.update({ + name: '' }); ``` diff --git a/docs/examples/health/get-queue-audits.md b/docs/examples/project/update-deny-corporate-email-policy.md similarity index 69% rename from docs/examples/health/get-queue-audits.md rename to docs/examples/project/update-deny-corporate-email-policy.md index dcc7c6c..8335b8e 100644 --- a/docs/examples/health/get-queue-audits.md +++ b/docs/examples/project/update-deny-corporate-email-policy.md @@ -6,9 +6,9 @@ const client = new sdk.Client() .setProject('') // Your project ID .setKey(''); // Your secret API key -const health = new sdk.Health(client); +const project = new sdk.Project(client); -const result = await health.getQueueAudits({ - threshold: null // optional +const result = await project.updateDenyCorporateEmailPolicy({ + enabled: false }); ``` diff --git a/docs/examples/health/get-console-pausing.md b/docs/examples/project/update-o-auth-2-appwrite.md similarity index 57% rename from docs/examples/health/get-console-pausing.md rename to docs/examples/project/update-o-auth-2-appwrite.md index a3dfca6..6a7df87 100644 --- a/docs/examples/health/get-console-pausing.md +++ b/docs/examples/project/update-o-auth-2-appwrite.md @@ -6,10 +6,11 @@ const client = new sdk.Client() .setProject('') // Your project ID .setKey(''); // Your secret API key -const health = new sdk.Health(client); +const project = new sdk.Project(client); -const result = await health.getConsolePausing({ - threshold: null, // optional - inactivityDays: null // optional +const result = await project.updateOAuth2Appwrite({ + clientId: '', // optional + clientSecret: '', // optional + enabled: false // optional }); ``` diff --git a/docs/examples/project/update-o-auth-2-oidc.md b/docs/examples/project/update-o-auth-2-oidc.md index 7f1f6eb..271afcf 100644 --- a/docs/examples/project/update-o-auth-2-oidc.md +++ b/docs/examples/project/update-o-auth-2-oidc.md @@ -15,6 +15,8 @@ const result = await project.updateOAuth2Oidc({ authorizationURL: 'https://example.com', // optional tokenURL: 'https://example.com', // optional userInfoURL: 'https://example.com', // optional + prompt: [sdk.ProjectOAuth2OidcPrompt.None], // optional + maxAge: 0, // optional enabled: 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 5feef6a..0cd95ae 100644 --- a/docs/examples/project/update-o-auth-2-server.md +++ b/docs/examples/project/update-o-auth-2-server.md @@ -21,6 +21,7 @@ const result = await project.updateOAuth2Server({ verificationUrl: 'https://example.com', // optional userCodeLength: 6, // optional userCodeFormat: 'numeric', // optional - deviceCodeDuration: 60 // optional + deviceCodeDuration: 60, // optional + defaultScopes: [] // optional }); ``` diff --git a/docs/examples/project/update-smtp.md b/docs/examples/project/update-smtp.md index fe7258a..d7ace09 100644 --- a/docs/examples/project/update-smtp.md +++ b/docs/examples/project/update-smtp.md @@ -12,7 +12,7 @@ const result = await project.updateSMTP({ host: '', // optional port: null, // optional username: '', // optional - password: '', // optional + password: 'password', // optional senderEmail: 'email@example.com', // optional senderName: '', // optional replyToEmail: 'email@example.com', // optional diff --git a/docs/examples/sites/list-specifications.md b/docs/examples/sites/list-specifications.md index 6e88289..208c827 100644 --- a/docs/examples/sites/list-specifications.md +++ b/docs/examples/sites/list-specifications.md @@ -8,5 +8,7 @@ const client = new sdk.Client() const sites = new sdk.Sites(client); -const result = await sites.listSpecifications(); +const result = await sites.listSpecifications({ + type: 'runtimes' // optional +}); ``` diff --git a/docs/examples/tablesdb/create.md b/docs/examples/tablesdb/create.md index 0571906..280db02 100644 --- a/docs/examples/tablesdb/create.md +++ b/docs/examples/tablesdb/create.md @@ -11,6 +11,7 @@ const tablesDB = new sdk.TablesDB(client); const result = await tablesDB.create({ databaseId: '', name: '', - enabled: false // optional + enabled: false, // optional + specification: 'serverless' // optional }); ``` diff --git a/docs/examples/usage/list-events.md b/docs/examples/usage/list-events.md deleted file mode 100644 index 887f98f..0000000 --- a/docs/examples/usage/list-events.md +++ /dev/null @@ -1,15 +0,0 @@ -```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 usage = new sdk.Usage(client); - -const result = await usage.listEvents({ - queries: [], // optional - total: false // optional -}); -``` diff --git a/docs/examples/usage/list-gauges.md b/docs/examples/usage/list-gauges.md deleted file mode 100644 index aa5ba1d..0000000 --- a/docs/examples/usage/list-gauges.md +++ /dev/null @@ -1,15 +0,0 @@ -```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 usage = new sdk.Usage(client); - -const result = await usage.listGauges({ - queries: [], // optional - total: false // optional -}); -``` diff --git a/docs/examples/users/create.md b/docs/examples/users/create.md index 5610f06..c93772d 100644 --- a/docs/examples/users/create.md +++ b/docs/examples/users/create.md @@ -12,7 +12,7 @@ const result = await users.create({ userId: '', email: 'email@example.com', // optional phone: '+12065550100', // optional - password: '', // optional + password: 'password', // optional name: '' // optional }); ``` diff --git a/docs/examples/users/update-password.md b/docs/examples/users/update-password.md index ab572ca..5cadfdb 100644 --- a/docs/examples/users/update-password.md +++ b/docs/examples/users/update-password.md @@ -10,6 +10,6 @@ const users = new sdk.Users(client); const result = await users.updatePassword({ userId: '', - password: '' + password: 'password' }); ``` diff --git a/docs/examples/webhooks/create.md b/docs/examples/webhooks/create.md index c860387..75c778c 100644 --- a/docs/examples/webhooks/create.md +++ b/docs/examples/webhooks/create.md @@ -16,7 +16,7 @@ const result = await webhooks.create({ enabled: false, // optional tls: false, // optional authUsername: '', // optional - authPassword: '', // optional + authPassword: 'password', // optional secret: '' // optional }); ``` diff --git a/docs/examples/webhooks/update.md b/docs/examples/webhooks/update.md index 6596e90..f83021c 100644 --- a/docs/examples/webhooks/update.md +++ b/docs/examples/webhooks/update.md @@ -16,6 +16,6 @@ const result = await webhooks.update({ enabled: false, // optional tls: false, // optional authUsername: '', // optional - authPassword: '' // optional + authPassword: 'password' // optional }); ``` diff --git a/package-lock.json b/package-lock.json index 2ac1a1e..6a10292 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,25 +1,29 @@ { "name": "node-appwrite", - "version": "26.2.0", + "version": "27.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "node-appwrite", - "version": "26.2.0", + "version": "27.0.0", "license": "BSD-3-Clause", "dependencies": { "json-bigint": "1.0.0", - "undici": "^6.26.0" + "undici": "^6.27.0" }, "devDependencies": { "@types/json-bigint": "1.0.4", - "@types/node": "20.11.25", + "@types/node": "26.1.1", "esbuild-plugin-file-path-extensions": "^2.0.0", - "jest": "^29.7.0", - "tslib": "2.6.2", + "jest": "^30.4.2", + "tslib": "2.8.1", "tsup": "^8.5.1", - "typescript": "5.4.2" + "typescript": "5.9.3" + }, + "overrides": { + "esbuild": "^0.28.1", + "js-yaml": "^4.2.0" } }, "node_modules/@babel/code-frame": { @@ -518,10 +522,44 @@ "dev": true, "license": "MIT" }, + "node_modules/@emnapi/core": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.10.0.tgz", + "integrity": "sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/wasi-threads": "1.2.1", + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.10.0.tgz", + "integrity": "sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/wasi-threads": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.1.tgz", + "integrity": "sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.27.7", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.7.tgz", - "integrity": "sha512-EKX3Qwmhz1eMdEJokhALr0YiD0lhQNwDqkPYyPhiSwKrh7/4KRjQc04sZ8db+5DVVnZ1LmbNDI1uAMPEUBnQPg==", + "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==", "cpu": [ "ppc64" ], @@ -536,9 +574,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.27.7", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.7.tgz", - "integrity": "sha512-jbPXvB4Yj2yBV7HUfE2KHe4GJX51QplCN1pGbYjvsyCZbQmies29EoJbkEc+vYuU5o45AfQn37vZlyXy4YJ8RQ==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.1.tgz", + "integrity": "sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==", "cpu": [ "arm" ], @@ -553,9 +591,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.27.7", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.7.tgz", - "integrity": "sha512-62dPZHpIXzvChfvfLJow3q5dDtiNMkwiRzPylSCfriLvZeq0a1bWChrGx/BbUbPwOrsWKMn8idSllklzBy+dgQ==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.1.tgz", + "integrity": "sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==", "cpu": [ "arm64" ], @@ -570,9 +608,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.27.7", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.7.tgz", - "integrity": "sha512-x5VpMODneVDb70PYV2VQOmIUUiBtY3D3mPBG8NxVk5CogneYhkR7MmM3yR/uMdITLrC1ml/NV1rj4bMJuy9MCg==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.1.tgz", + "integrity": "sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==", "cpu": [ "x64" ], @@ -587,9 +625,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.27.7", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.7.tgz", - "integrity": "sha512-5lckdqeuBPlKUwvoCXIgI2D9/ABmPq3Rdp7IfL70393YgaASt7tbju3Ac+ePVi3KDH6N2RqePfHnXkaDtY9fkw==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.1.tgz", + "integrity": "sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==", "cpu": [ "arm64" ], @@ -604,9 +642,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.27.7", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.7.tgz", - "integrity": "sha512-rYnXrKcXuT7Z+WL5K980jVFdvVKhCHhUwid+dDYQpH+qu+TefcomiMAJpIiC2EM3Rjtq0sO3StMV/+3w3MyyqQ==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.1.tgz", + "integrity": "sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==", "cpu": [ "x64" ], @@ -621,9 +659,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.27.7", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.7.tgz", - "integrity": "sha512-B48PqeCsEgOtzME2GbNM2roU29AMTuOIN91dsMO30t+Ydis3z/3Ngoj5hhnsOSSwNzS+6JppqWsuhTp6E82l2w==", + "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==", "cpu": [ "arm64" ], @@ -638,9 +676,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.27.7", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.7.tgz", - "integrity": "sha512-jOBDK5XEjA4m5IJK3bpAQF9/Lelu/Z9ZcdhTRLf4cajlB+8VEhFFRjWgfy3M1O4rO2GQ/b2dLwCUGpiF/eATNQ==", + "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==", "cpu": [ "x64" ], @@ -655,9 +693,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.27.7", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.7.tgz", - "integrity": "sha512-RkT/YXYBTSULo3+af8Ib0ykH8u2MBh57o7q/DAs3lTJlyVQkgQvlrPTnjIzzRPQyavxtPtfg0EopvDyIt0j1rA==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.1.tgz", + "integrity": "sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==", "cpu": [ "arm" ], @@ -672,9 +710,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.27.7", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.7.tgz", - "integrity": "sha512-RZPHBoxXuNnPQO9rvjh5jdkRmVizktkT7TCDkDmQ0W2SwHInKCAV95GRuvdSvA7w4VMwfCjUiPwDi0ZO6Nfe9A==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.1.tgz", + "integrity": "sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==", "cpu": [ "arm64" ], @@ -689,9 +727,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.27.7", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.7.tgz", - "integrity": "sha512-GA48aKNkyQDbd3KtkplYWT102C5sn/EZTY4XROkxONgruHPU72l+gW+FfF8tf2cFjeHaRbWpOYa/uRBz/Xq1Pg==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.1.tgz", + "integrity": "sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==", "cpu": [ "ia32" ], @@ -706,9 +744,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.27.7", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.7.tgz", - "integrity": "sha512-a4POruNM2oWsD4WKvBSEKGIiWQF8fZOAsycHOt6JBpZ+JN2n2JH9WAv56SOyu9X5IqAjqSIPTaJkqN8F7XOQ5Q==", + "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==", "cpu": [ "loong64" ], @@ -723,9 +761,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.27.7", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.7.tgz", - "integrity": "sha512-KabT5I6StirGfIz0FMgl1I+R1H73Gp0ofL9A3nG3i/cYFJzKHhouBV5VWK1CSgKvVaG4q1RNpCTR2LuTVB3fIw==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.1.tgz", + "integrity": "sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==", "cpu": [ "mips64el" ], @@ -740,9 +778,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.27.7", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.7.tgz", - "integrity": "sha512-gRsL4x6wsGHGRqhtI+ifpN/vpOFTQtnbsupUF5R5YTAg+y/lKelYR1hXbnBdzDjGbMYjVJLJTd2OFmMewAgwlQ==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.1.tgz", + "integrity": "sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==", "cpu": [ "ppc64" ], @@ -757,9 +795,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.27.7", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.7.tgz", - "integrity": "sha512-hL25LbxO1QOngGzu2U5xeXtxXcW+/GvMN3ejANqXkxZ/opySAZMrc+9LY/WyjAan41unrR3YrmtTsUpwT66InQ==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.1.tgz", + "integrity": "sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==", "cpu": [ "riscv64" ], @@ -774,9 +812,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.27.7", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.7.tgz", - "integrity": "sha512-2k8go8Ycu1Kb46vEelhu1vqEP+UeRVj2zY1pSuPdgvbd5ykAw82Lrro28vXUrRmzEsUV0NzCf54yARIK8r0fdw==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.1.tgz", + "integrity": "sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==", "cpu": [ "s390x" ], @@ -791,9 +829,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.27.7", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.7.tgz", - "integrity": "sha512-hzznmADPt+OmsYzw1EE33ccA+HPdIqiCRq7cQeL1Jlq2gb1+OyWBkMCrYGBJ+sxVzve2ZJEVeePbLM2iEIZSxA==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.1.tgz", + "integrity": "sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==", "cpu": [ "x64" ], @@ -808,9 +846,9 @@ } }, "node_modules/@esbuild/netbsd-arm64": { - "version": "0.27.7", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.7.tgz", - "integrity": "sha512-b6pqtrQdigZBwZxAn1UpazEisvwaIDvdbMbmrly7cDTMFnw/+3lVxxCTGOrkPVnsYIosJJXAsILG9XcQS+Yu6w==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.1.tgz", + "integrity": "sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==", "cpu": [ "arm64" ], @@ -825,9 +863,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.27.7", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.7.tgz", - "integrity": "sha512-OfatkLojr6U+WN5EDYuoQhtM+1xco+/6FSzJJnuWiUw5eVcicbyK3dq5EeV/QHT1uy6GoDhGbFpprUiHUYggrw==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.1.tgz", + "integrity": "sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==", "cpu": [ "x64" ], @@ -842,9 +880,9 @@ } }, "node_modules/@esbuild/openbsd-arm64": { - "version": "0.27.7", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.7.tgz", - "integrity": "sha512-AFuojMQTxAz75Fo8idVcqoQWEHIXFRbOc1TrVcFSgCZtQfSdc1RXgB3tjOn/krRHENUB4j00bfGjyl2mJrU37A==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.1.tgz", + "integrity": "sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==", "cpu": [ "arm64" ], @@ -859,9 +897,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.27.7", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.7.tgz", - "integrity": "sha512-+A1NJmfM8WNDv5CLVQYJ5PshuRm/4cI6WMZRg1by1GwPIQPCTs1GLEUHwiiQGT5zDdyLiRM/l1G0Pv54gvtKIg==", + "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==", "cpu": [ "x64" ], @@ -876,9 +914,9 @@ } }, "node_modules/@esbuild/openharmony-arm64": { - "version": "0.27.7", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.7.tgz", - "integrity": "sha512-+KrvYb/C8zA9CU/g0sR6w2RBw7IGc5J2BPnc3dYc5VJxHCSF1yNMxTV5LQ7GuKteQXZtspjFbiuW5/dOj7H4Yw==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.1.tgz", + "integrity": "sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==", "cpu": [ "arm64" ], @@ -893,9 +931,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.27.7", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.7.tgz", - "integrity": "sha512-ikktIhFBzQNt/QDyOL580ti9+5mL/YZeUPKU2ivGtGjdTYoqz6jObj6nOMfhASpS4GU4Q/Clh1QtxWAvcYKamA==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.1.tgz", + "integrity": "sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==", "cpu": [ "x64" ], @@ -910,9 +948,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.27.7", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.7.tgz", - "integrity": "sha512-7yRhbHvPqSpRUV7Q20VuDwbjW5kIMwTHpptuUzV+AA46kiPze5Z7qgt6CLCK3pWFrHeNfDd1VKgyP4O+ng17CA==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.1.tgz", + "integrity": "sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==", "cpu": [ "arm64" ], @@ -927,9 +965,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.27.7", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.7.tgz", - "integrity": "sha512-SmwKXe6VHIyZYbBLJrhOoCJRB/Z1tckzmgTLfFYOfpMAx63BJEaL9ExI8x7v0oAO3Zh6D/Oi1gVxEYr5oUCFhw==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.1.tgz", + "integrity": "sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==", "cpu": [ "ia32" ], @@ -944,9 +982,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.27.7", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.7.tgz", - "integrity": "sha512-56hiAJPhwQ1R4i+21FVF7V8kSD5zZTdHcVuRFMW0hn753vVfQN8xlx4uOPT4xoGH0Z/oVATuR82AiqSTDIpaHg==", + "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==", "cpu": [ "x64" ], @@ -960,6 +998,24 @@ "node": ">=18" } }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -988,61 +1044,61 @@ } }, "node_modules/@jest/console": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", - "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-30.4.1.tgz", + "integrity": "sha512-v3bhyxUh9Hgmo5p6hAOXe14/R3ZxZDOsvHleh4B07z3m/x4/ngPUXEm9XwK4sF4u+f+P2ORb0Ge+MgpaqRMVDA==", "dev": true, "license": "MIT", "dependencies": { - "@jest/types": "^29.6.3", + "@jest/types": "30.4.1", "@types/node": "*", - "chalk": "^4.0.0", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0", + "chalk": "^4.1.2", + "jest-message-util": "30.4.1", + "jest-util": "30.4.1", "slash": "^3.0.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/core": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", - "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", + "version": "30.4.2", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-30.4.2.tgz", + "integrity": "sha512-TZJA6cPJUFxoWhxaLo8t0VX/MZX2wPWr0uIDvLSHIvN4gu9h02vSzqI2kBADG1ExqQlC+cY09xKMSreivvrChQ==", "dev": true, "license": "MIT", "dependencies": { - "@jest/console": "^29.7.0", - "@jest/reporters": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", + "@jest/console": "30.4.1", + "@jest/pattern": "30.4.0", + "@jest/reporters": "30.4.1", + "@jest/test-result": "30.4.1", + "@jest/transform": "30.4.1", + "@jest/types": "30.4.1", "@types/node": "*", - "ansi-escapes": "^4.2.1", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "exit": "^0.1.2", - "graceful-fs": "^4.2.9", - "jest-changed-files": "^29.7.0", - "jest-config": "^29.7.0", - "jest-haste-map": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-regex-util": "^29.6.3", - "jest-resolve": "^29.7.0", - "jest-resolve-dependencies": "^29.7.0", - "jest-runner": "^29.7.0", - "jest-runtime": "^29.7.0", - "jest-snapshot": "^29.7.0", - "jest-util": "^29.7.0", - "jest-validate": "^29.7.0", - "jest-watcher": "^29.7.0", - "micromatch": "^4.0.4", - "pretty-format": "^29.7.0", - "slash": "^3.0.0", - "strip-ansi": "^6.0.0" + "ansi-escapes": "^4.3.2", + "chalk": "^4.1.2", + "ci-info": "^4.2.0", + "exit-x": "^0.2.2", + "fast-json-stable-stringify": "^2.1.0", + "graceful-fs": "^4.2.11", + "jest-changed-files": "30.4.1", + "jest-config": "30.4.2", + "jest-haste-map": "30.4.1", + "jest-message-util": "30.4.1", + "jest-regex-util": "30.4.0", + "jest-resolve": "30.4.1", + "jest-resolve-dependencies": "30.4.2", + "jest-runner": "30.4.2", + "jest-runtime": "30.4.2", + "jest-snapshot": "30.4.1", + "jest-util": "30.4.1", + "jest-validate": "30.4.1", + "jest-watcher": "30.4.1", + "pretty-format": "30.4.1", + "slash": "^3.0.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" }, "peerDependencies": { "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" @@ -1053,117 +1109,150 @@ } } }, + "node_modules/@jest/diff-sequences": { + "version": "30.4.0", + "resolved": "https://registry.npmjs.org/@jest/diff-sequences/-/diff-sequences-30.4.0.tgz", + "integrity": "sha512-zOpzlfUs45l6u7jm39qr87JCHUDsaeCtvL+kQe/Vn9jSnRB4/5IPXISm0h9I1vZW/o00Kn4UTJ2MOlhnUGwv3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, "node_modules/@jest/environment": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", - "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-30.4.1.tgz", + "integrity": "sha512-AK9yNRqgKxiabqMoe4oW+3/TSSeV8vkdC7BGaxZdU0AFXfOpofTLqdru2GXKZghP3sdgwE9XXpnVwfZ8JnFV4w==", "dev": true, "license": "MIT", "dependencies": { - "@jest/fake-timers": "^29.7.0", - "@jest/types": "^29.6.3", + "@jest/fake-timers": "30.4.1", + "@jest/types": "30.4.1", "@types/node": "*", - "jest-mock": "^29.7.0" + "jest-mock": "30.4.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/expect": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", - "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-30.4.1.tgz", + "integrity": "sha512-ginrj6TMgh2GshLUGCjO94Ptx9HhdZA/I6A9iUfyeLKFtdAjnKzHDgzgP9HYQgbxM1lbXScQ2eUBz2lGeVDPWA==", "dev": true, "license": "MIT", "dependencies": { - "expect": "^29.7.0", - "jest-snapshot": "^29.7.0" + "expect": "30.4.1", + "jest-snapshot": "30.4.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/expect-utils": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", - "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-30.4.1.tgz", + "integrity": "sha512-ZBn5CglH8fBsQsvs4VWNzD4aWfUYks+IdOOQU3MEK71ol/BcVm+P+rtb1KpiFBpSWSCE27uOahyyf1vfqOVbcQ==", "dev": true, "license": "MIT", "dependencies": { - "jest-get-type": "^29.6.3" + "@jest/get-type": "30.1.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/fake-timers": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", - "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-30.4.1.tgz", + "integrity": "sha512-iW5umdmfPeWzehrVhugFQZqCchSCud5S1l2YT0O9ZhjRR0ExclANDZkiSBwzqtnlOn0J1JXvO+HZ6rkuyOVOgQ==", "dev": true, "license": "MIT", "dependencies": { - "@jest/types": "^29.6.3", - "@sinonjs/fake-timers": "^10.0.2", + "@jest/types": "30.4.1", + "@sinonjs/fake-timers": "^15.4.0", "@types/node": "*", - "jest-message-util": "^29.7.0", - "jest-mock": "^29.7.0", - "jest-util": "^29.7.0" + "jest-message-util": "30.4.1", + "jest-mock": "30.4.1", + "jest-util": "30.4.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/get-type": { + "version": "30.1.0", + "resolved": "https://registry.npmjs.org/@jest/get-type/-/get-type-30.1.0.tgz", + "integrity": "sha512-eMbZE2hUnx1WV0pmURZY9XoXPkUYjpc55mb0CrhtdWLtzMQPFvu/rZkTLZFTsdaVQa+Tr4eWAteqcUzoawq/uA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/globals": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", - "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-30.4.1.tgz", + "integrity": "sha512-ZbuY4cmXC8DkxYjfvT2DbcHWL2T6vmsMhXCDcmTB2T0y0gaezBI77ufq5ZAIdcRkYZ7NEQEDg1xFeKbxUJ5v5Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "30.4.1", + "@jest/expect": "30.4.1", + "@jest/types": "30.4.1", + "jest-mock": "30.4.1" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/pattern": { + "version": "30.4.0", + "resolved": "https://registry.npmjs.org/@jest/pattern/-/pattern-30.4.0.tgz", + "integrity": "sha512-RAWn3+f9u8BsHijKJ71uHcFp6vmyEt6VvoWXkl6hKF3qVIuWNmudVjg12DlBPGup/frIl5UcUlH5HfEuvHpEXg==", "dev": true, "license": "MIT", "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/expect": "^29.7.0", - "@jest/types": "^29.6.3", - "jest-mock": "^29.7.0" + "@types/node": "*", + "jest-regex-util": "30.4.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/reporters": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", - "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-30.4.1.tgz", + "integrity": "sha512-/SnkPCzEQpUaBH81kjdEdDdo2WZl5hxw+BmLDGWjRkm8o7XlhjwsU36cqwe5PGBE5WYpBvDzRSdXx9rbGuJtNA==", "dev": true, "license": "MIT", "dependencies": { "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "@jridgewell/trace-mapping": "^0.3.18", + "@jest/console": "30.4.1", + "@jest/test-result": "30.4.1", + "@jest/transform": "30.4.1", + "@jest/types": "30.4.1", + "@jridgewell/trace-mapping": "^0.3.25", "@types/node": "*", - "chalk": "^4.0.0", - "collect-v8-coverage": "^1.0.0", - "exit": "^0.1.2", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", + "chalk": "^4.1.2", + "collect-v8-coverage": "^1.0.2", + "exit-x": "^0.2.2", + "glob": "^10.5.0", + "graceful-fs": "^4.2.11", "istanbul-lib-coverage": "^3.0.0", "istanbul-lib-instrument": "^6.0.0", "istanbul-lib-report": "^3.0.0", - "istanbul-lib-source-maps": "^4.0.0", + "istanbul-lib-source-maps": "^5.0.0", "istanbul-reports": "^3.1.3", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0", - "jest-worker": "^29.7.0", + "jest-message-util": "30.4.1", + "jest-util": "30.4.1", + "jest-worker": "30.4.1", "slash": "^3.0.0", - "string-length": "^4.0.1", - "strip-ansi": "^6.0.0", + "string-length": "^4.0.2", "v8-to-istanbul": "^9.0.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" }, "peerDependencies": { "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" @@ -1175,108 +1264,124 @@ } }, "node_modules/@jest/schemas": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", - "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-30.4.1.tgz", + "integrity": "sha512-i6b4qw5qnP8c5FEeBJg/uZQ4ddrkN6Ca8qISJh0pr7a5hfn3h3v5x60BEbOC7OYAGZNMs1LfFLwnW2CuK8F57Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sinclair/typebox": "^0.34.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/snapshot-utils": { + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/@jest/snapshot-utils/-/snapshot-utils-30.4.1.tgz", + "integrity": "sha512-ObY4ljvQ95mt6iwKtVLetR/4yXiAgl3H4nJxhztr0MTjrN97TwDYrnCp/kF60Ec9HdhkWTHSu+Hg05aXfngpOA==", "dev": true, "license": "MIT", "dependencies": { - "@sinclair/typebox": "^0.27.8" + "@jest/types": "30.4.1", + "chalk": "^4.1.2", + "graceful-fs": "^4.2.11", + "natural-compare": "^1.4.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/source-map": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", - "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", + "version": "30.0.1", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-30.0.1.tgz", + "integrity": "sha512-MIRWMUUR3sdbP36oyNyhbThLHyJ2eEDClPCiHVbrYAe5g3CHRArIVpBw7cdSB5fr+ofSfIb2Tnsw8iEHL0PYQg==", "dev": true, "license": "MIT", "dependencies": { - "@jridgewell/trace-mapping": "^0.3.18", - "callsites": "^3.0.0", - "graceful-fs": "^4.2.9" + "@jridgewell/trace-mapping": "^0.3.25", + "callsites": "^3.1.0", + "graceful-fs": "^4.2.11" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/test-result": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", - "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-30.4.1.tgz", + "integrity": "sha512-/ZG7pgEiOmmWkN9TplKbOu4id2N5lh7FHwRwlkgBVAzGdRH+OkkQ8wX/kIxg4zmd3ZQvAL1RwL2yWsvNYYECTw==", "dev": true, "license": "MIT", "dependencies": { - "@jest/console": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "collect-v8-coverage": "^1.0.0" + "@jest/console": "30.4.1", + "@jest/types": "30.4.1", + "@types/istanbul-lib-coverage": "^2.0.6", + "collect-v8-coverage": "^1.0.2" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/test-sequencer": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", - "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-30.4.1.tgz", + "integrity": "sha512-PeYE+4td5rKjoRPxztObrXU+H8hsjZfxKMXOcmrr34JerSyB/ROOxbbicz8B7A5j9R9VayDnVPvBmedqCsFCdw==", "dev": true, "license": "MIT", "dependencies": { - "@jest/test-result": "^29.7.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", + "@jest/test-result": "30.4.1", + "graceful-fs": "^4.2.11", + "jest-haste-map": "30.4.1", "slash": "^3.0.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/transform": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", - "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-30.4.1.tgz", + "integrity": "sha512-Wz0LyktlTvRefoymh+n64hQ84KNXsRGcwdoZ8CSa0Ea+fgYcHZlnk+hDP7v2MS7il2bQ5uTEIxf4/NNfhMN4KQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/core": "^7.11.6", - "@jest/types": "^29.6.3", - "@jridgewell/trace-mapping": "^0.3.18", - "babel-plugin-istanbul": "^6.1.1", - "chalk": "^4.0.0", + "@babel/core": "^7.27.4", + "@jest/types": "30.4.1", + "@jridgewell/trace-mapping": "^0.3.25", + "babel-plugin-istanbul": "^7.0.1", + "chalk": "^4.1.2", "convert-source-map": "^2.0.0", "fast-json-stable-stringify": "^2.1.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "jest-regex-util": "^29.6.3", - "jest-util": "^29.7.0", - "micromatch": "^4.0.4", - "pirates": "^4.0.4", + "graceful-fs": "^4.2.11", + "jest-haste-map": "30.4.1", + "jest-regex-util": "30.4.0", + "jest-util": "30.4.1", + "pirates": "^4.0.7", "slash": "^3.0.0", - "write-file-atomic": "^4.0.2" + "write-file-atomic": "^5.0.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-30.4.1.tgz", + "integrity": "sha512-f1x/vJXIfjOlEmejYpbkbgw1gOqpPECwMvMEtBqe47j7H2Hg8h8w3o3ikhSXq3MI15kg+oQ0exWO0uCtTNJLoQ==", "dev": true, "license": "MIT", "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", + "@jest/pattern": "30.4.0", + "@jest/schemas": "30.4.1", + "@types/istanbul-lib-coverage": "^2.0.6", + "@types/istanbul-reports": "^3.0.4", "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" + "@types/yargs": "^17.0.33", + "chalk": "^4.1.2" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jridgewell/gen-mapping": { @@ -1329,10 +1434,53 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "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==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@tybys/wasm-util": "^0.10.3" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "peerDependencies": { + "@emnapi/core": "^1.7.1", + "@emnapi/runtime": "^1.7.1" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@pkgr/core": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.3.6.tgz", + "integrity": "sha512-SEeaJLb3qBNF/OaXnaR1NmmBbFYk1zC0ZH/52fATcRPLFg/p791YrcyFFy44Bo9sLaGuSuLp5Q6axbb/O+v/RA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/pkgr" + } + }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.61.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.61.1.tgz", - "integrity": "sha512-JnBB8MdXj45cajvTuO5FmPlvFVJRQgvrz1uSEl3NwqFnReAPGwb8EanbGi4z2nRaqLzjJSv5/JmycoTKlRZxHA==", + "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==", "cpu": [ "arm" ], @@ -1344,9 +1492,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.61.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.61.1.tgz", - "integrity": "sha512-Jx2g7iSjw4AOT0HDPHM9RV3GNjRXwybWtSFZiZAYUTjUwjVrYIwq3kBf+LnhqJlzXFAqTAh2F7IGI+O568exPw==", + "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==", "cpu": [ "arm64" ], @@ -1358,9 +1506,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.61.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.61.1.tgz", - "integrity": "sha512-0F1L/Z3Eqv8mT2n3dCpeO8GcTvHvVqkP5/t6DMsn0KzhYVcg+s7Ncl5DS8qjKYEeio6Az0Gt6nyBORay5qIlCA==", + "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==", "cpu": [ "arm64" ], @@ -1372,9 +1520,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.61.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.61.1.tgz", - "integrity": "sha512-qLttcH871ujY4YcVfUSShhOw+CsoTatYz8gRbHO7Bb92QH059/P0y5do1KMs41fY0BpD2x4AJH/gID0zFiqVKQ==", + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.62.2.tgz", + "integrity": "sha512-yl0y2vq3S3lHeuXhEdss6TWfKW8vkujImO12tn4ZkG/4oghr09LvdYm2RElVjokTQiUvDUGXLGsYeLqUMCKpGA==", "cpu": [ "x64" ], @@ -1386,9 +1534,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.61.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.61.1.tgz", - "integrity": "sha512-fUI4RapGE0Oh3mb8mgfvC1O2nU1RpDZUKnDQm3xB1Ipg7C2wTs5Kstz7G2uWK99a8S2yTMq8/P4uycwNa0nJyw==", + "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==", "cpu": [ "arm64" ], @@ -1400,9 +1548,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.61.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.61.1.tgz", - "integrity": "sha512-H5YrdvJaDtI/U9/emrD4b++xkvp3y/JvOe4rizHbxvkyMfRS/CiRYdji+Pl8D0brEaNFWUh1drQxgAGIl6Xudw==", + "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==", "cpu": [ "x64" ], @@ -1414,13 +1562,16 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.61.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.61.1.tgz", - "integrity": "sha512-Q8CBCCQtDFrYtXoeUXSrnFXKOnyUhx6bz+SkL6A0E7V8kAiCJ5pamq1WtbfpVGhR5TSpXY6ak3avmDc5fHTyJA==", + "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==", "cpu": [ "arm" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -1428,13 +1579,16 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.61.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.61.1.tgz", - "integrity": "sha512-nwnhk1581l0FBVellGcVCAT0Oi06onEA3WB53sf01VO3I0UPBkMH9sXONYME2K0ovXcNayJfNtHfm6mpJElatQ==", + "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==", "cpu": [ "arm" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -1442,13 +1596,16 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.61.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.61.1.tgz", - "integrity": "sha512-x5Xr49hwt3hdW75UOZm3395YwwzPyauktslv29KpWL/T+vVAzoT3azLcTWv0eMciBNrx+DYjH4paehHoLpPvpg==", + "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==", "cpu": [ "arm64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -1456,13 +1613,16 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.61.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.61.1.tgz", - "integrity": "sha512-unMS3H73DpaoPyyEVPjGKleM/s0mkmsauTENpw4INQY8y4+IuLNjkueQ5QCtC0D3N38Y38yhAU8OoZ20S2Tm6w==", + "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==", "cpu": [ "arm64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -1470,13 +1630,16 @@ ] }, "node_modules/@rollup/rollup-linux-loong64-gnu": { - "version": "4.61.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.61.1.tgz", - "integrity": "sha512-zNZzGRnAhwjFEYmvphJRV5XaQGjs62cCmeYYHUT//NbvEnHauw+I85nGG+SiVg5ld4GX8D1IbKIX+ozITQnhMQ==", + "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==", "cpu": [ "loong64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -1484,13 +1647,16 @@ ] }, "node_modules/@rollup/rollup-linux-loong64-musl": { - "version": "4.61.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.61.1.tgz", - "integrity": "sha512-LdpWGL8X209B2SIvWjqlc8VZgM6PKfontSerGepuldQmHYrAOtnMCXeJkxXGbC+PPZVOuu5czJo7fNV6aeW8rQ==", + "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==", "cpu": [ "loong64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -1498,13 +1664,16 @@ ] }, "node_modules/@rollup/rollup-linux-ppc64-gnu": { - "version": "4.61.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.61.1.tgz", - "integrity": "sha512-EC5kTtNaNGOmbMGqar8dvJy6y/hg99GAwjfBz++pxZhQATXGcRjd6c5en5wcbru0vkRmiMGsQKdMJOOf6sza4g==", + "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==", "cpu": [ "ppc64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -1512,13 +1681,16 @@ ] }, "node_modules/@rollup/rollup-linux-ppc64-musl": { - "version": "4.61.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.61.1.tgz", - "integrity": "sha512-8hiwp6D4acEcNK78I4rP0/XtS1sknWIAMJBPdR4l6zUtyTm5KiTDr5bXmWt4foY7nAN7AThDHgkLIEZOWKbzWw==", + "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==", "cpu": [ "ppc64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -1526,13 +1698,16 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.61.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.61.1.tgz", - "integrity": "sha512-10dh/h/BqA7DuMPWSxkR8uks18FRwnwOEqr5zOTEl+NOwP/OMzKX8OFR/Of9xxDA7D5qef1Nzar5WDD2kCCr1g==", + "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==", "cpu": [ "riscv64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -1540,13 +1715,16 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.61.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.61.1.tgz", - "integrity": "sha512-YKJ5lg35DP17gcAOggnihe+APw9HLyj1Xn7gsmGumBJAUDa6NGXNixJzmkWLhcK9TOuuyQjdamzvJefkO7qHZQ==", + "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==", "cpu": [ "riscv64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -1554,13 +1732,16 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.61.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.61.1.tgz", - "integrity": "sha512-Mlil5G2Jj6a7B3LWGctg+XPL9vdXYuzCtNXfxOQ0nPjc2m6ueUktocPGH9bnAM0bNRKb/bAWTujUU7IJQdQA+g==", + "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==", "cpu": [ "s390x" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -1568,13 +1749,16 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.61.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.61.1.tgz", - "integrity": "sha512-bVWIOIk6pV01p4CdUbPP7CJ/434z+OooYjDuFcR+44N35YvKUC66G8MGnvcWx5mWKW3g61J+t74l3Kj15Kwn2Q==", + "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==", "cpu": [ "x64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -1582,13 +1766,16 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.61.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.61.1.tgz", - "integrity": "sha512-qy5pBvZbqNFheBz61R1rzsezjm0J7O2oNGoWtGoY89SZYLUfxAJTBAqDChqAIdB4rCiIbi9nF7yZ83GnNiLwSw==", + "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==", "cpu": [ "x64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -1596,9 +1783,9 @@ ] }, "node_modules/@rollup/rollup-openbsd-x64": { - "version": "4.61.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.61.1.tgz", - "integrity": "sha512-E83TXjI4zm0+5f2qO+UOudaCYIhYwpJ5jq6YCZNIZ+6CbfhKrkAGezeiASBL9ElxAxFsRS9ZhESv8mfnj6TKeg==", + "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==", "cpu": [ "x64" ], @@ -1610,9 +1797,9 @@ ] }, "node_modules/@rollup/rollup-openharmony-arm64": { - "version": "4.61.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.61.1.tgz", - "integrity": "sha512-fbWnKqVkjrJN38vNe3ahkbk6iejS/3b0Nt7EEtPpE6RBacZcGXNKbzfHN3GUUlXOPghUg0j6XUGrtjX9z1sIvA==", + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.62.2.tgz", + "integrity": "sha512-8hOJnxgbyObnCm5AlRA3A931xX19xq80RjVTKgJOvEKWqJruP/Uf12IbAOaDjjEXYRewwHLfmF0YRIdK3OwKWA==", "cpu": [ "arm64" ], @@ -1624,9 +1811,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.61.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.61.1.tgz", - "integrity": "sha512-ArMl38iVAbk0New1ogihQNY6iphLi4ZaRsa037gUzv5yeKPY8TD3Dmy4x2RNC1VztU/uqm+G+/RwFrSka3Oy2g==", + "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==", "cpu": [ "arm64" ], @@ -1638,9 +1825,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.61.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.61.1.tgz", - "integrity": "sha512-0mYtjHS9ucAbcATycCNK9IGBk/cCe/ma7EmSLGZdsxnOA8cjRIyU04wDpVAD9NiOfLUR9KTxdiO53uOkherqjQ==", + "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==", "cpu": [ "ia32" ], @@ -1652,9 +1839,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-gnu": { - "version": "4.61.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.61.1.tgz", - "integrity": "sha512-gK1iCEPfpoSG9wfBihXxvBMi8ZfcWffYkEsC/Eih+iFENTaewvNcrEQ69lIOWYO5pePHKLHHO7nq5AILGO/HQQ==", + "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==", "cpu": [ "x64" ], @@ -1666,9 +1853,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.61.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.61.1.tgz", - "integrity": "sha512-X+zaP2x+j4RXGfbp/seSoRHWnPxzApilDszisZxbYH5C/jTxFhCtDNdPGZb9lJyYPs24wGxruPF7Y+sIXt9Gzw==", + "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==", "cpu": [ "x64" ], @@ -1680,9 +1867,9 @@ ] }, "node_modules/@sinclair/typebox": { - "version": "0.27.10", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.10.tgz", - "integrity": "sha512-MTBk/3jGLNB2tVxv6uLlFh1iu64iYOQ2PbdOSK3NW8JZsmlaOh2q6sdtKowBhfw8QFLmYNzTW4/oK4uATIi6ZA==", + "version": "0.34.51", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.34.51.tgz", + "integrity": "sha512-Nu4sNPT4G3QgAvxmdUCR/NBmsi23F2tEIcbMOZJVHS+qEgk+rmXxQikEeoKFyaX+UEggAoTvHUvIlj8MfYPzXQ==", "dev": true, "license": "MIT" }, @@ -1697,13 +1884,24 @@ } }, "node_modules/@sinonjs/fake-timers": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", - "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", + "version": "15.4.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-15.4.0.tgz", + "integrity": "sha512-DsG+8/LscQIQg68J6Ef3dv10u6nVyetYn923s3/sus5eaGfTo1of5WMZSLf0UJc9KDuKPilPH0UDJCjvNbDNCA==", "dev": true, "license": "BSD-3-Clause", "dependencies": { - "@sinonjs/commons": "^3.0.0" + "@sinonjs/commons": "^3.0.1" + } + }, + "node_modules/@tybys/wasm-util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.3.tgz", + "integrity": "sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" } }, "node_modules/@types/babel__core": { @@ -1758,16 +1956,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/graceful-fs": { - "version": "4.1.9", - "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", - "integrity": "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", @@ -1803,13 +1991,13 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.11.25", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.25.tgz", - "integrity": "sha512-TBHyJxk2b7HceLVGFcpAUjsa5zIdsPWlR6XHfyGzd0SFu+/NFgQgMAl96MSDZgQDvJAvV6BKsFOrt6zIL09JDw==", + "version": "26.1.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-26.1.1.tgz", + "integrity": "sha512-nxAkRSVkN1Y0JC1W8ky/fTfkGsMmcrRsbx+3XoZE+rMOX71kLYTV7fLXpqud1GpbpP5TuffXFqfX7fH2GgZREw==", "dev": true, "license": "MIT", "dependencies": { - "undici-types": "~5.26.4" + "undici-types": "~8.3.0" } }, "node_modules/@types/stack-utils": { @@ -1836,162 +2024,508 @@ "dev": true, "license": "MIT" }, - "node_modules/acorn": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz", - "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", + "node_modules/@ungap/structured-clone": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.3.tgz", + "integrity": "sha512-60YRaenCQcVjYEKOcG824+DRGGIQ3VKErcBoAEDJZz5bKIs2ZG+X/H9Nk+Q6EVkwJk5QNApxbrc5QtBSwtrXAg==", "dev": true, - "license": "MIT", - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } + "license": "ISC" }, - "node_modules/ansi-escapes": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "node_modules/@unrs/resolver-binding-android-arm-eabi": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-android-arm-eabi/-/resolver-binding-android-arm-eabi-1.12.2.tgz", + "integrity": "sha512-g5T90pqg1bo/7mytQx6F4iBNC0Wsh9cu+z9veDbFjc7HjpesJFWD7QMS0NGStXM075+7dJPPVvBbpZlnrdpi/w==", + "cpu": [ + "arm" + ], "dev": true, "license": "MIT", - "dependencies": { - "type-fest": "^0.21.3" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } + "optional": true, + "os": [ + "android" + ] }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "node_modules/@unrs/resolver-binding-android-arm64": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-android-arm64/-/resolver-binding-android-arm64-1.12.2.tgz", + "integrity": "sha512-YGCRZv/9GLhwmz6mYDeTsm/92BAyR28l6c2ReweVW5pWgfsitWLY8upvfRlGdoyD8HjeTHSYJWyZGD4KJA/nFQ==", + "cpu": [ + "arm64" + ], "dev": true, "license": "MIT", - "engines": { - "node": ">=8" - } + "optional": true, + "os": [ + "android" + ] }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/@unrs/resolver-binding-darwin-arm64": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-darwin-arm64/-/resolver-binding-darwin-arm64-1.12.2.tgz", + "integrity": "sha512-u9DiNT1auQMO20A9SyTuG3wUgQWB9Z7KjAg0uFuCDR1FsAY8A0CG2S6JpHS1xwm/w1G08bjXZDcyOCjv1WAm2w==", + "cpu": [ + "arm64" + ], "dev": true, "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } + "optional": true, + "os": [ + "darwin" + ] }, - "node_modules/any-promise": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "node_modules/@unrs/resolver-binding-darwin-x64": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-darwin-x64/-/resolver-binding-darwin-x64-1.12.2.tgz", + "integrity": "sha512-f7rPLi/T1HVKZu/u6t87lroib16n8vrSzcyxI7lg4BGO9UF26KhQL44sd9eOUgrTYhvRXtWOIZT5PejdPyJfUA==", + "cpu": [ + "x64" + ], "dev": true, - "license": "MIT" + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] }, - "node_modules/anymatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "node_modules/@unrs/resolver-binding-freebsd-x64": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-freebsd-x64/-/resolver-binding-freebsd-x64-1.12.2.tgz", + "integrity": "sha512-BpcOjWCJub6nRZUS2zA20pmLvjtqAtGejETaIyRLiZiQf++cbrjltLA5NN/xaXfqeOBOSlMFbemIl5/S5tljmg==", + "cpu": [ + "x64" + ], "dev": true, - "license": "ISC", - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] }, - "node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "node_modules/@unrs/resolver-binding-linux-arm-gnueabihf": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm-gnueabihf/-/resolver-binding-linux-arm-gnueabihf-1.12.2.tgz", + "integrity": "sha512-vZTDvdSISZjJx66OzJqtsOhzifbqRjbmI1Mnu49fQDwog5GtDI4QidRiEAYbZCRj9C8YZEW+3ZjqsyS9GR4k2A==", + "cpu": [ + "arm" + ], "dev": true, "license": "MIT", - "dependencies": { - "sprintf-js": "~1.0.2" - } + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/babel-jest": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", - "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", + "node_modules/@unrs/resolver-binding-linux-arm-musleabihf": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm-musleabihf/-/resolver-binding-linux-arm-musleabihf-1.12.2.tgz", + "integrity": "sha512-BiPI+IrIlwcW4nLLMM21+B1dFPzd55yAVgVGrdgDjNef+ch03GdxrcyaIz8X9SsQirh/kCQ7mviyWlMxdh2D7g==", + "cpu": [ + "arm" + ], "dev": true, "license": "MIT", - "dependencies": { - "@jest/transform": "^29.7.0", - "@types/babel__core": "^7.1.14", - "babel-plugin-istanbul": "^6.1.1", - "babel-preset-jest": "^29.6.3", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "slash": "^3.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "@babel/core": "^7.8.0" - } + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/babel-plugin-istanbul": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", - "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", + "node_modules/@unrs/resolver-binding-linux-arm64-gnu": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm64-gnu/-/resolver-binding-linux-arm64-gnu-1.12.2.tgz", + "integrity": "sha512-zJc0H99FEPoFfSrNpa91HYfxzfAJCr502oxNK1cfdC9hlaFI43RT+JFCann9JUgZmLzzntChHyn13Sgn9ljHNg==", + "cpu": [ + "arm64" + ], "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@istanbuljs/load-nyc-config": "^1.0.0", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-instrument": "^5.0.4", - "test-exclude": "^6.0.0" - }, - "engines": { - "node": ">=8" - } + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", - "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", + "node_modules/@unrs/resolver-binding-linux-arm64-musl": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm64-musl/-/resolver-binding-linux-arm64-musl-1.12.2.tgz", + "integrity": "sha512-KQ3Lki6l+Pz1k/eBipN41ES+YUK30beLGb9YqcB1O542cyLCNE6GaxrfcY3T6EezmGGk84wb5XyO9loTM9tkcA==", + "cpu": [ + "arm64" + ], "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@babel/core": "^7.12.3", - "@babel/parser": "^7.14.7", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-coverage": "^3.2.0", - "semver": "^6.3.0" - }, - "engines": { - "node": ">=8" - } + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-loong64-gnu": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-loong64-gnu/-/resolver-binding-linux-loong64-gnu-1.12.2.tgz", + "integrity": "sha512-3SJGEh1DborhG6pyxvhPzCT4bbSIVihsvgJc13P1bHG7KLdNDaF9T3gsTwFc7Jw/5Y5/iWOjkEx7Zy0NvCGX3Q==", + "cpu": [ + "loong64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-loong64-musl": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-loong64-musl/-/resolver-binding-linux-loong64-musl-1.12.2.tgz", + "integrity": "sha512-jiuG/Obbel7uw1PwHNFfrkiKhLAF6mnyZ6aWlOAVN9WqKm8v0OFGnciJIHu8+CMvXLQ8AD51LPzAoUfT21D5Ew==", + "cpu": [ + "loong64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-ppc64-gnu": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-ppc64-gnu/-/resolver-binding-linux-ppc64-gnu-1.12.2.tgz", + "integrity": "sha512-q7xRvVpmcfeL+LlZg8Pbbo6QaTZwDU5BaGZbwfhkEsXJn3Was8xYfE0RBH266xZt0rM6B7i8xAYIvjthuUIWHg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-riscv64-gnu": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-riscv64-gnu/-/resolver-binding-linux-riscv64-gnu-1.12.2.tgz", + "integrity": "sha512-0CVdx6lcnT3Q9inOH8tsMIOJ6ImndllMjqJHg8RLVdB7Vq4SfkEXl9mCSsVNuNA4MCYycRicCUxPCabVHJRr6A==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-riscv64-musl": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-riscv64-musl/-/resolver-binding-linux-riscv64-musl-1.12.2.tgz", + "integrity": "sha512-iOwlRo9vnp6R6ohHQS11n0NnfdXx/omhkocmIfaPRpQhKZ+3BDMkkdRVh53qjkFkpPddf+FETA28NwGN7l5l+w==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-s390x-gnu": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-s390x-gnu/-/resolver-binding-linux-s390x-gnu-1.12.2.tgz", + "integrity": "sha512-HYJtLfXq94q8iZNFT1lknx258wlkkWhZeUXJRqzKBBUJ00CvZ+N33zgbCqimLjsyw5Va6uUxhVa12mI+kaveEw==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-x64-gnu": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-gnu/-/resolver-binding-linux-x64-gnu-1.12.2.tgz", + "integrity": "sha512-mPsUhunKKDih5O96Y6enDQyHc1SqBPlY1E/SfMWDM3EdJ95Z9CArPeCVwCCqbP45ljvivdEk8Fxn+SIb1rDAJQ==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-x64-musl": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-musl/-/resolver-binding-linux-x64-musl-1.12.2.tgz", + "integrity": "sha512-azrt6+5ydLd8Vt210AAFis/lZevSfPw93EJRIJG+xPu4WCJ8K0kppCTpMyLPcKT7H15M4Jnt2tMp5bOvCkRC6A==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-openharmony-arm64": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-openharmony-arm64/-/resolver-binding-openharmony-arm64-1.12.2.tgz", + "integrity": "sha512-YZ9hP4O0X9PQb8eO980qmLNGH4zT3I9+SZTdt0Pr0YyuGQhYKoOZkV02VzrzyOZJ5xIJ3UFIenKkUkGg8GjgWQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@unrs/resolver-binding-wasm32-wasi": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-wasm32-wasi/-/resolver-binding-wasm32-wasi-1.12.2.tgz", + "integrity": "sha512-tYFDIkMxSflfEc/h92ZWNsZlHSwgimbNHSO3PL2JWQHfCuC2q316jMyYU9TIWZsFK2bQwyK5VAdYgn8ygPj69A==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "1.10.0", + "@emnapi/runtime": "1.10.0", + "@napi-rs/wasm-runtime": "^1.1.4" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@unrs/resolver-binding-win32-arm64-msvc": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-arm64-msvc/-/resolver-binding-win32-arm64-msvc-1.12.2.tgz", + "integrity": "sha512-qzNyg3xL0VPQmCaUh+N5jSitce6k+uCBfMDesWRnlULOZaqUkaJ0ybdT+UqlAWJoQjuqfIU/0Ptx9bteN4D82g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@unrs/resolver-binding-win32-ia32-msvc": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-ia32-msvc/-/resolver-binding-win32-ia32-msvc-1.12.2.tgz", + "integrity": "sha512-WD9sY00OfpHVGfsnHZoA8jVT+esS/Bg8z8jzxp5BnDCjjwsuKsPQrzswwpFy4J1AUJbXPRfkpcX0mXrzeXW79g==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@unrs/resolver-binding-win32-x64-msvc": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-x64-msvc/-/resolver-binding-win32-x64-msvc-1.12.2.tgz", + "integrity": "sha512-nAB74NfSNKknqQ1RrYj6uz8FcXEomu/MATJZxh/x+BArzN2U3JbOYC0APYzUIGhVY3m5hRxA8VPNdPBoG8txlA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/acorn": { + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.17.0.tgz", + "integrity": "sha512-xRQbDb9BnwDafYNn6Vwl839DYVjqXYb1XVGtWAZ1kcDc6iwAL4hg3B1dZlRiuENFeO2H53gFG3in621AdERVAg==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "dev": true, + "license": "MIT" + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/anymatch/node_modules/picomatch": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/babel-jest": { + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-30.4.1.tgz", + "integrity": "sha512-fATAbM8piYxkiXQp3RBXmZHxZVNJZAVXXfyeyCN2Tida3+qJ8ea9UxhiJ2y4fLO90ZImKt6k9FlcH2+rLkJGhw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/transform": "30.4.1", + "@types/babel__core": "^7.20.5", + "babel-plugin-istanbul": "^7.0.1", + "babel-preset-jest": "30.4.0", + "chalk": "^4.1.2", + "graceful-fs": "^4.2.11", + "slash": "^3.0.0" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.11.0 || ^8.0.0-0" + } + }, + "node_modules/babel-plugin-istanbul": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-7.0.1.tgz", + "integrity": "sha512-D8Z6Qm8jCvVXtIRkBnqNHX0zJ37rQcFJ9u8WOS6tkYOsRdHBzypCstaxWiu5ZIlqQtviRYbgnRLSoCEvjqcqbA==", + "dev": true, + "license": "BSD-3-Clause", + "workspaces": [ + "test/babel-8" + ], + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-instrument": "^6.0.2", + "test-exclude": "^6.0.0" + }, + "engines": { + "node": ">=12" + } }, "node_modules/babel-plugin-jest-hoist": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", - "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", + "version": "30.4.0", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-30.4.0.tgz", + "integrity": "sha512-9EdtWM/sSfXLOGLwSn+GS6pIXyBnL07/8gyJlwFXjWy4DxMOyItqyUT29d4lQiS380EZwYlX7/At4PgBS+m2aA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/template": "^7.3.3", - "@babel/types": "^7.3.3", - "@types/babel__core": "^7.1.14", - "@types/babel__traverse": "^7.0.6" + "@types/babel__core": "^7.20.5" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/babel-preset-current-node-syntax": { @@ -2022,20 +2556,20 @@ } }, "node_modules/babel-preset-jest": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", - "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", + "version": "30.4.0", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-30.4.0.tgz", + "integrity": "sha512-lBY4jxsNmCnSiu7kquw8ZC9F4+XLMOKypT3RnNHPvU2Kpd4W0xaPuLr5ZkRyOsvLYAY4yaW1ZwTW4xB7NIiZzg==", "dev": true, "license": "MIT", "dependencies": { - "babel-plugin-jest-hoist": "^29.6.3", - "babel-preset-current-node-syntax": "^1.0.0" + "babel-plugin-jest-hoist": "30.4.0", + "babel-preset-current-node-syntax": "^1.2.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" }, "peerDependencies": { - "@babel/core": "^7.0.0" + "@babel/core": "^7.11.0 || ^8.0.0-beta.1" } }, "node_modules/balanced-match": { @@ -2046,9 +2580,9 @@ "license": "MIT" }, "node_modules/baseline-browser-mapping": { - "version": "2.10.34", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.34.tgz", - "integrity": "sha512-IMDedajPifLnHNY0X9n8hKxRTQ6/eTHwr5bDo04WnuqxyKw6LYtQywCuuqPZwhl3aBXMvQpJov42GLCwRRdQzw==", + "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==", "dev": true, "license": "Apache-2.0", "bin": { @@ -2068,33 +2602,19 @@ } }, "node_modules/brace-expansion": { - "version": "1.1.15", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.15.tgz", - "integrity": "sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.2.tgz", + "integrity": "sha512-w5JZcKgdhDOgOwm8H+KgbosopHMuGcl6qbulwjtz3SM7I7P3yW1eAjzMPLrIE+NQ9vjgANKHWeMHnrT0OXW1oA==", "dev": true, "license": "MIT", "dependencies": { - "fill-range": "^7.1.1" - }, - "engines": { - "node": ">=8" + "balanced-match": "^1.0.0" } }, "node_modules/browserslist": { - "version": "4.28.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.2.tgz", - "integrity": "sha512-48xSriZYYg+8qXna9kwqjIVzuQxi+KYWp2+5nCYnYKPTr0LvD89Jqk2Or5ogxz0NUMfIjhh2lIUX/LyX9B4oIg==", + "version": "4.28.5", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.5.tgz", + "integrity": "sha512-Cu2E6QejHWzuDMTkuwgpABFgDfZrXLQq5V13YOACZx4mFAG4IwGTbTfHPMr4WtxlHoXSM8FIuRwYYCz5XiabaQ==", "dev": true, "funding": [ { @@ -2112,10 +2632,10 @@ ], "license": "MIT", "dependencies": { - "baseline-browser-mapping": "^2.10.12", - "caniuse-lite": "^1.0.30001782", - "electron-to-chromium": "^1.5.328", - "node-releases": "^2.0.36", + "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" }, "bin": { @@ -2189,9 +2709,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001797", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001797.tgz", - "integrity": "sha512-l8xKG+gwAIExZGl9FrF7KUwuOmk6wbEPC9Xoy/RtnWv1XG0Q4LFlagaLpUv3Kiza3W/wm27zy0yWJEieYKAP6w==", + "version": "1.0.30001803", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001803.tgz", + "integrity": "sha512-g/uHREV2ZpK9qMalCsWaxmA6ol+DX8GYhuf3T40RKoP+oL7vhRJh8LNt73PCjpnR6l14FzfPrB5Yux4PKm2meg==", "dev": true, "funding": [ { @@ -2253,9 +2773,9 @@ } }, "node_modules/ci-info": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", - "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.4.0.tgz", + "integrity": "sha512-77PSwercCZU2Fc4sX94eF8k8Pxte6JAwL4/ICZLFjJLqegs7kCuAsqqj/70NQF6TvDpgFjkubQB2FW2ZZddvQg==", "dev": true, "funding": [ { @@ -2269,9 +2789,9 @@ } }, "node_modules/cjs-module-lexer": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.4.3.tgz", - "integrity": "sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-2.2.0.tgz", + "integrity": "sha512-4bHTS2YuzUvtoLjdy+98ykbNB5jS0+07EvFNXerqZQJ89F7DI6ET7OQo/HJuW6K0aVsKA9hj9/RVb2kQVOrPDQ==", "dev": true, "license": "MIT" }, @@ -2290,6 +2810,69 @@ "node": ">=12" } }, + "node_modules/cliui/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/cliui/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", @@ -2369,28 +2952,6 @@ "dev": true, "license": "MIT" }, - "node_modules/create-jest": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", - "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jest/types": "^29.6.3", - "chalk": "^4.0.0", - "exit": "^0.1.2", - "graceful-fs": "^4.2.9", - "jest-config": "^29.7.0", - "jest-util": "^29.7.0", - "prompts": "^2.0.1" - }, - "bin": { - "create-jest": "bin/create-jest.js" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", @@ -2459,20 +3020,17 @@ "node": ">=8" } }, - "node_modules/diff-sequences": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", - "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "dev": true, - "license": "MIT", - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } + "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.368", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.368.tgz", - "integrity": "sha512-7RckJJK4uESJF9PxvfMWd3TGqIiieUTG4HxnKaKuIpGbcr+r2ZEB3g2gAhCP3Fqm42vJSzLfgab9eva/C4/XVw==", + "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==", "dev": true, "license": "ISC" }, @@ -2490,9 +3048,9 @@ } }, "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true, "license": "MIT" }, @@ -2506,20 +3064,10 @@ "is-arrayish": "^0.2.1" } }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, "node_modules/esbuild": { - "version": "0.27.7", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.7.tgz", - "integrity": "sha512-IxpibTjyVnmrIQo5aqNpCgoACA/dTKLTlhMHihVHhdkxKyPO1uBBthumT0rdHmcsk9uMonIWS0m4FljWzILh3w==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.1.tgz", + "integrity": "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -2530,32 +3078,32 @@ "node": ">=18" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.27.7", - "@esbuild/android-arm": "0.27.7", - "@esbuild/android-arm64": "0.27.7", - "@esbuild/android-x64": "0.27.7", - "@esbuild/darwin-arm64": "0.27.7", - "@esbuild/darwin-x64": "0.27.7", - "@esbuild/freebsd-arm64": "0.27.7", - "@esbuild/freebsd-x64": "0.27.7", - "@esbuild/linux-arm": "0.27.7", - "@esbuild/linux-arm64": "0.27.7", - "@esbuild/linux-ia32": "0.27.7", - "@esbuild/linux-loong64": "0.27.7", - "@esbuild/linux-mips64el": "0.27.7", - "@esbuild/linux-ppc64": "0.27.7", - "@esbuild/linux-riscv64": "0.27.7", - "@esbuild/linux-s390x": "0.27.7", - "@esbuild/linux-x64": "0.27.7", - "@esbuild/netbsd-arm64": "0.27.7", - "@esbuild/netbsd-x64": "0.27.7", - "@esbuild/openbsd-arm64": "0.27.7", - "@esbuild/openbsd-x64": "0.27.7", - "@esbuild/openharmony-arm64": "0.27.7", - "@esbuild/sunos-x64": "0.27.7", - "@esbuild/win32-arm64": "0.27.7", - "@esbuild/win32-ia32": "0.27.7", - "@esbuild/win32-x64": "0.27.7" + "@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" } }, "node_modules/esbuild-plugin-file-path-extensions": { @@ -2581,26 +3129,12 @@ }, "node_modules/escape-string-regexp": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", - "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", "dev": true, - "license": "BSD-2-Clause", - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, + "license": "MIT", "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/execa": { @@ -2627,30 +3161,39 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/exit": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", - "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", + "node_modules/execa/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/exit-x": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/exit-x/-/exit-x-0.2.2.tgz", + "integrity": "sha512-+I6B/IkJc1o/2tiURyz/ivu/O0nKNEArIUB5O7zBrlDVJr22SCLH3xTeEry428LvFhRzIA1g8izguxJ/gbNcVQ==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8.0" } }, "node_modules/expect": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", - "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/expect/-/expect-30.4.1.tgz", + "integrity": "sha512-PMARsyh/JtqC20HoGqlFcIlQAyqUtW4PlI1rup1uhYJtKuwAjbvWi3GQMAn+STdHum/dk8xrKfUM1+5SAwpolA==", "dev": true, "license": "MIT", "dependencies": { - "@jest/expect-utils": "^29.7.0", - "jest-get-type": "^29.6.3", - "jest-matcher-utils": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0" + "@jest/expect-utils": "30.4.1", + "@jest/get-type": "30.1.0", + "jest-matcher-utils": "30.4.1", + "jest-message-util": "30.4.1", + "jest-mock": "30.4.1", + "jest-util": "30.4.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/fast-json-stable-stringify": { @@ -2670,17 +3213,22 @@ "bser": "2.1.1" } }, - "node_modules/fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", "dev": true, "license": "MIT", - "dependencies": { - "to-regex-range": "^5.0.1" - }, "engines": { - "node": ">=8" + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } } }, "node_modules/find-up": { @@ -2709,6 +3257,23 @@ "rollup": "^4.34.8" } }, + "node_modules/foreground-child": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", + "dev": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -2731,16 +3296,6 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -2785,22 +3340,22 @@ } }, "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", + "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", "dev": true, "license": "ISC", "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" }, - "engines": { - "node": "*" + "bin": { + "glob": "dist/esm/bin.mjs" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -2823,19 +3378,6 @@ "node": ">=8" } }, - "node_modules/hasown": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", - "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", - "dev": true, - "license": "MIT", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/html-escaper": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", @@ -2909,22 +3451,6 @@ "dev": true, "license": "MIT" }, - "node_modules/is-core-module": { - "version": "2.16.2", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.2.tgz", - "integrity": "sha512-evOr8xfXKxE6qSR0hSXL2r3sd7ALj8+7jQEUvPYcm5sgZFdJ+AYzT6yNmJenvIYQBgIGwfwz08sL8zoL7yq2BA==", - "dev": true, - "license": "MIT", - "dependencies": { - "hasown": "^2.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -2945,16 +3471,6 @@ "node": ">=6" } }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.12.0" - } - }, "node_modules/is-stream": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", @@ -3003,9 +3519,9 @@ } }, "node_modules/istanbul-lib-instrument/node_modules/semver": { - "version": "7.8.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.2.tgz", - "integrity": "sha512-c8jsqUZm3omBOI66G90z1Dyw5z622G8oLG+omfsHBJf3CWQTlOcwOjvOG6wtiNfW6anKm/eA39LMwMtMez2TiQ==", + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", "dev": true, "license": "ISC", "bin": { @@ -3031,15 +3547,15 @@ } }, "node_modules/istanbul-lib-source-maps": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", - "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-5.0.6.tgz", + "integrity": "sha512-yg2d+Em4KizZC5niWhQaIomgf5WlL4vOOjZ5xGCmF8SnPE/mDWWXgvRExdcpCgh9lLRRa1/fSYp2ymmbJ1pI+A==", "dev": true, "license": "BSD-3-Clause", "dependencies": { + "@jridgewell/trace-mapping": "^0.3.23", "debug": "^4.1.1", - "istanbul-lib-coverage": "^3.0.0", - "source-map": "^0.6.1" + "istanbul-lib-coverage": "^3.0.0" }, "engines": { "node": ">=10" @@ -3059,23 +3575,39 @@ "node": ">=8" } }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, "node_modules/jest": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", - "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", + "version": "30.4.2", + "resolved": "https://registry.npmjs.org/jest/-/jest-30.4.2.tgz", + "integrity": "sha512-Yi1jqNC/Oq0N4hBgNH/YvBpP1P57QqundgytzYqy3yqAa7NZPNjSoi4SGbRAXDMdBzNE6xBCi5U7RgfrvMEUVQ==", "dev": true, "license": "MIT", "dependencies": { - "@jest/core": "^29.7.0", - "@jest/types": "^29.6.3", - "import-local": "^3.0.2", - "jest-cli": "^29.7.0" + "@jest/core": "30.4.2", + "@jest/types": "30.4.1", + "import-local": "^3.2.0", + "jest-cli": "30.4.2" }, "bin": { "jest": "bin/jest.js" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" }, "peerDependencies": { "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" @@ -3087,76 +3619,75 @@ } }, "node_modules/jest-changed-files": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", - "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-30.4.1.tgz", + "integrity": "sha512-IuctmYrxi21iOSOaIXpJWalHyPAsVv0GeBHKDn8C1CA4W5htHn7INL+wdnL4Bo0+olEndvAFkmb++tIQJG+vvg==", "dev": true, "license": "MIT", "dependencies": { - "execa": "^5.0.0", - "jest-util": "^29.7.0", + "execa": "^5.1.1", + "jest-util": "30.4.1", "p-limit": "^3.1.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-circus": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", - "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", + "version": "30.4.2", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-30.4.2.tgz", + "integrity": "sha512-rvHH7VlY6LgbJXJTQ87GW62g1FntOtbhh0zT+v04kC+pgL6aBKyYINXxWukCpj3dcIBMw5/XUbtDS9dU9JTXeQ==", "dev": true, "license": "MIT", "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/expect": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/types": "^29.6.3", + "@jest/environment": "30.4.1", + "@jest/expect": "30.4.1", + "@jest/test-result": "30.4.1", + "@jest/types": "30.4.1", "@types/node": "*", - "chalk": "^4.0.0", + "chalk": "^4.1.2", "co": "^4.6.0", - "dedent": "^1.0.0", - "is-generator-fn": "^2.0.0", - "jest-each": "^29.7.0", - "jest-matcher-utils": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-runtime": "^29.7.0", - "jest-snapshot": "^29.7.0", - "jest-util": "^29.7.0", + "dedent": "^1.6.0", + "is-generator-fn": "^2.1.0", + "jest-each": "30.4.1", + "jest-matcher-utils": "30.4.1", + "jest-message-util": "30.4.1", + "jest-runtime": "30.4.2", + "jest-snapshot": "30.4.1", + "jest-util": "30.4.1", "p-limit": "^3.1.0", - "pretty-format": "^29.7.0", - "pure-rand": "^6.0.0", + "pretty-format": "30.4.1", + "pure-rand": "^7.0.0", "slash": "^3.0.0", - "stack-utils": "^2.0.3" + "stack-utils": "^2.0.6" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-cli": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", - "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", + "version": "30.4.2", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-30.4.2.tgz", + "integrity": "sha512-jfA2ocvVHMXS2QijrJ0d31ektP+d/W0T5RpcTX2Pq+3sVqHlsXVCM2+FmwpL+bdY8OfHpIg9xMxLF17Zg0U49Q==", "dev": true, "license": "MIT", "dependencies": { - "@jest/core": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/types": "^29.6.3", - "chalk": "^4.0.0", - "create-jest": "^29.7.0", - "exit": "^0.1.2", - "import-local": "^3.0.2", - "jest-config": "^29.7.0", - "jest-util": "^29.7.0", - "jest-validate": "^29.7.0", - "yargs": "^17.3.1" + "@jest/core": "30.4.2", + "@jest/test-result": "30.4.1", + "@jest/types": "30.4.1", + "chalk": "^4.1.2", + "exit-x": "^0.2.2", + "import-local": "^3.2.0", + "jest-config": "30.4.2", + "jest-util": "30.4.1", + "jest-validate": "30.4.1", + "yargs": "^17.7.2" }, "bin": { "jest": "bin/jest.js" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" }, "peerDependencies": { "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" @@ -3168,215 +3699,211 @@ } }, "node_modules/jest-config": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", - "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/core": "^7.11.6", - "@jest/test-sequencer": "^29.7.0", - "@jest/types": "^29.6.3", - "babel-jest": "^29.7.0", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "deepmerge": "^4.2.2", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "jest-circus": "^29.7.0", - "jest-environment-node": "^29.7.0", - "jest-get-type": "^29.6.3", - "jest-regex-util": "^29.6.3", - "jest-resolve": "^29.7.0", - "jest-runner": "^29.7.0", - "jest-util": "^29.7.0", - "jest-validate": "^29.7.0", - "micromatch": "^4.0.4", + "version": "30.4.2", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-30.4.2.tgz", + "integrity": "sha512-rNHAShJQqQwFNoL0hbf3BphSBOWnpOUAKvidLS/AjNVLPfoj5mSf4jQMfW3cYOs6hXeZC7nF7mDHaBnbxELOzg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.27.4", + "@jest/get-type": "30.1.0", + "@jest/pattern": "30.4.0", + "@jest/test-sequencer": "30.4.1", + "@jest/types": "30.4.1", + "babel-jest": "30.4.1", + "chalk": "^4.1.2", + "ci-info": "^4.2.0", + "deepmerge": "^4.3.1", + "glob": "^10.5.0", + "graceful-fs": "^4.2.11", + "jest-circus": "30.4.2", + "jest-docblock": "30.4.0", + "jest-environment-node": "30.4.1", + "jest-regex-util": "30.4.0", + "jest-resolve": "30.4.1", + "jest-runner": "30.4.2", + "jest-util": "30.4.1", + "jest-validate": "30.4.1", "parse-json": "^5.2.0", - "pretty-format": "^29.7.0", + "pretty-format": "30.4.1", "slash": "^3.0.0", "strip-json-comments": "^3.1.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" }, "peerDependencies": { "@types/node": "*", + "esbuild-register": ">=3.4.0", "ts-node": ">=9.0.0" }, "peerDependenciesMeta": { "@types/node": { "optional": true }, + "esbuild-register": { + "optional": true + }, "ts-node": { "optional": true } } }, "node_modules/jest-diff": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", - "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-30.4.1.tgz", + "integrity": "sha512-CRpFK0RtLriVDGcPPAnR6HMVI8bSR2jnUIgralhauzYQZIb4RH9AtEInTuQr65LmmGggGcRT6HIASxwqsVsmlA==", "dev": true, "license": "MIT", "dependencies": { - "chalk": "^4.0.0", - "diff-sequences": "^29.6.3", - "jest-get-type": "^29.6.3", - "pretty-format": "^29.7.0" + "@jest/diff-sequences": "30.4.0", + "@jest/get-type": "30.1.0", + "chalk": "^4.1.2", + "pretty-format": "30.4.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-docblock": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", - "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", + "version": "30.4.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-30.4.0.tgz", + "integrity": "sha512-ZPMabUZCx5MpbZ2eBYSvZ0J8fvo3dR9oM+eeUpb3aKNQFuS2tu3Duw1TNlMoP8k3WQgKGJuhcMFvwcVuq6T7oA==", "dev": true, "license": "MIT", "dependencies": { - "detect-newline": "^3.0.0" + "detect-newline": "^3.1.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-each": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", - "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-30.4.1.tgz", + "integrity": "sha512-/8MJbH6fuj48TstjrMf+u/pd06Qezz5xOXvZA6442heNOWr8bdeoGZX2d9fCn028CoMgYmroH9//zky5GfyYmA==", "dev": true, "license": "MIT", "dependencies": { - "@jest/types": "^29.6.3", - "chalk": "^4.0.0", - "jest-get-type": "^29.6.3", - "jest-util": "^29.7.0", - "pretty-format": "^29.7.0" + "@jest/get-type": "30.1.0", + "@jest/types": "30.4.1", + "chalk": "^4.1.2", + "jest-util": "30.4.1", + "pretty-format": "30.4.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-environment-node": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", - "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-30.4.1.tgz", + "integrity": "sha512-4FZYVOk85hz2AyT6BbarKy9u37g6DbrDyCdFhsnDdXqyrueYQvB+0zO4f/kqLCRD0BsPRXPMNJeQwihKZV8naw==", "dev": true, "license": "MIT", "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/fake-timers": "^29.7.0", - "@jest/types": "^29.6.3", + "@jest/environment": "30.4.1", + "@jest/fake-timers": "30.4.1", + "@jest/types": "30.4.1", "@types/node": "*", - "jest-mock": "^29.7.0", - "jest-util": "^29.7.0" + "jest-mock": "30.4.1", + "jest-util": "30.4.1", + "jest-validate": "30.4.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-get-type": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", - "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-haste-map": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", - "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-30.4.1.tgz", + "integrity": "sha512-rFrcONd8jeFsyw+Z9CrScJgglRf2+NFmNam8dKu7n+SoHqNYT47mn0DdEcVUZJpvh7Iz6/si7f7yUH7GJHVgnw==", "dev": true, "license": "MIT", "dependencies": { - "@jest/types": "^29.6.3", - "@types/graceful-fs": "^4.1.3", + "@jest/types": "30.4.1", "@types/node": "*", - "anymatch": "^3.0.3", - "fb-watchman": "^2.0.0", - "graceful-fs": "^4.2.9", - "jest-regex-util": "^29.6.3", - "jest-util": "^29.7.0", - "jest-worker": "^29.7.0", - "micromatch": "^4.0.4", + "anymatch": "^3.1.3", + "fb-watchman": "^2.0.2", + "graceful-fs": "^4.2.11", + "jest-regex-util": "30.4.0", + "jest-util": "30.4.1", + "jest-worker": "30.4.1", + "picomatch": "^4.0.3", "walker": "^1.0.8" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" }, "optionalDependencies": { - "fsevents": "^2.3.2" + "fsevents": "^2.3.3" } }, "node_modules/jest-leak-detector": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", - "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-30.4.1.tgz", + "integrity": "sha512-IpmyiioeHxiWDhesHnUFmOxcTzwCwKpgACgWajtAP+nYQXiY7DakTxB6Bx9JFiRMljr0AX1PvnQdaU1KFoz6NQ==", "dev": true, "license": "MIT", "dependencies": { - "jest-get-type": "^29.6.3", - "pretty-format": "^29.7.0" + "@jest/get-type": "30.1.0", + "pretty-format": "30.4.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-matcher-utils": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", - "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-30.4.1.tgz", + "integrity": "sha512-zvYfX5CaeEkFrrLS9suWe9rvJrm9J1Iv3ua8kIBv9GEPzcnsfBf0bob37la7s67fs0nlBC3EuvkOLnXQKxtx4A==", "dev": true, "license": "MIT", "dependencies": { - "chalk": "^4.0.0", - "jest-diff": "^29.7.0", - "jest-get-type": "^29.6.3", - "pretty-format": "^29.7.0" + "@jest/get-type": "30.1.0", + "chalk": "^4.1.2", + "jest-diff": "30.4.1", + "pretty-format": "30.4.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-message-util": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", - "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.4.1.tgz", + "integrity": "sha512-kwCKIvq0MCW1HzLoGola9Te6JUdzgV0loyKJ3Qghrkz9i5/RRIHsL95BMQc2HBBhlBKC4j22K9p11TGHH8RBpQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.12.13", - "@jest/types": "^29.6.3", - "@types/stack-utils": "^2.0.0", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "micromatch": "^4.0.4", - "pretty-format": "^29.7.0", + "@babel/code-frame": "^7.27.1", + "@jest/types": "30.4.1", + "@types/stack-utils": "^2.0.3", + "chalk": "^4.1.2", + "graceful-fs": "^4.2.11", + "jest-util": "30.4.1", + "picomatch": "^4.0.3", + "pretty-format": "30.4.1", "slash": "^3.0.0", - "stack-utils": "^2.0.3" + "stack-utils": "^2.0.6" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-mock": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", - "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-30.4.1.tgz", + "integrity": "sha512-/i8SVb8/NSB7RfNi8gfqu8gxLV23KaL5EpAttyb9iz8qWRIqXRLflycz/32wXsYkOnaUlx8NAKnJYtpsmXUmfw==", "dev": true, "license": "MIT", "dependencies": { - "@jest/types": "^29.6.3", + "@jest/types": "30.4.1", "@types/node": "*", - "jest-util": "^29.7.0" + "jest-util": "30.4.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-pnp-resolver": { @@ -3398,153 +3925,154 @@ } }, "node_modules/jest-regex-util": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", - "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", + "version": "30.4.0", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-30.4.0.tgz", + "integrity": "sha512-mWlvLviKIgIQ8VCuM1xRdD0TWp3zlzionlmDBjuXVBs+VkmXq6FgW9T4Emr7oGz/Rk6feDCGyiugolcQEyp3mg==", "dev": true, "license": "MIT", "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-resolve": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", - "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-30.4.1.tgz", + "integrity": "sha512-Zry8Yq/yJcNAZ7dJ5F2heic8AheXvbFZ7XI5V+h28nrYZ7Qoyy4dItq8OodjnYD270mvX+ZudmrNV9cysqhW5Q==", "dev": true, "license": "MIT", "dependencies": { - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "jest-pnp-resolver": "^1.2.2", - "jest-util": "^29.7.0", - "jest-validate": "^29.7.0", - "resolve": "^1.20.0", - "resolve.exports": "^2.0.0", - "slash": "^3.0.0" + "chalk": "^4.1.2", + "graceful-fs": "^4.2.11", + "jest-haste-map": "30.4.1", + "jest-pnp-resolver": "^1.2.3", + "jest-util": "30.4.1", + "jest-validate": "30.4.1", + "slash": "^3.0.0", + "unrs-resolver": "^1.7.11" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-resolve-dependencies": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", - "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", + "version": "30.4.2", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-30.4.2.tgz", + "integrity": "sha512-gDiVh1I+GxYzz9oXlyw+1wv6VOYX1WYxMOfjsA3iGKePV2oxmbHhwxfkALxNxYy1ciw6APWwkW2zZONwP97aEQ==", "dev": true, "license": "MIT", "dependencies": { - "jest-regex-util": "^29.6.3", - "jest-snapshot": "^29.7.0" + "jest-regex-util": "30.4.0", + "jest-snapshot": "30.4.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-runner": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", - "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", + "version": "30.4.2", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-30.4.2.tgz", + "integrity": "sha512-2dw0PslVYXxffXGpLo+Ejad+KcI1Qkjn7f4X4619gf21oCUmL+SPfjqIa/losUem3yEOvfNZe/F1HWUcNpODcg==", "dev": true, "license": "MIT", "dependencies": { - "@jest/console": "^29.7.0", - "@jest/environment": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", + "@jest/console": "30.4.1", + "@jest/environment": "30.4.1", + "@jest/test-result": "30.4.1", + "@jest/transform": "30.4.1", + "@jest/types": "30.4.1", "@types/node": "*", - "chalk": "^4.0.0", + "chalk": "^4.1.2", "emittery": "^0.13.1", - "graceful-fs": "^4.2.9", - "jest-docblock": "^29.7.0", - "jest-environment-node": "^29.7.0", - "jest-haste-map": "^29.7.0", - "jest-leak-detector": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-resolve": "^29.7.0", - "jest-runtime": "^29.7.0", - "jest-util": "^29.7.0", - "jest-watcher": "^29.7.0", - "jest-worker": "^29.7.0", + "exit-x": "^0.2.2", + "graceful-fs": "^4.2.11", + "jest-docblock": "30.4.0", + "jest-environment-node": "30.4.1", + "jest-haste-map": "30.4.1", + "jest-leak-detector": "30.4.1", + "jest-message-util": "30.4.1", + "jest-resolve": "30.4.1", + "jest-runtime": "30.4.2", + "jest-util": "30.4.1", + "jest-watcher": "30.4.1", + "jest-worker": "30.4.1", "p-limit": "^3.1.0", "source-map-support": "0.5.13" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-runtime": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", - "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", + "version": "30.4.2", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-30.4.2.tgz", + "integrity": "sha512-3/5e8iPz2k/VLqlr8DgTftYyLUv8Su3FkCAO2/Od81UsUTpSxOrS6O5x5KkoQwyUjmpYyDJKeyAvg2T2nvpNkQ==", "dev": true, "license": "MIT", "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/fake-timers": "^29.7.0", - "@jest/globals": "^29.7.0", - "@jest/source-map": "^29.6.3", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", + "@jest/environment": "30.4.1", + "@jest/fake-timers": "30.4.1", + "@jest/globals": "30.4.1", + "@jest/source-map": "30.0.1", + "@jest/test-result": "30.4.1", + "@jest/transform": "30.4.1", + "@jest/types": "30.4.1", "@types/node": "*", - "chalk": "^4.0.0", - "cjs-module-lexer": "^1.0.0", - "collect-v8-coverage": "^1.0.0", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-mock": "^29.7.0", - "jest-regex-util": "^29.6.3", - "jest-resolve": "^29.7.0", - "jest-snapshot": "^29.7.0", - "jest-util": "^29.7.0", + "chalk": "^4.1.2", + "cjs-module-lexer": "^2.1.0", + "collect-v8-coverage": "^1.0.2", + "glob": "^10.5.0", + "graceful-fs": "^4.2.11", + "jest-haste-map": "30.4.1", + "jest-message-util": "30.4.1", + "jest-mock": "30.4.1", + "jest-regex-util": "30.4.0", + "jest-resolve": "30.4.1", + "jest-snapshot": "30.4.1", + "jest-util": "30.4.1", "slash": "^3.0.0", "strip-bom": "^4.0.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-snapshot": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", - "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/core": "^7.11.6", - "@babel/generator": "^7.7.2", - "@babel/plugin-syntax-jsx": "^7.7.2", - "@babel/plugin-syntax-typescript": "^7.7.2", - "@babel/types": "^7.3.3", - "@jest/expect-utils": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "babel-preset-current-node-syntax": "^1.0.0", - "chalk": "^4.0.0", - "expect": "^29.7.0", - "graceful-fs": "^4.2.9", - "jest-diff": "^29.7.0", - "jest-get-type": "^29.6.3", - "jest-matcher-utils": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0", - "natural-compare": "^1.4.0", - "pretty-format": "^29.7.0", - "semver": "^7.5.3" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-30.4.1.tgz", + "integrity": "sha512-tEOkkfOMppUyeiHwjZswOQ3lcnoTnws/q5FnGIaeIh/jmoU0ZlgMYRR8sTlTj+nNGCoJ0RDq6SfxGxCsyMTPmw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.27.4", + "@babel/generator": "^7.27.5", + "@babel/plugin-syntax-jsx": "^7.27.1", + "@babel/plugin-syntax-typescript": "^7.27.1", + "@babel/types": "^7.27.3", + "@jest/expect-utils": "30.4.1", + "@jest/get-type": "30.1.0", + "@jest/snapshot-utils": "30.4.1", + "@jest/transform": "30.4.1", + "@jest/types": "30.4.1", + "babel-preset-current-node-syntax": "^1.2.0", + "chalk": "^4.1.2", + "expect": "30.4.1", + "graceful-fs": "^4.2.11", + "jest-diff": "30.4.1", + "jest-matcher-utils": "30.4.1", + "jest-message-util": "30.4.1", + "jest-util": "30.4.1", + "pretty-format": "30.4.1", + "semver": "^7.7.2", + "synckit": "^0.11.8" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-snapshot/node_modules/semver": { - "version": "7.8.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.2.tgz", - "integrity": "sha512-c8jsqUZm3omBOI66G90z1Dyw5z622G8oLG+omfsHBJf3CWQTlOcwOjvOG6wtiNfW6anKm/eA39LMwMtMez2TiQ==", + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", "dev": true, "license": "ISC", "bin": { @@ -3555,39 +4083,39 @@ } }, "node_modules/jest-util": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", - "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-30.4.1.tgz", + "integrity": "sha512-vjQb1sACEiv13DKJMDToJpzVW0joCsIQrmbg0fi7CyOOt+g9jTuQl2A216pWRBYhOVt53XbL/2LbMKg1BECWOw==", "dev": true, "license": "MIT", "dependencies": { - "@jest/types": "^29.6.3", + "@jest/types": "30.4.1", "@types/node": "*", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "graceful-fs": "^4.2.9", - "picomatch": "^2.2.3" + "chalk": "^4.1.2", + "ci-info": "^4.2.0", + "graceful-fs": "^4.2.11", + "picomatch": "^4.0.3" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-validate": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", - "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-30.4.1.tgz", + "integrity": "sha512-PDWi4SOwLnwqNDfHZjOcsEFyZ4fc/2W2gVL3DEoyqnB6jCQMLRtfBong8s6omIw3lI0HWOus12xfnFmQtjW3fw==", "dev": true, "license": "MIT", "dependencies": { - "@jest/types": "^29.6.3", - "camelcase": "^6.2.0", - "chalk": "^4.0.0", - "jest-get-type": "^29.6.3", + "@jest/get-type": "30.1.0", + "@jest/types": "30.4.1", + "camelcase": "^6.3.0", + "chalk": "^4.1.2", "leven": "^3.1.0", - "pretty-format": "^29.7.0" + "pretty-format": "30.4.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-validate/node_modules/camelcase": { @@ -3604,39 +4132,40 @@ } }, "node_modules/jest-watcher": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", - "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-30.4.1.tgz", + "integrity": "sha512-/l9UonmvCwjHH7d2h3iAwIloLc1H0S8mJZ/LNK3i86hqwPAz8otUJjP9MfYtz9Tt77Su5FD2xGjZn8d31IZHlw==", "dev": true, "license": "MIT", "dependencies": { - "@jest/test-result": "^29.7.0", - "@jest/types": "^29.6.3", + "@jest/test-result": "30.4.1", + "@jest/types": "30.4.1", "@types/node": "*", - "ansi-escapes": "^4.2.1", - "chalk": "^4.0.0", + "ansi-escapes": "^4.3.2", + "chalk": "^4.1.2", "emittery": "^0.13.1", - "jest-util": "^29.7.0", - "string-length": "^4.0.1" + "jest-util": "30.4.1", + "string-length": "^4.0.2" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-worker": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", - "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-30.4.1.tgz", + "integrity": "sha512-SHynN/q/QD++iNyvMdy+WMmbCGk8jIsNcRxycXbWubSOhvo6T+j2afcfUSl+3hYsiBebOTo0cT7c2H7CXugu1g==", "dev": true, "license": "MIT", "dependencies": { "@types/node": "*", - "jest-util": "^29.7.0", + "@ungap/structured-clone": "^1.3.0", + "jest-util": "30.4.1", "merge-stream": "^2.0.0", - "supports-color": "^8.0.0" + "supports-color": "^8.1.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-worker/node_modules/supports-color": { @@ -3673,14 +4202,23 @@ "license": "MIT" }, "node_modules/js-yaml": { - "version": "3.14.2", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.2.tgz", - "integrity": "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.0.tgz", + "integrity": "sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], "license": "MIT", "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" @@ -3728,16 +4266,6 @@ "node": ">=6" } }, - "node_modules/kleur": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", - "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/leven": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", @@ -3828,9 +4356,9 @@ } }, "node_modules/make-dir/node_modules/semver": { - "version": "7.8.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.2.tgz", - "integrity": "sha512-c8jsqUZm3omBOI66G90z1Dyw5z622G8oLG+omfsHBJf3CWQTlOcwOjvOG6wtiNfW6anKm/eA39LMwMtMez2TiQ==", + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", "dev": true, "license": "ISC", "bin": { @@ -3857,20 +4385,6 @@ "dev": true, "license": "MIT" }, - "node_modules/micromatch": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", - "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", - "dev": true, - "license": "MIT", - "dependencies": { - "braces": "^3.0.3", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, "node_modules/mimic-fn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", @@ -3882,16 +4396,29 @@ } }, "node_modules/minimatch": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", - "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", + "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", "dev": true, "license": "ISC", "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.2" }, "engines": { - "node": "*" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minipass": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", + "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=16 || 14 >=14.17" } }, "node_modules/mlly": { @@ -3926,6 +4453,22 @@ "thenify-all": "^1.0.0" } }, + "node_modules/napi-postinstall": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/napi-postinstall/-/napi-postinstall-0.3.4.tgz", + "integrity": "sha512-PHI5f1O0EP5xJ9gQmFGMS6IZcrVvTjpXjz7Na41gTE7eE2hK11lg04CECCYEEjdc17EV4DO+fkGEtt7TpTaTiQ==", + "dev": true, + "license": "MIT", + "bin": { + "napi-postinstall": "lib/cli.js" + }, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/napi-postinstall" + } + }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -3941,9 +4484,9 @@ "license": "MIT" }, "node_modules/node-releases": { - "version": "2.0.47", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.47.tgz", - "integrity": "sha512-Uzmd6LXpouKo8EUK68IjH4+E01w/hXyV3R3g/geCJo+rXLNfh1xucB+LOzYEOQPSiUK3h/xZf0cQGcSsmyL2Og==", + "version": "2.0.51", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.51.tgz", + "integrity": "sha512-wRNIrw4DmVLKQlbgOMdkMx27Wrpzes2hh5Jtbi2bjPd+4wJstWIqP5A+lscnqbm0xxmT5Bpg8Lec5ItEBwx6BQ==", "dev": true, "license": "MIT", "engines": { @@ -4064,6 +4607,13 @@ "node": ">=6" } }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, "node_modules/parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -4113,12 +4663,29 @@ "node": ">=8" } }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", "dev": true, - "license": "MIT" + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" }, "node_modules/pathe": { "version": "2.0.3", @@ -4135,13 +4702,13 @@ "license": "ISC" }, "node_modules/picomatch": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", - "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", "dev": true, "license": "MIT", "engines": { - "node": ">=8.6" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/jonschlinkert" @@ -4226,18 +4793,19 @@ } }, "node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "version": "30.4.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-30.4.1.tgz", + "integrity": "sha512-K6KiKMHTL4jjX4u3Kir2EW07nRfcqVTXIImx50wbjHQTcZPgg+gjVeNTIT3l3L1Rd4UefxfogquC9J37SoFyyw==", "dev": true, "license": "MIT", "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" + "@jest/schemas": "30.4.1", + "ansi-styles": "^5.2.0", + "react-is-18": "npm:react-is@^18.3.1", + "react-is-19": "npm:react-is@^19.2.5" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/pretty-format/node_modules/ansi-styles": { @@ -4253,24 +4821,10 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/prompts": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", - "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "kleur": "^3.0.3", - "sisteransi": "^1.0.5" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/pure-rand": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", - "integrity": "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-7.0.1.tgz", + "integrity": "sha512-oTUZM/NAZS8p7ANR3SHh30kXB+zK2r2BPcEn/awJIbOvq82WoMN4p62AWWp3Hhw50G0xMsw1mhIBLqHw64EcNQ==", "dev": true, "funding": [ { @@ -4284,13 +4838,22 @@ ], "license": "MIT" }, - "node_modules/react-is": { + "node_modules/react-is-18": { + "name": "react-is", "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", "dev": true, "license": "MIT" }, + "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==", + "dev": true, + "license": "MIT" + }, "node_modules/readdirp": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", @@ -4315,28 +4878,6 @@ "node": ">=0.10.0" } }, - "node_modules/resolve": { - "version": "1.22.12", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.12.tgz", - "integrity": "sha512-TyeJ1zif53BPfHootBGwPRYT1RUt6oGWsaQr8UyZW/eAm9bKoijtvruSDEmZHm92CwS9nj7/fWttqPCgzep8CA==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "is-core-module": "^2.16.1", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/resolve-cwd": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", @@ -4360,20 +4901,10 @@ "node": ">=8" } }, - "node_modules/resolve.exports": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.3.tgz", - "integrity": "sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - } - }, "node_modules/rollup": { - "version": "4.61.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.61.1.tgz", - "integrity": "sha512-I4KW6iuRpuu2uHBLraZ1wNZe0DP7lnRha+VJ9tNaYVaVgKhW0aI3h4RYnoRPeql0flHm/Co55b7snEDcOfOJrA==", + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.62.2.tgz", + "integrity": "sha512-RFnrW4lhXA3s3eqHDZvN654g8OTjzRfqpIRJYczCGB6HzphckVAi/Qh4tbPUbRuDi7s1Llv8g/NspLkttY3gTA==", "dev": true, "license": "MIT", "dependencies": { @@ -4387,31 +4918,31 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.61.1", - "@rollup/rollup-android-arm64": "4.61.1", - "@rollup/rollup-darwin-arm64": "4.61.1", - "@rollup/rollup-darwin-x64": "4.61.1", - "@rollup/rollup-freebsd-arm64": "4.61.1", - "@rollup/rollup-freebsd-x64": "4.61.1", - "@rollup/rollup-linux-arm-gnueabihf": "4.61.1", - "@rollup/rollup-linux-arm-musleabihf": "4.61.1", - "@rollup/rollup-linux-arm64-gnu": "4.61.1", - "@rollup/rollup-linux-arm64-musl": "4.61.1", - "@rollup/rollup-linux-loong64-gnu": "4.61.1", - "@rollup/rollup-linux-loong64-musl": "4.61.1", - "@rollup/rollup-linux-ppc64-gnu": "4.61.1", - "@rollup/rollup-linux-ppc64-musl": "4.61.1", - "@rollup/rollup-linux-riscv64-gnu": "4.61.1", - "@rollup/rollup-linux-riscv64-musl": "4.61.1", - "@rollup/rollup-linux-s390x-gnu": "4.61.1", - "@rollup/rollup-linux-x64-gnu": "4.61.1", - "@rollup/rollup-linux-x64-musl": "4.61.1", - "@rollup/rollup-openbsd-x64": "4.61.1", - "@rollup/rollup-openharmony-arm64": "4.61.1", - "@rollup/rollup-win32-arm64-msvc": "4.61.1", - "@rollup/rollup-win32-ia32-msvc": "4.61.1", - "@rollup/rollup-win32-x64-gnu": "4.61.1", - "@rollup/rollup-win32-x64-msvc": "4.61.1", + "@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", "fsevents": "~2.3.2" } }, @@ -4449,18 +4980,17 @@ } }, "node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true, - "license": "ISC" - }, - "node_modules/sisteransi": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", - "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "dev": true, - "license": "MIT" + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } }, "node_modules/slash": { "version": "3.0.0", @@ -4493,13 +5023,6 @@ "source-map": "^0.6.0" } }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true, - "license": "BSD-3-Clause" - }, "node_modules/stack-utils": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", @@ -4507,27 +5030,69 @@ "dev": true, "license": "MIT", "dependencies": { - "escape-string-regexp": "^2.0.0" + "escape-string-regexp": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/string-length": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", + "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "char-regex": "^1.0.2", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/string-length/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/string-length/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" }, "engines": { - "node": ">=10" + "node": ">=8" } }, - "node_modules/string-length": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", - "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", + "node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, "license": "MIT", "dependencies": { - "char-regex": "^1.0.2", - "strip-ansi": "^6.0.0" + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" }, "engines": { - "node": ">=10" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/string-width": { + "node_modules/string-width-cjs": { + "name": "string-width", "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", @@ -4542,7 +5107,54 @@ "node": ">=8" } }, + "node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-ansi": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", + "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.2.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", @@ -4555,6 +5167,16 @@ "node": ">=8" } }, + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/strip-bom": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", @@ -4624,17 +5246,20 @@ "node": ">=8" } }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "node_modules/synckit": { + "version": "0.11.13", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.11.13.tgz", + "integrity": "sha512-eNRKgb3z66Yp3D2CixVujOUvXLFUTij/zVnV8KRyvFdQwpz7I5DS8UfRkTeLzb64u+dkzDSdelE24izu+zSSUg==", "dev": true, "license": "MIT", + "dependencies": { + "@pkgr/core": "^0.3.6" + }, "engines": { - "node": ">= 0.4" + "node": "^14.18.0 || >=16.0.0" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://opencollective.com/synckit" } }, "node_modules/test-exclude": { @@ -4652,6 +5277,52 @@ "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", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/test-exclude/node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/thenify": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", @@ -4699,37 +5370,6 @@ "url": "https://github.com/sponsors/SuperchupuDev" } }, - "node_modules/tinyglobby/node_modules/fdir": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", - "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12.0.0" - }, - "peerDependencies": { - "picomatch": "^3 || ^4" - }, - "peerDependenciesMeta": { - "picomatch": { - "optional": true - } - } - }, - "node_modules/tinyglobby/node_modules/picomatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", - "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, "node_modules/tmpl": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", @@ -4737,19 +5377,6 @@ "dev": true, "license": "BSD-3-Clause" }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, "node_modules/tree-kill": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", @@ -4768,9 +5395,9 @@ "license": "Apache-2.0" }, "node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", "dev": true, "license": "0BSD" }, @@ -4861,9 +5488,9 @@ } }, "node_modules/typescript": { - "version": "5.4.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz", - "integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==", + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", "bin": { @@ -4882,21 +5509,59 @@ "license": "MIT" }, "node_modules/undici": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.26.0.tgz", - "integrity": "sha512-4yqz8a3n5HmGTlsbADNtr/dJlhkh/55Rq798G6ibiULcXbDtaLpTl1pvdqcbFfeoj3iSi52lePFM7h9H21cw/A==", + "version": "6.27.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.27.0.tgz", + "integrity": "sha512-YmfV3YnEDzXRC5lZ2jWtWWHKGUm1zIt8AhesR1tens+HTNv+YZlN/dp6G727LOvMJ8xjP9Be7Y2Sdr96LDm+pg==", "license": "MIT", "engines": { "node": ">=18.17" } }, "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz", + "integrity": "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==", "dev": true, "license": "MIT" }, + "node_modules/unrs-resolver": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/unrs-resolver/-/unrs-resolver-1.12.2.tgz", + "integrity": "sha512-dmlRxBJJayXjqTwC+JtF1HhJmgf3ftQ3YejFcZrf4+KKtJv0qDsK1pjqaaVjG7wJ5NJ6UVP1OqRMQ71Z4C3rxQ==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "napi-postinstall": "^0.3.4" + }, + "funding": { + "url": "https://opencollective.com/unrs-resolver" + }, + "optionalDependencies": { + "@unrs/resolver-binding-android-arm-eabi": "1.12.2", + "@unrs/resolver-binding-android-arm64": "1.12.2", + "@unrs/resolver-binding-darwin-arm64": "1.12.2", + "@unrs/resolver-binding-darwin-x64": "1.12.2", + "@unrs/resolver-binding-freebsd-x64": "1.12.2", + "@unrs/resolver-binding-linux-arm-gnueabihf": "1.12.2", + "@unrs/resolver-binding-linux-arm-musleabihf": "1.12.2", + "@unrs/resolver-binding-linux-arm64-gnu": "1.12.2", + "@unrs/resolver-binding-linux-arm64-musl": "1.12.2", + "@unrs/resolver-binding-linux-loong64-gnu": "1.12.2", + "@unrs/resolver-binding-linux-loong64-musl": "1.12.2", + "@unrs/resolver-binding-linux-ppc64-gnu": "1.12.2", + "@unrs/resolver-binding-linux-riscv64-gnu": "1.12.2", + "@unrs/resolver-binding-linux-riscv64-musl": "1.12.2", + "@unrs/resolver-binding-linux-s390x-gnu": "1.12.2", + "@unrs/resolver-binding-linux-x64-gnu": "1.12.2", + "@unrs/resolver-binding-linux-x64-musl": "1.12.2", + "@unrs/resolver-binding-openharmony-arm64": "1.12.2", + "@unrs/resolver-binding-wasm32-wasi": "1.12.2", + "@unrs/resolver-binding-win32-arm64-msvc": "1.12.2", + "@unrs/resolver-binding-win32-ia32-msvc": "1.12.2", + "@unrs/resolver-binding-win32-x64-msvc": "1.12.2" + } + }, "node_modules/update-browserslist-db": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", @@ -4970,6 +5635,25 @@ } }, "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", @@ -4987,6 +5671,64 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -4995,17 +5737,17 @@ "license": "ISC" }, "node_modules/write-file-atomic": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", - "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-5.0.1.tgz", + "integrity": "sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==", "dev": true, "license": "ISC", "dependencies": { "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.7" + "signal-exit": "^4.0.1" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, "node_modules/y18n": { @@ -5026,9 +5768,9 @@ "license": "ISC" }, "node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "version": "17.7.3", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.3.tgz", + "integrity": "sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g==", "dev": true, "license": "MIT", "dependencies": { @@ -5054,6 +5796,51 @@ "node": ">=12" } }, + "node_modules/yargs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/yargs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", diff --git a/package.json b/package.json index 581a191..a791cae 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "node-appwrite", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API", - "version": "26.2.0", + "version": "27.0.0", "license": "BSD-3-Clause", "main": "dist/index.js", "type": "commonjs", @@ -43,15 +43,19 @@ }, "devDependencies": { "@types/json-bigint": "1.0.4", - "@types/node": "20.11.25", + "@types/node": "26.1.1", "tsup": "^8.5.1", "esbuild-plugin-file-path-extensions": "^2.0.0", - "tslib": "2.6.2", - "typescript": "5.4.2", - "jest": "^29.7.0" + "tslib": "2.8.1", + "typescript": "5.9.3", + "jest": "^30.4.2" }, "dependencies": { "json-bigint": "1.0.0", - "undici": "^6.26.0" + "undici": "^6.27.0" + }, + "overrides": { + "esbuild": "^0.28.1", + "js-yaml": "^4.2.0" } } diff --git a/src/client.ts b/src/client.ts index 5bc4e36..4fb7ac6 100644 --- a/src/client.ts +++ b/src/client.ts @@ -73,7 +73,7 @@ class AppwriteException extends Error { } function getUserAgent() { - let ua = 'AppwriteNodeJSSDK/26.2.0'; + let ua = 'AppwriteNodeJSSDK/27.0.0'; // `process` is a global in Node.js, but not fully available in all runtimes. const platform: string[] = []; @@ -115,6 +115,7 @@ class Client { project: '', key: '', jwt: '', + bearer: '', locale: '', session: '', forwardeduseragent: '', @@ -128,7 +129,7 @@ class Client { 'x-sdk-name': 'Node.js', 'x-sdk-platform': 'server', 'x-sdk-language': 'nodejs', - 'x-sdk-version': '26.2.0', + 'x-sdk-version': '27.0.0', 'user-agent' : getUserAgent(), 'X-Appwrite-Response-Format': '1.9.5', }; @@ -245,6 +246,20 @@ class Client { this.config.jwt = value; return this; } + /** + * Set Bearer + * + * The OAuth access token to authenticate with + * + * @param value string + * + * @return {this} + */ + setBearer(value: string): this { + this.headers['Authorization'] = value; + this.config.bearer = value; + return this; + } /** * Set Locale * @@ -316,7 +331,7 @@ class Client { /** * Set ImpersonateUserId * - * Impersonate a user by ID on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data. + * Impersonate a user by ID * * @param value string * @@ -330,7 +345,7 @@ class Client { /** * Set ImpersonateUserEmail * - * Impersonate a user by email on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data. + * Impersonate a user by email * * @param value string * @@ -344,7 +359,7 @@ class Client { /** * Set ImpersonateUserPhone * - * Impersonate a user by phone on an already user-authenticated request. Requires the current request to be authenticated as a user with impersonator capability; X-Appwrite-Key alone is not sufficient. Impersonator users are intentionally granted users.read so they can discover a target before impersonation begins. Internal audit logs still attribute actions to the original impersonator and record the impersonated target only in internal audit payload data. + * Impersonate a user by phone * * @param value string * @@ -660,6 +675,7 @@ class Client { async ping(): Promise { return this.call('GET', new URL(this.config.endpoint + '/ping'), { 'X-Appwrite-Project': this.config.project, + 'accept': 'application/json', }); } diff --git a/src/enums/billing-plan-group.ts b/src/enums/billing-plan-group.ts new file mode 100644 index 0000000..8aa025b --- /dev/null +++ b/src/enums/billing-plan-group.ts @@ -0,0 +1,5 @@ +export enum BillingPlanGroup { + Starter = 'starter', + Pro = 'pro', + Scale = 'scale', +} \ No newline at end of file diff --git a/src/enums/database-status.ts b/src/enums/database-status.ts new file mode 100644 index 0000000..9e9cb51 --- /dev/null +++ b/src/enums/database-status.ts @@ -0,0 +1,5 @@ +export enum DatabaseStatus { + Provisioning = 'provisioning', + Ready = 'ready', + Failed = 'failed', +} \ No newline at end of file diff --git a/src/enums/health-antivirus-status.ts b/src/enums/health-antivirus-status.ts deleted file mode 100644 index d4da4c4..0000000 --- a/src/enums/health-antivirus-status.ts +++ /dev/null @@ -1,5 +0,0 @@ -export enum HealthAntivirusStatus { - Disabled = 'disabled', - Offline = 'offline', - Online = 'online', -} \ No newline at end of file diff --git a/src/enums/health-check-status.ts b/src/enums/health-check-status.ts deleted file mode 100644 index 9dbc681..0000000 --- a/src/enums/health-check-status.ts +++ /dev/null @@ -1,4 +0,0 @@ -export enum HealthCheckStatus { - Pass = 'pass', - Fail = 'fail', -} \ No newline at end of file diff --git a/src/enums/health-queue-name.ts b/src/enums/health-queue-name.ts deleted file mode 100644 index 81320f8..0000000 --- a/src/enums/health-queue-name.ts +++ /dev/null @@ -1,15 +0,0 @@ -export enum HealthQueueName { - V1database = 'v1-database', - V1deletes = 'v1-deletes', - V1audits = 'v1-audits', - V1mails = 'v1-mails', - V1functions = 'v1-functions', - V1statsresources = 'v1-stats-resources', - V1statsusage = 'v1-stats-usage', - V1webhooks = 'v1-webhooks', - V1certificates = 'v1-certificates', - V1builds = 'v1-builds', - V1screenshots = 'v1-screenshots', - V1messaging = 'v1-messaging', - V1migrations = 'v1-migrations', -} \ No newline at end of file diff --git a/src/enums/o-auth-2-oidc-prompt.ts b/src/enums/o-auth-2-oidc-prompt.ts new file mode 100644 index 0000000..daa1ef0 --- /dev/null +++ b/src/enums/o-auth-2-oidc-prompt.ts @@ -0,0 +1,6 @@ +export enum OAuth2OidcPrompt { + None = 'none', + Login = 'login', + Consent = 'consent', + SelectAccount = 'select_account', +} \ No newline at end of file diff --git a/src/enums/o-auth-provider.ts b/src/enums/o-auth-provider.ts index cc9e340..e7136d6 100644 --- a/src/enums/o-auth-provider.ts +++ b/src/enums/o-auth-provider.ts @@ -1,6 +1,7 @@ export enum OAuthProvider { Amazon = 'amazon', Apple = 'apple', + Appwrite = 'appwrite', Auth0 = 'auth0', Authentik = 'authentik', Autodesk = 'autodesk', diff --git a/src/enums/organization-key-scopes.ts b/src/enums/organization-key-scopes.ts index 05c96d2..a4ff3fb 100644 --- a/src/enums/organization-key-scopes.ts +++ b/src/enums/organization-key-scopes.ts @@ -5,6 +5,10 @@ export enum OrganizationKeyScopes { DevKeysWrite = 'devKeys.write', OrganizationKeysRead = 'organization.keys.read', OrganizationKeysWrite = 'organization.keys.write', + OrganizationMembershipsRead = 'organization.memberships.read', + OrganizationMembershipsWrite = 'organization.memberships.write', + OrganizationRead = 'organization.read', + OrganizationWrite = 'organization.write', DomainsRead = 'domains.read', DomainsWrite = 'domains.write', KeysRead = 'keys.read', diff --git a/src/enums/project-key-scopes.ts b/src/enums/project-key-scopes.ts index 927acf8..7f97ba9 100644 --- a/src/enums/project-key-scopes.ts +++ b/src/enums/project-key-scopes.ts @@ -11,10 +11,12 @@ export enum ProjectKeyScopes { PoliciesWrite = 'policies.write', ProjectPoliciesRead = 'project.policies.read', ProjectPoliciesWrite = 'project.policies.write', + ProjectOauth2Read = 'project.oauth2.read', + ProjectOauth2Write = 'project.oauth2.write', TemplatesRead = 'templates.read', TemplatesWrite = 'templates.write', - Oauth2Read = 'oauth2.read', - Oauth2Write = 'oauth2.write', + StagesRead = 'stages.read', + StagesWrite = 'stages.write', UsersRead = 'users.read', UsersWrite = 'users.write', SessionsRead = 'sessions.read', @@ -95,5 +97,7 @@ export enum ProjectKeyScopes { EventsRead = 'events.read', AppsRead = 'apps.read', AppsWrite = 'apps.write', + Oauth2Read = 'oauth2.read', + Oauth2Write = 'oauth2.write', UsageRead = 'usage.read', } \ No newline at end of file diff --git a/src/enums/project-o-auth-2-oidc-prompt.ts b/src/enums/project-o-auth-2-oidc-prompt.ts new file mode 100644 index 0000000..6d346b1 --- /dev/null +++ b/src/enums/project-o-auth-2-oidc-prompt.ts @@ -0,0 +1,6 @@ +export enum ProjectOAuth2OidcPrompt { + None = 'none', + Login = 'login', + Consent = 'consent', + SelectAccount = 'select_account', +} \ No newline at end of file diff --git a/src/enums/project-o-auth-provider-id.ts b/src/enums/project-o-auth-provider-id.ts index e1ed1b8..125ee88 100644 --- a/src/enums/project-o-auth-provider-id.ts +++ b/src/enums/project-o-auth-provider-id.ts @@ -1,6 +1,7 @@ export enum ProjectOAuthProviderId { Amazon = 'amazon', Apple = 'apple', + Appwrite = 'appwrite', Auth0 = 'auth0', Authentik = 'authentik', Autodesk = 'autodesk', diff --git a/src/enums/project-policy-id.ts b/src/enums/project-policy-id.ts index be2ea72..823727a 100644 --- a/src/enums/project-policy-id.ts +++ b/src/enums/project-policy-id.ts @@ -12,4 +12,5 @@ export enum ProjectPolicyId { Denyaliasedemail = 'deny-aliased-email', Denydisposableemail = 'deny-disposable-email', Denyfreeemail = 'deny-free-email', + Denycorporateemail = 'deny-corporate-email', } \ No newline at end of file diff --git a/src/enums/project-service-id.ts b/src/enums/project-service-id.ts index 01f844a..0da78c5 100644 --- a/src/enums/project-service-id.ts +++ b/src/enums/project-service-id.ts @@ -17,4 +17,5 @@ export enum ProjectServiceId { Migrations = 'migrations', Messaging = 'messaging', Advisor = 'advisor', + Oauth2 = 'oauth2', } \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 6e11f54..efa797e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,7 +6,6 @@ export { Backups } from './services/backups'; export { Databases } from './services/databases'; export { Functions } from './services/functions'; export { Graphql } from './services/graphql'; -export { Health } from './services/health'; export { Locale } from './services/locale'; export { Messaging } from './services/messaging'; export { Organization } from './services/organization'; @@ -19,7 +18,6 @@ export { Storage } from './services/storage'; export { TablesDB } from './services/tables-db'; export { Teams } from './services/teams'; export { Tokens } from './services/tokens'; -export { Usage } from './services/usage'; export { Users } from './services/users'; export { Webhooks } from './services/webhooks'; export type { Models, Payload, UploadProgress } from './client'; @@ -49,13 +47,13 @@ export { TemplateReferenceType } from './enums/template-reference-type'; export { VCSReferenceType } from './enums/vcs-reference-type'; export { DeploymentDownloadType } from './enums/deployment-download-type'; export { ExecutionMethod } from './enums/execution-method'; -export { HealthQueueName } from './enums/health-queue-name'; export { MessagePriority } from './enums/message-priority'; export { SmtpEncryption } from './enums/smtp-encryption'; export { OrganizationKeyScopes } from './enums/organization-key-scopes'; export { Region } from './enums/region'; export { ProjectAuthMethodId } from './enums/project-auth-method-id'; export { ProjectOAuth2GooglePrompt } from './enums/project-o-auth-2-google-prompt'; +export { ProjectOAuth2OidcPrompt } from './enums/project-o-auth-2-oidc-prompt'; export { ProjectOAuthProviderId } from './enums/project-o-auth-provider-id'; export { ProjectPolicyId } from './enums/project-policy-id'; export { ProjectProtocolId } from './enums/project-protocol-id'; @@ -74,6 +72,7 @@ export { TablesDBIndexType } from './enums/tables-db-index-type'; export { PasswordHash } from './enums/password-hash'; export { MessagingProviderType } from './enums/messaging-provider-type'; export { DatabaseType } from './enums/database-type'; +export { DatabaseStatus } from './enums/database-status'; export { AttributeStatus } from './enums/attribute-status'; export { ColumnStatus } from './enums/column-status'; export { IndexStatus } from './enums/index-status'; @@ -81,9 +80,9 @@ export { DeploymentStatus } from './enums/deployment-status'; export { ExecutionTrigger } from './enums/execution-trigger'; export { ExecutionStatus } from './enums/execution-status'; export { OAuth2GooglePrompt } from './enums/o-auth-2-google-prompt'; +export { OAuth2OidcPrompt } from './enums/o-auth-2-oidc-prompt'; export { PlatformType } from './enums/platform-type'; -export { HealthAntivirusStatus } from './enums/health-antivirus-status'; -export { HealthCheckStatus } from './enums/health-check-status'; export { ProxyRuleDeploymentResourceType } from './enums/proxy-rule-deployment-resource-type'; export { ProxyRuleStatus } from './enums/proxy-rule-status'; export { MessageStatus } from './enums/message-status'; +export { BillingPlanGroup } from './enums/billing-plan-group'; diff --git a/src/models.ts b/src/models.ts index 2c72952..5e56cfa 100644 --- a/src/models.ts +++ b/src/models.ts @@ -1,4 +1,5 @@ import { DatabaseType } from "./enums/database-type" +import { DatabaseStatus } from "./enums/database-status" import { AttributeStatus } from "./enums/attribute-status" import { ColumnStatus } from "./enums/column-status" import { IndexStatus } from "./enums/index-status" @@ -9,12 +10,12 @@ import { ProjectAuthMethodId } from "./enums/project-auth-method-id" import { ProjectServiceId } from "./enums/project-service-id" import { ProjectProtocolId } from "./enums/project-protocol-id" import { OAuth2GooglePrompt } from "./enums/o-auth-2-google-prompt" +import { OAuth2OidcPrompt } from "./enums/o-auth-2-oidc-prompt" import { PlatformType } from "./enums/platform-type" -import { HealthAntivirusStatus } from "./enums/health-antivirus-status" -import { HealthCheckStatus } from "./enums/health-check-status" import { ProxyRuleDeploymentResourceType } from "./enums/proxy-rule-deployment-resource-type" import { ProxyRuleStatus } from "./enums/proxy-rule-status" import { MessageStatus } from "./enums/message-status" +import { BillingPlanGroup } from "./enums/billing-plan-group" /** * Appwrite Models @@ -496,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)[]; + 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)[]; } /** @@ -513,20 +514,6 @@ export namespace Models { templates: EmailTemplate[]; } - /** - * Status List - */ - export type HealthStatusList = { - /** - * Total number of statuses that matched your query. - */ - total: number; - /** - * List of statuses. - */ - statuses: HealthStatus[]; - } - /** * Rule List */ @@ -709,6 +696,10 @@ export namespace Models { * Database type. */ type: DatabaseType; + /** + * Database status. Possible values: `provisioning`, `ready` or `failed` + */ + status?: DatabaseStatus; /** * Database backup policies. */ @@ -1364,7 +1355,7 @@ export namespace Models { /** * Default value for attribute when not provided. Cannot be set when attribute is required. */ - default?: any[]; + default?: number[]; } /** @@ -1406,7 +1397,7 @@ export namespace Models { /** * Default value for attribute when not provided. Cannot be set when attribute is required. */ - default?: any[]; + default?: number[][]; } /** @@ -1448,7 +1439,7 @@ export namespace Models { /** * Default value for attribute when not provided. Cannot be set when attribute is required. */ - default?: any[]; + default?: number[][][]; } /** @@ -2284,7 +2275,7 @@ export namespace Models { /** * Default value for column when not provided. Cannot be set when column is required. */ - default?: any[]; + default?: number[]; } /** @@ -2326,7 +2317,7 @@ export namespace Models { /** * Default value for column when not provided. Cannot be set when column is required. */ - default?: any[]; + default?: number[][]; } /** @@ -2368,7 +2359,7 @@ export namespace Models { /** * Default value for column when not provided. Cannot be set when column is required. */ - default?: any[]; + default?: number[][][]; } /** @@ -2796,7 +2787,7 @@ export namespace Models { */ mode: string; /** - * User type who triggered the audit log. Possible values: user, admin, guest, keyProject, keyAccount, keyOrganization. + * User type who triggered the audit log. Possible values: user, admin, guest, hidden, keyProject, keyAccount, keyOrganization. */ userType: string; /** @@ -3336,6 +3327,50 @@ export namespace Models { * Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format */ currency: string; + /** + * City + */ + city?: string; + /** + * Name of timezone + */ + timeZone?: string; + /** + * Postal code + */ + postalCode?: string; + /** + * Latitude + */ + latitude?: number; + /** + * Longitude + */ + longitude?: number; + /** + * Autonomous System Number (ASN) of the IP + */ + autonomousSystemNumber?: string; + /** + * Organization that owns the ASN + */ + autonomousSystemOrganization?: string; + /** + * Internet service provider of the IP + */ + isp?: string; + /** + * Connection type of the IP (e.g. cable, cellular, corporate) + */ + connectionType?: string; + /** + * User type classification of the IP (e.g. residential, business, hosting) + */ + connectionUsageType?: string; + /** + * Registered organization of the IP + */ + connectionOrganization?: string; } /** @@ -4252,6 +4287,10 @@ export namespace Models { * Project status */ status: string; + /** + * Stage progress (completed or skipped) with timestamps and actor types, keyed by stage id. + */ + onboarding: object; /** * List of auth methods. */ @@ -4279,59 +4318,63 @@ export namespace Models { /** * OAuth2 server status */ - oAuth2ServerEnabled: boolean; + oAuth2ServerEnabled?: boolean; /** * OAuth2 server authorization URL */ - oAuth2ServerAuthorizationUrl: string; + oAuth2ServerAuthorizationUrl?: string; /** * OAuth2 server allowed scopes */ - oAuth2ServerScopes: string[]; + oAuth2ServerScopes?: string[]; + /** + * OAuth2 server scopes used when an authorization request omits the scope parameter + */ + oAuth2ServerDefaultScopes?: string[]; /** * OAuth2 server accepted RFC 9396 authorization_details types */ - oAuth2ServerAuthorizationDetailsTypes: string[]; + oAuth2ServerAuthorizationDetailsTypes?: string[]; /** * OAuth2 server access token duration in seconds for confidential clients */ - oAuth2ServerAccessTokenDuration: number; + oAuth2ServerAccessTokenDuration?: number; /** * OAuth2 server refresh token duration in seconds for confidential clients */ - oAuth2ServerRefreshTokenDuration: number; + oAuth2ServerRefreshTokenDuration?: number; /** * OAuth2 server access token duration in seconds for public clients (SPAs, mobile, native) */ - oAuth2ServerPublicAccessTokenDuration: number; + oAuth2ServerPublicAccessTokenDuration?: number; /** * OAuth2 server refresh token duration in seconds for public clients (SPAs, mobile, native) */ - oAuth2ServerPublicRefreshTokenDuration: number; + oAuth2ServerPublicRefreshTokenDuration?: number; /** * When enabled, PKCE is required for confidential clients (server-side flows using client_secret). PKCE is always required for public clients regardless of this setting. */ - oAuth2ServerConfidentialPkce: boolean; + oAuth2ServerConfidentialPkce?: boolean; /** * URL to your application page where users enter the device flow user code. Empty when the Device Authorization Grant is not configured. */ - oAuth2ServerVerificationUrl: string; + oAuth2ServerVerificationUrl?: string; /** * Number of characters in the device flow user code, excluding the formatting separator. */ - oAuth2ServerUserCodeLength: number; + oAuth2ServerUserCodeLength?: number; /** * Character set for device flow user codes: `numeric`, `alphabetic`, or `alphanumeric`. */ - oAuth2ServerUserCodeFormat: string; + oAuth2ServerUserCodeFormat?: string; /** * Lifetime in seconds of device flow device codes and user codes. */ - oAuth2ServerDeviceCodeDuration: number; + oAuth2ServerDeviceCodeDuration?: number; /** * OAuth2 server discovery URL */ - oAuth2ServerDiscoveryUrl: string; + oAuth2ServerDiscoveryUrl?: string; } /** @@ -5268,6 +5311,28 @@ export namespace Models { endpoint: string; } + /** + * OAuth2Appwrite + */ + export type OAuth2Appwrite = { + /** + * OAuth2 provider ID. + */ + $id: string; + /** + * OAuth2 provider is active and can be used to create sessions. + */ + enabled: boolean; + /** + * Appwrite OAuth2 client ID. + */ + clientId: string; + /** + * Appwrite OAuth2 client secret. + */ + clientSecret: string; + } + /** * OAuth2Authentik */ @@ -5412,6 +5477,14 @@ export namespace Models { * OpenID Connect user info endpoint URL. */ userInfoURL: string; + /** + * OpenID Connect prompt values controlling the authentication and consent screens. + */ + prompt: OAuth2OidcPrompt[]; + /** + * Maximum authentication age in seconds. When set, the user must have authenticated within this many seconds. + */ + maxAge?: number; } /** @@ -5533,7 +5606,7 @@ export namespace Models { /** * List of OAuth2 providers. */ - providers: (Models.OAuth2Github | Models.OAuth2Discord | Models.OAuth2Figma | Models.OAuth2Dropbox | Models.OAuth2Dailymotion | Models.OAuth2Bitbucket | Models.OAuth2Bitly | Models.OAuth2Box | Models.OAuth2Autodesk | Models.OAuth2Google | Models.OAuth2Zoom | Models.OAuth2Zoho | Models.OAuth2Yandex | Models.OAuth2X | Models.OAuth2WordPress | Models.OAuth2Twitch | Models.OAuth2Stripe | Models.OAuth2Spotify | Models.OAuth2Slack | Models.OAuth2Podio | Models.OAuth2Notion | Models.OAuth2Salesforce | Models.OAuth2Yahoo | Models.OAuth2Linkedin | Models.OAuth2Disqus | Models.OAuth2Amazon | Models.OAuth2Etsy | Models.OAuth2Facebook | Models.OAuth2Tradeshift | Models.OAuth2Paypal | Models.OAuth2Gitlab | Models.OAuth2Authentik | Models.OAuth2Auth0 | Models.OAuth2FusionAuth | Models.OAuth2Keycloak | Models.OAuth2Oidc | Models.OAuth2Apple | Models.OAuth2Okta | Models.OAuth2Kick | Models.OAuth2Microsoft)[]; + providers: (Models.OAuth2Github | Models.OAuth2Discord | Models.OAuth2Figma | Models.OAuth2Dropbox | Models.OAuth2Dailymotion | Models.OAuth2Bitbucket | Models.OAuth2Bitly | Models.OAuth2Box | Models.OAuth2Autodesk | Models.OAuth2Google | Models.OAuth2Zoom | Models.OAuth2Zoho | Models.OAuth2Yandex | Models.OAuth2X | Models.OAuth2WordPress | Models.OAuth2Twitch | Models.OAuth2Stripe | Models.OAuth2Spotify | Models.OAuth2Slack | Models.OAuth2Podio | Models.OAuth2Notion | Models.OAuth2Salesforce | Models.OAuth2Yahoo | Models.OAuth2Linkedin | Models.OAuth2Disqus | Models.OAuth2Amazon | Models.OAuth2Etsy | Models.OAuth2Facebook | Models.OAuth2Tradeshift | Models.OAuth2Paypal | Models.OAuth2Gitlab | Models.OAuth2Appwrite | Models.OAuth2Authentik | Models.OAuth2Auth0 | Models.OAuth2FusionAuth | Models.OAuth2Keycloak | Models.OAuth2Oidc | Models.OAuth2Apple | Models.OAuth2Okta | Models.OAuth2Kick | Models.OAuth2Microsoft)[]; } /** @@ -6012,96 +6085,6 @@ export namespace Models { countryName: string; } - /** - * Health Antivirus - */ - export type HealthAntivirus = { - /** - * Antivirus version. - */ - version: string; - /** - * Antivirus status. Possible values are: `disabled`, `offline`, `online` - */ - status: HealthAntivirusStatus; - } - - /** - * Health Queue - */ - export type HealthQueue = { - /** - * Amount of actions in the queue. - */ - size: number; - } - - /** - * Health Status - */ - export type HealthStatus = { - /** - * Name of the service. - */ - name: string; - /** - * Duration in milliseconds how long the health check took. - */ - ping: number; - /** - * Service status. Possible values are: `pass`, `fail` - */ - status: HealthCheckStatus; - } - - /** - * Health Certificate - */ - export type HealthCertificate = { - /** - * Certificate name - */ - name: string; - /** - * Subject SN - */ - subjectSN: string; - /** - * Issuer organisation - */ - issuerOrganisation: string; - /** - * Valid from - */ - validFrom: string; - /** - * Valid to - */ - validTo: string; - /** - * Signature type SN - */ - signatureTypeSN: string; - } - - /** - * Health Time - */ - export type HealthTime = { - /** - * Current unix timestamp on trustful remote server. - */ - remoteTime: number; - /** - * Current unix timestamp of local server where Appwrite runs. - */ - localTime: number; - /** - * Difference of unix remote and local timestamps in milliseconds. - */ - diff: number; - } - /** * Headers */ @@ -6788,62 +6771,36 @@ export namespace Models { * Hostname. */ hostname: string; + } + + /** + * AdditionalResource + */ + export type AdditionalResource = { /** - * Operating system code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/os.json). - */ - osCode: string; - /** - * Operating system name. - */ - osName: string; - /** - * Operating system version. - */ - osVersion: string; - /** - * Client type. - */ - clientType: string; - /** - * Client code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/clients.json). - */ - clientCode: string; - /** - * Client name. - */ - clientName: string; - /** - * Client version. - */ - clientVersion: string; - /** - * Client engine name. - */ - clientEngine: string; - /** - * Client engine name. + * Resource name */ - clientEngineVersion: string; + name: string; /** - * Device name. + * Resource unit */ - deviceName: string; + unit: string; /** - * Device brand name. + * Price currency */ - deviceBrand: string; + currency: string; /** - * Device model name. + * Price */ - deviceModel: string; + price: number; /** - * Country two-character ISO 3166-1 alpha code. + * Resource value */ - countryCode: string; + value: number; /** - * Country name. + * Description on invoice */ - countryName: string; + invoiceDesc: string; } /** @@ -6939,179 +6896,665 @@ export namespace Models { } /** - * Block + * billingPlan */ - export type Block = { + export type BillingPlan = { /** - * Block creation date in ISO 8601 format. + * Plan ID. */ - $createdAt: string; + $id: string; /** - * Resource type that is blocked + * Plan name */ - resourceType: string; + name: string; /** - * Resource identifier that is blocked + * Plan description */ - resourceId: string; + desc: string; /** - * Reason for the block. Can be null if no reason was provided. + * Plan order */ - reason?: string; + order: number; /** - * Block expiration date in ISO 8601 format. Can be null if the block does not expire. + * Price */ - expiredAt?: string; + price: number; /** - * Name of the project this block applies to. + * Trial days */ - projectName: string; + trial: number; /** - * Region of the project this block applies to. + * Bandwidth */ - region: string; + bandwidth: number; /** - * Name of the organization that owns the project. + * Storage */ - organizationName: string; + storage: number; /** - * ID of the organization that owns the project. + * Image Transformations */ - organizationId: string; + imageTransformations: number; /** - * Billing plan of the organization that owns the project. + * Screenshots generated */ - billingPlan: string; - } - - /** - * backup - */ - export type BackupPolicy = { + screenshotsGenerated: number; /** - * Backup policy ID. + * Members */ - $id: string; + members: number; /** - * Backup policy name. + * Webhooks */ - name: string; + webhooks: number; /** - * Policy creation date in ISO 8601 format. + * Projects */ - $createdAt: string; + projects: number; /** - * Policy update date in ISO 8601 format. + * Platforms */ - $updatedAt: string; + platforms: number; /** - * The services that are backed up by this policy. + * Users */ - services: string[]; + users: number; /** - * The resources that are backed up by this policy. + * Teams */ - resources: string[]; + teams: number; /** - * The resource ID to backup. Set only if this policy should backup a single resource. + * Databases */ - resourceId?: string; + databases: number; /** - * The resource type to backup. Set only if this policy should backup a single resource. + * Database reads per month */ - resourceType?: string; + databasesReads: number; /** - * How many days to keep the backup before it will be automatically deleted. + * Database writes per month */ - retention: number; + databasesWrites: number; /** - * Policy backup schedule in CRON format. + * Database batch size limit */ - schedule: string; + databasesBatchSize: number; /** - * Is this policy enabled. + * Buckets */ - enabled: boolean; - } - - /** - * Policy Deny Aliased Email - */ - export type PolicyDenyAliasedEmail = { + buckets: number; /** - * Policy ID. + * File size */ - $id: string; + fileSize: number; /** - * Whether the deny aliased email policy is enabled. + * Functions */ - enabled: boolean; - } - - /** - * Policy Deny Disposable Email - */ - export type PolicyDenyDisposableEmail = { + functions: number; /** - * Policy ID. + * Sites */ - $id: string; + sites: number; /** - * Whether the deny disposable email policy is enabled. + * Function executions */ - enabled: boolean; - } - - /** - * Policy Deny Free Email - */ - export type PolicyDenyFreeEmail = { + executions: number; /** - * Policy ID. + * Rolling max executions retained per function/site */ - $id: string; + executionsRetentionCount: number; /** - * Whether the deny free email policy is enabled. + * GB hours for functions */ - enabled: boolean; - } - - /** - * Restoration - */ - export type BackupRestoration = { + GBHours: number; /** - * Restoration ID. + * Realtime connections */ - $id: string; + realtime: number; /** - * Restoration creation time in ISO 8601 format. + * Realtime messages */ - $createdAt: string; + realtimeMessages: number; /** - * Restoration update date in ISO 8601 format. + * Messages per month + */ + messages: number; + /** + * Topics for messaging + */ + topics: number; + /** + * SMS authentications per month + */ + authPhone: number; + /** + * Custom domains + */ + domains: number; + /** + * Activity log days + */ + activityLogs: number; + /** + * Usage history days + */ + usageLogs: number; + /** + * Usage log time intervals allowed for this plan (e.g. 15m, 1h, 1d). + */ + usageLogsIntervals?: string[]; + /** + * Number of days of console inactivity before a project is paused. 0 means pausing is disabled. + */ + projectInactivityDays: number; + /** + * Alert threshold percentage + */ + alertLimit: number; + /** + * Additional resources + */ + usage: UsageBillingPlan; + /** + * Addons + */ + addons: BillingPlanAddon; + /** + * Budget cap enabled or disabled. + */ + budgetCapEnabled: boolean; + /** + * Custom SMTP + */ + customSmtp: boolean; + /** + * Appwrite branding in email + */ + emailBranding: boolean; + /** + * Does plan require payment method + */ + requiresPaymentMethod: boolean; + /** + * Does plan require billing address + */ + requiresBillingAddress: boolean; + /** + * Is the billing plan available + */ + isAvailable: boolean; + /** + * Can user change the plan themselves + */ + selfService: boolean; + /** + * Does plan enable premium support + */ + premiumSupport: boolean; + /** + * Does plan support budget cap + */ + budgeting: boolean; + /** + * Does plan support mock numbers + */ + supportsMockNumbers: boolean; + /** + * Does plan support organization roles + */ + supportsOrganizationRoles: boolean; + /** + * Does plan support credit + */ + supportsCredits: boolean; + /** + * Does plan support blocking disposable email addresses. + */ + supportsDisposableEmailValidation: boolean; + /** + * Does plan support requiring canonical email addresses. + */ + supportsCanonicalEmailValidation: boolean; + /** + * Does plan support blocking free email addresses. + */ + supportsFreeEmailValidation: boolean; + /** + * Does plan support restricting sign-ups to corporate email addresses only. + */ + supportsCorporateEmailValidation: boolean; + /** + * Does plan support project-specific member roles. + */ + supportsProjectSpecificRoles: boolean; + /** + * Does plan support backup policies. + */ + backupsEnabled: boolean; + /** + * Whether usage addons are calculated per project. + */ + usagePerProject: boolean; + /** + * Supported addons for this plan + */ + supportedAddons: BillingPlanSupportedAddons; + /** + * How many policies does plan support + */ + backupPolicies: number; + /** + * Maximum function and site deployment size in MB + */ + deploymentSize: number; + /** + * Maximum function and site deployment size in MB + */ + buildSize: number; + /** + * Does the plan support encrypted string attributes or not. + */ + databasesAllowEncrypt: boolean; + /** + * Plan specific limits + */ + limits?: BillingPlanLimits; + /** + * Group of this billing plan for variants + */ + group: BillingPlanGroup; + /** + * Details of the program this plan is a part of. + */ + program?: Program; + /** + * Dedicated database limits available to this plan. + */ + dedicatedDatabases?: BillingPlanDedicatedDatabaseLimits; + } + + /** + * Addon + */ + export type BillingPlanAddon = { + /** + * Addon seats + */ + seats: BillingPlanAddonDetails; + /** + * Addon projects + */ + projects: BillingPlanAddonDetails; + } + + /** + * Details + */ + export type BillingPlanAddonDetails = { + /** + * Is the addon supported in the plan? + */ + supported: boolean; + /** + * Addon plan included value + */ + planIncluded: number; + /** + * Addon limit + */ + limit: number; + /** + * Addon type + */ + type: string; + /** + * Price currency + */ + currency: string; + /** + * Price + */ + price: number; + /** + * Resource value + */ + value: number; + /** + * Description on invoice + */ + invoiceDesc: string; + } + + /** + * PlanLimits + */ + export type BillingPlanLimits = { + /** + * Credits limit per billing cycle + */ + credits?: number; + /** + * Daily credits limit (if applicable) + */ + dailyCredits?: number; + } + + /** + * dedicatedDatabaseLimits + */ + export type BillingPlanDedicatedDatabaseLimits = { + /** + * Minimum CPU allocation in millicores. + */ + minCpu?: number; + /** + * Maximum CPU allocation in millicores. + */ + maxCpu?: number; + /** + * Minimum memory allocation in megabytes. + */ + minMemoryMb?: number; + /** + * Maximum memory allocation in megabytes. + */ + maxMemoryMb?: number; + /** + * Minimum storage allocation in gigabytes. + */ + minStorageGb?: number; + /** + * Maximum storage allocation in gigabytes. + */ + maxStorageGb?: number; + /** + * Maximum number of high-availability replicas per dedicated database. + */ + maxReplicas?: number; + /** + * Maximum number of client connections. + */ + maxConnections?: number; + /** + * Maximum number of entries allowed in the IP allowlist. + */ + maxIpAllowlistSize?: number; + /** + * Maximum number of database extensions that can be enabled. + */ + maxExtensions?: number; + /** + * Maximum number of days a backup can be retained. + */ + maxBackupRetentionDays?: number; + /** + * Maximum number of days of point-in-time recovery data that can be retained. + */ + maxPitrRetentionDays?: number; + /** + * Maximum number of rows a single SQL API query can return. + */ + maxSqlApiMaxRows?: number; + /** + * Maximum response size in bytes for a single SQL API query. + */ + maxSqlApiMaxBytes?: number; + /** + * Maximum execution time in seconds for a single SQL API query. + */ + maxSqlApiTimeoutSeconds?: number; + /** + * Maximum number of SQL statement types that can be permitted through the SQL API. + */ + maxSqlApiAllowedStatements?: number; + /** + * SQL statement types permitted through the SQL API. + */ + allowedSqlStatements?: string[]; + /** + * Storage classes available for dedicated databases. + */ + allowedStorageClasses?: string[]; + /** + * Replica synchronization modes available for dedicated databases. + */ + allowedSyncModes?: string[]; + } + + /** + * BillingPlanSupportedAddons + */ + export type BillingPlanSupportedAddons = { + /** + * Whether the plan supports BAA (Business Associate Agreement) addon + */ + baa: boolean; + /** + * Whether the plan supports Premium Geo DB addon (project-level) + */ + premiumGeoDB: boolean; + /** + * Whether the plan supports Premium Geo DB addon (organization-level) + */ + premiumGeoDBOrg: boolean; + } + + /** + * Block + */ + export type Block = { + /** + * Block creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Resource type that is blocked + */ + resourceType: string; + /** + * Resource identifier that is blocked + */ + resourceId: string; + /** + * Block mode. full blocks reads and writes; readOnly blocks writes only. + */ + mode: string; + /** + * Reason for the block. Can be null if no reason was provided. + */ + reason?: string; + /** + * Block expiration date in ISO 8601 format. Can be null if the block does not expire. + */ + expiredAt?: string; + /** + * Name of the project this block applies to. + */ + projectName: string; + /** + * Region of the project this block applies to. + */ + region: string; + /** + * Name of the organization that owns the project. + */ + organizationName: string; + /** + * ID of the organization that owns the project. + */ + organizationId: string; + /** + * Billing plan of the organization that owns the project. + */ + billingPlan: string; + } + + /** + * Organization + */ + export type Organization = { + /** + * Team ID. + */ + $id: string; + /** + * Team creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Team update date in ISO 8601 format. */ $updatedAt: string; /** - * Backup archive ID. + * Team name. */ - archiveId: string; + name: string; /** - * Backup policy ID. + * Total number of team members. */ - policyId: string; + total: number; /** - * The status of the restoration. Possible values: pending, downloading, processing, completed, failed. + * Team preferences as a key-value object + */ + prefs: Preferences; + /** + * Project budget limit + */ + billingBudget: number; + /** + * Project budget limit + */ + budgetAlerts: number[]; + /** + * Organization's billing plan ID. + */ + billingPlan: string; + /** + * Organization's billing plan ID. + */ + billingPlanId: string; + /** + * Organization's billing plan. + */ + billingPlanDetails: BillingPlan; + /** + * Billing email set for the organization. + */ + billingEmail: string; + /** + * Billing cycle start date. + */ + billingStartDate: string; + /** + * Current invoice cycle start date. + */ + billingCurrentInvoiceDate: string; + /** + * Next invoice cycle start date. + */ + billingNextInvoiceDate: string; + /** + * Start date of trial. + */ + billingTrialStartDate: string; + /** + * Number of trial days. + */ + billingTrialDays: number; + /** + * Current active aggregation id. + */ + billingAggregationId: string; + /** + * Current active aggregation id. + */ + billingInvoiceId: string; + /** + * Default payment method. + */ + paymentMethodId: string; + /** + * Default payment method. + */ + billingAddressId: string; + /** + * Backup payment method. + */ + backupPaymentMethodId: string; + /** + * Team status. */ status: string; /** - * The backup start time. + * Remarks on team status. */ - startedAt: string; + remarks: string; /** - * Migration ID. + * Organization agreements */ - migrationId: string; + agreementBAA: string; + /** + * Program manager's name. + */ + programManagerName: string; + /** + * Program manager's calendar link. + */ + programManagerCalendar: string; + /** + * Program's discord channel name. + */ + programDiscordChannelName: string; + /** + * Program's discord channel URL. + */ + programDiscordChannelUrl: string; + /** + * Billing limits reached + */ + billingLimits?: BillingLimits; + /** + * Billing plan selected for downgrade. + */ + billingPlanDowngrade: string; + /** + * Tax Id + */ + billingTaxId: string; + /** + * Marked for deletion + */ + markedForDeletion: boolean; + /** + * Product with which the organization is associated (appwrite or imagine) + */ + platform: string; + /** + * Selected projects + */ + projects: string[]; + } + + /** + * backup + */ + export type BackupPolicy = { + /** + * Backup policy ID. + */ + $id: string; + /** + * Backup policy name. + */ + name: string; + /** + * Policy creation date in ISO 8601 format. + */ + $createdAt: string; + /** + * Policy update date in ISO 8601 format. + */ + $updatedAt: string; /** * The services that are backed up by this policy. */ @@ -7121,81 +7564,227 @@ export namespace Models { */ resources: string[]; /** - * Optional data in key-value object. + * The resource ID to backup. Set only if this policy should backup a single resource. */ - options: string; + resourceId?: string; + /** + * The resource type to backup. Set only if this policy should backup a single resource. + */ + resourceType?: string; + /** + * How many days to keep the backup before it will be automatically deleted. + */ + retention: number; + /** + * Policy backup schedule in CRON format. + */ + schedule: string; + /** + * Backup type. Possible values: full (complete database snapshot), incremental (changes since last backup). + */ + type: string; + /** + * Is this policy enabled. + */ + enabled: boolean; } /** - * usageEvent + * Policy Deny Aliased Email */ - export type UsageEvent = { + export type PolicyDenyAliasedEmail = { /** - * The metric key. + * Policy ID. */ - metric: string; + $id: string; /** - * The metric value. + * Whether the deny aliased email policy is enabled. */ - value: number; + enabled: boolean; + } + + /** + * Policy Deny Disposable Email + */ + export type PolicyDenyDisposableEmail = { /** - * The event timestamp. + * Policy ID. */ - time: string; + $id: string; + /** + * Whether the deny disposable email policy is enabled. + */ + enabled: boolean; + } + + /** + * Policy Deny Free Email + */ + export type PolicyDenyFreeEmail = { /** - * The API endpoint path. + * Policy ID. */ - path: string; + $id: string; /** - * The HTTP method. + * Whether the deny free email policy is enabled. */ - method: string; + enabled: boolean; + } + + /** + * Policy Deny Corporate Email + */ + export type PolicyDenyCorporateEmail = { + /** + * Policy ID. + */ + $id: string; + /** + * Whether the deny non-corporate email policy is enabled. + */ + enabled: boolean; + } + + /** + * Program + */ + export type Program = { + /** + * Program ID + */ + $id: string; + /** + * Program title + */ + title: string; + /** + * Program description + */ + description: string; + /** + * Program tag for highlighting on console + */ + tag: string; + /** + * Program icon for highlighting on console + */ + icon: string; + /** + * URL for more information on this program + */ + url: string; + /** + * Whether this program is active + */ + active: boolean; + /** + * Whether this program is external + */ + external: boolean; + /** + * Billing plan ID that this is program is associated with. + */ + billingPlanId: string; + } + + /** + * Restoration + */ + export type BackupRestoration = { + /** + * Restoration ID. + */ + $id: string; + /** + * Restoration creation time in ISO 8601 format. + */ + $createdAt: string; + /** + * Restoration update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Backup archive ID. + */ + archiveId: string; + /** + * Backup policy ID. + */ + policyId: string; /** - * HTTP status code. Stored as string to preserve unset state (empty string = not available). + * The status of the restoration. Possible values: pending, downloading, processing, completed, failed. */ status: string; /** - * The resource type. + * The backup start time. */ - resourceType: string; + startedAt: string; /** - * The resource ID. + * Migration ID. */ - resourceId: string; + migrationId: string; /** - * Country code in [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) two-character format. + * The services that are backed up by this policy. */ - countryCode: string; + services: string[]; /** - * The user agent string. + * The resources that are backed up by this policy. */ - userAgent: string; + resources: string[]; + /** + * Optional data in key-value object. + */ + options: string; } /** - * usageGauge + * usageBillingPlan */ - export type UsageGauge = { + export type UsageBillingPlan = { /** - * The metric key. + * Bandwidth additional resources */ - metric: string; + bandwidth: AdditionalResource; /** - * The current snapshot value. + * Executions additional resources */ - value: number; + executions: AdditionalResource; /** - * The snapshot timestamp. + * Member additional resources */ - time: string; + member: AdditionalResource; /** - * The resource type. + * Realtime additional resources */ - resourceType: string; + realtime: AdditionalResource; /** - * The resource ID. + * Realtime messages additional resources */ - resourceId: string; + realtimeMessages: AdditionalResource; + /** + * Realtime bandwidth additional resources + */ + realtimeBandwidth: AdditionalResource; + /** + * Storage additional resources + */ + storage: AdditionalResource; + /** + * User additional resources + */ + users: AdditionalResource; + /** + * GBHour additional resources + */ + GBHours: AdditionalResource; + /** + * Image transformation additional resources + */ + imageTransformations: AdditionalResource; + /** + * Credits additional resources + */ + credits: AdditionalResource; } /** @@ -7253,32 +7842,4 @@ export namespace Models { */ restorations: BackupRestoration[]; } - - /** - * Usage events list - */ - export type UsageEventList = { - /** - * Total number of events that matched your query. - */ - total: number; - /** - * List of events. - */ - events: UsageEvent[]; - } - - /** - * Usage gauges list - */ - export type UsageGaugeList = { - /** - * Total number of gauges that matched your query. - */ - total: number; - /** - * List of gauges. - */ - gauges: UsageGauge[]; - } } diff --git a/src/query.ts b/src/query.ts index fdd9f40..e0e9725 100644 --- a/src/query.ts +++ b/src/query.ts @@ -494,6 +494,36 @@ export class Query { static distanceLessThan = (attribute: string, values: any[], distance: number, meters: boolean = true): string => new Query("distanceLessThan", attribute, [[values, distance, meters]] as QueryTypesList).toString(); + /** + * Filter resources using vector dot product similarity. + * + * @param {string} attribute + * @param {number[]} vector + * @returns {string} + */ + static vectorDot = (attribute: string, vector: number[]): string => + new Query("vectorDot", attribute, [vector] as QueryTypesList).toString(); + + /** + * Filter resources using vector cosine similarity. + * + * @param {string} attribute + * @param {number[]} vector + * @returns {string} + */ + static vectorCosine = (attribute: string, vector: number[]): string => + new Query("vectorCosine", attribute, [vector] as QueryTypesList).toString(); + + /** + * Filter resources using vector Euclidean distance. + * + * @param {string} attribute + * @param {number[]} vector + * @returns {string} + */ + static vectorEuclidean = (attribute: string, vector: number[]): string => + new Query("vectorEuclidean", attribute, [vector] as QueryTypesList).toString(); + /** * Filter resources where attribute intersects with the given geometry. * diff --git a/src/services/account.ts b/src/services/account.ts index 474bfba..57aadeb 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -292,7 +292,7 @@ export class Account { throw new AppwriteException('Missing required parameter: "identityId"'); } - const apiPath = '/account/identities/{identityId}'.replace('{identityId}', identityId); + const apiPath = '/account/identities/{identityId}'.replace('{identityId}', encodeURIComponent(String(identityId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -518,7 +518,7 @@ export class Account { throw new AppwriteException('Missing required parameter: "type"'); } - const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type); + const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', encodeURIComponent(String(type))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -572,7 +572,7 @@ export class Account { throw new AppwriteException('Missing required parameter: "type"'); } - const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type); + const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', encodeURIComponent(String(type))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -635,7 +635,7 @@ export class Account { throw new AppwriteException('Missing required parameter: "otp"'); } - const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type); + const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', encodeURIComponent(String(type))); const payload: Payload = {}; if (typeof otp !== 'undefined') { payload['otp'] = otp; @@ -700,7 +700,7 @@ export class Account { throw new AppwriteException('Missing required parameter: "otp"'); } - const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type); + const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', encodeURIComponent(String(type))); const payload: Payload = {}; if (typeof otp !== 'undefined') { payload['otp'] = otp; @@ -758,7 +758,7 @@ export class Account { throw new AppwriteException('Missing required parameter: "type"'); } - const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type); + const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', encodeURIComponent(String(type))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -811,7 +811,7 @@ export class Account { throw new AppwriteException('Missing required parameter: "type"'); } - const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type); + const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', encodeURIComponent(String(type))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -2100,7 +2100,7 @@ export class Account { throw new AppwriteException('Missing required parameter: "sessionId"'); } - const apiPath = '/account/sessions/{sessionId}'.replace('{sessionId}', sessionId); + const apiPath = '/account/sessions/{sessionId}'.replace('{sessionId}', encodeURIComponent(String(sessionId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -2153,7 +2153,7 @@ export class Account { throw new AppwriteException('Missing required parameter: "sessionId"'); } - const apiPath = '/account/sessions/{sessionId}'.replace('{sessionId}', sessionId); + const apiPath = '/account/sessions/{sessionId}'.replace('{sessionId}', encodeURIComponent(String(sessionId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -2207,7 +2207,7 @@ export class Account { throw new AppwriteException('Missing required parameter: "sessionId"'); } - const apiPath = '/account/sessions/{sessionId}'.replace('{sessionId}', sessionId); + const apiPath = '/account/sessions/{sessionId}'.replace('{sessionId}', encodeURIComponent(String(sessionId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -2426,7 +2426,7 @@ export class Account { * * A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). * - * @param {OAuthProvider} params.provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom. + * @param {OAuthProvider} params.provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, appwrite, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom. * @param {string} params.success - URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param {string} params.failure - URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param {string[]} params.scopes - A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long. @@ -2441,7 +2441,7 @@ export class Account { * * A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). * - * @param {OAuthProvider} provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom. + * @param {OAuthProvider} provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, appwrite, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom. * @param {string} success - URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param {string} failure - URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API. * @param {string[]} scopes - A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long. @@ -2476,7 +2476,7 @@ export class Account { throw new AppwriteException('Missing required parameter: "provider"'); } - const apiPath = '/account/tokens/oauth2/{provider}'.replace('{provider}', provider); + const apiPath = '/account/tokens/oauth2/{provider}'.replace('{provider}', encodeURIComponent(String(provider))); const payload: Payload = {}; if (typeof success !== 'undefined') { payload['success'] = success; diff --git a/src/services/activities.ts b/src/services/activities.ts index 10b8062..e473154 100644 --- a/src/services/activities.ts +++ b/src/services/activities.ts @@ -101,7 +101,7 @@ export class Activities { throw new AppwriteException('Missing required parameter: "eventId"'); } - const apiPath = '/activities/events/{eventId}'.replace('{eventId}', eventId); + const apiPath = '/activities/events/{eventId}'.replace('{eventId}', encodeURIComponent(String(eventId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); diff --git a/src/services/advisor.ts b/src/services/advisor.ts index c735c29..ccb67d3 100644 --- a/src/services/advisor.ts +++ b/src/services/advisor.ts @@ -111,7 +111,7 @@ export class Advisor { throw new AppwriteException('Missing required parameter: "reportId"'); } - const apiPath = '/reports/{reportId}'.replace('{reportId}', reportId); + const apiPath = '/reports/{reportId}'.replace('{reportId}', encodeURIComponent(String(reportId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -166,7 +166,7 @@ export class Advisor { throw new AppwriteException('Missing required parameter: "reportId"'); } - const apiPath = '/reports/{reportId}'.replace('{reportId}', reportId); + const apiPath = '/reports/{reportId}'.replace('{reportId}', encodeURIComponent(String(reportId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -230,7 +230,7 @@ export class Advisor { throw new AppwriteException('Missing required parameter: "reportId"'); } - const apiPath = '/reports/{reportId}/insights'.replace('{reportId}', reportId); + const apiPath = '/reports/{reportId}/insights'.replace('{reportId}', encodeURIComponent(String(reportId))); const payload: Payload = {}; if (typeof queries !== 'undefined') { payload['queries'] = queries; @@ -299,7 +299,7 @@ export class Advisor { throw new AppwriteException('Missing required parameter: "insightId"'); } - const apiPath = '/reports/{reportId}/insights/{insightId}'.replace('{reportId}', reportId).replace('{insightId}', insightId); + const apiPath = '/reports/{reportId}/insights/{insightId}'.replace('{reportId}', encodeURIComponent(String(reportId))).replace('{insightId}', encodeURIComponent(String(insightId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); diff --git a/src/services/avatars.ts b/src/services/avatars.ts index 0e71d1a..d6914c0 100644 --- a/src/services/avatars.ts +++ b/src/services/avatars.ts @@ -70,7 +70,7 @@ export class Avatars { throw new AppwriteException('Missing required parameter: "code"'); } - const apiPath = '/avatars/browsers/{code}'.replace('{code}', code); + const apiPath = '/avatars/browsers/{code}'.replace('{code}', encodeURIComponent(String(code))); const payload: Payload = {}; if (typeof width !== 'undefined') { payload['width'] = width; @@ -152,7 +152,7 @@ export class Avatars { throw new AppwriteException('Missing required parameter: "code"'); } - const apiPath = '/avatars/credit-cards/{code}'.replace('{code}', code); + const apiPath = '/avatars/credit-cards/{code}'.replace('{code}', encodeURIComponent(String(code))); const payload: Payload = {}; if (typeof width !== 'undefined') { payload['width'] = width; @@ -295,7 +295,7 @@ export class Avatars { throw new AppwriteException('Missing required parameter: "code"'); } - const apiPath = '/avatars/flags/{code}'.replace('{code}', code); + const apiPath = '/avatars/flags/{code}'.replace('{code}', encodeURIComponent(String(code))); const payload: Payload = {}; if (typeof width !== 'undefined') { payload['width'] = width; diff --git a/src/services/backups.ts b/src/services/backups.ts index 098db6d..38b5cc0 100644 --- a/src/services/backups.ts +++ b/src/services/backups.ts @@ -165,7 +165,7 @@ export class Backups { throw new AppwriteException('Missing required parameter: "archiveId"'); } - const apiPath = '/backups/archives/{archiveId}'.replace('{archiveId}', archiveId); + const apiPath = '/backups/archives/{archiveId}'.replace('{archiveId}', encodeURIComponent(String(archiveId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -218,7 +218,7 @@ export class Backups { throw new AppwriteException('Missing required parameter: "archiveId"'); } - const apiPath = '/backups/archives/{archiveId}'.replace('{archiveId}', archiveId); + const apiPath = '/backups/archives/{archiveId}'.replace('{archiveId}', encodeURIComponent(String(archiveId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -434,7 +434,7 @@ export class Backups { throw new AppwriteException('Missing required parameter: "policyId"'); } - const apiPath = '/backups/policies/{policyId}'.replace('{policyId}', policyId); + const apiPath = '/backups/policies/{policyId}'.replace('{policyId}', encodeURIComponent(String(policyId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -504,7 +504,7 @@ export class Backups { throw new AppwriteException('Missing required parameter: "policyId"'); } - const apiPath = '/backups/policies/{policyId}'.replace('{policyId}', policyId); + const apiPath = '/backups/policies/{policyId}'.replace('{policyId}', encodeURIComponent(String(policyId))); const payload: Payload = {}; if (typeof name !== 'undefined') { payload['name'] = name; @@ -570,7 +570,7 @@ export class Backups { throw new AppwriteException('Missing required parameter: "policyId"'); } - const apiPath = '/backups/policies/{policyId}'.replace('{policyId}', policyId); + const apiPath = '/backups/policies/{policyId}'.replace('{policyId}', encodeURIComponent(String(policyId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -590,41 +590,50 @@ export class Backups { /** * Create and trigger a new restoration for a backup on a project. + * + * When restoring a DocumentsDB or VectorsDB database to a new resource, pass `newSpecification` to provision the restored database on a different specification than the archived one (for example, restoring onto a larger or smaller dedicated database). Use `serverless` to restore onto the shared pool, or a dedicated specification slug to restore onto a dedicated database of that size. The specification must be permitted by the organization's plan. `newSpecification` is not supported for legacy/TablesDB databases or for bucket restores. + * * * @param {string} params.archiveId - Backup archive ID to restore * @param {BackupServices[]} params.services - Array of services to restore * @param {string} params.newResourceId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {string} params.newResourceName - Database name. Max length: 128 chars. + * @param {string} params.newSpecification - Specification to provision the restored database on, when restoring a DocumentsDB or VectorsDB database to a new resource. Defaults to the archived database's specification. Use `serverless` for the shared pool or a dedicated specification slug. * @throws {AppwriteException} * @returns {Promise} */ - createRestoration(params: { archiveId: string, services: BackupServices[], newResourceId?: string, newResourceName?: string }): Promise; + createRestoration(params: { archiveId: string, services: BackupServices[], newResourceId?: string, newResourceName?: string, newSpecification?: string }): Promise; /** * Create and trigger a new restoration for a backup on a project. + * + * When restoring a DocumentsDB or VectorsDB database to a new resource, pass `newSpecification` to provision the restored database on a different specification than the archived one (for example, restoring onto a larger or smaller dedicated database). Use `serverless` to restore onto the shared pool, or a dedicated specification slug to restore onto a dedicated database of that size. The specification must be permitted by the organization's plan. `newSpecification` is not supported for legacy/TablesDB databases or for bucket restores. + * * * @param {string} archiveId - Backup archive ID to restore * @param {BackupServices[]} services - Array of services to restore * @param {string} newResourceId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {string} newResourceName - Database name. Max length: 128 chars. + * @param {string} newSpecification - Specification to provision the restored database on, when restoring a DocumentsDB or VectorsDB database to a new resource. Defaults to the archived database's specification. Use `serverless` for the shared pool or a dedicated specification slug. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createRestoration(archiveId: string, services: BackupServices[], newResourceId?: string, newResourceName?: string): Promise; + createRestoration(archiveId: string, services: BackupServices[], newResourceId?: string, newResourceName?: string, newSpecification?: string): Promise; createRestoration( - paramsOrFirst: { archiveId: string, services: BackupServices[], newResourceId?: string, newResourceName?: string } | string, - ...rest: [(BackupServices[])?, (string)?, (string)?] + paramsOrFirst: { archiveId: string, services: BackupServices[], newResourceId?: string, newResourceName?: string, newSpecification?: string } | string, + ...rest: [(BackupServices[])?, (string)?, (string)?, (string)?] ): Promise { - let params: { archiveId: string, services: BackupServices[], newResourceId?: string, newResourceName?: string }; + let params: { archiveId: string, services: BackupServices[], newResourceId?: string, newResourceName?: string, newSpecification?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { archiveId: string, services: BackupServices[], newResourceId?: string, newResourceName?: string }; + params = (paramsOrFirst || {}) as { archiveId: string, services: BackupServices[], newResourceId?: string, newResourceName?: string, newSpecification?: string }; } else { params = { archiveId: paramsOrFirst as string, services: rest[0] as BackupServices[], newResourceId: rest[1] as string, - newResourceName: rest[2] as string + newResourceName: rest[2] as string, + newSpecification: rest[3] as string }; } @@ -632,6 +641,7 @@ export class Backups { const services = params.services; const newResourceId = params.newResourceId; const newResourceName = params.newResourceName; + const newSpecification = params.newSpecification; if (typeof archiveId === 'undefined') { throw new AppwriteException('Missing required parameter: "archiveId"'); @@ -654,6 +664,9 @@ export class Backups { if (typeof newResourceName !== 'undefined') { payload['newResourceName'] = newResourceName; } + if (typeof newSpecification !== 'undefined') { + payload['newSpecification'] = newSpecification; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -759,7 +772,7 @@ export class Backups { throw new AppwriteException('Missing required parameter: "restorationId"'); } - const apiPath = '/backups/restorations/{restorationId}'.replace('{restorationId}', restorationId); + const apiPath = '/backups/restorations/{restorationId}'.replace('{restorationId}', encodeURIComponent(String(restorationId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); diff --git a/src/services/databases.ts b/src/services/databases.ts index 8107a94..ee501f8 100644 --- a/src/services/databases.ts +++ b/src/services/databases.ts @@ -167,6 +167,7 @@ export class Databases { * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.listTransactions` instead. */ listTransactions(params?: { queries?: string[] }): Promise; /** @@ -220,6 +221,7 @@ export class Databases { * @param {number} params.ttl - Seconds before the transaction expires. * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createTransaction` instead. */ createTransaction(params?: { ttl?: number }): Promise; /** @@ -274,6 +276,7 @@ export class Databases { * @param {string} params.transactionId - Transaction ID. * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.getTransaction` instead. */ getTransaction(params: { transactionId: string }): Promise; /** @@ -304,7 +307,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "transactionId"'); } - const apiPath = '/databases/transactions/{transactionId}'.replace('{transactionId}', transactionId); + const apiPath = '/databases/transactions/{transactionId}'.replace('{transactionId}', encodeURIComponent(String(transactionId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -329,6 +332,7 @@ export class Databases { * @param {boolean} params.rollback - Rollback transaction? * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateTransaction` instead. */ updateTransaction(params: { transactionId: string, commit?: boolean, rollback?: boolean }): Promise; /** @@ -366,7 +370,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "transactionId"'); } - const apiPath = '/databases/transactions/{transactionId}'.replace('{transactionId}', transactionId); + const apiPath = '/databases/transactions/{transactionId}'.replace('{transactionId}', encodeURIComponent(String(transactionId))); const payload: Payload = {}; if (typeof commit !== 'undefined') { payload['commit'] = commit; @@ -396,6 +400,7 @@ export class Databases { * @param {string} params.transactionId - Transaction ID. * @throws {AppwriteException} * @returns {Promise<{}>} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.deleteTransaction` instead. */ deleteTransaction(params: { transactionId: string }): Promise<{}>; /** @@ -426,7 +431,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "transactionId"'); } - const apiPath = '/databases/transactions/{transactionId}'.replace('{transactionId}', transactionId); + const apiPath = '/databases/transactions/{transactionId}'.replace('{transactionId}', encodeURIComponent(String(transactionId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -450,6 +455,7 @@ export class Databases { * @param {object[]} params.operations - Array of staged operations. * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createOperations` instead. */ createOperations(params: { transactionId: string, operations?: object[] }): Promise; /** @@ -484,7 +490,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "transactionId"'); } - const apiPath = '/databases/transactions/{transactionId}/operations'.replace('{transactionId}', transactionId); + const apiPath = '/databases/transactions/{transactionId}/operations'.replace('{transactionId}', encodeURIComponent(String(transactionId))); const payload: Payload = {}; if (typeof operations !== 'undefined') { payload['operations'] = operations; @@ -542,7 +548,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "databaseId"'); } - const apiPath = '/databases/{databaseId}'.replace('{databaseId}', databaseId); + const apiPath = '/databases/{databaseId}'.replace('{databaseId}', encodeURIComponent(String(databaseId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -605,7 +611,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "databaseId"'); } - const apiPath = '/databases/{databaseId}'.replace('{databaseId}', databaseId); + const apiPath = '/databases/{databaseId}'.replace('{databaseId}', encodeURIComponent(String(databaseId))); const payload: Payload = {}; if (typeof name !== 'undefined') { payload['name'] = name; @@ -666,7 +672,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "databaseId"'); } - const apiPath = '/databases/{databaseId}'.replace('{databaseId}', databaseId); + const apiPath = '/databases/{databaseId}'.replace('{databaseId}', encodeURIComponent(String(databaseId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -733,7 +739,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "databaseId"'); } - const apiPath = '/databases/{databaseId}/collections'.replace('{databaseId}', databaseId); + const apiPath = '/databases/{databaseId}/collections'.replace('{databaseId}', encodeURIComponent(String(databaseId))); const payload: Payload = {}; if (typeof queries !== 'undefined') { payload['queries'] = queries; @@ -831,7 +837,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "name"'); } - const apiPath = '/databases/{databaseId}/collections'.replace('{databaseId}', databaseId); + const apiPath = '/databases/{databaseId}/collections'.replace('{databaseId}', encodeURIComponent(String(databaseId))); const payload: Payload = {}; if (typeof collectionId !== 'undefined') { payload['collectionId'] = collectionId; @@ -915,7 +921,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "collectionId"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const apiPath = '/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -997,7 +1003,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "collectionId"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const apiPath = '/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))); const payload: Payload = {}; if (typeof name !== 'undefined') { payload['name'] = name; @@ -1075,7 +1081,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "collectionId"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const apiPath = '/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -1145,7 +1151,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "collectionId"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))); const payload: Payload = {}; if (typeof queries !== 'undefined') { payload['queries'] = queries; @@ -1245,7 +1251,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/bigint'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/bigint'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -1361,7 +1367,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/bigint/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/bigint/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; if (typeof required !== 'undefined') { payload['required'] = required; @@ -1463,7 +1469,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -1563,7 +1569,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; if (typeof required !== 'undefined') { payload['required'] = required; @@ -1657,7 +1663,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -1757,7 +1763,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; if (typeof required !== 'undefined') { payload['required'] = required; @@ -1853,7 +1859,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/email'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/email'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -1955,7 +1961,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/email/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/email/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; if (typeof required !== 'undefined') { payload['required'] = required; @@ -2058,7 +2064,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/enum'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/enum'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -2170,7 +2176,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; if (typeof elements !== 'undefined') { payload['elements'] = elements; @@ -2277,7 +2283,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/float'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/float'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -2393,7 +2399,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/float/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/float/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; if (typeof required !== 'undefined') { payload['required'] = required; @@ -2503,7 +2509,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/integer'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/integer'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -2619,7 +2625,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/integer/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/integer/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; if (typeof required !== 'undefined') { payload['required'] = required; @@ -2721,7 +2727,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/ip'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/ip'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -2823,7 +2829,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/ip/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/ip/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; if (typeof required !== 'undefined') { payload['required'] = required; @@ -2857,12 +2863,12 @@ export class Databases { * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? - * @param {any[]} params.xdefault - Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required. + * @param {any[][]} params.xdefault - Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required. * @throws {AppwriteException} * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createLineColumn` instead. */ - createLineAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] }): Promise; + createLineAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][] }): Promise; /** * Create a geometric line attribute. * @@ -2870,27 +2876,27 @@ export class Databases { * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? - * @param {any[]} xdefault - Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required. + * @param {any[][]} xdefault - Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createLineAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[]): Promise; + createLineAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][]): Promise; createLineAttribute( - paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] } | string, - ...rest: [(string)?, (string)?, (boolean)?, (any[])?] + paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][] } | string, + ...rest: [(string)?, (string)?, (boolean)?, (any[][])?] ): Promise { - let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] }; + let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][] }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] }; + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][] }; } else { params = { databaseId: paramsOrFirst as string, collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as any[] + xdefault: rest[3] as any[][] }; } @@ -2913,7 +2919,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/line'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/line'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -2947,13 +2953,13 @@ export class Databases { * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection). * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? - * @param {any[]} params.xdefault - Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required. + * @param {any[][]} params.xdefault - Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required. * @param {string} params.newKey - New attribute key. * @throws {AppwriteException} * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateLineColumn` instead. */ - updateLineAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }): Promise; + updateLineAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string }): Promise; /** * Update a line attribute. Changing the `default` value will not update already existing documents. * @@ -2961,28 +2967,28 @@ export class Databases { * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection). * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? - * @param {any[]} xdefault - Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required. + * @param {any[][]} xdefault - Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required. * @param {string} newKey - New attribute key. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateLineAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string): Promise; + updateLineAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string): Promise; updateLineAttribute( - paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string } | string, - ...rest: [(string)?, (string)?, (boolean)?, (any[])?, (string)?] + paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string } | string, + ...rest: [(string)?, (string)?, (boolean)?, (any[][])?, (string)?] ): Promise { - let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }; + let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }; + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string }; } else { params = { databaseId: paramsOrFirst as string, collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as any[], + xdefault: rest[3] as any[][], newKey: rest[4] as string }; } @@ -3007,7 +3013,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/line/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/line/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; if (typeof required !== 'undefined') { payload['required'] = required; @@ -3047,6 +3053,7 @@ export class Databases { * @param {boolean} params.encrypt - Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried. * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createLongtextColumn` instead. */ createLongtextAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }): Promise; /** @@ -3106,7 +3113,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/longtext'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/longtext'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -3151,6 +3158,7 @@ export class Databases { * @param {string} params.newKey - New Attribute Key. * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateLongtextColumn` instead. */ updateLongtextAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string }): Promise; /** @@ -3210,7 +3218,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/longtext/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/longtext/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; if (typeof required !== 'undefined') { payload['required'] = required; @@ -3250,6 +3258,7 @@ export class Databases { * @param {boolean} params.encrypt - Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried. * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createMediumtextColumn` instead. */ createMediumtextAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }): Promise; /** @@ -3309,7 +3318,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/mediumtext'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/mediumtext'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -3354,6 +3363,7 @@ export class Databases { * @param {string} params.newKey - New Attribute Key. * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateMediumtextColumn` instead. */ updateMediumtextAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string }): Promise; /** @@ -3413,7 +3423,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/mediumtext/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/mediumtext/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; if (typeof required !== 'undefined') { payload['required'] = required; @@ -3447,12 +3457,12 @@ export class Databases { * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? - * @param {any[]} params.xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required. + * @param {number[]} params.xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required. * @throws {AppwriteException} * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createPointColumn` instead. */ - createPointAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] }): Promise; + createPointAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number[] }): Promise; /** * Create a geometric point attribute. * @@ -3460,27 +3470,27 @@ export class Databases { * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? - * @param {any[]} xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required. + * @param {number[]} xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createPointAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[]): Promise; + createPointAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number[]): Promise; createPointAttribute( - paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] } | string, - ...rest: [(string)?, (string)?, (boolean)?, (any[])?] + paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number[] } | string, + ...rest: [(string)?, (string)?, (boolean)?, (number[])?] ): Promise { - let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] }; + let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number[] }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] }; + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number[] }; } else { params = { databaseId: paramsOrFirst as string, collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as any[] + xdefault: rest[3] as number[] }; } @@ -3503,7 +3513,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/point'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/point'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -3537,13 +3547,13 @@ export class Databases { * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection). * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? - * @param {any[]} params.xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required. + * @param {number[]} params.xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required. * @param {string} params.newKey - New attribute key. * @throws {AppwriteException} * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updatePointColumn` instead. */ - updatePointAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }): Promise; + updatePointAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number[], newKey?: string }): Promise; /** * Update a point attribute. Changing the `default` value will not update already existing documents. * @@ -3551,28 +3561,28 @@ export class Databases { * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection). * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? - * @param {any[]} xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required. + * @param {number[]} xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required. * @param {string} newKey - New attribute key. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updatePointAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string): Promise; + updatePointAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number[], newKey?: string): Promise; updatePointAttribute( - paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string } | string, - ...rest: [(string)?, (string)?, (boolean)?, (any[])?, (string)?] + paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number[], newKey?: string } | string, + ...rest: [(string)?, (string)?, (boolean)?, (number[])?, (string)?] ): Promise { - let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }; + let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number[], newKey?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }; + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number[], newKey?: string }; } else { params = { databaseId: paramsOrFirst as string, collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as any[], + xdefault: rest[3] as number[], newKey: rest[4] as string }; } @@ -3597,7 +3607,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/point/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/point/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; if (typeof required !== 'undefined') { payload['required'] = required; @@ -3631,12 +3641,12 @@ export class Databases { * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? - * @param {any[]} params.xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required. + * @param {any[][]} params.xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required. * @throws {AppwriteException} * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createPolygonColumn` instead. */ - createPolygonAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] }): Promise; + createPolygonAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][] }): Promise; /** * Create a geometric polygon attribute. * @@ -3644,27 +3654,27 @@ export class Databases { * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? - * @param {any[]} xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required. + * @param {any[][]} xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createPolygonAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[]): Promise; + createPolygonAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][]): Promise; createPolygonAttribute( - paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] } | string, - ...rest: [(string)?, (string)?, (boolean)?, (any[])?] + paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][] } | string, + ...rest: [(string)?, (string)?, (boolean)?, (any[][])?] ): Promise { - let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] }; + let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][] }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[] }; + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][] }; } else { params = { databaseId: paramsOrFirst as string, collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as any[] + xdefault: rest[3] as any[][] }; } @@ -3687,7 +3697,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/polygon'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/polygon'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -3721,13 +3731,13 @@ export class Databases { * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection). * @param {string} params.key - Attribute Key. * @param {boolean} params.required - Is attribute required? - * @param {any[]} params.xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required. + * @param {any[][]} params.xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required. * @param {string} params.newKey - New attribute key. * @throws {AppwriteException} * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updatePolygonColumn` instead. */ - updatePolygonAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }): Promise; + updatePolygonAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string }): Promise; /** * Update a polygon attribute. Changing the `default` value will not update already existing documents. * @@ -3735,28 +3745,28 @@ export class Databases { * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection). * @param {string} key - Attribute Key. * @param {boolean} required - Is attribute required? - * @param {any[]} xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required. + * @param {any[][]} xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required. * @param {string} newKey - New attribute key. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updatePolygonAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string): Promise; + updatePolygonAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string): Promise; updatePolygonAttribute( - paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string } | string, - ...rest: [(string)?, (string)?, (boolean)?, (any[])?, (string)?] + paramsOrFirst: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string } | string, + ...rest: [(string)?, (string)?, (boolean)?, (any[][])?, (string)?] ): Promise { - let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }; + let params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }; + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string }; } else { params = { databaseId: paramsOrFirst as string, collectionId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as any[], + xdefault: rest[3] as any[][], newKey: rest[4] as string }; } @@ -3781,7 +3791,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/polygon/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/polygon/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; if (typeof required !== 'undefined') { payload['required'] = required; @@ -3885,7 +3895,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "type"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/relationship'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/relationship'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))); const payload: Payload = {}; if (typeof relatedCollectionId !== 'undefined') { payload['relatedCollectionId'] = relatedCollectionId; @@ -3983,7 +3993,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "key"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/relationship/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/relationship/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; if (typeof onDelete !== 'undefined') { payload['onDelete'] = onDelete; @@ -4087,7 +4097,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/string'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/string'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -4199,7 +4209,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/string/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/string/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; if (typeof required !== 'undefined') { payload['required'] = required; @@ -4242,6 +4252,7 @@ export class Databases { * @param {boolean} params.encrypt - Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried. * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createTextColumn` instead. */ createTextAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }): Promise; /** @@ -4301,7 +4312,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/text'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/text'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -4346,6 +4357,7 @@ export class Databases { * @param {string} params.newKey - New Attribute Key. * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateTextColumn` instead. */ updateTextAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string }): Promise; /** @@ -4405,7 +4417,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/text/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/text/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; if (typeof required !== 'undefined') { payload['required'] = required; @@ -4501,7 +4513,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/url'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/url'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -4603,7 +4615,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/url/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/url/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; if (typeof required !== 'undefined') { payload['required'] = required; @@ -4644,6 +4656,7 @@ export class Databases { * @param {boolean} params.encrypt - Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried. * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createVarcharColumn` instead. */ createVarcharAttribute(params: { databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean, encrypt?: boolean }): Promise; /** @@ -4709,7 +4722,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/varchar'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/varchar'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -4758,6 +4771,7 @@ export class Databases { * @param {string} params.newKey - New Attribute Key. * @throws {AppwriteException} * @returns {Promise} + * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateVarcharColumn` instead. */ updateVarcharAttribute(params: { databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string }): Promise; /** @@ -4820,7 +4834,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/varchar/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/varchar/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; if (typeof required !== 'undefined') { payload['required'] = required; @@ -4902,7 +4916,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "key"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -4971,7 +4985,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "key"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -5049,7 +5063,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "collectionId"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))); const payload: Payload = {}; if (typeof queries !== 'undefined') { payload['queries'] = queries; @@ -5145,7 +5159,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "data"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))); const payload: Payload = {}; if (typeof documentId !== 'undefined') { payload['documentId'] = documentId; @@ -5231,7 +5245,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "documents"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))); const payload: Payload = {}; if (typeof documents !== 'undefined') { payload['documents'] = documents; @@ -5313,7 +5327,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "documents"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))); const payload: Payload = {}; if (typeof documents !== 'undefined') { payload['documents'] = documents; @@ -5394,7 +5408,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "collectionId"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))); const payload: Payload = {}; if (typeof data !== 'undefined') { payload['data'] = data; @@ -5474,7 +5488,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "collectionId"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))); const payload: Payload = {}; if (typeof queries !== 'undefined') { payload['queries'] = queries; @@ -5558,7 +5572,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "documentId"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))).replace('{documentId}', encodeURIComponent(String(documentId))); const payload: Payload = {}; if (typeof queries !== 'undefined') { payload['queries'] = queries; @@ -5645,7 +5659,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "documentId"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))).replace('{documentId}', encodeURIComponent(String(documentId))); const payload: Payload = {}; if (typeof data !== 'undefined') { payload['data'] = data; @@ -5736,7 +5750,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "documentId"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))).replace('{documentId}', encodeURIComponent(String(documentId))); const payload: Payload = {}; if (typeof data !== 'undefined') { payload['data'] = data; @@ -5819,7 +5833,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "documentId"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))).replace('{documentId}', encodeURIComponent(String(documentId))); const payload: Payload = {}; if (typeof transactionId !== 'undefined') { payload['transactionId'] = transactionId; @@ -5910,7 +5924,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "attribute"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId).replace('{attribute}', attribute); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))).replace('{documentId}', encodeURIComponent(String(documentId))).replace('{attribute}', encodeURIComponent(String(attribute))); const payload: Payload = {}; if (typeof value !== 'undefined') { payload['value'] = value; @@ -6008,7 +6022,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "attribute"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId).replace('{attribute}', attribute); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))).replace('{documentId}', encodeURIComponent(String(documentId))).replace('{attribute}', encodeURIComponent(String(attribute))); const payload: Payload = {}; if (typeof value !== 'undefined') { payload['value'] = value; @@ -6088,7 +6102,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "collectionId"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))); const payload: Payload = {}; if (typeof queries !== 'undefined') { payload['queries'] = queries; @@ -6187,7 +6201,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "attributes"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -6272,7 +6286,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "key"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -6341,7 +6355,7 @@ export class Databases { throw new AppwriteException('Missing required parameter: "key"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key); + const apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); diff --git a/src/services/functions.ts b/src/services/functions.ts index 1a0fb93..9957381 100644 --- a/src/services/functions.ts +++ b/src/services/functions.ts @@ -99,7 +99,7 @@ export class Functions { * @param {boolean} params.logging - When disabled, executions will exclude logs and errors, and will be slightly faster. * @param {string} params.entrypoint - Entrypoint File. This path is relative to the "providerRootDirectory". * @param {string} params.commands - Build Commands. - * @param {ProjectKeyScopes[]} params.scopes - List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed. + * @param {ProjectKeyScopes[]} params.scopes - List of scopes allowed for API key auto-generated for every execution. Maximum of 200 scopes are allowed. * @param {string} params.installationId - Appwrite Installation ID for VCS (Version Control System) deployment. * @param {string} params.providerRepositoryId - Repository ID of the repo linked to the function. * @param {string} params.providerBranch - Production branch for the repo linked to the function. @@ -128,7 +128,7 @@ export class Functions { * @param {boolean} logging - When disabled, executions will exclude logs and errors, and will be slightly faster. * @param {string} entrypoint - Entrypoint File. This path is relative to the "providerRootDirectory". * @param {string} commands - Build Commands. - * @param {ProjectKeyScopes[]} scopes - List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed. + * @param {ProjectKeyScopes[]} scopes - List of scopes allowed for API key auto-generated for every execution. Maximum of 200 scopes are allowed. * @param {string} installationId - Appwrite Installation ID for VCS (Version Control System) deployment. * @param {string} providerRepositoryId - Repository ID of the repo linked to the function. * @param {string} providerBranch - Production branch for the repo linked to the function. @@ -324,13 +324,41 @@ export class Functions { /** * List allowed function specifications for this instance. * + * @param {string} params.type - Specification type to list. Can be one of: runtimes, builds. * @throws {AppwriteException} * @returns {Promise} */ - listSpecifications(): Promise { + listSpecifications(params?: { type?: string }): Promise; + /** + * List allowed function specifications for this instance. + * + * @param {string} type - Specification type to list. Can be one of: runtimes, builds. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listSpecifications(type?: string): Promise; + listSpecifications( + paramsOrFirst?: { type?: string } | string + ): Promise { + let params: { type?: string }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { type?: string }; + } else { + params = { + type: paramsOrFirst as string + }; + } + + const type = params.type; + const apiPath = '/functions/specifications'; const payload: Payload = {}; + if (typeof type !== 'undefined') { + payload['type'] = type; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -382,7 +410,7 @@ export class Functions { throw new AppwriteException('Missing required parameter: "functionId"'); } - const apiPath = '/functions/{functionId}'.replace('{functionId}', functionId); + const apiPath = '/functions/{functionId}'.replace('{functionId}', encodeURIComponent(String(functionId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -413,7 +441,7 @@ export class Functions { * @param {boolean} params.logging - When disabled, executions will exclude logs and errors, and will be slightly faster. * @param {string} params.entrypoint - Entrypoint File. This path is relative to the "providerRootDirectory". * @param {string} params.commands - Build Commands. - * @param {ProjectKeyScopes[]} params.scopes - List of scopes allowed for API Key auto-generated for every execution. Maximum of 100 scopes are allowed. + * @param {ProjectKeyScopes[]} params.scopes - List of scopes allowed for API Key auto-generated for every execution. Maximum of 200 scopes are allowed. * @param {string} params.installationId - Appwrite Installation ID for VCS (Version Controle System) deployment. * @param {string} params.providerRepositoryId - Repository ID of the repo linked to the function * @param {string} params.providerBranch - Production branch for the repo linked to the function @@ -442,7 +470,7 @@ export class Functions { * @param {boolean} logging - When disabled, executions will exclude logs and errors, and will be slightly faster. * @param {string} entrypoint - Entrypoint File. This path is relative to the "providerRootDirectory". * @param {string} commands - Build Commands. - * @param {ProjectKeyScopes[]} scopes - List of scopes allowed for API Key auto-generated for every execution. Maximum of 100 scopes are allowed. + * @param {ProjectKeyScopes[]} scopes - List of scopes allowed for API Key auto-generated for every execution. Maximum of 200 scopes are allowed. * @param {string} installationId - Appwrite Installation ID for VCS (Version Controle System) deployment. * @param {string} providerRepositoryId - Repository ID of the repo linked to the function * @param {string} providerBranch - Production branch for the repo linked to the function @@ -523,7 +551,7 @@ export class Functions { throw new AppwriteException('Missing required parameter: "name"'); } - const apiPath = '/functions/{functionId}'.replace('{functionId}', functionId); + const apiPath = '/functions/{functionId}'.replace('{functionId}', encodeURIComponent(String(functionId))); const payload: Payload = {}; if (typeof name !== 'undefined') { payload['name'] = name; @@ -640,7 +668,7 @@ export class Functions { throw new AppwriteException('Missing required parameter: "functionId"'); } - const apiPath = '/functions/{functionId}'.replace('{functionId}', functionId); + const apiPath = '/functions/{functionId}'.replace('{functionId}', encodeURIComponent(String(functionId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -701,7 +729,7 @@ export class Functions { throw new AppwriteException('Missing required parameter: "deploymentId"'); } - const apiPath = '/functions/{functionId}/deployment'.replace('{functionId}', functionId); + const apiPath = '/functions/{functionId}/deployment'.replace('{functionId}', encodeURIComponent(String(functionId))); const payload: Payload = {}; if (typeof deploymentId !== 'undefined') { payload['deploymentId'] = deploymentId; @@ -771,7 +799,7 @@ export class Functions { throw new AppwriteException('Missing required parameter: "functionId"'); } - const apiPath = '/functions/{functionId}/deployments'.replace('{functionId}', functionId); + const apiPath = '/functions/{functionId}/deployments'.replace('{functionId}', encodeURIComponent(String(functionId))); const payload: Payload = {}; if (typeof queries !== 'undefined') { payload['queries'] = queries; @@ -867,7 +895,7 @@ export class Functions { throw new AppwriteException('Missing required parameter: "activate"'); } - const apiPath = '/functions/{functionId}/deployments'.replace('{functionId}', functionId); + const apiPath = '/functions/{functionId}/deployments'.replace('{functionId}', encodeURIComponent(String(functionId))); const payload: Payload = {}; if (typeof entrypoint !== 'undefined') { payload['entrypoint'] = entrypoint; @@ -946,7 +974,7 @@ export class Functions { throw new AppwriteException('Missing required parameter: "deploymentId"'); } - const apiPath = '/functions/{functionId}/deployments/duplicate'.replace('{functionId}', functionId); + const apiPath = '/functions/{functionId}/deployments/duplicate'.replace('{functionId}', encodeURIComponent(String(functionId))); const payload: Payload = {}; if (typeof deploymentId !== 'undefined') { payload['deploymentId'] = deploymentId; @@ -1050,7 +1078,7 @@ export class Functions { throw new AppwriteException('Missing required parameter: "reference"'); } - const apiPath = '/functions/{functionId}/deployments/template'.replace('{functionId}', functionId); + const apiPath = '/functions/{functionId}/deployments/template'.replace('{functionId}', encodeURIComponent(String(functionId))); const payload: Payload = {}; if (typeof repository !== 'undefined') { payload['repository'] = repository; @@ -1145,7 +1173,7 @@ export class Functions { throw new AppwriteException('Missing required parameter: "reference"'); } - const apiPath = '/functions/{functionId}/deployments/vcs'.replace('{functionId}', functionId); + const apiPath = '/functions/{functionId}/deployments/vcs'.replace('{functionId}', encodeURIComponent(String(functionId))); const payload: Payload = {}; if (typeof type !== 'undefined') { payload['type'] = type; @@ -1216,7 +1244,7 @@ export class Functions { throw new AppwriteException('Missing required parameter: "deploymentId"'); } - const apiPath = '/functions/{functionId}/deployments/{deploymentId}'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId); + const apiPath = '/functions/{functionId}/deployments/{deploymentId}'.replace('{functionId}', encodeURIComponent(String(functionId))).replace('{deploymentId}', encodeURIComponent(String(deploymentId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -1277,7 +1305,7 @@ export class Functions { throw new AppwriteException('Missing required parameter: "deploymentId"'); } - const apiPath = '/functions/{functionId}/deployments/{deploymentId}'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId); + const apiPath = '/functions/{functionId}/deployments/{deploymentId}'.replace('{functionId}', encodeURIComponent(String(functionId))).replace('{deploymentId}', encodeURIComponent(String(deploymentId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -1300,40 +1328,44 @@ export class Functions { * @param {string} params.functionId - Function ID. * @param {string} params.deploymentId - Deployment ID. * @param {DeploymentDownloadType} params.type - Deployment file to download. Can be: "source", "output". + * @param {string} params.token - Presigned source-download token for accessing this deployment without a session (jobs-service). * @throws {AppwriteException} * @returns {Promise} */ - getDeploymentDownload(params: { functionId: string, deploymentId: string, type?: DeploymentDownloadType }): Promise; + getDeploymentDownload(params: { functionId: string, deploymentId: string, type?: DeploymentDownloadType, token?: string }): Promise; /** * Get a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. * * @param {string} functionId - Function ID. * @param {string} deploymentId - Deployment ID. * @param {DeploymentDownloadType} type - Deployment file to download. Can be: "source", "output". + * @param {string} token - Presigned source-download token for accessing this deployment without a session (jobs-service). * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getDeploymentDownload(functionId: string, deploymentId: string, type?: DeploymentDownloadType): Promise; + getDeploymentDownload(functionId: string, deploymentId: string, type?: DeploymentDownloadType, token?: string): Promise; getDeploymentDownload( - paramsOrFirst: { functionId: string, deploymentId: string, type?: DeploymentDownloadType } | string, - ...rest: [(string)?, (DeploymentDownloadType)?] + paramsOrFirst: { functionId: string, deploymentId: string, type?: DeploymentDownloadType, token?: string } | string, + ...rest: [(string)?, (DeploymentDownloadType)?, (string)?] ): Promise { - let params: { functionId: string, deploymentId: string, type?: DeploymentDownloadType }; + let params: { functionId: string, deploymentId: string, type?: DeploymentDownloadType, token?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { functionId: string, deploymentId: string, type?: DeploymentDownloadType }; + params = (paramsOrFirst || {}) as { functionId: string, deploymentId: string, type?: DeploymentDownloadType, token?: string }; } else { params = { functionId: paramsOrFirst as string, deploymentId: rest[0] as string, - type: rest[1] as DeploymentDownloadType + type: rest[1] as DeploymentDownloadType, + token: rest[2] as string }; } const functionId = params.functionId; const deploymentId = params.deploymentId; const type = params.type; + const token = params.token; if (typeof functionId === 'undefined') { throw new AppwriteException('Missing required parameter: "functionId"'); @@ -1342,11 +1374,14 @@ export class Functions { throw new AppwriteException('Missing required parameter: "deploymentId"'); } - const apiPath = '/functions/{functionId}/deployments/{deploymentId}/download'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId); + const apiPath = '/functions/{functionId}/deployments/{deploymentId}/download'.replace('{functionId}', encodeURIComponent(String(functionId))).replace('{deploymentId}', encodeURIComponent(String(deploymentId))); const payload: Payload = {}; if (typeof type !== 'undefined') { payload['type'] = type; } + if (typeof token !== 'undefined') { + payload['token'] = token; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -1407,7 +1442,7 @@ export class Functions { throw new AppwriteException('Missing required parameter: "deploymentId"'); } - const apiPath = '/functions/{functionId}/deployments/{deploymentId}/status'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId); + const apiPath = '/functions/{functionId}/deployments/{deploymentId}/status'.replace('{functionId}', encodeURIComponent(String(functionId))).replace('{deploymentId}', encodeURIComponent(String(deploymentId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -1470,7 +1505,7 @@ export class Functions { throw new AppwriteException('Missing required parameter: "functionId"'); } - const apiPath = '/functions/{functionId}/executions'.replace('{functionId}', functionId); + const apiPath = '/functions/{functionId}/executions'.replace('{functionId}', encodeURIComponent(String(functionId))); const payload: Payload = {}; if (typeof queries !== 'undefined') { payload['queries'] = queries; @@ -1554,7 +1589,7 @@ export class Functions { throw new AppwriteException('Missing required parameter: "functionId"'); } - const apiPath = '/functions/{functionId}/executions'.replace('{functionId}', functionId); + const apiPath = '/functions/{functionId}/executions'.replace('{functionId}', encodeURIComponent(String(functionId))); const payload: Payload = {}; if (typeof body !== 'undefined') { payload['body'] = body; @@ -1634,7 +1669,7 @@ export class Functions { throw new AppwriteException('Missing required parameter: "executionId"'); } - const apiPath = '/functions/{functionId}/executions/{executionId}'.replace('{functionId}', functionId).replace('{executionId}', executionId); + const apiPath = '/functions/{functionId}/executions/{executionId}'.replace('{functionId}', encodeURIComponent(String(functionId))).replace('{executionId}', encodeURIComponent(String(executionId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -1695,7 +1730,7 @@ export class Functions { throw new AppwriteException('Missing required parameter: "executionId"'); } - const apiPath = '/functions/{functionId}/executions/{executionId}'.replace('{functionId}', functionId).replace('{executionId}', executionId); + const apiPath = '/functions/{functionId}/executions/{executionId}'.replace('{functionId}', encodeURIComponent(String(functionId))).replace('{executionId}', encodeURIComponent(String(executionId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -1757,7 +1792,7 @@ export class Functions { throw new AppwriteException('Missing required parameter: "functionId"'); } - const apiPath = '/functions/{functionId}/variables'.replace('{functionId}', functionId); + const apiPath = '/functions/{functionId}/variables'.replace('{functionId}', encodeURIComponent(String(functionId))); const payload: Payload = {}; if (typeof queries !== 'undefined') { payload['queries'] = queries; @@ -1842,7 +1877,7 @@ export class Functions { throw new AppwriteException('Missing required parameter: "value"'); } - const apiPath = '/functions/{functionId}/variables'.replace('{functionId}', functionId); + const apiPath = '/functions/{functionId}/variables'.replace('{functionId}', encodeURIComponent(String(functionId))); const payload: Payload = {}; if (typeof variableId !== 'undefined') { payload['variableId'] = variableId; @@ -1916,7 +1951,7 @@ export class Functions { throw new AppwriteException('Missing required parameter: "variableId"'); } - const apiPath = '/functions/{functionId}/variables/{variableId}'.replace('{functionId}', functionId).replace('{variableId}', variableId); + const apiPath = '/functions/{functionId}/variables/{variableId}'.replace('{functionId}', encodeURIComponent(String(functionId))).replace('{variableId}', encodeURIComponent(String(variableId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -1989,7 +2024,7 @@ export class Functions { throw new AppwriteException('Missing required parameter: "variableId"'); } - const apiPath = '/functions/{functionId}/variables/{variableId}'.replace('{functionId}', functionId).replace('{variableId}', variableId); + const apiPath = '/functions/{functionId}/variables/{variableId}'.replace('{functionId}', encodeURIComponent(String(functionId))).replace('{variableId}', encodeURIComponent(String(variableId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -2060,7 +2095,7 @@ export class Functions { throw new AppwriteException('Missing required parameter: "variableId"'); } - const apiPath = '/functions/{functionId}/variables/{variableId}'.replace('{functionId}', functionId).replace('{variableId}', variableId); + const apiPath = '/functions/{functionId}/variables/{variableId}'.replace('{functionId}', encodeURIComponent(String(functionId))).replace('{variableId}', encodeURIComponent(String(variableId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); diff --git a/src/services/health.ts b/src/services/health.ts deleted file mode 100644 index 6b8ceda..0000000 --- a/src/services/health.ts +++ /dev/null @@ -1,1117 +0,0 @@ -import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; -import type { Models } from '../models'; - - -import { HealthQueueName } from '../enums/health-queue-name'; - -export class Health { - client: Client; - - constructor(client: Client) { - this.client = client; - } - - /** - * Check the Appwrite HTTP server is up and responsive. - * - * @throws {AppwriteException} - * @returns {Promise} - */ - get(): Promise { - - const apiPath = '/health'; - 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, - ); - } - - /** - * Check the Appwrite Antivirus server is up and connection is successful. - * - * @throws {AppwriteException} - * @returns {Promise} - */ - getAntivirus(): Promise { - - const apiPath = '/health/anti-virus'; - 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, - ); - } - - /** - * Check the database that backs the audit and activity store. When the connection is reachable the endpoint returns a passing status with its response time. - * - * - * @throws {AppwriteException} - * @returns {Promise} - */ - getAuditsDB(): Promise { - - const apiPath = '/health/audits-db'; - const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload, - ); - } - - /** - * Check the Appwrite in-memory cache servers are up and connection is successful. - * - * @throws {AppwriteException} - * @returns {Promise} - */ - getCache(): Promise { - - const apiPath = '/health/cache'; - 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, - ); - } - - /** - * Get the SSL certificate for a domain - * - * @param {string} params.domain - string - * @throws {AppwriteException} - * @returns {Promise} - */ - getCertificate(params?: { domain?: string }): Promise; - /** - * Get the SSL certificate for a domain - * - * @param {string} domain - string - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getCertificate(domain?: string): Promise; - getCertificate( - paramsOrFirst?: { domain?: string } | string - ): Promise { - let params: { domain?: string }; - - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { domain?: string }; - } else { - params = { - domain: paramsOrFirst as string - }; - } - - const domain = params.domain; - - - const apiPath = '/health/certificate'; - const payload: Payload = {}; - if (typeof domain !== 'undefined') { - payload['domain'] = domain; - } - 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 console pausing health status. Monitors projects approaching the pause threshold to detect potential issues with console access tracking. - * - * - * @param {number} params.threshold - Percentage threshold of projects approaching pause. When hit (equal or higher), endpoint returns server error. Default value is 10. - * @param {number} params.inactivityDays - Number of days of inactivity before a project is paused. Should match the plan's projectInactivityDays setting. Default value is 7. - * @throws {AppwriteException} - * @returns {Promise} - */ - getConsolePausing(params?: { threshold?: number, inactivityDays?: number }): Promise; - /** - * Get console pausing health status. Monitors projects approaching the pause threshold to detect potential issues with console access tracking. - * - * - * @param {number} threshold - Percentage threshold of projects approaching pause. When hit (equal or higher), endpoint returns server error. Default value is 10. - * @param {number} inactivityDays - Number of days of inactivity before a project is paused. Should match the plan's projectInactivityDays setting. Default value is 7. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getConsolePausing(threshold?: number, inactivityDays?: number): Promise; - getConsolePausing( - paramsOrFirst?: { threshold?: number, inactivityDays?: number } | number, - ...rest: [(number)?] - ): Promise { - let params: { threshold?: number, inactivityDays?: number }; - - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number, inactivityDays?: number }; - } else { - params = { - threshold: paramsOrFirst as number, - inactivityDays: rest[0] as number - }; - } - - const threshold = params.threshold; - const inactivityDays = params.inactivityDays; - - - const apiPath = '/health/console-pausing'; - const payload: Payload = {}; - if (typeof threshold !== 'undefined') { - payload['threshold'] = threshold; - } - if (typeof inactivityDays !== 'undefined') { - payload['inactivityDays'] = inactivityDays; - } - 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, - ); - } - - /** - * Check the Appwrite database servers are up and connection is successful. - * - * @throws {AppwriteException} - * @returns {Promise} - */ - getDB(): Promise { - - const apiPath = '/health/db'; - const payload: Payload = {}; - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload, - ); - } - - /** - * Check the Appwrite pub-sub servers are up and connection is successful. - * - * @throws {AppwriteException} - * @returns {Promise} - */ - getPubSub(): Promise { - - const apiPath = '/health/pubsub'; - 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, - ); - } - - /** - * Get the number of audit logs that are waiting to be processed in the Appwrite internal queue server. - * - * - * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. - * @throws {AppwriteException} - * @returns {Promise} - */ - getQueueAudits(params?: { threshold?: number }): Promise; - /** - * Get the number of audit logs that are waiting to be processed in the Appwrite internal queue server. - * - * - * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getQueueAudits(threshold?: number): Promise; - getQueueAudits( - paramsOrFirst?: { threshold?: number } | number - ): Promise { - let params: { threshold?: number }; - - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number }; - } else { - params = { - threshold: paramsOrFirst as number - }; - } - - const threshold = params.threshold; - - - const apiPath = '/health/queue/audits'; - const payload: Payload = {}; - if (typeof threshold !== 'undefined') { - payload['threshold'] = threshold; - } - 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 the number of builds that are waiting to be processed in the Appwrite internal queue server. - * - * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. - * @throws {AppwriteException} - * @returns {Promise} - */ - getQueueBuilds(params?: { threshold?: number }): Promise; - /** - * Get the number of builds that are waiting to be processed in the Appwrite internal queue server. - * - * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getQueueBuilds(threshold?: number): Promise; - getQueueBuilds( - paramsOrFirst?: { threshold?: number } | number - ): Promise { - let params: { threshold?: number }; - - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number }; - } else { - params = { - threshold: paramsOrFirst as number - }; - } - - const threshold = params.threshold; - - - const apiPath = '/health/queue/builds'; - const payload: Payload = {}; - if (typeof threshold !== 'undefined') { - payload['threshold'] = threshold; - } - 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 the number of certificates that are waiting to be issued against [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue server. - * - * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. - * @throws {AppwriteException} - * @returns {Promise} - */ - getQueueCertificates(params?: { threshold?: number }): Promise; - /** - * Get the number of certificates that are waiting to be issued against [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue server. - * - * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getQueueCertificates(threshold?: number): Promise; - getQueueCertificates( - paramsOrFirst?: { threshold?: number } | number - ): Promise { - let params: { threshold?: number }; - - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number }; - } else { - params = { - threshold: paramsOrFirst as number - }; - } - - const threshold = params.threshold; - - - const apiPath = '/health/queue/certificates'; - const payload: Payload = {}; - if (typeof threshold !== 'undefined') { - payload['threshold'] = threshold; - } - 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 the number of database changes that are waiting to be processed in the Appwrite internal queue server. - * - * @param {string} params.name - Queue name for which to check the queue size - * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. - * @throws {AppwriteException} - * @returns {Promise} - */ - getQueueDatabases(params?: { name?: string, threshold?: number }): Promise; - /** - * Get the number of database changes that are waiting to be processed in the Appwrite internal queue server. - * - * @param {string} name - Queue name for which to check the queue size - * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getQueueDatabases(name?: string, threshold?: number): Promise; - getQueueDatabases( - paramsOrFirst?: { name?: string, threshold?: number } | string, - ...rest: [(number)?] - ): Promise { - let params: { name?: string, threshold?: number }; - - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { name?: string, threshold?: number }; - } else { - params = { - name: paramsOrFirst as string, - threshold: rest[0] as number - }; - } - - const name = params.name; - const threshold = params.threshold; - - - const apiPath = '/health/queue/databases'; - const payload: Payload = {}; - if (typeof name !== 'undefined') { - payload['name'] = name; - } - if (typeof threshold !== 'undefined') { - payload['threshold'] = threshold; - } - 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 the number of background destructive changes that are waiting to be processed in the Appwrite internal queue server. - * - * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. - * @throws {AppwriteException} - * @returns {Promise} - */ - getQueueDeletes(params?: { threshold?: number }): Promise; - /** - * Get the number of background destructive changes that are waiting to be processed in the Appwrite internal queue server. - * - * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getQueueDeletes(threshold?: number): Promise; - getQueueDeletes( - paramsOrFirst?: { threshold?: number } | number - ): Promise { - let params: { threshold?: number }; - - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number }; - } else { - params = { - threshold: paramsOrFirst as number - }; - } - - const threshold = params.threshold; - - - const apiPath = '/health/queue/deletes'; - const payload: Payload = {}; - if (typeof threshold !== 'undefined') { - payload['threshold'] = threshold; - } - 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, - ); - } - - /** - * Returns the amount of failed jobs in a given queue. - * - * - * @param {HealthQueueName} params.name - The name of the queue - * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. - * @throws {AppwriteException} - * @returns {Promise} - */ - getFailedJobs(params: { name: HealthQueueName, threshold?: number }): Promise; - /** - * Returns the amount of failed jobs in a given queue. - * - * - * @param {HealthQueueName} name - The name of the queue - * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getFailedJobs(name: HealthQueueName, threshold?: number): Promise; - getFailedJobs( - paramsOrFirst: { name: HealthQueueName, threshold?: number } | HealthQueueName, - ...rest: [(number)?] - ): Promise { - let params: { name: HealthQueueName, threshold?: number }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('name' in paramsOrFirst || 'threshold' in paramsOrFirst))) { - params = (paramsOrFirst || {}) as { name: HealthQueueName, threshold?: number }; - } else { - params = { - name: paramsOrFirst as HealthQueueName, - threshold: rest[0] as number - }; - } - - const name = params.name; - const threshold = params.threshold; - - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - - const apiPath = '/health/queue/failed/{name}'.replace('{name}', name); - const payload: Payload = {}; - if (typeof threshold !== 'undefined') { - payload['threshold'] = threshold; - } - 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 the number of function executions that are waiting to be processed in the Appwrite internal queue server. - * - * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. - * @throws {AppwriteException} - * @returns {Promise} - */ - getQueueFunctions(params?: { threshold?: number }): Promise; - /** - * Get the number of function executions that are waiting to be processed in the Appwrite internal queue server. - * - * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getQueueFunctions(threshold?: number): Promise; - getQueueFunctions( - paramsOrFirst?: { threshold?: number } | number - ): Promise { - let params: { threshold?: number }; - - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number }; - } else { - params = { - threshold: paramsOrFirst as number - }; - } - - const threshold = params.threshold; - - - const apiPath = '/health/queue/functions'; - const payload: Payload = {}; - if (typeof threshold !== 'undefined') { - payload['threshold'] = threshold; - } - 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 the number of logs that are waiting to be processed in the Appwrite internal queue server. - * - * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. - * @throws {AppwriteException} - * @returns {Promise} - */ - getQueueLogs(params?: { threshold?: number }): Promise; - /** - * Get the number of logs that are waiting to be processed in the Appwrite internal queue server. - * - * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getQueueLogs(threshold?: number): Promise; - getQueueLogs( - paramsOrFirst?: { threshold?: number } | number - ): Promise { - let params: { threshold?: number }; - - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number }; - } else { - params = { - threshold: paramsOrFirst as number - }; - } - - const threshold = params.threshold; - - - const apiPath = '/health/queue/logs'; - const payload: Payload = {}; - if (typeof threshold !== 'undefined') { - payload['threshold'] = threshold; - } - 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 the number of mails that are waiting to be processed in the Appwrite internal queue server. - * - * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. - * @throws {AppwriteException} - * @returns {Promise} - */ - getQueueMails(params?: { threshold?: number }): Promise; - /** - * Get the number of mails that are waiting to be processed in the Appwrite internal queue server. - * - * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getQueueMails(threshold?: number): Promise; - getQueueMails( - paramsOrFirst?: { threshold?: number } | number - ): Promise { - let params: { threshold?: number }; - - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number }; - } else { - params = { - threshold: paramsOrFirst as number - }; - } - - const threshold = params.threshold; - - - const apiPath = '/health/queue/mails'; - const payload: Payload = {}; - if (typeof threshold !== 'undefined') { - payload['threshold'] = threshold; - } - 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 the number of messages that are waiting to be processed in the Appwrite internal queue server. - * - * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. - * @throws {AppwriteException} - * @returns {Promise} - */ - getQueueMessaging(params?: { threshold?: number }): Promise; - /** - * Get the number of messages that are waiting to be processed in the Appwrite internal queue server. - * - * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getQueueMessaging(threshold?: number): Promise; - getQueueMessaging( - paramsOrFirst?: { threshold?: number } | number - ): Promise { - let params: { threshold?: number }; - - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number }; - } else { - params = { - threshold: paramsOrFirst as number - }; - } - - const threshold = params.threshold; - - - const apiPath = '/health/queue/messaging'; - const payload: Payload = {}; - if (typeof threshold !== 'undefined') { - payload['threshold'] = threshold; - } - 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 the number of migrations that are waiting to be processed in the Appwrite internal queue server. - * - * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. - * @throws {AppwriteException} - * @returns {Promise} - */ - getQueueMigrations(params?: { threshold?: number }): Promise; - /** - * Get the number of migrations that are waiting to be processed in the Appwrite internal queue server. - * - * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getQueueMigrations(threshold?: number): Promise; - getQueueMigrations( - paramsOrFirst?: { threshold?: number } | number - ): Promise { - let params: { threshold?: number }; - - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number }; - } else { - params = { - threshold: paramsOrFirst as number - }; - } - - const threshold = params.threshold; - - - const apiPath = '/health/queue/migrations'; - const payload: Payload = {}; - if (typeof threshold !== 'undefined') { - payload['threshold'] = threshold; - } - 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 the number of metrics that are waiting to be processed in the Appwrite stats resources queue. - * - * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. - * @throws {AppwriteException} - * @returns {Promise} - */ - getQueueStatsResources(params?: { threshold?: number }): Promise; - /** - * Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue. - * - * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getQueueStatsResources(threshold?: number): Promise; - getQueueStatsResources( - paramsOrFirst?: { threshold?: number } | number - ): Promise { - let params: { threshold?: number }; - - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number }; - } else { - params = { - threshold: paramsOrFirst as number - }; - } - - const threshold = params.threshold; - - - const apiPath = '/health/queue/stats-resources'; - const payload: Payload = {}; - if (typeof threshold !== 'undefined') { - payload['threshold'] = threshold; - } - 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 the number of metrics that are waiting to be processed in the Appwrite internal queue server. - * - * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. - * @throws {AppwriteException} - * @returns {Promise} - */ - getQueueUsage(params?: { threshold?: number }): Promise; - /** - * Get the number of metrics that are waiting to be processed in the Appwrite internal queue server. - * - * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getQueueUsage(threshold?: number): Promise; - getQueueUsage( - paramsOrFirst?: { threshold?: number } | number - ): Promise { - let params: { threshold?: number }; - - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number }; - } else { - params = { - threshold: paramsOrFirst as number - }; - } - - const threshold = params.threshold; - - - const apiPath = '/health/queue/stats-usage'; - const payload: Payload = {}; - if (typeof threshold !== 'undefined') { - payload['threshold'] = threshold; - } - 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 the number of webhooks that are waiting to be processed in the Appwrite internal queue server. - * - * @param {number} params.threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. - * @throws {AppwriteException} - * @returns {Promise} - */ - getQueueWebhooks(params?: { threshold?: number }): Promise; - /** - * Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server. - * - * @param {number} threshold - Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getQueueWebhooks(threshold?: number): Promise; - getQueueWebhooks( - paramsOrFirst?: { threshold?: number } | number - ): Promise { - let params: { threshold?: number }; - - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { threshold?: number }; - } else { - params = { - threshold: paramsOrFirst as number - }; - } - - const threshold = params.threshold; - - - const apiPath = '/health/queue/webhooks'; - const payload: Payload = {}; - if (typeof threshold !== 'undefined') { - payload['threshold'] = threshold; - } - 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, - ); - } - - /** - * Check the Appwrite storage device is up and connection is successful. - * - * @throws {AppwriteException} - * @returns {Promise} - */ - getStorage(): Promise { - - const apiPath = '/health/storage'; - 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, - ); - } - - /** - * Check the Appwrite local storage device is up and connection is successful. - * - * @throws {AppwriteException} - * @returns {Promise} - */ - getStorageLocal(): Promise { - - const apiPath = '/health/storage/local'; - 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, - ); - } - - /** - * Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https://en.wikipedia.org/wiki/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP. - * - * @throws {AppwriteException} - * @returns {Promise} - */ - getTime(): Promise { - - const apiPath = '/health/time'; - 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, - ); - } -} diff --git a/src/services/messaging.ts b/src/services/messaging.ts index a1c719a..95646cc 100644 --- a/src/services/messaging.ts +++ b/src/services/messaging.ts @@ -304,7 +304,7 @@ export class Messaging { throw new AppwriteException('Missing required parameter: "messageId"'); } - const apiPath = '/messaging/messages/email/{messageId}'.replace('{messageId}', messageId); + const apiPath = '/messaging/messages/email/{messageId}'.replace('{messageId}', encodeURIComponent(String(messageId))); const payload: Payload = {}; if (typeof topics !== 'undefined') { payload['topics'] = topics; @@ -650,7 +650,7 @@ export class Messaging { throw new AppwriteException('Missing required parameter: "messageId"'); } - const apiPath = '/messaging/messages/push/{messageId}'.replace('{messageId}', messageId); + const apiPath = '/messaging/messages/push/{messageId}'.replace('{messageId}', encodeURIComponent(String(messageId))); const payload: Payload = {}; if (typeof topics !== 'undefined') { payload['topics'] = topics; @@ -993,7 +993,7 @@ export class Messaging { throw new AppwriteException('Missing required parameter: "messageId"'); } - const apiPath = '/messaging/messages/sms/{messageId}'.replace('{messageId}', messageId); + const apiPath = '/messaging/messages/sms/{messageId}'.replace('{messageId}', encodeURIComponent(String(messageId))); const payload: Payload = {}; if (typeof topics !== 'undefined') { payload['topics'] = topics; @@ -1092,7 +1092,7 @@ export class Messaging { throw new AppwriteException('Missing required parameter: "messageId"'); } - const apiPath = '/messaging/messages/sms/{messageId}'.replace('{messageId}', messageId); + const apiPath = '/messaging/messages/sms/{messageId}'.replace('{messageId}', encodeURIComponent(String(messageId))); const payload: Payload = {}; if (typeof topics !== 'undefined') { payload['topics'] = topics; @@ -1166,7 +1166,7 @@ export class Messaging { throw new AppwriteException('Missing required parameter: "messageId"'); } - const apiPath = '/messaging/messages/{messageId}'.replace('{messageId}', messageId); + const apiPath = '/messaging/messages/{messageId}'.replace('{messageId}', encodeURIComponent(String(messageId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -1219,7 +1219,7 @@ export class Messaging { throw new AppwriteException('Missing required parameter: "messageId"'); } - const apiPath = '/messaging/messages/{messageId}'.replace('{messageId}', messageId); + const apiPath = '/messaging/messages/{messageId}'.replace('{messageId}', encodeURIComponent(String(messageId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -1236,74 +1236,6 @@ export class Messaging { ); } - /** - * Get the message activity logs listed by its unique ID. - * - * @param {string} params.messageId - Message 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). Only supported methods are limit and offset - * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. - * @throws {AppwriteException} - * @returns {Promise} - */ - listMessageLogs(params: { messageId: string, queries?: string[], total?: boolean }): Promise; - /** - * Get the message activity logs listed by its unique ID. - * - * @param {string} messageId - Message 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). Only supported methods are limit and offset - * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - listMessageLogs(messageId: string, queries?: string[], total?: boolean): Promise; - listMessageLogs( - paramsOrFirst: { messageId: string, queries?: string[], total?: boolean } | string, - ...rest: [(string[])?, (boolean)?] - ): Promise { - let params: { messageId: string, queries?: string[], total?: boolean }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { messageId: string, queries?: string[], total?: boolean }; - } else { - params = { - messageId: paramsOrFirst as string, - queries: rest[0] as string[], - total: rest[1] as boolean - }; - } - - const messageId = params.messageId; - const queries = params.queries; - const total = params.total; - - if (typeof messageId === 'undefined') { - throw new AppwriteException('Missing required parameter: "messageId"'); - } - - const apiPath = '/messaging/messages/{messageId}/logs'.replace('{messageId}', messageId); - const payload: Payload = {}; - if (typeof queries !== 'undefined') { - payload['queries'] = queries; - } - if (typeof total !== 'undefined') { - payload['total'] = total; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload, - ); - } - /** * Get a list of the targets associated with a message. * @@ -1349,7 +1281,7 @@ export class Messaging { throw new AppwriteException('Missing required parameter: "messageId"'); } - const apiPath = '/messaging/messages/{messageId}/targets'.replace('{messageId}', messageId); + const apiPath = '/messaging/messages/{messageId}/targets'.replace('{messageId}', encodeURIComponent(String(messageId))); const payload: Payload = {}; if (typeof queries !== 'undefined') { payload['queries'] = queries; @@ -1727,7 +1659,7 @@ export class Messaging { throw new AppwriteException('Missing required parameter: "providerId"'); } - const apiPath = '/messaging/providers/apns/{providerId}'.replace('{providerId}', providerId); + const apiPath = '/messaging/providers/apns/{providerId}'.replace('{providerId}', encodeURIComponent(String(providerId))); const payload: Payload = {}; if (typeof name !== 'undefined') { payload['name'] = name; @@ -1831,7 +1763,7 @@ export class Messaging { throw new AppwriteException('Missing required parameter: "providerId"'); } - const apiPath = '/messaging/providers/apns/{providerId}'.replace('{providerId}', providerId); + const apiPath = '/messaging/providers/apns/{providerId}'.replace('{providerId}', encodeURIComponent(String(providerId))); const payload: Payload = {}; if (typeof name !== 'undefined') { payload['name'] = name; @@ -2085,7 +2017,7 @@ export class Messaging { throw new AppwriteException('Missing required parameter: "providerId"'); } - const apiPath = '/messaging/providers/fcm/{providerId}'.replace('{providerId}', providerId); + const apiPath = '/messaging/providers/fcm/{providerId}'.replace('{providerId}', encodeURIComponent(String(providerId))); const payload: Payload = {}; if (typeof name !== 'undefined') { payload['name'] = name; @@ -2161,7 +2093,7 @@ export class Messaging { throw new AppwriteException('Missing required parameter: "providerId"'); } - const apiPath = '/messaging/providers/fcm/{providerId}'.replace('{providerId}', providerId); + const apiPath = '/messaging/providers/fcm/{providerId}'.replace('{providerId}', encodeURIComponent(String(providerId))); const payload: Payload = {}; if (typeof name !== 'undefined') { payload['name'] = name; @@ -2385,7 +2317,7 @@ export class Messaging { throw new AppwriteException('Missing required parameter: "providerId"'); } - const apiPath = '/messaging/providers/mailgun/{providerId}'.replace('{providerId}', providerId); + const apiPath = '/messaging/providers/mailgun/{providerId}'.replace('{providerId}', encodeURIComponent(String(providerId))); const payload: Payload = {}; if (typeof name !== 'undefined') { payload['name'] = name; @@ -2583,7 +2515,7 @@ export class Messaging { throw new AppwriteException('Missing required parameter: "providerId"'); } - const apiPath = '/messaging/providers/msg91/{providerId}'.replace('{providerId}', providerId); + const apiPath = '/messaging/providers/msg91/{providerId}'.replace('{providerId}', encodeURIComponent(String(providerId))); const payload: Payload = {}; if (typeof name !== 'undefined') { payload['name'] = name; @@ -2791,7 +2723,7 @@ export class Messaging { throw new AppwriteException('Missing required parameter: "providerId"'); } - const apiPath = '/messaging/providers/resend/{providerId}'.replace('{providerId}', providerId); + const apiPath = '/messaging/providers/resend/{providerId}'.replace('{providerId}', encodeURIComponent(String(providerId))); const payload: Payload = {}; if (typeof name !== 'undefined') { payload['name'] = name; @@ -3005,7 +2937,7 @@ export class Messaging { throw new AppwriteException('Missing required parameter: "providerId"'); } - const apiPath = '/messaging/providers/sendgrid/{providerId}'.replace('{providerId}', providerId); + const apiPath = '/messaging/providers/sendgrid/{providerId}'.replace('{providerId}', encodeURIComponent(String(providerId))); const payload: Payload = {}; if (typeof name !== 'undefined') { payload['name'] = name; @@ -3241,7 +3173,7 @@ export class Messaging { throw new AppwriteException('Missing required parameter: "providerId"'); } - const apiPath = '/messaging/providers/ses/{providerId}'.replace('{providerId}', providerId); + const apiPath = '/messaging/providers/ses/{providerId}'.replace('{providerId}', encodeURIComponent(String(providerId))); const payload: Payload = {}; if (typeof name !== 'undefined') { payload['name'] = name; @@ -3687,7 +3619,7 @@ export class Messaging { throw new AppwriteException('Missing required parameter: "providerId"'); } - const apiPath = '/messaging/providers/smtp/{providerId}'.replace('{providerId}', providerId); + const apiPath = '/messaging/providers/smtp/{providerId}'.replace('{providerId}', encodeURIComponent(String(providerId))); const payload: Payload = {}; if (typeof name !== 'undefined') { payload['name'] = name; @@ -3833,7 +3765,7 @@ export class Messaging { throw new AppwriteException('Missing required parameter: "providerId"'); } - const apiPath = '/messaging/providers/smtp/{providerId}'.replace('{providerId}', providerId); + const apiPath = '/messaging/providers/smtp/{providerId}'.replace('{providerId}', encodeURIComponent(String(providerId))); const payload: Payload = {}; if (typeof name !== 'undefined') { payload['name'] = name; @@ -4043,7 +3975,7 @@ export class Messaging { throw new AppwriteException('Missing required parameter: "providerId"'); } - const apiPath = '/messaging/providers/telesign/{providerId}'.replace('{providerId}', providerId); + const apiPath = '/messaging/providers/telesign/{providerId}'.replace('{providerId}', encodeURIComponent(String(providerId))); const payload: Payload = {}; if (typeof name !== 'undefined') { payload['name'] = name; @@ -4229,7 +4161,7 @@ export class Messaging { throw new AppwriteException('Missing required parameter: "providerId"'); } - const apiPath = '/messaging/providers/textmagic/{providerId}'.replace('{providerId}', providerId); + const apiPath = '/messaging/providers/textmagic/{providerId}'.replace('{providerId}', encodeURIComponent(String(providerId))); const payload: Payload = {}; if (typeof name !== 'undefined') { payload['name'] = name; @@ -4415,7 +4347,7 @@ export class Messaging { throw new AppwriteException('Missing required parameter: "providerId"'); } - const apiPath = '/messaging/providers/twilio/{providerId}'.replace('{providerId}', providerId); + const apiPath = '/messaging/providers/twilio/{providerId}'.replace('{providerId}', encodeURIComponent(String(providerId))); const payload: Payload = {}; if (typeof name !== 'undefined') { payload['name'] = name; @@ -4601,7 +4533,7 @@ export class Messaging { throw new AppwriteException('Missing required parameter: "providerId"'); } - const apiPath = '/messaging/providers/vonage/{providerId}'.replace('{providerId}', providerId); + const apiPath = '/messaging/providers/vonage/{providerId}'.replace('{providerId}', encodeURIComponent(String(providerId))); const payload: Payload = {}; if (typeof name !== 'undefined') { payload['name'] = name; @@ -4672,7 +4604,7 @@ export class Messaging { throw new AppwriteException('Missing required parameter: "providerId"'); } - const apiPath = '/messaging/providers/{providerId}'.replace('{providerId}', providerId); + const apiPath = '/messaging/providers/{providerId}'.replace('{providerId}', encodeURIComponent(String(providerId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -4725,7 +4657,7 @@ export class Messaging { throw new AppwriteException('Missing required parameter: "providerId"'); } - const apiPath = '/messaging/providers/{providerId}'.replace('{providerId}', providerId); + const apiPath = '/messaging/providers/{providerId}'.replace('{providerId}', encodeURIComponent(String(providerId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -4742,142 +4674,6 @@ export class Messaging { ); } - /** - * Get the provider activity logs listed by its unique ID. - * - * @param {string} params.providerId - Provider 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). Only supported methods are limit and offset - * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. - * @throws {AppwriteException} - * @returns {Promise} - */ - listProviderLogs(params: { providerId: string, queries?: string[], total?: boolean }): Promise; - /** - * Get the provider activity logs listed by its unique ID. - * - * @param {string} providerId - Provider 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). Only supported methods are limit and offset - * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - listProviderLogs(providerId: string, queries?: string[], total?: boolean): Promise; - listProviderLogs( - paramsOrFirst: { providerId: string, queries?: string[], total?: boolean } | string, - ...rest: [(string[])?, (boolean)?] - ): Promise { - let params: { providerId: string, queries?: string[], total?: boolean }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { providerId: string, queries?: string[], total?: boolean }; - } else { - params = { - providerId: paramsOrFirst as string, - queries: rest[0] as string[], - total: rest[1] as boolean - }; - } - - const providerId = params.providerId; - const queries = params.queries; - const total = params.total; - - if (typeof providerId === 'undefined') { - throw new AppwriteException('Missing required parameter: "providerId"'); - } - - const apiPath = '/messaging/providers/{providerId}/logs'.replace('{providerId}', providerId); - const payload: Payload = {}; - if (typeof queries !== 'undefined') { - payload['queries'] = queries; - } - if (typeof total !== 'undefined') { - payload['total'] = total; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload, - ); - } - - /** - * Get the subscriber activity logs listed by its unique ID. - * - * @param {string} params.subscriberId - Subscriber 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). Only supported methods are limit and offset - * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. - * @throws {AppwriteException} - * @returns {Promise} - */ - listSubscriberLogs(params: { subscriberId: string, queries?: string[], total?: boolean }): Promise; - /** - * Get the subscriber activity logs listed by its unique ID. - * - * @param {string} subscriberId - Subscriber 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). Only supported methods are limit and offset - * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - listSubscriberLogs(subscriberId: string, queries?: string[], total?: boolean): Promise; - listSubscriberLogs( - paramsOrFirst: { subscriberId: string, queries?: string[], total?: boolean } | string, - ...rest: [(string[])?, (boolean)?] - ): Promise { - let params: { subscriberId: string, queries?: string[], total?: boolean }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { subscriberId: string, queries?: string[], total?: boolean }; - } else { - params = { - subscriberId: paramsOrFirst as string, - queries: rest[0] as string[], - total: rest[1] as boolean - }; - } - - const subscriberId = params.subscriberId; - const queries = params.queries; - const total = params.total; - - if (typeof subscriberId === 'undefined') { - throw new AppwriteException('Missing required parameter: "subscriberId"'); - } - - const apiPath = '/messaging/subscribers/{subscriberId}/logs'.replace('{subscriberId}', subscriberId); - const payload: Payload = {}; - if (typeof queries !== 'undefined') { - payload['queries'] = queries; - } - if (typeof total !== 'undefined') { - payload['total'] = total; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload, - ); - } - /** * Get a list of all topics from the current Appwrite project. * @@ -5059,7 +4855,7 @@ export class Messaging { throw new AppwriteException('Missing required parameter: "topicId"'); } - const apiPath = '/messaging/topics/{topicId}'.replace('{topicId}', topicId); + const apiPath = '/messaging/topics/{topicId}'.replace('{topicId}', encodeURIComponent(String(topicId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -5123,7 +4919,7 @@ export class Messaging { throw new AppwriteException('Missing required parameter: "topicId"'); } - const apiPath = '/messaging/topics/{topicId}'.replace('{topicId}', topicId); + const apiPath = '/messaging/topics/{topicId}'.replace('{topicId}', encodeURIComponent(String(topicId))); const payload: Payload = {}; if (typeof name !== 'undefined') { payload['name'] = name; @@ -5183,7 +4979,7 @@ export class Messaging { throw new AppwriteException('Missing required parameter: "topicId"'); } - const apiPath = '/messaging/topics/{topicId}'.replace('{topicId}', topicId); + const apiPath = '/messaging/topics/{topicId}'.replace('{topicId}', encodeURIComponent(String(topicId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -5200,74 +4996,6 @@ export class Messaging { ); } - /** - * Get the topic activity logs listed by its unique ID. - * - * @param {string} params.topicId - Topic 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). Only supported methods are limit and offset - * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. - * @throws {AppwriteException} - * @returns {Promise} - */ - listTopicLogs(params: { topicId: string, queries?: string[], total?: boolean }): Promise; - /** - * Get the topic activity logs listed by its unique ID. - * - * @param {string} topicId - Topic 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). Only supported methods are limit and offset - * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - listTopicLogs(topicId: string, queries?: string[], total?: boolean): Promise; - listTopicLogs( - paramsOrFirst: { topicId: string, queries?: string[], total?: boolean } | string, - ...rest: [(string[])?, (boolean)?] - ): Promise { - let params: { topicId: string, queries?: string[], total?: boolean }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { topicId: string, queries?: string[], total?: boolean }; - } else { - params = { - topicId: paramsOrFirst as string, - queries: rest[0] as string[], - total: rest[1] as boolean - }; - } - - const topicId = params.topicId; - const queries = params.queries; - const total = params.total; - - if (typeof topicId === 'undefined') { - throw new AppwriteException('Missing required parameter: "topicId"'); - } - - const apiPath = '/messaging/topics/{topicId}/logs'.replace('{topicId}', topicId); - const payload: Payload = {}; - if (typeof queries !== 'undefined') { - payload['queries'] = queries; - } - if (typeof total !== 'undefined') { - payload['total'] = total; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload, - ); - } - /** * Get a list of all subscribers from the current Appwrite project. * @@ -5317,7 +5045,7 @@ export class Messaging { throw new AppwriteException('Missing required parameter: "topicId"'); } - const apiPath = '/messaging/topics/{topicId}/subscribers'.replace('{topicId}', topicId); + const apiPath = '/messaging/topics/{topicId}/subscribers'.replace('{topicId}', encodeURIComponent(String(topicId))); const payload: Payload = {}; if (typeof queries !== 'undefined') { payload['queries'] = queries; @@ -5394,7 +5122,7 @@ export class Messaging { throw new AppwriteException('Missing required parameter: "targetId"'); } - const apiPath = '/messaging/topics/{topicId}/subscribers'.replace('{topicId}', topicId); + const apiPath = '/messaging/topics/{topicId}/subscribers'.replace('{topicId}', encodeURIComponent(String(topicId))); const payload: Payload = {}; if (typeof subscriberId !== 'undefined') { payload['subscriberId'] = subscriberId; @@ -5464,7 +5192,7 @@ export class Messaging { throw new AppwriteException('Missing required parameter: "subscriberId"'); } - const apiPath = '/messaging/topics/{topicId}/subscribers/{subscriberId}'.replace('{topicId}', topicId).replace('{subscriberId}', subscriberId); + const apiPath = '/messaging/topics/{topicId}/subscribers/{subscriberId}'.replace('{topicId}', encodeURIComponent(String(topicId))).replace('{subscriberId}', encodeURIComponent(String(subscriberId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -5525,7 +5253,7 @@ export class Messaging { throw new AppwriteException('Missing required parameter: "subscriberId"'); } - const apiPath = '/messaging/topics/{topicId}/subscribers/{subscriberId}'.replace('{topicId}', topicId).replace('{subscriberId}', subscriberId); + const apiPath = '/messaging/topics/{topicId}/subscribers/{subscriberId}'.replace('{topicId}', encodeURIComponent(String(topicId))).replace('{subscriberId}', encodeURIComponent(String(subscriberId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); diff --git a/src/services/organization.ts b/src/services/organization.ts index c28cc7b..83d4977 100644 --- a/src/services/organization.ts +++ b/src/services/organization.ts @@ -12,6 +12,113 @@ export class Organization { this.client = client; } + /** + * Get the current organization. + * + * @throws {AppwriteException} + * @returns {Promise>} + */ + get(): Promise> { + + const apiPath = '/organization'; + 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, + ); + } + + /** + * Update the current organization's name. + * + * @param {string} params.name - New organization name. Max length: 128 chars. + * @throws {AppwriteException} + * @returns {Promise>} + */ + update(params: { name: string }): Promise>; + /** + * Update the current organization's name. + * + * @param {string} name - New organization name. Max length: 128 chars. + * @throws {AppwriteException} + * @returns {Promise>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + update(name: string): Promise>; + update( + paramsOrFirst: { name: string } | string + ): Promise> { + let params: { name: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { name: string }; + } else { + params = { + name: paramsOrFirst as string + }; + } + + const name = params.name; + + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + + const apiPath = '/organization'; + const payload: Payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + const 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( + 'put', + uri, + apiHeaders, + payload, + ); + } + + /** + * Delete the current organization. All projects that belong to the organization are deleted as well. + * + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + delete(): Promise<{}> { + + const apiPath = '/organization'; + 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', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload, + ); + } + /** * Get a list of all API keys from the current organization. * @@ -78,7 +185,7 @@ export class Organization { * * @param {string} params.keyId - Key ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {string} params.name - Key name. Max length: 128 chars. - * @param {OrganizationKeyScopes[]} params.scopes - Key scopes list. Maximum of 100 scopes are allowed. + * @param {OrganizationKeyScopes[]} 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} @@ -89,7 +196,7 @@ export class Organization { * * @param {string} keyId - Key ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {string} name - Key name. Max length: 128 chars. - * @param {OrganizationKeyScopes[]} scopes - Key scopes list. Maximum of 100 scopes are allowed. + * @param {OrganizationKeyScopes[]} 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} @@ -194,7 +301,7 @@ export class Organization { throw new AppwriteException('Missing required parameter: "keyId"'); } - const apiPath = '/organization/keys/{keyId}'.replace('{keyId}', keyId); + const apiPath = '/organization/keys/{keyId}'.replace('{keyId}', encodeURIComponent(String(keyId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -216,7 +323,7 @@ export class Organization { * * @param {string} params.keyId - Key unique ID. * @param {string} params.name - Key name. Max length: 128 chars. - * @param {OrganizationKeyScopes[]} params.scopes - Key scopes list. Maximum of 100 scopes are allowed. + * @param {OrganizationKeyScopes[]} 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} @@ -227,7 +334,7 @@ export class Organization { * * @param {string} keyId - Key unique ID. * @param {string} name - Key name. Max length: 128 chars. - * @param {OrganizationKeyScopes[]} scopes - Key scopes list. Maximum of 100 scopes are allowed. + * @param {OrganizationKeyScopes[]} 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} @@ -266,7 +373,7 @@ export class Organization { throw new AppwriteException('Missing required parameter: "scopes"'); } - const apiPath = '/organization/keys/{keyId}'.replace('{keyId}', keyId); + const apiPath = '/organization/keys/{keyId}'.replace('{keyId}', encodeURIComponent(String(keyId))); const payload: Payload = {}; if (typeof name !== 'undefined') { payload['name'] = name; @@ -329,7 +436,339 @@ export class Organization { throw new AppwriteException('Missing required parameter: "keyId"'); } - const apiPath = '/organization/keys/{keyId}'.replace('{keyId}', keyId); + const apiPath = '/organization/keys/{keyId}'.replace('{keyId}', encodeURIComponent(String(keyId))); + 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', + } + + return this.client.call( + 'delete', + uri, + apiHeaders, + payload, + ); + } + + /** + * Get a list of all memberships from the current organization. + * + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles + * @param {string} params.search - Search term to filter your list results. Max length: 256 chars. + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + */ + listMemberships(params?: { queries?: string[], search?: string, total?: boolean }): Promise; + /** + * Get a list of all memberships from the current organization. + * + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles + * @param {string} search - Search term to filter your list results. Max length: 256 chars. + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listMemberships(queries?: string[], search?: string, total?: boolean): Promise; + listMemberships( + paramsOrFirst?: { queries?: string[], search?: string, total?: boolean } | string[], + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { queries?: string[], search?: string, total?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { queries?: string[], search?: string, total?: boolean }; + } else { + params = { + queries: paramsOrFirst as string[], + search: rest[0] as string, + total: rest[1] as boolean + }; + } + + const queries = params.queries; + const search = params.search; + const total = params.total; + + + const apiPath = '/organization/memberships'; + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof search !== 'undefined') { + payload['search'] = search; + } + if (typeof total !== 'undefined') { + payload['total'] = total; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Invite a new member to join the current organization. An email with a link to join the organization will be sent to the new member's email address. If member doesn't exist in the project it will be automatically created. + * + * @param {string[]} params.roles - Array of strings. Use this param to set the user roles in the organization. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 81 characters long. + * @param {string} params.email - Email of the new organization member. + * @param {string} params.userId - ID of the user to be added to the organization. + * @param {string} params.phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. + * @param {string} params.url - URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. + * @param {string} params.name - Name of the new organization member. Max length: 128 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + createMembership(params: { roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string }): Promise; + /** + * Invite a new member to join the current organization. An email with a link to join the organization will be sent to the new member's email address. If member doesn't exist in the project it will be automatically created. + * + * @param {string[]} roles - Array of strings. Use this param to set the user roles in the organization. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 81 characters long. + * @param {string} email - Email of the new organization member. + * @param {string} userId - ID of the user to be added to the organization. + * @param {string} phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212. + * @param {string} url - URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. + * @param {string} name - Name of the new organization member. Max length: 128 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createMembership(roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string): Promise; + createMembership( + paramsOrFirst: { roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string } | string[], + ...rest: [(string)?, (string)?, (string)?, (string)?, (string)?] + ): Promise { + let params: { roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string }; + } else { + params = { + roles: paramsOrFirst as string[], + email: rest[0] as string, + userId: rest[1] as string, + phone: rest[2] as string, + url: rest[3] as string, + name: rest[4] as string + }; + } + + const roles = params.roles; + const email = params.email; + const userId = params.userId; + const phone = params.phone; + const url = params.url; + const name = params.name; + + if (typeof roles === 'undefined') { + throw new AppwriteException('Missing required parameter: "roles"'); + } + + const apiPath = '/organization/memberships'; + const payload: Payload = {}; + if (typeof email !== 'undefined') { + payload['email'] = email; + } + if (typeof userId !== 'undefined') { + payload['userId'] = userId; + } + if (typeof phone !== 'undefined') { + payload['phone'] = phone; + } + if (typeof roles !== 'undefined') { + payload['roles'] = roles; + } + if (typeof url !== 'undefined') { + payload['url'] = url; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + const 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 membership from the current organization by its unique ID. + * + * @param {string} params.membershipId - Membership ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + getMembership(params: { membershipId: string }): Promise; + /** + * Get a membership from the current organization by its unique ID. + * + * @param {string} membershipId - Membership ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getMembership(membershipId: string): Promise; + getMembership( + paramsOrFirst: { membershipId: string } | string + ): Promise { + let params: { membershipId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { membershipId: string }; + } else { + params = { + membershipId: paramsOrFirst as string + }; + } + + const membershipId = params.membershipId; + + if (typeof membershipId === 'undefined') { + throw new AppwriteException('Missing required parameter: "membershipId"'); + } + + const apiPath = '/organization/memberships/{membershipId}'.replace('{membershipId}', encodeURIComponent(String(membershipId))); + 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, + ); + } + + /** + * Modify the roles of a member in the current organization. + * + * @param {string} params.membershipId - Membership ID. + * @param {string[]} params.roles - An array of strings. Use this param to set the user's roles in the organization. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 81 characters long. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateMembership(params: { membershipId: string, roles: string[] }): Promise; + /** + * Modify the roles of a member in the current organization. + * + * @param {string} membershipId - Membership ID. + * @param {string[]} roles - An array of strings. Use this param to set the user's roles in the organization. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 81 characters long. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateMembership(membershipId: string, roles: string[]): Promise; + updateMembership( + paramsOrFirst: { membershipId: string, roles: string[] } | string, + ...rest: [(string[])?] + ): Promise { + let params: { membershipId: string, roles: string[] }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { membershipId: string, roles: string[] }; + } else { + params = { + membershipId: paramsOrFirst as string, + roles: rest[0] as string[] + }; + } + + const membershipId = params.membershipId; + const roles = params.roles; + + if (typeof membershipId === 'undefined') { + throw new AppwriteException('Missing required parameter: "membershipId"'); + } + if (typeof roles === 'undefined') { + throw new AppwriteException('Missing required parameter: "roles"'); + } + + const apiPath = '/organization/memberships/{membershipId}'.replace('{membershipId}', encodeURIComponent(String(membershipId))); + const payload: Payload = {}; + if (typeof roles !== 'undefined') { + payload['roles'] = roles; + } + const 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, + ); + } + + /** + * Remove a member from the current organization. The member is removed whether they accepted the invitation or not; a pending invitation is revoked. + * + * @param {string} params.membershipId - Membership ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deleteMembership(params: { membershipId: string }): Promise<{}>; + /** + * Remove a member from the current organization. The member is removed whether they accepted the invitation or not; a pending invitation is revoked. + * + * @param {string} membershipId - Membership ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deleteMembership(membershipId: string): Promise<{}>; + deleteMembership( + paramsOrFirst: { membershipId: string } | string + ): Promise<{}> { + let params: { membershipId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { membershipId: string }; + } else { + params = { + membershipId: paramsOrFirst as string + }; + } + + const membershipId = params.membershipId; + + if (typeof membershipId === 'undefined') { + throw new AppwriteException('Missing required parameter: "membershipId"'); + } + + const apiPath = '/organization/memberships/{membershipId}'.replace('{membershipId}', encodeURIComponent(String(membershipId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -349,7 +788,7 @@ export class Organization { /** * Get a list of all projects. You can use the query params to filter your results. * - * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, teamId, labels, search + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, teamId, labels, search, accessedAt * @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} @@ -359,7 +798,7 @@ export class Organization { /** * Get a list of all projects. You can use the query params to filter your results. * - * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, teamId, labels, search + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, teamId, labels, search, accessedAt * @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} @@ -525,7 +964,7 @@ export class Organization { throw new AppwriteException('Missing required parameter: "projectId"'); } - const apiPath = '/organization/projects/{projectId}'.replace('{projectId}', projectId); + const apiPath = '/organization/projects/{projectId}'.replace('{projectId}', encodeURIComponent(String(projectId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -585,7 +1024,7 @@ export class Organization { throw new AppwriteException('Missing required parameter: "name"'); } - const apiPath = '/organization/projects/{projectId}'.replace('{projectId}', projectId); + const apiPath = '/organization/projects/{projectId}'.replace('{projectId}', encodeURIComponent(String(projectId))); const payload: Payload = {}; if (typeof name !== 'undefined') { payload['name'] = name; @@ -642,7 +1081,7 @@ export class Organization { throw new AppwriteException('Missing required parameter: "projectId"'); } - const apiPath = '/organization/projects/{projectId}'.replace('{projectId}', projectId); + const apiPath = '/organization/projects/{projectId}'.replace('{projectId}', encodeURIComponent(String(projectId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); diff --git a/src/services/presences.ts b/src/services/presences.ts index 51fb984..d7e8af9 100644 --- a/src/services/presences.ts +++ b/src/services/presences.ts @@ -118,7 +118,7 @@ export class Presences { throw new AppwriteException('Missing required parameter: "presenceId"'); } - const apiPath = '/presences/{presenceId}'.replace('{presenceId}', presenceId); + const apiPath = '/presences/{presenceId}'.replace('{presenceId}', encodeURIComponent(String(presenceId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -200,7 +200,7 @@ export class Presences { throw new AppwriteException('Missing required parameter: "status"'); } - const apiPath = '/presences/{presenceId}'.replace('{presenceId}', presenceId); + const apiPath = '/presences/{presenceId}'.replace('{presenceId}', encodeURIComponent(String(presenceId))); const payload: Payload = {}; if (typeof userId !== 'undefined') { payload['userId'] = userId; @@ -299,7 +299,7 @@ export class Presences { throw new AppwriteException('Missing required parameter: "userId"'); } - const apiPath = '/presences/{presenceId}'.replace('{presenceId}', presenceId); + const apiPath = '/presences/{presenceId}'.replace('{presenceId}', encodeURIComponent(String(presenceId))); const payload: Payload = {}; if (typeof userId !== 'undefined') { payload['userId'] = userId; @@ -373,7 +373,7 @@ export class Presences { throw new AppwriteException('Missing required parameter: "presenceId"'); } - const apiPath = '/presences/{presenceId}'.replace('{presenceId}', presenceId); + const apiPath = '/presences/{presenceId}'.replace('{presenceId}', encodeURIComponent(String(presenceId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); diff --git a/src/services/project.ts b/src/services/project.ts index 45207af..1d79f2f 100644 --- a/src/services/project.ts +++ b/src/services/project.ts @@ -5,6 +5,7 @@ import type { Models } from '../models'; import { ProjectAuthMethodId } from '../enums/project-auth-method-id'; import { ProjectKeyScopes } from '../enums/project-key-scopes'; import { ProjectOAuth2GooglePrompt } from '../enums/project-o-auth-2-google-prompt'; +import { ProjectOAuth2OidcPrompt } from '../enums/project-o-auth-2-oidc-prompt'; import { ProjectOAuthProviderId } from '../enums/project-o-auth-provider-id'; import { ProjectPolicyId } from '../enums/project-policy-id'; import { ProjectProtocolId } from '../enums/project-protocol-id'; @@ -113,7 +114,7 @@ export class Project { throw new AppwriteException('Missing required parameter: "enabled"'); } - const apiPath = '/project/auth-methods/{methodId}'.replace('{methodId}', methodId); + const apiPath = '/project/auth-methods/{methodId}'.replace('{methodId}', encodeURIComponent(String(methodId))); const payload: Payload = {}; if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; @@ -202,7 +203,7 @@ export class Project { * * @param {string} params.keyId - Key ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {string} params.name - Key name. Max length: 128 chars. - * @param {ProjectKeyScopes[]} params.scopes - Key scopes list. Maximum of 100 scopes are allowed. + * @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} @@ -215,7 +216,7 @@ export class Project { * * @param {string} keyId - Key ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {string} name - Key name. Max length: 128 chars. - * @param {ProjectKeyScopes[]} scopes - Key scopes list. Maximum of 100 scopes are allowed. + * @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} @@ -289,7 +290,7 @@ export class Project { * * You can also create a standard API key if you need a longer-lived key instead. * - * @param {ProjectKeyScopes[]} params.scopes - Key scopes list. Maximum of 100 scopes are allowed. + * @param {ProjectKeyScopes[]} params.scopes - Key scopes list. Maximum of 200 scopes are allowed. * @param {number} params.duration - Time in seconds before ephemeral key expires. Maximum duration is 3600 seconds. * @throws {AppwriteException} * @returns {Promise} @@ -300,7 +301,7 @@ export class Project { * * You can also create a standard API key if you need a longer-lived key instead. * - * @param {ProjectKeyScopes[]} scopes - Key scopes list. Maximum of 100 scopes are allowed. + * @param {ProjectKeyScopes[]} scopes - Key scopes list. Maximum of 200 scopes are allowed. * @param {number} duration - Time in seconds before ephemeral key expires. Maximum duration is 3600 seconds. * @throws {AppwriteException} * @returns {Promise} @@ -392,7 +393,7 @@ export class Project { throw new AppwriteException('Missing required parameter: "keyId"'); } - const apiPath = '/project/keys/{keyId}'.replace('{keyId}', keyId); + const apiPath = '/project/keys/{keyId}'.replace('{keyId}', encodeURIComponent(String(keyId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -414,7 +415,7 @@ export class Project { * * @param {string} params.keyId - Key ID. * @param {string} params.name - Key name. Max length: 128 chars. - * @param {ProjectKeyScopes[]} params.scopes - Key scopes list. Maximum of 100 scopes are allowed. + * @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} @@ -425,7 +426,7 @@ export class Project { * * @param {string} keyId - Key ID. * @param {string} name - Key name. Max length: 128 chars. - * @param {ProjectKeyScopes[]} scopes - Key scopes list. Maximum of 100 scopes are allowed. + * @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} @@ -464,7 +465,7 @@ export class Project { throw new AppwriteException('Missing required parameter: "scopes"'); } - const apiPath = '/project/keys/{keyId}'.replace('{keyId}', keyId); + const apiPath = '/project/keys/{keyId}'.replace('{keyId}', encodeURIComponent(String(keyId))); const payload: Payload = {}; if (typeof name !== 'undefined') { payload['name'] = name; @@ -527,7 +528,7 @@ export class Project { throw new AppwriteException('Missing required parameter: "keyId"'); } - const apiPath = '/project/keys/{keyId}'.replace('{keyId}', keyId); + const apiPath = '/project/keys/{keyId}'.replace('{keyId}', encodeURIComponent(String(keyId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -766,7 +767,7 @@ export class Project { throw new AppwriteException('Missing required parameter: "number"'); } - const apiPath = '/project/mock-phones/{number}'.replace('{number}', number); + const apiPath = '/project/mock-phones/{number}'.replace('{number}', encodeURIComponent(String(number))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -827,7 +828,7 @@ export class Project { throw new AppwriteException('Missing required parameter: "otp"'); } - const apiPath = '/project/mock-phones/{number}'.replace('{number}', number); + const apiPath = '/project/mock-phones/{number}'.replace('{number}', encodeURIComponent(String(number))); const payload: Payload = {}; if (typeof otp !== 'undefined') { payload['otp'] = otp; @@ -884,7 +885,7 @@ export class Project { throw new AppwriteException('Missing required parameter: "number"'); } - const apiPath = '/project/mock-phones/{number}'.replace('{number}', number); + const apiPath = '/project/mock-phones/{number}'.replace('{number}', encodeURIComponent(String(number))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -978,10 +979,11 @@ export class Project { * @param {number} params.userCodeLength - Number of characters in the device flow user code, excluding the formatting separator. Shorter codes are easier to type but weaker; pair short codes with short expiry. Leave empty to use default 8. * @param {string} params.userCodeFormat - Character set for device flow user codes: `numeric` (digits only — best for numeric keypads and TV remotes), `alphabetic` (letters only), or `alphanumeric` (letters and digits — highest entropy per character). Defaults to `alphanumeric`. * @param {number} params.deviceCodeDuration - Lifetime in seconds of device flow device codes and user codes. Device codes are intentionally short-lived. Leave empty to use default 600. + * @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. * @throws {AppwriteException} * @returns {Promise} */ - updateOAuth2Server(params: { enabled: boolean, authorizationUrl: string, scopes?: string[], authorizationDetailsTypes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, confidentialPkce?: boolean, verificationUrl?: string, userCodeLength?: number, userCodeFormat?: string, deviceCodeDuration?: number }): Promise; + updateOAuth2Server(params: { enabled: boolean, authorizationUrl: string, scopes?: string[], authorizationDetailsTypes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, confidentialPkce?: boolean, verificationUrl?: string, userCodeLength?: number, userCodeFormat?: string, deviceCodeDuration?: number, defaultScopes?: string[] }): Promise; /** * Update the OAuth2 server (OIDC provider) configuration. * @@ -998,19 +1000,20 @@ export class Project { * @param {number} userCodeLength - Number of characters in the device flow user code, excluding the formatting separator. Shorter codes are easier to type but weaker; pair short codes with short expiry. Leave empty to use default 8. * @param {string} userCodeFormat - Character set for device flow user codes: `numeric` (digits only — best for numeric keypads and TV remotes), `alphabetic` (letters only), or `alphanumeric` (letters and digits — highest entropy per character). Defaults to `alphanumeric`. * @param {number} deviceCodeDuration - Lifetime in seconds of device flow device codes and user codes. Device codes are intentionally short-lived. Leave empty to use default 600. + * @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. * @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, confidentialPkce?: boolean, verificationUrl?: string, userCodeLength?: number, userCodeFormat?: string, deviceCodeDuration?: number): Promise; + updateOAuth2Server(enabled: boolean, authorizationUrl: string, scopes?: string[], authorizationDetailsTypes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, confidentialPkce?: boolean, verificationUrl?: string, userCodeLength?: number, userCodeFormat?: string, deviceCodeDuration?: number, defaultScopes?: string[]): Promise; updateOAuth2Server( - paramsOrFirst: { enabled: boolean, authorizationUrl: string, scopes?: string[], authorizationDetailsTypes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, confidentialPkce?: boolean, verificationUrl?: string, userCodeLength?: number, userCodeFormat?: string, deviceCodeDuration?: number } | boolean, - ...rest: [(string)?, (string[])?, (string[])?, (number)?, (number)?, (number)?, (number)?, (boolean)?, (string)?, (number)?, (string)?, (number)?] + paramsOrFirst: { enabled: boolean, authorizationUrl: string, scopes?: string[], authorizationDetailsTypes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, confidentialPkce?: boolean, verificationUrl?: string, userCodeLength?: number, userCodeFormat?: string, deviceCodeDuration?: number, defaultScopes?: string[] } | boolean, + ...rest: [(string)?, (string[])?, (string[])?, (number)?, (number)?, (number)?, (number)?, (boolean)?, (string)?, (number)?, (string)?, (number)?, (string[])?] ): Promise { - let params: { enabled: boolean, authorizationUrl: string, scopes?: string[], authorizationDetailsTypes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, confidentialPkce?: boolean, verificationUrl?: string, userCodeLength?: number, userCodeFormat?: string, deviceCodeDuration?: number }; + let params: { enabled: boolean, authorizationUrl: string, scopes?: string[], authorizationDetailsTypes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, confidentialPkce?: boolean, verificationUrl?: string, userCodeLength?: number, userCodeFormat?: string, deviceCodeDuration?: number, defaultScopes?: 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, confidentialPkce?: boolean, verificationUrl?: string, userCodeLength?: number, userCodeFormat?: string, deviceCodeDuration?: number }; + params = (paramsOrFirst || {}) as { enabled: boolean, authorizationUrl: string, scopes?: string[], authorizationDetailsTypes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, confidentialPkce?: boolean, verificationUrl?: string, userCodeLength?: number, userCodeFormat?: string, deviceCodeDuration?: number, defaultScopes?: string[] }; } else { params = { enabled: paramsOrFirst as boolean, @@ -1025,7 +1028,8 @@ export class Project { verificationUrl: rest[8] as string, userCodeLength: rest[9] as number, userCodeFormat: rest[10] as string, - deviceCodeDuration: rest[11] as number + deviceCodeDuration: rest[11] as number, + defaultScopes: rest[12] as string[] }; } @@ -1042,6 +1046,7 @@ export class Project { const userCodeLength = params.userCodeLength; const userCodeFormat = params.userCodeFormat; const deviceCodeDuration = params.deviceCodeDuration; + const defaultScopes = params.defaultScopes; if (typeof enabled === 'undefined') { throw new AppwriteException('Missing required parameter: "enabled"'); @@ -1091,6 +1096,9 @@ export class Project { if (typeof deviceCodeDuration !== 'undefined') { payload['deviceCodeDuration'] = deviceCodeDuration; } + if (typeof defaultScopes !== 'undefined') { + payload['defaultScopes'] = defaultScopes; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -1259,6 +1267,75 @@ export class Project { ); } + /** + * Update the project OAuth2 Appwrite configuration. + * + * @param {string} params.clientId - 'Client ID' of Appwrite OAuth2 app. For example: 6a42000000000000b5a0 + * @param {string} params.clientSecret - 'Client Secret' of Appwrite OAuth2 app. For example: b86afd000000000000000000000000000000000000000000000000000ced5f93 + * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2Appwrite(params?: { clientId?: string, clientSecret?: string, enabled?: boolean }): Promise; + /** + * Update the project OAuth2 Appwrite configuration. + * + * @param {string} clientId - 'Client ID' of Appwrite OAuth2 app. For example: 6a42000000000000b5a0 + * @param {string} clientSecret - 'Client Secret' of Appwrite OAuth2 app. For example: b86afd000000000000000000000000000000000000000000000000000ced5f93 + * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateOAuth2Appwrite(clientId?: string, clientSecret?: string, enabled?: boolean): Promise; + updateOAuth2Appwrite( + paramsOrFirst?: { clientId?: string, clientSecret?: string, enabled?: boolean } | string, + ...rest: [(string)?, (boolean)?] + ): Promise { + let params: { clientId?: string, clientSecret?: string, enabled?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { clientId?: string, clientSecret?: string, enabled?: boolean }; + } else { + params = { + clientId: paramsOrFirst as string, + clientSecret: rest[0] as string, + enabled: rest[1] as boolean + }; + } + + const clientId = params.clientId; + const clientSecret = params.clientSecret; + const enabled = params.enabled; + + + const apiPath = '/project/oauth2/appwrite'; + const payload: Payload = {}; + if (typeof clientId !== 'undefined') { + payload['clientId'] = clientId; + } + if (typeof clientSecret !== 'undefined') { + payload['clientSecret'] = clientSecret; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + 'accept': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + /** * Update the project OAuth2 Auth0 configuration. * @@ -2842,11 +2919,13 @@ export class Project { * @param {string} params.authorizationURL - OpenID Connect authorization endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/authorize * @param {string} params.tokenURL - OpenID Connect token endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/token * @param {string} params.userInfoURL - OpenID Connect user info endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/userinfo + * @param {ProjectOAuth2OidcPrompt[]} params.prompt - Array of OpenID Connect prompt values controlling the authentication and consent screens. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. "login" means: prompt the user to re-authenticate. "consent" means: prompt the user for consent. "select_account" means: prompt the user to select an account. + * @param {number} params.maxAge - Maximum authentication age in seconds. When set, the user must have authenticated within this many seconds, otherwise they are prompted to re-authenticate. * @param {boolean} params.enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} */ - updateOAuth2Oidc(params?: { clientId?: string, clientSecret?: string, wellKnownURL?: string, authorizationURL?: string, tokenURL?: string, userInfoURL?: string, enabled?: boolean }): Promise; + updateOAuth2Oidc(params?: { clientId?: string, clientSecret?: string, wellKnownURL?: string, authorizationURL?: string, tokenURL?: string, userInfoURL?: string, prompt?: ProjectOAuth2OidcPrompt[], maxAge?: number, enabled?: boolean }): Promise; /** * Update the project OAuth2 Oidc configuration. * @@ -2856,20 +2935,22 @@ export class Project { * @param {string} authorizationURL - OpenID Connect authorization endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/authorize * @param {string} tokenURL - OpenID Connect token endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/token * @param {string} userInfoURL - OpenID Connect user info endpoint URL. Required when wellKnownURL is not provided. For example: https://myoauth.com/oauth2/userinfo + * @param {ProjectOAuth2OidcPrompt[]} prompt - Array of OpenID Connect prompt values controlling the authentication and consent screens. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. "login" means: prompt the user to re-authenticate. "consent" means: prompt the user for consent. "select_account" means: prompt the user to select an account. + * @param {number} maxAge - Maximum authentication age in seconds. When set, the user must have authenticated within this many seconds, otherwise they are prompted to re-authenticate. * @param {boolean} enabled - OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateOAuth2Oidc(clientId?: string, clientSecret?: string, wellKnownURL?: string, authorizationURL?: string, tokenURL?: string, userInfoURL?: string, enabled?: boolean): Promise; + updateOAuth2Oidc(clientId?: string, clientSecret?: string, wellKnownURL?: string, authorizationURL?: string, tokenURL?: string, userInfoURL?: string, prompt?: ProjectOAuth2OidcPrompt[], maxAge?: number, enabled?: boolean): Promise; updateOAuth2Oidc( - paramsOrFirst?: { clientId?: string, clientSecret?: string, wellKnownURL?: string, authorizationURL?: string, tokenURL?: string, userInfoURL?: string, enabled?: boolean } | string, - ...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (boolean)?] + paramsOrFirst?: { clientId?: string, clientSecret?: string, wellKnownURL?: string, authorizationURL?: string, tokenURL?: string, userInfoURL?: string, prompt?: ProjectOAuth2OidcPrompt[], maxAge?: number, enabled?: boolean } | string, + ...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (ProjectOAuth2OidcPrompt[])?, (number)?, (boolean)?] ): Promise { - let params: { clientId?: string, clientSecret?: string, wellKnownURL?: string, authorizationURL?: string, tokenURL?: string, userInfoURL?: string, enabled?: boolean }; + let params: { clientId?: string, clientSecret?: string, wellKnownURL?: string, authorizationURL?: string, tokenURL?: string, userInfoURL?: string, prompt?: ProjectOAuth2OidcPrompt[], maxAge?: number, enabled?: boolean }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { clientId?: string, clientSecret?: string, wellKnownURL?: string, authorizationURL?: string, tokenURL?: string, userInfoURL?: string, enabled?: boolean }; + params = (paramsOrFirst || {}) as { clientId?: string, clientSecret?: string, wellKnownURL?: string, authorizationURL?: string, tokenURL?: string, userInfoURL?: string, prompt?: ProjectOAuth2OidcPrompt[], maxAge?: number, enabled?: boolean }; } else { params = { clientId: paramsOrFirst as string, @@ -2878,7 +2959,9 @@ export class Project { authorizationURL: rest[2] as string, tokenURL: rest[3] as string, userInfoURL: rest[4] as string, - enabled: rest[5] as boolean + prompt: rest[5] as ProjectOAuth2OidcPrompt[], + maxAge: rest[6] as number, + enabled: rest[7] as boolean }; } @@ -2888,6 +2971,8 @@ export class Project { const authorizationURL = params.authorizationURL; const tokenURL = params.tokenURL; const userInfoURL = params.userInfoURL; + const prompt = params.prompt; + const maxAge = params.maxAge; const enabled = params.enabled; @@ -2911,6 +2996,12 @@ export class Project { if (typeof userInfoURL !== 'undefined') { payload['userInfoURL'] = userInfoURL; } + if (typeof prompt !== 'undefined') { + payload['prompt'] = prompt; + } + if (typeof maxAge !== 'undefined') { + payload['maxAge'] = maxAge; + } if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } @@ -4153,7 +4244,7 @@ export class Project { throw new AppwriteException('Missing required parameter: "providerId"'); } - const apiPath = '/project/oauth2/{providerId}'.replace('{providerId}', providerId); + const apiPath = '/project/oauth2/{providerId}'.replace('{providerId}', encodeURIComponent(String(providerId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -4360,7 +4451,7 @@ export class Project { throw new AppwriteException('Missing required parameter: "applicationId"'); } - const apiPath = '/project/platforms/android/{platformId}'.replace('{platformId}', platformId); + const apiPath = '/project/platforms/android/{platformId}'.replace('{platformId}', encodeURIComponent(String(platformId))); const payload: Payload = {}; if (typeof name !== 'undefined') { payload['name'] = name; @@ -4513,7 +4604,7 @@ export class Project { throw new AppwriteException('Missing required parameter: "bundleIdentifier"'); } - const apiPath = '/project/platforms/apple/{platformId}'.replace('{platformId}', platformId); + const apiPath = '/project/platforms/apple/{platformId}'.replace('{platformId}', encodeURIComponent(String(platformId))); const payload: Payload = {}; if (typeof name !== 'undefined') { payload['name'] = name; @@ -4666,7 +4757,7 @@ export class Project { throw new AppwriteException('Missing required parameter: "packageName"'); } - const apiPath = '/project/platforms/linux/{platformId}'.replace('{platformId}', platformId); + const apiPath = '/project/platforms/linux/{platformId}'.replace('{platformId}', encodeURIComponent(String(platformId))); const payload: Payload = {}; if (typeof name !== 'undefined') { payload['name'] = name; @@ -4819,7 +4910,7 @@ export class Project { throw new AppwriteException('Missing required parameter: "hostname"'); } - const apiPath = '/project/platforms/web/{platformId}'.replace('{platformId}', platformId); + const apiPath = '/project/platforms/web/{platformId}'.replace('{platformId}', encodeURIComponent(String(platformId))); const payload: Payload = {}; if (typeof name !== 'undefined') { payload['name'] = name; @@ -4972,7 +5063,7 @@ export class Project { throw new AppwriteException('Missing required parameter: "packageIdentifierName"'); } - const apiPath = '/project/platforms/windows/{platformId}'.replace('{platformId}', platformId); + const apiPath = '/project/platforms/windows/{platformId}'.replace('{platformId}', encodeURIComponent(String(platformId))); const payload: Payload = {}; if (typeof name !== 'undefined') { payload['name'] = name; @@ -5032,7 +5123,7 @@ export class Project { throw new AppwriteException('Missing required parameter: "platformId"'); } - const apiPath = '/project/platforms/{platformId}'.replace('{platformId}', platformId); + const apiPath = '/project/platforms/{platformId}'.replace('{platformId}', encodeURIComponent(String(platformId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -5085,7 +5176,7 @@ export class Project { throw new AppwriteException('Missing required parameter: "platformId"'); } - const apiPath = '/project/platforms/{platformId}'.replace('{platformId}', platformId); + const apiPath = '/project/platforms/{platformId}'.replace('{platformId}', encodeURIComponent(String(platformId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -5220,6 +5311,63 @@ export class Project { ); } + /** + * Configures if only corporate email addresses (non-free and non-disposable domains) are allowed during new user sign-ups and email updates. + * + * @param {boolean} params.enabled - Set whether or not to restrict sign-ups and email updates to corporate email addresses only. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateDenyCorporateEmailPolicy(params: { enabled: boolean }): Promise; + /** + * Configures if only corporate email addresses (non-free and non-disposable domains) are allowed during new user sign-ups and email updates. + * + * @param {boolean} enabled - Set whether or not to restrict sign-ups and email updates to corporate email addresses only. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateDenyCorporateEmailPolicy(enabled: boolean): Promise; + updateDenyCorporateEmailPolicy( + paramsOrFirst: { enabled: boolean } | boolean + ): Promise { + let params: { enabled: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { enabled: boolean }; + } else { + params = { + enabled: paramsOrFirst as boolean + }; + } + + const enabled = params.enabled; + + if (typeof enabled === 'undefined') { + throw new AppwriteException('Missing required parameter: "enabled"'); + } + + const apiPath = '/project/policies/deny-corporate-email'; + const payload: Payload = {}; + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + 'accept': 'application/json', + } + + return this.client.call( + 'patch', + uri, + apiHeaders, + payload, + ); + } + /** * Configures if disposable emails from known temporary domains are denied during new users sign-ups and email updates. * @@ -5970,23 +6118,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. + * @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. * @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. + * @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. * @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))) { @@ -6003,7 +6151,7 @@ export class Project { throw new AppwriteException('Missing required parameter: "policyId"'); } - const apiPath = '/project/policies/{policyId}'.replace('{policyId}', policyId); + const apiPath = '/project/policies/{policyId}'.replace('{policyId}', encodeURIComponent(String(policyId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -6064,7 +6212,7 @@ export class Project { throw new AppwriteException('Missing required parameter: "enabled"'); } - const apiPath = '/project/protocols/{protocolId}'.replace('{protocolId}', protocolId); + const apiPath = '/project/protocols/{protocolId}'.replace('{protocolId}', encodeURIComponent(String(protocolId))); const payload: Payload = {}; if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; @@ -6088,7 +6236,7 @@ export class Project { /** * Update properties of a specific service. Use this endpoint to enable or disable a service in your project. * - * @param {ProjectServiceId} params.serviceId - Service name. Can be one of: account, avatars, databases, tablesdb, locale, health, project, storage, teams, users, vcs, sites, functions, proxy, graphql, migrations, messaging, advisor + * @param {ProjectServiceId} params.serviceId - Service name. Can be one of: account, avatars, databases, tablesdb, locale, health, project, storage, teams, users, vcs, sites, functions, proxy, graphql, migrations, messaging, advisor, oauth2 * @param {boolean} params.enabled - Service status. * @throws {AppwriteException} * @returns {Promise} @@ -6097,7 +6245,7 @@ export class Project { /** * Update properties of a specific service. Use this endpoint to enable or disable a service in your project. * - * @param {ProjectServiceId} serviceId - Service name. Can be one of: account, avatars, databases, tablesdb, locale, health, project, storage, teams, users, vcs, sites, functions, proxy, graphql, migrations, messaging, advisor + * @param {ProjectServiceId} serviceId - Service name. Can be one of: account, avatars, databases, tablesdb, locale, health, project, storage, teams, users, vcs, sites, functions, proxy, graphql, migrations, messaging, advisor, oauth2 * @param {boolean} enabled - Service status. * @throws {AppwriteException} * @returns {Promise} @@ -6129,7 +6277,7 @@ export class Project { throw new AppwriteException('Missing required parameter: "enabled"'); } - const apiPath = '/project/services/{serviceId}'.replace('{serviceId}', serviceId); + const apiPath = '/project/services/{serviceId}'.replace('{serviceId}', encodeURIComponent(String(serviceId))); const payload: Payload = {}; if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; @@ -6533,7 +6681,7 @@ export class Project { throw new AppwriteException('Missing required parameter: "templateId"'); } - const apiPath = '/project/templates/email/{templateId}'.replace('{templateId}', templateId); + const apiPath = '/project/templates/email/{templateId}'.replace('{templateId}', encodeURIComponent(String(templateId))); const payload: Payload = {}; if (typeof locale !== 'undefined') { payload['locale'] = locale; @@ -6735,7 +6883,7 @@ export class Project { throw new AppwriteException('Missing required parameter: "variableId"'); } - const apiPath = '/project/variables/{variableId}'.replace('{variableId}', variableId); + const apiPath = '/project/variables/{variableId}'.replace('{variableId}', encodeURIComponent(String(variableId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -6801,7 +6949,7 @@ export class Project { throw new AppwriteException('Missing required parameter: "variableId"'); } - const apiPath = '/project/variables/{variableId}'.replace('{variableId}', variableId); + const apiPath = '/project/variables/{variableId}'.replace('{variableId}', encodeURIComponent(String(variableId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -6864,7 +7012,7 @@ export class Project { throw new AppwriteException('Missing required parameter: "variableId"'); } - const apiPath = '/project/variables/{variableId}'.replace('{variableId}', variableId); + const apiPath = '/project/variables/{variableId}'.replace('{variableId}', encodeURIComponent(String(variableId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); diff --git a/src/services/proxy.ts b/src/services/proxy.ts index b2c53fa..04379aa 100644 --- a/src/services/proxy.ts +++ b/src/services/proxy.ts @@ -430,7 +430,7 @@ export class Proxy { throw new AppwriteException('Missing required parameter: "ruleId"'); } - const apiPath = '/proxy/rules/{ruleId}'.replace('{ruleId}', ruleId); + const apiPath = '/proxy/rules/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -483,7 +483,7 @@ export class Proxy { throw new AppwriteException('Missing required parameter: "ruleId"'); } - const apiPath = '/proxy/rules/{ruleId}'.replace('{ruleId}', ruleId); + const apiPath = '/proxy/rules/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -536,7 +536,7 @@ export class Proxy { throw new AppwriteException('Missing required parameter: "ruleId"'); } - const apiPath = '/proxy/rules/{ruleId}/status'.replace('{ruleId}', ruleId); + const apiPath = '/proxy/rules/{ruleId}/status'.replace('{ruleId}', encodeURIComponent(String(ruleId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); diff --git a/src/services/sites.ts b/src/services/sites.ts index 0de414a..314650f 100644 --- a/src/services/sites.ts +++ b/src/services/sites.ts @@ -334,13 +334,41 @@ export class Sites { /** * List allowed site specifications for this instance. * + * @param {string} params.type - Specification type to list. Can be one of: runtimes, builds. * @throws {AppwriteException} * @returns {Promise} */ - listSpecifications(): Promise { + listSpecifications(params?: { type?: string }): Promise; + /** + * List allowed site specifications for this instance. + * + * @param {string} type - Specification type to list. Can be one of: runtimes, builds. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listSpecifications(type?: string): Promise; + listSpecifications( + paramsOrFirst?: { type?: string } | string + ): Promise { + let params: { type?: string }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { type?: string }; + } else { + params = { + type: paramsOrFirst as string + }; + } + + const type = params.type; + const apiPath = '/sites/specifications'; const payload: Payload = {}; + if (typeof type !== 'undefined') { + payload['type'] = type; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -392,7 +420,7 @@ export class Sites { throw new AppwriteException('Missing required parameter: "siteId"'); } - const apiPath = '/sites/{siteId}'.replace('{siteId}', siteId); + const apiPath = '/sites/{siteId}'.replace('{siteId}', encodeURIComponent(String(siteId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -540,7 +568,7 @@ export class Sites { throw new AppwriteException('Missing required parameter: "framework"'); } - const apiPath = '/sites/{siteId}'.replace('{siteId}', siteId); + const apiPath = '/sites/{siteId}'.replace('{siteId}', encodeURIComponent(String(siteId))); const payload: Payload = {}; if (typeof name !== 'undefined') { payload['name'] = name; @@ -660,7 +688,7 @@ export class Sites { throw new AppwriteException('Missing required parameter: "siteId"'); } - const apiPath = '/sites/{siteId}'.replace('{siteId}', siteId); + const apiPath = '/sites/{siteId}'.replace('{siteId}', encodeURIComponent(String(siteId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -721,7 +749,7 @@ export class Sites { throw new AppwriteException('Missing required parameter: "deploymentId"'); } - const apiPath = '/sites/{siteId}/deployment'.replace('{siteId}', siteId); + const apiPath = '/sites/{siteId}/deployment'.replace('{siteId}', encodeURIComponent(String(siteId))); const payload: Payload = {}; if (typeof deploymentId !== 'undefined') { payload['deploymentId'] = deploymentId; @@ -791,7 +819,7 @@ export class Sites { throw new AppwriteException('Missing required parameter: "siteId"'); } - const apiPath = '/sites/{siteId}/deployments'.replace('{siteId}', siteId); + const apiPath = '/sites/{siteId}/deployments'.replace('{siteId}', encodeURIComponent(String(siteId))); const payload: Payload = {}; if (typeof queries !== 'undefined') { payload['queries'] = queries; @@ -880,7 +908,7 @@ export class Sites { throw new AppwriteException('Missing required parameter: "code"'); } - const apiPath = '/sites/{siteId}/deployments'.replace('{siteId}', siteId); + const apiPath = '/sites/{siteId}/deployments'.replace('{siteId}', encodeURIComponent(String(siteId))); const payload: Payload = {}; if (typeof installCommand !== 'undefined') { payload['installCommand'] = installCommand; @@ -958,7 +986,7 @@ export class Sites { throw new AppwriteException('Missing required parameter: "deploymentId"'); } - const apiPath = '/sites/{siteId}/deployments/duplicate'.replace('{siteId}', siteId); + const apiPath = '/sites/{siteId}/deployments/duplicate'.replace('{siteId}', encodeURIComponent(String(siteId))); const payload: Payload = {}; if (typeof deploymentId !== 'undefined') { payload['deploymentId'] = deploymentId; @@ -1059,7 +1087,7 @@ export class Sites { throw new AppwriteException('Missing required parameter: "reference"'); } - const apiPath = '/sites/{siteId}/deployments/template'.replace('{siteId}', siteId); + const apiPath = '/sites/{siteId}/deployments/template'.replace('{siteId}', encodeURIComponent(String(siteId))); const payload: Payload = {}; if (typeof repository !== 'undefined') { payload['repository'] = repository; @@ -1154,7 +1182,7 @@ export class Sites { throw new AppwriteException('Missing required parameter: "reference"'); } - const apiPath = '/sites/{siteId}/deployments/vcs'.replace('{siteId}', siteId); + const apiPath = '/sites/{siteId}/deployments/vcs'.replace('{siteId}', encodeURIComponent(String(siteId))); const payload: Payload = {}; if (typeof type !== 'undefined') { payload['type'] = type; @@ -1225,7 +1253,7 @@ export class Sites { throw new AppwriteException('Missing required parameter: "deploymentId"'); } - const apiPath = '/sites/{siteId}/deployments/{deploymentId}'.replace('{siteId}', siteId).replace('{deploymentId}', deploymentId); + const apiPath = '/sites/{siteId}/deployments/{deploymentId}'.replace('{siteId}', encodeURIComponent(String(siteId))).replace('{deploymentId}', encodeURIComponent(String(deploymentId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -1286,7 +1314,7 @@ export class Sites { throw new AppwriteException('Missing required parameter: "deploymentId"'); } - const apiPath = '/sites/{siteId}/deployments/{deploymentId}'.replace('{siteId}', siteId).replace('{deploymentId}', deploymentId); + const apiPath = '/sites/{siteId}/deployments/{deploymentId}'.replace('{siteId}', encodeURIComponent(String(siteId))).replace('{deploymentId}', encodeURIComponent(String(deploymentId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -1351,7 +1379,7 @@ export class Sites { throw new AppwriteException('Missing required parameter: "deploymentId"'); } - const apiPath = '/sites/{siteId}/deployments/{deploymentId}/download'.replace('{siteId}', siteId).replace('{deploymentId}', deploymentId); + const apiPath = '/sites/{siteId}/deployments/{deploymentId}/download'.replace('{siteId}', encodeURIComponent(String(siteId))).replace('{deploymentId}', encodeURIComponent(String(deploymentId))); const payload: Payload = {}; if (typeof type !== 'undefined') { payload['type'] = type; @@ -1416,7 +1444,7 @@ export class Sites { throw new AppwriteException('Missing required parameter: "deploymentId"'); } - const apiPath = '/sites/{siteId}/deployments/{deploymentId}/status'.replace('{siteId}', siteId).replace('{deploymentId}', deploymentId); + const apiPath = '/sites/{siteId}/deployments/{deploymentId}/status'.replace('{siteId}', encodeURIComponent(String(siteId))).replace('{deploymentId}', encodeURIComponent(String(deploymentId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -1479,7 +1507,7 @@ export class Sites { throw new AppwriteException('Missing required parameter: "siteId"'); } - const apiPath = '/sites/{siteId}/logs'.replace('{siteId}', siteId); + const apiPath = '/sites/{siteId}/logs'.replace('{siteId}', encodeURIComponent(String(siteId))); const payload: Payload = {}; if (typeof queries !== 'undefined') { payload['queries'] = queries; @@ -1546,7 +1574,7 @@ export class Sites { throw new AppwriteException('Missing required parameter: "logId"'); } - const apiPath = '/sites/{siteId}/logs/{logId}'.replace('{siteId}', siteId).replace('{logId}', logId); + const apiPath = '/sites/{siteId}/logs/{logId}'.replace('{siteId}', encodeURIComponent(String(siteId))).replace('{logId}', encodeURIComponent(String(logId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -1607,7 +1635,7 @@ export class Sites { throw new AppwriteException('Missing required parameter: "logId"'); } - const apiPath = '/sites/{siteId}/logs/{logId}'.replace('{siteId}', siteId).replace('{logId}', logId); + const apiPath = '/sites/{siteId}/logs/{logId}'.replace('{siteId}', encodeURIComponent(String(siteId))).replace('{logId}', encodeURIComponent(String(logId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -1670,7 +1698,7 @@ export class Sites { throw new AppwriteException('Missing required parameter: "siteId"'); } - const apiPath = '/sites/{siteId}/variables'.replace('{siteId}', siteId); + const apiPath = '/sites/{siteId}/variables'.replace('{siteId}', encodeURIComponent(String(siteId))); const payload: Payload = {}; if (typeof queries !== 'undefined') { payload['queries'] = queries; @@ -1755,7 +1783,7 @@ export class Sites { throw new AppwriteException('Missing required parameter: "value"'); } - const apiPath = '/sites/{siteId}/variables'.replace('{siteId}', siteId); + const apiPath = '/sites/{siteId}/variables'.replace('{siteId}', encodeURIComponent(String(siteId))); const payload: Payload = {}; if (typeof variableId !== 'undefined') { payload['variableId'] = variableId; @@ -1829,7 +1857,7 @@ export class Sites { throw new AppwriteException('Missing required parameter: "variableId"'); } - const apiPath = '/sites/{siteId}/variables/{variableId}'.replace('{siteId}', siteId).replace('{variableId}', variableId); + const apiPath = '/sites/{siteId}/variables/{variableId}'.replace('{siteId}', encodeURIComponent(String(siteId))).replace('{variableId}', encodeURIComponent(String(variableId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -1902,7 +1930,7 @@ export class Sites { throw new AppwriteException('Missing required parameter: "variableId"'); } - const apiPath = '/sites/{siteId}/variables/{variableId}'.replace('{siteId}', siteId).replace('{variableId}', variableId); + const apiPath = '/sites/{siteId}/variables/{variableId}'.replace('{siteId}', encodeURIComponent(String(siteId))).replace('{variableId}', encodeURIComponent(String(variableId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -1973,7 +2001,7 @@ export class Sites { throw new AppwriteException('Missing required parameter: "variableId"'); } - const apiPath = '/sites/{siteId}/variables/{variableId}'.replace('{siteId}', siteId).replace('{variableId}', variableId); + const apiPath = '/sites/{siteId}/variables/{variableId}'.replace('{siteId}', encodeURIComponent(String(siteId))).replace('{variableId}', encodeURIComponent(String(variableId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); diff --git a/src/services/storage.ts b/src/services/storage.ts index f4ae7a0..7ff1932 100644 --- a/src/services/storage.ts +++ b/src/services/storage.ts @@ -249,7 +249,7 @@ export class Storage { throw new AppwriteException('Missing required parameter: "bucketId"'); } - const apiPath = '/storage/buckets/{bucketId}'.replace('{bucketId}', bucketId); + const apiPath = '/storage/buckets/{bucketId}'.replace('{bucketId}', encodeURIComponent(String(bucketId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -346,7 +346,7 @@ export class Storage { throw new AppwriteException('Missing required parameter: "name"'); } - const apiPath = '/storage/buckets/{bucketId}'.replace('{bucketId}', bucketId); + const apiPath = '/storage/buckets/{bucketId}'.replace('{bucketId}', encodeURIComponent(String(bucketId))); const payload: Payload = {}; if (typeof name !== 'undefined') { payload['name'] = name; @@ -430,7 +430,7 @@ export class Storage { throw new AppwriteException('Missing required parameter: "bucketId"'); } - const apiPath = '/storage/buckets/{bucketId}'.replace('{bucketId}', bucketId); + const apiPath = '/storage/buckets/{bucketId}'.replace('{bucketId}', encodeURIComponent(String(bucketId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -496,7 +496,7 @@ export class Storage { throw new AppwriteException('Missing required parameter: "bucketId"'); } - const apiPath = '/storage/buckets/{bucketId}/files'.replace('{bucketId}', bucketId); + const apiPath = '/storage/buckets/{bucketId}/files'.replace('{bucketId}', encodeURIComponent(String(bucketId))); const payload: Payload = {}; if (typeof queries !== 'undefined') { payload['queries'] = queries; @@ -594,7 +594,7 @@ export class Storage { throw new AppwriteException('Missing required parameter: "file"'); } - const apiPath = '/storage/buckets/{bucketId}/files'.replace('{bucketId}', bucketId); + const apiPath = '/storage/buckets/{bucketId}/files'.replace('{bucketId}', encodeURIComponent(String(bucketId))); const payload: Payload = {}; if (typeof fileId !== 'undefined') { payload['fileId'] = fileId; @@ -666,7 +666,7 @@ export class Storage { throw new AppwriteException('Missing required parameter: "fileId"'); } - const apiPath = '/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', bucketId).replace('{fileId}', fileId); + const apiPath = '/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', encodeURIComponent(String(bucketId))).replace('{fileId}', encodeURIComponent(String(fileId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -735,7 +735,7 @@ export class Storage { throw new AppwriteException('Missing required parameter: "fileId"'); } - const apiPath = '/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', bucketId).replace('{fileId}', fileId); + const apiPath = '/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', encodeURIComponent(String(bucketId))).replace('{fileId}', encodeURIComponent(String(fileId))); const payload: Payload = {}; if (typeof name !== 'undefined') { payload['name'] = name; @@ -803,7 +803,7 @@ export class Storage { throw new AppwriteException('Missing required parameter: "fileId"'); } - const apiPath = '/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', bucketId).replace('{fileId}', fileId); + const apiPath = '/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', encodeURIComponent(String(bucketId))).replace('{fileId}', encodeURIComponent(String(fileId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -868,7 +868,7 @@ export class Storage { throw new AppwriteException('Missing required parameter: "fileId"'); } - const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/download'.replace('{bucketId}', bucketId).replace('{fileId}', fileId); + const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/download'.replace('{bucketId}', encodeURIComponent(String(bucketId))).replace('{fileId}', encodeURIComponent(String(fileId))); const payload: Payload = {}; if (typeof token !== 'undefined') { payload['token'] = token; @@ -981,7 +981,7 @@ export class Storage { throw new AppwriteException('Missing required parameter: "fileId"'); } - const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/preview'.replace('{bucketId}', bucketId).replace('{fileId}', fileId); + const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/preview'.replace('{bucketId}', encodeURIComponent(String(bucketId))).replace('{fileId}', encodeURIComponent(String(fileId))); const payload: Payload = {}; if (typeof width !== 'undefined') { payload['width'] = width; @@ -1083,7 +1083,7 @@ export class Storage { throw new AppwriteException('Missing required parameter: "fileId"'); } - const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/view'.replace('{bucketId}', bucketId).replace('{fileId}', fileId); + const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/view'.replace('{bucketId}', encodeURIComponent(String(bucketId))).replace('{fileId}', encodeURIComponent(String(fileId))); const payload: Payload = {}; if (typeof token !== 'undefined') { payload['token'] = token; diff --git a/src/services/tables-db.ts b/src/services/tables-db.ts index aa4248f..57baaf2 100644 --- a/src/services/tables-db.ts +++ b/src/services/tables-db.ts @@ -89,10 +89,11 @@ export class TablesDB { * @param {string} params.databaseId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {string} params.name - Database name. Max length: 128 chars. * @param {boolean} params.enabled - Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + * @param {string} params.specification - Database specification. Defaults to `serverless`, which creates the database on the shared pool. Any other value provisions a dedicated database on that specification. * @throws {AppwriteException} * @returns {Promise} */ - create(params: { databaseId: string, name: string, enabled?: boolean }): Promise; + create(params: { databaseId: string, name: string, enabled?: boolean, specification?: string }): Promise; /** * Create a new Database. * @@ -100,30 +101,33 @@ export class TablesDB { * @param {string} databaseId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {string} name - Database name. Max length: 128 chars. * @param {boolean} enabled - Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. + * @param {string} specification - Database specification. Defaults to `serverless`, which creates the database on the shared pool. Any other value provisions a dedicated database on that specification. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - create(databaseId: string, name: string, enabled?: boolean): Promise; + create(databaseId: string, name: string, enabled?: boolean, specification?: string): Promise; create( - paramsOrFirst: { databaseId: string, name: string, enabled?: boolean } | string, - ...rest: [(string)?, (boolean)?] + paramsOrFirst: { databaseId: string, name: string, enabled?: boolean, specification?: string } | string, + ...rest: [(string)?, (boolean)?, (string)?] ): Promise { - let params: { databaseId: string, name: string, enabled?: boolean }; + let params: { databaseId: string, name: string, enabled?: boolean, specification?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, name: string, enabled?: boolean }; + params = (paramsOrFirst || {}) as { databaseId: string, name: string, enabled?: boolean, specification?: string }; } else { params = { databaseId: paramsOrFirst as string, name: rest[0] as string, - enabled: rest[1] as boolean + enabled: rest[1] as boolean, + specification: rest[2] as string }; } const databaseId = params.databaseId; const name = params.name; const enabled = params.enabled; + const specification = params.specification; if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); @@ -143,6 +147,9 @@ export class TablesDB { if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } + if (typeof specification !== 'undefined') { + payload['specification'] = specification; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -302,7 +309,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "transactionId"'); } - const apiPath = '/tablesdb/transactions/{transactionId}'.replace('{transactionId}', transactionId); + const apiPath = '/tablesdb/transactions/{transactionId}'.replace('{transactionId}', encodeURIComponent(String(transactionId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -364,7 +371,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "transactionId"'); } - const apiPath = '/tablesdb/transactions/{transactionId}'.replace('{transactionId}', transactionId); + const apiPath = '/tablesdb/transactions/{transactionId}'.replace('{transactionId}', encodeURIComponent(String(transactionId))); const payload: Payload = {}; if (typeof commit !== 'undefined') { payload['commit'] = commit; @@ -424,7 +431,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "transactionId"'); } - const apiPath = '/tablesdb/transactions/{transactionId}'.replace('{transactionId}', transactionId); + const apiPath = '/tablesdb/transactions/{transactionId}'.replace('{transactionId}', encodeURIComponent(String(transactionId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -482,7 +489,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "transactionId"'); } - const apiPath = '/tablesdb/transactions/{transactionId}/operations'.replace('{transactionId}', transactionId); + const apiPath = '/tablesdb/transactions/{transactionId}/operations'.replace('{transactionId}', encodeURIComponent(String(transactionId))); const payload: Payload = {}; if (typeof operations !== 'undefined') { payload['operations'] = operations; @@ -539,7 +546,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "databaseId"'); } - const apiPath = '/tablesdb/{databaseId}'.replace('{databaseId}', databaseId); + const apiPath = '/tablesdb/{databaseId}'.replace('{databaseId}', encodeURIComponent(String(databaseId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -601,7 +608,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "databaseId"'); } - const apiPath = '/tablesdb/{databaseId}'.replace('{databaseId}', databaseId); + const apiPath = '/tablesdb/{databaseId}'.replace('{databaseId}', encodeURIComponent(String(databaseId))); const payload: Payload = {}; if (typeof name !== 'undefined') { payload['name'] = name; @@ -661,7 +668,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "databaseId"'); } - const apiPath = '/tablesdb/{databaseId}'.replace('{databaseId}', databaseId); + const apiPath = '/tablesdb/{databaseId}'.replace('{databaseId}', encodeURIComponent(String(databaseId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -727,7 +734,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "databaseId"'); } - const apiPath = '/tablesdb/{databaseId}/tables'.replace('{databaseId}', databaseId); + const apiPath = '/tablesdb/{databaseId}/tables'.replace('{databaseId}', encodeURIComponent(String(databaseId))); const payload: Payload = {}; if (typeof queries !== 'undefined') { payload['queries'] = queries; @@ -824,7 +831,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "name"'); } - const apiPath = '/tablesdb/{databaseId}/tables'.replace('{databaseId}', databaseId); + const apiPath = '/tablesdb/{databaseId}/tables'.replace('{databaseId}', encodeURIComponent(String(databaseId))); const payload: Payload = {}; if (typeof tableId !== 'undefined') { payload['tableId'] = tableId; @@ -907,7 +914,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "tableId"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -988,7 +995,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "tableId"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))); const payload: Payload = {}; if (typeof name !== 'undefined') { payload['name'] = name; @@ -1065,7 +1072,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "tableId"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -1134,7 +1141,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "tableId"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))); const payload: Payload = {}; if (typeof queries !== 'undefined') { payload['queries'] = queries; @@ -1233,7 +1240,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/bigint'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/bigint'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -1348,7 +1355,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/bigint/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/bigint/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; if (typeof required !== 'undefined') { payload['required'] = required; @@ -1449,7 +1456,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/boolean'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/boolean'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -1548,7 +1555,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/boolean/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/boolean/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; if (typeof required !== 'undefined') { payload['required'] = required; @@ -1641,7 +1648,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/datetime'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/datetime'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -1740,7 +1747,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/datetime/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/datetime/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; if (typeof required !== 'undefined') { payload['required'] = required; @@ -1835,7 +1842,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/email'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/email'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -1936,7 +1943,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/email/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/email/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; if (typeof required !== 'undefined') { payload['required'] = required; @@ -2036,7 +2043,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/enum'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/enum'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -2147,7 +2154,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/enum/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/enum/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; if (typeof elements !== 'undefined') { payload['elements'] = elements; @@ -2253,7 +2260,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/float'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/float'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -2368,7 +2375,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/float/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/float/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; if (typeof required !== 'undefined') { payload['required'] = required; @@ -2477,7 +2484,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/integer'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/integer'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -2592,7 +2599,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/integer/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/integer/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; if (typeof required !== 'undefined') { payload['required'] = required; @@ -2693,7 +2700,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/ip'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/ip'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -2794,7 +2801,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/ip/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/ip/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; if (typeof required !== 'undefined') { payload['required'] = required; @@ -2828,11 +2835,11 @@ export class TablesDB { * @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? - * @param {any[]} params.xdefault - Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required. + * @param {any[][]} params.xdefault - Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required. * @throws {AppwriteException} * @returns {Promise} */ - createLineColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[] }): Promise; + createLineColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][] }): Promise; /** * Create a geometric line column. * @@ -2840,27 +2847,27 @@ export class TablesDB { * @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} key - Column Key. * @param {boolean} required - Is column required? - * @param {any[]} xdefault - Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required. + * @param {any[][]} xdefault - Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createLineColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[]): Promise; + createLineColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][]): Promise; createLineColumn( - paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[] } | string, - ...rest: [(string)?, (string)?, (boolean)?, (any[])?] + paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][] } | string, + ...rest: [(string)?, (string)?, (boolean)?, (any[][])?] ): Promise { - let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[] }; + let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][] }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[] }; + params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][] }; } else { params = { databaseId: paramsOrFirst as string, tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as any[] + xdefault: rest[3] as any[][] }; } @@ -2883,7 +2890,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/line'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/line'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -2917,12 +2924,12 @@ export class TablesDB { * @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? - * @param {any[]} params.xdefault - Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required. + * @param {any[][]} params.xdefault - Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required. * @param {string} params.newKey - New Column Key. * @throws {AppwriteException} * @returns {Promise} */ - updateLineColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }): Promise; + updateLineColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string }): Promise; /** * Update a line column. Changing the `default` value will not update already existing rows. * @@ -2930,28 +2937,28 @@ export class TablesDB { * @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} key - Column Key. * @param {boolean} required - Is column required? - * @param {any[]} xdefault - Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required. + * @param {any[][]} xdefault - Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required. * @param {string} newKey - New Column Key. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateLineColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[], newKey?: string): Promise; + updateLineColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string): Promise; updateLineColumn( - paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[], newKey?: string } | string, - ...rest: [(string)?, (string)?, (boolean)?, (any[])?, (string)?] + paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string } | string, + ...rest: [(string)?, (string)?, (boolean)?, (any[][])?, (string)?] ): Promise { - let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }; + let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }; + params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string }; } else { params = { databaseId: paramsOrFirst as string, tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as any[], + xdefault: rest[3] as any[][], newKey: rest[4] as string }; } @@ -2976,7 +2983,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/line/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/line/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; if (typeof required !== 'undefined') { payload['required'] = required; @@ -3075,7 +3082,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/longtext'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/longtext'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -3179,7 +3186,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/longtext/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/longtext/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; if (typeof required !== 'undefined') { payload['required'] = required; @@ -3278,7 +3285,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/mediumtext'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/mediumtext'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -3382,7 +3389,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/mediumtext/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/mediumtext/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; if (typeof required !== 'undefined') { payload['required'] = required; @@ -3416,11 +3423,11 @@ export class TablesDB { * @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? - * @param {any[]} params.xdefault - Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required. + * @param {number[]} params.xdefault - Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required. * @throws {AppwriteException} * @returns {Promise} */ - createPointColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[] }): Promise; + createPointColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number[] }): Promise; /** * Create a geometric point column. * @@ -3428,27 +3435,27 @@ export class TablesDB { * @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} key - Column Key. * @param {boolean} required - Is column required? - * @param {any[]} xdefault - Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required. + * @param {number[]} xdefault - Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createPointColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[]): Promise; + createPointColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number[]): Promise; createPointColumn( - paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[] } | string, - ...rest: [(string)?, (string)?, (boolean)?, (any[])?] + paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number[] } | string, + ...rest: [(string)?, (string)?, (boolean)?, (number[])?] ): Promise { - let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[] }; + let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number[] }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[] }; + params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number[] }; } else { params = { databaseId: paramsOrFirst as string, tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as any[] + xdefault: rest[3] as number[] }; } @@ -3471,7 +3478,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/point'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/point'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -3505,12 +3512,12 @@ export class TablesDB { * @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? - * @param {any[]} params.xdefault - Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required. + * @param {number[]} params.xdefault - Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required. * @param {string} params.newKey - New Column Key. * @throws {AppwriteException} * @returns {Promise} */ - updatePointColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }): Promise; + updatePointColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number[], newKey?: string }): Promise; /** * Update a point column. Changing the `default` value will not update already existing rows. * @@ -3518,28 +3525,28 @@ export class TablesDB { * @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} key - Column Key. * @param {boolean} required - Is column required? - * @param {any[]} xdefault - Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required. + * @param {number[]} xdefault - Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required. * @param {string} newKey - New Column Key. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updatePointColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[], newKey?: string): Promise; + updatePointColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number[], newKey?: string): Promise; updatePointColumn( - paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[], newKey?: string } | string, - ...rest: [(string)?, (string)?, (boolean)?, (any[])?, (string)?] + paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number[], newKey?: string } | string, + ...rest: [(string)?, (string)?, (boolean)?, (number[])?, (string)?] ): Promise { - let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }; + let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number[], newKey?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }; + params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: number[], newKey?: string }; } else { params = { databaseId: paramsOrFirst as string, tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as any[], + xdefault: rest[3] as number[], newKey: rest[4] as string }; } @@ -3564,7 +3571,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/point/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/point/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; if (typeof required !== 'undefined') { payload['required'] = required; @@ -3598,11 +3605,11 @@ export class TablesDB { * @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? - * @param {any[]} params.xdefault - Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required. + * @param {any[][]} params.xdefault - Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required. * @throws {AppwriteException} * @returns {Promise} */ - createPolygonColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[] }): Promise; + createPolygonColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][] }): Promise; /** * Create a geometric polygon column. * @@ -3610,27 +3617,27 @@ export class TablesDB { * @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} key - Column Key. * @param {boolean} required - Is column required? - * @param {any[]} xdefault - Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required. + * @param {any[][]} xdefault - Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createPolygonColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[]): Promise; + createPolygonColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][]): Promise; createPolygonColumn( - paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[] } | string, - ...rest: [(string)?, (string)?, (boolean)?, (any[])?] + paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][] } | string, + ...rest: [(string)?, (string)?, (boolean)?, (any[][])?] ): Promise { - let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[] }; + let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][] }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[] }; + params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][] }; } else { params = { databaseId: paramsOrFirst as string, tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as any[] + xdefault: rest[3] as any[][] }; } @@ -3653,7 +3660,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/polygon'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/polygon'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -3687,12 +3694,12 @@ export class TablesDB { * @param {string} params.tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} params.key - Column Key. * @param {boolean} params.required - Is column required? - * @param {any[]} params.xdefault - Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required. + * @param {any[][]} params.xdefault - Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required. * @param {string} params.newKey - New Column Key. * @throws {AppwriteException} * @returns {Promise} */ - updatePolygonColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }): Promise; + updatePolygonColumn(params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string }): Promise; /** * Update a polygon column. Changing the `default` value will not update already existing rows. * @@ -3700,28 +3707,28 @@ export class TablesDB { * @param {string} tableId - Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param {string} key - Column Key. * @param {boolean} required - Is column required? - * @param {any[]} xdefault - Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required. + * @param {any[][]} xdefault - Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required. * @param {string} newKey - New Column Key. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updatePolygonColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[], newKey?: string): Promise; + updatePolygonColumn(databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string): Promise; updatePolygonColumn( - paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[], newKey?: string } | string, - ...rest: [(string)?, (string)?, (boolean)?, (any[])?, (string)?] + paramsOrFirst: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string } | string, + ...rest: [(string)?, (string)?, (boolean)?, (any[][])?, (string)?] ): Promise { - let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }; + let params: { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[], newKey?: string }; + params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, key: string, required: boolean, xdefault?: any[][], newKey?: string }; } else { params = { databaseId: paramsOrFirst as string, tableId: rest[0] as string, key: rest[1] as string, required: rest[2] as boolean, - xdefault: rest[3] as any[], + xdefault: rest[3] as any[][], newKey: rest[4] as string }; } @@ -3746,7 +3753,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/polygon/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/polygon/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; if (typeof required !== 'undefined') { payload['required'] = required; @@ -3849,7 +3856,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "type"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/relationship'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/relationship'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))); const payload: Payload = {}; if (typeof relatedTableId !== 'undefined') { payload['relatedTableId'] = relatedTableId; @@ -3965,7 +3972,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/string'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/string'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -4077,7 +4084,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/string/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/string/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; if (typeof required !== 'undefined') { payload['required'] = required; @@ -4179,7 +4186,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/text'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/text'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -4283,7 +4290,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/text/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/text/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; if (typeof required !== 'undefined') { payload['required'] = required; @@ -4378,7 +4385,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/url'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/url'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -4479,7 +4486,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/url/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/url/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; if (typeof required !== 'undefined') { payload['required'] = required; @@ -4585,7 +4592,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "required"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/varchar'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/varchar'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -4696,7 +4703,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "xdefault"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/varchar/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/varchar/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; if (typeof required !== 'undefined') { payload['required'] = required; @@ -4777,7 +4784,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "key"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -4845,7 +4852,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "key"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -4923,7 +4930,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "key"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/{key}/relationship'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/{key}/relationship'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; if (typeof onDelete !== 'undefined') { payload['onDelete'] = onDelete; @@ -4999,7 +5006,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "tableId"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/indexes'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/indexes'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))); const payload: Payload = {}; if (typeof queries !== 'undefined') { payload['queries'] = queries; @@ -5097,7 +5104,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "columns"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/indexes'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/indexes'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))); const payload: Payload = {}; if (typeof key !== 'undefined') { payload['key'] = key; @@ -5181,7 +5188,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "key"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/indexes/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -5249,7 +5256,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "key"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/indexes/{key}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))).replace('{key}', encodeURIComponent(String(key))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -5326,7 +5333,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "tableId"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))); const payload: Payload = {}; if (typeof queries !== 'undefined') { payload['queries'] = queries; @@ -5421,7 +5428,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "data"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))); const payload: Payload = {}; if (typeof rowId !== 'undefined') { payload['rowId'] = rowId; @@ -5506,7 +5513,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "rows"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))); const payload: Payload = {}; if (typeof rows !== 'undefined') { payload['rows'] = rows; @@ -5587,7 +5594,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "rows"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))); const payload: Payload = {}; if (typeof rows !== 'undefined') { payload['rows'] = rows; @@ -5667,7 +5674,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "tableId"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))); const payload: Payload = {}; if (typeof data !== 'undefined') { payload['data'] = data; @@ -5746,7 +5753,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "tableId"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))); const payload: Payload = {}; if (typeof queries !== 'undefined') { payload['queries'] = queries; @@ -5829,7 +5836,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "rowId"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))).replace('{rowId}', encodeURIComponent(String(rowId))); const payload: Payload = {}; if (typeof queries !== 'undefined') { payload['queries'] = queries; @@ -5915,7 +5922,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "rowId"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))).replace('{rowId}', encodeURIComponent(String(rowId))); const payload: Payload = {}; if (typeof data !== 'undefined') { payload['data'] = data; @@ -6005,7 +6012,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "rowId"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))).replace('{rowId}', encodeURIComponent(String(rowId))); const payload: Payload = {}; if (typeof data !== 'undefined') { payload['data'] = data; @@ -6087,7 +6094,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "rowId"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))).replace('{rowId}', encodeURIComponent(String(rowId))); const payload: Payload = {}; if (typeof transactionId !== 'undefined') { payload['transactionId'] = transactionId; @@ -6177,7 +6184,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "column"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/decrement'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId).replace('{column}', column); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/decrement'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))).replace('{rowId}', encodeURIComponent(String(rowId))).replace('{column}', encodeURIComponent(String(column))); const payload: Payload = {}; if (typeof value !== 'undefined') { payload['value'] = value; @@ -6274,7 +6281,7 @@ export class TablesDB { throw new AppwriteException('Missing required parameter: "column"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/increment'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId).replace('{column}', column); + const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/increment'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(tableId))).replace('{rowId}', encodeURIComponent(String(rowId))).replace('{column}', encodeURIComponent(String(column))); const payload: Payload = {}; if (typeof value !== 'undefined') { payload['value'] = value; diff --git a/src/services/teams.ts b/src/services/teams.ts index 3a77c58..28a9533 100644 --- a/src/services/teams.ts +++ b/src/services/teams.ts @@ -189,7 +189,7 @@ export class Teams { throw new AppwriteException('Missing required parameter: "teamId"'); } - const apiPath = '/teams/{teamId}'.replace('{teamId}', teamId); + const apiPath = '/teams/{teamId}'.replace('{teamId}', encodeURIComponent(String(teamId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -250,7 +250,7 @@ export class Teams { throw new AppwriteException('Missing required parameter: "name"'); } - const apiPath = '/teams/{teamId}'.replace('{teamId}', teamId); + const apiPath = '/teams/{teamId}'.replace('{teamId}', encodeURIComponent(String(teamId))); const payload: Payload = {}; if (typeof name !== 'undefined') { payload['name'] = name; @@ -307,7 +307,7 @@ export class Teams { throw new AppwriteException('Missing required parameter: "teamId"'); } - const apiPath = '/teams/{teamId}'.replace('{teamId}', teamId); + const apiPath = '/teams/{teamId}'.replace('{teamId}', encodeURIComponent(String(teamId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -373,7 +373,7 @@ export class Teams { throw new AppwriteException('Missing required parameter: "teamId"'); } - const apiPath = '/teams/{teamId}/memberships'.replace('{teamId}', teamId); + const apiPath = '/teams/{teamId}/memberships'.replace('{teamId}', encodeURIComponent(String(teamId))); const payload: Payload = {}; if (typeof queries !== 'undefined') { payload['queries'] = queries; @@ -477,7 +477,7 @@ export class Teams { throw new AppwriteException('Missing required parameter: "roles"'); } - const apiPath = '/teams/{teamId}/memberships'.replace('{teamId}', teamId); + const apiPath = '/teams/{teamId}/memberships'.replace('{teamId}', encodeURIComponent(String(teamId))); const payload: Payload = {}; if (typeof email !== 'undefined') { payload['email'] = email; @@ -557,7 +557,7 @@ export class Teams { throw new AppwriteException('Missing required parameter: "membershipId"'); } - const apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId); + const apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', encodeURIComponent(String(teamId))).replace('{membershipId}', encodeURIComponent(String(membershipId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -627,7 +627,7 @@ export class Teams { throw new AppwriteException('Missing required parameter: "roles"'); } - const apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId); + const apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', encodeURIComponent(String(teamId))).replace('{membershipId}', encodeURIComponent(String(membershipId))); const payload: Payload = {}; if (typeof roles !== 'undefined') { payload['roles'] = roles; @@ -692,7 +692,7 @@ export class Teams { throw new AppwriteException('Missing required parameter: "membershipId"'); } - const apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId); + const apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', encodeURIComponent(String(teamId))).replace('{membershipId}', encodeURIComponent(String(membershipId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -773,7 +773,7 @@ export class Teams { throw new AppwriteException('Missing required parameter: "secret"'); } - const apiPath = '/teams/{teamId}/memberships/{membershipId}/status'.replace('{teamId}', teamId).replace('{membershipId}', membershipId); + const apiPath = '/teams/{teamId}/memberships/{membershipId}/status'.replace('{teamId}', encodeURIComponent(String(teamId))).replace('{membershipId}', encodeURIComponent(String(membershipId))); const payload: Payload = {}; if (typeof userId !== 'undefined') { payload['userId'] = userId; @@ -833,7 +833,7 @@ export class Teams { throw new AppwriteException('Missing required parameter: "teamId"'); } - const apiPath = '/teams/{teamId}/prefs'.replace('{teamId}', teamId); + const apiPath = '/teams/{teamId}/prefs'.replace('{teamId}', encodeURIComponent(String(teamId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -894,7 +894,7 @@ export class Teams { throw new AppwriteException('Missing required parameter: "prefs"'); } - const apiPath = '/teams/{teamId}/prefs'.replace('{teamId}', teamId); + const apiPath = '/teams/{teamId}/prefs'.replace('{teamId}', encodeURIComponent(String(teamId))); const payload: Payload = {}; if (typeof prefs !== 'undefined') { payload['prefs'] = prefs; diff --git a/src/services/tokens.ts b/src/services/tokens.ts index 18b0fed..f5b9cb0 100644 --- a/src/services/tokens.ts +++ b/src/services/tokens.ts @@ -62,7 +62,7 @@ export class Tokens { throw new AppwriteException('Missing required parameter: "fileId"'); } - const apiPath = '/tokens/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', bucketId).replace('{fileId}', fileId); + const apiPath = '/tokens/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', encodeURIComponent(String(bucketId))).replace('{fileId}', encodeURIComponent(String(fileId))); const payload: Payload = {}; if (typeof queries !== 'undefined') { payload['queries'] = queries; @@ -133,7 +133,7 @@ export class Tokens { throw new AppwriteException('Missing required parameter: "fileId"'); } - const apiPath = '/tokens/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', bucketId).replace('{fileId}', fileId); + const apiPath = '/tokens/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', encodeURIComponent(String(bucketId))).replace('{fileId}', encodeURIComponent(String(fileId))); const payload: Payload = {}; if (typeof expire !== 'undefined') { payload['expire'] = expire; @@ -190,7 +190,7 @@ export class Tokens { throw new AppwriteException('Missing required parameter: "tokenId"'); } - const apiPath = '/tokens/{tokenId}'.replace('{tokenId}', tokenId); + const apiPath = '/tokens/{tokenId}'.replace('{tokenId}', encodeURIComponent(String(tokenId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -248,7 +248,7 @@ export class Tokens { throw new AppwriteException('Missing required parameter: "tokenId"'); } - const apiPath = '/tokens/{tokenId}'.replace('{tokenId}', tokenId); + const apiPath = '/tokens/{tokenId}'.replace('{tokenId}', encodeURIComponent(String(tokenId))); const payload: Payload = {}; if (typeof expire !== 'undefined') { payload['expire'] = expire; @@ -305,7 +305,7 @@ export class Tokens { throw new AppwriteException('Missing required parameter: "tokenId"'); } - const apiPath = '/tokens/{tokenId}'.replace('{tokenId}', tokenId); + const apiPath = '/tokens/{tokenId}'.replace('{tokenId}', encodeURIComponent(String(tokenId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); diff --git a/src/services/usage.ts b/src/services/usage.ts deleted file mode 100644 index f7d485e..0000000 --- a/src/services/usage.ts +++ /dev/null @@ -1,134 +0,0 @@ -import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; -import type { Models } from '../models'; - - - -export class Usage { - client: Client; - - constructor(client: Client) { - this.client = client; - } - - /** - * Query usage event metrics from the usage database. Returns individual event rows with full metadata. Pass Query objects as JSON strings to filter, paginate, and order results. Supported query methods: equal, greaterThanEqual, lessThanEqual, orderAsc, orderDesc, limit, offset. Supported filter attributes: metric, path, method, status, resource, resourceId, country, userAgent, time (these match the underlying column names — note that the response surfaces `resource` as `resourceType` and `country` as `countryCode`). When no time filter is supplied the endpoint defaults to the last 7 days. Default `limit(100)` is applied if none is given; user-supplied limits are capped at 500. The `total` field is capped at 5000 to keep counts predictable — pass `total=false` to skip the count entirely. - * - * @param {string[]} params.queries - Array of query strings as JSON. Supported: equal("metric", [...]), equal("path", [...]), equal("method", [...]), equal("status", [...]), equal("resource", [...]), equal("resourceId", [...]), equal("country", [...]), equal("userAgent", [...]), greaterThanEqual("time", "..."), lessThanEqual("time", "..."), orderAsc("time"), orderDesc("time"), limit(N), offset(N). - * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. - * @throws {AppwriteException} - * @returns {Promise} - */ - listEvents(params?: { queries?: string[], total?: boolean }): Promise; - /** - * Query usage event metrics from the usage database. Returns individual event rows with full metadata. Pass Query objects as JSON strings to filter, paginate, and order results. Supported query methods: equal, greaterThanEqual, lessThanEqual, orderAsc, orderDesc, limit, offset. Supported filter attributes: metric, path, method, status, resource, resourceId, country, userAgent, time (these match the underlying column names — note that the response surfaces `resource` as `resourceType` and `country` as `countryCode`). When no time filter is supplied the endpoint defaults to the last 7 days. Default `limit(100)` is applied if none is given; user-supplied limits are capped at 500. The `total` field is capped at 5000 to keep counts predictable — pass `total=false` to skip the count entirely. - * - * @param {string[]} queries - Array of query strings as JSON. Supported: equal("metric", [...]), equal("path", [...]), equal("method", [...]), equal("status", [...]), equal("resource", [...]), equal("resourceId", [...]), equal("country", [...]), equal("userAgent", [...]), greaterThanEqual("time", "..."), lessThanEqual("time", "..."), orderAsc("time"), orderDesc("time"), limit(N), offset(N). - * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - listEvents(queries?: string[], total?: boolean): Promise; - listEvents( - paramsOrFirst?: { queries?: string[], total?: boolean } | string[], - ...rest: [(boolean)?] - ): Promise { - let params: { queries?: string[], total?: boolean }; - - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { queries?: string[], total?: boolean }; - } else { - params = { - queries: paramsOrFirst as string[], - total: rest[0] as boolean - }; - } - - const queries = params.queries; - const total = params.total; - - - const apiPath = '/usage/events'; - const payload: Payload = {}; - if (typeof queries !== 'undefined') { - payload['queries'] = queries; - } - if (typeof total !== 'undefined') { - payload['total'] = total; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload, - ); - } - - /** - * Query usage gauge metrics (point-in-time resource snapshots) from the usage database. Returns individual gauge snapshots with metric, value, timestamp, resourceType, and resourceId. Pass Query objects as JSON strings to filter, paginate, and order results. Supported query methods: equal, greaterThanEqual, lessThanEqual, orderAsc, orderDesc, limit, offset. Supported filter attributes: metric, time. Use `orderDesc("time"), limit(1)` to fetch the most recent snapshot. When no time filter is supplied the endpoint defaults to the last 7 days. Default `limit(100)` is applied if none is given; user-supplied limits are capped at 500. The `total` field is capped at 5000 to keep counts predictable — pass `total=false` to skip the count entirely. - * - * @param {string[]} params.queries - Array of query strings as JSON. Supported: equal("metric", [...]), greaterThanEqual("time", "..."), lessThanEqual("time", "..."), orderAsc("time"), orderDesc("time"), limit(N), offset(N). - * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. - * @throws {AppwriteException} - * @returns {Promise} - */ - listGauges(params?: { queries?: string[], total?: boolean }): Promise; - /** - * Query usage gauge metrics (point-in-time resource snapshots) from the usage database. Returns individual gauge snapshots with metric, value, timestamp, resourceType, and resourceId. Pass Query objects as JSON strings to filter, paginate, and order results. Supported query methods: equal, greaterThanEqual, lessThanEqual, orderAsc, orderDesc, limit, offset. Supported filter attributes: metric, time. Use `orderDesc("time"), limit(1)` to fetch the most recent snapshot. When no time filter is supplied the endpoint defaults to the last 7 days. Default `limit(100)` is applied if none is given; user-supplied limits are capped at 500. The `total` field is capped at 5000 to keep counts predictable — pass `total=false` to skip the count entirely. - * - * @param {string[]} queries - Array of query strings as JSON. Supported: equal("metric", [...]), greaterThanEqual("time", "..."), lessThanEqual("time", "..."), orderAsc("time"), orderDesc("time"), limit(N), offset(N). - * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - listGauges(queries?: string[], total?: boolean): Promise; - listGauges( - paramsOrFirst?: { queries?: string[], total?: boolean } | string[], - ...rest: [(boolean)?] - ): Promise { - let params: { queries?: string[], total?: boolean }; - - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { queries?: string[], total?: boolean }; - } else { - params = { - queries: paramsOrFirst as string[], - total: rest[0] as boolean - }; - } - - const queries = params.queries; - const total = params.total; - - - const apiPath = '/usage/gauges'; - const payload: Payload = {}; - if (typeof queries !== 'undefined') { - payload['queries'] = queries; - } - if (typeof total !== 'undefined') { - payload['total'] = total; - } - const uri = new URL(this.client.config.endpoint + apiPath); - - const apiHeaders: { [header: string]: string } = { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - } - - return this.client.call( - 'get', - uri, - apiHeaders, - payload, - ); - } -} diff --git a/src/services/users.ts b/src/services/users.ts index 44a107a..6b9985c 100644 --- a/src/services/users.ts +++ b/src/services/users.ts @@ -16,7 +16,7 @@ export class Users { /** * Get a list of all the project's users. You can use the query params to filter your results. * - * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels, impersonator + * @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, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels, impersonator, accessedAt * @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} @@ -26,7 +26,7 @@ export class Users { /** * Get a list of all the project's users. You can use the query params to filter your results. * - * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels, impersonator + * @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, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels, impersonator, accessedAt * @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} @@ -441,7 +441,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "identityId"'); } - const apiPath = '/users/identities/{identityId}'.replace('{identityId}', identityId); + const apiPath = '/users/identities/{identityId}'.replace('{identityId}', encodeURIComponent(String(identityId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -1006,7 +1006,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "userId"'); } - const apiPath = '/users/{userId}'.replace('{userId}', userId); + const apiPath = '/users/{userId}'.replace('{userId}', encodeURIComponent(String(userId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -1059,7 +1059,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "userId"'); } - const apiPath = '/users/{userId}'.replace('{userId}', userId); + const apiPath = '/users/{userId}'.replace('{userId}', encodeURIComponent(String(userId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -1120,7 +1120,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "email"'); } - const apiPath = '/users/{userId}/email'.replace('{userId}', userId); + const apiPath = '/users/{userId}/email'.replace('{userId}', encodeURIComponent(String(userId))); const payload: Payload = {}; if (typeof email !== 'undefined') { payload['email'] = email; @@ -1187,7 +1187,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "impersonator"'); } - const apiPath = '/users/{userId}/impersonator'.replace('{userId}', userId); + const apiPath = '/users/{userId}/impersonator'.replace('{userId}', encodeURIComponent(String(userId))); const payload: Payload = {}; if (typeof impersonator !== 'undefined') { payload['impersonator'] = impersonator; @@ -1253,7 +1253,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "userId"'); } - const apiPath = '/users/{userId}/jwts'.replace('{userId}', userId); + const apiPath = '/users/{userId}/jwts'.replace('{userId}', encodeURIComponent(String(userId))); const payload: Payload = {}; if (typeof sessionId !== 'undefined') { payload['sessionId'] = sessionId; @@ -1325,7 +1325,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "labels"'); } - const apiPath = '/users/{userId}/labels'.replace('{userId}', userId); + const apiPath = '/users/{userId}/labels'.replace('{userId}', encodeURIComponent(String(userId))); const payload: Payload = {}; if (typeof labels !== 'undefined') { payload['labels'] = labels; @@ -1391,7 +1391,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "userId"'); } - const apiPath = '/users/{userId}/logs'.replace('{userId}', userId); + const apiPath = '/users/{userId}/logs'.replace('{userId}', encodeURIComponent(String(userId))); const payload: Payload = {}; if (typeof queries !== 'undefined') { payload['queries'] = queries; @@ -1463,7 +1463,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "userId"'); } - const apiPath = '/users/{userId}/memberships'.replace('{userId}', userId); + const apiPath = '/users/{userId}/memberships'.replace('{userId}', encodeURIComponent(String(userId))); const payload: Payload = {}; if (typeof queries !== 'undefined') { payload['queries'] = queries; @@ -1534,7 +1534,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "mfa"'); } - const apiPath = '/users/{userId}/mfa'.replace('{userId}', userId); + const apiPath = '/users/{userId}/mfa'.replace('{userId}', encodeURIComponent(String(userId))); const payload: Payload = {}; if (typeof mfa !== 'undefined') { payload['mfa'] = mfa; @@ -1599,7 +1599,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "mfa"'); } - const apiPath = '/users/{userId}/mfa'.replace('{userId}', userId); + const apiPath = '/users/{userId}/mfa'.replace('{userId}', encodeURIComponent(String(userId))); const payload: Payload = {}; if (typeof mfa !== 'undefined') { payload['mfa'] = mfa; @@ -1665,7 +1665,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "type"'); } - const apiPath = '/users/{userId}/mfa/authenticators/{type}'.replace('{userId}', userId).replace('{type}', type); + const apiPath = '/users/{userId}/mfa/authenticators/{type}'.replace('{userId}', encodeURIComponent(String(userId))).replace('{type}', encodeURIComponent(String(type))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -1726,7 +1726,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "type"'); } - const apiPath = '/users/{userId}/mfa/authenticators/{type}'.replace('{userId}', userId).replace('{type}', type); + const apiPath = '/users/{userId}/mfa/authenticators/{type}'.replace('{userId}', encodeURIComponent(String(userId))).replace('{type}', encodeURIComponent(String(type))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -1780,7 +1780,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "userId"'); } - const apiPath = '/users/{userId}/mfa/factors'.replace('{userId}', userId); + const apiPath = '/users/{userId}/mfa/factors'.replace('{userId}', encodeURIComponent(String(userId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -1833,7 +1833,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "userId"'); } - const apiPath = '/users/{userId}/mfa/factors'.replace('{userId}', userId); + const apiPath = '/users/{userId}/mfa/factors'.replace('{userId}', encodeURIComponent(String(userId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -1887,7 +1887,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "userId"'); } - const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId); + const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', encodeURIComponent(String(userId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -1940,7 +1940,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "userId"'); } - const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId); + const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', encodeURIComponent(String(userId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -1994,7 +1994,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "userId"'); } - const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId); + const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', encodeURIComponent(String(userId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -2048,7 +2048,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "userId"'); } - const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId); + const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', encodeURIComponent(String(userId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -2103,7 +2103,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "userId"'); } - const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId); + const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', encodeURIComponent(String(userId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -2157,7 +2157,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "userId"'); } - const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId); + const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', encodeURIComponent(String(userId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -2219,7 +2219,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "name"'); } - const apiPath = '/users/{userId}/name'.replace('{userId}', userId); + const apiPath = '/users/{userId}/name'.replace('{userId}', encodeURIComponent(String(userId))); const payload: Payload = {}; if (typeof name !== 'undefined') { payload['name'] = name; @@ -2284,7 +2284,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "password"'); } - const apiPath = '/users/{userId}/password'.replace('{userId}', userId); + const apiPath = '/users/{userId}/password'.replace('{userId}', encodeURIComponent(String(userId))); const payload: Payload = {}; if (typeof password !== 'undefined') { payload['password'] = password; @@ -2349,7 +2349,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "number"'); } - const apiPath = '/users/{userId}/phone'.replace('{userId}', userId); + const apiPath = '/users/{userId}/phone'.replace('{userId}', encodeURIComponent(String(userId))); const payload: Payload = {}; if (typeof number !== 'undefined') { payload['number'] = number; @@ -2406,7 +2406,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "userId"'); } - const apiPath = '/users/{userId}/prefs'.replace('{userId}', userId); + const apiPath = '/users/{userId}/prefs'.replace('{userId}', encodeURIComponent(String(userId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -2467,7 +2467,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "prefs"'); } - const apiPath = '/users/{userId}/prefs'.replace('{userId}', userId); + const apiPath = '/users/{userId}/prefs'.replace('{userId}', encodeURIComponent(String(userId))); const payload: Payload = {}; if (typeof prefs !== 'undefined') { payload['prefs'] = prefs; @@ -2529,7 +2529,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "userId"'); } - const apiPath = '/users/{userId}/sessions'.replace('{userId}', userId); + const apiPath = '/users/{userId}/sessions'.replace('{userId}', encodeURIComponent(String(userId))); const payload: Payload = {}; if (typeof total !== 'undefined') { payload['total'] = total; @@ -2589,7 +2589,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "userId"'); } - const apiPath = '/users/{userId}/sessions'.replace('{userId}', userId); + const apiPath = '/users/{userId}/sessions'.replace('{userId}', encodeURIComponent(String(userId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -2643,7 +2643,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "userId"'); } - const apiPath = '/users/{userId}/sessions'.replace('{userId}', userId); + const apiPath = '/users/{userId}/sessions'.replace('{userId}', encodeURIComponent(String(userId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -2704,7 +2704,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "sessionId"'); } - const apiPath = '/users/{userId}/sessions/{sessionId}'.replace('{userId}', userId).replace('{sessionId}', sessionId); + const apiPath = '/users/{userId}/sessions/{sessionId}'.replace('{userId}', encodeURIComponent(String(userId))).replace('{sessionId}', encodeURIComponent(String(sessionId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -2765,7 +2765,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "status"'); } - const apiPath = '/users/{userId}/status'.replace('{userId}', userId); + const apiPath = '/users/{userId}/status'.replace('{userId}', encodeURIComponent(String(userId))); const payload: Payload = {}; if (typeof status !== 'undefined') { payload['status'] = status; @@ -2831,7 +2831,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "userId"'); } - const apiPath = '/users/{userId}/targets'.replace('{userId}', userId); + const apiPath = '/users/{userId}/targets'.replace('{userId}', encodeURIComponent(String(userId))); const payload: Payload = {}; if (typeof queries !== 'undefined') { payload['queries'] = queries; @@ -2920,7 +2920,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "identifier"'); } - const apiPath = '/users/{userId}/targets'.replace('{userId}', userId); + const apiPath = '/users/{userId}/targets'.replace('{userId}', encodeURIComponent(String(userId))); const payload: Payload = {}; if (typeof targetId !== 'undefined') { payload['targetId'] = targetId; @@ -2997,7 +2997,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "targetId"'); } - const apiPath = '/users/{userId}/targets/{targetId}'.replace('{userId}', userId).replace('{targetId}', targetId); + const apiPath = '/users/{userId}/targets/{targetId}'.replace('{userId}', encodeURIComponent(String(userId))).replace('{targetId}', encodeURIComponent(String(targetId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -3070,7 +3070,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "targetId"'); } - const apiPath = '/users/{userId}/targets/{targetId}'.replace('{userId}', userId).replace('{targetId}', targetId); + const apiPath = '/users/{userId}/targets/{targetId}'.replace('{userId}', encodeURIComponent(String(userId))).replace('{targetId}', encodeURIComponent(String(targetId))); const payload: Payload = {}; if (typeof identifier !== 'undefined') { payload['identifier'] = identifier; @@ -3141,7 +3141,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "targetId"'); } - const apiPath = '/users/{userId}/targets/{targetId}'.replace('{userId}', userId).replace('{targetId}', targetId); + const apiPath = '/users/{userId}/targets/{targetId}'.replace('{userId}', encodeURIComponent(String(userId))).replace('{targetId}', encodeURIComponent(String(targetId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -3205,7 +3205,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "userId"'); } - const apiPath = '/users/{userId}/tokens'.replace('{userId}', userId); + const apiPath = '/users/{userId}/tokens'.replace('{userId}', encodeURIComponent(String(userId))); const payload: Payload = {}; if (typeof length !== 'undefined') { payload['length'] = length; @@ -3273,7 +3273,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "emailVerification"'); } - const apiPath = '/users/{userId}/verification'.replace('{userId}', userId); + const apiPath = '/users/{userId}/verification'.replace('{userId}', encodeURIComponent(String(userId))); const payload: Payload = {}; if (typeof emailVerification !== 'undefined') { payload['emailVerification'] = emailVerification; @@ -3338,7 +3338,7 @@ export class Users { throw new AppwriteException('Missing required parameter: "phoneVerification"'); } - const apiPath = '/users/{userId}/verification/phone'.replace('{userId}', userId); + const apiPath = '/users/{userId}/verification/phone'.replace('{userId}', encodeURIComponent(String(userId))); const payload: Payload = {}; if (typeof phoneVerification !== 'undefined') { payload['phoneVerification'] = phoneVerification; diff --git a/src/services/webhooks.ts b/src/services/webhooks.ts index cf096f8..71d27f1 100644 --- a/src/services/webhooks.ts +++ b/src/services/webhooks.ts @@ -230,7 +230,7 @@ export class Webhooks { throw new AppwriteException('Missing required parameter: "webhookId"'); } - const apiPath = '/webhooks/{webhookId}'.replace('{webhookId}', webhookId); + const apiPath = '/webhooks/{webhookId}'.replace('{webhookId}', encodeURIComponent(String(webhookId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -321,7 +321,7 @@ export class Webhooks { throw new AppwriteException('Missing required parameter: "events"'); } - const apiPath = '/webhooks/{webhookId}'.replace('{webhookId}', webhookId); + const apiPath = '/webhooks/{webhookId}'.replace('{webhookId}', encodeURIComponent(String(webhookId))); const payload: Payload = {}; if (typeof name !== 'undefined') { payload['name'] = name; @@ -396,7 +396,7 @@ export class Webhooks { throw new AppwriteException('Missing required parameter: "webhookId"'); } - const apiPath = '/webhooks/{webhookId}'.replace('{webhookId}', webhookId); + const apiPath = '/webhooks/{webhookId}'.replace('{webhookId}', encodeURIComponent(String(webhookId))); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); @@ -454,7 +454,7 @@ export class Webhooks { throw new AppwriteException('Missing required parameter: "webhookId"'); } - const apiPath = '/webhooks/{webhookId}/secret'.replace('{webhookId}', webhookId); + const apiPath = '/webhooks/{webhookId}/secret'.replace('{webhookId}', encodeURIComponent(String(webhookId))); const payload: Payload = {}; if (typeof secret !== 'undefined') { payload['secret'] = secret; diff --git a/test/services/account.test.js b/test/services/account.test.js index f13cbde..21537be 100644 --- a/test/services/account.test.js +++ b/test/services/account.test.js @@ -62,7 +62,7 @@ describe('Account', () => { const response = await account.create( '', 'email@example.com', - '', + 'password', ); // Remove custom toString method on the objects to allow for clean data comparison. @@ -605,7 +605,7 @@ describe('Account', () => { mockedFetch.mockImplementation(() => Response.json(data)); const response = await account.updatePassword( - '', + 'password', ); // Remove custom toString method on the objects to allow for clean data comparison. @@ -722,7 +722,7 @@ describe('Account', () => { const response = await account.updateRecovery( '', '', - '', + 'password', ); // Remove custom toString method on the objects to allow for clean data comparison. diff --git a/test/services/activities.test.js b/test/services/activities.test.js index e7c258a..2823e41 100644 --- a/test/services/activities.test.js +++ b/test/services/activities.test.js @@ -44,21 +44,7 @@ describe('Activities', () => { 'time': '2020-10-15T06:38:00.000+00:00', 'projectId': '610fc2f985ee0', 'teamId': '610fc2f985ee0', - 'hostname': 'appwrite.io', - 'osCode': 'Mac', - 'osName': 'Mac', - 'osVersion': 'Mac', - 'clientType': 'browser', - 'clientCode': 'CM', - 'clientName': 'Chrome Mobile iOS', - 'clientVersion': '84.0', - 'clientEngine': 'WebKit', - 'clientEngineVersion': '605.1.15', - 'deviceName': 'smartphone', - 'deviceBrand': 'Google', - 'deviceModel': 'Nexus 5', - 'countryCode': 'US', - 'countryName': 'United States',}; + 'hostname': 'appwrite.io',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await activities.getEvent( diff --git a/test/services/backups.test.js b/test/services/backups.test.js index a5e5599..46f5814 100644 --- a/test/services/backups.test.js +++ b/test/services/backups.test.js @@ -112,6 +112,7 @@ describe('Backups', () => { 'resources': [], 'retention': 7, 'schedule': '0 * * * *', + 'type': 'full', 'enabled': true,}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -138,6 +139,7 @@ describe('Backups', () => { 'resources': [], 'retention': 7, 'schedule': '0 * * * *', + 'type': 'full', 'enabled': true,}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -161,6 +163,7 @@ describe('Backups', () => { 'resources': [], 'retention': 7, 'schedule': '0 * * * *', + 'type': 'full', 'enabled': true,}; mockedFetch.mockImplementation(() => Response.json(data)); @@ -200,7 +203,7 @@ describe('Backups', () => { 'migrationId': 'did8jx6ws45jana098ab7', 'services': [], 'resources': [], - 'options': '{databases.database[{oldId, newId, newName}]}',}; + 'options': '{databases.database[{oldId, newId, newName, newSpecification}]}',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await backups.createRestoration( @@ -241,7 +244,7 @@ describe('Backups', () => { 'migrationId': 'did8jx6ws45jana098ab7', 'services': [], 'resources': [], - 'options': '{databases.database[{oldId, newId, newName}]}',}; + 'options': '{databases.database[{oldId, newId, newName, newSpecification}]}',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await backups.getRestoration( diff --git a/test/services/health.test.js b/test/services/health.test.js deleted file mode 100644 index 3e306fe..0000000 --- a/test/services/health.test.js +++ /dev/null @@ -1,383 +0,0 @@ -const { Client } = require("../../dist/client"); -const { InputFile } = require("../../dist/inputFile"); -const { Health } = require("../../dist/services/health"); - -const { fetch: mockedFetch, Response } = require("undici"); -jest.mock('undici', () => ({ ...jest.requireActual('undici'), fetch: jest.fn() })); - -describe('Health', () => { - const client = new Client(); - const health = new Health(client); - - - test('test method get()', async () => { - const data = { - 'name': 'database', - 'ping': 128, - 'status': 'pass',}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await health.get( - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - - test('test method getAntivirus()', async () => { - const data = { - 'version': '1.0.0', - 'status': 'online',}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await health.getAntivirus( - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - - test('test method getAuditsDB()', async () => { - const data = { - 'total': 5, - 'statuses': [],}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await health.getAuditsDB( - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - - test('test method getCache()', async () => { - const data = { - 'total': 5, - 'statuses': [],}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await health.getCache( - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - - test('test method getCertificate()', async () => { - const data = { - 'name': '/CN=www.google.com', - 'subjectSN': '', - 'issuerOrganisation': '', - 'validFrom': '1704200998', - 'validTo': '1711458597', - 'signatureTypeSN': 'RSA-SHA256',}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await health.getCertificate( - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - - test('test method getConsolePausing()', async () => { - const data = { - 'name': 'database', - 'ping': 128, - 'status': 'pass',}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await health.getConsolePausing( - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - - test('test method getDB()', async () => { - const data = { - 'total': 5, - 'statuses': [],}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await health.getDB( - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - - test('test method getPubSub()', async () => { - const data = { - 'total': 5, - 'statuses': [],}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await health.getPubSub( - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - - test('test method getQueueAudits()', async () => { - const data = { - 'size': 8,}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await health.getQueueAudits( - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - - test('test method getQueueBuilds()', async () => { - const data = { - 'size': 8,}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await health.getQueueBuilds( - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - - test('test method getQueueCertificates()', async () => { - const data = { - 'size': 8,}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await health.getQueueCertificates( - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - - test('test method getQueueDatabases()', async () => { - const data = { - 'size': 8,}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await health.getQueueDatabases( - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - - test('test method getQueueDeletes()', async () => { - const data = { - 'size': 8,}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await health.getQueueDeletes( - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - - test('test method getFailedJobs()', async () => { - const data = { - 'size': 8,}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await health.getFailedJobs( - 'v1-database', - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - - test('test method getQueueFunctions()', async () => { - const data = { - 'size': 8,}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await health.getQueueFunctions( - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - - test('test method getQueueLogs()', async () => { - const data = { - 'size': 8,}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await health.getQueueLogs( - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - - test('test method getQueueMails()', async () => { - const data = { - 'size': 8,}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await health.getQueueMails( - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - - test('test method getQueueMessaging()', async () => { - const data = { - 'size': 8,}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await health.getQueueMessaging( - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - - test('test method getQueueMigrations()', async () => { - const data = { - 'size': 8,}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await health.getQueueMigrations( - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - - test('test method getQueueStatsResources()', async () => { - const data = { - 'size': 8,}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await health.getQueueStatsResources( - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - - test('test method getQueueUsage()', async () => { - const data = { - 'size': 8,}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await health.getQueueUsage( - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - - test('test method getQueueWebhooks()', async () => { - const data = { - 'size': 8,}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await health.getQueueWebhooks( - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - - test('test method getStorage()', async () => { - const data = { - 'name': 'database', - 'ping': 128, - 'status': 'pass',}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await health.getStorage( - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - - test('test method getStorageLocal()', async () => { - const data = { - 'name': 'database', - 'ping': 128, - 'status': 'pass',}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await health.getStorageLocal( - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - - test('test method getTime()', async () => { - const data = { - 'remoteTime': 1639490751, - 'localTime': 1639490844, - 'diff': 93,}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await health.getTime( - ); - - // 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/messaging.test.js b/test/services/messaging.test.js index 1a08800..007688e 100644 --- a/test/services/messaging.test.js +++ b/test/services/messaging.test.js @@ -259,22 +259,6 @@ describe('Messaging', () => { expect(response).toEqual(data); }); - test('test method listMessageLogs()', async () => { - const data = { - 'total': 5, - 'logs': [],}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await messaging.listMessageLogs( - '', - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - test('test method listTargets()', async () => { const data = { 'total': 5, @@ -1019,38 +1003,6 @@ describe('Messaging', () => { expect(response).toEqual(data); }); - test('test method listProviderLogs()', async () => { - const data = { - 'total': 5, - 'logs': [],}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await messaging.listProviderLogs( - '', - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - - test('test method listSubscriberLogs()', async () => { - const data = { - 'total': 5, - 'logs': [],}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await messaging.listSubscriberLogs( - '', - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - test('test method listTopics()', async () => { const data = { 'total': 5, @@ -1147,22 +1099,6 @@ describe('Messaging', () => { expect(response).toEqual(data); }); - test('test method listTopicLogs()', async () => { - const data = { - 'total': 5, - 'logs': [],}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await messaging.listTopicLogs( - '', - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - test('test method listSubscribers()', async () => { const data = { 'total': 5, diff --git a/test/services/organization.test.js b/test/services/organization.test.js index a2a6a29..69a6ea4 100644 --- a/test/services/organization.test.js +++ b/test/services/organization.test.js @@ -10,6 +10,114 @@ describe('Organization', () => { const organization = new Organization(client); + test('test method get()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'VIP', + 'total': 7, + 'prefs': {}, + 'billingBudget': 50, + 'budgetAlerts': [], + 'billingPlan': 'tier-1', + 'billingPlanId': 'tier-1', + 'billingPlanDetails': {}, + 'billingEmail': 'billing@org.example', + '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': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await organization.get( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method update()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'VIP', + 'total': 7, + 'prefs': {}, + 'billingBudget': 50, + 'budgetAlerts': [], + 'billingPlan': 'tier-1', + 'billingPlanId': 'tier-1', + 'billingPlanDetails': {}, + 'billingEmail': 'billing@org.example', + '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': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await organization.update( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method delete()', async () => { + const data = {message: ""}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await organization.delete( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method listKeys()', async () => { const data = { 'total': 5, @@ -112,6 +220,123 @@ describe('Organization', () => { expect(response).toEqual(data); }); + test('test method listMemberships()', async () => { + const data = { + 'total': 5, + 'memberships': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await organization.listMemberships( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method createMembership()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'userId': '5e5ea5c16897e', + 'userName': 'John Doe', + 'userEmail': 'john@appwrite.io', + 'userPhone': '+1 555 555 5555', + 'teamId': '5e5ea5c16897e', + 'teamName': 'VIP', + 'invited': '2020-10-15T06:38:00.000+00:00', + 'joined': '2020-10-15T06:38:00.000+00:00', + 'confirm': true, + 'mfa': true, + 'userAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'roles': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await organization.createMembership( + [], + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method getMembership()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'userId': '5e5ea5c16897e', + 'userName': 'John Doe', + 'userEmail': 'john@appwrite.io', + 'userPhone': '+1 555 555 5555', + 'teamId': '5e5ea5c16897e', + 'teamName': 'VIP', + 'invited': '2020-10-15T06:38:00.000+00:00', + 'joined': '2020-10-15T06:38:00.000+00:00', + 'confirm': true, + 'mfa': true, + 'userAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'roles': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await organization.getMembership( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateMembership()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'userId': '5e5ea5c16897e', + 'userName': 'John Doe', + 'userEmail': 'john@appwrite.io', + 'userPhone': '+1 555 555 5555', + 'teamId': '5e5ea5c16897e', + 'teamName': 'VIP', + 'invited': '2020-10-15T06:38:00.000+00:00', + 'joined': '2020-10-15T06:38:00.000+00:00', + 'confirm': true, + 'mfa': true, + 'userAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'roles': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await organization.updateMembership( + '', + [], + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method deleteMembership()', async () => { + const data = {message: ""}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await organization.deleteMembership( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method listProjects()', async () => { const data = { 'total': 5, @@ -144,31 +369,18 @@ describe('Organization', () => { 'smtpHost': 'mail.appwrite.io', 'smtpPort': 25, 'smtpUsername': 'emailuser', - 'smtpPassword': '', + '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', - 'oAuth2ServerEnabled': true, - 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', - 'oAuth2ServerScopes': [], - 'oAuth2ServerAuthorizationDetailsTypes': [], - 'oAuth2ServerAccessTokenDuration': 3600, - 'oAuth2ServerRefreshTokenDuration': 86400, - 'oAuth2ServerPublicAccessTokenDuration': 3600, - 'oAuth2ServerPublicRefreshTokenDuration': 2592000, - 'oAuth2ServerConfidentialPkce': true, - 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', - 'oAuth2ServerUserCodeLength': 8, - 'oAuth2ServerUserCodeFormat': 'alphanumeric', - 'oAuth2ServerDeviceCodeDuration': 600, - 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await organization.createProject( @@ -199,31 +411,18 @@ describe('Organization', () => { 'smtpHost': 'mail.appwrite.io', 'smtpPort': 25, 'smtpUsername': 'emailuser', - 'smtpPassword': '', + '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', - 'oAuth2ServerEnabled': true, - 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', - 'oAuth2ServerScopes': [], - 'oAuth2ServerAuthorizationDetailsTypes': [], - 'oAuth2ServerAccessTokenDuration': 3600, - 'oAuth2ServerRefreshTokenDuration': 86400, - 'oAuth2ServerPublicAccessTokenDuration': 3600, - 'oAuth2ServerPublicRefreshTokenDuration': 2592000, - 'oAuth2ServerConfidentialPkce': true, - 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', - 'oAuth2ServerUserCodeLength': 8, - 'oAuth2ServerUserCodeFormat': 'alphanumeric', - 'oAuth2ServerDeviceCodeDuration': 600, - 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await organization.getProject( @@ -253,31 +452,18 @@ describe('Organization', () => { 'smtpHost': 'mail.appwrite.io', 'smtpPort': 25, 'smtpUsername': 'emailuser', - 'smtpPassword': '', + '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', - 'oAuth2ServerEnabled': true, - 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', - 'oAuth2ServerScopes': [], - 'oAuth2ServerAuthorizationDetailsTypes': [], - 'oAuth2ServerAccessTokenDuration': 3600, - 'oAuth2ServerRefreshTokenDuration': 86400, - 'oAuth2ServerPublicAccessTokenDuration': 3600, - 'oAuth2ServerPublicRefreshTokenDuration': 2592000, - 'oAuth2ServerConfidentialPkce': true, - 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', - 'oAuth2ServerUserCodeLength': 8, - 'oAuth2ServerUserCodeFormat': 'alphanumeric', - 'oAuth2ServerDeviceCodeDuration': 600, - 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await organization.updateProject( diff --git a/test/services/project.test.js b/test/services/project.test.js index d644e0d..48aaf8e 100644 --- a/test/services/project.test.js +++ b/test/services/project.test.js @@ -27,31 +27,18 @@ describe('Project', () => { 'smtpHost': 'mail.appwrite.io', 'smtpPort': 25, 'smtpUsername': 'emailuser', - 'smtpPassword': '', + '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', - 'oAuth2ServerEnabled': true, - 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', - 'oAuth2ServerScopes': [], - 'oAuth2ServerAuthorizationDetailsTypes': [], - 'oAuth2ServerAccessTokenDuration': 3600, - 'oAuth2ServerRefreshTokenDuration': 86400, - 'oAuth2ServerPublicAccessTokenDuration': 3600, - 'oAuth2ServerPublicRefreshTokenDuration': 2592000, - 'oAuth2ServerConfidentialPkce': true, - 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', - 'oAuth2ServerUserCodeLength': 8, - 'oAuth2ServerUserCodeFormat': 'alphanumeric', - 'oAuth2ServerDeviceCodeDuration': 600, - 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.get( @@ -93,31 +80,18 @@ describe('Project', () => { 'smtpHost': 'mail.appwrite.io', 'smtpPort': 25, 'smtpUsername': 'emailuser', - 'smtpPassword': '', + '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', - 'oAuth2ServerEnabled': true, - 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', - 'oAuth2ServerScopes': [], - 'oAuth2ServerAuthorizationDetailsTypes': [], - 'oAuth2ServerAccessTokenDuration': 3600, - 'oAuth2ServerRefreshTokenDuration': 86400, - 'oAuth2ServerPublicAccessTokenDuration': 3600, - 'oAuth2ServerPublicRefreshTokenDuration': 2592000, - 'oAuth2ServerConfidentialPkce': true, - 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', - 'oAuth2ServerUserCodeLength': 8, - 'oAuth2ServerUserCodeFormat': 'alphanumeric', - 'oAuth2ServerDeviceCodeDuration': 600, - 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateAuthMethod( @@ -274,31 +248,18 @@ describe('Project', () => { 'smtpHost': 'mail.appwrite.io', 'smtpPort': 25, 'smtpUsername': 'emailuser', - 'smtpPassword': '', + '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', - 'oAuth2ServerEnabled': true, - 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', - 'oAuth2ServerScopes': [], - 'oAuth2ServerAuthorizationDetailsTypes': [], - 'oAuth2ServerAccessTokenDuration': 3600, - 'oAuth2ServerRefreshTokenDuration': 86400, - 'oAuth2ServerPublicAccessTokenDuration': 3600, - 'oAuth2ServerPublicRefreshTokenDuration': 2592000, - 'oAuth2ServerConfidentialPkce': true, - 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', - 'oAuth2ServerUserCodeLength': 8, - 'oAuth2ServerUserCodeFormat': 'alphanumeric', - 'oAuth2ServerDeviceCodeDuration': 600, - 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateLabels( @@ -428,31 +389,18 @@ describe('Project', () => { 'smtpHost': 'mail.appwrite.io', 'smtpPort': 25, 'smtpUsername': 'emailuser', - 'smtpPassword': '', + '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', - 'oAuth2ServerEnabled': true, - 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', - 'oAuth2ServerScopes': [], - 'oAuth2ServerAuthorizationDetailsTypes': [], - 'oAuth2ServerAccessTokenDuration': 3600, - 'oAuth2ServerRefreshTokenDuration': 86400, - 'oAuth2ServerPublicAccessTokenDuration': 3600, - 'oAuth2ServerPublicRefreshTokenDuration': 2592000, - 'oAuth2ServerConfidentialPkce': true, - 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', - 'oAuth2ServerUserCodeLength': 8, - 'oAuth2ServerUserCodeFormat': 'alphanumeric', - 'oAuth2ServerDeviceCodeDuration': 600, - 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Server( @@ -502,6 +450,23 @@ describe('Project', () => { expect(response).toEqual(data); }); + test('test method updateOAuth2Appwrite()', async () => { + const data = { + '\$id': 'github', + 'enabled': true, + 'clientId': '6a42000000000000b5a0', + 'clientSecret': 'b86afd000000000000000000000000000000000000000000000000000ced5f93',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateOAuth2Appwrite( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method updateOAuth2Auth0()', async () => { const data = { '\$id': 'github', @@ -893,7 +858,8 @@ describe('Project', () => { 'wellKnownURL': 'https://myoauth.com/.well-known/openid-configuration', 'authorizationURL': 'https://myoauth.com/oauth2/authorize', 'tokenURL': 'https://myoauth.com/oauth2/token', - 'userInfoURL': 'https://myoauth.com/oauth2/userinfo',}; + 'userInfoURL': 'https://myoauth.com/oauth2/userinfo', + 'prompt': [],}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Oidc( @@ -1516,31 +1482,18 @@ describe('Project', () => { 'smtpHost': 'mail.appwrite.io', 'smtpPort': 25, 'smtpUsername': 'emailuser', - 'smtpPassword': '', + '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', - 'oAuth2ServerEnabled': true, - 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', - 'oAuth2ServerScopes': [], - 'oAuth2ServerAuthorizationDetailsTypes': [], - 'oAuth2ServerAccessTokenDuration': 3600, - 'oAuth2ServerRefreshTokenDuration': 86400, - 'oAuth2ServerPublicAccessTokenDuration': 3600, - 'oAuth2ServerPublicRefreshTokenDuration': 2592000, - 'oAuth2ServerConfidentialPkce': true, - 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', - 'oAuth2ServerUserCodeLength': 8, - 'oAuth2ServerUserCodeFormat': 'alphanumeric', - 'oAuth2ServerDeviceCodeDuration': 600, - 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateDenyAliasedEmailPolicy( @@ -1553,6 +1506,47 @@ describe('Project', () => { expect(response).toEqual(data); }); + test('test method updateDenyCorporateEmailPolicy()', 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',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await project.updateDenyCorporateEmailPolicy( + true, + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method updateDenyDisposableEmailPolicy()', async () => { const data = { '\$id': '5e5ea5c16897e', @@ -1570,31 +1564,18 @@ describe('Project', () => { 'smtpHost': 'mail.appwrite.io', 'smtpPort': 25, 'smtpUsername': 'emailuser', - 'smtpPassword': '', + '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', - 'oAuth2ServerEnabled': true, - 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', - 'oAuth2ServerScopes': [], - 'oAuth2ServerAuthorizationDetailsTypes': [], - 'oAuth2ServerAccessTokenDuration': 3600, - 'oAuth2ServerRefreshTokenDuration': 86400, - 'oAuth2ServerPublicAccessTokenDuration': 3600, - 'oAuth2ServerPublicRefreshTokenDuration': 2592000, - 'oAuth2ServerConfidentialPkce': true, - 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', - 'oAuth2ServerUserCodeLength': 8, - 'oAuth2ServerUserCodeFormat': 'alphanumeric', - 'oAuth2ServerDeviceCodeDuration': 600, - 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateDenyDisposableEmailPolicy( @@ -1624,31 +1605,18 @@ describe('Project', () => { 'smtpHost': 'mail.appwrite.io', 'smtpPort': 25, 'smtpUsername': 'emailuser', - 'smtpPassword': '', + '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', - 'oAuth2ServerEnabled': true, - 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', - 'oAuth2ServerScopes': [], - 'oAuth2ServerAuthorizationDetailsTypes': [], - 'oAuth2ServerAccessTokenDuration': 3600, - 'oAuth2ServerRefreshTokenDuration': 86400, - 'oAuth2ServerPublicAccessTokenDuration': 3600, - 'oAuth2ServerPublicRefreshTokenDuration': 2592000, - 'oAuth2ServerConfidentialPkce': true, - 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', - 'oAuth2ServerUserCodeLength': 8, - 'oAuth2ServerUserCodeFormat': 'alphanumeric', - 'oAuth2ServerDeviceCodeDuration': 600, - 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateDenyFreeEmailPolicy( @@ -1678,31 +1646,18 @@ describe('Project', () => { 'smtpHost': 'mail.appwrite.io', 'smtpPort': 25, 'smtpUsername': 'emailuser', - 'smtpPassword': '', + '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', - 'oAuth2ServerEnabled': true, - 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', - 'oAuth2ServerScopes': [], - 'oAuth2ServerAuthorizationDetailsTypes': [], - 'oAuth2ServerAccessTokenDuration': 3600, - 'oAuth2ServerRefreshTokenDuration': 86400, - 'oAuth2ServerPublicAccessTokenDuration': 3600, - 'oAuth2ServerPublicRefreshTokenDuration': 2592000, - 'oAuth2ServerConfidentialPkce': true, - 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', - 'oAuth2ServerUserCodeLength': 8, - 'oAuth2ServerUserCodeFormat': 'alphanumeric', - 'oAuth2ServerDeviceCodeDuration': 600, - 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateMembershipPrivacyPolicy( @@ -1731,31 +1686,18 @@ describe('Project', () => { 'smtpHost': 'mail.appwrite.io', 'smtpPort': 25, 'smtpUsername': 'emailuser', - 'smtpPassword': '', + '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', - 'oAuth2ServerEnabled': true, - 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', - 'oAuth2ServerScopes': [], - 'oAuth2ServerAuthorizationDetailsTypes': [], - 'oAuth2ServerAccessTokenDuration': 3600, - 'oAuth2ServerRefreshTokenDuration': 86400, - 'oAuth2ServerPublicAccessTokenDuration': 3600, - 'oAuth2ServerPublicRefreshTokenDuration': 2592000, - 'oAuth2ServerConfidentialPkce': true, - 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', - 'oAuth2ServerUserCodeLength': 8, - 'oAuth2ServerUserCodeFormat': 'alphanumeric', - 'oAuth2ServerDeviceCodeDuration': 600, - 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updatePasswordDictionaryPolicy( @@ -1785,31 +1727,18 @@ describe('Project', () => { 'smtpHost': 'mail.appwrite.io', 'smtpPort': 25, 'smtpUsername': 'emailuser', - 'smtpPassword': '', + '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', - 'oAuth2ServerEnabled': true, - 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', - 'oAuth2ServerScopes': [], - 'oAuth2ServerAuthorizationDetailsTypes': [], - 'oAuth2ServerAccessTokenDuration': 3600, - 'oAuth2ServerRefreshTokenDuration': 86400, - 'oAuth2ServerPublicAccessTokenDuration': 3600, - 'oAuth2ServerPublicRefreshTokenDuration': 2592000, - 'oAuth2ServerConfidentialPkce': true, - 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', - 'oAuth2ServerUserCodeLength': 8, - 'oAuth2ServerUserCodeFormat': 'alphanumeric', - 'oAuth2ServerDeviceCodeDuration': 600, - 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updatePasswordHistoryPolicy( @@ -1839,31 +1768,18 @@ describe('Project', () => { 'smtpHost': 'mail.appwrite.io', 'smtpPort': 25, 'smtpUsername': 'emailuser', - 'smtpPassword': '', + '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', - 'oAuth2ServerEnabled': true, - 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', - 'oAuth2ServerScopes': [], - 'oAuth2ServerAuthorizationDetailsTypes': [], - 'oAuth2ServerAccessTokenDuration': 3600, - 'oAuth2ServerRefreshTokenDuration': 86400, - 'oAuth2ServerPublicAccessTokenDuration': 3600, - 'oAuth2ServerPublicRefreshTokenDuration': 2592000, - 'oAuth2ServerConfidentialPkce': true, - 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', - 'oAuth2ServerUserCodeLength': 8, - 'oAuth2ServerUserCodeFormat': 'alphanumeric', - 'oAuth2ServerDeviceCodeDuration': 600, - 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updatePasswordPersonalDataPolicy( @@ -1912,31 +1828,18 @@ describe('Project', () => { 'smtpHost': 'mail.appwrite.io', 'smtpPort': 25, 'smtpUsername': 'emailuser', - 'smtpPassword': '', + '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', - 'oAuth2ServerEnabled': true, - 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', - 'oAuth2ServerScopes': [], - 'oAuth2ServerAuthorizationDetailsTypes': [], - 'oAuth2ServerAccessTokenDuration': 3600, - 'oAuth2ServerRefreshTokenDuration': 86400, - 'oAuth2ServerPublicAccessTokenDuration': 3600, - 'oAuth2ServerPublicRefreshTokenDuration': 2592000, - 'oAuth2ServerConfidentialPkce': true, - 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', - 'oAuth2ServerUserCodeLength': 8, - 'oAuth2ServerUserCodeFormat': 'alphanumeric', - 'oAuth2ServerDeviceCodeDuration': 600, - 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateSessionAlertPolicy( @@ -1966,31 +1869,18 @@ describe('Project', () => { 'smtpHost': 'mail.appwrite.io', 'smtpPort': 25, 'smtpUsername': 'emailuser', - 'smtpPassword': '', + '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', - 'oAuth2ServerEnabled': true, - 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', - 'oAuth2ServerScopes': [], - 'oAuth2ServerAuthorizationDetailsTypes': [], - 'oAuth2ServerAccessTokenDuration': 3600, - 'oAuth2ServerRefreshTokenDuration': 86400, - 'oAuth2ServerPublicAccessTokenDuration': 3600, - 'oAuth2ServerPublicRefreshTokenDuration': 2592000, - 'oAuth2ServerConfidentialPkce': true, - 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', - 'oAuth2ServerUserCodeLength': 8, - 'oAuth2ServerUserCodeFormat': 'alphanumeric', - 'oAuth2ServerDeviceCodeDuration': 600, - 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateSessionDurationPolicy( @@ -2020,31 +1910,18 @@ describe('Project', () => { 'smtpHost': 'mail.appwrite.io', 'smtpPort': 25, 'smtpUsername': 'emailuser', - 'smtpPassword': '', + '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', - 'oAuth2ServerEnabled': true, - 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', - 'oAuth2ServerScopes': [], - 'oAuth2ServerAuthorizationDetailsTypes': [], - 'oAuth2ServerAccessTokenDuration': 3600, - 'oAuth2ServerRefreshTokenDuration': 86400, - 'oAuth2ServerPublicAccessTokenDuration': 3600, - 'oAuth2ServerPublicRefreshTokenDuration': 2592000, - 'oAuth2ServerConfidentialPkce': true, - 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', - 'oAuth2ServerUserCodeLength': 8, - 'oAuth2ServerUserCodeFormat': 'alphanumeric', - 'oAuth2ServerDeviceCodeDuration': 600, - 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateSessionInvalidationPolicy( @@ -2074,31 +1951,18 @@ describe('Project', () => { 'smtpHost': 'mail.appwrite.io', 'smtpPort': 25, 'smtpUsername': 'emailuser', - 'smtpPassword': '', + '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', - 'oAuth2ServerEnabled': true, - 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', - 'oAuth2ServerScopes': [], - 'oAuth2ServerAuthorizationDetailsTypes': [], - 'oAuth2ServerAccessTokenDuration': 3600, - 'oAuth2ServerRefreshTokenDuration': 86400, - 'oAuth2ServerPublicAccessTokenDuration': 3600, - 'oAuth2ServerPublicRefreshTokenDuration': 2592000, - 'oAuth2ServerConfidentialPkce': true, - 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', - 'oAuth2ServerUserCodeLength': 8, - 'oAuth2ServerUserCodeFormat': 'alphanumeric', - 'oAuth2ServerDeviceCodeDuration': 600, - 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateSessionLimitPolicy( @@ -2128,31 +1992,18 @@ describe('Project', () => { 'smtpHost': 'mail.appwrite.io', 'smtpPort': 25, 'smtpUsername': 'emailuser', - 'smtpPassword': '', + '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', - 'oAuth2ServerEnabled': true, - 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', - 'oAuth2ServerScopes': [], - 'oAuth2ServerAuthorizationDetailsTypes': [], - 'oAuth2ServerAccessTokenDuration': 3600, - 'oAuth2ServerRefreshTokenDuration': 86400, - 'oAuth2ServerPublicAccessTokenDuration': 3600, - 'oAuth2ServerPublicRefreshTokenDuration': 2592000, - 'oAuth2ServerConfidentialPkce': true, - 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', - 'oAuth2ServerUserCodeLength': 8, - 'oAuth2ServerUserCodeFormat': 'alphanumeric', - 'oAuth2ServerDeviceCodeDuration': 600, - 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateUserLimitPolicy( @@ -2198,31 +2049,18 @@ describe('Project', () => { 'smtpHost': 'mail.appwrite.io', 'smtpPort': 25, 'smtpUsername': 'emailuser', - 'smtpPassword': '', + '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', - 'oAuth2ServerEnabled': true, - 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', - 'oAuth2ServerScopes': [], - 'oAuth2ServerAuthorizationDetailsTypes': [], - 'oAuth2ServerAccessTokenDuration': 3600, - 'oAuth2ServerRefreshTokenDuration': 86400, - 'oAuth2ServerPublicAccessTokenDuration': 3600, - 'oAuth2ServerPublicRefreshTokenDuration': 2592000, - 'oAuth2ServerConfidentialPkce': true, - 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', - 'oAuth2ServerUserCodeLength': 8, - 'oAuth2ServerUserCodeFormat': 'alphanumeric', - 'oAuth2ServerDeviceCodeDuration': 600, - 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateProtocol( @@ -2253,31 +2091,18 @@ describe('Project', () => { 'smtpHost': 'mail.appwrite.io', 'smtpPort': 25, 'smtpUsername': 'emailuser', - 'smtpPassword': '', + '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', - 'oAuth2ServerEnabled': true, - 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', - 'oAuth2ServerScopes': [], - 'oAuth2ServerAuthorizationDetailsTypes': [], - 'oAuth2ServerAccessTokenDuration': 3600, - 'oAuth2ServerRefreshTokenDuration': 86400, - 'oAuth2ServerPublicAccessTokenDuration': 3600, - 'oAuth2ServerPublicRefreshTokenDuration': 2592000, - 'oAuth2ServerConfidentialPkce': true, - 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', - 'oAuth2ServerUserCodeLength': 8, - 'oAuth2ServerUserCodeFormat': 'alphanumeric', - 'oAuth2ServerDeviceCodeDuration': 600, - 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateService( @@ -2308,31 +2133,18 @@ describe('Project', () => { 'smtpHost': 'mail.appwrite.io', 'smtpPort': 25, 'smtpUsername': 'emailuser', - 'smtpPassword': '', + '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', - 'oAuth2ServerEnabled': true, - 'oAuth2ServerAuthorizationUrl': 'https://cloud.appwrite.io/oauth2/.well-known/openid-configuration', - 'oAuth2ServerScopes': [], - 'oAuth2ServerAuthorizationDetailsTypes': [], - 'oAuth2ServerAccessTokenDuration': 3600, - 'oAuth2ServerRefreshTokenDuration': 86400, - 'oAuth2ServerPublicAccessTokenDuration': 3600, - 'oAuth2ServerPublicRefreshTokenDuration': 2592000, - 'oAuth2ServerConfidentialPkce': true, - 'oAuth2ServerVerificationUrl': 'https://cloud.appwrite.io/device', - 'oAuth2ServerUserCodeLength': 8, - 'oAuth2ServerUserCodeFormat': 'alphanumeric', - 'oAuth2ServerDeviceCodeDuration': 600, - 'oAuth2ServerDiscoveryUrl': 'https://auth.example.com/.well-known/openid-configuration',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateSMTP( diff --git a/test/services/usage.test.js b/test/services/usage.test.js deleted file mode 100644 index 44efb8e..0000000 --- a/test/services/usage.test.js +++ /dev/null @@ -1,42 +0,0 @@ -const { Client } = require("../../dist/client"); -const { InputFile } = require("../../dist/inputFile"); -const { Usage } = require("../../dist/services/usage"); - -const { fetch: mockedFetch, Response } = require("undici"); -jest.mock('undici', () => ({ ...jest.requireActual('undici'), fetch: jest.fn() })); - -describe('Usage', () => { - const client = new Client(); - const usage = new Usage(client); - - - test('test method listEvents()', async () => { - const data = { - 'total': 5, - 'events': [],}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await usage.listEvents( - ); - - // Remove custom toString method on the objects to allow for clean data comparison. - delete response.toString; - - expect(response).toEqual(data); - }); - - test('test method listGauges()', async () => { - const data = { - 'total': 5, - 'gauges': [],}; - mockedFetch.mockImplementation(() => Response.json(data)); - - const response = await usage.listGauges( - ); - - // 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/users.test.js b/test/services/users.test.js index 7513e57..f9ea2b1 100644 --- a/test/services/users.test.js +++ b/test/services/users.test.js @@ -771,7 +771,7 @@ describe('Users', () => { const response = await users.updatePassword( '', - '', + 'password', ); // Remove custom toString method on the objects to allow for clean data comparison. diff --git a/test/services/webhooks.test.js b/test/services/webhooks.test.js index 7fb1338..46382da 100644 --- a/test/services/webhooks.test.js +++ b/test/services/webhooks.test.js @@ -35,7 +35,7 @@ describe('Webhooks', () => { 'events': [], 'tls': true, 'authUsername': 'username', - 'authPassword': 'password', + 'authPassword': 'webhook-password', 'secret': 'ad3d581ca230e2b7059c545e5a', 'enabled': true, 'logs': 'Failed to connect to remote server.', @@ -65,7 +65,7 @@ describe('Webhooks', () => { 'events': [], 'tls': true, 'authUsername': 'username', - 'authPassword': 'password', + 'authPassword': 'webhook-password', 'secret': 'ad3d581ca230e2b7059c545e5a', 'enabled': true, 'logs': 'Failed to connect to remote server.', @@ -92,7 +92,7 @@ describe('Webhooks', () => { 'events': [], 'tls': true, 'authUsername': 'username', - 'authPassword': 'password', + 'authPassword': 'webhook-password', 'secret': 'ad3d581ca230e2b7059c545e5a', 'enabled': true, 'logs': 'Failed to connect to remote server.', @@ -136,7 +136,7 @@ describe('Webhooks', () => { 'events': [], 'tls': true, 'authUsername': 'username', - 'authPassword': 'password', + 'authPassword': 'webhook-password', 'secret': 'ad3d581ca230e2b7059c545e5a', 'enabled': true, 'logs': 'Failed to connect to remote server.', From c2a4f04053ac013fcfae4e12b73b7b4c8d1df147 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 13 Jul 2026 12:10:38 +0530 Subject: [PATCH 3/6] chore: update Node.js SDK to 27.0.0 --- src/client.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client.ts b/src/client.ts index 4fb7ac6..960612e 100644 --- a/src/client.ts +++ b/src/client.ts @@ -256,7 +256,7 @@ class Client { * @return {this} */ setBearer(value: string): this { - this.headers['Authorization'] = value; + this.headers['Authorization'] = `Bearer ${value}`; this.config.bearer = value; return this; } From 5b3431bdeac005883f5fc655a3006641aa4b729a Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 13 Jul 2026 13:17:33 +0530 Subject: [PATCH 4/6] (fix): remove duplicate Project model properties from merge --- src/models.ts | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/models.ts b/src/models.ts index 448a4e3..5e56cfa 100644 --- a/src/models.ts +++ b/src/models.ts @@ -4335,10 +4335,6 @@ export namespace Models { * OAuth2 server accepted RFC 9396 authorization_details types */ oAuth2ServerAuthorizationDetailsTypes?: string[]; - /** - * OAuth2 server accepted RFC 9396 authorization_details types - */ - oAuth2ServerAuthorizationDetailsTypes: string[]; /** * OAuth2 server access token duration in seconds for confidential clients */ @@ -4375,22 +4371,6 @@ export namespace Models { * Lifetime in seconds of device flow device codes and user codes. */ oAuth2ServerDeviceCodeDuration?: number; - /** - * URL to your application page where users enter the device flow user code. Empty when the Device Authorization Grant is not configured. - */ - oAuth2ServerVerificationUrl: string; - /** - * Number of characters in the device flow user code, excluding the formatting separator. - */ - oAuth2ServerUserCodeLength: number; - /** - * Character set for device flow user codes: `numeric`, `alphabetic`, or `alphanumeric`. - */ - oAuth2ServerUserCodeFormat: string; - /** - * Lifetime in seconds of device flow device codes and user codes. - */ - oAuth2ServerDeviceCodeDuration: number; /** * OAuth2 server discovery URL */ From 25c3ae5ca15d935d826f87189e8e14c27f1c03a9 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 23 Jul 2026 16:17:06 +0530 Subject: [PATCH 5/6] chore: update Node.js SDK to 27.1.0 --- CHANGELOG.md | 10 + docs/examples/account/delete-consent-token.md | 15 + docs/examples/account/delete-consent.md | 14 + docs/examples/account/get-consent-token.md | 15 + docs/examples/account/get-consent.md | 14 + docs/examples/account/list-consent-tokens.md | 16 + docs/examples/account/list-consents.md | 15 + .../apps/create-installation-token.md | 15 + docs/examples/apps/create-key.md | 14 + docs/examples/apps/create-secret.md | 14 + docs/examples/apps/create.md | 32 + docs/examples/apps/delete-key.md | 15 + docs/examples/apps/delete-secret.md | 15 + docs/examples/apps/delete-tokens.md | 14 + docs/examples/apps/delete.md | 14 + docs/examples/apps/get-installation.md | 15 + docs/examples/apps/get-key.md | 15 + docs/examples/apps/get-secret.md | 15 + docs/examples/apps/get.md | 14 + .../examples/apps/list-installation-scopes.md | 12 + docs/examples/apps/list-installations.md | 16 + docs/examples/apps/list-keys.md | 16 + docs/examples/apps/list-o-auth-2-scopes.md | 12 + docs/examples/apps/list-secrets.md | 16 + docs/examples/apps/list.md | 15 + docs/examples/apps/update-labels.md | 15 + docs/examples/apps/update-team.md | 15 + docs/examples/apps/update.md | 33 + docs/examples/backups/create-restoration.md | 3 +- docs/examples/oauth2/approve.md | 16 + docs/examples/oauth2/authorize-post.md | 27 + docs/examples/oauth2/authorize.md | 27 + .../oauth2/create-device-authorization.md | 18 + docs/examples/oauth2/create-grant.md | 14 + docs/examples/oauth2/create-par.md | 26 + docs/examples/oauth2/create-token.md | 23 + docs/examples/oauth2/get-grant.md | 14 + docs/examples/oauth2/list-organizations.md | 16 + docs/examples/oauth2/list-projects.md | 16 + docs/examples/oauth2/reject.md | 14 + docs/examples/oauth2/revoke.md | 17 + .../organization/create-installation.md | 15 + .../organization/delete-installation.md | 14 + .../examples/organization/get-installation.md | 14 + .../organization/list-installations.md | 15 + .../organization/update-installation.md | 15 + .../project/update-o-auth-2-server.md | 1 + .../examples/sites/get-deployment-download.md | 3 +- docs/examples/tablesdb/create-failover.md | 15 + docs/examples/tablesdb/create.md | 3 +- docs/examples/tablesdb/get-replicas.md | 14 + docs/examples/tablesdb/get-status.md | 14 + docs/examples/tablesdb/list-specifications.md | 12 + docs/examples/tablesdb/update.md | 3 +- docs/examples/teams/create-installation.md | 16 + docs/examples/teams/delete-installation.md | 15 + docs/examples/teams/get-installation.md | 15 + docs/examples/teams/list-installations.md | 16 + docs/examples/teams/update-installation.md | 16 + package-lock.json | 4 +- package.json | 2 +- src/client.ts | 4 +- src/enums/database-status.ts | 11 + src/enums/database-type.ts | 3 + src/enums/organization-key-scopes.ts | 2 + src/enums/project-key-scopes.ts | 3 + src/index.ts | 2 + src/models.ts | 1314 ++++++++++++++- src/services/account.ts | 359 ++++ src/services/apps.ts | 1476 +++++++++++++++++ src/services/backups.ts | 41 +- src/services/oauth-2.ts | 1097 ++++++++++++ src/services/organization.ts | 295 ++++ src/services/project.ts | 31 +- src/services/sites.ts | 21 +- src/services/tables-db.ts | 235 ++- src/services/teams.ts | 332 ++++ test/services/account.test.js | 110 ++ test/services/activities.test.js | 13 +- test/services/apps.test.js | 502 ++++++ test/services/backups.test.js | 4 +- test/services/databases.test.js | 12 +- test/services/oauth2.test.js | 224 +++ test/services/organization.test.js | 107 +- test/services/project.test.js | 60 +- test/services/tables-d-b.test.js | 128 +- test/services/teams.test.js | 103 ++ 87 files changed, 7229 insertions(+), 154 deletions(-) create mode 100644 docs/examples/account/delete-consent-token.md create mode 100644 docs/examples/account/delete-consent.md create mode 100644 docs/examples/account/get-consent-token.md create mode 100644 docs/examples/account/get-consent.md create mode 100644 docs/examples/account/list-consent-tokens.md create mode 100644 docs/examples/account/list-consents.md create mode 100644 docs/examples/apps/create-installation-token.md create mode 100644 docs/examples/apps/create-key.md create mode 100644 docs/examples/apps/create-secret.md create mode 100644 docs/examples/apps/create.md create mode 100644 docs/examples/apps/delete-key.md create mode 100644 docs/examples/apps/delete-secret.md create mode 100644 docs/examples/apps/delete-tokens.md create mode 100644 docs/examples/apps/delete.md create mode 100644 docs/examples/apps/get-installation.md create mode 100644 docs/examples/apps/get-key.md create mode 100644 docs/examples/apps/get-secret.md create mode 100644 docs/examples/apps/get.md create mode 100644 docs/examples/apps/list-installation-scopes.md create mode 100644 docs/examples/apps/list-installations.md create mode 100644 docs/examples/apps/list-keys.md create mode 100644 docs/examples/apps/list-o-auth-2-scopes.md create mode 100644 docs/examples/apps/list-secrets.md create mode 100644 docs/examples/apps/list.md create mode 100644 docs/examples/apps/update-labels.md create mode 100644 docs/examples/apps/update-team.md create mode 100644 docs/examples/apps/update.md create mode 100644 docs/examples/oauth2/approve.md create mode 100644 docs/examples/oauth2/authorize-post.md create mode 100644 docs/examples/oauth2/authorize.md create mode 100644 docs/examples/oauth2/create-device-authorization.md create mode 100644 docs/examples/oauth2/create-grant.md create mode 100644 docs/examples/oauth2/create-par.md create mode 100644 docs/examples/oauth2/create-token.md create mode 100644 docs/examples/oauth2/get-grant.md create mode 100644 docs/examples/oauth2/list-organizations.md create mode 100644 docs/examples/oauth2/list-projects.md create mode 100644 docs/examples/oauth2/reject.md create mode 100644 docs/examples/oauth2/revoke.md create mode 100644 docs/examples/organization/create-installation.md create mode 100644 docs/examples/organization/delete-installation.md create mode 100644 docs/examples/organization/get-installation.md create mode 100644 docs/examples/organization/list-installations.md create mode 100644 docs/examples/organization/update-installation.md create mode 100644 docs/examples/tablesdb/create-failover.md create mode 100644 docs/examples/tablesdb/get-replicas.md create mode 100644 docs/examples/tablesdb/get-status.md create mode 100644 docs/examples/tablesdb/list-specifications.md create mode 100644 docs/examples/teams/create-installation.md create mode 100644 docs/examples/teams/delete-installation.md create mode 100644 docs/examples/teams/get-installation.md create mode 100644 docs/examples/teams/list-installations.md create mode 100644 docs/examples/teams/update-installation.md create mode 100644 src/services/apps.ts create mode 100644 src/services/oauth-2.ts create mode 100644 test/services/apps.test.js create mode 100644 test/services/oauth2.test.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b9de72..fc35853 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Change Log +## 27.1.0 + +* Added: `Apps` service for managing OAuth2 applications, keys, and installations +* Added: `OAuth2` service with authorize, grant, device authorization, and consent flows +* Added: account OAuth2 consent methods `listConsents`, `getConsent`, `deleteConsent`, and consent token methods +* Added: app installation management methods to `Organization` and `Teams` services +* Added: `installationAccessTokenDuration` parameter to `project.updateOAuth2Server` +* Added: `token` parameter to `sites.getDeploymentDownload` +* Added: `oauth2.introspect` and organization installation key scopes + ## 27.0.0 * Breaking: removed `Health` service, health enums, and health response models diff --git a/docs/examples/account/delete-consent-token.md b/docs/examples/account/delete-consent-token.md new file mode 100644 index 0000000..3b45b09 --- /dev/null +++ b/docs/examples/account/delete-consent-token.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 + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.deleteConsentToken({ + consentId: '', + tokenId: '' +}); +``` diff --git a/docs/examples/account/delete-consent.md b/docs/examples/account/delete-consent.md new file mode 100644 index 0000000..eb93aba --- /dev/null +++ b/docs/examples/account/delete-consent.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 + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.deleteConsent({ + consentId: '' +}); +``` diff --git a/docs/examples/account/get-consent-token.md b/docs/examples/account/get-consent-token.md new file mode 100644 index 0000000..3ae6c1e --- /dev/null +++ b/docs/examples/account/get-consent-token.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 + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.getConsentToken({ + consentId: '', + tokenId: '' +}); +``` diff --git a/docs/examples/account/get-consent.md b/docs/examples/account/get-consent.md new file mode 100644 index 0000000..fc7cb6c --- /dev/null +++ b/docs/examples/account/get-consent.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 + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.getConsent({ + consentId: '' +}); +``` diff --git a/docs/examples/account/list-consent-tokens.md b/docs/examples/account/list-consent-tokens.md new file mode 100644 index 0000000..d271066 --- /dev/null +++ b/docs/examples/account/list-consent-tokens.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 + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.listConsentTokens({ + consentId: '', + queries: [], // optional + total: false // optional +}); +``` diff --git a/docs/examples/account/list-consents.md b/docs/examples/account/list-consents.md new file mode 100644 index 0000000..12ec54e --- /dev/null +++ b/docs/examples/account/list-consents.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 + .setSession(''); // The user session to authenticate with + +const account = new sdk.Account(client); + +const result = await account.listConsents({ + queries: [], // optional + total: false // optional +}); +``` diff --git a/docs/examples/apps/create-installation-token.md b/docs/examples/apps/create-installation-token.md new file mode 100644 index 0000000..f60d495 --- /dev/null +++ b/docs/examples/apps/create-installation-token.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 apps = new sdk.Apps(client); + +const result = await apps.createInstallationToken({ + appId: '', + installationId: '' +}); +``` diff --git a/docs/examples/apps/create-key.md b/docs/examples/apps/create-key.md new file mode 100644 index 0000000..0b35816 --- /dev/null +++ b/docs/examples/apps/create-key.md @@ -0,0 +1,14 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with + +const apps = new sdk.Apps(client); + +const result = await apps.createKey({ + appId: '' +}); +``` diff --git a/docs/examples/apps/create-secret.md b/docs/examples/apps/create-secret.md new file mode 100644 index 0000000..1f85104 --- /dev/null +++ b/docs/examples/apps/create-secret.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 + .setSession(''); // The user session to authenticate with + +const apps = new sdk.Apps(client); + +const result = await apps.createSecret({ + appId: '' +}); +``` diff --git a/docs/examples/apps/create.md b/docs/examples/apps/create.md new file mode 100644 index 0000000..80339c5 --- /dev/null +++ b/docs/examples/apps/create.md @@ -0,0 +1,32 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with + +const apps = new sdk.Apps(client); + +const result = await apps.create({ + appId: '', + name: '', + redirectUris: [], + description: '', // optional + clientUri: 'https://example.com', // optional + logoUri: 'https://example.com', // optional + privacyPolicyUrl: 'https://example.com', // optional + termsUrl: 'https://example.com', // optional + contacts: [], // optional + tagline: '', // optional + tags: [], // optional + images: [], // optional + supportUrl: 'https://example.com', // optional + dataDeletionUrl: 'https://example.com', // optional + postLogoutRedirectUris: [], // optional + enabled: false, // optional + type: 'public', // optional + deviceFlow: false, // optional + teamId: '' // optional +}); +``` diff --git a/docs/examples/apps/delete-key.md b/docs/examples/apps/delete-key.md new file mode 100644 index 0000000..f4f0bb5 --- /dev/null +++ b/docs/examples/apps/delete-key.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 + .setSession(''); // The user session to authenticate with + +const apps = new sdk.Apps(client); + +const result = await apps.deleteKey({ + appId: '', + keyId: '' +}); +``` diff --git a/docs/examples/apps/delete-secret.md b/docs/examples/apps/delete-secret.md new file mode 100644 index 0000000..eeb1e43 --- /dev/null +++ b/docs/examples/apps/delete-secret.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 + .setSession(''); // The user session to authenticate with + +const apps = new sdk.Apps(client); + +const result = await apps.deleteSecret({ + appId: '', + secretId: '' +}); +``` diff --git a/docs/examples/apps/delete-tokens.md b/docs/examples/apps/delete-tokens.md new file mode 100644 index 0000000..757af7d --- /dev/null +++ b/docs/examples/apps/delete-tokens.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 + .setSession(''); // The user session to authenticate with + +const apps = new sdk.Apps(client); + +const result = await apps.deleteTokens({ + appId: '' +}); +``` diff --git a/docs/examples/apps/delete.md b/docs/examples/apps/delete.md new file mode 100644 index 0000000..fd9138c --- /dev/null +++ b/docs/examples/apps/delete.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 + .setSession(''); // The user session to authenticate with + +const apps = new sdk.Apps(client); + +const result = await apps.delete({ + appId: '' +}); +``` diff --git a/docs/examples/apps/get-installation.md b/docs/examples/apps/get-installation.md new file mode 100644 index 0000000..eb483b2 --- /dev/null +++ b/docs/examples/apps/get-installation.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 apps = new sdk.Apps(client); + +const result = await apps.getInstallation({ + appId: '', + installationId: '' +}); +``` diff --git a/docs/examples/apps/get-key.md b/docs/examples/apps/get-key.md new file mode 100644 index 0000000..afc83cc --- /dev/null +++ b/docs/examples/apps/get-key.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 + .setSession(''); // The user session to authenticate with + +const apps = new sdk.Apps(client); + +const result = await apps.getKey({ + appId: '', + keyId: '' +}); +``` diff --git a/docs/examples/apps/get-secret.md b/docs/examples/apps/get-secret.md new file mode 100644 index 0000000..4d6a0ec --- /dev/null +++ b/docs/examples/apps/get-secret.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 + .setSession(''); // The user session to authenticate with + +const apps = new sdk.Apps(client); + +const result = await apps.getSecret({ + appId: '', + secretId: '' +}); +``` diff --git a/docs/examples/apps/get.md b/docs/examples/apps/get.md new file mode 100644 index 0000000..660c4f4 --- /dev/null +++ b/docs/examples/apps/get.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 + .setSession(''); // The user session to authenticate with + +const apps = new sdk.Apps(client); + +const result = await apps.get({ + appId: '' +}); +``` diff --git a/docs/examples/apps/list-installation-scopes.md b/docs/examples/apps/list-installation-scopes.md new file mode 100644 index 0000000..299d7b7 --- /dev/null +++ b/docs/examples/apps/list-installation-scopes.md @@ -0,0 +1,12 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with + +const apps = new sdk.Apps(client); + +const result = await apps.listInstallationScopes(); +``` diff --git a/docs/examples/apps/list-installations.md b/docs/examples/apps/list-installations.md new file mode 100644 index 0000000..e410f66 --- /dev/null +++ b/docs/examples/apps/list-installations.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 apps = new sdk.Apps(client); + +const result = await apps.listInstallations({ + appId: '', + queries: [], // optional + total: false // optional +}); +``` diff --git a/docs/examples/apps/list-keys.md b/docs/examples/apps/list-keys.md new file mode 100644 index 0000000..3a2198f --- /dev/null +++ b/docs/examples/apps/list-keys.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 + .setSession(''); // The user session to authenticate with + +const apps = new sdk.Apps(client); + +const result = await apps.listKeys({ + appId: '', + queries: [], // optional + total: false // optional +}); +``` diff --git a/docs/examples/apps/list-o-auth-2-scopes.md b/docs/examples/apps/list-o-auth-2-scopes.md new file mode 100644 index 0000000..6f92539 --- /dev/null +++ b/docs/examples/apps/list-o-auth-2-scopes.md @@ -0,0 +1,12 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with + +const apps = new sdk.Apps(client); + +const result = await apps.listOAuth2Scopes(); +``` diff --git a/docs/examples/apps/list-secrets.md b/docs/examples/apps/list-secrets.md new file mode 100644 index 0000000..d1155a5 --- /dev/null +++ b/docs/examples/apps/list-secrets.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 + .setSession(''); // The user session to authenticate with + +const apps = new sdk.Apps(client); + +const result = await apps.listSecrets({ + appId: '', + queries: [], // optional + total: false // optional +}); +``` diff --git a/docs/examples/apps/list.md b/docs/examples/apps/list.md new file mode 100644 index 0000000..d594293 --- /dev/null +++ b/docs/examples/apps/list.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 + .setSession(''); // The user session to authenticate with + +const apps = new sdk.Apps(client); + +const result = await apps.list({ + queries: [], // optional + total: false // optional +}); +``` diff --git a/docs/examples/apps/update-labels.md b/docs/examples/apps/update-labels.md new file mode 100644 index 0000000..67a98fc --- /dev/null +++ b/docs/examples/apps/update-labels.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 apps = new sdk.Apps(client); + +const result = await apps.updateLabels({ + appId: '', + labels: [] +}); +``` diff --git a/docs/examples/apps/update-team.md b/docs/examples/apps/update-team.md new file mode 100644 index 0000000..65828dc --- /dev/null +++ b/docs/examples/apps/update-team.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 + .setSession(''); // The user session to authenticate with + +const apps = new sdk.Apps(client); + +const result = await apps.updateTeam({ + appId: '', + teamId: '' +}); +``` diff --git a/docs/examples/apps/update.md b/docs/examples/apps/update.md new file mode 100644 index 0000000..2ac2e58 --- /dev/null +++ b/docs/examples/apps/update.md @@ -0,0 +1,33 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with + +const apps = new sdk.Apps(client); + +const result = await apps.update({ + appId: '', + name: '', + description: '', // optional + clientUri: 'https://example.com', // optional + logoUri: 'https://example.com', // optional + privacyPolicyUrl: 'https://example.com', // optional + termsUrl: 'https://example.com', // optional + contacts: [], // optional + tagline: '', // optional + tags: [], // optional + images: [], // optional + supportUrl: 'https://example.com', // optional + dataDeletionUrl: 'https://example.com', // optional + enabled: false, // optional + redirectUris: [], // optional + postLogoutRedirectUris: [], // optional + type: 'public', // optional + deviceFlow: false, // optional + installationScopes: [], // optional + installationRedirectUrl: 'https://example.com' // optional +}); +``` diff --git a/docs/examples/backups/create-restoration.md b/docs/examples/backups/create-restoration.md index 6a8096a..f41a234 100644 --- a/docs/examples/backups/create-restoration.md +++ b/docs/examples/backups/create-restoration.md @@ -12,7 +12,6 @@ const result = await backups.createRestoration({ archiveId: '', services: [sdk.BackupServices.Databases], newResourceId: '', // optional - newResourceName: '', // optional - newSpecification: 'serverless' // optional + newResourceName: '' // optional }); ``` diff --git a/docs/examples/oauth2/approve.md b/docs/examples/oauth2/approve.md new file mode 100644 index 0000000..64f473b --- /dev/null +++ b/docs/examples/oauth2/approve.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 + .setSession('') // The user session to authenticate with + .setProject(''); // Your project ID + +const oauth2 = new sdk.Oauth2(client); + +const result = await oauth2.approve({ + grantId: '', + authorizationDetails: '', // optional + scope: '' // optional +}); +``` diff --git a/docs/examples/oauth2/authorize-post.md b/docs/examples/oauth2/authorize-post.md new file mode 100644 index 0000000..9d9317e --- /dev/null +++ b/docs/examples/oauth2/authorize-post.md @@ -0,0 +1,27 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setSession('') // The user session to authenticate with + .setProject(''); // Your project ID + +const oauth2 = new sdk.Oauth2(client); + +const result = await oauth2.authorizePost({ + clientId: '', // optional + redirectUri: 'https://example.com', // optional + responseType: '', // optional + scope: '', // optional + state: '', // optional + nonce: '', // optional + codeChallenge: '', // optional + codeChallengeMethod: 's256', // optional + prompt: '', // optional + maxAge: 0, // optional + authorizationDetails: '', // optional + resource: '', // optional + audience: '', // optional + requestUri: '' // optional +}); +``` diff --git a/docs/examples/oauth2/authorize.md b/docs/examples/oauth2/authorize.md new file mode 100644 index 0000000..10b6f61 --- /dev/null +++ b/docs/examples/oauth2/authorize.md @@ -0,0 +1,27 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setSession('') // The user session to authenticate with + .setProject(''); // Your project ID + +const oauth2 = new sdk.Oauth2(client); + +const result = await oauth2.authorize({ + clientId: '', // optional + redirectUri: 'https://example.com', // optional + responseType: '', // optional + scope: '', // optional + state: '', // optional + nonce: '', // optional + codeChallenge: '', // optional + codeChallengeMethod: 's256', // optional + prompt: '', // optional + maxAge: 0, // optional + authorizationDetails: '', // optional + resource: '', // optional + audience: '', // optional + requestUri: '' // optional +}); +``` diff --git a/docs/examples/oauth2/create-device-authorization.md b/docs/examples/oauth2/create-device-authorization.md new file mode 100644 index 0000000..19710c7 --- /dev/null +++ b/docs/examples/oauth2/create-device-authorization.md @@ -0,0 +1,18 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setSession('') // The user session to authenticate with + .setProject(''); // Your project ID + +const oauth2 = new sdk.Oauth2(client); + +const result = await oauth2.createDeviceAuthorization({ + clientId: '', // optional + scope: '', // optional + authorizationDetails: '', // optional + resource: '', // optional + audience: '' // optional +}); +``` diff --git a/docs/examples/oauth2/create-grant.md b/docs/examples/oauth2/create-grant.md new file mode 100644 index 0000000..0f644ee --- /dev/null +++ b/docs/examples/oauth2/create-grant.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 + .setSession('') // The user session to authenticate with + .setProject(''); // Your project ID + +const oauth2 = new sdk.Oauth2(client); + +const result = await oauth2.createGrant({ + userCode: '' +}); +``` diff --git a/docs/examples/oauth2/create-par.md b/docs/examples/oauth2/create-par.md new file mode 100644 index 0000000..70623e9 --- /dev/null +++ b/docs/examples/oauth2/create-par.md @@ -0,0 +1,26 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setSession('') // The user session to authenticate with + .setProject(''); // Your project ID + +const oauth2 = new sdk.Oauth2(client); + +const result = await oauth2.createPAR({ + clientId: '', + redirectUri: 'https://example.com', + responseType: 'code', + scope: '', // optional + state: '', // optional + nonce: '', // optional + codeChallenge: '', // optional + codeChallengeMethod: 's256', // optional + prompt: '', // optional + maxAge: 0, // optional + authorizationDetails: '', // optional + resource: '', // optional + audience: '' // optional +}); +``` diff --git a/docs/examples/oauth2/create-token.md b/docs/examples/oauth2/create-token.md new file mode 100644 index 0000000..e27883d --- /dev/null +++ b/docs/examples/oauth2/create-token.md @@ -0,0 +1,23 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setSession('') // The user session to authenticate with + .setProject(''); // Your project ID + +const oauth2 = new sdk.Oauth2(client); + +const result = await oauth2.createToken({ + grantType: '', + code: '', // optional + refreshToken: '', // optional + deviceCode: '', // optional + clientId: '', // optional + clientSecret: '', // optional + codeVerifier: '', // optional + redirectUri: 'https://example.com', // optional + resource: '', // optional + audience: '' // optional +}); +``` diff --git a/docs/examples/oauth2/get-grant.md b/docs/examples/oauth2/get-grant.md new file mode 100644 index 0000000..b619812 --- /dev/null +++ b/docs/examples/oauth2/get-grant.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 + .setSession('') // The user session to authenticate with + .setProject(''); // Your project ID + +const oauth2 = new sdk.Oauth2(client); + +const result = await oauth2.getGrant({ + grantId: '' +}); +``` diff --git a/docs/examples/oauth2/list-organizations.md b/docs/examples/oauth2/list-organizations.md new file mode 100644 index 0000000..b9503c2 --- /dev/null +++ b/docs/examples/oauth2/list-organizations.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 + .setSession('') // The user session to authenticate with + .setProject(''); // Your project ID + +const oauth2 = new sdk.Oauth2(client); + +const result = await oauth2.listOrganizations({ + limit: 1, // optional + offset: 0, // optional + search: '' // optional +}); +``` diff --git a/docs/examples/oauth2/list-projects.md b/docs/examples/oauth2/list-projects.md new file mode 100644 index 0000000..95e89e9 --- /dev/null +++ b/docs/examples/oauth2/list-projects.md @@ -0,0 +1,16 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setSession('') // The user session to authenticate with + .setProject(''); // Your project ID + +const oauth2 = new sdk.Oauth2(client); + +const result = await oauth2.listProjects({ + limit: 1, // optional + offset: 0, // optional + search: '' // optional +}); +``` diff --git a/docs/examples/oauth2/reject.md b/docs/examples/oauth2/reject.md new file mode 100644 index 0000000..5e5a8ff --- /dev/null +++ b/docs/examples/oauth2/reject.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 + .setSession('') // The user session to authenticate with + .setProject(''); // Your project ID + +const oauth2 = new sdk.Oauth2(client); + +const result = await oauth2.reject({ + grantId: '' +}); +``` diff --git a/docs/examples/oauth2/revoke.md b/docs/examples/oauth2/revoke.md new file mode 100644 index 0000000..e853410 --- /dev/null +++ b/docs/examples/oauth2/revoke.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 + .setSession('') // The user session to authenticate with + .setProject(''); // Your project ID + +const oauth2 = new sdk.Oauth2(client); + +const result = await oauth2.revoke({ + token: '', + tokenTypeHint: 'access_token', // optional + clientId: '', // optional + clientSecret: '' // optional +}); +``` diff --git a/docs/examples/organization/create-installation.md b/docs/examples/organization/create-installation.md new file mode 100644 index 0000000..56558fd --- /dev/null +++ b/docs/examples/organization/create-installation.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 + .setSession(''); // The user session to authenticate with + +const organization = new sdk.Organization(client); + +const result = await organization.createInstallation({ + appId: '', + authorizationDetails: '' // optional +}); +``` diff --git a/docs/examples/organization/delete-installation.md b/docs/examples/organization/delete-installation.md new file mode 100644 index 0000000..afc3be5 --- /dev/null +++ b/docs/examples/organization/delete-installation.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 + .setSession(''); // The user session to authenticate with + +const organization = new sdk.Organization(client); + +const result = await organization.deleteInstallation({ + installationId: '' +}); +``` diff --git a/docs/examples/organization/get-installation.md b/docs/examples/organization/get-installation.md new file mode 100644 index 0000000..e5ed10e --- /dev/null +++ b/docs/examples/organization/get-installation.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 + .setSession(''); // The user session to authenticate with + +const organization = new sdk.Organization(client); + +const result = await organization.getInstallation({ + installationId: '' +}); +``` diff --git a/docs/examples/organization/list-installations.md b/docs/examples/organization/list-installations.md new file mode 100644 index 0000000..91f6b66 --- /dev/null +++ b/docs/examples/organization/list-installations.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 + .setSession(''); // The user session to authenticate with + +const organization = new sdk.Organization(client); + +const result = await organization.listInstallations({ + queries: [], // optional + total: false // optional +}); +``` diff --git a/docs/examples/organization/update-installation.md b/docs/examples/organization/update-installation.md new file mode 100644 index 0000000..59ccac7 --- /dev/null +++ b/docs/examples/organization/update-installation.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 + .setSession(''); // The user session to authenticate with + +const organization = new sdk.Organization(client); + +const result = await organization.updateInstallation({ + installationId: '', + authorizationDetails: '' // optional +}); +``` diff --git a/docs/examples/project/update-o-auth-2-server.md b/docs/examples/project/update-o-auth-2-server.md index 0cd95ae..a34a5fc 100644 --- a/docs/examples/project/update-o-auth-2-server.md +++ b/docs/examples/project/update-o-auth-2-server.md @@ -17,6 +17,7 @@ const result = await project.updateOAuth2Server({ refreshTokenDuration: 60, // optional publicAccessTokenDuration: 60, // optional publicRefreshTokenDuration: 60, // optional + installationAccessTokenDuration: 60, // optional confidentialPkce: false, // optional verificationUrl: 'https://example.com', // optional userCodeLength: 6, // optional diff --git a/docs/examples/sites/get-deployment-download.md b/docs/examples/sites/get-deployment-download.md index 6e7ee4a..1d62d28 100644 --- a/docs/examples/sites/get-deployment-download.md +++ b/docs/examples/sites/get-deployment-download.md @@ -11,6 +11,7 @@ const sites = new sdk.Sites(client); const result = await sites.getDeploymentDownload({ siteId: '', deploymentId: '', - type: sdk.DeploymentDownloadType.Source // optional + type: sdk.DeploymentDownloadType.Source, // optional + token: '' // optional }); ``` diff --git a/docs/examples/tablesdb/create-failover.md b/docs/examples/tablesdb/create-failover.md new file mode 100644 index 0000000..0ad6437 --- /dev/null +++ b/docs/examples/tablesdb/create-failover.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.createFailover({ + databaseId: '', + targetReplicaId: '' // optional +}); +``` diff --git a/docs/examples/tablesdb/create.md b/docs/examples/tablesdb/create.md index 280db02..27bf661 100644 --- a/docs/examples/tablesdb/create.md +++ b/docs/examples/tablesdb/create.md @@ -12,6 +12,7 @@ const result = await tablesDB.create({ databaseId: '', name: '', enabled: false, // optional - specification: 'serverless' // optional + specification: 'serverless', // optional + replicas: 0 // optional }); ``` diff --git a/docs/examples/tablesdb/get-replicas.md b/docs/examples/tablesdb/get-replicas.md new file mode 100644 index 0000000..ab40296 --- /dev/null +++ b/docs/examples/tablesdb/get-replicas.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.getReplicas({ + databaseId: '' +}); +``` diff --git a/docs/examples/tablesdb/get-status.md b/docs/examples/tablesdb/get-status.md new file mode 100644 index 0000000..3b85821 --- /dev/null +++ b/docs/examples/tablesdb/get-status.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.getStatus({ + databaseId: '' +}); +``` diff --git a/docs/examples/tablesdb/list-specifications.md b/docs/examples/tablesdb/list-specifications.md new file mode 100644 index 0000000..c5e11ea --- /dev/null +++ b/docs/examples/tablesdb/list-specifications.md @@ -0,0 +1,12 @@ +```javascript +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('') // Your project ID + .setKey(''); // Your secret API key + +const tablesDB = new sdk.TablesDB(client); + +const result = await tablesDB.listSpecifications(); +``` diff --git a/docs/examples/tablesdb/update.md b/docs/examples/tablesdb/update.md index 7cbf6f5..034eb94 100644 --- a/docs/examples/tablesdb/update.md +++ b/docs/examples/tablesdb/update.md @@ -11,6 +11,7 @@ const tablesDB = new sdk.TablesDB(client); const result = await tablesDB.update({ databaseId: '', name: '', // optional - enabled: false // optional + enabled: false, // optional + replicas: 0 // optional }); ``` diff --git a/docs/examples/teams/create-installation.md b/docs/examples/teams/create-installation.md new file mode 100644 index 0000000..e84f9d8 --- /dev/null +++ b/docs/examples/teams/create-installation.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 + .setSession(''); // The user session to authenticate with + +const teams = new sdk.Teams(client); + +const result = await teams.createInstallation({ + teamId: '', + appId: '', + authorizationDetails: '' // optional +}); +``` diff --git a/docs/examples/teams/delete-installation.md b/docs/examples/teams/delete-installation.md new file mode 100644 index 0000000..d363129 --- /dev/null +++ b/docs/examples/teams/delete-installation.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 + .setSession(''); // The user session to authenticate with + +const teams = new sdk.Teams(client); + +const result = await teams.deleteInstallation({ + teamId: '', + installationId: '' +}); +``` diff --git a/docs/examples/teams/get-installation.md b/docs/examples/teams/get-installation.md new file mode 100644 index 0000000..47c71f3 --- /dev/null +++ b/docs/examples/teams/get-installation.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 + .setSession(''); // The user session to authenticate with + +const teams = new sdk.Teams(client); + +const result = await teams.getInstallation({ + teamId: '', + installationId: '' +}); +``` diff --git a/docs/examples/teams/list-installations.md b/docs/examples/teams/list-installations.md new file mode 100644 index 0000000..ecd4c42 --- /dev/null +++ b/docs/examples/teams/list-installations.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 + .setSession(''); // The user session to authenticate with + +const teams = new sdk.Teams(client); + +const result = await teams.listInstallations({ + teamId: '', + queries: [], // optional + total: false // optional +}); +``` diff --git a/docs/examples/teams/update-installation.md b/docs/examples/teams/update-installation.md new file mode 100644 index 0000000..f62bdfc --- /dev/null +++ b/docs/examples/teams/update-installation.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 + .setSession(''); // The user session to authenticate with + +const teams = new sdk.Teams(client); + +const result = await teams.updateInstallation({ + teamId: '', + installationId: '', + authorizationDetails: '' // optional +}); +``` diff --git a/package-lock.json b/package-lock.json index 6a10292..5e4de24 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "node-appwrite", - "version": "27.0.0", + "version": "27.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "node-appwrite", - "version": "27.0.0", + "version": "27.1.0", "license": "BSD-3-Clause", "dependencies": { "json-bigint": "1.0.0", diff --git a/package.json b/package.json index a791cae..898eb6b 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.0.0", + "version": "27.1.0", "license": "BSD-3-Clause", "main": "dist/index.js", "type": "commonjs", diff --git a/src/client.ts b/src/client.ts index 960612e..8051af7 100644 --- a/src/client.ts +++ b/src/client.ts @@ -73,7 +73,7 @@ class AppwriteException extends Error { } function getUserAgent() { - let ua = 'AppwriteNodeJSSDK/27.0.0'; + let ua = 'AppwriteNodeJSSDK/27.1.0'; // `process` is a global in Node.js, but not fully available in all runtimes. const platform: string[] = []; @@ -129,7 +129,7 @@ class Client { 'x-sdk-name': 'Node.js', 'x-sdk-platform': 'server', 'x-sdk-language': 'nodejs', - 'x-sdk-version': '27.0.0', + 'x-sdk-version': '27.1.0', 'user-agent' : getUserAgent(), 'X-Appwrite-Response-Format': '1.9.5', }; diff --git a/src/enums/database-status.ts b/src/enums/database-status.ts index 9e9cb51..8a01e3b 100644 --- a/src/enums/database-status.ts +++ b/src/enums/database-status.ts @@ -1,5 +1,16 @@ export enum DatabaseStatus { Provisioning = 'provisioning', Ready = 'ready', + Inactive = 'inactive', + Paused = 'paused', Failed = 'failed', + Deleting = 'deleting', + Deleted = 'deleted', + Restoring = 'restoring', + Scaling = 'scaling', + Upgrading = 'upgrading', + Migrating = 'migrating', + Pausing = 'pausing', + Resuming = 'resuming', + Failingover = 'failing-over', } \ No newline at end of file diff --git a/src/enums/database-type.ts b/src/enums/database-type.ts index 8ccd969..b39f921 100644 --- a/src/enums/database-type.ts +++ b/src/enums/database-type.ts @@ -3,4 +3,7 @@ export enum DatabaseType { Tablesdb = 'tablesdb', Documentsdb = 'documentsdb', Vectorsdb = 'vectorsdb', + Mysql = 'mysql', + Postgresql = 'postgresql', + Mongodb = 'mongodb', } \ No newline at end of file diff --git a/src/enums/organization-key-scopes.ts b/src/enums/organization-key-scopes.ts index a4ff3fb..eb18181 100644 --- a/src/enums/organization-key-scopes.ts +++ b/src/enums/organization-key-scopes.ts @@ -5,6 +5,8 @@ export enum OrganizationKeyScopes { DevKeysWrite = 'devKeys.write', OrganizationKeysRead = 'organization.keys.read', OrganizationKeysWrite = 'organization.keys.write', + OrganizationInstallationsRead = 'organization.installations.read', + OrganizationInstallationsWrite = 'organization.installations.write', OrganizationMembershipsRead = 'organization.memberships.read', OrganizationMembershipsWrite = 'organization.memberships.write', OrganizationRead = 'organization.read', diff --git a/src/enums/project-key-scopes.ts b/src/enums/project-key-scopes.ts index 7f97ba9..b0ac3cd 100644 --- a/src/enums/project-key-scopes.ts +++ b/src/enums/project-key-scopes.ts @@ -94,10 +94,13 @@ export enum ProjectKeyScopes { DedicatedDatabasesExecute = 'dedicatedDatabases.execute', DomainsRead = 'domains.read', DomainsWrite = 'domains.write', + WafRulesRead = 'wafRules.read', + WafRulesWrite = 'wafRules.write', EventsRead = 'events.read', AppsRead = 'apps.read', AppsWrite = 'apps.write', Oauth2Read = 'oauth2.read', Oauth2Write = 'oauth2.write', + Oauth2Introspect = 'oauth2.introspect', UsageRead = 'usage.read', } \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index efa797e..0226923 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,7 @@ export { Client, Query, AppwriteException } from './client'; export { Account } from './services/account'; export { Activities } from './services/activities'; +export { Apps } from './services/apps'; export { Avatars } from './services/avatars'; export { Backups } from './services/backups'; export { Databases } from './services/databases'; @@ -8,6 +9,7 @@ export { Functions } from './services/functions'; export { Graphql } from './services/graphql'; export { Locale } from './services/locale'; export { Messaging } from './services/messaging'; +export { Oauth2 } from './services/oauth-2'; export { Organization } from './services/organization'; export { Presences } from './services/presences'; export { Project } from './services/project'; diff --git a/src/models.ts b/src/models.ts index 5e56cfa..9100284 100644 --- a/src/models.ts +++ b/src/models.ts @@ -697,17 +697,29 @@ export namespace Models { */ type: DatabaseType; /** - * Database status. Possible values: `provisioning`, `ready` or `failed` + * Dedicated database lifecycle status. Null when the database has no valid dedicated backing. */ 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. + */ + engine?: string; + /** + * Compute specification identifier of the dedicated backing, e.g. s-2vcpu-2gb. Null when the database has no dedicated backing. + */ + specification?: string; + /** + * Number of secondary high availability replicas, excluding the primary. Null when backing configuration is unavailable. + */ + replicas?: number; /** * Database backup policies. */ - policies: BackupPolicy[]; + policies?: BackupPolicy[]; /** * Database backup archives. */ - archives: BackupArchive[]; + archives?: BackupArchive[]; } /** @@ -4311,6 +4323,10 @@ export namespace Models { * Last time the project was accessed via console. Used with plan's projectInactivityDays to determine if project is paused. */ consoleAccessedAt: string; + /** + * Whether WAF enforcement is enabled for the project. + */ + wafEnabled: boolean; /** * Billing limits reached */ @@ -4351,6 +4367,10 @@ export namespace Models { * OAuth2 server refresh token duration in seconds for public clients (SPAs, mobile, native) */ oAuth2ServerPublicRefreshTokenDuration?: number; + /** + * OAuth2 server access token duration in seconds for app installation access tokens + */ + oAuth2ServerInstallationAccessTokenDuration?: number; /** * When enabled, PKCE is required for confidential clients (server-side flows using client_secret). PKCE is always required for public clients regardless of this setting. */ @@ -6755,6 +6775,42 @@ export namespace Models { * Location. */ country: string; + /** + * Continent code. + */ + continentCode: string; + /** + * City name. + */ + city: string; + /** + * Region/state chain. + */ + subdivisions: string; + /** + * Internet service provider. + */ + isp: string; + /** + * Autonomous System Number (ASN). + */ + autonomousSystemNumber: string; + /** + * Organization that owns the ASN. + */ + autonomousSystemOrganization: string; + /** + * Connection type (e.g. cable, cellular, corporate). + */ + connectionType: string; + /** + * User type (e.g. residential, business, hosting). + */ + connectionUsageType: string; + /** + * Registered organization of the IP. + */ + connectionOrganization: string; /** * Log creation date in ISO 8601 format. */ @@ -6771,6 +6827,14 @@ export namespace Models { * Hostname. */ hostname: string; + /** + * Name of the SDK that triggered the event. + */ + sdk: string; + /** + * Version of the SDK that triggered the event. + */ + sdkVersion: string; } /** @@ -6947,6 +7011,10 @@ export namespace Models { * Webhooks */ webhooks: number; + /** + * Maximum WAF rules per project + */ + wafRules: number; /** * Projects */ @@ -7389,6 +7457,286 @@ export namespace Models { billingPlan: string; } + /** + * DedicatedDatabase + */ + export type DedicatedDatabase = { + /** + * Dedicated database ID. + */ + $id: string; + /** + * Database creation time in ISO 8601 format. + */ + $createdAt: string; + /** + * Database update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Project ID that owns this database. + */ + projectId: string; + /** + * Database display name. + */ + name: string; + /** + * Product API that owns this database: tablesdb, documentsdb, vectorsdb, mysql, postgresql, or mongodb. + */ + api: string; + /** + * Database engine: postgresql, mysql, mariadb, or mongodb. + */ + engine: string; + /** + * Database engine version. + */ + version: string; + /** + * Specification identifier. + */ + specification: string; + /** + * Database backend provider. Possible values: prisma, edge. + */ + backend: string; + /** + * Database hostname for connections. + */ + hostname: string; + /** + * Database port for connections. + */ + connectionPort: number; + /** + * Database username for connections. + */ + connectionUser: string; + /** + * Database password for connections. + */ + connectionPassword: string; + /** + * Full database connection string (URI format). + */ + connectionString: string; + /** + * Whether SSL/TLS is required for client connections. + */ + ssl: boolean; + /** + * Database status. Possible values: provisioning, ready, inactive, paused, failed, deleted, restoring, scaling. + */ + status: string; + /** + * Container status for lifecycle-managed database runtimes: active or inactive. + */ + containerStatus: string; + /** + * Last activity timestamp in ISO 8601 format. + */ + lastAccessedAt?: string; + /** + * Display-only timestamp when the database is expected to be considered idle (ISO 8601 format). Derived from last activity; lifecycle transitions are driven by lifecycleState. + */ + idleUntil?: string; + /** + * Idle-lifecycle state of the database. Possible values: active, warm, cold, hibernated. + */ + lifecycleState: string; + /** + * Minutes of inactivity before container scales to zero. + */ + idleTimeoutMinutes: number; + /** + * CPU allocated in millicores. + */ + cpu: number; + /** + * Memory allocated in MB. + */ + memory: number; + /** + * Storage allocated in GB. + */ + storage: number; + /** + * Storage class. Currently always 'ssd'; DigitalOcean exposes a single block-storage class. + */ + storageClass: string; + /** + * Maximum storage allowed in GB. 0 means use system default. + */ + storageMaxGb: number; + /** + * Kubernetes node pool where the database is scheduled. + */ + nodePool: string; + /** + * Number of high availability replicas. High availability is enabled when greater than 0. + */ + replicas: number; + /** + * Replication sync mode: async, sync, or quorum. + */ + syncMode: string; + /** + * Number of cross-region replicas. Cross-region availability is enabled when greater than 0. + */ + crossRegionReplicas: number; + /** + * Maximum concurrent connections. + */ + networkMaxConnections: number; + /** + * Connection idle timeout in seconds. + */ + networkIdleTimeoutSeconds: number; + /** + * IP addresses/CIDR ranges allowed to connect. + */ + networkIPAllowlist: string[]; + /** + * Whether automatic backups are enabled. + */ + backupEnabled: boolean; + /** + * Whether point-in-time recovery is enabled. + */ + pitr: boolean; + /** + * Number of days to retain PITR data. + */ + pitrRetentionDays: number; + /** + * Whether automatic storage expansion is enabled. + */ + storageAutoscaling: boolean; + /** + * Storage usage percentage that triggers automatic expansion. + */ + storageAutoscalingThresholdPercent: number; + /** + * Maximum storage size in GB for autoscaling. 0 means no limit. + */ + storageAutoscalingMaxGb: number; + /** + * Day of the week for the maintenance window. Possible values: sun, mon, tue, wed, thu, fri, sat. + */ + maintenanceWindowDay: string; + /** + * Hour in UTC (0-23) when the maintenance window starts. + */ + maintenanceWindowHourUtc: number; + /** + * Whether metrics collection is enabled. + */ + metricsEnabled: boolean; + /** + * Whether the SQL API sidecar is enabled for this database. + */ + sqlApiEnabled: boolean; + /** + * Statement types accepted by the SQL API. Defaults to read/write DML only; DDL/DCL types (CREATE, ALTER, DROP, TRUNCATE, GRANT, REVOKE) are opt-in per database. Allowed values: SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, TRUNCATE, GRANT, REVOKE. + */ + sqlApiAllowedStatements: string[]; + /** + * Maximum rows returned per SQL API execution. Results larger than this are truncated. + */ + sqlApiMaxRows: number; + /** + * Maximum serialised SQL API result payload in bytes. Results larger than this are truncated. + */ + sqlApiMaxBytes: number; + /** + * Maximum server-side SQL API execution time in seconds before the query is cancelled. + */ + sqlApiTimeoutSeconds: number; + /** + * Error message if status is failed. + */ + error: string; + } + + /** + * Status + */ + export type DatabaseStatus = { + /** + * Overall health status: healthy, degraded, or unhealthy. + */ + health: string; + /** + * Whether the database is ready to accept connections. + */ + ready: boolean; + /** + * Database engine: postgresql, mysql, mariadb, or mongodb. + */ + engine: string; + /** + * Database engine version. + */ + version: string; + /** + * Database uptime in seconds. + */ + uptime: number; + /** + * Connection statistics. + */ + connections: DatabaseStatusConnections; + /** + * List of database replicas and their status. + */ + replicas: DatabaseStatusReplica[]; + /** + * Storage volume information. + */ + volumes: DatabaseStatusVolume[]; + } + + /** + * Member + */ + export type DedicatedDatabaseMember = { + /** + * Member identifier. + */ + $id: string; + /** + * Member role. Possible values: primary (accepts reads and writes), replica (read-only follower). + */ + 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. + */ + status: string; + /** + * Replication lag in seconds. + */ + lagSeconds: number; + } + + /** + * Replicas + */ + export type DedicatedDatabaseReplicas = { + /** + * Number of configured replicas. Zero means high availability is disabled. + */ + replicas: number; + /** + * Replication sync mode. Possible values: async (asynchronous, fastest), sync (synchronous, strong consistency), quorum (quorum-based, majority of replicas must confirm). + */ + syncMode: string; + /** + * Per-pod statuses for the primary and every replica. + */ + members: DedicatedDatabaseMember[]; + } + /** * Organization */ @@ -7738,99 +8086,897 @@ export namespace Models { } /** - * usageBillingPlan + * Specification */ - export type UsageBillingPlan = { - /** - * Bandwidth additional resources - */ - bandwidth: AdditionalResource; - /** - * Executions additional resources - */ - executions: AdditionalResource; + export type DedicatedDatabaseSpecification = { /** - * Member additional resources + * Specification slug. Use this value when creating a dedicated database. */ - member: AdditionalResource; + slug: string; /** - * Realtime additional resources + * Human readable specification name. */ - realtime: AdditionalResource; + name: string; /** - * Realtime messages additional resources + * Monthly price of the specification in USD. */ - realtimeMessages: AdditionalResource; + price: number; /** - * Realtime bandwidth additional resources + * Allocated CPU in millicores. */ - realtimeBandwidth: AdditionalResource; + cpu: number; /** - * Storage additional resources + * Allocated memory in MB. */ - storage: AdditionalResource; + memory: number; /** - * User additional resources + * Maximum number of concurrent connections. */ - users: AdditionalResource; + maxConnections: number; /** - * GBHour additional resources + * Included storage in GB before overage charges apply. */ - GBHours: AdditionalResource; + includedStorage: number; /** - * Image transformation additional resources + * Included bandwidth in GB before overage charges apply. */ - imageTransformations: AdditionalResource; + includedBandwidth: number; /** - * Credits additional resources + * Whether the specification is available on the current plan. */ - credits: AdditionalResource; + enabled: boolean; } /** - * Activity event list + * SpecificationList */ - export type ActivityEventList = { + export type DedicatedDatabaseSpecificationList = { /** - * Total number of events that matched your query. + * List of dedicated database specifications. + */ + specifications: DedicatedDatabaseSpecification[]; + /** + * Total number of specifications. */ total: number; /** - * List of events. + * Overage and add-on pricing shared across all specifications. */ - events: ActivityEvent[]; + pricing: DedicatedDatabaseSpecificationPricing; } /** - * Backup archive list + * SpecificationPricing */ - export type BackupArchiveList = { + export type DedicatedDatabaseSpecificationPricing = { /** - * Total number of archives that matched your query. + * Price per GB of storage above the included amount, per month, in USD. */ - total: number; + storageOverageRate: number; /** - * List of archives. + * Price per GB of bandwidth above the included amount, per month, in USD. */ - archives: BackupArchive[]; + bandwidthOverageRate: number; + /** + * 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. + */ + pitrRate: number; } /** - * Backup policy list + * Connections */ - export type BackupPolicyList = { + export type DatabaseStatusConnections = { /** - * Total number of policies that matched your query. + * Current number of active connections. */ - total: number; + current: number; /** - * List of policies. + * Maximum allowed connections. */ - policies: BackupPolicy[]; + max: number; } /** - * Backup restoration list + * Replica + */ + export type DatabaseStatusReplica = { + /** + * StatefulSet pod index (0 = primary, 1+ = replicas). + */ + index: number; + /** + * Replica role: primary or replica. + */ + role: string; + /** + * Whether the replica is healthy. + */ + healthy: boolean; + /** + * Replication lag in seconds (null for primary). + */ + lagSeconds?: number; + } + + /** + * Volume + */ + export type DatabaseStatusVolume = { + /** + * Mount path of the volume. + */ + path: string; + /** + * Percentage of storage used. + */ + usedPercent: string; + /** + * Available storage space. + */ + available: string; + /** + * Whether the volume is mounted. + */ + mounted: boolean; + } + + /** + * usageBillingPlan + */ + export type UsageBillingPlan = { + /** + * Bandwidth additional resources + */ + bandwidth: AdditionalResource; + /** + * Executions additional resources + */ + executions: AdditionalResource; + /** + * Member additional resources + */ + member: AdditionalResource; + /** + * Realtime additional resources + */ + realtime: AdditionalResource; + /** + * Realtime messages additional resources + */ + realtimeMessages: AdditionalResource; + /** + * Realtime bandwidth additional resources + */ + realtimeBandwidth: AdditionalResource; + /** + * Storage additional resources + */ + storage: AdditionalResource; + /** + * User additional resources + */ + users: AdditionalResource; + /** + * GBHour additional resources + */ + GBHours: AdditionalResource; + /** + * Image transformation additional resources + */ + imageTransformations: AdditionalResource; + /** + * Credits additional resources + */ + credits: AdditionalResource; + } + + /** + * App + */ + export type App = { + /** + * App ID. + */ + $id: string; + /** + * App creation time in ISO 8601 format. + */ + $createdAt: string; + /** + * App update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Application name. + */ + name: string; + /** + * Application description shown to users during OAuth2 consent. + */ + description: string; + /** + * Application homepage URL shown to users during OAuth2 consent. + */ + clientUri: string; + /** + * Application logo URL shown to users during OAuth2 consent. + */ + logoUri: string; + /** + * Application privacy policy URL shown to users during OAuth2 consent. + */ + privacyPolicyUrl: string; + /** + * Application terms of service URL shown to users during OAuth2 consent. + */ + termsUrl: string; + /** + * Application support or security contact emails. + */ + contacts: string[]; + /** + * Application tagline shown to users during OAuth2 consent. + */ + tagline: string; + /** + * Application tags shown to users during OAuth2 consent. + */ + tags: string[]; + /** + * Application labels. Read-only for clients; only a server SDK using a project API key can update them. + */ + labels: string[]; + /** + * Application image URLs shown to users during OAuth2 consent. + */ + images: string[]; + /** + * Application support URL shown to users during OAuth2 consent. + */ + supportUrl: string; + /** + * Application data deletion URL shown to users during OAuth2 consent. + */ + dataDeletionUrl: string; + /** + * List of authorized redirect URIs. These URIs can be used to redirect users after they authenticate. + */ + redirectUris: string[]; + /** + * List of authorized post-logout redirect URIs for OpenID Connect RP-Initiated Logout. The logout endpoint only redirects users to URIs in this list after ending their session. + */ + postLogoutRedirectUris: string[]; + /** + * Whether the app is enabled or not. + */ + enabled: boolean; + /** + * OAuth2 client type. `public` for SPAs, mobile, and native apps that cannot keep a client secret (PKCE required); `confidential` for server-side clients that authenticate with a client secret. + */ + type: string; + /** + * Whether this client may use the OAuth2 Device Authorization Grant (RFC 8628). + */ + deviceFlow: boolean; + /** + * ID of team that owns the application, if owned by team. Otherwise, user ID will be used. + */ + teamId: string; + /** + * ID of user who owns the application, if owned by user. Otherwise, team ID will be used. + */ + userId: string; + /** + * Scopes the application requests when installed on a team. Organization-level and project-level scopes only. + */ + installationScopes: string[]; + /** + * URL users are redirected to after creating or updating an installation of this application. Empty for no redirect. + */ + installationRedirectUrl: string; + /** + * List of application secrets. + */ + secrets: AppSecret[]; + } + + /** + * AppSecret + */ + export type AppSecret = { + /** + * Secret ID. + */ + $id: string; + /** + * Secret creation time in ISO 8601 format. + */ + $createdAt: string; + /** + * Secret update time in ISO 8601 format. + */ + $updatedAt: string; + /** + * Application ID this secret belongs to. + */ + appId: string; + /** + * Always empty. The application client secret is returned only once, in the response of the createSecret method. + */ + secret: string; + /** + * Last few characters of the client secret, used to help identify it. + */ + hint: string; + /** + * ID of the user who created the secret. + */ + createdById: string; + /** + * Name of the user who created the secret. + */ + createdByName: string; + /** + * Time the secret was last used for authentication in ISO 8601 format. Null if never used. + */ + lastAccessedAt?: string; + } + + /** + * AppSecretPlaintext + */ + export type AppSecretPlaintext = { + /** + * Secret ID. + */ + $id: string; + /** + * Secret creation time in ISO 8601 format. + */ + $createdAt: string; + /** + * Secret update time in ISO 8601 format. + */ + $updatedAt: string; + /** + * Application ID this secret belongs to. + */ + appId: string; + /** + * Application client secret. Returned only when the secret is created; subsequent reads always return an empty value. + */ + secret: string; + /** + * Last few characters of the client secret, used to help identify it. + */ + hint: string; + /** + * ID of the user who created the secret. + */ + createdById: string; + /** + * Name of the user who created the secret. + */ + createdByName: string; + /** + * Time the secret was last used for authentication in ISO 8601 format. Null if never used. + */ + lastAccessedAt?: string; + } + + /** + * AppScope + */ + export type AppScope = { + /** + * Scope value as requested by apps. + */ + value: string; + /** + * Human-readable description of what the scope grants. + */ + description: string; + /** + * What the scope grants access to. One of `account`, `project`, or `organization`. Only `project` and `organization` scopes are installable. + */ + type: string; + /** + * Scope category, used to group scopes on consent and installation screens. + */ + category: string; + /** + * Whether the scope is deprecated. Deprecated scopes can still be requested but should not be offered for new grants. + */ + deprecated: boolean; + } + + /** + * AppInstallation + */ + export type AppInstallation = { + /** + * Installation ID. + */ + $id: string; + /** + * Installation creation time in ISO 8601 format. + */ + $createdAt: string; + /** + * Installation update time in ISO 8601 format. + */ + $updatedAt: string; + /** + * ID of the installed application. + */ + appId: string; + /** + * ID of the team the application is installed on. + */ + teamId: string; + /** + * Scopes granted to the application. Snapshot of the application's installation scopes taken when the installation was created or last updated. + */ + scopes: string[]; + /** + * Authorization details granted to the application. Rich authorization request (RFC 9396) style entries; the Appwrite Console stores authorized project IDs here. + */ + authorizationDetails: object; + /** + * ID of the user who created the installation. + */ + createdById: string; + /** + * Name of the user who created the installation. + */ + createdByName: string; + /** + * Time an access token was last issued for the installation in ISO 8601 format. Null if never used. + */ + lastAccessedAt?: string; + } + + /** + * AppKey + */ + export type AppKey = { + /** + * App key ID. + */ + $id: string; + /** + * App key creation time in ISO 8601 format. + */ + $createdAt: string; + /** + * App key update time in ISO 8601 format. + */ + $updatedAt: string; + /** + * Application ID this app key belongs to. + */ + appId: string; + /** + * App key secret. + */ + secret: string; + /** + * Last few characters of the app key secret, used to help identify it. + */ + hint: string; + /** + * ID of the user who created the app key. + */ + createdById: string; + /** + * Name of the user who created the app key. + */ + createdByName: string; + /** + * Time the app key was last used for authentication in ISO 8601 format. Null if never used. + */ + lastAccessedAt?: string; + } + + /** + * OAuth2 Authorize + */ + export type Oauth2Authorize = { + /** + * OAuth2 grant ID. Set when the user must give explicit consent; pass it to the approve or reject endpoint. Empty when a redirect URL is returned instead. + */ + grantId: string; + /** + * URL the end user should be redirected to when the flow can complete without consent. Empty when consent is still required. + */ + redirectUrl: string; + } + + /** + * OAuth2 Approve + */ + export type Oauth2Approve = { + /** + * URL the end user should be redirected to after the grant is approved, carrying the authorization `code` and/or `id_token` along with the original `state`. + */ + redirectUrl: string; + } + + /** + * OAuth2 Reject + */ + export type Oauth2Reject = { + /** + * URL the end user should be redirected to after the grant is rejected, carrying an `access_denied` error. + */ + redirectUrl: string; + } + + /** + * OAuth2 Grant + */ + export type Oauth2Grant = { + /** + * Grant ID. + */ + $id: string; + /** + * Grant creation time in ISO 8601 format. + */ + $createdAt: string; + /** + * Grant update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * ID of the user the grant belongs to. + */ + userId: string; + /** + * ID of the OAuth2 client (app) the grant was requested for. + */ + appId: string; + /** + * Requested OAuth2 scopes the user is being asked to consent to. + */ + scopes: string[]; + /** + * Requested RFC 8707 resource indicators the user is being asked to consent to. + */ + resources: string[]; + /** + * Requested authorization_details the user is being asked to consent to, as a JSON string. Each entry has a `type` plus project-defined fields. + */ + authorizationDetails: string; + /** + * OIDC prompt directive the consent screen should honor. Space-separated list of: login, consent, select_account. + */ + prompt: string; + /** + * Redirect URI the user will be sent to after the flow completes. + */ + redirectUri: string; + /** + * Unix timestamp of when the user last authenticated. + */ + authTime: number; + /** + * Grant expiration time in ISO 8601 format. + */ + expire: string; + } + + /** + * OAuth2 Device Authorization + */ + export type Oauth2DeviceAuthorization = { + /** + * Device verification code used by the client to poll the token endpoint. + */ + device_code: string; + /** + * Short code the end user enters on the verification page. + */ + user_code: string; + /** + * URL where the end user enters the user code. + */ + verification_uri: string; + /** + * Verification URL with the user code prefilled as a query parameter. + */ + verification_uri_complete: string; + /** + * Lifetime of the device code and user code in seconds. + */ + expires_in: number; + /** + * Minimum polling interval for the token endpoint in seconds. + */ + interval: number; + } + + /** + * OAuth2 PAR + */ + export type Oauth2PAR = { + /** + * Authorization request handle to pass to the authorize endpoint. + */ + request_uri: string; + /** + * Lifetime of the authorization request handle in seconds. + */ + expires_in: number; + } + + /** + * OAuth2 Token + */ + export type Oauth2Token = { + /** + * OAuth2 access token. + */ + access_token: string; + /** + * OAuth2 token type. + */ + token_type: string; + /** + * Access token lifetime in seconds. + */ + expires_in: number; + /** + * OAuth2 refresh token. + */ + refresh_token: string; + /** + * Space-separated scopes granted to the access token. + */ + scope: string; + /** + * Granted RFC 9396 authorization details as a JSON string. + */ + authorization_details?: string; + /** + * OpenID Connect ID token. Returned when the `openid` scope is granted. + */ + id_token?: string; + } + + /** + * OAuth2 Consent + */ + export type Oauth2Consent = { + /** + * Consent ID. + */ + $id: string; + /** + * Consent creation time in ISO 8601 format. + */ + $createdAt: string; + /** + * Consent update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * ID of the user the consent belongs to. + */ + userId: string; + /** + * ID of the registered app the consent was given to. Empty for URL-form (CIMD) clients. + */ + appId: string; + /** + * Client ID metadata document URL of the client the consent was given to. Empty for registered apps. + */ + cimdUrl: string; + /** + * OAuth2 scopes the user consented to. + */ + scopes: string[]; + /** + * RFC 8707 resource indicators the user consented to. + */ + resources: string[]; + /** + * Authorization details the user consented to, as a JSON string. Each entry has a `type` plus project-defined fields. + */ + authorizationDetails: string; + /** + * Consent expiration time in ISO 8601 format. Empty when the consent has no token-bound expiry yet. + */ + expire: string; + } + + /** + * OAuth2 Consent Token + */ + export type Oauth2ConsentToken = { + /** + * Token family ID. + */ + $id: string; + /** + * Token creation time in ISO 8601 format. + */ + $createdAt: string; + /** + * Token update date in ISO 8601 format. Refreshing the token family updates this. + */ + $updatedAt: string; + /** + * ID of the consent the token family was issued under. + */ + consentId: string; + /** + * ID of the user the token family belongs to. + */ + userId: string; + /** + * ID of the registered app the token family was issued to. Empty for URL-form (CIMD) clients. + */ + appId: string; + /** + * Client ID metadata document URL of the client the token family was issued to. Empty for registered apps. + */ + cimdUrl: string; + /** + * OAuth2 scopes granted on the token family. + */ + scopes: string[]; + /** + * RFC 8707 resource indicators granted on the token family. + */ + resources: string[]; + /** + * Authorization details granted on the token family, as a JSON string. Each entry has a `type` plus project-defined fields. + */ + authorizationDetails: string; + /** + * Expiration time of the current access token of this family in ISO 8601 format. + */ + expire: string; + } + + /** + * OAuth2 Project + */ + export type Oauth2Project = { + /** + * Project ID. + */ + $id: string; + /** + * Region ID the project is deployed in. + */ + region: string; + /** + * API endpoint of the region the project is deployed in. Empty when the region has no public hostname configured. + */ + endpoint: string; + } + + /** + * OAuth2 Organization + */ + export type Oauth2Organization = { + /** + * Organization ID. + */ + $id: string; + } + + /** + * OAuth2 accessible projects list + */ + export type Oauth2ProjectList = { + /** + * Total number of projects that matched your query. + */ + total: number; + /** + * List of projects. + */ + projects: Oauth2Project[]; + } + + /** + * OAuth2 accessible organizations list + */ + export type Oauth2OrganizationList = { + /** + * Total number of organizations that matched your query. + */ + total: number; + /** + * List of organizations. + */ + organizations: Oauth2Organization[]; + } + + /** + * OAuth2 consents list + */ + export type Oauth2ConsentList = { + /** + * Total number of consents that matched your query. + */ + total: number; + /** + * List of consents. + */ + consents: Oauth2Consent[]; + } + + /** + * OAuth2 consent tokens list + */ + export type Oauth2ConsentTokenList = { + /** + * Total number of tokens that matched your query. + */ + total: number; + /** + * List of tokens. + */ + tokens: Oauth2ConsentToken[]; + } + + /** + * Activity event list + */ + export type ActivityEventList = { + /** + * Total number of events that matched your query. + */ + total: number; + /** + * List of events. + */ + events: ActivityEvent[]; + } + + /** + * Backup archive list + */ + export type BackupArchiveList = { + /** + * Total number of archives that matched your query. + */ + total: number; + /** + * List of archives. + */ + archives: BackupArchive[]; + } + + /** + * Backup policy list + */ + export type BackupPolicyList = { + /** + * Total number of policies that matched your query. + */ + total: number; + /** + * List of policies. + */ + policies: BackupPolicy[]; + } + + /** + * Backup restoration list */ export type BackupRestorationList = { /** @@ -7842,4 +8988,74 @@ export namespace Models { */ restorations: BackupRestoration[]; } + + /** + * Apps list + */ + export type AppsList = { + /** + * Total number of apps that matched your query. + */ + total: number; + /** + * List of apps. + */ + apps: App[]; + } + + /** + * App secrets list + */ + export type AppSecretList = { + /** + * Total number of secrets that matched your query. + */ + total: number; + /** + * List of secrets. + */ + secrets: AppSecret[]; + } + + /** + * App scopes list + */ + export type AppScopeList = { + /** + * Total number of scopes that matched your query. + */ + total: number; + /** + * List of scopes. + */ + scopes: AppScope[]; + } + + /** + * App installations list + */ + export type AppInstallationList = { + /** + * Total number of installations that matched your query. + */ + total: number; + /** + * List of installations. + */ + installations: AppInstallation[]; + } + + /** + * App keys list + */ + export type AppKeyList = { + /** + * Total number of keys that matched your query. + */ + total: number; + /** + * List of keys. + */ + keys: AppKey[]; + } } diff --git a/src/services/account.ts b/src/services/account.ts index 57aadeb..3443e13 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -123,6 +123,365 @@ export class Account { ); } + /** + * Get a list of the OAuth2 consents the current user has given to third-party apps. + * + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + */ + listConsents(params?: { queries?: string[], total?: boolean }): Promise; + /** + * Get a list of the OAuth2 consents the current user has given to third-party apps. + * + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listConsents(queries?: string[], total?: boolean): Promise; + listConsents( + paramsOrFirst?: { queries?: string[], total?: boolean } | string[], + ...rest: [(boolean)?] + ): Promise { + let params: { queries?: string[], total?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { queries?: string[], total?: boolean }; + } else { + params = { + queries: paramsOrFirst as string[], + total: rest[0] as boolean + }; + } + + const queries = params.queries; + const total = params.total; + + + const apiPath = '/account/consents'; + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof total !== 'undefined') { + payload['total'] = total; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Get an OAuth2 consent the current user has given to a third-party app by its unique ID. + * + * @param {string} params.consentId - Consent unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + getConsent(params: { consentId: string }): Promise; + /** + * Get an OAuth2 consent the current user has given to a third-party app by its unique ID. + * + * @param {string} consentId - Consent unique ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getConsent(consentId: string): Promise; + getConsent( + paramsOrFirst: { consentId: string } | string + ): Promise { + let params: { consentId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { consentId: string }; + } else { + params = { + consentId: paramsOrFirst as string + }; + } + + const consentId = params.consentId; + + if (typeof consentId === 'undefined') { + throw new AppwriteException('Missing required parameter: "consentId"'); + } + + const apiPath = '/account/consents/{consentId}'.replace('{consentId}', encodeURIComponent(String(consentId))); + 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, + ); + } + + /** + * Delete an OAuth2 consent by its unique ID. All token families issued under the consent are revoked, and the app must ask for consent again to regain access. + * + * @param {string} params.consentId - Consent unique ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deleteConsent(params: { consentId: string }): Promise<{}>; + /** + * Delete an OAuth2 consent by its unique ID. All token families issued under the consent are revoked, and the app must ask for consent again to regain access. + * + * @param {string} consentId - Consent unique ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deleteConsent(consentId: string): Promise<{}>; + deleteConsent( + paramsOrFirst: { consentId: string } | string + ): Promise<{}> { + let params: { consentId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { consentId: string }; + } else { + params = { + consentId: paramsOrFirst as string + }; + } + + const consentId = params.consentId; + + if (typeof consentId === 'undefined') { + throw new AppwriteException('Missing required parameter: "consentId"'); + } + + const apiPath = '/account/consents/{consentId}'.replace('{consentId}', encodeURIComponent(String(consentId))); + 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, + ); + } + + /** + * Get a list of the token families issued under an OAuth2 consent. Each entry represents one authorized device or session; the token secrets themselves are never returned. + * + * @param {string} params.consentId - Consent 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. + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + */ + listConsentTokens(params: { consentId: string, queries?: string[], total?: boolean }): Promise; + /** + * Get a list of the token families issued under an OAuth2 consent. Each entry represents one authorized device or session; the token secrets themselves are never returned. + * + * @param {string} consentId - Consent 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. + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listConsentTokens(consentId: string, queries?: string[], total?: boolean): Promise; + listConsentTokens( + paramsOrFirst: { consentId: string, queries?: string[], total?: boolean } | string, + ...rest: [(string[])?, (boolean)?] + ): Promise { + let params: { consentId: string, queries?: string[], total?: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { consentId: string, queries?: string[], total?: boolean }; + } else { + params = { + consentId: paramsOrFirst as string, + queries: rest[0] as string[], + total: rest[1] as boolean + }; + } + + const consentId = params.consentId; + const queries = params.queries; + const total = params.total; + + if (typeof consentId === 'undefined') { + throw new AppwriteException('Missing required parameter: "consentId"'); + } + + const apiPath = '/account/consents/{consentId}/tokens'.replace('{consentId}', encodeURIComponent(String(consentId))); + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof total !== 'undefined') { + payload['total'] = total; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Get a token family issued under an OAuth2 consent by its unique ID. The token secrets themselves are never returned. + * + * @param {string} params.consentId - Consent unique ID. + * @param {string} params.tokenId - Token unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + getConsentToken(params: { consentId: string, tokenId: string }): Promise; + /** + * Get a token family issued under an OAuth2 consent by its unique ID. The token secrets themselves are never returned. + * + * @param {string} consentId - Consent unique ID. + * @param {string} tokenId - Token unique ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getConsentToken(consentId: string, tokenId: string): Promise; + getConsentToken( + paramsOrFirst: { consentId: string, tokenId: string } | string, + ...rest: [(string)?] + ): Promise { + let params: { consentId: string, tokenId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { consentId: string, tokenId: string }; + } else { + params = { + consentId: paramsOrFirst as string, + tokenId: rest[0] as string + }; + } + + const consentId = params.consentId; + const tokenId = params.tokenId; + + if (typeof consentId === 'undefined') { + throw new AppwriteException('Missing required parameter: "consentId"'); + } + if (typeof tokenId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tokenId"'); + } + + const apiPath = '/account/consents/{consentId}/tokens/{tokenId}'.replace('{consentId}', encodeURIComponent(String(consentId))).replace('{tokenId}', encodeURIComponent(String(tokenId))); + 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, + ); + } + + /** + * Delete a token family issued under an OAuth2 consent by its unique ID. The access and refresh tokens of the family stop working immediately; other token families and the consent itself are unaffected. + * + * @param {string} params.consentId - Consent unique ID. + * @param {string} params.tokenId - Token unique ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deleteConsentToken(params: { consentId: string, tokenId: string }): Promise<{}>; + /** + * Delete a token family issued under an OAuth2 consent by its unique ID. The access and refresh tokens of the family stop working immediately; other token families and the consent itself are unaffected. + * + * @param {string} consentId - Consent unique ID. + * @param {string} tokenId - Token unique ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deleteConsentToken(consentId: string, tokenId: string): Promise<{}>; + deleteConsentToken( + paramsOrFirst: { consentId: string, tokenId: string } | string, + ...rest: [(string)?] + ): Promise<{}> { + let params: { consentId: string, tokenId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { consentId: string, tokenId: string }; + } else { + params = { + consentId: paramsOrFirst as string, + tokenId: rest[0] as string + }; + } + + const consentId = params.consentId; + const tokenId = params.tokenId; + + if (typeof consentId === 'undefined') { + throw new AppwriteException('Missing required parameter: "consentId"'); + } + if (typeof tokenId === 'undefined') { + throw new AppwriteException('Missing required parameter: "tokenId"'); + } + + const apiPath = '/account/consents/{consentId}/tokens/{tokenId}'.replace('{consentId}', encodeURIComponent(String(consentId))).replace('{tokenId}', encodeURIComponent(String(tokenId))); + 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, + ); + } + /** * Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request. * This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password. diff --git a/src/services/apps.ts b/src/services/apps.ts new file mode 100644 index 0000000..bdee84f --- /dev/null +++ b/src/services/apps.ts @@ -0,0 +1,1476 @@ +import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; +import type { Models } from '../models'; + + + +export class Apps { + client: Client; + + constructor(client: Client) { + this.client = client; + } + + /** + * List applications. + * + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + */ + list(params?: { queries?: string[], total?: boolean }): Promise; + /** + * List applications. + * + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + list(queries?: string[], total?: boolean): Promise; + list( + paramsOrFirst?: { queries?: string[], total?: boolean } | string[], + ...rest: [(boolean)?] + ): Promise { + let params: { queries?: string[], total?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { queries?: string[], total?: boolean }; + } else { + params = { + queries: paramsOrFirst as string[], + total: rest[0] as boolean + }; + } + + const queries = params.queries; + const total = params.total; + + + const apiPath = '/apps'; + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof total !== 'undefined') { + payload['total'] = total; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Create a new application. + * + * @param {string} params.appId - Application ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} params.name - Application name. + * @param {string[]} params.redirectUris - Redirect URIs. Each must be an https URL, an http loopback URL (localhost, 127.0.0.1, [::1]), or a private-use scheme URI (e.g. com.example.app:/oauth), and must not contain a fragment. + * @param {string} params.description - Application description shown to users during OAuth2 consent. + * @param {string} params.clientUri - Application homepage URL shown to users during OAuth2 consent. + * @param {string} params.logoUri - Application logo URL shown to users during OAuth2 consent. + * @param {string} params.privacyPolicyUrl - Application privacy policy URL shown to users during OAuth2 consent. + * @param {string} params.termsUrl - Application terms of service URL shown to users during OAuth2 consent. + * @param {string[]} params.contacts - Application support or security contact emails. Maximum of 100 contacts are allowed. + * @param {string} params.tagline - Application tagline shown to users during OAuth2 consent. + * @param {string[]} params.tags - Application tags shown to users during OAuth2 consent. Maximum of 100 tags are allowed, each up to 64 characters long. + * @param {string[]} params.images - Application image URLs shown to users during OAuth2 consent. Maximum of 100 images are allowed. + * @param {string} params.supportUrl - Application support URL shown to users during OAuth2 consent. + * @param {string} params.dataDeletionUrl - Application data deletion URL shown to users during OAuth2 consent. + * @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 {boolean} params.enabled - Is application enabled? + * @param {string} params.type - OAuth2 client type. Use `public` for SPAs, mobile, and native apps that cannot keep a `client_secret` — PKCE is then required at the token endpoint. Use `confidential` for server-side clients that present a `client_secret`. Defaults to `confidential`. + * @param {boolean} params.deviceFlow - Allow this client to use the OAuth2 Device Authorization Grant (RFC 8628) for input-constrained devices such as TVs and CLIs. Defaults to false. + * @param {string} params.teamId - Team unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + create(params: { appId: string, name: string, redirectUris: string[], description?: string, clientUri?: string, logoUri?: string, privacyPolicyUrl?: string, termsUrl?: string, contacts?: string[], tagline?: string, tags?: string[], images?: string[], supportUrl?: string, dataDeletionUrl?: string, postLogoutRedirectUris?: string[], enabled?: boolean, type?: string, deviceFlow?: boolean, teamId?: string }): Promise; + /** + * Create a new application. + * + * @param {string} appId - Application ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} name - Application name. + * @param {string[]} redirectUris - Redirect URIs. Each must be an https URL, an http loopback URL (localhost, 127.0.0.1, [::1]), or a private-use scheme URI (e.g. com.example.app:/oauth), and must not contain a fragment. + * @param {string} description - Application description shown to users during OAuth2 consent. + * @param {string} clientUri - Application homepage URL shown to users during OAuth2 consent. + * @param {string} logoUri - Application logo URL shown to users during OAuth2 consent. + * @param {string} privacyPolicyUrl - Application privacy policy URL shown to users during OAuth2 consent. + * @param {string} termsUrl - Application terms of service URL shown to users during OAuth2 consent. + * @param {string[]} contacts - Application support or security contact emails. Maximum of 100 contacts are allowed. + * @param {string} tagline - Application tagline shown to users during OAuth2 consent. + * @param {string[]} tags - Application tags shown to users during OAuth2 consent. Maximum of 100 tags are allowed, each up to 64 characters long. + * @param {string[]} images - Application image URLs shown to users during OAuth2 consent. Maximum of 100 images are allowed. + * @param {string} supportUrl - Application support URL shown to users during OAuth2 consent. + * @param {string} dataDeletionUrl - Application data deletion URL shown to users during OAuth2 consent. + * @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 {boolean} enabled - Is application enabled? + * @param {string} type - OAuth2 client type. Use `public` for SPAs, mobile, and native apps that cannot keep a `client_secret` — PKCE is then required at the token endpoint. Use `confidential` for server-side clients that present a `client_secret`. Defaults to `confidential`. + * @param {boolean} deviceFlow - Allow this client to use the OAuth2 Device Authorization Grant (RFC 8628) for input-constrained devices such as TVs and CLIs. Defaults to false. + * @param {string} teamId - Team unique ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + create(appId: string, name: string, redirectUris: string[], description?: string, clientUri?: string, logoUri?: string, privacyPolicyUrl?: string, termsUrl?: string, contacts?: string[], tagline?: string, tags?: string[], images?: string[], supportUrl?: string, dataDeletionUrl?: string, postLogoutRedirectUris?: string[], enabled?: boolean, type?: string, deviceFlow?: boolean, teamId?: string): Promise; + create( + paramsOrFirst: { appId: string, name: string, redirectUris: string[], description?: string, clientUri?: string, logoUri?: string, privacyPolicyUrl?: string, termsUrl?: string, contacts?: string[], tagline?: string, tags?: string[], images?: string[], supportUrl?: string, dataDeletionUrl?: string, postLogoutRedirectUris?: string[], enabled?: boolean, type?: string, deviceFlow?: boolean, teamId?: string } | string, + ...rest: [(string)?, (string[])?, (string)?, (string)?, (string)?, (string)?, (string)?, (string[])?, (string)?, (string[])?, (string[])?, (string)?, (string)?, (string[])?, (boolean)?, (string)?, (boolean)?, (string)?] + ): Promise { + let params: { appId: string, name: string, redirectUris: string[], description?: string, clientUri?: string, logoUri?: string, privacyPolicyUrl?: string, termsUrl?: string, contacts?: string[], tagline?: string, tags?: string[], images?: string[], supportUrl?: string, dataDeletionUrl?: string, postLogoutRedirectUris?: string[], enabled?: boolean, type?: string, deviceFlow?: boolean, teamId?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { appId: string, name: string, redirectUris: string[], description?: string, clientUri?: string, logoUri?: string, privacyPolicyUrl?: string, termsUrl?: string, contacts?: string[], tagline?: string, tags?: string[], images?: string[], supportUrl?: string, dataDeletionUrl?: string, postLogoutRedirectUris?: string[], enabled?: boolean, type?: string, deviceFlow?: boolean, teamId?: string }; + } else { + params = { + appId: paramsOrFirst as string, + name: rest[0] as string, + redirectUris: rest[1] as string[], + description: rest[2] as string, + clientUri: rest[3] as string, + logoUri: rest[4] as string, + privacyPolicyUrl: rest[5] as string, + termsUrl: rest[6] as string, + contacts: rest[7] as string[], + tagline: rest[8] as string, + tags: rest[9] as string[], + images: rest[10] as string[], + supportUrl: rest[11] as string, + dataDeletionUrl: rest[12] as string, + postLogoutRedirectUris: rest[13] as string[], + enabled: rest[14] as boolean, + type: rest[15] as string, + deviceFlow: rest[16] as boolean, + teamId: rest[17] as string + }; + } + + const appId = params.appId; + const name = params.name; + const redirectUris = params.redirectUris; + const description = params.description; + const clientUri = params.clientUri; + const logoUri = params.logoUri; + const privacyPolicyUrl = params.privacyPolicyUrl; + const termsUrl = params.termsUrl; + const contacts = params.contacts; + const tagline = params.tagline; + const tags = params.tags; + const images = params.images; + const supportUrl = params.supportUrl; + const dataDeletionUrl = params.dataDeletionUrl; + const postLogoutRedirectUris = params.postLogoutRedirectUris; + const enabled = params.enabled; + const type = params.type; + const deviceFlow = params.deviceFlow; + const teamId = params.teamId; + + if (typeof appId === 'undefined') { + throw new AppwriteException('Missing required parameter: "appId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (typeof redirectUris === 'undefined') { + throw new AppwriteException('Missing required parameter: "redirectUris"'); + } + + const apiPath = '/apps'; + const payload: Payload = {}; + if (typeof appId !== 'undefined') { + payload['appId'] = appId; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof description !== 'undefined') { + payload['description'] = description; + } + if (typeof clientUri !== 'undefined') { + payload['clientUri'] = clientUri; + } + if (typeof logoUri !== 'undefined') { + payload['logoUri'] = logoUri; + } + if (typeof privacyPolicyUrl !== 'undefined') { + payload['privacyPolicyUrl'] = privacyPolicyUrl; + } + if (typeof termsUrl !== 'undefined') { + payload['termsUrl'] = termsUrl; + } + if (typeof contacts !== 'undefined') { + payload['contacts'] = contacts; + } + if (typeof tagline !== 'undefined') { + payload['tagline'] = tagline; + } + if (typeof tags !== 'undefined') { + payload['tags'] = tags; + } + if (typeof images !== 'undefined') { + payload['images'] = images; + } + if (typeof supportUrl !== 'undefined') { + payload['supportUrl'] = supportUrl; + } + if (typeof dataDeletionUrl !== 'undefined') { + payload['dataDeletionUrl'] = dataDeletionUrl; + } + if (typeof redirectUris !== 'undefined') { + payload['redirectUris'] = redirectUris; + } + if (typeof postLogoutRedirectUris !== 'undefined') { + payload['postLogoutRedirectUris'] = postLogoutRedirectUris; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + if (typeof type !== 'undefined') { + payload['type'] = type; + } + if (typeof deviceFlow !== 'undefined') { + payload['deviceFlow'] = deviceFlow; + } + if (typeof teamId !== 'undefined') { + payload['teamId'] = teamId; + } + const 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 scopes an application can request when installed on a team. + * + * @throws {AppwriteException} + * @returns {Promise} + */ + listInstallationScopes(): Promise { + + const apiPath = '/apps/scopes/installations'; + 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 scopes an application can request during the OAuth2 flow. + * + * @throws {AppwriteException} + * @returns {Promise} + */ + listOAuth2Scopes(): Promise { + + const apiPath = '/apps/scopes/oauth2'; + 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, + ); + } + + /** + * Get an application by its unique ID. + * + * @param {string} params.appId - Application unique ID or HTTPS client ID metadata document URL. + * @throws {AppwriteException} + * @returns {Promise} + */ + get(params: { appId: string }): Promise; + /** + * Get an application by its unique ID. + * + * @param {string} appId - Application unique ID or HTTPS client ID metadata document URL. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + get(appId: string): Promise; + get( + paramsOrFirst: { appId: string } | string + ): Promise { + let params: { appId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { appId: string }; + } else { + params = { + appId: paramsOrFirst as string + }; + } + + const appId = params.appId; + + if (typeof appId === 'undefined') { + throw new AppwriteException('Missing required parameter: "appId"'); + } + + const apiPath = '/apps/{appId}'.replace('{appId}', encodeURIComponent(String(appId))); + 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, + ); + } + + /** + * Update an application by its unique ID. + * + * @param {string} params.appId - Application unique ID. + * @param {string} params.name - Application name. + * @param {string} params.description - Application description shown to users during OAuth2 consent. + * @param {string} params.clientUri - Application homepage URL shown to users during OAuth2 consent. + * @param {string} params.logoUri - Application logo URL shown to users during OAuth2 consent. + * @param {string} params.privacyPolicyUrl - Application privacy policy URL shown to users during OAuth2 consent. + * @param {string} params.termsUrl - Application terms of service URL shown to users during OAuth2 consent. + * @param {string[]} params.contacts - Application support or security contact emails. Maximum of 100 contacts are allowed. + * @param {string} params.tagline - Application tagline shown to users during OAuth2 consent. + * @param {string[]} params.tags - Application tags shown to users during OAuth2 consent. Maximum of 100 tags are allowed, each up to 64 characters long. + * @param {string[]} params.images - Application image URLs shown to users during OAuth2 consent. Maximum of 100 images are allowed. + * @param {string} params.supportUrl - Application support URL shown to users during OAuth2 consent. + * @param {string} params.dataDeletionUrl - Application data deletion URL shown to users during OAuth2 consent. + * @param {boolean} params.enabled - Is application enabled? + * @param {string[]} params.redirectUris - Redirect URIs. Each must be an https URL, an http loopback URL (localhost, 127.0.0.1, [::1]), or a private-use scheme URI (e.g. com.example.app:/oauth), and must not contain a fragment. + * @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.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} + */ + update(params: { appId: string, name: string, description?: string, clientUri?: string, logoUri?: string, privacyPolicyUrl?: string, termsUrl?: string, contacts?: string[], tagline?: string, tags?: string[], images?: string[], supportUrl?: string, dataDeletionUrl?: string, enabled?: boolean, redirectUris?: string[], postLogoutRedirectUris?: string[], type?: string, deviceFlow?: boolean, installationScopes?: string[], installationRedirectUrl?: string }): Promise; + /** + * Update an application by its unique ID. + * + * @param {string} appId - Application unique ID. + * @param {string} name - Application name. + * @param {string} description - Application description shown to users during OAuth2 consent. + * @param {string} clientUri - Application homepage URL shown to users during OAuth2 consent. + * @param {string} logoUri - Application logo URL shown to users during OAuth2 consent. + * @param {string} privacyPolicyUrl - Application privacy policy URL shown to users during OAuth2 consent. + * @param {string} termsUrl - Application terms of service URL shown to users during OAuth2 consent. + * @param {string[]} contacts - Application support or security contact emails. Maximum of 100 contacts are allowed. + * @param {string} tagline - Application tagline shown to users during OAuth2 consent. + * @param {string[]} tags - Application tags shown to users during OAuth2 consent. Maximum of 100 tags are allowed, each up to 64 characters long. + * @param {string[]} images - Application image URLs shown to users during OAuth2 consent. Maximum of 100 images are allowed. + * @param {string} supportUrl - Application support URL shown to users during OAuth2 consent. + * @param {string} dataDeletionUrl - Application data deletion URL shown to users during OAuth2 consent. + * @param {boolean} enabled - Is application enabled? + * @param {string[]} redirectUris - Redirect URIs. Each must be an https URL, an http loopback URL (localhost, 127.0.0.1, [::1]), or a private-use scheme URI (e.g. com.example.app:/oauth), and must not contain a fragment. + * @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} 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} + * @deprecated Use the object parameter style method for a better developer experience. + */ + update(appId: string, name: string, description?: string, clientUri?: string, logoUri?: string, privacyPolicyUrl?: string, termsUrl?: string, contacts?: string[], tagline?: string, tags?: string[], images?: string[], supportUrl?: string, dataDeletionUrl?: string, enabled?: boolean, redirectUris?: string[], postLogoutRedirectUris?: string[], type?: string, deviceFlow?: boolean, installationScopes?: string[], installationRedirectUrl?: string): Promise; + update( + paramsOrFirst: { appId: string, name: string, description?: string, clientUri?: string, logoUri?: string, privacyPolicyUrl?: string, termsUrl?: string, contacts?: string[], tagline?: string, tags?: string[], images?: string[], supportUrl?: string, dataDeletionUrl?: string, enabled?: boolean, redirectUris?: string[], postLogoutRedirectUris?: string[], type?: string, deviceFlow?: boolean, installationScopes?: string[], installationRedirectUrl?: string } | string, + ...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string[])?, (string)?, (string[])?, (string[])?, (string)?, (string)?, (boolean)?, (string[])?, (string[])?, (string)?, (boolean)?, (string[])?, (string)?] + ): Promise { + let params: { appId: string, name: string, description?: string, clientUri?: string, logoUri?: string, privacyPolicyUrl?: string, termsUrl?: string, contacts?: string[], tagline?: string, tags?: string[], images?: string[], supportUrl?: string, dataDeletionUrl?: string, enabled?: boolean, redirectUris?: string[], postLogoutRedirectUris?: string[], type?: string, deviceFlow?: boolean, installationScopes?: string[], installationRedirectUrl?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { appId: string, name: string, description?: string, clientUri?: string, logoUri?: string, privacyPolicyUrl?: string, termsUrl?: string, contacts?: string[], tagline?: string, tags?: string[], images?: string[], supportUrl?: string, dataDeletionUrl?: string, enabled?: boolean, redirectUris?: string[], postLogoutRedirectUris?: string[], type?: string, deviceFlow?: boolean, installationScopes?: string[], installationRedirectUrl?: string }; + } else { + params = { + appId: paramsOrFirst as string, + name: rest[0] as string, + description: rest[1] as string, + clientUri: rest[2] as string, + logoUri: rest[3] as string, + privacyPolicyUrl: rest[4] as string, + termsUrl: rest[5] as string, + contacts: rest[6] as string[], + tagline: rest[7] as string, + tags: rest[8] as string[], + images: rest[9] as string[], + supportUrl: rest[10] as string, + dataDeletionUrl: rest[11] as string, + enabled: rest[12] as boolean, + redirectUris: rest[13] as string[], + postLogoutRedirectUris: rest[14] as string[], + type: rest[15] as string, + deviceFlow: rest[16] as boolean, + installationScopes: rest[17] as string[], + installationRedirectUrl: rest[18] as string + }; + } + + const appId = params.appId; + const name = params.name; + const description = params.description; + const clientUri = params.clientUri; + const logoUri = params.logoUri; + const privacyPolicyUrl = params.privacyPolicyUrl; + const termsUrl = params.termsUrl; + const contacts = params.contacts; + const tagline = params.tagline; + const tags = params.tags; + const images = params.images; + const supportUrl = params.supportUrl; + const dataDeletionUrl = params.dataDeletionUrl; + const enabled = params.enabled; + const redirectUris = params.redirectUris; + const postLogoutRedirectUris = params.postLogoutRedirectUris; + const type = params.type; + const deviceFlow = params.deviceFlow; + const installationScopes = params.installationScopes; + const installationRedirectUrl = params.installationRedirectUrl; + + if (typeof appId === 'undefined') { + throw new AppwriteException('Missing required parameter: "appId"'); + } + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + + const apiPath = '/apps/{appId}'.replace('{appId}', encodeURIComponent(String(appId))); + const payload: Payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof description !== 'undefined') { + payload['description'] = description; + } + if (typeof clientUri !== 'undefined') { + payload['clientUri'] = clientUri; + } + if (typeof logoUri !== 'undefined') { + payload['logoUri'] = logoUri; + } + if (typeof privacyPolicyUrl !== 'undefined') { + payload['privacyPolicyUrl'] = privacyPolicyUrl; + } + if (typeof termsUrl !== 'undefined') { + payload['termsUrl'] = termsUrl; + } + if (typeof contacts !== 'undefined') { + payload['contacts'] = contacts; + } + if (typeof tagline !== 'undefined') { + payload['tagline'] = tagline; + } + if (typeof tags !== 'undefined') { + payload['tags'] = tags; + } + if (typeof images !== 'undefined') { + payload['images'] = images; + } + if (typeof supportUrl !== 'undefined') { + payload['supportUrl'] = supportUrl; + } + if (typeof dataDeletionUrl !== 'undefined') { + payload['dataDeletionUrl'] = dataDeletionUrl; + } + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + if (typeof redirectUris !== 'undefined') { + payload['redirectUris'] = redirectUris; + } + if (typeof postLogoutRedirectUris !== 'undefined') { + payload['postLogoutRedirectUris'] = postLogoutRedirectUris; + } + if (typeof type !== 'undefined') { + payload['type'] = type; + } + if (typeof deviceFlow !== 'undefined') { + payload['deviceFlow'] = deviceFlow; + } + if (typeof installationScopes !== 'undefined') { + payload['installationScopes'] = installationScopes; + } + if (typeof installationRedirectUrl !== 'undefined') { + payload['installationRedirectUrl'] = installationRedirectUrl; + } + const 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( + 'put', + uri, + apiHeaders, + payload, + ); + } + + /** + * Delete an application by its unique ID. + * + * @param {string} params.appId - Application unique ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + delete(params: { appId: string }): Promise<{}>; + /** + * Delete an application by its unique ID. + * + * @param {string} appId - Application unique ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + delete(appId: string): Promise<{}>; + delete( + paramsOrFirst: { appId: string } | string + ): Promise<{}> { + let params: { appId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { appId: string }; + } else { + params = { + appId: paramsOrFirst as string + }; + } + + const appId = params.appId; + + if (typeof appId === 'undefined') { + throw new AppwriteException('Missing required parameter: "appId"'); + } + + const apiPath = '/apps/{appId}'.replace('{appId}', encodeURIComponent(String(appId))); + 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, + ); + } + + /** + * List installations of an application. Requires an app key sent in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header. + * + * @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. + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + */ + 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. + * + * @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. + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listInstallations(appId: string, queries?: string[], total?: boolean): Promise; + listInstallations( + paramsOrFirst: { appId: string, queries?: string[], total?: boolean } | string, + ...rest: [(string[])?, (boolean)?] + ): Promise { + let params: { appId: string, queries?: string[], total?: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { appId: string, queries?: string[], total?: boolean }; + } else { + params = { + appId: paramsOrFirst as string, + queries: rest[0] as string[], + total: rest[1] as boolean + }; + } + + const appId = params.appId; + const queries = params.queries; + const total = params.total; + + if (typeof appId === 'undefined') { + throw new AppwriteException('Missing required parameter: "appId"'); + } + + const apiPath = '/apps/{appId}/installations'.replace('{appId}', encodeURIComponent(String(appId))); + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof total !== 'undefined') { + payload['total'] = total; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * 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. + * + * @param {string} params.appId - Application unique ID. + * @param {string} params.installationId - Installation unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + 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. + * + * @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. + */ + getInstallation(appId: string, installationId: string): Promise; + getInstallation( + 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, + 'accept': 'application/json', + } + + return this.client.call( + 'get', + 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. 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. + * @throws {AppwriteException} + * @returns {Promise} + */ + 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. + * + * @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. + */ + createInstallationToken(appId: string, installationId: string): Promise; + createInstallationToken( + 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}/tokens'.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( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * List app keys for an application. + * + * @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. + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + */ + listKeys(params: { appId: string, queries?: string[], total?: boolean }): Promise; + /** + * List app keys for an application. + * + * @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. + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listKeys(appId: string, queries?: string[], total?: boolean): Promise; + listKeys( + paramsOrFirst: { appId: string, queries?: string[], total?: boolean } | string, + ...rest: [(string[])?, (boolean)?] + ): Promise { + let params: { appId: string, queries?: string[], total?: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { appId: string, queries?: string[], total?: boolean }; + } else { + params = { + appId: paramsOrFirst as string, + queries: rest[0] as string[], + total: rest[1] as boolean + }; + } + + const appId = params.appId; + const queries = params.queries; + const total = params.total; + + if (typeof appId === 'undefined') { + throw new AppwriteException('Missing required parameter: "appId"'); + } + + const apiPath = '/apps/{appId}/keys'.replace('{appId}', encodeURIComponent(String(appId))); + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof total !== 'undefined') { + payload['total'] = total; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Create a new app key for an application. App keys carry no scopes; send one in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header to list the application's installations and create installation access tokens. + * + * @param {string} params.appId - Application unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + createKey(params: { appId: string }): Promise; + /** + * Create a new app key for an application. App keys carry no scopes; send one in the `X-Appwrite-Key` header alongside the `X-Appwrite-App` header to list the application's installations and create installation access tokens. + * + * @param {string} appId - Application unique ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createKey(appId: string): Promise; + createKey( + paramsOrFirst: { appId: string } | string + ): Promise { + let params: { appId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { appId: string }; + } else { + params = { + appId: paramsOrFirst as string + }; + } + + const appId = params.appId; + + if (typeof appId === 'undefined') { + throw new AppwriteException('Missing required parameter: "appId"'); + } + + const apiPath = '/apps/{appId}/keys'.replace('{appId}', encodeURIComponent(String(appId))); + 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, + ); + } + + /** + * Get an app key by its unique ID. + * + * @param {string} params.appId - Application unique ID. + * @param {string} params.keyId - App key unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + getKey(params: { appId: string, keyId: string }): Promise; + /** + * Get an app key by its unique ID. + * + * @param {string} appId - Application unique ID. + * @param {string} keyId - App key unique ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getKey(appId: string, keyId: string): Promise; + getKey( + paramsOrFirst: { appId: string, keyId: string } | string, + ...rest: [(string)?] + ): Promise { + let params: { appId: string, keyId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { appId: string, keyId: string }; + } else { + params = { + appId: paramsOrFirst as string, + keyId: rest[0] as string + }; + } + + const appId = params.appId; + const keyId = params.keyId; + + if (typeof appId === 'undefined') { + throw new AppwriteException('Missing required parameter: "appId"'); + } + if (typeof keyId === 'undefined') { + throw new AppwriteException('Missing required parameter: "keyId"'); + } + + const apiPath = '/apps/{appId}/keys/{keyId}'.replace('{appId}', encodeURIComponent(String(appId))).replace('{keyId}', encodeURIComponent(String(keyId))); + 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, + ); + } + + /** + * Delete an app key by its unique ID. + * + * @param {string} params.appId - Application unique ID. + * @param {string} params.keyId - App key unique ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deleteKey(params: { appId: string, keyId: string }): Promise<{}>; + /** + * Delete an app key by its unique ID. + * + * @param {string} appId - Application unique ID. + * @param {string} keyId - App key unique ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deleteKey(appId: string, keyId: string): Promise<{}>; + deleteKey( + paramsOrFirst: { appId: string, keyId: string } | string, + ...rest: [(string)?] + ): Promise<{}> { + let params: { appId: string, keyId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { appId: string, keyId: string }; + } else { + params = { + appId: paramsOrFirst as string, + keyId: rest[0] as string + }; + } + + const appId = params.appId; + const keyId = params.keyId; + + if (typeof appId === 'undefined') { + throw new AppwriteException('Missing required parameter: "appId"'); + } + if (typeof keyId === 'undefined') { + throw new AppwriteException('Missing required parameter: "keyId"'); + } + + const apiPath = '/apps/{appId}/keys/{keyId}'.replace('{appId}', encodeURIComponent(String(appId))).replace('{keyId}', encodeURIComponent(String(keyId))); + 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, + ); + } + + /** + * Update the labels of an application. Labels are read-only for clients; only a server SDK using a project API key can set them. Replaces the previous labels. + * + * @param {string} params.appId - Application unique ID. + * @param {string[]} params.labels - Array of application labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateLabels(params: { appId: string, labels: string[] }): Promise; + /** + * Update the labels of an application. Labels are read-only for clients; only a server SDK using a project API key can set them. Replaces the previous labels. + * + * @param {string} appId - Application unique ID. + * @param {string[]} labels - Array of application labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateLabels(appId: string, labels: string[]): Promise; + updateLabels( + paramsOrFirst: { appId: string, labels: string[] } | string, + ...rest: [(string[])?] + ): Promise { + let params: { appId: string, labels: string[] }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { appId: string, labels: string[] }; + } else { + params = { + appId: paramsOrFirst as string, + labels: rest[0] as string[] + }; + } + + const appId = params.appId; + const labels = params.labels; + + if (typeof appId === 'undefined') { + throw new AppwriteException('Missing required parameter: "appId"'); + } + if (typeof labels === 'undefined') { + throw new AppwriteException('Missing required parameter: "labels"'); + } + + const apiPath = '/apps/{appId}/labels'.replace('{appId}', encodeURIComponent(String(appId))); + const payload: Payload = {}; + if (typeof labels !== 'undefined') { + payload['labels'] = labels; + } + const 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( + 'put', + uri, + apiHeaders, + payload, + ); + } + + /** + * List client secrets for an application. + * + * @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. + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + */ + listSecrets(params: { appId: string, queries?: string[], total?: boolean }): Promise; + /** + * List client secrets for an application. + * + * @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. + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listSecrets(appId: string, queries?: string[], total?: boolean): Promise; + listSecrets( + paramsOrFirst: { appId: string, queries?: string[], total?: boolean } | string, + ...rest: [(string[])?, (boolean)?] + ): Promise { + let params: { appId: string, queries?: string[], total?: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { appId: string, queries?: string[], total?: boolean }; + } else { + params = { + appId: paramsOrFirst as string, + queries: rest[0] as string[], + total: rest[1] as boolean + }; + } + + const appId = params.appId; + const queries = params.queries; + const total = params.total; + + if (typeof appId === 'undefined') { + throw new AppwriteException('Missing required parameter: "appId"'); + } + + const apiPath = '/apps/{appId}/secrets'.replace('{appId}', encodeURIComponent(String(appId))); + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof total !== 'undefined') { + payload['total'] = total; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Create a new client secret for an application. + * + * @param {string} params.appId - Application unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + createSecret(params: { appId: string }): Promise; + /** + * Create a new client secret for an application. + * + * @param {string} appId - Application unique ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createSecret(appId: string): Promise; + createSecret( + paramsOrFirst: { appId: string } | string + ): Promise { + let params: { appId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { appId: string }; + } else { + params = { + appId: paramsOrFirst as string + }; + } + + const appId = params.appId; + + if (typeof appId === 'undefined') { + throw new AppwriteException('Missing required parameter: "appId"'); + } + + const apiPath = '/apps/{appId}/secrets'.replace('{appId}', encodeURIComponent(String(appId))); + 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, + ); + } + + /** + * Get an application client secret by its unique ID. + * + * @param {string} params.appId - Application unique ID. + * @param {string} params.secretId - Secret unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + getSecret(params: { appId: string, secretId: string }): Promise; + /** + * Get an application client secret by its unique ID. + * + * @param {string} appId - Application unique ID. + * @param {string} secretId - Secret unique ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getSecret(appId: string, secretId: string): Promise; + getSecret( + paramsOrFirst: { appId: string, secretId: string } | string, + ...rest: [(string)?] + ): Promise { + let params: { appId: string, secretId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { appId: string, secretId: string }; + } else { + params = { + appId: paramsOrFirst as string, + secretId: rest[0] as string + }; + } + + const appId = params.appId; + const secretId = params.secretId; + + if (typeof appId === 'undefined') { + throw new AppwriteException('Missing required parameter: "appId"'); + } + if (typeof secretId === 'undefined') { + throw new AppwriteException('Missing required parameter: "secretId"'); + } + + const apiPath = '/apps/{appId}/secrets/{secretId}'.replace('{appId}', encodeURIComponent(String(appId))).replace('{secretId}', encodeURIComponent(String(secretId))); + 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, + ); + } + + /** + * Delete an application client secret by its unique ID. + * + * @param {string} params.appId - Application unique ID. + * @param {string} params.secretId - Secret unique ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deleteSecret(params: { appId: string, secretId: string }): Promise<{}>; + /** + * Delete an application client secret by its unique ID. + * + * @param {string} appId - Application unique ID. + * @param {string} secretId - Secret unique ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deleteSecret(appId: string, secretId: string): Promise<{}>; + deleteSecret( + paramsOrFirst: { appId: string, secretId: string } | string, + ...rest: [(string)?] + ): Promise<{}> { + let params: { appId: string, secretId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { appId: string, secretId: string }; + } else { + params = { + appId: paramsOrFirst as string, + secretId: rest[0] as string + }; + } + + const appId = params.appId; + const secretId = params.secretId; + + if (typeof appId === 'undefined') { + throw new AppwriteException('Missing required parameter: "appId"'); + } + if (typeof secretId === 'undefined') { + throw new AppwriteException('Missing required parameter: "secretId"'); + } + + const apiPath = '/apps/{appId}/secrets/{secretId}'.replace('{appId}', encodeURIComponent(String(appId))).replace('{secretId}', encodeURIComponent(String(secretId))); + 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, + ); + } + + /** + * Transfer an application to another team by its unique ID. + * + * @param {string} params.appId - Application unique ID. + * @param {string} params.teamId - Team ID of the team to transfer application to. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateTeam(params: { appId: string, teamId: string }): Promise; + /** + * Transfer an application to another team by its unique ID. + * + * @param {string} appId - Application unique ID. + * @param {string} teamId - Team ID of the team to transfer application to. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateTeam(appId: string, teamId: string): Promise; + updateTeam( + paramsOrFirst: { appId: string, teamId: string } | string, + ...rest: [(string)?] + ): Promise { + let params: { appId: string, teamId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { appId: string, teamId: string }; + } else { + params = { + appId: paramsOrFirst as string, + teamId: rest[0] as string + }; + } + + const appId = params.appId; + const teamId = params.teamId; + + if (typeof appId === 'undefined') { + throw new AppwriteException('Missing required parameter: "appId"'); + } + if (typeof teamId === 'undefined') { + throw new AppwriteException('Missing required parameter: "teamId"'); + } + + const apiPath = '/apps/{appId}/team'.replace('{appId}', encodeURIComponent(String(appId))); + const payload: Payload = {}; + if (typeof teamId !== 'undefined') { + payload['teamId'] = teamId; + } + const 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, + ); + } + + /** + * Revoke all tokens for an application by its unique ID. + * + * @param {string} params.appId - Application unique ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deleteTokens(params: { appId: string }): Promise<{}>; + /** + * Revoke all tokens for an application by its unique ID. + * + * @param {string} appId - Application unique ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deleteTokens(appId: string): Promise<{}>; + deleteTokens( + paramsOrFirst: { appId: string } | string + ): Promise<{}> { + let params: { appId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { appId: string }; + } else { + params = { + appId: paramsOrFirst as string + }; + } + + const appId = params.appId; + + if (typeof appId === 'undefined') { + throw new AppwriteException('Missing required parameter: "appId"'); + } + + const apiPath = '/apps/{appId}/tokens'.replace('{appId}', encodeURIComponent(String(appId))); + 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, + ); + } +} diff --git a/src/services/backups.ts b/src/services/backups.ts index 38b5cc0..ee83d6a 100644 --- a/src/services/backups.ts +++ b/src/services/backups.ts @@ -591,49 +591,58 @@ export class Backups { /** * Create and trigger a new restoration for a backup on a project. * - * When restoring a DocumentsDB or VectorsDB database to a new resource, pass `newSpecification` to provision the restored database on a different specification than the archived one (for example, restoring onto a larger or smaller dedicated database). Use `serverless` to restore onto the shared pool, or a dedicated specification slug to restore onto a dedicated database of that size. The specification must be permitted by the organization's plan. `newSpecification` is not supported for legacy/TablesDB databases or for bucket restores. + * 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`. + * + * 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. * * * @param {string} params.archiveId - Backup archive ID to restore * @param {BackupServices[]} params.services - Array of services to restore - * @param {string} params.newResourceId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} params.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.newResourceName - Database name. Max length: 128 chars. - * @param {string} params.newSpecification - Specification to provision the restored database on, when restoring a DocumentsDB or VectorsDB database to a new resource. Defaults to the archived database's specification. Use `serverless` for the shared pool or a dedicated specification slug. * @throws {AppwriteException} * @returns {Promise} */ - createRestoration(params: { archiveId: string, services: BackupServices[], newResourceId?: string, newResourceName?: string, newSpecification?: string }): Promise; + createRestoration(params: { archiveId: string, services: BackupServices[], newResourceId?: string, newResourceName?: string }): Promise; /** * Create and trigger a new restoration for a backup on a project. * - * When restoring a DocumentsDB or VectorsDB database to a new resource, pass `newSpecification` to provision the restored database on a different specification than the archived one (for example, restoring onto a larger or smaller dedicated database). Use `serverless` to restore onto the shared pool, or a dedicated specification slug to restore onto a dedicated database of that size. The specification must be permitted by the organization's plan. `newSpecification` is not supported for legacy/TablesDB databases or for bucket restores. + * 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`. + * + * 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. * * * @param {string} archiveId - Backup archive ID to restore * @param {BackupServices[]} services - Array of services to restore - * @param {string} newResourceId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} 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} newResourceName - Database name. Max length: 128 chars. - * @param {string} newSpecification - Specification to provision the restored database on, when restoring a DocumentsDB or VectorsDB database to a new resource. Defaults to the archived database's specification. Use `serverless` for the shared pool or a dedicated specification slug. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createRestoration(archiveId: string, services: BackupServices[], newResourceId?: string, newResourceName?: string, newSpecification?: string): Promise; + createRestoration(archiveId: string, services: BackupServices[], newResourceId?: string, newResourceName?: string): Promise; createRestoration( - paramsOrFirst: { archiveId: string, services: BackupServices[], newResourceId?: string, newResourceName?: string, newSpecification?: string } | string, - ...rest: [(BackupServices[])?, (string)?, (string)?, (string)?] + paramsOrFirst: { archiveId: string, services: BackupServices[], newResourceId?: string, newResourceName?: string } | string, + ...rest: [(BackupServices[])?, (string)?, (string)?] ): Promise { - let params: { archiveId: string, services: BackupServices[], newResourceId?: string, newResourceName?: string, newSpecification?: string }; + let params: { archiveId: string, services: BackupServices[], newResourceId?: string, newResourceName?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { archiveId: string, services: BackupServices[], newResourceId?: string, newResourceName?: string, newSpecification?: string }; + params = (paramsOrFirst || {}) as { archiveId: string, services: BackupServices[], newResourceId?: string, newResourceName?: string }; } else { params = { archiveId: paramsOrFirst as string, services: rest[0] as BackupServices[], newResourceId: rest[1] as string, - newResourceName: rest[2] as string, - newSpecification: rest[3] as string + newResourceName: rest[2] as string }; } @@ -641,7 +650,6 @@ export class Backups { const services = params.services; const newResourceId = params.newResourceId; const newResourceName = params.newResourceName; - const newSpecification = params.newSpecification; if (typeof archiveId === 'undefined') { throw new AppwriteException('Missing required parameter: "archiveId"'); @@ -664,9 +672,6 @@ export class Backups { if (typeof newResourceName !== 'undefined') { payload['newResourceName'] = newResourceName; } - if (typeof newSpecification !== 'undefined') { - payload['newSpecification'] = newSpecification; - } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { diff --git a/src/services/oauth-2.ts b/src/services/oauth-2.ts new file mode 100644 index 0000000..4458be3 --- /dev/null +++ b/src/services/oauth-2.ts @@ -0,0 +1,1097 @@ +import { AppwriteException, Client, type Payload, UploadProgress } from '../client'; +import type { Models } from '../models'; + + + +export class Oauth2 { + client: Client; + + constructor(client: Client) { + this.client = client; + } + + /** + * Approve an OAuth2 grant after the user gives consent. Returns the `redirectUrl` the end user should be sent to. The consent screen may optionally pass enriched `authorization_details` to record the concrete resources the user selected. You can pass Accept header of `application/json` to receive a JSON response instead of a redirect. + * + * @param {string} params.grantId - Grant ID made during authorization, provided to consent screen in URL search params. + * @param {string} params.authorizationDetails - Enriched `authorization_details` the user consented to, replacing what the client requested. Each entry must use a `type` the project accepts. Optional; omit to keep the originally requested details. + * @param {string} params.scope - Space-separated scopes the user consented to. Must be a subset of the scopes originally requested; identity scopes such as `openid` are always retained. Optional; omit to keep the originally requested scopes. + * @throws {AppwriteException} + * @returns {Promise} + */ + approve(params: { grantId: string, authorizationDetails?: string, scope?: string }): Promise; + /** + * Approve an OAuth2 grant after the user gives consent. Returns the `redirectUrl` the end user should be sent to. The consent screen may optionally pass enriched `authorization_details` to record the concrete resources the user selected. You can pass Accept header of `application/json` to receive a JSON response instead of a redirect. + * + * @param {string} grantId - Grant ID made during authorization, provided to consent screen in URL search params. + * @param {string} authorizationDetails - Enriched `authorization_details` the user consented to, replacing what the client requested. Each entry must use a `type` the project accepts. Optional; omit to keep the originally requested details. + * @param {string} scope - Space-separated scopes the user consented to. Must be a subset of the scopes originally requested; identity scopes such as `openid` are always retained. Optional; omit to keep the originally requested scopes. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + approve(grantId: string, authorizationDetails?: string, scope?: string): Promise; + approve( + paramsOrFirst: { grantId: string, authorizationDetails?: string, scope?: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { grantId: string, authorizationDetails?: string, scope?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { grantId: string, authorizationDetails?: string, scope?: string }; + } else { + params = { + grantId: paramsOrFirst as string, + authorizationDetails: rest[0] as string, + scope: rest[1] as string + }; + } + + const grantId = params.grantId; + const authorizationDetails = params.authorizationDetails; + const scope = params.scope; + + if (typeof grantId === 'undefined') { + throw new AppwriteException('Missing required parameter: "grantId"'); + } + + const apiPath = '/oauth2/{project_id}/approve'.replace('{project_id}', encodeURIComponent(String(this.client.config.project))); + const payload: Payload = {}; + if (typeof grantId !== 'undefined') { + payload['grant_id'] = grantId; + } + if (typeof authorizationDetails !== 'undefined') { + payload['authorization_details'] = authorizationDetails; + } + if (typeof scope !== 'undefined') { + payload['scope'] = scope; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + 'accept': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Begin the OAuth2 authorization flow. When called without a session, the user is redirected to the consent screen without grant ID. When called with a session, the redirect URL includes param for grant ID. You can pass Accept header of `application/json` to receive a JSON response instead of a redirect. + * + * @param {string} params.clientId - OAuth2 client ID. Either a registered app ID or an HTTPS client ID metadata document URL. + * @param {string} params.redirectUri - Redirect URI where visitor will be redirected after authorization, whether successful or not. + * @param {string} params.responseType - OAuth2 / OIDC response type. One of `code` (Authorization Code Flow), `id_token` (Implicit Flow, OIDC login only), or `code id_token` (Hybrid Flow). + * @param {string} params.scope - Space-separated OAuth2 scopes. Can include project scopes, and built-in scopes: `openid`, `email`, `profile`, `phone`. + * @param {string} params.state - OAuth2 state. You receive this back in the redirect URI. + * @param {string} params.nonce - OIDC nonce parameter to prevent replay attacks. Required when response_type includes `id_token`. + * @param {string} params.codeChallenge - PKCE code challenge. Required when OAuth2 app is public. + * @param {string} params.codeChallengeMethod - PKCE code challenge method. Required when OAuth2 app is public. + * @param {string} params.prompt - OIDC prompt parameter for customization of consent screen. Space-separated list of: none, login, consent, select_account. + * @param {number} params.maxAge - OIDC max_age paraleter for customization of consent screen. Maximum allowable elapsed time in seconds since the user last authenticated. If exceeded, re-authentication is required. + * @param {string} params.authorizationDetails - Rich authorization request. JSON array of objects, each with a `type` and project-defined fields + * @param {string} params.resource - RFC 8707 resource indicator URI or URI list. Each value must be an absolute URI without a fragment. + * @param {string} params.audience - Compatibility alias for a single OAuth2 resource indicator URI. + * @param {string} params.requestUri - OAuth2 authorization request handle returned by the pushed authorization request endpoint. + * @throws {AppwriteException} + * @returns {Promise} + */ + authorize(params?: { clientId?: string, redirectUri?: string, responseType?: string, scope?: string, state?: string, nonce?: string, codeChallenge?: string, codeChallengeMethod?: string, prompt?: string, maxAge?: number, authorizationDetails?: string, resource?: string, audience?: string, requestUri?: string }): Promise; + /** + * Begin the OAuth2 authorization flow. When called without a session, the user is redirected to the consent screen without grant ID. When called with a session, the redirect URL includes param for grant ID. You can pass Accept header of `application/json` to receive a JSON response instead of a redirect. + * + * @param {string} clientId - OAuth2 client ID. Either a registered app ID or an HTTPS client ID metadata document URL. + * @param {string} redirectUri - Redirect URI where visitor will be redirected after authorization, whether successful or not. + * @param {string} responseType - OAuth2 / OIDC response type. One of `code` (Authorization Code Flow), `id_token` (Implicit Flow, OIDC login only), or `code id_token` (Hybrid Flow). + * @param {string} scope - Space-separated OAuth2 scopes. Can include project scopes, and built-in scopes: `openid`, `email`, `profile`, `phone`. + * @param {string} state - OAuth2 state. You receive this back in the redirect URI. + * @param {string} nonce - OIDC nonce parameter to prevent replay attacks. Required when response_type includes `id_token`. + * @param {string} codeChallenge - PKCE code challenge. Required when OAuth2 app is public. + * @param {string} codeChallengeMethod - PKCE code challenge method. Required when OAuth2 app is public. + * @param {string} prompt - OIDC prompt parameter for customization of consent screen. Space-separated list of: none, login, consent, select_account. + * @param {number} maxAge - OIDC max_age paraleter for customization of consent screen. Maximum allowable elapsed time in seconds since the user last authenticated. If exceeded, re-authentication is required. + * @param {string} authorizationDetails - Rich authorization request. JSON array of objects, each with a `type` and project-defined fields + * @param {string} resource - RFC 8707 resource indicator URI or URI list. Each value must be an absolute URI without a fragment. + * @param {string} audience - Compatibility alias for a single OAuth2 resource indicator URI. + * @param {string} requestUri - OAuth2 authorization request handle returned by the pushed authorization request endpoint. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + authorize(clientId?: string, redirectUri?: string, responseType?: string, scope?: string, state?: string, nonce?: string, codeChallenge?: string, codeChallengeMethod?: string, prompt?: string, maxAge?: number, authorizationDetails?: string, resource?: string, audience?: string, requestUri?: string): Promise; + authorize( + paramsOrFirst?: { clientId?: string, redirectUri?: string, responseType?: string, scope?: string, state?: string, nonce?: string, codeChallenge?: string, codeChallengeMethod?: string, prompt?: string, maxAge?: number, authorizationDetails?: string, resource?: string, audience?: string, requestUri?: string } | string, + ...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (number)?, (string)?, (string)?, (string)?, (string)?] + ): Promise { + let params: { clientId?: string, redirectUri?: string, responseType?: string, scope?: string, state?: string, nonce?: string, codeChallenge?: string, codeChallengeMethod?: string, prompt?: string, maxAge?: number, authorizationDetails?: string, resource?: string, audience?: string, requestUri?: string }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { clientId?: string, redirectUri?: string, responseType?: string, scope?: string, state?: string, nonce?: string, codeChallenge?: string, codeChallengeMethod?: string, prompt?: string, maxAge?: number, authorizationDetails?: string, resource?: string, audience?: string, requestUri?: string }; + } else { + params = { + clientId: paramsOrFirst as string, + redirectUri: rest[0] as string, + responseType: rest[1] as string, + scope: rest[2] as string, + state: rest[3] as string, + nonce: rest[4] as string, + codeChallenge: rest[5] as string, + codeChallengeMethod: rest[6] as string, + prompt: rest[7] as string, + maxAge: rest[8] as number, + authorizationDetails: rest[9] as string, + resource: rest[10] as string, + audience: rest[11] as string, + requestUri: rest[12] as string + }; + } + + const clientId = params.clientId; + const redirectUri = params.redirectUri; + const responseType = params.responseType; + const scope = params.scope; + const state = params.state; + const nonce = params.nonce; + const codeChallenge = params.codeChallenge; + const codeChallengeMethod = params.codeChallengeMethod; + const prompt = params.prompt; + const maxAge = params.maxAge; + const authorizationDetails = params.authorizationDetails; + const resource = params.resource; + const audience = params.audience; + const requestUri = params.requestUri; + + + const apiPath = '/oauth2/{project_id}/authorize'.replace('{project_id}', encodeURIComponent(String(this.client.config.project))); + const payload: Payload = {}; + if (typeof clientId !== 'undefined') { + payload['client_id'] = clientId; + } + if (typeof redirectUri !== 'undefined') { + payload['redirect_uri'] = redirectUri; + } + if (typeof responseType !== 'undefined') { + payload['response_type'] = responseType; + } + if (typeof scope !== 'undefined') { + payload['scope'] = scope; + } + if (typeof state !== 'undefined') { + payload['state'] = state; + } + if (typeof nonce !== 'undefined') { + payload['nonce'] = nonce; + } + if (typeof codeChallenge !== 'undefined') { + payload['code_challenge'] = codeChallenge; + } + if (typeof codeChallengeMethod !== 'undefined') { + payload['code_challenge_method'] = codeChallengeMethod; + } + if (typeof prompt !== 'undefined') { + payload['prompt'] = prompt; + } + if (typeof maxAge !== 'undefined') { + payload['max_age'] = maxAge; + } + if (typeof authorizationDetails !== 'undefined') { + payload['authorization_details'] = authorizationDetails; + } + if (typeof resource !== 'undefined') { + payload['resource'] = resource; + } + if (typeof audience !== 'undefined') { + payload['audience'] = audience; + } + if (typeof requestUri !== 'undefined') { + payload['request_uri'] = requestUri; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'accept': 'application/json', + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Begin the OAuth2 authorization flow. When called without a session, the user is redirected to the consent screen without grant ID. When called with a session, the redirect URL includes param for grant ID. You can pass Accept header of `application/json` to receive a JSON response instead of a redirect. + * + * @param {string} params.clientId - OAuth2 client ID. Either a registered app ID or an HTTPS client ID metadata document URL. + * @param {string} params.redirectUri - Redirect URI where visitor will be redirected after authorization, whether successful or not. + * @param {string} params.responseType - OAuth2 / OIDC response type. One of `code` (Authorization Code Flow), `id_token` (Implicit Flow, OIDC login only), or `code id_token` (Hybrid Flow). + * @param {string} params.scope - Space-separated OAuth2 scopes. Can include project scopes, and built-in scopes: `openid`, `email`, `profile`, `phone`. + * @param {string} params.state - OAuth2 state. You receive this back in the redirect URI. + * @param {string} params.nonce - OIDC nonce parameter to prevent replay attacks. Required when response_type includes `id_token`. + * @param {string} params.codeChallenge - PKCE code challenge. Required when OAuth2 app is public. + * @param {string} params.codeChallengeMethod - PKCE code challenge method. Required when OAuth2 app is public. + * @param {string} params.prompt - OIDC prompt parameter for customization of consent screen. Space-separated list of: none, login, consent, select_account. + * @param {number} params.maxAge - OIDC max_age paraleter for customization of consent screen. Maximum allowable elapsed time in seconds since the user last authenticated. If exceeded, re-authentication is required. + * @param {string} params.authorizationDetails - Rich authorization request. JSON array of objects, each with a `type` and project-defined fields + * @param {string} params.resource - RFC 8707 resource indicator URI or URI list. Each value must be an absolute URI without a fragment. + * @param {string} params.audience - Compatibility alias for a single OAuth2 resource indicator URI. + * @param {string} params.requestUri - OAuth2 authorization request handle returned by the pushed authorization request endpoint. + * @throws {AppwriteException} + * @returns {Promise} + */ + authorizePost(params?: { clientId?: string, redirectUri?: string, responseType?: string, scope?: string, state?: string, nonce?: string, codeChallenge?: string, codeChallengeMethod?: string, prompt?: string, maxAge?: number, authorizationDetails?: string, resource?: string, audience?: string, requestUri?: string }): Promise; + /** + * Begin the OAuth2 authorization flow. When called without a session, the user is redirected to the consent screen without grant ID. When called with a session, the redirect URL includes param for grant ID. You can pass Accept header of `application/json` to receive a JSON response instead of a redirect. + * + * @param {string} clientId - OAuth2 client ID. Either a registered app ID or an HTTPS client ID metadata document URL. + * @param {string} redirectUri - Redirect URI where visitor will be redirected after authorization, whether successful or not. + * @param {string} responseType - OAuth2 / OIDC response type. One of `code` (Authorization Code Flow), `id_token` (Implicit Flow, OIDC login only), or `code id_token` (Hybrid Flow). + * @param {string} scope - Space-separated OAuth2 scopes. Can include project scopes, and built-in scopes: `openid`, `email`, `profile`, `phone`. + * @param {string} state - OAuth2 state. You receive this back in the redirect URI. + * @param {string} nonce - OIDC nonce parameter to prevent replay attacks. Required when response_type includes `id_token`. + * @param {string} codeChallenge - PKCE code challenge. Required when OAuth2 app is public. + * @param {string} codeChallengeMethod - PKCE code challenge method. Required when OAuth2 app is public. + * @param {string} prompt - OIDC prompt parameter for customization of consent screen. Space-separated list of: none, login, consent, select_account. + * @param {number} maxAge - OIDC max_age paraleter for customization of consent screen. Maximum allowable elapsed time in seconds since the user last authenticated. If exceeded, re-authentication is required. + * @param {string} authorizationDetails - Rich authorization request. JSON array of objects, each with a `type` and project-defined fields + * @param {string} resource - RFC 8707 resource indicator URI or URI list. Each value must be an absolute URI without a fragment. + * @param {string} audience - Compatibility alias for a single OAuth2 resource indicator URI. + * @param {string} requestUri - OAuth2 authorization request handle returned by the pushed authorization request endpoint. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + authorizePost(clientId?: string, redirectUri?: string, responseType?: string, scope?: string, state?: string, nonce?: string, codeChallenge?: string, codeChallengeMethod?: string, prompt?: string, maxAge?: number, authorizationDetails?: string, resource?: string, audience?: string, requestUri?: string): Promise; + authorizePost( + paramsOrFirst?: { clientId?: string, redirectUri?: string, responseType?: string, scope?: string, state?: string, nonce?: string, codeChallenge?: string, codeChallengeMethod?: string, prompt?: string, maxAge?: number, authorizationDetails?: string, resource?: string, audience?: string, requestUri?: string } | string, + ...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (number)?, (string)?, (string)?, (string)?, (string)?] + ): Promise { + let params: { clientId?: string, redirectUri?: string, responseType?: string, scope?: string, state?: string, nonce?: string, codeChallenge?: string, codeChallengeMethod?: string, prompt?: string, maxAge?: number, authorizationDetails?: string, resource?: string, audience?: string, requestUri?: string }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { clientId?: string, redirectUri?: string, responseType?: string, scope?: string, state?: string, nonce?: string, codeChallenge?: string, codeChallengeMethod?: string, prompt?: string, maxAge?: number, authorizationDetails?: string, resource?: string, audience?: string, requestUri?: string }; + } else { + params = { + clientId: paramsOrFirst as string, + redirectUri: rest[0] as string, + responseType: rest[1] as string, + scope: rest[2] as string, + state: rest[3] as string, + nonce: rest[4] as string, + codeChallenge: rest[5] as string, + codeChallengeMethod: rest[6] as string, + prompt: rest[7] as string, + maxAge: rest[8] as number, + authorizationDetails: rest[9] as string, + resource: rest[10] as string, + audience: rest[11] as string, + requestUri: rest[12] as string + }; + } + + const clientId = params.clientId; + const redirectUri = params.redirectUri; + const responseType = params.responseType; + const scope = params.scope; + const state = params.state; + const nonce = params.nonce; + const codeChallenge = params.codeChallenge; + const codeChallengeMethod = params.codeChallengeMethod; + const prompt = params.prompt; + const maxAge = params.maxAge; + const authorizationDetails = params.authorizationDetails; + const resource = params.resource; + const audience = params.audience; + const requestUri = params.requestUri; + + + const apiPath = '/oauth2/{project_id}/authorize'.replace('{project_id}', encodeURIComponent(String(this.client.config.project))); + const payload: Payload = {}; + if (typeof clientId !== 'undefined') { + payload['client_id'] = clientId; + } + if (typeof redirectUri !== 'undefined') { + payload['redirect_uri'] = redirectUri; + } + if (typeof responseType !== 'undefined') { + payload['response_type'] = responseType; + } + if (typeof scope !== 'undefined') { + payload['scope'] = scope; + } + if (typeof state !== 'undefined') { + payload['state'] = state; + } + if (typeof nonce !== 'undefined') { + payload['nonce'] = nonce; + } + if (typeof codeChallenge !== 'undefined') { + payload['code_challenge'] = codeChallenge; + } + if (typeof codeChallengeMethod !== 'undefined') { + payload['code_challenge_method'] = codeChallengeMethod; + } + if (typeof prompt !== 'undefined') { + payload['prompt'] = prompt; + } + if (typeof maxAge !== 'undefined') { + payload['max_age'] = maxAge; + } + if (typeof authorizationDetails !== 'undefined') { + payload['authorization_details'] = authorizationDetails; + } + if (typeof resource !== 'undefined') { + payload['resource'] = resource; + } + if (typeof audience !== 'undefined') { + payload['audience'] = audience; + } + if (typeof requestUri !== 'undefined') { + payload['request_uri'] = requestUri; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + 'accept': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Start the OAuth2 Device Authorization Grant. Returns the device code, user code, verification URL, expiration, and polling interval. + * + * @param {string} params.clientId - OAuth2 client ID. Either a registered app ID or an HTTPS client ID metadata document URL. + * @param {string} params.scope - Space-separated OAuth2 scopes. Can include project scopes, and built-in scopes: `openid`, `email`, `profile`. + * @param {string} params.authorizationDetails - Rich authorization request. JSON array of objects, each with a `type` and project-defined fields + * @param {string} params.resource - RFC 8707 resource indicator URI or URI list. Each value must be an absolute URI without a fragment. + * @param {string} params.audience - Compatibility alias for a single OAuth2 resource indicator URI. + * @throws {AppwriteException} + * @returns {Promise} + */ + createDeviceAuthorization(params?: { clientId?: string, scope?: string, authorizationDetails?: string, resource?: string, audience?: string }): Promise; + /** + * Start the OAuth2 Device Authorization Grant. Returns the device code, user code, verification URL, expiration, and polling interval. + * + * @param {string} clientId - OAuth2 client ID. Either a registered app ID or an HTTPS client ID metadata document URL. + * @param {string} scope - Space-separated OAuth2 scopes. Can include project scopes, and built-in scopes: `openid`, `email`, `profile`. + * @param {string} authorizationDetails - Rich authorization request. JSON array of objects, each with a `type` and project-defined fields + * @param {string} resource - RFC 8707 resource indicator URI or URI list. Each value must be an absolute URI without a fragment. + * @param {string} audience - Compatibility alias for a single OAuth2 resource indicator URI. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createDeviceAuthorization(clientId?: string, scope?: string, authorizationDetails?: string, resource?: string, audience?: string): Promise; + createDeviceAuthorization( + paramsOrFirst?: { clientId?: string, scope?: string, authorizationDetails?: string, resource?: string, audience?: string } | string, + ...rest: [(string)?, (string)?, (string)?, (string)?] + ): Promise { + let params: { clientId?: string, scope?: string, authorizationDetails?: string, resource?: string, audience?: string }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { clientId?: string, scope?: string, authorizationDetails?: string, resource?: string, audience?: string }; + } else { + params = { + clientId: paramsOrFirst as string, + scope: rest[0] as string, + authorizationDetails: rest[1] as string, + resource: rest[2] as string, + audience: rest[3] as string + }; + } + + const clientId = params.clientId; + const scope = params.scope; + const authorizationDetails = params.authorizationDetails; + const resource = params.resource; + const audience = params.audience; + + + const apiPath = '/oauth2/{project_id}/device_authorization'.replace('{project_id}', encodeURIComponent(String(this.client.config.project))); + const payload: Payload = {}; + if (typeof clientId !== 'undefined') { + payload['client_id'] = clientId; + } + if (typeof scope !== 'undefined') { + payload['scope'] = scope; + } + if (typeof authorizationDetails !== 'undefined') { + payload['authorization_details'] = authorizationDetails; + } + if (typeof resource !== 'undefined') { + payload['resource'] = resource; + } + if (typeof audience !== 'undefined') { + payload['audience'] = audience; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + 'accept': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Exchange a device flow user code for an OAuth2 grant. The authenticated user is bound to the pending grant. Pass the returned grant ID to the get grant endpoint to render the consent screen, then to the approve or reject endpoint to complete the flow. + * + * @param {string} params.userCode - User code displayed on the device. + * @throws {AppwriteException} + * @returns {Promise} + */ + createGrant(params: { userCode: string }): Promise; + /** + * Exchange a device flow user code for an OAuth2 grant. The authenticated user is bound to the pending grant. Pass the returned grant ID to the get grant endpoint to render the consent screen, then to the approve or reject endpoint to complete the flow. + * + * @param {string} userCode - User code displayed on the device. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createGrant(userCode: string): Promise; + createGrant( + paramsOrFirst: { userCode: string } | string + ): Promise { + let params: { userCode: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { userCode: string }; + } else { + params = { + userCode: paramsOrFirst as string + }; + } + + const userCode = params.userCode; + + if (typeof userCode === 'undefined') { + throw new AppwriteException('Missing required parameter: "userCode"'); + } + + const apiPath = '/oauth2/{project_id}/grants'.replace('{project_id}', encodeURIComponent(String(this.client.config.project))); + const payload: Payload = {}; + if (typeof userCode !== 'undefined') { + payload['user_code'] = userCode; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + 'accept': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Get an OAuth2 grant by its ID. Used by the consent screen to display the details of the authorization the user is being asked to approve. A grant can only be read by the user it belongs to, or by server SDK. + * + * @param {string} params.grantId - Grant ID made during authorization, provided to consent screen in URL search params. + * @throws {AppwriteException} + * @returns {Promise} + */ + getGrant(params: { grantId: string }): Promise; + /** + * Get an OAuth2 grant by its ID. Used by the consent screen to display the details of the authorization the user is being asked to approve. A grant can only be read by the user it belongs to, or by server SDK. + * + * @param {string} grantId - Grant ID made during authorization, provided to consent screen in URL search params. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getGrant(grantId: string): Promise; + getGrant( + paramsOrFirst: { grantId: string } | string + ): Promise { + let params: { grantId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { grantId: string }; + } else { + params = { + grantId: paramsOrFirst as string + }; + } + + const grantId = params.grantId; + + if (typeof grantId === 'undefined') { + throw new AppwriteException('Missing required parameter: "grantId"'); + } + + const apiPath = '/oauth2/{project_id}/grants/{grant_id}'.replace('{project_id}', encodeURIComponent(String(this.client.config.project))).replace('{grant_id}', encodeURIComponent(String(grantId))); + const payload: Payload = {}; + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'accept': 'application/json', + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * List the organizations the OAuth2 access token can access. Resolves the token's `organization` authorization details, expanding the `*` wildcard into the concrete set of organizations the user can see. + * + * @param {number} params.limit - Maximum number of organizations to return. Between 1 and 5000. + * @param {number} params.offset - Number of organizations to skip before returning results. Used for pagination. + * @param {string} params.search - Search term to filter your list results. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + listOrganizations(params?: { limit?: number, offset?: number, search?: string }): Promise; + /** + * List the organizations the OAuth2 access token can access. Resolves the token's `organization` authorization details, expanding the `*` wildcard into the concrete set of organizations the user can see. + * + * @param {number} limit - Maximum number of organizations to return. Between 1 and 5000. + * @param {number} offset - Number of organizations to skip before returning results. Used for pagination. + * @param {string} search - Search term to filter your list results. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listOrganizations(limit?: number, offset?: number, search?: string): Promise; + listOrganizations( + paramsOrFirst?: { limit?: number, offset?: number, search?: string } | number, + ...rest: [(number)?, (string)?] + ): Promise { + let params: { limit?: number, offset?: number, search?: string }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { limit?: number, offset?: number, search?: string }; + } else { + params = { + limit: paramsOrFirst as number, + offset: rest[0] as number, + search: rest[1] as string + }; + } + + const limit = params.limit; + const offset = params.offset; + const search = params.search; + + + const apiPath = '/oauth2/{project_id}/organizations'.replace('{project_id}', encodeURIComponent(String(this.client.config.project))); + const payload: Payload = {}; + if (typeof limit !== 'undefined') { + payload['limit'] = limit; + } + if (typeof offset !== 'undefined') { + payload['offset'] = offset; + } + if (typeof search !== 'undefined') { + payload['search'] = search; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'accept': 'application/json', + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Store an OAuth2 authorization request server-side and receive a short-lived request_uri handle for the authorize endpoint. + * + * @param {string} params.clientId - OAuth2 client ID. Either a registered app ID or an HTTPS client ID metadata document URL. + * @param {string} params.redirectUri - Redirect URI where visitor will be redirected after authorization, whether successful or not. + * @param {string} params.responseType - OAuth2 / OIDC response type. + * @param {string} params.scope - Space-separated OAuth2 scopes. Can include project scopes, and built-in scopes: `openid`, `email`, `profile`, `phone`. + * @param {string} params.state - OAuth2 state. You receive this back in the redirect URI. + * @param {string} params.nonce - OIDC nonce parameter to prevent replay attacks. Required when response_type includes `id_token`. + * @param {string} params.codeChallenge - PKCE code challenge. Required when OAuth2 app is public. + * @param {string} params.codeChallengeMethod - PKCE code challenge method. Required when OAuth2 app is public. + * @param {string} params.prompt - OIDC prompt parameter for customization of consent screen. Space-separated list of: none, login, consent, select_account. + * @param {number} params.maxAge - OIDC max_age parameter for customization of consent screen. + * @param {string} params.authorizationDetails - Rich authorization request. JSON array of objects, each with a `type` and project-defined fields + * @param {string} params.resource - RFC 8707 resource indicator URI or URI list. Each value must be an absolute URI without a fragment. + * @param {string} params.audience - Compatibility alias for a single OAuth2 resource indicator URI. + * @throws {AppwriteException} + * @returns {Promise} + */ + createPAR(params: { clientId: string, redirectUri: string, responseType: string, scope?: string, state?: string, nonce?: string, codeChallenge?: string, codeChallengeMethod?: string, prompt?: string, maxAge?: number, authorizationDetails?: string, resource?: string, audience?: string }): Promise; + /** + * Store an OAuth2 authorization request server-side and receive a short-lived request_uri handle for the authorize endpoint. + * + * @param {string} clientId - OAuth2 client ID. Either a registered app ID or an HTTPS client ID metadata document URL. + * @param {string} redirectUri - Redirect URI where visitor will be redirected after authorization, whether successful or not. + * @param {string} responseType - OAuth2 / OIDC response type. + * @param {string} scope - Space-separated OAuth2 scopes. Can include project scopes, and built-in scopes: `openid`, `email`, `profile`, `phone`. + * @param {string} state - OAuth2 state. You receive this back in the redirect URI. + * @param {string} nonce - OIDC nonce parameter to prevent replay attacks. Required when response_type includes `id_token`. + * @param {string} codeChallenge - PKCE code challenge. Required when OAuth2 app is public. + * @param {string} codeChallengeMethod - PKCE code challenge method. Required when OAuth2 app is public. + * @param {string} prompt - OIDC prompt parameter for customization of consent screen. Space-separated list of: none, login, consent, select_account. + * @param {number} maxAge - OIDC max_age parameter for customization of consent screen. + * @param {string} authorizationDetails - Rich authorization request. JSON array of objects, each with a `type` and project-defined fields + * @param {string} resource - RFC 8707 resource indicator URI or URI list. Each value must be an absolute URI without a fragment. + * @param {string} audience - Compatibility alias for a single OAuth2 resource indicator URI. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createPAR(clientId: string, redirectUri: string, responseType: string, scope?: string, state?: string, nonce?: string, codeChallenge?: string, codeChallengeMethod?: string, prompt?: string, maxAge?: number, authorizationDetails?: string, resource?: string, audience?: string): Promise; + createPAR( + paramsOrFirst: { clientId: string, redirectUri: string, responseType: string, scope?: string, state?: string, nonce?: string, codeChallenge?: string, codeChallengeMethod?: string, prompt?: string, maxAge?: number, authorizationDetails?: string, resource?: string, audience?: string } | string, + ...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (number)?, (string)?, (string)?, (string)?] + ): Promise { + let params: { clientId: string, redirectUri: string, responseType: string, scope?: string, state?: string, nonce?: string, codeChallenge?: string, codeChallengeMethod?: string, prompt?: string, maxAge?: number, authorizationDetails?: string, resource?: string, audience?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { clientId: string, redirectUri: string, responseType: string, scope?: string, state?: string, nonce?: string, codeChallenge?: string, codeChallengeMethod?: string, prompt?: string, maxAge?: number, authorizationDetails?: string, resource?: string, audience?: string }; + } else { + params = { + clientId: paramsOrFirst as string, + redirectUri: rest[0] as string, + responseType: rest[1] as string, + scope: rest[2] as string, + state: rest[3] as string, + nonce: rest[4] as string, + codeChallenge: rest[5] as string, + codeChallengeMethod: rest[6] as string, + prompt: rest[7] as string, + maxAge: rest[8] as number, + authorizationDetails: rest[9] as string, + resource: rest[10] as string, + audience: rest[11] as string + }; + } + + const clientId = params.clientId; + const redirectUri = params.redirectUri; + const responseType = params.responseType; + const scope = params.scope; + const state = params.state; + const nonce = params.nonce; + const codeChallenge = params.codeChallenge; + const codeChallengeMethod = params.codeChallengeMethod; + const prompt = params.prompt; + const maxAge = params.maxAge; + const authorizationDetails = params.authorizationDetails; + const resource = params.resource; + const audience = params.audience; + + if (typeof clientId === 'undefined') { + throw new AppwriteException('Missing required parameter: "clientId"'); + } + if (typeof redirectUri === 'undefined') { + throw new AppwriteException('Missing required parameter: "redirectUri"'); + } + if (typeof responseType === 'undefined') { + throw new AppwriteException('Missing required parameter: "responseType"'); + } + + const apiPath = '/oauth2/{project_id}/par'.replace('{project_id}', encodeURIComponent(String(this.client.config.project))); + const payload: Payload = {}; + if (typeof clientId !== 'undefined') { + payload['client_id'] = clientId; + } + if (typeof redirectUri !== 'undefined') { + payload['redirect_uri'] = redirectUri; + } + if (typeof responseType !== 'undefined') { + payload['response_type'] = responseType; + } + if (typeof scope !== 'undefined') { + payload['scope'] = scope; + } + if (typeof state !== 'undefined') { + payload['state'] = state; + } + if (typeof nonce !== 'undefined') { + payload['nonce'] = nonce; + } + if (typeof codeChallenge !== 'undefined') { + payload['code_challenge'] = codeChallenge; + } + if (typeof codeChallengeMethod !== 'undefined') { + payload['code_challenge_method'] = codeChallengeMethod; + } + if (typeof prompt !== 'undefined') { + payload['prompt'] = prompt; + } + if (typeof maxAge !== 'undefined') { + payload['max_age'] = maxAge; + } + if (typeof authorizationDetails !== 'undefined') { + payload['authorization_details'] = authorizationDetails; + } + if (typeof resource !== 'undefined') { + payload['resource'] = resource; + } + if (typeof audience !== 'undefined') { + payload['audience'] = audience; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + 'accept': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * List the projects the OAuth2 access token can access. Resolves the token's `project` authorization details, expanding the `*` wildcard into the concrete set of projects the user can see. + * + * @param {number} params.limit - Maximum number of projects to return. Between 1 and 5000. + * @param {number} params.offset - Number of projects to skip before returning results. Used for pagination. + * @param {string} params.search - Search term to filter your list results. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + */ + listProjects(params?: { limit?: number, offset?: number, search?: string }): Promise; + /** + * List the projects the OAuth2 access token can access. Resolves the token's `project` authorization details, expanding the `*` wildcard into the concrete set of projects the user can see. + * + * @param {number} limit - Maximum number of projects to return. Between 1 and 5000. + * @param {number} offset - Number of projects to skip before returning results. Used for pagination. + * @param {string} search - Search term to filter your list results. Max length: 256 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listProjects(limit?: number, offset?: number, search?: string): Promise; + listProjects( + paramsOrFirst?: { limit?: number, offset?: number, search?: string } | number, + ...rest: [(number)?, (string)?] + ): Promise { + let params: { limit?: number, offset?: number, search?: string }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { limit?: number, offset?: number, search?: string }; + } else { + params = { + limit: paramsOrFirst as number, + offset: rest[0] as number, + search: rest[1] as string + }; + } + + const limit = params.limit; + const offset = params.offset; + const search = params.search; + + + const apiPath = '/oauth2/{project_id}/projects'.replace('{project_id}', encodeURIComponent(String(this.client.config.project))); + const payload: Payload = {}; + if (typeof limit !== 'undefined') { + payload['limit'] = limit; + } + if (typeof offset !== 'undefined') { + payload['offset'] = offset; + } + if (typeof search !== 'undefined') { + payload['search'] = search; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'accept': 'application/json', + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Reject an OAuth2 grant when the user denies consent. Returns the `redirectUrl` the end user should be sent to with an `access_denied` error. You can pass Accept header of `application/json` to receive a JSON response instead of a redirect. + * + * @param {string} params.grantId - Grant ID made during authorization, provided to consent screen in URL search params. + * @throws {AppwriteException} + * @returns {Promise} + */ + reject(params: { grantId: string }): Promise; + /** + * Reject an OAuth2 grant when the user denies consent. Returns the `redirectUrl` the end user should be sent to with an `access_denied` error. You can pass Accept header of `application/json` to receive a JSON response instead of a redirect. + * + * @param {string} grantId - Grant ID made during authorization, provided to consent screen in URL search params. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + reject(grantId: string): Promise; + reject( + paramsOrFirst: { grantId: string } | string + ): Promise { + let params: { grantId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { grantId: string }; + } else { + params = { + grantId: paramsOrFirst as string + }; + } + + const grantId = params.grantId; + + if (typeof grantId === 'undefined') { + throw new AppwriteException('Missing required parameter: "grantId"'); + } + + const apiPath = '/oauth2/{project_id}/reject'.replace('{project_id}', encodeURIComponent(String(this.client.config.project))); + const payload: Payload = {}; + if (typeof grantId !== 'undefined') { + payload['grant_id'] = grantId; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + 'accept': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Revoke an OAuth2 access token or refresh token. + * + * @param {string} params.token - The access or refresh token to revoke. + * @param {string} params.tokenTypeHint - Type of token to revoke (access_token or refresh_token). + * @param {string} params.clientId - OAuth2 client ID. Either a registered app ID or an HTTPS client ID metadata document URL. + * @param {string} params.clientSecret - OAuth2 client secret. Required for confidential apps; omitted for public apps. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + revoke(params: { token: string, tokenTypeHint?: string, clientId?: string, clientSecret?: string }): Promise<{}>; + /** + * Revoke an OAuth2 access token or refresh token. + * + * @param {string} token - The access or refresh token to revoke. + * @param {string} tokenTypeHint - Type of token to revoke (access_token or refresh_token). + * @param {string} clientId - OAuth2 client ID. Either a registered app ID or an HTTPS client ID metadata document URL. + * @param {string} clientSecret - OAuth2 client secret. Required for confidential apps; omitted for public apps. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + revoke(token: string, tokenTypeHint?: string, clientId?: string, clientSecret?: string): Promise<{}>; + revoke( + paramsOrFirst: { token: string, tokenTypeHint?: string, clientId?: string, clientSecret?: string } | string, + ...rest: [(string)?, (string)?, (string)?] + ): Promise<{}> { + let params: { token: string, tokenTypeHint?: string, clientId?: string, clientSecret?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { token: string, tokenTypeHint?: string, clientId?: string, clientSecret?: string }; + } else { + params = { + token: paramsOrFirst as string, + tokenTypeHint: rest[0] as string, + clientId: rest[1] as string, + clientSecret: rest[2] as string + }; + } + + const token = params.token; + const tokenTypeHint = params.tokenTypeHint; + const clientId = params.clientId; + const clientSecret = params.clientSecret; + + if (typeof token === 'undefined') { + throw new AppwriteException('Missing required parameter: "token"'); + } + + const apiPath = '/oauth2/{project_id}/revoke'.replace('{project_id}', encodeURIComponent(String(this.client.config.project))); + const payload: Payload = {}; + if (typeof token !== 'undefined') { + payload['token'] = token; + } + if (typeof tokenTypeHint !== 'undefined') { + payload['token_type_hint'] = tokenTypeHint; + } + if (typeof clientId !== 'undefined') { + payload['client_id'] = clientId; + } + if (typeof clientSecret !== 'undefined') { + payload['client_secret'] = clientSecret; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + 'accept': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } + + /** + * Exchange an OAuth2 authorization code, refresh token, or device code for access and refresh tokens. + * + * @param {string} params.grantType - OAuth2 grant type. Can be one of: `authorization_code`, `refresh_token`, `urn:ietf:params:oauth:grant-type:device_code`. + * @param {string} params.code - Authorization code to be exchanged for access and refresh tokens. Required for `authorization_code` grant type. + * @param {string} params.refreshToken - Refresh token to be exchanged for a new access and refresh tokens. Required for `refresh_token` grant type. + * @param {string} params.deviceCode - Device code obtained from the device authorization endpoint. Required for `urn:ietf:params:oauth:grant-type:device_code` grant type. + * @param {string} params.clientId - OAuth2 client ID. Either a registered app ID or an HTTPS client ID metadata document URL. + * @param {string} params.clientSecret - OAuth2 client secret. Required for confidential apps. + * @param {string} params.codeVerifier - PKCE code verifier. Required for public apps. + * @param {string} params.redirectUri - Redirect URI. Required for `authorization_code` grant type. + * @param {string} params.resource - RFC 8707 resource indicator URI or URI list. Each value must be an absolute URI without a fragment. + * @param {string} params.audience - Compatibility alias for a single OAuth2 resource indicator URI. + * @throws {AppwriteException} + * @returns {Promise} + */ + createToken(params: { grantType: string, code?: string, refreshToken?: string, deviceCode?: string, clientId?: string, clientSecret?: string, codeVerifier?: string, redirectUri?: string, resource?: string, audience?: string }): Promise; + /** + * Exchange an OAuth2 authorization code, refresh token, or device code for access and refresh tokens. + * + * @param {string} grantType - OAuth2 grant type. Can be one of: `authorization_code`, `refresh_token`, `urn:ietf:params:oauth:grant-type:device_code`. + * @param {string} code - Authorization code to be exchanged for access and refresh tokens. Required for `authorization_code` grant type. + * @param {string} refreshToken - Refresh token to be exchanged for a new access and refresh tokens. Required for `refresh_token` grant type. + * @param {string} deviceCode - Device code obtained from the device authorization endpoint. Required for `urn:ietf:params:oauth:grant-type:device_code` grant type. + * @param {string} clientId - OAuth2 client ID. Either a registered app ID or an HTTPS client ID metadata document URL. + * @param {string} clientSecret - OAuth2 client secret. Required for confidential apps. + * @param {string} codeVerifier - PKCE code verifier. Required for public apps. + * @param {string} redirectUri - Redirect URI. Required for `authorization_code` grant type. + * @param {string} resource - RFC 8707 resource indicator URI or URI list. Each value must be an absolute URI without a fragment. + * @param {string} audience - Compatibility alias for a single OAuth2 resource indicator URI. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createToken(grantType: string, code?: string, refreshToken?: string, deviceCode?: string, clientId?: string, clientSecret?: string, codeVerifier?: string, redirectUri?: string, resource?: string, audience?: string): Promise; + createToken( + paramsOrFirst: { grantType: string, code?: string, refreshToken?: string, deviceCode?: string, clientId?: string, clientSecret?: string, codeVerifier?: string, redirectUri?: string, resource?: string, audience?: string } | string, + ...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?] + ): Promise { + let params: { grantType: string, code?: string, refreshToken?: string, deviceCode?: string, clientId?: string, clientSecret?: string, codeVerifier?: string, redirectUri?: string, resource?: string, audience?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { grantType: string, code?: string, refreshToken?: string, deviceCode?: string, clientId?: string, clientSecret?: string, codeVerifier?: string, redirectUri?: string, resource?: string, audience?: string }; + } else { + params = { + grantType: paramsOrFirst as string, + code: rest[0] as string, + refreshToken: rest[1] as string, + deviceCode: rest[2] as string, + clientId: rest[3] as string, + clientSecret: rest[4] as string, + codeVerifier: rest[5] as string, + redirectUri: rest[6] as string, + resource: rest[7] as string, + audience: rest[8] as string + }; + } + + const grantType = params.grantType; + const code = params.code; + const refreshToken = params.refreshToken; + const deviceCode = params.deviceCode; + const clientId = params.clientId; + const clientSecret = params.clientSecret; + const codeVerifier = params.codeVerifier; + const redirectUri = params.redirectUri; + const resource = params.resource; + const audience = params.audience; + + if (typeof grantType === 'undefined') { + throw new AppwriteException('Missing required parameter: "grantType"'); + } + + const apiPath = '/oauth2/{project_id}/token'.replace('{project_id}', encodeURIComponent(String(this.client.config.project))); + const payload: Payload = {}; + if (typeof grantType !== 'undefined') { + payload['grant_type'] = grantType; + } + if (typeof code !== 'undefined') { + payload['code'] = code; + } + if (typeof refreshToken !== 'undefined') { + payload['refresh_token'] = refreshToken; + } + if (typeof deviceCode !== 'undefined') { + payload['device_code'] = deviceCode; + } + if (typeof clientId !== 'undefined') { + payload['client_id'] = clientId; + } + if (typeof clientSecret !== 'undefined') { + payload['client_secret'] = clientSecret; + } + if (typeof codeVerifier !== 'undefined') { + payload['code_verifier'] = codeVerifier; + } + if (typeof redirectUri !== 'undefined') { + payload['redirect_uri'] = redirectUri; + } + if (typeof resource !== 'undefined') { + payload['resource'] = resource; + } + if (typeof audience !== 'undefined') { + payload['audience'] = audience; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'content-type': 'application/json', + 'accept': 'application/json', + } + + return this.client.call( + 'post', + uri, + apiHeaders, + payload, + ); + } +} diff --git a/src/services/organization.ts b/src/services/organization.ts index 83d4977..e286608 100644 --- a/src/services/organization.ts +++ b/src/services/organization.ts @@ -119,6 +119,301 @@ export class Organization { ); } + /** + * List app installations on the organization. Any organization member can read installations. + * + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + */ + listInstallations(params?: { queries?: string[], total?: boolean }): Promise; + /** + * List app installations on the organization. Any organization member can read installations. + * + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listInstallations(queries?: string[], total?: boolean): Promise; + listInstallations( + paramsOrFirst?: { queries?: string[], total?: boolean } | string[], + ...rest: [(boolean)?] + ): Promise { + let params: { queries?: string[], total?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { queries?: string[], total?: boolean }; + } else { + params = { + queries: paramsOrFirst as string[], + total: rest[0] as boolean + }; + } + + const queries = params.queries; + const total = params.total; + + + const apiPath = '/organization/installations'; + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof total !== 'undefined') { + payload['total'] = total; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Install an app on the organization. Only organization members with the owner role can install apps. The installation is granted the scopes the app currently requests. + * + * @param {string} params.appId - Application unique ID. + * @param {string} params.authorizationDetails - Authorization details granted to the installation as a JSON array of objects, each with a `type` and app-defined fields. The Appwrite Console stores authorized project IDs here. + * @throws {AppwriteException} + * @returns {Promise} + */ + createInstallation(params: { appId: string, authorizationDetails?: string }): Promise; + /** + * Install an app on the organization. Only organization members with the owner role can install apps. The installation is granted the scopes the app currently requests. + * + * @param {string} appId - Application unique ID. + * @param {string} authorizationDetails - Authorization details granted to the installation as a JSON array of objects, each with a `type` and app-defined fields. The Appwrite Console stores authorized project IDs here. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createInstallation(appId: string, authorizationDetails?: string): Promise; + createInstallation( + paramsOrFirst: { appId: string, authorizationDetails?: string } | string, + ...rest: [(string)?] + ): Promise { + let params: { appId: string, authorizationDetails?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { appId: string, authorizationDetails?: string }; + } else { + params = { + appId: paramsOrFirst as string, + authorizationDetails: rest[0] as string + }; + } + + const appId = params.appId; + const authorizationDetails = params.authorizationDetails; + + if (typeof appId === 'undefined') { + throw new AppwriteException('Missing required parameter: "appId"'); + } + + const apiPath = '/organization/installations'; + const payload: Payload = {}; + if (typeof appId !== 'undefined') { + payload['appId'] = appId; + } + if (typeof authorizationDetails !== 'undefined') { + payload['authorizationDetails'] = authorizationDetails; + } + const 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 an app installation on the organization by its unique ID. Any organization member can read installations. + * + * @param {string} params.installationId - Installation unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + getInstallation(params: { installationId: string }): Promise; + /** + * Get an app installation on the organization by its unique ID. Any organization member can read installations. + * + * @param {string} installationId - Installation unique ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getInstallation(installationId: string): Promise; + getInstallation( + paramsOrFirst: { installationId: string } | string + ): Promise { + let params: { installationId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { installationId: string }; + } else { + params = { + installationId: paramsOrFirst as string + }; + } + + const installationId = params.installationId; + + if (typeof installationId === 'undefined') { + throw new AppwriteException('Missing required parameter: "installationId"'); + } + + const apiPath = '/organization/installations/{installationId}'.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, + 'accept': 'application/json', + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update an app installation on the organization. Only organization members with the owner role can update installations. The installation's granted scopes are refreshed to the scopes the app currently requests; previously issued installation access tokens are revoked. + * + * @param {string} params.installationId - Installation unique ID. + * @param {string} params.authorizationDetails - Authorization details granted to the installation as a JSON array of objects, each with a `type` and app-defined fields. Omit to keep the current value. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateInstallation(params: { installationId: string, authorizationDetails?: string }): Promise; + /** + * Update an app installation on the organization. Only organization members with the owner role can update installations. The installation's granted scopes are refreshed to the scopes the app currently requests; previously issued installation access tokens are revoked. + * + * @param {string} installationId - Installation unique ID. + * @param {string} authorizationDetails - Authorization details granted to the installation as a JSON array of objects, each with a `type` and app-defined fields. Omit to keep the current value. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateInstallation(installationId: string, authorizationDetails?: string): Promise; + updateInstallation( + paramsOrFirst: { installationId: string, authorizationDetails?: string } | string, + ...rest: [(string)?] + ): Promise { + let params: { installationId: string, authorizationDetails?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { installationId: string, authorizationDetails?: string }; + } else { + params = { + installationId: paramsOrFirst as string, + authorizationDetails: rest[0] as string + }; + } + + const installationId = params.installationId; + const authorizationDetails = params.authorizationDetails; + + if (typeof installationId === 'undefined') { + throw new AppwriteException('Missing required parameter: "installationId"'); + } + + const apiPath = '/organization/installations/{installationId}'.replace('{installationId}', encodeURIComponent(String(installationId))); + const payload: Payload = {}; + if (typeof authorizationDetails !== 'undefined') { + payload['authorizationDetails'] = authorizationDetails; + } + const 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( + 'put', + uri, + apiHeaders, + payload, + ); + } + + /** + * Uninstall an app from the organization by its installation ID. Only organization members with the owner role can remove installations. Previously issued installation access tokens are revoked. + * + * @param {string} params.installationId - Installation unique ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deleteInstallation(params: { installationId: string }): Promise<{}>; + /** + * Uninstall an app from the organization by its installation ID. Only organization members with the owner role can remove installations. Previously issued installation access tokens are revoked. + * + * @param {string} installationId - Installation unique ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deleteInstallation(installationId: string): Promise<{}>; + deleteInstallation( + paramsOrFirst: { installationId: string } | string + ): Promise<{}> { + let params: { installationId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { installationId: string }; + } else { + params = { + installationId: paramsOrFirst as string + }; + } + + const installationId = params.installationId; + + if (typeof installationId === 'undefined') { + throw new AppwriteException('Missing required parameter: "installationId"'); + } + + const apiPath = '/organization/installations/{installationId}'.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, + ); + } + /** * Get a list of all API keys from the current organization. * diff --git a/src/services/project.ts b/src/services/project.ts index 1d79f2f..747b541 100644 --- a/src/services/project.ts +++ b/src/services/project.ts @@ -974,6 +974,7 @@ export class Project { * @param {number} params.refreshTokenDuration - Refresh token duration in seconds for confidential clients (server-side apps that authenticate with a client secret). Leave empty to use default 1 year. * @param {number} params.publicAccessTokenDuration - Access token duration in seconds for public clients (SPAs, mobile, and native apps that cannot keep a client secret). Leave empty to use default 1 hour. * @param {number} params.publicRefreshTokenDuration - Refresh token duration in seconds for public clients (SPAs, mobile, and native apps that cannot keep a client secret). Leave empty to use default 30 days. + * @param {number} params.installationAccessTokenDuration - Access token duration in seconds for app installation access tokens. Leave empty to use default 1 hour. * @param {boolean} params.confidentialPkce - When enabled, PKCE is required for confidential clients (server-side flows using client_secret). PKCE is always required for public clients regardless of this setting. * @param {string} params.verificationUrl - URL to your application page where users enter the device flow user code. Required to enable the Device Authorization Grant. * @param {number} params.userCodeLength - Number of characters in the device flow user code, excluding the formatting separator. Shorter codes are easier to type but weaker; pair short codes with short expiry. Leave empty to use default 8. @@ -983,7 +984,7 @@ export class Project { * @throws {AppwriteException} * @returns {Promise} */ - updateOAuth2Server(params: { enabled: boolean, authorizationUrl: string, scopes?: string[], authorizationDetailsTypes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, confidentialPkce?: boolean, verificationUrl?: string, userCodeLength?: number, userCodeFormat?: string, deviceCodeDuration?: number, 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[] }): Promise; /** * Update the OAuth2 server (OIDC provider) configuration. * @@ -995,6 +996,7 @@ export class Project { * @param {number} refreshTokenDuration - Refresh token duration in seconds for confidential clients (server-side apps that authenticate with a client secret). Leave empty to use default 1 year. * @param {number} publicAccessTokenDuration - Access token duration in seconds for public clients (SPAs, mobile, and native apps that cannot keep a client secret). Leave empty to use default 1 hour. * @param {number} publicRefreshTokenDuration - Refresh token duration in seconds for public clients (SPAs, mobile, and native apps that cannot keep a client secret). Leave empty to use default 30 days. + * @param {number} installationAccessTokenDuration - Access token duration in seconds for app installation access tokens. Leave empty to use default 1 hour. * @param {boolean} confidentialPkce - When enabled, PKCE is required for confidential clients (server-side flows using client_secret). PKCE is always required for public clients regardless of this setting. * @param {string} verificationUrl - URL to your application page where users enter the device flow user code. Required to enable the Device Authorization Grant. * @param {number} userCodeLength - Number of characters in the device flow user code, excluding the formatting separator. Shorter codes are easier to type but weaker; pair short codes with short expiry. Leave empty to use default 8. @@ -1005,15 +1007,15 @@ export class Project { * @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, 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[]): Promise; updateOAuth2Server( - paramsOrFirst: { enabled: boolean, authorizationUrl: string, scopes?: string[], authorizationDetailsTypes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, confidentialPkce?: boolean, verificationUrl?: string, userCodeLength?: number, userCodeFormat?: string, deviceCodeDuration?: number, defaultScopes?: string[] } | boolean, - ...rest: [(string)?, (string[])?, (string[])?, (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[] } | boolean, + ...rest: [(string)?, (string[])?, (string[])?, (number)?, (number)?, (number)?, (number)?, (number)?, (boolean)?, (string)?, (number)?, (string)?, (number)?, (string[])?] ): Promise { - let params: { enabled: boolean, authorizationUrl: string, scopes?: string[], authorizationDetailsTypes?: string[], accessTokenDuration?: number, refreshTokenDuration?: number, publicAccessTokenDuration?: number, publicRefreshTokenDuration?: number, confidentialPkce?: boolean, verificationUrl?: string, userCodeLength?: number, userCodeFormat?: string, deviceCodeDuration?: number, 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[] }; 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, 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[] }; } else { params = { enabled: paramsOrFirst as boolean, @@ -1024,12 +1026,13 @@ export class Project { refreshTokenDuration: rest[4] as number, publicAccessTokenDuration: rest[5] as number, publicRefreshTokenDuration: rest[6] as number, - confidentialPkce: rest[7] as boolean, - verificationUrl: rest[8] as string, - userCodeLength: rest[9] as number, - userCodeFormat: rest[10] as string, - deviceCodeDuration: rest[11] as number, - defaultScopes: rest[12] as string[] + installationAccessTokenDuration: rest[7] as number, + confidentialPkce: rest[8] as boolean, + verificationUrl: rest[9] as string, + userCodeLength: rest[10] as number, + userCodeFormat: rest[11] as string, + deviceCodeDuration: rest[12] as number, + defaultScopes: rest[13] as string[] }; } @@ -1041,6 +1044,7 @@ export class Project { const refreshTokenDuration = params.refreshTokenDuration; const publicAccessTokenDuration = params.publicAccessTokenDuration; const publicRefreshTokenDuration = params.publicRefreshTokenDuration; + const installationAccessTokenDuration = params.installationAccessTokenDuration; const confidentialPkce = params.confidentialPkce; const verificationUrl = params.verificationUrl; const userCodeLength = params.userCodeLength; @@ -1081,6 +1085,9 @@ export class Project { if (typeof publicRefreshTokenDuration !== 'undefined') { payload['publicRefreshTokenDuration'] = publicRefreshTokenDuration; } + if (typeof installationAccessTokenDuration !== 'undefined') { + payload['installationAccessTokenDuration'] = installationAccessTokenDuration; + } if (typeof confidentialPkce !== 'undefined') { payload['confidentialPkce'] = confidentialPkce; } diff --git a/src/services/sites.ts b/src/services/sites.ts index 314650f..8fde491 100644 --- a/src/services/sites.ts +++ b/src/services/sites.ts @@ -1337,40 +1337,44 @@ export class Sites { * @param {string} params.siteId - Site ID. * @param {string} params.deploymentId - Deployment ID. * @param {DeploymentDownloadType} params.type - Deployment file to download. Can be: "source", "output". + * @param {string} params.token - Presigned source-download token for accessing this deployment without a session (jobs-service). * @throws {AppwriteException} * @returns {Promise} */ - getDeploymentDownload(params: { siteId: string, deploymentId: string, type?: DeploymentDownloadType }): Promise; + getDeploymentDownload(params: { siteId: string, deploymentId: string, type?: DeploymentDownloadType, token?: string }): Promise; /** * Get a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory. * * @param {string} siteId - Site ID. * @param {string} deploymentId - Deployment ID. * @param {DeploymentDownloadType} type - Deployment file to download. Can be: "source", "output". + * @param {string} token - Presigned source-download token for accessing this deployment without a session (jobs-service). * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getDeploymentDownload(siteId: string, deploymentId: string, type?: DeploymentDownloadType): Promise; + getDeploymentDownload(siteId: string, deploymentId: string, type?: DeploymentDownloadType, token?: string): Promise; getDeploymentDownload( - paramsOrFirst: { siteId: string, deploymentId: string, type?: DeploymentDownloadType } | string, - ...rest: [(string)?, (DeploymentDownloadType)?] + paramsOrFirst: { siteId: string, deploymentId: string, type?: DeploymentDownloadType, token?: string } | string, + ...rest: [(string)?, (DeploymentDownloadType)?, (string)?] ): Promise { - let params: { siteId: string, deploymentId: string, type?: DeploymentDownloadType }; + let params: { siteId: string, deploymentId: string, type?: DeploymentDownloadType, token?: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { siteId: string, deploymentId: string, type?: DeploymentDownloadType }; + params = (paramsOrFirst || {}) as { siteId: string, deploymentId: string, type?: DeploymentDownloadType, token?: string }; } else { params = { siteId: paramsOrFirst as string, deploymentId: rest[0] as string, - type: rest[1] as DeploymentDownloadType + type: rest[1] as DeploymentDownloadType, + token: rest[2] as string }; } const siteId = params.siteId; const deploymentId = params.deploymentId; const type = params.type; + const token = params.token; if (typeof siteId === 'undefined') { throw new AppwriteException('Missing required parameter: "siteId"'); @@ -1384,6 +1388,9 @@ export class Sites { if (typeof type !== 'undefined') { payload['type'] = type; } + if (typeof token !== 'undefined') { + payload['token'] = token; + } 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 57baaf2..70bfec6 100644 --- a/src/services/tables-db.ts +++ b/src/services/tables-db.ts @@ -90,10 +90,11 @@ export class TablesDB { * @param {string} params.name - Database name. Max length: 128 chars. * @param {boolean} params.enabled - Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. * @param {string} params.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. * @throws {AppwriteException} * @returns {Promise} */ - create(params: { databaseId: string, name: string, enabled?: boolean, specification?: string }): Promise; + create(params: { databaseId: string, name: string, enabled?: boolean, specification?: string, replicas?: number }): Promise; /** * Create a new Database. * @@ -102,25 +103,27 @@ export class TablesDB { * @param {string} name - Database name. Max length: 128 chars. * @param {boolean} enabled - Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled. * @param {string} 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. * @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): Promise; + create(databaseId: string, name: string, enabled?: boolean, specification?: string, replicas?: number): Promise; create( - paramsOrFirst: { databaseId: string, name: string, enabled?: boolean, specification?: string } | string, - ...rest: [(string)?, (boolean)?, (string)?] + paramsOrFirst: { databaseId: string, name: string, enabled?: boolean, specification?: string, replicas?: number } | string, + ...rest: [(string)?, (boolean)?, (string)?, (number)?] ): Promise { - let params: { databaseId: string, name: string, enabled?: boolean, specification?: string }; + let params: { databaseId: string, name: string, enabled?: boolean, specification?: string, replicas?: number }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, name: string, enabled?: boolean, specification?: string }; + params = (paramsOrFirst || {}) as { databaseId: string, name: string, enabled?: boolean, specification?: string, replicas?: number }; } else { params = { databaseId: paramsOrFirst as string, name: rest[0] as string, enabled: rest[1] as boolean, - specification: rest[2] as string + specification: rest[2] as string, + replicas: rest[3] as number }; } @@ -128,6 +131,7 @@ export class TablesDB { const name = params.name; const enabled = params.enabled; const specification = params.specification; + const replicas = params.replicas; if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); @@ -150,6 +154,9 @@ export class TablesDB { if (typeof specification !== 'undefined') { payload['specification'] = specification; } + if (typeof replicas !== 'undefined') { + payload['replicas'] = replicas; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -166,6 +173,31 @@ export class TablesDB { ); } + /** + * List the dedicated database specifications available on the current plan. Each specification reports its resource limits, pricing, and whether it is enabled for the organization. + * + * @throws {AppwriteException} + * @returns {Promise} + */ + listSpecifications(): Promise { + + const apiPath = '/tablesdb/specifications'; + 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 transactions across all databases. * @@ -569,40 +601,44 @@ 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 {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. * @throws {AppwriteException} * @returns {Promise} */ - update(params: { databaseId: string, name?: string, enabled?: boolean }): Promise; + update(params: { databaseId: string, name?: string, enabled?: boolean, replicas?: number }): 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 {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. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - update(databaseId: string, name?: string, enabled?: boolean): Promise; + update(databaseId: string, name?: string, enabled?: boolean, replicas?: number): Promise; update( - paramsOrFirst: { databaseId: string, name?: string, enabled?: boolean } | string, - ...rest: [(string)?, (boolean)?] + paramsOrFirst: { databaseId: string, name?: string, enabled?: boolean, replicas?: number } | string, + ...rest: [(string)?, (boolean)?, (number)?] ): Promise { - let params: { databaseId: string, name?: string, enabled?: boolean }; + let params: { databaseId: string, name?: string, enabled?: boolean, replicas?: number }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, name?: string, enabled?: boolean }; + params = (paramsOrFirst || {}) as { databaseId: string, name?: string, enabled?: boolean, replicas?: number }; } else { params = { databaseId: paramsOrFirst as string, name: rest[0] as string, - enabled: rest[1] as boolean + enabled: rest[1] as boolean, + replicas: rest[2] as number }; } const databaseId = params.databaseId; const name = params.name; const enabled = params.enabled; + const replicas = params.replicas; if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); @@ -616,6 +652,9 @@ export class TablesDB { if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } + if (typeof replicas !== 'undefined') { + payload['replicas'] = replicas; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { @@ -685,6 +724,174 @@ 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. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected. + * @throws {AppwriteException} + * @returns {Promise} + */ + 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. + * + * @param {string} databaseId - Database ID. + * @param {string} targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createFailover(databaseId: string, targetReplicaId?: string): Promise; + createFailover( + paramsOrFirst: { databaseId: string, targetReplicaId?: string } | string, + ...rest: [(string)?] + ): Promise { + let params: { databaseId: string, targetReplicaId?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { databaseId: string, targetReplicaId?: string }; + } else { + params = { + databaseId: paramsOrFirst as string, + targetReplicaId: rest[0] as string + }; + } + + const databaseId = params.databaseId; + const targetReplicaId = params.targetReplicaId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException('Missing required parameter: "databaseId"'); + } + + const apiPath = '/tablesdb/{databaseId}/failovers'.replace('{databaseId}', encodeURIComponent(String(databaseId))); + const payload: Payload = {}; + if (typeof targetReplicaId !== 'undefined') { + payload['targetReplicaId'] = targetReplicaId; + } + const 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 high availability status for a dedicated database. Returns replica statuses, replication lag, and sync mode. + * + * @param {string} params.databaseId - Database ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + getReplicas(params: { databaseId: string }): Promise; + /** + * Get high availability status for a dedicated database. Returns replica statuses, replication lag, and sync mode. + * + * @param {string} databaseId - Database ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getReplicas(databaseId: string): Promise; + getReplicas( + 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}/replicas'.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, + ); + } + + /** + * Get real-time health and status information for a dedicated database. Returns health status, readiness, uptime, connection info, replica status, and volume information. + * + * @param {string} params.databaseId - Database ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + getStatus(params: { databaseId: string }): Promise; + /** + * Get real-time health and status information for a dedicated database. Returns health status, readiness, uptime, connection info, replica status, and volume information. + * + * @param {string} databaseId - Database ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getStatus(databaseId: string): Promise; + getStatus( + 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}/status'.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, + ); + } + /** * Get a list of all tables that belong to the provided databaseId. You can use the search parameter to filter your results. * diff --git a/src/services/teams.ts b/src/services/teams.ts index 28a9533..a194b2a 100644 --- a/src/services/teams.ts +++ b/src/services/teams.ts @@ -324,6 +324,338 @@ export class Teams { ); } + /** + * List app installations on a team. Any team member can read installations. + * + * @param {string} params.teamId - Team 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. + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + */ + listInstallations(params: { teamId: string, queries?: string[], total?: boolean }): Promise; + /** + * List app installations on a team. Any team member can read installations. + * + * @param {string} teamId - Team 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. + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listInstallations(teamId: string, queries?: string[], total?: boolean): Promise; + listInstallations( + paramsOrFirst: { teamId: string, queries?: string[], total?: boolean } | string, + ...rest: [(string[])?, (boolean)?] + ): Promise { + let params: { teamId: string, queries?: string[], total?: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { teamId: string, queries?: string[], total?: boolean }; + } else { + params = { + teamId: paramsOrFirst as string, + queries: rest[0] as string[], + total: rest[1] as boolean + }; + } + + const teamId = params.teamId; + const queries = params.queries; + const total = params.total; + + if (typeof teamId === 'undefined') { + throw new AppwriteException('Missing required parameter: "teamId"'); + } + + const apiPath = '/teams/{teamId}/installations'.replace('{teamId}', encodeURIComponent(String(teamId))); + const payload: Payload = {}; + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + if (typeof total !== 'undefined') { + payload['total'] = total; + } + const uri = new URL(this.client.config.endpoint + apiPath); + + const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Install an app on a team. When authenticated as a user, only team members with the owner role can install apps. Requests using an API key or in admin mode can install apps on any team. The installation is granted the scopes the app currently requests. + * + * @param {string} params.teamId - Team ID. + * @param {string} params.appId - Application unique ID. + * @param {string} params.authorizationDetails - Authorization details granted to the installation as a JSON array of objects, each with a `type` and app-defined fields. The Appwrite Console stores authorized project IDs here. + * @throws {AppwriteException} + * @returns {Promise} + */ + createInstallation(params: { teamId: string, appId: string, authorizationDetails?: string }): Promise; + /** + * Install an app on a team. When authenticated as a user, only team members with the owner role can install apps. Requests using an API key or in admin mode can install apps on any team. The installation is granted the scopes the app currently requests. + * + * @param {string} teamId - Team ID. + * @param {string} appId - Application unique ID. + * @param {string} authorizationDetails - Authorization details granted to the installation as a JSON array of objects, each with a `type` and app-defined fields. The Appwrite Console stores authorized project IDs here. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createInstallation(teamId: string, appId: string, authorizationDetails?: string): Promise; + createInstallation( + paramsOrFirst: { teamId: string, appId: string, authorizationDetails?: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { teamId: string, appId: string, authorizationDetails?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { teamId: string, appId: string, authorizationDetails?: string }; + } else { + params = { + teamId: paramsOrFirst as string, + appId: rest[0] as string, + authorizationDetails: rest[1] as string + }; + } + + const teamId = params.teamId; + const appId = params.appId; + const authorizationDetails = params.authorizationDetails; + + if (typeof teamId === 'undefined') { + throw new AppwriteException('Missing required parameter: "teamId"'); + } + if (typeof appId === 'undefined') { + throw new AppwriteException('Missing required parameter: "appId"'); + } + + const apiPath = '/teams/{teamId}/installations'.replace('{teamId}', encodeURIComponent(String(teamId))); + const payload: Payload = {}; + if (typeof appId !== 'undefined') { + payload['appId'] = appId; + } + if (typeof authorizationDetails !== 'undefined') { + payload['authorizationDetails'] = authorizationDetails; + } + const 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 an app installation on a team by its unique ID. Any team member can read installations. + * + * @param {string} params.teamId - Team ID. + * @param {string} params.installationId - Installation unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + getInstallation(params: { teamId: string, installationId: string }): Promise; + /** + * Get an app installation on a team by its unique ID. Any team member can read installations. + * + * @param {string} teamId - Team ID. + * @param {string} installationId - Installation unique ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getInstallation(teamId: string, installationId: string): Promise; + getInstallation( + paramsOrFirst: { teamId: string, installationId: string } | string, + ...rest: [(string)?] + ): Promise { + let params: { teamId: string, installationId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { teamId: string, installationId: string }; + } else { + params = { + teamId: paramsOrFirst as string, + installationId: rest[0] as string + }; + } + + const teamId = params.teamId; + const installationId = params.installationId; + + if (typeof teamId === 'undefined') { + throw new AppwriteException('Missing required parameter: "teamId"'); + } + if (typeof installationId === 'undefined') { + throw new AppwriteException('Missing required parameter: "installationId"'); + } + + const apiPath = '/teams/{teamId}/installations/{installationId}'.replace('{teamId}', encodeURIComponent(String(teamId))).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, + 'accept': 'application/json', + } + + return this.client.call( + 'get', + uri, + apiHeaders, + payload, + ); + } + + /** + * Update an app installation on a team. Only team members with the owner role can update installations. The installation's granted scopes are refreshed to the scopes the app currently requests; previously issued installation access tokens are revoked. + * + * @param {string} params.teamId - Team ID. + * @param {string} params.installationId - Installation unique ID. + * @param {string} params.authorizationDetails - Authorization details granted to the installation as a JSON array of objects, each with a `type` and app-defined fields. Omit to keep the current value. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateInstallation(params: { teamId: string, installationId: string, authorizationDetails?: string }): Promise; + /** + * Update an app installation on a team. Only team members with the owner role can update installations. The installation's granted scopes are refreshed to the scopes the app currently requests; previously issued installation access tokens are revoked. + * + * @param {string} teamId - Team ID. + * @param {string} installationId - Installation unique ID. + * @param {string} authorizationDetails - Authorization details granted to the installation as a JSON array of objects, each with a `type` and app-defined fields. Omit to keep the current value. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateInstallation(teamId: string, installationId: string, authorizationDetails?: string): Promise; + updateInstallation( + paramsOrFirst: { teamId: string, installationId: string, authorizationDetails?: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { teamId: string, installationId: string, authorizationDetails?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { teamId: string, installationId: string, authorizationDetails?: string }; + } else { + params = { + teamId: paramsOrFirst as string, + installationId: rest[0] as string, + authorizationDetails: rest[1] as string + }; + } + + const teamId = params.teamId; + const installationId = params.installationId; + const authorizationDetails = params.authorizationDetails; + + if (typeof teamId === 'undefined') { + throw new AppwriteException('Missing required parameter: "teamId"'); + } + if (typeof installationId === 'undefined') { + throw new AppwriteException('Missing required parameter: "installationId"'); + } + + const apiPath = '/teams/{teamId}/installations/{installationId}'.replace('{teamId}', encodeURIComponent(String(teamId))).replace('{installationId}', encodeURIComponent(String(installationId))); + const payload: Payload = {}; + if (typeof authorizationDetails !== 'undefined') { + payload['authorizationDetails'] = authorizationDetails; + } + const 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( + 'put', + uri, + apiHeaders, + payload, + ); + } + + /** + * Uninstall an app from a team by its installation ID. Only team members with the owner role can remove installations. Previously issued installation access tokens are revoked. + * + * @param {string} params.teamId - Team ID. + * @param {string} params.installationId - Installation unique ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + */ + deleteInstallation(params: { teamId: string, installationId: string }): Promise<{}>; + /** + * Uninstall an app from a team by its installation ID. Only team members with the owner role can remove installations. Previously issued installation access tokens are revoked. + * + * @param {string} teamId - Team ID. + * @param {string} installationId - Installation unique ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deleteInstallation(teamId: string, installationId: string): Promise<{}>; + deleteInstallation( + paramsOrFirst: { teamId: string, installationId: string } | string, + ...rest: [(string)?] + ): Promise<{}> { + let params: { teamId: string, installationId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { teamId: string, installationId: string }; + } else { + params = { + teamId: paramsOrFirst as string, + installationId: rest[0] as string + }; + } + + const teamId = params.teamId; + const installationId = params.installationId; + + if (typeof teamId === 'undefined') { + throw new AppwriteException('Missing required parameter: "teamId"'); + } + if (typeof installationId === 'undefined') { + throw new AppwriteException('Missing required parameter: "installationId"'); + } + + const apiPath = '/teams/{teamId}/installations/{installationId}'.replace('{teamId}', encodeURIComponent(String(teamId))).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, + ); + } + /** * Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console. * diff --git a/test/services/account.test.js b/test/services/account.test.js index 21537be..e541ba3 100644 --- a/test/services/account.test.js +++ b/test/services/account.test.js @@ -71,6 +71,116 @@ describe('Account', () => { expect(response).toEqual(data); }); + test('test method listConsents()', async () => { + const data = { + 'total': 5, + 'consents': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await account.listConsents( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method getConsent()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'userId': '5e5ea5c16897e', + 'appId': '5e5ea5c16897e', + 'cimdUrl': 'https://example.com/.well-known/client-metadata.json', + 'scopes': [], + 'resources': [], + 'authorizationDetails': '[{\"type\":\"calendar\",\"identifier\":\"primary\",\"actions\":[\"read_events\",\"create_event\"]}]', + 'expire': '2020-10-15T06:38:00.000+00:00',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await account.getConsent( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method deleteConsent()', async () => { + const data = {message: ""}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await account.deleteConsent( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method listConsentTokens()', async () => { + const data = { + 'total': 5, + 'tokens': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await account.listConsentTokens( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method getConsentToken()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'consentId': '5e5ea5c16897e', + 'userId': '5e5ea5c16897e', + 'appId': '5e5ea5c16897e', + 'cimdUrl': 'https://example.com/.well-known/client-metadata.json', + 'scopes': [], + 'resources': [], + 'authorizationDetails': '[{\"type\":\"calendar\",\"identifier\":\"primary\",\"actions\":[\"read_events\",\"create_event\"]}]', + 'expire': '2020-10-15T06:38:00.000+00:00',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await account.getConsentToken( + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method deleteConsentToken()', async () => { + const data = {message: ""}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await account.deleteConsentToken( + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method updateEmail()', async () => { const data = { '\$id': '5e5ea5c16897e', diff --git a/test/services/activities.test.js b/test/services/activities.test.js index 2823e41..61bc596 100644 --- a/test/services/activities.test.js +++ b/test/services/activities.test.js @@ -41,10 +41,21 @@ describe('Activities', () => { 'ip': '127.0.0.1', 'mode': 'admin', 'country': 'US', + 'continentCode': 'NA', + 'city': 'Mountain View', + 'subdivisions': 'California', + 'isp': 'Google', + 'autonomousSystemNumber': '15169', + 'autonomousSystemOrganization': 'GOOGLE', + 'connectionType': 'cable', + 'connectionUsageType': 'residential', + 'connectionOrganization': 'Google LLC', 'time': '2020-10-15T06:38:00.000+00:00', 'projectId': '610fc2f985ee0', 'teamId': '610fc2f985ee0', - 'hostname': 'appwrite.io',}; + 'hostname': 'appwrite.io', + 'sdk': 'web', + 'sdkVersion': '14.0.0',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await activities.getEvent( diff --git a/test/services/apps.test.js b/test/services/apps.test.js new file mode 100644 index 0000000..34305b3 --- /dev/null +++ b/test/services/apps.test.js @@ -0,0 +1,502 @@ +const { Client } = require("../../dist/client"); +const { InputFile } = require("../../dist/inputFile"); +const { Apps } = require("../../dist/services/apps"); + +const { fetch: mockedFetch, Response } = require("undici"); +jest.mock('undici', () => ({ ...jest.requireActual('undici'), fetch: jest.fn() })); + +describe('Apps', () => { + const client = new Client(); + const apps = new Apps(client); + + + test('test method list()', async () => { + const data = { + 'total': 5, + 'apps': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await apps.list( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method create()', 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 Application', + 'description': 'Connect your workspace to My Application.', + 'clientUri': 'https://example.com', + 'logoUri': 'https://example.com/logo.png', + 'privacyPolicyUrl': 'https://example.com/privacy', + 'termsUrl': 'https://example.com/terms', + 'contacts': [], + 'tagline': 'Automate your workspace.', + 'tags': [], + 'labels': [], + 'images': [], + 'supportUrl': 'https://example.com/support', + 'dataDeletionUrl': 'https://example.com/data-deletion', + 'redirectUris': [], + 'postLogoutRedirectUris': [], + 'enabled': true, + 'type': 'confidential', + 'deviceFlow': true, + 'teamId': '5e5ea5c16897e', + 'userId': '5e5ea5c16897e', + 'installationScopes': [], + 'installationRedirectUrl': 'https://example.com/setup', + 'secrets': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await apps.create( + '', + '', + [], + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method listInstallationScopes()', async () => { + const data = { + 'total': 5, + 'scopes': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await apps.listInstallationScopes( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method listOAuth2Scopes()', async () => { + const data = { + 'total': 5, + 'scopes': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await apps.listOAuth2Scopes( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method get()', 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 Application', + 'description': 'Connect your workspace to My Application.', + 'clientUri': 'https://example.com', + 'logoUri': 'https://example.com/logo.png', + 'privacyPolicyUrl': 'https://example.com/privacy', + 'termsUrl': 'https://example.com/terms', + 'contacts': [], + 'tagline': 'Automate your workspace.', + 'tags': [], + 'labels': [], + 'images': [], + 'supportUrl': 'https://example.com/support', + 'dataDeletionUrl': 'https://example.com/data-deletion', + 'redirectUris': [], + 'postLogoutRedirectUris': [], + 'enabled': true, + 'type': 'confidential', + 'deviceFlow': true, + 'teamId': '5e5ea5c16897e', + 'userId': '5e5ea5c16897e', + 'installationScopes': [], + 'installationRedirectUrl': 'https://example.com/setup', + 'secrets': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await apps.get( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method update()', 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 Application', + 'description': 'Connect your workspace to My Application.', + 'clientUri': 'https://example.com', + 'logoUri': 'https://example.com/logo.png', + 'privacyPolicyUrl': 'https://example.com/privacy', + 'termsUrl': 'https://example.com/terms', + 'contacts': [], + 'tagline': 'Automate your workspace.', + 'tags': [], + 'labels': [], + 'images': [], + 'supportUrl': 'https://example.com/support', + 'dataDeletionUrl': 'https://example.com/data-deletion', + 'redirectUris': [], + 'postLogoutRedirectUris': [], + 'enabled': true, + 'type': 'confidential', + 'deviceFlow': true, + 'teamId': '5e5ea5c16897e', + 'userId': '5e5ea5c16897e', + 'installationScopes': [], + 'installationRedirectUrl': 'https://example.com/setup', + 'secrets': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await apps.update( + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method delete()', async () => { + const data = {message: ""}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await apps.delete( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method listInstallations()', async () => { + const data = { + 'total': 5, + 'installations': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await apps.listInstallations( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method getInstallation()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'appId': '5e5ea5c16897e', + 'teamId': '5e5ea5c16897e', + 'scopes': [], + 'authorizationDetails': {}, + 'createdById': '5e5ea5c16897e', + 'createdByName': 'Walter White',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await apps.getInstallation( + '', + '', + ); + + // 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...', + 'token_type': 'Bearer', + 'expires_in': 3600, + 'refresh_token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...', + 'scope': 'openid email profile',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await apps.createInstallationToken( + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method listKeys()', async () => { + const data = { + 'total': 5, + 'keys': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await apps.listKeys( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method createKey()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'appId': '5e5ea5c16897e', + 'secret': '5f3c8d2a1b9e4f7a6c8b2d1e9f4a7b3c5d8e1f2a9b4c7d6e3f5a8b1c4d7e2f9a', + 'hint': 'f5c6c7', + 'createdById': '5e5ea5c16897e', + 'createdByName': 'Walter White',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await apps.createKey( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method getKey()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'appId': '5e5ea5c16897e', + 'secret': '5f3c8d2a1b9e4f7a6c8b2d1e9f4a7b3c5d8e1f2a9b4c7d6e3f5a8b1c4d7e2f9a', + 'hint': 'f5c6c7', + 'createdById': '5e5ea5c16897e', + 'createdByName': 'Walter White',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await apps.getKey( + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method deleteKey()', async () => { + const data = {message: ""}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await apps.deleteKey( + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateLabels()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'name': 'My Application', + 'description': 'Connect your workspace to My Application.', + 'clientUri': 'https://example.com', + 'logoUri': 'https://example.com/logo.png', + 'privacyPolicyUrl': 'https://example.com/privacy', + 'termsUrl': 'https://example.com/terms', + 'contacts': [], + 'tagline': 'Automate your workspace.', + 'tags': [], + 'labels': [], + 'images': [], + 'supportUrl': 'https://example.com/support', + 'dataDeletionUrl': 'https://example.com/data-deletion', + 'redirectUris': [], + 'postLogoutRedirectUris': [], + 'enabled': true, + 'type': 'confidential', + 'deviceFlow': true, + 'teamId': '5e5ea5c16897e', + 'userId': '5e5ea5c16897e', + 'installationScopes': [], + 'installationRedirectUrl': 'https://example.com/setup', + 'secrets': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await apps.updateLabels( + '', + [], + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method listSecrets()', async () => { + const data = { + 'total': 5, + 'secrets': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await apps.listSecrets( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method createSecret()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'appId': '5e5ea5c16897e', + 'secret': '5f3c8d2a1b9e4f7a6c8b2d1e9f4a7b3c5d8e1f2a9b4c7d6e3f5a8b1c4d7e2f9a', + 'hint': 'f5c6c7', + 'createdById': '5e5ea5c16897e', + 'createdByName': 'Walter White',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await apps.createSecret( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method getSecret()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'appId': '5e5ea5c16897e', + 'secret': '', + 'hint': 'f5c6c7', + 'createdById': '5e5ea5c16897e', + 'createdByName': 'Walter White',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await apps.getSecret( + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method deleteSecret()', async () => { + const data = {message: ""}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await apps.deleteSecret( + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateTeam()', 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 Application', + 'description': 'Connect your workspace to My Application.', + 'clientUri': 'https://example.com', + 'logoUri': 'https://example.com/logo.png', + 'privacyPolicyUrl': 'https://example.com/privacy', + 'termsUrl': 'https://example.com/terms', + 'contacts': [], + 'tagline': 'Automate your workspace.', + 'tags': [], + 'labels': [], + 'images': [], + 'supportUrl': 'https://example.com/support', + 'dataDeletionUrl': 'https://example.com/data-deletion', + 'redirectUris': [], + 'postLogoutRedirectUris': [], + 'enabled': true, + 'type': 'confidential', + 'deviceFlow': true, + 'teamId': '5e5ea5c16897e', + 'userId': '5e5ea5c16897e', + 'installationScopes': [], + 'installationRedirectUrl': 'https://example.com/setup', + 'secrets': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await apps.updateTeam( + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method deleteTokens()', async () => { + const data = {message: ""}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await apps.deleteTokens( + '', + ); + + // 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/backups.test.js b/test/services/backups.test.js index 46f5814..b37c790 100644 --- a/test/services/backups.test.js +++ b/test/services/backups.test.js @@ -203,7 +203,7 @@ describe('Backups', () => { 'migrationId': 'did8jx6ws45jana098ab7', 'services': [], 'resources': [], - 'options': '{databases.database[{oldId, newId, newName, newSpecification}]}',}; + 'options': '{databases.database[{oldId, newId, newName}]}',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await backups.createRestoration( @@ -244,7 +244,7 @@ describe('Backups', () => { 'migrationId': 'did8jx6ws45jana098ab7', 'services': [], 'resources': [], - 'options': '{databases.database[{oldId, newId, newName, newSpecification}]}',}; + 'options': '{databases.database[{oldId, newId, newName}]}',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await backups.getRestoration( diff --git a/test/services/databases.test.js b/test/services/databases.test.js index 2b20a4f..e4172d2 100644 --- a/test/services/databases.test.js +++ b/test/services/databases.test.js @@ -32,9 +32,7 @@ describe('Databases', () => { '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'enabled': true, - 'type': 'legacy', - 'policies': [], - 'archives': [],}; + 'type': 'legacy',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await databases.create( @@ -163,9 +161,7 @@ describe('Databases', () => { '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'enabled': true, - 'type': 'legacy', - 'policies': [], - 'archives': [],}; + 'type': 'legacy',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await databases.get( @@ -185,9 +181,7 @@ describe('Databases', () => { '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'enabled': true, - 'type': 'legacy', - 'policies': [], - 'archives': [],}; + 'type': 'legacy',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await databases.update( diff --git a/test/services/oauth2.test.js b/test/services/oauth2.test.js new file mode 100644 index 0000000..b1bf4c4 --- /dev/null +++ b/test/services/oauth2.test.js @@ -0,0 +1,224 @@ +const { Client } = require("../../dist/client"); +const { InputFile } = require("../../dist/inputFile"); +const { Oauth2 } = require("../../dist/services/oauth-2"); + +const { fetch: mockedFetch, Response } = require("undici"); +jest.mock('undici', () => ({ ...jest.requireActual('undici'), fetch: jest.fn() })); + +describe('Oauth2', () => { + const client = new Client(); + const oauth2 = new Oauth2(client); + + + test('test method approve()', async () => { + const data = { + 'redirectUrl': 'https://example.com/callback?code=abcde&state=fghij',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await oauth2.approve( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method authorize()', async () => { + const data = { + 'grantId': '5e5ea5c16897e', + 'redirectUrl': 'https://example.com/callback?code=abcde&state=fghij',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await oauth2.authorize( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method authorizePost()', async () => { + const data = { + 'grantId': '5e5ea5c16897e', + 'redirectUrl': 'https://example.com/callback?code=abcde&state=fghij',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await oauth2.authorizePost( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method createDeviceAuthorization()', async () => { + const data = { + 'device_code': '5f3c8d2a1b9e4f7a6c8b2d1e9f4a7b3c5d8e1f2a9b4c7d6e3f5a8b1c4d7e2f9a', + 'user_code': 'ABCD-EFGH', + 'verification_uri': 'https://cloud.appwrite.io/console/oauth2/device', + 'verification_uri_complete': 'https://cloud.appwrite.io/console/oauth2/device?user_code=ABCD-EFGH', + 'expires_in': 900, + 'interval': 5,}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await oauth2.createDeviceAuthorization( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method createGrant()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'userId': '5e5ea5c16897e', + 'appId': '5e5ea5c16897e', + 'scopes': [], + 'resources': [], + 'authorizationDetails': '[{\"type\":\"calendar\",\"identifier\":\"primary\",\"actions\":[\"read_events\",\"create_event\"]}]', + 'prompt': 'login', + 'redirectUri': 'https://example.com/callback', + 'authTime': 1592981250, + 'expire': '2020-10-15T06:38:00.000+00:00',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await oauth2.createGrant( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method getGrant()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'userId': '5e5ea5c16897e', + 'appId': '5e5ea5c16897e', + 'scopes': [], + 'resources': [], + 'authorizationDetails': '[{\"type\":\"calendar\",\"identifier\":\"primary\",\"actions\":[\"read_events\",\"create_event\"]}]', + 'prompt': 'login', + 'redirectUri': 'https://example.com/callback', + 'authTime': 1592981250, + 'expire': '2020-10-15T06:38:00.000+00:00',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await oauth2.getGrant( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method listOrganizations()', async () => { + const data = { + 'total': 5, + 'organizations': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await oauth2.listOrganizations( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method createPAR()', async () => { + const data = { + 'request_uri': 'urn:appwrite:oauth2:request:5e5ea5c16897e', + 'expires_in': 600,}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await oauth2.createPAR( + '', + 'https://example.com', + 'code', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method listProjects()', async () => { + const data = { + 'total': 5, + 'projects': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await oauth2.listProjects( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method reject()', async () => { + const data = { + 'redirectUrl': 'https://example.com/callback?error=access_denied&state=fghij',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await oauth2.reject( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method revoke()', async () => { + const data = {message: ""}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await oauth2.revoke( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method createToken()', async () => { + const data = { + 'access_token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9...', + 'token_type': 'Bearer', + 'expires_in': 3600, + 'refresh_token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...', + 'scope': 'openid email profile',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await oauth2.createToken( + '', + ); + + // 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 69a6ea4..e4d0532 100644 --- a/test/services/organization.test.js +++ b/test/services/organization.test.js @@ -118,6 +118,104 @@ describe('Organization', () => { expect(response).toEqual(data); }); + test('test method listInstallations()', async () => { + const data = { + 'total': 5, + 'installations': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await organization.listInstallations( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method createInstallation()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'appId': '5e5ea5c16897e', + 'teamId': '5e5ea5c16897e', + 'scopes': [], + 'authorizationDetails': {}, + 'createdById': '5e5ea5c16897e', + 'createdByName': 'Walter White',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await organization.createInstallation( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method getInstallation()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'appId': '5e5ea5c16897e', + 'teamId': '5e5ea5c16897e', + 'scopes': [], + 'authorizationDetails': {}, + 'createdById': '5e5ea5c16897e', + 'createdByName': 'Walter White',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await organization.getInstallation( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateInstallation()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'appId': '5e5ea5c16897e', + 'teamId': '5e5ea5c16897e', + 'scopes': [], + 'authorizationDetails': {}, + 'createdById': '5e5ea5c16897e', + 'createdByName': 'Walter White',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await organization.updateInstallation( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method deleteInstallation()', async () => { + const data = {message: ""}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await organization.deleteInstallation( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method listKeys()', async () => { const data = { 'total': 5, @@ -380,7 +478,8 @@ describe('Organization', () => { 'services': [], 'protocols': [], 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'wafEnabled': true,}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await organization.createProject( @@ -422,7 +521,8 @@ describe('Organization', () => { 'services': [], 'protocols': [], 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'wafEnabled': true,}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await organization.getProject( @@ -463,7 +563,8 @@ describe('Organization', () => { 'services': [], 'protocols': [], 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'wafEnabled': true,}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await organization.updateProject( diff --git a/test/services/project.test.js b/test/services/project.test.js index 48aaf8e..3f535e9 100644 --- a/test/services/project.test.js +++ b/test/services/project.test.js @@ -38,7 +38,8 @@ describe('Project', () => { 'services': [], 'protocols': [], 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'wafEnabled': true,}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.get( @@ -91,7 +92,8 @@ describe('Project', () => { 'services': [], 'protocols': [], 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'wafEnabled': true,}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateAuthMethod( @@ -259,7 +261,8 @@ describe('Project', () => { 'services': [], 'protocols': [], 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'wafEnabled': true,}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateLabels( @@ -400,7 +403,8 @@ describe('Project', () => { 'services': [], 'protocols': [], 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'wafEnabled': true,}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateOAuth2Server( @@ -1493,7 +1497,8 @@ describe('Project', () => { 'services': [], 'protocols': [], 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'wafEnabled': true,}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateDenyAliasedEmailPolicy( @@ -1534,7 +1539,8 @@ describe('Project', () => { 'services': [], 'protocols': [], 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'wafEnabled': true,}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateDenyCorporateEmailPolicy( @@ -1575,7 +1581,8 @@ describe('Project', () => { 'services': [], 'protocols': [], 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'wafEnabled': true,}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateDenyDisposableEmailPolicy( @@ -1616,7 +1623,8 @@ describe('Project', () => { 'services': [], 'protocols': [], 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'wafEnabled': true,}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateDenyFreeEmailPolicy( @@ -1657,7 +1665,8 @@ describe('Project', () => { 'services': [], 'protocols': [], 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'wafEnabled': true,}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateMembershipPrivacyPolicy( @@ -1697,7 +1706,8 @@ describe('Project', () => { 'services': [], 'protocols': [], 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'wafEnabled': true,}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updatePasswordDictionaryPolicy( @@ -1738,7 +1748,8 @@ describe('Project', () => { 'services': [], 'protocols': [], 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'wafEnabled': true,}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updatePasswordHistoryPolicy( @@ -1779,7 +1790,8 @@ describe('Project', () => { 'services': [], 'protocols': [], 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'wafEnabled': true,}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updatePasswordPersonalDataPolicy( @@ -1839,7 +1851,8 @@ describe('Project', () => { 'services': [], 'protocols': [], 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'wafEnabled': true,}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateSessionAlertPolicy( @@ -1880,7 +1893,8 @@ describe('Project', () => { 'services': [], 'protocols': [], 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'wafEnabled': true,}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateSessionDurationPolicy( @@ -1921,7 +1935,8 @@ describe('Project', () => { 'services': [], 'protocols': [], 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'wafEnabled': true,}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateSessionInvalidationPolicy( @@ -1962,7 +1977,8 @@ describe('Project', () => { 'services': [], 'protocols': [], 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'wafEnabled': true,}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateSessionLimitPolicy( @@ -2003,7 +2019,8 @@ describe('Project', () => { 'services': [], 'protocols': [], 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'wafEnabled': true,}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateUserLimitPolicy( @@ -2060,7 +2077,8 @@ describe('Project', () => { 'services': [], 'protocols': [], 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'wafEnabled': true,}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateProtocol( @@ -2102,7 +2120,8 @@ describe('Project', () => { 'services': [], 'protocols': [], 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'wafEnabled': true,}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateService( @@ -2144,7 +2163,8 @@ describe('Project', () => { 'services': [], 'protocols': [], 'blocks': [], - 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00',}; + 'consoleAccessedAt': '2020-10-15T06:38:00.000+00:00', + 'wafEnabled': true,}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await project.updateSMTP( diff --git a/test/services/tables-d-b.test.js b/test/services/tables-d-b.test.js index 513c5b7..654a20a 100644 --- a/test/services/tables-d-b.test.js +++ b/test/services/tables-d-b.test.js @@ -32,9 +32,7 @@ describe('TablesDB', () => { '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'enabled': true, - 'type': 'legacy', - 'policies': [], - 'archives': [],}; + 'type': 'legacy',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await tablesDB.create( @@ -48,6 +46,22 @@ describe('TablesDB', () => { expect(response).toEqual(data); }); + test('test method listSpecifications()', async () => { + const data = { + 'specifications': [], + 'total': 9, + 'pricing': {},}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await tablesDB.listSpecifications( + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method listTransactions()', async () => { const data = { 'total': 5, @@ -163,9 +177,7 @@ describe('TablesDB', () => { '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'enabled': true, - 'type': 'legacy', - 'policies': [], - 'archives': [],}; + 'type': 'legacy',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await tablesDB.get( @@ -185,9 +197,7 @@ describe('TablesDB', () => { '\$createdAt': '2020-10-15T06:38:00.000+00:00', '\$updatedAt': '2020-10-15T06:38:00.000+00:00', 'enabled': true, - 'type': 'legacy', - 'policies': [], - 'archives': [],}; + 'type': 'legacy',}; mockedFetch.mockImplementation(() => Response.json(data)); const response = await tablesDB.update( @@ -214,6 +224,106 @@ describe('TablesDB', () => { expect(response).toEqual(data); }); + test('test method createFailover()', 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', + 'name': 'My Production Database', + 'api': 'postgresql', + 'engine': 'postgresql', + 'version': '16', + 'specification': 's-2vcpu-2gb', + 'backend': 'edge', + 'hostname': 'db-myproject-mydb.fra.appwrite.center', + 'connectionPort': 5432, + 'connectionUser': 'appwrite_user', + 'connectionPassword': '••••••••', + 'connectionString': 'postgresql://user:pass@db-myproject-mydb.fra.appwrite.center:5432/postgres?sslmode=require', + 'ssl': true, + 'status': 'ready', + 'containerStatus': 'active', + 'lifecycleState': 'active', + 'idleTimeoutMinutes': 15, + 'cpu': 2000, + 'memory': 4096, + 'storage': 100, + 'storageClass': 'ssd', + 'storageMaxGb': 100, + 'nodePool': 'db-pool-4vcpu-8gb', + 'replicas': 2, + 'syncMode': 'async', + 'crossRegionReplicas': 1, + 'networkMaxConnections': 500, + 'networkIdleTimeoutSeconds': 900, + 'networkIPAllowlist': [], + 'backupEnabled': true, + 'pitr': true, + 'pitrRetentionDays': 14, + 'storageAutoscaling': true, + 'storageAutoscalingThresholdPercent': 85, + 'storageAutoscalingMaxGb': 500, + 'maintenanceWindowDay': 'sun', + 'maintenanceWindowHourUtc': 3, + 'metricsEnabled': true, + 'sqlApiEnabled': true, + 'sqlApiAllowedStatements': [], + 'sqlApiMaxRows': 10000, + 'sqlApiMaxBytes': 10485760, + 'sqlApiTimeoutSeconds': 30, + 'error': '',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await tablesDB.createFailover( + '', + ); + + // 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', + 'members': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await tablesDB.getReplicas( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method getStatus()', async () => { + const data = { + 'health': 'healthy', + 'ready': true, + 'engine': 'postgresql', + 'version': '17', + 'uptime': 86400, + 'connections': {}, + 'replicas': [], + 'volumes': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await tablesDB.getStatus( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method listTables()', async () => { const data = { 'total': 5, diff --git a/test/services/teams.test.js b/test/services/teams.test.js index 0054c3e..dfa5365 100644 --- a/test/services/teams.test.js +++ b/test/services/teams.test.js @@ -101,6 +101,109 @@ describe('Teams', () => { expect(response).toEqual(data); }); + test('test method listInstallations()', async () => { + const data = { + 'total': 5, + 'installations': [],}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await teams.listInstallations( + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method createInstallation()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'appId': '5e5ea5c16897e', + 'teamId': '5e5ea5c16897e', + 'scopes': [], + 'authorizationDetails': {}, + 'createdById': '5e5ea5c16897e', + 'createdByName': 'Walter White',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await teams.createInstallation( + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method getInstallation()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'appId': '5e5ea5c16897e', + 'teamId': '5e5ea5c16897e', + 'scopes': [], + 'authorizationDetails': {}, + 'createdById': '5e5ea5c16897e', + 'createdByName': 'Walter White',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await teams.getInstallation( + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method updateInstallation()', async () => { + const data = { + '\$id': '5e5ea5c16897e', + '\$createdAt': '2020-10-15T06:38:00.000+00:00', + '\$updatedAt': '2020-10-15T06:38:00.000+00:00', + 'appId': '5e5ea5c16897e', + 'teamId': '5e5ea5c16897e', + 'scopes': [], + 'authorizationDetails': {}, + 'createdById': '5e5ea5c16897e', + 'createdByName': 'Walter White',}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await teams.updateInstallation( + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + + test('test method deleteInstallation()', async () => { + const data = {message: ""}; + mockedFetch.mockImplementation(() => Response.json(data)); + + const response = await teams.deleteInstallation( + '', + '', + ); + + // Remove custom toString method on the objects to allow for clean data comparison. + delete response.toString; + + expect(response).toEqual(data); + }); + test('test method listMemberships()', async () => { const data = { 'total': 5, From 2868e94278101cc37a2fcf28d27bcdf64e7961a9 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 23 Jul 2026 17:01:30 +0530 Subject: [PATCH 6/6] chore: update Node.js SDK to 27.1.0 --- .github/workflows/publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 48121d6..9f7045d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,10 +14,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Use Node.js - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: '24.14.1' registry-url: 'https://registry.npmjs.org'