From a87d96a5688699c13b83515af3386e679dc8fcf2 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 13 Jul 2026 10:46:18 +0530 Subject: [PATCH 1/5] chore: update React Native SDK to 0.34.0 --- .github/workflows/publish.yml | 3 +- CHANGELOG.md | 8 +- package-lock.json | 954 +++++++++++++++++----------------- package.json | 6 +- src/client.ts | 18 +- src/enums/o-auth-provider.ts | 1 + src/models.ts | 46 +- src/query.ts | 30 ++ src/services/account.ts | 8 +- 9 files changed, 589 insertions(+), 485 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ee63d526..48121d67 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 14a02ca2..c691690f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,16 @@ # Change log +## 0.34.0 + +* Added: `Client.setBearer()` method for OAuth access token authentication +* Added: `Query.vectorDot`, `Query.vectorCosine`, and `Query.vectorEuclidean` vector similarity queries +* Added: `Appwrite` value to the `OAuthProvider` enum +* Added: optional geolocation fields (`city`, `timeZone`, `latitude`, `isp`, etc.) to `Models.Locale` + ## 0.33.0 * Added: Realtime connections now send the configured JWT for authentication. * Added: Forwarded `impersonateUserId` on `avatars` and `storage` file requests. -* Fixed: URL-encode path parameters across all services. ## 0.32.0 diff --git a/package-lock.json b/package-lock.json index b66460b6..29339f34 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "react-native-appwrite", - "version": "0.33.0", + "version": "0.34.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "react-native-appwrite", - "version": "0.33.0", + "version": "0.34.0", "license": "BSD-3-Clause", "dependencies": { "expo-file-system": "18.*.*", @@ -17,16 +17,27 @@ "@rollup/plugin-typescript": "12.3.0", "@types/json-bigint": "1.0.4", "playwright": "1.59.0", - "rollup": "4.60.1", + "rollup": "4.62.2", "serve-handler": "6.1.7", "tslib": "2.8.1", - "typescript": "5.7.3" + "typescript": "5.9.3" }, "engines": { "node": ">=18.0.0" }, "peerDependencies": { "expo": "*" + }, + "overrides": { + "glob": { + ".": "^13.0.0", + "brace-expansion": "^5.0.6" + }, + "rimraf": "^6.0.0", + "@xmldom/xmldom": "^0.9.10", + "uuid": "^14.0.0", + "postcss": "^8.5.12", + "ws": "^8.20.1" } }, "node_modules/@babel/code-frame": { @@ -1127,36 +1138,37 @@ } }, "node_modules/@expo/cli": { - "version": "56.1.15", - "resolved": "https://registry.npmjs.org/@expo/cli/-/cli-56.1.15.tgz", - "integrity": "sha512-ik6++YzURB2d/mSEfYwbuNa19uOWZwVHy9THCQ/pPr6mzplKl4w9I4nlYF9lx7oluNC3NvxsSZ8/rgpVKEOJTA==", + "version": "57.0.6", + "resolved": "https://registry.npmjs.org/@expo/cli/-/cli-57.0.6.tgz", + "integrity": "sha512-14wEb2e8lctlxGARbinUEr+9EmrTR2jIgcaPBBkZXDFMRJmdoY0ic18JuFJPi+7CuQ4XWiGK6obN4VK2PXosLA==", "license": "MIT", "peer": true, "dependencies": { "@expo/code-signing-certificates": "^0.0.6", - "@expo/config": "~56.0.9", - "@expo/config-plugins": "~56.0.8", + "@expo/config": "~57.0.3", + "@expo/config-plugins": "~57.0.3", "@expo/devcert": "^1.2.1", - "@expo/env": "~2.3.0", - "@expo/image-utils": "^0.10.1", - "@expo/inline-modules": "^0.0.11", - "@expo/json-file": "^10.2.0", - "@expo/log-box": "^56.0.13", + "@expo/env": "~2.4.1", + "@expo/image-utils": "^0.11.1", + "@expo/inline-modules": "^0.1.2", + "@expo/json-file": "^11.0.0", + "@expo/log-box": "^57.0.0", "@expo/metro": "~56.0.0", - "@expo/metro-config": "~56.0.14", - "@expo/metro-file-map": "^56.0.3", - "@expo/osascript": "^2.6.0", - "@expo/package-manager": "^1.12.1", - "@expo/plist": "^0.7.0", - "@expo/prebuild-config": "^56.0.15", - "@expo/require-utils": "^56.1.3", - "@expo/router-server": "^56.0.13", - "@expo/schema-utils": "^56.0.0", + "@expo/metro-config": "~57.0.3", + "@expo/metro-file-map": "^57.0.0", + "@expo/osascript": "^2.7.0", + "@expo/package-manager": "^1.13.0", + "@expo/plist": "^0.8.0", + "@expo/prebuild-config": "^57.0.5", + "@expo/require-utils": "^57.0.1", + "@expo/router-server": "^57.0.2", + "@expo/schema-utils": "^57.0.1", "@expo/spawn-async": "^1.8.0", "@expo/ws-tunnel": "^2.0.0", "@expo/xcpretty": "^4.4.4", - "@react-native/dev-middleware": "0.85.3", + "@react-native/dev-middleware": "0.86.0", "accepts": "^1.3.8", + "agent-cli-detector": "^0.1.2", "arg": "^5.0.2", "bplist-creator": "0.1.0", "bplist-parser": "^0.3.1", @@ -1166,7 +1178,7 @@ "connect": "^3.7.0", "debug": "^4.3.4", "dnssd-advertise": "^1.1.4", - "expo-server": "^56.0.5", + "expo-server": "^57.0.0", "fetch-nodeshim": "^0.4.10", "getenv": "^2.0.0", "glob": "^13.0.0", @@ -1219,16 +1231,16 @@ } }, "node_modules/@expo/config": { - "version": "56.0.9", - "resolved": "https://registry.npmjs.org/@expo/config/-/config-56.0.9.tgz", - "integrity": "sha512-/lqFeWGSrhpKJVP8tTN8LjuoIe8u8q2w7FzBL0C+wHgl+WM8l1qUIEYWy/sMvsG/NbpUIUsDHJRhQvOkU58eIw==", + "version": "57.0.3", + "resolved": "https://registry.npmjs.org/@expo/config/-/config-57.0.3.tgz", + "integrity": "sha512-IshqjjpGtT7wj86pxgsfMD1/abNMfu1wZ07ubyYO29l+PWa0eAh2TcpyLcyBaqo01IonF6646xWwrCPcdlUl3Q==", "license": "MIT", "peer": true, "dependencies": { - "@expo/config-plugins": "~56.0.8", - "@expo/config-types": "^56.0.5", - "@expo/json-file": "^10.2.0", - "@expo/require-utils": "^56.1.3", + "@expo/config-plugins": "~57.0.3", + "@expo/config-types": "^57.0.1", + "@expo/json-file": "^11.0.0", + "@expo/require-utils": "^57.0.1", "deepmerge": "^4.3.1", "getenv": "^2.0.0", "glob": "^13.0.0", @@ -1238,16 +1250,16 @@ } }, "node_modules/@expo/config-plugins": { - "version": "56.0.8", - "resolved": "https://registry.npmjs.org/@expo/config-plugins/-/config-plugins-56.0.8.tgz", - "integrity": "sha512-phTuyBhgVLfqUHMjQkAfRtbyoY6yTxoKja1awtpVnEkoJDxPJuXx1KX5uvq1eZtt4bJQ08OBJ6P95INqRSHpRg==", + "version": "57.0.3", + "resolved": "https://registry.npmjs.org/@expo/config-plugins/-/config-plugins-57.0.3.tgz", + "integrity": "sha512-J3P2T7FoOE9P3TuLcJXwt8jISKRxo7UntTzbJ/Qc5F7QXenNntk/4t1XndVkLucYjpnHArPd9xzDXuxxKEHVbQ==", "license": "MIT", "peer": true, "dependencies": { - "@expo/config-types": "^56.0.5", - "@expo/json-file": "~10.2.0", - "@expo/plist": "^0.7.0", - "@expo/require-utils": "^56.1.3", + "@expo/config-types": "^57.0.1", + "@expo/json-file": "~11.0.0", + "@expo/plist": "^0.8.0", + "@expo/require-utils": "^57.0.1", "@expo/sdk-runtime-versions": "^1.0.0", "chalk": "^4.1.2", "debug": "^4.3.5", @@ -1260,9 +1272,9 @@ } }, "node_modules/@expo/config-types": { - "version": "56.0.5", - "resolved": "https://registry.npmjs.org/@expo/config-types/-/config-types-56.0.5.tgz", - "integrity": "sha512-GsAHO/MwW9ZRdgnmyfRXqVGLCP/zejD6rWnp5OROp8mBGRObKm4HfrjlUyT1skjMwCj1OrURx9ZfIc6yeBAkIA==", + "version": "57.0.1", + "resolved": "https://registry.npmjs.org/@expo/config-types/-/config-types-57.0.1.tgz", + "integrity": "sha512-fo7d/Ym28uwGzdTV2leEvpsb9t+7i8YHjy471m31+cmDt4BRd/l7e94JHyrXAq4SWOBVus16S0JLqm89SRCCdw==", "license": "MIT", "peer": true }, @@ -1288,9 +1300,9 @@ } }, "node_modules/@expo/devtools": { - "version": "56.0.2", - "resolved": "https://registry.npmjs.org/@expo/devtools/-/devtools-56.0.2.tgz", - "integrity": "sha512-ANl4kPdbe0/HQYWkDEN79S6bQhI+i/ZCnPxuC853pPsB4svhINC7Ku9lmGOKPsUUWWnrHg1spkDGQBZ4sD6JxQ==", + "version": "57.0.0", + "resolved": "https://registry.npmjs.org/@expo/devtools/-/devtools-57.0.0.tgz", + "integrity": "sha512-i8ITQmf/wB0JNQ2gASFOKvqo1zRWCl/VfPlFRXdz6UkHen4s31NmMy0zmumS+pMpwn0+gA6oU4FF4zRDRG488Q==", "license": "MIT", "peer": true, "dependencies": { @@ -1310,9 +1322,9 @@ } }, "node_modules/@expo/dom-webview": { - "version": "56.0.5", - "resolved": "https://registry.npmjs.org/@expo/dom-webview/-/dom-webview-56.0.5.tgz", - "integrity": "sha512-UIEJxkLg6cHqofKrpWpkn9E6ApxVRtCgZhZkARPr9VV7rBVloJgeroTHs31YgU/JpbI5lLQOnfOlGo54W6C2Ew==", + "version": "57.0.0", + "resolved": "https://registry.npmjs.org/@expo/dom-webview/-/dom-webview-57.0.0.tgz", + "integrity": "sha512-zBZw52KnaHf9zGVp1eJk8kNfc+5ArGf+KvTL3SeMsr03K6tPJtLbgycVLjrAiLMfhzqGVjPD2G+rbNwpbLUxcg==", "license": "MIT", "peer": true, "peerDependencies": { @@ -1322,9 +1334,9 @@ } }, "node_modules/@expo/env": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@expo/env/-/env-2.3.0.tgz", - "integrity": "sha512-9HnnIbzwTTdbwSjNLXTk0fPm9ZwMJ7c1/31tsni8HZ8Q62KzYCyspahH+V365vg5J6lr001DzNwBxVWSaYCQLg==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@expo/env/-/env-2.4.1.tgz", + "integrity": "sha512-3c9Mg9x0HmGPEsVrGAGyEDJsNUOZ55cZvZ47/HLmXh7MHV9Zv7My73wThklKrObaBBoMfE4YqpKjYKDRzojpjQ==", "license": "MIT", "peer": true, "dependencies": { @@ -1337,20 +1349,20 @@ } }, "node_modules/@expo/expo-modules-macros-plugin": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/@expo/expo-modules-macros-plugin/-/expo-modules-macros-plugin-0.2.2.tgz", - "integrity": "sha512-4IMzPDIo/VOXREQjsJtliSfqYVZvfzU2SLFS/9sKMWF848S8CHx+e/E+Vf0TcMvpWCCKX5umyqxb13KJJ+YUzg==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@expo/expo-modules-macros-plugin/-/expo-modules-macros-plugin-0.3.0.tgz", + "integrity": "sha512-2tRq8kiIZTVZcI5uggh86HefQ7s++Zk5WkFFomNp4aUqyN5ownHHvj1jPEP9jWXaXjPDmWuf5SUZTGD5G6AKkg==", "license": "MIT", "peer": true }, "node_modules/@expo/fingerprint": { - "version": "0.19.4", - "resolved": "https://registry.npmjs.org/@expo/fingerprint/-/fingerprint-0.19.4.tgz", - "integrity": "sha512-PsowRlO8+S7JlO8go7yhNEXp7sqlsWDE2AlCwoss7zH0dcajXFo74Fy0KdXEc4UXK7kKoHD37oDgsZ8aHSLr7A==", + "version": "0.20.3", + "resolved": "https://registry.npmjs.org/@expo/fingerprint/-/fingerprint-0.20.3.tgz", + "integrity": "sha512-WDV2hS87C61TsX55w4A0cPnbnN8bqdVHp2MpZsJTvB4Tv4TITgSxWYhRj/xv0pwcZvKHn05MBg6AfHPNj9o5Sw==", "license": "MIT", "peer": true, "dependencies": { - "@expo/env": "^2.3.0", + "@expo/env": "^2.4.1", "@expo/spawn-async": "^1.8.0", "arg": "^5.0.2", "chalk": "^4.1.2", @@ -1367,13 +1379,13 @@ } }, "node_modules/@expo/image-utils": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/@expo/image-utils/-/image-utils-0.10.1.tgz", - "integrity": "sha512-YDeefvmYdihS7Wp3ESDUVnOgOSWmj2Cczm9lVNDdm4MqQLdAKm/LPYg83HtFQPfefRlAxyHrQR/O9kIXN9C1Wg==", + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/@expo/image-utils/-/image-utils-0.11.1.tgz", + "integrity": "sha512-0JueH4vdgAZQmhlSYFvTQzt4b4NO5cnByDuApw7bMUIjhwLRnT46Ki3ritMrzJMQaO2lLK2flInZbsZbOuy8nw==", "license": "MIT", "peer": true, "dependencies": { - "@expo/require-utils": "^56.1.3", + "@expo/require-utils": "^57.0.1", "@expo/spawn-async": "^1.8.0", "chalk": "^4.0.0", "getenv": "^2.0.0", @@ -1383,19 +1395,19 @@ } }, "node_modules/@expo/inline-modules": { - "version": "0.0.11", - "resolved": "https://registry.npmjs.org/@expo/inline-modules/-/inline-modules-0.0.11.tgz", - "integrity": "sha512-ZlIfKL61DPnW8YUTdMEjMA31xrDDV6p7Xi8rWYyhd5qXBV8MwGwjuJ7vKeaVaMjRqxJk1N9lv7zlfyvQpRCNNw==", + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@expo/inline-modules/-/inline-modules-0.1.2.tgz", + "integrity": "sha512-wc5wH4ND647Ne/6A/ESuelcqOQUEvK8MYjjvbp5wcl59dECk7juh0cFOJjAWkpc4pLTcvqXBSRcUDpGWm5XNWg==", "license": "MIT", "peer": true, "dependencies": { - "@expo/config-plugins": "~56.0.8" + "@expo/config-plugins": "~57.0.3" } }, "node_modules/@expo/json-file": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/@expo/json-file/-/json-file-10.2.0.tgz", - "integrity": "sha512-S6XzKe3R9GQeHiUPXc3xJjOv2VJhOEwFYf7xdC2z2cUqt3kZJ9mSO877sNQloVdnW/SUCtPY3bexlM7nwq+CAQ==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@expo/json-file/-/json-file-11.0.0.tgz", + "integrity": "sha512-pHJCETqFL5x5BzNV6cEPwjwuECgGmnl0bNmfHIJ6LM1tlh2eVXi5HEdit3zby/JO/B8Otk5cgcqtJXgvvUat3A==", "license": "MIT", "peer": true, "dependencies": { @@ -1404,29 +1416,29 @@ } }, "node_modules/@expo/local-build-cache-provider": { - "version": "56.0.8", - "resolved": "https://registry.npmjs.org/@expo/local-build-cache-provider/-/local-build-cache-provider-56.0.8.tgz", - "integrity": "sha512-UsuXwpNi57MNhzZ3be4XThc8xW6nzk3Wu37s1+2qcfZGeJcMLKDFfwO6n8YXeIiGlCsOi0Ee1rsTdgjrKt/YJQ==", + "version": "57.0.2", + "resolved": "https://registry.npmjs.org/@expo/local-build-cache-provider/-/local-build-cache-provider-57.0.2.tgz", + "integrity": "sha512-/8/FoYrEBJZPG4wR8kO6REI4VRCPAStD+7wS/Ds6XXddxhmyMP3pvUJz/c3icyAoqpbqeZZkR6E1ptT5Gi5iXg==", "license": "MIT", "peer": true, "dependencies": { - "@expo/config": "~56.0.9", + "@expo/config": "~57.0.2", "chalk": "^4.1.2" } }, "node_modules/@expo/log-box": { - "version": "56.0.13", - "resolved": "https://registry.npmjs.org/@expo/log-box/-/log-box-56.0.13.tgz", - "integrity": "sha512-QWRZSpWPyjkDLVQio4R7oAzg/Av2MOt/DciFkfjr8qQ3qxGVn1Rt1oHP/80hvcWDcHFV7N6PqpyxRXw6nbxzKQ==", + "version": "57.0.0", + "resolved": "https://registry.npmjs.org/@expo/log-box/-/log-box-57.0.0.tgz", + "integrity": "sha512-tt9x76IEE8hp2FWTLPfEArrTyD7GCoUe3TpohESy+SPZ/OqkUnSXz40xnUuE0XbE132z8c5CRCfXQLM9DTEknQ==", "license": "MIT", "peer": true, "dependencies": { - "@expo/dom-webview": "^56.0.5", + "@expo/dom-webview": "^57.0.0", "anser": "^1.4.9", "stacktrace-parser": "^0.1.10" }, "peerDependencies": { - "@expo/dom-webview": "^56.0.5", + "@expo/dom-webview": "^57.0.0", "expo": "*", "react": "*", "react-native": "*" @@ -1456,20 +1468,20 @@ } }, "node_modules/@expo/metro-config": { - "version": "56.0.14", - "resolved": "https://registry.npmjs.org/@expo/metro-config/-/metro-config-56.0.14.tgz", - "integrity": "sha512-O3CIHruaTJhswPAf/nf3i8QQ3f2jl+mEwSea1eb3khuplabdy/wTQz+JvHN8VGUFyg7JKwUGU1QfO6T3JiSQqA==", + "version": "57.0.3", + "resolved": "https://registry.npmjs.org/@expo/metro-config/-/metro-config-57.0.3.tgz", + "integrity": "sha512-k7qcjTe1xDrUW15Ue86WAsJSL0ubiSluBXVNRFoe9snAWhMzBGzdZfl9XiDf4TNUV43T0L1ch+n4GmDqamvfEg==", "license": "MIT", "peer": true, "dependencies": { "@babel/code-frame": "^7.20.0", "@babel/core": "^7.20.0", "@babel/generator": "^7.20.5", - "@expo/config": "~56.0.9", - "@expo/env": "~2.3.0", - "@expo/json-file": "~10.2.0", + "@expo/config": "~57.0.2", + "@expo/env": "~2.4.1", + "@expo/json-file": "~11.0.0", "@expo/metro": "~56.0.0", - "@expo/require-utils": "^56.1.3", + "@expo/require-utils": "^57.0.1", "@expo/spawn-async": "^1.8.0", "@jridgewell/gen-mapping": "^0.3.13", "@jridgewell/remapping": "^2.3.5", @@ -1479,7 +1491,7 @@ "debug": "^4.3.2", "getenv": "^2.0.0", "glob": "^13.0.0", - "hermes-parser": "^0.33.3", + "hermes-parser": "^0.36.0", "jsc-safe-url": "^0.2.4", "lightningcss": "^1.30.1", "picomatch": "^4.0.4", @@ -1496,9 +1508,9 @@ } }, "node_modules/@expo/metro-file-map": { - "version": "56.0.3", - "resolved": "https://registry.npmjs.org/@expo/metro-file-map/-/metro-file-map-56.0.3.tgz", - "integrity": "sha512-5OGW3z8LgEYgMJOR7F3pC8llFLkb1fVqwAewbCl6S4Vkha8AFQMwOjT+9Wbka+V4rmpljpGqOnMhF4xZbD961w==", + "version": "57.0.0", + "resolved": "https://registry.npmjs.org/@expo/metro-file-map/-/metro-file-map-57.0.0.tgz", + "integrity": "sha512-/sxwKQmwpYFYjFT6VYFpgldTwSv53OCx4/UCpLCv9iqQLVQ30hFEJsxGA9Jif8n9pacigK4P5/0ZJ2zMHm6arA==", "license": "MIT", "peer": true, "dependencies": { @@ -1511,9 +1523,9 @@ } }, "node_modules/@expo/osascript": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@expo/osascript/-/osascript-2.6.0.tgz", - "integrity": "sha512-QvqDBlJXa8CS2vRORJ4wEflY1m0vVI07uSJdIRgBrLxRPBcsrXxrtU7+wXRXMqfq9zLwNP9XbvRsXF2omoDylg==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/@expo/osascript/-/osascript-2.7.0.tgz", + "integrity": "sha512-wKIXL8UtbuX4KwavPasIW3CUcgTbYfjzLcgUhjyKUAYDEqMaf6gmU1bqz3ffBPTokmX+G8/vFG1ZuI9etQWukA==", "license": "MIT", "peer": true, "dependencies": { @@ -1524,13 +1536,13 @@ } }, "node_modules/@expo/package-manager": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@expo/package-manager/-/package-manager-1.12.1.tgz", - "integrity": "sha512-fQLiFAcFRWF53mtuLK32SUJQ1ahhrTcBZPZPedYTiUT5ha5FF+UO6bPtCc0Y/hgj0/m3HCGBAuSHjbg2kI9oPQ==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@expo/package-manager/-/package-manager-1.13.0.tgz", + "integrity": "sha512-s3W3eZafJDEyVL7W/jxj2Nz3eONKxSCU604S5xj8ijrVaRz83x0DnZznLf/UXQEI1w+FyibH68nHeQyk767b1A==", "license": "MIT", "peer": true, "dependencies": { - "@expo/json-file": "^10.2.0", + "@expo/json-file": "^11.0.0", "@expo/spawn-async": "^1.8.0", "chalk": "^4.0.0", "npm-package-arg": "^11.0.0", @@ -1539,9 +1551,9 @@ } }, "node_modules/@expo/plist": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@expo/plist/-/plist-0.7.0.tgz", - "integrity": "sha512-vrpryU1GoqSIRNqRB2D3IjXDmzNYfiQpEF6AH/xknlD7eiYmEDt3mb26V7cLcedcPG8PY/1xWHdBXVQJfEAh6Q==", + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@expo/plist/-/plist-0.8.0.tgz", + "integrity": "sha512-24JlUJI4PwHN4PLydlzFEzCdiqybfaV5t04QBkOg8em3AjvHKbMgBGlKreiuOoc0rNa3DZ21ZqL+xLGMBLQNKQ==", "license": "MIT", "peer": true, "dependencies": { @@ -1551,28 +1563,28 @@ } }, "node_modules/@expo/prebuild-config": { - "version": "56.0.15", - "resolved": "https://registry.npmjs.org/@expo/prebuild-config/-/prebuild-config-56.0.15.tgz", - "integrity": "sha512-6GC+QjdCkzp/5wjsqgfu/B2+2yf5MyZMtzf9szIPrLt9uKhzV2PdyM0vU0kvbj1YT8weHCtO7bsrzimman0sjA==", + "version": "57.0.5", + "resolved": "https://registry.npmjs.org/@expo/prebuild-config/-/prebuild-config-57.0.5.tgz", + "integrity": "sha512-KnKx6Iu4jppbNVtt9yTrN10OVoPZlOYYyLZuarY70u6fgUO9lYKDa06Hxv+PmIwcnygfj2CSBBl5ewBqS2bxtw==", "license": "MIT", "peer": true, "dependencies": { - "@expo/config": "~56.0.9", - "@expo/config-plugins": "~56.0.8", - "@expo/config-types": "^56.0.5", - "@expo/image-utils": "^0.10.1", - "@expo/json-file": "^10.2.0", - "@react-native/normalize-colors": "0.85.3", + "@expo/config": "~57.0.2", + "@expo/config-plugins": "~57.0.3", + "@expo/config-types": "^57.0.1", + "@expo/image-utils": "^0.11.1", + "@expo/json-file": "^11.0.0", + "@react-native/normalize-colors": "0.86.0", "debug": "^4.3.1", - "expo-modules-autolinking": "~56.0.15", + "expo-modules-autolinking": "~57.0.5", "resolve-from": "^5.0.0", "semver": "^7.6.0" } }, "node_modules/@expo/require-utils": { - "version": "56.1.3", - "resolved": "https://registry.npmjs.org/@expo/require-utils/-/require-utils-56.1.3.tgz", - "integrity": "sha512-KyLeOn/zzQSvuPpV5YhB/FPKnpQytno4luN918bGdPDssLBoS3N/0UbC3W0rJAn9kSFu+XpfR81eABRVsSdfgQ==", + "version": "57.0.1", + "resolved": "https://registry.npmjs.org/@expo/require-utils/-/require-utils-57.0.1.tgz", + "integrity": "sha512-uXen5/4x7j60I5slShgZr5QEtJDBK8homFiNLDnDrNrxZhrRHXASo0H6JArs3/1PDzw1wahzhGWg2WKuYyZd0A==", "license": "MIT", "peer": true, "dependencies": { @@ -1590,21 +1602,21 @@ } }, "node_modules/@expo/router-server": { - "version": "56.0.14", - "resolved": "https://registry.npmjs.org/@expo/router-server/-/router-server-56.0.14.tgz", - "integrity": "sha512-2UCTtZfcq1ZPgp3wk8/+sq9DvFI9UxrPr1jcEKMAF2DGAJLosnpc8GWNNg2hkjt6SHUOdFHIPxujWPYyho2y3A==", + "version": "57.0.2", + "resolved": "https://registry.npmjs.org/@expo/router-server/-/router-server-57.0.2.tgz", + "integrity": "sha512-hu9qhnq2PKuwMXIoRMAa2+HUeqSut9HwiQf3a62tfGTIxPN3rKUZ10TozEEB+Pd/7WIa238sXMS5v1YhTuC9gA==", "license": "MIT", "peer": true, "dependencies": { "debug": "^4.3.4" }, "peerDependencies": { - "@expo/metro-runtime": "^56.0.15", + "@expo/metro-runtime": "^57.0.3", "expo": "*", - "expo-constants": "^56.0.18", - "expo-font": "^56.0.6", + "expo-constants": "^57.0.3", + "expo-font": "^57.0.0", "expo-router": "*", - "expo-server": "^56.0.5", + "expo-server": "^57.0.0", "react": "*", "react-dom": "*", "react-server-dom-webpack": "~19.0.1 || ~19.1.2 || ~19.2.1" @@ -1625,9 +1637,9 @@ } }, "node_modules/@expo/schema-utils": { - "version": "56.0.1", - "resolved": "https://registry.npmjs.org/@expo/schema-utils/-/schema-utils-56.0.1.tgz", - "integrity": "sha512-CZ/+mYbQmWeOnkCGlWy9K+lFxbJSMFY7+TqBZcKzBSTU5Q7IGRvn/sOG3TdNjIdLPmbA8xe7R/c3UUQ28R9i9w==", + "version": "57.0.1", + "resolved": "https://registry.npmjs.org/@expo/schema-utils/-/schema-utils-57.0.1.tgz", + "integrity": "sha512-IVdaqtP3+iHFRE/y22mKijQtZanLcB18q1zi2kfN6RINTCryyzM7qHGsWHc5LBJbOuj1G4avCOECs97hOJm0GQ==", "license": "MIT", "peer": true }, @@ -1786,29 +1798,28 @@ } }, "node_modules/@react-native/babel-plugin-codegen": { - "version": "0.85.3", - "resolved": "https://registry.npmjs.org/@react-native/babel-plugin-codegen/-/babel-plugin-codegen-0.85.3.tgz", - "integrity": "sha512-Wc94zGfeFG8Njf9SHMPfYZP04kjigkOps6F1TYTvd7ZVXuGxqseCDgxc50LWcOhOCLypI9n3oVVqz81C3p44ZA==", + "version": "0.86.0", + "resolved": "https://registry.npmjs.org/@react-native/babel-plugin-codegen/-/babel-plugin-codegen-0.86.0.tgz", + "integrity": "sha512-qdsABWNW7uTll90l4Vh03gjeyu3WVDi2CyiiyvYGMRDcoYbjbQi6df3BMAm9lQI2yslZ1T14LlDDAsgTwNxplA==", "license": "MIT", "peer": true, "dependencies": { "@babel/traverse": "^7.29.0", - "@react-native/codegen": "0.85.3" + "@react-native/codegen": "0.86.0" }, "engines": { "node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0" } }, "node_modules/@react-native/codegen": { - "version": "0.85.3", - "resolved": "https://registry.npmjs.org/@react-native/codegen/-/codegen-0.85.3.tgz", - "integrity": "sha512-/JkS1lGLyzBWP1FbgDwaqEf7qShIC6pUC1M0a/YMAd/v4iqR24MRkQWe7jkYvcBQ2LpEhs5NGE9InhxSv21zCA==", + "version": "0.86.0", + "resolved": "https://registry.npmjs.org/@react-native/codegen/-/codegen-0.86.0.tgz", + "integrity": "sha512-uTs9DBo3+/lUqinsGZK0FKJRBVClrwMXoZToaDxE1Q2SL2e55vs2GwyZfIKzPl5uJnbu4PfFMIp0/mLXLWUMuA==", "license": "MIT", - "peer": true, "dependencies": { "@babel/core": "^7.25.2", "@babel/parser": "^7.29.0", - "hermes-parser": "0.33.3", + "hermes-parser": "0.36.0", "invariant": "^2.2.4", "nullthrows": "^1.1.1", "tinyglobby": "^0.2.15", @@ -1821,6 +1832,21 @@ "@babel/core": "*" } }, + "node_modules/@react-native/codegen/node_modules/hermes-estree": { + "version": "0.36.0", + "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.36.0.tgz", + "integrity": "sha512-A1+8zn5oss2CFP7pKsOaxorQG6FNIz1WU1VDqruLPPZl3LVgeE2C5xfFg8Ow6/Ow4mSslLLtYP1J3n38eKyW9w==", + "license": "MIT" + }, + "node_modules/@react-native/codegen/node_modules/hermes-parser": { + "version": "0.36.0", + "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.36.0.tgz", + "integrity": "sha512-GdpwMmH5x6IpC1cijvcvYnlPB60Mh6kTSF/NFdYV/j56gYdi+0RIakYs+eqOV+bbO0SW7mgVVGSsTJxyPQfo3w==", + "license": "MIT", + "dependencies": { + "hermes-estree": "0.36.0" + } + }, "node_modules/@react-native/community-cli-plugin": { "version": "0.86.0", "resolved": "https://registry.npmjs.org/@react-native/community-cli-plugin/-/community-cli-plugin-0.86.0.tgz", @@ -1851,7 +1877,7 @@ } } }, - "node_modules/@react-native/community-cli-plugin/node_modules/@react-native/debugger-frontend": { + "node_modules/@react-native/debugger-frontend": { "version": "0.86.0", "resolved": "https://registry.npmjs.org/@react-native/debugger-frontend/-/debugger-frontend-0.86.0.tgz", "integrity": "sha512-7Mb3nDfyJeys+ELF75Ageu7VKERlnIMoO+aNPoXqTXvz+b41L6l2CqMyLpDHxkBSlenij6gEepPNgaIyWHbJZw==", @@ -1860,7 +1886,7 @@ "node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0" } }, - "node_modules/@react-native/community-cli-plugin/node_modules/@react-native/debugger-shell": { + "node_modules/@react-native/debugger-shell": { "version": "0.86.0", "resolved": "https://registry.npmjs.org/@react-native/debugger-shell/-/debugger-shell-0.86.0.tgz", "integrity": "sha512-Y0zEkZzLz8ou6o/VLml1A31X/rMgc6DRjwxwzPMa94qRTMY070WeBCNTITQo4kKTBAUgbxh07oXPQqp0Tpja8w==", @@ -1874,7 +1900,7 @@ "node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0" } }, - "node_modules/@react-native/community-cli-plugin/node_modules/@react-native/dev-middleware": { + "node_modules/@react-native/dev-middleware": { "version": "0.86.0", "resolved": "https://registry.npmjs.org/@react-native/dev-middleware/-/dev-middleware-0.86.0.tgz", "integrity": "sha512-20pTO6yTybmvXvro520H6C7jydIQnLKOl5qFtVEcHSdFrY63r3OGei+Rx9bILgSRmH6jgnfEcijcMx7pwWuQtw==", @@ -1897,55 +1923,6 @@ "node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0" } }, - "node_modules/@react-native/debugger-frontend": { - "version": "0.85.3", - "resolved": "https://registry.npmjs.org/@react-native/debugger-frontend/-/debugger-frontend-0.85.3.tgz", - "integrity": "sha512-uAu7rM5o/Np1zgp6fi5zM1sP1aB8DcS7DdOLcj/TkSutOAjkMqqd2lWt1/+3S7qXexRHVK5XcP+o3VXo4L/V0A==", - "license": "BSD-3-Clause", - "peer": true, - "engines": { - "node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0" - } - }, - "node_modules/@react-native/debugger-shell": { - "version": "0.85.3", - "resolved": "https://registry.npmjs.org/@react-native/debugger-shell/-/debugger-shell-0.85.3.tgz", - "integrity": "sha512-/jRAaT9boiCttIcEwS02WPwYkUihqsjSaK/TMtHz05vT6uMgac9PaQt5kzBQLIABv5aEIa5gtrMmKVz49MjkjQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "cross-spawn": "^7.0.6", - "debug": "^4.4.0", - "fb-dotslash": "0.5.8" - }, - "engines": { - "node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0" - } - }, - "node_modules/@react-native/dev-middleware": { - "version": "0.85.3", - "resolved": "https://registry.npmjs.org/@react-native/dev-middleware/-/dev-middleware-0.85.3.tgz", - "integrity": "sha512-JYzBiT4A8w+KQt+dOD5v+ti+tDrGoPnsSTuApq3Ls4RB5sfWbDlYMyz3dbc8qBIHz9tv0sQ5+eOu6Xwqzr5AQA==", - "license": "MIT", - "peer": true, - "dependencies": { - "@isaacs/ttlcache": "^1.4.1", - "@react-native/debugger-frontend": "0.85.3", - "@react-native/debugger-shell": "0.85.3", - "chrome-launcher": "^0.15.2", - "chromium-edge-launcher": "^0.3.0", - "connect": "^3.6.5", - "debug": "^4.4.0", - "invariant": "^2.2.4", - "nullthrows": "^1.1.1", - "open": "^7.0.3", - "serve-static": "^1.16.2", - "ws": "^7.5.10" - }, - "engines": { - "node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0" - } - }, "node_modules/@react-native/gradle-plugin": { "version": "0.86.0", "resolved": "https://registry.npmjs.org/@react-native/gradle-plugin/-/gradle-plugin-0.86.0.tgz", @@ -1965,11 +1942,10 @@ } }, "node_modules/@react-native/normalize-colors": { - "version": "0.85.3", - "resolved": "https://registry.npmjs.org/@react-native/normalize-colors/-/normalize-colors-0.85.3.tgz", - "integrity": "sha512-hj0PScZEhIbcOvQV5yMKX3ha4XEIOy/SVE1Rrpp0beW0dpNLOgSC7KDxGewmDnIHK9YdQUXGY9eMEfShUMIaZw==", - "license": "MIT", - "peer": true + "version": "0.86.0", + "resolved": "https://registry.npmjs.org/@react-native/normalize-colors/-/normalize-colors-0.86.0.tgz", + "integrity": "sha512-kG0wfCGghUKlfxkJyyHCDVutWVYWK7/DG58ojA/4v9EfulgF+osuSQmlbNb3rcKX58qutm7JcldSeVLgGFha9g==", + "license": "MIT" }, "node_modules/@react-native/virtualized-lists": { "version": "0.86.0", @@ -2045,9 +2021,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.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" ], @@ -2059,9 +2035,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.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" ], @@ -2073,9 +2049,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.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" ], @@ -2087,9 +2063,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.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.62.2.tgz", + "integrity": "sha512-yl0y2vq3S3lHeuXhEdss6TWfKW8vkujImO12tn4ZkG/4oghr09LvdYm2RElVjokTQiUvDUGXLGsYeLqUMCKpGA==", "cpu": [ "x64" ], @@ -2101,9 +2077,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.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" ], @@ -2115,9 +2091,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.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" ], @@ -2129,13 +2105,16 @@ ] }, "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.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": [ @@ -2143,13 +2122,16 @@ ] }, "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.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": [ @@ -2157,13 +2139,16 @@ ] }, "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.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": [ @@ -2171,13 +2156,16 @@ ] }, "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.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": [ @@ -2185,13 +2173,16 @@ ] }, "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.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": [ @@ -2199,13 +2190,16 @@ ] }, "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.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": [ @@ -2213,13 +2207,16 @@ ] }, "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.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": [ @@ -2227,13 +2224,16 @@ ] }, "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.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": [ @@ -2241,13 +2241,16 @@ ] }, "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.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": [ @@ -2255,13 +2258,16 @@ ] }, "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.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": [ @@ -2269,13 +2275,16 @@ ] }, "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.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": [ @@ -2283,13 +2292,16 @@ ] }, "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.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": [ @@ -2297,13 +2309,16 @@ ] }, "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.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": [ @@ -2311,9 +2326,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.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" ], @@ -2325,9 +2340,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.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.62.2.tgz", + "integrity": "sha512-8hOJnxgbyObnCm5AlRA3A931xX19xq80RjVTKgJOvEKWqJruP/Uf12IbAOaDjjEXYRewwHLfmF0YRIdK3OwKWA==", "cpu": [ "arm64" ], @@ -2339,9 +2354,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.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" ], @@ -2353,9 +2368,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.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" ], @@ -2367,9 +2382,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.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" ], @@ -2381,9 +2396,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.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" ], @@ -2439,12 +2454,12 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "25.9.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-25.9.3.tgz", - "integrity": "sha512-603BddQMv3pUcr4U2dhujk83N2tTDVr/34wII2B6bJy6g+8WD6yUb11jszNs0gdi4PesVWl7ABt8nYMVpnLUcg==", + "version": "26.1.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-26.1.1.tgz", + "integrity": "sha512-nxAkRSVkN1Y0JC1W8ky/fTfkGsMmcrRsbx+3XoZE+rMOX71kLYTV7fLXpqud1GpbpP5TuffXFqfX7fH2GgZREw==", "license": "MIT", "dependencies": { - "undici-types": ">=7.24.0 <7.24.7" + "undici-types": "~8.3.0" } }, "node_modules/@types/yargs": { @@ -2463,9 +2478,9 @@ "license": "MIT" }, "node_modules/@ungap/structured-clone": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.1.tgz", - "integrity": "sha512-mUFwbeTqrVgDQxFveS+df2yfap6iuP20NAKAsBt5jDEoOTDew+zwLAOilHCeQJOVSvmgCX4ogqIrA0mnyr08yQ==", + "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==", "license": "ISC", "peer": true }, @@ -2506,9 +2521,9 @@ } }, "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==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.17.0.tgz", + "integrity": "sha512-xRQbDb9BnwDafYNn6Vwl839DYVjqXYb1XVGtWAZ1kcDc6iwAL4hg3B1dZlRiuENFeO2H53gFG3in621AdERVAg==", "license": "MIT", "bin": { "acorn": "bin/acorn" @@ -2526,6 +2541,19 @@ "node": ">= 14" } }, + "node_modules/agent-cli-detector": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/agent-cli-detector/-/agent-cli-detector-0.1.2.tgz", + "integrity": "sha512-qdZ/9JFORtTKJNhT/IczMeEfEUbUU0K5umYeiIQHX+AjHs+Y9SXVzSgaYlpZeyNMrvuh2HpZiOTpvS57iPfBkQ==", + "license": "MIT", + "peer": true, + "bin": { + "agent-cli-detector": "dist/cli.js" + }, + "engines": { + "node": ">=18.18" + } + }, "node_modules/anser": { "version": "1.4.10", "resolved": "https://registry.npmjs.org/anser/-/anser-1.4.10.tgz", @@ -2675,13 +2703,13 @@ "peer": true }, "node_modules/babel-plugin-syntax-hermes-parser": { - "version": "0.33.3", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-hermes-parser/-/babel-plugin-syntax-hermes-parser-0.33.3.tgz", - "integrity": "sha512-/Z9xYdaJ1lC0pT9do6TqCqhOSLfZ5Ot8D5za1p+feEfWYupCOfGbhhEXN9r2ZgJtDNUNRw/Z+T2CvAGKBqtqWA==", + "version": "0.36.1", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-hermes-parser/-/babel-plugin-syntax-hermes-parser-0.36.1.tgz", + "integrity": "sha512-ycduwJbvdvIMmVvlAZqGggS+pm5Eu4Bk9pcV9Sm2Z4PJNRVsKkv0g7vHj+LeuC1gHTeF67sJXFOq61IlqCa2hA==", "license": "MIT", "peer": true, "dependencies": { - "hermes-parser": "0.33.3" + "hermes-parser": "0.36.1" } }, "node_modules/babel-plugin-transform-flow-enums": { @@ -2695,9 +2723,9 @@ } }, "node_modules/babel-preset-expo": { - "version": "56.0.15", - "resolved": "https://registry.npmjs.org/babel-preset-expo/-/babel-preset-expo-56.0.15.tgz", - "integrity": "sha512-0MqbQoM6nBUbKvgu2xJ4VixZnUTGTq3HB2WwvOikdO4CiPxbQ+wGA25fOoHHSni5iEFW39wy6y1ookTWlq3wVw==", + "version": "57.0.2", + "resolved": "https://registry.npmjs.org/babel-preset-expo/-/babel-preset-expo-57.0.2.tgz", + "integrity": "sha512-PgsWlNSlNhnSkU4UCAcvl252CaB7VU1eQuSvJoRSiqfrZDGmeqwQmMUs+PcS5VUppFwmmhVlDPwOc7kR3Qr08Q==", "license": "MIT", "peer": true, "dependencies": { @@ -2737,17 +2765,17 @@ "@babel/plugin-transform-typescript": "^7.25.2", "@babel/plugin-transform-unicode-regex": "^7.24.7", "@babel/preset-typescript": "^7.23.0", - "@react-native/babel-plugin-codegen": "0.85.3", + "@react-native/babel-plugin-codegen": "0.86.0", "babel-plugin-react-compiler": "^1.0.0", "babel-plugin-react-native-web": "~0.21.0", - "babel-plugin-syntax-hermes-parser": "^0.33.3", + "babel-plugin-syntax-hermes-parser": "^0.36.0", "babel-plugin-transform-flow-enums": "^0.0.2", "debug": "^4.3.4" }, "peerDependencies": { "@babel/runtime": "^7.20.0", "expo": "*", - "expo-widgets": "^56.0.18", + "expo-widgets": "^57.0.3", "react-refresh": ">=0.14.0 <1.0.0" }, "peerDependenciesMeta": { @@ -2793,9 +2821,9 @@ "license": "MIT" }, "node_modules/baseline-browser-mapping": { - "version": "2.10.35", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.35.tgz", - "integrity": "sha512-honAfLBde0HAFLdNyBEfuuENkF6zR+ozxqxa/2zJKHBe1qzLqyTSeRKpdPEHAP03rlDGyQOPnCSxnVpVqQo9Mg==", + "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==", "license": "Apache-2.0", "bin": { "baseline-browser-mapping": "dist/cli.cjs" @@ -2847,9 +2875,9 @@ } }, "node_modules/brace-expansion": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz", - "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==", + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.7.tgz", + "integrity": "sha512-7oFy703dxfY3/NLxC1fh2SUCQ0H9rmAY+5EpDVfXjUTTs+HEwR2nYaqLv+GWcTsumwxPfiz6CzCNkwXwBUwqCA==", "license": "MIT", "peer": true, "dependencies": { @@ -2872,9 +2900,9 @@ } }, "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==", "funding": [ { "type": "opencollective", @@ -2891,10 +2919,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": { @@ -2942,9 +2970,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==", "funding": [ { "type": "opencollective", @@ -3323,9 +3351,9 @@ } }, "node_modules/dnssd-advertise": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/dnssd-advertise/-/dnssd-advertise-1.1.4.tgz", - "integrity": "sha512-AmGyK9WpNf06WeP5TjHZq/wNzP76OuEeaiTlKr9E/EEelYLczywUKoqRz+DPRq/ErssjT4lU+/W7wzJW+7K/ZA==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/dnssd-advertise/-/dnssd-advertise-1.1.6.tgz", + "integrity": "sha512-Ndrrf6BMPalkQPd/zubL+4YghH2J9NspapQ09uDXwYbvOPkP0oaqf5CkcwJ0b50kS2O3ul6yVu+jz+RY62Cejg==", "license": "MIT", "peer": true }, @@ -3336,9 +3364,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.371", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.371.tgz", - "integrity": "sha512-e9htk9mAYL6AzmkEhSvVVw7IWGSBJ/Bqdn2eRyRLrj1g6sncN4WbFt5qnILYoCktktr45pyjIrOiRvBThQ808w==", + "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==", "license": "ISC" }, "node_modules/emoji-regex": { @@ -3427,32 +3455,32 @@ } }, "node_modules/expo": { - "version": "56.0.11", - "resolved": "https://registry.npmjs.org/expo/-/expo-56.0.11.tgz", - "integrity": "sha512-YqF+q+JqfobDU5yFym3h1vQqzbl7rFiDB4wAJEyK6NK+KLeyf4pfzydQcNTyqLXQKcQBG1reBJExfDShoAYTzw==", + "version": "57.0.4", + "resolved": "https://registry.npmjs.org/expo/-/expo-57.0.4.tgz", + "integrity": "sha512-5wW0SR6OnGUh+UPb3JWlFTAL22IgBcX36RqofjLAH2AuFqxAIpYIdwr9BYR9Wl3xyIe0t9lCoMQIZlAIZUNQvg==", "license": "MIT", "peer": true, "dependencies": { "@babel/runtime": "^7.20.0", - "@expo/cli": "^56.1.15", - "@expo/config": "~56.0.9", - "@expo/config-plugins": "~56.0.8", - "@expo/devtools": "~56.0.2", - "@expo/dom-webview": "~56.0.5", - "@expo/fingerprint": "^0.19.4", - "@expo/local-build-cache-provider": "^56.0.8", - "@expo/log-box": "^56.0.13", + "@expo/cli": "^57.0.6", + "@expo/config": "~57.0.3", + "@expo/config-plugins": "~57.0.3", + "@expo/devtools": "~57.0.0", + "@expo/dom-webview": "~57.0.0", + "@expo/fingerprint": "^0.20.3", + "@expo/local-build-cache-provider": "^57.0.2", + "@expo/log-box": "^57.0.0", "@expo/metro": "~56.0.0", - "@expo/metro-config": "~56.0.14", + "@expo/metro-config": "~57.0.3", "@ungap/structured-clone": "^1.3.0", - "babel-preset-expo": "~56.0.15", - "expo-asset": "~56.0.17", - "expo-constants": "~56.0.18", - "expo-file-system": "~56.0.8", - "expo-font": "~56.0.6", - "expo-keep-awake": "~56.0.3", - "expo-modules-autolinking": "~56.0.15", - "expo-modules-core": "~56.0.16", + "babel-preset-expo": "~57.0.2", + "expo-asset": "~57.0.3", + "expo-constants": "~57.0.3", + "expo-file-system": "~57.0.0", + "expo-font": "~57.0.0", + "expo-keep-awake": "~57.0.0", + "expo-modules-autolinking": "~57.0.5", + "expo-modules-core": "~57.0.3", "pretty-format": "^29.7.0", "react-refresh": "^0.14.2", "whatwg-url-minimum": "^0.1.2" @@ -3490,14 +3518,14 @@ } }, "node_modules/expo-asset": { - "version": "56.0.17", - "resolved": "https://registry.npmjs.org/expo-asset/-/expo-asset-56.0.17.tgz", - "integrity": "sha512-GFN5j+8SPkyv0nfsiFHewmdB/D0tL237TsBE/gSfFOFy/J3a52py7IulcSqkA3sQE/u/UlD5BmvP5ssS4//nUg==", + "version": "57.0.3", + "resolved": "https://registry.npmjs.org/expo-asset/-/expo-asset-57.0.3.tgz", + "integrity": "sha512-6E08JDuYrktY5pKNn2WiFBPBfj6bvFb++ccuBTijK8BUk/afSoy6n35h583LmC2YHgHTepWHHWNfr61nYcMd8Q==", "license": "MIT", "peer": true, "dependencies": { - "@expo/image-utils": "^0.10.1", - "expo-constants": "~56.0.18" + "@expo/image-utils": "^0.11.1", + "expo-constants": "~57.0.3" }, "peerDependencies": { "expo": "*", @@ -3506,13 +3534,13 @@ } }, "node_modules/expo-constants": { - "version": "56.0.18", - "resolved": "https://registry.npmjs.org/expo-constants/-/expo-constants-56.0.18.tgz", - "integrity": "sha512-8AMtbDGl/WVPnWlmbpGmvcdnNCy9E4PFnwdVwj600vljkMDPSxcAcjw8GVXEPk3PpZ+ngTqsrkltWyj0UKYAxw==", + "version": "57.0.3", + "resolved": "https://registry.npmjs.org/expo-constants/-/expo-constants-57.0.3.tgz", + "integrity": "sha512-BghbZlzwFnA22BG0CWv6W29zx8w19FozYPfSeZ3HjMitoy4aAmF1FnFbbjYSmZz6HHXXTWOfqwobOEIaglfzxg==", "license": "MIT", "peer": true, "dependencies": { - "@expo/env": "~2.3.0" + "@expo/env": "~2.4.1" }, "peerDependencies": { "expo": "*", @@ -3530,9 +3558,9 @@ } }, "node_modules/expo-font": { - "version": "56.0.6", - "resolved": "https://registry.npmjs.org/expo-font/-/expo-font-56.0.6.tgz", - "integrity": "sha512-D4s72Aei844C2s8Vy61qMr6wLEjv6BMrXA1oyRQ0x8LJBbpm5gyogUohc0lABUURVLCqsnBIDdztegl3hktmmg==", + "version": "57.0.0", + "resolved": "https://registry.npmjs.org/expo-font/-/expo-font-57.0.0.tgz", + "integrity": "sha512-zF+J7WrNFjqyAADwdvDgkFEoIQv9DqcjJ57HVstNEH7/7Tx1ThPEhKraodEQOwSjMYWirP+4BYsVbdb+/Zr4QQ==", "license": "MIT", "peer": true, "dependencies": { @@ -3545,9 +3573,9 @@ } }, "node_modules/expo-keep-awake": { - "version": "56.0.3", - "resolved": "https://registry.npmjs.org/expo-keep-awake/-/expo-keep-awake-56.0.3.tgz", - "integrity": "sha512-CLMJXtEiMKknD3Rpm8CRwE6ZJUzu2yCEmRk1sgfHAJ1zIbuEWY3dpPDubtsnuzWm+2k6Sru+yaFbYsvPWmTiBA==", + "version": "57.0.0", + "resolved": "https://registry.npmjs.org/expo-keep-awake/-/expo-keep-awake-57.0.0.tgz", + "integrity": "sha512-WqEoyDNSmUeAI9Gu7UaWKDjOhfaV+jGcms7N0hh/EAr7sqJrI2s0HpLSC3P9cWfXFUZCL1zZjd22m/NbsJYCKg==", "license": "MIT", "peer": true, "peerDependencies": { @@ -3556,13 +3584,13 @@ } }, "node_modules/expo-modules-autolinking": { - "version": "56.0.15", - "resolved": "https://registry.npmjs.org/expo-modules-autolinking/-/expo-modules-autolinking-56.0.15.tgz", - "integrity": "sha512-WqpBFwLzn7DsrUkWltIjVmAjwuI1VdQ2jRMlvk1nh2kVadwdJBkSjUBQWRifsEePNhiMT/rFOovBolUU/ARt5w==", + "version": "57.0.5", + "resolved": "https://registry.npmjs.org/expo-modules-autolinking/-/expo-modules-autolinking-57.0.5.tgz", + "integrity": "sha512-Vv2PVeEUN0/VW19ItkVA8LxAuH8SV8cjui0MKhJxCKrNyCAGGZU6sRsBJciYXR4uVxuXWKiepGW6E3k/c+Ytdg==", "license": "MIT", "peer": true, "dependencies": { - "@expo/require-utils": "^56.1.3", + "@expo/require-utils": "^57.0.1", "@expo/spawn-async": "^1.8.0", "chalk": "^4.1.0", "commander": "^7.2.0" @@ -3572,20 +3600,20 @@ } }, "node_modules/expo-modules-core": { - "version": "56.0.16", - "resolved": "https://registry.npmjs.org/expo-modules-core/-/expo-modules-core-56.0.16.tgz", - "integrity": "sha512-IVdT0CnqOpQCPdemA5rb50CPbbhWeJePnvuH0yUmOmyMkNky8WVOdRQtVicoIv4CCG5hDrzPIxULD4YOHZ5CHg==", + "version": "57.0.3", + "resolved": "https://registry.npmjs.org/expo-modules-core/-/expo-modules-core-57.0.3.tgz", + "integrity": "sha512-fuD3DjPQvdaldtCJm2erV2/trPMrDJvEwPdz0RuxAQnduiNwZ3yxBoi81ZEKC5GBSJauMo53YXSwogsFagjwFQ==", "license": "MIT", "peer": true, "dependencies": { - "@expo/expo-modules-macros-plugin": "0.2.2", - "expo-modules-jsi": "~56.0.9", + "@expo/expo-modules-macros-plugin": "0.3.0", + "expo-modules-jsi": "~57.0.1", "invariant": "^2.2.4" }, "peerDependencies": { "react": "*", "react-native": "*", - "react-native-worklets": "^0.7.4 || ^0.8.0" + "react-native-worklets": "^0.7.4 || ^0.8.0 || ^0.9.0 || ^0.10.0" }, "peerDependenciesMeta": { "react-native-worklets": { @@ -3594,9 +3622,9 @@ } }, "node_modules/expo-modules-jsi": { - "version": "56.0.9", - "resolved": "https://registry.npmjs.org/expo-modules-jsi/-/expo-modules-jsi-56.0.9.tgz", - "integrity": "sha512-2lfDkRcsP/Qh2upS+nu0MS0tfGsghc6ehTivzbgM5nJz0MGYhAJxCJSeendWM+aOQutQAwzsoxrNT0nW8lRAwA==", + "version": "57.0.1", + "resolved": "https://registry.npmjs.org/expo-modules-jsi/-/expo-modules-jsi-57.0.1.tgz", + "integrity": "sha512-dECN3pOFv+KrQcGrOhJKEBc1/ob7SBjTTYGRB1bc84zmQ65La0FSrAPxpvnEQf8g9giLB5y9RLqwGxHspjXigQ==", "license": "MIT", "peer": true, "peerDependencies": { @@ -3604,9 +3632,9 @@ } }, "node_modules/expo-server": { - "version": "56.0.5", - "resolved": "https://registry.npmjs.org/expo-server/-/expo-server-56.0.5.tgz", - "integrity": "sha512-SmM2p2g3Jrktpiazcst+OxhjSzOHXKAY4BPURHYHXvApzzoybMmrNF4IEZ8DKZ145BhSe4ydAmlEFCRTsdtgUQ==", + "version": "57.0.0", + "resolved": "https://registry.npmjs.org/expo-server/-/expo-server-57.0.0.tgz", + "integrity": "sha512-18byjwFbHVFrGzI4IH1o2MZiiYwvO/y3d+JL3sq50Lg3Id1titwIRMh1fjbHbpM+wP6x14KJY0Ers1UYsjGq8Q==", "license": "MIT", "peer": true, "engines": { @@ -3614,9 +3642,9 @@ } }, "node_modules/expo/node_modules/expo-file-system": { - "version": "56.0.8", - "resolved": "https://registry.npmjs.org/expo-file-system/-/expo-file-system-56.0.8.tgz", - "integrity": "sha512-NrH41/8snGIBSbYicwVLB4txPdgCATd7ZYhMAGS3YJZ9GbnduhlAoV4/YCbGayjrbpE9bJb/6wegPL/zmvRMnQ==", + "version": "57.0.0", + "resolved": "https://registry.npmjs.org/expo-file-system/-/expo-file-system-57.0.0.tgz", + "integrity": "sha512-G+eytNuNGMiS7dbdj1j0nAYMowXnNr1vpO+jss6nQvBlRxshcGBFMtk8xfc67ynz0MUVkzod7WwKO7Vf1iOaJw==", "license": "MIT", "peer": true, "peerDependencies": { @@ -3846,20 +3874,20 @@ "license": "MIT" }, "node_modules/hermes-estree": { - "version": "0.33.3", - "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.33.3.tgz", - "integrity": "sha512-6kzYZHCk8Fy1Uc+t3HGYyJn3OL4aeqKLTyina4UFtWl8I0kSL7OmKThaiX+Uh2f8nGw3mo4Ifxg0M5Zk3/Oeqg==", + "version": "0.36.1", + "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.36.1.tgz", + "integrity": "sha512-guv1nQ6IJ7S83NRFPWc3SA7IBZrdNC9kapwOq6uXvF4wP+sDCgjzQbKPCoyYmoyZRzztF/n/c36l/rccCZSiCw==", "license": "MIT", "peer": true }, "node_modules/hermes-parser": { - "version": "0.33.3", - "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.33.3.tgz", - "integrity": "sha512-Yg3HgaG4CqgyowtYjX/FsnPAuZdHOqSMtnbpylbptsQ9nwwSKsy6uRWcGO5RK0EqiX12q8HvDWKgeAVajRO5DA==", + "version": "0.36.1", + "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.36.1.tgz", + "integrity": "sha512-GApNk4zLHi2UWoWZZkx7LNCOSzLSc5lB55pZ/PhK7ycFeg7u5LcF88p/WbpIi1XUDtE0MpHE3uRR3u3KB7TjSQ==", "license": "MIT", "peer": true, "dependencies": { - "hermes-estree": "0.33.3" + "hermes-estree": "0.36.1" } }, "node_modules/hosted-git-info": { @@ -4129,9 +4157,9 @@ "license": "MIT" }, "node_modules/js-yaml": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.2.0.tgz", - "integrity": "sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.0.tgz", + "integrity": "sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q==", "funding": [ { "type": "github", @@ -4386,6 +4414,9 @@ "cpu": [ "arm64" ], + "libc": [ + "glibc" + ], "license": "MPL-2.0", "optional": true, "os": [ @@ -4407,6 +4438,9 @@ "cpu": [ "arm64" ], + "libc": [ + "musl" + ], "license": "MPL-2.0", "optional": true, "os": [ @@ -4428,6 +4462,9 @@ "cpu": [ "x64" ], + "libc": [ + "glibc" + ], "license": "MPL-2.0", "optional": true, "os": [ @@ -4449,6 +4486,9 @@ "cpu": [ "x64" ], + "libc": [ + "musl" + ], "license": "MPL-2.0", "optional": true, "os": [ @@ -5130,9 +5170,9 @@ "peer": true }, "node_modules/nanoid": { - "version": "3.3.12", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.12.tgz", - "integrity": "sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==", + "version": "3.3.15", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.15.tgz", + "integrity": "sha512-y7Wygv/7mEOvxTuEQDB8StXdMRBWf1kR/tlhAzBRUFkB2jfcLOAxO/SHmOO2zgz1pVgK29/kyupn059/bCHdjA==", "funding": [ { "type": "github", @@ -5175,9 +5215,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==", "license": "MIT", "engines": { "node": ">=18" @@ -5426,9 +5466,9 @@ } }, "node_modules/path-scurry/node_modules/lru-cache": { - "version": "11.5.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.1.tgz", - "integrity": "sha512-RPimw/7aMdv2oqRrxKwvZXcPfwBrn/JZ2xYcY9Hus/6LaS3VOAKVWKWgNLCFSiOm1ESXinjsDlidVU7JlnCN2A==", + "version": "11.5.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.2.tgz", + "integrity": "sha512-4pfM1Ff0x50o0tQwb5ucw/RzNyD0/YJME6IVcStalZuMWxdt3sR3huStTtxz4PUmvZfRguvDejasvQ2kifR11g==", "license": "BlueOak-1.0.0", "peer": true, "engines": { @@ -5449,9 +5489,9 @@ "license": "ISC" }, "node_modules/picomatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", - "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", "license": "MIT", "engines": { "node": ">=12" @@ -5518,9 +5558,9 @@ } }, "node_modules/postcss": { - "version": "8.5.15", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.15.tgz", - "integrity": "sha512-FfR8sjd4em2T6fb3I2MwAJU7HWVMr9zba+enmQeeWFfCbm+UOC/0X4DS8XtpUTMwWMGbjKYP7xjfNekzyGmB3A==", + "version": "8.5.16", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.16.tgz", + "integrity": "sha512-vuwillviilfKZsg0VGj5R/YwwcHx4SLsIOI/7K6mQkWx+l5cUHTjj5g0AasTBcyXsbfTgrwsUNmVUb5xVwyPwg==", "funding": [ { "type": "opencollective", @@ -5718,33 +5758,6 @@ } } }, - "node_modules/react-native/node_modules/@react-native/codegen": { - "version": "0.86.0", - "resolved": "https://registry.npmjs.org/@react-native/codegen/-/codegen-0.86.0.tgz", - "integrity": "sha512-uTs9DBo3+/lUqinsGZK0FKJRBVClrwMXoZToaDxE1Q2SL2e55vs2GwyZfIKzPl5uJnbu4PfFMIp0/mLXLWUMuA==", - "license": "MIT", - "dependencies": { - "@babel/core": "^7.25.2", - "@babel/parser": "^7.29.0", - "hermes-parser": "0.36.0", - "invariant": "^2.2.4", - "nullthrows": "^1.1.1", - "tinyglobby": "^0.2.15", - "yargs": "^17.6.2" - }, - "engines": { - "node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0" - }, - "peerDependencies": { - "@babel/core": "*" - } - }, - "node_modules/react-native/node_modules/@react-native/normalize-colors": { - "version": "0.86.0", - "resolved": "https://registry.npmjs.org/@react-native/normalize-colors/-/normalize-colors-0.86.0.tgz", - "integrity": "sha512-kG0wfCGghUKlfxkJyyHCDVutWVYWK7/DG58ojA/4v9EfulgF+osuSQmlbNb3rcKX58qutm7JcldSeVLgGFha9g==", - "license": "MIT" - }, "node_modules/react-native/node_modules/babel-plugin-syntax-hermes-parser": { "version": "0.36.0", "resolved": "https://registry.npmjs.org/babel-plugin-syntax-hermes-parser/-/babel-plugin-syntax-hermes-parser-0.36.0.tgz", @@ -5839,9 +5852,9 @@ "peer": true }, "node_modules/regjsparser": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.13.1.tgz", - "integrity": "sha512-dLsljMd9sqwRkby8zhO1gSg3PnJIBFid8f4CQj/sXx+7cKx+E7u0PKhZ+U4wmhx7EfmtvnA318oVaIkAB1lRJw==", + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.13.2.tgz", + "integrity": "sha512-NgRBy2Nx/bE+9F27nVHnqcN5HjyLmecqsqx2PJHu3/IEtADD4WuxuXIVExD5PoSDFVrl78dOonfcOe5O+5nbzQ==", "license": "BSD-2-Clause", "peer": true, "dependencies": { @@ -5913,13 +5926,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.62.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.62.2.tgz", + "integrity": "sha512-RFnrW4lhXA3s3eqHDZvN654g8OTjzRfqpIRJYczCGB6HzphckVAi/Qh4tbPUbRuDi7s1Llv8g/NspLkttY3gTA==", "dev": true, "license": "MIT", "dependencies": { - "@types/estree": "1.0.8" + "@types/estree": "1.0.9" }, "bin": { "rollup": "dist/bin/rollup" @@ -5929,41 +5942,34 @@ "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.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" } }, - "node_modules/rollup/node_modules/@types/estree": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", - "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", - "dev": true, - "license": "MIT" - }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -6002,9 +6008,9 @@ "license": "MIT" }, "node_modules/semver": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.4.tgz", - "integrity": "sha512-rUCObTnP32Q08R2uuIrt7r9PlEonuTmtuXYcW6s5kjdlj3xbnwe+21yXptAUYcMAABLkYYTtnmzb3w3EDZfueA==", + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -6115,9 +6121,9 @@ "license": "MIT" }, "node_modules/serve-handler/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==", + "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": { @@ -6233,9 +6239,9 @@ } }, "node_modules/shell-quote": { - "version": "1.8.4", - "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.4.tgz", - "integrity": "sha512-VsC6n6vz1ihYYyZZwX7YZSF5l5x36ca17OC+a69h94YqB7X6XLwf+5MOgynYir2SLFUbl8gIYvBo8K8RoNQ6bQ==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.10.0.tgz", + "integrity": "sha512-w1aiOKwKuRgtwAReIIj89puqg+I7GvX4IbLrvmhXbzQsj1+Zwi4VO3+fa6ZF91TWSjIxoEkKnMeHcLEODK5ZXA==", "license": "MIT", "engines": { "node": ">= 0.4" @@ -6480,9 +6486,9 @@ } }, "node_modules/terser": { - "version": "5.48.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.48.0.tgz", - "integrity": "sha512-J/9An6vs9Us6wKRriSFXBWdRZapREHqFzdNUKk0pmu804EMR6dr6winwo7e5JDxN4xahxQsuysyYFwlwj4XN/Q==", + "version": "5.49.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.49.0.tgz", + "integrity": "sha512-SNiDnXyHSrxVcIOtVbULzcTmniUiwcV7Nwdyj1twVubeTmbjoa8p69KKDpfkdoOavuM4/GRm1+ykI8qqnavHoA==", "license": "BSD-2-Clause", "dependencies": { "@jridgewell/source-map": "^0.3.3", @@ -6576,9 +6582,9 @@ } }, "node_modules/typescript": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", - "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "devOptional": true, "license": "Apache-2.0", "bin": { @@ -6590,9 +6596,9 @@ } }, "node_modules/undici-types": { - "version": "7.24.6", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.24.6.tgz", - "integrity": "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==", + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz", + "integrity": "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==", "license": "MIT" }, "node_modules/unicode-canonical-property-names-ecmascript": { @@ -6688,9 +6694,9 @@ } }, "node_modules/uuid": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-14.0.0.tgz", - "integrity": "sha512-Qo+uWgilfSmAhXCMav1uYFynlQO7fMFiMVZsQqZRMIXp0O7rR7qjkj+cPvBHLgBqi960QCoo/PH2/6ZtVqKvrg==", + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-14.0.1.tgz", + "integrity": "sha512-6ZxzVpzDXDa3bJWaHilVayA+BH/1zmxCJoVgvmqJnid/gPoKHxUrS/aC/T6LGQtNHT+XHG9fXPJB4d+IrU30Ew==", "funding": [ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" @@ -6903,9 +6909,9 @@ } }, "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==", "license": "MIT", "dependencies": { "cliui": "^8.0.1", diff --git a/package.json b/package.json index 1d142f3e..d4e59716 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "react-native-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": "0.33.0", + "version": "0.34.0", "license": "BSD-3-Clause", "main": "dist/cjs/sdk.js", "exports": { @@ -35,10 +35,10 @@ "@rollup/plugin-typescript": "12.3.0", "@types/json-bigint": "1.0.4", "playwright": "1.59.0", - "rollup": "4.60.1", + "rollup": "4.62.2", "serve-handler": "6.1.7", "tslib": "2.8.1", - "typescript": "5.7.3" + "typescript": "5.9.3" }, "dependencies": { "expo-file-system": "18.*.*", diff --git a/src/client.ts b/src/client.ts index fb954ab8..e28c97bc 100644 --- a/src/client.ts +++ b/src/client.ts @@ -168,6 +168,7 @@ class Client { platform: '', project: '', jwt: '', + bearer: '', locale: '', session: '', devkey: '', @@ -180,7 +181,7 @@ class Client { 'x-sdk-name': 'React Native', 'x-sdk-platform': 'client', 'x-sdk-language': 'reactnative', - 'x-sdk-version': '0.33.0', + 'x-sdk-version': '0.34.0', 'X-Appwrite-Response-Format': '1.9.5', }; @@ -283,6 +284,21 @@ class Client { 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 * diff --git a/src/enums/o-auth-provider.ts b/src/enums/o-auth-provider.ts index cc9e340b..e7136d69 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/models.ts b/src/models.ts index 6140c788..969aac23 100644 --- a/src/models.ts +++ b/src/models.ts @@ -388,7 +388,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; /** @@ -928,6 +928,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; } /** diff --git a/src/query.ts b/src/query.ts index 0c89adec..a77df1be 100644 --- a/src/query.ts +++ b/src/query.ts @@ -336,6 +336,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 8ff78631..377024e5 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -1704,7 +1704,7 @@ export class Account extends Service { * 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. @@ -1720,7 +1720,7 @@ export class Account extends Service { * 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. @@ -2415,7 +2415,7 @@ export class Account extends Service { * * 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. @@ -2430,7 +2430,7 @@ export class Account extends Service { * * 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. From fea8440712001012251b539c094e17b6629a2e6c Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 13 Jul 2026 12:10:03 +0530 Subject: [PATCH 2/5] chore: update React Native SDK to 0.34.0 --- src/client.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client.ts b/src/client.ts index e28c97bc..1c80f8e3 100644 --- a/src/client.ts +++ b/src/client.ts @@ -294,7 +294,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 3e227dabeb33b5631815be7e4c038284cac79f9b Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 7 Sep 2026 15:58:27 +0100 Subject: [PATCH 3/5] chore: update React Native SDK to 0.35.0 --- .github/workflows/publish.yml | 8 +- .prettierignore | 13 + .prettierrc | 4 + CHANGELOG.md | 17 + README.md | 4 +- .../account/create-anonymous-session.md | 2 +- .../account/create-email-password-session.md | 4 +- docs/examples/account/create-email-token.md | 4 +- .../account/create-email-verification.md | 4 +- docs/examples/account/create-jwt.md | 4 +- .../account/create-magic-url-token.md | 4 +- .../account/create-mfa-authenticator.md | 4 +- docs/examples/account/create-mfa-challenge.md | 4 +- .../account/create-mfa-recovery-codes.md | 2 +- .../account/create-o-auth-2-session.md | 5 +- .../examples/account/create-o-auth-2-token.md | 5 +- docs/examples/account/create-phone-token.md | 4 +- .../account/create-phone-verification.md | 2 +- docs/examples/account/create-push-target.md | 4 +- docs/examples/account/create-recovery.md | 4 +- docs/examples/account/create-session.md | 4 +- docs/examples/account/create-verification.md | 4 +- docs/examples/account/create.md | 4 +- docs/examples/account/delete-consent-token.md | 16 + docs/examples/account/delete-consent.md | 15 + docs/examples/account/delete-identity.md | 4 +- .../account/delete-mfa-authenticator.md | 4 +- docs/examples/account/delete-push-target.md | 4 +- docs/examples/account/delete-session.md | 4 +- docs/examples/account/delete-sessions.md | 2 +- docs/examples/account/get-consent-token.md | 16 + docs/examples/account/get-consent.md | 15 + .../account/get-mfa-recovery-codes.md | 2 +- docs/examples/account/get-prefs.md | 2 +- docs/examples/account/get-session.md | 4 +- docs/examples/account/get.md | 2 +- docs/examples/account/list-consent-tokens.md | 17 + docs/examples/account/list-consents.md | 16 + docs/examples/account/list-identities.md | 4 +- docs/examples/account/list-logs.md | 4 +- docs/examples/account/list-mfa-factors.md | 2 +- docs/examples/account/list-sessions.md | 2 +- .../account/update-email-verification.md | 4 +- docs/examples/account/update-email.md | 4 +- .../account/update-magic-url-session.md | 4 +- .../account/update-mfa-authenticator.md | 4 +- docs/examples/account/update-mfa-challenge.md | 4 +- .../account/update-mfa-recovery-codes.md | 2 +- docs/examples/account/update-mfa.md | 4 +- docs/examples/account/update-name.md | 4 +- docs/examples/account/update-password.md | 4 +- docs/examples/account/update-phone-session.md | 4 +- .../account/update-phone-verification.md | 4 +- docs/examples/account/update-phone.md | 4 +- docs/examples/account/update-prefs.md | 10 +- docs/examples/account/update-push-target.md | 4 +- docs/examples/account/update-recovery.md | 4 +- docs/examples/account/update-session.md | 4 +- docs/examples/account/update-status.md | 2 +- docs/examples/account/update-verification.md | 4 +- docs/examples/avatars/get-browser.md | 4 +- docs/examples/avatars/get-credit-card.md | 4 +- docs/examples/avatars/get-favicon.md | 4 +- docs/examples/avatars/get-flag.md | 4 +- docs/examples/avatars/get-image.md | 4 +- docs/examples/avatars/get-initials.md | 4 +- docs/examples/avatars/get-photo.md | 22 + docs/examples/avatars/get-qr.md | 4 +- docs/examples/avatars/get-screenshot.md | 23 +- docs/examples/databases/create-document.md | 16 +- docs/examples/databases/create-operations.md | 22 +- docs/examples/databases/create-transaction.md | 4 +- .../databases/decrement-document-attribute.md | 8 +- docs/examples/databases/delete-document.md | 4 +- docs/examples/databases/delete-transaction.md | 4 +- docs/examples/databases/get-document.md | 4 +- docs/examples/databases/get-transaction.md | 4 +- .../databases/increment-document-attribute.md | 10 +- docs/examples/databases/list-documents.md | 4 +- docs/examples/databases/list-transactions.md | 4 +- docs/examples/databases/update-document.md | 16 +- docs/examples/databases/update-transaction.md | 4 +- docs/examples/databases/upsert-document.md | 16 +- docs/examples/documentsdb/create-document.md | 26 + docs/examples/documentsdb/create-documents.md | 18 + .../examples/documentsdb/create-operations.md | 26 + .../documentsdb/create-transaction.md | 15 + .../decrement-document-attribute.md | 21 + docs/examples/documentsdb/delete-document.md | 18 + .../documentsdb/delete-transaction.md | 15 + docs/examples/documentsdb/get-document.md | 19 + docs/examples/documentsdb/get-transaction.md | 15 + .../increment-document-attribute.md | 21 + docs/examples/documentsdb/list-documents.md | 20 + .../examples/documentsdb/list-transactions.md | 15 + docs/examples/documentsdb/update-document.md | 20 + .../documentsdb/update-transaction.md | 17 + docs/examples/documentsdb/upsert-document.md | 20 + docs/examples/functions/create-execution.md | 4 +- docs/examples/functions/get-execution.md | 4 +- docs/examples/functions/list-executions.md | 4 +- docs/examples/graphql/mutation.md | 4 +- docs/examples/graphql/query.md | 4 +- docs/examples/locale/get.md | 2 +- docs/examples/locale/list-codes.md | 2 +- docs/examples/locale/list-continents.md | 2 +- docs/examples/locale/list-countries-eu.md | 2 +- docs/examples/locale/list-countries-phones.md | 2 +- docs/examples/locale/list-countries.md | 2 +- docs/examples/locale/list-currencies.md | 2 +- docs/examples/locale/list-languages.md | 2 +- docs/examples/messaging/create-subscriber.md | 4 +- docs/examples/messaging/delete-subscriber.md | 4 +- .../organization/create-installation.md | 16 + .../organization/delete-installation.md | 15 + .../examples/organization/get-installation.md | 15 + .../organization/list-installations.md | 16 + .../organization/update-installation.md | 16 + docs/examples/presences/delete.md | 4 +- docs/examples/presences/get.md | 4 +- docs/examples/presences/list.md | 4 +- docs/examples/presences/update.md | 6 +- docs/examples/presences/upsert.md | 6 +- docs/examples/storage/create-file.md | 12 +- docs/examples/storage/delete-file.md | 4 +- docs/examples/storage/get-file-download.md | 4 +- docs/examples/storage/get-file-preview.md | 13 +- docs/examples/storage/get-file-view.md | 4 +- docs/examples/storage/get-file.md | 4 +- docs/examples/storage/list-files.md | 4 +- docs/examples/storage/update-file.md | 4 +- docs/examples/tablesdb/create-operations.md | 22 +- docs/examples/tablesdb/create-row.md | 16 +- docs/examples/tablesdb/create-transaction.md | 4 +- .../examples/tablesdb/decrement-row-column.md | 8 +- docs/examples/tablesdb/delete-row.md | 4 +- docs/examples/tablesdb/delete-transaction.md | 4 +- docs/examples/tablesdb/get-row.md | 4 +- docs/examples/tablesdb/get-transaction.md | 4 +- .../examples/tablesdb/increment-row-column.md | 10 +- docs/examples/tablesdb/list-rows.md | 4 +- docs/examples/tablesdb/list-transactions.md | 4 +- docs/examples/tablesdb/update-row.md | 16 +- docs/examples/tablesdb/update-transaction.md | 4 +- docs/examples/tablesdb/upsert-row.md | 16 +- docs/examples/teams/create-installation.md | 17 + docs/examples/teams/create-membership.md | 4 +- docs/examples/teams/create.md | 4 +- docs/examples/teams/delete-installation.md | 16 + docs/examples/teams/delete-membership.md | 4 +- docs/examples/teams/delete.md | 4 +- docs/examples/teams/get-installation.md | 16 + docs/examples/teams/get-membership.md | 4 +- docs/examples/teams/get-prefs.md | 4 +- docs/examples/teams/get.md | 4 +- docs/examples/teams/list-installations.md | 17 + docs/examples/teams/list-memberships.md | 4 +- docs/examples/teams/list.md | 4 +- docs/examples/teams/update-installation.md | 17 + .../teams/update-membership-status.md | 4 +- docs/examples/teams/update-membership.md | 4 +- docs/examples/teams/update-name.md | 4 +- docs/examples/teams/update-prefs.md | 4 +- docs/examples/vectorsdb/create-document.md | 25 + docs/examples/vectorsdb/create-operations.md | 26 + docs/examples/vectorsdb/create-query.md | 20 + docs/examples/vectorsdb/create-transaction.md | 15 + docs/examples/vectorsdb/delete-document.md | 18 + docs/examples/vectorsdb/delete-transaction.md | 15 + docs/examples/vectorsdb/get-document.md | 19 + docs/examples/vectorsdb/get-transaction.md | 15 + docs/examples/vectorsdb/list-documents.md | 20 + docs/examples/vectorsdb/list-transactions.md | 15 + docs/examples/vectorsdb/update-document.md | 20 + docs/examples/vectorsdb/update-transaction.md | 17 + docs/examples/vectorsdb/upsert-document.md | 20 + eslint.config.mjs | 31 + package-lock.json | 3213 +++++++++++++---- package.json | 126 +- rollup.config.mjs | 19 +- src/channel.ts | 340 +- src/client.ts | 341 +- src/enums/authentication-factor.ts | 3 +- src/enums/authenticator-type.ts | 2 +- src/enums/browser-permission.ts | 2 +- src/enums/browser-theme.ts | 2 +- src/enums/browser.ts | 2 +- src/enums/credit-card.ts | 2 +- src/enums/execution-method.ts | 2 +- src/enums/execution-resource-type.ts | 4 + src/enums/execution-status.ts | 2 +- src/enums/execution-trigger.ts | 2 +- src/enums/flag.ts | 2 +- src/enums/image-format.ts | 2 +- src/enums/image-gravity.ts | 2 +- src/enums/o-auth-provider.ts | 5 +- src/enums/timezone.ts | 2 +- src/id.ts | 5 +- src/index.ts | 11 +- src/models.ts | 1175 +++--- src/operator.ts | 542 ++- src/permission.ts | 21 +- src/query.ts | 930 ++--- src/react-native-shim.d.ts | 5 + src/role.ts | 61 +- src/service.ts | 6 +- src/services/account.ts | 2663 ++++++++++---- src/services/avatars.ts | 1032 +++++- src/services/databases.ts | 1164 ++++-- src/services/documents-db.ts | 1833 ++++++++++ src/services/functions.ts | 216 +- src/services/graphql.ts | 78 +- src/services/locale.ts | 121 +- src/services/messaging.ts | 135 +- src/services/organization.ts | 366 ++ src/services/presences.ts | 313 +- src/services/realtime.ts | 257 +- src/services/storage.ts | 767 +++- src/services/tables-db.ts | 1019 ++++-- src/services/teams.ts | 1197 ++++-- src/services/vectors-db.ts | 1517 ++++++++ tsconfig.json | 4 +- 222 files changed, 16172 insertions(+), 4869 deletions(-) create mode 100644 .prettierignore create mode 100644 .prettierrc 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/avatars/get-photo.md create mode 100644 docs/examples/documentsdb/create-document.md create mode 100644 docs/examples/documentsdb/create-documents.md create mode 100644 docs/examples/documentsdb/create-operations.md create mode 100644 docs/examples/documentsdb/create-transaction.md create mode 100644 docs/examples/documentsdb/decrement-document-attribute.md create mode 100644 docs/examples/documentsdb/delete-document.md create mode 100644 docs/examples/documentsdb/delete-transaction.md create mode 100644 docs/examples/documentsdb/get-document.md create mode 100644 docs/examples/documentsdb/get-transaction.md create mode 100644 docs/examples/documentsdb/increment-document-attribute.md create mode 100644 docs/examples/documentsdb/list-documents.md create mode 100644 docs/examples/documentsdb/list-transactions.md create mode 100644 docs/examples/documentsdb/update-document.md create mode 100644 docs/examples/documentsdb/update-transaction.md create mode 100644 docs/examples/documentsdb/upsert-document.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/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 docs/examples/vectorsdb/create-document.md create mode 100644 docs/examples/vectorsdb/create-operations.md create mode 100644 docs/examples/vectorsdb/create-query.md create mode 100644 docs/examples/vectorsdb/create-transaction.md create mode 100644 docs/examples/vectorsdb/delete-document.md create mode 100644 docs/examples/vectorsdb/delete-transaction.md create mode 100644 docs/examples/vectorsdb/get-document.md create mode 100644 docs/examples/vectorsdb/get-transaction.md create mode 100644 docs/examples/vectorsdb/list-documents.md create mode 100644 docs/examples/vectorsdb/list-transactions.md create mode 100644 docs/examples/vectorsdb/update-document.md create mode 100644 docs/examples/vectorsdb/update-transaction.md create mode 100644 docs/examples/vectorsdb/upsert-document.md create mode 100644 eslint.config.mjs create mode 100644 src/enums/execution-resource-type.ts create mode 100644 src/react-native-shim.d.ts create mode 100644 src/services/documents-db.ts create mode 100644 src/services/organization.ts create mode 100644 src/services/vectors-db.ts diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 48121d67..1775eff9 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' @@ -36,8 +36,8 @@ jobs: - name: Install dependencies, audit, and build run: | - npm ci - npm audit --audit-level=high --omit=dev + npm ci --omit=peer + npm audit --audit-level=high --omit=dev --omit=peer npm run build - name: Publish diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..c14dbf09 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,13 @@ +node_modules/ +dist/ +types/ +package-lock.json + +# CI workflow files follow the YAML conventions of the publishing repository, +# not this SDK's source formatting. +.github/ + +# README and CHANGELOG carry caller-supplied markdown verbatim, which this +# SDK's formatter must not rewrite. +README.md +CHANGELOG.md diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..9b0bb437 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,4 @@ +{ + "tabWidth": 4, + "singleQuote": true +} diff --git a/CHANGELOG.md b/CHANGELOG.md index c691690f..f5aa7b51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Change log +## 0.35.0 + +* Breaking: `Execution.functionId` replaced by `resourceId` and `resourceType` +* Breaking: `react-native` is now a peer dependency instead of a dependency +* Breaking: SDK now targets Appwrite 2.0 (`X-Appwrite-Response-Format: 2.0.0`) +* Added: `DocumentsDB` and `VectorsDB` services for document and vector database access +* Added: `Organization` service with `listInstallations`, `createInstallation`, `getInstallation`, `updateInstallation`, `deleteInstallation` +* Added: `Teams` installation methods `listInstallations`, `createInstallation`, `getInstallation`, `updateInstallation`, `deleteInstallation` +* Added: `Account` consent methods `listConsents`, `getConsent`, `deleteConsent`, `listConsentTokens`, `getConsentToken`, `deleteConsentToken` +* Added: `Avatars.getPhoto` returning the best available user profile photo +* Added: `folder` parameter to `Storage.createFile` and `folder`, `key` fields on `File` +* Added: `ExecutionResourceType` enum with `Functions` and `Sites` +* Added: `AppInstallation`, `Oauth2Consent`, `Oauth2ConsentToken` models and list types +* Added: `Custom` value to `AuthenticationFactor` and `custom` field on `MfaFactors` +* Added: `Cloudflare`, `Huggingface`, `Resend` values to `OAuthProvider` +* Updated: source formatted with Prettier and linted with ESLint + ## 0.34.0 * Added: `Client.setBearer()` method for OAuth access token authentication diff --git a/README.md b/README.md index 70321e6a..1d70247c 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # Appwrite React Native SDK ![License](https://img.shields.io/github/license/appwrite/sdk-for-react-native.svg?style=flat-square) -![Version](https://img.shields.io/badge/api%20version-1.9.5-blue.svg?style=flat-square) +![Version](https://img.shields.io/badge/api%20version-2.0.0-blue.svg?style=flat-square) [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator) [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) -**This SDK is compatible with Appwrite server version 1.9.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-react-native/releases).** +**This SDK targets Appwrite server version 1.9.x as shipped on Appwrite Cloud.** Self-hosted releases can lag behind Cloud — if you run an older self-hosted build, use a matching older SDK from [previous releases](https://github.com/appwrite/sdk-for-react-native/releases) when APIs differ. Appwrite is an open-source backend as a service server that abstracts and simplifies complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the React Native SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) diff --git a/docs/examples/account/create-anonymous-session.md b/docs/examples/account/create-anonymous-session.md index 49a81c6c..7047a74d 100644 --- a/docs/examples/account/create-anonymous-session.md +++ b/docs/examples/account/create-anonymous-session.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint diff --git a/docs/examples/account/create-email-password-session.md b/docs/examples/account/create-email-password-session.md index 4b3e2002..e38beaf7 100644 --- a/docs/examples/account/create-email-password-session.md +++ b/docs/examples/account/create-email-password-session.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -9,7 +9,7 @@ const account = new Account(client); const result = await account.createEmailPasswordSession({ email: 'email@example.com', - password: 'password' + password: 'password', }); console.log(result); diff --git a/docs/examples/account/create-email-token.md b/docs/examples/account/create-email-token.md index 9956ed4f..9b9db8b8 100644 --- a/docs/examples/account/create-email-token.md +++ b/docs/examples/account/create-email-token.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -10,7 +10,7 @@ const account = new Account(client); const result = await account.createEmailToken({ userId: '', email: 'email@example.com', - phrase: false // optional + phrase: false, // optional }); console.log(result); diff --git a/docs/examples/account/create-email-verification.md b/docs/examples/account/create-email-verification.md index 8cef78ec..1a42defd 100644 --- a/docs/examples/account/create-email-verification.md +++ b/docs/examples/account/create-email-verification.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -8,7 +8,7 @@ const client = new Client() const account = new Account(client); const result = await account.createEmailVerification({ - url: 'https://example.com' + url: 'https://example.com', }); console.log(result); diff --git a/docs/examples/account/create-jwt.md b/docs/examples/account/create-jwt.md index 517a4f01..77ecb531 100644 --- a/docs/examples/account/create-jwt.md +++ b/docs/examples/account/create-jwt.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -8,7 +8,7 @@ const client = new Client() const account = new Account(client); const result = await account.createJWT({ - duration: 0 // optional + duration: 0, // optional }); console.log(result); diff --git a/docs/examples/account/create-magic-url-token.md b/docs/examples/account/create-magic-url-token.md index 85106b57..95327d71 100644 --- a/docs/examples/account/create-magic-url-token.md +++ b/docs/examples/account/create-magic-url-token.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -11,7 +11,7 @@ const result = await account.createMagicURLToken({ userId: '', email: 'email@example.com', url: 'https://example.com', // optional - phrase: false // optional + phrase: false, // optional }); console.log(result); diff --git a/docs/examples/account/create-mfa-authenticator.md b/docs/examples/account/create-mfa-authenticator.md index b7f6b847..3b43a024 100644 --- a/docs/examples/account/create-mfa-authenticator.md +++ b/docs/examples/account/create-mfa-authenticator.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account, AuthenticatorType } from "react-native-appwrite"; +import { Client, Account, AuthenticatorType } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -8,7 +8,7 @@ const client = new Client() const account = new Account(client); const result = await account.createMFAAuthenticator({ - type: AuthenticatorType.Totp + type: AuthenticatorType.Totp, }); console.log(result); diff --git a/docs/examples/account/create-mfa-challenge.md b/docs/examples/account/create-mfa-challenge.md index 373e3f54..53234366 100644 --- a/docs/examples/account/create-mfa-challenge.md +++ b/docs/examples/account/create-mfa-challenge.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account, AuthenticationFactor } from "react-native-appwrite"; +import { Client, Account, AuthenticationFactor } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -8,7 +8,7 @@ const client = new Client() const account = new Account(client); const result = await account.createMFAChallenge({ - factor: AuthenticationFactor.Email + factor: AuthenticationFactor.Email, }); console.log(result); diff --git a/docs/examples/account/create-mfa-recovery-codes.md b/docs/examples/account/create-mfa-recovery-codes.md index 2f73900e..300096e9 100644 --- a/docs/examples/account/create-mfa-recovery-codes.md +++ b/docs/examples/account/create-mfa-recovery-codes.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint diff --git a/docs/examples/account/create-o-auth-2-session.md b/docs/examples/account/create-o-auth-2-session.md index 289a4c8b..c90edc14 100644 --- a/docs/examples/account/create-o-auth-2-session.md +++ b/docs/examples/account/create-o-auth-2-session.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account, OAuthProvider } from "react-native-appwrite"; +import { Client, Account, OAuthProvider } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -11,7 +11,6 @@ account.createOAuth2Session({ provider: OAuthProvider.Amazon, success: 'https://example.com', // optional failure: 'https://example.com', // optional - scopes: [] // optional + scopes: [], // optional }); - ``` diff --git a/docs/examples/account/create-o-auth-2-token.md b/docs/examples/account/create-o-auth-2-token.md index dda39b0d..c043fb78 100644 --- a/docs/examples/account/create-o-auth-2-token.md +++ b/docs/examples/account/create-o-auth-2-token.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account, OAuthProvider } from "react-native-appwrite"; +import { Client, Account, OAuthProvider } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -11,7 +11,6 @@ account.createOAuth2Token({ provider: OAuthProvider.Amazon, success: 'https://example.com', // optional failure: 'https://example.com', // optional - scopes: [] // optional + scopes: [], // optional }); - ``` diff --git a/docs/examples/account/create-phone-token.md b/docs/examples/account/create-phone-token.md index c6021381..1bf53f9a 100644 --- a/docs/examples/account/create-phone-token.md +++ b/docs/examples/account/create-phone-token.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -9,7 +9,7 @@ const account = new Account(client); const result = await account.createPhoneToken({ userId: '', - phone: '+12065550100' + phone: '+12065550100', }); console.log(result); diff --git a/docs/examples/account/create-phone-verification.md b/docs/examples/account/create-phone-verification.md index cf9c2e28..6588b6b2 100644 --- a/docs/examples/account/create-phone-verification.md +++ b/docs/examples/account/create-phone-verification.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint diff --git a/docs/examples/account/create-push-target.md b/docs/examples/account/create-push-target.md index 1679c7e0..da09d09d 100644 --- a/docs/examples/account/create-push-target.md +++ b/docs/examples/account/create-push-target.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -10,7 +10,7 @@ const account = new Account(client); const result = await account.createPushTarget({ targetId: '', identifier: '', - providerId: '' // optional + providerId: '', // optional }); console.log(result); diff --git a/docs/examples/account/create-recovery.md b/docs/examples/account/create-recovery.md index 23a886ee..4d970c4f 100644 --- a/docs/examples/account/create-recovery.md +++ b/docs/examples/account/create-recovery.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -9,7 +9,7 @@ const account = new Account(client); const result = await account.createRecovery({ email: 'email@example.com', - url: 'https://example.com' + url: 'https://example.com', }); console.log(result); diff --git a/docs/examples/account/create-session.md b/docs/examples/account/create-session.md index 18a0b7c0..bcee0a80 100644 --- a/docs/examples/account/create-session.md +++ b/docs/examples/account/create-session.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -9,7 +9,7 @@ const account = new Account(client); const result = await account.createSession({ userId: '', - secret: '' + secret: '', }); console.log(result); diff --git a/docs/examples/account/create-verification.md b/docs/examples/account/create-verification.md index ff15a627..8c7be4e8 100644 --- a/docs/examples/account/create-verification.md +++ b/docs/examples/account/create-verification.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -8,7 +8,7 @@ const client = new Client() const account = new Account(client); const result = await account.createVerification({ - url: 'https://example.com' + url: 'https://example.com', }); console.log(result); diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md index 14bb50d2..964d1c4d 100644 --- a/docs/examples/account/create.md +++ b/docs/examples/account/create.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -11,7 +11,7 @@ const result = await account.create({ userId: '', email: 'email@example.com', password: 'password', - name: '' // optional + name: '', // optional }); console.log(result); diff --git a/docs/examples/account/delete-consent-token.md b/docs/examples/account/delete-consent-token.md new file mode 100644 index 00000000..e27393f5 --- /dev/null +++ b/docs/examples/account/delete-consent-token.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.deleteConsentToken({ + consentId: '', + tokenId: '', +}); + +console.log(result); +``` diff --git a/docs/examples/account/delete-consent.md b/docs/examples/account/delete-consent.md new file mode 100644 index 00000000..1b87ee71 --- /dev/null +++ b/docs/examples/account/delete-consent.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.deleteConsent({ + consentId: '', +}); + +console.log(result); +``` diff --git a/docs/examples/account/delete-identity.md b/docs/examples/account/delete-identity.md index aac71687..fbf4f7ec 100644 --- a/docs/examples/account/delete-identity.md +++ b/docs/examples/account/delete-identity.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -8,7 +8,7 @@ const client = new Client() const account = new Account(client); const result = await account.deleteIdentity({ - identityId: '' + identityId: '', }); console.log(result); diff --git a/docs/examples/account/delete-mfa-authenticator.md b/docs/examples/account/delete-mfa-authenticator.md index 626ac9a5..faffbba6 100644 --- a/docs/examples/account/delete-mfa-authenticator.md +++ b/docs/examples/account/delete-mfa-authenticator.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account, AuthenticatorType } from "react-native-appwrite"; +import { Client, Account, AuthenticatorType } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -8,7 +8,7 @@ const client = new Client() const account = new Account(client); const result = await account.deleteMFAAuthenticator({ - type: AuthenticatorType.Totp + type: AuthenticatorType.Totp, }); console.log(result); diff --git a/docs/examples/account/delete-push-target.md b/docs/examples/account/delete-push-target.md index 271b4094..ab0bb9d4 100644 --- a/docs/examples/account/delete-push-target.md +++ b/docs/examples/account/delete-push-target.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -8,7 +8,7 @@ const client = new Client() const account = new Account(client); const result = await account.deletePushTarget({ - targetId: '' + targetId: '', }); console.log(result); diff --git a/docs/examples/account/delete-session.md b/docs/examples/account/delete-session.md index a21fa8e6..16f6df8a 100644 --- a/docs/examples/account/delete-session.md +++ b/docs/examples/account/delete-session.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -8,7 +8,7 @@ const client = new Client() const account = new Account(client); const result = await account.deleteSession({ - sessionId: '' + sessionId: '', }); console.log(result); diff --git a/docs/examples/account/delete-sessions.md b/docs/examples/account/delete-sessions.md index b1127016..0f1bc281 100644 --- a/docs/examples/account/delete-sessions.md +++ b/docs/examples/account/delete-sessions.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint diff --git a/docs/examples/account/get-consent-token.md b/docs/examples/account/get-consent-token.md new file mode 100644 index 00000000..9bb0ab99 --- /dev/null +++ b/docs/examples/account/get-consent-token.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.getConsentToken({ + consentId: '', + tokenId: '', +}); + +console.log(result); +``` diff --git a/docs/examples/account/get-consent.md b/docs/examples/account/get-consent.md new file mode 100644 index 00000000..ae7cdc1c --- /dev/null +++ b/docs/examples/account/get-consent.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.getConsent({ + consentId: '', +}); + +console.log(result); +``` diff --git a/docs/examples/account/get-mfa-recovery-codes.md b/docs/examples/account/get-mfa-recovery-codes.md index a2016f0b..cd2a16ef 100644 --- a/docs/examples/account/get-mfa-recovery-codes.md +++ b/docs/examples/account/get-mfa-recovery-codes.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint diff --git a/docs/examples/account/get-prefs.md b/docs/examples/account/get-prefs.md index 3838731d..337523af 100644 --- a/docs/examples/account/get-prefs.md +++ b/docs/examples/account/get-prefs.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint diff --git a/docs/examples/account/get-session.md b/docs/examples/account/get-session.md index 5462215c..3676c4b2 100644 --- a/docs/examples/account/get-session.md +++ b/docs/examples/account/get-session.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -8,7 +8,7 @@ const client = new Client() const account = new Account(client); const result = await account.getSession({ - sessionId: '' + sessionId: '', }); console.log(result); diff --git a/docs/examples/account/get.md b/docs/examples/account/get.md index 0397f698..7144a9eb 100644 --- a/docs/examples/account/get.md +++ b/docs/examples/account/get.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint diff --git a/docs/examples/account/list-consent-tokens.md b/docs/examples/account/list-consent-tokens.md new file mode 100644 index 00000000..e33cf4e9 --- /dev/null +++ b/docs/examples/account/list-consent-tokens.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.listConsentTokens({ + consentId: '', + queries: [], // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/docs/examples/account/list-consents.md b/docs/examples/account/list-consents.md new file mode 100644 index 00000000..032aed08 --- /dev/null +++ b/docs/examples/account/list-consents.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Account } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const account = new Account(client); + +const result = await account.listConsents({ + queries: [], // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/docs/examples/account/list-identities.md b/docs/examples/account/list-identities.md index 3a8046b7..24426d42 100644 --- a/docs/examples/account/list-identities.md +++ b/docs/examples/account/list-identities.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -9,7 +9,7 @@ const account = new Account(client); const result = await account.listIdentities({ queries: [], // optional - total: false // optional + total: false, // optional }); console.log(result); diff --git a/docs/examples/account/list-logs.md b/docs/examples/account/list-logs.md index b919ce24..a3c7b437 100644 --- a/docs/examples/account/list-logs.md +++ b/docs/examples/account/list-logs.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -9,7 +9,7 @@ const account = new Account(client); const result = await account.listLogs({ queries: [], // optional - total: false // optional + total: false, // optional }); console.log(result); diff --git a/docs/examples/account/list-mfa-factors.md b/docs/examples/account/list-mfa-factors.md index 4d78b709..82c643bc 100644 --- a/docs/examples/account/list-mfa-factors.md +++ b/docs/examples/account/list-mfa-factors.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint diff --git a/docs/examples/account/list-sessions.md b/docs/examples/account/list-sessions.md index c9868acc..c8acda4d 100644 --- a/docs/examples/account/list-sessions.md +++ b/docs/examples/account/list-sessions.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint diff --git a/docs/examples/account/update-email-verification.md b/docs/examples/account/update-email-verification.md index c29caaf8..684ecfa8 100644 --- a/docs/examples/account/update-email-verification.md +++ b/docs/examples/account/update-email-verification.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -9,7 +9,7 @@ const account = new Account(client); const result = await account.updateEmailVerification({ userId: '', - secret: '' + secret: '', }); console.log(result); diff --git a/docs/examples/account/update-email.md b/docs/examples/account/update-email.md index 148c6d90..ec0f8d64 100644 --- a/docs/examples/account/update-email.md +++ b/docs/examples/account/update-email.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -9,7 +9,7 @@ const account = new Account(client); const result = await account.updateEmail({ email: 'email@example.com', - password: 'password' + password: 'password', }); console.log(result); diff --git a/docs/examples/account/update-magic-url-session.md b/docs/examples/account/update-magic-url-session.md index 5efeda04..62545322 100644 --- a/docs/examples/account/update-magic-url-session.md +++ b/docs/examples/account/update-magic-url-session.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -9,7 +9,7 @@ const account = new Account(client); const result = await account.updateMagicURLSession({ userId: '', - secret: '' + secret: '', }); console.log(result); diff --git a/docs/examples/account/update-mfa-authenticator.md b/docs/examples/account/update-mfa-authenticator.md index 67f30eaf..4a954e85 100644 --- a/docs/examples/account/update-mfa-authenticator.md +++ b/docs/examples/account/update-mfa-authenticator.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account, AuthenticatorType } from "react-native-appwrite"; +import { Client, Account, AuthenticatorType } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -9,7 +9,7 @@ const account = new Account(client); const result = await account.updateMFAAuthenticator({ type: AuthenticatorType.Totp, - otp: '' + otp: '', }); console.log(result); diff --git a/docs/examples/account/update-mfa-challenge.md b/docs/examples/account/update-mfa-challenge.md index d432e08e..b6521a69 100644 --- a/docs/examples/account/update-mfa-challenge.md +++ b/docs/examples/account/update-mfa-challenge.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -9,7 +9,7 @@ const account = new Account(client); const result = await account.updateMFAChallenge({ challengeId: '', - otp: '' + otp: '', }); console.log(result); diff --git a/docs/examples/account/update-mfa-recovery-codes.md b/docs/examples/account/update-mfa-recovery-codes.md index 5283ebca..fa03ccd0 100644 --- a/docs/examples/account/update-mfa-recovery-codes.md +++ b/docs/examples/account/update-mfa-recovery-codes.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint diff --git a/docs/examples/account/update-mfa.md b/docs/examples/account/update-mfa.md index be3e8b9a..c2973e41 100644 --- a/docs/examples/account/update-mfa.md +++ b/docs/examples/account/update-mfa.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -8,7 +8,7 @@ const client = new Client() const account = new Account(client); const result = await account.updateMFA({ - mfa: false + mfa: false, }); console.log(result); diff --git a/docs/examples/account/update-name.md b/docs/examples/account/update-name.md index 5b9182e6..500e2f06 100644 --- a/docs/examples/account/update-name.md +++ b/docs/examples/account/update-name.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -8,7 +8,7 @@ const client = new Client() const account = new Account(client); const result = await account.updateName({ - name: '' + name: '', }); console.log(result); diff --git a/docs/examples/account/update-password.md b/docs/examples/account/update-password.md index 5c3860c2..cf8ad5b6 100644 --- a/docs/examples/account/update-password.md +++ b/docs/examples/account/update-password.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -9,7 +9,7 @@ const account = new Account(client); const result = await account.updatePassword({ password: 'password', - oldPassword: 'password' // optional + oldPassword: 'password', // optional }); console.log(result); diff --git a/docs/examples/account/update-phone-session.md b/docs/examples/account/update-phone-session.md index 1b63ed69..d008f2af 100644 --- a/docs/examples/account/update-phone-session.md +++ b/docs/examples/account/update-phone-session.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -9,7 +9,7 @@ const account = new Account(client); const result = await account.updatePhoneSession({ userId: '', - secret: '' + secret: '', }); console.log(result); diff --git a/docs/examples/account/update-phone-verification.md b/docs/examples/account/update-phone-verification.md index 3f25a737..0bc9a3f0 100644 --- a/docs/examples/account/update-phone-verification.md +++ b/docs/examples/account/update-phone-verification.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -9,7 +9,7 @@ const account = new Account(client); const result = await account.updatePhoneVerification({ userId: '', - secret: '' + secret: '', }); console.log(result); diff --git a/docs/examples/account/update-phone.md b/docs/examples/account/update-phone.md index 5206263a..d8537e97 100644 --- a/docs/examples/account/update-phone.md +++ b/docs/examples/account/update-phone.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -9,7 +9,7 @@ const account = new Account(client); const result = await account.updatePhone({ phone: '+12065550100', - password: 'password' + password: 'password', }); console.log(result); diff --git a/docs/examples/account/update-prefs.md b/docs/examples/account/update-prefs.md index 510d038a..a7afc13a 100644 --- a/docs/examples/account/update-prefs.md +++ b/docs/examples/account/update-prefs.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -9,10 +9,10 @@ const account = new Account(client); const result = await account.updatePrefs({ prefs: { - "language": "en", - "timezone": "UTC", - "darkTheme": true - } + language: 'en', + timezone: 'UTC', + darkTheme: true, + }, }); console.log(result); diff --git a/docs/examples/account/update-push-target.md b/docs/examples/account/update-push-target.md index 3ca599f1..a759e5c5 100644 --- a/docs/examples/account/update-push-target.md +++ b/docs/examples/account/update-push-target.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -9,7 +9,7 @@ const account = new Account(client); const result = await account.updatePushTarget({ targetId: '', - identifier: '' + identifier: '', }); console.log(result); diff --git a/docs/examples/account/update-recovery.md b/docs/examples/account/update-recovery.md index 6beab09a..87cc4f41 100644 --- a/docs/examples/account/update-recovery.md +++ b/docs/examples/account/update-recovery.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -10,7 +10,7 @@ const account = new Account(client); const result = await account.updateRecovery({ userId: '', secret: '', - password: 'password' + password: 'password', }); console.log(result); diff --git a/docs/examples/account/update-session.md b/docs/examples/account/update-session.md index 7c99dfaf..cc3f3216 100644 --- a/docs/examples/account/update-session.md +++ b/docs/examples/account/update-session.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -8,7 +8,7 @@ const client = new Client() const account = new Account(client); const result = await account.updateSession({ - sessionId: '' + sessionId: '', }); console.log(result); diff --git a/docs/examples/account/update-status.md b/docs/examples/account/update-status.md index 0e079e44..48976e3c 100644 --- a/docs/examples/account/update-status.md +++ b/docs/examples/account/update-status.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint diff --git a/docs/examples/account/update-verification.md b/docs/examples/account/update-verification.md index efba6786..42164302 100644 --- a/docs/examples/account/update-verification.md +++ b/docs/examples/account/update-verification.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Account } from "react-native-appwrite"; +import { Client, Account } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -9,7 +9,7 @@ const account = new Account(client); const result = await account.updateVerification({ userId: '', - secret: '' + secret: '', }); console.log(result); diff --git a/docs/examples/avatars/get-browser.md b/docs/examples/avatars/get-browser.md index ff14a8c9..d748496c 100644 --- a/docs/examples/avatars/get-browser.md +++ b/docs/examples/avatars/get-browser.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Avatars, Browser } from "react-native-appwrite"; +import { Client, Avatars, Browser } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -11,7 +11,7 @@ const result = avatars.getBrowser({ code: Browser.AvantBrowser, width: 0, // optional height: 0, // optional - quality: -1 // optional + quality: -1, // optional }); console.log(result); diff --git a/docs/examples/avatars/get-credit-card.md b/docs/examples/avatars/get-credit-card.md index 1c83c95b..604390fe 100644 --- a/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/avatars/get-credit-card.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Avatars, CreditCard } from "react-native-appwrite"; +import { Client, Avatars, CreditCard } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -11,7 +11,7 @@ const result = avatars.getCreditCard({ code: CreditCard.AmericanExpress, width: 0, // optional height: 0, // optional - quality: -1 // optional + quality: -1, // optional }); console.log(result); diff --git a/docs/examples/avatars/get-favicon.md b/docs/examples/avatars/get-favicon.md index c0820921..ec54e8c5 100644 --- a/docs/examples/avatars/get-favicon.md +++ b/docs/examples/avatars/get-favicon.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Avatars } from "react-native-appwrite"; +import { Client, Avatars } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -8,7 +8,7 @@ const client = new Client() const avatars = new Avatars(client); const result = avatars.getFavicon({ - url: 'https://example.com' + url: 'https://example.com', }); console.log(result); diff --git a/docs/examples/avatars/get-flag.md b/docs/examples/avatars/get-flag.md index dd0fb734..8e5f4d7b 100644 --- a/docs/examples/avatars/get-flag.md +++ b/docs/examples/avatars/get-flag.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Avatars, Flag } from "react-native-appwrite"; +import { Client, Avatars, Flag } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -11,7 +11,7 @@ const result = avatars.getFlag({ code: Flag.Afghanistan, width: 0, // optional height: 0, // optional - quality: -1 // optional + quality: -1, // optional }); console.log(result); diff --git a/docs/examples/avatars/get-image.md b/docs/examples/avatars/get-image.md index da107482..55abf9dc 100644 --- a/docs/examples/avatars/get-image.md +++ b/docs/examples/avatars/get-image.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Avatars } from "react-native-appwrite"; +import { Client, Avatars } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -10,7 +10,7 @@ const avatars = new Avatars(client); const result = avatars.getImage({ url: 'https://example.com', width: 0, // optional - height: 0 // optional + height: 0, // optional }); console.log(result); diff --git a/docs/examples/avatars/get-initials.md b/docs/examples/avatars/get-initials.md index fbcf43ed..bd4675af 100644 --- a/docs/examples/avatars/get-initials.md +++ b/docs/examples/avatars/get-initials.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Avatars } from "react-native-appwrite"; +import { Client, Avatars } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -11,7 +11,7 @@ const result = avatars.getInitials({ name: '', // optional width: 0, // optional height: 0, // optional - background: '' // optional + background: 'FFFFFF', // optional }); console.log(result); diff --git a/docs/examples/avatars/get-photo.md b/docs/examples/avatars/get-photo.md new file mode 100644 index 00000000..44ca362b --- /dev/null +++ b/docs/examples/avatars/get-photo.md @@ -0,0 +1,22 @@ +```javascript +import { Client, Avatars } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const avatars = new Avatars(client); + +const result = avatars.getPhoto({ + width: 0, // optional + height: 0, // optional + quality: 0, // optional + output: 'png', // optional + rating: 'g', // optional + userId: 'current()', // optional + emailHash: '', // optional + name: '', // optional +}); + +console.log(result); +``` diff --git a/docs/examples/avatars/get-qr.md b/docs/examples/avatars/get-qr.md index b73c6215..98c291b9 100644 --- a/docs/examples/avatars/get-qr.md +++ b/docs/examples/avatars/get-qr.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Avatars } from "react-native-appwrite"; +import { Client, Avatars } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -11,7 +11,7 @@ const result = avatars.getQR({ text: '', size: 1, // optional margin: 0, // optional - download: false // optional + download: false, // optional }); console.log(result); diff --git a/docs/examples/avatars/get-screenshot.md b/docs/examples/avatars/get-screenshot.md index bf88cf2b..4e0402bc 100644 --- a/docs/examples/avatars/get-screenshot.md +++ b/docs/examples/avatars/get-screenshot.md @@ -1,5 +1,12 @@ ```javascript -import { Client, Avatars, BrowserTheme, Timezone, BrowserPermission, ImageFormat } from "react-native-appwrite"; +import { + Client, + Avatars, + BrowserTheme, + Timezone, + BrowserPermission, + ImageFormat, +} from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -10,14 +17,15 @@ const avatars = new Avatars(client); const result = avatars.getScreenshot({ url: 'https://example.com', headers: { - "Authorization": "Bearer token123", - "X-Custom-Header": "value" + Authorization: 'Bearer token123', + 'X-Custom-Header': 'value', }, // optional viewportWidth: 1920, // optional viewportHeight: 1080, // optional scale: 2, // optional theme: BrowserTheme.Dark, // optional - userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15', // optional + userAgent: + 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15', // optional fullpage: true, // optional locale: 'en-US', // optional timezone: Timezone.AfricaAbidjan, // optional @@ -25,12 +33,15 @@ const result = avatars.getScreenshot({ longitude: -122.4194, // optional accuracy: 100, // optional touch: true, // optional - permissions: [BrowserPermission.Geolocation, BrowserPermission.Notifications], // optional + permissions: [ + BrowserPermission.Geolocation, + BrowserPermission.Notifications, + ], // optional sleep: 3, // optional width: 800, // optional height: 600, // optional quality: 85, // optional - output: ImageFormat.Jpeg // optional + output: ImageFormat.Jpeg, // optional }); console.log(result); diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index 0b5c538b..5f4f0d8b 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Databases, Permission, Role } from "react-native-appwrite"; +import { Client, Databases, Permission, Role } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -12,14 +12,14 @@ const result = await databases.createDocument({ collectionId: '', documentId: '', data: { - "username": "walter.obrien", - "email": "walter.obrien@example.com", - "fullName": "Walter O'Brien", - "age": 30, - "isAdmin": false + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 30, + isAdmin: false, }, - permissions: ["read("any")"], // optional - transactionId: '' // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional }); console.log(result); diff --git a/docs/examples/databases/create-operations.md b/docs/examples/databases/create-operations.md index c4495a24..29999609 100644 --- a/docs/examples/databases/create-operations.md +++ b/docs/examples/databases/create-operations.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Databases } from "react-native-appwrite"; +import { Client, Databases } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -10,16 +10,16 @@ const databases = new Databases(client); const result = await databases.createOperations({ transactionId: '', operations: [ - { - "action": "create", - "databaseId": "", - "collectionId": "", - "documentId": "", - "data": { - "name": "Walter O'Brien" - } - } - ] // optional + { + action: 'create', + databaseId: '', + collectionId: '', + documentId: '', + data: { + name: "Walter O'Brien", + }, + }, + ], // optional }); console.log(result); diff --git a/docs/examples/databases/create-transaction.md b/docs/examples/databases/create-transaction.md index a1c4d328..508008db 100644 --- a/docs/examples/databases/create-transaction.md +++ b/docs/examples/databases/create-transaction.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Databases } from "react-native-appwrite"; +import { Client, Databases } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -8,7 +8,7 @@ const client = new Client() const databases = new Databases(client); const result = await databases.createTransaction({ - ttl: 60 // optional + ttl: 60, // optional }); console.log(result); diff --git a/docs/examples/databases/decrement-document-attribute.md b/docs/examples/databases/decrement-document-attribute.md index 19a8742b..efb34ee4 100644 --- a/docs/examples/databases/decrement-document-attribute.md +++ b/docs/examples/databases/decrement-document-attribute.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Databases } from "react-native-appwrite"; +import { Client, Databases } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -11,10 +11,10 @@ const result = await databases.decrementDocumentAttribute({ databaseId: '', collectionId: '', documentId: '', - attribute: '', - value: 0, // optional + attribute: '', + value: 1, // optional min: 0, // optional - transactionId: '' // optional + transactionId: '', // optional }); console.log(result); diff --git a/docs/examples/databases/delete-document.md b/docs/examples/databases/delete-document.md index c8db1b21..5b326f08 100644 --- a/docs/examples/databases/delete-document.md +++ b/docs/examples/databases/delete-document.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Databases } from "react-native-appwrite"; +import { Client, Databases } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -11,7 +11,7 @@ const result = await databases.deleteDocument({ databaseId: '', collectionId: '', documentId: '', - transactionId: '' // optional + transactionId: '', // optional }); console.log(result); diff --git a/docs/examples/databases/delete-transaction.md b/docs/examples/databases/delete-transaction.md index 30f149d9..b020fec4 100644 --- a/docs/examples/databases/delete-transaction.md +++ b/docs/examples/databases/delete-transaction.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Databases } from "react-native-appwrite"; +import { Client, Databases } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -8,7 +8,7 @@ const client = new Client() const databases = new Databases(client); const result = await databases.deleteTransaction({ - transactionId: '' + transactionId: '', }); console.log(result); diff --git a/docs/examples/databases/get-document.md b/docs/examples/databases/get-document.md index 1dcfc2b2..c4de1815 100644 --- a/docs/examples/databases/get-document.md +++ b/docs/examples/databases/get-document.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Databases } from "react-native-appwrite"; +import { Client, Databases } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -12,7 +12,7 @@ const result = await databases.getDocument({ collectionId: '', documentId: '', queries: [], // optional - transactionId: '' // optional + transactionId: '', // optional }); console.log(result); diff --git a/docs/examples/databases/get-transaction.md b/docs/examples/databases/get-transaction.md index 839712a9..76923162 100644 --- a/docs/examples/databases/get-transaction.md +++ b/docs/examples/databases/get-transaction.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Databases } from "react-native-appwrite"; +import { Client, Databases } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -8,7 +8,7 @@ const client = new Client() const databases = new Databases(client); const result = await databases.getTransaction({ - transactionId: '' + transactionId: '', }); console.log(result); diff --git a/docs/examples/databases/increment-document-attribute.md b/docs/examples/databases/increment-document-attribute.md index 95123e83..9da47e2a 100644 --- a/docs/examples/databases/increment-document-attribute.md +++ b/docs/examples/databases/increment-document-attribute.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Databases } from "react-native-appwrite"; +import { Client, Databases } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -11,10 +11,10 @@ const result = await databases.incrementDocumentAttribute({ databaseId: '', collectionId: '', documentId: '', - attribute: '', - value: 0, // optional - max: 0, // optional - transactionId: '' // optional + attribute: '', + value: 1, // optional + max: 100, // optional + transactionId: '', // optional }); console.log(result); diff --git a/docs/examples/databases/list-documents.md b/docs/examples/databases/list-documents.md index 7907cd3f..c4f07bf9 100644 --- a/docs/examples/databases/list-documents.md +++ b/docs/examples/databases/list-documents.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Databases } from "react-native-appwrite"; +import { Client, Databases } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -13,7 +13,7 @@ const result = await databases.listDocuments({ queries: [], // optional transactionId: '', // optional total: false, // optional - ttl: 0 // optional + ttl: 0, // optional }); console.log(result); diff --git a/docs/examples/databases/list-transactions.md b/docs/examples/databases/list-transactions.md index 0ca57bac..051ea0f3 100644 --- a/docs/examples/databases/list-transactions.md +++ b/docs/examples/databases/list-transactions.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Databases } from "react-native-appwrite"; +import { Client, Databases } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -8,7 +8,7 @@ const client = new Client() const databases = new Databases(client); const result = await databases.listTransactions({ - queries: [] // optional + queries: [], // optional }); console.log(result); diff --git a/docs/examples/databases/update-document.md b/docs/examples/databases/update-document.md index 44ff772e..9aac365f 100644 --- a/docs/examples/databases/update-document.md +++ b/docs/examples/databases/update-document.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Databases, Permission, Role } from "react-native-appwrite"; +import { Client, Databases, Permission, Role } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -12,14 +12,14 @@ const result = await databases.updateDocument({ collectionId: '', documentId: '', data: { - "username": "walter.obrien", - "email": "walter.obrien@example.com", - "fullName": "Walter O'Brien", - "age": 33, - "isAdmin": false + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 33, + isAdmin: false, }, // optional - permissions: ["read("any")"], // optional - transactionId: '' // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional }); console.log(result); diff --git a/docs/examples/databases/update-transaction.md b/docs/examples/databases/update-transaction.md index fa1a745c..9f040f0b 100644 --- a/docs/examples/databases/update-transaction.md +++ b/docs/examples/databases/update-transaction.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Databases } from "react-native-appwrite"; +import { Client, Databases } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -10,7 +10,7 @@ const databases = new Databases(client); const result = await databases.updateTransaction({ transactionId: '', commit: false, // optional - rollback: false // optional + rollback: false, // optional }); console.log(result); diff --git a/docs/examples/databases/upsert-document.md b/docs/examples/databases/upsert-document.md index 9552a9d2..6d2102aa 100644 --- a/docs/examples/databases/upsert-document.md +++ b/docs/examples/databases/upsert-document.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Databases, Permission, Role } from "react-native-appwrite"; +import { Client, Databases, Permission, Role } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -12,14 +12,14 @@ const result = await databases.upsertDocument({ collectionId: '', documentId: '', data: { - "username": "walter.obrien", - "email": "walter.obrien@example.com", - "fullName": "Walter O'Brien", - "age": 30, - "isAdmin": false + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 30, + isAdmin: false, }, // optional - permissions: ["read("any")"], // optional - transactionId: '' // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional }); console.log(result); diff --git a/docs/examples/documentsdb/create-document.md b/docs/examples/documentsdb/create-document.md new file mode 100644 index 00000000..51d69a97 --- /dev/null +++ b/docs/examples/documentsdb/create-document.md @@ -0,0 +1,26 @@ +```javascript +import { Client, DocumentsDB, Permission, Role } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.createDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: { + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 30, + isAdmin: false, + }, + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/create-documents.md b/docs/examples/documentsdb/create-documents.md new file mode 100644 index 00000000..891757c6 --- /dev/null +++ b/docs/examples/documentsdb/create-documents.md @@ -0,0 +1,18 @@ +```javascript +import { Client, DocumentsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.createDocuments({ + databaseId: '', + collectionId: '', + documents: [], + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/create-operations.md b/docs/examples/documentsdb/create-operations.md new file mode 100644 index 00000000..41698bbf --- /dev/null +++ b/docs/examples/documentsdb/create-operations.md @@ -0,0 +1,26 @@ +```javascript +import { Client, DocumentsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.createOperations({ + transactionId: '', + operations: [ + { + action: 'create', + databaseId: '', + collectionId: '', + documentId: '', + data: { + name: "Walter O'Brien", + }, + }, + ], // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/create-transaction.md b/docs/examples/documentsdb/create-transaction.md new file mode 100644 index 00000000..e535ea74 --- /dev/null +++ b/docs/examples/documentsdb/create-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, DocumentsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.createTransaction({ + ttl: 60, // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/decrement-document-attribute.md b/docs/examples/documentsdb/decrement-document-attribute.md new file mode 100644 index 00000000..ca7ed94f --- /dev/null +++ b/docs/examples/documentsdb/decrement-document-attribute.md @@ -0,0 +1,21 @@ +```javascript +import { Client, DocumentsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.decrementDocumentAttribute({ + databaseId: '', + collectionId: '', + documentId: '', + attribute: '', + value: 1, // optional + min: 0, // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/delete-document.md b/docs/examples/documentsdb/delete-document.md new file mode 100644 index 00000000..ba07f831 --- /dev/null +++ b/docs/examples/documentsdb/delete-document.md @@ -0,0 +1,18 @@ +```javascript +import { Client, DocumentsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.deleteDocument({ + databaseId: '', + collectionId: '', + documentId: '', + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/delete-transaction.md b/docs/examples/documentsdb/delete-transaction.md new file mode 100644 index 00000000..a537cad4 --- /dev/null +++ b/docs/examples/documentsdb/delete-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, DocumentsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.deleteTransaction({ + transactionId: '', +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/get-document.md b/docs/examples/documentsdb/get-document.md new file mode 100644 index 00000000..64a5b43b --- /dev/null +++ b/docs/examples/documentsdb/get-document.md @@ -0,0 +1,19 @@ +```javascript +import { Client, DocumentsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.getDocument({ + databaseId: '', + collectionId: '', + documentId: '', + queries: [], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/get-transaction.md b/docs/examples/documentsdb/get-transaction.md new file mode 100644 index 00000000..449f8924 --- /dev/null +++ b/docs/examples/documentsdb/get-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, DocumentsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.getTransaction({ + transactionId: '', +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/increment-document-attribute.md b/docs/examples/documentsdb/increment-document-attribute.md new file mode 100644 index 00000000..80f4b0cc --- /dev/null +++ b/docs/examples/documentsdb/increment-document-attribute.md @@ -0,0 +1,21 @@ +```javascript +import { Client, DocumentsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.incrementDocumentAttribute({ + databaseId: '', + collectionId: '', + documentId: '', + attribute: '', + value: 1, // optional + max: 100, // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/list-documents.md b/docs/examples/documentsdb/list-documents.md new file mode 100644 index 00000000..b6a16cc2 --- /dev/null +++ b/docs/examples/documentsdb/list-documents.md @@ -0,0 +1,20 @@ +```javascript +import { Client, DocumentsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.listDocuments({ + databaseId: '', + collectionId: '', + queries: [], // optional + transactionId: '', // optional + total: false, // optional + ttl: 0, // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/list-transactions.md b/docs/examples/documentsdb/list-transactions.md new file mode 100644 index 00000000..24c8dbdb --- /dev/null +++ b/docs/examples/documentsdb/list-transactions.md @@ -0,0 +1,15 @@ +```javascript +import { Client, DocumentsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.listTransactions({ + queries: [], // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/update-document.md b/docs/examples/documentsdb/update-document.md new file mode 100644 index 00000000..cad772de --- /dev/null +++ b/docs/examples/documentsdb/update-document.md @@ -0,0 +1,20 @@ +```javascript +import { Client, DocumentsDB, Permission, Role } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.updateDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: {}, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/update-transaction.md b/docs/examples/documentsdb/update-transaction.md new file mode 100644 index 00000000..df1009a6 --- /dev/null +++ b/docs/examples/documentsdb/update-transaction.md @@ -0,0 +1,17 @@ +```javascript +import { Client, DocumentsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.updateTransaction({ + transactionId: '', + commit: false, // optional + rollback: false, // optional +}); + +console.log(result); +``` diff --git a/docs/examples/documentsdb/upsert-document.md b/docs/examples/documentsdb/upsert-document.md new file mode 100644 index 00000000..52af7040 --- /dev/null +++ b/docs/examples/documentsdb/upsert-document.md @@ -0,0 +1,20 @@ +```javascript +import { Client, DocumentsDB, Permission, Role } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const documentsDB = new DocumentsDB(client); + +const result = await documentsDB.upsertDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: {}, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index 3a05c923..7c0addc7 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Functions, ExecutionMethod } from "react-native-appwrite"; +import { Client, Functions, ExecutionMethod } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -14,7 +14,7 @@ const result = await functions.createExecution({ xpath: '', // optional method: ExecutionMethod.GET, // optional headers: {}, // optional - scheduledAt: '' // optional + scheduledAt: '', // optional }); console.log(result); diff --git a/docs/examples/functions/get-execution.md b/docs/examples/functions/get-execution.md index 9393fc30..5f3bd512 100644 --- a/docs/examples/functions/get-execution.md +++ b/docs/examples/functions/get-execution.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Functions } from "react-native-appwrite"; +import { Client, Functions } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -9,7 +9,7 @@ const functions = new Functions(client); const result = await functions.getExecution({ functionId: '', - executionId: '' + executionId: '', }); console.log(result); diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md index 405fbe77..fedf597a 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Functions } from "react-native-appwrite"; +import { Client, Functions } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -10,7 +10,7 @@ const functions = new Functions(client); const result = await functions.listExecutions({ functionId: '', queries: [], // optional - total: false // optional + total: false, // optional }); console.log(result); diff --git a/docs/examples/graphql/mutation.md b/docs/examples/graphql/mutation.md index 3b7b3dc1..f5e673a2 100644 --- a/docs/examples/graphql/mutation.md +++ b/docs/examples/graphql/mutation.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Graphql } from "react-native-appwrite"; +import { Client, Graphql } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -8,7 +8,7 @@ const client = new Client() const graphql = new Graphql(client); const result = await graphql.mutation({ - query: {} + query: {}, }); console.log(result); diff --git a/docs/examples/graphql/query.md b/docs/examples/graphql/query.md index fe3afbf9..c9640ebe 100644 --- a/docs/examples/graphql/query.md +++ b/docs/examples/graphql/query.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Graphql } from "react-native-appwrite"; +import { Client, Graphql } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -8,7 +8,7 @@ const client = new Client() const graphql = new Graphql(client); const result = await graphql.query({ - query: {} + query: {}, }); console.log(result); diff --git a/docs/examples/locale/get.md b/docs/examples/locale/get.md index 81f04e18..99bde954 100644 --- a/docs/examples/locale/get.md +++ b/docs/examples/locale/get.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Locale } from "react-native-appwrite"; +import { Client, Locale } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint diff --git a/docs/examples/locale/list-codes.md b/docs/examples/locale/list-codes.md index efea7971..f96a7ee3 100644 --- a/docs/examples/locale/list-codes.md +++ b/docs/examples/locale/list-codes.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Locale } from "react-native-appwrite"; +import { Client, Locale } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint diff --git a/docs/examples/locale/list-continents.md b/docs/examples/locale/list-continents.md index aa3eba82..8973cfd4 100644 --- a/docs/examples/locale/list-continents.md +++ b/docs/examples/locale/list-continents.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Locale } from "react-native-appwrite"; +import { Client, Locale } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint diff --git a/docs/examples/locale/list-countries-eu.md b/docs/examples/locale/list-countries-eu.md index 92447251..f948ee69 100644 --- a/docs/examples/locale/list-countries-eu.md +++ b/docs/examples/locale/list-countries-eu.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Locale } from "react-native-appwrite"; +import { Client, Locale } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint diff --git a/docs/examples/locale/list-countries-phones.md b/docs/examples/locale/list-countries-phones.md index c09816b0..7974d60e 100644 --- a/docs/examples/locale/list-countries-phones.md +++ b/docs/examples/locale/list-countries-phones.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Locale } from "react-native-appwrite"; +import { Client, Locale } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint diff --git a/docs/examples/locale/list-countries.md b/docs/examples/locale/list-countries.md index bf607a4e..b46bc615 100644 --- a/docs/examples/locale/list-countries.md +++ b/docs/examples/locale/list-countries.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Locale } from "react-native-appwrite"; +import { Client, Locale } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint diff --git a/docs/examples/locale/list-currencies.md b/docs/examples/locale/list-currencies.md index ade09501..28498d9a 100644 --- a/docs/examples/locale/list-currencies.md +++ b/docs/examples/locale/list-currencies.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Locale } from "react-native-appwrite"; +import { Client, Locale } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint diff --git a/docs/examples/locale/list-languages.md b/docs/examples/locale/list-languages.md index 12e603f7..835b04de 100644 --- a/docs/examples/locale/list-languages.md +++ b/docs/examples/locale/list-languages.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Locale } from "react-native-appwrite"; +import { Client, Locale } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint diff --git a/docs/examples/messaging/create-subscriber.md b/docs/examples/messaging/create-subscriber.md index ae78a134..20f1368b 100644 --- a/docs/examples/messaging/create-subscriber.md +++ b/docs/examples/messaging/create-subscriber.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Messaging } from "react-native-appwrite"; +import { Client, Messaging } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -10,7 +10,7 @@ const messaging = new Messaging(client); const result = await messaging.createSubscriber({ topicId: '', subscriberId: '', - targetId: '' + targetId: '', }); console.log(result); diff --git a/docs/examples/messaging/delete-subscriber.md b/docs/examples/messaging/delete-subscriber.md index da6370c1..209c133f 100644 --- a/docs/examples/messaging/delete-subscriber.md +++ b/docs/examples/messaging/delete-subscriber.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Messaging } from "react-native-appwrite"; +import { Client, Messaging } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -9,7 +9,7 @@ const messaging = new Messaging(client); const result = await messaging.deleteSubscriber({ topicId: '', - subscriberId: '' + subscriberId: '', }); console.log(result); diff --git a/docs/examples/organization/create-installation.md b/docs/examples/organization/create-installation.md new file mode 100644 index 00000000..9ae1fa67 --- /dev/null +++ b/docs/examples/organization/create-installation.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Organization } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const organization = new Organization(client); + +const result = await organization.createInstallation({ + appId: '', + authorizationDetails: '', // optional +}); + +console.log(result); +``` diff --git a/docs/examples/organization/delete-installation.md b/docs/examples/organization/delete-installation.md new file mode 100644 index 00000000..47f5cc48 --- /dev/null +++ b/docs/examples/organization/delete-installation.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Organization } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const organization = new Organization(client); + +const result = await organization.deleteInstallation({ + installationId: '', +}); + +console.log(result); +``` diff --git a/docs/examples/organization/get-installation.md b/docs/examples/organization/get-installation.md new file mode 100644 index 00000000..bcde6bf3 --- /dev/null +++ b/docs/examples/organization/get-installation.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Organization } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const organization = new Organization(client); + +const result = await organization.getInstallation({ + installationId: '', +}); + +console.log(result); +``` diff --git a/docs/examples/organization/list-installations.md b/docs/examples/organization/list-installations.md new file mode 100644 index 00000000..83618188 --- /dev/null +++ b/docs/examples/organization/list-installations.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Organization } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const organization = new Organization(client); + +const result = await organization.listInstallations({ + queries: [], // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/docs/examples/organization/update-installation.md b/docs/examples/organization/update-installation.md new file mode 100644 index 00000000..150d0ee6 --- /dev/null +++ b/docs/examples/organization/update-installation.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Organization } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const organization = new Organization(client); + +const result = await organization.updateInstallation({ + installationId: '', + authorizationDetails: '', // optional +}); + +console.log(result); +``` diff --git a/docs/examples/presences/delete.md b/docs/examples/presences/delete.md index 447de030..03e4a107 100644 --- a/docs/examples/presences/delete.md +++ b/docs/examples/presences/delete.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Presences } from "react-native-appwrite"; +import { Client, Presences } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -8,7 +8,7 @@ const client = new Client() const presences = new Presences(client); const result = await presences.delete({ - presenceId: '' + presenceId: '', }); console.log(result); diff --git a/docs/examples/presences/get.md b/docs/examples/presences/get.md index e5b89718..7358111b 100644 --- a/docs/examples/presences/get.md +++ b/docs/examples/presences/get.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Presences } from "react-native-appwrite"; +import { Client, Presences } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -8,7 +8,7 @@ const client = new Client() const presences = new Presences(client); const result = await presences.get({ - presenceId: '' + presenceId: '', }); console.log(result); diff --git a/docs/examples/presences/list.md b/docs/examples/presences/list.md index ccfe7079..ea4f8fe8 100644 --- a/docs/examples/presences/list.md +++ b/docs/examples/presences/list.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Presences } from "react-native-appwrite"; +import { Client, Presences } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -10,7 +10,7 @@ const presences = new Presences(client); const result = await presences.list({ queries: [], // optional total: false, // optional - ttl: 0 // optional + ttl: 0, // optional }); console.log(result); diff --git a/docs/examples/presences/update.md b/docs/examples/presences/update.md index 16ef7428..a9a0dad7 100644 --- a/docs/examples/presences/update.md +++ b/docs/examples/presences/update.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Presences, Permission, Role } from "react-native-appwrite"; +import { Client, Presences, Permission, Role } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -12,8 +12,8 @@ const result = await presences.update({ status: '', // optional expiresAt: '2020-10-15T06:38:00.000+00:00', // optional metadata: {}, // optional - permissions: ["read("any")"], // optional - purge: false // optional + permissions: [Permission.read(Role.any())], // optional + purge: false, // optional }); console.log(result); diff --git a/docs/examples/presences/upsert.md b/docs/examples/presences/upsert.md index 522c44e0..09e21622 100644 --- a/docs/examples/presences/upsert.md +++ b/docs/examples/presences/upsert.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Presences, Permission, Role } from "react-native-appwrite"; +import { Client, Presences, Permission, Role } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -10,9 +10,9 @@ const presences = new Presences(client); const result = await presences.upsert({ presenceId: '', status: '', - permissions: ["read("any")"], // optional + permissions: [Permission.read(Role.any())], // optional expiresAt: '2020-10-15T06:38:00.000+00:00', // optional - metadata: {} // optional + metadata: {}, // optional }); console.log(result); diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index c1ca26ae..2901c4bd 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Storage, Permission, Role } from "react-native-appwrite"; +import { Client, Storage, Permission, Role } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -10,8 +10,14 @@ const storage = new Storage(client); const result = await storage.createFile({ bucketId: '', fileId: '', - file: InputFile.fromPath('/path/to/file', 'filename'), - permissions: ["read("any")"] // optional + file: { + name: 'image.png', + type: 'image/png', + size: 1024, + uri: 'file:///path/to/image.png', + }, + permissions: [Permission.read(Role.any())], // optional + folder: 'photos/2026', // optional }); console.log(result); diff --git a/docs/examples/storage/delete-file.md b/docs/examples/storage/delete-file.md index f4c109fb..c6ef83ce 100644 --- a/docs/examples/storage/delete-file.md +++ b/docs/examples/storage/delete-file.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Storage } from "react-native-appwrite"; +import { Client, Storage } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -9,7 +9,7 @@ const storage = new Storage(client); const result = await storage.deleteFile({ bucketId: '', - fileId: '' + fileId: '', }); console.log(result); diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md index 52f602b9..cba6f31c 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Storage } from "react-native-appwrite"; +import { Client, Storage } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -10,7 +10,7 @@ const storage = new Storage(client); const result = storage.getFileDownload({ bucketId: '', fileId: '', - token: '' // optional + token: '', // optional }); console.log(result); diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index d3c944ad..5be0eea8 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -1,5 +1,10 @@ ```javascript -import { Client, Storage, ImageGravity, ImageFormat } from "react-native-appwrite"; +import { + Client, + Storage, + ImageGravity, + ImageFormat, +} from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -15,13 +20,13 @@ const result = storage.getFilePreview({ gravity: ImageGravity.Center, // optional quality: -1, // optional borderWidth: 0, // optional - borderColor: '', // optional + borderColor: 'FFFFFF', // optional borderRadius: 0, // optional opacity: 0, // optional rotation: -360, // optional - background: '', // optional + background: 'FFFFFF', // optional output: ImageFormat.Jpg, // optional - token: '' // optional + token: '', // optional }); console.log(result); diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md index 28e6e43a..99b34161 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Storage } from "react-native-appwrite"; +import { Client, Storage } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -10,7 +10,7 @@ const storage = new Storage(client); const result = storage.getFileView({ bucketId: '', fileId: '', - token: '' // optional + token: '', // optional }); console.log(result); diff --git a/docs/examples/storage/get-file.md b/docs/examples/storage/get-file.md index d587547c..80b9a17e 100644 --- a/docs/examples/storage/get-file.md +++ b/docs/examples/storage/get-file.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Storage } from "react-native-appwrite"; +import { Client, Storage } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -9,7 +9,7 @@ const storage = new Storage(client); const result = await storage.getFile({ bucketId: '', - fileId: '' + fileId: '', }); console.log(result); diff --git a/docs/examples/storage/list-files.md b/docs/examples/storage/list-files.md index ac21eadb..31b88fb5 100644 --- a/docs/examples/storage/list-files.md +++ b/docs/examples/storage/list-files.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Storage } from "react-native-appwrite"; +import { Client, Storage } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -11,7 +11,7 @@ const result = await storage.listFiles({ bucketId: '', queries: [], // optional search: '', // optional - total: false // optional + total: false, // optional }); console.log(result); diff --git a/docs/examples/storage/update-file.md b/docs/examples/storage/update-file.md index 82fc4d26..417fb811 100644 --- a/docs/examples/storage/update-file.md +++ b/docs/examples/storage/update-file.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Storage, Permission, Role } from "react-native-appwrite"; +import { Client, Storage, Permission, Role } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -11,7 +11,7 @@ const result = await storage.updateFile({ bucketId: '', fileId: '', name: '', // optional - permissions: ["read("any")"] // optional + permissions: [Permission.read(Role.any())], // optional }); console.log(result); diff --git a/docs/examples/tablesdb/create-operations.md b/docs/examples/tablesdb/create-operations.md index c061f76c..9c1458fe 100644 --- a/docs/examples/tablesdb/create-operations.md +++ b/docs/examples/tablesdb/create-operations.md @@ -1,5 +1,5 @@ ```javascript -import { Client, TablesDB } from "react-native-appwrite"; +import { Client, TablesDB } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -10,16 +10,16 @@ const tablesDB = new TablesDB(client); const result = await tablesDB.createOperations({ transactionId: '', operations: [ - { - "action": "create", - "databaseId": "", - "tableId": "", - "rowId": "", - "data": { - "name": "Walter O'Brien" - } - } - ] // optional + { + action: 'create', + databaseId: '', + tableId: '', + rowId: '', + data: { + name: "Walter O'Brien", + }, + }, + ], // optional }); console.log(result); diff --git a/docs/examples/tablesdb/create-row.md b/docs/examples/tablesdb/create-row.md index 18e1777d..c4d2cb4f 100644 --- a/docs/examples/tablesdb/create-row.md +++ b/docs/examples/tablesdb/create-row.md @@ -1,5 +1,5 @@ ```javascript -import { Client, TablesDB, Permission, Role } from "react-native-appwrite"; +import { Client, TablesDB, Permission, Role } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -12,14 +12,14 @@ const result = await tablesDB.createRow({ tableId: '', rowId: '', data: { - "username": "walter.obrien", - "email": "walter.obrien@example.com", - "fullName": "Walter O'Brien", - "age": 30, - "isAdmin": false + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 30, + isAdmin: false, }, - permissions: ["read("any")"], // optional - transactionId: '' // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/create-transaction.md b/docs/examples/tablesdb/create-transaction.md index 4d73a3e2..87e53a18 100644 --- a/docs/examples/tablesdb/create-transaction.md +++ b/docs/examples/tablesdb/create-transaction.md @@ -1,5 +1,5 @@ ```javascript -import { Client, TablesDB } from "react-native-appwrite"; +import { Client, TablesDB } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -8,7 +8,7 @@ const client = new Client() const tablesDB = new TablesDB(client); const result = await tablesDB.createTransaction({ - ttl: 60 // optional + ttl: 60, // optional }); console.log(result); diff --git a/docs/examples/tablesdb/decrement-row-column.md b/docs/examples/tablesdb/decrement-row-column.md index 3d036ad6..a3a845f8 100644 --- a/docs/examples/tablesdb/decrement-row-column.md +++ b/docs/examples/tablesdb/decrement-row-column.md @@ -1,5 +1,5 @@ ```javascript -import { Client, TablesDB } from "react-native-appwrite"; +import { Client, TablesDB } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -11,10 +11,10 @@ const result = await tablesDB.decrementRowColumn({ databaseId: '', tableId: '', rowId: '', - column: '', - value: 0, // optional + column: '', + value: 1, // optional min: 0, // optional - transactionId: '' // optional + transactionId: '', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/delete-row.md b/docs/examples/tablesdb/delete-row.md index a7b94e27..4a32be86 100644 --- a/docs/examples/tablesdb/delete-row.md +++ b/docs/examples/tablesdb/delete-row.md @@ -1,5 +1,5 @@ ```javascript -import { Client, TablesDB } from "react-native-appwrite"; +import { Client, TablesDB } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -11,7 +11,7 @@ const result = await tablesDB.deleteRow({ databaseId: '', tableId: '', rowId: '', - transactionId: '' // optional + transactionId: '', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/delete-transaction.md b/docs/examples/tablesdb/delete-transaction.md index 4fb82043..3cbf63e9 100644 --- a/docs/examples/tablesdb/delete-transaction.md +++ b/docs/examples/tablesdb/delete-transaction.md @@ -1,5 +1,5 @@ ```javascript -import { Client, TablesDB } from "react-native-appwrite"; +import { Client, TablesDB } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -8,7 +8,7 @@ const client = new Client() const tablesDB = new TablesDB(client); const result = await tablesDB.deleteTransaction({ - transactionId: '' + transactionId: '', }); console.log(result); diff --git a/docs/examples/tablesdb/get-row.md b/docs/examples/tablesdb/get-row.md index 7fa742ef..fe2c7769 100644 --- a/docs/examples/tablesdb/get-row.md +++ b/docs/examples/tablesdb/get-row.md @@ -1,5 +1,5 @@ ```javascript -import { Client, TablesDB } from "react-native-appwrite"; +import { Client, TablesDB } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -12,7 +12,7 @@ const result = await tablesDB.getRow({ tableId: '', rowId: '', queries: [], // optional - transactionId: '' // optional + transactionId: '', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/get-transaction.md b/docs/examples/tablesdb/get-transaction.md index 2c5d350f..8776ee66 100644 --- a/docs/examples/tablesdb/get-transaction.md +++ b/docs/examples/tablesdb/get-transaction.md @@ -1,5 +1,5 @@ ```javascript -import { Client, TablesDB } from "react-native-appwrite"; +import { Client, TablesDB } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -8,7 +8,7 @@ const client = new Client() const tablesDB = new TablesDB(client); const result = await tablesDB.getTransaction({ - transactionId: '' + transactionId: '', }); console.log(result); diff --git a/docs/examples/tablesdb/increment-row-column.md b/docs/examples/tablesdb/increment-row-column.md index 6c924ad9..18985147 100644 --- a/docs/examples/tablesdb/increment-row-column.md +++ b/docs/examples/tablesdb/increment-row-column.md @@ -1,5 +1,5 @@ ```javascript -import { Client, TablesDB } from "react-native-appwrite"; +import { Client, TablesDB } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -11,10 +11,10 @@ const result = await tablesDB.incrementRowColumn({ databaseId: '', tableId: '', rowId: '', - column: '', - value: 0, // optional - max: 0, // optional - transactionId: '' // optional + column: '', + value: 1, // optional + max: 100, // optional + transactionId: '', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/list-rows.md b/docs/examples/tablesdb/list-rows.md index 80bbc454..6c0cc417 100644 --- a/docs/examples/tablesdb/list-rows.md +++ b/docs/examples/tablesdb/list-rows.md @@ -1,5 +1,5 @@ ```javascript -import { Client, TablesDB } from "react-native-appwrite"; +import { Client, TablesDB } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -13,7 +13,7 @@ const result = await tablesDB.listRows({ queries: [], // optional transactionId: '', // optional total: false, // optional - ttl: 0 // optional + ttl: 0, // optional }); console.log(result); diff --git a/docs/examples/tablesdb/list-transactions.md b/docs/examples/tablesdb/list-transactions.md index 008ed3de..e28ff141 100644 --- a/docs/examples/tablesdb/list-transactions.md +++ b/docs/examples/tablesdb/list-transactions.md @@ -1,5 +1,5 @@ ```javascript -import { Client, TablesDB } from "react-native-appwrite"; +import { Client, TablesDB } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -8,7 +8,7 @@ const client = new Client() const tablesDB = new TablesDB(client); const result = await tablesDB.listTransactions({ - queries: [] // optional + queries: [], // optional }); console.log(result); diff --git a/docs/examples/tablesdb/update-row.md b/docs/examples/tablesdb/update-row.md index 0916853f..a330449e 100644 --- a/docs/examples/tablesdb/update-row.md +++ b/docs/examples/tablesdb/update-row.md @@ -1,5 +1,5 @@ ```javascript -import { Client, TablesDB, Permission, Role } from "react-native-appwrite"; +import { Client, TablesDB, Permission, Role } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -12,14 +12,14 @@ const result = await tablesDB.updateRow({ tableId: '', rowId: '', data: { - "username": "walter.obrien", - "email": "walter.obrien@example.com", - "fullName": "Walter O'Brien", - "age": 33, - "isAdmin": false + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 33, + isAdmin: false, }, // optional - permissions: ["read("any")"], // optional - transactionId: '' // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional }); console.log(result); diff --git a/docs/examples/tablesdb/update-transaction.md b/docs/examples/tablesdb/update-transaction.md index d94c24a0..d89cc16e 100644 --- a/docs/examples/tablesdb/update-transaction.md +++ b/docs/examples/tablesdb/update-transaction.md @@ -1,5 +1,5 @@ ```javascript -import { Client, TablesDB } from "react-native-appwrite"; +import { Client, TablesDB } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -10,7 +10,7 @@ const tablesDB = new TablesDB(client); const result = await tablesDB.updateTransaction({ transactionId: '', commit: false, // optional - rollback: false // optional + rollback: false, // optional }); console.log(result); diff --git a/docs/examples/tablesdb/upsert-row.md b/docs/examples/tablesdb/upsert-row.md index e578cccb..91691931 100644 --- a/docs/examples/tablesdb/upsert-row.md +++ b/docs/examples/tablesdb/upsert-row.md @@ -1,5 +1,5 @@ ```javascript -import { Client, TablesDB, Permission, Role } from "react-native-appwrite"; +import { Client, TablesDB, Permission, Role } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -12,14 +12,14 @@ const result = await tablesDB.upsertRow({ tableId: '', rowId: '', data: { - "username": "walter.obrien", - "email": "walter.obrien@example.com", - "fullName": "Walter O'Brien", - "age": 33, - "isAdmin": false + username: 'walter.obrien', + email: 'walter.obrien@example.com', + fullName: "Walter O'Brien", + age: 33, + isAdmin: false, }, // optional - permissions: ["read("any")"], // optional - transactionId: '' // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional }); console.log(result); diff --git a/docs/examples/teams/create-installation.md b/docs/examples/teams/create-installation.md new file mode 100644 index 00000000..56b4b08e --- /dev/null +++ b/docs/examples/teams/create-installation.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Teams } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const teams = new Teams(client); + +const result = await teams.createInstallation({ + teamId: '', + appId: '', + authorizationDetails: '', // optional +}); + +console.log(result); +``` diff --git a/docs/examples/teams/create-membership.md b/docs/examples/teams/create-membership.md index 824c129c..e7fe0d72 100644 --- a/docs/examples/teams/create-membership.md +++ b/docs/examples/teams/create-membership.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Teams } from "react-native-appwrite"; +import { Client, Teams } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -14,7 +14,7 @@ const result = await teams.createMembership({ userId: '', // optional phone: '+12065550100', // optional url: 'https://example.com', // optional - name: '' // optional + name: '', // optional }); console.log(result); diff --git a/docs/examples/teams/create.md b/docs/examples/teams/create.md index c6338930..0bd3adf5 100644 --- a/docs/examples/teams/create.md +++ b/docs/examples/teams/create.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Teams } from "react-native-appwrite"; +import { Client, Teams } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -10,7 +10,7 @@ const teams = new Teams(client); const result = await teams.create({ teamId: '', name: '', - roles: [] // optional + roles: [], // optional }); console.log(result); diff --git a/docs/examples/teams/delete-installation.md b/docs/examples/teams/delete-installation.md new file mode 100644 index 00000000..29097557 --- /dev/null +++ b/docs/examples/teams/delete-installation.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Teams } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const teams = new Teams(client); + +const result = await teams.deleteInstallation({ + teamId: '', + installationId: '', +}); + +console.log(result); +``` diff --git a/docs/examples/teams/delete-membership.md b/docs/examples/teams/delete-membership.md index 1cdb4baf..f8fb2c97 100644 --- a/docs/examples/teams/delete-membership.md +++ b/docs/examples/teams/delete-membership.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Teams } from "react-native-appwrite"; +import { Client, Teams } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -9,7 +9,7 @@ const teams = new Teams(client); const result = await teams.deleteMembership({ teamId: '', - membershipId: '' + membershipId: '', }); console.log(result); diff --git a/docs/examples/teams/delete.md b/docs/examples/teams/delete.md index 81a4fa64..e5927ef8 100644 --- a/docs/examples/teams/delete.md +++ b/docs/examples/teams/delete.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Teams } from "react-native-appwrite"; +import { Client, Teams } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -8,7 +8,7 @@ const client = new Client() const teams = new Teams(client); const result = await teams.delete({ - teamId: '' + teamId: '', }); console.log(result); diff --git a/docs/examples/teams/get-installation.md b/docs/examples/teams/get-installation.md new file mode 100644 index 00000000..8f1a7e44 --- /dev/null +++ b/docs/examples/teams/get-installation.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Teams } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const teams = new Teams(client); + +const result = await teams.getInstallation({ + teamId: '', + installationId: '', +}); + +console.log(result); +``` diff --git a/docs/examples/teams/get-membership.md b/docs/examples/teams/get-membership.md index 41e96e22..b73f234e 100644 --- a/docs/examples/teams/get-membership.md +++ b/docs/examples/teams/get-membership.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Teams } from "react-native-appwrite"; +import { Client, Teams } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -9,7 +9,7 @@ const teams = new Teams(client); const result = await teams.getMembership({ teamId: '', - membershipId: '' + membershipId: '', }); console.log(result); diff --git a/docs/examples/teams/get-prefs.md b/docs/examples/teams/get-prefs.md index 505703d3..78fd30c6 100644 --- a/docs/examples/teams/get-prefs.md +++ b/docs/examples/teams/get-prefs.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Teams } from "react-native-appwrite"; +import { Client, Teams } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -8,7 +8,7 @@ const client = new Client() const teams = new Teams(client); const result = await teams.getPrefs({ - teamId: '' + teamId: '', }); console.log(result); diff --git a/docs/examples/teams/get.md b/docs/examples/teams/get.md index 2b0131e1..fb2fc31f 100644 --- a/docs/examples/teams/get.md +++ b/docs/examples/teams/get.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Teams } from "react-native-appwrite"; +import { Client, Teams } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -8,7 +8,7 @@ const client = new Client() const teams = new Teams(client); const result = await teams.get({ - teamId: '' + teamId: '', }); console.log(result); diff --git a/docs/examples/teams/list-installations.md b/docs/examples/teams/list-installations.md new file mode 100644 index 00000000..48e971eb --- /dev/null +++ b/docs/examples/teams/list-installations.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Teams } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const teams = new Teams(client); + +const result = await teams.listInstallations({ + teamId: '', + queries: [], // optional + total: false, // optional +}); + +console.log(result); +``` diff --git a/docs/examples/teams/list-memberships.md b/docs/examples/teams/list-memberships.md index 6b7fc155..14104a63 100644 --- a/docs/examples/teams/list-memberships.md +++ b/docs/examples/teams/list-memberships.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Teams } from "react-native-appwrite"; +import { Client, Teams } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -11,7 +11,7 @@ const result = await teams.listMemberships({ teamId: '', queries: [], // optional search: '', // optional - total: false // optional + total: false, // optional }); console.log(result); diff --git a/docs/examples/teams/list.md b/docs/examples/teams/list.md index a7fa1ec2..5f3fb9b9 100644 --- a/docs/examples/teams/list.md +++ b/docs/examples/teams/list.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Teams } from "react-native-appwrite"; +import { Client, Teams } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -10,7 +10,7 @@ const teams = new Teams(client); const result = await teams.list({ queries: [], // optional search: '', // optional - total: false // optional + total: false, // optional }); console.log(result); diff --git a/docs/examples/teams/update-installation.md b/docs/examples/teams/update-installation.md new file mode 100644 index 00000000..5d613035 --- /dev/null +++ b/docs/examples/teams/update-installation.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Teams } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const teams = new Teams(client); + +const result = await teams.updateInstallation({ + teamId: '', + installationId: '', + authorizationDetails: '', // optional +}); + +console.log(result); +``` diff --git a/docs/examples/teams/update-membership-status.md b/docs/examples/teams/update-membership-status.md index 83a52c32..23d0479a 100644 --- a/docs/examples/teams/update-membership-status.md +++ b/docs/examples/teams/update-membership-status.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Teams } from "react-native-appwrite"; +import { Client, Teams } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -11,7 +11,7 @@ const result = await teams.updateMembershipStatus({ teamId: '', membershipId: '', userId: '', - secret: '' + secret: '', }); console.log(result); diff --git a/docs/examples/teams/update-membership.md b/docs/examples/teams/update-membership.md index 0f00f5ee..92e59696 100644 --- a/docs/examples/teams/update-membership.md +++ b/docs/examples/teams/update-membership.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Teams } from "react-native-appwrite"; +import { Client, Teams } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -10,7 +10,7 @@ const teams = new Teams(client); const result = await teams.updateMembership({ teamId: '', membershipId: '', - roles: [] + roles: [], }); console.log(result); diff --git a/docs/examples/teams/update-name.md b/docs/examples/teams/update-name.md index d362b2cb..c18ed128 100644 --- a/docs/examples/teams/update-name.md +++ b/docs/examples/teams/update-name.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Teams } from "react-native-appwrite"; +import { Client, Teams } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -9,7 +9,7 @@ const teams = new Teams(client); const result = await teams.updateName({ teamId: '', - name: '' + name: '', }); console.log(result); diff --git a/docs/examples/teams/update-prefs.md b/docs/examples/teams/update-prefs.md index f603ac96..1e068740 100644 --- a/docs/examples/teams/update-prefs.md +++ b/docs/examples/teams/update-prefs.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Teams } from "react-native-appwrite"; +import { Client, Teams } from 'react-native-appwrite'; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint @@ -9,7 +9,7 @@ const teams = new Teams(client); const result = await teams.updatePrefs({ teamId: '', - prefs: {} + prefs: {}, }); console.log(result); diff --git a/docs/examples/vectorsdb/create-document.md b/docs/examples/vectorsdb/create-document.md new file mode 100644 index 00000000..f2aaf472 --- /dev/null +++ b/docs/examples/vectorsdb/create-document.md @@ -0,0 +1,25 @@ +```javascript +import { Client, VectorsDB, Permission, Role } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.createDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: { + embeddings: [0.12, -0.55, 0.88, 1.02], + metadata: { + key: 'value', + }, + }, + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/create-operations.md b/docs/examples/vectorsdb/create-operations.md new file mode 100644 index 00000000..86be153f --- /dev/null +++ b/docs/examples/vectorsdb/create-operations.md @@ -0,0 +1,26 @@ +```javascript +import { Client, VectorsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.createOperations({ + transactionId: '', + operations: [ + { + action: 'create', + databaseId: '', + collectionId: '', + documentId: '', + data: { + name: "Walter O'Brien", + }, + }, + ], // optional +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/create-query.md b/docs/examples/vectorsdb/create-query.md new file mode 100644 index 00000000..af982000 --- /dev/null +++ b/docs/examples/vectorsdb/create-query.md @@ -0,0 +1,20 @@ +```javascript +import { Client, VectorsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.createQuery({ + databaseId: '', + collectionId: '', + queries: [], // optional + transactionId: '', // optional + total: false, // optional + ttl: 0, // optional +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/create-transaction.md b/docs/examples/vectorsdb/create-transaction.md new file mode 100644 index 00000000..8377619f --- /dev/null +++ b/docs/examples/vectorsdb/create-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, VectorsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.createTransaction({ + ttl: 60, // optional +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/delete-document.md b/docs/examples/vectorsdb/delete-document.md new file mode 100644 index 00000000..5046144d --- /dev/null +++ b/docs/examples/vectorsdb/delete-document.md @@ -0,0 +1,18 @@ +```javascript +import { Client, VectorsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.deleteDocument({ + databaseId: '', + collectionId: '', + documentId: '', + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/delete-transaction.md b/docs/examples/vectorsdb/delete-transaction.md new file mode 100644 index 00000000..fc6cc5c5 --- /dev/null +++ b/docs/examples/vectorsdb/delete-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, VectorsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.deleteTransaction({ + transactionId: '', +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/get-document.md b/docs/examples/vectorsdb/get-document.md new file mode 100644 index 00000000..1545ae99 --- /dev/null +++ b/docs/examples/vectorsdb/get-document.md @@ -0,0 +1,19 @@ +```javascript +import { Client, VectorsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.getDocument({ + databaseId: '', + collectionId: '', + documentId: '', + queries: [], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/get-transaction.md b/docs/examples/vectorsdb/get-transaction.md new file mode 100644 index 00000000..b6e81c94 --- /dev/null +++ b/docs/examples/vectorsdb/get-transaction.md @@ -0,0 +1,15 @@ +```javascript +import { Client, VectorsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.getTransaction({ + transactionId: '', +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/list-documents.md b/docs/examples/vectorsdb/list-documents.md new file mode 100644 index 00000000..fa79136a --- /dev/null +++ b/docs/examples/vectorsdb/list-documents.md @@ -0,0 +1,20 @@ +```javascript +import { Client, VectorsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.listDocuments({ + databaseId: '', + collectionId: '', + queries: [], // optional + transactionId: '', // optional + total: false, // optional + ttl: 0, // optional +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/list-transactions.md b/docs/examples/vectorsdb/list-transactions.md new file mode 100644 index 00000000..8a009a98 --- /dev/null +++ b/docs/examples/vectorsdb/list-transactions.md @@ -0,0 +1,15 @@ +```javascript +import { Client, VectorsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.listTransactions({ + queries: [], // optional +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/update-document.md b/docs/examples/vectorsdb/update-document.md new file mode 100644 index 00000000..d2fa8794 --- /dev/null +++ b/docs/examples/vectorsdb/update-document.md @@ -0,0 +1,20 @@ +```javascript +import { Client, VectorsDB, Permission, Role } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.updateDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: {}, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/update-transaction.md b/docs/examples/vectorsdb/update-transaction.md new file mode 100644 index 00000000..d1392088 --- /dev/null +++ b/docs/examples/vectorsdb/update-transaction.md @@ -0,0 +1,17 @@ +```javascript +import { Client, VectorsDB } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.updateTransaction({ + transactionId: '', + commit: false, // optional + rollback: false, // optional +}); + +console.log(result); +``` diff --git a/docs/examples/vectorsdb/upsert-document.md b/docs/examples/vectorsdb/upsert-document.md new file mode 100644 index 00000000..cabe87c0 --- /dev/null +++ b/docs/examples/vectorsdb/upsert-document.md @@ -0,0 +1,20 @@ +```javascript +import { Client, VectorsDB, Permission, Role } from 'react-native-appwrite'; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const vectorsDB = new VectorsDB(client); + +const result = await vectorsDB.upsertDocument({ + databaseId: '', + collectionId: '', + documentId: '', + data: {}, // optional + permissions: [Permission.read(Role.any())], // optional + transactionId: '', // optional +}); + +console.log(result); +``` diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 00000000..b8d79f5d --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,31 @@ +import eslint from '@eslint/js'; +import tseslint from 'typescript-eslint'; + +export default tseslint.config( + eslint.configs.recommended, + tseslint.configs.recommended, + { + ignores: ['dist/', 'types/', 'docs/', 'rollup.config.mjs'], + }, + { + rules: { + // The SDK deliberately exposes loosely-typed surfaces (payloads, + // model generics defaulting to open records), so `any` is part of + // its public contract rather than an oversight. + '@typescript-eslint/no-explicit-any': 'off', + // Empty responses are typed `Promise<{}>` and the models are + // published under the `Models` namespace; both are part of the + // SDK's public API and cannot change without a breaking release. + '@typescript-eslint/no-empty-object-type': 'off', + '@typescript-eslint/no-namespace': 'off', + '@typescript-eslint/no-unused-vars': [ + 'error', + { + argsIgnorePattern: '^_', + caughtErrorsIgnorePattern: '^_', + destructuredArrayIgnorePattern: '^_', + }, + ], + }, + }, +); diff --git a/package-lock.json b/package-lock.json index 29339f34..4a785eb2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,42 +1,47 @@ { "name": "react-native-appwrite", - "version": "0.34.0", + "version": "0.35.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "react-native-appwrite", - "version": "0.34.0", + "version": "0.35.0", "license": "BSD-3-Clause", "dependencies": { "expo-file-system": "18.*.*", - "json-bigint": "1.0.0", - "react-native": ">=0.76.7 <1.0.0" + "json-bigint": "1.0.0" }, "devDependencies": { + "@eslint/js": "10.0.1", "@rollup/plugin-typescript": "12.3.0", "@types/json-bigint": "1.0.4", + "eslint": "10.9.1", "playwright": "1.59.0", - "rollup": "4.62.2", + "prettier": "3.9.6", + "rollup": "4.63.1", "serve-handler": "6.1.7", "tslib": "2.8.1", - "typescript": "5.9.3" + "typescript": "5.9.3", + "typescript-eslint": "8.69.0" }, "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "expo": "*" + "expo": "*", + "react-native": ">=0.76.7 <1.0.0" }, "overrides": { "glob": { ".": "^13.0.0", - "brace-expansion": "^5.0.6" + "brace-expansion": "5.0.9" }, + "brace-expansion": "5.0.9", "rimraf": "^6.0.0", "@xmldom/xmldom": "^0.9.10", "uuid": "^14.0.0", - "postcss": "^8.5.12", + "postcss": "^8.5.18", "ws": "^8.20.1" } }, @@ -45,6 +50,7 @@ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", "license": "MIT", + "peer": true, "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", @@ -59,6 +65,7 @@ "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz", "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==", "license": "MIT", + "peer": true, "engines": { "node": ">=6.9.0" } @@ -68,6 +75,7 @@ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.7.tgz", "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==", "license": "MIT", + "peer": true, "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.7", @@ -98,18 +106,20 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "license": "ISC", + "peer": true, "bin": { "semver": "bin/semver.js" } }, "node_modules/@babel/generator": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.7.tgz", - "integrity": "sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ==", + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.8.tgz", + "integrity": "sha512-gZbepsdh3WDtgZKWL+vTPh71LSBrm/Y4/QDZBVCcYfmeTEEuoOYwlSy+G1StfJg+/Zy550u/3TATbm7qDbbMtg==", "license": "MIT", + "peer": true, "dependencies": { - "@babel/parser": "^7.29.7", - "@babel/types": "^7.29.7", + "@babel/parser": "^7.29.8", + "@babel/types": "^7.29.8", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" @@ -136,6 +146,7 @@ "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.7.tgz", "integrity": "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==", "license": "MIT", + "peer": true, "dependencies": { "@babel/compat-data": "^7.29.7", "@babel/helper-validator-option": "^7.29.7", @@ -152,6 +163,7 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "license": "ISC", + "peer": true, "bin": { "semver": "bin/semver.js" } @@ -238,6 +250,7 @@ "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz", "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==", "license": "MIT", + "peer": true, "engines": { "node": ">=6.9.0" } @@ -261,6 +274,7 @@ "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz", "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==", "license": "MIT", + "peer": true, "dependencies": { "@babel/traverse": "^7.29.7", "@babel/types": "^7.29.7" @@ -274,6 +288,7 @@ "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.7.tgz", "integrity": "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==", "license": "MIT", + "peer": true, "dependencies": { "@babel/helper-module-imports": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7", @@ -364,6 +379,7 @@ "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==", "license": "MIT", + "peer": true, "engines": { "node": ">=6.9.0" } @@ -373,6 +389,7 @@ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", "license": "MIT", + "peer": true, "engines": { "node": ">=6.9.0" } @@ -382,6 +399,7 @@ "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz", "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==", "license": "MIT", + "peer": true, "engines": { "node": ">=6.9.0" } @@ -406,6 +424,7 @@ "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.7.tgz", "integrity": "sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg==", "license": "MIT", + "peer": true, "dependencies": { "@babel/template": "^7.29.7", "@babel/types": "^7.29.7" @@ -415,12 +434,13 @@ } }, "node_modules/@babel/parser": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.7.tgz", - "integrity": "sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg==", + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.8.tgz", + "integrity": "sha512-E8lTAYNB1KW+FH+VGJuZM1ioAx2E6oVlvQFRrf5P8ZZmsiJXYAD9vTFV7yyEURNzgh1dFqMZuO6tUwcARbqFCA==", "license": "MIT", + "peer": true, "dependencies": { - "@babel/types": "^7.29.7" + "@babel/types": "^7.29.8" }, "bin": { "parser": "bin/babel-parser.js" @@ -1088,6 +1108,7 @@ "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.7.tgz", "integrity": "sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==", "license": "MIT", + "peer": true, "engines": { "node": ">=6.9.0" } @@ -1097,6 +1118,7 @@ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz", "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==", "license": "MIT", + "peer": true, "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/parser": "^7.29.7", @@ -1107,17 +1129,18 @@ } }, "node_modules/@babel/traverse": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.7.tgz", - "integrity": "sha512-EhlfNQtZ+NK22w5BM61ciuiq1m58ed33Wr1Xan//ZRTy6hgjnwyCffRYwzsGXdASJSUJ1guZILsErh1eQcl+zw==", + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.8.tgz", + "integrity": "sha512-I5z7H3bf/41ktsNVLtpN0wAa336HkqIHQ5BuPLEhTkt1jVSyZpeNKIzTgEWmlxjdg81R0IgUCcaE+Ok3NvrfZg==", "license": "MIT", + "peer": true, "dependencies": { "@babel/code-frame": "^7.29.7", - "@babel/generator": "^7.29.7", + "@babel/generator": "^7.29.8", "@babel/helper-globals": "^7.29.7", - "@babel/parser": "^7.29.7", + "@babel/parser": "^7.29.8", "@babel/template": "^7.29.7", - "@babel/types": "^7.29.7", + "@babel/types": "^7.29.8", "debug": "^4.3.1" }, "engines": { @@ -1125,10 +1148,11 @@ } }, "node_modules/@babel/types": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.7.tgz", - "integrity": "sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==", + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.8.tgz", + "integrity": "sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg==", "license": "MIT", + "peer": true, "dependencies": { "@babel/helper-string-parser": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7" @@ -1137,38 +1161,166 @@ "node": ">=6.9.0" } }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.10.1.tgz", + "integrity": "sha512-cuadcxVFE8sDK6iWJbs8Sn0av2Nrh2QSGQhVlBW9AaAHqHwjWsZHT8LJ4hFGPh7ASBV2deFdM7H/DPjulmh8rg==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/config-array": { + "version": "0.23.5", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.5.tgz", + "integrity": "sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^3.0.5", + "debug": "^4.3.1", + "minimatch": "^10.2.4" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/config-helpers": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.7.0.tgz", + "integrity": "sha512-DObd/KKUsU+FaFv4PLxSRenpXfQWmPXXP3pPZ6/K1PCrMu2vQpMDMuQe/BqYeoLcz8ro0bVDF1RxOJgfVEdhUw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^1.2.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/core": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-1.2.1.tgz", + "integrity": "sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/js": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-10.0.1.tgz", + "integrity": "sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "eslint": "^10.0.0" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, + "node_modules/@eslint/object-schema": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-3.0.5.tgz", + "integrity": "sha512-vqTaUEgxzm+YDSdElad6PiRoX4t8VGDjCtt05zn4nU810UIx/uNEV7/lZJ6KwFThKZOzOxzXy48da+No7HZaMw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.7.3.tgz", + "integrity": "sha512-IkO+/KEUvwbVpiURZg+P7zF74z5Jxe0UgJxVni+RtoHQ6IZieXaO02kmadomap/q+l6bc/jdPGGqTjhuZnuz1Q==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^1.2.1", + "levn": "^0.4.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, "node_modules/@expo/cli": { - "version": "57.0.6", - "resolved": "https://registry.npmjs.org/@expo/cli/-/cli-57.0.6.tgz", - "integrity": "sha512-14wEb2e8lctlxGARbinUEr+9EmrTR2jIgcaPBBkZXDFMRJmdoY0ic18JuFJPi+7CuQ4XWiGK6obN4VK2PXosLA==", + "version": "57.0.22", + "resolved": "https://registry.npmjs.org/@expo/cli/-/cli-57.0.22.tgz", + "integrity": "sha512-MdToR0ZZ1yjfkqbP1jcA7viS9duMPGq/C+qQ/21dtq+en583Ghp+O11BP/wujHa9ZGRtXimzuKPZDpPresVE0g==", "license": "MIT", "peer": true, "dependencies": { "@expo/code-signing-certificates": "^0.0.6", - "@expo/config": "~57.0.3", - "@expo/config-plugins": "~57.0.3", + "@expo/config": "~57.0.9", + "@expo/config-plugins": "~57.0.9", "@expo/devcert": "^1.2.1", - "@expo/env": "~2.4.1", - "@expo/image-utils": "^0.11.1", - "@expo/inline-modules": "^0.1.2", - "@expo/json-file": "^11.0.0", - "@expo/log-box": "^57.0.0", - "@expo/metro": "~56.0.0", - "@expo/metro-config": "~57.0.3", - "@expo/metro-file-map": "^57.0.0", - "@expo/osascript": "^2.7.0", - "@expo/package-manager": "^1.13.0", - "@expo/plist": "^0.8.0", - "@expo/prebuild-config": "^57.0.5", - "@expo/require-utils": "^57.0.1", - "@expo/router-server": "^57.0.2", - "@expo/schema-utils": "^57.0.1", + "@expo/env": "~2.4.3", + "@expo/image-utils": "^0.11.5", + "@expo/inline-modules": "^0.1.7", + "@expo/json-file": "^11.0.1", + "@expo/log-box": "^57.0.4", + "@expo/metro": "~56.0.2", + "@expo/metro-config": "~57.0.12", + "@expo/metro-file-map": "^57.0.2", + "@expo/osascript": "^2.7.1", + "@expo/package-manager": "^1.13.1", + "@expo/plist": "^0.8.1", + "@expo/prebuild-config": "^57.0.15", + "@expo/require-utils": "^57.0.5", + "@expo/router-server": "^57.0.9", + "@expo/schema-utils": "^57.0.2", "@expo/spawn-async": "^1.8.0", "@expo/ws-tunnel": "^2.0.0", "@expo/xcpretty": "^4.4.4", - "@react-native/dev-middleware": "0.86.0", + "@react-native/dev-middleware": "0.86.3", "accepts": "^1.3.8", - "agent-cli-detector": "^0.1.2", + "agent-cli-detector": "0.1.7", "arg": "^5.0.2", "bplist-creator": "0.1.0", "bplist-parser": "^0.3.1", @@ -1178,12 +1330,12 @@ "connect": "^3.7.0", "debug": "^4.3.4", "dnssd-advertise": "^1.1.4", - "expo-server": "^57.0.0", + "expo-server": "^57.0.3", "fetch-nodeshim": "^0.4.10", "getenv": "^2.0.0", "glob": "^13.0.0", "lan-network": "^0.2.1", - "multitars": "^1.0.0", + "multitars": "^1.0.2", "node-forge": "^1.3.3", "npm-package-arg": "^11.0.0", "ora": "^3.4.0", @@ -1192,6 +1344,7 @@ "progress": "^2.0.3", "prompts": "^2.3.2", "resolve-from": "^5.0.0", + "sandbox-cli-detector": "^0.2.0", "semver": "^7.6.0", "send": "^0.19.0", "slugify": "^1.3.4", @@ -1231,16 +1384,16 @@ } }, "node_modules/@expo/config": { - "version": "57.0.3", - "resolved": "https://registry.npmjs.org/@expo/config/-/config-57.0.3.tgz", - "integrity": "sha512-IshqjjpGtT7wj86pxgsfMD1/abNMfu1wZ07ubyYO29l+PWa0eAh2TcpyLcyBaqo01IonF6646xWwrCPcdlUl3Q==", + "version": "57.0.9", + "resolved": "https://registry.npmjs.org/@expo/config/-/config-57.0.9.tgz", + "integrity": "sha512-dmzlKraIFxa7wLwV6K7WzI8jp6QZpW6Mc5mGjLimJUFjzh4uQdYaT3m3plEutM5yxBoBEwqzks7l+I/ljCbxAQ==", "license": "MIT", "peer": true, "dependencies": { - "@expo/config-plugins": "~57.0.3", - "@expo/config-types": "^57.0.1", - "@expo/json-file": "^11.0.0", - "@expo/require-utils": "^57.0.1", + "@expo/config-plugins": "~57.0.9", + "@expo/config-types": "^57.0.2", + "@expo/json-file": "^11.0.1", + "@expo/require-utils": "^57.0.5", "deepmerge": "^4.3.1", "getenv": "^2.0.0", "glob": "^13.0.0", @@ -1250,16 +1403,16 @@ } }, "node_modules/@expo/config-plugins": { - "version": "57.0.3", - "resolved": "https://registry.npmjs.org/@expo/config-plugins/-/config-plugins-57.0.3.tgz", - "integrity": "sha512-J3P2T7FoOE9P3TuLcJXwt8jISKRxo7UntTzbJ/Qc5F7QXenNntk/4t1XndVkLucYjpnHArPd9xzDXuxxKEHVbQ==", + "version": "57.0.9", + "resolved": "https://registry.npmjs.org/@expo/config-plugins/-/config-plugins-57.0.9.tgz", + "integrity": "sha512-hHgfL1avkCdEvDSw7IwlKwRYYNgcxzbNNMIk6W6lTkJpY0MajinAfeJUS0J+wPCsjUfGbVqOJM+XhPaO5ulUxg==", "license": "MIT", "peer": true, "dependencies": { - "@expo/config-types": "^57.0.1", - "@expo/json-file": "~11.0.0", - "@expo/plist": "^0.8.0", - "@expo/require-utils": "^57.0.1", + "@expo/config-types": "^57.0.2", + "@expo/json-file": "~11.0.1", + "@expo/plist": "^0.8.1", + "@expo/require-utils": "^57.0.5", "@expo/sdk-runtime-versions": "^1.0.0", "chalk": "^4.1.2", "debug": "^4.3.5", @@ -1272,9 +1425,9 @@ } }, "node_modules/@expo/config-types": { - "version": "57.0.1", - "resolved": "https://registry.npmjs.org/@expo/config-types/-/config-types-57.0.1.tgz", - "integrity": "sha512-fo7d/Ym28uwGzdTV2leEvpsb9t+7i8YHjy471m31+cmDt4BRd/l7e94JHyrXAq4SWOBVus16S0JLqm89SRCCdw==", + "version": "57.0.2", + "resolved": "https://registry.npmjs.org/@expo/config-types/-/config-types-57.0.2.tgz", + "integrity": "sha512-ewW08OonrcRIsRKIlFvvcmmafE5zemb1ocu3HkNwtVPyRtj2w42pZCAkMIROYpcVBaPnc3mDT9UZDzwXWC3i6g==", "license": "MIT", "peer": true }, @@ -1300,9 +1453,9 @@ } }, "node_modules/@expo/devtools": { - "version": "57.0.0", - "resolved": "https://registry.npmjs.org/@expo/devtools/-/devtools-57.0.0.tgz", - "integrity": "sha512-i8ITQmf/wB0JNQ2gASFOKvqo1zRWCl/VfPlFRXdz6UkHen4s31NmMy0zmumS+pMpwn0+gA6oU4FF4zRDRG488Q==", + "version": "57.0.1", + "resolved": "https://registry.npmjs.org/@expo/devtools/-/devtools-57.0.1.tgz", + "integrity": "sha512-GyUf+wFNkbttaX0jR7MZa9bm77U0IrLg6d2AjpxdyoXw/w4abHoXG0oFufwLMgP9zLTd5+Ct4X/ffNUTnlzZgg==", "license": "MIT", "peer": true, "dependencies": { @@ -1322,9 +1475,9 @@ } }, "node_modules/@expo/dom-webview": { - "version": "57.0.0", - "resolved": "https://registry.npmjs.org/@expo/dom-webview/-/dom-webview-57.0.0.tgz", - "integrity": "sha512-zBZw52KnaHf9zGVp1eJk8kNfc+5ArGf+KvTL3SeMsr03K6tPJtLbgycVLjrAiLMfhzqGVjPD2G+rbNwpbLUxcg==", + "version": "57.0.1", + "resolved": "https://registry.npmjs.org/@expo/dom-webview/-/dom-webview-57.0.1.tgz", + "integrity": "sha512-lAKsME4SAq+8sf56oN0DX5TBYyruupoRxbWbD2xf9RnKY8y6x8eb9LCE5pxSN0qyWdqnp+0wmyWzDkKboThKAw==", "license": "MIT", "peer": true, "peerDependencies": { @@ -1334,9 +1487,9 @@ } }, "node_modules/@expo/env": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@expo/env/-/env-2.4.1.tgz", - "integrity": "sha512-3c9Mg9x0HmGPEsVrGAGyEDJsNUOZ55cZvZ47/HLmXh7MHV9Zv7My73wThklKrObaBBoMfE4YqpKjYKDRzojpjQ==", + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/@expo/env/-/env-2.4.3.tgz", + "integrity": "sha512-M1NXeZCA1mkMkYOyIe7PlyRX0/jqFtMoJgyblnlq/vpCRfmueFT7RnGSQG8uEFDF5WHOFGijAQ3fogPh3/n5Ng==", "license": "MIT", "peer": true, "dependencies": { @@ -1349,20 +1502,20 @@ } }, "node_modules/@expo/expo-modules-macros-plugin": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@expo/expo-modules-macros-plugin/-/expo-modules-macros-plugin-0.3.0.tgz", - "integrity": "sha512-2tRq8kiIZTVZcI5uggh86HefQ7s++Zk5WkFFomNp4aUqyN5ownHHvj1jPEP9jWXaXjPDmWuf5SUZTGD5G6AKkg==", + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/@expo/expo-modules-macros-plugin/-/expo-modules-macros-plugin-0.6.1.tgz", + "integrity": "sha512-cpsLZE4rqkc1Y3eZTkxB98jrqY1YXgetmtxFt8q89jBRmk3quRuk1BZo+VcnCSObZardjg99r1k5xijEMONFGA==", "license": "MIT", "peer": true }, "node_modules/@expo/fingerprint": { - "version": "0.20.3", - "resolved": "https://registry.npmjs.org/@expo/fingerprint/-/fingerprint-0.20.3.tgz", - "integrity": "sha512-WDV2hS87C61TsX55w4A0cPnbnN8bqdVHp2MpZsJTvB4Tv4TITgSxWYhRj/xv0pwcZvKHn05MBg6AfHPNj9o5Sw==", + "version": "0.20.12", + "resolved": "https://registry.npmjs.org/@expo/fingerprint/-/fingerprint-0.20.12.tgz", + "integrity": "sha512-FIR5fkZYeFaLSowmjgyB6RPKl8AXeE8HuCBHHvyxK8UhOjpPfCAmzT4E7v2yub4qqDafKnfcOFCYxvpUEu+01w==", "license": "MIT", "peer": true, "dependencies": { - "@expo/env": "^2.4.1", + "@expo/env": "^2.4.3", "@expo/spawn-async": "^1.8.0", "arg": "^5.0.2", "chalk": "^4.1.2", @@ -1379,13 +1532,13 @@ } }, "node_modules/@expo/image-utils": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/@expo/image-utils/-/image-utils-0.11.1.tgz", - "integrity": "sha512-0JueH4vdgAZQmhlSYFvTQzt4b4NO5cnByDuApw7bMUIjhwLRnT46Ki3ritMrzJMQaO2lLK2flInZbsZbOuy8nw==", + "version": "0.11.5", + "resolved": "https://registry.npmjs.org/@expo/image-utils/-/image-utils-0.11.5.tgz", + "integrity": "sha512-KPQBTpmpAfy/Vu9y4wPW808/qtZxjYmyJg8cm2QCPAupp+qEWA3b5zmk0ulOwQ9OgeHxuCPgUqWgkwHFo7UsrQ==", "license": "MIT", "peer": true, "dependencies": { - "@expo/require-utils": "^57.0.1", + "@expo/require-utils": "^57.0.5", "@expo/spawn-async": "^1.8.0", "chalk": "^4.0.0", "getenv": "^2.0.0", @@ -1395,19 +1548,19 @@ } }, "node_modules/@expo/inline-modules": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/@expo/inline-modules/-/inline-modules-0.1.2.tgz", - "integrity": "sha512-wc5wH4ND647Ne/6A/ESuelcqOQUEvK8MYjjvbp5wcl59dECk7juh0cFOJjAWkpc4pLTcvqXBSRcUDpGWm5XNWg==", + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/@expo/inline-modules/-/inline-modules-0.1.7.tgz", + "integrity": "sha512-Bz/khd1gIJqDkje7t5ejD5e9jFbm4xEJzWSwRKadRo6gruepbw1xJ3Eb+e58OS8fY1ZNQYjzZbspnuph67sN0g==", "license": "MIT", "peer": true, "dependencies": { - "@expo/config-plugins": "~57.0.3" + "@expo/config-plugins": "~57.0.9" } }, "node_modules/@expo/json-file": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/@expo/json-file/-/json-file-11.0.0.tgz", - "integrity": "sha512-pHJCETqFL5x5BzNV6cEPwjwuECgGmnl0bNmfHIJ6LM1tlh2eVXi5HEdit3zby/JO/B8Otk5cgcqtJXgvvUat3A==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/@expo/json-file/-/json-file-11.0.1.tgz", + "integrity": "sha512-zxHWj4MKKMAL29ZQSY/Fssx4Thluk40JmuGNaeS078wy/NhlFhnVi+rHHunulE3xJAJ0CM73m8VK2+GkF9eRwQ==", "license": "MIT", "peer": true, "dependencies": { @@ -1416,72 +1569,72 @@ } }, "node_modules/@expo/local-build-cache-provider": { - "version": "57.0.2", - "resolved": "https://registry.npmjs.org/@expo/local-build-cache-provider/-/local-build-cache-provider-57.0.2.tgz", - "integrity": "sha512-/8/FoYrEBJZPG4wR8kO6REI4VRCPAStD+7wS/Ds6XXddxhmyMP3pvUJz/c3icyAoqpbqeZZkR6E1ptT5Gi5iXg==", + "version": "57.0.8", + "resolved": "https://registry.npmjs.org/@expo/local-build-cache-provider/-/local-build-cache-provider-57.0.8.tgz", + "integrity": "sha512-SEdE0pAQrr90bRh3MNR0ZuwoIBw390cYdFgbn7Vk0Mtm9EHaBfP7kYj+2hXnXZJgOEm3/JMtfoD3rV7rWA9FGg==", "license": "MIT", "peer": true, "dependencies": { - "@expo/config": "~57.0.2", + "@expo/config": "~57.0.9", "chalk": "^4.1.2" } }, "node_modules/@expo/log-box": { - "version": "57.0.0", - "resolved": "https://registry.npmjs.org/@expo/log-box/-/log-box-57.0.0.tgz", - "integrity": "sha512-tt9x76IEE8hp2FWTLPfEArrTyD7GCoUe3TpohESy+SPZ/OqkUnSXz40xnUuE0XbE132z8c5CRCfXQLM9DTEknQ==", + "version": "57.0.4", + "resolved": "https://registry.npmjs.org/@expo/log-box/-/log-box-57.0.4.tgz", + "integrity": "sha512-IxwS9s1L2muj8mj8AQSuiy7u8OFJdc02NRFo2me/Tj6DiaeG5SREqmpBE4rQpR2cadqSg5jl8Qab8Cjie616dg==", "license": "MIT", "peer": true, "dependencies": { - "@expo/dom-webview": "^57.0.0", + "@expo/dom-webview": "^57.0.1", "anser": "^1.4.9", "stacktrace-parser": "^0.1.10" }, "peerDependencies": { - "@expo/dom-webview": "^57.0.0", + "@expo/dom-webview": "^57.0.1", "expo": "*", "react": "*", "react-native": "*" } }, "node_modules/@expo/metro": { - "version": "56.0.0", - "resolved": "https://registry.npmjs.org/@expo/metro/-/metro-56.0.0.tgz", - "integrity": "sha512-5gIgQHtEpjjvsjKfVtIv23a98LLRV0/y07PDShEwYSytAMlE3FSF8RHXqtHc1sUJL6dn7hnuIBpIbrLXXuVi0A==", + "version": "56.0.2", + "resolved": "https://registry.npmjs.org/@expo/metro/-/metro-56.0.2.tgz", + "integrity": "sha512-Ld5AeYMCCDa8bLeWhfuLbZFFjlV3f6ORqyPz2glGh6RltIngMuLf9BTC2yvHFjkKuGxL5SynijmA8xmNNWn5iA==", "license": "MIT", "peer": true, "dependencies": { - "metro": "0.84.4", - "metro-babel-transformer": "0.84.4", - "metro-cache": "0.84.4", - "metro-cache-key": "0.84.4", - "metro-config": "0.84.4", - "metro-core": "0.84.4", - "metro-file-map": "0.84.4", - "metro-minify-terser": "0.84.4", - "metro-resolver": "0.84.4", - "metro-runtime": "0.84.4", - "metro-source-map": "0.84.4", - "metro-symbolicate": "0.84.4", - "metro-transform-plugins": "0.84.4", - "metro-transform-worker": "0.84.4" + "metro": "0.84.5", + "metro-babel-transformer": "0.84.5", + "metro-cache": "0.84.5", + "metro-cache-key": "0.84.5", + "metro-config": "0.84.5", + "metro-core": "0.84.5", + "metro-file-map": "0.84.5", + "metro-minify-terser": "0.84.5", + "metro-resolver": "0.84.5", + "metro-runtime": "0.84.5", + "metro-source-map": "0.84.5", + "metro-symbolicate": "0.84.5", + "metro-transform-plugins": "0.84.5", + "metro-transform-worker": "0.84.5" } }, "node_modules/@expo/metro-config": { - "version": "57.0.3", - "resolved": "https://registry.npmjs.org/@expo/metro-config/-/metro-config-57.0.3.tgz", - "integrity": "sha512-k7qcjTe1xDrUW15Ue86WAsJSL0ubiSluBXVNRFoe9snAWhMzBGzdZfl9XiDf4TNUV43T0L1ch+n4GmDqamvfEg==", + "version": "57.0.12", + "resolved": "https://registry.npmjs.org/@expo/metro-config/-/metro-config-57.0.12.tgz", + "integrity": "sha512-S62Lrq35HZqBFD55423pmWb8PjaiR/W02zQC1uECBmw1vTN8WZaFz4TJ0i21EeJzwfebMb9MLxL8JZ102Z6VbA==", "license": "MIT", "peer": true, "dependencies": { "@babel/code-frame": "^7.20.0", "@babel/core": "^7.20.0", "@babel/generator": "^7.20.5", - "@expo/config": "~57.0.2", - "@expo/env": "~2.4.1", - "@expo/json-file": "~11.0.0", - "@expo/metro": "~56.0.0", - "@expo/require-utils": "^57.0.1", + "@expo/config": "~57.0.9", + "@expo/env": "~2.4.3", + "@expo/json-file": "~11.0.1", + "@expo/metro": "~56.0.2", + "@expo/require-utils": "^57.0.5", "@expo/spawn-async": "^1.8.0", "@jridgewell/gen-mapping": "^0.3.13", "@jridgewell/remapping": "^2.3.5", @@ -1508,9 +1661,9 @@ } }, "node_modules/@expo/metro-file-map": { - "version": "57.0.0", - "resolved": "https://registry.npmjs.org/@expo/metro-file-map/-/metro-file-map-57.0.0.tgz", - "integrity": "sha512-/sxwKQmwpYFYjFT6VYFpgldTwSv53OCx4/UCpLCv9iqQLVQ30hFEJsxGA9Jif8n9pacigK4P5/0ZJ2zMHm6arA==", + "version": "57.0.2", + "resolved": "https://registry.npmjs.org/@expo/metro-file-map/-/metro-file-map-57.0.2.tgz", + "integrity": "sha512-tb50nSIWwKpRufSkGuivOK0FbUxv1Uwqptb0SzFTk0bkmYmcy3gIwnCbOHTfmrQDVndRhPEiu2SYgh9Z0PCvGg==", "license": "MIT", "peer": true, "dependencies": { @@ -1523,9 +1676,9 @@ } }, "node_modules/@expo/osascript": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/@expo/osascript/-/osascript-2.7.0.tgz", - "integrity": "sha512-wKIXL8UtbuX4KwavPasIW3CUcgTbYfjzLcgUhjyKUAYDEqMaf6gmU1bqz3ffBPTokmX+G8/vFG1ZuI9etQWukA==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/@expo/osascript/-/osascript-2.7.1.tgz", + "integrity": "sha512-Zn03EX6In7ts2lPUW2ESUSkEhEWQN1qqsiXjadtZMJOuZRkMiAg1ZQHuvz9DjByDWNJ2pBwAGyrts9lj9k389g==", "license": "MIT", "peer": true, "dependencies": { @@ -1536,13 +1689,13 @@ } }, "node_modules/@expo/package-manager": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@expo/package-manager/-/package-manager-1.13.0.tgz", - "integrity": "sha512-s3W3eZafJDEyVL7W/jxj2Nz3eONKxSCU604S5xj8ijrVaRz83x0DnZznLf/UXQEI1w+FyibH68nHeQyk767b1A==", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/@expo/package-manager/-/package-manager-1.13.1.tgz", + "integrity": "sha512-y/K+CaYYpZpNGZhSX4HyLT/vyIunFjNfyoxNysPBCefeLKI/VCx6f9LNPzrxayr3rCYO5bl9O8H+HRQK265Nkg==", "license": "MIT", "peer": true, "dependencies": { - "@expo/json-file": "^11.0.0", + "@expo/json-file": "^11.0.1", "@expo/spawn-async": "^1.8.0", "chalk": "^4.0.0", "npm-package-arg": "^11.0.0", @@ -1551,9 +1704,9 @@ } }, "node_modules/@expo/plist": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/@expo/plist/-/plist-0.8.0.tgz", - "integrity": "sha512-24JlUJI4PwHN4PLydlzFEzCdiqybfaV5t04QBkOg8em3AjvHKbMgBGlKreiuOoc0rNa3DZ21ZqL+xLGMBLQNKQ==", + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@expo/plist/-/plist-0.8.1.tgz", + "integrity": "sha512-3gTReGIUm0oRaMClsAJYxBnVPCl6fVpsl8HS+DTVxDhW4GyVyxg9E/Znm3BvcHtUJ51RJJI14pC1wvrNilCRHw==", "license": "MIT", "peer": true, "dependencies": { @@ -1563,28 +1716,28 @@ } }, "node_modules/@expo/prebuild-config": { - "version": "57.0.5", - "resolved": "https://registry.npmjs.org/@expo/prebuild-config/-/prebuild-config-57.0.5.tgz", - "integrity": "sha512-KnKx6Iu4jppbNVtt9yTrN10OVoPZlOYYyLZuarY70u6fgUO9lYKDa06Hxv+PmIwcnygfj2CSBBl5ewBqS2bxtw==", + "version": "57.0.15", + "resolved": "https://registry.npmjs.org/@expo/prebuild-config/-/prebuild-config-57.0.15.tgz", + "integrity": "sha512-xTbWHroj0PDmlbqvmU+zF9ZZxveJkiuyiPoeRJYRGruFHebRAWnoTdw5S7d/UCzDBI8ropGGu9g2eb2nMxtvAw==", "license": "MIT", "peer": true, "dependencies": { - "@expo/config": "~57.0.2", - "@expo/config-plugins": "~57.0.3", - "@expo/config-types": "^57.0.1", - "@expo/image-utils": "^0.11.1", - "@expo/json-file": "^11.0.0", - "@react-native/normalize-colors": "0.86.0", + "@expo/config": "~57.0.9", + "@expo/config-plugins": "~57.0.9", + "@expo/config-types": "^57.0.2", + "@expo/image-utils": "^0.11.5", + "@expo/json-file": "^11.0.1", + "@react-native/normalize-colors": "0.86.3", "debug": "^4.3.1", - "expo-modules-autolinking": "~57.0.5", + "expo-modules-autolinking": "~57.0.12", "resolve-from": "^5.0.0", "semver": "^7.6.0" } }, "node_modules/@expo/require-utils": { - "version": "57.0.1", - "resolved": "https://registry.npmjs.org/@expo/require-utils/-/require-utils-57.0.1.tgz", - "integrity": "sha512-uXen5/4x7j60I5slShgZr5QEtJDBK8homFiNLDnDrNrxZhrRHXASo0H6JArs3/1PDzw1wahzhGWg2WKuYyZd0A==", + "version": "57.0.5", + "resolved": "https://registry.npmjs.org/@expo/require-utils/-/require-utils-57.0.5.tgz", + "integrity": "sha512-kTAXj9lDFEIPMsbAOGCGbjBbMF0oi7CqkYM79KOX0DDD9wSwXmlKL1z2h8OwsrBf7mbOo2DjlRvZu4BEjrIxGw==", "license": "MIT", "peer": true, "dependencies": { @@ -1593,7 +1746,7 @@ "@babel/plugin-transform-modules-commonjs": "^7.24.8" }, "peerDependencies": { - "typescript": "^5.0.0 || ^5.0.0-0 || ^6.0.0" + "typescript": "^5.0.0 || ^5.0.0-0 || ^6.0.0 || ^7.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -1602,21 +1755,21 @@ } }, "node_modules/@expo/router-server": { - "version": "57.0.2", - "resolved": "https://registry.npmjs.org/@expo/router-server/-/router-server-57.0.2.tgz", - "integrity": "sha512-hu9qhnq2PKuwMXIoRMAa2+HUeqSut9HwiQf3a62tfGTIxPN3rKUZ10TozEEB+Pd/7WIa238sXMS5v1YhTuC9gA==", + "version": "57.0.9", + "resolved": "https://registry.npmjs.org/@expo/router-server/-/router-server-57.0.9.tgz", + "integrity": "sha512-/PxRQozFesIyCJZOAtrQE8XcmcojNiL5ctPMQnbE4ojC2EJPu0zc7c0Y4PuXsoRxrZxm8Usw76/lCVrXcfTZ2w==", "license": "MIT", "peer": true, "dependencies": { "debug": "^4.3.4" }, "peerDependencies": { - "@expo/metro-runtime": "^57.0.3", + "@expo/metro-runtime": "^57.0.15", "expo": "*", - "expo-constants": "^57.0.3", - "expo-font": "^57.0.0", + "expo-constants": "^57.0.17", + "expo-font": "^57.0.3", "expo-router": "*", - "expo-server": "^57.0.0", + "expo-server": "^57.0.3", "react": "*", "react-dom": "*", "react-server-dom-webpack": "~19.0.1 || ~19.1.2 || ~19.2.1" @@ -1637,9 +1790,9 @@ } }, "node_modules/@expo/schema-utils": { - "version": "57.0.1", - "resolved": "https://registry.npmjs.org/@expo/schema-utils/-/schema-utils-57.0.1.tgz", - "integrity": "sha512-IVdaqtP3+iHFRE/y22mKijQtZanLcB18q1zi2kfN6RINTCryyzM7qHGsWHc5LBJbOuj1G4avCOECs97hOJm0GQ==", + "version": "57.0.2", + "resolved": "https://registry.npmjs.org/@expo/schema-utils/-/schema-utils-57.0.2.tgz", + "integrity": "sha512-fMu/jyN0l1Wzv7XkeWR4IYCx1M8ryui3FdBNGrWwbRgJ7EhxXxK8E2jxP2W3pbgUwUY0V3hG8+GyfCZwny+Lxw==", "license": "MIT", "peer": true }, @@ -1695,11 +1848,78 @@ "excpretty": "build/cli.js" } }, + "node_modules/@humanfs/core": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.2.tgz", + "integrity": "sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/types": "^0.15.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.8", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.8.tgz", + "integrity": "sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/core": "^0.19.2", + "@humanfs/types": "^0.15.0", + "@humanwhocodes/retry": "^0.4.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/types": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/@humanfs/types/-/types-0.15.0.tgz", + "integrity": "sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, "node_modules/@isaacs/ttlcache": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/@isaacs/ttlcache/-/ttlcache-1.4.1.tgz", "integrity": "sha512-RQgQ4uQ+pLbqXfOmieB91ejmLwvSgv9nLx6sT6sD83s7umBypgg+OIBOBbEUiJXrfpnp9j0mRhYYdzp9uqq3lA==", "license": "ISC", + "peer": true, "engines": { "node": ">=12" } @@ -1709,6 +1929,7 @@ "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", "license": "MIT", + "peer": true, "dependencies": { "@sinclair/typebox": "^0.27.8" }, @@ -1721,6 +1942,7 @@ "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", "license": "MIT", + "peer": true, "dependencies": { "@jest/schemas": "^29.6.3", "@types/istanbul-lib-coverage": "^2.0.0", @@ -1738,6 +1960,7 @@ "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", "license": "MIT", + "peer": true, "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0", "@jridgewell/trace-mapping": "^0.3.24" @@ -1748,6 +1971,7 @@ "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", "license": "MIT", + "peer": true, "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" @@ -1758,6 +1982,7 @@ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "license": "MIT", + "peer": true, "engines": { "node": ">=6.0.0" } @@ -1767,55 +1992,80 @@ "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.11.tgz", "integrity": "sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==", "license": "MIT", + "peer": true, "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25" } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", - "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", - "license": "MIT" + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "license": "MIT", + "peer": true }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.31", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", "license": "MIT", + "peer": true, "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/@react-native/assets-registry": { - "version": "0.86.0", - "resolved": "https://registry.npmjs.org/@react-native/assets-registry/-/assets-registry-0.86.0.tgz", - "integrity": "sha512-nIaXbm2jX1OTYp0qbviJ3O6KZivoE8z3BnhUQ2LsqfZSWRoOK/n1qsiAr6oALiNKWnXY3j2KPwtYORnZzp8xew==", + "node_modules/@napi-rs/lzma-linux-x64-gnu": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@napi-rs/lzma-linux-x64-gnu/-/lzma-linux-x64-gnu-1.5.1.tgz", + "integrity": "sha512-oTXEIha4SsuXdTA4Iyskj0kpdx2yVXdhd75c2v3xGrHFfVMsbhTPZU/nMPL4sWKo4pBHm3aucLaqGlF696dTyQ==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0" + "node": "^22.20 || ^24.12 || >=25" + } + }, + "node_modules/@react-native/asset-utils": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/@react-native/asset-utils/-/asset-utils-0.87.1.tgz", + "integrity": "sha512-FeFnbn9ENPs7IVBzZt1bBWfiRGvT4q+CsWwXGFyKVW/1ol3ylBRuTtXBGHIAmcNN4fUR60nSXsCN19pzNHkPgA==", + "license": "MIT", + "peer": true, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" } }, "node_modules/@react-native/babel-plugin-codegen": { - "version": "0.86.0", - "resolved": "https://registry.npmjs.org/@react-native/babel-plugin-codegen/-/babel-plugin-codegen-0.86.0.tgz", - "integrity": "sha512-qdsABWNW7uTll90l4Vh03gjeyu3WVDi2CyiiyvYGMRDcoYbjbQi6df3BMAm9lQI2yslZ1T14LlDDAsgTwNxplA==", + "version": "0.86.3", + "resolved": "https://registry.npmjs.org/@react-native/babel-plugin-codegen/-/babel-plugin-codegen-0.86.3.tgz", + "integrity": "sha512-O6Xza4JBGPIU8J7YbKTyBoYL4thpy8jMW/oaLDWdAyOwYHKIjK47pAL5HUEbOe2bWz2PEKjbYRF2ApkJv1ottQ==", "license": "MIT", "peer": true, "dependencies": { "@babel/traverse": "^7.29.0", - "@react-native/codegen": "0.86.0" + "@react-native/codegen": "0.86.3" }, "engines": { "node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0" } }, "node_modules/@react-native/codegen": { - "version": "0.86.0", - "resolved": "https://registry.npmjs.org/@react-native/codegen/-/codegen-0.86.0.tgz", - "integrity": "sha512-uTs9DBo3+/lUqinsGZK0FKJRBVClrwMXoZToaDxE1Q2SL2e55vs2GwyZfIKzPl5uJnbu4PfFMIp0/mLXLWUMuA==", + "version": "0.86.3", + "resolved": "https://registry.npmjs.org/@react-native/codegen/-/codegen-0.86.3.tgz", + "integrity": "sha512-Ux4jHi0fh+bdtVEcL0gaPLbY56V+SvFUDl/8sRAE1jdb4k+o7fT/4Nc29yz4X+qfjstkSqObQTMBGhdzxH9JvA==", "license": "MIT", + "peer": true, "dependencies": { "@babel/core": "^7.25.2", "@babel/parser": "^7.29.0", @@ -1836,37 +2086,39 @@ "version": "0.36.0", "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.36.0.tgz", "integrity": "sha512-A1+8zn5oss2CFP7pKsOaxorQG6FNIz1WU1VDqruLPPZl3LVgeE2C5xfFg8Ow6/Ow4mSslLLtYP1J3n38eKyW9w==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@react-native/codegen/node_modules/hermes-parser": { "version": "0.36.0", "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.36.0.tgz", "integrity": "sha512-GdpwMmH5x6IpC1cijvcvYnlPB60Mh6kTSF/NFdYV/j56gYdi+0RIakYs+eqOV+bbO0SW7mgVVGSsTJxyPQfo3w==", "license": "MIT", + "peer": true, "dependencies": { "hermes-estree": "0.36.0" } }, "node_modules/@react-native/community-cli-plugin": { - "version": "0.86.0", - "resolved": "https://registry.npmjs.org/@react-native/community-cli-plugin/-/community-cli-plugin-0.86.0.tgz", - "integrity": "sha512-Jv8p1ebEPfTzs8gmrjsdT2XMXFfeAg45Pman+XPLFGaSeGAZkutRFRyX9Cs9aGTSOyIA9YPJ6vDNb1ayTf1FKQ==", + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/@react-native/community-cli-plugin/-/community-cli-plugin-0.87.1.tgz", + "integrity": "sha512-aGBae6v+ngy8fIpU1EOaVxn/8DOgmJNphEdn5Eb0wTchUCxr8bDjpTJYNdrptyn3qI/elk8r9agQ2OBaFvrRlw==", "license": "MIT", + "peer": true, "dependencies": { - "@react-native/dev-middleware": "0.86.0", + "@react-native/asset-utils": "0.87.1", + "@react-native/dev-middleware": "0.87.1", "debug": "^4.4.0", "invariant": "^2.2.4", - "metro": "^0.84.3", - "metro-config": "^0.84.3", - "metro-core": "^0.84.3", + "metro": "^0.87.0", "semver": "^7.1.3" }, "engines": { - "node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0" + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" }, "peerDependencies": { "@react-native-community/cli": "*", - "@react-native/metro-config": "0.86.0" + "@react-native/metro-config": "0.87.1" }, "peerDependenciesMeta": { "@react-native-community/cli": { @@ -1877,38 +2129,41 @@ } } }, - "node_modules/@react-native/debugger-frontend": { - "version": "0.86.0", - "resolved": "https://registry.npmjs.org/@react-native/debugger-frontend/-/debugger-frontend-0.86.0.tgz", - "integrity": "sha512-7Mb3nDfyJeys+ELF75Ageu7VKERlnIMoO+aNPoXqTXvz+b41L6l2CqMyLpDHxkBSlenij6gEepPNgaIyWHbJZw==", + "node_modules/@react-native/community-cli-plugin/node_modules/@react-native/debugger-frontend": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/@react-native/debugger-frontend/-/debugger-frontend-0.87.1.tgz", + "integrity": "sha512-RNm7soJB+8YSauLnsCCylA1eVfT6JWaDTPUEF01uu9YwDyZ7remKlZbXtmVbtscbNGcp+hbI4iZUdVOpQWsHuA==", "license": "BSD-3-Clause", + "peer": true, "engines": { - "node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0" + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" } }, - "node_modules/@react-native/debugger-shell": { - "version": "0.86.0", - "resolved": "https://registry.npmjs.org/@react-native/debugger-shell/-/debugger-shell-0.86.0.tgz", - "integrity": "sha512-Y0zEkZzLz8ou6o/VLml1A31X/rMgc6DRjwxwzPMa94qRTMY070WeBCNTITQo4kKTBAUgbxh07oXPQqp0Tpja8w==", + "node_modules/@react-native/community-cli-plugin/node_modules/@react-native/debugger-shell": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/@react-native/debugger-shell/-/debugger-shell-0.87.1.tgz", + "integrity": "sha512-eNbKjcnseJIjy5XCDwyhKOT1ngOg3Dv1fVxTDtnVFqdqjqsbfY4v9JuJG1RZJ7+mFoRRe05HE8GSQU8B7n5xwQ==", "license": "MIT", + "peer": true, "dependencies": { "cross-spawn": "^7.0.6", "debug": "^4.4.0", "fb-dotslash": "0.5.8" }, "engines": { - "node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0" + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" } }, - "node_modules/@react-native/dev-middleware": { - "version": "0.86.0", - "resolved": "https://registry.npmjs.org/@react-native/dev-middleware/-/dev-middleware-0.86.0.tgz", - "integrity": "sha512-20pTO6yTybmvXvro520H6C7jydIQnLKOl5qFtVEcHSdFrY63r3OGei+Rx9bILgSRmH6jgnfEcijcMx7pwWuQtw==", + "node_modules/@react-native/community-cli-plugin/node_modules/@react-native/dev-middleware": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/@react-native/dev-middleware/-/dev-middleware-0.87.1.tgz", + "integrity": "sha512-KgvAGUaVl6/XrWFAPK8e0ojDRbsdBjr4bnwyn6PC3CwxPQc5iv+i7hMoUwYS8ORSkHKfjt+cV86/mBQ4lG8yfA==", "license": "MIT", + "peer": true, "dependencies": { "@isaacs/ttlcache": "^1.4.1", - "@react-native/debugger-frontend": "0.86.0", - "@react-native/debugger-shell": "0.86.0", + "@react-native/debugger-frontend": "0.87.1", + "@react-native/debugger-shell": "0.87.1", "chrome-launcher": "^0.15.2", "chromium-edge-launcher": "^0.3.0", "connect": "^3.6.5", @@ -1920,49 +2175,441 @@ "ws": "^7.5.10" }, "engines": { - "node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0" + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" } }, - "node_modules/@react-native/gradle-plugin": { - "version": "0.86.0", - "resolved": "https://registry.npmjs.org/@react-native/gradle-plugin/-/gradle-plugin-0.86.0.tgz", - "integrity": "sha512-a1RcfaEDqWExCGfCwadIxt4l8FvKYgFqeMf2uzeKyAOnb+vTGNIeCvifFL2MqvgaeYxlER437HbMIajGcuJ1pQ==", + "node_modules/@react-native/community-cli-plugin/node_modules/accepts": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", + "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", "license": "MIT", + "peer": true, + "dependencies": { + "mime-types": "^3.0.0", + "negotiator": "^1.0.0" + }, "engines": { - "node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0" + "node": ">= 0.6" } }, - "node_modules/@react-native/js-polyfills": { - "version": "0.86.0", - "resolved": "https://registry.npmjs.org/@react-native/js-polyfills/-/js-polyfills-0.86.0.tgz", - "integrity": "sha512-zYy/Cjd1VTnZ2iCNaG9bDF9C3l2ntESiPRscjIlI5FKugu6aeTwsDSv1aI8Bc4Kp3vEdoVg+UQhLAhE4svREaQ==", + "node_modules/@react-native/community-cli-plugin/node_modules/ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", "license": "MIT", - "engines": { - "node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0" - } - }, - "node_modules/@react-native/normalize-colors": { - "version": "0.86.0", - "resolved": "https://registry.npmjs.org/@react-native/normalize-colors/-/normalize-colors-0.86.0.tgz", - "integrity": "sha512-kG0wfCGghUKlfxkJyyHCDVutWVYWK7/DG58ojA/4v9EfulgF+osuSQmlbNb3rcKX58qutm7JcldSeVLgGFha9g==", - "license": "MIT" + "peer": true }, - "node_modules/@react-native/virtualized-lists": { - "version": "0.86.0", - "resolved": "https://registry.npmjs.org/@react-native/virtualized-lists/-/virtualized-lists-0.86.0.tgz", - "integrity": "sha512-4/ZLXdf/OSpPDVO0AsQ1SJdRIzt5t9BNQ46QwGgxvX7/cirYR5k8KXctNGGgW8lQo2gZChEfY2zFCZg9nM/jiw==", + "node_modules/@react-native/community-cli-plugin/node_modules/metro": { + "version": "0.87.0", + "resolved": "https://registry.npmjs.org/metro/-/metro-0.87.0.tgz", + "integrity": "sha512-fRqFhSzQhLNQSCvJFeuRzBRXAOOKXf1O8d2cvmMtG6yFR0jCllQ7vBsXoLP18yuqtf+N1XwWXTPF11eWy9q6dQ==", "license": "MIT", + "peer": true, "dependencies": { + "@babel/code-frame": "^7.29.0", + "@babel/core": "^7.25.2", + "@babel/generator": "^7.29.1", + "@babel/parser": "^7.29.0", + "@babel/template": "^7.28.6", + "@babel/traverse": "^7.29.0", + "@babel/types": "^7.29.0", + "accepts": "^2.0.0", + "ci-info": "^2.0.0", + "connect": "^3.6.5", + "debug": "^4.4.0", + "error-stack-parser": "^2.0.6", + "flow-enums-runtime": "^0.0.6", + "graceful-fs": "^4.2.4", + "hermes-parser": "0.36.1", + "image-size": "^1.0.2", "invariant": "^2.2.4", - "nullthrows": "^1.1.1" - }, - "engines": { - "node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0" - }, - "peerDependencies": { - "@types/react": "^19.2.0", - "react": "*", - "react-native": "0.86.0" + "jest-worker": "^29.7.0", + "jsc-safe-url": "^0.2.2", + "lodash.throttle": "^4.1.1", + "metro-babel-transformer": "0.87.0", + "metro-cache": "0.87.0", + "metro-cache-key": "0.87.0", + "metro-config": "0.87.0", + "metro-core": "0.87.0", + "metro-file-map": "0.87.0", + "metro-resolver": "0.87.0", + "metro-runtime": "0.87.0", + "metro-source-map": "0.87.0", + "metro-symbolicate": "0.87.0", + "metro-transform-plugins": "0.87.0", + "metro-transform-worker": "0.87.0", + "mime-types": "^3.0.1", + "nullthrows": "^1.1.1", + "serialize-error": "^2.1.0", + "source-map": "^0.5.6", + "throat": "^5.0.0", + "ws": "^7.5.10", + "yargs": "^17.6.2" + }, + "bin": { + "metro": "src/cli.js" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/@react-native/community-cli-plugin/node_modules/metro-babel-transformer": { + "version": "0.87.0", + "resolved": "https://registry.npmjs.org/metro-babel-transformer/-/metro-babel-transformer-0.87.0.tgz", + "integrity": "sha512-IEn1K1FyY4J1sA5y6zqDjf2OkfmpTEqhZOeP6MJX8HepSW0cuHGw1m8bYOdv2adkG3XUE9dtM0csUs0gP/Xa5w==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/core": "^7.25.2", + "flow-enums-runtime": "^0.0.6", + "hermes-parser": "0.36.1", + "metro-cache-key": "0.87.0", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/@react-native/community-cli-plugin/node_modules/metro-cache": { + "version": "0.87.0", + "resolved": "https://registry.npmjs.org/metro-cache/-/metro-cache-0.87.0.tgz", + "integrity": "sha512-146vS1BMSKcp99jddOhFBfHwzUEWN35NrsnSJDF2sQQ0ZT5OsBcOjd574PM233TWEZISRJ5DOK+vokD+1ubx+w==", + "license": "MIT", + "peer": true, + "dependencies": { + "exponential-backoff": "^3.1.1", + "flow-enums-runtime": "^0.0.6", + "https-proxy-agent": "^7.0.5", + "metro-core": "0.87.0" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/@react-native/community-cli-plugin/node_modules/metro-cache-key": { + "version": "0.87.0", + "resolved": "https://registry.npmjs.org/metro-cache-key/-/metro-cache-key-0.87.0.tgz", + "integrity": "sha512-Q+MPt6jl0zQogr4Q02WaJK6HY+GtE5A0nzj8kIV1Owgrx6OMNvm6scPTr1SM/R4LpCE8EH/Y5qfbXQ84GHTr0Q==", + "license": "MIT", + "peer": true, + "dependencies": { + "flow-enums-runtime": "^0.0.6" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/@react-native/community-cli-plugin/node_modules/metro-config": { + "version": "0.87.0", + "resolved": "https://registry.npmjs.org/metro-config/-/metro-config-0.87.0.tgz", + "integrity": "sha512-yZ9QAIzWH9MxwrzwRlX/CBGRWOT14l7klSDYg8hdtSdnoUs5A7MQRdHE2KB9iHVzGQW5wgWM5aXJswNeWbSQPA==", + "license": "MIT", + "peer": true, + "dependencies": { + "connect": "^3.6.5", + "flow-enums-runtime": "^0.0.6", + "jest-validate": "^29.7.0", + "metro": "0.87.0", + "metro-cache": "0.87.0", + "metro-core": "0.87.0", + "metro-runtime": "0.87.0" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/@react-native/community-cli-plugin/node_modules/metro-core": { + "version": "0.87.0", + "resolved": "https://registry.npmjs.org/metro-core/-/metro-core-0.87.0.tgz", + "integrity": "sha512-yW57+pCOHRC/CJZ99GA2PTd+30dORwDAjUPRCokj91IWW5In9Jwtt2FB5wACrGO8P0GHTyVHdTwDNyZsNndUbA==", + "license": "MIT", + "peer": true, + "dependencies": { + "flow-enums-runtime": "^0.0.6", + "lodash.throttle": "^4.1.1", + "metro-resolver": "0.87.0" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/@react-native/community-cli-plugin/node_modules/metro-file-map": { + "version": "0.87.0", + "resolved": "https://registry.npmjs.org/metro-file-map/-/metro-file-map-0.87.0.tgz", + "integrity": "sha512-Dc57t8jsINwA90bbVlqaeDlxf1rVGgj5SmOEnOMbaHNUM/HCYYTJxPV8SRdOBwh7qTz/biO9vaQvBTjRBgbbsg==", + "license": "MIT", + "peer": true, + "dependencies": { + "debug": "^4.4.0", + "fb-watchman": "^2.0.0", + "flow-enums-runtime": "^0.0.6", + "graceful-fs": "^4.2.4", + "invariant": "^2.2.4", + "jest-worker": "^29.7.0", + "micromatch": "^4.0.4", + "nullthrows": "^1.1.1", + "walker": "^1.0.7" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/@react-native/community-cli-plugin/node_modules/metro-minify-terser": { + "version": "0.87.0", + "resolved": "https://registry.npmjs.org/metro-minify-terser/-/metro-minify-terser-0.87.0.tgz", + "integrity": "sha512-tPa0O983PDutFu3LXbArRH5NduogcKrvW6fs9VHhksTKUA1iqDyoD1ZSj/Me52xJ6T9/9pOwIVyj9ulKc/zMkg==", + "license": "MIT", + "peer": true, + "dependencies": { + "flow-enums-runtime": "^0.0.6", + "terser": "^5.15.0" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/@react-native/community-cli-plugin/node_modules/metro-resolver": { + "version": "0.87.0", + "resolved": "https://registry.npmjs.org/metro-resolver/-/metro-resolver-0.87.0.tgz", + "integrity": "sha512-Xl3M9R3KToaHJvXlI2lSOxtYHitzxite+195DSi00HL9PcS7Xik5+3xlRjfkKb3FA86SZxYPj+WJwlcfgaZoxg==", + "license": "MIT", + "peer": true, + "dependencies": { + "flow-enums-runtime": "^0.0.6" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/@react-native/community-cli-plugin/node_modules/metro-runtime": { + "version": "0.87.0", + "resolved": "https://registry.npmjs.org/metro-runtime/-/metro-runtime-0.87.0.tgz", + "integrity": "sha512-XsXZkgEwI0ZMYSBfvOMAbenzwa60XlObXJ27g6/Khgrz9ESbiBbAsd7hR62G2jRBYOhGAzG61Gk22dpRJj/mdw==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.25.0", + "flow-enums-runtime": "^0.0.6" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/@react-native/community-cli-plugin/node_modules/metro-source-map": { + "version": "0.87.0", + "resolved": "https://registry.npmjs.org/metro-source-map/-/metro-source-map-0.87.0.tgz", + "integrity": "sha512-31BrYqu1c2co93rF1LN9Pw+7g+BrfDyxJkNQWrYm+pfA/+eVYVumF7tFMHbXLePLmHfhvSgVvbK6su1Oyiw1ng==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/traverse": "^7.29.0", + "@babel/types": "^7.29.0", + "flow-enums-runtime": "^0.0.6", + "invariant": "^2.2.4", + "metro-symbolicate": "0.87.0", + "nullthrows": "^1.1.1", + "ob1": "0.87.0", + "source-map": "^0.5.6", + "vlq": "^1.0.0" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/@react-native/community-cli-plugin/node_modules/metro-symbolicate": { + "version": "0.87.0", + "resolved": "https://registry.npmjs.org/metro-symbolicate/-/metro-symbolicate-0.87.0.tgz", + "integrity": "sha512-uOpTxAXu74N+RSujUZ78L6gjI6bDdnz6XuW+AIUNuubZDEQPIpaX0StzIb0GMeQWP6zfHOHwFrWPP5Iquu1GXw==", + "license": "MIT", + "peer": true, + "dependencies": { + "flow-enums-runtime": "^0.0.6", + "invariant": "^2.2.4", + "metro-source-map": "0.87.0", + "nullthrows": "^1.1.1", + "source-map": "^0.5.6", + "vlq": "^1.0.0" + }, + "bin": { + "metro-symbolicate": "src/index.js" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/@react-native/community-cli-plugin/node_modules/metro-transform-plugins": { + "version": "0.87.0", + "resolved": "https://registry.npmjs.org/metro-transform-plugins/-/metro-transform-plugins-0.87.0.tgz", + "integrity": "sha512-i8keUe9+BaSwMuQM26DGheElCpTtflAKIrSwJAm8ZsgDb50RAUQus+e6zt2suaJXJ1OxZa7vqgtqoZxdniM6Fw==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/core": "^7.25.2", + "@babel/generator": "^7.29.1", + "@babel/template": "^7.28.6", + "@babel/traverse": "^7.29.0", + "flow-enums-runtime": "^0.0.6", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/@react-native/community-cli-plugin/node_modules/metro-transform-worker": { + "version": "0.87.0", + "resolved": "https://registry.npmjs.org/metro-transform-worker/-/metro-transform-worker-0.87.0.tgz", + "integrity": "sha512-YftLzNJxCTYxEN5k4AzR8KYwiENTEuz30L+4QeoMrtDd+U8mDThZg/ArR3JVRd8LaikwPOjVAS5SP3xPJN0AaA==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/core": "^7.25.2", + "@babel/generator": "^7.29.1", + "@babel/parser": "^7.29.0", + "@babel/types": "^7.29.0", + "flow-enums-runtime": "^0.0.6", + "metro": "0.87.0", + "metro-babel-transformer": "0.87.0", + "metro-cache": "0.87.0", + "metro-cache-key": "0.87.0", + "metro-minify-terser": "0.87.0", + "metro-source-map": "0.87.0", + "metro-transform-plugins": "0.87.0", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/@react-native/community-cli-plugin/node_modules/mime-types": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz", + "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==", + "license": "MIT", + "peer": true, + "dependencies": { + "mime-db": "^1.54.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/@react-native/community-cli-plugin/node_modules/negotiator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.1.0.tgz", + "integrity": "sha512-NMPBRMJgiQHjbd8phG3Vebdx4kZ1H121rbl5IkMqeOsahptB9BKo/d7oJ3zTXqTgagn2bWlNSXkh0QUGM31RYg==", + "license": "MIT", + "peer": true, + "dependencies": { + "content-type": "^2.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/@react-native/community-cli-plugin/node_modules/ob1": { + "version": "0.87.0", + "resolved": "https://registry.npmjs.org/ob1/-/ob1-0.87.0.tgz", + "integrity": "sha512-8Q8sKCiUwsxgSmjDtVWyRgmxsgeJXXam3oQH6Id8ADfNaJMV6GZKyeAl8+pGVVdgwAZabfk5+aExle7AP/nZiA==", + "license": "MIT", + "peer": true, + "dependencies": { + "flow-enums-runtime": "^0.0.6" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/@react-native/debugger-frontend": { + "version": "0.86.3", + "resolved": "https://registry.npmjs.org/@react-native/debugger-frontend/-/debugger-frontend-0.86.3.tgz", + "integrity": "sha512-TQmeofQ0PcuylhhlleOeuzHYZfbrgm3gayXzowqUEzgRisTm1D40/J3ggqs7XkQi5HP5ZA3n8dHmKL9vIzPcsw==", + "license": "BSD-3-Clause", + "peer": true, + "engines": { + "node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0" + } + }, + "node_modules/@react-native/debugger-shell": { + "version": "0.86.3", + "resolved": "https://registry.npmjs.org/@react-native/debugger-shell/-/debugger-shell-0.86.3.tgz", + "integrity": "sha512-O4ds+J7xZfxkbih9T+cAGegBdvKSPKYJm/lDgC9CpEjFMkmzWTpVLU3Qsv9sqZuo58z+sGhIcJfPsCFFWHpqbQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "cross-spawn": "^7.0.6", + "debug": "^4.4.0", + "fb-dotslash": "0.5.8" + }, + "engines": { + "node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0" + } + }, + "node_modules/@react-native/dev-middleware": { + "version": "0.86.3", + "resolved": "https://registry.npmjs.org/@react-native/dev-middleware/-/dev-middleware-0.86.3.tgz", + "integrity": "sha512-LiEPTqTg/63bYUnrPyHLfjTDCNhA/+CUqI1+DsA9tYyewtSbULd5awsva6SgE10I+2iMhgKXS3ymkhU/kSCrGA==", + "license": "MIT", + "peer": true, + "dependencies": { + "@isaacs/ttlcache": "^1.4.1", + "@react-native/debugger-frontend": "0.86.3", + "@react-native/debugger-shell": "0.86.3", + "chrome-launcher": "^0.15.2", + "chromium-edge-launcher": "^0.3.0", + "connect": "^3.6.5", + "debug": "^4.4.0", + "invariant": "^2.2.4", + "nullthrows": "^1.1.1", + "open": "^7.0.3", + "serve-static": "^1.16.2", + "ws": "^7.5.10" + }, + "engines": { + "node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0" + } + }, + "node_modules/@react-native/gradle-plugin": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/@react-native/gradle-plugin/-/gradle-plugin-0.87.1.tgz", + "integrity": "sha512-bZ5X2BNxaSlfp2KlDtUM910QqW9G1yTIeZXghuv4ag8SAQLzm5Mf9j5GjJfT6ax2Qo2aRT15Vi3Tro/yLGJstA==", + "license": "MIT", + "peer": true, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/@react-native/normalize-colors": { + "version": "0.86.3", + "resolved": "https://registry.npmjs.org/@react-native/normalize-colors/-/normalize-colors-0.86.3.tgz", + "integrity": "sha512-Cv3CDkprb67GrzuaS9BGbBJC/6G4lIw3nyKOHRKTqTTum4bn37y5+R0Z04L8mcbQN85eEohNrRwb7IOM4j6uvg==", + "license": "MIT", + "peer": true + }, + "node_modules/@react-native/virtualized-lists": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/@react-native/virtualized-lists/-/virtualized-lists-0.87.1.tgz", + "integrity": "sha512-qSZjeX3UJrDvyfjf7yc3E68rp1XnzE+5nu8ImklhkVC0+p/XiaHPb/KGkRqDdnQyWHN55BRYSsCMEwgVI6WRNQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "invariant": "^2.2.4", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + }, + "peerDependencies": { + "@types/react": "^19.2.0", + "react": "*", + "react-native": "0.87.1" }, "peerDependenciesMeta": { "@types/react": { @@ -2021,9 +2668,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.62.2.tgz", - "integrity": "sha512-6o7ZLZK+BeenkZCFNDXqpbjw9bD6nuWonvS/lwQJp7NoVVxm6p3qE7qQ5jGuBjiFsgvqjD8mZAU5oWxTmbOeOg==", + "version": "4.63.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.63.1.tgz", + "integrity": "sha512-UZ8sUxPTiHWYX9QNdJedb1kDZSpS1t/VPWBWGSgqHNi9w3Cu6IXvu2mzbhiTiPvtrqgTQJ+zqiAq2iPIPilpaQ==", "cpu": [ "arm" ], @@ -2035,9 +2682,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.62.2.tgz", - "integrity": "sha512-BaH7BllCACHoH1LguOU56UItGfUWjujlO65kS9LAodViaN4bwIKd7oeW/ZHJ/4ljr/7MIiENnNy3HJ0zXv8Zkw==", + "version": "4.63.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.63.1.tgz", + "integrity": "sha512-cQ4nFQABN5cDvDpbvJ7bMStCpnaVxynZrRMfUJYgxcIk9Sh54FIO1vtfkg0B69REjER77ioZ/ov+eAApx/KmLQ==", "cpu": [ "arm64" ], @@ -2049,9 +2696,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.62.2.tgz", - "integrity": "sha512-v39RCCvj4He82I9sFmk+M1VZ0PLM9sfsLVikjfx2hYBNALhrrOR2D3JjQA6AhlaSOgcR+RzrKY7e1+bT6SUO/A==", + "version": "4.63.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.63.1.tgz", + "integrity": "sha512-FQNqd1lRy/0QhDk3xeRIkSBiCpXCiDnZO3YLVdcDKN1UBiKToNftCzcXYNLshmPDUMlu2TdeS8tGcsU6f3YF1Q==", "cpu": [ "arm64" ], @@ -2063,9 +2710,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.62.2.tgz", - "integrity": "sha512-yl0y2vq3S3lHeuXhEdss6TWfKW8vkujImO12tn4ZkG/4oghr09LvdYm2RElVjokTQiUvDUGXLGsYeLqUMCKpGA==", + "version": "4.63.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.63.1.tgz", + "integrity": "sha512-pvD16V939D3CloK0+qikpGaxiPrDUXTe7Y5cWOMkMSy7m1cawa8EGy/kXYi/G/cKAC4HDAbSnzCIk1WmsoOKXg==", "cpu": [ "x64" ], @@ -2077,9 +2724,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.62.2.tgz", - "integrity": "sha512-tT4pvt4qXD+vEoezupCWi+a1F0vvDiksiHc+PxRlYTOH1I6/X4id9jPxTP+Fg+545euaFT1jJVs4CEdHZAU1vw==", + "version": "4.63.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.63.1.tgz", + "integrity": "sha512-pcFGeL2345VwdTnJhA6zLbew+YgWB0qBG2+dMtXjCicf6+rm6kO6cOoh5VnTe0ZMrMRgRyuHmCJxZWrIdzYuOw==", "cpu": [ "arm64" ], @@ -2091,9 +2738,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.62.2.tgz", - "integrity": "sha512-6nU5F2wCW+qvCBhTn1pdIU3bzsIoF7EUwsCDRxilWGprQR6yd508YnH9+OKFCwpfS8pjZqDUmnCAr7exax0XCg==", + "version": "4.63.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.63.1.tgz", + "integrity": "sha512-mRJlqSRulVzcKq/LKA6ICSIc3K/l4fzlVn/gePn2nXIHy8seRi5z/eeRE0d/XMBxcMldiXtQTSpRj0tkkC3g8Q==", "cpu": [ "x64" ], @@ -2105,9 +2752,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.62.2.tgz", - "integrity": "sha512-n1GJHPOvpIfhi3TmrCeh6S6URt9BFCt0KQE3qvexyGCTAKpR4Lg+eWvNZEqu7epxwus/8ElT3hacYEucm49SZg==", + "version": "4.63.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.63.1.tgz", + "integrity": "sha512-YDUNvVM85TI3g/1OpnqKP1h4NeW/j64DfWMf+G3M809xNk1bJSnpFp4sh83NpmVE5DXnkh8ULor4LTVZKoYLHw==", "cpu": [ "arm" ], @@ -2122,9 +2769,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.62.2.tgz", - "integrity": "sha512-JqgflS8wEB+UXV/vS1RpRbifGBeN4D5lz8D8oOFbFZw4vedvdOgCFAjfBmIMdW3yL10XpQQ0Ambepw6MXrhOnA==", + "version": "4.63.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.63.1.tgz", + "integrity": "sha512-7Mcn71p9ZuQFAj+h+dhQXy/yeLePRS2yKRnmW1DijA9thKO5qap0GNOIQK4yQ6iP3SU0Mrb/yWo8h8vgRba8lw==", "cpu": [ "arm" ], @@ -2139,9 +2786,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.62.2.tgz", - "integrity": "sha512-wnFJkogWvN4jm/hQRF2UBaeUmk20j5+DmHvoyWii2b8HJDyvz1MF2OU/6ynXt2KR63rbZLWkFpoytpdc/yBuSA==", + "version": "4.63.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.63.1.tgz", + "integrity": "sha512-4YiLQTX6U4CSl0L9cluep9A9W6UmTfqBDc2/CH6wlu54pl4E7Jn3cOD8oxzvBDEGk/JMKgJ47C8g+radF7mwvg==", "cpu": [ "arm64" ], @@ -2156,9 +2803,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.62.2.tgz", - "integrity": "sha512-HVu2bp0zhvJ8xHEV9+UUs7S90VadmBSY3LcIMvozbPo4AuMGDWlz3ymHLHZPX4hR67TKTt8Qp5PJ5RBg/i+RMQ==", + "version": "4.63.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.63.1.tgz", + "integrity": "sha512-2ra8F7w8OquwZN9z2/fKFnli69wa8PLwaVzRMIPGb13ByMJwC28Fbp8YcVGoUhlYMTt7j5j9bNgpysrN2UM+vw==", "cpu": [ "arm64" ], @@ -2173,9 +2820,9 @@ ] }, "node_modules/@rollup/rollup-linux-loong64-gnu": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.62.2.tgz", - "integrity": "sha512-mQqqAV8QaoSgr9I2fKDLY2BAVvmKjWoGiu/cSYQonsLvtqwEn1E4QYfnCOcp5zoEqNhsDYin1s6jx/VJmrxlZg==", + "version": "4.63.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.63.1.tgz", + "integrity": "sha512-Sy20ncyhjmBP0Ml+UvQbimjlk6VFgjW5uNP+qqwHB00mTE8Bl2C1TuHTlRwK2YoXeZbee5lP2XevBWVkAQAtSQ==", "cpu": [ "loong64" ], @@ -2190,9 +2837,9 @@ ] }, "node_modules/@rollup/rollup-linux-loong64-musl": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.62.2.tgz", - "integrity": "sha512-IxKLoxCQ2IWi6bT2akyDUBGsOImDKB+sPp4EsTmwFQ/fMwpCKm8uLSSgP/Kx/QYUgKis6SEZ5/Nlhup0DIA0PQ==", + "version": "4.63.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.63.1.tgz", + "integrity": "sha512-noITLp8oNjYliPnGWmLyelIHwULGqbHloQHGw1rtxbWhTuWooRpnZarZQJ1y9EUC4szuCusCc+HEpUtxpIwYvA==", "cpu": [ "loong64" ], @@ -2207,9 +2854,9 @@ ] }, "node_modules/@rollup/rollup-linux-ppc64-gnu": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.62.2.tgz", - "integrity": "sha512-Mk5ha2RQSgyFfmYYLkBpPnUk8D8FriBxesO1u9O75X0mHgXL1UQcH5Itl2lurWL2tj0RxV9b9tJgipac0hRY9A==", + "version": "4.63.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.63.1.tgz", + "integrity": "sha512-hlxxXd+F1mWiAcaFR7Sv9ZQT6m6UfI8+Vy/kFJzztq2pDMU/0wZ9sish0iszNZvsQDo8Gc0i5yuFEOz5dDf6fA==", "cpu": [ "ppc64" ], @@ -2224,9 +2871,9 @@ ] }, "node_modules/@rollup/rollup-linux-ppc64-musl": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.62.2.tgz", - "integrity": "sha512-CjvEnqJL/0/TQ3TXX3OPIJ/kmBellrWd4heXUmHeJlTnmwjKpSJzoehLaL6Xk0ZnMHBu9dZuFADNOrtjF4v+2w==", + "version": "4.63.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.63.1.tgz", + "integrity": "sha512-EF7OpqQTQ/BvGqLzUi4rEHuagCV9MugAUXSHemwPW5vxZ75RR+jxO/2j95Ph2dalMpFHSVECjRoioHZgA9zOYA==", "cpu": [ "ppc64" ], @@ -2241,9 +2888,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.62.2.tgz", - "integrity": "sha512-1SiZbzwdkaDURsew/tSOrooKiYy7EQGT6m8ufavAi9NEyQb/6VuIxFXAL1fqa4iZe3g4NbNk4P7J32z2tw5Mgg==", + "version": "4.63.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.63.1.tgz", + "integrity": "sha512-wQO3JesW9PRkwlabQ27y7sPfVOOTLRG73I4F2UYHG5PXun3J9U3y+b7ezVKSYbsvSKGQ1k1cq8Qlun4C9kLt3w==", "cpu": [ "riscv64" ], @@ -2258,9 +2905,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.62.2.tgz", - "integrity": "sha512-nQts12zJ3NQRoE6uYljOH89v7szzLDvG2JD/vsX+vGXU8w/At1GowTZ5/7qeFQ8m7L55rpR8Okugnuo5bgjy2Q==", + "version": "4.63.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.63.1.tgz", + "integrity": "sha512-ouAGwhO6wHRXdnOVCOsB0tRFkA7nhNB2Nwax6oECXN0YiN8EYUTBAOudADOB1PI+yDL61TeNx/u7MVCzksNbkQ==", "cpu": [ "riscv64" ], @@ -2275,9 +2922,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.62.2.tgz", - "integrity": "sha512-E9/ll019jhPIJgpzfZoIkBGhcz+kKNgVWYRY0zr9srBdPPFVpvOKW8VaJKUbeK+eZXyQF9ltME+Kk6affeaPgg==", + "version": "4.63.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.63.1.tgz", + "integrity": "sha512-q2R38Sn+1J8RxhfJ+T54wSWmyKXWec+9jgDfqO2AtArEqHO5R2aeayp5H5OYLr5UYDVGsVaZPEFUooMhYCdz5A==", "cpu": [ "s390x" ], @@ -2292,9 +2939,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.62.2.tgz", - "integrity": "sha512-5BqxR/pshjey51iliyzTD5Xi3EN0aLmQ2lZ3lvefVV9c82BvrLo2/6OT55iifpWBufs6kdwWbuOKS841DrmK9A==", + "version": "4.63.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.63.1.tgz", + "integrity": "sha512-gfI5T24WLLuFfSKw7Go/zDXjAAV0fny0swTaDv+WjK7vqcw4cRhFfdsyKL1n+ukI+ooBxn3bVQnyrn06WpI50w==", "cpu": [ "x64" ], @@ -2309,9 +2956,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.62.2.tgz", - "integrity": "sha512-uNN83XxQrRAh/w0/pmAfibcwyb6YWt4gP+dpnQKPVJshAloQ785ii8CT8ZCIxkGg9opVsvAlGhFitSm6D1Jjpg==", + "version": "4.63.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.63.1.tgz", + "integrity": "sha512-4h6XqthmB4Hspji84wvgk+ElodTsGj+dbZqHJHHtKxj4mYq0ANSEEPX9ys3moJueqsRjwpaJYH7874Itwnj2ow==", "cpu": [ "x64" ], @@ -2326,9 +2973,9 @@ ] }, "node_modules/@rollup/rollup-openbsd-x64": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.62.2.tgz", - "integrity": "sha512-srjEIxSH3LRnJN6THczDHWQplqEMFiAJrTab0msUryh9kwNpkICf3Ea6q6MN/2cZwRFUNx5w+h6Hpi4QuHS6Zg==", + "version": "4.63.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.63.1.tgz", + "integrity": "sha512-dlfCOa87o1VAYegLQ9EKilx2JCeRofiyPGhTCmqnuXZ6bMPiycO1rq1+sKoulAp7pGLIsTIw+1x5R+zgh5LhhA==", "cpu": [ "x64" ], @@ -2340,9 +2987,9 @@ ] }, "node_modules/@rollup/rollup-openharmony-arm64": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.62.2.tgz", - "integrity": "sha512-8hOJnxgbyObnCm5AlRA3A931xX19xq80RjVTKgJOvEKWqJruP/Uf12IbAOaDjjEXYRewwHLfmF0YRIdK3OwKWA==", + "version": "4.63.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.63.1.tgz", + "integrity": "sha512-cjkLbOlfcm3QGhMM1J5zaZjsw1GggbN6rw9UTSSRrPrR1KkcXnN7Uq9rPw34xImQ9VOY9GN+6u2Zj80B9ptkcw==", "cpu": [ "arm64" ], @@ -2354,9 +3001,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.62.2.tgz", - "integrity": "sha512-mmF4AY1i0hG/bLWUctUq59gtmgaSIRa3cu/A3JFRp/sCNEme2bgDEiDS22P9FbnJB8NJNF4jPJiSP5RHQpUTDg==", + "version": "4.63.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.63.1.tgz", + "integrity": "sha512-Li1KdUnWGE4N3e1F/B4RTB1ms+nG4WBgjByO46pkeBVX/2UBsY53xf5vK9WygVmnH3RwncIST7lkSdLSY6P9lg==", "cpu": [ "arm64" ], @@ -2368,9 +3015,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.62.2.tgz", - "integrity": "sha512-DZgkknc6jhHrk46V25vbAM0zZkyP0nSDkJB8/dRkLTxv470dOmWDqGoEJl/9A0dFfS7yE3REOwNDxpHwSLSt0Q==", + "version": "4.63.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.63.1.tgz", + "integrity": "sha512-t4ZYOSoLTgwhuFMrmTMLx/+i1DQVK7HYqMc6kY46EApwi8X0nIVphzdNoThU3xt6n+N5urG1/gxBdCaKDLavfg==", "cpu": [ "ia32" ], @@ -2382,9 +3029,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-gnu": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.62.2.tgz", - "integrity": "sha512-T6xr6ucWSFto+VGajA8YH26LdpHRuP4YLHEKAtCWvJDOlnmWcDZVCI2Jmjr+IFHDlt2zRaTAKE4tfjTaWLgJBg==", + "version": "4.63.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.63.1.tgz", + "integrity": "sha512-RgroPfMmKlD1RzSDxvwgcPiy2HNQKoYV7OmwIXDsk73uKW5t6B/V8KIy27SMv/FNXFo/oSBtWc9J0X7t91ezZg==", "cpu": [ "x64" ], @@ -2396,9 +3043,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.62.2.tgz", - "integrity": "sha512-BfzEnDJOt9T8M989/lA37EcJgat01wLRnoi5dQf3QzOH7jzpqTAzdDbVfRljVr5r+jzKqpbHeyOfAaXxAd0PAA==", + "version": "4.63.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.63.1.tgz", + "integrity": "sha512-at8QVep6S3h5Y6gSbdGU06bRY5WJkf6WUduM9YtvYMbYhB1MOFfUgc6kehitQXzOtMSaT70q7f9ydPhpqu821w==", "cpu": [ "x64" ], @@ -2410,9 +3057,17 @@ ] }, "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.27.12", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.12.tgz", + "integrity": "sha512-hhyNJ+nbR6ZR7pToHvllEFun9TL0sbL+tk/ON75lo+Xas054uez98qRbsuNt7MBCyZKK4+8Yli/OAGZhmfBZ/g==", + "license": "MIT", + "peer": true + }, + "node_modules/@types/esrecurse": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@types/esrecurse/-/esrecurse-4.3.1.tgz", + "integrity": "sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw==", + "dev": true, "license": "MIT" }, "node_modules/@types/estree": { @@ -2426,13 +3081,15 @@ "version": "2.0.6", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@types/istanbul-lib-report": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", "license": "MIT", + "peer": true, "dependencies": { "@types/istanbul-lib-coverage": "*" } @@ -2442,70 +3099,299 @@ "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", "license": "MIT", + "peer": true, "dependencies": { "@types/istanbul-lib-report": "*" } }, - "node_modules/@types/json-bigint": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@types/json-bigint/-/json-bigint-1.0.4.tgz", - "integrity": "sha512-ydHooXLbOmxBbubnA7Eh+RpBzuaIiQjh8WGJYQB50JFGFrdxW7JzVlyEV7fAXw0T2sqJ1ysTneJbiyNLqZRAag==", + "node_modules/@types/json-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@types/json-bigint/-/json-bigint-1.0.4.tgz", + "integrity": "sha512-ydHooXLbOmxBbubnA7Eh+RpBzuaIiQjh8WGJYQB50JFGFrdxW7JzVlyEV7fAXw0T2sqJ1ysTneJbiyNLqZRAag==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "26.4.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-26.4.1.tgz", + "integrity": "sha512-k97ENvZWtvA6yqz5/FS6a7duDgOPEeOQOc2iKS/nY6mX6qJUKtLnWzQS+Xj6tXweyj6ZcTAK2Qecetnvi9nCLA==", + "license": "MIT", + "peer": true, + "dependencies": { + "undici-types": "~8.3.0" + } + }, + "node_modules/@types/yargs": { + "version": "17.0.35", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.35.tgz", + "integrity": "sha512-qUHkeCyQFxMXg79wQfTtfndEC+N9ZZg76HJftDJp+qH2tV7Gj4OJi7l+PiWwJ+pWtW8GwSmqsDj/oymhrTWXjg==", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@types/yargs-parser": { + "version": "21.0.3", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", + "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", + "license": "MIT", + "peer": true + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.69.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.69.0.tgz", + "integrity": "sha512-t5jQTKPIgVW1PE6dR6H6Qz5gm8zjMlX5/2gRaOGd9eO6V7J+tQc6iWKukEe7dY8u9HyYasQ0yfF0/FSSTEO2gA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.12.2", + "@typescript-eslint/scope-manager": "8.69.0", + "@typescript-eslint/type-utils": "8.69.0", + "@typescript-eslint/utils": "8.69.0", + "@typescript-eslint/visitor-keys": "8.69.0", + "ignore": "^7.0.5", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.5.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.69.0", + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "7.0.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.8.tgz", + "integrity": "sha512-YYNsSlXBjMk92SKnkwvB5LOVSa6OznlFUGcsvrFgNJbJCd0M1XKeFVRc8ZByeCqz32FivYNHJVooLmdqrmvp/Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "8.69.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.69.0.tgz", + "integrity": "sha512-l4b0DhWioGg6Gt2ebGlvfkFMOjRsauxtsnDRwUSRX1qHq3HdTfQHV8wW9zEXeciai6HfeaKOedQn2Zoofx3WBw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/scope-manager": "8.69.0", + "@typescript-eslint/types": "8.69.0", + "@typescript-eslint/typescript-estree": "8.69.0", + "@typescript-eslint/visitor-keys": "8.69.0", + "debug": "^4.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/project-service": { + "version": "8.69.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.69.0.tgz", + "integrity": "sha512-yi4obFrHMmnsesWehHbkg9zMA7Jt8cXT+mKM08G999pH1yT6nqgsHx7MYm0uY1wAj8CqiBXYRJ7WAT0QdQHQXg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/tsconfig-utils": "^8.69.0", + "@typescript-eslint/types": "^8.69.0", + "debug": "^4.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.69.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.69.0.tgz", + "integrity": "sha512-ewfspqWvSxKSOaplqAUNbaSFO0eB6w1EtQ+esfYFRm3614Ty4uNtExkcbgd6nWsXphbqKyf9ZYdbZdv2xEoWEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.69.0", + "@typescript-eslint/visitor-keys": "8.69.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.69.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.69.0.tgz", + "integrity": "sha512-xNqK7YTDZsLniQMV/4rpFR8Z5JlqeRvVjuG1YgF/mdPVH84HSD19L8CczMA0qg2RfwEV231GHH3VnToJDo4MfQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "8.69.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.69.0.tgz", + "integrity": "sha512-ZfoJAVg3JZndQEpEl9petVlxau3lRuElc4HRMuAlLCf8to04/iHz692RUSNmXKDjEuJmIL+KZ2/BsOcBc16dsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.69.0", + "@typescript-eslint/typescript-estree": "8.69.0", + "@typescript-eslint/utils": "8.69.0", + "debug": "^4.4.3", + "ts-api-utils": "^2.5.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "8.69.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.69.0.tgz", + "integrity": "sha512-K3VrubUPhlo9VDBS6QdI8YB5j7ClpqLRdefcz6PFrhnwicehBweqQ9Evhl4l+FYz0HdDmMqIiSX0aldGRYtDCA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.69.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.69.0.tgz", + "integrity": "sha512-AdFkgqck3Vudb/kWnxlyafU/4aBhHrbQ9locP2N4psXTy5mOBg0SHJumnLvx7r6g1gV4DKvUFwV2nJZBoqOD8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/project-service": "8.69.0", + "@typescript-eslint/tsconfig-utils": "8.69.0", + "@typescript-eslint/types": "8.69.0", + "@typescript-eslint/visitor-keys": "8.69.0", + "debug": "^4.4.3", + "minimatch": "^10.2.2", + "semver": "^7.7.3", + "tinyglobby": "^0.2.15", + "ts-api-utils": "^2.5.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "8.69.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.69.0.tgz", + "integrity": "sha512-tUbx60BBqQa31kXF5MCsOOLL5E/WzUuxIn7YpAvq+eaUlqvk8/NXnXMBNAdLCr0icjkzem7iUA5QqWHe/hJ1aw==", "dev": true, - "license": "MIT" - }, - "node_modules/@types/node": { - "version": "26.1.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-26.1.1.tgz", - "integrity": "sha512-nxAkRSVkN1Y0JC1W8ky/fTfkGsMmcrRsbx+3XoZE+rMOX71kLYTV7fLXpqud1GpbpP5TuffXFqfX7fH2GgZREw==", "license": "MIT", "dependencies": { - "undici-types": "~8.3.0" + "@eslint-community/eslint-utils": "^4.9.1", + "@typescript-eslint/scope-manager": "8.69.0", + "@typescript-eslint/types": "8.69.0", + "@typescript-eslint/typescript-estree": "8.69.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" } }, - "node_modules/@types/yargs": { - "version": "17.0.35", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.35.tgz", - "integrity": "sha512-qUHkeCyQFxMXg79wQfTtfndEC+N9ZZg76HJftDJp+qH2tV7Gj4OJi7l+PiWwJ+pWtW8GwSmqsDj/oymhrTWXjg==", + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.69.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.69.0.tgz", + "integrity": "sha512-+rmdgPA+EXkNgKYvHvFfhrs35utXbwaC5PGpDquSXcoXQDKUA5UjV0LmTucG/4JXkM31BTu4TilHtrN8IVBe8w==", + "dev": true, "license": "MIT", "dependencies": { - "@types/yargs-parser": "*" + "@typescript-eslint/types": "8.69.0", + "eslint-visitor-keys": "^5.0.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@types/yargs-parser": { - "version": "21.0.3", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", - "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", - "license": "MIT" - }, "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==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.4.0.tgz", + "integrity": "sha512-1mEZtMKPM09vDmQt5y7YvmN2+DFTP7Tg0EWXdic8/C6VRnpb33e4ghisCIE3WZjsE2N8mf+QV1Zqh7ZFYLWInQ==", "license": "ISC", "peer": true }, "node_modules/@xmldom/xmldom": { - "version": "0.9.10", - "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.9.10.tgz", - "integrity": "sha512-A9gOqLdi6cV4ibazAjcQufGj0B1y/vDqYrcuP6d/6x8P27gRS8643Dj9o1dEKtB6O7fwxb2FgBmJS2mX7gpvdw==", + "version": "0.9.12", + "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.9.12.tgz", + "integrity": "sha512-5AXjrcMClTryPe9LgZrygpB1lj7s0S9E0+W+AHaVKAVyHanafK86iPSvG5xHVSp/jC+VH1UXu0TAEmY279xH7A==", "license": "MIT", "peer": true, "engines": { "node": ">=14.6" } }, - "node_modules/abort-controller": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", - "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", - "license": "MIT", - "dependencies": { - "event-target-shim": "^5.0.0" - }, - "engines": { - "node": ">=6.5" - } - }, "node_modules/accepts": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", @@ -2521,9 +3407,9 @@ } }, "node_modules/acorn": { - "version": "8.17.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.17.0.tgz", - "integrity": "sha512-xRQbDb9BnwDafYNn6Vwl839DYVjqXYb1XVGtWAZ1kcDc6iwAL4hg3B1dZlRiuENFeO2H53gFG3in621AdERVAg==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.18.0.tgz", + "integrity": "sha512-lGq+9yr1/GuAWaVYIHRjvvySG5/4VfKIvC8EWxStPdcDh/Ka7FG3twP6v4d5BkravUilhIAsG4Qj83t02LWUPQ==", "license": "MIT", "bin": { "acorn": "bin/acorn" @@ -2532,19 +3418,30 @@ "node": ">=0.4.0" } }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, "node_modules/agent-base": { "version": "7.1.4", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", "license": "MIT", + "peer": true, "engines": { "node": ">= 14" } }, "node_modules/agent-cli-detector": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/agent-cli-detector/-/agent-cli-detector-0.1.2.tgz", - "integrity": "sha512-qdZ/9JFORtTKJNhT/IczMeEfEUbUU0K5umYeiIQHX+AjHs+Y9SXVzSgaYlpZeyNMrvuh2HpZiOTpvS57iPfBkQ==", + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/agent-cli-detector/-/agent-cli-detector-0.1.7.tgz", + "integrity": "sha512-d8OWDVdZMgjhLUT9ZPgSv/BdFFF9pVuscC0JdUSz3bjwE15gcp6u/o0/JooM2yyAWC49KThFhXlgTXRa9B7yng==", "license": "MIT", "peer": true, "bin": { @@ -2554,11 +3451,29 @@ "node": ">=18.18" } }, + "node_modules/ajv": { + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz", + "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, "node_modules/anser": { "version": "1.4.10", "resolved": "https://registry.npmjs.org/anser/-/anser-1.4.10.tgz", "integrity": "sha512-hCv9AqTQ8ycjpSd3upOJd7vFwW1JaoYQ7tpham03GJ1ca8/65rqn0RpaWpItOAd6ylW9wAw6luXYPJIyPFVOww==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/ansi-escapes": { "version": "4.3.2", @@ -2594,6 +3509,7 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "license": "MIT", + "peer": true, "engines": { "node": ">=8" } @@ -2603,6 +3519,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "license": "MIT", + "peer": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -2631,7 +3548,8 @@ "version": "2.0.6", "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/babel-plugin-polyfill-corejs2": { "version": "0.4.17", @@ -2723,9 +3641,9 @@ } }, "node_modules/babel-preset-expo": { - "version": "57.0.2", - "resolved": "https://registry.npmjs.org/babel-preset-expo/-/babel-preset-expo-57.0.2.tgz", - "integrity": "sha512-PgsWlNSlNhnSkU4UCAcvl252CaB7VU1eQuSvJoRSiqfrZDGmeqwQmMUs+PcS5VUppFwmmhVlDPwOc7kR3Qr08Q==", + "version": "57.0.10", + "resolved": "https://registry.npmjs.org/babel-preset-expo/-/babel-preset-expo-57.0.10.tgz", + "integrity": "sha512-08bt6bqMZFoQuWO9gkt0EXotbqKHimELFGa1LlKJvY89iKsi4S0FJSFBFJ4pn9NZvofet48HIjYDQ0SZJ7bNrg==", "license": "MIT", "peer": true, "dependencies": { @@ -2765,7 +3683,7 @@ "@babel/plugin-transform-typescript": "^7.25.2", "@babel/plugin-transform-unicode-regex": "^7.24.7", "@babel/preset-typescript": "^7.23.0", - "@react-native/babel-plugin-codegen": "0.86.0", + "@react-native/babel-plugin-codegen": "0.86.3", "babel-plugin-react-compiler": "^1.0.0", "babel-plugin-react-native-web": "~0.21.0", "babel-plugin-syntax-hermes-parser": "^0.36.0", @@ -2775,7 +3693,7 @@ "peerDependencies": { "@babel/runtime": "^7.20.0", "expo": "*", - "expo-widgets": "^57.0.3", + "expo-widgets": "^57.0.16", "react-refresh": ">=0.14.0 <1.0.0" }, "peerDependenciesMeta": { @@ -2795,7 +3713,6 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", "license": "MIT", - "peer": true, "engines": { "node": "18 || 20 || >=22" } @@ -2818,13 +3735,15 @@ "url": "https://feross.org/support" } ], - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/baseline-browser-mapping": { - "version": "2.10.42", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.42.tgz", - "integrity": "sha512-c/jurFrDLyui7o1J86yLkRu4LMsTYcBohveus7/I2Hzdn9KIP2bdJPTue/lR1KH46enoPbD77GKeSYNdyPoD3Q==", + "version": "2.11.21", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.21.tgz", + "integrity": "sha512-uh8vpY/1/YyFkunIDFH/12p7/7VdPKA1hejMVEbdkEaWnUz0Hesvx5EbiU6XxjyHZIOju+ZMbQJkRh+es3/spQ==", "license": "Apache-2.0", + "peer": true, "bin": { "baseline-browser-mapping": "dist/cli.cjs" }, @@ -2875,16 +3794,15 @@ } }, "node_modules/brace-expansion": { - "version": "5.0.7", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.7.tgz", - "integrity": "sha512-7oFy703dxfY3/NLxC1fh2SUCQ0H9rmAY+5EpDVfXjUTTs+HEwR2nYaqLv+GWcTsumwxPfiz6CzCNkwXwBUwqCA==", + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz", + "integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==", "license": "MIT", - "peer": true, "dependencies": { "balanced-match": "^4.0.2" }, "engines": { - "node": "18 || 20 || >=22" + "node": "20 || >=22" } }, "node_modules/braces": { @@ -2892,6 +3810,7 @@ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "license": "MIT", + "peer": true, "dependencies": { "fill-range": "^7.1.1" }, @@ -2900,9 +3819,9 @@ } }, "node_modules/browserslist": { - "version": "4.28.5", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.5.tgz", - "integrity": "sha512-Cu2E6QejHWzuDMTkuwgpABFgDfZrXLQq5V13YOACZx4mFAG4IwGTbTfHPMr4WtxlHoXSM8FIuRwYYCz5XiabaQ==", + "version": "4.28.9", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.9.tgz", + "integrity": "sha512-EWazOblFYUvlGZcfGhPUPmYh3nikUxBVb+y9MJun5f3hBi812X+8MSQTujLBtgK3cf51fJWbWfOjyeO954d+Eg==", "funding": [ { "type": "opencollective", @@ -2918,12 +3837,13 @@ } ], "license": "MIT", + "peer": true, "dependencies": { - "baseline-browser-mapping": "^2.10.42", - "caniuse-lite": "^1.0.30001800", - "electron-to-chromium": "^1.5.387", - "node-releases": "^2.0.50", - "update-browserslist-db": "^1.2.3" + "baseline-browser-mapping": "^2.11.20", + "caniuse-lite": "^1.0.30001810", + "electron-to-chromium": "^1.5.420", + "node-releases": "^2.0.54", + "update-browserslist-db": "^1.3.2" }, "bin": { "browserslist": "cli.js" @@ -2937,6 +3857,7 @@ "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", "license": "Apache-2.0", + "peer": true, "dependencies": { "node-int64": "^0.4.0" } @@ -2945,7 +3866,8 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/bytes": { "version": "3.1.2", @@ -2962,6 +3884,7 @@ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "license": "MIT", + "peer": true, "engines": { "node": ">=10" }, @@ -2970,9 +3893,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001803", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001803.tgz", - "integrity": "sha512-g/uHREV2ZpK9qMalCsWaxmA6ol+DX8GYhuf3T40RKoP+oL7vhRJh8LNt73PCjpnR6l14FzfPrB5Yux4PKm2meg==", + "version": "1.0.30001810", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001810.tgz", + "integrity": "sha512-TITQPUkaz+aVk5GL6NhOdwk1aEaNTSDPsGFWrTuhKGtjTF70jL/Oht2W4c6rXUe5fu7Ie19VIahAXHIIiWWNeg==", "funding": [ { "type": "opencollective", @@ -2987,13 +3910,15 @@ "url": "https://github.com/sponsors/ai" } ], - "license": "CC-BY-4.0" + "license": "CC-BY-4.0", + "peer": true }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "license": "MIT", + "peer": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -3010,6 +3935,7 @@ "resolved": "https://registry.npmjs.org/chrome-launcher/-/chrome-launcher-0.15.2.tgz", "integrity": "sha512-zdLEwNo3aUVzIhKhTtXfxhdvZhUghrnmkvcAq2NoDd+LeOHKf03H5jwZ8T/STsAlzyALkBVK552iaG1fGf1xVQ==", "license": "Apache-2.0", + "peer": true, "dependencies": { "@types/node": "*", "escape-string-regexp": "^4.0.0", @@ -3028,6 +3954,7 @@ "resolved": "https://registry.npmjs.org/chromium-edge-launcher/-/chromium-edge-launcher-0.3.0.tgz", "integrity": "sha512-p03azHlGjtyRvFEee3cyvtsRYdniSkwjkzmM/KmVnqT5d7QkkwpJBhis/zCLMYdQMVJ5tt140TBNqqrZPaWeFA==", "license": "Apache-2.0", + "peer": true, "dependencies": { "@types/node": "*", "escape-string-regexp": "^4.0.0", @@ -3047,6 +3974,7 @@ } ], "license": "MIT", + "peer": true, "engines": { "node": ">=8" } @@ -3082,6 +4010,7 @@ "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "license": "ISC", + "peer": true, "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.1", @@ -3096,6 +4025,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "license": "MIT", + "peer": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -3118,6 +4048,7 @@ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "license": "MIT", + "peer": true, "dependencies": { "color-name": "~1.1.4" }, @@ -3129,7 +4060,8 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/commander": { "version": "7.2.0", @@ -3200,18 +4132,12 @@ "node": ">= 0.6" } }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true, - "license": "MIT" - }, "node_modules/connect": { "version": "3.7.0", "resolved": "https://registry.npmjs.org/connect/-/connect-3.7.0.tgz", "integrity": "sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==", "license": "MIT", + "peer": true, "dependencies": { "debug": "2.6.9", "finalhandler": "1.1.2", @@ -3227,6 +4153,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "license": "MIT", + "peer": true, "dependencies": { "ms": "2.0.0" } @@ -3235,7 +4162,8 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/content-disposition": { "version": "0.5.2", @@ -3247,20 +4175,38 @@ "node": ">= 0.6" } }, + "node_modules/content-type": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.1.0.tgz", + "integrity": "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, "node_modules/convert-source-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/core-js-compat": { - "version": "3.49.0", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.49.0.tgz", - "integrity": "sha512-VQXt1jr9cBz03b331DFDCCP90b3fanciLkgiOoy8SBHy06gNf+vQ1A3WFLqG7I8TipYIKeYK9wxd0tUrvHcOZA==", + "version": "3.50.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.50.0.tgz", + "integrity": "sha512-XGpFGbMLHwSt74YLTKho7Ib242qi6O8MSX+sRokV4oz7iKXvQWGYZthjIhjRGMxjzVkAubBO512dKGYcefmX3Q==", "license": "MIT", "peer": true, "dependencies": { - "browserslist": "^4.28.1" + "browserslist": "^4.28.7" + }, + "engines": { + "node": ">=6.4.0" }, "funding": { "type": "opencollective", @@ -3298,6 +4244,13 @@ } } }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, "node_modules/deepmerge": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", @@ -3326,6 +4279,7 @@ "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", "license": "MIT", + "peer": true, "engines": { "node": ">= 0.8" } @@ -3335,6 +4289,7 @@ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", "license": "MIT", + "peer": true, "engines": { "node": ">= 0.8", "npm": "1.2.8000 || >= 1.4.16" @@ -3361,25 +4316,29 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/electron-to-chromium": { - "version": "1.5.389", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.389.tgz", - "integrity": "sha512-cEto7aeOqBfU1D+c5py5pE+ooscKE75JifxLBdFUZsqAxRS6y7kebtxAZvICszSl05gPjYHDTjY+lXpyGvpJbg==", - "license": "ISC" + "version": "1.5.422", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.422.tgz", + "integrity": "sha512-UvA/32XqrLDdZSn7Jllo1AYNcWji/G0d5M0GTViE7KoGBiMunw3a34Sb2KO4ZZyrSEhqsxFoVhWWJshdyfKqJA==", + "license": "ISC", + "peer": true }, "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==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", "license": "MIT", + "peer": true, "engines": { "node": ">= 0.8" } @@ -3389,6 +4348,7 @@ "resolved": "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.1.4.tgz", "integrity": "sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ==", "license": "MIT", + "peer": true, "dependencies": { "stackframe": "^1.3.4" } @@ -3407,6 +4367,7 @@ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "license": "MIT", + "peer": true, "engines": { "node": ">=6" } @@ -3415,7 +4376,8 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/escape-string-regexp": { "version": "4.0.0", @@ -3429,6 +4391,151 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/eslint": { + "version": "10.9.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.9.1.tgz", + "integrity": "sha512-9VaAkDURekixUQJy0oJYl2DcN6oKMfxay7XzaGYAWQwsb6qfKf+x76R2k1L8kb1boc+FyCAaTA9GmiKaaiaF+A==", + "dev": true, + "license": "MIT", + "workspaces": [ + "packages/*" + ], + "dependencies": { + "@eslint-community/eslint-utils": "^4.8.0", + "@eslint-community/regexpp": "^4.12.2", + "@eslint/config-array": "^0.23.5", + "@eslint/config-helpers": "^0.7.0", + "@eslint/core": "^1.2.1", + "@eslint/plugin-kit": "^0.7.2", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "ajv": "^6.14.0", + "cross-spawn": "^7.0.6", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^9.1.2", + "eslint-visitor-keys": "^5.0.1", + "espree": "^11.2.0", + "esquery": "^1.7.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "minimatch": "^10.2.5", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } + } + }, + "node_modules/eslint-scope": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-9.1.2.tgz", + "integrity": "sha512-xS90H51cKw0jltxmvmHy2Iai1LIqrfbw57b79w/J7MfvDfkIkFZ+kj6zC3BjtUwh150HsSSdxXZcsuv72miDFQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@types/esrecurse": "^4.3.1", + "@types/estree": "^1.0.8", + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", + "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-11.2.0.tgz", + "integrity": "sha512-7p3DrVEIopW1B1avAGLuCSh1jubc01H2JHc8B4qqGblmg5gI9yumBgACjWo4JlIc04ufug4xJ3SQI8HkS/Rgzw==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.16.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^5.0.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", + "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, "node_modules/estree-walker": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", @@ -3436,51 +4543,53 @@ "dev": true, "license": "MIT" }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/etag": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", "license": "MIT", + "peer": true, "engines": { "node": ">= 0.6" } }, - "node_modules/event-target-shim": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", - "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/expo": { - "version": "57.0.4", - "resolved": "https://registry.npmjs.org/expo/-/expo-57.0.4.tgz", - "integrity": "sha512-5wW0SR6OnGUh+UPb3JWlFTAL22IgBcX36RqofjLAH2AuFqxAIpYIdwr9BYR9Wl3xyIe0t9lCoMQIZlAIZUNQvg==", + "version": "57.0.20", + "resolved": "https://registry.npmjs.org/expo/-/expo-57.0.20.tgz", + "integrity": "sha512-H57GWLLpNPrltsrjvx6ROsMecoFQza7h9OzujUjBsaY+aDL+bj3GsZaH3T5v5B96R7txuidUwjUh5q5hi3qttg==", "license": "MIT", "peer": true, "dependencies": { "@babel/runtime": "^7.20.0", - "@expo/cli": "^57.0.6", - "@expo/config": "~57.0.3", - "@expo/config-plugins": "~57.0.3", - "@expo/devtools": "~57.0.0", - "@expo/dom-webview": "~57.0.0", - "@expo/fingerprint": "^0.20.3", - "@expo/local-build-cache-provider": "^57.0.2", - "@expo/log-box": "^57.0.0", - "@expo/metro": "~56.0.0", - "@expo/metro-config": "~57.0.3", + "@expo/cli": "^57.0.22", + "@expo/config": "~57.0.9", + "@expo/config-plugins": "~57.0.9", + "@expo/devtools": "~57.0.1", + "@expo/dom-webview": "~57.0.1", + "@expo/fingerprint": "^0.20.12", + "@expo/local-build-cache-provider": "^57.0.8", + "@expo/log-box": "^57.0.4", + "@expo/metro": "~56.0.2", + "@expo/metro-config": "~57.0.12", "@ungap/structured-clone": "^1.3.0", - "babel-preset-expo": "~57.0.2", - "expo-asset": "~57.0.3", - "expo-constants": "~57.0.3", - "expo-file-system": "~57.0.0", - "expo-font": "~57.0.0", - "expo-keep-awake": "~57.0.0", - "expo-modules-autolinking": "~57.0.5", - "expo-modules-core": "~57.0.3", + "babel-preset-expo": "~57.0.10", + "expo-asset": "~57.0.16", + "expo-constants": "~57.0.17", + "expo-file-system": "~57.0.6", + "expo-font": "~57.0.3", + "expo-keep-awake": "~57.0.1", + "expo-modules-autolinking": "~57.0.12", + "expo-modules-core": "~57.0.16", "pretty-format": "^29.7.0", "react-refresh": "^0.14.2", "whatwg-url-minimum": "^0.1.2" @@ -3518,14 +4627,14 @@ } }, "node_modules/expo-asset": { - "version": "57.0.3", - "resolved": "https://registry.npmjs.org/expo-asset/-/expo-asset-57.0.3.tgz", - "integrity": "sha512-6E08JDuYrktY5pKNn2WiFBPBfj6bvFb++ccuBTijK8BUk/afSoy6n35h583LmC2YHgHTepWHHWNfr61nYcMd8Q==", + "version": "57.0.16", + "resolved": "https://registry.npmjs.org/expo-asset/-/expo-asset-57.0.16.tgz", + "integrity": "sha512-IBRfQdW3iFT+GOBERMZLZM1MUNyrjMgMskuD0elVZ1ae44858UFlTJkHO3f8vi+u5zuv7O7KofsiN8NMG/uWzw==", "license": "MIT", "peer": true, "dependencies": { - "@expo/image-utils": "^0.11.1", - "expo-constants": "~57.0.3" + "@expo/image-utils": "^0.11.5", + "expo-constants": "~57.0.17" }, "peerDependencies": { "expo": "*", @@ -3534,13 +4643,13 @@ } }, "node_modules/expo-constants": { - "version": "57.0.3", - "resolved": "https://registry.npmjs.org/expo-constants/-/expo-constants-57.0.3.tgz", - "integrity": "sha512-BghbZlzwFnA22BG0CWv6W29zx8w19FozYPfSeZ3HjMitoy4aAmF1FnFbbjYSmZz6HHXXTWOfqwobOEIaglfzxg==", + "version": "57.0.17", + "resolved": "https://registry.npmjs.org/expo-constants/-/expo-constants-57.0.17.tgz", + "integrity": "sha512-cPWYBKN1SEbg2lXg2f8VkePJqGZrJPLvVdQDCTfbFu9sQHO1M31Y1zILReUuGnmt/VKeUz40ze579vR00xGu/A==", "license": "MIT", "peer": true, "dependencies": { - "@expo/env": "~2.4.1" + "@expo/env": "~2.4.3" }, "peerDependencies": { "expo": "*", @@ -3558,9 +4667,9 @@ } }, "node_modules/expo-font": { - "version": "57.0.0", - "resolved": "https://registry.npmjs.org/expo-font/-/expo-font-57.0.0.tgz", - "integrity": "sha512-zF+J7WrNFjqyAADwdvDgkFEoIQv9DqcjJ57HVstNEH7/7Tx1ThPEhKraodEQOwSjMYWirP+4BYsVbdb+/Zr4QQ==", + "version": "57.0.3", + "resolved": "https://registry.npmjs.org/expo-font/-/expo-font-57.0.3.tgz", + "integrity": "sha512-kiVUnc2A8vAvO2FfDJTsQa5BwmY+PAkof/1wRb5MOkcX1jtiaSTwz9gCUAyscMBFLundZDmZrLy1P7LZVC+NvA==", "license": "MIT", "peer": true, "dependencies": { @@ -3573,9 +4682,9 @@ } }, "node_modules/expo-keep-awake": { - "version": "57.0.0", - "resolved": "https://registry.npmjs.org/expo-keep-awake/-/expo-keep-awake-57.0.0.tgz", - "integrity": "sha512-WqEoyDNSmUeAI9Gu7UaWKDjOhfaV+jGcms7N0hh/EAr7sqJrI2s0HpLSC3P9cWfXFUZCL1zZjd22m/NbsJYCKg==", + "version": "57.0.1", + "resolved": "https://registry.npmjs.org/expo-keep-awake/-/expo-keep-awake-57.0.1.tgz", + "integrity": "sha512-28lkFImeXTS+bhAjuCFV7w7tW5bXg27BJVrxv+nC/nyYa86qEa0oFeHwqol6ha5k4pdVDQgBF09GM4A1k76Ssg==", "license": "MIT", "peer": true, "peerDependencies": { @@ -3584,13 +4693,13 @@ } }, "node_modules/expo-modules-autolinking": { - "version": "57.0.5", - "resolved": "https://registry.npmjs.org/expo-modules-autolinking/-/expo-modules-autolinking-57.0.5.tgz", - "integrity": "sha512-Vv2PVeEUN0/VW19ItkVA8LxAuH8SV8cjui0MKhJxCKrNyCAGGZU6sRsBJciYXR4uVxuXWKiepGW6E3k/c+Ytdg==", + "version": "57.0.12", + "resolved": "https://registry.npmjs.org/expo-modules-autolinking/-/expo-modules-autolinking-57.0.12.tgz", + "integrity": "sha512-Q8KAlq37nLKsQ+HsS9NpQVpd5jCgqtu694TDUNHBUBpV9ViD82mRBh8Uug/h68RG9xnLS+kuL4nYaCuFRghHjg==", "license": "MIT", "peer": true, "dependencies": { - "@expo/require-utils": "^57.0.1", + "@expo/require-utils": "^57.0.5", "@expo/spawn-async": "^1.8.0", "chalk": "^4.1.0", "commander": "^7.2.0" @@ -3600,14 +4709,14 @@ } }, "node_modules/expo-modules-core": { - "version": "57.0.3", - "resolved": "https://registry.npmjs.org/expo-modules-core/-/expo-modules-core-57.0.3.tgz", - "integrity": "sha512-fuD3DjPQvdaldtCJm2erV2/trPMrDJvEwPdz0RuxAQnduiNwZ3yxBoi81ZEKC5GBSJauMo53YXSwogsFagjwFQ==", + "version": "57.0.16", + "resolved": "https://registry.npmjs.org/expo-modules-core/-/expo-modules-core-57.0.16.tgz", + "integrity": "sha512-vPbxDOdvG6Ucpws5ucdbQa+nNmdxKONS1fTg92sy0p4TnHX8hBiExtbrtUA/5+1t3FRCUuiy29/1nJEGdt3E4A==", "license": "MIT", "peer": true, "dependencies": { - "@expo/expo-modules-macros-plugin": "0.3.0", - "expo-modules-jsi": "~57.0.1", + "@expo/expo-modules-macros-plugin": "0.6.1", + "expo-modules-jsi": "~57.0.8", "invariant": "^2.2.4" }, "peerDependencies": { @@ -3622,9 +4731,9 @@ } }, "node_modules/expo-modules-jsi": { - "version": "57.0.1", - "resolved": "https://registry.npmjs.org/expo-modules-jsi/-/expo-modules-jsi-57.0.1.tgz", - "integrity": "sha512-dECN3pOFv+KrQcGrOhJKEBc1/ob7SBjTTYGRB1bc84zmQ65La0FSrAPxpvnEQf8g9giLB5y9RLqwGxHspjXigQ==", + "version": "57.0.8", + "resolved": "https://registry.npmjs.org/expo-modules-jsi/-/expo-modules-jsi-57.0.8.tgz", + "integrity": "sha512-MFwvKP0FXLkEET27KsKvOh/L7Dpu2d00UgzAlmKozJgtI23WTKSyKPxu+EOSs9peSgkHzKI0vQOhWjOseGBMkQ==", "license": "MIT", "peer": true, "peerDependencies": { @@ -3632,9 +4741,9 @@ } }, "node_modules/expo-server": { - "version": "57.0.0", - "resolved": "https://registry.npmjs.org/expo-server/-/expo-server-57.0.0.tgz", - "integrity": "sha512-18byjwFbHVFrGzI4IH1o2MZiiYwvO/y3d+JL3sq50Lg3Id1titwIRMh1fjbHbpM+wP6x14KJY0Ers1UYsjGq8Q==", + "version": "57.0.3", + "resolved": "https://registry.npmjs.org/expo-server/-/expo-server-57.0.3.tgz", + "integrity": "sha512-aK+LdKzauHSGmsOStZtyxdzv0zWssCkxTw3m4QuOhfDSJsZaMRTd9O41d8ixU/QfELTbaJ0oRNcF7JFV/7O9YQ==", "license": "MIT", "peer": true, "engines": { @@ -3642,9 +4751,9 @@ } }, "node_modules/expo/node_modules/expo-file-system": { - "version": "57.0.0", - "resolved": "https://registry.npmjs.org/expo-file-system/-/expo-file-system-57.0.0.tgz", - "integrity": "sha512-G+eytNuNGMiS7dbdj1j0nAYMowXnNr1vpO+jss6nQvBlRxshcGBFMtk8xfc67ynz0MUVkzod7WwKO7Vf1iOaJw==", + "version": "57.0.6", + "resolved": "https://registry.npmjs.org/expo-file-system/-/expo-file-system-57.0.6.tgz", + "integrity": "sha512-pm8PMYEW6BnVOCBJ7df9FcDmQtE1tqImuYphlfYe1ipQRLYtdCayRczJcbKIsnB3mqEyp4gC2gWmMbsAsAOjVg==", "license": "MIT", "peer": true, "peerDependencies": { @@ -3656,13 +4765,36 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/exponential-backoff/-/exponential-backoff-3.1.3.tgz", "integrity": "sha512-ZgEeZXj30q+I0EN+CbSSpIyPaJ5HVQD18Z1m+u1FXbAeT94mr1zw50q4q6jiiC447Nl/YTcIYSAftiGqetwXCA==", - "license": "Apache-2.0" + "license": "Apache-2.0", + "peer": true + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" }, "node_modules/fb-dotslash": { "version": "0.5.8", "resolved": "https://registry.npmjs.org/fb-dotslash/-/fb-dotslash-0.5.8.tgz", "integrity": "sha512-XHYLKk9J4BupDxi9bSEhkfss0m+Vr9ChTrjhf9l2iw3jB5C7BnY4GVPoMcqbrTutsKJso6yj2nAB6BI/F2oZaA==", "license": "(MIT OR Apache-2.0)", + "peer": true, "bin": { "dotslash": "bin/dotslash" }, @@ -3675,6 +4807,7 @@ "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", "license": "Apache-2.0", + "peer": true, "dependencies": { "bser": "2.1.1" } @@ -3703,11 +4836,25 @@ "license": "MIT", "peer": true }, + "node_modules/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, "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==", "license": "MIT", + "peer": true, "dependencies": { "to-regex-range": "^5.0.1" }, @@ -3720,6 +4867,7 @@ "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", "license": "MIT", + "peer": true, "dependencies": { "debug": "2.6.9", "encodeurl": "~1.0.2", @@ -3738,6 +4886,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "license": "MIT", + "peer": true, "dependencies": { "ms": "2.0.0" } @@ -3746,13 +4895,53 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "license": "MIT" + "license": "MIT", + "peer": true + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/flatted": { + "version": "3.4.4", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.4.tgz", + "integrity": "sha512-5+ybhBZANEJxaH3X5evAFatUxLfEHSr7n6kYJ+1Qd0mUqr4eu9gIf6GDbWHf8RJijHrjjO8G+la14SlL2SeS1Q==", + "dev": true, + "license": "ISC" }, "node_modules/flow-enums-runtime": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/flow-enums-runtime/-/flow-enums-runtime-0.0.6.tgz", "integrity": "sha512-3PYnM29RFXwvAN6Pc/scUfkI7RwhQ/xqyLUyPNlXUp9S40zI8nup9tUSrTLSVnWGBN38FNiGWbwZOB6uR4OGdw==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/fontfaceobserver": { "version": "2.3.0", @@ -3766,6 +4955,7 @@ "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", "license": "MIT", + "peer": true, "engines": { "node": ">= 0.6" } @@ -3799,6 +4989,7 @@ "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", "license": "MIT", + "peer": true, "engines": { "node": ">=6.9.0" } @@ -3808,6 +4999,7 @@ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "license": "ISC", + "peer": true, "engines": { "node": "6.* || 8.* || >= 10.*" } @@ -3840,17 +5032,32 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "license": "ISC" + "license": "ISC", + "peer": true }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "license": "MIT", + "peer": true, "engines": { "node": ">=8" } @@ -3868,10 +5075,11 @@ } }, "node_modules/hermes-compiler": { - "version": "250829098.0.14", - "resolved": "https://registry.npmjs.org/hermes-compiler/-/hermes-compiler-250829098.0.14.tgz", - "integrity": "sha512-5meXwsZxgiqFaJjNzwjzI9IyUkuGGBisu+z9BvQWmGVpjH6nz11hgqkyxe4dl8UAdyIV4lTbz91+Dlnjz0VxqA==", - "license": "MIT" + "version": "250829098.0.17", + "resolved": "https://registry.npmjs.org/hermes-compiler/-/hermes-compiler-250829098.0.17.tgz", + "integrity": "sha512-qG1PXzTEtriF6oQLZF3vyHhSMxOdW5h2TqqLri0rdpstPustd2fSvRZQMVAPdlhgFwBfYnj3OUZtiO6LjYsEFw==", + "license": "MIT", + "peer": true }, "node_modules/hermes-estree": { "version": "0.36.1", @@ -3915,6 +5123,7 @@ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", "license": "MIT", + "peer": true, "dependencies": { "depd": "~2.0.0", "inherits": "~2.0.4", @@ -3935,6 +5144,7 @@ "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", "license": "MIT", + "peer": true, "engines": { "node": ">= 0.8" } @@ -3944,6 +5154,7 @@ "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", "license": "MIT", + "peer": true, "dependencies": { "agent-base": "^7.1.2", "debug": "4" @@ -3957,7 +5168,6 @@ "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "license": "MIT", - "peer": true, "engines": { "node": ">= 4" } @@ -3967,6 +5177,7 @@ "resolved": "https://registry.npmjs.org/image-size/-/image-size-1.2.1.tgz", "integrity": "sha512-rH+46sQJ2dlwfjfhCyNx5thzrv+dtmBIhPHk0zgRUukHzZ/kRueTJXoYYsclBaKcSMBWuGbOFXtioLpzTb5euw==", "license": "MIT", + "peer": true, "dependencies": { "queue": "6.0.2" }, @@ -3977,17 +5188,29 @@ "node": ">=16.x" } }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "license": "ISC" + "license": "ISC", + "peer": true }, "node_modules/invariant": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", "license": "MIT", + "peer": true, "dependencies": { "loose-envify": "^1.0.0" } @@ -4012,6 +5235,7 @@ "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", "license": "MIT", + "peer": true, "bin": { "is-docker": "cli.js" }, @@ -4022,20 +5246,45 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "license": "MIT", + "peer": true, "engines": { "node": ">=8" } }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "license": "MIT", + "peer": true, "engines": { "node": ">=0.12.0" } @@ -4045,6 +5294,7 @@ "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", "license": "MIT", + "peer": true, "dependencies": { "is-docker": "^2.0.0" }, @@ -4063,6 +5313,7 @@ "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", "license": "MIT", + "peer": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } @@ -4072,6 +5323,7 @@ "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", "license": "MIT", + "peer": true, "dependencies": { "@jest/types": "^29.6.3", "@types/node": "*", @@ -4089,6 +5341,7 @@ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", "license": "MIT", + "peer": true, "engines": { "node": ">=8.6" }, @@ -4101,6 +5354,7 @@ "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", "license": "MIT", + "peer": true, "dependencies": { "@jest/types": "^29.6.3", "camelcase": "^6.2.0", @@ -4118,6 +5372,7 @@ "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", "license": "MIT", + "peer": true, "dependencies": { "@types/node": "*", "jest-util": "^29.7.0", @@ -4133,6 +5388,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "license": "MIT", + "peer": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -4154,12 +5410,13 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/js-yaml": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.0.tgz", - "integrity": "sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.2.tgz", + "integrity": "sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA==", "funding": [ { "type": "github", @@ -4183,13 +5440,15 @@ "version": "0.2.4", "resolved": "https://registry.npmjs.org/jsc-safe-url/-/jsc-safe-url-0.2.4.tgz", "integrity": "sha512-0wM3YBWtYePOjfyXQH5MWQ8H7sdk5EXSwZvmSLKk2RboVQ2Bu239jycHDz5J/8Blf3K0Qnoy2b6xD+z10MFB+Q==", - "license": "0BSD" + "license": "0BSD", + "peer": true }, "node_modules/jsesc": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", "license": "MIT", + "peer": true, "bin": { "jsesc": "bin/jsesc" }, @@ -4206,11 +5465,33 @@ "bignumber.js": "^9.0.0" } }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, "node_modules/json5": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "license": "MIT", + "peer": true, "bin": { "json5": "lib/cli.js" }, @@ -4218,6 +5499,16 @@ "node": ">=6" } }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, "node_modules/kleur": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", @@ -4243,15 +5534,31 @@ "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", "license": "MIT", + "peer": true, "engines": { "node": ">=6" } }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/lighthouse-logger": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/lighthouse-logger/-/lighthouse-logger-1.4.2.tgz", "integrity": "sha512-gPWxznF6TKmUHrOQjlVo2UbaL2EJ71mb2CCeRs/2qBpi4L/g4LUVc9+3lKQ6DTUZwJswfM7ainGrLO1+fOqa2g==", "license": "Apache-2.0", + "peer": true, "dependencies": { "debug": "^2.6.9", "marky": "^1.2.2" @@ -4262,6 +5569,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "license": "MIT", + "peer": true, "dependencies": { "ms": "2.0.0" } @@ -4270,12 +5578,13 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/lightningcss": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.32.0.tgz", - "integrity": "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==", + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.33.0.tgz", + "integrity": "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==", "license": "MPL-2.0", "peer": true, "dependencies": { @@ -4289,23 +5598,23 @@ "url": "https://opencollective.com/parcel" }, "optionalDependencies": { - "lightningcss-android-arm64": "1.32.0", - "lightningcss-darwin-arm64": "1.32.0", - "lightningcss-darwin-x64": "1.32.0", - "lightningcss-freebsd-x64": "1.32.0", - "lightningcss-linux-arm-gnueabihf": "1.32.0", - "lightningcss-linux-arm64-gnu": "1.32.0", - "lightningcss-linux-arm64-musl": "1.32.0", - "lightningcss-linux-x64-gnu": "1.32.0", - "lightningcss-linux-x64-musl": "1.32.0", - "lightningcss-win32-arm64-msvc": "1.32.0", - "lightningcss-win32-x64-msvc": "1.32.0" + "lightningcss-android-arm64": "1.33.0", + "lightningcss-darwin-arm64": "1.33.0", + "lightningcss-darwin-x64": "1.33.0", + "lightningcss-freebsd-x64": "1.33.0", + "lightningcss-linux-arm-gnueabihf": "1.33.0", + "lightningcss-linux-arm64-gnu": "1.33.0", + "lightningcss-linux-arm64-musl": "1.33.0", + "lightningcss-linux-x64-gnu": "1.33.0", + "lightningcss-linux-x64-musl": "1.33.0", + "lightningcss-win32-arm64-msvc": "1.33.0", + "lightningcss-win32-x64-msvc": "1.33.0" } }, "node_modules/lightningcss-android-arm64": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.32.0.tgz", - "integrity": "sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==", + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.33.0.tgz", + "integrity": "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==", "cpu": [ "arm64" ], @@ -4324,9 +5633,9 @@ } }, "node_modules/lightningcss-darwin-arm64": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.32.0.tgz", - "integrity": "sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==", + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.33.0.tgz", + "integrity": "sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==", "cpu": [ "arm64" ], @@ -4345,9 +5654,9 @@ } }, "node_modules/lightningcss-darwin-x64": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.32.0.tgz", - "integrity": "sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==", + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.33.0.tgz", + "integrity": "sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==", "cpu": [ "x64" ], @@ -4366,9 +5675,9 @@ } }, "node_modules/lightningcss-freebsd-x64": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.32.0.tgz", - "integrity": "sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==", + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.33.0.tgz", + "integrity": "sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==", "cpu": [ "x64" ], @@ -4387,9 +5696,9 @@ } }, "node_modules/lightningcss-linux-arm-gnueabihf": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.32.0.tgz", - "integrity": "sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==", + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.33.0.tgz", + "integrity": "sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==", "cpu": [ "arm" ], @@ -4408,9 +5717,9 @@ } }, "node_modules/lightningcss-linux-arm64-gnu": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.32.0.tgz", - "integrity": "sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==", + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.33.0.tgz", + "integrity": "sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==", "cpu": [ "arm64" ], @@ -4432,9 +5741,9 @@ } }, "node_modules/lightningcss-linux-arm64-musl": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.32.0.tgz", - "integrity": "sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==", + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.33.0.tgz", + "integrity": "sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==", "cpu": [ "arm64" ], @@ -4456,9 +5765,9 @@ } }, "node_modules/lightningcss-linux-x64-gnu": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.32.0.tgz", - "integrity": "sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==", + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.33.0.tgz", + "integrity": "sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==", "cpu": [ "x64" ], @@ -4480,9 +5789,9 @@ } }, "node_modules/lightningcss-linux-x64-musl": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.32.0.tgz", - "integrity": "sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==", + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.33.0.tgz", + "integrity": "sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==", "cpu": [ "x64" ], @@ -4504,9 +5813,9 @@ } }, "node_modules/lightningcss-win32-arm64-msvc": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.32.0.tgz", - "integrity": "sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==", + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.33.0.tgz", + "integrity": "sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==", "cpu": [ "arm64" ], @@ -4525,9 +5834,9 @@ } }, "node_modules/lightningcss-win32-x64-msvc": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.32.0.tgz", - "integrity": "sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==", + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.33.0.tgz", + "integrity": "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==", "cpu": [ "x64" ], @@ -4545,6 +5854,22 @@ "url": "https://opencollective.com/parcel" } }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/lodash.debounce": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", @@ -4556,7 +5881,8 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", "integrity": "sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/log-symbols": { "version": "2.2.0", @@ -4654,6 +5980,7 @@ "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", "license": "MIT", + "peer": true, "dependencies": { "js-tokens": "^3.0.0 || ^4.0.0" }, @@ -4666,6 +5993,7 @@ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "license": "ISC", + "peer": true, "dependencies": { "yallist": "^3.0.2" } @@ -4675,6 +6003,7 @@ "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", "license": "BSD-3-Clause", + "peer": true, "dependencies": { "tmpl": "1.0.5" } @@ -4683,25 +6012,29 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/marky/-/marky-1.3.0.tgz", "integrity": "sha512-ocnPZQLNpvbedwTy9kNrQEsknEfgvcLMvOtz3sFeWApDq1MXH1TqkCIx58xlpESsfwQOnuBO9beyQuNGzVvuhQ==", - "license": "Apache-2.0" + "license": "Apache-2.0", + "peer": true }, "node_modules/memoize-one": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-5.2.1.tgz", "integrity": "sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/metro": { - "version": "0.84.4", - "resolved": "https://registry.npmjs.org/metro/-/metro-0.84.4.tgz", - "integrity": "sha512-8ETTubqfD6ornDy2zYDvRcKnVDOXdFJsjetYDBsY4oAsb6NJkiwFR+FaMESyGppFmQUyBQA4H4sFGxzcQSGtFA==", + "version": "0.84.5", + "resolved": "https://registry.npmjs.org/metro/-/metro-0.84.5.tgz", + "integrity": "sha512-r1liLkyFZMVSEMNjU1CJU5pRzs3NdkxHqXS60O25c0rCIqAR+cGk7rPydw/g0WAIKVXojIBIF45yYBPagJGcgw==", "license": "MIT", + "peer": true, "dependencies": { "@babel/code-frame": "^7.29.0", "@babel/core": "^7.25.2", @@ -4718,23 +6051,22 @@ "flow-enums-runtime": "^0.0.6", "graceful-fs": "^4.2.4", "hermes-parser": "0.35.0", - "image-size": "^1.0.2", "invariant": "^2.2.4", "jest-worker": "^29.7.0", "jsc-safe-url": "^0.2.2", "lodash.throttle": "^4.1.1", - "metro-babel-transformer": "0.84.4", - "metro-cache": "0.84.4", - "metro-cache-key": "0.84.4", - "metro-config": "0.84.4", - "metro-core": "0.84.4", - "metro-file-map": "0.84.4", - "metro-resolver": "0.84.4", - "metro-runtime": "0.84.4", - "metro-source-map": "0.84.4", - "metro-symbolicate": "0.84.4", - "metro-transform-plugins": "0.84.4", - "metro-transform-worker": "0.84.4", + "metro-babel-transformer": "0.84.5", + "metro-cache": "0.84.5", + "metro-cache-key": "0.84.5", + "metro-config": "0.84.5", + "metro-core": "0.84.5", + "metro-file-map": "0.84.5", + "metro-resolver": "0.84.5", + "metro-runtime": "0.84.5", + "metro-source-map": "0.84.5", + "metro-symbolicate": "0.84.5", + "metro-transform-plugins": "0.84.5", + "metro-transform-worker": "0.84.5", "mime-types": "^3.0.1", "nullthrows": "^1.1.1", "serialize-error": "^2.1.0", @@ -4751,15 +6083,16 @@ } }, "node_modules/metro-babel-transformer": { - "version": "0.84.4", - "resolved": "https://registry.npmjs.org/metro-babel-transformer/-/metro-babel-transformer-0.84.4.tgz", - "integrity": "sha512-rvCfz8snl9h20VcvpOHxZuHP1SlAkv4HXbzw7nyyVwu6Eqo5PRerbakQ9XmUCOsRy70spJ37O+G1TK8oMzo48g==", + "version": "0.84.5", + "resolved": "https://registry.npmjs.org/metro-babel-transformer/-/metro-babel-transformer-0.84.5.tgz", + "integrity": "sha512-2WbHILKMiJUzfdjmGOQOqU1bWi9//gqiclc/tkk/AIsrrVw3efhZ1uhkOwMTxUEPOzqoo091H0olLmVZH5FHGQ==", "license": "MIT", + "peer": true, "dependencies": { "@babel/core": "^7.25.2", "flow-enums-runtime": "^0.0.6", "hermes-parser": "0.35.0", - "metro-cache-key": "0.84.4", + "metro-cache-key": "0.84.5", "nullthrows": "^1.1.1" }, "engines": { @@ -4770,37 +6103,41 @@ "version": "0.35.0", "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.35.0.tgz", "integrity": "sha512-xVx5Opwy8Oo1I5yGpVRhCvWL/iV3M+ylksSKVNlxxD90cpDpR/AR1jLYqK8HWihm065a6UI3HeyAmYzwS8NOOg==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/metro-babel-transformer/node_modules/hermes-parser": { "version": "0.35.0", "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.35.0.tgz", "integrity": "sha512-9JLjeHxBx8T4CAsydZR49PNZUaix+WpQJwu9p2010lu+7Kwl6D/7wYFFJxoz+aXkaaClp9Zfg6W6/zVlSJORaA==", "license": "MIT", + "peer": true, "dependencies": { "hermes-estree": "0.35.0" } }, "node_modules/metro-cache": { - "version": "0.84.4", - "resolved": "https://registry.npmjs.org/metro-cache/-/metro-cache-0.84.4.tgz", - "integrity": "sha512-gpcFQdSLUwUCk71saKoE64jLFbx2nwTfVCcPSULMNT8QYq0p1eZZE29Jvd0HtT/UlhC3ZOutLxJME5xqD2JUZg==", + "version": "0.84.5", + "resolved": "https://registry.npmjs.org/metro-cache/-/metro-cache-0.84.5.tgz", + "integrity": "sha512-WHS0n2OxQqtwEjSeQFPePNrMvEFhmQcUQM9cRJMHByWoi/GMWFBEWOf7hVkAM/0KRutAXNbDlSu/cZB6CyxgQQ==", "license": "MIT", + "peer": true, "dependencies": { "exponential-backoff": "^3.1.1", "flow-enums-runtime": "^0.0.6", "https-proxy-agent": "^7.0.5", - "metro-core": "0.84.4" + "metro-core": "0.84.5" }, "engines": { "node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0" } }, "node_modules/metro-cache-key": { - "version": "0.84.4", - "resolved": "https://registry.npmjs.org/metro-cache-key/-/metro-cache-key-0.84.4.tgz", - "integrity": "sha512-wVO79aGrkYImpnaVS4+d5RrRBRPX31QtvKB3wKGBuiNSznduZTQHzsrJZRroFJSwnygrzdsGUtDQPuqqFjFdvw==", + "version": "0.84.5", + "resolved": "https://registry.npmjs.org/metro-cache-key/-/metro-cache-key-0.84.5.tgz", + "integrity": "sha512-3dPB2TnvGjjf0/9O7AXVQURKXuQNauTZE7WpTGTlR017Gh/B5y0m/2wcqxfveUguHSpu89KhVxCAlr2k/H7uhQ==", "license": "MIT", + "peer": true, "dependencies": { "flow-enums-runtime": "^0.0.6" }, @@ -4809,18 +6146,19 @@ } }, "node_modules/metro-config": { - "version": "0.84.4", - "resolved": "https://registry.npmjs.org/metro-config/-/metro-config-0.84.4.tgz", - "integrity": "sha512-PMotGDjXcXLWo2TMRH+VR99phFNgYTwqh4OoieIKK3yTJa1Jmkl+fZJxDO0jfBvNF+WESHciHvpNuBtXaF3B0Q==", + "version": "0.84.5", + "resolved": "https://registry.npmjs.org/metro-config/-/metro-config-0.84.5.tgz", + "integrity": "sha512-zie+uN6oohscowi2S7ByU+wUw6CrT4ZxW9uAbONOObSxx86RGmnIAmjXHLkfmcdYoY7jzOPEbqcI6oeVmqyBQA==", "license": "MIT", + "peer": true, "dependencies": { "connect": "^3.6.5", "flow-enums-runtime": "^0.0.6", "jest-validate": "^29.7.0", - "metro": "0.84.4", - "metro-cache": "0.84.4", - "metro-core": "0.84.4", - "metro-runtime": "0.84.4", + "metro": "0.84.5", + "metro-cache": "0.84.5", + "metro-core": "0.84.5", + "metro-runtime": "0.84.5", "yaml": "^2.6.1" }, "engines": { @@ -4828,24 +6166,26 @@ } }, "node_modules/metro-core": { - "version": "0.84.4", - "resolved": "https://registry.npmjs.org/metro-core/-/metro-core-0.84.4.tgz", - "integrity": "sha512-HONpWC5LGXZn3ffkd4Hu6AIrfE7j4Z0g0wMo/goV24WOB3lhuFZ40KgvaDiSw8iyQHloMYay5N/wPX+z8oN/PQ==", + "version": "0.84.5", + "resolved": "https://registry.npmjs.org/metro-core/-/metro-core-0.84.5.tgz", + "integrity": "sha512-xwm605hCi5Y6eJTTb8ZWo6pkUcoBEIyiQOfkZh5GwtDwUrP9SNhTQZhzJHrBCwwxlf3Ptl/pxWJgQ1rsNYMnrA==", "license": "MIT", + "peer": true, "dependencies": { "flow-enums-runtime": "^0.0.6", "lodash.throttle": "^4.1.1", - "metro-resolver": "0.84.4" + "metro-resolver": "0.84.5" }, "engines": { "node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0" } }, "node_modules/metro-file-map": { - "version": "0.84.4", - "resolved": "https://registry.npmjs.org/metro-file-map/-/metro-file-map-0.84.4.tgz", - "integrity": "sha512-KSVDi/u60hKPx++NLu3MTIvyjzNoJnFAF8PQFxaj1jiSka/wjw+Ua6sNuJ0TDHQv+7AAoFQxeMgaRAe8Yic5wQ==", + "version": "0.84.5", + "resolved": "https://registry.npmjs.org/metro-file-map/-/metro-file-map-0.84.5.tgz", + "integrity": "sha512-mlm/JL8toSbSc2akpKIGmzvrVRSCgZ5vkbycI34oMLoOnLGuLyC8WTyVJ6P0hZG/usDaGwZSl/s9BCRriqjGJA==", "license": "MIT", + "peer": true, "dependencies": { "debug": "^4.4.0", "fb-watchman": "^2.0.0", @@ -4862,10 +6202,11 @@ } }, "node_modules/metro-minify-terser": { - "version": "0.84.4", - "resolved": "https://registry.npmjs.org/metro-minify-terser/-/metro-minify-terser-0.84.4.tgz", - "integrity": "sha512-5qpbaVOMC7CPitIpuewzVeGw7E+C3ykbv2mqTjQLl85Z3annSVGlSCTcsZjqXZzjupfK4Ztj3dDc4kc44NZwtQ==", + "version": "0.84.5", + "resolved": "https://registry.npmjs.org/metro-minify-terser/-/metro-minify-terser-0.84.5.tgz", + "integrity": "sha512-BJoFwCEDsYnagPqarayInv2+diCDNDdLlaof/p6s9w4gh+gc9HXYM+pDvsKGKKUumpZswNF3Z/ftTMqKl/5IBg==", "license": "MIT", + "peer": true, "dependencies": { "flow-enums-runtime": "^0.0.6", "terser": "^5.15.0" @@ -4875,10 +6216,11 @@ } }, "node_modules/metro-resolver": { - "version": "0.84.4", - "resolved": "https://registry.npmjs.org/metro-resolver/-/metro-resolver-0.84.4.tgz", - "integrity": "sha512-1qLgbxQ5ZGhhutuPot1Yp348ofDsATL2WkrHF65TobqTT9K3P9qJXw38bomk7ncp5B7OYMfWwtyBZo1lCV792A==", + "version": "0.84.5", + "resolved": "https://registry.npmjs.org/metro-resolver/-/metro-resolver-0.84.5.tgz", + "integrity": "sha512-VSSnepg1k6LyCwtb6eirWdAWlpKwBG8Rdtsr1mU38rMelFyWgh3/QuMSiZIZAIjwg/fsa8GhW5/FO54CAUPCEA==", "license": "MIT", + "peer": true, "dependencies": { "flow-enums-runtime": "^0.0.6" }, @@ -4887,10 +6229,11 @@ } }, "node_modules/metro-runtime": { - "version": "0.84.4", - "resolved": "https://registry.npmjs.org/metro-runtime/-/metro-runtime-0.84.4.tgz", - "integrity": "sha512-Jibypds4g7AhzdRKY+kDoj51s5EXMwgyp5ddtlreDAsWefMdOx+agWqgm0H2XSZ/ueanHHVM89fnf5OJnlxa8Q==", + "version": "0.84.5", + "resolved": "https://registry.npmjs.org/metro-runtime/-/metro-runtime-0.84.5.tgz", + "integrity": "sha512-U1m2+d1Pr+JO2/iVXBB2OfXXityz7tqwIorxfrT15IEgaHvpJBq/OHiqnOWPKJbUl3JcxjcdviZZOKk85oK4Qg==", "license": "MIT", + "peer": true, "dependencies": { "@babel/runtime": "^7.25.0", "flow-enums-runtime": "^0.0.6" @@ -4900,18 +6243,19 @@ } }, "node_modules/metro-source-map": { - "version": "0.84.4", - "resolved": "https://registry.npmjs.org/metro-source-map/-/metro-source-map-0.84.4.tgz", - "integrity": "sha512-jbWkPxIesVuo1IWkvezmMJld6iu8nD62GsrZiV6jP37AOdbo4OBq1FJ+qkOg8sV05wAHB//jAbziuW0SlJfW4g==", + "version": "0.84.5", + "resolved": "https://registry.npmjs.org/metro-source-map/-/metro-source-map-0.84.5.tgz", + "integrity": "sha512-2BtV5L9uPc49F13Gn5wiP6bX/EncqzqTIk2VL/0F/96Vo0YEOjluT/qktQjFODfqGFsucwnh5mPEAl/2jVEfeg==", "license": "MIT", + "peer": true, "dependencies": { "@babel/traverse": "^7.29.0", "@babel/types": "^7.29.0", "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", - "metro-symbolicate": "0.84.4", + "metro-symbolicate": "0.84.5", "nullthrows": "^1.1.1", - "ob1": "0.84.4", + "ob1": "0.84.5", "source-map": "^0.5.6", "vlq": "^1.0.0" }, @@ -4920,14 +6264,15 @@ } }, "node_modules/metro-symbolicate": { - "version": "0.84.4", - "resolved": "https://registry.npmjs.org/metro-symbolicate/-/metro-symbolicate-0.84.4.tgz", - "integrity": "sha512-OnfpacxUqGPZQ27t8qK9mFa7uqHIlVWeqRqkCbvMvreEBiamEeOn8krKtcwgP5M4cYDPwuSmCTopHMVthqG4zA==", + "version": "0.84.5", + "resolved": "https://registry.npmjs.org/metro-symbolicate/-/metro-symbolicate-0.84.5.tgz", + "integrity": "sha512-rQ40zYDAkaWBN9yvjUuAD0ZpzBMZSoKyGYXnb5JrfbKjun7fTvfoLHL3KXFYenBTYZkQtlp4cKSCv/1utxFyOw==", "license": "MIT", + "peer": true, "dependencies": { "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", - "metro-source-map": "0.84.4", + "metro-source-map": "0.84.5", "nullthrows": "^1.1.1", "source-map": "^0.5.6", "vlq": "^1.0.0" @@ -4940,10 +6285,11 @@ } }, "node_modules/metro-transform-plugins": { - "version": "0.84.4", - "resolved": "https://registry.npmjs.org/metro-transform-plugins/-/metro-transform-plugins-0.84.4.tgz", - "integrity": "sha512-kehr6HbAecqD0/a3xLXobELdPaAmRAl8bel0qagPF4vhZtux93nS8S4eq2kgKt6J2GnQpVjSoW1PXdst04mwow==", + "version": "0.84.5", + "resolved": "https://registry.npmjs.org/metro-transform-plugins/-/metro-transform-plugins-0.84.5.tgz", + "integrity": "sha512-+InaSVGaOyt0DyRo4Y/zIdPI6CZwnbNho5LAL23tgmuGwv7fyfkF7kKfPjZcfxXBcoYdTLLFnCfCH/dHSiCqNg==", "license": "MIT", + "peer": true, "dependencies": { "@babel/core": "^7.25.2", "@babel/generator": "^7.29.1", @@ -4957,23 +6303,24 @@ } }, "node_modules/metro-transform-worker": { - "version": "0.84.4", - "resolved": "https://registry.npmjs.org/metro-transform-worker/-/metro-transform-worker-0.84.4.tgz", - "integrity": "sha512-W1IYMvvXTu4MxYr7d9h7CeG2vpIr3bmLLIavkPY4O1ilzDrvS8z/NEe6y+pC44Ff7raMXQgYSfdqDUwN/i39gg==", + "version": "0.84.5", + "resolved": "https://registry.npmjs.org/metro-transform-worker/-/metro-transform-worker-0.84.5.tgz", + "integrity": "sha512-ui1Z8x4s5RL36gMmKLaMMO7O9NNDHNdthEZSCDQHAau3JcAsTaFOK6I+2q4I/kW5u8hSEjJk9L45TXSVJw6g1A==", "license": "MIT", + "peer": true, "dependencies": { "@babel/core": "^7.25.2", "@babel/generator": "^7.29.1", "@babel/parser": "^7.29.0", "@babel/types": "^7.29.0", "flow-enums-runtime": "^0.0.6", - "metro": "0.84.4", - "metro-babel-transformer": "0.84.4", - "metro-cache": "0.84.4", - "metro-cache-key": "0.84.4", - "metro-minify-terser": "0.84.4", - "metro-source-map": "0.84.4", - "metro-transform-plugins": "0.84.4", + "metro": "0.84.5", + "metro-babel-transformer": "0.84.5", + "metro-cache": "0.84.5", + "metro-cache-key": "0.84.5", + "metro-minify-terser": "0.84.5", + "metro-source-map": "0.84.5", + "metro-transform-plugins": "0.84.5", "nullthrows": "^1.1.1" }, "engines": { @@ -4985,6 +6332,7 @@ "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", "license": "MIT", + "peer": true, "dependencies": { "mime-types": "^3.0.0", "negotiator": "^1.0.0" @@ -4997,19 +6345,22 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/metro/node_modules/hermes-estree": { "version": "0.35.0", "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.35.0.tgz", "integrity": "sha512-xVx5Opwy8Oo1I5yGpVRhCvWL/iV3M+ylksSKVNlxxD90cpDpR/AR1jLYqK8HWihm065a6UI3HeyAmYzwS8NOOg==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/metro/node_modules/hermes-parser": { "version": "0.35.0", "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.35.0.tgz", "integrity": "sha512-9JLjeHxBx8T4CAsydZR49PNZUaix+WpQJwu9p2010lu+7Kwl6D/7wYFFJxoz+aXkaaClp9Zfg6W6/zVlSJORaA==", "license": "MIT", + "peer": true, "dependencies": { "hermes-estree": "0.35.0" } @@ -5019,6 +6370,7 @@ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz", "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==", "license": "MIT", + "peer": true, "dependencies": { "mime-db": "^1.54.0" }, @@ -5031,12 +6383,20 @@ } }, "node_modules/metro/node_modules/negotiator": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", - "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.1.0.tgz", + "integrity": "sha512-NMPBRMJgiQHjbd8phG3Vebdx4kZ1H121rbl5IkMqeOsahptB9BKo/d7oJ3zTXqTgagn2bWlNSXkh0QUGM31RYg==", "license": "MIT", + "peer": true, + "dependencies": { + "content-type": "^2.1.0" + }, "engines": { - "node": ">= 0.6" + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, "node_modules/micromatch": { @@ -5044,6 +6404,7 @@ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "license": "MIT", + "peer": true, "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" @@ -5057,6 +6418,7 @@ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", "license": "MIT", + "peer": true, "engines": { "node": ">=8.6" }, @@ -5069,6 +6431,7 @@ "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", "license": "MIT", + "peer": true, "bin": { "mime": "cli.js" }, @@ -5081,6 +6444,7 @@ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", "license": "MIT", + "peer": true, "engines": { "node": ">= 0.6" } @@ -5119,13 +6483,12 @@ } }, "node_modules/minimatch": { - "version": "10.2.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", - "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", + "version": "10.2.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", + "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", "license": "BlueOak-1.0.0", - "peer": true, "dependencies": { - "brace-expansion": "^5.0.5" + "brace-expansion": "^5.0.8" }, "engines": { "node": "18 || 20 || >=22" @@ -5149,6 +6512,7 @@ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", "license": "MIT", + "peer": true, "bin": { "mkdirp": "bin/cmd.js" }, @@ -5163,16 +6527,16 @@ "license": "MIT" }, "node_modules/multitars": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/multitars/-/multitars-1.0.0.tgz", - "integrity": "sha512-H/J4fMLedtudftaYMOg7ajzLYgT3/rwbWVJbqr/iUgB8DQztn38ys5HOqI1CzSxx8QhXXwOOnnBvd4v3jG5+Mg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/multitars/-/multitars-1.0.2.tgz", + "integrity": "sha512-6GwVw5eLi9sThdtlS4PKwC7yRLaf45pYhIEzKBHdKxi+YOXGKFX8acIniH+Uh/+k9mS2lQOupTccjoe5r0/1IQ==", "license": "MIT", "peer": true }, "node_modules/nanoid": { - "version": "3.3.15", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.15.tgz", - "integrity": "sha512-y7Wygv/7mEOvxTuEQDB8StXdMRBWf1kR/tlhAzBRUFkB2jfcLOAxO/SHmOO2zgz1pVgK29/kyupn059/bCHdjA==", + "version": "3.3.18", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.18.tgz", + "integrity": "sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w==", "funding": [ { "type": "github", @@ -5188,6 +6552,13 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, "node_modules/negotiator": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", @@ -5212,13 +6583,15 @@ "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/node-releases": { - "version": "2.0.51", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.51.tgz", - "integrity": "sha512-wRNIrw4DmVLKQlbgOMdkMx27Wrpzes2hh5Jtbi2bjPd+4wJstWIqP5A+lscnqbm0xxmT5Bpg8Lec5ItEBwx6BQ==", + "version": "2.0.54", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.54.tgz", + "integrity": "sha512-YHs7BmmcsdAI5Ozuf8JZo6PT0mv2GIWC9vMfvUC3dp65M8hn7Ux8CPL+2oBI7juNuj9d0ndhTcznq2ODBps9cQ==", "license": "MIT", + "peer": true, "engines": { "node": ">=18" } @@ -5243,13 +6616,15 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/nullthrows/-/nullthrows-1.1.1.tgz", "integrity": "sha512-2vPPEi+Z7WqML2jZYddDIfy5Dqb0r2fze2zTxNNknZaFpVHU3mFB3R+DWeJWGVx0ecvttSGlJTI+WG+8Z4cDWw==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/ob1": { - "version": "0.84.4", - "resolved": "https://registry.npmjs.org/ob1/-/ob1-0.84.4.tgz", - "integrity": "sha512-eJXMpz4aQHXF/YBB9ddqZDIS+ooO91hObo9FoW/xBkr54/zCwYYCDqT/O54vNo8kOkWs5Ou/y28NgdrV0edQNA==", + "version": "0.84.5", + "resolved": "https://registry.npmjs.org/ob1/-/ob1-0.84.5.tgz", + "integrity": "sha512-aH9RkoZc7w/90HBamFxTw8ZLFr05wXS+iOnvmrgo53Ep8Pyrm5FieQSaPIVROkfFVQISeD/zo92fes26TOwe+A==", "license": "MIT", + "peer": true, "dependencies": { "flow-enums-runtime": "^0.0.6" }, @@ -5262,6 +6637,7 @@ "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==", "license": "MIT", + "peer": true, "dependencies": { "ee-first": "1.1.1" }, @@ -5297,6 +6673,7 @@ "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz", "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==", "license": "MIT", + "peer": true, "dependencies": { "is-docker": "^2.0.0", "is-wsl": "^2.1.1" @@ -5308,6 +6685,24 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/ora": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/ora/-/ora-3.4.0.tgz", @@ -5398,10 +6793,42 @@ "license": "MIT", "peer": true, "dependencies": { - "has-flag": "^3.0.0" + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" }, "engines": { - "node": ">=4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/parse-png": { @@ -5422,10 +6849,21 @@ "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", "license": "MIT", + "peer": true, "engines": { "node": ">= 0.8" } }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/path-is-inside": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", @@ -5486,12 +6924,13 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", - "license": "ISC" + "license": "ISC", + "peer": true }, "node_modules/picomatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", - "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", "license": "MIT", "engines": { "node": ">=12" @@ -5558,9 +6997,9 @@ } }, "node_modules/postcss": { - "version": "8.5.16", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.16.tgz", - "integrity": "sha512-vuwillviilfKZsg0VGj5R/YwwcHx4SLsIOI/7K6mQkWx+l5cUHTjj5g0AasTBcyXsbfTgrwsUNmVUb5xVwyPwg==", + "version": "8.5.28", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.28.tgz", + "integrity": "sha512-RRuzqDtt5Y9h3quz5hWhK+TPnsmVs6WwSU6LkJMeY4HstUEDuYTG8UJSdawMRzmzAtV+KEoG8N3Qg2qLy5vM/A==", "funding": [ { "type": "opencollective", @@ -5578,7 +7017,7 @@ "license": "MIT", "peer": true, "dependencies": { - "nanoid": "^3.3.12", + "nanoid": "^3.3.18", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" }, @@ -5586,11 +7025,38 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "3.9.6", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.6.tgz", + "integrity": "sha512-OpN0zzVdiaiAhxpuuj5efpIS4sY9j7bY6uR5mnj5yPzGkdkjNKSJeUThPb60Jw29QuAZgA4o+/iB49kFiaBX6g==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "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==", "license": "MIT", + "peer": true, "dependencies": { "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", @@ -5605,6 +7071,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", "license": "MIT", + "peer": true, "engines": { "node": ">=10" }, @@ -5637,6 +7104,7 @@ "resolved": "https://registry.npmjs.org/promise/-/promise-8.3.0.tgz", "integrity": "sha512-rZPNPKTOYVNEEKFaq1HqTgOwZD+4/YHS5ukLzQCypkj+OkYx7iv0mA91lJlpPPZ8vMau3IIGj5Qlwrx+8iiSmg==", "license": "MIT", + "peer": true, "dependencies": { "asap": "~2.0.6" } @@ -5655,11 +7123,22 @@ "node": ">= 6" } }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/queue": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/queue/-/queue-6.0.2.tgz", "integrity": "sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA==", "license": "MIT", + "peer": true, "dependencies": { "inherits": "~2.0.3" } @@ -5669,14 +7148,15 @@ "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", "license": "MIT", + "peer": true, "engines": { "node": ">= 0.6" } }, "node_modules/react": { - "version": "19.2.7", - "resolved": "https://registry.npmjs.org/react/-/react-19.2.7.tgz", - "integrity": "sha512-HNe9WslTbXmFK8o8cmwgAeJFSBvt1bPdHCVKtaaV+WlAN36mpT4hcRpwbf3fY56ar2oIXzsBpOAiIRHAdY0OlQ==", + "version": "19.2.8", + "resolved": "https://registry.npmjs.org/react/-/react-19.2.8.tgz", + "integrity": "sha512-PWaYA1L/q9u2u7xYQi+Y3L3Yfnie7XyLeaJICV1MGD6LprsBxcAqGjYyr0eY3p+QdsA+x/Irkt4Qif8D63+Sbw==", "license": "MIT", "peer": true, "engines": { @@ -5688,6 +7168,7 @@ "resolved": "https://registry.npmjs.org/react-devtools-core/-/react-devtools-core-6.1.5.tgz", "integrity": "sha512-ePrwPfxAnB+7hgnEr8vpKxL9cmnp7F322t8oqcPshbIQQhDKgFDW4tjhF2wjVbdXF9O/nyuy3sQWd9JGpiLPvA==", "license": "MIT", + "peer": true, "dependencies": { "shell-quote": "^1.6.1", "ws": "^7" @@ -5697,33 +7178,33 @@ "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==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/react-native": { - "version": "0.86.0", - "resolved": "https://registry.npmjs.org/react-native/-/react-native-0.86.0.tgz", - "integrity": "sha512-17ALh/dd6AO4pgOVmOO5Axll5PbErEo3XFyLokyzW6usyi+OShIEPwUW26wLPlhVifgSOIfECCH0WN+0IqtJ1w==", - "license": "MIT", - "dependencies": { - "@react-native/assets-registry": "0.86.0", - "@react-native/codegen": "0.86.0", - "@react-native/community-cli-plugin": "0.86.0", - "@react-native/gradle-plugin": "0.86.0", - "@react-native/js-polyfills": "0.86.0", - "@react-native/normalize-colors": "0.86.0", - "@react-native/virtualized-lists": "0.86.0", - "abort-controller": "^3.0.0", + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/react-native/-/react-native-0.87.1.tgz", + "integrity": "sha512-DJKG6ANoD7BtrE4z9DewiSD7/RxCX73lK5Pu49aUr85P3333Dm2roTiP0rRjQNDZdVizHSOmstWfwF/o9EjCRA==", + "license": "MIT", + "peer": true, + "dependencies": { + "@react-native/asset-utils": "0.87.1", + "@react-native/codegen": "0.87.1", + "@react-native/community-cli-plugin": "0.87.1", + "@react-native/gradle-plugin": "0.87.1", + "@react-native/normalize-colors": "0.87.1", + "@react-native/virtualized-lists": "0.87.1", "anser": "^1.4.9", "ansi-regex": "^5.0.0", - "babel-plugin-syntax-hermes-parser": "0.36.0", + "babel-plugin-syntax-hermes-parser": "0.36.1", "base64-js": "^1.5.1", "commander": "^12.0.0", "flow-enums-runtime": "^0.0.6", - "hermes-compiler": "250829098.0.14", + "hermes-compiler": "250829098.0.17", "invariant": "^2.2.4", "memoize-one": "^5.0.0", - "metro-runtime": "^0.84.3", - "metro-source-map": "^0.84.3", + "metro-runtime": "^0.87.0", + "metro-source-map": "^0.87.0", "nullthrows": "^1.1.1", "pretty-format": "^29.7.0", "promise": "^8.3.0", @@ -5742,53 +7223,124 @@ "react-native": "cli.js" }, "engines": { - "node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0" + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" }, "peerDependencies": { - "@react-native/jest-preset": "0.86.0", "@types/react": "^19.1.1", "react": "^19.2.3" }, "peerDependenciesMeta": { - "@react-native/jest-preset": { - "optional": true - }, "@types/react": { "optional": true } } }, - "node_modules/react-native/node_modules/babel-plugin-syntax-hermes-parser": { - "version": "0.36.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-hermes-parser/-/babel-plugin-syntax-hermes-parser-0.36.0.tgz", - "integrity": "sha512-LhD0xdoedDw7ansQgXbB2DADLZIK/LRXuWNBPuVzMc5S2WK5GyT89tCM+cQzxFGO0mGyLK6D5TrVOJJzAoDy8Q==", + "node_modules/react-native/node_modules/@react-native/codegen": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/@react-native/codegen/-/codegen-0.87.1.tgz", + "integrity": "sha512-qbaqEdlUfj2vRgvWTpMoNgHnEqAhAYJLUrpGkb0WC9n0kdtqUvgigpz4bDktZwolM9BemXwgGFgyiAnbs3t0xw==", "license": "MIT", + "peer": true, "dependencies": { - "hermes-parser": "0.36.0" + "@babel/core": "^7.25.2", + "@babel/parser": "^7.29.0", + "hermes-parser": "0.36.1", + "invariant": "^2.2.4", + "nullthrows": "^1.1.1", + "tinyglobby": "^0.2.15", + "yargs": "^17.6.2" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + }, + "peerDependencies": { + "@babel/core": "*" } }, + "node_modules/react-native/node_modules/@react-native/normalize-colors": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/@react-native/normalize-colors/-/normalize-colors-0.87.1.tgz", + "integrity": "sha512-8+AutemzX+a7cuKgTUyb7JUk3sFYgLyrSnlTLrL6LuW/LKDE+FYE8lJGWYhJPJcE51Ge1D8yRzxgQEdEFZtuIw==", + "license": "MIT", + "peer": true + }, "node_modules/react-native/node_modules/commander": { "version": "12.1.0", "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", "license": "MIT", + "peer": true, "engines": { "node": ">=18" } }, - "node_modules/react-native/node_modules/hermes-estree": { - "version": "0.36.0", - "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.36.0.tgz", - "integrity": "sha512-A1+8zn5oss2CFP7pKsOaxorQG6FNIz1WU1VDqruLPPZl3LVgeE2C5xfFg8Ow6/Ow4mSslLLtYP1J3n38eKyW9w==", - "license": "MIT" + "node_modules/react-native/node_modules/metro-runtime": { + "version": "0.87.0", + "resolved": "https://registry.npmjs.org/metro-runtime/-/metro-runtime-0.87.0.tgz", + "integrity": "sha512-XsXZkgEwI0ZMYSBfvOMAbenzwa60XlObXJ27g6/Khgrz9ESbiBbAsd7hR62G2jRBYOhGAzG61Gk22dpRJj/mdw==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/runtime": "^7.25.0", + "flow-enums-runtime": "^0.0.6" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } }, - "node_modules/react-native/node_modules/hermes-parser": { - "version": "0.36.0", - "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.36.0.tgz", - "integrity": "sha512-GdpwMmH5x6IpC1cijvcvYnlPB60Mh6kTSF/NFdYV/j56gYdi+0RIakYs+eqOV+bbO0SW7mgVVGSsTJxyPQfo3w==", + "node_modules/react-native/node_modules/metro-source-map": { + "version": "0.87.0", + "resolved": "https://registry.npmjs.org/metro-source-map/-/metro-source-map-0.87.0.tgz", + "integrity": "sha512-31BrYqu1c2co93rF1LN9Pw+7g+BrfDyxJkNQWrYm+pfA/+eVYVumF7tFMHbXLePLmHfhvSgVvbK6su1Oyiw1ng==", "license": "MIT", + "peer": true, "dependencies": { - "hermes-estree": "0.36.0" + "@babel/traverse": "^7.29.0", + "@babel/types": "^7.29.0", + "flow-enums-runtime": "^0.0.6", + "invariant": "^2.2.4", + "metro-symbolicate": "0.87.0", + "nullthrows": "^1.1.1", + "ob1": "0.87.0", + "source-map": "^0.5.6", + "vlq": "^1.0.0" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/react-native/node_modules/metro-symbolicate": { + "version": "0.87.0", + "resolved": "https://registry.npmjs.org/metro-symbolicate/-/metro-symbolicate-0.87.0.tgz", + "integrity": "sha512-uOpTxAXu74N+RSujUZ78L6gjI6bDdnz6XuW+AIUNuubZDEQPIpaX0StzIb0GMeQWP6zfHOHwFrWPP5Iquu1GXw==", + "license": "MIT", + "peer": true, + "dependencies": { + "flow-enums-runtime": "^0.0.6", + "invariant": "^2.2.4", + "metro-source-map": "0.87.0", + "nullthrows": "^1.1.1", + "source-map": "^0.5.6", + "vlq": "^1.0.0" + }, + "bin": { + "metro-symbolicate": "src/index.js" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/react-native/node_modules/ob1": { + "version": "0.87.0", + "resolved": "https://registry.npmjs.org/ob1/-/ob1-0.87.0.tgz", + "integrity": "sha512-8Q8sKCiUwsxgSmjDtVWyRgmxsgeJXXam3oQH6Id8ADfNaJMV6GZKyeAl8+pGVVdgwAZabfk5+aExle7AP/nZiA==", + "license": "MIT", + "peer": true, + "dependencies": { + "flow-enums-runtime": "^0.0.6" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" } }, "node_modules/react-refresh": { @@ -5796,6 +7348,7 @@ "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.2.tgz", "integrity": "sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==", "license": "MIT", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -5824,7 +7377,8 @@ "version": "0.13.11", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/regexpu-core": { "version": "6.4.0", @@ -5869,6 +7423,7 @@ "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "license": "MIT", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -5926,9 +7481,9 @@ } }, "node_modules/rollup": { - "version": "4.62.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.62.2.tgz", - "integrity": "sha512-RFnrW4lhXA3s3eqHDZvN654g8OTjzRfqpIRJYczCGB6HzphckVAi/Qh4tbPUbRuDi7s1Llv8g/NspLkttY3gTA==", + "version": "4.63.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.63.1.tgz", + "integrity": "sha512-3Df9jsstwhccuEfmAMi9l8XUh/GOkVObmFTU7CCVBysEbcOZLl84jCtaAZMcPiMz2EGKsATzQcU+Xr3n/wU6cg==", "dev": true, "license": "MIT", "dependencies": { @@ -5942,31 +7497,32 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.62.2", - "@rollup/rollup-android-arm64": "4.62.2", - "@rollup/rollup-darwin-arm64": "4.62.2", - "@rollup/rollup-darwin-x64": "4.62.2", - "@rollup/rollup-freebsd-arm64": "4.62.2", - "@rollup/rollup-freebsd-x64": "4.62.2", - "@rollup/rollup-linux-arm-gnueabihf": "4.62.2", - "@rollup/rollup-linux-arm-musleabihf": "4.62.2", - "@rollup/rollup-linux-arm64-gnu": "4.62.2", - "@rollup/rollup-linux-arm64-musl": "4.62.2", - "@rollup/rollup-linux-loong64-gnu": "4.62.2", - "@rollup/rollup-linux-loong64-musl": "4.62.2", - "@rollup/rollup-linux-ppc64-gnu": "4.62.2", - "@rollup/rollup-linux-ppc64-musl": "4.62.2", - "@rollup/rollup-linux-riscv64-gnu": "4.62.2", - "@rollup/rollup-linux-riscv64-musl": "4.62.2", - "@rollup/rollup-linux-s390x-gnu": "4.62.2", - "@rollup/rollup-linux-x64-gnu": "4.62.2", - "@rollup/rollup-linux-x64-musl": "4.62.2", - "@rollup/rollup-openbsd-x64": "4.62.2", - "@rollup/rollup-openharmony-arm64": "4.62.2", - "@rollup/rollup-win32-arm64-msvc": "4.62.2", - "@rollup/rollup-win32-ia32-msvc": "4.62.2", - "@rollup/rollup-win32-x64-gnu": "4.62.2", - "@rollup/rollup-win32-x64-msvc": "4.62.2", + "@napi-rs/lzma-linux-x64-gnu": "1.5.1", + "@rollup/rollup-android-arm-eabi": "4.63.1", + "@rollup/rollup-android-arm64": "4.63.1", + "@rollup/rollup-darwin-arm64": "4.63.1", + "@rollup/rollup-darwin-x64": "4.63.1", + "@rollup/rollup-freebsd-arm64": "4.63.1", + "@rollup/rollup-freebsd-x64": "4.63.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.63.1", + "@rollup/rollup-linux-arm-musleabihf": "4.63.1", + "@rollup/rollup-linux-arm64-gnu": "4.63.1", + "@rollup/rollup-linux-arm64-musl": "4.63.1", + "@rollup/rollup-linux-loong64-gnu": "4.63.1", + "@rollup/rollup-linux-loong64-musl": "4.63.1", + "@rollup/rollup-linux-ppc64-gnu": "4.63.1", + "@rollup/rollup-linux-ppc64-musl": "4.63.1", + "@rollup/rollup-linux-riscv64-gnu": "4.63.1", + "@rollup/rollup-linux-riscv64-musl": "4.63.1", + "@rollup/rollup-linux-s390x-gnu": "4.63.1", + "@rollup/rollup-linux-x64-gnu": "4.63.1", + "@rollup/rollup-linux-x64-musl": "4.63.1", + "@rollup/rollup-openbsd-x64": "4.63.1", + "@rollup/rollup-openharmony-arm64": "4.63.1", + "@rollup/rollup-win32-arm64-msvc": "4.63.1", + "@rollup/rollup-win32-ia32-msvc": "4.63.1", + "@rollup/rollup-win32-x64-gnu": "4.63.1", + "@rollup/rollup-win32-x64-msvc": "4.63.1", "fsevents": "~2.3.2" } }, @@ -5991,10 +7547,23 @@ "license": "MIT", "peer": true }, + "node_modules/sandbox-cli-detector": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/sandbox-cli-detector/-/sandbox-cli-detector-0.2.0.tgz", + "integrity": "sha512-4lyHX0ZU0AZKwjgZ1InxZAa3PNpyEb8rOQ+Zss1ReYmhNzW0Q+h1zE5nvniXN0HaAWZaZE1zgVNEirb0R7LmNg==", + "license": "MIT", + "peer": true, + "bin": { + "sandbox-cli-detector": "dist/cli.js" + }, + "engines": { + "node": ">=18.18" + } + }, "node_modules/sax": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.6.0.tgz", - "integrity": "sha512-6R3J5M4AcbtLUdZmRv2SygeVaM7IhrLXu9BmnOGmmACak8fiUtOsYNWUS4uK7upbmHIBbLBeFeI//477BKLBzA==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.6.1.tgz", + "integrity": "sha512-42tBVwLWnaQvW5zc4HbZrTuWccECCZfBi92FDuwtqxasH+JbPB3/FOKb1m222K42R4WxuxzzMsTswfzgtSu64Q==", "license": "BlueOak-1.0.0", "peer": true, "engines": { @@ -6005,7 +7574,8 @@ "version": "0.27.0", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz", "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/semver": { "version": "7.8.5", @@ -6024,6 +7594,7 @@ "resolved": "https://registry.npmjs.org/send/-/send-0.19.2.tgz", "integrity": "sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg==", "license": "MIT", + "peer": true, "dependencies": { "debug": "2.6.9", "depd": "2.0.0", @@ -6048,6 +7619,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "license": "MIT", + "peer": true, "dependencies": { "ms": "2.0.0" } @@ -6056,13 +7628,15 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/send/node_modules/encodeurl": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", "license": "MIT", + "peer": true, "engines": { "node": ">= 0.8" } @@ -6072,6 +7646,7 @@ "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "license": "MIT", + "peer": true, "dependencies": { "ee-first": "1.1.1" }, @@ -6084,6 +7659,7 @@ "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", "license": "MIT", + "peer": true, "engines": { "node": ">= 0.8" } @@ -6093,6 +7669,7 @@ "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-2.1.0.tgz", "integrity": "sha512-ghgmKt5o4Tly5yEG/UJp8qTd0AN7Xalw4XBtDEKP655B699qMEtra1WlXeE6WIvdEG481JvRxULKsInq/iNysw==", "license": "MIT", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -6113,24 +7690,6 @@ "range-parser": "1.2.0" } }, - "node_modules/serve-handler/node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "license": "MIT" - }, - "node_modules/serve-handler/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/serve-handler/node_modules/bytes": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", @@ -6192,6 +7751,7 @@ "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.3.tgz", "integrity": "sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA==", "license": "MIT", + "peer": true, "dependencies": { "encodeurl": "~2.0.0", "escape-html": "~1.0.3", @@ -6207,6 +7767,7 @@ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", "license": "MIT", + "peer": true, "engines": { "node": ">= 0.8" } @@ -6215,7 +7776,8 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", - "license": "ISC" + "license": "ISC", + "peer": true }, "node_modules/shebang-command": { "version": "2.0.0", @@ -6243,6 +7805,7 @@ "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.10.0.tgz", "integrity": "sha512-w1aiOKwKuRgtwAReIIj89puqg+I7GvX4IbLrvmhXbzQsj1+Zwi4VO3+fa6ZF91TWSjIxoEkKnMeHcLEODK5ZXA==", "license": "MIT", + "peer": true, "engines": { "node": ">= 0.4" }, @@ -6304,6 +7867,7 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", "license": "BSD-3-Clause", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -6323,6 +7887,7 @@ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", "license": "MIT", + "peer": true, "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -6333,6 +7898,7 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "license": "BSD-3-Clause", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -6341,13 +7907,15 @@ "version": "1.3.4", "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz", "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/stacktrace-parser": { "version": "0.1.11", "resolved": "https://registry.npmjs.org/stacktrace-parser/-/stacktrace-parser-0.1.11.tgz", "integrity": "sha512-WjlahMgHmCJpqzU8bIBy4qtsZdU9lRlcZE3Lvyej6t4tuOuv1vk57OW3MBrj6hXBFx/nNoC9MPMTcr5YA7NQbg==", "license": "MIT", + "peer": true, "dependencies": { "type-fest": "^0.7.1" }, @@ -6360,6 +7928,7 @@ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", "license": "MIT", + "peer": true, "engines": { "node": ">= 0.6" } @@ -6379,6 +7948,7 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "license": "MIT", + "peer": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -6393,6 +7963,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "license": "MIT", + "peer": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -6435,6 +8006,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "license": "MIT", + "peer": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -6486,10 +8058,11 @@ } }, "node_modules/terser": { - "version": "5.49.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.49.0.tgz", - "integrity": "sha512-SNiDnXyHSrxVcIOtVbULzcTmniUiwcV7Nwdyj1twVubeTmbjoa8p69KKDpfkdoOavuM4/GRm1+ykI8qqnavHoA==", + "version": "5.51.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.51.2.tgz", + "integrity": "sha512-bWnjSNscmuI+GJze6ZupnHP8G/cTcsJF+bXCeQknk2SHQsgbNJnLrqiH9jZ2W4STPVXH2mDKKRX3iwPhc9Cn/Q==", "license": "BSD-2-Clause", + "peer": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", "acorn": "^8.15.0", @@ -6507,13 +8080,15 @@ "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/throat": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/throat/-/throat-5.0.0.tgz", "integrity": "sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/tinyglobby": { "version": "0.2.17", @@ -6535,13 +8110,15 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", - "license": "BSD-3-Clause" + "license": "BSD-3-Clause", + "peer": true }, "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==", "license": "MIT", + "peer": true, "dependencies": { "is-number": "^7.0.0" }, @@ -6554,6 +8131,7 @@ "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", "license": "MIT", + "peer": true, "engines": { "node": ">=0.6" } @@ -6565,6 +8143,19 @@ "license": "MIT", "peer": true }, + "node_modules/ts-api-utils": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.5.0.tgz", + "integrity": "sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" + } + }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", @@ -6572,11 +8163,25 @@ "dev": true, "license": "0BSD" }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/type-fest": { "version": "0.7.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.7.1.tgz", "integrity": "sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==", "license": "(MIT OR CC0-1.0)", + "peer": true, "engines": { "node": ">=8" } @@ -6595,11 +8200,36 @@ "node": ">=14.17" } }, + "node_modules/typescript-eslint": { + "version": "8.69.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.69.0.tgz", + "integrity": "sha512-B3MltX0VqjUBNEe3b3sSuiRbfa6XrfHFtBiPamjT5AsW/dfq+y+bc0wyuS9DxAS1LyzCxRp2+rxzpLUvqM2BvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/eslint-plugin": "8.69.0", + "@typescript-eslint/parser": "8.69.0", + "@typescript-eslint/typescript-estree": "8.69.0", + "@typescript-eslint/utils": "8.69.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, "node_modules/undici-types": { "version": "8.3.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz", "integrity": "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "2.0.1", @@ -6650,14 +8280,15 @@ "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", "license": "MIT", + "peer": true, "engines": { "node": ">= 0.8" } }, "node_modules/update-browserslist-db": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", - "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.2.tgz", + "integrity": "sha512-UQ+MSxlhRm1bzjhU+DcuXfjFO1FzNtqhK5+9Yvlp90ItDLk5vT932A0rFu619nf7RVS+Y/VeaUW1jaRDqZ8VJw==", "funding": [ { "type": "opencollective", @@ -6673,6 +8304,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" @@ -6684,19 +8316,30 @@ "browserslist": ">= 4.21.0" } }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, "node_modules/utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", "license": "MIT", + "peer": true, "engines": { "node": ">= 0.4.0" } }, "node_modules/uuid": { - "version": "14.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-14.0.1.tgz", - "integrity": "sha512-6ZxzVpzDXDa3bJWaHilVayA+BH/1zmxCJoVgvmqJnid/gPoKHxUrS/aC/T6LGQtNHT+XHG9fXPJB4d+IrU30Ew==", + "version": "14.0.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-14.0.2.tgz", + "integrity": "sha512-xZe/16rV4aa+HGSOCiY2YeLT1OybRLrrkL/Rqaq7p7GMVXjFh+6wN4oMYgjFmnSnhY8t6Xpdl2l9qmnHYuMHwQ==", "funding": [ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" @@ -6731,13 +8374,15 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/vlq/-/vlq-1.0.1.tgz", "integrity": "sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/walker": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", "license": "Apache-2.0", + "peer": true, "dependencies": { "makeerror": "1.0.12" } @@ -6756,7 +8401,8 @@ "version": "3.6.20", "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.20.tgz", "integrity": "sha512-EqhiFU6daOA8kpjOWTL0olhVOF3i7OrFzSYiGsEMB8GcXS+RrzauAERX65xMeNWVqxA6HXH2m69Z9LaKKdisfg==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/whatwg-url-minimum": { "version": "0.1.2", @@ -6780,11 +8426,22 @@ "node": ">= 8" } }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "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==", "license": "MIT", + "peer": true, "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -6802,6 +8459,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "license": "MIT", + "peer": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -6810,10 +8468,11 @@ } }, "node_modules/ws": { - "version": "8.21.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.0.tgz", - "integrity": "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==", + "version": "8.21.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.3.tgz", + "integrity": "sha512-201TZ/kPWxoPr/OKWjquZR1SWKXcvxdH+e1xrx89b3YbmzLMFCLfnaG1HFIgWzJOEWZ7MvpK++odZufgYR50Rw==", "license": "MIT", + "peer": true, "engines": { "node": ">=10.0.0" }, @@ -6883,6 +8542,7 @@ "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "license": "ISC", + "peer": true, "engines": { "node": ">=10" } @@ -6891,13 +8551,15 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "license": "ISC" + "license": "ISC", + "peer": true }, "node_modules/yaml": { "version": "2.9.0", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz", "integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==", "license": "ISC", + "peer": true, "bin": { "yaml": "bin.mjs" }, @@ -6913,6 +8575,7 @@ "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.3.tgz", "integrity": "sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g==", "license": "MIT", + "peer": true, "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", @@ -6931,10 +8594,24 @@ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "license": "ISC", + "peer": true, "engines": { "node": ">=12" } }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/zod": { "version": "3.25.76", "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", diff --git a/package.json b/package.json index d4e59716..92668884 100644 --- a/package.json +++ b/package.json @@ -1,62 +1,72 @@ { - "name": "react-native-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": "0.34.0", - "license": "BSD-3-Clause", - "main": "dist/cjs/sdk.js", - "exports": { - ".": { - "import": "./dist/esm/sdk.js", - "require": "./dist/cjs/sdk.js", - "types": "./types/index.d.ts" + "name": "react-native-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": "0.35.0", + "license": "BSD-3-Clause", + "main": "dist/cjs/sdk.js", + "exports": { + ".": { + "import": "./dist/esm/sdk.js", + "require": "./dist/cjs/sdk.js", + "types": "./types/index.d.ts" + }, + "./package.json": "./package.json" }, - "./package.json": "./package.json" - }, - "module": "dist/esm/sdk.js", - "types": "types/index.d.ts", - "files": [ - "dist", - "types" - ], - "repository": { - "type": "git", - "url": "https://github.com/appwrite/sdk-for-react-native" - }, - "scripts": { - "build": "npm run build:types && npm run build:libs", - "build:types": "tsc --declaration --emitDeclarationOnly --outDir types", - "build:libs": "rollup -c" - }, - "engines": { - "node": ">=18.0.0" - }, - "devDependencies": { - "@rollup/plugin-typescript": "12.3.0", - "@types/json-bigint": "1.0.4", - "playwright": "1.59.0", - "rollup": "4.62.2", - "serve-handler": "6.1.7", - "tslib": "2.8.1", - "typescript": "5.9.3" - }, - "dependencies": { - "expo-file-system": "18.*.*", - "json-bigint": "1.0.0", - "react-native": ">=0.76.7 <1.0.0" - }, - "peerDependencies": { - "expo": "*" - }, - "overrides": { - "glob": { - ".": "^13.0.0", - "brace-expansion": "^5.0.6" + "module": "dist/esm/sdk.js", + "types": "types/index.d.ts", + "files": [ + "dist", + "types" + ], + "repository": { + "type": "git", + "url": "https://github.com/appwrite/sdk-for-react-native" }, - "rimraf": "^6.0.0", - "@xmldom/xmldom": "^0.9.10", - "uuid": "^14.0.0", - "postcss": "^8.5.12", - "ws": "^8.20.1" - } + "scripts": { + "build": "npm run build:types && npm run build:libs", + "build:types": "tsc --declaration --emitDeclarationOnly --outDir types", + "build:libs": "rollup -c", + "format": "prettier --write .", + "format:check": "prettier --check .", + "lint": "eslint .", + "lint:fix": "eslint --fix .", + "analyse": "tsc --noEmit" + }, + "engines": { + "node": ">=18.0.0" + }, + "devDependencies": { + "@eslint/js": "10.0.1", + "eslint": "10.9.1", + "@rollup/plugin-typescript": "12.3.0", + "@types/json-bigint": "1.0.4", + "playwright": "1.59.0", + "prettier": "3.9.6", + "rollup": "4.63.1", + "serve-handler": "6.1.7", + "tslib": "2.8.1", + "typescript": "5.9.3", + "typescript-eslint": "8.69.0" + }, + "dependencies": { + "expo-file-system": "18.*.*", + "json-bigint": "1.0.0" + }, + "peerDependencies": { + "expo": "*", + "react-native": ">=0.76.7 <1.0.0" + }, + "overrides": { + "glob": { + ".": "^13.0.0", + "brace-expansion": "5.0.9" + }, + "brace-expansion": "5.0.9", + "rimraf": "^6.0.0", + "@xmldom/xmldom": "^0.9.10", + "uuid": "^14.0.0", + "postcss": "^8.5.18", + "ws": "^8.20.1" + } } diff --git a/rollup.config.mjs b/rollup.config.mjs index a4e740ba..a2714681 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -1,22 +1,25 @@ -import { readFileSync } from "fs"; -const pkg = JSON.parse(readFileSync("./package.json", "utf8")); -import typescript from "@rollup/plugin-typescript"; +import { readFileSync } from 'fs'; +const pkg = JSON.parse(readFileSync('./package.json', 'utf8')); +import typescript from '@rollup/plugin-typescript'; -const external = Object.keys(pkg.dependencies ?? {}); +const external = [ + ...Object.keys(pkg.dependencies ?? {}), + ...Object.keys(pkg.peerDependencies ?? {}), +]; export default { - input: "src/index.ts", + input: 'src/index.ts', external, - plugins: [typescript({ outDir: "dist" })], + plugins: [typescript({ outDir: 'dist' })], output: [ { - format: "cjs", + format: 'cjs', file: pkg.main, esModule: false, sourcemap: true, }, { - format: "es", + format: 'es', file: pkg.module, sourcemap: true, }, diff --git a/src/channel.ts b/src/channel.ts index 653bd313..343b41af 100644 --- a/src/channel.ts +++ b/src/channel.ts @@ -1,164 +1,198 @@ -interface Root {} -interface Database { _db: any } -interface Collection { _coll: any } -interface Document { _doc: any } -interface TablesDB { _tdb: any } -interface Table { _tbl: any } -interface Row { _row: any } -interface Bucket { _bkt: any } -interface File { _file: any } -interface Func { _fn: any } -interface Execution { _exec: any } -interface Team { _team: any } -interface Membership { _mem: any } -interface Presence { _presence: any } -interface Resolved { _res: any } +interface Database { + _db: any; +} +interface Collection { + _coll: any; +} +interface Document { + _doc: any; +} +interface TablesDB { + _tdb: any; +} +interface Table { + _tbl: any; +} +interface Row { + _row: any; +} +interface Bucket { + _bkt: any; +} +interface File { + _file: any; +} +interface Func { + _fn: any; +} +interface Execution { + _exec: any; +} +interface Team { + _team: any; +} +interface Membership { + _mem: any; +} +interface Presence { + _presence: any; +} +interface Resolved { + _res: any; +} type Actionable = Document | Row | File | Team | Membership | Presence; function normalize(id: string): string { - if (id === undefined || id === null) { - throw new Error("Channel ID is required"); - } - const trimmed = String(id).trim(); - if (trimmed === "") { - throw new Error("Channel ID is required"); - } - return trimmed; + if (id === undefined || id === null) { + throw new Error('Channel ID is required'); + } + const trimmed = String(id).trim(); + if (trimmed === '') { + throw new Error('Channel ID is required'); + } + return trimmed; } export class Channel { - declare _type: T; - - private constructor(private readonly segments: string[]) {} - - private next(segment: string, id?: string): Channel { - const segments = - id === undefined - ? [...this.segments, segment] - : [...this.segments, segment, normalize(id)]; - - return new Channel(segments) as any; - } - - private resolve(action: string): Channel { - return new Channel([...this.segments, action]) as any; - } - - toString(): string { - return this.segments.join("."); - } - - // --- DATABASE ROUTE --- - // Only available on Channel - collection(this: Channel, id: string): Channel { - return this.next("collections", id); - } - - // Only available on Channel - document(this: Channel, id?: string): Channel { - return this.next("documents", id); - } - - // --- TABLESDB ROUTE --- - table(this: Channel, id: string): Channel { - return this.next
("tables", id); - } - - row(this: Channel
, id?: string): Channel { - return this.next("rows", id); - } - - // --- BUCKET ROUTE --- - file(this: Channel, id?: string): Channel { - return this.next("files", id); - } - - // --- TERMINAL ACTIONS --- - // Restricted to the Actionable union - create(this: Channel): Channel { - return this.resolve("create"); - } - - upsert(this: Channel): Channel { - return this.resolve("upsert"); - } - - update(this: Channel): Channel { - return this.resolve("update"); - } - - delete(this: Channel): Channel { - return this.resolve("delete"); - } - - // --- ROOT FACTORIES --- - static database(id: string) { - return new Channel(["databases", normalize(id)]); - } - - static tablesdb(id: string) { - return new Channel(["tablesdb", normalize(id)]); - } - - static bucket(id: string) { - return new Channel(["buckets", normalize(id)]); - } - - static function(id: string) { - return new Channel(["functions", normalize(id)]); - } - - static execution(id: string) { - return new Channel(["executions", normalize(id)]); - } - - static team(id: string) { - return new Channel(["teams", normalize(id)]); - } - - static membership(id: string) { - return new Channel(["memberships", normalize(id)]); - } - - static presence(id: string) { - return new Channel(["presences", normalize(id)]); - } - - static account(): string { - return "account"; - } - - // Global events - static documents(): string { - return "documents"; - } - - static rows(): string { - return "rows"; - } - - static files(): string { - return "files"; - } - - static executions(): string { - return "executions"; - } - - static teams(): string { - return "teams"; - } - - static memberships(): string { - return "memberships"; - } - - static presences(): string { - return "presences"; - } + declare _type: T; + + private constructor(private readonly segments: string[]) {} + + private next(segment: string, id?: string): Channel { + const segments = + id === undefined + ? [...this.segments, segment] + : [...this.segments, segment, normalize(id)]; + + return new Channel(segments) as any; + } + + private resolve(action: string): Channel { + return new Channel([...this.segments, action]) as any; + } + + toString(): string { + return this.segments.join('.'); + } + + // --- DATABASE ROUTE --- + // Only available on Channel + collection(this: Channel, id: string): Channel { + return this.next('collections', id); + } + + // Only available on Channel + document(this: Channel, id?: string): Channel { + return this.next('documents', id); + } + + // --- TABLESDB ROUTE --- + table(this: Channel, id: string): Channel
{ + return this.next
('tables', id); + } + + row(this: Channel
, id?: string): Channel { + return this.next('rows', id); + } + + // --- BUCKET ROUTE --- + file(this: Channel, id?: string): Channel { + return this.next('files', id); + } + + // --- TERMINAL ACTIONS --- + // Restricted to the Actionable union + create(this: Channel): Channel { + return this.resolve('create'); + } + + upsert(this: Channel): Channel { + return this.resolve('upsert'); + } + + update(this: Channel): Channel { + return this.resolve('update'); + } + + delete(this: Channel): Channel { + return this.resolve('delete'); + } + + // --- ROOT FACTORIES --- + static database(id: string) { + return new Channel(['databases', normalize(id)]); + } + + static tablesdb(id: string) { + return new Channel(['tablesdb', normalize(id)]); + } + + static bucket(id: string) { + return new Channel(['buckets', normalize(id)]); + } + + static function(id: string) { + return new Channel(['functions', normalize(id)]); + } + + static execution(id: string) { + return new Channel(['executions', normalize(id)]); + } + + static team(id: string) { + return new Channel(['teams', normalize(id)]); + } + + static membership(id: string) { + return new Channel(['memberships', normalize(id)]); + } + + static presence(id: string) { + return new Channel(['presences', normalize(id)]); + } + + static account(): string { + return 'account'; + } + + // Global events + static documents(): string { + return 'documents'; + } + + static rows(): string { + return 'rows'; + } + + static files(): string { + return 'files'; + } + + static executions(): string { + return 'executions'; + } + + static teams(): string { + return 'teams'; + } + + static memberships(): string { + return 'memberships'; + } + + static presences(): string { + return 'presences'; + } } // Export types for backward compatibility with realtime -export type ActionableChannel = Channel | Channel | Channel | Channel | Channel | Channel | Channel; +export type ActionableChannel = + | Channel + | Channel + | Channel + | Channel + | Channel + | Channel + | Channel; export type ResolvedChannel = Channel; diff --git a/src/client.ts b/src/client.ts index 1c80f8e3..7195cd39 100644 --- a/src/client.ts +++ b/src/client.ts @@ -12,12 +12,14 @@ const MAX_INT64 = BigInt('9223372036854775807'); const MIN_INT64 = BigInt('-9223372036854775808'); function isBigNumber(value: any): boolean { - return value !== null - && typeof value === 'object' - && value._isBigNumber === true - && typeof value.isInteger === 'function' - && typeof value.toFixed === 'function' - && typeof value.toNumber === 'function'; + return ( + value !== null && + typeof value === 'object' && + value._isBigNumber === true && + typeof value.isInteger === 'function' && + typeof value.toFixed === 'function' && + typeof value.toNumber === 'function' + ); } function reviver(_key: string, value: any): any { @@ -40,32 +42,37 @@ function reviver(_key: string, value: any): any { export const JSONbig = { parse: (text: string) => JSONbigParser.parse(text, reviver), - stringify: JSONbigSerializer.stringify + stringify: JSONbigSerializer.stringify, }; type Payload = { [key: string]: any; -} +}; type Headers = { [key: string]: string; -} +}; type RealtimeResponse = { type: 'error' | 'event' | 'connected' | 'response' | 'pong'; - data: RealtimeResponseAuthenticated | RealtimeResponseConnected | RealtimeResponseError | RealtimeResponseEvent | undefined; -} + data: + | RealtimeResponseAuthenticated + | RealtimeResponseConnected + | RealtimeResponseError + | RealtimeResponseEvent + | undefined; +}; type RealtimeRequest = { type: 'authentication' | 'subscribe'; data: RealtimeRequestAuthenticate | RealtimeRequestSubscribe[]; -} +}; type RealtimeRequestSubscribe = { subscriptionId?: string; channels: string[]; queries: string[]; -} +}; type RealtimeResponseAction = { to?: string; @@ -75,35 +82,35 @@ type RealtimeResponseAction = { channels?: string[]; queries?: string[]; }>; -} +}; -export type RealtimeResponseEvent = { +export type RealtimeResponseEvent = { events: string[]; channels: string[]; timestamp: number; payload: T; subscriptions?: string[]; -} +}; type RealtimeResponseError = { code: number; message: string; -} +}; type RealtimeResponseConnected = { channels: string[]; user?: object; -} +}; type RealtimeResponseAuthenticated = { to: string; success: boolean; user: object; -} +}; type RealtimeRequestAuthenticate = { session: string; -} +}; type Realtime = { socket?: WebSocket; @@ -115,16 +122,19 @@ type Realtime = { /** * Heartbeat interval for the realtime connection. - */ + */ heartbeat?: number; url?: string; lastMessage?: RealtimeResponse; - subscriptions: Map) => void - }>; + subscriptions: Map< + number, + { + channels: string[]; + queries: string[]; + callback: (payload: RealtimeResponseEvent) => void; + } + >; slotToSubscriptionId: Map; subscriptionIdToSlot: Map; pendingSubscribeSlots: number[]; @@ -137,7 +147,7 @@ type Realtime = { createHeartbeat: () => void; sendSubscribeMessage: () => void; onMessage: (event: MessageEvent) => void; -} +}; export type UploadProgress = { $id: string; @@ -145,13 +155,18 @@ export type UploadProgress = { sizeUploaded: number; chunksTotal: number; chunksUploaded: number; -} +}; class AppwriteException extends Error { code: number; response: string; type: string; - constructor(message: string, code: number = 0, type: string = '', response: string = '') { + constructor( + message: string, + code: number = 0, + type: string = '', + response: string = '', + ) { super(message); this.name = 'AppwriteException'; this.message = message; @@ -181,8 +196,8 @@ class Client { 'x-sdk-name': 'React Native', 'x-sdk-platform': 'client', 'x-sdk-language': 'reactnative', - 'x-sdk-version': '0.34.0', - 'X-Appwrite-Response-Format': '1.9.5', + 'x-sdk-version': '0.35.0', + 'X-Appwrite-Response-Format': '2.0.0', }; /** @@ -211,12 +226,17 @@ class Client { throw new AppwriteException('Endpoint must be a valid string'); } - if (!endpoint.startsWith('http://') && !endpoint.startsWith('https://')) { + if ( + !endpoint.startsWith('http://') && + !endpoint.startsWith('https://') + ) { throw new AppwriteException('Invalid endpoint URL: ' + endpoint); } this.config.endpoint = endpoint; - this.config.endpointRealtime = endpoint.replace('https://', 'wss://').replace('http://', 'ws://'); + this.config.endpointRealtime = endpoint + .replace('https://', 'wss://') + .replace('http://', 'ws://'); return this; } @@ -233,8 +253,13 @@ class Client { throw new AppwriteException('Endpoint must be a valid string'); } - if (!endpointRealtime.startsWith('ws://') && !endpointRealtime.startsWith('wss://')) { - throw new AppwriteException('Invalid realtime endpoint URL: ' + endpointRealtime); + if ( + !endpointRealtime.startsWith('ws://') && + !endpointRealtime.startsWith('wss://') + ) { + throw new AppwriteException( + 'Invalid realtime endpoint URL: ' + endpointRealtime, + ); } this.config.endpointRealtime = endpointRealtime; @@ -403,7 +428,6 @@ class Client { return this; } - private realtime: Realtime = { socket: undefined, timeout: undefined, @@ -441,9 +465,11 @@ class Client { } this.realtime.heartbeat = window?.setInterval(() => { - this.realtime.socket?.send(JSONbig.stringify({ - type: 'ping' - })); + this.realtime.socket?.send( + JSONbig.stringify({ + type: 'ping', + }), + ); }, 20_000); }, createSocket: () => { @@ -461,7 +487,10 @@ class Client { channels.set('jwt', jwt); } - const url = this.config.endpointRealtime + '/realtime?' + channels.toString(); + const url = + this.config.endpointRealtime + + '/realtime?' + + channels.toString(); if ( url !== this.realtime.url || // Check if URL is present @@ -477,45 +506,56 @@ class Client { } this.realtime.url = url; - // @ts-ignore + // @ts-expect-error self-signed agent is Node-only this.realtime.socket = new WebSocket(url, undefined, { headers: { Origin: `appwrite-${Platform.OS}://${this.config.platform}`, - ...(jwt && Platform.OS !== 'web' ? { 'x-appwrite-jwt': jwt } : {}) - } + ...(jwt && Platform.OS !== 'web' + ? { 'x-appwrite-jwt': jwt } + : {}), + }, }); - this.realtime.socket.addEventListener('message', this.realtime.onMessage); - this.realtime.socket.addEventListener('open', _event => { + this.realtime.socket.addEventListener( + 'message', + this.realtime.onMessage, + ); + this.realtime.socket.addEventListener('open', (_event) => { this.realtime.reconnectAttempts = 0; this.realtime.createHeartbeat(); }); - this.realtime.socket.addEventListener('close', event => { + this.realtime.socket.addEventListener('close', (event) => { if ( !this.realtime.reconnect || - ( - this.realtime?.lastMessage?.type === 'error' && // Check if last message was of type error - (this.realtime?.lastMessage.data).code === 1008 // Check for policy violation 1008 - ) + (this.realtime?.lastMessage?.type === 'error' && // Check if last message was of type error + (( + this.realtime?.lastMessage.data + )).code === 1008) // Check for policy violation 1008 ) { this.realtime.reconnect = true; return; } const timeout = this.realtime.getTimeout(); - console.error(`Realtime got disconnected. Reconnect will be attempted in ${timeout / 1000} seconds.`, event.reason); + console.error( + `Realtime got disconnected. Reconnect will be attempted in ${timeout / 1000} seconds.`, + event.reason, + ); setTimeout(() => { this.realtime.reconnectAttempts++; this.realtime.createSocket(); }, timeout); - }) + }); } else if (this.realtime.socket?.readyState === WebSocket.OPEN) { // URL is unchanged; re-send subscribe message to apply updated queries. this.realtime.sendSubscribeMessage(); } }, sendSubscribeMessage: () => { - if (!this.realtime.socket || this.realtime.socket.readyState !== WebSocket.OPEN) { + if ( + !this.realtime.socket || + this.realtime.socket.readyState !== WebSocket.OPEN + ) { return; } @@ -527,9 +567,10 @@ class Client { const row: RealtimeRequestSubscribe = { channels: sub.channels, - queries + queries, }; - const knownSubscriptionId = this.realtime.slotToSubscriptionId.get(slot); + const knownSubscriptionId = + this.realtime.slotToSubscriptionId.get(slot); if (knownSubscriptionId) { row.subscriptionId = knownSubscriptionId; } @@ -542,10 +583,12 @@ class Client { return; } - this.realtime.socket.send(JSONbig.stringify({ - type: 'subscribe', - data: rows - })); + this.realtime.socket.send( + JSONbig.stringify({ + type: 'subscribe', + data: rows, + }), + ); }, onMessage: (event) => { try { @@ -553,20 +596,28 @@ class Client { this.realtime.lastMessage = message; switch (message.type) { case 'connected': { - const messageData = message.data; + const messageData = ( + message.data + ); let session = this.config.session; if (!session) { - const cookie = JSONbig.parse(window.localStorage.getItem('cookieFallback') ?? '{}'); - session = cookie?.[`a_session_${this.config.project}`]; + const cookie = JSONbig.parse( + window.localStorage.getItem('cookieFallback') ?? + '{}', + ); + session = + cookie?.[`a_session_${this.config.project}`]; } if (session && !messageData?.user) { - this.realtime.socket?.send(JSONbig.stringify({ - type: 'authentication', - data: { - session - } - })); + this.realtime.socket?.send( + JSONbig.stringify({ + type: 'authentication', + data: { + session, + }, + }), + ); } this.realtime.sendSubscribeMessage(); @@ -574,44 +625,78 @@ class Client { } case 'response': { const action = message.data as RealtimeResponseAction; - if (action?.to !== 'subscribe' || !Array.isArray(action.subscriptions)) { + if ( + action?.to !== 'subscribe' || + !Array.isArray(action.subscriptions) + ) { break; } action.subscriptions.forEach((subscription, index) => { const subscriptionId = subscription?.subscriptionId; - const slot = this.realtime.pendingSubscribeSlots[index]; + const slot = + this.realtime.pendingSubscribeSlots[index]; if (!subscriptionId || slot === undefined) { return; } - this.realtime.slotToSubscriptionId.set(slot, subscriptionId); - this.realtime.subscriptionIdToSlot.set(subscriptionId, slot); + this.realtime.slotToSubscriptionId.set( + slot, + subscriptionId, + ); + this.realtime.subscriptionIdToSlot.set( + subscriptionId, + slot, + ); }); break; } - case 'event': - const data = >message.data; + case 'event': { + const data = >( + message.data + ); if (data?.channels) { - if (data.subscriptions && data.subscriptions.length > 0) { + if ( + data.subscriptions && + data.subscriptions.length > 0 + ) { data.subscriptions.forEach((subscriptionId) => { - const slot = this.realtime.subscriptionIdToSlot.get(subscriptionId); + const slot = + this.realtime.subscriptionIdToSlot.get( + subscriptionId, + ); if (slot !== undefined) { - const subscription = this.realtime.subscriptions.get(slot); + const subscription = + this.realtime.subscriptions.get( + slot, + ); if (subscription) { - setTimeout(() => subscription.callback(data)); + setTimeout(() => + subscription.callback(data), + ); } } }); } else { - this.realtime.subscriptions.forEach(subscription => { - if (data.channels.some(channel => subscription.channels.includes(channel))) { - setTimeout(() => subscription.callback(data)); - } - }); + this.realtime.subscriptions.forEach( + (subscription) => { + if ( + data.channels.some((channel) => + subscription.channels.includes( + channel, + ), + ) + ) { + setTimeout(() => + subscription.callback(data), + ); + } + }, + ); } } break; + } case 'pong': break; // Handle pong response if needed case 'error': @@ -622,15 +707,15 @@ class Client { } catch (e) { console.error(e); } - } - } + }, + }; /** * Subscribes to Appwrite events and passes you the payload in realtime. - * - * @param {string|string[]} channels + * + * @param {string|string[]} channels * Channel to subscribe - pass a single channel as a string or multiple with an array of strings. - * + * * Possible channels are: * - account * - collections @@ -650,49 +735,59 @@ class Client { * @param {(payload: RealtimeMessage) => void} callback Is called on every realtime update. * @returns {() => void} Unsubscribes from events. */ - subscribe( + subscribe( channels: string | string[], callback: (payload: RealtimeResponseEvent) => void, - queries: (string | Query)[] = [] + queries: (string | Query)[] = [], ): () => void { - let channelArray = typeof channels === 'string' ? [channels] : channels; + const channelArray = + typeof channels === 'string' ? [channels] : channels; - const queryStrings = (queries ?? []).map(q => typeof q === 'string' ? q : q.toString()); + const queryStrings = (queries ?? []).map((q) => + typeof q === 'string' ? q : q.toString(), + ); const counter = this.realtime.subscriptionsCounter++; this.realtime.subscriptions.set(counter, { channels: channelArray, queries: queryStrings, - callback + callback, }); this.realtime.connect(); return () => { - const subscriptionId = this.realtime.slotToSubscriptionId.get(counter); + const subscriptionId = + this.realtime.slotToSubscriptionId.get(counter); this.realtime.subscriptions.delete(counter); this.realtime.slotToSubscriptionId.delete(counter); if (subscriptionId) { this.realtime.subscriptionIdToSlot.delete(subscriptionId); } this.realtime.connect(); - } + }; } async ping(): Promise { return this.call('GET', new URL(this.config.endpoint + '/ping'), { 'X-Appwrite-Project': this.config.project, - 'accept': 'application/json', + accept: 'application/json', }); } - async call(method: string, url: URL, headers: Headers = {}, params: Payload = {}, responseType = 'json'): Promise { + async call( + method: string, + url: URL, + headers: Headers = {}, + params: Payload = {}, + responseType = 'json', + ): Promise { method = method.toUpperCase(); headers = Object.assign({}, this.headers, headers); - headers.Origin = `appwrite-${Platform.OS}://${this.config.platform}` + headers.Origin = `appwrite-${Platform.OS}://${this.config.platform}`; - let options: RequestInit = { + const options: RequestInit = { method, headers, }; @@ -702,7 +797,9 @@ class Client { } if (method === 'GET') { - for (const [key, value] of Object.entries(Service.flatten(params))) { + for (const [key, value] of Object.entries( + Service.flatten(params), + )) { url.searchParams.append(key, value); } } else { @@ -711,14 +808,14 @@ class Client { options.body = JSONbig.stringify(params); break; - case 'multipart/form-data': - let formData = new FormData(); + case 'multipart/form-data': { + const formData = new FormData(); for (const key in params) { if (Array.isArray(params[key])) { params[key].forEach((value: any) => { formData.append(key + '[]', value); - }) + }); } else { formData.append(key, params[key]); } @@ -727,6 +824,7 @@ class Client { options.body = formData; delete headers['content-type']; break; + } } } @@ -737,33 +835,56 @@ class Client { const warnings = response.headers.get('x-appwrite-warning'); if (warnings) { - warnings.split(';').forEach((warning: string) => console.warn('Warning: ' + warning)); + warnings + .split(';') + .forEach((warning: string) => + console.warn('Warning: ' + warning), + ); } - if (response.headers.get('content-type')?.includes('application/json')) { + if ( + response.headers + .get('content-type') + ?.includes('application/json') + ) { data = JSONbig.parse(await response.text()); } else if (responseType === 'arrayBuffer') { data = await response.arrayBuffer(); } else { data = { - message: await response.text() + message: await response.text(), }; } if (400 <= response.status) { let responseText = ''; - if (response.headers.get('content-type')?.includes('application/json')) { + if ( + response.headers + .get('content-type') + ?.includes('application/json') + ) { responseText = JSONbig.stringify(data); } else { responseText = data?.message; } - throw new AppwriteException(data?.message, response.status, data?.type, responseText); + throw new AppwriteException( + data?.message, + response.status, + data?.type, + responseText, + ); } const cookieFallback = response.headers.get('X-Fallback-Cookies'); - if (typeof window !== 'undefined' && window.localStorage && cookieFallback) { - window.console.warn('Appwrite is using localStorage for session management. Increase your security by adding a custom domain as your API endpoint.'); + if ( + typeof window !== 'undefined' && + window.localStorage && + cookieFallback + ) { + window.console.warn( + 'Appwrite is using localStorage for session management. Increase your security by adding a custom domain as your API endpoint.', + ); window.localStorage.setItem('cookieFallback', cookieFallback); } diff --git a/src/enums/authentication-factor.ts b/src/enums/authentication-factor.ts index 928c4074..d16c3fe5 100644 --- a/src/enums/authentication-factor.ts +++ b/src/enums/authentication-factor.ts @@ -3,4 +3,5 @@ export enum AuthenticationFactor { Phone = 'phone', Totp = 'totp', Recoverycode = 'recoverycode', -} \ No newline at end of file + Custom = 'custom', +} diff --git a/src/enums/authenticator-type.ts b/src/enums/authenticator-type.ts index 34db0cca..0c918278 100644 --- a/src/enums/authenticator-type.ts +++ b/src/enums/authenticator-type.ts @@ -1,3 +1,3 @@ export enum AuthenticatorType { Totp = 'totp', -} \ No newline at end of file +} diff --git a/src/enums/browser-permission.ts b/src/enums/browser-permission.ts index 77b62f46..32271a4d 100644 --- a/src/enums/browser-permission.ts +++ b/src/enums/browser-permission.ts @@ -19,4 +19,4 @@ export enum BrowserPermission { ScreenWakeLock = 'screen-wake-lock', WebShare = 'web-share', XrSpatialTracking = 'xr-spatial-tracking', -} \ No newline at end of file +} diff --git a/src/enums/browser-theme.ts b/src/enums/browser-theme.ts index 9f8c382a..acb8d578 100644 --- a/src/enums/browser-theme.ts +++ b/src/enums/browser-theme.ts @@ -1,4 +1,4 @@ export enum BrowserTheme { Light = 'light', Dark = 'dark', -} \ No newline at end of file +} diff --git a/src/enums/browser.ts b/src/enums/browser.ts index cec52fb6..78762163 100644 --- a/src/enums/browser.ts +++ b/src/enums/browser.ts @@ -13,4 +13,4 @@ export enum Browser { OperaMini = 'om', Opera = 'op', OperaNext = 'on', -} \ No newline at end of file +} diff --git a/src/enums/credit-card.ts b/src/enums/credit-card.ts index e6ce2429..946e4931 100644 --- a/src/enums/credit-card.ts +++ b/src/enums/credit-card.ts @@ -16,4 +16,4 @@ export enum CreditCard { MIR = 'mir', Maestro = 'maestro', Rupay = 'rupay', -} \ No newline at end of file +} diff --git a/src/enums/execution-method.ts b/src/enums/execution-method.ts index 39d4c1e8..a01b6b1a 100644 --- a/src/enums/execution-method.ts +++ b/src/enums/execution-method.ts @@ -6,4 +6,4 @@ export enum ExecutionMethod { DELETE = 'DELETE', OPTIONS = 'OPTIONS', HEAD = 'HEAD', -} \ No newline at end of file +} diff --git a/src/enums/execution-resource-type.ts b/src/enums/execution-resource-type.ts new file mode 100644 index 00000000..f2773e86 --- /dev/null +++ b/src/enums/execution-resource-type.ts @@ -0,0 +1,4 @@ +export enum ExecutionResourceType { + Functions = 'functions', + Sites = 'sites', +} diff --git a/src/enums/execution-status.ts b/src/enums/execution-status.ts index 992d987d..81bd3955 100644 --- a/src/enums/execution-status.ts +++ b/src/enums/execution-status.ts @@ -4,4 +4,4 @@ export enum ExecutionStatus { Completed = 'completed', Failed = 'failed', Scheduled = 'scheduled', -} \ No newline at end of file +} diff --git a/src/enums/execution-trigger.ts b/src/enums/execution-trigger.ts index 1829d514..84fa8f60 100644 --- a/src/enums/execution-trigger.ts +++ b/src/enums/execution-trigger.ts @@ -2,4 +2,4 @@ export enum ExecutionTrigger { Http = 'http', Schedule = 'schedule', Event = 'event', -} \ No newline at end of file +} diff --git a/src/enums/flag.ts b/src/enums/flag.ts index 7e1d8781..ab49b648 100644 --- a/src/enums/flag.ts +++ b/src/enums/flag.ts @@ -194,4 +194,4 @@ export enum Flag { SouthAfrica = 'za', Zambia = 'zm', Zimbabwe = 'zw', -} \ No newline at end of file +} diff --git a/src/enums/image-format.ts b/src/enums/image-format.ts index 758fad74..4c210ffd 100644 --- a/src/enums/image-format.ts +++ b/src/enums/image-format.ts @@ -6,4 +6,4 @@ export enum ImageFormat { Heic = 'heic', Avif = 'avif', Gif = 'gif', -} \ No newline at end of file +} diff --git a/src/enums/image-gravity.ts b/src/enums/image-gravity.ts index 4af66d41..dcaa9f61 100644 --- a/src/enums/image-gravity.ts +++ b/src/enums/image-gravity.ts @@ -8,4 +8,4 @@ export enum ImageGravity { BottomLeft = 'bottom-left', Bottom = 'bottom', BottomRight = 'bottom-right', -} \ No newline at end of file +} diff --git a/src/enums/o-auth-provider.ts b/src/enums/o-auth-provider.ts index e7136d69..2d838dd4 100644 --- a/src/enums/o-auth-provider.ts +++ b/src/enums/o-auth-provider.ts @@ -8,6 +8,7 @@ export enum OAuthProvider { Bitbucket = 'bitbucket', Bitly = 'bitly', Box = 'box', + Cloudflare = 'cloudflare', Dailymotion = 'dailymotion', Discord = 'discord', Disqus = 'disqus', @@ -19,6 +20,7 @@ export enum OAuthProvider { Github = 'github', Gitlab = 'gitlab', Google = 'google', + Huggingface = 'huggingface', Keycloak = 'keycloak', Kick = 'kick', Linkedin = 'linkedin', @@ -29,6 +31,7 @@ export enum OAuthProvider { Paypal = 'paypal', PaypalSandbox = 'paypalSandbox', Podio = 'podio', + Resend = 'resend', Salesforce = 'salesforce', Slack = 'slack', Spotify = 'spotify', @@ -43,4 +46,4 @@ export enum OAuthProvider { Yandex = 'yandex', Zoho = 'zoho', Zoom = 'zoom', -} \ No newline at end of file +} diff --git a/src/enums/timezone.ts b/src/enums/timezone.ts index b67cdd2a..185261df 100644 --- a/src/enums/timezone.ts +++ b/src/enums/timezone.ts @@ -418,4 +418,4 @@ export enum Timezone { PacificWake = 'pacific/wake', PacificWallis = 'pacific/wallis', Utc = 'utc', -} \ No newline at end of file +} diff --git a/src/id.ts b/src/id.ts index 199f00a4..337600f0 100644 --- a/src/id.ts +++ b/src/id.ts @@ -7,12 +7,13 @@ export class ID { const msec = now.getMilliseconds(); // Convert to hexadecimal - const hexTimestamp = sec.toString(16) + msec.toString(16).padStart(5, '0'); + const hexTimestamp = + sec.toString(16) + msec.toString(16).padStart(5, '0'); return hexTimestamp; } public static custom(id: string): string { - return id + return id; } public static unique(padding: number = 7): string { diff --git a/src/index.ts b/src/index.ts index 1905aafd..f91bfd9e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,16 +2,24 @@ export { Client, AppwriteException } from './client'; export { Account } from './services/account'; export { Avatars } from './services/avatars'; export { Databases } from './services/databases'; +export { DocumentsDB } from './services/documents-db'; export { Functions } from './services/functions'; export { Graphql } from './services/graphql'; export { Locale } from './services/locale'; export { Messaging } from './services/messaging'; +export { Organization } from './services/organization'; export { Presences } from './services/presences'; export { Storage } from './services/storage'; export { TablesDB } from './services/tables-db'; export { Teams } from './services/teams'; +export { VectorsDB } from './services/vectors-db'; export { Realtime } from './services/realtime'; -export type { Models, Payload, RealtimeResponseEvent, UploadProgress } from './client'; +export type { + Models, + Payload, + RealtimeResponseEvent, + UploadProgress, +} from './client'; export type { RealtimeSubscription } from './services/realtime'; export type { QueryTypes, QueryTypesList } from './query'; export { Query } from './query'; @@ -32,5 +40,6 @@ export { BrowserPermission } from './enums/browser-permission'; export { ImageFormat } from './enums/image-format'; export { ExecutionMethod } from './enums/execution-method'; export { ImageGravity } from './enums/image-gravity'; +export { ExecutionResourceType } from './enums/execution-resource-type'; export { ExecutionTrigger } from './enums/execution-trigger'; export { ExecutionStatus } from './enums/execution-status'; diff --git a/src/models.ts b/src/models.ts index 969aac23..38c9b4f2 100644 --- a/src/models.ts +++ b/src/models.ts @@ -1,8 +1,8 @@ -import { ExecutionTrigger } from "./enums/execution-trigger" -import { ExecutionStatus } from "./enums/execution-status" +import { ExecutionResourceType } from './enums/execution-resource-type'; +import { ExecutionTrigger } from './enums/execution-trigger'; +import { ExecutionStatus } from './enums/execution-status'; export namespace Models { - declare const __default: unique symbol; /** @@ -10,272 +10,235 @@ export namespace Models { */ export type RowList = { /** - * Total number of rows that matched your query. - */ + * Total number of rows that matched your query. */ total: number; /** - * List of rows. - */ + * List of rows. */ rows: Row[]; - } + }; /** * Documents List */ - export type DocumentList = { + export type DocumentList< + Document extends Models.Document = Models.DefaultDocument, + > = { /** - * Total number of documents that matched your query. - */ + * Total number of documents that matched your query. */ total: number; /** - * List of documents. - */ + * List of documents. */ documents: Document[]; - } + }; /** * Presences List */ export type PresenceList = { /** - * Total number of presences that matched your query. - */ + * Total number of presences that matched your query. */ total: number; /** - * List of presences. - */ + * List of presences. */ presences: Presence[]; - } + }; /** * Sessions List */ export type SessionList = { /** - * Total number of sessions that matched your query. - */ + * Total number of sessions that matched your query. */ total: number; /** - * List of sessions. - */ + * List of sessions. */ sessions: Session[]; - } + }; /** * Identities List */ export type IdentityList = { /** - * Total number of identities that matched your query. - */ + * Total number of identities that matched your query. */ total: number; /** - * List of identities. - */ + * List of identities. */ identities: Identity[]; - } + }; /** * Logs List */ export type LogList = { /** - * Total number of logs that matched your query. - */ + * Total number of logs that matched your query. */ total: number; /** - * List of logs. - */ + * List of logs. */ logs: Log[]; - } + }; /** * Files List */ export type FileList = { /** - * Total number of files that matched your query. - */ + * Total number of files that matched your query. */ total: number; /** - * List of files. - */ + * List of files. */ files: File[]; - } + }; /** * Teams List */ - export type TeamList = { + export type TeamList< + Preferences extends Models.Preferences = Models.DefaultPreferences, + > = { /** - * Total number of teams that matched your query. - */ + * Total number of teams that matched your query. */ total: number; /** - * List of teams. - */ + * List of teams. */ teams: Team[]; - } + }; /** * Memberships List */ export type MembershipList = { /** - * Total number of memberships that matched your query. - */ + * Total number of memberships that matched your query. */ total: number; /** - * List of memberships. - */ + * List of memberships. */ memberships: Membership[]; - } + }; /** * Executions List */ export type ExecutionList = { /** - * Total number of executions that matched your query. - */ + * Total number of executions that matched your query. */ total: number; /** - * List of executions. - */ + * List of executions. */ executions: Execution[]; - } + }; /** * Countries List */ export type CountryList = { /** - * Total number of countries that matched your query. - */ + * Total number of countries that matched your query. */ total: number; /** - * List of countries. - */ + * List of countries. */ countries: Country[]; - } + }; /** * Continents List */ export type ContinentList = { /** - * Total number of continents that matched your query. - */ + * Total number of continents that matched your query. */ total: number; /** - * List of continents. - */ + * List of continents. */ continents: Continent[]; - } + }; /** * Languages List */ export type LanguageList = { /** - * Total number of languages that matched your query. - */ + * Total number of languages that matched your query. */ total: number; /** - * List of languages. - */ + * List of languages. */ languages: Language[]; - } + }; /** * Currencies List */ export type CurrencyList = { /** - * Total number of currencies that matched your query. - */ + * Total number of currencies that matched your query. */ total: number; /** - * List of currencies. - */ + * List of currencies. */ currencies: Currency[]; - } + }; /** * Phones List */ export type PhoneList = { /** - * Total number of phones that matched your query. - */ + * Total number of phones that matched your query. */ total: number; /** - * List of phones. - */ + * List of phones. */ phones: Phone[]; - } + }; /** * Locale codes list */ export type LocaleCodeList = { /** - * Total number of localeCodes that matched your query. - */ + * Total number of localeCodes that matched your query. */ total: number; /** - * List of localeCodes. - */ + * List of localeCodes. */ localeCodes: LocaleCode[]; - } + }; /** * Transaction List */ export type TransactionList = { /** - * Total number of transactions that matched your query. - */ + * Total number of transactions that matched your query. */ total: number; /** - * List of transactions. - */ + * List of transactions. */ transactions: Transaction[]; - } + }; /** * Row */ export type Row = { /** - * Row ID. - */ + * Row ID. */ $id: string; /** - * Row sequence ID. - */ + * Row sequence ID. */ $sequence: string; /** - * Table ID. - */ + * Table ID. */ $tableId: string; /** - * Database ID. - */ + * Database ID. */ $databaseId: string; /** - * Row creation date in ISO 8601 format. - */ + * Row creation date in ISO 8601 format. */ $createdAt: string; /** - * Row update date in ISO 8601 format. - */ + * Row update date in ISO 8601 format. */ $updatedAt: string; /** - * Row permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - */ + * Row permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). */ $permissions: string[]; - } + }; export type DefaultRow = Row & { [key: string]: any; @@ -287,34 +250,27 @@ export namespace Models { */ export type Document = { /** - * Document ID. - */ + * Document ID. */ $id: string; /** - * Document sequence ID. - */ + * Document sequence ID. */ $sequence: string; /** - * Collection ID. - */ + * Collection ID. */ $collectionId: string; /** - * Database ID. - */ + * Database ID. */ $databaseId: string; /** - * Document creation date in ISO 8601 format. - */ + * Document creation date in ISO 8601 format. */ $createdAt: string; /** - * Document update date in ISO 8601 format. - */ + * Document update date in ISO 8601 format. */ $updatedAt: string; /** - * Document permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - */ + * Document permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). */ $permissions: string[]; - } + }; export type DefaultDocument = Document & { [key: string]: any; @@ -326,362 +282,289 @@ export namespace Models { */ export type Presence = { /** - * Presence ID. - */ + * Presence ID. */ $id: string; /** - * Presence creation date in ISO 8601 format. - */ + * Presence creation date in ISO 8601 format. */ $createdAt: string; /** - * Presence update date in ISO 8601 format. - */ + * Presence update date in ISO 8601 format. */ $updatedAt: string; /** - * Presence permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - */ + * Presence permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). */ $permissions: string[]; /** - * User ID. - */ + * User ID. */ userId: string; /** - * Presence status. - */ + * Presence status. */ status?: string; /** - * Presence source. - */ + * Presence source. */ source: string; /** - * Presence expiry date in ISO 8601 format. - */ + * Presence expiry date in ISO 8601 format. */ expiresAt?: string; /** - * Presence metadata. - */ + * Presence metadata. */ metadata?: object; - } + }; /** * Log */ export type Log = { /** - * Event name. - */ + * Event name. */ event: string; /** - * User ID of the actor recorded for this log. During impersonation, this is the original impersonator, not the impersonated target user. - */ + * User ID of the actor recorded for this log. During impersonation, this is the original impersonator, not the impersonated target user. */ userId: string; /** - * User email of the actor recorded for this log. During impersonation, this is the original impersonator. - */ + * User email of the actor recorded for this log. During impersonation, this is the original impersonator. */ userEmail: string; /** - * User name of the actor recorded for this log. During impersonation, this is the original impersonator. - */ + * User name of the actor recorded for this log. During impersonation, this is the original impersonator. */ userName: string; /** - * API mode when event triggered. - */ + * API mode when event triggered. */ mode: string; /** - * User type who triggered the audit log. Possible values: user, admin, guest, hidden, keyProject, keyAccount, keyOrganization. - */ + * User type who triggered the audit log. Possible values: user, admin, guest, hidden, keyProject, keyAccount, keyOrganization. */ userType: string; /** - * IP session in use when the session was created. - */ + * IP session in use when the session was created. */ ip: string; /** - * Log creation date in ISO 8601 format. - */ + * Log creation date in ISO 8601 format. */ time: string; /** - * Operating system code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/os.json). - */ + * 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. - */ + * Operating system name. */ osName: string; /** - * Operating system version. - */ + * Operating system version. */ osVersion: string; /** - * Client type. - */ + * Client type. */ clientType: string; /** - * Client code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/clients.json). - */ + * Client code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/clients.json). */ clientCode: string; /** - * Client name. - */ + * Client name. */ clientName: string; /** - * Client version. - */ + * Client version. */ clientVersion: string; /** - * Client engine name. - */ + * Client engine name. */ clientEngine: string; /** - * Client engine name. - */ + * Client engine name. */ clientEngineVersion: string; /** - * Device name. - */ + * Device name. */ deviceName: string; /** - * Device brand name. - */ + * Device brand name. */ deviceBrand: string; /** - * Device model name. - */ + * Device model name. */ deviceModel: string; /** - * Country two-character ISO 3166-1 alpha code. - */ + * Country two-character ISO 3166-1 alpha code. */ countryCode: string; /** - * Country name. - */ + * Country name. */ countryName: string; - } + }; /** * User */ - export type User = { + export type User< + Preferences extends Models.Preferences = Models.DefaultPreferences, + > = { /** - * User ID. - */ + * User ID. */ $id: string; /** - * User creation date in ISO 8601 format. - */ + * User creation date in ISO 8601 format. */ $createdAt: string; /** - * User update date in ISO 8601 format. - */ + * User update date in ISO 8601 format. */ $updatedAt: string; /** - * User name. - */ + * User name. */ name: string; /** - * Hashed user password. - */ + * Hashed user password. */ password?: string; /** - * Password hashing algorithm. - */ + * Password hashing algorithm. */ hash?: string; /** - * Password hashing algorithm configuration. - */ + * Password hashing algorithm configuration. */ hashOptions?: object; /** - * User registration date in ISO 8601 format. - */ + * User registration date in ISO 8601 format. */ registration: string; /** - * User status. Pass `true` for enabled and `false` for disabled. - */ + * User status. Pass `true` for enabled and `false` for disabled. */ status: boolean; /** - * Labels for the user. - */ + * Labels for the user. */ labels: string[]; /** - * Password update time in ISO 8601 format. - */ + * Password update time in ISO 8601 format. */ passwordUpdate: string; /** - * User email address. - */ + * User email address. */ email: string; /** - * User phone number in E.164 format. - */ + * User phone number in E.164 format. */ phone: string; /** - * Email verification status. - */ + * Email verification status. */ emailVerification: boolean; /** - * Canonical form of the user email address. - */ + * Canonical form of the user email address. */ emailCanonical?: string; /** - * Whether the user email is from a free email provider. - */ + * Whether the user email is from a free email provider. */ emailIsFree?: boolean; /** - * Whether the user email is from a disposable email provider. - */ + * Whether the user email is from a disposable email provider. */ emailIsDisposable?: boolean; /** - * Whether the user email is from a corporate domain. - */ + * Whether the user email is from a corporate domain. */ emailIsCorporate?: boolean; /** - * Whether the user email is in its canonical form. - */ + * Whether the user email is in its canonical form. */ emailIsCanonical?: boolean; /** - * Phone verification status. - */ + * Phone verification status. */ phoneVerification: boolean; /** - * Multi factor authentication status. - */ + * Multi factor authentication status. */ mfa: boolean; /** - * User preferences as a key-value object - */ + * User preferences as a key-value object */ prefs: Preferences; /** - * A user-owned message receiver. A single user may have multiple e.g. emails, phones, and a browser. Each target is registered with a single provider. - */ + * A user-owned message receiver. A single user may have multiple e.g. emails, phones, and a browser. Each target is registered with a single provider. */ targets: Target[]; /** - * Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours. - */ + * Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours. */ accessedAt: string; /** - * Whether the user can impersonate other users. - */ + * Whether the user can impersonate other users. */ impersonator?: boolean; /** - * ID of the original actor performing the impersonation. Present only when the current request is impersonating another user. Internal audit logs attribute the action to this user, while the impersonated target is recorded only in internal audit payload data. - */ + * ID of the original actor performing the impersonation. Present only when the current request is impersonating another user. Internal audit logs attribute the action to this user, while the impersonated target is recorded only in internal audit payload data. */ impersonatorUserId?: string; - } + }; /** * AlgoMD5 */ export type AlgoMd5 = { /** - * Algo type. - */ + * Algo type. */ type: string; - } + }; /** * AlgoSHA */ export type AlgoSha = { /** - * Algo type. - */ + * Algo type. */ type: string; - } + }; /** * AlgoPHPass */ export type AlgoPhpass = { /** - * Algo type. - */ + * Algo type. */ type: string; - } + }; /** * AlgoBcrypt */ export type AlgoBcrypt = { /** - * Algo type. - */ + * Algo type. */ type: string; - } + }; /** * AlgoScrypt */ export type AlgoScrypt = { /** - * Algo type. - */ + * Algo type. */ type: string; /** - * CPU complexity of computed hash. - */ + * CPU complexity of computed hash. */ costCpu: number; /** - * Memory complexity of computed hash. - */ + * Memory complexity of computed hash. */ costMemory: number; /** - * Parallelization of computed hash. - */ + * Parallelization of computed hash. */ costParallel: number; /** - * Length used to compute hash. - */ + * Length used to compute hash. */ length: number; - } + }; /** * AlgoScryptModified */ export type AlgoScryptModified = { /** - * Algo type. - */ + * Algo type. */ type: string; /** - * Salt used to compute hash. - */ + * Salt used to compute hash. */ salt: string; /** - * Separator used to compute hash. - */ + * Separator used to compute hash. */ saltSeparator: string; /** - * Key used to compute hash. - */ + * Key used to compute hash. */ signerKey: string; - } + }; /** * AlgoArgon2 */ export type AlgoArgon2 = { /** - * Algo type. - */ + * Algo type. */ type: string; /** - * Memory used to compute hash. - */ + * Memory used to compute hash. */ memoryCost: number; /** - * Amount of time consumed to compute hash - */ + * Amount of time consumed to compute hash */ timeCost: number; /** - * Number of threads used to compute hash. - */ + * Number of threads used to compute hash. */ threads: number; - } + }; /** * Preferences */ - export type Preferences = { - } + export type Preferences = {}; export type DefaultPreferences = Preferences & { [key: string]: any; @@ -693,828 +576,816 @@ export namespace Models { */ export type Session = { /** - * Session ID. - */ + * Session ID. */ $id: string; /** - * Session creation date in ISO 8601 format. - */ + * Session creation date in ISO 8601 format. */ $createdAt: string; /** - * Session update date in ISO 8601 format. - */ + * Session update date in ISO 8601 format. */ $updatedAt: string; /** - * User ID. - */ + * User ID. */ userId: string; /** - * Session expiration date in ISO 8601 format. - */ + * Session expiration date in ISO 8601 format. */ expire: string; /** - * Session Provider. - */ + * Session Provider. */ provider: string; /** - * Session Provider User ID. - */ + * Session Provider User ID. */ providerUid: string; /** - * Session Provider Access Token. - */ + * Session Provider Access Token. */ providerAccessToken: string; /** - * The date of when the access token expires in ISO 8601 format. - */ + * The date of when the access token expires in ISO 8601 format. */ providerAccessTokenExpiry: string; /** - * Session Provider Refresh Token. - */ + * Session Provider Refresh Token. */ providerRefreshToken: string; /** - * IP in use when the session was created. - */ + * IP in use when the session was created. */ ip: string; /** - * Operating system code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/os.json). - */ + * 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. - */ + * Operating system name. */ osName: string; /** - * Operating system version. - */ + * Operating system version. */ osVersion: string; /** - * Client type. - */ + * Client type. */ clientType: string; /** - * Client code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/clients.json). - */ + * Client code name. View list of [available options](https://github.com/appwrite/appwrite/blob/master/docs/lists/clients.json). */ clientCode: string; /** - * Client name. - */ + * Client name. */ clientName: string; /** - * Client version. - */ + * Client version. */ clientVersion: string; /** - * Client engine name. - */ + * Client engine name. */ clientEngine: string; /** - * Client engine name. - */ + * Client engine name. */ clientEngineVersion: string; /** - * Device name. - */ + * Device name. */ deviceName: string; /** - * Device brand name. - */ + * Device brand name. */ deviceBrand: string; /** - * Device model name. - */ + * Device model name. */ deviceModel: string; /** - * Country two-character ISO 3166-1 alpha code. - */ + * Country two-character ISO 3166-1 alpha code. */ countryCode: string; /** - * Country name. - */ + * Country name. */ countryName: string; /** - * Returns true if this the current user session. - */ + * Returns true if this the current user session. */ current: boolean; /** - * Returns a list of active session factors. - */ + * Returns a list of active session factors. */ factors: string[]; /** - * Secret used to authenticate the user. Only included if the request was made with an API key - */ + * Secret used to authenticate the user. Only included if the request was made with an API key */ secret: string; /** - * Most recent date in ISO 8601 format when the session successfully passed MFA challenge. - */ + * Most recent date in ISO 8601 format when the session successfully passed MFA challenge. */ mfaUpdatedAt: string; - } + }; /** * Identity */ export type Identity = { /** - * Identity ID. - */ + * Identity ID. */ $id: string; /** - * Identity creation date in ISO 8601 format. - */ + * Identity creation date in ISO 8601 format. */ $createdAt: string; /** - * Identity update date in ISO 8601 format. - */ + * Identity update date in ISO 8601 format. */ $updatedAt: string; /** - * User ID. - */ + * User ID. */ userId: string; /** - * Identity Provider. - */ + * Identity Provider. */ provider: string; /** - * ID of the User in the Identity Provider. - */ + * ID of the User in the Identity Provider. */ providerUid: string; /** - * Email of the User in the Identity Provider. - */ + * Email of the User in the Identity Provider. */ providerEmail: string; /** - * Identity Provider Access Token. - */ + * Identity Provider Access Token. */ providerAccessToken: string; /** - * The date of when the access token expires in ISO 8601 format. - */ + * The date of when the access token expires in ISO 8601 format. */ providerAccessTokenExpiry: string; /** - * Identity Provider Refresh Token. - */ + * Identity Provider Refresh Token. */ providerRefreshToken: string; - } + }; /** * Token */ export type Token = { /** - * Token ID. - */ + * Token ID. */ $id: string; /** - * Token creation date in ISO 8601 format. - */ + * Token creation date in ISO 8601 format. */ $createdAt: string; /** - * User ID. - */ + * User ID. */ userId: string; /** - * Token secret key. This will return an empty string unless the response is returned using an API key or as part of a webhook payload. - */ + * Token secret key. This will return an empty string unless the response is returned using an API key or as part of a webhook payload. */ secret: string; /** - * Token expiration date in ISO 8601 format. - */ + * Token expiration date in ISO 8601 format. */ expire: string; /** - * Security phrase of a token. Empty if security phrase was not requested when creating a token. It includes randomly generated phrase which is also sent in the external resource such as email. - */ + * Security phrase of a token. Empty if security phrase was not requested when creating a token. It includes randomly generated phrase which is also sent in the external resource such as email. */ phrase: string; - } + }; /** * JWT */ export type Jwt = { /** - * JWT encoded string. - */ + * JWT encoded string. */ jwt: string; - } + }; /** * Locale */ export type Locale = { /** - * User IP address. - */ + * User IP address. */ ip: string; /** - * Country code in [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) two-character format - */ + * Country code in [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) two-character format */ countryCode: string; /** - * Country name. This field support localization. - */ + * Country name. This field support localization. */ country: string; /** - * Continent code. A two character continent code "AF" for Africa, "AN" for Antarctica, "AS" for Asia, "EU" for Europe, "NA" for North America, "OC" for Oceania, and "SA" for South America. - */ + * Continent code. A two character continent code "AF" for Africa, "AN" for Antarctica, "AS" for Asia, "EU" for Europe, "NA" for North America, "OC" for Oceania, and "SA" for South America. */ continentCode: string; /** - * Continent name. This field support localization. - */ + * Continent name. This field support localization. */ continent: string; /** - * True if country is part of the European Union. - */ + * True if country is part of the European Union. */ eu: boolean; /** - * Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format - */ + * Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format */ currency: string; /** - * City - */ + * City */ city?: string; /** - * Name of timezone - */ + * Name of timezone */ timeZone?: string; /** - * Postal code - */ + * Postal code */ postalCode?: string; /** - * Latitude - */ + * Latitude */ latitude?: number; /** - * Longitude - */ + * Longitude */ longitude?: number; /** - * Autonomous System Number (ASN) of the IP - */ + * Autonomous System Number (ASN) of the IP */ autonomousSystemNumber?: string; /** - * Organization that owns the ASN - */ + * Organization that owns the ASN */ autonomousSystemOrganization?: string; /** - * Internet service provider of the IP - */ + * Internet service provider of the IP */ isp?: string; /** - * Connection type of the IP (e.g. cable, cellular, corporate) - */ + * Connection type of the IP (e.g. cable, cellular, corporate) */ connectionType?: string; /** - * User type classification of the IP (e.g. residential, business, hosting) - */ + * User type classification of the IP (e.g. residential, business, hosting) */ connectionUsageType?: string; /** - * Registered organization of the IP - */ + * Registered organization of the IP */ connectionOrganization?: string; - } + }; /** * LocaleCode */ export type LocaleCode = { /** - * Locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) - */ + * Locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) */ code: string; /** - * Locale name - */ + * Locale name */ name: string; - } + }; /** * File */ export type File = { /** - * File ID. - */ + * File ID. */ $id: string; /** - * Bucket ID. - */ + * Bucket ID. */ bucketId: string; /** - * File creation date in ISO 8601 format. - */ + * File creation date in ISO 8601 format. */ $createdAt: string; /** - * File update date in ISO 8601 format. - */ + * File update date in ISO 8601 format. */ $updatedAt: string; /** - * File permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). - */ + * File permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). */ $permissions: string[]; /** - * File name. - */ + * File name. */ name: string; /** - * File MD5 signature. - */ + * Virtual folder containing the file, with a trailing slash. Empty for the bucket root. */ + folder: string; + /** + * Full virtual path of the file: the folder followed by the file name. */ + key: string; + /** + * File MD5 signature. */ signature: string; /** - * File mime type. - */ + * File mime type. */ mimeType: string; /** - * File original size in bytes. - */ + * File original size in bytes. */ sizeOriginal: number; /** - * File actual stored size in bytes after compression and/or encryption. - */ + * File actual stored size in bytes after compression and/or encryption. */ sizeActual: number; /** - * Total number of chunks available - */ + * Total number of chunks available */ chunksTotal: number; /** - * Total number of chunks uploaded - */ + * Total number of chunks uploaded */ chunksUploaded: number; /** - * Whether file contents are encrypted at rest. - */ + * Whether file contents are encrypted at rest. */ encryption: boolean; /** - * Compression algorithm used for the file. Will be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd). - */ + * Compression algorithm used for the file. Will be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd). */ compression: string; - } + }; /** * Team */ - export type Team = { + export type Team< + Preferences extends Models.Preferences = Models.DefaultPreferences, + > = { /** - * Team ID. - */ + * Team ID. */ $id: string; /** - * Team creation date in ISO 8601 format. - */ + * Team creation date in ISO 8601 format. */ $createdAt: string; /** - * Team update date in ISO 8601 format. - */ + * Team update date in ISO 8601 format. */ $updatedAt: string; /** - * Team name. - */ + * Team name. */ name: string; /** - * Total number of team members. - */ + * Total number of team members. */ total: number; /** - * Team preferences as a key-value object - */ + * Team preferences as a key-value object */ prefs: Preferences; - } + }; /** * Membership */ export type Membership = { /** - * Membership ID. - */ + * Membership ID. */ $id: string; /** - * Membership creation date in ISO 8601 format. - */ + * Membership creation date in ISO 8601 format. */ $createdAt: string; /** - * Membership update date in ISO 8601 format. - */ + * Membership update date in ISO 8601 format. */ $updatedAt: string; /** - * User ID. - */ + * User ID. */ userId: string; /** - * User name. Hide this attribute by toggling membership privacy in the Console. - */ + * User name. Hide this attribute by toggling membership privacy in the Console. */ userName: string; /** - * User email address. Hide this attribute by toggling membership privacy in the Console. - */ + * User email address. Hide this attribute by toggling membership privacy in the Console. */ userEmail: string; /** - * User phone number. Hide this attribute by toggling membership privacy in the Console. - */ + * User phone number. Hide this attribute by toggling membership privacy in the Console. */ userPhone: string; /** - * Team ID. - */ + * Team ID. */ teamId: string; /** - * Team name. - */ + * Team name. */ teamName: string; /** - * Date, the user has been invited to join the team in ISO 8601 format. - */ + * Date, the user has been invited to join the team in ISO 8601 format. */ invited: string; /** - * Date, the user has accepted the invitation to join the team in ISO 8601 format. - */ + * Date, the user has accepted the invitation to join the team in ISO 8601 format. */ joined: string; /** - * User confirmation status, true if the user has joined the team or false otherwise. - */ + * User confirmation status, true if the user has joined the team or false otherwise. */ confirm: boolean; /** - * Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console. - */ + * 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. - */ + * Most recent access date in ISO 8601 format. Show this attribute by toggling membership privacy in the Console. */ userAccessedAt: string; /** - * User list of roles - */ + * User list of roles */ roles: string[]; - } + }; /** * Execution */ export type Execution = { /** - * Execution ID. - */ + * Execution ID. */ $id: string; /** - * Execution creation date in ISO 8601 format. - */ + * Execution creation date in ISO 8601 format. */ $createdAt: string; /** - * Execution update date in ISO 8601 format. - */ + * Execution update date in ISO 8601 format. */ $updatedAt: string; /** - * Execution roles. - */ + * Execution roles. */ $permissions: string[]; /** - * Function ID. - */ - functionId: string; + * Function or site ID. */ + resourceId: string; /** - * Function's deployment ID used to create the execution. - */ + * Execution resource type. */ + resourceType: ExecutionResourceType; + /** + * Deployment ID used to create the execution. */ deploymentId: string; /** - * The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`. - */ + * The trigger that caused the resource to execute. Possible values can be: `http`, `schedule`, or `event`. */ trigger: ExecutionTrigger; /** - * The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, `failed`, or `scheduled`. - */ + * The status of the resource execution. Possible values can be: `waiting`, `processing`, `completed`, `failed`, or `scheduled`. */ status: ExecutionStatus; /** - * HTTP request method type. - */ + * HTTP request method type. */ requestMethod: string; /** - * HTTP request path and query. - */ + * HTTP request path and query. */ requestPath: string; /** - * HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous. - */ + * HTTP request headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous. */ requestHeaders: Headers[]; /** - * HTTP response status code. - */ + * HTTP response status code. */ responseStatusCode: number; /** - * HTTP response body. This will return empty unless execution is created as synchronous. - */ + * HTTP response body. This will return empty unless execution is created as synchronous. */ responseBody: string; /** - * HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous. - */ + * HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous. */ responseHeaders: Headers[]; /** - * Function logs. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload. - */ + * Resource logs. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload. */ logs: string; /** - * Function errors. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload. - */ + * Resource errors. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload. */ errors: string; /** - * Resource(function/site) execution duration in seconds. - */ + * Resource(function/site) execution duration in seconds. */ duration: number; /** - * The scheduled time for execution. If left empty, execution will be queued immediately. - */ + * The scheduled time for execution. If left empty, execution will be queued immediately. */ scheduledAt?: string; - } + }; /** * Country */ export type Country = { /** - * Country name. - */ + * Country name. */ name: string; /** - * Country two-character ISO 3166-1 alpha code. - */ + * Country two-character ISO 3166-1 alpha code. */ code: string; - } + }; /** * Continent */ export type Continent = { /** - * Continent name. - */ + * Continent name. */ name: string; /** - * Continent two letter code. - */ + * Continent two letter code. */ code: string; - } + }; /** * Language */ export type Language = { /** - * Language name. - */ + * Language name. */ name: string; /** - * Language two-character ISO 639-1 codes. - */ + * Language two-character ISO 639-1 codes. */ code: string; /** - * Language native name. - */ + * Language native name. */ nativeName: string; - } + }; /** * Currency */ export type Currency = { /** - * Currency symbol. - */ + * Currency symbol. */ symbol: string; /** - * Currency name. - */ + * Currency name. */ name: string; /** - * Currency native symbol. - */ + * Currency native symbol. */ symbolNative: string; /** - * Number of decimal digits. - */ + * Number of decimal digits. */ decimalDigits: number; /** - * Currency digit rounding. - */ + * Currency digit rounding. */ rounding: number; /** - * Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format. - */ + * Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format. */ code: string; /** - * Currency plural name - */ + * Currency plural name */ namePlural: string; - } + }; /** * Phone */ export type Phone = { /** - * Phone code. - */ + * Phone code. */ code: string; /** - * Country two-character ISO 3166-1 alpha code. - */ + * Country two-character ISO 3166-1 alpha code. */ countryCode: string; /** - * Country name. - */ + * Country name. */ countryName: string; - } + }; /** * Headers */ export type Headers = { /** - * Header name. - */ + * Header name. */ name: string; /** - * Header value. - */ + * Header value. */ value: string; - } + }; /** * MFA Challenge */ export type MfaChallenge = { /** - * Token ID. - */ + * Token ID. */ $id: string; /** - * Token creation date in ISO 8601 format. - */ + * Token creation date in ISO 8601 format. */ $createdAt: string; /** - * User ID. - */ + * User ID. */ userId: string; /** - * Token expiration date in ISO 8601 format. - */ + * Token expiration date in ISO 8601 format. */ expire: string; - } + }; /** * MFA Recovery Codes */ export type MfaRecoveryCodes = { /** - * Recovery codes. - */ + * Recovery codes. */ recoveryCodes: string[]; - } + }; /** * MFAType */ export type MfaType = { /** - * Secret token used for TOTP factor. - */ + * Secret token used for TOTP factor. */ secret: string; /** - * URI for authenticator apps. - */ + * URI for authenticator apps. */ uri: string; - } + }; /** * MFAFactors */ export type MfaFactors = { /** - * Can TOTP be used for MFA challenge for this account. - */ + * Can TOTP be used for MFA challenge for this account. */ totp: boolean; /** - * Can phone (SMS) be used for MFA challenge for this account. - */ + * Can phone (SMS) be used for MFA challenge for this account. */ phone: boolean; /** - * Can email be used for MFA challenge for this account. - */ + * Can email be used for MFA challenge for this account. */ email: boolean; /** - * Can recovery code be used for MFA challenge for this account. - */ + * Can recovery code be used for MFA challenge for this account. */ recoveryCode: boolean; - } + /** + * Can custom factor be used for MFA challenge for this account. */ + custom: boolean; + }; /** * Transaction */ export type Transaction = { /** - * Transaction ID. - */ + * Transaction ID. */ $id: string; /** - * Transaction creation time in ISO 8601 format. - */ + * Transaction creation time in ISO 8601 format. */ $createdAt: string; /** - * Transaction update date in ISO 8601 format. - */ + * Transaction update date in ISO 8601 format. */ $updatedAt: string; /** - * Current status of the transaction. One of: pending, committing, committed, rolled_back, failed. - */ + * Current status of the transaction. One of: pending, committing, committed, rolled_back, failed. */ status: string; /** - * Number of operations in the transaction. - */ + * Number of operations in the transaction. */ operations: number; /** - * Expiration time in ISO 8601 format. - */ + * Expiration time in ISO 8601 format. */ expiresAt: string; - } + }; /** * Subscriber */ export type Subscriber = { /** - * Subscriber ID. - */ + * Subscriber ID. */ $id: string; /** - * Subscriber creation time in ISO 8601 format. - */ + * Subscriber creation time in ISO 8601 format. */ $createdAt: string; /** - * Subscriber update date in ISO 8601 format. - */ + * Subscriber update date in ISO 8601 format. */ $updatedAt: string; /** - * Target ID. - */ + * Target ID. */ targetId: string; /** - * Target. - */ + * Target. */ target: Target; /** - * Topic ID. - */ + * Topic ID. */ userId: string; /** - * User Name. - */ + * User Name. */ userName: string; /** - * Topic ID. - */ + * Topic ID. */ topicId: string; /** - * The target provider type. Can be one of the following: `email`, `sms` or `push`. - */ + * The target provider type. Can be one of the following: `email`, `sms` or `push`. */ providerType: string; - } + }; /** * Target */ export type Target = { /** - * Target ID. - */ + * Target ID. */ $id: string; /** - * Target creation time in ISO 8601 format. - */ + * Target creation time in ISO 8601 format. */ $createdAt: string; /** - * Target update date in ISO 8601 format. - */ + * Target update date in ISO 8601 format. */ $updatedAt: string; /** - * Target Name. - */ + * Target Name. */ name: string; /** - * User ID. - */ + * User ID. */ userId: string; /** - * Provider ID. - */ + * Provider ID. */ providerId?: string; /** - * The target provider type. Can be one of the following: `email`, `sms` or `push`. - */ + * The target provider type. Can be one of the following: `email`, `sms` or `push`. */ providerType: string; /** - * The target identifier. - */ + * The target identifier. */ identifier: string; /** - * Is the target expired. - */ + * Is the target expired. */ expired: 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: Record[]; + /** + * 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; + }; + + /** + * 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 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[]; + }; + + /** + * App installations list + */ + export type AppInstallationList = { + /** + * Total number of installations that matched your query. */ + total: number; + /** + * List of installations. */ + installations: AppInstallation[]; + }; } diff --git a/src/operator.ts b/src/operator.ts index 2386a6c4..86b59205 100644 --- a/src/operator.ts +++ b/src/operator.ts @@ -3,306 +3,304 @@ export type OperatorValuesList = string[] | number[] | boolean[] | any[]; export type OperatorValues = OperatorValuesSingle | OperatorValuesList; export enum Condition { - Equal = "equal", - NotEqual = "notEqual", - GreaterThan = "greaterThan", - GreaterThanEqual = "greaterThanEqual", - LessThan = "lessThan", - LessThanEqual = "lessThanEqual", - Contains = "contains", - IsNull = "isNull", - IsNotNull = "isNotNull", + Equal = 'equal', + NotEqual = 'notEqual', + GreaterThan = 'greaterThan', + GreaterThanEqual = 'greaterThanEqual', + LessThan = 'lessThan', + LessThanEqual = 'lessThanEqual', + Contains = 'contains', + IsNull = 'isNull', + IsNotNull = 'isNotNull', } /** * Helper class to generate operator strings for atomic operations. */ export class Operator { - method: string; - values: OperatorValuesList | undefined; + method: string; + values: OperatorValuesList | undefined; - /** - * Constructor for Operator class. - * - * @param {string} method - * @param {OperatorValues} values - */ - constructor( - method: string, - values?: OperatorValues - ) { - this.method = method; + /** + * Constructor for Operator class. + * + * @param {string} method + * @param {OperatorValues} values + */ + constructor(method: string, values?: OperatorValues) { + this.method = method; - if (values !== undefined) { - if (Array.isArray(values)) { - this.values = values; - } else { - this.values = [values] as OperatorValuesList; - } + if (values !== undefined) { + if (Array.isArray(values)) { + this.values = values; + } else { + this.values = [values] as OperatorValuesList; + } + } } - } - /** - * Convert the operator object to a JSON string. - * - * @returns {string} - */ - toString(): string { - return JSON.stringify({ - method: this.method, - values: this.values, - }); - } - - /** - * Increment a numeric attribute by a specified value. - * - * @param {number} value - * @param {number} max - * @returns {string} - */ - static increment = (value: number = 1, max?: number): string => { - if (isNaN(value) || !isFinite(value)) { - throw new Error("Value cannot be NaN or Infinity"); - } - if (max !== undefined && (isNaN(max) || !isFinite(max))) { - throw new Error("Max cannot be NaN or Infinity"); - } - const values: any[] = [value]; - if (max !== undefined) { - values.push(max); + /** + * Convert the operator object to a JSON string. + * + * @returns {string} + */ + toString(): string { + return JSON.stringify({ + method: this.method, + values: this.values, + }); } - return new Operator("increment", values).toString(); - }; - /** - * Decrement a numeric attribute by a specified value. - * - * @param {number} value - * @param {number} min - * @returns {string} - */ - static decrement = (value: number = 1, min?: number): string => { - if (isNaN(value) || !isFinite(value)) { - throw new Error("Value cannot be NaN or Infinity"); - } - if (min !== undefined && (isNaN(min) || !isFinite(min))) { - throw new Error("Min cannot be NaN or Infinity"); - } - const values: any[] = [value]; - if (min !== undefined) { - values.push(min); - } - return new Operator("decrement", values).toString(); - }; + /** + * Increment a numeric attribute by a specified value. + * + * @param {number} value + * @param {number} max + * @returns {string} + */ + static increment = (value: number = 1, max?: number): string => { + if (isNaN(value) || !isFinite(value)) { + throw new Error('Value cannot be NaN or Infinity'); + } + if (max !== undefined && (isNaN(max) || !isFinite(max))) { + throw new Error('Max cannot be NaN or Infinity'); + } + const values: any[] = [value]; + if (max !== undefined) { + values.push(max); + } + return new Operator('increment', values).toString(); + }; - /** - * Multiply a numeric attribute by a specified factor. - * - * @param {number} factor - * @param {number} max - * @returns {string} - */ - static multiply = (factor: number, max?: number): string => { - if (isNaN(factor) || !isFinite(factor)) { - throw new Error("Factor cannot be NaN or Infinity"); - } - if (max !== undefined && (isNaN(max) || !isFinite(max))) { - throw new Error("Max cannot be NaN or Infinity"); - } - const values: any[] = [factor]; - if (max !== undefined) { - values.push(max); - } - return new Operator("multiply", values).toString(); - }; + /** + * Decrement a numeric attribute by a specified value. + * + * @param {number} value + * @param {number} min + * @returns {string} + */ + static decrement = (value: number = 1, min?: number): string => { + if (isNaN(value) || !isFinite(value)) { + throw new Error('Value cannot be NaN or Infinity'); + } + if (min !== undefined && (isNaN(min) || !isFinite(min))) { + throw new Error('Min cannot be NaN or Infinity'); + } + const values: any[] = [value]; + if (min !== undefined) { + values.push(min); + } + return new Operator('decrement', values).toString(); + }; - /** - * Divide a numeric attribute by a specified divisor. - * - * @param {number} divisor - * @param {number} min - * @returns {string} - */ - static divide = (divisor: number, min?: number): string => { - if (isNaN(divisor) || !isFinite(divisor)) { - throw new Error("Divisor cannot be NaN or Infinity"); - } - if (min !== undefined && (isNaN(min) || !isFinite(min))) { - throw new Error("Min cannot be NaN or Infinity"); - } - if (divisor === 0) { - throw new Error("Divisor cannot be zero"); - } - const values: any[] = [divisor]; - if (min !== undefined) { - values.push(min); - } - return new Operator("divide", values).toString(); - }; + /** + * Multiply a numeric attribute by a specified factor. + * + * @param {number} factor + * @param {number} max + * @returns {string} + */ + static multiply = (factor: number, max?: number): string => { + if (isNaN(factor) || !isFinite(factor)) { + throw new Error('Factor cannot be NaN or Infinity'); + } + if (max !== undefined && (isNaN(max) || !isFinite(max))) { + throw new Error('Max cannot be NaN or Infinity'); + } + const values: any[] = [factor]; + if (max !== undefined) { + values.push(max); + } + return new Operator('multiply', values).toString(); + }; - /** - * Apply modulo operation on a numeric attribute. - * - * @param {number} divisor - * @returns {string} - */ - static modulo = (divisor: number): string => { - if (isNaN(divisor) || !isFinite(divisor)) { - throw new Error("Divisor cannot be NaN or Infinity"); - } - if (divisor === 0) { - throw new Error("Divisor cannot be zero"); - } - return new Operator("modulo", [divisor]).toString(); - }; + /** + * Divide a numeric attribute by a specified divisor. + * + * @param {number} divisor + * @param {number} min + * @returns {string} + */ + static divide = (divisor: number, min?: number): string => { + if (isNaN(divisor) || !isFinite(divisor)) { + throw new Error('Divisor cannot be NaN or Infinity'); + } + if (min !== undefined && (isNaN(min) || !isFinite(min))) { + throw new Error('Min cannot be NaN or Infinity'); + } + if (divisor === 0) { + throw new Error('Divisor cannot be zero'); + } + const values: any[] = [divisor]; + if (min !== undefined) { + values.push(min); + } + return new Operator('divide', values).toString(); + }; - /** - * Raise a numeric attribute to a specified power. - * - * @param {number} exponent - * @param {number} max - * @returns {string} - */ - static power = (exponent: number, max?: number): string => { - if (isNaN(exponent) || !isFinite(exponent)) { - throw new Error("Exponent cannot be NaN or Infinity"); - } - if (max !== undefined && (isNaN(max) || !isFinite(max))) { - throw new Error("Max cannot be NaN or Infinity"); - } - const values: any[] = [exponent]; - if (max !== undefined) { - values.push(max); - } - return new Operator("power", values).toString(); - }; + /** + * Apply modulo operation on a numeric attribute. + * + * @param {number} divisor + * @returns {string} + */ + static modulo = (divisor: number): string => { + if (isNaN(divisor) || !isFinite(divisor)) { + throw new Error('Divisor cannot be NaN or Infinity'); + } + if (divisor === 0) { + throw new Error('Divisor cannot be zero'); + } + return new Operator('modulo', [divisor]).toString(); + }; + + /** + * Raise a numeric attribute to a specified power. + * + * @param {number} exponent + * @param {number} max + * @returns {string} + */ + static power = (exponent: number, max?: number): string => { + if (isNaN(exponent) || !isFinite(exponent)) { + throw new Error('Exponent cannot be NaN or Infinity'); + } + if (max !== undefined && (isNaN(max) || !isFinite(max))) { + throw new Error('Max cannot be NaN or Infinity'); + } + const values: any[] = [exponent]; + if (max !== undefined) { + values.push(max); + } + return new Operator('power', values).toString(); + }; - /** - * Append values to an array attribute. - * - * @param {any[]} values - * @returns {string} - */ - static arrayAppend = (values: any[]): string => - new Operator("arrayAppend", values).toString(); + /** + * Append values to an array attribute. + * + * @param {any[]} values + * @returns {string} + */ + static arrayAppend = (values: any[]): string => + new Operator('arrayAppend', values).toString(); - /** - * Prepend values to an array attribute. - * - * @param {any[]} values - * @returns {string} - */ - static arrayPrepend = (values: any[]): string => - new Operator("arrayPrepend", values).toString(); + /** + * Prepend values to an array attribute. + * + * @param {any[]} values + * @returns {string} + */ + static arrayPrepend = (values: any[]): string => + new Operator('arrayPrepend', values).toString(); - /** - * Insert a value at a specific index in an array attribute. - * - * @param {number} index - * @param {any} value - * @returns {string} - */ - static arrayInsert = (index: number, value: any): string => - new Operator("arrayInsert", [index, value]).toString(); + /** + * Insert a value at a specific index in an array attribute. + * + * @param {number} index + * @param {any} value + * @returns {string} + */ + static arrayInsert = (index: number, value: any): string => + new Operator('arrayInsert', [index, value]).toString(); - /** - * Remove a value from an array attribute. - * - * @param {any} value - * @returns {string} - */ - static arrayRemove = (value: any): string => - new Operator("arrayRemove", [value]).toString(); + /** + * Remove a value from an array attribute. + * + * @param {any} value + * @returns {string} + */ + static arrayRemove = (value: any): string => + new Operator('arrayRemove', [value]).toString(); - /** - * Remove duplicate values from an array attribute. - * - * @returns {string} - */ - static arrayUnique = (): string => - new Operator("arrayUnique", []).toString(); + /** + * Remove duplicate values from an array attribute. + * + * @returns {string} + */ + static arrayUnique = (): string => + new Operator('arrayUnique', []).toString(); - /** - * Keep only values that exist in both the current array and the provided array. - * - * @param {any[]} values - * @returns {string} - */ - static arrayIntersect = (values: any[]): string => - new Operator("arrayIntersect", values).toString(); + /** + * Keep only values that exist in both the current array and the provided array. + * + * @param {any[]} values + * @returns {string} + */ + static arrayIntersect = (values: any[]): string => + new Operator('arrayIntersect', values).toString(); - /** - * Remove values from the array that exist in the provided array. - * - * @param {any[]} values - * @returns {string} - */ - static arrayDiff = (values: any[]): string => - new Operator("arrayDiff", values).toString(); + /** + * Remove values from the array that exist in the provided array. + * + * @param {any[]} values + * @returns {string} + */ + static arrayDiff = (values: any[]): string => + new Operator('arrayDiff', values).toString(); - /** - * Filter array values based on a condition. - * - * @param {Condition} condition - * @param {any} value - * @returns {string} - */ - static arrayFilter = (condition: Condition, value?: any): string => { - const values: any[] = [condition as string, value === undefined ? null : value]; - return new Operator("arrayFilter", values).toString(); - }; + /** + * Filter array values based on a condition. + * + * @param {Condition} condition + * @param {any} value + * @returns {string} + */ + static arrayFilter = (condition: Condition, value?: any): string => { + const values: any[] = [ + condition as string, + value === undefined ? null : value, + ]; + return new Operator('arrayFilter', values).toString(); + }; - /** - * Concatenate a value to a string or array attribute. - * - * @param {any} value - * @returns {string} - */ - static stringConcat = (value: any): string => - new Operator("stringConcat", [value]).toString(); + /** + * Concatenate a value to a string or array attribute. + * + * @param {any} value + * @returns {string} + */ + static stringConcat = (value: any): string => + new Operator('stringConcat', [value]).toString(); - /** - * Replace occurrences of a search string with a replacement string. - * - * @param {string} search - * @param {string} replace - * @returns {string} - */ - static stringReplace = (search: string, replace: string): string => - new Operator("stringReplace", [search, replace]).toString(); + /** + * Replace occurrences of a search string with a replacement string. + * + * @param {string} search + * @param {string} replace + * @returns {string} + */ + static stringReplace = (search: string, replace: string): string => + new Operator('stringReplace', [search, replace]).toString(); - /** - * Toggle a boolean attribute. - * - * @returns {string} - */ - static toggle = (): string => - new Operator("toggle", []).toString(); + /** + * Toggle a boolean attribute. + * + * @returns {string} + */ + static toggle = (): string => new Operator('toggle', []).toString(); - /** - * Add days to a date attribute. - * - * @param {number} days - * @returns {string} - */ - static dateAddDays = (days: number): string => - new Operator("dateAddDays", [days]).toString(); + /** + * Add days to a date attribute. + * + * @param {number} days + * @returns {string} + */ + static dateAddDays = (days: number): string => + new Operator('dateAddDays', [days]).toString(); - /** - * Subtract days from a date attribute. - * - * @param {number} days - * @returns {string} - */ - static dateSubDays = (days: number): string => - new Operator("dateSubDays", [days]).toString(); + /** + * Subtract days from a date attribute. + * + * @param {number} days + * @returns {string} + */ + static dateSubDays = (days: number): string => + new Operator('dateSubDays', [days]).toString(); - /** - * Set a date attribute to the current date and time. - * - * @returns {string} - */ - static dateSetNow = (): string => - new Operator("dateSetNow", []).toString(); + /** + * Set a date attribute to the current date and time. + * + * @returns {string} + */ + static dateSetNow = (): string => new Operator('dateSetNow', []).toString(); } diff --git a/src/permission.ts b/src/permission.ts index bfc330a1..89b68f9f 100644 --- a/src/permission.ts +++ b/src/permission.ts @@ -1,22 +1,21 @@ export class Permission { - static read = (role: string): string => { - return `read("${role}")` - } + return `read("${role}")`; + }; static write = (role: string): string => { - return `write("${role}")` - } + return `write("${role}")`; + }; static create = (role: string): string => { - return `create("${role}")` - } + return `create("${role}")`; + }; static update = (role: string): string => { - return `update("${role}")` - } + return `update("${role}")`; + }; static delete = (role: string): string => { - return `delete("${role}")` - } + return `delete("${role}")`; + }; } diff --git a/src/query.ts b/src/query.ts index a77df1be..104b1ab9 100644 --- a/src/query.ts +++ b/src/query.ts @@ -2,447 +2,503 @@ import JSONbigModule from 'json-bigint'; const JSONbig = JSONbigModule({ useNativeBigInt: true }); type QueryTypesSingle = string | number | bigint | boolean; -export type QueryTypesList = string[] | number[] | bigint[] | boolean[] | Query[] | any[]; +export type QueryTypesList = + string[] | number[] | bigint[] | boolean[] | Query[] | any[]; export type QueryTypes = QueryTypesSingle | QueryTypesList; type AttributesTypes = string | string[]; export class Query { - method: string; - attribute: AttributesTypes | undefined; - values: QueryTypesList | undefined; - - constructor( - method: string, - attribute?: AttributesTypes, - values?: QueryTypes - ) { - this.method = method; - this.attribute = attribute; - - if (values !== undefined) { - if (Array.isArray(values)) { - this.values = values; - } else { - this.values = [values] as QueryTypesList; - } + method: string; + attribute: AttributesTypes | undefined; + values: QueryTypesList | undefined; + + constructor( + method: string, + attribute?: AttributesTypes, + values?: QueryTypes, + ) { + this.method = method; + this.attribute = attribute; + + if (values !== undefined) { + if (Array.isArray(values)) { + this.values = values; + } else { + this.values = [values] as QueryTypesList; + } + } } - } - toString(): string { - return JSONbig.stringify({ - method: this.method, - attribute: this.attribute, - values: this.values, - }); - } - - static equal = (attribute: string, value: QueryTypes): string => - new Query("equal", attribute, value).toString(); - - static notEqual = (attribute: string, value: QueryTypes): string => - new Query("notEqual", attribute, value).toString(); - - /** - * Filter resources where attribute matches a regular expression pattern. - * - * @param {string} attribute The attribute to filter on. - * @param {string} pattern The regular expression pattern to match. - * @returns {string} - */ - static regex = (attribute: string, pattern: string): string => - new Query("regex", attribute, pattern).toString(); - - static lessThan = (attribute: string, value: QueryTypes): string => - new Query("lessThan", attribute, value).toString(); - - static lessThanEqual = (attribute: string, value: QueryTypes): string => - new Query("lessThanEqual", attribute, value).toString(); - - static greaterThan = (attribute: string, value: QueryTypes): string => - new Query("greaterThan", attribute, value).toString(); - - static greaterThanEqual = (attribute: string, value: QueryTypes): string => - new Query("greaterThanEqual", attribute, value).toString(); - - static isNull = (attribute: string): string => - new Query("isNull", attribute).toString(); - - static isNotNull = (attribute: string): string => - new Query("isNotNull", attribute).toString(); - - /** - * Filter resources where the specified attributes exist. - * - * @param {string[]} attributes The list of attributes that must exist. - * @returns {string} - */ - static exists = (attributes: string[]): string => - new Query("exists", undefined, attributes).toString(); - - /** - * Filter resources where the specified attributes do not exist. - * - * @param {string[]} attributes The list of attributes that must not exist. - * @returns {string} - */ - static notExists = (attributes: string[]): string => - new Query("notExists", undefined, attributes).toString(); - - static between = (attribute: string, start: string | number | bigint, end: string | number | bigint) => - new Query("between", attribute, [start, end] as QueryTypesList).toString(); - - static startsWith = (attribute: string, value: string): string => - new Query("startsWith", attribute, value).toString(); - - static endsWith = (attribute: string, value: string): string => - new Query("endsWith", attribute, value).toString(); - - static select = (attributes: string[]): string => - new Query("select", undefined, attributes).toString(); - - static search = (attribute: string, value: string): string => - new Query("search", attribute, value).toString(); - - static orderDesc = (attribute: string): string => - new Query("orderDesc", attribute).toString(); - - static orderAsc = (attribute: string): string => - new Query("orderAsc", attribute).toString(); - - static orderRandom = (): string => - new Query("orderRandom").toString(); - - static cursorAfter = (documentId: string): string => - new Query("cursorAfter", undefined, documentId).toString(); - - static cursorBefore = (documentId: string): string => - new Query("cursorBefore", undefined, documentId).toString(); - - static limit = (limit: number): string => - new Query("limit", undefined, limit).toString(); - - static offset = (offset: number): string => - new Query("offset", undefined, offset).toString(); - - /** - * Filter resources where attribute contains the specified value. - * For string attributes, checks if the string contains the substring. - * - * Note: For array attributes, use {@link containsAny} or {@link containsAll} instead. - * @param {string} attribute - * @param {string | string[]} value - * @returns {string} - */ - static contains = (attribute: string, value: string | any[]): string => - new Query("contains", attribute, value).toString(); - - /** - * Filter resources where attribute contains ANY of the specified values. - * For array and relationship attributes, matches documents where the attribute - * contains at least one of the given values. - * - * @param {string} attribute - * @param {any[]} value - * @returns {string} - */ - static containsAny = (attribute: string, value: any[]): string => - new Query("containsAny", attribute, value).toString(); - - /** - * Filter resources where attribute contains ALL of the specified values. - * For array and relationship attributes, matches documents where the attribute - * contains every one of the given values. - * - * @param {string} attribute - * @param {any[]} value - * @returns {string} - */ - static containsAll = (attribute: string, value: any[]): string => - new Query("containsAll", attribute, value).toString(); - - /** - * Filter resources where attribute does not contain the specified value. - * - * @param {string} attribute - * @param {string | string[]} value - * @returns {string} - */ - static notContains = (attribute: string, value: string | any[]): string => - new Query("notContains", attribute, value).toString(); - - /** - * Filter resources by searching attribute for value (inverse of search). - * A fulltext index on attribute is required for this query to work. - * - * @param {string} attribute - * @param {string} value - * @returns {string} - */ - static notSearch = (attribute: string, value: string): string => - new Query("notSearch", attribute, value).toString(); - - /** - * Filter resources where attribute is not between start and end (exclusive). - * - * @param {string} attribute - * @param {string | number | bigint} start - * @param {string | number | bigint} end - * @returns {string} - */ - static notBetween = (attribute: string, start: string | number | bigint, end: string | number | bigint): string => - new Query("notBetween", attribute, [start, end] as QueryTypesList).toString(); - - /** - * Filter resources where attribute does not start with value. - * - * @param {string} attribute - * @param {string} value - * @returns {string} - */ - static notStartsWith = (attribute: string, value: string): string => - new Query("notStartsWith", attribute, value).toString(); - - /** - * Filter resources where attribute does not end with value. - * - * @param {string} attribute - * @param {string} value - * @returns {string} - */ - static notEndsWith = (attribute: string, value: string): string => - new Query("notEndsWith", attribute, value).toString(); - - /** - * Filter resources where document was created before date. - * - * @param {string} value - * @returns {string} - */ - static createdBefore = (value: string): string => - Query.lessThan("$createdAt", value); - - /** - * Filter resources where document was created after date. - * - * @param {string} value - * @returns {string} - */ - static createdAfter = (value: string): string => - Query.greaterThan("$createdAt", value); - - /** - * Filter resources where document was created between dates. - * - * @param {string} start - * @param {string} end - * @returns {string} - */ - static createdBetween = (start: string, end: string): string => - Query.between("$createdAt", start, end); - - /** - * Filter resources where document was updated before date. - * - * @param {string} value - * @returns {string} - */ - static updatedBefore = (value: string): string => - Query.lessThan("$updatedAt", value); - - /** - * Filter resources where document was updated after date. - * - * @param {string} value - * @returns {string} - */ - static updatedAfter = (value: string): string => - Query.greaterThan("$updatedAt", value); - - /** - * Filter resources where document was updated between dates. - * - * @param {string} start - * @param {string} end - * @returns {string} - */ - static updatedBetween = (start: string, end: string): string => - Query.between("$updatedAt", start, end); - - static or = (queries: string[]) => - new Query("or", undefined, queries.map((query) => JSONbig.parse(query))).toString(); - - static and = (queries: string[]) => - new Query("and", undefined, queries.map((query) => JSONbig.parse(query))).toString(); - - /** - * Filter array elements where at least one element matches all the specified queries. - * - * @param {string} attribute The attribute containing the array to filter on. - * @param {string[]} queries The list of query strings to match against array elements. - * @returns {string} - */ - static elemMatch = (attribute: string, queries: string[]): string => - new Query( - "elemMatch", - attribute, - queries.map((query) => JSONbig.parse(query)) - ).toString(); - - /** - * Filter resources where attribute is at a specific distance from the given coordinates. - * - * @param {string} attribute - * @param {any[]} values - * @param {number} distance - * @param {boolean} meters - * @returns {string} - */ - static distanceEqual = (attribute: string, values: any[], distance: number, meters: boolean = true): string => - new Query("distanceEqual", attribute, [[values, distance, meters]] as QueryTypesList).toString(); - - /** - * Filter resources where attribute is not at a specific distance from the given coordinates. - * - * @param {string} attribute - * @param {any[]} values - * @param {number} distance - * @param {boolean} meters - * @returns {string} - */ - static distanceNotEqual = (attribute: string, values: any[], distance: number, meters: boolean = true): string => - new Query("distanceNotEqual", attribute, [[values, distance, meters]] as QueryTypesList).toString(); - - /** - * Filter resources where attribute is at a distance greater than the specified value from the given coordinates. - * - * @param {string} attribute - * @param {any[]} values - * @param {number} distance - * @param {boolean} meters - * @returns {string} - */ - static distanceGreaterThan = (attribute: string, values: any[], distance: number, meters: boolean = true): string => - new Query("distanceGreaterThan", attribute, [[values, distance, meters]] as QueryTypesList).toString(); - - /** - * Filter resources where attribute is at a distance less than the specified value from the given coordinates. - * - * @param {string} attribute - * @param {any[]} values - * @param {number} distance - * @param {boolean} meters - * @returns {string} - */ - 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. - * - * @param {string} attribute - * @param {any[]} values - * @returns {string} - */ - static intersects = (attribute: string, values: any[]): string => - new Query("intersects", attribute, [values]).toString(); - - /** - * Filter resources where attribute does not intersect with the given geometry. - * - * @param {string} attribute - * @param {any[]} values - * @returns {string} - */ - static notIntersects = (attribute: string, values: any[]): string => - new Query("notIntersects", attribute, [values]).toString(); - - /** - * Filter resources where attribute crosses the given geometry. - * - * @param {string} attribute - * @param {any[]} values - * @returns {string} - */ - static crosses = (attribute: string, values: any[]): string => - new Query("crosses", attribute, [values]).toString(); - - /** - * Filter resources where attribute does not cross the given geometry. - * - * @param {string} attribute - * @param {any[]} values - * @returns {string} - */ - static notCrosses = (attribute: string, values: any[]): string => - new Query("notCrosses", attribute, [values]).toString(); - - /** - * Filter resources where attribute overlaps with the given geometry. - * - * @param {string} attribute - * @param {any[]} values - * @returns {string} - */ - static overlaps = (attribute: string, values: any[]): string => - new Query("overlaps", attribute, [values]).toString(); - - /** - * Filter resources where attribute does not overlap with the given geometry. - * - * @param {string} attribute - * @param {any[]} values - * @returns {string} - */ - static notOverlaps = (attribute: string, values: any[]): string => - new Query("notOverlaps", attribute, [values]).toString(); - - /** - * Filter resources where attribute touches the given geometry. - * - * @param {string} attribute - * @param {any[]} values - * @returns {string} - */ - static touches = (attribute: string, values: any[]): string => - new Query("touches", attribute, [values]).toString(); - - /** - * Filter resources where attribute does not touch the given geometry. - * - * @param {string} attribute - * @param {any[]} values - * @returns {string} - */ - static notTouches = (attribute: string, values: any[]): string => - new Query("notTouches", attribute, [values]).toString(); + toString(): string { + return JSONbig.stringify({ + method: this.method, + attribute: this.attribute, + values: this.values, + }); + } + + static equal = (attribute: string, value: QueryTypes): string => + new Query('equal', attribute, value).toString(); + + static notEqual = (attribute: string, value: QueryTypes): string => + new Query('notEqual', attribute, value).toString(); + + /** + * Filter resources where attribute matches a regular expression pattern. + * + * @param {string} attribute The attribute to filter on. + * @param {string} pattern The regular expression pattern to match. + * @returns {string} + */ + static regex = (attribute: string, pattern: string): string => + new Query('regex', attribute, pattern).toString(); + + static lessThan = (attribute: string, value: QueryTypes): string => + new Query('lessThan', attribute, value).toString(); + + static lessThanEqual = (attribute: string, value: QueryTypes): string => + new Query('lessThanEqual', attribute, value).toString(); + + static greaterThan = (attribute: string, value: QueryTypes): string => + new Query('greaterThan', attribute, value).toString(); + + static greaterThanEqual = (attribute: string, value: QueryTypes): string => + new Query('greaterThanEqual', attribute, value).toString(); + + static isNull = (attribute: string): string => + new Query('isNull', attribute).toString(); + + static isNotNull = (attribute: string): string => + new Query('isNotNull', attribute).toString(); + + /** + * Filter resources where the specified attributes exist. + * + * @param {string[]} attributes The list of attributes that must exist. + * @returns {string} + */ + static exists = (attributes: string[]): string => + new Query('exists', undefined, attributes).toString(); + + /** + * Filter resources where the specified attributes do not exist. + * + * @param {string[]} attributes The list of attributes that must not exist. + * @returns {string} + */ + static notExists = (attributes: string[]): string => + new Query('notExists', undefined, attributes).toString(); + + static between = ( + attribute: string, + start: string | number | bigint, + end: string | number | bigint, + ) => + new Query('between', attribute, [ + start, + end, + ] as QueryTypesList).toString(); + + static startsWith = (attribute: string, value: string): string => + new Query('startsWith', attribute, value).toString(); + + static endsWith = (attribute: string, value: string): string => + new Query('endsWith', attribute, value).toString(); + + static select = (attributes: string[]): string => + new Query('select', undefined, attributes).toString(); + + static search = (attribute: string, value: string): string => + new Query('search', attribute, value).toString(); + + static orderDesc = (attribute: string): string => + new Query('orderDesc', attribute).toString(); + + static orderAsc = (attribute: string): string => + new Query('orderAsc', attribute).toString(); + + static orderRandom = (): string => new Query('orderRandom').toString(); + + static cursorAfter = (documentId: string): string => + new Query('cursorAfter', undefined, documentId).toString(); + + static cursorBefore = (documentId: string): string => + new Query('cursorBefore', undefined, documentId).toString(); + + static limit = (limit: number): string => + new Query('limit', undefined, limit).toString(); + + static offset = (offset: number): string => + new Query('offset', undefined, offset).toString(); + + /** + * Filter resources where attribute contains the specified value. + * For string attributes, checks if the string contains the substring. + * + * Note: For array attributes, use {@link containsAny} or {@link containsAll} instead. + * @param {string} attribute + * @param {string | string[]} value + * @returns {string} + */ + static contains = (attribute: string, value: string | any[]): string => + new Query('contains', attribute, value).toString(); + + /** + * Filter resources where attribute contains ANY of the specified values. + * For array and relationship attributes, matches documents where the attribute + * contains at least one of the given values. + * + * @param {string} attribute + * @param {any[]} value + * @returns {string} + */ + static containsAny = (attribute: string, value: any[]): string => + new Query('containsAny', attribute, value).toString(); + + /** + * Filter resources where attribute contains ALL of the specified values. + * For array and relationship attributes, matches documents where the attribute + * contains every one of the given values. + * + * @param {string} attribute + * @param {any[]} value + * @returns {string} + */ + static containsAll = (attribute: string, value: any[]): string => + new Query('containsAll', attribute, value).toString(); + + /** + * Filter resources where attribute does not contain the specified value. + * + * @param {string} attribute + * @param {string | string[]} value + * @returns {string} + */ + static notContains = (attribute: string, value: string | any[]): string => + new Query('notContains', attribute, value).toString(); + + /** + * Filter resources by searching attribute for value (inverse of search). + * A fulltext index on attribute is required for this query to work. + * + * @param {string} attribute + * @param {string} value + * @returns {string} + */ + static notSearch = (attribute: string, value: string): string => + new Query('notSearch', attribute, value).toString(); + + /** + * Filter resources where attribute is not between start and end (exclusive). + * + * @param {string} attribute + * @param {string | number | bigint} start + * @param {string | number | bigint} end + * @returns {string} + */ + static notBetween = ( + attribute: string, + start: string | number | bigint, + end: string | number | bigint, + ): string => + new Query('notBetween', attribute, [ + start, + end, + ] as QueryTypesList).toString(); + + /** + * Filter resources where attribute does not start with value. + * + * @param {string} attribute + * @param {string} value + * @returns {string} + */ + static notStartsWith = (attribute: string, value: string): string => + new Query('notStartsWith', attribute, value).toString(); + + /** + * Filter resources where attribute does not end with value. + * + * @param {string} attribute + * @param {string} value + * @returns {string} + */ + static notEndsWith = (attribute: string, value: string): string => + new Query('notEndsWith', attribute, value).toString(); + + /** + * Filter resources where document was created before date. + * + * @param {string} value + * @returns {string} + */ + static createdBefore = (value: string): string => + Query.lessThan('$createdAt', value); + + /** + * Filter resources where document was created after date. + * + * @param {string} value + * @returns {string} + */ + static createdAfter = (value: string): string => + Query.greaterThan('$createdAt', value); + + /** + * Filter resources where document was created between dates. + * + * @param {string} start + * @param {string} end + * @returns {string} + */ + static createdBetween = (start: string, end: string): string => + Query.between('$createdAt', start, end); + + /** + * Filter resources where document was updated before date. + * + * @param {string} value + * @returns {string} + */ + static updatedBefore = (value: string): string => + Query.lessThan('$updatedAt', value); + + /** + * Filter resources where document was updated after date. + * + * @param {string} value + * @returns {string} + */ + static updatedAfter = (value: string): string => + Query.greaterThan('$updatedAt', value); + + /** + * Filter resources where document was updated between dates. + * + * @param {string} start + * @param {string} end + * @returns {string} + */ + static updatedBetween = (start: string, end: string): string => + Query.between('$updatedAt', start, end); + + static or = (queries: string[]) => + new Query( + 'or', + undefined, + queries.map((query) => JSONbig.parse(query)), + ).toString(); + + static and = (queries: string[]) => + new Query( + 'and', + undefined, + queries.map((query) => JSONbig.parse(query)), + ).toString(); + + /** + * Filter array elements where at least one element matches all the specified queries. + * + * @param {string} attribute The attribute containing the array to filter on. + * @param {string[]} queries The list of query strings to match against array elements. + * @returns {string} + */ + static elemMatch = (attribute: string, queries: string[]): string => + new Query( + 'elemMatch', + attribute, + queries.map((query) => JSONbig.parse(query)), + ).toString(); + + /** + * Filter resources where attribute is at a specific distance from the given coordinates. + * + * @param {string} attribute + * @param {any[]} values + * @param {number} distance + * @param {boolean} meters + * @returns {string} + */ + static distanceEqual = ( + attribute: string, + values: any[], + distance: number, + meters: boolean = true, + ): string => + new Query('distanceEqual', attribute, [ + [values, distance, meters], + ] as QueryTypesList).toString(); + + /** + * Filter resources where attribute is not at a specific distance from the given coordinates. + * + * @param {string} attribute + * @param {any[]} values + * @param {number} distance + * @param {boolean} meters + * @returns {string} + */ + static distanceNotEqual = ( + attribute: string, + values: any[], + distance: number, + meters: boolean = true, + ): string => + new Query('distanceNotEqual', attribute, [ + [values, distance, meters], + ] as QueryTypesList).toString(); + + /** + * Filter resources where attribute is at a distance greater than the specified value from the given coordinates. + * + * @param {string} attribute + * @param {any[]} values + * @param {number} distance + * @param {boolean} meters + * @returns {string} + */ + static distanceGreaterThan = ( + attribute: string, + values: any[], + distance: number, + meters: boolean = true, + ): string => + new Query('distanceGreaterThan', attribute, [ + [values, distance, meters], + ] as QueryTypesList).toString(); + + /** + * Filter resources where attribute is at a distance less than the specified value from the given coordinates. + * + * @param {string} attribute + * @param {any[]} values + * @param {number} distance + * @param {boolean} meters + * @returns {string} + */ + 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. + * + * @param {string} attribute + * @param {any[]} values + * @returns {string} + */ + static intersects = (attribute: string, values: any[]): string => + new Query('intersects', attribute, [values]).toString(); + + /** + * Filter resources where attribute does not intersect with the given geometry. + * + * @param {string} attribute + * @param {any[]} values + * @returns {string} + */ + static notIntersects = (attribute: string, values: any[]): string => + new Query('notIntersects', attribute, [values]).toString(); + + /** + * Filter resources where attribute crosses the given geometry. + * + * @param {string} attribute + * @param {any[]} values + * @returns {string} + */ + static crosses = (attribute: string, values: any[]): string => + new Query('crosses', attribute, [values]).toString(); + + /** + * Filter resources where attribute does not cross the given geometry. + * + * @param {string} attribute + * @param {any[]} values + * @returns {string} + */ + static notCrosses = (attribute: string, values: any[]): string => + new Query('notCrosses', attribute, [values]).toString(); + + /** + * Filter resources where attribute overlaps with the given geometry. + * + * @param {string} attribute + * @param {any[]} values + * @returns {string} + */ + static overlaps = (attribute: string, values: any[]): string => + new Query('overlaps', attribute, [values]).toString(); + + /** + * Filter resources where attribute does not overlap with the given geometry. + * + * @param {string} attribute + * @param {any[]} values + * @returns {string} + */ + static notOverlaps = (attribute: string, values: any[]): string => + new Query('notOverlaps', attribute, [values]).toString(); + + /** + * Filter resources where attribute touches the given geometry. + * + * @param {string} attribute + * @param {any[]} values + * @returns {string} + */ + static touches = (attribute: string, values: any[]): string => + new Query('touches', attribute, [values]).toString(); + + /** + * Filter resources where attribute does not touch the given geometry. + * + * @param {string} attribute + * @param {any[]} values + * @returns {string} + */ + static notTouches = (attribute: string, values: any[]): string => + new Query('notTouches', attribute, [values]).toString(); } diff --git a/src/react-native-shim.d.ts b/src/react-native-shim.d.ts new file mode 100644 index 00000000..fd9952a7 --- /dev/null +++ b/src/react-native-shim.d.ts @@ -0,0 +1,5 @@ +declare module 'react-native' { + export const Platform: { + readonly OS: string; + }; +} diff --git a/src/role.ts b/src/role.ts index 79f8c6b6..51a05aaf 100644 --- a/src/role.ts +++ b/src/role.ts @@ -2,99 +2,98 @@ * Helper class to generate role strings for `Permission`. */ export class Role { - /** * Grants access to anyone. - * + * * This includes authenticated and unauthenticated users. - * + * * @returns {string} */ public static any(): string { - return 'any' + return 'any'; } /** * Grants access to a specific user by user ID. - * + * * You can optionally pass verified or unverified for * `status` to target specific types of users. * - * @param {string} id - * @param {string} status + * @param {string} id + * @param {string} status * @returns {string} */ public static user(id: string, status: string = ''): string { if (status === '') { - return `user:${id}` + return `user:${id}`; } - return `user:${id}/${status}` + return `user:${id}/${status}`; } /** * Grants access to any authenticated or anonymous user. - * + * * You can optionally pass verified or unverified for * `status` to target specific types of users. - * - * @param {string} status + * + * @param {string} status * @returns {string} */ public static users(status: string = ''): string { if (status === '') { - return 'users' + return 'users'; } - return `users/${status}` + return `users/${status}`; } /** * Grants access to any guest user without a session. - * + * * Authenticated users don't have access to this role. - * + * * @returns {string} */ public static guests(): string { - return 'guests' + return 'guests'; } /** * Grants access to a team by team ID. - * + * * You can optionally pass a role for `role` to target * team members with the specified role. - * - * @param {string} id - * @param {string} role + * + * @param {string} id + * @param {string} role * @returns {string} */ public static team(id: string, role: string = ''): string { if (role === '') { - return `team:${id}` + return `team:${id}`; } - return `team:${id}/${role}` + return `team:${id}/${role}`; } /** * Grants access to a specific member of a team. - * + * * When the member is removed from the team, they will * no longer have access. - * - * @param {string} id + * + * @param {string} id * @returns {string} */ public static member(id: string): string { - return `member:${id}` + return `member:${id}`; } /** * Grants access to a user with the specified label. - * - * @param {string} name + * + * @param {string} name * @returns {string} */ public static label(name: string): string { - return `label:${name}` + return `label:${name}`; } -} \ No newline at end of file +} diff --git a/src/service.ts b/src/service.ts index fe176992..5fa7a7a1 100644 --- a/src/service.ts +++ b/src/service.ts @@ -2,7 +2,7 @@ import { Client } from './client'; import type { Payload } from './client'; export class Service { - static CHUNK_SIZE = 5*1024*1024; // 5MB + static CHUNK_SIZE = 5 * 1024 * 1024; // 5MB client: Client; @@ -14,7 +14,7 @@ export class Service { let output: Payload = {}; for (const [key, value] of Object.entries(data)) { - let finalKey = prefix ? prefix + '[' + key +']' : key; + const finalKey = prefix ? prefix + '[' + key + ']' : key; if (Array.isArray(value)) { output = { ...output, ...Service.flatten(value, finalKey) }; } else { @@ -24,4 +24,4 @@ export class Service { return output; } -} \ No newline at end of file +} diff --git a/src/services/account.ts b/src/services/account.ts index 377024e5..f0dd7728 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -1,20 +1,15 @@ import { Service } from '../service'; import { AppwriteException, Client } from '../client'; import type { Models } from '../models'; -import type { UploadProgress, Payload } from '../client'; -import * as FileSystem from 'expo-file-system'; -import { Platform as RNPlatform } from 'react-native'; +import type { Payload } from '../client'; import { AuthenticatorType } from '../enums/authenticator-type'; import { AuthenticationFactor } from '../enums/authentication-factor'; import { OAuthProvider } from '../enums/o-auth-provider'; - export class Account extends Service { - - constructor(client: Client) - { + constructor(client: Client) { super(client); - } + } /** * Get the currently logged in user. @@ -22,15 +17,22 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - get(): Promise> { + get< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >(): Promise> { const apiPath = '/account'; const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } /** @@ -43,7 +45,14 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - create(params: { userId: string, email: string, password: string, name?: string }): Promise>; + create< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >(params: { + userId: string; + email: string; + password: string; + name?: string; + }): Promise>; /** * Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [/account/verfication](https://appwrite.io/docs/references/cloud/client-web/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https://appwrite.io/docs/references/cloud/client-web/account#createEmailSession). * @@ -55,21 +64,42 @@ export class Account extends Service { * @returns {Promise>} * @deprecated Use the object parameter style method for a better developer experience. */ - create(userId: string, email: string, password: string, name?: string): Promise>; create( - paramsOrFirst: { userId: string, email: string, password: string, name?: string } | string, - ...rest: [(string)?, (string)?, (string)?] + userId: string, + email: string, + password: string, + name?: string, + ): Promise>; + create( + paramsOrFirst: + | { userId: string; email: string; password: string; name?: string } + | string, + ...rest: [string?, string?, string?] ): Promise> { - let params: { userId: string, email: string, password: string, name?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { userId: string, email: string, password: string, name?: string }; + let params: { + userId: string; + email: string; + password: string; + name?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + userId: string; + email: string; + password: string; + name?: string; + }; } else { params = { userId: paramsOrFirst as string, email: rest[0] as string, password: rest[1] as string, - name: rest[2] as string + name: rest[2] as string, }; } @@ -87,7 +117,9 @@ export class Account extends Service { } if (typeof password === 'undefined') { - throw new AppwriteException('Missing required parameter: "password"'); + throw new AppwriteException( + 'Missing required parameter: "password"', + ); } const apiPath = '/account'; @@ -110,28 +142,477 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('post', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); + } + + /** + * 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); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + 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); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + 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); + return this.client.call( + 'delete', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + 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); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + 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); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + 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); + return this.client.call( + 'delete', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + 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. - * + * * * @param {string} params.email - User email. * @param {string} params.password - User password. Must be at least 8 chars. * @throws {AppwriteException} * @returns {Promise} */ - updateEmail(params: { email: string, password: string }): Promise>; + updateEmail< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >(params: { + email: string; + password: string; + }): Promise>; /** * 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. - * + * * * @param {string} email - User email. * @param {string} password - User password. Must be at least 8 chars. @@ -139,19 +620,30 @@ export class Account extends Service { * @returns {Promise>} * @deprecated Use the object parameter style method for a better developer experience. */ - updateEmail(email: string, password: string): Promise>; - updateEmail( - paramsOrFirst: { email: string, password: string } | string, - ...rest: [(string)?] + updateEmail< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >(email: string, password: string): Promise>; + updateEmail< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >( + paramsOrFirst: { email: string; password: string } | string, + ...rest: [string?] ): Promise> { - let params: { email: string, password: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { email: string, password: string }; + let params: { email: string; password: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + email: string; + password: string; + }; } else { params = { email: paramsOrFirst as string, - password: rest[0] as string + password: rest[0] as string, }; } @@ -163,7 +655,9 @@ export class Account extends Service { } if (typeof password === 'undefined') { - throw new AppwriteException('Missing required parameter: "password"'); + throw new AppwriteException( + 'Missing required parameter: "password"', + ); } const apiPath = '/account/email'; @@ -178,11 +672,16 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('patch', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'patch', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -193,7 +692,10 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - listIdentities(params?: { queries?: string[], total?: boolean }): Promise; + listIdentities(params?: { + queries?: string[]; + total?: boolean; + }): Promise; /** * Get the list of identities for the currently logged in user. * @@ -203,19 +705,30 @@ export class Account extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - listIdentities(queries?: string[], total?: boolean): Promise; listIdentities( - paramsOrFirst?: { queries?: string[], total?: boolean } | string[], - ...rest: [(boolean)?] + queries?: string[], + total?: boolean, + ): Promise; + listIdentities( + 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 }; + 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 + total: rest[0] as boolean, }; } @@ -234,10 +747,15 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } /** @@ -247,7 +765,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - deleteIdentity(params: { identityId: string }): Promise<{}>; + deleteIdentity(params: { identityId: string }): Promise<{}>; /** * Delete an identity by its unique ID. * @@ -258,32 +776,46 @@ export class Account extends Service { */ deleteIdentity(identityId: string): Promise<{}>; deleteIdentity( - paramsOrFirst: { identityId: string } | string + paramsOrFirst: { identityId: string } | string, ): Promise<{}> { let params: { identityId: string }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { params = (paramsOrFirst || {}) as { identityId: string }; } else { params = { - identityId: paramsOrFirst as string + identityId: paramsOrFirst as string, }; } const identityId = params.identityId; if (typeof identityId === 'undefined') { - throw new AppwriteException('Missing required parameter: "identityId"'); + throw new AppwriteException( + 'Missing required parameter: "identityId"', + ); } - const apiPath = '/account/identities/{identityId}'.replace('{identityId}', encodeURIComponent(String(identityId))); + const apiPath = '/account/identities/{identityId}'.replace( + '{identityId}', + encodeURIComponent(String(identityId)), + ); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('delete', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - }, payload); + return this.client.call( + 'delete', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + }, + payload, + ); } /** @@ -293,7 +825,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - createJWT(params?: { duration?: number }): Promise; + createJWT(params?: { duration?: number }): Promise; /** * Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame. * @@ -304,15 +836,20 @@ export class Account extends Service { */ createJWT(duration?: number): Promise; createJWT( - paramsOrFirst?: { duration?: number } | number + paramsOrFirst?: { duration?: number } | number, ): Promise { let params: { duration?: number }; - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + if ( + !paramsOrFirst || + (paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst)) + ) { params = (paramsOrFirst || {}) as { duration?: number }; } else { params = { - duration: paramsOrFirst as number + duration: paramsOrFirst as number, }; } @@ -326,11 +863,16 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('post', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -341,7 +883,10 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - listLogs(params?: { queries?: string[], total?: boolean }): Promise; + listLogs(params?: { + queries?: string[]; + total?: boolean; + }): Promise; /** * Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log. * @@ -353,17 +898,25 @@ export class Account extends Service { */ listLogs(queries?: string[], total?: boolean): Promise; listLogs( - paramsOrFirst?: { queries?: string[], total?: boolean } | string[], - ...rest: [(boolean)?] + 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 }; + 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 + total: rest[0] as boolean, }; } @@ -382,10 +935,15 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } /** @@ -395,7 +953,9 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - updateMFA(params: { mfa: boolean }): Promise>; + updateMFA< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >(params: { mfa: boolean }): Promise>; /** * Enable or disable MFA on an account. * @@ -404,17 +964,25 @@ export class Account extends Service { * @returns {Promise>} * @deprecated Use the object parameter style method for a better developer experience. */ - updateMFA(mfa: boolean): Promise>; - updateMFA( - paramsOrFirst: { mfa: boolean } | boolean + updateMFA< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >(mfa: boolean): Promise>; + updateMFA< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >( + paramsOrFirst: { mfa: boolean } | boolean, ): Promise> { let params: { mfa: boolean }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { params = (paramsOrFirst || {}) as { mfa: boolean }; } else { params = { - mfa: paramsOrFirst as boolean + mfa: paramsOrFirst as boolean, }; } @@ -432,11 +1000,16 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('patch', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'patch', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -447,7 +1020,9 @@ export class Account extends Service { * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `Account.createMFAAuthenticator` instead. */ - createMfaAuthenticator(params: { type: AuthenticatorType }): Promise; + createMfaAuthenticator(params: { + type: AuthenticatorType; + }): Promise; /** * Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator) method. * @@ -458,15 +1033,20 @@ export class Account extends Service { */ createMfaAuthenticator(type: AuthenticatorType): Promise; createMfaAuthenticator( - paramsOrFirst: { type: AuthenticatorType } | AuthenticatorType + paramsOrFirst: { type: AuthenticatorType } | AuthenticatorType, ): Promise { let params: { type: AuthenticatorType }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('type' in paramsOrFirst))) { + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) && + 'type' in paramsOrFirst + ) { params = (paramsOrFirst || {}) as { type: AuthenticatorType }; } else { params = { - type: paramsOrFirst as AuthenticatorType + type: paramsOrFirst as AuthenticatorType, }; } @@ -476,15 +1056,23 @@ export class Account extends Service { throw new AppwriteException('Missing required parameter: "type"'); } - const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', encodeURIComponent(String(type))); + const apiPath = '/account/mfa/authenticators/{type}'.replace( + '{type}', + encodeURIComponent(String(type)), + ); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('post', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -494,7 +1082,9 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - createMFAAuthenticator(params: { type: AuthenticatorType }): Promise; + createMFAAuthenticator(params: { + type: AuthenticatorType; + }): Promise; /** * Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator) method. * @@ -505,15 +1095,20 @@ export class Account extends Service { */ createMFAAuthenticator(type: AuthenticatorType): Promise; createMFAAuthenticator( - paramsOrFirst: { type: AuthenticatorType } | AuthenticatorType + paramsOrFirst: { type: AuthenticatorType } | AuthenticatorType, ): Promise { let params: { type: AuthenticatorType }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('type' in paramsOrFirst))) { + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) && + 'type' in paramsOrFirst + ) { params = (paramsOrFirst || {}) as { type: AuthenticatorType }; } else { params = { - type: paramsOrFirst as AuthenticatorType + type: paramsOrFirst as AuthenticatorType, }; } @@ -523,15 +1118,23 @@ export class Account extends Service { throw new AppwriteException('Missing required parameter: "type"'); } - const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', encodeURIComponent(String(type))); + const apiPath = '/account/mfa/authenticators/{type}'.replace( + '{type}', + encodeURIComponent(String(type)), + ); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('post', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -543,7 +1146,12 @@ export class Account extends Service { * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `Account.updateMFAAuthenticator` instead. */ - updateMfaAuthenticator(params: { type: AuthenticatorType, otp: string }): Promise>; + updateMfaAuthenticator< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >(params: { + type: AuthenticatorType; + otp: string; + }): Promise>; /** * Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method. * @@ -553,19 +1161,32 @@ export class Account extends Service { * @returns {Promise>} * @deprecated Use the object parameter style method for a better developer experience. */ - updateMfaAuthenticator(type: AuthenticatorType, otp: string): Promise>; - updateMfaAuthenticator( - paramsOrFirst: { type: AuthenticatorType, otp: string } | AuthenticatorType, - ...rest: [(string)?] + updateMfaAuthenticator< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >(type: AuthenticatorType, otp: string): Promise>; + updateMfaAuthenticator< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >( + paramsOrFirst: + { type: AuthenticatorType; otp: string } | AuthenticatorType, + ...rest: [string?] ): Promise> { - let params: { type: AuthenticatorType, otp: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('type' in paramsOrFirst || 'otp' in paramsOrFirst))) { - params = (paramsOrFirst || {}) as { type: AuthenticatorType, otp: string }; + let params: { type: AuthenticatorType; otp: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) && + ('type' in paramsOrFirst || 'otp' in paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + type: AuthenticatorType; + otp: string; + }; } else { params = { type: paramsOrFirst as AuthenticatorType, - otp: rest[0] as string + otp: rest[0] as string, }; } @@ -580,7 +1201,10 @@ export class Account extends Service { throw new AppwriteException('Missing required parameter: "otp"'); } - const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', encodeURIComponent(String(type))); + const apiPath = '/account/mfa/authenticators/{type}'.replace( + '{type}', + encodeURIComponent(String(type)), + ); const payload: Payload = {}; if (typeof otp !== 'undefined') { @@ -588,11 +1212,16 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('put', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'put', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -603,7 +1232,12 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - updateMFAAuthenticator(params: { type: AuthenticatorType, otp: string }): Promise>; + updateMFAAuthenticator< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >(params: { + type: AuthenticatorType; + otp: string; + }): Promise>; /** * Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method. * @@ -613,19 +1247,32 @@ export class Account extends Service { * @returns {Promise>} * @deprecated Use the object parameter style method for a better developer experience. */ - updateMFAAuthenticator(type: AuthenticatorType, otp: string): Promise>; - updateMFAAuthenticator( - paramsOrFirst: { type: AuthenticatorType, otp: string } | AuthenticatorType, - ...rest: [(string)?] + updateMFAAuthenticator< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >(type: AuthenticatorType, otp: string): Promise>; + updateMFAAuthenticator< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >( + paramsOrFirst: + { type: AuthenticatorType; otp: string } | AuthenticatorType, + ...rest: [string?] ): Promise> { - let params: { type: AuthenticatorType, otp: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('type' in paramsOrFirst || 'otp' in paramsOrFirst))) { - params = (paramsOrFirst || {}) as { type: AuthenticatorType, otp: string }; + let params: { type: AuthenticatorType; otp: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) && + ('type' in paramsOrFirst || 'otp' in paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + type: AuthenticatorType; + otp: string; + }; } else { params = { type: paramsOrFirst as AuthenticatorType, - otp: rest[0] as string + otp: rest[0] as string, }; } @@ -640,7 +1287,10 @@ export class Account extends Service { throw new AppwriteException('Missing required parameter: "otp"'); } - const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', encodeURIComponent(String(type))); + const apiPath = '/account/mfa/authenticators/{type}'.replace( + '{type}', + encodeURIComponent(String(type)), + ); const payload: Payload = {}; if (typeof otp !== 'undefined') { @@ -648,11 +1298,16 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('put', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'put', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -663,7 +1318,7 @@ export class Account extends Service { * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `Account.deleteMFAAuthenticator` instead. */ - deleteMfaAuthenticator(params: { type: AuthenticatorType }): Promise<{}>; + deleteMfaAuthenticator(params: { type: AuthenticatorType }): Promise<{}>; /** * Delete an authenticator for a user by ID. * @@ -674,15 +1329,20 @@ export class Account extends Service { */ deleteMfaAuthenticator(type: AuthenticatorType): Promise<{}>; deleteMfaAuthenticator( - paramsOrFirst: { type: AuthenticatorType } | AuthenticatorType + paramsOrFirst: { type: AuthenticatorType } | AuthenticatorType, ): Promise<{}> { let params: { type: AuthenticatorType }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('type' in paramsOrFirst))) { + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) && + 'type' in paramsOrFirst + ) { params = (paramsOrFirst || {}) as { type: AuthenticatorType }; } else { params = { - type: paramsOrFirst as AuthenticatorType + type: paramsOrFirst as AuthenticatorType, }; } @@ -692,14 +1352,22 @@ export class Account extends Service { throw new AppwriteException('Missing required parameter: "type"'); } - const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', encodeURIComponent(String(type))); + const apiPath = '/account/mfa/authenticators/{type}'.replace( + '{type}', + encodeURIComponent(String(type)), + ); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('delete', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - }, payload); + return this.client.call( + 'delete', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + }, + payload, + ); } /** @@ -709,7 +1377,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - deleteMFAAuthenticator(params: { type: AuthenticatorType }): Promise<{}>; + deleteMFAAuthenticator(params: { type: AuthenticatorType }): Promise<{}>; /** * Delete an authenticator for a user by ID. * @@ -720,15 +1388,20 @@ export class Account extends Service { */ deleteMFAAuthenticator(type: AuthenticatorType): Promise<{}>; deleteMFAAuthenticator( - paramsOrFirst: { type: AuthenticatorType } | AuthenticatorType + paramsOrFirst: { type: AuthenticatorType } | AuthenticatorType, ): Promise<{}> { let params: { type: AuthenticatorType }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('type' in paramsOrFirst))) { + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) && + 'type' in paramsOrFirst + ) { params = (paramsOrFirst || {}) as { type: AuthenticatorType }; } else { params = { - type: paramsOrFirst as AuthenticatorType + type: paramsOrFirst as AuthenticatorType, }; } @@ -738,44 +1411,61 @@ export class Account extends Service { throw new AppwriteException('Missing required parameter: "type"'); } - const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', encodeURIComponent(String(type))); + const apiPath = '/account/mfa/authenticators/{type}'.replace( + '{type}', + encodeURIComponent(String(type)), + ); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('delete', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - }, payload); + return this.client.call( + 'delete', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + }, + payload, + ); } /** * Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method. * - * @param {AuthenticationFactor} params.factor - Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`. + * @param {AuthenticationFactor} params.factor - Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`, `custom`. * @throws {AppwriteException} * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `Account.createMFAChallenge` instead. */ - createMfaChallenge(params: { factor: AuthenticationFactor }): Promise; + createMfaChallenge(params: { + factor: AuthenticationFactor; + }): Promise; /** * Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method. * - * @param {AuthenticationFactor} factor - Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`. + * @param {AuthenticationFactor} factor - Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`, `custom`. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createMfaChallenge(factor: AuthenticationFactor): Promise; createMfaChallenge( - paramsOrFirst: { factor: AuthenticationFactor } | AuthenticationFactor + factor: AuthenticationFactor, + ): Promise; + createMfaChallenge( + paramsOrFirst: { factor: AuthenticationFactor } | AuthenticationFactor, ): Promise { let params: { factor: AuthenticationFactor }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('factor' in paramsOrFirst))) { + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) && + 'factor' in paramsOrFirst + ) { params = (paramsOrFirst || {}) as { factor: AuthenticationFactor }; } else { params = { - factor: paramsOrFirst as AuthenticationFactor + factor: paramsOrFirst as AuthenticationFactor, }; } @@ -793,40 +1483,54 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('post', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** * Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method. * - * @param {AuthenticationFactor} params.factor - Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`. + * @param {AuthenticationFactor} params.factor - Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`, `custom`. * @throws {AppwriteException} * @returns {Promise} */ - createMFAChallenge(params: { factor: AuthenticationFactor }): Promise; + createMFAChallenge(params: { + factor: AuthenticationFactor; + }): Promise; /** * Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method. * - * @param {AuthenticationFactor} factor - Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`. + * @param {AuthenticationFactor} factor - Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`, `custom`. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createMFAChallenge(factor: AuthenticationFactor): Promise; createMFAChallenge( - paramsOrFirst: { factor: AuthenticationFactor } | AuthenticationFactor + factor: AuthenticationFactor, + ): Promise; + createMFAChallenge( + paramsOrFirst: { factor: AuthenticationFactor } | AuthenticationFactor, ): Promise { let params: { factor: AuthenticationFactor }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('factor' in paramsOrFirst))) { + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) && + 'factor' in paramsOrFirst + ) { params = (paramsOrFirst || {}) as { factor: AuthenticationFactor }; } else { params = { - factor: paramsOrFirst as AuthenticationFactor + factor: paramsOrFirst as AuthenticationFactor, }; } @@ -844,11 +1548,16 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('post', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -860,7 +1569,10 @@ export class Account extends Service { * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `Account.updateMFAChallenge` instead. */ - updateMfaChallenge(params: { challengeId: string, otp: string }): Promise; + updateMfaChallenge(params: { + challengeId: string; + otp: string; + }): Promise; /** * Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. * @@ -870,19 +1582,29 @@ export class Account extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateMfaChallenge(challengeId: string, otp: string): Promise; updateMfaChallenge( - paramsOrFirst: { challengeId: string, otp: string } | string, - ...rest: [(string)?] + challengeId: string, + otp: string, + ): Promise; + updateMfaChallenge( + paramsOrFirst: { challengeId: string; otp: string } | string, + ...rest: [string?] ): Promise { - let params: { challengeId: string, otp: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { challengeId: string, otp: string }; + let params: { challengeId: string; otp: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + challengeId: string; + otp: string; + }; } else { params = { challengeId: paramsOrFirst as string, - otp: rest[0] as string + otp: rest[0] as string, }; } @@ -890,7 +1612,9 @@ export class Account extends Service { const otp = params.otp; if (typeof challengeId === 'undefined') { - throw new AppwriteException('Missing required parameter: "challengeId"'); + throw new AppwriteException( + 'Missing required parameter: "challengeId"', + ); } if (typeof otp === 'undefined') { @@ -909,11 +1633,16 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('put', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'put', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -924,7 +1653,10 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - updateMFAChallenge(params: { challengeId: string, otp: string }): Promise; + updateMFAChallenge(params: { + challengeId: string; + otp: string; + }): Promise; /** * Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. * @@ -934,19 +1666,29 @@ export class Account extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateMFAChallenge(challengeId: string, otp: string): Promise; updateMFAChallenge( - paramsOrFirst: { challengeId: string, otp: string } | string, - ...rest: [(string)?] + challengeId: string, + otp: string, + ): Promise; + updateMFAChallenge( + paramsOrFirst: { challengeId: string; otp: string } | string, + ...rest: [string?] ): Promise { - let params: { challengeId: string, otp: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { challengeId: string, otp: string }; + let params: { challengeId: string; otp: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + challengeId: string; + otp: string; + }; } else { params = { challengeId: paramsOrFirst as string, - otp: rest[0] as string + otp: rest[0] as string, }; } @@ -954,7 +1696,9 @@ export class Account extends Service { const otp = params.otp; if (typeof challengeId === 'undefined') { - throw new AppwriteException('Missing required parameter: "challengeId"'); + throw new AppwriteException( + 'Missing required parameter: "challengeId"', + ); } if (typeof otp === 'undefined') { @@ -973,11 +1717,16 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('put', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'put', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -992,10 +1741,15 @@ export class Account extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } /** @@ -1009,10 +1763,15 @@ export class Account extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } /** @@ -1027,10 +1786,15 @@ export class Account extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } /** @@ -1044,10 +1808,15 @@ export class Account extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } /** @@ -1062,11 +1831,16 @@ export class Account extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('post', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -1080,11 +1854,16 @@ export class Account extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('post', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -1099,11 +1878,16 @@ export class Account extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('patch', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'patch', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -1117,11 +1901,16 @@ export class Account extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('patch', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'patch', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -1131,7 +1920,9 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - updateName(params: { name: string }): Promise>; + updateName< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >(params: { name: string }): Promise>; /** * Update currently logged in user account name. * @@ -1140,17 +1931,25 @@ export class Account extends Service { * @returns {Promise>} * @deprecated Use the object parameter style method for a better developer experience. */ - updateName(name: string): Promise>; - updateName( - paramsOrFirst: { name: string } | string + updateName< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >(name: string): Promise>; + updateName< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >( + paramsOrFirst: { name: string } | string, ): Promise> { let params: { name: string }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { params = (paramsOrFirst || {}) as { name: string }; } else { params = { - name: paramsOrFirst as string + name: paramsOrFirst as string, }; } @@ -1168,11 +1967,16 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('patch', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'patch', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -1183,7 +1987,12 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - updatePassword(params: { password: string, oldPassword?: string }): Promise>; + updatePassword< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >(params: { + password: string; + oldPassword?: string; + }): Promise>; /** * Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional. * @@ -1193,19 +2002,33 @@ export class Account extends Service { * @returns {Promise>} * @deprecated Use the object parameter style method for a better developer experience. */ - updatePassword(password: string, oldPassword?: string): Promise>; - updatePassword( - paramsOrFirst: { password: string, oldPassword?: string } | string, - ...rest: [(string)?] + updatePassword< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >( + password: string, + oldPassword?: string, + ): Promise>; + updatePassword< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >( + paramsOrFirst: { password: string; oldPassword?: string } | string, + ...rest: [string?] ): Promise> { - let params: { password: string, oldPassword?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { password: string, oldPassword?: string }; + let params: { password: string; oldPassword?: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + password: string; + oldPassword?: string; + }; } else { params = { password: paramsOrFirst as string, - oldPassword: rest[0] as string + oldPassword: rest[0] as string, }; } @@ -1213,7 +2036,9 @@ export class Account extends Service { const oldPassword = params.oldPassword; if (typeof password === 'undefined') { - throw new AppwriteException('Missing required parameter: "password"'); + throw new AppwriteException( + 'Missing required parameter: "password"', + ); } const apiPath = '/account/password'; @@ -1228,11 +2053,16 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('patch', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'patch', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -1243,7 +2073,12 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - updatePhone(params: { phone: string, password: string }): Promise>; + updatePhone< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >(params: { + phone: string; + password: string; + }): Promise>; /** * Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification) endpoint to send a confirmation SMS. * @@ -1253,19 +2088,30 @@ export class Account extends Service { * @returns {Promise>} * @deprecated Use the object parameter style method for a better developer experience. */ - updatePhone(phone: string, password: string): Promise>; - updatePhone( - paramsOrFirst: { phone: string, password: string } | string, - ...rest: [(string)?] + updatePhone< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >(phone: string, password: string): Promise>; + updatePhone< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >( + paramsOrFirst: { phone: string; password: string } | string, + ...rest: [string?] ): Promise> { - let params: { phone: string, password: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { phone: string, password: string }; + let params: { phone: string; password: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + phone: string; + password: string; + }; } else { params = { phone: paramsOrFirst as string, - password: rest[0] as string + password: rest[0] as string, }; } @@ -1277,7 +2123,9 @@ export class Account extends Service { } if (typeof password === 'undefined') { - throw new AppwriteException('Missing required parameter: "password"'); + throw new AppwriteException( + 'Missing required parameter: "password"', + ); } const apiPath = '/account/phone'; @@ -1292,11 +2140,16 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('patch', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'patch', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -1305,15 +2158,22 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - getPrefs(): Promise { + getPrefs< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >(): Promise { const apiPath = '/account/prefs'; const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } /** @@ -1323,7 +2183,11 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - updatePrefs(params: { prefs: Partial }): Promise>; + updatePrefs< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >(params: { + prefs: Partial; + }): Promise>; /** * Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded. * @@ -1332,17 +2196,26 @@ export class Account extends Service { * @returns {Promise>} * @deprecated Use the object parameter style method for a better developer experience. */ - updatePrefs(prefs: Partial): Promise>; - updatePrefs( - paramsOrFirst: { prefs: Partial } | Partial + updatePrefs< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >(prefs: Partial): Promise>; + updatePrefs< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >( + paramsOrFirst: { prefs: Partial } | Partial, ): Promise> { let params: { prefs: Partial }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('prefs' in paramsOrFirst))) { + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) && + 'prefs' in paramsOrFirst + ) { params = (paramsOrFirst || {}) as { prefs: Partial }; } else { params = { - prefs: paramsOrFirst as Partial + prefs: paramsOrFirst as Partial, }; } @@ -1360,11 +2233,16 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('patch', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'patch', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -1375,7 +2253,10 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - createRecovery(params: { email: string, url: string }): Promise; + createRecovery(params: { + email: string; + url: string; + }): Promise; /** * Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour. * @@ -1387,17 +2268,21 @@ export class Account extends Service { */ createRecovery(email: string, url: string): Promise; createRecovery( - paramsOrFirst: { email: string, url: string } | string, - ...rest: [(string)?] + paramsOrFirst: { email: string; url: string } | string, + ...rest: [string?] ): Promise { - let params: { email: string, url: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { email: string, url: string }; + let params: { email: string; url: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { email: string; url: string }; } else { params = { email: paramsOrFirst as string, - url: rest[0] as string + url: rest[0] as string, }; } @@ -1424,16 +2309,21 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('post', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** * Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#createRecovery) endpoint. - * + * * Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. * * @param {string} params.userId - User ID. @@ -1442,10 +2332,14 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - updateRecovery(params: { userId: string, secret: string, password: string }): Promise; + updateRecovery(params: { + userId: string; + secret: string; + password: string; + }): Promise; /** * Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#createRecovery) endpoint. - * + * * Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. * * @param {string} userId - User ID. @@ -1455,20 +2349,33 @@ export class Account extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateRecovery(userId: string, secret: string, password: string): Promise; updateRecovery( - paramsOrFirst: { userId: string, secret: string, password: string } | string, - ...rest: [(string)?, (string)?] + userId: string, + secret: string, + password: string, + ): Promise; + updateRecovery( + paramsOrFirst: + { userId: string; secret: string; password: string } | string, + ...rest: [string?, string?] ): Promise { - let params: { userId: string, secret: string, password: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { userId: string, secret: string, password: string }; + let params: { userId: string; secret: string; password: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + userId: string; + secret: string; + password: string; + }; } else { params = { userId: paramsOrFirst as string, secret: rest[0] as string, - password: rest[1] as string + password: rest[1] as string, }; } @@ -1485,7 +2392,9 @@ export class Account extends Service { } if (typeof password === 'undefined') { - throw new AppwriteException('Missing required parameter: "password"'); + throw new AppwriteException( + 'Missing required parameter: "password"', + ); } const apiPath = '/account/recovery'; @@ -1504,11 +2413,16 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('put', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'put', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -1522,10 +2436,15 @@ export class Account extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } /** @@ -1539,10 +2458,15 @@ export class Account extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('delete', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - }, payload); + return this.client.call( + 'delete', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + }, + payload, + ); } /** @@ -1556,16 +2480,21 @@ export class Account extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('post', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** * Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user. - * + * * 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 {string} params.email - User email. @@ -1573,10 +2502,13 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - createEmailPasswordSession(params: { email: string, password: string }): Promise; + createEmailPasswordSession(params: { + email: string; + password: string; + }): Promise; /** * Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user. - * + * * 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 {string} email - User email. @@ -1585,19 +2517,29 @@ export class Account extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createEmailPasswordSession(email: string, password: string): Promise; createEmailPasswordSession( - paramsOrFirst: { email: string, password: string } | string, - ...rest: [(string)?] + email: string, + password: string, + ): Promise; + createEmailPasswordSession( + paramsOrFirst: { email: string; password: string } | string, + ...rest: [string?] ): Promise { - let params: { email: string, password: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { email: string, password: string }; + let params: { email: string; password: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + email: string; + password: string; + }; } else { params = { email: paramsOrFirst as string, - password: rest[0] as string + password: rest[0] as string, }; } @@ -1609,7 +2551,9 @@ export class Account extends Service { } if (typeof password === 'undefined') { - throw new AppwriteException('Missing required parameter: "password"'); + throw new AppwriteException( + 'Missing required parameter: "password"', + ); } const apiPath = '/account/sessions/email'; @@ -1624,11 +2568,16 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('post', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -1640,7 +2589,10 @@ export class Account extends Service { * @returns {Promise} * @deprecated This API has been deprecated since 1.6.0. Please use `Account.createSession` instead. */ - updateMagicURLSession(params: { userId: string, secret: string }): Promise; + updateMagicURLSession(params: { + userId: string; + secret: string; + }): Promise; /** * Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login. * @@ -1650,19 +2602,29 @@ export class Account extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateMagicURLSession(userId: string, secret: string): Promise; updateMagicURLSession( - paramsOrFirst: { userId: string, secret: string } | string, - ...rest: [(string)?] + userId: string, + secret: string, + ): Promise; + updateMagicURLSession( + paramsOrFirst: { userId: string; secret: string } | string, + ...rest: [string?] ): Promise { - let params: { userId: string, secret: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { userId: string, secret: string }; + let params: { userId: string; secret: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + userId: string; + secret: string; + }; } else { params = { userId: paramsOrFirst as string, - secret: rest[0] as string + secret: rest[0] as string, }; } @@ -1689,38 +2651,48 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('put', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'put', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** * Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. - * + * * If there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user. - * + * * 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, 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 {OAuthProvider} params.provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, appwrite, auth0, authentik, autodesk, bitbucket, bitly, box, cloudflare, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, huggingface, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, resend, 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. * @throws {AppwriteException} * @returns {void|string} */ - createOAuth2Session(params: { provider: OAuthProvider, success?: string, failure?: string, scopes?: string[] }): void | URL; + createOAuth2Session(params: { + provider: OAuthProvider; + success?: string; + failure?: string; + scopes?: string[]; + }): void | URL; /** * Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. - * + * * If there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user. - * + * * 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, 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 {OAuthProvider} provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, appwrite, auth0, authentik, autodesk, bitbucket, bitly, box, cloudflare, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, huggingface, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, resend, 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. @@ -1728,21 +2700,51 @@ export class Account extends Service { * @returns {void | URL} * @deprecated Use the object parameter style method for a better developer experience. */ - createOAuth2Session(provider: OAuthProvider, success?: string, failure?: string, scopes?: string[]): void | URL; createOAuth2Session( - paramsOrFirst: { provider: OAuthProvider, success?: string, failure?: string, scopes?: string[] } | OAuthProvider, - ...rest: [(string)?, (string)?, (string[])?] + provider: OAuthProvider, + success?: string, + failure?: string, + scopes?: string[], + ): void | URL; + createOAuth2Session( + paramsOrFirst: + | { + provider: OAuthProvider; + success?: string; + failure?: string; + scopes?: string[]; + } + | OAuthProvider, + ...rest: [string?, string?, string[]?] ): void | URL { - let params: { provider: OAuthProvider, success?: string, failure?: string, scopes?: string[] }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('provider' in paramsOrFirst || 'success' in paramsOrFirst || 'failure' in paramsOrFirst || 'scopes' in paramsOrFirst))) { - params = (paramsOrFirst || {}) as { provider: OAuthProvider, success?: string, failure?: string, scopes?: string[] }; + let params: { + provider: OAuthProvider; + success?: string; + failure?: string; + scopes?: string[]; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) && + ('provider' in paramsOrFirst || + 'success' in paramsOrFirst || + 'failure' in paramsOrFirst || + 'scopes' in paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + provider: OAuthProvider; + success?: string; + failure?: string; + scopes?: string[]; + }; } else { params = { provider: paramsOrFirst as OAuthProvider, success: rest[0] as string, failure: rest[1] as string, - scopes: rest[2] as string[] + scopes: rest[2] as string[], }; } @@ -1752,10 +2754,15 @@ export class Account extends Service { const scopes = params.scopes; if (typeof provider === 'undefined') { - throw new AppwriteException('Missing required parameter: "provider"'); + throw new AppwriteException( + 'Missing required parameter: "provider"', + ); } - const apiPath = '/account/sessions/oauth2/{provider}'.replace('{provider}', encodeURIComponent(String(provider))); + const apiPath = '/account/sessions/oauth2/{provider}'.replace( + '{provider}', + encodeURIComponent(String(provider)), + ); const payload: Payload = {}; if (typeof success !== 'undefined') { @@ -1773,7 +2780,6 @@ export class Account extends Service { const uri = new URL(this.client.config.endpoint + apiPath); payload['project'] = this.client.config.project; - for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } @@ -1789,7 +2795,10 @@ export class Account extends Service { * @returns {Promise} * @deprecated This API has been deprecated since 1.6.0. Please use `Account.createSession` instead. */ - updatePhoneSession(params: { userId: string, secret: string }): Promise; + updatePhoneSession(params: { + userId: string; + secret: string; + }): Promise; /** * Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login. * @@ -1801,17 +2810,24 @@ export class Account extends Service { */ updatePhoneSession(userId: string, secret: string): Promise; updatePhoneSession( - paramsOrFirst: { userId: string, secret: string } | string, - ...rest: [(string)?] + paramsOrFirst: { userId: string; secret: string } | string, + ...rest: [string?] ): Promise { - let params: { userId: string, secret: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { userId: string, secret: string }; + let params: { userId: string; secret: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + userId: string; + secret: string; + }; } else { params = { userId: paramsOrFirst as string, - secret: rest[0] as string + secret: rest[0] as string, }; } @@ -1838,11 +2854,16 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('put', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'put', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -1853,7 +2874,10 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - createSession(params: { userId: string, secret: string }): Promise; + createSession(params: { + userId: string; + secret: string; + }): Promise; /** * Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login. * @@ -1865,17 +2889,24 @@ export class Account extends Service { */ createSession(userId: string, secret: string): Promise; createSession( - paramsOrFirst: { userId: string, secret: string } | string, - ...rest: [(string)?] + paramsOrFirst: { userId: string; secret: string } | string, + ...rest: [string?] ): Promise { - let params: { userId: string, secret: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { userId: string, secret: string }; + let params: { userId: string; secret: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + userId: string; + secret: string; + }; } else { params = { userId: paramsOrFirst as string, - secret: rest[0] as string + secret: rest[0] as string, }; } @@ -1902,11 +2933,16 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('post', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -1916,7 +2952,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - getSession(params: { sessionId: string }): Promise; + getSession(params: { sessionId: string }): Promise; /** * Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used. * @@ -1927,32 +2963,46 @@ export class Account extends Service { */ getSession(sessionId: string): Promise; getSession( - paramsOrFirst: { sessionId: string } | string + paramsOrFirst: { sessionId: string } | string, ): Promise { let params: { sessionId: string }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { params = (paramsOrFirst || {}) as { sessionId: string }; } else { params = { - sessionId: paramsOrFirst as string + sessionId: paramsOrFirst as string, }; } const sessionId = params.sessionId; if (typeof sessionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "sessionId"'); + throw new AppwriteException( + 'Missing required parameter: "sessionId"', + ); } - const apiPath = '/account/sessions/{sessionId}'.replace('{sessionId}', encodeURIComponent(String(sessionId))); + const apiPath = '/account/sessions/{sessionId}'.replace( + '{sessionId}', + encodeURIComponent(String(sessionId)), + ); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } /** @@ -1962,7 +3012,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - updateSession(params: { sessionId: string }): Promise; + updateSession(params: { sessionId: string }): Promise; /** * Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider. * @@ -1973,33 +3023,47 @@ export class Account extends Service { */ updateSession(sessionId: string): Promise; updateSession( - paramsOrFirst: { sessionId: string } | string + paramsOrFirst: { sessionId: string } | string, ): Promise { let params: { sessionId: string }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { params = (paramsOrFirst || {}) as { sessionId: string }; } else { params = { - sessionId: paramsOrFirst as string + sessionId: paramsOrFirst as string, }; } const sessionId = params.sessionId; if (typeof sessionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "sessionId"'); + throw new AppwriteException( + 'Missing required parameter: "sessionId"', + ); } - const apiPath = '/account/sessions/{sessionId}'.replace('{sessionId}', encodeURIComponent(String(sessionId))); + const apiPath = '/account/sessions/{sessionId}'.replace( + '{sessionId}', + encodeURIComponent(String(sessionId)), + ); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('patch', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'patch', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -2009,7 +3073,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - deleteSession(params: { sessionId: string }): Promise<{}>; + deleteSession(params: { sessionId: string }): Promise<{}>; /** * Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https://appwrite.io/docs/references/cloud/client-web/account#deleteSessions) instead. * @@ -2019,33 +3083,45 @@ export class Account extends Service { * @deprecated Use the object parameter style method for a better developer experience. */ deleteSession(sessionId: string): Promise<{}>; - deleteSession( - paramsOrFirst: { sessionId: string } | string - ): Promise<{}> { + deleteSession(paramsOrFirst: { sessionId: string } | string): Promise<{}> { let params: { sessionId: string }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { params = (paramsOrFirst || {}) as { sessionId: string }; } else { params = { - sessionId: paramsOrFirst as string + sessionId: paramsOrFirst as string, }; } const sessionId = params.sessionId; if (typeof sessionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "sessionId"'); + throw new AppwriteException( + 'Missing required parameter: "sessionId"', + ); } - const apiPath = '/account/sessions/{sessionId}'.replace('{sessionId}', encodeURIComponent(String(sessionId))); + const apiPath = '/account/sessions/{sessionId}'.replace( + '{sessionId}', + encodeURIComponent(String(sessionId)), + ); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('delete', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - }, payload); + return this.client.call( + 'delete', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + }, + payload, + ); } /** @@ -2054,16 +3130,23 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - updateStatus(): Promise> { + updateStatus< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >(): Promise> { const apiPath = '/account/status'; const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('patch', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'patch', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -2075,7 +3158,11 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - createPushTarget(params: { targetId: string, identifier: string, providerId?: string }): Promise; + createPushTarget(params: { + targetId: string; + identifier: string; + providerId?: string; + }): Promise; /** * Use this endpoint to register a device for push notifications. Provide a target ID (custom or generated using ID.unique()), a device identifier (usually a device token), and optionally specify which provider should send notifications to this target. The target is automatically linked to the current session and includes device information like brand and model. * @@ -2086,20 +3173,38 @@ export class Account extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createPushTarget(targetId: string, identifier: string, providerId?: string): Promise; createPushTarget( - paramsOrFirst: { targetId: string, identifier: string, providerId?: string } | string, - ...rest: [(string)?, (string)?] + targetId: string, + identifier: string, + providerId?: string, + ): Promise; + createPushTarget( + paramsOrFirst: + | { targetId: string; identifier: string; providerId?: string } + | string, + ...rest: [string?, string?] ): Promise { - let params: { targetId: string, identifier: string, providerId?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { targetId: string, identifier: string, providerId?: string }; + let params: { + targetId: string; + identifier: string; + providerId?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + targetId: string; + identifier: string; + providerId?: string; + }; } else { params = { targetId: paramsOrFirst as string, identifier: rest[0] as string, - providerId: rest[1] as string + providerId: rest[1] as string, }; } @@ -2108,11 +3213,15 @@ export class Account extends Service { const providerId = params.providerId; if (typeof targetId === 'undefined') { - throw new AppwriteException('Missing required parameter: "targetId"'); + throw new AppwriteException( + 'Missing required parameter: "targetId"', + ); } if (typeof identifier === 'undefined') { - throw new AppwriteException('Missing required parameter: "identifier"'); + throw new AppwriteException( + 'Missing required parameter: "identifier"', + ); } const apiPath = '/account/targets/push'; @@ -2131,11 +3240,16 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('post', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -2146,7 +3260,10 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - updatePushTarget(params: { targetId: string, identifier: string }): Promise; + updatePushTarget(params: { + targetId: string; + identifier: string; + }): Promise; /** * Update the currently logged in user's push notification target. You can modify the target's identifier (device token) and provider ID (token, email, phone etc.). The target must exist and belong to the current user. If you change the provider ID, notifications will be sent through the new messaging provider instead. * @@ -2156,19 +3273,29 @@ export class Account extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updatePushTarget(targetId: string, identifier: string): Promise; updatePushTarget( - paramsOrFirst: { targetId: string, identifier: string } | string, - ...rest: [(string)?] + targetId: string, + identifier: string, + ): Promise; + updatePushTarget( + paramsOrFirst: { targetId: string; identifier: string } | string, + ...rest: [string?] ): Promise { - let params: { targetId: string, identifier: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { targetId: string, identifier: string }; + let params: { targetId: string; identifier: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + targetId: string; + identifier: string; + }; } else { params = { targetId: paramsOrFirst as string, - identifier: rest[0] as string + identifier: rest[0] as string, }; } @@ -2176,14 +3303,21 @@ export class Account extends Service { const identifier = params.identifier; if (typeof targetId === 'undefined') { - throw new AppwriteException('Missing required parameter: "targetId"'); + throw new AppwriteException( + 'Missing required parameter: "targetId"', + ); } if (typeof identifier === 'undefined') { - throw new AppwriteException('Missing required parameter: "identifier"'); + throw new AppwriteException( + 'Missing required parameter: "identifier"', + ); } - const apiPath = '/account/targets/{targetId}/push'.replace('{targetId}', encodeURIComponent(String(targetId))); + const apiPath = '/account/targets/{targetId}/push'.replace( + '{targetId}', + encodeURIComponent(String(targetId)), + ); const payload: Payload = {}; if (typeof identifier !== 'undefined') { @@ -2191,11 +3325,16 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('put', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'put', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -2205,7 +3344,7 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - deletePushTarget(params: { targetId: string }): Promise<{}>; + deletePushTarget(params: { targetId: string }): Promise<{}>; /** * Delete a push notification target for the currently logged in user. After deletion, the device will no longer receive push notifications. The target must exist and belong to the current user. * @@ -2216,39 +3355,53 @@ export class Account extends Service { */ deletePushTarget(targetId: string): Promise<{}>; deletePushTarget( - paramsOrFirst: { targetId: string } | string + paramsOrFirst: { targetId: string } | string, ): Promise<{}> { let params: { targetId: string }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { params = (paramsOrFirst || {}) as { targetId: string }; } else { params = { - targetId: paramsOrFirst as string + targetId: paramsOrFirst as string, }; } const targetId = params.targetId; if (typeof targetId === 'undefined') { - throw new AppwriteException('Missing required parameter: "targetId"'); + throw new AppwriteException( + 'Missing required parameter: "targetId"', + ); } - const apiPath = '/account/targets/{targetId}/push'.replace('{targetId}', encodeURIComponent(String(targetId))); + const apiPath = '/account/targets/{targetId}/push'.replace( + '{targetId}', + encodeURIComponent(String(targetId)), + ); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('delete', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - }, payload); + return this.client.call( + 'delete', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + }, + payload, + ); } /** * Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes. - * + * * 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 {string} params.userId - User 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. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored. * @param {string} params.email - User email. @@ -2256,12 +3409,16 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - createEmailToken(params: { userId: string, email: string, phrase?: boolean }): Promise; + createEmailToken(params: { + userId: string; + email: string; + phrase?: boolean; + }): Promise; /** * Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes. - * + * * 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 {string} userId - User 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. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored. * @param {string} email - User email. @@ -2270,20 +3427,33 @@ export class Account extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createEmailToken(userId: string, email: string, phrase?: boolean): Promise; createEmailToken( - paramsOrFirst: { userId: string, email: string, phrase?: boolean } | string, - ...rest: [(string)?, (boolean)?] + userId: string, + email: string, + phrase?: boolean, + ): Promise; + createEmailToken( + paramsOrFirst: + { userId: string; email: string; phrase?: boolean } | string, + ...rest: [string?, boolean?] ): Promise { - let params: { userId: string, email: string, phrase?: boolean }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { userId: string, email: string, phrase?: boolean }; + let params: { userId: string; email: string; phrase?: boolean }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + userId: string; + email: string; + phrase?: boolean; + }; } else { params = { userId: paramsOrFirst as string, email: rest[0] as string, - phrase: rest[1] as boolean + phrase: rest[1] as boolean, }; } @@ -2315,18 +3485,23 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('post', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** * Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. - * + * * 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 {string} params.userId - 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. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored. * @param {string} params.email - User email. @@ -2335,12 +3510,17 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - createMagicURLToken(params: { userId: string, email: string, url?: string, phrase?: boolean }): Promise; + createMagicURLToken(params: { + userId: string; + email: string; + url?: string; + phrase?: boolean; + }): Promise; /** * Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. - * + * * 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 {string} userId - 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. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored. * @param {string} email - User email. @@ -2350,21 +3530,42 @@ export class Account extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createMagicURLToken(userId: string, email: string, url?: string, phrase?: boolean): Promise; createMagicURLToken( - paramsOrFirst: { userId: string, email: string, url?: string, phrase?: boolean } | string, - ...rest: [(string)?, (string)?, (boolean)?] + userId: string, + email: string, + url?: string, + phrase?: boolean, + ): Promise; + createMagicURLToken( + paramsOrFirst: + | { userId: string; email: string; url?: string; phrase?: boolean } + | string, + ...rest: [string?, string?, boolean?] ): Promise { - let params: { userId: string, email: string, url?: string, phrase?: boolean }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { userId: string, email: string, url?: string, phrase?: boolean }; + let params: { + userId: string; + email: string; + url?: string; + phrase?: boolean; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + userId: string; + email: string; + url?: string; + phrase?: boolean; + }; } else { params = { userId: paramsOrFirst as string, email: rest[0] as string, url: rest[1] as string, - phrase: rest[2] as boolean + phrase: rest[2] as boolean, }; } @@ -2401,36 +3602,46 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('post', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** - * Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. - * + * Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. + * * If authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint. - * + * * 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, 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 {OAuthProvider} params.provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, appwrite, auth0, authentik, autodesk, bitbucket, bitly, box, cloudflare, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, huggingface, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, resend, 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. * @throws {AppwriteException} * @returns {void|string} */ - createOAuth2Token(params: { provider: OAuthProvider, success?: string, failure?: string, scopes?: string[] }): void | URL; + createOAuth2Token(params: { + provider: OAuthProvider; + success?: string; + failure?: string; + scopes?: string[]; + }): void | URL; /** - * Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. - * + * Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. + * * If authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint. - * + * * 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, 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 {OAuthProvider} provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, appwrite, auth0, authentik, autodesk, bitbucket, bitly, box, cloudflare, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, huggingface, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, resend, 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. @@ -2438,21 +3649,51 @@ export class Account extends Service { * @returns {void | URL} * @deprecated Use the object parameter style method for a better developer experience. */ - createOAuth2Token(provider: OAuthProvider, success?: string, failure?: string, scopes?: string[]): void | URL; createOAuth2Token( - paramsOrFirst: { provider: OAuthProvider, success?: string, failure?: string, scopes?: string[] } | OAuthProvider, - ...rest: [(string)?, (string)?, (string[])?] + provider: OAuthProvider, + success?: string, + failure?: string, + scopes?: string[], + ): void | URL; + createOAuth2Token( + paramsOrFirst: + | { + provider: OAuthProvider; + success?: string; + failure?: string; + scopes?: string[]; + } + | OAuthProvider, + ...rest: [string?, string?, string[]?] ): void | URL { - let params: { provider: OAuthProvider, success?: string, failure?: string, scopes?: string[] }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('provider' in paramsOrFirst || 'success' in paramsOrFirst || 'failure' in paramsOrFirst || 'scopes' in paramsOrFirst))) { - params = (paramsOrFirst || {}) as { provider: OAuthProvider, success?: string, failure?: string, scopes?: string[] }; + let params: { + provider: OAuthProvider; + success?: string; + failure?: string; + scopes?: string[]; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) && + ('provider' in paramsOrFirst || + 'success' in paramsOrFirst || + 'failure' in paramsOrFirst || + 'scopes' in paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + provider: OAuthProvider; + success?: string; + failure?: string; + scopes?: string[]; + }; } else { params = { provider: paramsOrFirst as OAuthProvider, success: rest[0] as string, failure: rest[1] as string, - scopes: rest[2] as string[] + scopes: rest[2] as string[], }; } @@ -2462,10 +3703,15 @@ export class Account extends Service { const scopes = params.scopes; if (typeof provider === 'undefined') { - throw new AppwriteException('Missing required parameter: "provider"'); + throw new AppwriteException( + 'Missing required parameter: "provider"', + ); } - const apiPath = '/account/tokens/oauth2/{provider}'.replace('{provider}', encodeURIComponent(String(provider))); + const apiPath = '/account/tokens/oauth2/{provider}'.replace( + '{provider}', + encodeURIComponent(String(provider)), + ); const payload: Payload = {}; if (typeof success !== 'undefined') { @@ -2483,7 +3729,6 @@ export class Account extends Service { const uri = new URL(this.client.config.endpoint + apiPath); payload['project'] = this.client.config.project; - for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } @@ -2492,7 +3737,7 @@ export class Account extends Service { /** * Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes. - * + * * 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 {string} params.userId - 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. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored. @@ -2500,10 +3745,13 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - createPhoneToken(params: { userId: string, phone: string }): Promise; + createPhoneToken(params: { + userId: string; + phone: string; + }): Promise; /** * Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes. - * + * * 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 {string} userId - 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. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored. @@ -2514,17 +3762,21 @@ export class Account extends Service { */ createPhoneToken(userId: string, phone: string): Promise; createPhoneToken( - paramsOrFirst: { userId: string, phone: string } | string, - ...rest: [(string)?] + paramsOrFirst: { userId: string; phone: string } | string, + ...rest: [string?] ): Promise { - let params: { userId: string, phone: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { userId: string, phone: string }; + let params: { userId: string; phone: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { userId: string; phone: string }; } else { params = { userId: paramsOrFirst as string, - phone: rest[0] as string + phone: rest[0] as string, }; } @@ -2551,29 +3803,34 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('post', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** * Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). The verification link sent to the user's email address is valid for 7 days. - * + * * Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. - * + * * * @param {string} params.url - URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project 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. * @throws {AppwriteException} * @returns {Promise} */ - createEmailVerification(params: { url: string }): Promise; + createEmailVerification(params: { url: string }): Promise; /** * Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). The verification link sent to the user's email address is valid for 7 days. - * + * * Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. - * + * * * @param {string} url - URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project 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. * @throws {AppwriteException} @@ -2582,15 +3839,19 @@ export class Account extends Service { */ createEmailVerification(url: string): Promise; createEmailVerification( - paramsOrFirst: { url: string } | string + paramsOrFirst: { url: string } | string, ): Promise { let params: { url: string }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { params = (paramsOrFirst || {}) as { url: string }; } else { params = { - url: paramsOrFirst as string + url: paramsOrFirst as string, }; } @@ -2608,30 +3869,35 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('post', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** * Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). The verification link sent to the user's email address is valid for 7 days. - * + * * Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. - * + * * * @param {string} params.url - URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project 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. * @throws {AppwriteException} * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `Account.createEmailVerification` instead. */ - createVerification(params: { url: string }): Promise; + createVerification(params: { url: string }): Promise; /** * Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). The verification link sent to the user's email address is valid for 7 days. - * + * * Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. - * + * * * @param {string} url - URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project 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. * @throws {AppwriteException} @@ -2640,15 +3906,19 @@ export class Account extends Service { */ createVerification(url: string): Promise; createVerification( - paramsOrFirst: { url: string } | string + paramsOrFirst: { url: string } | string, ): Promise { let params: { url: string }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { params = (paramsOrFirst || {}) as { url: string }; } else { params = { - url: paramsOrFirst as string + url: paramsOrFirst as string, }; } @@ -2666,11 +3936,16 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('post', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -2681,7 +3956,10 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - updateEmailVerification(params: { userId: string, secret: string }): Promise; + updateEmailVerification(params: { + userId: string; + secret: string; + }): Promise; /** * Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code. * @@ -2691,19 +3969,29 @@ export class Account extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateEmailVerification(userId: string, secret: string): Promise; updateEmailVerification( - paramsOrFirst: { userId: string, secret: string } | string, - ...rest: [(string)?] + userId: string, + secret: string, + ): Promise; + updateEmailVerification( + paramsOrFirst: { userId: string; secret: string } | string, + ...rest: [string?] ): Promise { - let params: { userId: string, secret: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { userId: string, secret: string }; + let params: { userId: string; secret: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + userId: string; + secret: string; + }; } else { params = { userId: paramsOrFirst as string, - secret: rest[0] as string + secret: rest[0] as string, }; } @@ -2730,11 +4018,16 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('put', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'put', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -2746,7 +4039,10 @@ export class Account extends Service { * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `Account.updateEmailVerification` instead. */ - updateVerification(params: { userId: string, secret: string }): Promise; + updateVerification(params: { + userId: string; + secret: string; + }): Promise; /** * Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code. * @@ -2758,17 +4054,24 @@ export class Account extends Service { */ updateVerification(userId: string, secret: string): Promise; updateVerification( - paramsOrFirst: { userId: string, secret: string } | string, - ...rest: [(string)?] + paramsOrFirst: { userId: string; secret: string } | string, + ...rest: [string?] ): Promise { - let params: { userId: string, secret: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { userId: string, secret: string }; + let params: { userId: string; secret: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + userId: string; + secret: string; + }; } else { params = { userId: paramsOrFirst as string, - secret: rest[0] as string + secret: rest[0] as string, }; } @@ -2795,11 +4098,16 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('put', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'put', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -2813,11 +4121,16 @@ export class Account extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('post', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -2828,7 +4141,10 @@ export class Account extends Service { * @throws {AppwriteException} * @returns {Promise} */ - updatePhoneVerification(params: { userId: string, secret: string }): Promise; + updatePhoneVerification(params: { + userId: string; + secret: string; + }): Promise; /** * Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code. * @@ -2838,19 +4154,29 @@ export class Account extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updatePhoneVerification(userId: string, secret: string): Promise; updatePhoneVerification( - paramsOrFirst: { userId: string, secret: string } | string, - ...rest: [(string)?] + userId: string, + secret: string, + ): Promise; + updatePhoneVerification( + paramsOrFirst: { userId: string; secret: string } | string, + ...rest: [string?] ): Promise { - let params: { userId: string, secret: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { userId: string, secret: string }; + let params: { userId: string; secret: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + userId: string; + secret: string; + }; } else { params = { userId: paramsOrFirst as string, - secret: rest[0] as string + secret: rest[0] as string, }; } @@ -2877,10 +4203,15 @@ export class Account extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('put', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'put', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } -}; +} diff --git a/src/services/avatars.ts b/src/services/avatars.ts index aaee80f2..ebe61501 100644 --- a/src/services/avatars.ts +++ b/src/services/avatars.ts @@ -1,9 +1,6 @@ import { Service } from '../service'; import { AppwriteException, Client } from '../client'; -import type { Models } from '../models'; -import type { UploadProgress, Payload } from '../client'; -import * as FileSystem from 'expo-file-system'; -import { Platform as RNPlatform } from 'react-native'; +import type { Payload } from '../client'; import { Browser } from '../enums/browser'; import { CreditCard } from '../enums/credit-card'; @@ -12,17 +9,14 @@ import { BrowserTheme } from '../enums/browser-theme'; import { Timezone } from '../enums/timezone'; import { BrowserPermission } from '../enums/browser-permission'; import { ImageFormat } from '../enums/image-format'; - export class Avatars extends Service { - - constructor(client: Client) - { + constructor(client: Client) { super(client); - } + } /** * You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings. - * + * * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. * * @param {Browser} params.code - Browser Code. @@ -32,10 +26,15 @@ export class Avatars extends Service { * @throws {AppwriteException} * @returns {ArrayBuffer} */ - getBrowser(params: { code: Browser, width?: number, height?: number, quality?: number }): Promise; + getBrowser(params: { + code: Browser; + width?: number; + height?: number; + quality?: number; + }): Promise; /** * You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings. - * + * * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. * * @param {Browser} code - Browser Code. @@ -46,21 +45,51 @@ export class Avatars extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getBrowser(code: Browser, width?: number, height?: number, quality?: number): Promise; getBrowser( - paramsOrFirst: { code: Browser, width?: number, height?: number, quality?: number } | Browser, - ...rest: [(number)?, (number)?, (number)?] + code: Browser, + width?: number, + height?: number, + quality?: number, + ): Promise; + getBrowser( + paramsOrFirst: + | { + code: Browser; + width?: number; + height?: number; + quality?: number; + } + | Browser, + ...rest: [number?, number?, number?] ): Promise { - let params: { code: Browser, width?: number, height?: number, quality?: number }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('code' in paramsOrFirst || 'width' in paramsOrFirst || 'height' in paramsOrFirst || 'quality' in paramsOrFirst))) { - params = (paramsOrFirst || {}) as { code: Browser, width?: number, height?: number, quality?: number }; + let params: { + code: Browser; + width?: number; + height?: number; + quality?: number; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) && + ('code' in paramsOrFirst || + 'width' in paramsOrFirst || + 'height' in paramsOrFirst || + 'quality' in paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + code: Browser; + width?: number; + height?: number; + quality?: number; + }; } else { params = { code: paramsOrFirst as Browser, width: rest[0] as number, height: rest[1] as number, - quality: rest[2] as number + quality: rest[2] as number, }; } @@ -73,7 +102,10 @@ export class Avatars extends Service { throw new AppwriteException('Missing required parameter: "code"'); } - const apiPath = '/avatars/browsers/{code}'.replace('{code}', encodeURIComponent(String(code))); + const apiPath = '/avatars/browsers/{code}'.replace( + '{code}', + encodeURIComponent(String(code)), + ); const payload: Payload = {}; if (typeof width !== 'undefined') { @@ -93,21 +125,26 @@ export class Avatars extends Service { payload['impersonateuserid'] = this.client.config.impersonateuserid; - for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'image/png', - }, payload, 'arrayBuffer'); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'image/png', + }, + payload, + 'arrayBuffer', + ); } /** * The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings. - * + * * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. - * + * * * @param {CreditCard} params.code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay. * @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100. @@ -116,12 +153,17 @@ export class Avatars extends Service { * @throws {AppwriteException} * @returns {ArrayBuffer} */ - getCreditCard(params: { code: CreditCard, width?: number, height?: number, quality?: number }): Promise; + getCreditCard(params: { + code: CreditCard; + width?: number; + height?: number; + quality?: number; + }): Promise; /** * The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings. - * + * * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. - * + * * * @param {CreditCard} code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay. * @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100. @@ -131,21 +173,51 @@ export class Avatars extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getCreditCard(code: CreditCard, width?: number, height?: number, quality?: number): Promise; getCreditCard( - paramsOrFirst: { code: CreditCard, width?: number, height?: number, quality?: number } | CreditCard, - ...rest: [(number)?, (number)?, (number)?] + code: CreditCard, + width?: number, + height?: number, + quality?: number, + ): Promise; + getCreditCard( + paramsOrFirst: + | { + code: CreditCard; + width?: number; + height?: number; + quality?: number; + } + | CreditCard, + ...rest: [number?, number?, number?] ): Promise { - let params: { code: CreditCard, width?: number, height?: number, quality?: number }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('code' in paramsOrFirst || 'width' in paramsOrFirst || 'height' in paramsOrFirst || 'quality' in paramsOrFirst))) { - params = (paramsOrFirst || {}) as { code: CreditCard, width?: number, height?: number, quality?: number }; + let params: { + code: CreditCard; + width?: number; + height?: number; + quality?: number; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) && + ('code' in paramsOrFirst || + 'width' in paramsOrFirst || + 'height' in paramsOrFirst || + 'quality' in paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + code: CreditCard; + width?: number; + height?: number; + quality?: number; + }; } else { params = { code: paramsOrFirst as CreditCard, width: rest[0] as number, height: rest[1] as number, - quality: rest[2] as number + quality: rest[2] as number, }; } @@ -158,7 +230,10 @@ export class Avatars extends Service { throw new AppwriteException('Missing required parameter: "code"'); } - const apiPath = '/avatars/credit-cards/{code}'.replace('{code}', encodeURIComponent(String(code))); + const apiPath = '/avatars/credit-cards/{code}'.replace( + '{code}', + encodeURIComponent(String(code)), + ); const payload: Payload = {}; if (typeof width !== 'undefined') { @@ -178,29 +253,34 @@ export class Avatars extends Service { payload['impersonateuserid'] = this.client.config.impersonateuserid; - for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'image/png', - }, payload, 'arrayBuffer'); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'image/png', + }, + payload, + 'arrayBuffer', + ); } /** * Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL. - * + * * This endpoint does not follow HTTP redirects. * * @param {string} params.url - Website URL which you want to fetch the favicon from. * @throws {AppwriteException} * @returns {ArrayBuffer} */ - getFavicon(params: { url: string }): Promise; + getFavicon(params: { url: string }): Promise; /** * Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL. - * + * * This endpoint does not follow HTTP redirects. * * @param {string} url - Website URL which you want to fetch the favicon from. @@ -209,16 +289,18 @@ export class Avatars extends Service { * @deprecated Use the object parameter style method for a better developer experience. */ getFavicon(url: string): Promise; - getFavicon( - paramsOrFirst: { url: string } | string - ): Promise { + getFavicon(paramsOrFirst: { url: string } | string): Promise { let params: { url: string }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { params = (paramsOrFirst || {}) as { url: string }; } else { params = { - url: paramsOrFirst as string + url: paramsOrFirst as string, }; } @@ -240,21 +322,26 @@ export class Avatars extends Service { payload['impersonateuserid'] = this.client.config.impersonateuserid; - for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'image/*', - }, payload, 'arrayBuffer'); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'image/*', + }, + payload, + 'arrayBuffer', + ); } /** * You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard. - * + * * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. - * + * * * @param {Flag} params.code - Country Code. ISO Alpha-2 country code format. * @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100. @@ -263,12 +350,17 @@ export class Avatars extends Service { * @throws {AppwriteException} * @returns {ArrayBuffer} */ - getFlag(params: { code: Flag, width?: number, height?: number, quality?: number }): Promise; + getFlag(params: { + code: Flag; + width?: number; + height?: number; + quality?: number; + }): Promise; /** * You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard. - * + * * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. - * + * * * @param {Flag} code - Country Code. ISO Alpha-2 country code format. * @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100. @@ -278,21 +370,46 @@ export class Avatars extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getFlag(code: Flag, width?: number, height?: number, quality?: number): Promise; getFlag( - paramsOrFirst: { code: Flag, width?: number, height?: number, quality?: number } | Flag, - ...rest: [(number)?, (number)?, (number)?] + code: Flag, + width?: number, + height?: number, + quality?: number, + ): Promise; + getFlag( + paramsOrFirst: + | { code: Flag; width?: number; height?: number; quality?: number } + | Flag, + ...rest: [number?, number?, number?] ): Promise { - let params: { code: Flag, width?: number, height?: number, quality?: number }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('code' in paramsOrFirst || 'width' in paramsOrFirst || 'height' in paramsOrFirst || 'quality' in paramsOrFirst))) { - params = (paramsOrFirst || {}) as { code: Flag, width?: number, height?: number, quality?: number }; + let params: { + code: Flag; + width?: number; + height?: number; + quality?: number; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) && + ('code' in paramsOrFirst || + 'width' in paramsOrFirst || + 'height' in paramsOrFirst || + 'quality' in paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + code: Flag; + width?: number; + height?: number; + quality?: number; + }; } else { params = { code: paramsOrFirst as Flag, width: rest[0] as number, height: rest[1] as number, - quality: rest[2] as number + quality: rest[2] as number, }; } @@ -305,7 +422,10 @@ export class Avatars extends Service { throw new AppwriteException('Missing required parameter: "code"'); } - const apiPath = '/avatars/flags/{code}'.replace('{code}', encodeURIComponent(String(code))); + const apiPath = '/avatars/flags/{code}'.replace( + '{code}', + encodeURIComponent(String(code)), + ); const payload: Payload = {}; if (typeof width !== 'undefined') { @@ -325,21 +445,26 @@ export class Avatars extends Service { payload['impersonateuserid'] = this.client.config.impersonateuserid; - for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'image/png', - }, payload, 'arrayBuffer'); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'image/png', + }, + payload, + 'arrayBuffer', + ); } /** * Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol. - * + * * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px. - * + * * This endpoint does not follow HTTP redirects. * * @param {string} params.url - Image URL which you want to crop. @@ -348,12 +473,16 @@ export class Avatars extends Service { * @throws {AppwriteException} * @returns {ArrayBuffer} */ - getImage(params: { url: string, width?: number, height?: number }): Promise; + getImage(params: { + url: string; + width?: number; + height?: number; + }): Promise; /** * Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol. - * + * * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px. - * + * * This endpoint does not follow HTTP redirects. * * @param {string} url - Image URL which you want to crop. @@ -363,20 +492,33 @@ export class Avatars extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getImage(url: string, width?: number, height?: number): Promise; getImage( - paramsOrFirst: { url: string, width?: number, height?: number } | string, - ...rest: [(number)?, (number)?] + url: string, + width?: number, + height?: number, + ): Promise; + getImage( + paramsOrFirst: + { url: string; width?: number; height?: number } | string, + ...rest: [number?, number?] ): Promise { - let params: { url: string, width?: number, height?: number }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { url: string, width?: number, height?: number }; + let params: { url: string; width?: number; height?: number }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + url: string; + width?: number; + height?: number; + }; } else { params = { url: paramsOrFirst as string, width: rest[0] as number, - height: rest[1] as number + height: rest[1] as number, }; } @@ -408,23 +550,28 @@ export class Avatars extends Service { payload['impersonateuserid'] = this.client.config.impersonateuserid; - for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'image/*', - }, payload, 'arrayBuffer'); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'image/*', + }, + payload, + 'arrayBuffer', + ); } /** * Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned. - * + * * You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials. - * + * * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. - * + * * * @param {string} params.name - Full Name. When empty, current user name or email will be used. Max length: 128 chars. * @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100. @@ -433,14 +580,19 @@ export class Avatars extends Service { * @throws {AppwriteException} * @returns {ArrayBuffer} */ - getInitials(params?: { name?: string, width?: number, height?: number, background?: string }): Promise; + getInitials(params?: { + name?: string; + width?: number; + height?: number; + background?: string; + }): Promise; /** * Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned. - * + * * You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials. - * + * * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px. - * + * * * @param {string} name - Full Name. When empty, current user name or email will be used. Max length: 128 chars. * @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100. @@ -450,21 +602,48 @@ export class Avatars extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getInitials(name?: string, width?: number, height?: number, background?: string): Promise; getInitials( - paramsOrFirst?: { name?: string, width?: number, height?: number, background?: string } | string, - ...rest: [(number)?, (number)?, (string)?] + name?: string, + width?: number, + height?: number, + background?: string, + ): Promise; + getInitials( + paramsOrFirst?: + | { + name?: string; + width?: number; + height?: number; + background?: string; + } + | string, + ...rest: [number?, number?, string?] ): Promise { - let params: { name?: string, width?: number, height?: number, background?: string }; - - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { name?: string, width?: number, height?: number, background?: string }; + let params: { + name?: string; + width?: number; + height?: number; + background?: string; + }; + + if ( + !paramsOrFirst || + (paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst)) + ) { + params = (paramsOrFirst || {}) as { + name?: string; + width?: number; + height?: number; + background?: string; + }; } else { params = { name: paramsOrFirst as string, width: rest[0] as number, height: rest[1] as number, - background: rest[2] as string + background: rest[2] as string, }; } @@ -497,19 +676,196 @@ export class Avatars extends Service { payload['impersonateuserid'] = this.client.config.impersonateuserid; + for (const [key, value] of Object.entries(Service.flatten(payload))) { + uri.searchParams.append(key, value); + } + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'image/png', + }, + payload, + 'arrayBuffer', + ); + } + + /** + * Returns the best available profile photo for a user. The endpoint tries each source in priority order and returns the first successful result: OAuth2 identity photo, Gravatar, Libravatar, Appwrite Initials, built-in static fallback. + * + * Passing `userId` — `current()` for the authenticated user — resolves the photo from everything known about that user: identity photos, email, and name. An explicit `emailHash` or `name` then overrides just that value, and the user's remaining sources stay in the chain. Without `userId`, passing `emailHash` and/or `name` resolves the avatar from those values alone: the hash is looked up on Gravatar and Libravatar, the name is rendered as initials, and the session user stays out of the chain so their own photo never shadows the avatar being asked for. When nothing is passed, the photo resolves for the currently authenticated user. Emails are only ever accepted pre-hashed, so no address ends up in a URL. + * + * @param {number} params.width - Output image width in pixels. Pass an integer between 0 and 2000. Defaults to 256. + * @param {number} params.height - Output image height in pixels. Pass an integer between 0 and 2000. Defaults to 256. + * @param {number} params.quality - Output image quality between 0 and 100. Defaults to 100. + * @param {string} params.output - Output image format. Defaults to 'png'. + * @param {string} params.rating - Maximum image rating to fetch from Gravatar/Libravatar. Defaults to 'g'. + * @param {string} params.userId - User ID to resolve the photo for. Pass 'current()' for the currently authenticated user. When omitted, the session user is used only if no emailHash and no name is passed. + * @param {string} params.emailHash - SHA256 hash of the lowercase, trimmed email address to look up on Gravatar and Libravatar instead of the user's own email. Pass the hash, never the address itself. + * @param {string} params.name - Name to render initials from instead of the user's own name. Max length: 128 chars. + * @throws {AppwriteException} + * @returns {ArrayBuffer} + */ + getPhoto(params?: { + width?: number; + height?: number; + quality?: number; + output?: string; + rating?: string; + userId?: string; + emailHash?: string; + name?: string; + }): Promise; + /** + * Returns the best available profile photo for a user. The endpoint tries each source in priority order and returns the first successful result: OAuth2 identity photo, Gravatar, Libravatar, Appwrite Initials, built-in static fallback. + * + * Passing `userId` — `current()` for the authenticated user — resolves the photo from everything known about that user: identity photos, email, and name. An explicit `emailHash` or `name` then overrides just that value, and the user's remaining sources stay in the chain. Without `userId`, passing `emailHash` and/or `name` resolves the avatar from those values alone: the hash is looked up on Gravatar and Libravatar, the name is rendered as initials, and the session user stays out of the chain so their own photo never shadows the avatar being asked for. When nothing is passed, the photo resolves for the currently authenticated user. Emails are only ever accepted pre-hashed, so no address ends up in a URL. + * + * @param {number} width - Output image width in pixels. Pass an integer between 0 and 2000. Defaults to 256. + * @param {number} height - Output image height in pixels. Pass an integer between 0 and 2000. Defaults to 256. + * @param {number} quality - Output image quality between 0 and 100. Defaults to 100. + * @param {string} output - Output image format. Defaults to 'png'. + * @param {string} rating - Maximum image rating to fetch from Gravatar/Libravatar. Defaults to 'g'. + * @param {string} userId - User ID to resolve the photo for. Pass 'current()' for the currently authenticated user. When omitted, the session user is used only if no emailHash and no name is passed. + * @param {string} emailHash - SHA256 hash of the lowercase, trimmed email address to look up on Gravatar and Libravatar instead of the user's own email. Pass the hash, never the address itself. + * @param {string} name - Name to render initials from instead of the user's own name. Max length: 128 chars. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getPhoto( + width?: number, + height?: number, + quality?: number, + output?: string, + rating?: string, + userId?: string, + emailHash?: string, + name?: string, + ): Promise; + getPhoto( + paramsOrFirst?: + | { + width?: number; + height?: number; + quality?: number; + output?: string; + rating?: string; + userId?: string; + emailHash?: string; + name?: string; + } + | number, + ...rest: [number?, number?, string?, string?, string?, string?, string?] + ): Promise { + let params: { + width?: number; + height?: number; + quality?: number; + output?: string; + rating?: string; + userId?: string; + emailHash?: string; + name?: string; + }; + + if ( + !paramsOrFirst || + (paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst)) + ) { + params = (paramsOrFirst || {}) as { + width?: number; + height?: number; + quality?: number; + output?: string; + rating?: string; + userId?: string; + emailHash?: string; + name?: string; + }; + } else { + params = { + width: paramsOrFirst as number, + height: rest[0] as number, + quality: rest[1] as number, + output: rest[2] as string, + rating: rest[3] as string, + userId: rest[4] as string, + emailHash: rest[5] as string, + name: rest[6] as string, + }; + } + + const width = params.width; + const height = params.height; + const quality = params.quality; + const output = params.output; + const rating = params.rating; + const userId = params.userId; + const emailHash = params.emailHash; + const name = params.name; + + const apiPath = '/avatars/photo'; + const payload: Payload = {}; + + if (typeof width !== 'undefined') { + payload['width'] = width; + } + + if (typeof height !== 'undefined') { + payload['height'] = height; + } + + if (typeof quality !== 'undefined') { + payload['quality'] = quality; + } + + if (typeof output !== 'undefined') { + payload['output'] = output; + } + + if (typeof rating !== 'undefined') { + payload['rating'] = rating; + } + + if (typeof userId !== 'undefined') { + payload['userId'] = userId; + } + + if (typeof emailHash !== 'undefined') { + payload['emailHash'] = emailHash; + } + + if (typeof name !== 'undefined') { + payload['name'] = name; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + payload['project'] = this.client.config.project; + + payload['impersonateuserid'] = this.client.config.impersonateuserid; for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'image/png', - }, payload, 'arrayBuffer'); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'image/*', + }, + payload, + 'arrayBuffer', + ); } /** * Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image. - * + * * * @param {string} params.text - Plain text to be converted to QR code image. * @param {number} params.size - QR code size. Pass an integer between 1 to 1000. Defaults to 400. @@ -518,10 +874,15 @@ export class Avatars extends Service { * @throws {AppwriteException} * @returns {ArrayBuffer} */ - getQR(params: { text: string, size?: number, margin?: number, download?: boolean }): Promise; + getQR(params: { + text: string; + size?: number; + margin?: number; + download?: boolean; + }): Promise; /** * Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image. - * + * * * @param {string} text - Plain text to be converted to QR code image. * @param {number} size - QR code size. Pass an integer between 1 to 1000. Defaults to 400. @@ -531,21 +892,47 @@ export class Avatars extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getQR(text: string, size?: number, margin?: number, download?: boolean): Promise; getQR( - paramsOrFirst: { text: string, size?: number, margin?: number, download?: boolean } | string, - ...rest: [(number)?, (number)?, (boolean)?] + text: string, + size?: number, + margin?: number, + download?: boolean, + ): Promise; + getQR( + paramsOrFirst: + | { + text: string; + size?: number; + margin?: number; + download?: boolean; + } + | string, + ...rest: [number?, number?, boolean?] ): Promise { - let params: { text: string, size?: number, margin?: number, download?: boolean }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { text: string, size?: number, margin?: number, download?: boolean }; + let params: { + text: string; + size?: number; + margin?: number; + download?: boolean; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + text: string; + size?: number; + margin?: number; + download?: boolean; + }; } else { params = { text: paramsOrFirst as string, size: rest[0] as number, margin: rest[1] as number, - download: rest[2] as boolean + download: rest[2] as boolean, }; } @@ -582,21 +969,26 @@ export class Avatars extends Service { payload['impersonateuserid'] = this.client.config.impersonateuserid; - for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'image/png', - }, payload, 'arrayBuffer'); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'image/png', + }, + payload, + 'arrayBuffer', + ); } /** * Use this endpoint to capture a screenshot of any website URL. This endpoint uses a headless browser to render the webpage and capture it as an image. - * + * * You can configure the browser viewport size, theme, user agent, geolocation, permissions, and more. Capture either just the viewport or the full page scroll. - * + * * When width and height are specified, the image is resized accordingly. If both dimensions are 0, the API provides an image at original size. If dimensions are not specified, the default viewport size is 1280x720px. * * @param {string} params.url - Website URL which you want to capture. @@ -622,12 +1014,33 @@ export class Avatars extends Service { * @throws {AppwriteException} * @returns {ArrayBuffer} */ - getScreenshot(params: { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: BrowserTheme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat }): Promise; + getScreenshot(params: { + url: string; + headers?: object; + viewportWidth?: number; + viewportHeight?: number; + scale?: number; + theme?: BrowserTheme; + userAgent?: string; + fullpage?: boolean; + locale?: string; + timezone?: Timezone; + latitude?: number; + longitude?: number; + accuracy?: number; + touch?: boolean; + permissions?: BrowserPermission[]; + sleep?: number; + width?: number; + height?: number; + quality?: number; + output?: ImageFormat; + }): Promise; /** * Use this endpoint to capture a screenshot of any website URL. This endpoint uses a headless browser to render the webpage and capture it as an image. - * + * * You can configure the browser viewport size, theme, user agent, geolocation, permissions, and more. Capture either just the viewport or the full page scroll. - * + * * When width and height are specified, the image is resized accordingly. If both dimensions are 0, the API provides an image at original size. If dimensions are not specified, the default viewport size is 1280x720px. * * @param {string} url - Website URL which you want to capture. @@ -654,15 +1067,125 @@ export class Avatars extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getScreenshot(url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: BrowserTheme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat): Promise; getScreenshot( - paramsOrFirst: { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: BrowserTheme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat } | string, - ...rest: [(object)?, (number)?, (number)?, (number)?, (BrowserTheme)?, (string)?, (boolean)?, (string)?, (Timezone)?, (number)?, (number)?, (number)?, (boolean)?, (BrowserPermission[])?, (number)?, (number)?, (number)?, (number)?, (ImageFormat)?] + url: string, + headers?: object, + viewportWidth?: number, + viewportHeight?: number, + scale?: number, + theme?: BrowserTheme, + userAgent?: string, + fullpage?: boolean, + locale?: string, + timezone?: Timezone, + latitude?: number, + longitude?: number, + accuracy?: number, + touch?: boolean, + permissions?: BrowserPermission[], + sleep?: number, + width?: number, + height?: number, + quality?: number, + output?: ImageFormat, + ): Promise; + getScreenshot( + paramsOrFirst: + | { + url: string; + headers?: object; + viewportWidth?: number; + viewportHeight?: number; + scale?: number; + theme?: BrowserTheme; + userAgent?: string; + fullpage?: boolean; + locale?: string; + timezone?: Timezone; + latitude?: number; + longitude?: number; + accuracy?: number; + touch?: boolean; + permissions?: BrowserPermission[]; + sleep?: number; + width?: number; + height?: number; + quality?: number; + output?: ImageFormat; + } + | string, + ...rest: [ + object?, + number?, + number?, + number?, + BrowserTheme?, + string?, + boolean?, + string?, + Timezone?, + number?, + number?, + number?, + boolean?, + BrowserPermission[]?, + number?, + number?, + number?, + number?, + ImageFormat?, + ] ): Promise { - let params: { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: BrowserTheme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: BrowserTheme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat }; + let params: { + url: string; + headers?: object; + viewportWidth?: number; + viewportHeight?: number; + scale?: number; + theme?: BrowserTheme; + userAgent?: string; + fullpage?: boolean; + locale?: string; + timezone?: Timezone; + latitude?: number; + longitude?: number; + accuracy?: number; + touch?: boolean; + permissions?: BrowserPermission[]; + sleep?: number; + width?: number; + height?: number; + quality?: number; + output?: ImageFormat; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + url: string; + headers?: object; + viewportWidth?: number; + viewportHeight?: number; + scale?: number; + theme?: BrowserTheme; + userAgent?: string; + fullpage?: boolean; + locale?: string; + timezone?: Timezone; + latitude?: number; + longitude?: number; + accuracy?: number; + touch?: boolean; + permissions?: BrowserPermission[]; + sleep?: number; + width?: number; + height?: number; + quality?: number; + output?: ImageFormat; + }; } else { params = { url: paramsOrFirst as string, @@ -684,7 +1207,7 @@ export class Avatars extends Service { width: rest[15] as number, height: rest[16] as number, quality: rest[17] as number, - output: rest[18] as ImageFormat + output: rest[18] as ImageFormat, }; } @@ -801,14 +1324,19 @@ export class Avatars extends Service { payload['impersonateuserid'] = this.client.config.impersonateuserid; - for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'image/png', - }, payload, 'arrayBuffer'); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'image/png', + }, + payload, + 'arrayBuffer', + ); } /** @@ -817,7 +1345,7 @@ export class Avatars extends Service { * /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) * endpoint. Use width, height and quality arguments to change the output * settings. - * + * * When one dimension is specified and the other is 0, the image is scaled * with preserved aspect ratio. If both dimensions are 0, the API provides an * image at source quality. If dimensions are not specified, the default size @@ -829,9 +1357,17 @@ export class Avatars extends Service { * @param {number} quality * @throws {AppwriteException} * @returns {URL} - */ - getBrowserURL(code: Browser, width?: number, height?: number, quality?: number): URL { - const apiPath = '/avatars/browsers/{code}'.replace('{code}', encodeURIComponent(String(code))); + */ + getBrowserURL( + code: Browser, + width?: number, + height?: number, + quality?: number, + ): URL { + const apiPath = '/avatars/browsers/{code}'.replace( + '{code}', + encodeURIComponent(String(code)), + ); const payload: Payload = {}; if (typeof width !== 'undefined') { @@ -862,12 +1398,12 @@ export class Avatars extends Service { * The credit card endpoint will return you the icon of the credit card * provider you need. Use width, height and quality arguments to change the * output settings. - * + * * When one dimension is specified and the other is 0, the image is scaled * with preserved aspect ratio. If both dimensions are 0, the API provides an * image at source quality. If dimensions are not specified, the default size * of image returned is 100x100px. - * + * * * @param {CreditCard} code * @param {number} width @@ -875,9 +1411,17 @@ export class Avatars extends Service { * @param {number} quality * @throws {AppwriteException} * @returns {URL} - */ - getCreditCardURL(code: CreditCard, width?: number, height?: number, quality?: number): URL { - const apiPath = '/avatars/credit-cards/{code}'.replace('{code}', encodeURIComponent(String(code))); + */ + getCreditCardURL( + code: CreditCard, + width?: number, + height?: number, + quality?: number, + ): URL { + const apiPath = '/avatars/credit-cards/{code}'.replace( + '{code}', + encodeURIComponent(String(code)), + ); const payload: Payload = {}; if (typeof width !== 'undefined') { @@ -907,13 +1451,13 @@ export class Avatars extends Service { /** * Use this endpoint to fetch the favorite icon (AKA favicon) of any remote * website URL. - * + * * This endpoint does not follow HTTP redirects. * * @param {string} url * @throws {AppwriteException} * @returns {URL} - */ + */ getFaviconURL(url: string): URL { const apiPath = '/avatars/favicon'; const payload: Payload = {}; @@ -939,12 +1483,12 @@ export class Avatars extends Service { * users. The code argument receives the 2 letter country code. Use width, * height and quality arguments to change the output settings. Country codes * follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard. - * + * * When one dimension is specified and the other is 0, the image is scaled * with preserved aspect ratio. If both dimensions are 0, the API provides an * image at source quality. If dimensions are not specified, the default size * of image returned is 100x100px. - * + * * * @param {Flag} code * @param {number} width @@ -952,9 +1496,17 @@ export class Avatars extends Service { * @param {number} quality * @throws {AppwriteException} * @returns {URL} - */ - getFlagURL(code: Flag, width?: number, height?: number, quality?: number): URL { - const apiPath = '/avatars/flags/{code}'.replace('{code}', encodeURIComponent(String(code))); + */ + getFlagURL( + code: Flag, + width?: number, + height?: number, + quality?: number, + ): URL { + const apiPath = '/avatars/flags/{code}'.replace( + '{code}', + encodeURIComponent(String(code)), + ); const payload: Payload = {}; if (typeof width !== 'undefined') { @@ -986,12 +1538,12 @@ export class Avatars extends Service { * you want. This endpoint is very useful if you need to crop and display * remote images in your app or in case you want to make sure a 3rd party * image is properly served using a TLS protocol. - * + * * When one dimension is specified and the other is 0, the image is scaled * with preserved aspect ratio. If both dimensions are 0, the API provides an * image at source quality. If dimensions are not specified, the default size * of image returned is 400x400px. - * + * * This endpoint does not follow HTTP redirects. * * @param {string} url @@ -999,7 +1551,7 @@ export class Avatars extends Service { * @param {number} height * @throws {AppwriteException} * @returns {URL} - */ + */ getImageURL(url: string, width?: number, height?: number): URL { const apiPath = '/avatars/image'; const payload: Payload = {}; @@ -1031,20 +1583,20 @@ export class Avatars extends Service { /** * Use this endpoint to show your user initials avatar icon on your website or * app. By default, this route will try to print your logged-in user name or - * email initials. You can also overwrite the user name if you pass the 'name' + * email initials. You can also overwrite the user name if you pass the 'name' * parameter. If no name is given and no user is logged, an empty avatar will * be returned. - * + * * You can use the color and background params to change the avatar colors. By * default, a random theme will be selected. The random theme will persist for - * the user's initials when reloading the same theme will always return for + * the user's initials when reloading the same theme will always return for * the same initials. - * + * * When one dimension is specified and the other is 0, the image is scaled * with preserved aspect ratio. If both dimensions are 0, the API provides an * image at source quality. If dimensions are not specified, the default size * of image returned is 100x100px. - * + * * * @param {string} name * @param {number} width @@ -1052,8 +1604,13 @@ export class Avatars extends Service { * @param {string} background * @throws {AppwriteException} * @returns {URL} - */ - getInitialsURL(name?: string, width?: number, height?: number, background?: string): URL { + */ + getInitialsURL( + name?: string, + width?: number, + height?: number, + background?: string, + ): URL { const apiPath = '/avatars/initials'; const payload: Payload = {}; @@ -1085,10 +1642,95 @@ export class Avatars extends Service { return uri; } + /** + * Returns the best available profile photo for a user. The endpoint tries + * each source in priority order and returns the first successful result: + * OAuth2 identity photo, Gravatar, Libravatar, Appwrite Initials, built-in + * static fallback. + * + * Passing `userId` — `current()` for the authenticated user — resolves + * the photo from everything known about that user: identity photos, email, + * and name. An explicit `emailHash` or `name` then overrides just that value, + * and the user's remaining sources stay in the chain. Without `userId`, + * passing `emailHash` and/or `name` resolves the avatar from those values + * alone: the hash is looked up on Gravatar and Libravatar, the name is + * rendered as initials, and the session user stays out of the chain so their + * own photo never shadows the avatar being asked for. When nothing is passed, + * the photo resolves for the currently authenticated user. Emails are only + * ever accepted pre-hashed, so no address ends up in a URL. + * + * @param {number} width + * @param {number} height + * @param {number} quality + * @param {string} output + * @param {string} rating + * @param {string} userId + * @param {string} emailHash + * @param {string} name + * @throws {AppwriteException} + * @returns {URL} + */ + getPhotoURL( + width?: number, + height?: number, + quality?: number, + output?: string, + rating?: string, + userId?: string, + emailHash?: string, + name?: string, + ): URL { + const apiPath = '/avatars/photo'; + const payload: Payload = {}; + + if (typeof width !== 'undefined') { + payload['width'] = width; + } + + if (typeof height !== 'undefined') { + payload['height'] = height; + } + + if (typeof quality !== 'undefined') { + payload['quality'] = quality; + } + + if (typeof output !== 'undefined') { + payload['output'] = output; + } + + if (typeof rating !== 'undefined') { + payload['rating'] = rating; + } + + if (typeof userId !== 'undefined') { + payload['userId'] = userId; + } + + if (typeof emailHash !== 'undefined') { + payload['emailHash'] = emailHash; + } + + if (typeof name !== 'undefined') { + payload['name'] = name; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + payload['project'] = this.client.config.project; + + payload['impersonateuserid'] = this.client.config.impersonateuserid; + + for (const [key, value] of Object.entries(Service.flatten(payload))) { + uri.searchParams.append(key, value); + } + + return uri; + } + /** * Converts a given plain text to a QR code image. You can use the query * parameters to change the size and style of the resulting image. - * + * * * @param {string} text * @param {number} size @@ -1096,8 +1738,13 @@ export class Avatars extends Service { * @param {boolean} download * @throws {AppwriteException} * @returns {URL} - */ - getQRURL(text: string, size?: number, margin?: number, download?: boolean): URL { + */ + getQRURL( + text: string, + size?: number, + margin?: number, + download?: boolean, + ): URL { const apiPath = '/avatars/qr'; const payload: Payload = {}; @@ -1132,11 +1779,11 @@ export class Avatars extends Service { /** * Use this endpoint to capture a screenshot of any website URL. This endpoint * uses a headless browser to render the webpage and capture it as an image. - * + * * You can configure the browser viewport size, theme, user agent, * geolocation, permissions, and more. Capture either just the viewport or the * full page scroll. - * + * * When width and height are specified, the image is resized accordingly. If * both dimensions are 0, the API provides an image at original size. If * dimensions are not specified, the default viewport size is 1280x720px. @@ -1163,8 +1810,29 @@ export class Avatars extends Service { * @param {ImageFormat} output * @throws {AppwriteException} * @returns {URL} - */ - getScreenshotURL(url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: BrowserTheme, userAgent?: string, fullpage?: boolean, locale?: string, timezone?: Timezone, latitude?: number, longitude?: number, accuracy?: number, touch?: boolean, permissions?: BrowserPermission[], sleep?: number, width?: number, height?: number, quality?: number, output?: ImageFormat): URL { + */ + getScreenshotURL( + url: string, + headers?: object, + viewportWidth?: number, + viewportHeight?: number, + scale?: number, + theme?: BrowserTheme, + userAgent?: string, + fullpage?: boolean, + locale?: string, + timezone?: Timezone, + latitude?: number, + longitude?: number, + accuracy?: number, + touch?: boolean, + permissions?: BrowserPermission[], + sleep?: number, + width?: number, + height?: number, + quality?: number, + output?: ImageFormat, + ): URL { const apiPath = '/avatars/screenshots'; const payload: Payload = {}; @@ -1259,4 +1927,4 @@ export class Avatars extends Service { return uri; } -}; +} diff --git a/src/services/databases.ts b/src/services/databases.ts index 67cbfa58..14fd20ce 100644 --- a/src/services/databases.ts +++ b/src/services/databases.ts @@ -1,17 +1,12 @@ import { Service } from '../service'; import { AppwriteException, Client } from '../client'; import type { Models } from '../models'; -import type { UploadProgress, Payload } from '../client'; -import * as FileSystem from 'expo-file-system'; -import { Platform as RNPlatform } from 'react-native'; - +import type { Payload } from '../client'; export class Databases extends Service { - - constructor(client: Client) - { + constructor(client: Client) { super(client); - } + } /** * List transactions across all databases. @@ -21,7 +16,9 @@ export class Databases extends Service { * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.listTransactions` instead. */ - listTransactions(params?: { queries?: string[] }): Promise; + listTransactions(params?: { + queries?: string[]; + }): Promise; /** * List transactions across all databases. * @@ -32,15 +29,20 @@ export class Databases extends Service { */ listTransactions(queries?: string[]): Promise; listTransactions( - paramsOrFirst?: { queries?: string[] } | string[] + paramsOrFirst?: { queries?: string[] } | string[], ): Promise { let params: { queries?: string[] }; - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + if ( + !paramsOrFirst || + (paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst)) + ) { params = (paramsOrFirst || {}) as { queries?: string[] }; } else { params = { - queries: paramsOrFirst as string[] + queries: paramsOrFirst as string[], }; } @@ -54,10 +56,15 @@ export class Databases extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } /** @@ -68,7 +75,7 @@ export class Databases extends Service { * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createTransaction` instead. */ - createTransaction(params?: { ttl?: number }): Promise; + createTransaction(params?: { ttl?: number }): Promise; /** * Create a new transaction. * @@ -79,15 +86,20 @@ export class Databases extends Service { */ createTransaction(ttl?: number): Promise; createTransaction( - paramsOrFirst?: { ttl?: number } | number + paramsOrFirst?: { ttl?: number } | number, ): Promise { let params: { ttl?: number }; - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + if ( + !paramsOrFirst || + (paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst)) + ) { params = (paramsOrFirst || {}) as { ttl?: number }; } else { params = { - ttl: paramsOrFirst as number + ttl: paramsOrFirst as number, }; } @@ -101,11 +113,16 @@ export class Databases extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('post', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -116,7 +133,9 @@ export class Databases extends Service { * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.getTransaction` instead. */ - getTransaction(params: { transactionId: string }): Promise; + getTransaction(params: { + transactionId: string; + }): Promise; /** * Get a transaction by its unique ID. * @@ -127,32 +146,46 @@ export class Databases extends Service { */ getTransaction(transactionId: string): Promise; getTransaction( - paramsOrFirst: { transactionId: string } | string + paramsOrFirst: { transactionId: string } | string, ): Promise { let params: { transactionId: string }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { params = (paramsOrFirst || {}) as { transactionId: string }; } else { params = { - transactionId: paramsOrFirst as string + transactionId: paramsOrFirst as string, }; } const transactionId = params.transactionId; if (typeof transactionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "transactionId"'); + throw new AppwriteException( + 'Missing required parameter: "transactionId"', + ); } - const apiPath = '/databases/transactions/{transactionId}'.replace('{transactionId}', encodeURIComponent(String(transactionId))); + const apiPath = '/databases/transactions/{transactionId}'.replace( + '{transactionId}', + encodeURIComponent(String(transactionId)), + ); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } /** @@ -165,7 +198,11 @@ export class Databases extends Service { * @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; + updateTransaction(params: { + transactionId: string; + commit?: boolean; + rollback?: boolean; + }): Promise; /** * Update a transaction, to either commit or roll back its operations. * @@ -176,20 +213,38 @@ export class Databases extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateTransaction(transactionId: string, commit?: boolean, rollback?: boolean): Promise; updateTransaction( - paramsOrFirst: { transactionId: string, commit?: boolean, rollback?: boolean } | string, - ...rest: [(boolean)?, (boolean)?] + transactionId: string, + commit?: boolean, + rollback?: boolean, + ): Promise; + updateTransaction( + paramsOrFirst: + | { transactionId: string; commit?: boolean; rollback?: boolean } + | string, + ...rest: [boolean?, boolean?] ): Promise { - let params: { transactionId: string, commit?: boolean, rollback?: boolean }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { transactionId: string, commit?: boolean, rollback?: boolean }; + let params: { + transactionId: string; + commit?: boolean; + rollback?: boolean; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + transactionId: string; + commit?: boolean; + rollback?: boolean; + }; } else { params = { transactionId: paramsOrFirst as string, commit: rest[0] as boolean, - rollback: rest[1] as boolean + rollback: rest[1] as boolean, }; } @@ -198,10 +253,15 @@ export class Databases extends Service { const rollback = params.rollback; if (typeof transactionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "transactionId"'); + throw new AppwriteException( + 'Missing required parameter: "transactionId"', + ); } - const apiPath = '/databases/transactions/{transactionId}'.replace('{transactionId}', encodeURIComponent(String(transactionId))); + const apiPath = '/databases/transactions/{transactionId}'.replace( + '{transactionId}', + encodeURIComponent(String(transactionId)), + ); const payload: Payload = {}; if (typeof commit !== 'undefined') { @@ -213,11 +273,16 @@ export class Databases extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('patch', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'patch', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -228,7 +293,7 @@ export class Databases extends Service { * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.deleteTransaction` instead. */ - deleteTransaction(params: { transactionId: string }): Promise<{}>; + deleteTransaction(params: { transactionId: string }): Promise<{}>; /** * Delete a transaction by its unique ID. * @@ -239,32 +304,46 @@ export class Databases extends Service { */ deleteTransaction(transactionId: string): Promise<{}>; deleteTransaction( - paramsOrFirst: { transactionId: string } | string + paramsOrFirst: { transactionId: string } | string, ): Promise<{}> { let params: { transactionId: string }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { params = (paramsOrFirst || {}) as { transactionId: string }; } else { params = { - transactionId: paramsOrFirst as string + transactionId: paramsOrFirst as string, }; } const transactionId = params.transactionId; if (typeof transactionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "transactionId"'); + throw new AppwriteException( + 'Missing required parameter: "transactionId"', + ); } - const apiPath = '/databases/transactions/{transactionId}'.replace('{transactionId}', encodeURIComponent(String(transactionId))); + const apiPath = '/databases/transactions/{transactionId}'.replace( + '{transactionId}', + encodeURIComponent(String(transactionId)), + ); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('delete', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - }, payload); + return this.client.call( + 'delete', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + }, + payload, + ); } /** @@ -276,7 +355,10 @@ export class Databases extends Service { * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createOperations` instead. */ - createOperations(params: { transactionId: string, operations?: object[] }): Promise; + createOperations(params: { + transactionId: string; + operations?: object[]; + }): Promise; /** * Create multiple operations in a single transaction. * @@ -286,19 +368,30 @@ export class Databases extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createOperations(transactionId: string, operations?: object[]): Promise; createOperations( - paramsOrFirst: { transactionId: string, operations?: object[] } | string, - ...rest: [(object[])?] + transactionId: string, + operations?: object[], + ): Promise; + createOperations( + paramsOrFirst: + { transactionId: string; operations?: object[] } | string, + ...rest: [object[]?] ): Promise { - let params: { transactionId: string, operations?: object[] }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { transactionId: string, operations?: object[] }; + let params: { transactionId: string; operations?: object[] }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + transactionId: string; + operations?: object[]; + }; } else { params = { transactionId: paramsOrFirst as string, - operations: rest[0] as object[] + operations: rest[0] as object[], }; } @@ -306,10 +399,16 @@ export class Databases extends Service { const operations = params.operations; if (typeof transactionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "transactionId"'); + throw new AppwriteException( + 'Missing required parameter: "transactionId"', + ); } - const apiPath = '/databases/transactions/{transactionId}/operations'.replace('{transactionId}', encodeURIComponent(String(transactionId))); + const apiPath = + '/databases/transactions/{transactionId}/operations'.replace( + '{transactionId}', + encodeURIComponent(String(transactionId)), + ); const payload: Payload = {}; if (typeof operations !== 'undefined') { @@ -317,11 +416,16 @@ export class Databases extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('post', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -337,7 +441,16 @@ export class Databases extends Service { * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.listRows` instead. */ - listDocuments(params: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number }): Promise>; + listDocuments< + Document extends Models.Document = Models.DefaultDocument, + >(params: { + databaseId: string; + collectionId: string; + queries?: string[]; + transactionId?: string; + total?: boolean; + ttl?: number; + }): Promise>; /** * Get a list of all the user's documents in a given collection. You can use the query params to filter your results. * @@ -351,15 +464,49 @@ export class Databases extends Service { * @returns {Promise>} * @deprecated Use the object parameter style method for a better developer experience. */ - listDocuments(databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number): Promise>; listDocuments( - paramsOrFirst: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number } | string, - ...rest: [(string)?, (string[])?, (string)?, (boolean)?, (number)?] + databaseId: string, + collectionId: string, + queries?: string[], + transactionId?: string, + total?: boolean, + ttl?: number, + ): Promise>; + listDocuments( + paramsOrFirst: + | { + databaseId: string; + collectionId: string; + queries?: string[]; + transactionId?: string; + total?: boolean; + ttl?: number; + } + | string, + ...rest: [string?, string[]?, string?, boolean?, number?] ): Promise> { - let params: { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number }; + let params: { + databaseId: string; + collectionId: string; + queries?: string[]; + transactionId?: string; + total?: boolean; + ttl?: number; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + collectionId: string; + queries?: string[]; + transactionId?: string; + total?: boolean; + ttl?: number; + }; } else { params = { databaseId: paramsOrFirst as string, @@ -367,7 +514,7 @@ export class Databases extends Service { queries: rest[1] as string[], transactionId: rest[2] as string, total: rest[3] as boolean, - ttl: rest[4] as number + ttl: rest[4] as number, }; } @@ -379,14 +526,24 @@ export class Databases extends Service { const ttl = params.ttl; if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); } if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); - } - - const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))); + throw new AppwriteException( + 'Missing required parameter: "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') { @@ -406,10 +563,15 @@ export class Databases extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } /** @@ -425,7 +587,18 @@ export class Databases extends Service { * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createRow` instead. */ - createDocument(params: { databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit, permissions?: string[], transactionId?: string }): Promise; + createDocument< + Document extends Models.Document = Models.DefaultDocument, + >(params: { + databaseId: string; + collectionId: string; + documentId: string; + data: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & Omit; + permissions?: string[]; + transactionId?: string; + }): Promise; /** * Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. * @@ -439,23 +612,80 @@ export class Databases extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createDocument(databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit, permissions?: string[], transactionId?: string): Promise; createDocument( - paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit, permissions?: string[], transactionId?: string } | string, - ...rest: [(string)?, (string)?, (Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit)?, (string[])?, (string)?] + databaseId: string, + collectionId: string, + documentId: string, + data: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & Omit, + permissions?: string[], + transactionId?: string, + ): Promise; + createDocument( + paramsOrFirst: + | { + databaseId: string; + collectionId: string; + documentId: string; + data: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Omit; + permissions?: string[]; + transactionId?: string; + } + | string, + ...rest: [ + string?, + string?, + (Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Omit)?, + string[]?, + string?, + ] ): Promise { - let params: { databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit, permissions?: string[], transactionId?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit, permissions?: string[], transactionId?: string }; + let params: { + databaseId: string; + collectionId: string; + documentId: string; + data: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Omit; + permissions?: string[]; + transactionId?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + collectionId: string; + documentId: string; + data: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Omit; + permissions?: string[]; + transactionId?: string; + }; } else { params = { databaseId: paramsOrFirst as string, collectionId: rest[0] as string, documentId: rest[1] as string, - data: rest[2] as Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit, + data: rest[2] as Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Omit, permissions: rest[3] as string[], - transactionId: rest[4] as string + transactionId: rest[4] as string, }; } @@ -467,22 +697,34 @@ export class Databases extends Service { const transactionId = params.transactionId; if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); } if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); + throw new AppwriteException( + 'Missing required parameter: "collectionId"', + ); } if (typeof documentId === 'undefined') { - throw new AppwriteException('Missing required parameter: "documentId"'); + throw new AppwriteException( + 'Missing required parameter: "documentId"', + ); } if (typeof data === 'undefined') { throw new AppwriteException('Missing required parameter: "data"'); } - const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(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') { @@ -502,11 +744,16 @@ export class Databases extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('post', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -521,7 +768,15 @@ export class Databases extends Service { * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.getRow` instead. */ - getDocument(params: { databaseId: string, collectionId: string, documentId: string, queries?: string[], transactionId?: string }): Promise; + getDocument< + Document extends Models.Document = Models.DefaultDocument, + >(params: { + databaseId: string; + collectionId: string; + documentId: string; + queries?: string[]; + transactionId?: string; + }): Promise; /** * Get a document by its unique ID. This endpoint response returns a JSON object with the document data. * @@ -534,22 +789,52 @@ export class Databases extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getDocument(databaseId: string, collectionId: string, documentId: string, queries?: string[], transactionId?: string): Promise; getDocument( - paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, queries?: string[], transactionId?: string } | string, - ...rest: [(string)?, (string)?, (string[])?, (string)?] + databaseId: string, + collectionId: string, + documentId: string, + queries?: string[], + transactionId?: string, + ): Promise; + getDocument( + paramsOrFirst: + | { + databaseId: string; + collectionId: string; + documentId: string; + queries?: string[]; + transactionId?: string; + } + | string, + ...rest: [string?, string?, string[]?, string?] ): Promise { - let params: { databaseId: string, collectionId: string, documentId: string, queries?: string[], transactionId?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, queries?: string[], transactionId?: string }; + let params: { + databaseId: string; + collectionId: string; + documentId: string; + queries?: string[]; + transactionId?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + collectionId: string; + documentId: string; + queries?: string[]; + transactionId?: string; + }; } else { params = { databaseId: paramsOrFirst as string, collectionId: rest[0] as string, documentId: rest[1] as string, queries: rest[2] as string[], - transactionId: rest[3] as string + transactionId: rest[3] as string, }; } @@ -560,18 +845,34 @@ export class Databases extends Service { const transactionId = params.transactionId; if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); } if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); + throw new AppwriteException( + 'Missing required parameter: "collectionId"', + ); } if (typeof documentId === 'undefined') { - throw new AppwriteException('Missing required parameter: "documentId"'); - } - - const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))).replace('{documentId}', encodeURIComponent(String(documentId))); + throw new AppwriteException( + 'Missing required parameter: "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') { @@ -583,10 +884,15 @@ export class Databases extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } /** @@ -602,7 +908,19 @@ export class Databases extends Service { * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.upsertRow` instead. */ - upsertDocument(params: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }): Promise; + upsertDocument< + Document extends Models.Document = Models.DefaultDocument, + >(params: { + databaseId: string; + collectionId: string; + documentId: string; + data?: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>; + permissions?: string[]; + transactionId?: string; + }): Promise; /** * Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. * @@ -616,23 +934,81 @@ export class Databases extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - upsertDocument(databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string): Promise; upsertDocument( - paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string } | string, - ...rest: [(string)?, (string)?, (Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>)?, (string[])?, (string)?] + databaseId: string, + collectionId: string, + documentId: string, + data?: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>, + permissions?: string[], + transactionId?: string, + ): Promise; + upsertDocument( + paramsOrFirst: + | { + databaseId: string; + collectionId: string; + documentId: string; + data?: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>; + permissions?: string[]; + transactionId?: string; + } + | string, + ...rest: [ + string?, + string?, + (Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>)?, + string[]?, + string?, + ] ): Promise { - let params: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }; + let params: { + databaseId: string; + collectionId: string; + documentId: string; + data?: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>; + permissions?: string[]; + transactionId?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + collectionId: string; + documentId: string; + data?: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>; + permissions?: string[]; + transactionId?: string; + }; } else { params = { databaseId: paramsOrFirst as string, collectionId: rest[0] as string, documentId: rest[1] as string, - data: rest[2] as Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, + data: rest[2] as Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>, permissions: rest[3] as string[], - transactionId: rest[4] as string + transactionId: rest[4] as string, }; } @@ -644,18 +1020,34 @@ export class Databases extends Service { const transactionId = params.transactionId; if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); } if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); + throw new AppwriteException( + 'Missing required parameter: "collectionId"', + ); } if (typeof documentId === 'undefined') { - throw new AppwriteException('Missing required parameter: "documentId"'); - } - - const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))).replace('{documentId}', encodeURIComponent(String(documentId))); + throw new AppwriteException( + 'Missing required parameter: "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') { @@ -671,11 +1063,16 @@ export class Databases extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('put', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'put', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -691,7 +1088,19 @@ export class Databases extends Service { * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateRow` instead. */ - updateDocument(params: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }): Promise; + updateDocument< + Document extends Models.Document = Models.DefaultDocument, + >(params: { + databaseId: string; + collectionId: string; + documentId: string; + data?: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>; + permissions?: string[]; + transactionId?: string; + }): Promise; /** * Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated. * @@ -705,23 +1114,81 @@ export class Databases extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateDocument(databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string): Promise; updateDocument( - paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string } | string, - ...rest: [(string)?, (string)?, (Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>)?, (string[])?, (string)?] + databaseId: string, + collectionId: string, + documentId: string, + data?: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>, + permissions?: string[], + transactionId?: string, + ): Promise; + updateDocument( + paramsOrFirst: + | { + databaseId: string; + collectionId: string; + documentId: string; + data?: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>; + permissions?: string[]; + transactionId?: string; + } + | string, + ...rest: [ + string?, + string?, + (Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>)?, + string[]?, + string?, + ] ): Promise { - let params: { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }; + let params: { + databaseId: string; + collectionId: string; + documentId: string; + data?: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>; + permissions?: string[]; + transactionId?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + collectionId: string; + documentId: string; + data?: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>; + permissions?: string[]; + transactionId?: string; + }; } else { params = { databaseId: paramsOrFirst as string, collectionId: rest[0] as string, documentId: rest[1] as string, - data: rest[2] as Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>, + data: rest[2] as Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>, permissions: rest[3] as string[], - transactionId: rest[4] as string + transactionId: rest[4] as string, }; } @@ -733,18 +1200,34 @@ export class Databases extends Service { const transactionId = params.transactionId; if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); } if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); + throw new AppwriteException( + 'Missing required parameter: "collectionId"', + ); } if (typeof documentId === 'undefined') { - throw new AppwriteException('Missing required parameter: "documentId"'); - } - - const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))).replace('{documentId}', encodeURIComponent(String(documentId))); + throw new AppwriteException( + 'Missing required parameter: "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') { @@ -760,11 +1243,16 @@ export class Databases extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('patch', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'patch', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -778,7 +1266,12 @@ export class Databases extends Service { * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.deleteRow` instead. */ - deleteDocument(params: { databaseId: string, collectionId: string, documentId: string, transactionId?: string }): Promise<{}>; + deleteDocument(params: { + databaseId: string; + collectionId: string; + documentId: string; + transactionId?: string; + }): Promise<{}>; /** * Delete a document by its unique ID. * @@ -790,21 +1283,47 @@ export class Databases extends Service { * @returns {Promise<{}>} * @deprecated Use the object parameter style method for a better developer experience. */ - deleteDocument(databaseId: string, collectionId: string, documentId: string, transactionId?: string): Promise<{}>; deleteDocument( - paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, transactionId?: string } | string, - ...rest: [(string)?, (string)?, (string)?] + databaseId: string, + collectionId: string, + documentId: string, + transactionId?: string, + ): Promise<{}>; + deleteDocument( + paramsOrFirst: + | { + databaseId: string; + collectionId: string; + documentId: string; + transactionId?: string; + } + | string, + ...rest: [string?, string?, string?] ): Promise<{}> { - let params: { databaseId: string, collectionId: string, documentId: string, transactionId?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, transactionId?: string }; + let params: { + databaseId: string; + collectionId: string; + documentId: string; + transactionId?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + collectionId: string; + documentId: string; + transactionId?: string; + }; } else { params = { databaseId: paramsOrFirst as string, collectionId: rest[0] as string, documentId: rest[1] as string, - transactionId: rest[2] as string + transactionId: rest[2] as string, }; } @@ -814,18 +1333,34 @@ export class Databases extends Service { const transactionId = params.transactionId; if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); } if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); + throw new AppwriteException( + 'Missing required parameter: "collectionId"', + ); } if (typeof documentId === 'undefined') { - throw new AppwriteException('Missing required parameter: "documentId"'); - } - - const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{collectionId}', encodeURIComponent(String(collectionId))).replace('{documentId}', encodeURIComponent(String(documentId))); + throw new AppwriteException( + 'Missing required parameter: "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') { @@ -833,10 +1368,15 @@ export class Databases extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('delete', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - }, payload); + return this.client.call( + 'delete', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + }, + payload, + ); } /** @@ -853,7 +1393,17 @@ export class Databases extends Service { * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.decrementRowColumn` instead. */ - decrementDocumentAttribute(params: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number, transactionId?: string }): Promise; + decrementDocumentAttribute< + Document extends Models.Document = Models.DefaultDocument, + >(params: { + databaseId: string; + collectionId: string; + documentId: string; + attribute: string; + value?: number; + min?: number; + transactionId?: string; + }): Promise; /** * Decrement a specific attribute of a document by a given value. * @@ -868,15 +1418,57 @@ export class Databases extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - decrementDocumentAttribute(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number, transactionId?: string): Promise; - decrementDocumentAttribute( - paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number, transactionId?: string } | string, - ...rest: [(string)?, (string)?, (string)?, (number)?, (number)?, (string)?] + decrementDocumentAttribute< + Document extends Models.Document = Models.DefaultDocument, + >( + databaseId: string, + collectionId: string, + documentId: string, + attribute: string, + value?: number, + min?: number, + transactionId?: string, + ): Promise; + decrementDocumentAttribute< + Document extends Models.Document = Models.DefaultDocument, + >( + paramsOrFirst: + | { + databaseId: string; + collectionId: string; + documentId: string; + attribute: string; + value?: number; + min?: number; + transactionId?: string; + } + | string, + ...rest: [string?, string?, string?, number?, number?, string?] ): Promise { - let params: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number, transactionId?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number, transactionId?: string }; + let params: { + databaseId: string; + collectionId: string; + documentId: string; + attribute: string; + value?: number; + min?: number; + transactionId?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + collectionId: string; + documentId: string; + attribute: string; + value?: number; + min?: number; + transactionId?: string; + }; } else { params = { databaseId: paramsOrFirst as string, @@ -885,7 +1477,7 @@ export class Databases extends Service { attribute: rest[2] as string, value: rest[3] as number, min: rest[4] as number, - transactionId: rest[5] as string + transactionId: rest[5] as string, }; } @@ -898,22 +1490,38 @@ export class Databases extends Service { const transactionId = params.transactionId; if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); } if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); + throw new AppwriteException( + 'Missing required parameter: "collectionId"', + ); } if (typeof documentId === 'undefined') { - throw new AppwriteException('Missing required parameter: "documentId"'); + throw new AppwriteException( + 'Missing required parameter: "documentId"', + ); } if (typeof attribute === 'undefined') { - throw new AppwriteException('Missing required parameter: "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))); + throw new AppwriteException( + 'Missing required parameter: "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') { @@ -929,11 +1537,16 @@ export class Databases extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('patch', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'patch', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -950,7 +1563,17 @@ export class Databases extends Service { * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.incrementRowColumn` instead. */ - incrementDocumentAttribute(params: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number, transactionId?: string }): Promise; + incrementDocumentAttribute< + Document extends Models.Document = Models.DefaultDocument, + >(params: { + databaseId: string; + collectionId: string; + documentId: string; + attribute: string; + value?: number; + max?: number; + transactionId?: string; + }): Promise; /** * Increment a specific attribute of a document by a given value. * @@ -965,15 +1588,57 @@ export class Databases extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - incrementDocumentAttribute(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number, transactionId?: string): Promise; - incrementDocumentAttribute( - paramsOrFirst: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number, transactionId?: string } | string, - ...rest: [(string)?, (string)?, (string)?, (number)?, (number)?, (string)?] + incrementDocumentAttribute< + Document extends Models.Document = Models.DefaultDocument, + >( + databaseId: string, + collectionId: string, + documentId: string, + attribute: string, + value?: number, + max?: number, + transactionId?: string, + ): Promise; + incrementDocumentAttribute< + Document extends Models.Document = Models.DefaultDocument, + >( + paramsOrFirst: + | { + databaseId: string; + collectionId: string; + documentId: string; + attribute: string; + value?: number; + max?: number; + transactionId?: string; + } + | string, + ...rest: [string?, string?, string?, number?, number?, string?] ): Promise { - let params: { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number, transactionId?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number, transactionId?: string }; + let params: { + databaseId: string; + collectionId: string; + documentId: string; + attribute: string; + value?: number; + max?: number; + transactionId?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + collectionId: string; + documentId: string; + attribute: string; + value?: number; + max?: number; + transactionId?: string; + }; } else { params = { databaseId: paramsOrFirst as string, @@ -982,7 +1647,7 @@ export class Databases extends Service { attribute: rest[2] as string, value: rest[3] as number, max: rest[4] as number, - transactionId: rest[5] as string + transactionId: rest[5] as string, }; } @@ -995,22 +1660,38 @@ export class Databases extends Service { const transactionId = params.transactionId; if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); } if (typeof collectionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "collectionId"'); + throw new AppwriteException( + 'Missing required parameter: "collectionId"', + ); } if (typeof documentId === 'undefined') { - throw new AppwriteException('Missing required parameter: "documentId"'); + throw new AppwriteException( + 'Missing required parameter: "documentId"', + ); } if (typeof attribute === 'undefined') { - throw new AppwriteException('Missing required parameter: "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))); + throw new AppwriteException( + 'Missing required parameter: "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') { @@ -1026,10 +1707,15 @@ export class Databases extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('patch', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'patch', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } -}; +} diff --git a/src/services/documents-db.ts b/src/services/documents-db.ts new file mode 100644 index 00000000..255d82ad --- /dev/null +++ b/src/services/documents-db.ts @@ -0,0 +1,1833 @@ +import { Service } from '../service'; +import { AppwriteException, Client } from '../client'; +import type { Models } from '../models'; +import type { Payload } from '../client'; + +export class DocumentsDB extends Service { + constructor(client: Client) { + super(client); + } + + /** + * List transactions across all 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} + */ + listTransactions(params?: { + queries?: string[]; + }): Promise; + /** + * List transactions across all databases. + * + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listTransactions(queries?: string[]): Promise; + listTransactions( + paramsOrFirst?: { queries?: string[] } | string[], + ): Promise { + let params: { queries?: string[] }; + + if ( + !paramsOrFirst || + (paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst)) + ) { + params = (paramsOrFirst || {}) as { queries?: string[] }; + } else { + params = { + queries: paramsOrFirst as string[], + }; + } + + const queries = params.queries; + + const apiPath = '/documentsdb/transactions'; + const payload: Payload = {}; + + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); + } + + /** + * Create a new transaction. + * + * @param {number} params.ttl - Seconds before the transaction expires. + * @throws {AppwriteException} + * @returns {Promise} + */ + createTransaction(params?: { ttl?: number }): Promise; + /** + * Create a new transaction. + * + * @param {number} ttl - Seconds before the transaction expires. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createTransaction(ttl?: number): Promise; + createTransaction( + paramsOrFirst?: { ttl?: number } | number, + ): Promise { + let params: { ttl?: number }; + + if ( + !paramsOrFirst || + (paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst)) + ) { + params = (paramsOrFirst || {}) as { ttl?: number }; + } else { + params = { + ttl: paramsOrFirst as number, + }; + } + + const ttl = params.ttl; + + const apiPath = '/documentsdb/transactions'; + const payload: Payload = {}; + + if (typeof ttl !== 'undefined') { + payload['ttl'] = ttl; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); + } + + /** + * Get a transaction by its unique ID. + * + * @param {string} params.transactionId - Transaction ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + getTransaction(params: { + transactionId: string; + }): Promise; + /** + * Get a transaction by its unique ID. + * + * @param {string} transactionId - Transaction ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getTransaction(transactionId: string): Promise; + getTransaction( + paramsOrFirst: { transactionId: string } | string, + ): Promise { + let params: { transactionId: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { transactionId: string }; + } else { + params = { + transactionId: paramsOrFirst as string, + }; + } + + const transactionId = params.transactionId; + + if (typeof transactionId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "transactionId"', + ); + } + + const apiPath = '/documentsdb/transactions/{transactionId}'.replace( + '{transactionId}', + encodeURIComponent(String(transactionId)), + ); + const payload: Payload = {}; + + const uri = new URL(this.client.config.endpoint + apiPath); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); + } + + /** + * Update a transaction, to either commit or roll back its operations. + * + * @param {string} params.transactionId - Transaction ID. + * @param {boolean} params.commit - Commit transaction? + * @param {boolean} params.rollback - Rollback transaction? + * @throws {AppwriteException} + * @returns {Promise} + */ + updateTransaction(params: { + transactionId: string; + commit?: boolean; + rollback?: boolean; + }): Promise; + /** + * Update a transaction, to either commit or roll back its operations. + * + * @param {string} transactionId - Transaction ID. + * @param {boolean} commit - Commit transaction? + * @param {boolean} rollback - Rollback transaction? + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateTransaction( + transactionId: string, + commit?: boolean, + rollback?: boolean, + ): Promise; + updateTransaction( + paramsOrFirst: + | { transactionId: string; commit?: boolean; rollback?: boolean } + | string, + ...rest: [boolean?, boolean?] + ): Promise { + let params: { + transactionId: string; + commit?: boolean; + rollback?: boolean; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + transactionId: string; + commit?: boolean; + rollback?: boolean; + }; + } else { + params = { + transactionId: paramsOrFirst as string, + commit: rest[0] as boolean, + rollback: rest[1] as boolean, + }; + } + + const transactionId = params.transactionId; + const commit = params.commit; + const rollback = params.rollback; + + if (typeof transactionId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "transactionId"', + ); + } + + const apiPath = '/documentsdb/transactions/{transactionId}'.replace( + '{transactionId}', + encodeURIComponent(String(transactionId)), + ); + const payload: Payload = {}; + + if (typeof commit !== 'undefined') { + payload['commit'] = commit; + } + + if (typeof rollback !== 'undefined') { + payload['rollback'] = rollback; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return this.client.call( + 'patch', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); + } + + /** + * Delete a transaction by its unique ID. + * + * @param {string} params.transactionId - Transaction ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + deleteTransaction(params: { transactionId: string }): Promise<{}>; + /** + * Delete a transaction by its unique ID. + * + * @param {string} transactionId - Transaction ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deleteTransaction(transactionId: string): Promise<{}>; + deleteTransaction( + paramsOrFirst: { transactionId: string } | string, + ): Promise<{}> { + let params: { transactionId: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { transactionId: string }; + } else { + params = { + transactionId: paramsOrFirst as string, + }; + } + + const transactionId = params.transactionId; + + if (typeof transactionId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "transactionId"', + ); + } + + const apiPath = '/documentsdb/transactions/{transactionId}'.replace( + '{transactionId}', + encodeURIComponent(String(transactionId)), + ); + const payload: Payload = {}; + + const uri = new URL(this.client.config.endpoint + apiPath); + return this.client.call( + 'delete', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + }, + payload, + ); + } + + /** + * Create multiple operations in a single transaction. + * + * @param {string} params.transactionId - Transaction ID. + * @param {object[]} params.operations - Array of staged operations. + * @throws {AppwriteException} + * @returns {Promise} + */ + createOperations(params: { + transactionId: string; + operations?: object[]; + }): Promise; + /** + * Create multiple operations in a single transaction. + * + * @param {string} transactionId - Transaction ID. + * @param {object[]} operations - Array of staged operations. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createOperations( + transactionId: string, + operations?: object[], + ): Promise; + createOperations( + paramsOrFirst: + { transactionId: string; operations?: object[] } | string, + ...rest: [object[]?] + ): Promise { + let params: { transactionId: string; operations?: object[] }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + transactionId: string; + operations?: object[]; + }; + } else { + params = { + transactionId: paramsOrFirst as string, + operations: rest[0] as object[], + }; + } + + const transactionId = params.transactionId; + const operations = params.operations; + + if (typeof transactionId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "transactionId"', + ); + } + + const apiPath = + '/documentsdb/transactions/{transactionId}/operations'.replace( + '{transactionId}', + encodeURIComponent(String(transactionId)), + ); + const payload: Payload = {}; + + if (typeof operations !== 'undefined') { + payload['operations'] = operations; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); + } + + /** + * Get a list of all the user's documents in a given collection. You can use the query params to filter your results. + * + * @param {string} params.databaseId - Database ID. + * @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.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction. + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. + * @param {number} params.ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). + * @throws {AppwriteException} + * @returns {Promise} + */ + listDocuments< + Document extends Models.Document = Models.DefaultDocument, + >(params: { + databaseId: string; + collectionId: string; + queries?: string[]; + transactionId?: string; + total?: boolean; + ttl?: number; + }): Promise>; + /** + * Get a list of all the user's documents in a given collection. You can use the query params to filter your results. + * + * @param {string} databaseId - Database ID. + * @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[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction. + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. + * @param {number} ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). + * @throws {AppwriteException} + * @returns {Promise>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listDocuments( + databaseId: string, + collectionId: string, + queries?: string[], + transactionId?: string, + total?: boolean, + ttl?: number, + ): Promise>; + listDocuments( + paramsOrFirst: + | { + databaseId: string; + collectionId: string; + queries?: string[]; + transactionId?: string; + total?: boolean; + ttl?: number; + } + | string, + ...rest: [string?, string[]?, string?, boolean?, number?] + ): Promise> { + let params: { + databaseId: string; + collectionId: string; + queries?: string[]; + transactionId?: string; + total?: boolean; + ttl?: number; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + collectionId: string; + queries?: string[]; + transactionId?: string; + total?: boolean; + ttl?: number; + }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + queries: rest[1] as string[], + transactionId: rest[2] as string, + total: rest[3] as boolean, + ttl: rest[4] as number, + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const queries = params.queries; + const transactionId = params.transactionId; + const total = params.total; + const ttl = params.ttl; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); + } + + if (typeof collectionId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "collectionId"', + ); + } + + const apiPath = + '/documentsdb/{databaseId}/collections/{collectionId}/documents' + .replace('{databaseId}', encodeURIComponent(String(databaseId))) + .replace( + '{collectionId}', + encodeURIComponent(String(collectionId)), + ); + const payload: Payload = {}; + + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + + if (typeof transactionId !== 'undefined') { + payload['transactionId'] = transactionId; + } + + if (typeof total !== 'undefined') { + payload['total'] = total; + } + + if (typeof ttl !== 'undefined') { + payload['ttl'] = ttl; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); + } + + /** + * Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. + * + * @param {string} params.databaseId - Database ID. + * @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). Make sure to define attributes before creating documents. + * @param {string} params.documentId - Document 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 {Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit} params.data - Document data as JSON object. + * @param {string[]} params.permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string} params.transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise} + */ + createDocument< + Document extends Models.Document = Models.DefaultDocument, + >(params: { + databaseId: string; + collectionId: string; + documentId: string; + data: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & Omit; + permissions?: string[]; + transactionId?: string; + }): Promise; + /** + * Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. + * @param {string} documentId - Document 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 {Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit} data - Document data as JSON object. + * @param {string[]} permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string} transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createDocument( + databaseId: string, + collectionId: string, + documentId: string, + data: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & Omit, + permissions?: string[], + transactionId?: string, + ): Promise; + createDocument( + paramsOrFirst: + | { + databaseId: string; + collectionId: string; + documentId: string; + data: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Omit; + permissions?: string[]; + transactionId?: string; + } + | string, + ...rest: [ + string?, + string?, + (Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Omit)?, + string[]?, + string?, + ] + ): Promise { + let params: { + databaseId: string; + collectionId: string; + documentId: string; + data: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Omit; + permissions?: string[]; + transactionId?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + collectionId: string; + documentId: string; + data: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Omit; + permissions?: string[]; + transactionId?: string; + }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + documentId: rest[1] as string, + data: rest[2] as Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Omit, + permissions: rest[3] as string[], + transactionId: rest[4] as string, + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const documentId = params.documentId; + const data = params.data; + const permissions = params.permissions; + const transactionId = params.transactionId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); + } + + if (typeof collectionId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "collectionId"', + ); + } + + if (typeof documentId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "documentId"', + ); + } + + if (typeof data === 'undefined') { + throw new AppwriteException('Missing required parameter: "data"'); + } + + const apiPath = + '/documentsdb/{databaseId}/collections/{collectionId}/documents' + .replace('{databaseId}', encodeURIComponent(String(databaseId))) + .replace( + '{collectionId}', + encodeURIComponent(String(collectionId)), + ); + const payload: Payload = {}; + + if (typeof documentId !== 'undefined') { + payload['documentId'] = documentId; + } + + if (typeof data !== 'undefined') { + payload['data'] = data; + } + + if (typeof permissions !== 'undefined') { + payload['permissions'] = permissions; + } + + if (typeof transactionId !== 'undefined') { + payload['transactionId'] = transactionId; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); + } + + /** + * Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. + * + * @param {string} params.databaseId - Database ID. + * @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). Make sure to define attributes before creating documents. + * @param {object[]} params.documents - Array of documents data as JSON objects. + * @param {string} params.transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise} + */ + createDocuments< + Document extends Models.Document = Models.DefaultDocument, + >(params: { + databaseId: string; + collectionId: string; + documents: object[]; + transactionId?: string; + }): Promise>; + /** + * Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. + * @param {object[]} documents - Array of documents data as JSON objects. + * @param {string} transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createDocuments( + databaseId: string, + collectionId: string, + documents: object[], + transactionId?: string, + ): Promise>; + createDocuments( + paramsOrFirst: + | { + databaseId: string; + collectionId: string; + documents: object[]; + transactionId?: string; + } + | string, + ...rest: [string?, object[]?, string?] + ): Promise> { + let params: { + databaseId: string; + collectionId: string; + documents: object[]; + transactionId?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + collectionId: string; + documents: object[]; + transactionId?: string; + }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + documents: rest[1] as object[], + transactionId: rest[2] as string, + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const documents = params.documents; + const transactionId = params.transactionId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); + } + + if (typeof collectionId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "collectionId"', + ); + } + + if (typeof documents === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "documents"', + ); + } + + const apiPath = + '/documentsdb/{databaseId}/collections/{collectionId}/documents' + .replace('{databaseId}', encodeURIComponent(String(databaseId))) + .replace( + '{collectionId}', + encodeURIComponent(String(collectionId)), + ); + const payload: Payload = {}; + + if (typeof documents !== 'undefined') { + payload['documents'] = documents; + } + + if (typeof transactionId !== 'undefined') { + payload['transactionId'] = transactionId; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); + } + + /** + * Get a document by its unique ID. This endpoint response returns a JSON object with the document data. + * + * @param {string} params.databaseId - Database ID. + * @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.documentId - Document 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 {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction. + * @throws {AppwriteException} + * @returns {Promise} + */ + getDocument< + Document extends Models.Document = Models.DefaultDocument, + >(params: { + databaseId: string; + collectionId: string; + documentId: string; + queries?: string[]; + transactionId?: string; + }): Promise; + /** + * Get a document by its unique ID. This endpoint response returns a JSON object with the document data. + * + * @param {string} databaseId - Database ID. + * @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} documentId - Document 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 {string} transactionId - Transaction ID to read uncommitted changes within the transaction. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getDocument( + databaseId: string, + collectionId: string, + documentId: string, + queries?: string[], + transactionId?: string, + ): Promise; + getDocument( + paramsOrFirst: + | { + databaseId: string; + collectionId: string; + documentId: string; + queries?: string[]; + transactionId?: string; + } + | string, + ...rest: [string?, string?, string[]?, string?] + ): Promise { + let params: { + databaseId: string; + collectionId: string; + documentId: string; + queries?: string[]; + transactionId?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + collectionId: string; + documentId: string; + queries?: string[]; + transactionId?: string; + }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + documentId: rest[1] as string, + queries: rest[2] as string[], + transactionId: rest[3] as string, + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const documentId = params.documentId; + const queries = params.queries; + const transactionId = params.transactionId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); + } + + if (typeof collectionId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "collectionId"', + ); + } + + if (typeof documentId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "documentId"', + ); + } + + const apiPath = + '/documentsdb/{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; + } + + if (typeof transactionId !== 'undefined') { + payload['transactionId'] = transactionId; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); + } + + /** + * Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. + * @param {string} params.documentId - Document ID. + * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>} params.data - Document data as JSON object. Include all required fields of the document to be created or updated. + * @param {string[]} params.permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string} params.transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise} + */ + upsertDocument< + Document extends Models.Document = Models.DefaultDocument, + >(params: { + databaseId: string; + collectionId: string; + documentId: string; + data?: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>; + permissions?: string[]; + transactionId?: string; + }): Promise; + /** + * Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. + * @param {string} documentId - Document ID. + * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>} data - Document data as JSON object. Include all required fields of the document to be created or updated. + * @param {string[]} permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string} transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + upsertDocument( + databaseId: string, + collectionId: string, + documentId: string, + data?: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>, + permissions?: string[], + transactionId?: string, + ): Promise; + upsertDocument( + paramsOrFirst: + | { + databaseId: string; + collectionId: string; + documentId: string; + data?: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>; + permissions?: string[]; + transactionId?: string; + } + | string, + ...rest: [ + string?, + string?, + (Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>)?, + string[]?, + string?, + ] + ): Promise { + let params: { + databaseId: string; + collectionId: string; + documentId: string; + data?: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>; + permissions?: string[]; + transactionId?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + collectionId: string; + documentId: string; + data?: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>; + permissions?: string[]; + transactionId?: string; + }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + documentId: rest[1] as string, + data: rest[2] as Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>, + permissions: rest[3] as string[], + transactionId: rest[4] as string, + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const documentId = params.documentId; + const data = params.data; + const permissions = params.permissions; + const transactionId = params.transactionId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); + } + + if (typeof collectionId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "collectionId"', + ); + } + + if (typeof documentId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "documentId"', + ); + } + + const apiPath = + '/documentsdb/{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; + } + + if (typeof permissions !== 'undefined') { + payload['permissions'] = permissions; + } + + if (typeof transactionId !== 'undefined') { + payload['transactionId'] = transactionId; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return this.client.call( + 'put', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); + } + + /** + * Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. + * @param {string} params.documentId - Document ID. + * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>} params.data - Document data as JSON object. Include only fields and value pairs to be updated. + * @param {string[]} params.permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string} params.transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateDocument< + Document extends Models.Document = Models.DefaultDocument, + >(params: { + databaseId: string; + collectionId: string; + documentId: string; + data?: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>; + permissions?: string[]; + transactionId?: string; + }): Promise; + /** + * Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated. + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. + * @param {string} documentId - Document ID. + * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>} data - Document data as JSON object. Include only fields and value pairs to be updated. + * @param {string[]} permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string} transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateDocument( + databaseId: string, + collectionId: string, + documentId: string, + data?: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>, + permissions?: string[], + transactionId?: string, + ): Promise; + updateDocument( + paramsOrFirst: + | { + databaseId: string; + collectionId: string; + documentId: string; + data?: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>; + permissions?: string[]; + transactionId?: string; + } + | string, + ...rest: [ + string?, + string?, + (Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>)?, + string[]?, + string?, + ] + ): Promise { + let params: { + databaseId: string; + collectionId: string; + documentId: string; + data?: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>; + permissions?: string[]; + transactionId?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + collectionId: string; + documentId: string; + data?: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>; + permissions?: string[]; + transactionId?: string; + }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + documentId: rest[1] as string, + data: rest[2] as Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>, + permissions: rest[3] as string[], + transactionId: rest[4] as string, + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const documentId = params.documentId; + const data = params.data; + const permissions = params.permissions; + const transactionId = params.transactionId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); + } + + if (typeof collectionId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "collectionId"', + ); + } + + if (typeof documentId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "documentId"', + ); + } + + const apiPath = + '/documentsdb/{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; + } + + if (typeof permissions !== 'undefined') { + payload['permissions'] = permissions; + } + + if (typeof transactionId !== 'undefined') { + payload['transactionId'] = transactionId; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return this.client.call( + 'patch', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); + } + + /** + * Delete a document by its unique ID. + * + * @param {string} params.databaseId - Database ID. + * @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.documentId - Document ID. + * @param {string} params.transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise} + */ + deleteDocument(params: { + databaseId: string; + collectionId: string; + documentId: string; + transactionId?: string; + }): Promise<{}>; + /** + * Delete a document by its unique ID. + * + * @param {string} databaseId - Database ID. + * @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} documentId - Document ID. + * @param {string} transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deleteDocument( + databaseId: string, + collectionId: string, + documentId: string, + transactionId?: string, + ): Promise<{}>; + deleteDocument( + paramsOrFirst: + | { + databaseId: string; + collectionId: string; + documentId: string; + transactionId?: string; + } + | string, + ...rest: [string?, string?, string?] + ): Promise<{}> { + let params: { + databaseId: string; + collectionId: string; + documentId: string; + transactionId?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + collectionId: string; + documentId: string; + transactionId?: string; + }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + documentId: rest[1] as string, + transactionId: rest[2] as string, + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const documentId = params.documentId; + const transactionId = params.transactionId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); + } + + if (typeof collectionId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "collectionId"', + ); + } + + if (typeof documentId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "documentId"', + ); + } + + const apiPath = + '/documentsdb/{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; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return this.client.call( + 'delete', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + }, + payload, + ); + } + + /** + * Decrement a specific column of a row by a given value. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. + * @param {string} params.documentId - Document ID. + * @param {string} params.attribute - Attribute key. + * @param {number} params.value - Value to decrement the attribute by. The value must be a number. + * @param {number} params.min - Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown. + * @param {string} params.transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise} + */ + decrementDocumentAttribute< + Document extends Models.Document = Models.DefaultDocument, + >(params: { + databaseId: string; + collectionId: string; + documentId: string; + attribute: string; + value?: number; + min?: number; + transactionId?: string; + }): Promise; + /** + * Decrement a specific column of a row by a given value. + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. + * @param {string} documentId - Document ID. + * @param {string} attribute - Attribute key. + * @param {number} value - Value to decrement the attribute by. The value must be a number. + * @param {number} min - Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown. + * @param {string} transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + decrementDocumentAttribute< + Document extends Models.Document = Models.DefaultDocument, + >( + databaseId: string, + collectionId: string, + documentId: string, + attribute: string, + value?: number, + min?: number, + transactionId?: string, + ): Promise; + decrementDocumentAttribute< + Document extends Models.Document = Models.DefaultDocument, + >( + paramsOrFirst: + | { + databaseId: string; + collectionId: string; + documentId: string; + attribute: string; + value?: number; + min?: number; + transactionId?: string; + } + | string, + ...rest: [string?, string?, string?, number?, number?, string?] + ): Promise { + let params: { + databaseId: string; + collectionId: string; + documentId: string; + attribute: string; + value?: number; + min?: number; + transactionId?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + collectionId: string; + documentId: string; + attribute: string; + value?: number; + min?: number; + transactionId?: string; + }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + documentId: rest[1] as string, + attribute: rest[2] as string, + value: rest[3] as number, + min: rest[4] as number, + transactionId: rest[5] as string, + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const documentId = params.documentId; + const attribute = params.attribute; + const value = params.value; + const min = params.min; + const transactionId = params.transactionId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); + } + + if (typeof collectionId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "collectionId"', + ); + } + + if (typeof documentId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "documentId"', + ); + } + + if (typeof attribute === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "attribute"', + ); + } + + const apiPath = + '/documentsdb/{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; + } + + if (typeof min !== 'undefined') { + payload['min'] = min; + } + + if (typeof transactionId !== 'undefined') { + payload['transactionId'] = transactionId; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return this.client.call( + 'patch', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); + } + + /** + * Increment a specific column of a row by a given value. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. + * @param {string} params.documentId - Document ID. + * @param {string} params.attribute - Attribute key. + * @param {number} params.value - Value to increment the attribute by. The value must be a number. + * @param {number} params.max - Maximum value for the attribute. If the current value is greater than this value, an error will be thrown. + * @param {string} params.transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise} + */ + incrementDocumentAttribute< + Document extends Models.Document = Models.DefaultDocument, + >(params: { + databaseId: string; + collectionId: string; + documentId: string; + attribute: string; + value?: number; + max?: number; + transactionId?: string; + }): Promise; + /** + * Increment a specific column of a row by a given value. + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. + * @param {string} documentId - Document ID. + * @param {string} attribute - Attribute key. + * @param {number} value - Value to increment the attribute by. The value must be a number. + * @param {number} max - Maximum value for the attribute. If the current value is greater than this value, an error will be thrown. + * @param {string} transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + incrementDocumentAttribute< + Document extends Models.Document = Models.DefaultDocument, + >( + databaseId: string, + collectionId: string, + documentId: string, + attribute: string, + value?: number, + max?: number, + transactionId?: string, + ): Promise; + incrementDocumentAttribute< + Document extends Models.Document = Models.DefaultDocument, + >( + paramsOrFirst: + | { + databaseId: string; + collectionId: string; + documentId: string; + attribute: string; + value?: number; + max?: number; + transactionId?: string; + } + | string, + ...rest: [string?, string?, string?, number?, number?, string?] + ): Promise { + let params: { + databaseId: string; + collectionId: string; + documentId: string; + attribute: string; + value?: number; + max?: number; + transactionId?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + collectionId: string; + documentId: string; + attribute: string; + value?: number; + max?: number; + transactionId?: string; + }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + documentId: rest[1] as string, + attribute: rest[2] as string, + value: rest[3] as number, + max: rest[4] as number, + transactionId: rest[5] as string, + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const documentId = params.documentId; + const attribute = params.attribute; + const value = params.value; + const max = params.max; + const transactionId = params.transactionId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); + } + + if (typeof collectionId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "collectionId"', + ); + } + + if (typeof documentId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "documentId"', + ); + } + + if (typeof attribute === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "attribute"', + ); + } + + const apiPath = + '/documentsdb/{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; + } + + if (typeof max !== 'undefined') { + payload['max'] = max; + } + + if (typeof transactionId !== 'undefined') { + payload['transactionId'] = transactionId; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return this.client.call( + 'patch', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); + } +} diff --git a/src/services/functions.ts b/src/services/functions.ts index c76cd108..53d9cf98 100644 --- a/src/services/functions.ts +++ b/src/services/functions.ts @@ -1,18 +1,13 @@ import { Service } from '../service'; import { AppwriteException, Client } from '../client'; import type { Models } from '../models'; -import type { UploadProgress, Payload } from '../client'; -import * as FileSystem from 'expo-file-system'; -import { Platform as RNPlatform } from 'react-native'; +import type { Payload } from '../client'; import { ExecutionMethod } from '../enums/execution-method'; - export class Functions extends Service { - - constructor(client: Client) - { + constructor(client: Client) { super(client); - } + } /** * Get a list of all the current user function execution logs. You can use the query params to filter your results. @@ -23,7 +18,11 @@ export class Functions extends Service { * @throws {AppwriteException} * @returns {Promise} */ - listExecutions(params: { functionId: string, queries?: string[], total?: boolean }): Promise; + listExecutions(params: { + functionId: string; + queries?: string[]; + total?: boolean; + }): Promise; /** * Get a list of all the current user function execution logs. You can use the query params to filter your results. * @@ -34,20 +33,34 @@ export class Functions extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - listExecutions(functionId: string, queries?: string[], total?: boolean): Promise; listExecutions( - paramsOrFirst: { functionId: string, queries?: string[], total?: boolean } | string, - ...rest: [(string[])?, (boolean)?] + functionId: string, + queries?: string[], + total?: boolean, + ): Promise; + listExecutions( + paramsOrFirst: + | { functionId: string; queries?: string[]; total?: boolean } + | string, + ...rest: [string[]?, boolean?] ): Promise { - let params: { functionId: string, queries?: string[], total?: boolean }; + let params: { functionId: string; queries?: string[]; total?: boolean }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { functionId: string, queries?: string[], total?: boolean }; + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + functionId: string; + queries?: string[]; + total?: boolean; + }; } else { params = { functionId: paramsOrFirst as string, queries: rest[0] as string[], - total: rest[1] as boolean + total: rest[1] as boolean, }; } @@ -56,10 +69,15 @@ export class Functions extends Service { const total = params.total; if (typeof functionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "functionId"'); + throw new AppwriteException( + 'Missing required parameter: "functionId"', + ); } - const apiPath = '/functions/{functionId}/executions'.replace('{functionId}', encodeURIComponent(String(functionId))); + const apiPath = '/functions/{functionId}/executions'.replace( + '{functionId}', + encodeURIComponent(String(functionId)), + ); const payload: Payload = {}; if (typeof queries !== 'undefined') { @@ -71,10 +89,15 @@ export class Functions extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } /** @@ -90,7 +113,15 @@ export class Functions extends Service { * @throws {AppwriteException} * @returns {Promise} */ - createExecution(params: { functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string }): Promise; + createExecution(params: { + functionId: string; + body?: string; + async?: boolean; + xpath?: string; + method?: ExecutionMethod; + headers?: object; + scheduledAt?: string; + }): Promise; /** * Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously. * @@ -105,15 +136,60 @@ export class Functions extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createExecution(functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string): Promise; createExecution( - paramsOrFirst: { functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string } | string, - ...rest: [(string)?, (boolean)?, (string)?, (ExecutionMethod)?, (object)?, (string)?] + functionId: string, + body?: string, + async?: boolean, + xpath?: string, + method?: ExecutionMethod, + headers?: object, + scheduledAt?: string, + ): Promise; + createExecution( + paramsOrFirst: + | { + functionId: string; + body?: string; + async?: boolean; + xpath?: string; + method?: ExecutionMethod; + headers?: object; + scheduledAt?: string; + } + | string, + ...rest: [ + string?, + boolean?, + string?, + ExecutionMethod?, + object?, + string?, + ] ): Promise { - let params: { functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string }; + let params: { + functionId: string; + body?: string; + async?: boolean; + xpath?: string; + method?: ExecutionMethod; + headers?: object; + scheduledAt?: string; + }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string }; + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + functionId: string; + body?: string; + async?: boolean; + xpath?: string; + method?: ExecutionMethod; + headers?: object; + scheduledAt?: string; + }; } else { params = { functionId: paramsOrFirst as string, @@ -122,7 +198,7 @@ export class Functions extends Service { xpath: rest[2] as string, method: rest[3] as ExecutionMethod, headers: rest[4] as object, - scheduledAt: rest[5] as string + scheduledAt: rest[5] as string, }; } @@ -135,10 +211,15 @@ export class Functions extends Service { const scheduledAt = params.scheduledAt; if (typeof functionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "functionId"'); + throw new AppwriteException( + 'Missing required parameter: "functionId"', + ); } - const apiPath = '/functions/{functionId}/executions'.replace('{functionId}', encodeURIComponent(String(functionId))); + const apiPath = '/functions/{functionId}/executions'.replace( + '{functionId}', + encodeURIComponent(String(functionId)), + ); const payload: Payload = {}; if (typeof body !== 'undefined') { @@ -166,11 +247,16 @@ export class Functions extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('post', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -181,7 +267,10 @@ export class Functions extends Service { * @throws {AppwriteException} * @returns {Promise} */ - getExecution(params: { functionId: string, executionId: string }): Promise; + getExecution(params: { + functionId: string; + executionId: string; + }): Promise; /** * Get a function execution log by its unique ID. * @@ -191,19 +280,29 @@ export class Functions extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getExecution(functionId: string, executionId: string): Promise; getExecution( - paramsOrFirst: { functionId: string, executionId: string } | string, - ...rest: [(string)?] + functionId: string, + executionId: string, + ): Promise; + getExecution( + paramsOrFirst: { functionId: string; executionId: string } | string, + ...rest: [string?] ): Promise { - let params: { functionId: string, executionId: string }; + let params: { functionId: string; executionId: string }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { functionId: string, executionId: string }; + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + functionId: string; + executionId: string; + }; } else { params = { functionId: paramsOrFirst as string, - executionId: rest[0] as string + executionId: rest[0] as string, }; } @@ -211,20 +310,31 @@ export class Functions extends Service { const executionId = params.executionId; if (typeof functionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "functionId"'); + throw new AppwriteException( + 'Missing required parameter: "functionId"', + ); } if (typeof executionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "executionId"'); + throw new AppwriteException( + 'Missing required parameter: "executionId"', + ); } - const apiPath = '/functions/{functionId}/executions/{executionId}'.replace('{functionId}', encodeURIComponent(String(functionId))).replace('{executionId}', encodeURIComponent(String(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); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } -}; +} diff --git a/src/services/graphql.ts b/src/services/graphql.ts index 3b384e7b..b08fe7ce 100644 --- a/src/services/graphql.ts +++ b/src/services/graphql.ts @@ -1,17 +1,11 @@ import { Service } from '../service'; import { AppwriteException, Client } from '../client'; -import type { Models } from '../models'; -import type { UploadProgress, Payload } from '../client'; -import * as FileSystem from 'expo-file-system'; -import { Platform as RNPlatform } from 'react-native'; - +import type { Payload } from '../client'; export class Graphql extends Service { - - constructor(client: Client) - { + constructor(client: Client) { super(client); - } + } /** * Execute a GraphQL mutation. @@ -20,7 +14,7 @@ export class Graphql extends Service { * @throws {AppwriteException} * @returns {Promise} */ - query(params: { query: object }): Promise<{}>; + query(params: { query: object }): Promise<{}>; /** * Execute a GraphQL mutation. * @@ -30,16 +24,19 @@ export class Graphql extends Service { * @deprecated Use the object parameter style method for a better developer experience. */ query(query: object): Promise<{}>; - query( - paramsOrFirst: { query: object } | object - ): Promise<{}> { + query(paramsOrFirst: { query: object } | object): Promise<{}> { let params: { query: object }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('query' in paramsOrFirst))) { + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) && + 'query' in paramsOrFirst + ) { params = (paramsOrFirst || {}) as { query: object }; } else { params = { - query: paramsOrFirst as object + query: paramsOrFirst as object, }; } @@ -57,12 +54,17 @@ export class Graphql extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('post', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'x-sdk-graphql': 'true', - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'x-sdk-graphql': 'true', + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -72,7 +74,7 @@ export class Graphql extends Service { * @throws {AppwriteException} * @returns {Promise} */ - mutation(params: { query: object }): Promise<{}>; + mutation(params: { query: object }): Promise<{}>; /** * Execute a GraphQL mutation. * @@ -82,16 +84,19 @@ export class Graphql extends Service { * @deprecated Use the object parameter style method for a better developer experience. */ mutation(query: object): Promise<{}>; - mutation( - paramsOrFirst: { query: object } | object - ): Promise<{}> { + mutation(paramsOrFirst: { query: object } | object): Promise<{}> { let params: { query: object }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('query' in paramsOrFirst))) { + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) && + 'query' in paramsOrFirst + ) { params = (paramsOrFirst || {}) as { query: object }; } else { params = { - query: paramsOrFirst as object + query: paramsOrFirst as object, }; } @@ -109,11 +114,16 @@ export class Graphql extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('post', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'x-sdk-graphql': 'true', - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'x-sdk-graphql': 'true', + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } -}; +} diff --git a/src/services/locale.ts b/src/services/locale.ts index 5c1a6e87..6259730a 100644 --- a/src/services/locale.ts +++ b/src/services/locale.ts @@ -1,21 +1,16 @@ import { Service } from '../service'; -import { AppwriteException, Client } from '../client'; +import { Client } from '../client'; import type { Models } from '../models'; -import type { UploadProgress, Payload } from '../client'; -import * as FileSystem from 'expo-file-system'; -import { Platform as RNPlatform } from 'react-native'; - +import type { Payload } from '../client'; export class Locale extends Service { - - constructor(client: Client) - { + constructor(client: Client) { super(client); - } + } /** * Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language. - * + * * ([IP Geolocation by DB-IP](https://db-ip.com)) * * @throws {AppwriteException} @@ -26,10 +21,15 @@ export class Locale extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } /** @@ -43,10 +43,15 @@ export class Locale extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } /** @@ -60,10 +65,15 @@ export class Locale extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } /** @@ -77,10 +87,15 @@ export class Locale extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } /** @@ -94,10 +109,15 @@ export class Locale extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } /** @@ -111,10 +131,15 @@ export class Locale extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } /** @@ -128,10 +153,15 @@ export class Locale extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } /** @@ -145,9 +175,14 @@ export class Locale extends Service { const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } -}; +} diff --git a/src/services/messaging.ts b/src/services/messaging.ts index 4bedb187..e840cf51 100644 --- a/src/services/messaging.ts +++ b/src/services/messaging.ts @@ -1,17 +1,12 @@ import { Service } from '../service'; import { AppwriteException, Client } from '../client'; import type { Models } from '../models'; -import type { UploadProgress, Payload } from '../client'; -import * as FileSystem from 'expo-file-system'; -import { Platform as RNPlatform } from 'react-native'; - +import type { Payload } from '../client'; export class Messaging extends Service { - - constructor(client: Client) - { + constructor(client: Client) { super(client); - } + } /** * Create a new subscriber. @@ -22,7 +17,11 @@ export class Messaging extends Service { * @throws {AppwriteException} * @returns {Promise} */ - createSubscriber(params: { topicId: string, subscriberId: string, targetId: string }): Promise; + createSubscriber(params: { + topicId: string; + subscriberId: string; + targetId: string; + }): Promise; /** * Create a new subscriber. * @@ -33,20 +32,34 @@ export class Messaging extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createSubscriber(topicId: string, subscriberId: string, targetId: string): Promise; createSubscriber( - paramsOrFirst: { topicId: string, subscriberId: string, targetId: string } | string, - ...rest: [(string)?, (string)?] + topicId: string, + subscriberId: string, + targetId: string, + ): Promise; + createSubscriber( + paramsOrFirst: + | { topicId: string; subscriberId: string; targetId: string } + | string, + ...rest: [string?, string?] ): Promise { - let params: { topicId: string, subscriberId: string, targetId: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { topicId: string, subscriberId: string, targetId: string }; + let params: { topicId: string; subscriberId: string; targetId: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + topicId: string; + subscriberId: string; + targetId: string; + }; } else { params = { topicId: paramsOrFirst as string, subscriberId: rest[0] as string, - targetId: rest[1] as string + targetId: rest[1] as string, }; } @@ -55,18 +68,27 @@ export class Messaging extends Service { const targetId = params.targetId; if (typeof topicId === 'undefined') { - throw new AppwriteException('Missing required parameter: "topicId"'); + throw new AppwriteException( + 'Missing required parameter: "topicId"', + ); } if (typeof subscriberId === 'undefined') { - throw new AppwriteException('Missing required parameter: "subscriberId"'); + throw new AppwriteException( + 'Missing required parameter: "subscriberId"', + ); } if (typeof targetId === 'undefined') { - throw new AppwriteException('Missing required parameter: "targetId"'); + throw new AppwriteException( + 'Missing required parameter: "targetId"', + ); } - const apiPath = '/messaging/topics/{topicId}/subscribers'.replace('{topicId}', encodeURIComponent(String(topicId))); + const apiPath = '/messaging/topics/{topicId}/subscribers'.replace( + '{topicId}', + encodeURIComponent(String(topicId)), + ); const payload: Payload = {}; if (typeof subscriberId !== 'undefined') { @@ -78,11 +100,16 @@ export class Messaging extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('post', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -93,7 +120,10 @@ export class Messaging extends Service { * @throws {AppwriteException} * @returns {Promise} */ - deleteSubscriber(params: { topicId: string, subscriberId: string }): Promise<{}>; + deleteSubscriber(params: { + topicId: string; + subscriberId: string; + }): Promise<{}>; /** * Delete a subscriber by its unique ID. * @@ -105,17 +135,24 @@ export class Messaging extends Service { */ deleteSubscriber(topicId: string, subscriberId: string): Promise<{}>; deleteSubscriber( - paramsOrFirst: { topicId: string, subscriberId: string } | string, - ...rest: [(string)?] + paramsOrFirst: { topicId: string; subscriberId: string } | string, + ...rest: [string?] ): Promise<{}> { - let params: { topicId: string, subscriberId: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { topicId: string, subscriberId: string }; + let params: { topicId: string; subscriberId: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + topicId: string; + subscriberId: string; + }; } else { params = { topicId: paramsOrFirst as string, - subscriberId: rest[0] as string + subscriberId: rest[0] as string, }; } @@ -123,20 +160,34 @@ export class Messaging extends Service { const subscriberId = params.subscriberId; if (typeof topicId === 'undefined') { - throw new AppwriteException('Missing required parameter: "topicId"'); + throw new AppwriteException( + 'Missing required parameter: "topicId"', + ); } if (typeof subscriberId === 'undefined') { - throw new AppwriteException('Missing required parameter: "subscriberId"'); + throw new AppwriteException( + 'Missing required parameter: "subscriberId"', + ); } - const apiPath = '/messaging/topics/{topicId}/subscribers/{subscriberId}'.replace('{topicId}', encodeURIComponent(String(topicId))).replace('{subscriberId}', encodeURIComponent(String(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); - return this.client.call('delete', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - }, payload); + return this.client.call( + 'delete', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + }, + payload, + ); } -}; +} diff --git a/src/services/organization.ts b/src/services/organization.ts new file mode 100644 index 00000000..eba03e0d --- /dev/null +++ b/src/services/organization.ts @@ -0,0 +1,366 @@ +import { Service } from '../service'; +import { AppwriteException, Client } from '../client'; +import type { Models } from '../models'; +import type { Payload } from '../client'; + +export class Organization extends Service { + constructor(client: Client) { + super(client); + } + + /** + * 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); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + 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); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + 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); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + 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); + return this.client.call( + 'put', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + 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); + return this.client.call( + 'delete', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); + } +} diff --git a/src/services/presences.ts b/src/services/presences.ts index 4db4a549..a14b6843 100644 --- a/src/services/presences.ts +++ b/src/services/presences.ts @@ -1,21 +1,16 @@ import { Service } from '../service'; import { AppwriteException, Client } from '../client'; import type { Models } from '../models'; -import type { UploadProgress, Payload } from '../client'; -import * as FileSystem from 'expo-file-system'; -import { Platform as RNPlatform } from 'react-native'; - +import type { Payload } from '../client'; export class Presences extends Service { - - constructor(client: Client) - { + constructor(client: Client) { super(client); - } + } /** * List presence logs. Expired entries are filtered out automatically. - * + * * * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. @@ -23,10 +18,14 @@ export class Presences extends Service { * @throws {AppwriteException} * @returns {Promise} */ - list(params?: { queries?: string[], total?: boolean, ttl?: number }): Promise; + list(params?: { + queries?: string[]; + total?: boolean; + ttl?: number; + }): Promise; /** * List presence logs. Expired entries are filtered out automatically. - * + * * * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. @@ -35,20 +34,34 @@ export class Presences extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - list(queries?: string[], total?: boolean, ttl?: number): Promise; list( - paramsOrFirst?: { queries?: string[], total?: boolean, ttl?: number } | string[], - ...rest: [(boolean)?, (number)?] + queries?: string[], + total?: boolean, + ttl?: number, + ): Promise; + list( + paramsOrFirst?: + { queries?: string[]; total?: boolean; ttl?: number } | string[], + ...rest: [boolean?, number?] ): Promise { - let params: { queries?: string[], total?: boolean, ttl?: number }; - - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { queries?: string[], total?: boolean, ttl?: number }; + let params: { queries?: string[]; total?: boolean; ttl?: number }; + + if ( + !paramsOrFirst || + (paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst)) + ) { + params = (paramsOrFirst || {}) as { + queries?: string[]; + total?: boolean; + ttl?: number; + }; } else { params = { queries: paramsOrFirst as string[], total: rest[0] as boolean, - ttl: rest[1] as number + ttl: rest[1] as number, }; } @@ -72,24 +85,29 @@ export class Presences extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } /** * Get a presence log by its unique ID. Entries whose `expiresAt` is in the past are treated as not found. - * + * * * @param {string} params.presenceId - Presence unique ID. * @throws {AppwriteException} * @returns {Promise} */ - get(params: { presenceId: string }): Promise; + get(params: { presenceId: string }): Promise; /** * Get a presence log by its unique ID. Entries whose `expiresAt` is in the past are treated as not found. - * + * * * @param {string} presenceId - Presence unique ID. * @throws {AppwriteException} @@ -98,37 +116,51 @@ export class Presences extends Service { */ get(presenceId: string): Promise; get( - paramsOrFirst: { presenceId: string } | string + paramsOrFirst: { presenceId: string } | string, ): Promise { let params: { presenceId: string }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { params = (paramsOrFirst || {}) as { presenceId: string }; } else { params = { - presenceId: paramsOrFirst as string + presenceId: paramsOrFirst as string, }; } const presenceId = params.presenceId; if (typeof presenceId === 'undefined') { - throw new AppwriteException('Missing required parameter: "presenceId"'); + throw new AppwriteException( + 'Missing required parameter: "presenceId"', + ); } - const apiPath = '/presences/{presenceId}'.replace('{presenceId}', encodeURIComponent(String(presenceId))); + const apiPath = '/presences/{presenceId}'.replace( + '{presenceId}', + encodeURIComponent(String(presenceId)), + ); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } /** * Create or update a presence log by its user ID. - * + * * * @param {string} params.presenceId - Presence unique ID. * @param {string} params.status - Presence status. @@ -138,10 +170,16 @@ export class Presences extends Service { * @throws {AppwriteException} * @returns {Promise} */ - upsert(params: { presenceId: string, status: string, permissions?: string[], expiresAt?: string, metadata?: object }): Promise; + upsert(params: { + presenceId: string; + status: string; + permissions?: string[]; + expiresAt?: string; + metadata?: object; + }): Promise; /** * Create or update a presence log by its user ID. - * + * * * @param {string} presenceId - Presence unique ID. * @param {string} status - Presence status. @@ -152,22 +190,52 @@ export class Presences extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - upsert(presenceId: string, status: string, permissions?: string[], expiresAt?: string, metadata?: object): Promise; upsert( - paramsOrFirst: { presenceId: string, status: string, permissions?: string[], expiresAt?: string, metadata?: object } | string, - ...rest: [(string)?, (string[])?, (string)?, (object)?] + presenceId: string, + status: string, + permissions?: string[], + expiresAt?: string, + metadata?: object, + ): Promise; + upsert( + paramsOrFirst: + | { + presenceId: string; + status: string; + permissions?: string[]; + expiresAt?: string; + metadata?: object; + } + | string, + ...rest: [string?, string[]?, string?, object?] ): Promise { - let params: { presenceId: string, status: string, permissions?: string[], expiresAt?: string, metadata?: object }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { presenceId: string, status: string, permissions?: string[], expiresAt?: string, metadata?: object }; + let params: { + presenceId: string; + status: string; + permissions?: string[]; + expiresAt?: string; + metadata?: object; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + presenceId: string; + status: string; + permissions?: string[]; + expiresAt?: string; + metadata?: object; + }; } else { params = { presenceId: paramsOrFirst as string, status: rest[0] as string, permissions: rest[1] as string[], expiresAt: rest[2] as string, - metadata: rest[3] as object + metadata: rest[3] as object, }; } @@ -178,14 +246,19 @@ export class Presences extends Service { const metadata = params.metadata; if (typeof presenceId === 'undefined') { - throw new AppwriteException('Missing required parameter: "presenceId"'); + throw new AppwriteException( + 'Missing required parameter: "presenceId"', + ); } if (typeof status === 'undefined') { throw new AppwriteException('Missing required parameter: "status"'); } - const apiPath = '/presences/{presenceId}'.replace('{presenceId}', encodeURIComponent(String(presenceId))); + const apiPath = '/presences/{presenceId}'.replace( + '{presenceId}', + encodeURIComponent(String(presenceId)), + ); const payload: Payload = {}; if (typeof status !== 'undefined') { @@ -205,16 +278,21 @@ export class Presences extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('put', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'put', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** * Update a presence log by its unique ID. Using the patch method you can pass only specific fields that will get updated. - * + * * * @param {string} params.presenceId - Presence unique ID. * @param {string} params.status - Presence status. @@ -225,10 +303,17 @@ export class Presences extends Service { * @throws {AppwriteException} * @returns {Promise} */ - update(params: { presenceId: string, status?: string, expiresAt?: string, metadata?: object, permissions?: string[], purge?: boolean }): Promise; + update(params: { + presenceId: string; + status?: string; + expiresAt?: string; + metadata?: object; + permissions?: string[]; + purge?: boolean; + }): Promise; /** * Update a presence log by its unique ID. Using the patch method you can pass only specific fields that will get updated. - * + * * * @param {string} presenceId - Presence unique ID. * @param {string} status - Presence status. @@ -240,15 +325,49 @@ export class Presences extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - update(presenceId: string, status?: string, expiresAt?: string, metadata?: object, permissions?: string[], purge?: boolean): Promise; update( - paramsOrFirst: { presenceId: string, status?: string, expiresAt?: string, metadata?: object, permissions?: string[], purge?: boolean } | string, - ...rest: [(string)?, (string)?, (object)?, (string[])?, (boolean)?] + presenceId: string, + status?: string, + expiresAt?: string, + metadata?: object, + permissions?: string[], + purge?: boolean, + ): Promise; + update( + paramsOrFirst: + | { + presenceId: string; + status?: string; + expiresAt?: string; + metadata?: object; + permissions?: string[]; + purge?: boolean; + } + | string, + ...rest: [string?, string?, object?, string[]?, boolean?] ): Promise { - let params: { presenceId: string, status?: string, expiresAt?: string, metadata?: object, permissions?: string[], purge?: boolean }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { presenceId: string, status?: string, expiresAt?: string, metadata?: object, permissions?: string[], purge?: boolean }; + let params: { + presenceId: string; + status?: string; + expiresAt?: string; + metadata?: object; + permissions?: string[]; + purge?: boolean; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + presenceId: string; + status?: string; + expiresAt?: string; + metadata?: object; + permissions?: string[]; + purge?: boolean; + }; } else { params = { presenceId: paramsOrFirst as string, @@ -256,7 +375,7 @@ export class Presences extends Service { expiresAt: rest[1] as string, metadata: rest[2] as object, permissions: rest[3] as string[], - purge: rest[4] as boolean + purge: rest[4] as boolean, }; } @@ -268,10 +387,15 @@ export class Presences extends Service { const purge = params.purge; if (typeof presenceId === 'undefined') { - throw new AppwriteException('Missing required parameter: "presenceId"'); + throw new AppwriteException( + 'Missing required parameter: "presenceId"', + ); } - const apiPath = '/presences/{presenceId}'.replace('{presenceId}', encodeURIComponent(String(presenceId))); + const apiPath = '/presences/{presenceId}'.replace( + '{presenceId}', + encodeURIComponent(String(presenceId)), + ); const payload: Payload = {}; if (typeof status !== 'undefined') { @@ -295,25 +419,30 @@ export class Presences extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('patch', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'patch', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** * Delete a presence log by its unique ID. - * + * * * @param {string} params.presenceId - Presence unique ID. * @throws {AppwriteException} * @returns {Promise} */ - delete(params: { presenceId: string }): Promise<{}>; + delete(params: { presenceId: string }): Promise<{}>; /** * Delete a presence log by its unique ID. - * + * * * @param {string} presenceId - Presence unique ID. * @throws {AppwriteException} @@ -321,32 +450,44 @@ export class Presences extends Service { * @deprecated Use the object parameter style method for a better developer experience. */ delete(presenceId: string): Promise<{}>; - delete( - paramsOrFirst: { presenceId: string } | string - ): Promise<{}> { + delete(paramsOrFirst: { presenceId: string } | string): Promise<{}> { let params: { presenceId: string }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { params = (paramsOrFirst || {}) as { presenceId: string }; } else { params = { - presenceId: paramsOrFirst as string + presenceId: paramsOrFirst as string, }; } const presenceId = params.presenceId; if (typeof presenceId === 'undefined') { - throw new AppwriteException('Missing required parameter: "presenceId"'); + throw new AppwriteException( + 'Missing required parameter: "presenceId"', + ); } - const apiPath = '/presences/{presenceId}'.replace('{presenceId}', encodeURIComponent(String(presenceId))); + const apiPath = '/presences/{presenceId}'.replace( + '{presenceId}', + encodeURIComponent(String(presenceId)), + ); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('delete', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - }, payload); + return this.client.call( + 'delete', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + }, + payload, + ); } -}; +} diff --git a/src/services/realtime.ts b/src/services/realtime.ts index 35a8b867..77820844 100644 --- a/src/services/realtime.ts +++ b/src/services/realtime.ts @@ -3,11 +3,10 @@ import { Channel, ActionableChannel, ResolvedChannel } from '../channel'; import { Query } from '../query'; import { ID } from '../id'; import { Platform } from 'react-native'; - export type RealtimeSubscriptionUpdate = { channels?: (string | Channel | ActionableChannel | ResolvedChannel)[]; queries?: (string | Query)[]; -} +}; export type RealtimeSubscription = { /** @@ -26,18 +25,18 @@ export type RealtimeSubscription = { * Prefer `unsubscribe()` for per-subscription teardown and `Realtime.disconnect()` for full shutdown. */ close: () => Promise; -} +}; export type RealtimeCallback = { channels: Set; queries: string[]; // Array of query strings callback: (event: RealtimeResponseEvent) => void; -} +}; export type RealtimeResponse = { type: string; data?: any; -} +}; export type RealtimeResponseEvent = { events: string[]; @@ -45,17 +44,17 @@ export type RealtimeResponseEvent = { timestamp: string; payload: T; subscriptions: string[]; // Backend-provided subscription IDs -} +}; export type RealtimeResponseConnected = { channels: string[]; user?: object; -} +}; export type RealtimeRequest = { type: 'authentication' | 'subscribe' | 'unsubscribe' | 'presence'; data: any; -} +}; export type RealtimePresence = { $id: string; @@ -68,25 +67,25 @@ export type RealtimePresence = { status?: string; source: string; metadata?: Record; -} +}; export type RealtimePresenceCreate = { status: string; presenceId: string; permissions?: string[]; metadata?: Record; -} +}; type RealtimeRequestSubscribeRow = { subscriptionId?: string; channels: string[]; queries: string[]; -} +}; export enum RealtimeCode { NORMAL_CLOSURE = 1000, POLICY_VIOLATION = 1008, - UNKNOWN_ERROR = -1 + UNKNOWN_ERROR = -1, } export class Realtime { @@ -114,7 +113,9 @@ export class Realtime { private connectionId = 0; private reconnect = true; - private onErrorCallbacks: Array<(error?: Error, statusCode?: number) => void> = []; + private onErrorCallbacks: Array< + (error?: Error, statusCode?: number) => void + > = []; private onCloseCallbacks: Array<() => void> = []; private onOpenCallbacks: Array<() => void> = []; @@ -128,7 +129,9 @@ export class Realtime { * @param {Function} callback - Callback function to handle errors * @returns {void} */ - public onError(callback: (error?: Error, statusCode?: number) => void): void { + public onError( + callback: (error?: Error, statusCode?: number) => void, + ): void { this.onErrorCallbacks.push(callback); } @@ -206,10 +209,9 @@ export class Realtime { } // URL carries only the project; channels/queries are sent via the subscribe message. - let queryParams = `project=${projectId}`; + const queryParams = `project=${projectId}`; const jwt = this.client.config.jwt; - const endpoint = this.client.config.endpointRealtime !== '' ? this.client.config.endpointRealtime @@ -241,21 +243,25 @@ export class Realtime { try { const connectionId = ++this.connectionId; const WebSocketCtor: any = WebSocket; - const socket = (this.socket = Platform.OS === 'web' - ? new WebSocketCtor(jwt ? `${url}&jwt=${encodeURIComponent(jwt)}` : url) - : new WebSocketCtor(url, undefined, { - headers: { - Origin: `appwrite-${Platform.OS}://${this.client.config.platform}`, - ...(jwt ? { 'x-appwrite-jwt': jwt } : {}) - } - })); - + const socket = (this.socket = + Platform.OS === 'web' + ? new WebSocketCtor( + jwt + ? `${url}&jwt=${encodeURIComponent(jwt)}` + : url, + ) + : new WebSocketCtor(url, undefined, { + headers: { + Origin: `appwrite-${Platform.OS}://${this.client.config.platform}`, + ...(jwt ? { 'x-appwrite-jwt': jwt } : {}), + }, + })); socket.addEventListener('open', () => { if (connectionId !== this.connectionId) { return; } this.reconnectAttempts = 0; - this.onOpenCallbacks.forEach(callback => callback()); + this.onOpenCallbacks.forEach((callback) => callback()); this.startHeartbeat(); resolve(); }); @@ -265,7 +271,9 @@ export class Realtime { return; } try { - const message = JSONbig.parse(event.data) as RealtimeResponse; + const message = JSONbig.parse( + event.data, + ) as RealtimeResponse; this.handleMessage(message); } catch (error) { console.error('Failed to parse message:', error); @@ -273,20 +281,28 @@ export class Realtime { }); socket.addEventListener('close', async (event: CloseEvent) => { - if (connectionId !== this.connectionId || socket !== this.socket) { + if ( + connectionId !== this.connectionId || + socket !== this.socket + ) { return; } this.appConnected = false; this.stopHeartbeat(); - this.onCloseCallbacks.forEach(callback => callback()); + this.onCloseCallbacks.forEach((callback) => callback()); - if (!this.reconnect || event.code === RealtimeCode.POLICY_VIOLATION) { + if ( + !this.reconnect || + event.code === RealtimeCode.POLICY_VIOLATION + ) { this.reconnect = true; return; } const timeout = this.getTimeout(); - console.log(`Realtime disconnected. Re-connecting in ${timeout / 1000} seconds.`); + console.log( + `Realtime disconnected. Re-connecting in ${timeout / 1000} seconds.`, + ); await this.sleep(timeout); this.reconnectAttempts++; @@ -298,14 +314,19 @@ export class Realtime { } }); - socket.addEventListener('error', (event: Event) => { - if (connectionId !== this.connectionId || socket !== this.socket) { + socket.addEventListener('error', (_event: Event) => { + if ( + connectionId !== this.connectionId || + socket !== this.socket + ) { return; } this.stopHeartbeat(); const error = new Error('WebSocket error'); console.error('WebSocket error:', error.message); - this.onErrorCallbacks.forEach(callback => callback(error)); + this.onErrorCallbacks.forEach((callback) => + callback(error), + ); reject(error); }); } catch (error) { @@ -324,11 +345,17 @@ export class Realtime { return; } - if (this.socket.readyState === WebSocket.OPEN || - this.socket.readyState === WebSocket.CONNECTING) { - this.socket.addEventListener('close', () => { - resolve(); - }, { once: true }); + if ( + this.socket.readyState === WebSocket.OPEN || + this.socket.readyState === WebSocket.CONNECTING + ) { + this.socket.addEventListener( + 'close', + () => { + resolve(); + }, + { once: true }, + ); this.socket.close(RealtimeCode.NORMAL_CLOSURE); } else { resolve(); @@ -350,21 +377,25 @@ export class Realtime { } private sleep(ms: number): Promise { - return new Promise(resolve => setTimeout(resolve, ms)); + return new Promise((resolve) => setTimeout(resolve, ms)); } private sendUnsubscribeMessage(subscriptionIds: string[]): void { - const ids = subscriptionIds.filter(id => typeof id === 'string' && id.length > 0); + const ids = subscriptionIds.filter( + (id) => typeof id === 'string' && id.length > 0, + ); if (ids.length === 0) { return; } if (!this.socket || this.socket.readyState !== WebSocket.OPEN) { return; } - this.socket.send(JSONbig.stringify({ - type: 'unsubscribe', - data: ids.map(subscriptionId => ({ subscriptionId })) - })); + this.socket.send( + JSONbig.stringify({ + type: 'unsubscribe', + data: ids.map((subscriptionId) => ({ subscriptionId })), + }), + ); } private generateUniqueSubscriptionId(): string { @@ -375,7 +406,9 @@ export class Realtime { return id; } } - throw new AppwriteException('Failed to generate unique subscription id'); + throw new AppwriteException( + 'Failed to generate unique subscription id', + ); } private enqueuePendingSubscribe(subscriptionId: string): void { @@ -386,7 +419,7 @@ export class Realtime { this.pendingSubscribes.set(subscriptionId, { subscriptionId, channels: Array.from(subscription.channels), - queries: subscription.queries ?? [] + queries: subscription.queries ?? [], }); } @@ -437,10 +470,12 @@ export class Realtime { const rows = Array.from(this.pendingSubscribes.values()); this.pendingSubscribes.clear(); - this.socket.send(JSONbig.stringify({ - type: 'subscribe', - data: rows - })); + this.socket.send( + JSONbig.stringify({ + type: 'subscribe', + data: rows, + }), + ); } /** @@ -450,12 +485,17 @@ export class Realtime { * @param {string | Channel | ActionableChannel | ResolvedChannel} channel - Channel value (string or Channel builder instance) * @returns {string} Channel string representation */ - private channelToString(channel: string | Channel | ActionableChannel | ResolvedChannel): string { + private channelToString( + channel: string | Channel | ActionableChannel | ResolvedChannel, + ): string { if (typeof channel === 'string') { return channel; } // All Channel instances have toString() method - if (channel && typeof (channel as Channel).toString === 'function') { + if ( + channel && + typeof (channel as Channel).toString === 'function' + ) { return (channel as Channel).toString(); } return String(channel); @@ -471,7 +511,7 @@ export class Realtime { public async subscribe( channel: string | Channel | ActionableChannel | ResolvedChannel, callback: (event: RealtimeResponseEvent) => void, - queries?: (string | Query)[] + queries?: (string | Query)[], ): Promise; /** @@ -482,9 +522,11 @@ export class Realtime { * @returns {Promise} Subscription object with close method */ public async subscribe( - channels: (string | Channel | ActionableChannel | ResolvedChannel)[], + channels: ( + string | Channel | ActionableChannel | ResolvedChannel + )[], callback: (event: RealtimeResponseEvent) => void, - queries?: (string | Query)[] + queries?: (string | Query)[], ): Promise; /** @@ -497,7 +539,7 @@ export class Realtime { public async subscribe( channel: string | Channel | ActionableChannel | ResolvedChannel, callback: (event: RealtimeResponseEvent) => void, - queries?: (string | Query)[] + queries?: (string | Query)[], ): Promise; /** @@ -508,32 +550,43 @@ export class Realtime { * @returns {Promise} Subscription object with close method */ public async subscribe( - channels: (string | Channel | ActionableChannel | ResolvedChannel)[], + channels: ( + string | Channel | ActionableChannel | ResolvedChannel + )[], callback: (event: RealtimeResponseEvent) => void, - queries?: (string | Query)[] + queries?: (string | Query)[], ): Promise; public async subscribe( - channelsOrChannel: string | Channel | ActionableChannel | ResolvedChannel | (string | Channel | ActionableChannel | ResolvedChannel)[], + channelsOrChannel: + | string + | Channel + | ActionableChannel + | ResolvedChannel + | (string | Channel | ActionableChannel | ResolvedChannel)[], callback: (event: RealtimeResponseEvent) => void, - queries: (string | Query)[] = [] + queries: (string | Query)[] = [], ): Promise { const channelArray = Array.isArray(channelsOrChannel) ? channelsOrChannel : [channelsOrChannel]; - + // Convert all channels to strings - const channelStrings = channelArray.map(ch => this.channelToString(ch)); + const channelStrings = channelArray.map((ch) => + this.channelToString(ch), + ); const channels = new Set(channelStrings); // Convert queries to array of strings // Ensure each query is a separate string in the array const queryStrings: string[] = []; - for (const q of (queries ?? [])) { + for (const q of queries ?? []) { if (Array.isArray(q)) { // Handle nested arrays: [[q1, q2]] -> [q1, q2] for (const inner of q) { - queryStrings.push(typeof inner === 'string' ? inner : inner.toString()); + queryStrings.push( + typeof inner === 'string' ? inner : inner.toString(), + ); } } else { queryStrings.push(typeof q === 'string' ? q : q.toString()); @@ -545,7 +598,7 @@ export class Realtime { this.activeSubscriptions.set(subscriptionId, { channels, queries: queryStrings, - callback + callback, }); this.enqueuePendingSubscribe(subscriptionId); @@ -573,14 +626,18 @@ export class Realtime { this.sendUnsubscribeMessage([subscriptionId]); }; - const update = async (changes: RealtimeSubscriptionUpdate): Promise => { + const update = async ( + changes: RealtimeSubscriptionUpdate, + ): Promise => { const subscription = this.activeSubscriptions.get(subscriptionId); if (!subscription) { return; } if (changes.channels !== undefined) { - const nextChannelStrings = changes.channels.map(ch => this.channelToString(ch)); + const nextChannelStrings = changes.channels.map((ch) => + this.channelToString(ch), + ); subscription.channels = new Set(nextChannelStrings); } @@ -589,10 +646,16 @@ export class Realtime { for (const q of changes.queries) { if (Array.isArray(q)) { for (const inner of q) { - nextQueries.push(typeof inner === 'string' ? inner : (inner as Query).toString()); + nextQueries.push( + typeof inner === 'string' + ? inner + : (inner as Query).toString(), + ); } } else { - nextQueries.push(typeof q === 'string' ? q : q.toString()); + nextQueries.push( + typeof q === 'string' ? q : q.toString(), + ); } } subscription.queries = nextQueries; @@ -605,7 +668,10 @@ export class Realtime { await this.sleep(this.DEBOUNCE_MS); if (this.subCallDepth === 1) { - if (!this.socket || this.socket.readyState > WebSocket.OPEN) { + if ( + !this.socket || + this.socket.readyState > WebSocket.OPEN + ) { await this.createSocket(); } else if (this.socket.readyState === WebSocket.OPEN) { this.sendPendingSubscribes(); @@ -661,7 +727,10 @@ export class Realtime { // payload is stored. if (!this.socket || this.socket.readyState >= WebSocket.CLOSING) { this.createSocket().catch((error) => { - console.error('Failed to open realtime socket for presence:', error); + console.error( + 'Failed to open realtime socket for presence:', + error, + ); }); } @@ -681,10 +750,12 @@ export class Realtime { if (!this.appConnected) { return; } - this.socket.send(JSONbig.stringify({ - type: 'presence', - data: this.pendingPresence - })); + this.socket.send( + JSONbig.stringify({ + type: 'presence', + data: this.pendingPresence, + }), + ); } private handleMessage(message: RealtimeResponse): void { @@ -718,7 +789,9 @@ export class Realtime { let session = this.client.config.session; if (!session) { try { - const cookie = JSONbig.parse(window.localStorage.getItem('cookieFallback') ?? '{}'); + const cookie = JSONbig.parse( + window.localStorage.getItem('cookieFallback') ?? '{}', + ); session = cookie?.[`a_session_${this.client.config.project}`]; } catch (error) { console.error('Failed to parse cookie fallback:', error); @@ -726,12 +799,14 @@ export class Realtime { } if (session && !messageData.user) { - this.socket?.send(JSONbig.stringify({ - type: 'authentication', - data: { - session - } - })); + this.socket?.send( + JSONbig.stringify({ + type: 'authentication', + data: { + session, + }, + }), + ); } for (const subscriptionId of this.activeSubscriptions.keys()) { @@ -744,10 +819,12 @@ export class Realtime { private handleResponseError(message: RealtimeResponse): void { const error = new AppwriteException( - message.data?.message || 'Unknown error' + message.data?.message || 'Unknown error', ); const statusCode = message.data?.code; - this.onErrorCallbacks.forEach(callback => callback(error, statusCode)); + this.onErrorCallbacks.forEach((callback) => + callback(error, statusCode), + ); } private handleResponseEvent(message: RealtimeResponse): void { @@ -762,7 +839,13 @@ export class Realtime { const timestamp = data.timestamp as string; const subscriptions = data.subscriptions as string[] | undefined; - if (!channels || !events || !payload || !subscriptions || subscriptions.length === 0) { + if ( + !channels || + !events || + !payload || + !subscriptions || + subscriptions.length === 0 + ) { return; } @@ -776,7 +859,7 @@ export class Realtime { channels, timestamp, payload, - subscriptions + subscriptions, }); } } diff --git a/src/services/storage.ts b/src/services/storage.ts index 19c9d387..5ff4c5b6 100644 --- a/src/services/storage.ts +++ b/src/services/storage.ts @@ -7,51 +7,79 @@ import { Platform as RNPlatform } from 'react-native'; import { ImageGravity } from '../enums/image-gravity'; import { ImageFormat } from '../enums/image-format'; - export class Storage extends Service { - - constructor(client: Client) - { + constructor(client: Client) { super(client); - } + } /** * Get a list of all the user files. You can use the query params to filter your results. * * @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). - * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, folder, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded * @param {string} params.search - Search term to filter your list results. Max length: 256 chars. * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise} */ - listFiles(params: { bucketId: string, queries?: string[], search?: string, total?: boolean }): Promise; + listFiles(params: { + bucketId: string; + queries?: string[]; + search?: string; + total?: boolean; + }): Promise; /** * Get a list of all the user files. You can use the query params to filter your results. * * @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). - * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, folder, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded * @param {string} search - Search term to filter your list results. Max length: 256 chars. * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - listFiles(bucketId: string, queries?: string[], search?: string, total?: boolean): Promise; listFiles( - paramsOrFirst: { bucketId: string, queries?: string[], search?: string, total?: boolean } | string, - ...rest: [(string[])?, (string)?, (boolean)?] + bucketId: string, + queries?: string[], + search?: string, + total?: boolean, + ): Promise; + listFiles( + paramsOrFirst: + | { + bucketId: string; + queries?: string[]; + search?: string; + total?: boolean; + } + | string, + ...rest: [string[]?, string?, boolean?] ): Promise { - let params: { bucketId: string, queries?: string[], search?: string, total?: boolean }; + let params: { + bucketId: string; + queries?: string[]; + search?: string; + total?: boolean; + }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { bucketId: string, queries?: string[], search?: string, total?: boolean }; + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + bucketId: string; + queries?: string[]; + search?: string; + total?: boolean; + }; } else { params = { bucketId: paramsOrFirst as string, queries: rest[0] as string[], search: rest[1] as string, - total: rest[2] as boolean + total: rest[2] as boolean, }; } @@ -61,10 +89,15 @@ export class Storage extends Service { const total = params.total; if (typeof bucketId === 'undefined') { - throw new AppwriteException('Missing required parameter: "bucketId"'); + throw new AppwriteException( + 'Missing required parameter: "bucketId"', + ); } - const apiPath = '/storage/buckets/{bucketId}/files'.replace('{bucketId}', encodeURIComponent(String(bucketId))); + const apiPath = '/storage/buckets/{bucketId}/files'.replace( + '{bucketId}', + encodeURIComponent(String(bucketId)), + ); const payload: Payload = {}; if (typeof queries !== 'undefined') { @@ -80,76 +113,144 @@ export class Storage extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } /** * Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https://appwrite.io/docs/server/storage#storageCreateBucket) API or directly from your Appwrite console. - * + * * Larger files should be uploaded using multiple requests with the [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes. - * + * * When the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one. - * + * * If you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally. - * + * * * @param {string} params.bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). * @param {string} params.fileId - File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param {{name: string, type: string, size: number, uri: string}} params.file - Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https://appwrite.io/docs/products/storage/upload-download#input-file). + * @param {{ name: string; type: string; size: number; uri: string }} params.file - Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https://appwrite.io/docs/products/storage/upload-download#input-file). * @param {string[]} params.permissions - An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string} params.folder - Virtual folder to place the file in, for example "photos/2026". Nest folders with `/`. Defaults to the bucket root. * @throws {AppwriteException} * @returns {Promise} */ - async createFile(params: { bucketId: string, fileId: string, file: {name: string, type: string, size: number, uri: string}, permissions?: string[] , onProgress?: (progress: UploadProgress) => void }): Promise; + async createFile(params: { + bucketId: string; + fileId: string; + file: { name: string; type: string; size: number; uri: string }; + permissions?: string[]; + folder?: string; + onProgress?: (progress: UploadProgress) => void; + }): Promise; /** * Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https://appwrite.io/docs/server/storage#storageCreateBucket) API or directly from your Appwrite console. - * + * * Larger files should be uploaded using multiple requests with the [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes. - * + * * When the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one. - * + * * If you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally. - * + * * * @param {string} bucketId - Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). * @param {string} fileId - File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param {{name: string, type: string, size: number, uri: string}} file - Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https://appwrite.io/docs/products/storage/upload-download#input-file). + * @param {{ name: string; type: string; size: number; uri: string }} file - Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https://appwrite.io/docs/products/storage/upload-download#input-file). * @param {string[]} permissions - An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string} folder - Virtual folder to place the file in, for example "photos/2026". Nest folders with `/`. Defaults to the bucket root. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - async createFile(bucketId: string, fileId: string, file: {name: string, type: string, size: number, uri: string}, permissions?: string[], onProgress?: (progress: UploadProgress) => void): Promise; async createFile( - paramsOrFirst: { bucketId: string, fileId: string, file: {name: string, type: string, size: number, uri: string}, permissions?: string[], onProgress?: (progress: UploadProgress) => void } | string, - ...rest: [(string)?, ({name: string, type: string, size: number, uri: string})?, (string[])?,((progress: UploadProgress) => void)?] + bucketId: string, + fileId: string, + file: { name: string; type: string; size: number; uri: string }, + permissions?: string[], + folder?: string, + onProgress?: (progress: UploadProgress) => void, + ): Promise; + async createFile( + paramsOrFirst: + | { + bucketId: string; + fileId: string; + file: { + name: string; + type: string; + size: number; + uri: string; + }; + permissions?: string[]; + folder?: string; + onProgress?: (progress: UploadProgress) => void; + } + | string, + ...rest: [ + string?, + { name: string; type: string; size: number; uri: string }?, + string[]?, + string?, + ((progress: UploadProgress) => void)?, + ] ): Promise { - let params: { bucketId: string, fileId: string, file: {name: string, type: string, size: number, uri: string}, permissions?: string[] }; - let onProgress: ((progress: UploadProgress) => void); - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { bucketId: string, fileId: string, file: {name: string, type: string, size: number, uri: string}, permissions?: string[] }; - onProgress = paramsOrFirst?.onProgress as ((progress: UploadProgress) => void); + let params: { + bucketId: string; + fileId: string; + file: { name: string; type: string; size: number; uri: string }; + permissions?: string[]; + folder?: string; + }; + let onProgress: (progress: UploadProgress) => void; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + bucketId: string; + fileId: string; + file: { name: string; type: string; size: number; uri: string }; + permissions?: string[]; + folder?: string; + }; + onProgress = paramsOrFirst?.onProgress as ( + progress: UploadProgress, + ) => void; } else { params = { bucketId: paramsOrFirst as string, fileId: rest[0] as string, - file: rest[1] as {name: string, type: string, size: number, uri: string}, - permissions: rest[2] as string[] + file: rest[1] as { + name: string; + type: string; + size: number; + uri: string; + }, + permissions: rest[2] as string[], + folder: rest[3] as string, }; - onProgress = rest[3] as ((progress: UploadProgress) => void); + onProgress = rest[4] as (progress: UploadProgress) => void; } const bucketId = params.bucketId; const fileId = params.fileId; const file = params.file; const permissions = params.permissions; + const folder = params.folder; if (typeof bucketId === 'undefined') { - throw new AppwriteException('Missing required parameter: "bucketId"'); + throw new AppwriteException( + 'Missing required parameter: "bucketId"', + ); } if (typeof fileId === 'undefined') { @@ -160,7 +261,10 @@ export class Storage extends Service { throw new AppwriteException('Missing required parameter: "file"'); } - const apiPath = '/storage/buckets/{bucketId}/files'.replace('{bucketId}', encodeURIComponent(String(bucketId))); + const apiPath = '/storage/buckets/{bucketId}/files'.replace( + '{bucketId}', + encodeURIComponent(String(bucketId)), + ); const payload: Payload = {}; if (typeof fileId !== 'undefined') { @@ -175,30 +279,52 @@ export class Storage extends Service { payload['permissions'] = permissions; } + if (typeof folder !== 'undefined') { + payload['folder'] = folder; + } + const uri = new URL(this.client.config.endpoint + apiPath); const size = file.size; if (size <= Service.CHUNK_SIZE) { - return this.client.call('post', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'multipart/form-data', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'multipart/form-data', + accept: 'application/json', + }, + payload, + ); } const apiHeaders: { [header: string]: string } = { 'X-Appwrite-Project': this.client.config.project, 'content-type': 'multipart/form-data', - 'accept': 'application/json', - } + accept: 'application/json', + }; let offset = 0; let response = undefined; - try { - response = await this.client.call('GET', new URL(this.client.config.endpoint + apiPath + '/' + fileId), apiHeaders); - offset = response.chunksUploaded * Service.CHUNK_SIZE; - } catch(e) { + const providedUploadId = fileId; + if (providedUploadId) { + try { + response = await this.client.call( + 'GET', + new URL( + this.client.config.endpoint + + apiPath + + '/' + + providedUploadId, + ), + apiHeaders, + ); + offset = response.chunksUploaded * Service.CHUNK_SIZE; + } catch (_e) { + // A missing upload simply means we start from the first chunk. + } } const totalChunks = Math.ceil(size / Service.CHUNK_SIZE); @@ -206,22 +332,39 @@ export class Storage extends Service { // Upload first chunk alone to get the upload ID if (offset === 0) { const firstChunkEnd = Math.min(Service.CHUNK_SIZE, size); - const firstChunkHeaders = { ...apiHeaders, 'content-range': 'bytes 0-' + (firstChunkEnd - 1) + '/' + size }; + const firstChunkHeaders = { + ...apiHeaders, + 'content-range': 'bytes 0-' + (firstChunkEnd - 1) + '/' + size, + }; - let firstChunk = await FileSystem.readAsStringAsync(file.uri, { + const firstChunk = await FileSystem.readAsStringAsync(file.uri, { encoding: FileSystem.EncodingType.Base64, position: 0, - length: Service.CHUNK_SIZE + length: Service.CHUNK_SIZE, }); - var firstPath = `data:${file.type};base64,${firstChunk}`; + let firstPath = `data:${file.type};base64,${firstChunk}`; if (RNPlatform.OS.toLowerCase() === 'android') { - firstPath = FileSystem.cacheDirectory + '/tmp_chunk_' + new Date().getTime(); - await FileSystem.writeAsStringAsync(firstPath, firstChunk, {encoding: FileSystem.EncodingType.Base64}); + firstPath = + FileSystem.cacheDirectory + + '/tmp_chunk_' + + new Date().getTime(); + await FileSystem.writeAsStringAsync(firstPath, firstChunk, { + encoding: FileSystem.EncodingType.Base64, + }); } - payload['file'] = { uri: firstPath, name: file.name, type: file.type }; + payload['file'] = { + uri: firstPath, + name: file.name, + type: file.type, + }; - response = await this.client.call('post', uri, firstChunkHeaders, payload); + response = await this.client.call( + 'post', + uri, + firstChunkHeaders, + payload, + ); offset = firstChunkEnd; if (onProgress) { @@ -230,7 +373,7 @@ export class Storage extends Service { progress: (offset / size) * 100, sizeUploaded: offset, chunksTotal: totalChunks, - chunksUploaded: 1 + chunksUploaded: 1, }); } } @@ -258,39 +401,60 @@ export class Storage extends Service { const isUploadComplete = (chunkResponse: any) => { const chunksUploaded = chunkResponse?.chunksUploaded; const chunksTotal = chunkResponse?.chunksTotal ?? totalChunks; - return typeof chunksUploaded === 'number' && typeof chunksTotal === 'number' && chunksUploaded >= chunksTotal; + return ( + typeof chunksUploaded === 'number' && + typeof chunksTotal === 'number' && + chunksUploaded >= chunksTotal + ); }; - const uploadChunk = async (chunk: typeof chunks[0]) => { + const uploadChunk = async (chunk: (typeof chunks)[0]) => { const chunkHeaders = { ...apiHeaders }; if (uploadId) { chunkHeaders['x-appwrite-id'] = uploadId; } - chunkHeaders['content-range'] = 'bytes ' + chunk.start + '-' + (chunk.end - 1) + '/' + size; + chunkHeaders['content-range'] = + 'bytes ' + chunk.start + '-' + (chunk.end - 1) + '/' + size; const chunkData = await FileSystem.readAsStringAsync(file.uri, { encoding: FileSystem.EncodingType.Base64, position: chunk.start, - length: chunk.end - chunk.start + length: chunk.end - chunk.start, }); let chunkPath = `data:${file.type};base64,${chunkData}`; if (RNPlatform.OS.toLowerCase() === 'android') { - chunkPath = FileSystem.cacheDirectory + '/tmp_chunk_' + new Date().getTime() + '_' + chunk.index; - await FileSystem.writeAsStringAsync(chunkPath, chunkData, {encoding: FileSystem.EncodingType.Base64}); + chunkPath = + FileSystem.cacheDirectory + + '/tmp_chunk_' + + new Date().getTime() + + '_' + + chunk.index; + await FileSystem.writeAsStringAsync(chunkPath, chunkData, { + encoding: FileSystem.EncodingType.Base64, + }); } const chunkPayload = { ...payload }; - chunkPayload['file'] = { uri: chunkPath, name: file.name, type: file.type }; + chunkPayload['file'] = { + uri: chunkPath, + name: file.name, + type: file.type, + }; - const chunkResponse = await this.client.call('post', uri, chunkHeaders, chunkPayload); + const chunkResponse = await this.client.call( + 'post', + uri, + chunkHeaders, + chunkPayload, + ); if (failed) { return chunkResponse; } completedCount++; - uploadedBytes += (chunk.end - chunk.start); + uploadedBytes += chunk.end - chunk.start; response = chunkResponse; if (isUploadComplete(chunkResponse)) { @@ -303,7 +467,7 @@ export class Storage extends Service { progress: (uploadedBytes / size) * 100, sizeUploaded: uploadedBytes, chunksTotal: totalChunks, - chunksUploaded: completedCount + chunksUploaded: completedCount, }); } @@ -327,7 +491,7 @@ export class Storage extends Service { throw error; } } - })() + })(), ); } @@ -344,7 +508,7 @@ export class Storage extends Service { * @throws {AppwriteException} * @returns {Promise} */ - getFile(params: { bucketId: string, fileId: string }): Promise; + getFile(params: { bucketId: string; fileId: string }): Promise; /** * Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata. * @@ -356,17 +520,24 @@ export class Storage extends Service { */ getFile(bucketId: string, fileId: string): Promise; getFile( - paramsOrFirst: { bucketId: string, fileId: string } | string, - ...rest: [(string)?] + paramsOrFirst: { bucketId: string; fileId: string } | string, + ...rest: [string?] ): Promise { - let params: { bucketId: string, fileId: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { bucketId: string, fileId: string }; + let params: { bucketId: string; fileId: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + bucketId: string; + fileId: string; + }; } else { params = { bucketId: paramsOrFirst as string, - fileId: rest[0] as string + fileId: rest[0] as string, }; } @@ -374,21 +545,30 @@ export class Storage extends Service { const fileId = params.fileId; if (typeof bucketId === 'undefined') { - throw new AppwriteException('Missing required parameter: "bucketId"'); + throw new AppwriteException( + 'Missing required parameter: "bucketId"', + ); } if (typeof fileId === 'undefined') { throw new AppwriteException('Missing required parameter: "fileId"'); } - const apiPath = '/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', encodeURIComponent(String(bucketId))).replace('{fileId}', encodeURIComponent(String(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); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } /** @@ -401,7 +581,12 @@ export class Storage extends Service { * @throws {AppwriteException} * @returns {Promise} */ - updateFile(params: { bucketId: string, fileId: string, name?: string, permissions?: string[] }): Promise; + updateFile(params: { + bucketId: string; + fileId: string; + name?: string; + permissions?: string[]; + }): Promise; /** * Update a file by its unique ID. Only users with write permissions have access to update this resource. * @@ -413,21 +598,47 @@ export class Storage extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateFile(bucketId: string, fileId: string, name?: string, permissions?: string[]): Promise; updateFile( - paramsOrFirst: { bucketId: string, fileId: string, name?: string, permissions?: string[] } | string, - ...rest: [(string)?, (string)?, (string[])?] + bucketId: string, + fileId: string, + name?: string, + permissions?: string[], + ): Promise; + updateFile( + paramsOrFirst: + | { + bucketId: string; + fileId: string; + name?: string; + permissions?: string[]; + } + | string, + ...rest: [string?, string?, string[]?] ): Promise { - let params: { bucketId: string, fileId: string, name?: string, permissions?: string[] }; + let params: { + bucketId: string; + fileId: string; + name?: string; + permissions?: string[]; + }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { bucketId: string, fileId: string, name?: string, permissions?: string[] }; + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + bucketId: string; + fileId: string; + name?: string; + permissions?: string[]; + }; } else { params = { bucketId: paramsOrFirst as string, fileId: rest[0] as string, name: rest[1] as string, - permissions: rest[2] as string[] + permissions: rest[2] as string[], }; } @@ -437,14 +648,18 @@ export class Storage extends Service { const permissions = params.permissions; if (typeof bucketId === 'undefined') { - throw new AppwriteException('Missing required parameter: "bucketId"'); + throw new AppwriteException( + 'Missing required parameter: "bucketId"', + ); } if (typeof fileId === 'undefined') { throw new AppwriteException('Missing required parameter: "fileId"'); } - const apiPath = '/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', encodeURIComponent(String(bucketId))).replace('{fileId}', encodeURIComponent(String(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') { @@ -456,11 +671,16 @@ export class Storage extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('put', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'put', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -471,7 +691,7 @@ export class Storage extends Service { * @throws {AppwriteException} * @returns {Promise} */ - deleteFile(params: { bucketId: string, fileId: string }): Promise<{}>; + deleteFile(params: { bucketId: string; fileId: string }): Promise<{}>; /** * Delete a file by its unique ID. Only users with write permissions have access to delete this resource. * @@ -483,17 +703,24 @@ export class Storage extends Service { */ deleteFile(bucketId: string, fileId: string): Promise<{}>; deleteFile( - paramsOrFirst: { bucketId: string, fileId: string } | string, - ...rest: [(string)?] + paramsOrFirst: { bucketId: string; fileId: string } | string, + ...rest: [string?] ): Promise<{}> { - let params: { bucketId: string, fileId: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { bucketId: string, fileId: string }; + let params: { bucketId: string; fileId: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + bucketId: string; + fileId: string; + }; } else { params = { bucketId: paramsOrFirst as string, - fileId: rest[0] as string + fileId: rest[0] as string, }; } @@ -501,21 +728,30 @@ export class Storage extends Service { const fileId = params.fileId; if (typeof bucketId === 'undefined') { - throw new AppwriteException('Missing required parameter: "bucketId"'); + throw new AppwriteException( + 'Missing required parameter: "bucketId"', + ); } if (typeof fileId === 'undefined') { throw new AppwriteException('Missing required parameter: "fileId"'); } - const apiPath = '/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', encodeURIComponent(String(bucketId))).replace('{fileId}', encodeURIComponent(String(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); - return this.client.call('delete', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - }, payload); + return this.client.call( + 'delete', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + }, + payload, + ); } /** @@ -527,7 +763,11 @@ export class Storage extends Service { * @throws {AppwriteException} * @returns {ArrayBuffer} */ - getFileDownload(params: { bucketId: string, fileId: string, token?: string }): Promise; + getFileDownload(params: { + bucketId: string; + fileId: string; + token?: string; + }): Promise; /** * Get a file 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. * @@ -538,20 +778,33 @@ export class Storage extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getFileDownload(bucketId: string, fileId: string, token?: string): Promise; getFileDownload( - paramsOrFirst: { bucketId: string, fileId: string, token?: string } | string, - ...rest: [(string)?, (string)?] + bucketId: string, + fileId: string, + token?: string, + ): Promise; + getFileDownload( + paramsOrFirst: + { bucketId: string; fileId: string; token?: string } | string, + ...rest: [string?, string?] ): Promise { - let params: { bucketId: string, fileId: string, token?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { bucketId: string, fileId: string, token?: string }; + let params: { bucketId: string; fileId: string; token?: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + bucketId: string; + fileId: string; + token?: string; + }; } else { params = { bucketId: paramsOrFirst as string, fileId: rest[0] as string, - token: rest[1] as string + token: rest[1] as string, }; } @@ -560,14 +813,18 @@ export class Storage extends Service { const token = params.token; if (typeof bucketId === 'undefined') { - throw new AppwriteException('Missing required parameter: "bucketId"'); + throw new AppwriteException( + 'Missing required parameter: "bucketId"', + ); } if (typeof fileId === 'undefined') { throw new AppwriteException('Missing required parameter: "fileId"'); } - const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/download'.replace('{bucketId}', encodeURIComponent(String(bucketId))).replace('{fileId}', encodeURIComponent(String(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') { @@ -579,14 +836,19 @@ export class Storage extends Service { payload['impersonateuserid'] = this.client.config.impersonateuserid; - for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': '*/*', - }, payload, 'arrayBuffer'); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: '*/*', + }, + payload, + 'arrayBuffer', + ); } /** @@ -609,7 +871,22 @@ export class Storage extends Service { * @throws {AppwriteException} * @returns {ArrayBuffer} */ - getFilePreview(params: { bucketId: string, fileId: string, width?: number, height?: number, gravity?: ImageGravity, quality?: number, borderWidth?: number, borderColor?: string, borderRadius?: number, opacity?: number, rotation?: number, background?: string, output?: ImageFormat, token?: string }): Promise; + getFilePreview(params: { + bucketId: string; + fileId: string; + width?: number; + height?: number; + gravity?: ImageGravity; + quality?: number; + borderWidth?: number; + borderColor?: string; + borderRadius?: number; + opacity?: number; + rotation?: number; + background?: string; + output?: ImageFormat; + token?: string; + }): Promise; /** * Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB. * @@ -631,15 +908,95 @@ export class Storage extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getFilePreview(bucketId: string, fileId: string, width?: number, height?: number, gravity?: ImageGravity, quality?: number, borderWidth?: number, borderColor?: string, borderRadius?: number, opacity?: number, rotation?: number, background?: string, output?: ImageFormat, token?: string): Promise; getFilePreview( - paramsOrFirst: { bucketId: string, fileId: string, width?: number, height?: number, gravity?: ImageGravity, quality?: number, borderWidth?: number, borderColor?: string, borderRadius?: number, opacity?: number, rotation?: number, background?: string, output?: ImageFormat, token?: string } | string, - ...rest: [(string)?, (number)?, (number)?, (ImageGravity)?, (number)?, (number)?, (string)?, (number)?, (number)?, (number)?, (string)?, (ImageFormat)?, (string)?] + bucketId: string, + fileId: string, + width?: number, + height?: number, + gravity?: ImageGravity, + quality?: number, + borderWidth?: number, + borderColor?: string, + borderRadius?: number, + opacity?: number, + rotation?: number, + background?: string, + output?: ImageFormat, + token?: string, + ): Promise; + getFilePreview( + paramsOrFirst: + | { + bucketId: string; + fileId: string; + width?: number; + height?: number; + gravity?: ImageGravity; + quality?: number; + borderWidth?: number; + borderColor?: string; + borderRadius?: number; + opacity?: number; + rotation?: number; + background?: string; + output?: ImageFormat; + token?: string; + } + | string, + ...rest: [ + string?, + number?, + number?, + ImageGravity?, + number?, + number?, + string?, + number?, + number?, + number?, + string?, + ImageFormat?, + string?, + ] ): Promise { - let params: { bucketId: string, fileId: string, width?: number, height?: number, gravity?: ImageGravity, quality?: number, borderWidth?: number, borderColor?: string, borderRadius?: number, opacity?: number, rotation?: number, background?: string, output?: ImageFormat, token?: string }; + let params: { + bucketId: string; + fileId: string; + width?: number; + height?: number; + gravity?: ImageGravity; + quality?: number; + borderWidth?: number; + borderColor?: string; + borderRadius?: number; + opacity?: number; + rotation?: number; + background?: string; + output?: ImageFormat; + token?: string; + }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { bucketId: string, fileId: string, width?: number, height?: number, gravity?: ImageGravity, quality?: number, borderWidth?: number, borderColor?: string, borderRadius?: number, opacity?: number, rotation?: number, background?: string, output?: ImageFormat, token?: string }; + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + bucketId: string; + fileId: string; + width?: number; + height?: number; + gravity?: ImageGravity; + quality?: number; + borderWidth?: number; + borderColor?: string; + borderRadius?: number; + opacity?: number; + rotation?: number; + background?: string; + output?: ImageFormat; + token?: string; + }; } else { params = { bucketId: paramsOrFirst as string, @@ -655,7 +1012,7 @@ export class Storage extends Service { rotation: rest[9] as number, background: rest[10] as string, output: rest[11] as ImageFormat, - token: rest[12] as string + token: rest[12] as string, }; } @@ -675,14 +1032,18 @@ export class Storage extends Service { const token = params.token; if (typeof bucketId === 'undefined') { - throw new AppwriteException('Missing required parameter: "bucketId"'); + throw new AppwriteException( + 'Missing required parameter: "bucketId"', + ); } if (typeof fileId === 'undefined') { throw new AppwriteException('Missing required parameter: "fileId"'); } - const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/preview'.replace('{bucketId}', encodeURIComponent(String(bucketId))).replace('{fileId}', encodeURIComponent(String(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') { @@ -738,14 +1099,19 @@ export class Storage extends Service { payload['impersonateuserid'] = this.client.config.impersonateuserid; - for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'image/*', - }, payload, 'arrayBuffer'); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'image/*', + }, + payload, + 'arrayBuffer', + ); } /** @@ -757,7 +1123,11 @@ export class Storage extends Service { * @throws {AppwriteException} * @returns {ArrayBuffer} */ - getFileView(params: { bucketId: string, fileId: string, token?: string }): Promise; + getFileView(params: { + bucketId: string; + fileId: string; + token?: string; + }): Promise; /** * Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header. * @@ -768,20 +1138,33 @@ export class Storage extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getFileView(bucketId: string, fileId: string, token?: string): Promise; getFileView( - paramsOrFirst: { bucketId: string, fileId: string, token?: string } | string, - ...rest: [(string)?, (string)?] + bucketId: string, + fileId: string, + token?: string, + ): Promise; + getFileView( + paramsOrFirst: + { bucketId: string; fileId: string; token?: string } | string, + ...rest: [string?, string?] ): Promise { - let params: { bucketId: string, fileId: string, token?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { bucketId: string, fileId: string, token?: string }; + let params: { bucketId: string; fileId: string; token?: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + bucketId: string; + fileId: string; + token?: string; + }; } else { params = { bucketId: paramsOrFirst as string, fileId: rest[0] as string, - token: rest[1] as string + token: rest[1] as string, }; } @@ -790,14 +1173,18 @@ export class Storage extends Service { const token = params.token; if (typeof bucketId === 'undefined') { - throw new AppwriteException('Missing required parameter: "bucketId"'); + throw new AppwriteException( + 'Missing required parameter: "bucketId"', + ); } if (typeof fileId === 'undefined') { throw new AppwriteException('Missing required parameter: "fileId"'); } - const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/view'.replace('{bucketId}', encodeURIComponent(String(bucketId))).replace('{fileId}', encodeURIComponent(String(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') { @@ -809,19 +1196,24 @@ export class Storage extends Service { payload['impersonateuserid'] = this.client.config.impersonateuserid; - for (const [key, value] of Object.entries(Service.flatten(payload))) { uri.searchParams.append(key, value); } - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': '*/*', - }, payload, 'arrayBuffer'); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: '*/*', + }, + payload, + 'arrayBuffer', + ); } /** * Get a file content by its unique ID. The endpoint response return with a - * 'Content-Disposition: attachment' header that tells the browser to start + * 'Content-Disposition: attachment' header that tells the browser to start * downloading the file to user downloads directory. * * @param {string} bucketId @@ -829,9 +1221,11 @@ export class Storage extends Service { * @param {string} token * @throws {AppwriteException} * @returns {URL} - */ + */ getFileDownloadURL(bucketId: string, fileId: string, token?: string): URL { - const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/download'.replace('{bucketId}', encodeURIComponent(String(bucketId))).replace('{fileId}', encodeURIComponent(String(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') { @@ -873,9 +1267,26 @@ export class Storage extends Service { * @param {string} token * @throws {AppwriteException} * @returns {URL} - */ - getFilePreviewURL(bucketId: string, fileId: string, width?: number, height?: number, gravity?: ImageGravity, quality?: number, borderWidth?: number, borderColor?: string, borderRadius?: number, opacity?: number, rotation?: number, background?: string, output?: ImageFormat, token?: string): URL { - const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/preview'.replace('{bucketId}', encodeURIComponent(String(bucketId))).replace('{fileId}', encodeURIComponent(String(fileId))); + */ + getFilePreviewURL( + bucketId: string, + fileId: string, + width?: number, + height?: number, + gravity?: ImageGravity, + quality?: number, + borderWidth?: number, + borderColor?: string, + borderRadius?: number, + opacity?: number, + rotation?: number, + background?: string, + output?: ImageFormat, + token?: string, + ): URL { + 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') { @@ -940,7 +1351,7 @@ export class Storage extends Service { /** * Get a file content by its unique ID. This endpoint is similar to the - * download method but returns with no 'Content-Disposition: attachment' + * download method but returns with no 'Content-Disposition: attachment' * header. * * @param {string} bucketId @@ -948,9 +1359,11 @@ export class Storage extends Service { * @param {string} token * @throws {AppwriteException} * @returns {URL} - */ + */ getFileViewURL(bucketId: string, fileId: string, token?: string): URL { - const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/view'.replace('{bucketId}', encodeURIComponent(String(bucketId))).replace('{fileId}', encodeURIComponent(String(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') { @@ -968,4 +1381,4 @@ export class Storage extends Service { return uri; } -}; +} diff --git a/src/services/tables-db.ts b/src/services/tables-db.ts index 71561bcc..74256f5c 100644 --- a/src/services/tables-db.ts +++ b/src/services/tables-db.ts @@ -1,17 +1,12 @@ import { Service } from '../service'; import { AppwriteException, Client } from '../client'; import type { Models } from '../models'; -import type { UploadProgress, Payload } from '../client'; -import * as FileSystem from 'expo-file-system'; -import { Platform as RNPlatform } from 'react-native'; - +import type { Payload } from '../client'; export class TablesDB extends Service { - - constructor(client: Client) - { + constructor(client: Client) { super(client); - } + } /** * List transactions across all databases. @@ -20,7 +15,9 @@ export class TablesDB extends Service { * @throws {AppwriteException} * @returns {Promise} */ - listTransactions(params?: { queries?: string[] }): Promise; + listTransactions(params?: { + queries?: string[]; + }): Promise; /** * List transactions across all databases. * @@ -31,15 +28,20 @@ export class TablesDB extends Service { */ listTransactions(queries?: string[]): Promise; listTransactions( - paramsOrFirst?: { queries?: string[] } | string[] + paramsOrFirst?: { queries?: string[] } | string[], ): Promise { let params: { queries?: string[] }; - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + if ( + !paramsOrFirst || + (paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst)) + ) { params = (paramsOrFirst || {}) as { queries?: string[] }; } else { params = { - queries: paramsOrFirst as string[] + queries: paramsOrFirst as string[], }; } @@ -53,10 +55,15 @@ export class TablesDB extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } /** @@ -66,7 +73,7 @@ export class TablesDB extends Service { * @throws {AppwriteException} * @returns {Promise} */ - createTransaction(params?: { ttl?: number }): Promise; + createTransaction(params?: { ttl?: number }): Promise; /** * Create a new transaction. * @@ -77,15 +84,20 @@ export class TablesDB extends Service { */ createTransaction(ttl?: number): Promise; createTransaction( - paramsOrFirst?: { ttl?: number } | number + paramsOrFirst?: { ttl?: number } | number, ): Promise { let params: { ttl?: number }; - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + if ( + !paramsOrFirst || + (paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst)) + ) { params = (paramsOrFirst || {}) as { ttl?: number }; } else { params = { - ttl: paramsOrFirst as number + ttl: paramsOrFirst as number, }; } @@ -99,11 +111,16 @@ export class TablesDB extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('post', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -113,7 +130,9 @@ export class TablesDB extends Service { * @throws {AppwriteException} * @returns {Promise} */ - getTransaction(params: { transactionId: string }): Promise; + getTransaction(params: { + transactionId: string; + }): Promise; /** * Get a transaction by its unique ID. * @@ -124,32 +143,46 @@ export class TablesDB extends Service { */ getTransaction(transactionId: string): Promise; getTransaction( - paramsOrFirst: { transactionId: string } | string + paramsOrFirst: { transactionId: string } | string, ): Promise { let params: { transactionId: string }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { params = (paramsOrFirst || {}) as { transactionId: string }; } else { params = { - transactionId: paramsOrFirst as string + transactionId: paramsOrFirst as string, }; } const transactionId = params.transactionId; if (typeof transactionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "transactionId"'); + throw new AppwriteException( + 'Missing required parameter: "transactionId"', + ); } - const apiPath = '/tablesdb/transactions/{transactionId}'.replace('{transactionId}', encodeURIComponent(String(transactionId))); + const apiPath = '/tablesdb/transactions/{transactionId}'.replace( + '{transactionId}', + encodeURIComponent(String(transactionId)), + ); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } /** @@ -161,7 +194,11 @@ export class TablesDB extends Service { * @throws {AppwriteException} * @returns {Promise} */ - updateTransaction(params: { transactionId: string, commit?: boolean, rollback?: boolean }): Promise; + updateTransaction(params: { + transactionId: string; + commit?: boolean; + rollback?: boolean; + }): Promise; /** * Update a transaction, to either commit or roll back its operations. * @@ -172,20 +209,38 @@ export class TablesDB extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateTransaction(transactionId: string, commit?: boolean, rollback?: boolean): Promise; updateTransaction( - paramsOrFirst: { transactionId: string, commit?: boolean, rollback?: boolean } | string, - ...rest: [(boolean)?, (boolean)?] + transactionId: string, + commit?: boolean, + rollback?: boolean, + ): Promise; + updateTransaction( + paramsOrFirst: + | { transactionId: string; commit?: boolean; rollback?: boolean } + | string, + ...rest: [boolean?, boolean?] ): Promise { - let params: { transactionId: string, commit?: boolean, rollback?: boolean }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { transactionId: string, commit?: boolean, rollback?: boolean }; + let params: { + transactionId: string; + commit?: boolean; + rollback?: boolean; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + transactionId: string; + commit?: boolean; + rollback?: boolean; + }; } else { params = { transactionId: paramsOrFirst as string, commit: rest[0] as boolean, - rollback: rest[1] as boolean + rollback: rest[1] as boolean, }; } @@ -194,10 +249,15 @@ export class TablesDB extends Service { const rollback = params.rollback; if (typeof transactionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "transactionId"'); + throw new AppwriteException( + 'Missing required parameter: "transactionId"', + ); } - const apiPath = '/tablesdb/transactions/{transactionId}'.replace('{transactionId}', encodeURIComponent(String(transactionId))); + const apiPath = '/tablesdb/transactions/{transactionId}'.replace( + '{transactionId}', + encodeURIComponent(String(transactionId)), + ); const payload: Payload = {}; if (typeof commit !== 'undefined') { @@ -209,11 +269,16 @@ export class TablesDB extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('patch', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'patch', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -223,7 +288,7 @@ export class TablesDB extends Service { * @throws {AppwriteException} * @returns {Promise} */ - deleteTransaction(params: { transactionId: string }): Promise<{}>; + deleteTransaction(params: { transactionId: string }): Promise<{}>; /** * Delete a transaction by its unique ID. * @@ -234,32 +299,46 @@ export class TablesDB extends Service { */ deleteTransaction(transactionId: string): Promise<{}>; deleteTransaction( - paramsOrFirst: { transactionId: string } | string + paramsOrFirst: { transactionId: string } | string, ): Promise<{}> { let params: { transactionId: string }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { params = (paramsOrFirst || {}) as { transactionId: string }; } else { params = { - transactionId: paramsOrFirst as string + transactionId: paramsOrFirst as string, }; } const transactionId = params.transactionId; if (typeof transactionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "transactionId"'); + throw new AppwriteException( + 'Missing required parameter: "transactionId"', + ); } - const apiPath = '/tablesdb/transactions/{transactionId}'.replace('{transactionId}', encodeURIComponent(String(transactionId))); + const apiPath = '/tablesdb/transactions/{transactionId}'.replace( + '{transactionId}', + encodeURIComponent(String(transactionId)), + ); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('delete', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - }, payload); + return this.client.call( + 'delete', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + }, + payload, + ); } /** @@ -270,7 +349,10 @@ export class TablesDB extends Service { * @throws {AppwriteException} * @returns {Promise} */ - createOperations(params: { transactionId: string, operations?: object[] }): Promise; + createOperations(params: { + transactionId: string; + operations?: object[]; + }): Promise; /** * Create multiple operations in a single transaction. * @@ -280,19 +362,30 @@ export class TablesDB extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createOperations(transactionId: string, operations?: object[]): Promise; createOperations( - paramsOrFirst: { transactionId: string, operations?: object[] } | string, - ...rest: [(object[])?] + transactionId: string, + operations?: object[], + ): Promise; + createOperations( + paramsOrFirst: + { transactionId: string; operations?: object[] } | string, + ...rest: [object[]?] ): Promise { - let params: { transactionId: string, operations?: object[] }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { transactionId: string, operations?: object[] }; + let params: { transactionId: string; operations?: object[] }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + transactionId: string; + operations?: object[]; + }; } else { params = { transactionId: paramsOrFirst as string, - operations: rest[0] as object[] + operations: rest[0] as object[], }; } @@ -300,10 +393,16 @@ export class TablesDB extends Service { const operations = params.operations; if (typeof transactionId === 'undefined') { - throw new AppwriteException('Missing required parameter: "transactionId"'); + throw new AppwriteException( + 'Missing required parameter: "transactionId"', + ); } - const apiPath = '/tablesdb/transactions/{transactionId}/operations'.replace('{transactionId}', encodeURIComponent(String(transactionId))); + const apiPath = + '/tablesdb/transactions/{transactionId}/operations'.replace( + '{transactionId}', + encodeURIComponent(String(transactionId)), + ); const payload: Payload = {}; if (typeof operations !== 'undefined') { @@ -311,11 +410,16 @@ export class TablesDB extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('post', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -330,7 +434,14 @@ export class TablesDB extends Service { * @throws {AppwriteException} * @returns {Promise} */ - listRows(params: { databaseId: string, tableId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number }): Promise>; + listRows(params: { + databaseId: string; + tableId: string; + queries?: string[]; + transactionId?: string; + total?: boolean; + ttl?: number; + }): Promise>; /** * Get a list of all the user's rows in a given table. You can use the query params to filter your results. * @@ -344,15 +455,49 @@ export class TablesDB extends Service { * @returns {Promise>} * @deprecated Use the object parameter style method for a better developer experience. */ - listRows(databaseId: string, tableId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number): Promise>; listRows( - paramsOrFirst: { databaseId: string, tableId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number } | string, - ...rest: [(string)?, (string[])?, (string)?, (boolean)?, (number)?] + databaseId: string, + tableId: string, + queries?: string[], + transactionId?: string, + total?: boolean, + ttl?: number, + ): Promise>; + listRows( + paramsOrFirst: + | { + databaseId: string; + tableId: string; + queries?: string[]; + transactionId?: string; + total?: boolean; + ttl?: number; + } + | string, + ...rest: [string?, string[]?, string?, boolean?, number?] ): Promise> { - let params: { databaseId: string, tableId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, queries?: string[], transactionId?: string, total?: boolean, ttl?: number }; + let params: { + databaseId: string; + tableId: string; + queries?: string[]; + transactionId?: string; + total?: boolean; + ttl?: number; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + tableId: string; + queries?: string[]; + transactionId?: string; + total?: boolean; + ttl?: number; + }; } else { params = { databaseId: paramsOrFirst as string, @@ -360,7 +505,7 @@ export class TablesDB extends Service { queries: rest[1] as string[], transactionId: rest[2] as string, total: rest[3] as boolean, - ttl: rest[4] as number + ttl: rest[4] as number, }; } @@ -372,14 +517,20 @@ export class TablesDB extends Service { const ttl = params.ttl; if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); } if (typeof tableId === 'undefined') { - throw new AppwriteException('Missing required parameter: "tableId"'); + throw new AppwriteException( + 'Missing required parameter: "tableId"', + ); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(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') { @@ -399,10 +550,15 @@ export class TablesDB extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } /** @@ -417,7 +573,16 @@ export class TablesDB extends Service { * @throws {AppwriteException} * @returns {Promise} */ - createRow(params: { databaseId: string, tableId: string, rowId: string, data: Row extends Models.DefaultRow ? Partial & Record : Partial & Omit, permissions?: string[], transactionId?: string }): Promise; + createRow(params: { + databaseId: string; + tableId: string; + rowId: string; + data: Row extends Models.DefaultRow + ? Partial & Record + : Partial & Omit; + permissions?: string[]; + transactionId?: string; + }): Promise; /** * Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console. * @@ -431,23 +596,75 @@ export class TablesDB extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createRow(databaseId: string, tableId: string, rowId: string, data: Row extends Models.DefaultRow ? Partial & Record : Partial & Omit, permissions?: string[], transactionId?: string): Promise; createRow( - paramsOrFirst: { databaseId: string, tableId: string, rowId: string, data: Row extends Models.DefaultRow ? Partial & Record : Partial & Omit, permissions?: string[], transactionId?: string } | string, - ...rest: [(string)?, (string)?, (Row extends Models.DefaultRow ? Partial & Record : Partial & Omit)?, (string[])?, (string)?] + databaseId: string, + tableId: string, + rowId: string, + data: Row extends Models.DefaultRow + ? Partial & Record + : Partial & Omit, + permissions?: string[], + transactionId?: string, + ): Promise; + createRow( + paramsOrFirst: + | { + databaseId: string; + tableId: string; + rowId: string; + data: Row extends Models.DefaultRow + ? Partial & Record + : Partial & Omit; + permissions?: string[]; + transactionId?: string; + } + | string, + ...rest: [ + string?, + string?, + (Row extends Models.DefaultRow + ? Partial & Record + : Partial & Omit)?, + string[]?, + string?, + ] ): Promise { - let params: { databaseId: string, tableId: string, rowId: string, data: Row extends Models.DefaultRow ? Partial & Record : Partial & Omit, permissions?: string[], transactionId?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, rowId: string, data: Row extends Models.DefaultRow ? Partial & Record : Partial & Omit, permissions?: string[], transactionId?: string }; + let params: { + databaseId: string; + tableId: string; + rowId: string; + data: Row extends Models.DefaultRow + ? Partial & Record + : Partial & Omit; + permissions?: string[]; + transactionId?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + tableId: string; + rowId: string; + data: Row extends Models.DefaultRow + ? Partial & Record + : Partial & Omit; + permissions?: string[]; + transactionId?: string; + }; } else { params = { databaseId: paramsOrFirst as string, tableId: rest[0] as string, rowId: rest[1] as string, - data: rest[2] as Row extends Models.DefaultRow ? Partial & Record : Partial & Omit, + data: rest[2] as Row extends Models.DefaultRow + ? Partial & Record + : Partial & Omit, permissions: rest[3] as string[], - transactionId: rest[4] as string + transactionId: rest[4] as string, }; } @@ -459,11 +676,15 @@ export class TablesDB extends Service { const transactionId = params.transactionId; if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); } if (typeof tableId === 'undefined') { - throw new AppwriteException('Missing required parameter: "tableId"'); + throw new AppwriteException( + 'Missing required parameter: "tableId"', + ); } if (typeof rowId === 'undefined') { @@ -474,7 +695,9 @@ export class TablesDB extends Service { throw new AppwriteException('Missing required parameter: "data"'); } - const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', encodeURIComponent(String(databaseId))).replace('{tableId}', encodeURIComponent(String(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') { @@ -494,11 +717,16 @@ export class TablesDB extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('post', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -512,7 +740,13 @@ export class TablesDB extends Service { * @throws {AppwriteException} * @returns {Promise} */ - getRow(params: { databaseId: string, tableId: string, rowId: string, queries?: string[], transactionId?: string }): Promise; + getRow(params: { + databaseId: string; + tableId: string; + rowId: string; + queries?: string[]; + transactionId?: string; + }): Promise; /** * Get a row by its unique ID. This endpoint response returns a JSON object with the row data. * @@ -525,22 +759,52 @@ export class TablesDB extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getRow(databaseId: string, tableId: string, rowId: string, queries?: string[], transactionId?: string): Promise; getRow( - paramsOrFirst: { databaseId: string, tableId: string, rowId: string, queries?: string[], transactionId?: string } | string, - ...rest: [(string)?, (string)?, (string[])?, (string)?] + databaseId: string, + tableId: string, + rowId: string, + queries?: string[], + transactionId?: string, + ): Promise; + getRow( + paramsOrFirst: + | { + databaseId: string; + tableId: string; + rowId: string; + queries?: string[]; + transactionId?: string; + } + | string, + ...rest: [string?, string?, string[]?, string?] ): Promise { - let params: { databaseId: string, tableId: string, rowId: string, queries?: string[], transactionId?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, rowId: string, queries?: string[], transactionId?: string }; + let params: { + databaseId: string; + tableId: string; + rowId: string; + queries?: string[]; + transactionId?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + tableId: string; + rowId: string; + queries?: string[]; + transactionId?: string; + }; } else { params = { databaseId: paramsOrFirst as string, tableId: rest[0] as string, rowId: rest[1] as string, queries: rest[2] as string[], - transactionId: rest[3] as string + transactionId: rest[3] as string, }; } @@ -551,18 +815,25 @@ export class TablesDB extends Service { const transactionId = params.transactionId; if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); } if (typeof tableId === 'undefined') { - throw new AppwriteException('Missing required parameter: "tableId"'); + throw new AppwriteException( + 'Missing required parameter: "tableId"', + ); } if (typeof rowId === 'undefined') { throw new AppwriteException('Missing required parameter: "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 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') { @@ -574,10 +845,15 @@ export class TablesDB extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } /** @@ -592,7 +868,16 @@ export class TablesDB extends Service { * @throws {AppwriteException} * @returns {Promise} */ - upsertRow(params: { databaseId: string, tableId: string, rowId: string, data?: Row extends Models.DefaultRow ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }): Promise; + upsertRow(params: { + databaseId: string; + tableId: string; + rowId: string; + data?: Row extends Models.DefaultRow + ? Partial & Record + : Partial & Partial>; + permissions?: string[]; + transactionId?: string; + }): Promise; /** * Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console. * @@ -606,23 +891,78 @@ export class TablesDB extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - upsertRow(databaseId: string, tableId: string, rowId: string, data?: Row extends Models.DefaultRow ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string): Promise; upsertRow( - paramsOrFirst: { databaseId: string, tableId: string, rowId: string, data?: Row extends Models.DefaultRow ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string } | string, - ...rest: [(string)?, (string)?, (Row extends Models.DefaultRow ? Partial & Record : Partial & Partial>)?, (string[])?, (string)?] + databaseId: string, + tableId: string, + rowId: string, + data?: Row extends Models.DefaultRow + ? Partial & Record + : Partial & Partial>, + permissions?: string[], + transactionId?: string, + ): Promise; + upsertRow( + paramsOrFirst: + | { + databaseId: string; + tableId: string; + rowId: string; + data?: Row extends Models.DefaultRow + ? Partial & Record + : Partial & + Partial>; + permissions?: string[]; + transactionId?: string; + } + | string, + ...rest: [ + string?, + string?, + (Row extends Models.DefaultRow + ? Partial & Record + : Partial & Partial>)?, + string[]?, + string?, + ] ): Promise { - let params: { databaseId: string, tableId: string, rowId: string, data?: Row extends Models.DefaultRow ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, rowId: string, data?: Row extends Models.DefaultRow ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }; + let params: { + databaseId: string; + tableId: string; + rowId: string; + data?: Row extends Models.DefaultRow + ? Partial & Record + : Partial & Partial>; + permissions?: string[]; + transactionId?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + tableId: string; + rowId: string; + data?: Row extends Models.DefaultRow + ? Partial & Record + : Partial & + Partial>; + permissions?: string[]; + transactionId?: string; + }; } else { params = { databaseId: paramsOrFirst as string, tableId: rest[0] as string, rowId: rest[1] as string, - data: rest[2] as Row extends Models.DefaultRow ? Partial & Record : Partial & Partial>, + data: rest[2] as Row extends Models.DefaultRow + ? Partial & Record + : Partial & + Partial>, permissions: rest[3] as string[], - transactionId: rest[4] as string + transactionId: rest[4] as string, }; } @@ -634,18 +974,25 @@ export class TablesDB extends Service { const transactionId = params.transactionId; if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); } if (typeof tableId === 'undefined') { - throw new AppwriteException('Missing required parameter: "tableId"'); + throw new AppwriteException( + 'Missing required parameter: "tableId"', + ); } if (typeof rowId === 'undefined') { throw new AppwriteException('Missing required parameter: "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 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') { @@ -661,11 +1008,16 @@ export class TablesDB extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('put', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'put', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -680,7 +1032,16 @@ export class TablesDB extends Service { * @throws {AppwriteException} * @returns {Promise} */ - updateRow(params: { databaseId: string, tableId: string, rowId: string, data?: Row extends Models.DefaultRow ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }): Promise; + updateRow(params: { + databaseId: string; + tableId: string; + rowId: string; + data?: Row extends Models.DefaultRow + ? Partial & Record + : Partial & Partial>; + permissions?: string[]; + transactionId?: string; + }): Promise; /** * Update a row by its unique ID. Using the patch method you can pass only specific fields that will get updated. * @@ -694,23 +1055,78 @@ export class TablesDB extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateRow(databaseId: string, tableId: string, rowId: string, data?: Row extends Models.DefaultRow ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string): Promise; updateRow( - paramsOrFirst: { databaseId: string, tableId: string, rowId: string, data?: Row extends Models.DefaultRow ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string } | string, - ...rest: [(string)?, (string)?, (Row extends Models.DefaultRow ? Partial & Record : Partial & Partial>)?, (string[])?, (string)?] + databaseId: string, + tableId: string, + rowId: string, + data?: Row extends Models.DefaultRow + ? Partial & Record + : Partial & Partial>, + permissions?: string[], + transactionId?: string, + ): Promise; + updateRow( + paramsOrFirst: + | { + databaseId: string; + tableId: string; + rowId: string; + data?: Row extends Models.DefaultRow + ? Partial & Record + : Partial & + Partial>; + permissions?: string[]; + transactionId?: string; + } + | string, + ...rest: [ + string?, + string?, + (Row extends Models.DefaultRow + ? Partial & Record + : Partial & Partial>)?, + string[]?, + string?, + ] ): Promise { - let params: { databaseId: string, tableId: string, rowId: string, data?: Row extends Models.DefaultRow ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, rowId: string, data?: Row extends Models.DefaultRow ? Partial & Record : Partial & Partial>, permissions?: string[], transactionId?: string }; + let params: { + databaseId: string; + tableId: string; + rowId: string; + data?: Row extends Models.DefaultRow + ? Partial & Record + : Partial & Partial>; + permissions?: string[]; + transactionId?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + tableId: string; + rowId: string; + data?: Row extends Models.DefaultRow + ? Partial & Record + : Partial & + Partial>; + permissions?: string[]; + transactionId?: string; + }; } else { params = { databaseId: paramsOrFirst as string, tableId: rest[0] as string, rowId: rest[1] as string, - data: rest[2] as Row extends Models.DefaultRow ? Partial & Record : Partial & Partial>, + data: rest[2] as Row extends Models.DefaultRow + ? Partial & Record + : Partial & + Partial>, permissions: rest[3] as string[], - transactionId: rest[4] as string + transactionId: rest[4] as string, }; } @@ -722,18 +1138,25 @@ export class TablesDB extends Service { const transactionId = params.transactionId; if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); } if (typeof tableId === 'undefined') { - throw new AppwriteException('Missing required parameter: "tableId"'); + throw new AppwriteException( + 'Missing required parameter: "tableId"', + ); } if (typeof rowId === 'undefined') { throw new AppwriteException('Missing required parameter: "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 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') { @@ -749,11 +1172,16 @@ export class TablesDB extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('patch', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'patch', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -766,7 +1194,12 @@ export class TablesDB extends Service { * @throws {AppwriteException} * @returns {Promise} */ - deleteRow(params: { databaseId: string, tableId: string, rowId: string, transactionId?: string }): Promise<{}>; + deleteRow(params: { + databaseId: string; + tableId: string; + rowId: string; + transactionId?: string; + }): Promise<{}>; /** * Delete a row by its unique ID. * @@ -778,21 +1211,47 @@ export class TablesDB extends Service { * @returns {Promise<{}>} * @deprecated Use the object parameter style method for a better developer experience. */ - deleteRow(databaseId: string, tableId: string, rowId: string, transactionId?: string): Promise<{}>; deleteRow( - paramsOrFirst: { databaseId: string, tableId: string, rowId: string, transactionId?: string } | string, - ...rest: [(string)?, (string)?, (string)?] + databaseId: string, + tableId: string, + rowId: string, + transactionId?: string, + ): Promise<{}>; + deleteRow( + paramsOrFirst: + | { + databaseId: string; + tableId: string; + rowId: string; + transactionId?: string; + } + | string, + ...rest: [string?, string?, string?] ): Promise<{}> { - let params: { databaseId: string, tableId: string, rowId: string, transactionId?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, rowId: string, transactionId?: string }; + let params: { + databaseId: string; + tableId: string; + rowId: string; + transactionId?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + tableId: string; + rowId: string; + transactionId?: string; + }; } else { params = { databaseId: paramsOrFirst as string, tableId: rest[0] as string, rowId: rest[1] as string, - transactionId: rest[2] as string + transactionId: rest[2] as string, }; } @@ -802,18 +1261,25 @@ export class TablesDB extends Service { const transactionId = params.transactionId; if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); } if (typeof tableId === 'undefined') { - throw new AppwriteException('Missing required parameter: "tableId"'); + throw new AppwriteException( + 'Missing required parameter: "tableId"', + ); } if (typeof rowId === 'undefined') { throw new AppwriteException('Missing required parameter: "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 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') { @@ -821,10 +1287,15 @@ export class TablesDB extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('delete', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - }, payload); + return this.client.call( + 'delete', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + }, + payload, + ); } /** @@ -840,7 +1311,15 @@ export class TablesDB extends Service { * @throws {AppwriteException} * @returns {Promise} */ - decrementRowColumn(params: { databaseId: string, tableId: string, rowId: string, column: string, value?: number, min?: number, transactionId?: string }): Promise; + decrementRowColumn(params: { + databaseId: string; + tableId: string; + rowId: string; + column: string; + value?: number; + min?: number; + transactionId?: string; + }): Promise; /** * Decrement a specific column of a row by a given value. * @@ -855,15 +1334,53 @@ export class TablesDB extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - decrementRowColumn(databaseId: string, tableId: string, rowId: string, column: string, value?: number, min?: number, transactionId?: string): Promise; decrementRowColumn( - paramsOrFirst: { databaseId: string, tableId: string, rowId: string, column: string, value?: number, min?: number, transactionId?: string } | string, - ...rest: [(string)?, (string)?, (string)?, (number)?, (number)?, (string)?] + databaseId: string, + tableId: string, + rowId: string, + column: string, + value?: number, + min?: number, + transactionId?: string, + ): Promise; + decrementRowColumn( + paramsOrFirst: + | { + databaseId: string; + tableId: string; + rowId: string; + column: string; + value?: number; + min?: number; + transactionId?: string; + } + | string, + ...rest: [string?, string?, string?, number?, number?, string?] ): Promise { - let params: { databaseId: string, tableId: string, rowId: string, column: string, value?: number, min?: number, transactionId?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, rowId: string, column: string, value?: number, min?: number, transactionId?: string }; + let params: { + databaseId: string; + tableId: string; + rowId: string; + column: string; + value?: number; + min?: number; + transactionId?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + tableId: string; + rowId: string; + column: string; + value?: number; + min?: number; + transactionId?: string; + }; } else { params = { databaseId: paramsOrFirst as string, @@ -872,7 +1389,7 @@ export class TablesDB extends Service { column: rest[2] as string, value: rest[3] as number, min: rest[4] as number, - transactionId: rest[5] as string + transactionId: rest[5] as string, }; } @@ -885,11 +1402,15 @@ export class TablesDB extends Service { const transactionId = params.transactionId; if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); } if (typeof tableId === 'undefined') { - throw new AppwriteException('Missing required parameter: "tableId"'); + throw new AppwriteException( + 'Missing required parameter: "tableId"', + ); } if (typeof rowId === 'undefined') { @@ -900,7 +1421,12 @@ export class TablesDB extends Service { throw new AppwriteException('Missing required parameter: "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 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') { @@ -916,11 +1442,16 @@ export class TablesDB extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('patch', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'patch', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -936,7 +1467,15 @@ export class TablesDB extends Service { * @throws {AppwriteException} * @returns {Promise} */ - incrementRowColumn(params: { databaseId: string, tableId: string, rowId: string, column: string, value?: number, max?: number, transactionId?: string }): Promise; + incrementRowColumn(params: { + databaseId: string; + tableId: string; + rowId: string; + column: string; + value?: number; + max?: number; + transactionId?: string; + }): Promise; /** * Increment a specific column of a row by a given value. * @@ -951,15 +1490,53 @@ export class TablesDB extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - incrementRowColumn(databaseId: string, tableId: string, rowId: string, column: string, value?: number, max?: number, transactionId?: string): Promise; incrementRowColumn( - paramsOrFirst: { databaseId: string, tableId: string, rowId: string, column: string, value?: number, max?: number, transactionId?: string } | string, - ...rest: [(string)?, (string)?, (string)?, (number)?, (number)?, (string)?] + databaseId: string, + tableId: string, + rowId: string, + column: string, + value?: number, + max?: number, + transactionId?: string, + ): Promise; + incrementRowColumn( + paramsOrFirst: + | { + databaseId: string; + tableId: string; + rowId: string; + column: string; + value?: number; + max?: number; + transactionId?: string; + } + | string, + ...rest: [string?, string?, string?, number?, number?, string?] ): Promise { - let params: { databaseId: string, tableId: string, rowId: string, column: string, value?: number, max?: number, transactionId?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, rowId: string, column: string, value?: number, max?: number, transactionId?: string }; + let params: { + databaseId: string; + tableId: string; + rowId: string; + column: string; + value?: number; + max?: number; + transactionId?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + tableId: string; + rowId: string; + column: string; + value?: number; + max?: number; + transactionId?: string; + }; } else { params = { databaseId: paramsOrFirst as string, @@ -968,7 +1545,7 @@ export class TablesDB extends Service { column: rest[2] as string, value: rest[3] as number, max: rest[4] as number, - transactionId: rest[5] as string + transactionId: rest[5] as string, }; } @@ -981,11 +1558,15 @@ export class TablesDB extends Service { const transactionId = params.transactionId; if (typeof databaseId === 'undefined') { - throw new AppwriteException('Missing required parameter: "databaseId"'); + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); } if (typeof tableId === 'undefined') { - throw new AppwriteException('Missing required parameter: "tableId"'); + throw new AppwriteException( + 'Missing required parameter: "tableId"', + ); } if (typeof rowId === 'undefined') { @@ -996,7 +1577,12 @@ export class TablesDB extends Service { throw new AppwriteException('Missing required parameter: "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 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') { @@ -1012,10 +1598,15 @@ export class TablesDB extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('patch', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'patch', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } -}; +} diff --git a/src/services/teams.ts b/src/services/teams.ts index b5b10f33..285f6146 100644 --- a/src/services/teams.ts +++ b/src/services/teams.ts @@ -1,17 +1,12 @@ import { Service } from '../service'; import { AppwriteException, Client } from '../client'; import type { Models } from '../models'; -import type { UploadProgress, Payload } from '../client'; -import * as FileSystem from 'expo-file-system'; -import { Platform as RNPlatform } from 'react-native'; - +import type { Payload } from '../client'; export class Teams extends Service { - - constructor(client: Client) - { + constructor(client: Client) { super(client); - } + } /** * Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results. @@ -22,7 +17,13 @@ export class Teams extends Service { * @throws {AppwriteException} * @returns {Promise} */ - list(params?: { queries?: string[], search?: string, total?: boolean }): Promise>; + list< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >(params?: { + queries?: string[]; + search?: string; + total?: boolean; + }): Promise>; /** * Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results. * @@ -33,20 +34,34 @@ export class Teams extends Service { * @returns {Promise>} * @deprecated Use the object parameter style method for a better developer experience. */ - list(queries?: string[], search?: string, total?: boolean): Promise>; list( - paramsOrFirst?: { queries?: string[], search?: string, total?: boolean } | string[], - ...rest: [(string)?, (boolean)?] + queries?: string[], + search?: string, + total?: boolean, + ): Promise>; + list( + 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 }; + 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 + total: rest[1] as boolean, }; } @@ -70,10 +85,15 @@ export class Teams extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } /** @@ -85,7 +105,13 @@ export class Teams extends Service { * @throws {AppwriteException} * @returns {Promise} */ - create(params: { teamId: string, name: string, roles?: string[] }): Promise>; + create< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >(params: { + teamId: string; + name: string; + roles?: string[]; + }): Promise>; /** * Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team. * @@ -96,20 +122,33 @@ export class Teams extends Service { * @returns {Promise>} * @deprecated Use the object parameter style method for a better developer experience. */ - create(teamId: string, name: string, roles?: string[]): Promise>; create( - paramsOrFirst: { teamId: string, name: string, roles?: string[] } | string, - ...rest: [(string)?, (string[])?] + teamId: string, + name: string, + roles?: string[], + ): Promise>; + create( + paramsOrFirst: + { teamId: string; name: string; roles?: string[] } | string, + ...rest: [string?, string[]?] ): Promise> { - let params: { teamId: string, name: string, roles?: string[] }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { teamId: string, name: string, roles?: string[] }; + let params: { teamId: string; name: string; roles?: string[] }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + teamId: string; + name: string; + roles?: string[]; + }; } else { params = { teamId: paramsOrFirst as string, name: rest[0] as string, - roles: rest[1] as string[] + roles: rest[1] as string[], }; } @@ -141,11 +180,16 @@ export class Teams extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('post', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -155,7 +199,9 @@ export class Teams extends Service { * @throws {AppwriteException} * @returns {Promise} */ - get(params: { teamId: string }): Promise>; + get< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >(params: { teamId: string }): Promise>; /** * Get a team by its ID. All team members have read access for this resource. * @@ -164,17 +210,23 @@ export class Teams extends Service { * @returns {Promise>} * @deprecated Use the object parameter style method for a better developer experience. */ - get(teamId: string): Promise>; get( - paramsOrFirst: { teamId: string } | string + teamId: string, + ): Promise>; + get( + paramsOrFirst: { teamId: string } | string, ): Promise> { let params: { teamId: string }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { params = (paramsOrFirst || {}) as { teamId: string }; } else { params = { - teamId: paramsOrFirst as string + teamId: paramsOrFirst as string, }; } @@ -184,14 +236,22 @@ export class Teams extends Service { throw new AppwriteException('Missing required parameter: "teamId"'); } - const apiPath = '/teams/{teamId}'.replace('{teamId}', encodeURIComponent(String(teamId))); + const apiPath = '/teams/{teamId}'.replace( + '{teamId}', + encodeURIComponent(String(teamId)), + ); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } /** @@ -202,7 +262,12 @@ export class Teams extends Service { * @throws {AppwriteException} * @returns {Promise} */ - updateName(params: { teamId: string, name: string }): Promise>; + updateName< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >(params: { + teamId: string; + name: string; + }): Promise>; /** * Update the team's name by its unique ID. * @@ -212,19 +277,27 @@ export class Teams extends Service { * @returns {Promise>} * @deprecated Use the object parameter style method for a better developer experience. */ - updateName(teamId: string, name: string): Promise>; - updateName( - paramsOrFirst: { teamId: string, name: string } | string, - ...rest: [(string)?] + updateName< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >(teamId: string, name: string): Promise>; + updateName< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >( + paramsOrFirst: { teamId: string; name: string } | string, + ...rest: [string?] ): Promise> { - let params: { teamId: string, name: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { teamId: string, name: string }; + let params: { teamId: string; name: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { teamId: string; name: string }; } else { params = { teamId: paramsOrFirst as string, - name: rest[0] as string + name: rest[0] as string, }; } @@ -239,7 +312,10 @@ export class Teams extends Service { throw new AppwriteException('Missing required parameter: "name"'); } - const apiPath = '/teams/{teamId}'.replace('{teamId}', encodeURIComponent(String(teamId))); + const apiPath = '/teams/{teamId}'.replace( + '{teamId}', + encodeURIComponent(String(teamId)), + ); const payload: Payload = {}; if (typeof name !== 'undefined') { @@ -247,11 +323,16 @@ export class Teams extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('put', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'put', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -261,7 +342,7 @@ export class Teams extends Service { * @throws {AppwriteException} * @returns {Promise} */ - delete(params: { teamId: string }): Promise<{}>; + delete(params: { teamId: string }): Promise<{}>; /** * Delete a team using its ID. Only team members with the owner role can delete the team. * @@ -271,33 +352,489 @@ export class Teams extends Service { * @deprecated Use the object parameter style method for a better developer experience. */ delete(teamId: string): Promise<{}>; - delete( - paramsOrFirst: { teamId: string } | string - ): Promise<{}> { + delete(paramsOrFirst: { teamId: string } | string): Promise<{}> { let params: { teamId: string }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { params = (paramsOrFirst || {}) as { teamId: string }; } else { params = { - teamId: paramsOrFirst as string + teamId: paramsOrFirst as string, + }; + } + + const teamId = params.teamId; + + if (typeof teamId === 'undefined') { + throw new AppwriteException('Missing required parameter: "teamId"'); + } + + const apiPath = '/teams/{teamId}'.replace( + '{teamId}', + encodeURIComponent(String(teamId)), + ); + const payload: Payload = {}; + + const uri = new URL(this.client.config.endpoint + apiPath); + return this.client.call( + 'delete', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + }, + payload, + ); + } + + /** + * 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); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + 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); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + 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); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + 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"'); } - const apiPath = '/teams/{teamId}'.replace('{teamId}', encodeURIComponent(String(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); - return this.client.call('delete', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - }, payload); + return this.client.call( + 'put', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + 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); + return this.client.call( + 'delete', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -310,7 +847,12 @@ export class Teams extends Service { * @throws {AppwriteException} * @returns {Promise} */ - listMemberships(params: { teamId: string, queries?: string[], search?: string, total?: boolean }): Promise; + listMemberships(params: { + teamId: string; + queries?: string[]; + search?: string; + total?: boolean; + }): Promise; /** * 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. * @@ -322,21 +864,47 @@ export class Teams extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - listMemberships(teamId: string, queries?: string[], search?: string, total?: boolean): Promise; listMemberships( - paramsOrFirst: { teamId: string, queries?: string[], search?: string, total?: boolean } | string, - ...rest: [(string[])?, (string)?, (boolean)?] + teamId: string, + queries?: string[], + search?: string, + total?: boolean, + ): Promise; + listMemberships( + paramsOrFirst: + | { + teamId: string; + queries?: string[]; + search?: string; + total?: boolean; + } + | string, + ...rest: [string[]?, string?, boolean?] ): Promise { - let params: { teamId: string, queries?: string[], search?: string, total?: boolean }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { teamId: string, queries?: string[], search?: string, total?: boolean }; + let params: { + teamId: string; + queries?: string[]; + search?: string; + total?: boolean; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + teamId: string; + queries?: string[]; + search?: string; + total?: boolean; + }; } else { params = { teamId: paramsOrFirst as string, queries: rest[0] as string[], search: rest[1] as string, - total: rest[2] as boolean + total: rest[2] as boolean, }; } @@ -349,7 +917,10 @@ export class Teams extends Service { throw new AppwriteException('Missing required parameter: "teamId"'); } - const apiPath = '/teams/{teamId}/memberships'.replace('{teamId}', encodeURIComponent(String(teamId))); + const apiPath = '/teams/{teamId}/memberships'.replace( + '{teamId}', + encodeURIComponent(String(teamId)), + ); const payload: Payload = {}; if (typeof queries !== 'undefined') { @@ -365,21 +936,26 @@ export class Teams extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } /** * Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team. - * + * * You only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters. - * - * Use the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. - * + * + * Use the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. + * * Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console. - * + * * * @param {string} params.teamId - Team ID. * @param {string[]} params.roles - Array of strings. Use this param to set the user roles in the team. 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. @@ -391,16 +967,24 @@ export class Teams extends Service { * @throws {AppwriteException} * @returns {Promise} */ - createMembership(params: { teamId: string, roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string }): Promise; + createMembership(params: { + teamId: string; + roles: string[]; + email?: string; + userId?: string; + phone?: string; + url?: string; + name?: string; + }): Promise; /** * Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team. - * + * * You only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters. - * - * Use the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. - * + * + * Use the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. + * * Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console. - * + * * * @param {string} teamId - Team ID. * @param {string[]} roles - Array of strings. Use this param to set the user roles in the team. 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. @@ -413,15 +997,53 @@ export class Teams extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createMembership(teamId: string, roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string): Promise; createMembership( - paramsOrFirst: { teamId: string, roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string } | string, - ...rest: [(string[])?, (string)?, (string)?, (string)?, (string)?, (string)?] + teamId: string, + roles: string[], + email?: string, + userId?: string, + phone?: string, + url?: string, + name?: string, + ): Promise; + createMembership( + paramsOrFirst: + | { + teamId: string; + roles: string[]; + email?: string; + userId?: string; + phone?: string; + url?: string; + name?: string; + } + | string, + ...rest: [string[]?, string?, string?, string?, string?, string?] ): Promise { - let params: { teamId: string, roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { teamId: string, roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string }; + let params: { + teamId: string; + roles: string[]; + email?: string; + userId?: string; + phone?: string; + url?: string; + name?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + teamId: string; + roles: string[]; + email?: string; + userId?: string; + phone?: string; + url?: string; + name?: string; + }; } else { params = { teamId: paramsOrFirst as string, @@ -430,7 +1052,7 @@ export class Teams extends Service { userId: rest[2] as string, phone: rest[3] as string, url: rest[4] as string, - name: rest[5] as string + name: rest[5] as string, }; } @@ -450,7 +1072,10 @@ export class Teams extends Service { throw new AppwriteException('Missing required parameter: "roles"'); } - const apiPath = '/teams/{teamId}/memberships'.replace('{teamId}', encodeURIComponent(String(teamId))); + const apiPath = '/teams/{teamId}/memberships'.replace( + '{teamId}', + encodeURIComponent(String(teamId)), + ); const payload: Payload = {}; if (typeof email !== 'undefined') { @@ -478,11 +1103,16 @@ export class Teams extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('post', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -493,7 +1123,10 @@ export class Teams extends Service { * @throws {AppwriteException} * @returns {Promise} */ - getMembership(params: { teamId: string, membershipId: string }): Promise; + getMembership(params: { + teamId: string; + membershipId: string; + }): Promise; /** * Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console. * @@ -503,19 +1136,29 @@ export class Teams extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getMembership(teamId: string, membershipId: string): Promise; getMembership( - paramsOrFirst: { teamId: string, membershipId: string } | string, - ...rest: [(string)?] + teamId: string, + membershipId: string, + ): Promise; + getMembership( + paramsOrFirst: { teamId: string; membershipId: string } | string, + ...rest: [string?] ): Promise { - let params: { teamId: string, membershipId: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { teamId: string, membershipId: string }; + let params: { teamId: string; membershipId: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + teamId: string; + membershipId: string; + }; } else { params = { teamId: paramsOrFirst as string, - membershipId: rest[0] as string + membershipId: rest[0] as string, }; } @@ -527,22 +1170,34 @@ export class Teams extends Service { } if (typeof membershipId === 'undefined') { - throw new AppwriteException('Missing required parameter: "membershipId"'); + throw new AppwriteException( + 'Missing required parameter: "membershipId"', + ); } - const apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', encodeURIComponent(String(teamId))).replace('{membershipId}', encodeURIComponent(String(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); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } /** * Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). - * + * * * @param {string} params.teamId - Team ID. * @param {string} params.membershipId - Membership ID. @@ -550,10 +1205,14 @@ export class Teams extends Service { * @throws {AppwriteException} * @returns {Promise} */ - updateMembership(params: { teamId: string, membershipId: string, roles: string[] }): Promise; + updateMembership(params: { + teamId: string; + membershipId: string; + roles: string[]; + }): Promise; /** * Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). - * + * * * @param {string} teamId - Team ID. * @param {string} membershipId - Membership ID. @@ -562,20 +1221,33 @@ export class Teams extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateMembership(teamId: string, membershipId: string, roles: string[]): Promise; updateMembership( - paramsOrFirst: { teamId: string, membershipId: string, roles: string[] } | string, - ...rest: [(string)?, (string[])?] + teamId: string, + membershipId: string, + roles: string[], + ): Promise; + updateMembership( + paramsOrFirst: + { teamId: string; membershipId: string; roles: string[] } | string, + ...rest: [string?, string[]?] ): Promise { - let params: { teamId: string, membershipId: string, roles: string[] }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { teamId: string, membershipId: string, roles: string[] }; + let params: { teamId: string; membershipId: string; roles: string[] }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + teamId: string; + membershipId: string; + roles: string[]; + }; } else { params = { teamId: paramsOrFirst as string, membershipId: rest[0] as string, - roles: rest[1] as string[] + roles: rest[1] as string[], }; } @@ -588,14 +1260,21 @@ export class Teams extends Service { } if (typeof membershipId === 'undefined') { - throw new AppwriteException('Missing required parameter: "membershipId"'); + throw new AppwriteException( + 'Missing required parameter: "membershipId"', + ); } if (typeof roles === 'undefined') { throw new AppwriteException('Missing required parameter: "roles"'); } - const apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', encodeURIComponent(String(teamId))).replace('{membershipId}', encodeURIComponent(String(membershipId))); + const apiPath = '/teams/{teamId}/memberships/{membershipId}' + .replace('{teamId}', encodeURIComponent(String(teamId))) + .replace( + '{membershipId}', + encodeURIComponent(String(membershipId)), + ); const payload: Payload = {}; if (typeof roles !== 'undefined') { @@ -603,11 +1282,16 @@ export class Teams extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('patch', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'patch', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -618,7 +1302,10 @@ export class Teams extends Service { * @throws {AppwriteException} * @returns {Promise} */ - deleteMembership(params: { teamId: string, membershipId: string }): Promise<{}>; + deleteMembership(params: { + teamId: string; + membershipId: string; + }): Promise<{}>; /** * This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted. * @@ -630,17 +1317,24 @@ export class Teams extends Service { */ deleteMembership(teamId: string, membershipId: string): Promise<{}>; deleteMembership( - paramsOrFirst: { teamId: string, membershipId: string } | string, - ...rest: [(string)?] + paramsOrFirst: { teamId: string; membershipId: string } | string, + ...rest: [string?] ): Promise<{}> { - let params: { teamId: string, membershipId: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { teamId: string, membershipId: string }; + let params: { teamId: string; membershipId: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + teamId: string; + membershipId: string; + }; } else { params = { teamId: paramsOrFirst as string, - membershipId: rest[0] as string + membershipId: rest[0] as string, }; } @@ -652,24 +1346,36 @@ export class Teams extends Service { } if (typeof membershipId === 'undefined') { - throw new AppwriteException('Missing required parameter: "membershipId"'); + throw new AppwriteException( + 'Missing required parameter: "membershipId"', + ); } - const apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', encodeURIComponent(String(teamId))).replace('{membershipId}', encodeURIComponent(String(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); - return this.client.call('delete', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - }, payload); + return this.client.call( + 'delete', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + }, + payload, + ); } /** * Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user. - * + * * If the request is successful, a session for the user is automatically created. - * + * * * @param {string} params.teamId - Team ID. * @param {string} params.membershipId - Membership ID. @@ -678,12 +1384,17 @@ export class Teams extends Service { * @throws {AppwriteException} * @returns {Promise} */ - updateMembershipStatus(params: { teamId: string, membershipId: string, userId: string, secret: string }): Promise; + updateMembershipStatus(params: { + teamId: string; + membershipId: string; + userId: string; + secret: string; + }): Promise; /** * Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user. - * + * * If the request is successful, a session for the user is automatically created. - * + * * * @param {string} teamId - Team ID. * @param {string} membershipId - Membership ID. @@ -693,21 +1404,47 @@ export class Teams extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updateMembershipStatus(teamId: string, membershipId: string, userId: string, secret: string): Promise; updateMembershipStatus( - paramsOrFirst: { teamId: string, membershipId: string, userId: string, secret: string } | string, - ...rest: [(string)?, (string)?, (string)?] + teamId: string, + membershipId: string, + userId: string, + secret: string, + ): Promise; + updateMembershipStatus( + paramsOrFirst: + | { + teamId: string; + membershipId: string; + userId: string; + secret: string; + } + | string, + ...rest: [string?, string?, string?] ): Promise { - let params: { teamId: string, membershipId: string, userId: string, secret: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { teamId: string, membershipId: string, userId: string, secret: string }; + let params: { + teamId: string; + membershipId: string; + userId: string; + secret: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + teamId: string; + membershipId: string; + userId: string; + secret: string; + }; } else { params = { teamId: paramsOrFirst as string, membershipId: rest[0] as string, userId: rest[1] as string, - secret: rest[2] as string + secret: rest[2] as string, }; } @@ -721,7 +1458,9 @@ export class Teams extends Service { } if (typeof membershipId === 'undefined') { - throw new AppwriteException('Missing required parameter: "membershipId"'); + throw new AppwriteException( + 'Missing required parameter: "membershipId"', + ); } if (typeof userId === 'undefined') { @@ -732,7 +1471,12 @@ export class Teams extends Service { throw new AppwriteException('Missing required parameter: "secret"'); } - const apiPath = '/teams/{teamId}/memberships/{membershipId}/status'.replace('{teamId}', encodeURIComponent(String(teamId))).replace('{membershipId}', encodeURIComponent(String(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') { @@ -744,11 +1488,16 @@ export class Teams extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('patch', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'patch', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } /** @@ -758,7 +1507,9 @@ export class Teams extends Service { * @throws {AppwriteException} * @returns {Promise} */ - getPrefs(params: { teamId: string }): Promise; + getPrefs< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >(params: { teamId: string }): Promise; /** * Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs). * @@ -767,17 +1518,23 @@ export class Teams extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - getPrefs(teamId: string): Promise; - getPrefs( - paramsOrFirst: { teamId: string } | string - ): Promise { + getPrefs< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >(teamId: string): Promise; + getPrefs< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >(paramsOrFirst: { teamId: string } | string): Promise { let params: { teamId: string }; - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { params = (paramsOrFirst || {}) as { teamId: string }; } else { params = { - teamId: paramsOrFirst as string + teamId: paramsOrFirst as string, }; } @@ -787,14 +1544,22 @@ export class Teams extends Service { throw new AppwriteException('Missing required parameter: "teamId"'); } - const apiPath = '/teams/{teamId}/prefs'.replace('{teamId}', encodeURIComponent(String(teamId))); + const apiPath = '/teams/{teamId}/prefs'.replace( + '{teamId}', + encodeURIComponent(String(teamId)), + ); const payload: Payload = {}; const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); } /** @@ -805,7 +1570,9 @@ export class Teams extends Service { * @throws {AppwriteException} * @returns {Promise} */ - updatePrefs(params: { teamId: string, prefs: object }): Promise; + updatePrefs< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >(params: { teamId: string; prefs: object }): Promise; /** * Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded. * @@ -815,19 +1582,27 @@ export class Teams extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - updatePrefs(teamId: string, prefs: object): Promise; - updatePrefs( - paramsOrFirst: { teamId: string, prefs: object } | string, - ...rest: [(object)?] + updatePrefs< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >(teamId: string, prefs: object): Promise; + updatePrefs< + Preferences extends Models.Preferences = Models.DefaultPreferences, + >( + paramsOrFirst: { teamId: string; prefs: object } | string, + ...rest: [object?] ): Promise { - let params: { teamId: string, prefs: object }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { teamId: string, prefs: object }; + let params: { teamId: string; prefs: object }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { teamId: string; prefs: object }; } else { params = { teamId: paramsOrFirst as string, - prefs: rest[0] as object + prefs: rest[0] as object, }; } @@ -842,7 +1617,10 @@ export class Teams extends Service { throw new AppwriteException('Missing required parameter: "prefs"'); } - const apiPath = '/teams/{teamId}/prefs'.replace('{teamId}', encodeURIComponent(String(teamId))); + const apiPath = '/teams/{teamId}/prefs'.replace( + '{teamId}', + encodeURIComponent(String(teamId)), + ); const payload: Payload = {}; if (typeof prefs !== 'undefined') { @@ -850,10 +1628,15 @@ export class Teams extends Service { } const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('put', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); + return this.client.call( + 'put', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); } -}; +} diff --git a/src/services/vectors-db.ts b/src/services/vectors-db.ts new file mode 100644 index 00000000..3e6787ca --- /dev/null +++ b/src/services/vectors-db.ts @@ -0,0 +1,1517 @@ +import { Service } from '../service'; +import { AppwriteException, Client } from '../client'; +import type { Models } from '../models'; +import type { Payload } from '../client'; + +export class VectorsDB extends Service { + constructor(client: Client) { + super(client); + } + + /** + * List transactions across all 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} + */ + listTransactions(params?: { + queries?: string[]; + }): Promise; + /** + * List transactions across all databases. + * + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listTransactions(queries?: string[]): Promise; + listTransactions( + paramsOrFirst?: { queries?: string[] } | string[], + ): Promise { + let params: { queries?: string[] }; + + if ( + !paramsOrFirst || + (paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst)) + ) { + params = (paramsOrFirst || {}) as { queries?: string[] }; + } else { + params = { + queries: paramsOrFirst as string[], + }; + } + + const queries = params.queries; + + const apiPath = '/vectorsdb/transactions'; + const payload: Payload = {}; + + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); + } + + /** + * Create a new transaction. + * + * @param {number} params.ttl - Seconds before the transaction expires. + * @throws {AppwriteException} + * @returns {Promise} + */ + createTransaction(params?: { ttl?: number }): Promise; + /** + * Create a new transaction. + * + * @param {number} ttl - Seconds before the transaction expires. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createTransaction(ttl?: number): Promise; + createTransaction( + paramsOrFirst?: { ttl?: number } | number, + ): Promise { + let params: { ttl?: number }; + + if ( + !paramsOrFirst || + (paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst)) + ) { + params = (paramsOrFirst || {}) as { ttl?: number }; + } else { + params = { + ttl: paramsOrFirst as number, + }; + } + + const ttl = params.ttl; + + const apiPath = '/vectorsdb/transactions'; + const payload: Payload = {}; + + if (typeof ttl !== 'undefined') { + payload['ttl'] = ttl; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); + } + + /** + * Get a transaction by its unique ID. + * + * @param {string} params.transactionId - Transaction ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + getTransaction(params: { + transactionId: string; + }): Promise; + /** + * Get a transaction by its unique ID. + * + * @param {string} transactionId - Transaction ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getTransaction(transactionId: string): Promise; + getTransaction( + paramsOrFirst: { transactionId: string } | string, + ): Promise { + let params: { transactionId: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { transactionId: string }; + } else { + params = { + transactionId: paramsOrFirst as string, + }; + } + + const transactionId = params.transactionId; + + if (typeof transactionId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "transactionId"', + ); + } + + const apiPath = '/vectorsdb/transactions/{transactionId}'.replace( + '{transactionId}', + encodeURIComponent(String(transactionId)), + ); + const payload: Payload = {}; + + const uri = new URL(this.client.config.endpoint + apiPath); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); + } + + /** + * Update a transaction, to either commit or roll back its operations. + * + * @param {string} params.transactionId - Transaction ID. + * @param {boolean} params.commit - Commit transaction? + * @param {boolean} params.rollback - Rollback transaction? + * @throws {AppwriteException} + * @returns {Promise} + */ + updateTransaction(params: { + transactionId: string; + commit?: boolean; + rollback?: boolean; + }): Promise; + /** + * Update a transaction, to either commit or roll back its operations. + * + * @param {string} transactionId - Transaction ID. + * @param {boolean} commit - Commit transaction? + * @param {boolean} rollback - Rollback transaction? + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateTransaction( + transactionId: string, + commit?: boolean, + rollback?: boolean, + ): Promise; + updateTransaction( + paramsOrFirst: + | { transactionId: string; commit?: boolean; rollback?: boolean } + | string, + ...rest: [boolean?, boolean?] + ): Promise { + let params: { + transactionId: string; + commit?: boolean; + rollback?: boolean; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + transactionId: string; + commit?: boolean; + rollback?: boolean; + }; + } else { + params = { + transactionId: paramsOrFirst as string, + commit: rest[0] as boolean, + rollback: rest[1] as boolean, + }; + } + + const transactionId = params.transactionId; + const commit = params.commit; + const rollback = params.rollback; + + if (typeof transactionId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "transactionId"', + ); + } + + const apiPath = '/vectorsdb/transactions/{transactionId}'.replace( + '{transactionId}', + encodeURIComponent(String(transactionId)), + ); + const payload: Payload = {}; + + if (typeof commit !== 'undefined') { + payload['commit'] = commit; + } + + if (typeof rollback !== 'undefined') { + payload['rollback'] = rollback; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return this.client.call( + 'patch', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); + } + + /** + * Delete a transaction by its unique ID. + * + * @param {string} params.transactionId - Transaction ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + deleteTransaction(params: { transactionId: string }): Promise<{}>; + /** + * Delete a transaction by its unique ID. + * + * @param {string} transactionId - Transaction ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deleteTransaction(transactionId: string): Promise<{}>; + deleteTransaction( + paramsOrFirst: { transactionId: string } | string, + ): Promise<{}> { + let params: { transactionId: string }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { transactionId: string }; + } else { + params = { + transactionId: paramsOrFirst as string, + }; + } + + const transactionId = params.transactionId; + + if (typeof transactionId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "transactionId"', + ); + } + + const apiPath = '/vectorsdb/transactions/{transactionId}'.replace( + '{transactionId}', + encodeURIComponent(String(transactionId)), + ); + const payload: Payload = {}; + + const uri = new URL(this.client.config.endpoint + apiPath); + return this.client.call( + 'delete', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + }, + payload, + ); + } + + /** + * Create multiple operations in a single transaction. + * + * @param {string} params.transactionId - Transaction ID. + * @param {object[]} params.operations - Array of staged operations. + * @throws {AppwriteException} + * @returns {Promise} + */ + createOperations(params: { + transactionId: string; + operations?: object[]; + }): Promise; + /** + * Create multiple operations in a single transaction. + * + * @param {string} transactionId - Transaction ID. + * @param {object[]} operations - Array of staged operations. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createOperations( + transactionId: string, + operations?: object[], + ): Promise; + createOperations( + paramsOrFirst: + { transactionId: string; operations?: object[] } | string, + ...rest: [object[]?] + ): Promise { + let params: { transactionId: string; operations?: object[] }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + transactionId: string; + operations?: object[]; + }; + } else { + params = { + transactionId: paramsOrFirst as string, + operations: rest[0] as object[], + }; + } + + const transactionId = params.transactionId; + const operations = params.operations; + + if (typeof transactionId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "transactionId"', + ); + } + + const apiPath = + '/vectorsdb/transactions/{transactionId}/operations'.replace( + '{transactionId}', + encodeURIComponent(String(transactionId)), + ); + const payload: Payload = {}; + + if (typeof operations !== 'undefined') { + payload['operations'] = operations; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); + } + + /** + * Get a list of all the user's documents in a given collection. You can use the query params to filter your results. + * + * @param {string} params.databaseId - Database ID. + * @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.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 524288 characters long. + * @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction. + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. + * @param {number} params.ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). + * @throws {AppwriteException} + * @returns {Promise} + */ + listDocuments< + Document extends Models.Document = Models.DefaultDocument, + >(params: { + databaseId: string; + collectionId: string; + queries?: string[]; + transactionId?: string; + total?: boolean; + ttl?: number; + }): Promise>; + /** + * Get a list of all the user's documents in a given collection. You can use the query params to filter your results. + * + * @param {string} databaseId - Database ID. + * @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[]} 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 524288 characters long. + * @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction. + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. + * @param {number} ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). + * @throws {AppwriteException} + * @returns {Promise>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listDocuments( + databaseId: string, + collectionId: string, + queries?: string[], + transactionId?: string, + total?: boolean, + ttl?: number, + ): Promise>; + listDocuments( + paramsOrFirst: + | { + databaseId: string; + collectionId: string; + queries?: string[]; + transactionId?: string; + total?: boolean; + ttl?: number; + } + | string, + ...rest: [string?, string[]?, string?, boolean?, number?] + ): Promise> { + let params: { + databaseId: string; + collectionId: string; + queries?: string[]; + transactionId?: string; + total?: boolean; + ttl?: number; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + collectionId: string; + queries?: string[]; + transactionId?: string; + total?: boolean; + ttl?: number; + }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + queries: rest[1] as string[], + transactionId: rest[2] as string, + total: rest[3] as boolean, + ttl: rest[4] as number, + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const queries = params.queries; + const transactionId = params.transactionId; + const total = params.total; + const ttl = params.ttl; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); + } + + if (typeof collectionId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "collectionId"', + ); + } + + const apiPath = + '/vectorsdb/{databaseId}/collections/{collectionId}/documents' + .replace('{databaseId}', encodeURIComponent(String(databaseId))) + .replace( + '{collectionId}', + encodeURIComponent(String(collectionId)), + ); + const payload: Payload = {}; + + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + + if (typeof transactionId !== 'undefined') { + payload['transactionId'] = transactionId; + } + + if (typeof total !== 'undefined') { + payload['total'] = total; + } + + if (typeof ttl !== 'undefined') { + payload['ttl'] = ttl; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); + } + + /** + * Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. + * + * @param {string} params.databaseId - Database ID. + * @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). Make sure to define attributes before creating documents. + * @param {string} params.documentId - Document 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 {Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit} params.data - Document data as JSON object. + * @param {string[]} params.permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string} params.transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise} + */ + createDocument< + Document extends Models.Document = Models.DefaultDocument, + >(params: { + databaseId: string; + collectionId: string; + documentId: string; + data: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & Omit; + permissions?: string[]; + transactionId?: string; + }): Promise; + /** + * Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. + * @param {string} documentId - Document 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 {Document extends Models.DefaultDocument ? Partial & Record : Partial & Omit} data - Document data as JSON object. + * @param {string[]} permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string} transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createDocument( + databaseId: string, + collectionId: string, + documentId: string, + data: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & Omit, + permissions?: string[], + transactionId?: string, + ): Promise; + createDocument( + paramsOrFirst: + | { + databaseId: string; + collectionId: string; + documentId: string; + data: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Omit; + permissions?: string[]; + transactionId?: string; + } + | string, + ...rest: [ + string?, + string?, + (Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Omit)?, + string[]?, + string?, + ] + ): Promise { + let params: { + databaseId: string; + collectionId: string; + documentId: string; + data: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Omit; + permissions?: string[]; + transactionId?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + collectionId: string; + documentId: string; + data: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Omit; + permissions?: string[]; + transactionId?: string; + }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + documentId: rest[1] as string, + data: rest[2] as Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Omit, + permissions: rest[3] as string[], + transactionId: rest[4] as string, + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const documentId = params.documentId; + const data = params.data; + const permissions = params.permissions; + const transactionId = params.transactionId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); + } + + if (typeof collectionId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "collectionId"', + ); + } + + if (typeof documentId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "documentId"', + ); + } + + if (typeof data === 'undefined') { + throw new AppwriteException('Missing required parameter: "data"'); + } + + const apiPath = + '/vectorsdb/{databaseId}/collections/{collectionId}/documents' + .replace('{databaseId}', encodeURIComponent(String(databaseId))) + .replace( + '{collectionId}', + encodeURIComponent(String(collectionId)), + ); + const payload: Payload = {}; + + if (typeof documentId !== 'undefined') { + payload['documentId'] = documentId; + } + + if (typeof data !== 'undefined') { + payload['data'] = data; + } + + if (typeof permissions !== 'undefined') { + payload['permissions'] = permissions; + } + + if (typeof transactionId !== 'undefined') { + payload['transactionId'] = transactionId; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); + } + + /** + * Get a list of all the user's documents in a given collection using a POST request. This behaves identically to the list documents endpoint but accepts the queries in the request body, allowing much larger `queries` arrays than can fit in a URL query string. + * + * + * @param {string} params.databaseId - Database ID. + * @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.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 524288 characters long. + * @param {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction. + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. + * @param {number} params.ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). + * @throws {AppwriteException} + * @returns {Promise} + */ + createQuery< + Document extends Models.Document = Models.DefaultDocument, + >(params: { + databaseId: string; + collectionId: string; + queries?: string[]; + transactionId?: string; + total?: boolean; + ttl?: number; + }): Promise>; + /** + * Get a list of all the user's documents in a given collection using a POST request. This behaves identically to the list documents endpoint but accepts the queries in the request body, allowing much larger `queries` arrays than can fit in a URL query string. + * + * + * @param {string} databaseId - Database ID. + * @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[]} 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 524288 characters long. + * @param {string} transactionId - Transaction ID to read uncommitted changes within the transaction. + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. + * @param {number} ttl - TTL (seconds) for cached responses when caching is enabled for select queries. Must be between 0 and 86400 (24 hours). + * @throws {AppwriteException} + * @returns {Promise>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createQuery( + databaseId: string, + collectionId: string, + queries?: string[], + transactionId?: string, + total?: boolean, + ttl?: number, + ): Promise>; + createQuery( + paramsOrFirst: + | { + databaseId: string; + collectionId: string; + queries?: string[]; + transactionId?: string; + total?: boolean; + ttl?: number; + } + | string, + ...rest: [string?, string[]?, string?, boolean?, number?] + ): Promise> { + let params: { + databaseId: string; + collectionId: string; + queries?: string[]; + transactionId?: string; + total?: boolean; + ttl?: number; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + collectionId: string; + queries?: string[]; + transactionId?: string; + total?: boolean; + ttl?: number; + }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + queries: rest[1] as string[], + transactionId: rest[2] as string, + total: rest[3] as boolean, + ttl: rest[4] as number, + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const queries = params.queries; + const transactionId = params.transactionId; + const total = params.total; + const ttl = params.ttl; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); + } + + if (typeof collectionId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "collectionId"', + ); + } + + const apiPath = + '/vectorsdb/{databaseId}/collections/{collectionId}/documents/query' + .replace('{databaseId}', encodeURIComponent(String(databaseId))) + .replace( + '{collectionId}', + encodeURIComponent(String(collectionId)), + ); + const payload: Payload = {}; + + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + + if (typeof transactionId !== 'undefined') { + payload['transactionId'] = transactionId; + } + + if (typeof total !== 'undefined') { + payload['total'] = total; + } + + if (typeof ttl !== 'undefined') { + payload['ttl'] = ttl; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return this.client.call( + 'post', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); + } + + /** + * Get a document by its unique ID. This endpoint response returns a JSON object with the document data. + * + * @param {string} params.databaseId - Database ID. + * @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.documentId - Document 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 {string} params.transactionId - Transaction ID to read uncommitted changes within the transaction. + * @throws {AppwriteException} + * @returns {Promise} + */ + getDocument< + Document extends Models.Document = Models.DefaultDocument, + >(params: { + databaseId: string; + collectionId: string; + documentId: string; + queries?: string[]; + transactionId?: string; + }): Promise; + /** + * Get a document by its unique ID. This endpoint response returns a JSON object with the document data. + * + * @param {string} databaseId - Database ID. + * @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} documentId - Document 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 {string} transactionId - Transaction ID to read uncommitted changes within the transaction. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getDocument( + databaseId: string, + collectionId: string, + documentId: string, + queries?: string[], + transactionId?: string, + ): Promise; + getDocument( + paramsOrFirst: + | { + databaseId: string; + collectionId: string; + documentId: string; + queries?: string[]; + transactionId?: string; + } + | string, + ...rest: [string?, string?, string[]?, string?] + ): Promise { + let params: { + databaseId: string; + collectionId: string; + documentId: string; + queries?: string[]; + transactionId?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + collectionId: string; + documentId: string; + queries?: string[]; + transactionId?: string; + }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + documentId: rest[1] as string, + queries: rest[2] as string[], + transactionId: rest[3] as string, + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const documentId = params.documentId; + const queries = params.queries; + const transactionId = params.transactionId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); + } + + if (typeof collectionId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "collectionId"', + ); + } + + if (typeof documentId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "documentId"', + ); + } + + const apiPath = + '/vectorsdb/{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; + } + + if (typeof transactionId !== 'undefined') { + payload['transactionId'] = transactionId; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return this.client.call( + 'get', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + accept: 'application/json', + }, + payload, + ); + } + + /** + * Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. + * @param {string} params.documentId - Document ID. + * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>} params.data - Document data as JSON object. Include all required fields of the document to be created or updated. + * @param {string[]} params.permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string} params.transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise} + */ + upsertDocument< + Document extends Models.Document = Models.DefaultDocument, + >(params: { + databaseId: string; + collectionId: string; + documentId: string; + data?: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>; + permissions?: string[]; + transactionId?: string; + }): Promise; + /** + * Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console. + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. + * @param {string} documentId - Document ID. + * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>} data - Document data as JSON object. Include all required fields of the document to be created or updated. + * @param {string[]} permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string} transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + upsertDocument( + databaseId: string, + collectionId: string, + documentId: string, + data?: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>, + permissions?: string[], + transactionId?: string, + ): Promise; + upsertDocument( + paramsOrFirst: + | { + databaseId: string; + collectionId: string; + documentId: string; + data?: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>; + permissions?: string[]; + transactionId?: string; + } + | string, + ...rest: [ + string?, + string?, + (Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>)?, + string[]?, + string?, + ] + ): Promise { + let params: { + databaseId: string; + collectionId: string; + documentId: string; + data?: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>; + permissions?: string[]; + transactionId?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + collectionId: string; + documentId: string; + data?: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>; + permissions?: string[]; + transactionId?: string; + }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + documentId: rest[1] as string, + data: rest[2] as Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>, + permissions: rest[3] as string[], + transactionId: rest[4] as string, + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const documentId = params.documentId; + const data = params.data; + const permissions = params.permissions; + const transactionId = params.transactionId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); + } + + if (typeof collectionId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "collectionId"', + ); + } + + if (typeof documentId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "documentId"', + ); + } + + const apiPath = + '/vectorsdb/{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; + } + + if (typeof permissions !== 'undefined') { + payload['permissions'] = permissions; + } + + if (typeof transactionId !== 'undefined') { + payload['transactionId'] = transactionId; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return this.client.call( + 'put', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); + } + + /** + * Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated. + * + * @param {string} params.databaseId - Database ID. + * @param {string} params.collectionId - Collection ID. + * @param {string} params.documentId - Document ID. + * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>} params.data - Document data as JSON object. Include only fields and value pairs to be updated. + * @param {string[]} params.permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string} params.transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateDocument< + Document extends Models.Document = Models.DefaultDocument, + >(params: { + databaseId: string; + collectionId: string; + documentId: string; + data?: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>; + permissions?: string[]; + transactionId?: string; + }): Promise; + /** + * Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated. + * + * @param {string} databaseId - Database ID. + * @param {string} collectionId - Collection ID. + * @param {string} documentId - Document ID. + * @param {Document extends Models.DefaultDocument ? Partial & Record : Partial & Partial>} data - Document data as JSON object. Include only fields and value pairs to be updated. + * @param {string[]} permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). + * @param {string} transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateDocument( + databaseId: string, + collectionId: string, + documentId: string, + data?: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>, + permissions?: string[], + transactionId?: string, + ): Promise; + updateDocument( + paramsOrFirst: + | { + databaseId: string; + collectionId: string; + documentId: string; + data?: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>; + permissions?: string[]; + transactionId?: string; + } + | string, + ...rest: [ + string?, + string?, + (Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>)?, + string[]?, + string?, + ] + ): Promise { + let params: { + databaseId: string; + collectionId: string; + documentId: string; + data?: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>; + permissions?: string[]; + transactionId?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + collectionId: string; + documentId: string; + data?: Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>; + permissions?: string[]; + transactionId?: string; + }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + documentId: rest[1] as string, + data: rest[2] as Document extends Models.DefaultDocument + ? Partial & Record + : Partial & + Partial>, + permissions: rest[3] as string[], + transactionId: rest[4] as string, + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const documentId = params.documentId; + const data = params.data; + const permissions = params.permissions; + const transactionId = params.transactionId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); + } + + if (typeof collectionId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "collectionId"', + ); + } + + if (typeof documentId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "documentId"', + ); + } + + const apiPath = + '/vectorsdb/{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; + } + + if (typeof permissions !== 'undefined') { + payload['permissions'] = permissions; + } + + if (typeof transactionId !== 'undefined') { + payload['transactionId'] = transactionId; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return this.client.call( + 'patch', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + accept: 'application/json', + }, + payload, + ); + } + + /** + * Delete a document by its unique ID. + * + * @param {string} params.databaseId - Database ID. + * @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.documentId - Document ID. + * @param {string} params.transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise} + */ + deleteDocument(params: { + databaseId: string; + collectionId: string; + documentId: string; + transactionId?: string; + }): Promise<{}>; + /** + * Delete a document by its unique ID. + * + * @param {string} databaseId - Database ID. + * @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} documentId - Document ID. + * @param {string} transactionId - Transaction ID for staging the operation. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deleteDocument( + databaseId: string, + collectionId: string, + documentId: string, + transactionId?: string, + ): Promise<{}>; + deleteDocument( + paramsOrFirst: + | { + databaseId: string; + collectionId: string; + documentId: string; + transactionId?: string; + } + | string, + ...rest: [string?, string?, string?] + ): Promise<{}> { + let params: { + databaseId: string; + collectionId: string; + documentId: string; + transactionId?: string; + }; + + if ( + paramsOrFirst && + typeof paramsOrFirst === 'object' && + !Array.isArray(paramsOrFirst) + ) { + params = (paramsOrFirst || {}) as { + databaseId: string; + collectionId: string; + documentId: string; + transactionId?: string; + }; + } else { + params = { + databaseId: paramsOrFirst as string, + collectionId: rest[0] as string, + documentId: rest[1] as string, + transactionId: rest[2] as string, + }; + } + + const databaseId = params.databaseId; + const collectionId = params.collectionId; + const documentId = params.documentId; + const transactionId = params.transactionId; + + if (typeof databaseId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "databaseId"', + ); + } + + if (typeof collectionId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "collectionId"', + ); + } + + if (typeof documentId === 'undefined') { + throw new AppwriteException( + 'Missing required parameter: "documentId"', + ); + } + + const apiPath = + '/vectorsdb/{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; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return this.client.call( + 'delete', + uri, + { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + }, + payload, + ); + } +} diff --git a/tsconfig.json b/tsconfig.json index 8a27d1f0..c7292aa8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,9 +16,9 @@ "skipLibCheck": true, "strict": true, "target": "ES6", - "traceResolution": false, + "traceResolution": false }, "compileOnSave": false, "exclude": ["node_modules", "dist"], "include": ["src"] -} \ No newline at end of file +} From 39d456d39415b741dbc7ec5f2c7692fc3f74527b Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 7 Sep 2026 17:15:24 +0100 Subject: [PATCH 4/5] docs: state the SDK targets Appwrite server version 2.0.x --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1d70247c..eb49fe83 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) -**This SDK targets Appwrite server version 1.9.x as shipped on Appwrite Cloud.** Self-hosted releases can lag behind Cloud — if you run an older self-hosted build, use a matching older SDK from [previous releases](https://github.com/appwrite/sdk-for-react-native/releases) when APIs differ. +**This SDK targets Appwrite server version 2.0.x as shipped on Appwrite Cloud.** Self-hosted releases can lag behind Cloud — if you run an older self-hosted build, use a matching older SDK from [previous releases](https://github.com/appwrite/sdk-for-react-native/releases) when APIs differ. Appwrite is an open-source backend as a service server that abstracts and simplifies complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the React Native SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs) From 4ae0583b269bec4da01dd5d8f3a9ad414a7e41c9 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 7 Sep 2026 18:21:19 +0100 Subject: [PATCH 5/5] fix: regenerate with the latest sdk-generator and add auto image gravity --- CHANGELOG.md | 2 ++ docs/examples/storage/get-file-preview.md | 2 +- src/enums/image-gravity.ts | 1 + src/services/account.ts | 8 ++++---- src/services/avatars.ts | 4 ++-- src/services/databases.ts | 4 ++-- src/services/documents-db.ts | 4 ++-- src/services/organization.ts | 2 +- src/services/presences.ts | 2 +- src/services/storage.ts | 4 ++-- src/services/tables-db.ts | 4 ++-- src/services/teams.ts | 2 +- src/services/vectors-db.ts | 4 ++-- 13 files changed, 23 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f5aa7b51..bc76cf00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,9 @@ * Added: `AppInstallation`, `Oauth2Consent`, `Oauth2ConsentToken` models and list types * Added: `Custom` value to `AuthenticationFactor` and `custom` field on `MfaFactors` * Added: `Cloudflare`, `Huggingface`, `Resend` values to `OAuthProvider` +* Added: `Auto` value to `ImageGravity` enum * Updated: source formatted with Prettier and linted with ESLint +* Fixed: positional calls with an `undefined` leading argument and trailing arguments dispatch correctly ## 0.34.0 diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index 5be0eea8..eabdc1f2 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -17,7 +17,7 @@ const result = storage.getFilePreview({ fileId: '', width: 0, // optional height: 0, // optional - gravity: ImageGravity.Center, // optional + gravity: ImageGravity.Auto, // optional quality: -1, // optional borderWidth: 0, // optional borderColor: 'FFFFFF', // optional diff --git a/src/enums/image-gravity.ts b/src/enums/image-gravity.ts index dcaa9f61..73ed1525 100644 --- a/src/enums/image-gravity.ts +++ b/src/enums/image-gravity.ts @@ -1,4 +1,5 @@ export enum ImageGravity { + Auto = 'auto', Center = 'center', TopLeft = 'top-left', Top = 'top', diff --git a/src/services/account.ts b/src/services/account.ts index f0dd7728..05638413 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -186,7 +186,7 @@ export class Account extends Service { let params: { queries?: string[]; total?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -716,7 +716,7 @@ export class Account extends Service { let params: { queries?: string[]; total?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -841,7 +841,7 @@ export class Account extends Service { let params: { duration?: number }; if ( - !paramsOrFirst || + typeof paramsOrFirst === 'undefined' || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -904,7 +904,7 @@ export class Account extends Service { let params: { queries?: string[]; total?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) diff --git a/src/services/avatars.ts b/src/services/avatars.ts index ebe61501..963be5d2 100644 --- a/src/services/avatars.ts +++ b/src/services/avatars.ts @@ -627,7 +627,7 @@ export class Avatars extends Service { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -771,7 +771,7 @@ export class Avatars extends Service { }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) diff --git a/src/services/databases.ts b/src/services/databases.ts index 14fd20ce..e896cd75 100644 --- a/src/services/databases.ts +++ b/src/services/databases.ts @@ -34,7 +34,7 @@ export class Databases extends Service { let params: { queries?: string[] }; if ( - !paramsOrFirst || + typeof paramsOrFirst === 'undefined' || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -91,7 +91,7 @@ export class Databases extends Service { let params: { ttl?: number }; if ( - !paramsOrFirst || + typeof paramsOrFirst === 'undefined' || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) diff --git a/src/services/documents-db.ts b/src/services/documents-db.ts index 255d82ad..ee4ac71d 100644 --- a/src/services/documents-db.ts +++ b/src/services/documents-db.ts @@ -33,7 +33,7 @@ export class DocumentsDB extends Service { let params: { queries?: string[] }; if ( - !paramsOrFirst || + typeof paramsOrFirst === 'undefined' || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -89,7 +89,7 @@ export class DocumentsDB extends Service { let params: { ttl?: number }; if ( - !paramsOrFirst || + typeof paramsOrFirst === 'undefined' || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) diff --git a/src/services/organization.ts b/src/services/organization.ts index eba03e0d..2705527e 100644 --- a/src/services/organization.ts +++ b/src/services/organization.ts @@ -40,7 +40,7 @@ export class Organization extends Service { let params: { queries?: string[]; total?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) diff --git a/src/services/presences.ts b/src/services/presences.ts index a14b6843..e4a00e67 100644 --- a/src/services/presences.ts +++ b/src/services/presences.ts @@ -47,7 +47,7 @@ export class Presences extends Service { let params: { queries?: string[]; total?: boolean; ttl?: number }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) diff --git a/src/services/storage.ts b/src/services/storage.ts index 5ff4c5b6..94101755 100644 --- a/src/services/storage.ts +++ b/src/services/storage.ts @@ -858,7 +858,7 @@ export class Storage extends Service { * @param {string} params.fileId - File ID * @param {number} params.width - Resize preview image width, Pass an integer between 0 to 4000. * @param {number} params.height - Resize preview image height, Pass an integer between 0 to 4000. - * @param {ImageGravity} params.gravity - Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right + * @param {ImageGravity} params.gravity - Image crop gravity. Can be one of auto,center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right * @param {number} params.quality - Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. * @param {number} params.borderWidth - Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0. * @param {string} params.borderColor - Preview image border color. Use a valid HEX color, no # is needed for prefix. @@ -894,7 +894,7 @@ export class Storage extends Service { * @param {string} fileId - File ID * @param {number} width - Resize preview image width, Pass an integer between 0 to 4000. * @param {number} height - Resize preview image height, Pass an integer between 0 to 4000. - * @param {ImageGravity} gravity - Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right + * @param {ImageGravity} gravity - Image crop gravity. Can be one of auto,center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right * @param {number} quality - Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. * @param {number} borderWidth - Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0. * @param {string} borderColor - Preview image border color. Use a valid HEX color, no # is needed for prefix. diff --git a/src/services/tables-db.ts b/src/services/tables-db.ts index 74256f5c..9bae5f80 100644 --- a/src/services/tables-db.ts +++ b/src/services/tables-db.ts @@ -33,7 +33,7 @@ export class TablesDB extends Service { let params: { queries?: string[] }; if ( - !paramsOrFirst || + typeof paramsOrFirst === 'undefined' || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -89,7 +89,7 @@ export class TablesDB extends Service { let params: { ttl?: number }; if ( - !paramsOrFirst || + typeof paramsOrFirst === 'undefined' || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) diff --git a/src/services/teams.ts b/src/services/teams.ts index 285f6146..22e50b24 100644 --- a/src/services/teams.ts +++ b/src/services/teams.ts @@ -47,7 +47,7 @@ export class Teams extends Service { let params: { queries?: string[]; search?: string; total?: boolean }; if ( - !paramsOrFirst || + (typeof paramsOrFirst === 'undefined' && rest.length === 0) || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) diff --git a/src/services/vectors-db.ts b/src/services/vectors-db.ts index 3e6787ca..c7feefe8 100644 --- a/src/services/vectors-db.ts +++ b/src/services/vectors-db.ts @@ -33,7 +33,7 @@ export class VectorsDB extends Service { let params: { queries?: string[] }; if ( - !paramsOrFirst || + typeof paramsOrFirst === 'undefined' || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst)) @@ -89,7 +89,7 @@ export class VectorsDB extends Service { let params: { ttl?: number }; if ( - !paramsOrFirst || + typeof paramsOrFirst === 'undefined' || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))