From 68dcf3b97096655e4c9db68dcf81c40bec3eb208 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 8 Jun 2026 11:21:12 +0530 Subject: [PATCH 1/5] chore: update React Native SDK to 0.32.0 --- CHANGELOG.md | 10 + docs/examples/account/update-password.md | 2 +- docs/examples/apps/create-secret.md | 15 + docs/examples/apps/create.md | 21 + docs/examples/apps/delete-secret.md | 16 + docs/examples/apps/delete-tokens.md | 15 + docs/examples/apps/delete.md | 15 + docs/examples/apps/get-secret.md | 16 + docs/examples/apps/get.md | 15 + docs/examples/apps/list-secrets.md | 17 + docs/examples/apps/list.md | 16 + docs/examples/apps/update-team.md | 16 + docs/examples/apps/update.md | 20 + docs/examples/avatars/get-screenshot.md | 6 +- docs/examples/oauth2/approve.md | 17 + docs/examples/oauth2/authorize.md | 26 + docs/examples/oauth2/create-grant.md | 16 + docs/examples/oauth2/get-grant.md | 16 + docs/examples/oauth2/reject.md | 16 + package-lock.json | 1029 ++++++++++------------ package.json | 10 +- src/client.ts | 16 +- src/enums/{theme.ts => browser-theme.ts} | 2 +- src/index.ts | 4 +- src/models.ts | 281 +++++- src/services/account.ts | 110 ++- src/services/apps.ts | 691 +++++++++++++++ src/services/avatars.ts | 40 +- src/services/databases.ts | 26 + src/services/functions.ts | 6 + src/services/graphql.ts | 4 + src/services/locale.ts | 16 + src/services/messaging.ts | 3 + src/services/oauth-2.ts | 409 +++++++++ src/services/presences.ts | 49 +- src/services/realtime.ts | 12 +- src/services/storage.ts | 150 +++- src/services/tables-db.ts | 26 + src/services/teams.ts | 24 + 39 files changed, 2558 insertions(+), 641 deletions(-) create mode 100644 docs/examples/apps/create-secret.md create mode 100644 docs/examples/apps/create.md create mode 100644 docs/examples/apps/delete-secret.md create mode 100644 docs/examples/apps/delete-tokens.md create mode 100644 docs/examples/apps/delete.md create mode 100644 docs/examples/apps/get-secret.md create mode 100644 docs/examples/apps/get.md create mode 100644 docs/examples/apps/list-secrets.md create mode 100644 docs/examples/apps/list.md create mode 100644 docs/examples/apps/update-team.md create mode 100644 docs/examples/apps/update.md create mode 100644 docs/examples/oauth2/approve.md create mode 100644 docs/examples/oauth2/authorize.md create mode 100644 docs/examples/oauth2/create-grant.md create mode 100644 docs/examples/oauth2/get-grant.md create mode 100644 docs/examples/oauth2/reject.md rename src/enums/{theme.ts => browser-theme.ts} (60%) create mode 100644 src/services/apps.ts create mode 100644 src/services/oauth-2.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b38d347..ba0bfb33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Change log +## 0.32.0 + +* Breaking: Renamed `Theme` enum to `BrowserTheme`. +* Breaking: Removed `Models.DefaultPresence` and dropped the `Presence` generic from `presences` methods. +* Added: `apps` service with app and secret management methods. +* Added: `oauth2` service with `authorize`, `approve`, `reject`, `createGrant`, and `getGrant`. +* Added: `App`, `AppSecret`, `AppSecretPlaintext`, `AppsList`, and `AppSecretList` models. +* Added: `Oauth2Authorize`, `Oauth2Approve`, `Oauth2Reject`, and `Oauth2Grant` models. +* Added: Email metadata fields to `User`, plus `Membership.userAccessedAt` and `Presence.metadata`. + ## 0.30.1 * Fixed: Removed `Advisor` service and `Insight`, `InsightCTA`, `InsightList`, `Report`, `ReportList` models (admin-only endpoints, not intended for client SDKs) diff --git a/docs/examples/account/update-password.md b/docs/examples/account/update-password.md index 7ea08255..aaaf4dbd 100644 --- a/docs/examples/account/update-password.md +++ b/docs/examples/account/update-password.md @@ -9,7 +9,7 @@ const account = new Account(client); const result = await account.updatePassword({ password: '', - oldPassword: 'password' // optional + oldPassword: '' // optional }); console.log(result); diff --git a/docs/examples/apps/create-secret.md b/docs/examples/apps/create-secret.md new file mode 100644 index 00000000..04aa08c4 --- /dev/null +++ b/docs/examples/apps/create-secret.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Apps } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const apps = new Apps(client); + +const result = await apps.createSecret({ + appId: '' +}); + +console.log(result); +``` diff --git a/docs/examples/apps/create.md b/docs/examples/apps/create.md new file mode 100644 index 00000000..a7436ae3 --- /dev/null +++ b/docs/examples/apps/create.md @@ -0,0 +1,21 @@ +```javascript +import { Client, Apps } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const apps = new Apps(client); + +const result = await apps.create({ + appId: '', + name: '', + redirectUris: [], + enabled: false, // optional + type: 'public', // optional + deviceFlow: false, // optional + teamId: '' // optional +}); + +console.log(result); +``` diff --git a/docs/examples/apps/delete-secret.md b/docs/examples/apps/delete-secret.md new file mode 100644 index 00000000..ec517fdf --- /dev/null +++ b/docs/examples/apps/delete-secret.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Apps } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const apps = new Apps(client); + +const result = await apps.deleteSecret({ + appId: '', + secretId: '' +}); + +console.log(result); +``` diff --git a/docs/examples/apps/delete-tokens.md b/docs/examples/apps/delete-tokens.md new file mode 100644 index 00000000..ec4bdcac --- /dev/null +++ b/docs/examples/apps/delete-tokens.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Apps } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const apps = new Apps(client); + +const result = await apps.deleteTokens({ + appId: '' +}); + +console.log(result); +``` diff --git a/docs/examples/apps/delete.md b/docs/examples/apps/delete.md new file mode 100644 index 00000000..2d0e0cf3 --- /dev/null +++ b/docs/examples/apps/delete.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Apps } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const apps = new Apps(client); + +const result = await apps.delete({ + appId: '' +}); + +console.log(result); +``` diff --git a/docs/examples/apps/get-secret.md b/docs/examples/apps/get-secret.md new file mode 100644 index 00000000..3bd7794c --- /dev/null +++ b/docs/examples/apps/get-secret.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Apps } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const apps = new Apps(client); + +const result = await apps.getSecret({ + appId: '', + secretId: '' +}); + +console.log(result); +``` diff --git a/docs/examples/apps/get.md b/docs/examples/apps/get.md new file mode 100644 index 00000000..6995f784 --- /dev/null +++ b/docs/examples/apps/get.md @@ -0,0 +1,15 @@ +```javascript +import { Client, Apps } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const apps = new Apps(client); + +const result = await apps.get({ + appId: '' +}); + +console.log(result); +``` diff --git a/docs/examples/apps/list-secrets.md b/docs/examples/apps/list-secrets.md new file mode 100644 index 00000000..362be887 --- /dev/null +++ b/docs/examples/apps/list-secrets.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Apps } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const apps = new Apps(client); + +const result = await apps.listSecrets({ + appId: '', + queries: [], // optional + total: false // optional +}); + +console.log(result); +``` diff --git a/docs/examples/apps/list.md b/docs/examples/apps/list.md new file mode 100644 index 00000000..b6d14871 --- /dev/null +++ b/docs/examples/apps/list.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Apps } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const apps = new Apps(client); + +const result = await apps.list({ + queries: [], // optional + total: false // optional +}); + +console.log(result); +``` diff --git a/docs/examples/apps/update-team.md b/docs/examples/apps/update-team.md new file mode 100644 index 00000000..e5638faf --- /dev/null +++ b/docs/examples/apps/update-team.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Apps } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const apps = new Apps(client); + +const result = await apps.updateTeam({ + appId: '', + teamId: '' +}); + +console.log(result); +``` diff --git a/docs/examples/apps/update.md b/docs/examples/apps/update.md new file mode 100644 index 00000000..272e69b9 --- /dev/null +++ b/docs/examples/apps/update.md @@ -0,0 +1,20 @@ +```javascript +import { Client, Apps } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const apps = new Apps(client); + +const result = await apps.update({ + appId: '', + name: '', + enabled: false, // optional + redirectUris: [], // optional + type: 'public', // optional + deviceFlow: false // optional +}); + +console.log(result); +``` diff --git a/docs/examples/avatars/get-screenshot.md b/docs/examples/avatars/get-screenshot.md index 9cb1f990..bf88cf2b 100644 --- a/docs/examples/avatars/get-screenshot.md +++ b/docs/examples/avatars/get-screenshot.md @@ -1,5 +1,5 @@ ```javascript -import { Client, Avatars, Theme, 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 @@ -16,11 +16,11 @@ const result = avatars.getScreenshot({ viewportWidth: 1920, // optional viewportHeight: 1080, // optional scale: 2, // optional - theme: Theme.Dark, // optional + theme: BrowserTheme.Dark, // 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.AmericaNewYork, // optional + timezone: Timezone.AfricaAbidjan, // optional latitude: 37.7749, // optional longitude: -122.4194, // optional accuracy: 100, // optional diff --git a/docs/examples/oauth2/approve.md b/docs/examples/oauth2/approve.md new file mode 100644 index 00000000..dddadb47 --- /dev/null +++ b/docs/examples/oauth2/approve.md @@ -0,0 +1,17 @@ +```javascript +import { Client, Oauth2 } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProjectQuery(''); // Your project ID + +const oauth2 = new Oauth2(client); + +const result = await oauth2.approve({ + projectId: '', + grantId: '', + authorizationDetails: '' // optional +}); + +console.log(result); +``` diff --git a/docs/examples/oauth2/authorize.md b/docs/examples/oauth2/authorize.md new file mode 100644 index 00000000..fa6a2dc9 --- /dev/null +++ b/docs/examples/oauth2/authorize.md @@ -0,0 +1,26 @@ +```javascript +import { Client, Oauth2 } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProjectQuery(''); // Your project ID + +const oauth2 = new Oauth2(client); + +const result = await oauth2.authorize({ + projectId: '', + clientId: '', + redirectUri: 'https://example.com', + responseType: 'code', + scope: '', + state: '', // optional + nonce: '', // optional + codeChallenge: '', // optional + codeChallengeMethod: 's256', // optional + prompt: '', // optional + maxAge: 0, // optional + authorizationDetails: '' // optional +}); + +console.log(result); +``` diff --git a/docs/examples/oauth2/create-grant.md b/docs/examples/oauth2/create-grant.md new file mode 100644 index 00000000..862c6499 --- /dev/null +++ b/docs/examples/oauth2/create-grant.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Oauth2 } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const oauth2 = new Oauth2(client); + +const result = await oauth2.createGrant({ + projectId: '', + userCode: '' +}); + +console.log(result); +``` diff --git a/docs/examples/oauth2/get-grant.md b/docs/examples/oauth2/get-grant.md new file mode 100644 index 00000000..feea161f --- /dev/null +++ b/docs/examples/oauth2/get-grant.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Oauth2 } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProject(''); // Your project ID + +const oauth2 = new Oauth2(client); + +const result = await oauth2.getGrant({ + projectId: '', + grantId: '' +}); + +console.log(result); +``` diff --git a/docs/examples/oauth2/reject.md b/docs/examples/oauth2/reject.md new file mode 100644 index 00000000..c297dce6 --- /dev/null +++ b/docs/examples/oauth2/reject.md @@ -0,0 +1,16 @@ +```javascript +import { Client, Oauth2 } from "react-native-appwrite"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint + .setProjectQuery(''); // Your project ID + +const oauth2 = new Oauth2(client); + +const result = await oauth2.reject({ + projectId: '', + grantId: '' +}); + +console.log(result); +``` diff --git a/package-lock.json b/package-lock.json index a05bd6c2..2b44c489 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "react-native-appwrite", - "version": "0.30.1", + "version": "0.32.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "react-native-appwrite", - "version": "0.30.1", + "version": "0.32.0", "license": "BSD-3-Clause", "dependencies": { "expo-file-system": "18.*.*", @@ -44,9 +44,9 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.0.tgz", - "integrity": "sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg==", + "version": "7.29.3", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.3.tgz", + "integrity": "sha512-LIVqM46zQWZhj17qA8wb4nW/ixr2y1Nw+r1etiAWgRM6U1IqP+LNhL1yg440jYZR72jCWcWbLWzIosH+uP1fqg==", "license": "MIT", "engines": { "node": ">=6.9.0" @@ -146,9 +146,9 @@ } }, "node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.28.6", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.28.6.tgz", - "integrity": "sha512-dTOdvsjnG3xNT9Y0AUg1wAl38y+4Rl4sf9caSQZOXdNqVn+H+HbbJ4IyyHaIqNR6SW9oJpA/RuRjsjCw2IdIow==", + "version": "7.29.3", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.29.3.tgz", + "integrity": "sha512-RpLYy2sb51oNLjuu1iD3bwBqCBWUzjO0ocp+iaCP/lJtb2CPLcnC2Fftw+4sAzaMELGeWTgExSKADbdo0GFVzA==", "license": "MIT", "peer": true, "dependencies": { @@ -157,7 +157,7 @@ "@babel/helper-optimise-call-expression": "^7.27.1", "@babel/helper-replace-supers": "^7.28.6", "@babel/helper-skip-transparent-expression-wrappers": "^7.27.1", - "@babel/traverse": "^7.28.6", + "@babel/traverse": "^7.29.0", "semver": "^6.3.1" }, "engines": { @@ -404,9 +404,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.29.2", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.2.tgz", - "integrity": "sha512-4GgRzy/+fsBa72/RZVJmGKPmZu9Byn8o4MoLpmNe1m8ZfYnz5emHLQz3U4gLud6Zwl0RZIcgiLD7Uq7ySFuDLA==", + "version": "7.29.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.3.tgz", + "integrity": "sha512-b3ctpQwp+PROvU/cttc4OYl4MzfJUWy6FZg+PMXfzmt/+39iHVF0sDfqay8TQM3JA2EUOyKcFZt75jWriQijsA==", "license": "MIT", "dependencies": { "@babel/types": "^7.29.0" @@ -1328,29 +1328,29 @@ } }, "node_modules/@expo/cli": { - "version": "55.0.26", - "resolved": "https://registry.npmjs.org/@expo/cli/-/cli-55.0.26.tgz", - "integrity": "sha512-Ud9gpeGMF5RIL42LXvCw3k3mWK8rf/P2wu+Yrzz9Do1kcFKZeT9Vy2D/xukjdr/Xw+ELba87ThOot17GsPiWjw==", + "version": "55.0.30", + "resolved": "https://registry.npmjs.org/@expo/cli/-/cli-55.0.30.tgz", + "integrity": "sha512-luWcCgompncWtCi1HqQfY32MVOuD0kUeARpr1Le1LeKVtZykjOwnz7YWXZo5zjISiD7L/gQnBNGVrRjvREsJqg==", "license": "MIT", "peer": true, "dependencies": { "@expo/code-signing-certificates": "^0.0.6", - "@expo/config": "~55.0.15", - "@expo/config-plugins": "~55.0.8", + "@expo/config": "~55.0.17", + "@expo/config-plugins": "~55.0.9", "@expo/devcert": "^1.2.1", - "@expo/env": "~2.1.1", - "@expo/image-utils": "^0.8.13", - "@expo/json-file": "^10.0.13", - "@expo/log-box": "55.0.11", - "@expo/metro": "~55.1.0", - "@expo/metro-config": "~55.0.17", - "@expo/osascript": "^2.4.2", - "@expo/package-manager": "^1.10.4", - "@expo/plist": "^0.5.2", - "@expo/prebuild-config": "^55.0.16", - "@expo/require-utils": "^55.0.4", - "@expo/router-server": "^55.0.15", - "@expo/schema-utils": "^55.0.3", + "@expo/env": "~2.1.2", + "@expo/image-utils": "^0.8.14", + "@expo/json-file": "^10.0.14", + "@expo/log-box": "55.0.12", + "@expo/metro": "~55.1.1", + "@expo/metro-config": "~55.0.21", + "@expo/osascript": "^2.4.3", + "@expo/package-manager": "^1.10.5", + "@expo/plist": "^0.5.3", + "@expo/prebuild-config": "^55.0.18", + "@expo/require-utils": "^55.0.5", + "@expo/router-server": "^55.0.16", + "@expo/schema-utils": "^55.0.4", "@expo/spawn-async": "^1.7.2", "@expo/ws-tunnel": "^1.0.1", "@expo/xcpretty": "^4.4.0", @@ -1366,7 +1366,7 @@ "connect": "^3.7.0", "debug": "^4.3.4", "dnssd-advertise": "^1.1.4", - "expo-server": "^55.0.8", + "expo-server": "^55.0.9", "fetch-nodeshim": "^0.4.10", "getenv": "^2.0.0", "glob": "^13.0.0", @@ -1420,16 +1420,16 @@ } }, "node_modules/@expo/config": { - "version": "55.0.15", - "resolved": "https://registry.npmjs.org/@expo/config/-/config-55.0.15.tgz", - "integrity": "sha512-lHc0ELIQ8126jYOMZpLv3WIuvordW98jFg5aT/J1/12n2ycuXu01XLZkJsdw0avO34cusUYb1It+MvY8JiMduA==", + "version": "55.0.17", + "resolved": "https://registry.npmjs.org/@expo/config/-/config-55.0.17.tgz", + "integrity": "sha512-Y3VaRg7Jllg3MhlUOTQqHm6/dttsqcjYlnS9enhAllZvPUpTHnRA4YPETtUZlxkdMJy6y3UZe986pd/KfJ6OTg==", "license": "MIT", "peer": true, "dependencies": { - "@expo/config-plugins": "~55.0.8", + "@expo/config-plugins": "~55.0.9", "@expo/config-types": "^55.0.5", - "@expo/json-file": "^10.0.13", - "@expo/require-utils": "^55.0.4", + "@expo/json-file": "^10.0.14", + "@expo/require-utils": "^55.0.5", "deepmerge": "^4.3.1", "getenv": "^2.0.0", "glob": "^13.0.0", @@ -1439,15 +1439,15 @@ } }, "node_modules/@expo/config-plugins": { - "version": "55.0.8", - "resolved": "https://registry.npmjs.org/@expo/config-plugins/-/config-plugins-55.0.8.tgz", - "integrity": "sha512-8WfWTRntTCcowfOS+tHdB0z98gKetTwktg4G5TWkCkXVa8Jt1NUnvzaaU4UHk2vbR2U4N84RyZJFizSwfF6C9g==", + "version": "55.0.9", + "resolved": "https://registry.npmjs.org/@expo/config-plugins/-/config-plugins-55.0.9.tgz", + "integrity": "sha512-jLfpxru8dTo7eU0cqeTWuQav7byyjb37eF/mbXl1/3eTBHBvFU1VGxpeKxanUdTQAAjqzH8KGgWb0fWcce+z1w==", "license": "MIT", "peer": true, "dependencies": { "@expo/config-types": "^55.0.5", - "@expo/json-file": "~10.0.13", - "@expo/plist": "^0.5.2", + "@expo/json-file": "~10.0.14", + "@expo/plist": "^0.5.3", "@expo/sdk-runtime-versions": "^1.0.0", "chalk": "^4.1.2", "debug": "^4.3.5", @@ -1489,9 +1489,9 @@ } }, "node_modules/@expo/devtools": { - "version": "55.0.2", - "resolved": "https://registry.npmjs.org/@expo/devtools/-/devtools-55.0.2.tgz", - "integrity": "sha512-4VsFn9MUriocyuhyA+ycJP3TJhUsOFHDc270l9h3LhNpXMf6wvIdGcA0QzXkZtORXmlDybWXRP2KT1k36HcQkA==", + "version": "55.0.3", + "resolved": "https://registry.npmjs.org/@expo/devtools/-/devtools-55.0.3.tgz", + "integrity": "sha512-KoIDgo0NoXeWLsIcOdZqtAG/1LlsM+JL0DA3bo0vCYaOYTBLXi/ZvRBqa20Ub8D2vKLNa+FgRQW0gRg04Ps1Pg==", "license": "MIT", "peer": true, "dependencies": { @@ -1511,9 +1511,9 @@ } }, "node_modules/@expo/dom-webview": { - "version": "55.0.5", - "resolved": "https://registry.npmjs.org/@expo/dom-webview/-/dom-webview-55.0.5.tgz", - "integrity": "sha512-lt3uxYOCk3wmWvtOOvsC35CKGbDAOx5C2EaY8SH1JVSfBzqmF8Cs0Xp1MPxncDPMyxpMiWx5SvvV/iLF1rJU4A==", + "version": "55.0.6", + "resolved": "https://registry.npmjs.org/@expo/dom-webview/-/dom-webview-55.0.6.tgz", + "integrity": "sha512-ZNm8tiNEZysxrr36J0x4mOCGyJDcaIvL/3tMxBz0VJIJDcV19xjuJAhJQxHovu+jKx6s9tRyEAINa1mdrzV39g==", "license": "MIT", "peer": true, "peerDependencies": { @@ -1523,9 +1523,9 @@ } }, "node_modules/@expo/env": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@expo/env/-/env-2.1.1.tgz", - "integrity": "sha512-rVvHC4I6xlPcg+mAO09ydUi2Wjv1ZytpLmHOSzvXzBAz9mMrJggqCe4s4dubjJvi/Ino/xQCLhbaLCnTtLpikg==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@expo/env/-/env-2.1.2.tgz", + "integrity": "sha512-RJtGFfj/ygO/6zcVbV3cckHf4THcEkv5IZft1GjCB3dfT6axvzvIwXE9EiQqQYmGHcQ+ZrvC8xZcIhiHba0pYg==", "license": "MIT", "peer": true, "dependencies": { @@ -1538,13 +1538,13 @@ } }, "node_modules/@expo/fingerprint": { - "version": "0.16.6", - "resolved": "https://registry.npmjs.org/@expo/fingerprint/-/fingerprint-0.16.6.tgz", - "integrity": "sha512-nRITNbnu3RKSHPvKVehrSU4KG2VY9V8nvULOHBw98ukHCAU4bGrU5APvcblOkX3JAap+xEHsg/mZvqlvkLInmQ==", + "version": "0.16.7", + "resolved": "https://registry.npmjs.org/@expo/fingerprint/-/fingerprint-0.16.7.tgz", + "integrity": "sha512-BH8sicYOqZ1iBMwCVEGIz6uTTfylosjc49FoMmCYIzKOiYdiVehsfoYBwyfxwWIiya1VMhm1gv0cgOP8fxHpDw==", "license": "MIT", "peer": true, "dependencies": { - "@expo/env": "^2.0.11", + "@expo/env": "^2.1.2", "@expo/spawn-async": "^1.7.2", "arg": "^5.0.2", "chalk": "^4.1.2", @@ -1561,13 +1561,13 @@ } }, "node_modules/@expo/image-utils": { - "version": "0.8.13", - "resolved": "https://registry.npmjs.org/@expo/image-utils/-/image-utils-0.8.13.tgz", - "integrity": "sha512-1I//yBQeTY6p0u1ihqGNDAr35EbSG8uFEupFrIF0jd++h9EWH33521yZJU1yE+mwGlzCb61g3ehu78siMhXBlA==", + "version": "0.8.14", + "resolved": "https://registry.npmjs.org/@expo/image-utils/-/image-utils-0.8.14.tgz", + "integrity": "sha512-5Sn+jG4Cw+shC2wDMXoqSAJnvERbiwzHn05FpWtD5IBflfTIs5gUmjzwiGVyjOdlMSQhgRrw/AymPbmO9h9mpQ==", "license": "MIT", "peer": true, "dependencies": { - "@expo/require-utils": "^55.0.4", + "@expo/require-utils": "^55.0.5", "@expo/spawn-async": "^1.7.2", "chalk": "^4.0.0", "getenv": "^2.0.0", @@ -1577,9 +1577,9 @@ } }, "node_modules/@expo/json-file": { - "version": "10.0.13", - "resolved": "https://registry.npmjs.org/@expo/json-file/-/json-file-10.0.13.tgz", - "integrity": "sha512-pX/XjQn7tgNw6zuuV2ikmegmwe/S7uiwhrs2wXrANMkq7ozrA+JcZwgW9Q/8WZgciBzfAhNp5hnackHcrmapQA==", + "version": "10.0.14", + "resolved": "https://registry.npmjs.org/@expo/json-file/-/json-file-10.0.14.tgz", + "integrity": "sha512-yWwBFywFv+SxkJp/pIzzA416JVYflNUh7pqQzgaA6nXDqRyK7KfrqVzk8PdUfDnqbBcaZZxpzNssfQZzp5KHrA==", "license": "MIT", "peer": true, "dependencies": { @@ -1588,71 +1588,71 @@ } }, "node_modules/@expo/local-build-cache-provider": { - "version": "55.0.11", - "resolved": "https://registry.npmjs.org/@expo/local-build-cache-provider/-/local-build-cache-provider-55.0.11.tgz", - "integrity": "sha512-rJ4RTCrkeKaXaido/bVyhl90ZRtVTOEbj59F1PWVjIEIVgjdlfc1J3VD9v7hEsbf/+8Tbr/PgvWhT6Visi5sLQ==", + "version": "55.0.13", + "resolved": "https://registry.npmjs.org/@expo/local-build-cache-provider/-/local-build-cache-provider-55.0.13.tgz", + "integrity": "sha512-Vg5BE10UL+0yg3BVtIeiSoeHU31Qe1m3UxhBPS478ACY1zzKuxZE30x2sym/B2OIWypjmPzXDRt8J9TOGFuFNw==", "license": "MIT", "peer": true, "dependencies": { - "@expo/config": "~55.0.15", + "@expo/config": "~55.0.17", "chalk": "^4.1.2" } }, "node_modules/@expo/log-box": { - "version": "55.0.11", - "resolved": "https://registry.npmjs.org/@expo/log-box/-/log-box-55.0.11.tgz", - "integrity": "sha512-JQHFLWkskIbJi6cxYMjErx8lQqfFJilDQLKmdTO3m3YkdmN9GE/CrzjOfVlCG0DGEGZJ90br0pGKvGPdXNsHKw==", + "version": "55.0.12", + "resolved": "https://registry.npmjs.org/@expo/log-box/-/log-box-55.0.12.tgz", + "integrity": "sha512-f9ARS8J60cq3LLNdIqmUjYwyerBzVS5Ecp7KjIf3GOIPjW0571rkcwLz4/U18l/1DeSkSzIkYsNl2TC9oTdWaQ==", "license": "MIT", "peer": true, "dependencies": { - "@expo/dom-webview": "^55.0.5", + "@expo/dom-webview": "^55.0.6", "anser": "^1.4.9", "stacktrace-parser": "^0.1.10" }, "peerDependencies": { - "@expo/dom-webview": "^55.0.5", + "@expo/dom-webview": "^55.0.6", "expo": "*", "react": "*", "react-native": "*" } }, "node_modules/@expo/metro": { - "version": "55.1.0", - "resolved": "https://registry.npmjs.org/@expo/metro/-/metro-55.1.0.tgz", - "integrity": "sha512-bb/LOncsz9KiP6cHmMy0MCDG1COZOn+k+pRpDrvJUmxLdOOuniJSYyCc/Dgv1bR9E/6YR+fh3EXGg9MUrVNy4Q==", + "version": "55.1.1", + "resolved": "https://registry.npmjs.org/@expo/metro/-/metro-55.1.1.tgz", + "integrity": "sha512-/wfXo5hTuAVpVLG/4hzlmD9NBGJkzkmBEMm/4VICajYRbj7y8OmqqPWbbymzHiBiHB6tI9BnsyXpQM6zVZEECg==", "license": "MIT", "peer": true, "dependencies": { - "metro": "0.83.6", - "metro-babel-transformer": "0.83.6", - "metro-cache": "0.83.6", - "metro-cache-key": "0.83.6", - "metro-config": "0.83.6", - "metro-core": "0.83.6", - "metro-file-map": "0.83.6", - "metro-minify-terser": "0.83.6", - "metro-resolver": "0.83.6", - "metro-runtime": "0.83.6", - "metro-source-map": "0.83.6", - "metro-symbolicate": "0.83.6", - "metro-transform-plugins": "0.83.6", - "metro-transform-worker": "0.83.6" + "metro": "0.83.7", + "metro-babel-transformer": "0.83.7", + "metro-cache": "0.83.7", + "metro-cache-key": "0.83.7", + "metro-config": "0.83.7", + "metro-core": "0.83.7", + "metro-file-map": "0.83.7", + "metro-minify-terser": "0.83.7", + "metro-resolver": "0.83.7", + "metro-runtime": "0.83.7", + "metro-source-map": "0.83.7", + "metro-symbolicate": "0.83.7", + "metro-transform-plugins": "0.83.7", + "metro-transform-worker": "0.83.7" } }, "node_modules/@expo/metro-config": { - "version": "55.0.17", - "resolved": "https://registry.npmjs.org/@expo/metro-config/-/metro-config-55.0.17.tgz", - "integrity": "sha512-o11VyNoRDXv0T5320D9cH+nSsrR/OMHTjtysKLIfDlidsBswDk1DMApPv9Kw0/gluArCSnbx8JC1G0Yh2Y4P3g==", + "version": "55.0.21", + "resolved": "https://registry.npmjs.org/@expo/metro-config/-/metro-config-55.0.21.tgz", + "integrity": "sha512-pJ8G0uCxqA9KK+XCzXZF7ZI37rduD2l7Cun2e3rVAgB2yeOZagUD+VBvooU9QPiWx9e/7EbimH5/JP81JyhQlg==", "license": "MIT", "peer": true, "dependencies": { "@babel/code-frame": "^7.20.0", "@babel/core": "^7.20.0", "@babel/generator": "^7.20.5", - "@expo/config": "~55.0.15", - "@expo/env": "~2.1.1", - "@expo/json-file": "~10.0.13", - "@expo/metro": "~55.1.0", + "@expo/config": "~55.0.17", + "@expo/env": "~2.1.2", + "@expo/json-file": "~10.0.14", + "@expo/metro": "~55.1.1", "@expo/spawn-async": "^1.7.2", "browserslist": "^4.25.0", "chalk": "^4.1.0", @@ -1676,9 +1676,9 @@ } }, "node_modules/@expo/osascript": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/@expo/osascript/-/osascript-2.4.2.tgz", - "integrity": "sha512-/XP7PSYF2hzOZzqfjgkoWtllyeTN8dW3aM4P6YgKcmmPikKL5FdoyQhti4eh6RK5a5VrUXJTOlTNIpIHsfB5Iw==", + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/@expo/osascript/-/osascript-2.4.3.tgz", + "integrity": "sha512-wbuj3EebM7W9hN/Wp4xTzKd6rQ2zKJzAxkFxkOOwyysLp0HOAgQ4/5RINyoS241pZUX2rUHq7mAJ7pcCQ8U0Ow==", "license": "MIT", "peer": true, "dependencies": { @@ -1689,13 +1689,13 @@ } }, "node_modules/@expo/package-manager": { - "version": "1.10.4", - "resolved": "https://registry.npmjs.org/@expo/package-manager/-/package-manager-1.10.4.tgz", - "integrity": "sha512-y9Mr4Kmpk4abAVZrNNPCdzOZr8nLLyi18p1SXr0RCVA8IfzqZX/eY4H+50a0HTmXqIsPZrQdcdb4I3ekMS9GvQ==", + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/@expo/package-manager/-/package-manager-1.10.5.tgz", + "integrity": "sha512-nCP9Mebfl3jvOr0/P6VAuyah6PAtun+aihIL2zAtuE8uSe94JWkVZ7051i0MUVO+y3gFpBqnr8IIH5ch+VJjHA==", "license": "MIT", "peer": true, "dependencies": { - "@expo/json-file": "^10.0.13", + "@expo/json-file": "^10.0.14", "@expo/spawn-async": "^1.7.2", "chalk": "^4.0.0", "npm-package-arg": "^11.0.0", @@ -1704,9 +1704,9 @@ } }, "node_modules/@expo/plist": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@expo/plist/-/plist-0.5.2.tgz", - "integrity": "sha512-o4xdVdBpe4aTl3sPMZ2u3fJH4iG1I768EIRk1xRZP+GaFI93MaR3JvoFibYqxeTmLQ1p1kNEVqylfUjezxx45g==", + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/@expo/plist/-/plist-0.5.3.tgz", + "integrity": "sha512-jz5oPcPDd3fygwVxwSwmO6wodTwm0Qa14NUyPy0ka7H8sFmCtNZUI2+DzVe/EXjOhq1FbEjrwl89gdlWYOnVjQ==", "license": "MIT", "peer": true, "dependencies": { @@ -1716,17 +1716,17 @@ } }, "node_modules/@expo/prebuild-config": { - "version": "55.0.16", - "resolved": "https://registry.npmjs.org/@expo/prebuild-config/-/prebuild-config-55.0.16.tgz", - "integrity": "sha512-o4EAVgDGk1lISirtMD8hciO2vyMp7cWlPdfTtjjd5AXSfODVYDIDhygXrfvVQHmJXAztVqPUTKJT+BYOsVkYGQ==", + "version": "55.0.18", + "resolved": "https://registry.npmjs.org/@expo/prebuild-config/-/prebuild-config-55.0.18.tgz", + "integrity": "sha512-2oKXyy5pyM87DJqXW5Z+Sakle6rApFFtpPhWOiNsOdoh6rOAD+EqVgyrs2OEEic8CE0tTt27w3SRfSZe/PZrxg==", "license": "MIT", "peer": true, "dependencies": { - "@expo/config": "~55.0.15", - "@expo/config-plugins": "~55.0.8", + "@expo/config": "~55.0.17", + "@expo/config-plugins": "~55.0.9", "@expo/config-types": "^55.0.5", - "@expo/image-utils": "^0.8.13", - "@expo/json-file": "^10.0.13", + "@expo/image-utils": "^0.8.14", + "@expo/json-file": "^10.0.14", "@react-native/normalize-colors": "0.83.6", "debug": "^4.3.1", "resolve-from": "^5.0.0", @@ -1738,9 +1738,9 @@ } }, "node_modules/@expo/require-utils": { - "version": "55.0.4", - "resolved": "https://registry.npmjs.org/@expo/require-utils/-/require-utils-55.0.4.tgz", - "integrity": "sha512-JAANvXqV7MOysWeVWgaiDzikoyDjJWOV/ulOW60Zb3kXJfrx2oZOtGtDXDFKD1mXuahQgoM5QOjuZhF7gFRNjA==", + "version": "55.0.5", + "resolved": "https://registry.npmjs.org/@expo/require-utils/-/require-utils-55.0.5.tgz", + "integrity": "sha512-U4K/CQ2VpXuwfNGsN+daKmYOt15hCP8v/pXaYH6eut7kdYZo6SfJ1yr67BIcJ+1Gzzs+QzTxswAZChKpXmceyw==", "license": "MIT", "peer": true, "dependencies": { @@ -1758,21 +1758,21 @@ } }, "node_modules/@expo/router-server": { - "version": "55.0.15", - "resolved": "https://registry.npmjs.org/@expo/router-server/-/router-server-55.0.15.tgz", - "integrity": "sha512-6LksYO4Pg13qroL138KfUebt/x/EO07zVhdyT/nTgcxnpn6CS4ecTl3DciSKhxbaH+0BVLdANkxYeGdp43TMwQ==", + "version": "55.0.16", + "resolved": "https://registry.npmjs.org/@expo/router-server/-/router-server-55.0.16.tgz", + "integrity": "sha512-LvAdrm039nQBG+95+ff5Rc4CsBuoc/giDhjQrgxB9lKJqC/ZTq1xbwfEZFNq6yokX6fOCs/vlxdhmSkOjMIrvg==", "license": "MIT", "peer": true, "dependencies": { "debug": "^4.3.4" }, "peerDependencies": { - "@expo/metro-runtime": "^55.0.10", + "@expo/metro-runtime": "^55.0.11", "expo": "*", - "expo-constants": "^55.0.15", - "expo-font": "^55.0.6", + "expo-constants": "^55.0.16", + "expo-font": "^55.0.7", "expo-router": "*", - "expo-server": "^55.0.8", + "expo-server": "^55.0.9", "react": "*", "react-dom": "*", "react-server-dom-webpack": "~19.0.1 || ~19.1.2 || ~19.2.1" @@ -1793,9 +1793,9 @@ } }, "node_modules/@expo/schema-utils": { - "version": "55.0.3", - "resolved": "https://registry.npmjs.org/@expo/schema-utils/-/schema-utils-55.0.3.tgz", - "integrity": "sha512-l9KHVjTo6MvoeyvwNr6AjckGJm8NIcqZ3QSAh51cWozXW9v2AUjyCyqYtFtyntLWRZ0x/ByYJishpQo4ZQq45Q==", + "version": "55.0.4", + "resolved": "https://registry.npmjs.org/@expo/schema-utils/-/schema-utils-55.0.4.tgz", + "integrity": "sha512-65IdeeE8dAZR3n3J5Eq7LYiQ8BFGeEYCWPBCzycvafL7PkskbCyIclTQarRwf/HXFoRvezKCjaLwy/8v9Prk6g==", "license": "MIT", "peer": true }, @@ -1846,9 +1846,9 @@ "peer": true }, "node_modules/@expo/xcpretty": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/@expo/xcpretty/-/xcpretty-4.4.3.tgz", - "integrity": "sha512-wC562eD3gS6vO2tWHToFhlFnmHKfKHgF1oyvojeSkLK/ZYop1bMU+7cOMiF9Sq70CzcsLy/EMRy/uRc76QmNRw==", + "version": "4.4.4", + "resolved": "https://registry.npmjs.org/@expo/xcpretty/-/xcpretty-4.4.4.tgz", + "integrity": "sha512-4aQzz9vgxcNXFfo/iyNgDDYfsU5XGKKxWxZopw0cVotHiW+U8IJbIxMaxsINs6bHhtkG3StKNPcOrn3eBuxKPw==", "license": "BSD-3-Clause", "peer": true, "dependencies": { @@ -1954,9 +1954,9 @@ } }, "node_modules/@react-native/assets-registry": { - "version": "0.85.2", - "resolved": "https://registry.npmjs.org/@react-native/assets-registry/-/assets-registry-0.85.2.tgz", - "integrity": "sha512-kauC/oPaxklU4Y+u9gBfCBJm51qX6WBZq4xx0USCdimtp+G8+554kpygfSWIjoqCJa2o06bWxBEjesiuCv+LzA==", + "version": "0.85.3", + "resolved": "https://registry.npmjs.org/@react-native/assets-registry/-/assets-registry-0.85.3.tgz", + "integrity": "sha512-u9ZiYP23vA2IFtdFQFmetzSmk6SM0xgKIoiOsr1hXNHjHaLhOm+/Ph1ud57wX6+Dbwdzx8coJgnzSKL3W21PCg==", "license": "MIT", "engines": { "node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0" @@ -2103,17 +2103,17 @@ } }, "node_modules/@react-native/community-cli-plugin": { - "version": "0.85.2", - "resolved": "https://registry.npmjs.org/@react-native/community-cli-plugin/-/community-cli-plugin-0.85.2.tgz", - "integrity": "sha512-3KLgSg1kHvBpr93zMaQhvfYTgnCw7yZRED+3J4dMcYjfSjtD0Wf8SofU6uBmAw9JaVYvP43lpdwUpI4p0+ABsg==", + "version": "0.85.3", + "resolved": "https://registry.npmjs.org/@react-native/community-cli-plugin/-/community-cli-plugin-0.85.3.tgz", + "integrity": "sha512-fs85dmbIqNmtzEixDb0g+q6R3Vt4H9eAt8/inIZdDKfjN76+sUJA2r1nxODQ76bU23MrIbz8sI7KFBPaWk/zQw==", "license": "MIT", "dependencies": { - "@react-native/dev-middleware": "0.85.2", + "@react-native/dev-middleware": "0.85.3", "debug": "^4.4.0", "invariant": "^2.2.4", - "metro": "^0.84.0", - "metro-config": "^0.84.0", - "metro-core": "^0.84.0", + "metro": "^0.84.3", + "metro-config": "^0.84.3", + "metro-core": "^0.84.3", "semver": "^7.1.3" }, "engines": { @@ -2121,7 +2121,7 @@ }, "peerDependencies": { "@react-native-community/cli": "*", - "@react-native/metro-config": "0.85.2" + "@react-native/metro-config": "0.85.3" }, "peerDependenciesMeta": { "@react-native-community/cli": { @@ -2133,18 +2133,18 @@ } }, "node_modules/@react-native/community-cli-plugin/node_modules/@react-native/debugger-frontend": { - "version": "0.85.2", - "resolved": "https://registry.npmjs.org/@react-native/debugger-frontend/-/debugger-frontend-0.85.2.tgz", - "integrity": "sha512-j+0b9H5f5hGTLQxHIhJU/b/W6ijuxJF+ZTLHB0se2kzUBNxFKd7DkIc6753qk3CJdiv55vxG3XDgmlpbHxOpmA==", + "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", "engines": { "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": { - "version": "0.85.2", - "resolved": "https://registry.npmjs.org/@react-native/debugger-shell/-/debugger-shell-0.85.2.tgz", - "integrity": "sha512-r5BkhqPMfg3LmaZS5zadHmBNVH5h4bhSpv4BEPGfK4gat9HABAMzUzybi+2wpgU3SoHxnyKGdExEJvoqVcjeRg==", + "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", "dependencies": { "cross-spawn": "^7.0.6", @@ -2156,14 +2156,14 @@ } }, "node_modules/@react-native/community-cli-plugin/node_modules/@react-native/dev-middleware": { - "version": "0.85.2", - "resolved": "https://registry.npmjs.org/@react-native/dev-middleware/-/dev-middleware-0.85.2.tgz", - "integrity": "sha512-3J+NaDUg+QEfDeLAUzgaWhpaxEg78g+KwbydlDCewh2G6WnHpsty8XooruxNHzyAsqVWywZMrzmbn78Ctc1O9Q==", + "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", "dependencies": { "@isaacs/ttlcache": "^1.4.1", - "@react-native/debugger-frontend": "0.85.2", - "@react-native/debugger-shell": "0.85.2", + "@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", @@ -2226,9 +2226,9 @@ } }, "node_modules/@react-native/community-cli-plugin/node_modules/metro": { - "version": "0.84.3", - "resolved": "https://registry.npmjs.org/metro/-/metro-0.84.3.tgz", - "integrity": "sha512-1h3lbVrE6hGf1e/764HfhPGg/bGrWMJDDh7G2rc4gFYZboVuI40BlG/y+UhtbhQDNlO/csMvrcnK0YrTlHUVew==", + "version": "0.84.4", + "resolved": "https://registry.npmjs.org/metro/-/metro-0.84.4.tgz", + "integrity": "sha512-8ETTubqfD6ornDy2zYDvRcKnVDOXdFJsjetYDBsY4oAsb6NJkiwFR+FaMESyGppFmQUyBQA4H4sFGxzcQSGtFA==", "license": "MIT", "dependencies": { "@babel/code-frame": "^7.29.0", @@ -2239,7 +2239,6 @@ "@babel/traverse": "^7.29.0", "@babel/types": "^7.29.0", "accepts": "^2.0.0", - "chalk": "^4.0.0", "ci-info": "^2.0.0", "connect": "^3.6.5", "debug": "^4.4.0", @@ -2252,18 +2251,18 @@ "jest-worker": "^29.7.0", "jsc-safe-url": "^0.2.2", "lodash.throttle": "^4.1.1", - "metro-babel-transformer": "0.84.3", - "metro-cache": "0.84.3", - "metro-cache-key": "0.84.3", - "metro-config": "0.84.3", - "metro-core": "0.84.3", - "metro-file-map": "0.84.3", - "metro-resolver": "0.84.3", - "metro-runtime": "0.84.3", - "metro-source-map": "0.84.3", - "metro-symbolicate": "0.84.3", - "metro-transform-plugins": "0.84.3", - "metro-transform-worker": "0.84.3", + "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", "mime-types": "^3.0.1", "nullthrows": "^1.1.1", "serialize-error": "^2.1.0", @@ -2280,15 +2279,15 @@ } }, "node_modules/@react-native/community-cli-plugin/node_modules/metro-babel-transformer": { - "version": "0.84.3", - "resolved": "https://registry.npmjs.org/metro-babel-transformer/-/metro-babel-transformer-0.84.3.tgz", - "integrity": "sha512-svAA+yMLpeMiGcz/jKJs4oHpIGEx4nBqNEJ5AGj4CYIg1efvK+A0TjR6tgIuc6tKO5e8JmN/1lglpN2+f3/z/w==", + "version": "0.84.4", + "resolved": "https://registry.npmjs.org/metro-babel-transformer/-/metro-babel-transformer-0.84.4.tgz", + "integrity": "sha512-rvCfz8snl9h20VcvpOHxZuHP1SlAkv4HXbzw7nyyVwu6Eqo5PRerbakQ9XmUCOsRy70spJ37O+G1TK8oMzo48g==", "license": "MIT", "dependencies": { "@babel/core": "^7.25.2", "flow-enums-runtime": "^0.0.6", "hermes-parser": "0.35.0", - "metro-cache-key": "0.84.3", + "metro-cache-key": "0.84.4", "nullthrows": "^1.1.1" }, "engines": { @@ -2296,24 +2295,24 @@ } }, "node_modules/@react-native/community-cli-plugin/node_modules/metro-cache": { - "version": "0.84.3", - "resolved": "https://registry.npmjs.org/metro-cache/-/metro-cache-0.84.3.tgz", - "integrity": "sha512-0QElxwLaHqLZf+Xqio8QrjVbuXP/8sJfQBGSPiITlKDVXrVLefuzYVSH9Sj+QL6lrPj2gYZd/iwQh1yZuVKnLA==", + "version": "0.84.4", + "resolved": "https://registry.npmjs.org/metro-cache/-/metro-cache-0.84.4.tgz", + "integrity": "sha512-gpcFQdSLUwUCk71saKoE64jLFbx2nwTfVCcPSULMNT8QYq0p1eZZE29Jvd0HtT/UlhC3ZOutLxJME5xqD2JUZg==", "license": "MIT", "dependencies": { "exponential-backoff": "^3.1.1", "flow-enums-runtime": "^0.0.6", "https-proxy-agent": "^7.0.5", - "metro-core": "0.84.3" + "metro-core": "0.84.4" }, "engines": { "node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0" } }, "node_modules/@react-native/community-cli-plugin/node_modules/metro-cache-key": { - "version": "0.84.3", - "resolved": "https://registry.npmjs.org/metro-cache-key/-/metro-cache-key-0.84.3.tgz", - "integrity": "sha512-TnSL1Fdvrw+2glTdBSRmA5TL8l/i16ECjsrUdf3E5HncA+sNx8KcwDG8r+3ct1UhfYcusJypzZqTN55FZZcwGg==", + "version": "0.84.4", + "resolved": "https://registry.npmjs.org/metro-cache-key/-/metro-cache-key-0.84.4.tgz", + "integrity": "sha512-wVO79aGrkYImpnaVS4+d5RrRBRPX31QtvKB3wKGBuiNSznduZTQHzsrJZRroFJSwnygrzdsGUtDQPuqqFjFdvw==", "license": "MIT", "dependencies": { "flow-enums-runtime": "^0.0.6" @@ -2323,18 +2322,18 @@ } }, "node_modules/@react-native/community-cli-plugin/node_modules/metro-config": { - "version": "0.84.3", - "resolved": "https://registry.npmjs.org/metro-config/-/metro-config-0.84.3.tgz", - "integrity": "sha512-JmCzZWOETR+O22q8oPBWyQppx3roU9EbkbGzD8Gf1jukQ4b5T1fTzqqHruu6K4sTiNq5zVQySmKF6bp4kVARew==", + "version": "0.84.4", + "resolved": "https://registry.npmjs.org/metro-config/-/metro-config-0.84.4.tgz", + "integrity": "sha512-PMotGDjXcXLWo2TMRH+VR99phFNgYTwqh4OoieIKK3yTJa1Jmkl+fZJxDO0jfBvNF+WESHciHvpNuBtXaF3B0Q==", "license": "MIT", "dependencies": { "connect": "^3.6.5", "flow-enums-runtime": "^0.0.6", "jest-validate": "^29.7.0", - "metro": "0.84.3", - "metro-cache": "0.84.3", - "metro-core": "0.84.3", - "metro-runtime": "0.84.3", + "metro": "0.84.4", + "metro-cache": "0.84.4", + "metro-core": "0.84.4", + "metro-runtime": "0.84.4", "yaml": "^2.6.1" }, "engines": { @@ -2342,23 +2341,23 @@ } }, "node_modules/@react-native/community-cli-plugin/node_modules/metro-core": { - "version": "0.84.3", - "resolved": "https://registry.npmjs.org/metro-core/-/metro-core-0.84.3.tgz", - "integrity": "sha512-cc0pvAa80ai1nDmqqz0P59a+0ZqCZ/YHU/3jEekZL6spFnYDfX8iDLdn9FR6kX+67rmzKxHNrbrSRFLX2AYocw==", + "version": "0.84.4", + "resolved": "https://registry.npmjs.org/metro-core/-/metro-core-0.84.4.tgz", + "integrity": "sha512-HONpWC5LGXZn3ffkd4Hu6AIrfE7j4Z0g0wMo/goV24WOB3lhuFZ40KgvaDiSw8iyQHloMYay5N/wPX+z8oN/PQ==", "license": "MIT", "dependencies": { "flow-enums-runtime": "^0.0.6", "lodash.throttle": "^4.1.1", - "metro-resolver": "0.84.3" + "metro-resolver": "0.84.4" }, "engines": { "node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0" } }, "node_modules/@react-native/community-cli-plugin/node_modules/metro-file-map": { - "version": "0.84.3", - "resolved": "https://registry.npmjs.org/metro-file-map/-/metro-file-map-0.84.3.tgz", - "integrity": "sha512-1cL4m4Jv1yRUt9RJExZQLfccscdlMNOcRG6LHLtmJhf3BG9j3MujPVc7CIpKYdFl+KUl+sdjge6oO3+meKCHQA==", + "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==", "license": "MIT", "dependencies": { "debug": "^4.4.0", @@ -2376,9 +2375,9 @@ } }, "node_modules/@react-native/community-cli-plugin/node_modules/metro-minify-terser": { - "version": "0.84.3", - "resolved": "https://registry.npmjs.org/metro-minify-terser/-/metro-minify-terser-0.84.3.tgz", - "integrity": "sha512-3ofrG2OQyJbO9RNhCfOcl8QU7EE2WrSsnN5dFkuZaJO5+4Imujr9bUXmspeNlXRsOVk0F/rVRbEFH98lFSCkBQ==", + "version": "0.84.4", + "resolved": "https://registry.npmjs.org/metro-minify-terser/-/metro-minify-terser-0.84.4.tgz", + "integrity": "sha512-5qpbaVOMC7CPitIpuewzVeGw7E+C3ykbv2mqTjQLl85Z3annSVGlSCTcsZjqXZzjupfK4Ztj3dDc4kc44NZwtQ==", "license": "MIT", "dependencies": { "flow-enums-runtime": "^0.0.6", @@ -2389,9 +2388,9 @@ } }, "node_modules/@react-native/community-cli-plugin/node_modules/metro-resolver": { - "version": "0.84.3", - "resolved": "https://registry.npmjs.org/metro-resolver/-/metro-resolver-0.84.3.tgz", - "integrity": "sha512-pjEzGDtoM8DTHAIPK/9u9ZxszEiuRohYUVImWvgbnB91V4gqYJpQcoEYUugf2NIm1lrX5HNu0OvNqWmPBnGYjA==", + "version": "0.84.4", + "resolved": "https://registry.npmjs.org/metro-resolver/-/metro-resolver-0.84.4.tgz", + "integrity": "sha512-1qLgbxQ5ZGhhutuPot1Yp348ofDsATL2WkrHF65TobqTT9K3P9qJXw38bomk7ncp5B7OYMfWwtyBZo1lCV792A==", "license": "MIT", "dependencies": { "flow-enums-runtime": "^0.0.6" @@ -2401,9 +2400,9 @@ } }, "node_modules/@react-native/community-cli-plugin/node_modules/metro-runtime": { - "version": "0.84.3", - "resolved": "https://registry.npmjs.org/metro-runtime/-/metro-runtime-0.84.3.tgz", - "integrity": "sha512-o7HLRfMyVk9N2dUZ9VjQfB6xxUItL9Pi9WcqxURE7MEKOH6wbGt9/E92YdYLluTOtkzYAEVfdC6h6lcxqA+hMQ==", + "version": "0.84.4", + "resolved": "https://registry.npmjs.org/metro-runtime/-/metro-runtime-0.84.4.tgz", + "integrity": "sha512-Jibypds4g7AhzdRKY+kDoj51s5EXMwgyp5ddtlreDAsWefMdOx+agWqgm0H2XSZ/ueanHHVM89fnf5OJnlxa8Q==", "license": "MIT", "dependencies": { "@babel/runtime": "^7.25.0", @@ -2414,18 +2413,18 @@ } }, "node_modules/@react-native/community-cli-plugin/node_modules/metro-source-map": { - "version": "0.84.3", - "resolved": "https://registry.npmjs.org/metro-source-map/-/metro-source-map-0.84.3.tgz", - "integrity": "sha512-jS48CeSzw78M8y6VE0f9uy3lVmfbOS677j2VCxnlmlYmnahcXuC6IhoN9K6LynNvos9517yUadcfgioju38xYQ==", + "version": "0.84.4", + "resolved": "https://registry.npmjs.org/metro-source-map/-/metro-source-map-0.84.4.tgz", + "integrity": "sha512-jbWkPxIesVuo1IWkvezmMJld6iu8nD62GsrZiV6jP37AOdbo4OBq1FJ+qkOg8sV05wAHB//jAbziuW0SlJfW4g==", "license": "MIT", "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.3", + "metro-symbolicate": "0.84.4", "nullthrows": "^1.1.1", - "ob1": "0.84.3", + "ob1": "0.84.4", "source-map": "^0.5.6", "vlq": "^1.0.0" }, @@ -2434,14 +2433,14 @@ } }, "node_modules/@react-native/community-cli-plugin/node_modules/metro-symbolicate": { - "version": "0.84.3", - "resolved": "https://registry.npmjs.org/metro-symbolicate/-/metro-symbolicate-0.84.3.tgz", - "integrity": "sha512-J9Tpo8NCycYrozRvBIUyOwGAu4xkawOsAppmTscFiaegK0WvuDGwIM53GbzVSnytCHjVAF0io5GQxpkrKTuc7g==", + "version": "0.84.4", + "resolved": "https://registry.npmjs.org/metro-symbolicate/-/metro-symbolicate-0.84.4.tgz", + "integrity": "sha512-OnfpacxUqGPZQ27t8qK9mFa7uqHIlVWeqRqkCbvMvreEBiamEeOn8krKtcwgP5M4cYDPwuSmCTopHMVthqG4zA==", "license": "MIT", "dependencies": { "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", - "metro-source-map": "0.84.3", + "metro-source-map": "0.84.4", "nullthrows": "^1.1.1", "source-map": "^0.5.6", "vlq": "^1.0.0" @@ -2454,9 +2453,9 @@ } }, "node_modules/@react-native/community-cli-plugin/node_modules/metro-transform-plugins": { - "version": "0.84.3", - "resolved": "https://registry.npmjs.org/metro-transform-plugins/-/metro-transform-plugins-0.84.3.tgz", - "integrity": "sha512-8S3baq2XhBaafHEH5Q8sJW6tmzsEJk80qKc3RU/nZV1MsnYq94RdjTUR6AyKjQd6Rfsk1BtBxhtiNnk7mgslCg==", + "version": "0.84.4", + "resolved": "https://registry.npmjs.org/metro-transform-plugins/-/metro-transform-plugins-0.84.4.tgz", + "integrity": "sha512-kehr6HbAecqD0/a3xLXobELdPaAmRAl8bel0qagPF4vhZtux93nS8S4eq2kgKt6J2GnQpVjSoW1PXdst04mwow==", "license": "MIT", "dependencies": { "@babel/core": "^7.25.2", @@ -2471,9 +2470,9 @@ } }, "node_modules/@react-native/community-cli-plugin/node_modules/metro-transform-worker": { - "version": "0.84.3", - "resolved": "https://registry.npmjs.org/metro-transform-worker/-/metro-transform-worker-0.84.3.tgz", - "integrity": "sha512-Wjba7PyYktNRsHbPmkx2J2UX32rAzcDXjCu49zPHeF/viJlYJhwRaNePQcHaCRqQ+kmgQT4ThprsnJfDj71ZMA==", + "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==", "license": "MIT", "dependencies": { "@babel/core": "^7.25.2", @@ -2481,13 +2480,13 @@ "@babel/parser": "^7.29.0", "@babel/types": "^7.29.0", "flow-enums-runtime": "^0.0.6", - "metro": "0.84.3", - "metro-babel-transformer": "0.84.3", - "metro-cache": "0.84.3", - "metro-cache-key": "0.84.3", - "metro-minify-terser": "0.84.3", - "metro-source-map": "0.84.3", - "metro-transform-plugins": "0.84.3", + "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", "nullthrows": "^1.1.1" }, "engines": { @@ -2520,9 +2519,9 @@ } }, "node_modules/@react-native/community-cli-plugin/node_modules/ob1": { - "version": "0.84.3", - "resolved": "https://registry.npmjs.org/ob1/-/ob1-0.84.3.tgz", - "integrity": "sha512-J7554Ef8bzmKaDY365Afq6PF+qtdnY/d5PKUQFrsKlZHV/N3OGZewVrvDrQDyX5V5NJjTpcAKtlrFZcDr+HvpQ==", + "version": "0.84.4", + "resolved": "https://registry.npmjs.org/ob1/-/ob1-0.84.4.tgz", + "integrity": "sha512-eJXMpz4aQHXF/YBB9ddqZDIS+ooO91hObo9FoW/xBkr54/zCwYYCDqT/O54vNo8kOkWs5Ou/y28NgdrV0edQNA==", "license": "MIT", "dependencies": { "flow-enums-runtime": "^0.0.6" @@ -2531,27 +2530,6 @@ "node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0" } }, - "node_modules/@react-native/community-cli-plugin/node_modules/ws": { - "version": "7.5.10", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", - "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", - "license": "MIT", - "engines": { - "node": ">=8.3.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, "node_modules/@react-native/debugger-frontend": { "version": "0.83.6", "resolved": "https://registry.npmjs.org/@react-native/debugger-frontend/-/debugger-frontend-0.83.6.tgz", @@ -2600,41 +2578,19 @@ "node": ">= 20.19.4" } }, - "node_modules/@react-native/dev-middleware/node_modules/ws": { - "version": "7.5.10", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", - "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=8.3.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, "node_modules/@react-native/gradle-plugin": { - "version": "0.85.2", - "resolved": "https://registry.npmjs.org/@react-native/gradle-plugin/-/gradle-plugin-0.85.2.tgz", - "integrity": "sha512-YXBOLeAqFrv7XwUeBPTKZeOV1FIxn4AW7UAEitScf3ibC8bu8+6NpJu4HWgbNQHg7vDbbTZVbcOl8EwGxsSq2w==", + "version": "0.85.3", + "resolved": "https://registry.npmjs.org/@react-native/gradle-plugin/-/gradle-plugin-0.85.3.tgz", + "integrity": "sha512-39dY2j50Q1pntejzwt3XL7vwXtrj8jcIfHq6E+gyu3jzYxZJVvMkMutQ39vSg6zinIQOX36oQDhidXUbCXzgoA==", "license": "MIT", "engines": { "node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0" } }, "node_modules/@react-native/js-polyfills": { - "version": "0.85.2", - "resolved": "https://registry.npmjs.org/@react-native/js-polyfills/-/js-polyfills-0.85.2.tgz", - "integrity": "sha512-esGEAmKVM40DV/yVmNljCKZTIeUo7qXqc+Hwffkv3TG+b3E24xyFovHrbP98gGxZr2ZsEyx+2sKLdXF5asY5nw==", + "version": "0.85.3", + "resolved": "https://registry.npmjs.org/@react-native/js-polyfills/-/js-polyfills-0.85.3.tgz", + "integrity": "sha512-U2+aMshIXf1uFn77tpBb/xhHWB9vkVrMpt7kkucAugF8hJKYTDGB587X7WwelHduK2KBfhl4giSv0rzZGoef9A==", "license": "MIT", "engines": { "node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0" @@ -2648,9 +2604,9 @@ "peer": true }, "node_modules/@react-native/virtualized-lists": { - "version": "0.85.2", - "resolved": "https://registry.npmjs.org/@react-native/virtualized-lists/-/virtualized-lists-0.85.2.tgz", - "integrity": "sha512-wmVKpAlcr+UB0L5SpbrV865EdleUP7I5+X+48e1aRsQK8q+wsTRBXeUwWVip/1l+HZwlZFeO8iOILJ16VRu0Cw==", + "version": "0.85.3", + "resolved": "https://registry.npmjs.org/@react-native/virtualized-lists/-/virtualized-lists-0.85.3.tgz", + "integrity": "sha512-dsCjI//OIPEUJMyNHp4l7zNLVjCx7bcaRUceOCkU+IB17hkbtbGWvi7HjGFSzy7FJGmS/MOlcfpb72xXiy1Oig==", "license": "MIT", "dependencies": { "invariant": "^2.2.4", @@ -2662,7 +2618,7 @@ "peerDependencies": { "@types/react": "^19.2.0", "react": "*", - "react-native": "0.85.2" + "react-native": "0.85.3" }, "peerDependenciesMeta": { "@types/react": { @@ -3077,9 +3033,9 @@ "license": "MIT" }, "node_modules/@types/estree": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", - "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", "dev": true, "license": "MIT" }, @@ -3115,12 +3071,12 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "25.6.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-25.6.0.tgz", - "integrity": "sha512-+qIYRKdNYJwY3vRCZMdJbPLJAtGjQBudzZzdzwQYkEPQd+PJGixUL5QfvCLDaULoLv+RhT3LDkwEfKaAkgSmNQ==", + "version": "25.9.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.9.0.tgz", + "integrity": "sha512-AOQwYUNolgy3VosiRqXrACUXTN8nJUtPl7FJXMqZVyxiiCLhQuG3jXKvCS1ALr+Y2OmZhzzLVlYPEqJaiqkaJQ==", "license": "MIT", "dependencies": { - "undici-types": "~7.19.0" + "undici-types": ">=7.24.0 <7.24.7" } }, "node_modules/@types/yargs": { @@ -3139,9 +3095,9 @@ "license": "MIT" }, "node_modules/@ungap/structured-clone": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", - "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.1.tgz", + "integrity": "sha512-mUFwbeTqrVgDQxFveS+df2yfap6iuP20NAKAsBt5jDEoOTDew+zwLAOilHCeQJOVSvmgCX4ogqIrA0mnyr08yQ==", "license": "ISC", "peer": true }, @@ -3371,9 +3327,9 @@ } }, "node_modules/babel-preset-expo": { - "version": "55.0.18", - "resolved": "https://registry.npmjs.org/babel-preset-expo/-/babel-preset-expo-55.0.18.tgz", - "integrity": "sha512-zmDwKxCFBTe4e/jQXuITRUZlbl8HTZOhsUlwcHGjwEUB0lKQfRdaSYXZckQ+jMOBC34MrOl3Cs7/6F6vNbj5Pw==", + "version": "55.0.21", + "resolved": "https://registry.npmjs.org/babel-preset-expo/-/babel-preset-expo-55.0.21.tgz", + "integrity": "sha512-anXoUZBcxydLdVs2L+r3bWKGUvZv2FtgOl8xRJ12i/YfKICBpwTGZWSTiEYTqBByZ6GkA3mE9+3TW97X2ocFTQ==", "license": "MIT", "peer": true, "dependencies": { @@ -3404,7 +3360,7 @@ "peerDependencies": { "@babel/runtime": "^7.20.0", "expo": "*", - "expo-widgets": "^55.0.14", + "expo-widgets": "^55.0.17", "react-refresh": ">=0.14.0 <1.0.0" }, "peerDependenciesMeta": { @@ -3450,9 +3406,9 @@ "license": "MIT" }, "node_modules/baseline-browser-mapping": { - "version": "2.10.23", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.23.tgz", - "integrity": "sha512-xwVXGqevyKPsiuQdLj+dZMVjidjJV508TBqexND5HrF89cGdCYCJFB3qhcxRHSeMctdCfbR1jrxBajhDy7o29g==", + "version": "2.10.31", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.31.tgz", + "integrity": "sha512-MujYO3eP72uvmSE0i4wltsodRfIpZATP3jvzRNRGGxgzId7aVocVJJV3nf01qnzzKFGxQVC9bpWxl5cjxTr/7Q==", "license": "Apache-2.0", "bin": { "baseline-browser-mapping": "dist/cli.cjs" @@ -3535,9 +3491,9 @@ } }, "node_modules/brace-expansion": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.5.tgz", - "integrity": "sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ==", + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz", + "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==", "license": "MIT", "peer": true, "dependencies": { @@ -3630,9 +3586,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001791", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001791.tgz", - "integrity": "sha512-yk0l/YSrOnFZk3UROpDLQD9+kC1l4meK/wed583AXrzoarMGJcbRi2Q4RaUYbKxYAsZ8sWmaSa/DsLmdBeI1vQ==", + "version": "1.0.30001793", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001793.tgz", + "integrity": "sha512-iwSsYWaCOoh26cV8NwNRViHlrfUvYsHDfRVcbtmw0Kg6PJIZZXwMkj1442FYLBGkeUf1juAsU3DTfxW579mrPA==", "funding": [ { "type": "opencollective", @@ -4036,9 +3992,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.344", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.344.tgz", - "integrity": "sha512-4MxfbmNDm+KPh066EZy+eUnkcDPcZ35wNmOWzFuh/ijvHsve6kbLTLURy88uCNK5FbpN+yk2nQY6BYh1GEt+wg==", + "version": "1.5.359", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.359.tgz", + "integrity": "sha512-8lPELWuYZIWk7NDvCNthtmMw/7Q5Wu25NpM4djFMHBmk8DubPAtL4YTOp7ou0e7HyJtwkVlWv8XMLURnrtgJQw==", "license": "ISC" }, "node_modules/emoji-regex": { @@ -4127,35 +4083,35 @@ } }, "node_modules/expo": { - "version": "55.0.17", - "resolved": "https://registry.npmjs.org/expo/-/expo-55.0.17.tgz", - "integrity": "sha512-yVF2phiPw5XgOCedC/oQaL3j0XbwzsBLst3JiAF8bi9aFlxLOVvuDEM8BDg3E09XGSLaGCAclY4q5L+sFerXlQ==", + "version": "55.0.24", + "resolved": "https://registry.npmjs.org/expo/-/expo-55.0.24.tgz", + "integrity": "sha512-nU95y+GIfD1dm9CSjsitDdltSU83dDqemxD1UUBxJPH8zKf7B5AdGVNyE6/jLWyCM/p/EmHfCeiqdrWCy9ljZA==", "license": "MIT", "peer": true, "dependencies": { "@babel/runtime": "^7.20.0", - "@expo/cli": "55.0.26", - "@expo/config": "~55.0.15", - "@expo/config-plugins": "~55.0.8", - "@expo/devtools": "55.0.2", - "@expo/fingerprint": "0.16.6", - "@expo/local-build-cache-provider": "55.0.11", - "@expo/log-box": "55.0.11", - "@expo/metro": "~55.1.0", - "@expo/metro-config": "55.0.17", + "@expo/cli": "55.0.30", + "@expo/config": "~55.0.17", + "@expo/config-plugins": "~55.0.9", + "@expo/devtools": "55.0.3", + "@expo/fingerprint": "0.16.7", + "@expo/local-build-cache-provider": "55.0.13", + "@expo/log-box": "55.0.12", + "@expo/metro": "~55.1.1", + "@expo/metro-config": "55.0.21", "@expo/vector-icons": "^15.0.2", "@ungap/structured-clone": "^1.3.0", - "babel-preset-expo": "~55.0.18", - "expo-asset": "~55.0.16", - "expo-constants": "~55.0.15", - "expo-file-system": "~55.0.17", - "expo-font": "~55.0.6", - "expo-keep-awake": "~55.0.6", - "expo-modules-autolinking": "55.0.18", - "expo-modules-core": "55.0.23", + "babel-preset-expo": "~55.0.21", + "expo-asset": "~55.0.17", + "expo-constants": "~55.0.16", + "expo-file-system": "~55.0.20", + "expo-font": "~55.0.7", + "expo-keep-awake": "~55.0.8", + "expo-modules-autolinking": "55.0.22", + "expo-modules-core": "55.0.25", "pretty-format": "^29.7.0", "react-refresh": "^0.14.2", - "whatwg-url-minimum": "^0.1.1" + "whatwg-url-minimum": "^0.1.2" }, "bin": { "expo": "bin/cli", @@ -4182,14 +4138,14 @@ } }, "node_modules/expo-asset": { - "version": "55.0.16", - "resolved": "https://registry.npmjs.org/expo-asset/-/expo-asset-55.0.16.tgz", - "integrity": "sha512-5IJyfJtYqvKGg04NKGQWiCIoK/fULDL9m15mXPPyfabD1jsToVj2hnWmo1r2SWNNmMwtQxi6jTpcGwVo2nLDxg==", + "version": "55.0.17", + "resolved": "https://registry.npmjs.org/expo-asset/-/expo-asset-55.0.17.tgz", + "integrity": "sha512-pK9HHJuFqjE8kDUcbMFsZj3Cz8WdXpvZHZmYl7ouFQp59P83BvHln6VnqPDGlO+/4929G0Lm8ZUzbONuNRhi9w==", "license": "MIT", "peer": true, "dependencies": { - "@expo/image-utils": "^0.8.13", - "expo-constants": "~55.0.15" + "@expo/image-utils": "^0.8.14", + "expo-constants": "~55.0.16" }, "peerDependencies": { "expo": "*", @@ -4198,13 +4154,13 @@ } }, "node_modules/expo-constants": { - "version": "55.0.15", - "resolved": "https://registry.npmjs.org/expo-constants/-/expo-constants-55.0.15.tgz", - "integrity": "sha512-w394fcZLJjeKN+9ZnJzL/HiarE1nwZFDa+3S9frevh6Ur+MAAs9QDrcXhDrV8T3xqRzzYaqsP6Z8TFZ4efWN1A==", + "version": "55.0.16", + "resolved": "https://registry.npmjs.org/expo-constants/-/expo-constants-55.0.16.tgz", + "integrity": "sha512-Z15/No94UHoogD+pulxjudGAeOHTEIWZgb/vnX48Wx5D+apWTeCbnKxQZZtGQlosvduYL5kaic2/W8U+NHfBQQ==", "license": "MIT", "peer": true, "dependencies": { - "@expo/env": "~2.1.1" + "@expo/env": "~2.1.2" }, "peerDependencies": { "expo": "*", @@ -4222,9 +4178,9 @@ } }, "node_modules/expo-font": { - "version": "55.0.6", - "resolved": "https://registry.npmjs.org/expo-font/-/expo-font-55.0.6.tgz", - "integrity": "sha512-x9czUA3UQWjIwa0ZUEs/eWJNqB4mAue/m4ltESlNPLZhHL0nWWqIfsyHmklTLFH7mVfcHSJvew6k+pR2FE1zVw==", + "version": "55.0.7", + "resolved": "https://registry.npmjs.org/expo-font/-/expo-font-55.0.7.tgz", + "integrity": "sha512-oH39Xb+3i6Y69b7YRP+P+5WLx7621t+ep/RAgLwJJYpTjs7CnSohUG+873rEtqsTAuQGi63ms7x9ZeHj1E9LYw==", "license": "MIT", "peer": true, "dependencies": { @@ -4237,9 +4193,9 @@ } }, "node_modules/expo-keep-awake": { - "version": "55.0.6", - "resolved": "https://registry.npmjs.org/expo-keep-awake/-/expo-keep-awake-55.0.6.tgz", - "integrity": "sha512-acJjeHqkNxMVckEcJhGQeIksqqsarscSHJtT559bNgyiM4r14dViQ66su7bb6qDVeBt0K7z3glXI1dHVck1Zgg==", + "version": "55.0.8", + "resolved": "https://registry.npmjs.org/expo-keep-awake/-/expo-keep-awake-55.0.8.tgz", + "integrity": "sha512-PfIpMfM+STOBwkR5XOE+yVtER86c44MD+W8QD8JxuO0sT9pF7Y1SJYakWlpvX8xsGA+bjKLxftm9403s9kQhKA==", "license": "MIT", "peer": true, "peerDependencies": { @@ -4248,13 +4204,13 @@ } }, "node_modules/expo-modules-autolinking": { - "version": "55.0.18", - "resolved": "https://registry.npmjs.org/expo-modules-autolinking/-/expo-modules-autolinking-55.0.18.tgz", - "integrity": "sha512-olGTCWYkwVPj/momcgnF+z8MTzurGNFjopqPztQ4F53UkGPJnOFEuaM2/z4KbZtKbwHqeBv34OA5hxZP8uLdaQ==", + "version": "55.0.22", + "resolved": "https://registry.npmjs.org/expo-modules-autolinking/-/expo-modules-autolinking-55.0.22.tgz", + "integrity": "sha512-13x32V0HMHJDjND4K/gU2lQIZNxYn5S5rFzujqHmnXvOO6WGrVVELpk/0p5FmBfeuQ7GGFsATbhazQk+FeukUw==", "license": "MIT", "peer": true, "dependencies": { - "@expo/require-utils": "^55.0.4", + "@expo/require-utils": "^55.0.5", "@expo/spawn-async": "^1.7.2", "chalk": "^4.1.0", "commander": "^7.2.0" @@ -4264,9 +4220,9 @@ } }, "node_modules/expo-modules-core": { - "version": "55.0.23", - "resolved": "https://registry.npmjs.org/expo-modules-core/-/expo-modules-core-55.0.23.tgz", - "integrity": "sha512-IGWT5N9MoV4zgWyrv686bElnKhzhE7E6pSazhaBNh3vgViAah5nnAz2o5h5YoUMR2B+ZTdHumRbGHN6gHLgwPA==", + "version": "55.0.25", + "resolved": "https://registry.npmjs.org/expo-modules-core/-/expo-modules-core-55.0.25.tgz", + "integrity": "sha512-yXpfg7aHLbuqoXocK34Vua6Aey5SCyqLygAsXAMbul9P8vfBjLpaOPiTJ5cLVF7Drfq8ownqVJO6qpGEtZ6GOw==", "license": "MIT", "peer": true, "dependencies": { @@ -4284,9 +4240,9 @@ } }, "node_modules/expo-server": { - "version": "55.0.8", - "resolved": "https://registry.npmjs.org/expo-server/-/expo-server-55.0.8.tgz", - "integrity": "sha512-AoV5TKuO4biSzrhe/OVLyInfTT0pV9/OOc/g/oVq5vmCjL8SaSYTkES8PLt+67Tm7VqX+Dn0+kSx1nQcjEKaPw==", + "version": "55.0.9", + "resolved": "https://registry.npmjs.org/expo-server/-/expo-server-55.0.9.tgz", + "integrity": "sha512-N5Ipn1NwqaJzEm+G97o0Jbe4g/th3R/16N1DabnYryXKCiZwDkK13/w3VfGkQN9LOOaBP+JIRxGf4M8lQKPzyA==", "license": "MIT", "peer": true, "engines": { @@ -4294,9 +4250,9 @@ } }, "node_modules/expo/node_modules/expo-file-system": { - "version": "55.0.17", - "resolved": "https://registry.npmjs.org/expo-file-system/-/expo-file-system-55.0.17.tgz", - "integrity": "sha512-d27K1cagUOt2BwxwPka9KW8Znu5kN1tnairozCzzCRZviZFtWnBxwFuJ3KU6MAbav/9UhSMkp5Ve/oZ+SR0UgQ==", + "version": "55.0.20", + "resolved": "https://registry.npmjs.org/expo-file-system/-/expo-file-system-55.0.20.tgz", + "integrity": "sha512-sBCHhNlCT3EiqCcE6xSbyvOLUAlKx7+p0qjo+c+UPyC/gMrXUdva99g25uptM+fEMwy2co25MUQQ0U0guQLOQA==", "license": "MIT", "peer": true, "peerDependencies": { @@ -4645,12 +4601,12 @@ } }, "node_modules/is-core-module": { - "version": "2.16.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", - "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "version": "2.16.2", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.2.tgz", + "integrity": "sha512-evOr8xfXKxE6qSR0hSXL2r3sd7ALj8+7jQEUvPYcm5sgZFdJ+AYzT6yNmJenvIYQBgIGwfwz08sL8zoL7yq2BA==", "license": "MIT", "dependencies": { - "hasown": "^2.0.2" + "hasown": "^2.0.3" }, "engines": { "node": ">= 0.4" @@ -5328,9 +5284,9 @@ "license": "MIT" }, "node_modules/metro": { - "version": "0.83.6", - "resolved": "https://registry.npmjs.org/metro/-/metro-0.83.6.tgz", - "integrity": "sha512-pbdndsAZ2F/ceopDdhVbttpa/hfLzXPJ/husc+QvQ33R0D9UXJKzTn5+OzOXx4bpQNtAKF2bY88cCI3Zl44xDQ==", + "version": "0.83.7", + "resolved": "https://registry.npmjs.org/metro/-/metro-0.83.7.tgz", + "integrity": "sha512-SPaPEyvTsTmd0LpT7RaZciQyDw2i/JB7+iY9L5VfBo72+psescFxBqpI1TL9dnL+pmnfkU+l/J1mEEGLeF65EQ==", "license": "MIT", "peer": true, "dependencies": { @@ -5342,7 +5298,6 @@ "@babel/traverse": "^7.29.0", "@babel/types": "^7.29.0", "accepts": "^2.0.0", - "chalk": "^4.0.0", "ci-info": "^2.0.0", "connect": "^3.6.5", "debug": "^4.4.0", @@ -5355,18 +5310,18 @@ "jest-worker": "^29.7.0", "jsc-safe-url": "^0.2.2", "lodash.throttle": "^4.1.1", - "metro-babel-transformer": "0.83.6", - "metro-cache": "0.83.6", - "metro-cache-key": "0.83.6", - "metro-config": "0.83.6", - "metro-core": "0.83.6", - "metro-file-map": "0.83.6", - "metro-resolver": "0.83.6", - "metro-runtime": "0.83.6", - "metro-source-map": "0.83.6", - "metro-symbolicate": "0.83.6", - "metro-transform-plugins": "0.83.6", - "metro-transform-worker": "0.83.6", + "metro-babel-transformer": "0.83.7", + "metro-cache": "0.83.7", + "metro-cache-key": "0.83.7", + "metro-config": "0.83.7", + "metro-core": "0.83.7", + "metro-file-map": "0.83.7", + "metro-resolver": "0.83.7", + "metro-runtime": "0.83.7", + "metro-source-map": "0.83.7", + "metro-symbolicate": "0.83.7", + "metro-transform-plugins": "0.83.7", + "metro-transform-worker": "0.83.7", "mime-types": "^3.0.1", "nullthrows": "^1.1.1", "serialize-error": "^2.1.0", @@ -5383,16 +5338,16 @@ } }, "node_modules/metro-babel-transformer": { - "version": "0.83.6", - "resolved": "https://registry.npmjs.org/metro-babel-transformer/-/metro-babel-transformer-0.83.6.tgz", - "integrity": "sha512-1AnuazBpzY3meRMr04WUw14kRBkV0W3Ez+AA75FAeNpRyWNN5S3M3PHLUbZw7IXq7ZeOzceyRsHStaFrnWd+8w==", + "version": "0.83.7", + "resolved": "https://registry.npmjs.org/metro-babel-transformer/-/metro-babel-transformer-0.83.7.tgz", + "integrity": "sha512-sBqBkt6kNut/88bv+Ucvm4yqdPetbvAEsHzi3MAgJEifOSYYzX5Z5Kgw3TFOrwf/mHJTOBG2ONlaMHoyfP15TA==", "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.83.6", + "metro-cache-key": "0.83.7", "nullthrows": "^1.1.1" }, "engines": { @@ -5417,25 +5372,25 @@ } }, "node_modules/metro-cache": { - "version": "0.83.6", - "resolved": "https://registry.npmjs.org/metro-cache/-/metro-cache-0.83.6.tgz", - "integrity": "sha512-DpvZE32feNkqfZkI4Fic7YI/Kw8QP9wdl1rC4YKPrA77wQbI9vXbxjmfkCT/EGwBTFOPKqvIXo+H3BNe93YyiQ==", + "version": "0.83.7", + "resolved": "https://registry.npmjs.org/metro-cache/-/metro-cache-0.83.7.tgz", + "integrity": "sha512-E9SRePXQ1Zvlj79VcOk57q7VC7rMHMFQ+jhmPHBiq+dJ0bJB5BL87lWZF6oh5X76Cci5tpDuQNaDwwuSCToEeg==", "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.83.6" + "metro-core": "0.83.7" }, "engines": { "node": ">=20.19.4" } }, "node_modules/metro-cache-key": { - "version": "0.83.6", - "resolved": "https://registry.npmjs.org/metro-cache-key/-/metro-cache-key-0.83.6.tgz", - "integrity": "sha512-5gdK4PVpgNOHi7xCGrgesNP1AuOA2TiPqpcirGXZi4RLLzX1VMowpkgTVtBfpQQCqWoosQF9yrSo9/KDQg1eBg==", + "version": "0.83.7", + "resolved": "https://registry.npmjs.org/metro-cache-key/-/metro-cache-key-0.83.7.tgz", + "integrity": "sha512-W1c2Nmx8MiJTJt+eWhMO08z9VKi3kZOaz99IYGdqeqDgY9j+yZjXl62rUav4Di0heZfh4/n2s722PqRL1OODeg==", "license": "MIT", "peer": true, "dependencies": { @@ -5446,19 +5401,19 @@ } }, "node_modules/metro-config": { - "version": "0.83.6", - "resolved": "https://registry.npmjs.org/metro-config/-/metro-config-0.83.6.tgz", - "integrity": "sha512-G5622400uNtnAMlppEA5zkFAZltEf7DSGhOu09BkisCxOlVMWfdosD/oPyh4f2YVQsc1MBYyp4w6OzbExTYarg==", + "version": "0.83.7", + "resolved": "https://registry.npmjs.org/metro-config/-/metro-config-0.83.7.tgz", + "integrity": "sha512-83mjWFbFOt2GeJ6pFIum5mSnc1uTsZJAtD8o4ej0s4NVsYsA7fB+pHvTfHhFrpeMONaobu2riKavkPei05Er/Q==", "license": "MIT", "peer": true, "dependencies": { "connect": "^3.6.5", "flow-enums-runtime": "^0.0.6", "jest-validate": "^29.7.0", - "metro": "0.83.6", - "metro-cache": "0.83.6", - "metro-core": "0.83.6", - "metro-runtime": "0.83.6", + "metro": "0.83.7", + "metro-cache": "0.83.7", + "metro-core": "0.83.7", + "metro-runtime": "0.83.7", "yaml": "^2.6.1" }, "engines": { @@ -5466,24 +5421,24 @@ } }, "node_modules/metro-core": { - "version": "0.83.6", - "resolved": "https://registry.npmjs.org/metro-core/-/metro-core-0.83.6.tgz", - "integrity": "sha512-l+yQ2fuIgR//wszUlMrrAa9+Z+kbKazd0QOh0VQY7jC4ghb7yZBBSla/UMYRBZZ6fPg9IM+wD3+h+37a5f9etw==", + "version": "0.83.7", + "resolved": "https://registry.npmjs.org/metro-core/-/metro-core-0.83.7.tgz", + "integrity": "sha512-6yn3w1wnltT6RQl7p7YES2l95ArC+mWrOssEiH8p5/DDrJS65/szf9LsC9JrBv8c5DdvSY3V3f0GRYg0Ox7hCg==", "license": "MIT", "peer": true, "dependencies": { "flow-enums-runtime": "^0.0.6", "lodash.throttle": "^4.1.1", - "metro-resolver": "0.83.6" + "metro-resolver": "0.83.7" }, "engines": { "node": ">=20.19.4" } }, "node_modules/metro-file-map": { - "version": "0.83.6", - "resolved": "https://registry.npmjs.org/metro-file-map/-/metro-file-map-0.83.6.tgz", - "integrity": "sha512-Jg3oN604C7GWbQwFAUXt8KsbMXeKfsxbZ5HFy4XFM3ggTS+ja9QgUmq9B613kgXv3G4M6rwiI6cvh9TRly4x3w==", + "version": "0.83.7", + "resolved": "https://registry.npmjs.org/metro-file-map/-/metro-file-map-0.83.7.tgz", + "integrity": "sha512-+j0F1m+FQYVAQ6syf+mwhIPV5GoFQrkInX8bppuc50IzNsZbMrp8R5H/Sx/K2daQ3YEa9F/XwkeZT8gzJfgeCw==", "license": "MIT", "peer": true, "dependencies": { @@ -5502,9 +5457,9 @@ } }, "node_modules/metro-minify-terser": { - "version": "0.83.6", - "resolved": "https://registry.npmjs.org/metro-minify-terser/-/metro-minify-terser-0.83.6.tgz", - "integrity": "sha512-Vx3/Ne9Q+EIEDLfKzZUOtn/rxSNa/QjlYxc42nvK4Mg8mB6XUgd3LXX5ZZVq7lzQgehgEqLrbgShJPGfeF8PnQ==", + "version": "0.83.7", + "resolved": "https://registry.npmjs.org/metro-minify-terser/-/metro-minify-terser-0.83.7.tgz", + "integrity": "sha512-MfJar2IS4tBRuLb9svwb0Gu5l9BsH+pcRm8eGcEi/wy8MzZinfinh5dFLt2nWkocnulIgtGB5NkFDdbXqMXKhQ==", "license": "MIT", "peer": true, "dependencies": { @@ -5516,9 +5471,9 @@ } }, "node_modules/metro-resolver": { - "version": "0.83.6", - "resolved": "https://registry.npmjs.org/metro-resolver/-/metro-resolver-0.83.6.tgz", - "integrity": "sha512-lAwR/FsT1uJ5iCt4AIsN3boKfJ88aN8bjvDT5FwBS0tKeKw4/sbdSTWlFxc7W/MUTN5RekJ3nQkJRIWsvs28tA==", + "version": "0.83.7", + "resolved": "https://registry.npmjs.org/metro-resolver/-/metro-resolver-0.83.7.tgz", + "integrity": "sha512-WSJIENlMcoSsuz66IfBHOkgfp3KJt2UW2TnEHPf1b8pIG2eEXNOVmo2+03A0H17WY2XGXWgxL0CG7FAopqgB1A==", "license": "MIT", "peer": true, "dependencies": { @@ -5529,9 +5484,9 @@ } }, "node_modules/metro-runtime": { - "version": "0.83.6", - "resolved": "https://registry.npmjs.org/metro-runtime/-/metro-runtime-0.83.6.tgz", - "integrity": "sha512-WQPua1G2VgYbwRn6vSKxOhTX7CFbSf/JdUu6Nd8bZnPXckOf7HQ2y51NXNQHoEsiuawathrkzL8pBhv+zgZFmg==", + "version": "0.83.7", + "resolved": "https://registry.npmjs.org/metro-runtime/-/metro-runtime-0.83.7.tgz", + "integrity": "sha512-9GKkJURaB2iyYoEExKnedzAHzxmKtSi+k0tsZUvMoU27tBZJElchYt7JH/Ai/XzYAI9lCAaV7u5HZSI8J5Z+wQ==", "license": "MIT", "peer": true, "dependencies": { @@ -5543,9 +5498,9 @@ } }, "node_modules/metro-source-map": { - "version": "0.83.6", - "resolved": "https://registry.npmjs.org/metro-source-map/-/metro-source-map-0.83.6.tgz", - "integrity": "sha512-AqJbOMMpeyyM4iNI91pchqDIszzNuuHApEhg6OABqZ+9mjLEqzcIEQ/fboZ7x74fNU5DBd2K36FdUQYPqlGClA==", + "version": "0.83.7", + "resolved": "https://registry.npmjs.org/metro-source-map/-/metro-source-map-0.83.7.tgz", + "integrity": "sha512-JgA1h7oc1a1jydBe1GhVFsUoMYo3wLPk7oRA32rjlDsq+sP2JLt9x2p2lWbNSxTm/u8NV4VRid3hvEJgcX8tKw==", "license": "MIT", "peer": true, "dependencies": { @@ -5553,9 +5508,9 @@ "@babel/types": "^7.29.0", "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", - "metro-symbolicate": "0.83.6", + "metro-symbolicate": "0.83.7", "nullthrows": "^1.1.1", - "ob1": "0.83.6", + "ob1": "0.83.7", "source-map": "^0.5.6", "vlq": "^1.0.0" }, @@ -5564,15 +5519,15 @@ } }, "node_modules/metro-symbolicate": { - "version": "0.83.6", - "resolved": "https://registry.npmjs.org/metro-symbolicate/-/metro-symbolicate-0.83.6.tgz", - "integrity": "sha512-4nvkmv9T7ozhprlPwk/+xm0SVPsxly5kYyMHdNaOlFemFz4df9BanvD46Ac6OISu/4Idinzfk2KVb++6OfzPAQ==", + "version": "0.83.7", + "resolved": "https://registry.npmjs.org/metro-symbolicate/-/metro-symbolicate-0.83.7.tgz", + "integrity": "sha512-g4suyxw20WOHWI680c+Kq4wC/NF+Hx5pRH9afrMp+sMTxqLeKcPR1Xf4wMhsjlbvx7LbIREdke6q928jEjvJWw==", "license": "MIT", "peer": true, "dependencies": { "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", - "metro-source-map": "0.83.6", + "metro-source-map": "0.83.7", "nullthrows": "^1.1.1", "source-map": "^0.5.6", "vlq": "^1.0.0" @@ -5585,9 +5540,9 @@ } }, "node_modules/metro-transform-plugins": { - "version": "0.83.6", - "resolved": "https://registry.npmjs.org/metro-transform-plugins/-/metro-transform-plugins-0.83.6.tgz", - "integrity": "sha512-V+zoY2Ul0v0BW6IokJkTud3raXmDdbdwkUQ/5eiSoy0jKuKMhrDjdH+H5buCS5iiJdNbykOn69Eip+Sqymkodg==", + "version": "0.83.7", + "resolved": "https://registry.npmjs.org/metro-transform-plugins/-/metro-transform-plugins-0.83.7.tgz", + "integrity": "sha512-Ss0FpBiZDjX2kwhukMDl5sNdYK8T/06IPqxNE4H6PTlRlfs9q11cef13c/xESY/Pm4VCkp1yJUZO3kXzvMxQFA==", "license": "MIT", "peer": true, "dependencies": { @@ -5603,9 +5558,9 @@ } }, "node_modules/metro-transform-worker": { - "version": "0.83.6", - "resolved": "https://registry.npmjs.org/metro-transform-worker/-/metro-transform-worker-0.83.6.tgz", - "integrity": "sha512-G5kDJ/P0ZTIf57t3iyAd5qIXbj2Wb1j7WtIDh82uTFQHe2Mq2SO9aXG9j1wI+kxZlIe58Z22XEXIKMl89z0ibQ==", + "version": "0.83.7", + "resolved": "https://registry.npmjs.org/metro-transform-worker/-/metro-transform-worker-0.83.7.tgz", + "integrity": "sha512-UegCo7ygB2fT64mRK2nbAjQVJ1zSwIIHy8d96jJv2nKZFDaViYBiughEdu5HM/Ceq0WN3LZrZk3zhl9aoiLYFw==", "license": "MIT", "peer": true, "dependencies": { @@ -5614,13 +5569,13 @@ "@babel/parser": "^7.29.0", "@babel/types": "^7.29.0", "flow-enums-runtime": "^0.0.6", - "metro": "0.83.6", - "metro-babel-transformer": "0.83.6", - "metro-cache": "0.83.6", - "metro-cache-key": "0.83.6", - "metro-minify-terser": "0.83.6", - "metro-source-map": "0.83.6", - "metro-transform-plugins": "0.83.6", + "metro": "0.83.7", + "metro-babel-transformer": "0.83.7", + "metro-cache": "0.83.7", + "metro-cache-key": "0.83.7", + "metro-minify-terser": "0.83.7", + "metro-source-map": "0.83.7", + "metro-transform-plugins": "0.83.7", "nullthrows": "^1.1.1" }, "engines": { @@ -5692,28 +5647,6 @@ "node": ">= 0.6" } }, - "node_modules/metro/node_modules/ws": { - "version": "7.5.10", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", - "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=8.3.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, "node_modules/micromatch": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", @@ -5845,9 +5778,9 @@ "peer": true }, "node_modules/nanoid": { - "version": "3.3.11", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", - "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "version": "3.3.12", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.12.tgz", + "integrity": "sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==", "funding": [ { "type": "github", @@ -5890,9 +5823,9 @@ "license": "MIT" }, "node_modules/node-releases": { - "version": "2.0.38", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.38.tgz", - "integrity": "sha512-3qT/88Y3FbH/Kx4szpQQ4HzUbVrHPKTLVpVocKiLfoYvw9XSGOX2FmD2d6DrXbVYyAQTF2HeF6My8jmzx7/CRw==", + "version": "2.0.44", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.44.tgz", + "integrity": "sha512-5WUyunoPMsvvEhS8AxHtRzP+oA8UCkJ7YRxatWKjngndhDGLiqEVAQKWjFAiAiuL8zMRGzGSJxFnLetoa43qGQ==", "license": "MIT" }, "node_modules/npm-package-arg": { @@ -5918,9 +5851,9 @@ "license": "MIT" }, "node_modules/ob1": { - "version": "0.83.6", - "resolved": "https://registry.npmjs.org/ob1/-/ob1-0.83.6.tgz", - "integrity": "sha512-m/xZYkwcjo6UqLMrUICEB3iHk7Bjt3RSR7KXMi6Y1MO/kGkPhoRmfUDF6KAan3rLAZ7ABRqnQyKUTwaqZgUV4w==", + "version": "0.83.7", + "resolved": "https://registry.npmjs.org/ob1/-/ob1-0.83.7.tgz", + "integrity": "sha512-9M5kpuOLyTPogMtZiQUIxdAZxl7Dxs6tVBbJErSumsqGMuhVSoUbkfeZ3XNPpLpwBBtqY5QDUzGwggLHX3slQg==", "license": "MIT", "peer": true, "dependencies": { @@ -6146,9 +6079,9 @@ } }, "node_modules/path-scurry/node_modules/lru-cache": { - "version": "11.3.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.3.5.tgz", - "integrity": "sha512-NxVFwLAnrd9i7KUBxC4DrUhmgjzOs+1Qm50D3oF1/oL+r1NpZ4gA7xvG0/zJ8evR7zIKn4vLf7qTNduWFtCrRw==", + "version": "11.4.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.4.0.tgz", + "integrity": "sha512-W+R+kFL4HgVxONq2bhXPi3bGpzGe/yEhVOp233qw9wCRtgncJ15P3bC+e4zZMu4Cq7d+WAJjXGW0uUkifhcatA==", "license": "BlueOak-1.0.0", "peer": true, "engines": { @@ -6238,9 +6171,9 @@ } }, "node_modules/postcss": { - "version": "8.5.12", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.12.tgz", - "integrity": "sha512-W62t/Se6rA0Az3DfCL0AqJwXuKwBeYg6nOaIgzP+xZ7N5BFCI7DYi1qs6ygUYT6rvfi6t9k65UMLJC+PHZpDAA==", + "version": "8.5.14", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.14.tgz", + "integrity": "sha512-SoSL4+OSEtR99LHFZQiJLkT59C5B1amGO1NzTwj7TT1qCUgUO6hxOvzkOYxD+vMrXBM3XJIKzokoERdqQq/Zmg==", "funding": [ { "type": "opencollective", @@ -6354,9 +6287,9 @@ } }, "node_modules/react": { - "version": "19.2.5", - "resolved": "https://registry.npmjs.org/react/-/react-19.2.5.tgz", - "integrity": "sha512-llUJLzz1zTUBrskt2pwZgLq59AemifIftw4aB7JxOqf1HY2FDaGDxgwpAPVzHU1kdWabH7FauP4i1oEeer2WCA==", + "version": "19.2.6", + "resolved": "https://registry.npmjs.org/react/-/react-19.2.6.tgz", + "integrity": "sha512-sfWGGfavi0xr8Pg0sVsyHMAOziVYKgPLNrS7ig+ivMNb3wbCBw3KxtflsGBAwD3gYQlE/AEZsTLgToRrSCjb0Q==", "license": "MIT", "peer": true, "engines": { @@ -6373,27 +6306,6 @@ "ws": "^7" } }, - "node_modules/react-devtools-core/node_modules/ws": { - "version": "7.5.10", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", - "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", - "license": "MIT", - "engines": { - "node": ">=8.3.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, "node_modules/react-is": { "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", @@ -6401,18 +6313,18 @@ "license": "MIT" }, "node_modules/react-native": { - "version": "0.85.2", - "resolved": "https://registry.npmjs.org/react-native/-/react-native-0.85.2.tgz", - "integrity": "sha512-GFWEPwLYirfj5X8gMtXOWtqX0cqUEURRHETZfFk37VCa4++izrKvGvv24anvuyulXV87NAhVkfNw93rLg3HByw==", - "license": "MIT", - "dependencies": { - "@react-native/assets-registry": "0.85.2", - "@react-native/codegen": "0.85.2", - "@react-native/community-cli-plugin": "0.85.2", - "@react-native/gradle-plugin": "0.85.2", - "@react-native/js-polyfills": "0.85.2", - "@react-native/normalize-colors": "0.85.2", - "@react-native/virtualized-lists": "0.85.2", + "version": "0.85.3", + "resolved": "https://registry.npmjs.org/react-native/-/react-native-0.85.3.tgz", + "integrity": "sha512-HN/fGC+3nZVcDNcw7gfbM/DuqZAvI9Mz+/SxuhODaua4JY0BPzhfTzWXRyTR4mRgMHmShTPpH2PYMTxvZrsdZA==", + "license": "MIT", + "dependencies": { + "@react-native/assets-registry": "0.85.3", + "@react-native/codegen": "0.85.3", + "@react-native/community-cli-plugin": "0.85.3", + "@react-native/gradle-plugin": "0.85.3", + "@react-native/js-polyfills": "0.85.3", + "@react-native/normalize-colors": "0.85.3", + "@react-native/virtualized-lists": "0.85.3", "abort-controller": "^3.0.0", "anser": "^1.4.9", "ansi-regex": "^5.0.0", @@ -6423,8 +6335,8 @@ "hermes-compiler": "250829098.0.10", "invariant": "^2.2.4", "memoize-one": "^5.0.0", - "metro-runtime": "^0.84.0", - "metro-source-map": "^0.84.0", + "metro-runtime": "^0.84.3", + "metro-source-map": "^0.84.3", "nullthrows": "^1.1.1", "pretty-format": "^29.7.0", "promise": "^8.3.0", @@ -6446,7 +6358,7 @@ "node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0" }, "peerDependencies": { - "@react-native/jest-preset": "0.85.2", + "@react-native/jest-preset": "0.85.3", "@types/react": "^19.1.1", "react": "^19.2.3" }, @@ -6460,9 +6372,9 @@ } }, "node_modules/react-native/node_modules/@react-native/codegen": { - "version": "0.85.2", - "resolved": "https://registry.npmjs.org/@react-native/codegen/-/codegen-0.85.2.tgz", - "integrity": "sha512-XCginmxh0//++EXVOEJHBVZxHla294FzLCFF6jXwAUjvXVhqyIKyxhABfz+r4OOmaiuWk4Rtd4arqdAzeHeprg==", + "version": "0.85.3", + "resolved": "https://registry.npmjs.org/@react-native/codegen/-/codegen-0.85.3.tgz", + "integrity": "sha512-/JkS1lGLyzBWP1FbgDwaqEf7qShIC6pUC1M0a/YMAd/v4iqR24MRkQWe7jkYvcBQ2LpEhs5NGE9InhxSv21zCA==", "license": "MIT", "dependencies": { "@babel/core": "^7.25.2", @@ -6481,9 +6393,9 @@ } }, "node_modules/react-native/node_modules/@react-native/normalize-colors": { - "version": "0.85.2", - "resolved": "https://registry.npmjs.org/@react-native/normalize-colors/-/normalize-colors-0.85.2.tgz", - "integrity": "sha512-svuOLtjbFGXDdHsriHXuND5FgHg7XlkOXCbH/8+X4t76YLH6qSTffSIQQrKLDL5mn4EFU+Oh/PNO0/FfpnTOTg==", + "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" }, "node_modules/react-native/node_modules/babel-plugin-syntax-hermes-parser": { @@ -6520,9 +6432,9 @@ } }, "node_modules/react-native/node_modules/metro-runtime": { - "version": "0.84.3", - "resolved": "https://registry.npmjs.org/metro-runtime/-/metro-runtime-0.84.3.tgz", - "integrity": "sha512-o7HLRfMyVk9N2dUZ9VjQfB6xxUItL9Pi9WcqxURE7MEKOH6wbGt9/E92YdYLluTOtkzYAEVfdC6h6lcxqA+hMQ==", + "version": "0.84.4", + "resolved": "https://registry.npmjs.org/metro-runtime/-/metro-runtime-0.84.4.tgz", + "integrity": "sha512-Jibypds4g7AhzdRKY+kDoj51s5EXMwgyp5ddtlreDAsWefMdOx+agWqgm0H2XSZ/ueanHHVM89fnf5OJnlxa8Q==", "license": "MIT", "dependencies": { "@babel/runtime": "^7.25.0", @@ -6533,18 +6445,18 @@ } }, "node_modules/react-native/node_modules/metro-source-map": { - "version": "0.84.3", - "resolved": "https://registry.npmjs.org/metro-source-map/-/metro-source-map-0.84.3.tgz", - "integrity": "sha512-jS48CeSzw78M8y6VE0f9uy3lVmfbOS677j2VCxnlmlYmnahcXuC6IhoN9K6LynNvos9517yUadcfgioju38xYQ==", + "version": "0.84.4", + "resolved": "https://registry.npmjs.org/metro-source-map/-/metro-source-map-0.84.4.tgz", + "integrity": "sha512-jbWkPxIesVuo1IWkvezmMJld6iu8nD62GsrZiV6jP37AOdbo4OBq1FJ+qkOg8sV05wAHB//jAbziuW0SlJfW4g==", "license": "MIT", "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.3", + "metro-symbolicate": "0.84.4", "nullthrows": "^1.1.1", - "ob1": "0.84.3", + "ob1": "0.84.4", "source-map": "^0.5.6", "vlq": "^1.0.0" }, @@ -6553,14 +6465,14 @@ } }, "node_modules/react-native/node_modules/metro-symbolicate": { - "version": "0.84.3", - "resolved": "https://registry.npmjs.org/metro-symbolicate/-/metro-symbolicate-0.84.3.tgz", - "integrity": "sha512-J9Tpo8NCycYrozRvBIUyOwGAu4xkawOsAppmTscFiaegK0WvuDGwIM53GbzVSnytCHjVAF0io5GQxpkrKTuc7g==", + "version": "0.84.4", + "resolved": "https://registry.npmjs.org/metro-symbolicate/-/metro-symbolicate-0.84.4.tgz", + "integrity": "sha512-OnfpacxUqGPZQ27t8qK9mFa7uqHIlVWeqRqkCbvMvreEBiamEeOn8krKtcwgP5M4cYDPwuSmCTopHMVthqG4zA==", "license": "MIT", "dependencies": { "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", - "metro-source-map": "0.84.3", + "metro-source-map": "0.84.4", "nullthrows": "^1.1.1", "source-map": "^0.5.6", "vlq": "^1.0.0" @@ -6573,9 +6485,9 @@ } }, "node_modules/react-native/node_modules/ob1": { - "version": "0.84.3", - "resolved": "https://registry.npmjs.org/ob1/-/ob1-0.84.3.tgz", - "integrity": "sha512-J7554Ef8bzmKaDY365Afq6PF+qtdnY/d5PKUQFrsKlZHV/N3OGZewVrvDrQDyX5V5NJjTpcAKtlrFZcDr+HvpQ==", + "version": "0.84.4", + "resolved": "https://registry.npmjs.org/ob1/-/ob1-0.84.4.tgz", + "integrity": "sha512-eJXMpz4aQHXF/YBB9ddqZDIS+ooO91hObo9FoW/xBkr54/zCwYYCDqT/O54vNo8kOkWs5Ou/y28NgdrV0edQNA==", "license": "MIT", "dependencies": { "flow-enums-runtime": "^0.0.6" @@ -6584,27 +6496,6 @@ "node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0" } }, - "node_modules/react-native/node_modules/ws": { - "version": "7.5.10", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", - "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", - "license": "MIT", - "engines": { - "node": ">=8.3.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, "node_modules/react-refresh": { "version": "0.14.2", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.2.tgz", @@ -6804,6 +6695,13 @@ "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", @@ -6842,9 +6740,9 @@ "license": "MIT" }, "node_modules/semver": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", - "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.0.tgz", + "integrity": "sha512-AcM7dV/5ul4EekoQ29Agm5vri8JNqRyj39o0qpX6vDF2GZrtutZl5RwgD1XnZjiTAfncsJhMI48QQH3sN87YNA==", "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -7320,9 +7218,9 @@ } }, "node_modules/terser": { - "version": "5.46.2", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.46.2.tgz", - "integrity": "sha512-uxfo9fPcSgLDYob/w1FuL0c99MWiJDnv+5qXSQc5+Ki5NjVNsYi66INnMFBjf6uFz6OnX12piJQPF4IpjJTNTw==", + "version": "5.47.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.47.1.tgz", + "integrity": "sha512-tPbLXTI6ohPASb/1YViL428oEHu6/qv1OxqYnfaonVCFHqx4+wCd95pHrQWsL5X4pl90CTyW9piSAsS2L0VoMw==", "license": "BSD-2-Clause", "dependencies": { "@jridgewell/source-map": "^0.3.3", @@ -7430,9 +7328,9 @@ } }, "node_modules/undici-types": { - "version": "7.19.2", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.19.2.tgz", - "integrity": "sha512-qYVnV5OEm2AW8cJMCpdV20CDyaN3g0AjDlOGf1OW4iaDEx8MwdtChUp4zu4H0VP3nDRF/8RKWH+IPp9uW0YGZg==", + "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==", "license": "MIT" }, "node_modules/unicode-canonical-property-names-ecmascript": { @@ -7593,9 +7491,9 @@ "license": "MIT" }, "node_modules/whatwg-url-minimum": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/whatwg-url-minimum/-/whatwg-url-minimum-0.1.1.tgz", - "integrity": "sha512-u2FNVjFVFZhdjb502KzXy1gKn1mEisQRJssmSJT8CPhZdZa0AP6VCbWlXERKyGu0l09t0k50FiDiralpGhBxgA==", + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/whatwg-url-minimum/-/whatwg-url-minimum-0.1.2.tgz", + "integrity": "sha512-XPEm0XFQWNVG292lII1PrRRJl3sItrs7CettZ4ncYxuDVpLyy+NwlGyut2hXI0JswcJUxeCH+CyOJK0ZzAXD6A==", "license": "MIT", "peer": true }, @@ -7644,11 +7542,10 @@ } }, "node_modules/ws": { - "version": "8.20.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.20.0.tgz", - "integrity": "sha512-sAt8BhgNbzCtgGbt2OxmpuryO63ZoDk/sqaB/znQm94T4fCEsy/yV+7CdC1kJhOU9lboAEU7R3kquuycDoibVA==", + "version": "8.20.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.20.1.tgz", + "integrity": "sha512-It4dO0K5v//JtTXuPkfEOaI3uUN87iYPnqo/ZzqCoG3g8uhA66QUMs/SrM0YK7/NAu+r4LMh/9dq2A7k+rHs+w==", "license": "MIT", - "peer": true, "engines": { "node": ">=10.0.0" }, @@ -7729,9 +7626,9 @@ "license": "ISC" }, "node_modules/yaml": { - "version": "2.8.3", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.3.tgz", - "integrity": "sha512-AvbaCLOO2Otw/lW5bmh9d/WEdcDFdQp2Z2ZUH3pX9U2ihyUY0nvLv7J6TrWowklRGPYbB/IuIMfYgxaCPg5Bpg==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz", + "integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==", "license": "ISC", "bin": { "yaml": "bin.mjs" diff --git a/package.json b/package.json index d792c587..50fa32fe 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.30.1", + "version": "0.32.0", "license": "BSD-3-Clause", "main": "dist/cjs/sdk.js", "exports": { @@ -49,10 +49,14 @@ "expo": "*" }, "overrides": { - "glob": "^13.0.0", + "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" + "postcss": "^8.5.12", + "ws": "^8.20.1" } } diff --git a/src/client.ts b/src/client.ts index 02077127..82519e60 100644 --- a/src/client.ts +++ b/src/client.ts @@ -180,7 +180,7 @@ class Client { 'x-sdk-name': 'React Native', 'x-sdk-platform': 'client', 'x-sdk-language': 'reactnative', - 'x-sdk-version': '0.30.1', + 'x-sdk-version': '0.32.0', 'X-Appwrite-Response-Format': '1.9.5', }; @@ -264,7 +264,6 @@ class Client { * @return {this} */ setProject(value: string): this { - this.headers['X-Appwrite-Project'] = value; this.config.project = value; return this; } @@ -676,6 +675,12 @@ class Client { } } + async ping(): Promise { + return this.call('GET', new URL(this.config.endpoint + '/ping'), { + 'X-Appwrite-Project': this.config.project, + }); + } + async call(method: string, url: URL, headers: Headers = {}, params: Payload = {}, responseType = 'json'): Promise { method = method.toUpperCase(); @@ -758,7 +763,12 @@ class Client { } if (data && typeof data === 'object') { - data.toString = () => JSONbig.stringify(data); + Object.defineProperty(data, 'toString', { + value: () => JSONbig.stringify(data), + writable: true, + enumerable: false, + configurable: true, + }); } return data; diff --git a/src/enums/theme.ts b/src/enums/browser-theme.ts similarity index 60% rename from src/enums/theme.ts rename to src/enums/browser-theme.ts index 5e823a9b..9f8c382a 100644 --- a/src/enums/theme.ts +++ b/src/enums/browser-theme.ts @@ -1,4 +1,4 @@ -export enum Theme { +export enum BrowserTheme { Light = 'light', Dark = 'dark', } \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 52bb3e2a..28a7b709 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,11 +1,13 @@ export { Client, AppwriteException } from './client'; export { Account } from './services/account'; +export { Apps } from './services/apps'; export { Avatars } from './services/avatars'; export { Databases } from './services/databases'; export { Functions } from './services/functions'; export { Graphql } from './services/graphql'; export { Locale } from './services/locale'; export { Messaging } from './services/messaging'; +export { Oauth2 } from './services/oauth-2'; export { Presences } from './services/presences'; export { Storage } from './services/storage'; export { TablesDB } from './services/tables-db'; @@ -26,7 +28,7 @@ export { OAuthProvider } from './enums/o-auth-provider'; export { Browser } from './enums/browser'; export { CreditCard } from './enums/credit-card'; export { Flag } from './enums/flag'; -export { Theme } from './enums/theme'; +export { BrowserTheme } from './enums/browser-theme'; export { Timezone } from './enums/timezone'; export { BrowserPermission } from './enums/browser-permission'; export { ImageFormat } from './enums/image-format'; diff --git a/src/models.ts b/src/models.ts index 9b0a9c7b..e49dc895 100644 --- a/src/models.ts +++ b/src/models.ts @@ -36,7 +36,7 @@ export namespace Models { /** * Presences List */ - export type PresenceList = { + export type PresenceList = { /** * Total number of presences that matched your query. */ @@ -357,13 +357,12 @@ export namespace Models { * Presence expiry date in ISO 8601 format. */ expiresAt?: string; + /** + * Presence metadata. + */ + metadata?: object; } - export type DefaultPresence = Presence & { - [key: string]: any; - [__default]: true; - }; - /** * Log */ @@ -518,6 +517,26 @@ export namespace Models { * Email verification status. */ emailVerification: boolean; + /** + * Canonical form of the user email address. + */ + emailCanonical?: string; + /** + * Whether the user email is from a free email provider. + */ + emailIsFree?: boolean; + /** + * Whether the user email is from a disposable email provider. + */ + emailIsDisposable?: boolean; + /** + * Whether the user email is from a corporate domain. + */ + emailIsCorporate?: boolean; + /** + * Whether the user email is in its canonical form. + */ + emailIsCanonical?: boolean; /** * Phone verification status. */ @@ -1073,6 +1092,10 @@ export namespace Models { * Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console. */ mfa: boolean; + /** + * Most recent access date in ISO 8601 format. Show this attribute by toggling membership privacy in the Console. + */ + userAccessedAt: string; /** * User list of roles */ @@ -1450,4 +1473,250 @@ export namespace Models { */ expired: boolean; } + + /** + * App + */ + export type App = { + /** + * App ID. + */ + $id: string; + /** + * App creation time in ISO 8601 format. + */ + $createdAt: string; + /** + * App update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * Application name. + */ + name: string; + /** + * List of authorized redirect URIs. These URIs can be used to redirect users after they authenticate. + */ + redirectUris: string[]; + /** + * Whether the app is enabled or not. + */ + enabled: boolean; + /** + * OAuth2 client type. `public` for SPAs, mobile, and native apps that cannot keep a client secret (PKCE required); `confidential` for server-side clients that authenticate with a client secret. + */ + type: string; + /** + * Whether this client may use the OAuth2 Device Authorization Grant (RFC 8628). + */ + deviceFlow: boolean; + /** + * ID of team that owns the application, if owned by team. Otherwise, user ID will be used. + */ + teamId: string; + /** + * ID of user who owns the application, if owned by user. Otherwise, team ID will be used. + */ + userId: string; + /** + * List of application secrets. + */ + secrets: AppSecret[]; + } + + /** + * AppSecret + */ + export type AppSecret = { + /** + * Secret ID. + */ + $id: string; + /** + * Secret creation time in ISO 8601 format. + */ + $createdAt: string; + /** + * Secret update time in ISO 8601 format. + */ + $updatedAt: string; + /** + * Application ID this secret belongs to. + */ + appId: string; + /** + * Hashed application client secret. + */ + secret: string; + /** + * Last few characters of the client secret, used to help identify it. + */ + hint: string; + /** + * ID of the user who created the secret. + */ + createdById: string; + /** + * Name of the user who created the secret. + */ + createdByName: string; + /** + * Time the secret was last used for authentication in ISO 8601 format. Null if never used. + */ + lastAccessedAt?: string; + } + + /** + * AppSecretPlaintext + */ + export type AppSecretPlaintext = { + /** + * Secret ID. + */ + $id: string; + /** + * Secret creation time in ISO 8601 format. + */ + $createdAt: string; + /** + * Secret update time in ISO 8601 format. + */ + $updatedAt: string; + /** + * Application ID this secret belongs to. + */ + appId: string; + /** + * Application client secret. Returned in full only when the secret is created; subsequent reads return a masked value. + */ + secret: string; + /** + * Last few characters of the client secret, used to help identify it. + */ + hint: string; + /** + * ID of the user who created the secret. + */ + createdById: string; + /** + * Name of the user who created the secret. + */ + createdByName: string; + /** + * Time the secret was last used for authentication in ISO 8601 format. Null if never used. + */ + lastAccessedAt?: string; + } + + /** + * OAuth2 Authorize + */ + export type Oauth2Authorize = { + /** + * OAuth2 grant ID. Set when the user must give explicit consent; pass it to the approve or reject endpoint. Empty when a redirect URL is returned instead. + */ + grantId: string; + /** + * URL the end user should be redirected to when the flow can complete without consent. Empty when consent is still required. + */ + redirectUrl: string; + } + + /** + * OAuth2 Approve + */ + export type Oauth2Approve = { + /** + * URL the end user should be redirected to after the grant is approved, carrying the authorization `code` and/or `id_token` along with the original `state`. + */ + redirectUrl: string; + } + + /** + * OAuth2 Reject + */ + export type Oauth2Reject = { + /** + * URL the end user should be redirected to after the grant is rejected, carrying an `access_denied` error. + */ + redirectUrl: string; + } + + /** + * OAuth2 Grant + */ + export type Oauth2Grant = { + /** + * Grant ID. + */ + $id: string; + /** + * Grant creation time in ISO 8601 format. + */ + $createdAt: string; + /** + * Grant update date in ISO 8601 format. + */ + $updatedAt: string; + /** + * ID of the user the grant belongs to. + */ + userId: string; + /** + * ID of the OAuth2 client (app) the grant was requested for. + */ + appId: string; + /** + * Requested OAuth2 scopes the user is being asked to consent to. + */ + scopes: string[]; + /** + * Requested authorization_details the user is being asked to consent to, as a JSON string. Each entry has a `type` plus project-defined fields. + */ + authorizationDetails: string; + /** + * OIDC prompt directive the consent screen should honor. Space-separated list of: login, consent, select_account. + */ + prompt: string; + /** + * Redirect URI the user will be sent to after the flow completes. + */ + redirectUri: string; + /** + * Unix timestamp of when the user last authenticated. + */ + authTime: number; + /** + * Grant expiration time in ISO 8601 format. + */ + expire: string; + } + + /** + * Apps list + */ + export type AppsList = { + /** + * Total number of apps that matched your query. + */ + total: number; + /** + * List of apps. + */ + apps: App[]; + } + + /** + * App secrets list + */ + export type AppSecretList = { + /** + * Total number of secrets that matched your query. + */ + total: number; + /** + * List of secrets. + */ + secrets: AppSecret[]; + } } diff --git a/src/services/account.ts b/src/services/account.ts index 86be09e7..14008ac3 100644 --- a/src/services/account.ts +++ b/src/services/account.ts @@ -28,6 +28,8 @@ 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); } @@ -109,7 +111,9 @@ 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); } @@ -175,7 +179,9 @@ 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); } @@ -229,6 +235,8 @@ 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); } @@ -273,6 +281,7 @@ export class Account 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); } @@ -318,7 +327,9 @@ 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); } @@ -372,6 +383,8 @@ 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); } @@ -420,7 +433,9 @@ 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); } @@ -466,7 +481,9 @@ 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); } @@ -511,7 +528,9 @@ 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); } @@ -570,7 +589,9 @@ 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); } @@ -628,7 +649,9 @@ 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); } @@ -674,6 +697,7 @@ export class Account 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); } @@ -719,6 +743,7 @@ export class Account 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); } @@ -769,7 +794,9 @@ 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); } @@ -818,7 +845,9 @@ 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); } @@ -881,7 +910,9 @@ 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); } @@ -943,7 +974,9 @@ 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); } @@ -960,6 +993,8 @@ 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); } @@ -975,6 +1010,8 @@ 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); } @@ -991,6 +1028,8 @@ 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); } @@ -1006,6 +1045,8 @@ 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); } @@ -1022,7 +1063,9 @@ 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); } @@ -1038,7 +1081,9 @@ 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); } @@ -1055,7 +1100,9 @@ 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); } @@ -1071,7 +1118,9 @@ 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); } @@ -1120,7 +1169,9 @@ 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); } @@ -1128,7 +1179,7 @@ export class Account extends Service { * 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. * * @param {string} params.password - New user password. Must be at least 8 chars. - * @param {string} params.oldPassword - Current user password. Must be at least 8 chars. + * @param {string} params.oldPassword - Current user password. Max length: 256 chars. * @throws {AppwriteException} * @returns {Promise} */ @@ -1137,7 +1188,7 @@ export class Account extends Service { * 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. * * @param {string} password - New user password. Must be at least 8 chars. - * @param {string} oldPassword - Current user password. Must be at least 8 chars. + * @param {string} oldPassword - Current user password. Max length: 256 chars. * @throws {AppwriteException} * @returns {Promise>} * @deprecated Use the object parameter style method for a better developer experience. @@ -1178,7 +1229,9 @@ 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); } @@ -1240,7 +1293,9 @@ 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); } @@ -1256,6 +1311,8 @@ 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); } @@ -1304,7 +1361,9 @@ 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); } @@ -1366,7 +1425,9 @@ 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); } @@ -1444,7 +1505,9 @@ 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); } @@ -1460,6 +1523,8 @@ 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); } @@ -1475,6 +1540,7 @@ export class Account 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); } @@ -1491,7 +1557,9 @@ 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); } @@ -1557,7 +1625,9 @@ 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); } @@ -1620,7 +1690,9 @@ 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); } @@ -1767,7 +1839,9 @@ 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); } @@ -1829,7 +1903,9 @@ 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); } @@ -1874,6 +1950,8 @@ 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); } @@ -1918,7 +1996,9 @@ 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); } @@ -1963,6 +2043,7 @@ export class Account 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); } @@ -1979,7 +2060,9 @@ 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); } @@ -2049,7 +2132,9 @@ 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); } @@ -2107,7 +2192,9 @@ 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); } @@ -2152,6 +2239,7 @@ export class Account 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); } @@ -2228,7 +2316,9 @@ 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); } @@ -2312,7 +2402,9 @@ 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); } @@ -2460,7 +2552,9 @@ 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); } @@ -2515,7 +2609,9 @@ 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); } @@ -2571,7 +2667,9 @@ 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); } @@ -2633,7 +2731,9 @@ 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); } @@ -2696,7 +2796,9 @@ 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); } @@ -2712,7 +2814,9 @@ 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); } @@ -2774,7 +2878,9 @@ 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); } }; diff --git a/src/services/apps.ts b/src/services/apps.ts new file mode 100644 index 00000000..b5a2a678 --- /dev/null +++ b/src/services/apps.ts @@ -0,0 +1,691 @@ +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'; + + +export class Apps extends Service { + + constructor(client: Client) + { + super(client); + } + + /** + * List applications. + * + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + */ + list(params?: { queries?: string[], total?: boolean }): Promise; + /** + * List applications. + * + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + list(queries?: string[], total?: boolean): Promise; + list( + paramsOrFirst?: { queries?: string[], total?: boolean } | string[], + ...rest: [(boolean)?] + ): Promise { + let params: { queries?: string[], total?: boolean }; + + if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { queries?: string[], total?: boolean }; + } else { + params = { + queries: paramsOrFirst as string[], + total: rest[0] as boolean + }; + } + + const queries = params.queries; + const total = params.total; + + const apiPath = '/apps'; + const payload: Payload = {}; + + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + + if (typeof total !== 'undefined') { + payload['total'] = total; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return this.client.call('get', uri, { + 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', + }, payload); + } + + /** + * Create a new application. + * + * @param {string} params.appId - Application ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} params.name - Application name. + * @param {string[]} params.redirectUris - Redirect URIs (array of valid URLs). + * @param {boolean} params.enabled - Is application enabled? + * @param {string} params.type - OAuth2 client type. Use `public` for SPAs, mobile, and native apps that cannot keep a `client_secret` — PKCE is then required at the token endpoint. Use `confidential` for server-side clients that present a `client_secret`. Defaults to `confidential`. + * @param {boolean} params.deviceFlow - Allow this client to use the OAuth2 Device Authorization Grant (RFC 8628) for input-constrained devices such as TVs and CLIs. Defaults to false. + * @param {string} params.teamId - Team unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + create(params: { appId: string, name: string, redirectUris: string[], enabled?: boolean, type?: string, deviceFlow?: boolean, teamId?: string }): Promise; + /** + * Create a new application. + * + * @param {string} appId - Application ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + * @param {string} name - Application name. + * @param {string[]} redirectUris - Redirect URIs (array of valid URLs). + * @param {boolean} enabled - Is application enabled? + * @param {string} type - OAuth2 client type. Use `public` for SPAs, mobile, and native apps that cannot keep a `client_secret` — PKCE is then required at the token endpoint. Use `confidential` for server-side clients that present a `client_secret`. Defaults to `confidential`. + * @param {boolean} deviceFlow - Allow this client to use the OAuth2 Device Authorization Grant (RFC 8628) for input-constrained devices such as TVs and CLIs. Defaults to false. + * @param {string} teamId - Team unique ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + create(appId: string, name: string, redirectUris: string[], enabled?: boolean, type?: string, deviceFlow?: boolean, teamId?: string): Promise; + create( + paramsOrFirst: { appId: string, name: string, redirectUris: string[], enabled?: boolean, type?: string, deviceFlow?: boolean, teamId?: string } | string, + ...rest: [(string)?, (string[])?, (boolean)?, (string)?, (boolean)?, (string)?] + ): Promise { + let params: { appId: string, name: string, redirectUris: string[], enabled?: boolean, type?: string, deviceFlow?: boolean, teamId?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { appId: string, name: string, redirectUris: string[], enabled?: boolean, type?: string, deviceFlow?: boolean, teamId?: string }; + } else { + params = { + appId: paramsOrFirst as string, + name: rest[0] as string, + redirectUris: rest[1] as string[], + enabled: rest[2] as boolean, + type: rest[3] as string, + deviceFlow: rest[4] as boolean, + teamId: rest[5] as string + }; + } + + const appId = params.appId; + const name = params.name; + const redirectUris = params.redirectUris; + const enabled = params.enabled; + const type = params.type; + const deviceFlow = params.deviceFlow; + const teamId = params.teamId; + + if (typeof appId === 'undefined') { + throw new AppwriteException('Missing required parameter: "appId"'); + } + + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + + if (typeof redirectUris === 'undefined') { + throw new AppwriteException('Missing required parameter: "redirectUris"'); + } + + const apiPath = '/apps'; + const payload: Payload = {}; + + if (typeof appId !== 'undefined') { + payload['appId'] = appId; + } + + if (typeof name !== 'undefined') { + payload['name'] = name; + } + + if (typeof redirectUris !== 'undefined') { + payload['redirectUris'] = redirectUris; + } + + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + + if (typeof type !== 'undefined') { + payload['type'] = type; + } + + if (typeof deviceFlow !== 'undefined') { + payload['deviceFlow'] = deviceFlow; + } + + if (typeof teamId !== 'undefined') { + payload['teamId'] = teamId; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return this.client.call('post', uri, { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + 'accept': 'application/json', + }, payload); + } + + /** + * Get an application by its unique ID. + * + * @param {string} params.appId - Application unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + get(params: { appId: string }): Promise; + /** + * Get an application by its unique ID. + * + * @param {string} appId - Application unique ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + get(appId: string): Promise; + get( + paramsOrFirst: { appId: string } | string + ): Promise { + let params: { appId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { appId: string }; + } else { + params = { + appId: paramsOrFirst as string + }; + } + + const appId = params.appId; + + if (typeof appId === 'undefined') { + throw new AppwriteException('Missing required parameter: "appId"'); + } + + const apiPath = '/apps/{appId}'.replace('{appId}', appId); + 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 application by its unique ID. + * + * @param {string} params.appId - Application unique ID. + * @param {string} params.name - Application name. + * @param {boolean} params.enabled - Is application enabled? + * @param {string[]} params.redirectUris - Redirect URIs (array of valid URLs). + * @param {string} params.type - OAuth2 client type. Use `public` for SPAs, mobile, and native apps that cannot keep a `client_secret` — PKCE is then required at the token endpoint. Use `confidential` for server-side clients that present a `client_secret`. Defaults to `confidential`. + * @param {boolean} params.deviceFlow - Allow this client to use the OAuth2 Device Authorization Grant (RFC 8628) for input-constrained devices such as TVs and CLIs. Defaults to false. + * @throws {AppwriteException} + * @returns {Promise} + */ + update(params: { appId: string, name: string, enabled?: boolean, redirectUris?: string[], type?: string, deviceFlow?: boolean }): Promise; + /** + * Update an application by its unique ID. + * + * @param {string} appId - Application unique ID. + * @param {string} name - Application name. + * @param {boolean} enabled - Is application enabled? + * @param {string[]} redirectUris - Redirect URIs (array of valid URLs). + * @param {string} type - OAuth2 client type. Use `public` for SPAs, mobile, and native apps that cannot keep a `client_secret` — PKCE is then required at the token endpoint. Use `confidential` for server-side clients that present a `client_secret`. Defaults to `confidential`. + * @param {boolean} deviceFlow - Allow this client to use the OAuth2 Device Authorization Grant (RFC 8628) for input-constrained devices such as TVs and CLIs. Defaults to false. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + update(appId: string, name: string, enabled?: boolean, redirectUris?: string[], type?: string, deviceFlow?: boolean): Promise; + update( + paramsOrFirst: { appId: string, name: string, enabled?: boolean, redirectUris?: string[], type?: string, deviceFlow?: boolean } | string, + ...rest: [(string)?, (boolean)?, (string[])?, (string)?, (boolean)?] + ): Promise { + let params: { appId: string, name: string, enabled?: boolean, redirectUris?: string[], type?: string, deviceFlow?: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { appId: string, name: string, enabled?: boolean, redirectUris?: string[], type?: string, deviceFlow?: boolean }; + } else { + params = { + appId: paramsOrFirst as string, + name: rest[0] as string, + enabled: rest[1] as boolean, + redirectUris: rest[2] as string[], + type: rest[3] as string, + deviceFlow: rest[4] as boolean + }; + } + + const appId = params.appId; + const name = params.name; + const enabled = params.enabled; + const redirectUris = params.redirectUris; + const type = params.type; + const deviceFlow = params.deviceFlow; + + if (typeof appId === 'undefined') { + throw new AppwriteException('Missing required parameter: "appId"'); + } + + if (typeof name === 'undefined') { + throw new AppwriteException('Missing required parameter: "name"'); + } + + const apiPath = '/apps/{appId}'.replace('{appId}', appId); + const payload: Payload = {}; + + if (typeof name !== 'undefined') { + payload['name'] = name; + } + + if (typeof enabled !== 'undefined') { + payload['enabled'] = enabled; + } + + if (typeof redirectUris !== 'undefined') { + payload['redirectUris'] = redirectUris; + } + + if (typeof type !== 'undefined') { + payload['type'] = type; + } + + if (typeof deviceFlow !== 'undefined') { + payload['deviceFlow'] = deviceFlow; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return this.client.call('put', uri, { + 'X-Appwrite-Project': this.client.config.project, + 'content-type': 'application/json', + 'accept': 'application/json', + }, payload); + } + + /** + * Delete an application by its unique ID. + * + * @param {string} params.appId - Application unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + delete(params: { appId: string }): Promise<{}>; + /** + * Delete an application by its unique ID. + * + * @param {string} appId - Application unique ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + delete(appId: string): Promise<{}>; + delete( + paramsOrFirst: { appId: string } | string + ): Promise<{}> { + let params: { appId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { appId: string }; + } else { + params = { + appId: paramsOrFirst as string + }; + } + + const appId = params.appId; + + if (typeof appId === 'undefined') { + throw new AppwriteException('Missing required parameter: "appId"'); + } + + const apiPath = '/apps/{appId}'.replace('{appId}', appId); + 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); + } + + /** + * List client secrets for an application. + * + * @param {string} params.appId - Application unique ID. + * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + */ + listSecrets(params: { appId: string, queries?: string[], total?: boolean }): Promise; + /** + * List client secrets for an application. + * + * @param {string} appId - Application unique ID. + * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. + * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + listSecrets(appId: string, queries?: string[], total?: boolean): Promise; + listSecrets( + paramsOrFirst: { appId: string, queries?: string[], total?: boolean } | string, + ...rest: [(string[])?, (boolean)?] + ): Promise { + let params: { appId: string, queries?: string[], total?: boolean }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { appId: string, queries?: string[], total?: boolean }; + } else { + params = { + appId: paramsOrFirst as string, + queries: rest[0] as string[], + total: rest[1] as boolean + }; + } + + const appId = params.appId; + const queries = params.queries; + const total = params.total; + + if (typeof appId === 'undefined') { + throw new AppwriteException('Missing required parameter: "appId"'); + } + + const apiPath = '/apps/{appId}/secrets'.replace('{appId}', appId); + const payload: Payload = {}; + + if (typeof queries !== 'undefined') { + payload['queries'] = queries; + } + + if (typeof total !== 'undefined') { + payload['total'] = total; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + return this.client.call('get', uri, { + 'X-Appwrite-Project': this.client.config.project, + 'accept': 'application/json', + }, payload); + } + + /** + * Create a new client secret for an application. + * + * @param {string} params.appId - Application unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + createSecret(params: { appId: string }): Promise; + /** + * Create a new client secret for an application. + * + * @param {string} appId - Application unique ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createSecret(appId: string): Promise; + createSecret( + paramsOrFirst: { appId: string } | string + ): Promise { + let params: { appId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { appId: string }; + } else { + params = { + appId: paramsOrFirst as string + }; + } + + const appId = params.appId; + + if (typeof appId === 'undefined') { + throw new AppwriteException('Missing required parameter: "appId"'); + } + + const apiPath = '/apps/{appId}/secrets'.replace('{appId}', appId); + 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); + } + + /** + * Get an application client secret by its unique ID. + * + * @param {string} params.appId - Application unique ID. + * @param {string} params.secretId - Secret unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + getSecret(params: { appId: string, secretId: string }): Promise; + /** + * Get an application client secret by its unique ID. + * + * @param {string} appId - Application unique ID. + * @param {string} secretId - Secret unique ID. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getSecret(appId: string, secretId: string): Promise; + getSecret( + paramsOrFirst: { appId: string, secretId: string } | string, + ...rest: [(string)?] + ): Promise { + let params: { appId: string, secretId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { appId: string, secretId: string }; + } else { + params = { + appId: paramsOrFirst as string, + secretId: rest[0] as string + }; + } + + const appId = params.appId; + const secretId = params.secretId; + + if (typeof appId === 'undefined') { + throw new AppwriteException('Missing required parameter: "appId"'); + } + + if (typeof secretId === 'undefined') { + throw new AppwriteException('Missing required parameter: "secretId"'); + } + + const apiPath = '/apps/{appId}/secrets/{secretId}'.replace('{appId}', appId).replace('{secretId}', secretId); + 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 application client secret by its unique ID. + * + * @param {string} params.appId - Application unique ID. + * @param {string} params.secretId - Secret unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + deleteSecret(params: { appId: string, secretId: string }): Promise<{}>; + /** + * Delete an application client secret by its unique ID. + * + * @param {string} appId - Application unique ID. + * @param {string} secretId - Secret unique ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deleteSecret(appId: string, secretId: string): Promise<{}>; + deleteSecret( + paramsOrFirst: { appId: string, secretId: string } | string, + ...rest: [(string)?] + ): Promise<{}> { + let params: { appId: string, secretId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { appId: string, secretId: string }; + } else { + params = { + appId: paramsOrFirst as string, + secretId: rest[0] as string + }; + } + + const appId = params.appId; + const secretId = params.secretId; + + if (typeof appId === 'undefined') { + throw new AppwriteException('Missing required parameter: "appId"'); + } + + if (typeof secretId === 'undefined') { + throw new AppwriteException('Missing required parameter: "secretId"'); + } + + const apiPath = '/apps/{appId}/secrets/{secretId}'.replace('{appId}', appId).replace('{secretId}', secretId); + 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); + } + + /** + * Transfer an application to another team by its unique ID. + * + * @param {string} params.appId - Application unique ID. + * @param {string} params.teamId - Team ID of the team to transfer application to. + * @throws {AppwriteException} + * @returns {Promise} + */ + updateTeam(params: { appId: string, teamId: string }): Promise; + /** + * Transfer an application to another team by its unique ID. + * + * @param {string} appId - Application unique ID. + * @param {string} teamId - Team ID of the team to transfer application to. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + updateTeam(appId: string, teamId: string): Promise; + updateTeam( + paramsOrFirst: { appId: string, teamId: string } | string, + ...rest: [(string)?] + ): Promise { + let params: { appId: string, teamId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { appId: string, teamId: string }; + } else { + params = { + appId: paramsOrFirst as string, + teamId: rest[0] as string + }; + } + + const appId = params.appId; + const teamId = params.teamId; + + if (typeof appId === 'undefined') { + throw new AppwriteException('Missing required parameter: "appId"'); + } + + if (typeof teamId === 'undefined') { + throw new AppwriteException('Missing required parameter: "teamId"'); + } + + const apiPath = '/apps/{appId}/team'.replace('{appId}', appId); + const payload: Payload = {}; + + if (typeof teamId !== 'undefined') { + payload['teamId'] = teamId; + } + + 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); + } + + /** + * Revoke all tokens for an application by its unique ID. + * + * @param {string} params.appId - Application unique ID. + * @throws {AppwriteException} + * @returns {Promise} + */ + deleteTokens(params: { appId: string }): Promise<{}>; + /** + * Revoke all tokens for an application by its unique ID. + * + * @param {string} appId - Application unique ID. + * @throws {AppwriteException} + * @returns {Promise<{}>} + * @deprecated Use the object parameter style method for a better developer experience. + */ + deleteTokens(appId: string): Promise<{}>; + deleteTokens( + paramsOrFirst: { appId: string } | string + ): Promise<{}> { + let params: { appId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { appId: string }; + } else { + params = { + appId: paramsOrFirst as string + }; + } + + const appId = params.appId; + + if (typeof appId === 'undefined') { + throw new AppwriteException('Missing required parameter: "appId"'); + } + + const apiPath = '/apps/{appId}/tokens'.replace('{appId}', appId); + 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/avatars.ts b/src/services/avatars.ts index 87cdc112..3ab90461 100644 --- a/src/services/avatars.ts +++ b/src/services/avatars.ts @@ -8,7 +8,7 @@ import { Platform as RNPlatform } from 'react-native'; import { Browser } from '../enums/browser'; import { CreditCard } from '../enums/credit-card'; import { Flag } from '../enums/flag'; -import { Theme } from '../enums/theme'; +import { BrowserTheme } from '../enums/browser-theme'; import { Timezone } from '../enums/timezone'; import { BrowserPermission } from '../enums/browser-permission'; import { ImageFormat } from '../enums/image-format'; @@ -96,6 +96,8 @@ export class Avatars extends Service { uri.searchParams.append(key, value); } return this.client.call('get', uri, { + 'X-Appwrite-Project': this.client.config.project, + 'accept': 'image/png', }, payload, 'arrayBuffer'); } @@ -177,6 +179,8 @@ export class Avatars extends Service { uri.searchParams.append(key, value); } return this.client.call('get', uri, { + 'X-Appwrite-Project': this.client.config.project, + 'accept': 'image/png', }, payload, 'arrayBuffer'); } @@ -235,6 +239,8 @@ export class Avatars extends Service { uri.searchParams.append(key, value); } return this.client.call('get', uri, { + 'X-Appwrite-Project': this.client.config.project, + 'accept': 'image/*', }, payload, 'arrayBuffer'); } @@ -316,6 +322,8 @@ export class Avatars extends Service { uri.searchParams.append(key, value); } return this.client.call('get', uri, { + 'X-Appwrite-Project': this.client.config.project, + 'accept': 'image/png', }, payload, 'arrayBuffer'); } @@ -395,6 +403,8 @@ export class Avatars extends Service { uri.searchParams.append(key, value); } return this.client.call('get', uri, { + 'X-Appwrite-Project': this.client.config.project, + 'accept': 'image/*', }, payload, 'arrayBuffer'); } @@ -480,6 +490,8 @@ export class Avatars extends Service { uri.searchParams.append(key, value); } return this.client.call('get', uri, { + 'X-Appwrite-Project': this.client.config.project, + 'accept': 'image/png', }, payload, 'arrayBuffer'); } @@ -561,6 +573,8 @@ export class Avatars extends Service { uri.searchParams.append(key, value); } return this.client.call('get', uri, { + 'X-Appwrite-Project': this.client.config.project, + 'accept': 'image/png', }, payload, 'arrayBuffer'); } @@ -576,7 +590,7 @@ export class Avatars extends Service { * @param {number} params.viewportWidth - Browser viewport width. Pass an integer between 1 to 1920. Defaults to 1280. * @param {number} params.viewportHeight - Browser viewport height. Pass an integer between 1 to 1080. Defaults to 720. * @param {number} params.scale - Browser scale factor. Pass a number between 0.1 to 3. Defaults to 1. - * @param {Theme} params.theme - Browser theme. Pass "light" or "dark". Defaults to "light". + * @param {BrowserTheme} params.theme - Browser theme. Pass "light" or "dark". Defaults to "light". * @param {string} params.userAgent - Custom user agent string. Defaults to browser default. * @param {boolean} params.fullpage - Capture full page scroll. Pass 0 for viewport only, or 1 for full page. Defaults to 0. * @param {string} params.locale - Browser locale (e.g., "en-US", "fr-FR"). Defaults to browser default. @@ -594,7 +608,7 @@ export class Avatars extends Service { * @throws {AppwriteException} * @returns {ArrayBuffer} */ - getScreenshot(params: { url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, 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. * @@ -607,7 +621,7 @@ export class Avatars extends Service { * @param {number} viewportWidth - Browser viewport width. Pass an integer between 1 to 1920. Defaults to 1280. * @param {number} viewportHeight - Browser viewport height. Pass an integer between 1 to 1080. Defaults to 720. * @param {number} scale - Browser scale factor. Pass a number between 0.1 to 3. Defaults to 1. - * @param {Theme} theme - Browser theme. Pass "light" or "dark". Defaults to "light". + * @param {BrowserTheme} theme - Browser theme. Pass "light" or "dark". Defaults to "light". * @param {string} userAgent - Custom user agent string. Defaults to browser default. * @param {boolean} fullpage - Capture full page scroll. Pass 0 for viewport only, or 1 for full page. Defaults to 0. * @param {string} locale - Browser locale (e.g., "en-US", "fr-FR"). Defaults to browser default. @@ -626,15 +640,15 @@ 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?: Theme, 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(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?: Theme, 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)?, (Theme)?, (string)?, (boolean)?, (string)?, (Timezone)?, (number)?, (number)?, (number)?, (boolean)?, (BrowserPermission[])?, (number)?, (number)?, (number)?, (number)?, (ImageFormat)?] + 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?: Theme, 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?: Theme, 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 }; + 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, @@ -642,7 +656,7 @@ export class Avatars extends Service { viewportWidth: rest[1] as number, viewportHeight: rest[2] as number, scale: rest[3] as number, - theme: rest[4] as Theme, + theme: rest[4] as BrowserTheme, userAgent: rest[5] as string, fullpage: rest[6] as boolean, locale: rest[7] as string, @@ -776,6 +790,8 @@ export class Avatars extends Service { uri.searchParams.append(key, value); } return this.client.call('get', uri, { + 'X-Appwrite-Project': this.client.config.project, + 'accept': 'image/png', }, payload, 'arrayBuffer'); } @@ -1100,7 +1116,7 @@ export class Avatars extends Service { * @param {number} viewportWidth * @param {number} viewportHeight * @param {number} scale - * @param {Theme} theme + * @param {BrowserTheme} theme * @param {string} userAgent * @param {boolean} fullpage * @param {string} locale @@ -1118,7 +1134,7 @@ export class Avatars extends Service { * @throws {AppwriteException} * @returns {URL} */ - getScreenshotURL(url: string, headers?: object, viewportWidth?: number, viewportHeight?: number, scale?: number, theme?: Theme, 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 = {}; diff --git a/src/services/databases.ts b/src/services/databases.ts index 9bc9cda5..354eafcd 100644 --- a/src/services/databases.ts +++ b/src/services/databases.ts @@ -54,6 +54,8 @@ 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); } @@ -98,7 +100,9 @@ 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); } @@ -143,6 +147,8 @@ 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); } @@ -204,7 +210,9 @@ 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); } @@ -249,6 +257,7 @@ 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); } @@ -303,7 +312,9 @@ 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); } @@ -390,6 +401,8 @@ 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); } @@ -484,7 +497,9 @@ 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); } @@ -563,6 +578,8 @@ 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); } @@ -649,7 +666,9 @@ 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); } @@ -736,7 +755,9 @@ 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); } @@ -807,6 +828,7 @@ 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); } @@ -902,7 +924,9 @@ 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); } @@ -997,7 +1021,9 @@ 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); } }; diff --git a/src/services/functions.ts b/src/services/functions.ts index 56454f8b..a342a7d2 100644 --- a/src/services/functions.ts +++ b/src/services/functions.ts @@ -72,6 +72,8 @@ 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); } @@ -165,7 +167,9 @@ 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': 'multipart/form-data', }, payload); } @@ -219,6 +223,8 @@ 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); } }; diff --git a/src/services/graphql.ts b/src/services/graphql.ts index 21333efd..3b384e7b 100644 --- a/src/services/graphql.ts +++ b/src/services/graphql.ts @@ -58,8 +58,10 @@ 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); } @@ -108,8 +110,10 @@ 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); } }; diff --git a/src/services/locale.ts b/src/services/locale.ts index a3173a47..5c1a6e87 100644 --- a/src/services/locale.ts +++ b/src/services/locale.ts @@ -27,6 +27,8 @@ export class Locale 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); } @@ -42,6 +44,8 @@ export class Locale 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); } @@ -57,6 +61,8 @@ export class Locale 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); } @@ -72,6 +78,8 @@ export class Locale 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); } @@ -87,6 +95,8 @@ export class Locale 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); } @@ -102,6 +112,8 @@ export class Locale 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); } @@ -117,6 +129,8 @@ export class Locale 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); } @@ -132,6 +146,8 @@ export class Locale 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); } }; diff --git a/src/services/messaging.ts b/src/services/messaging.ts index a29668a0..51d8fb73 100644 --- a/src/services/messaging.ts +++ b/src/services/messaging.ts @@ -79,7 +79,9 @@ 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); } @@ -133,6 +135,7 @@ export class Messaging 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); } diff --git a/src/services/oauth-2.ts b/src/services/oauth-2.ts new file mode 100644 index 00000000..cd9cb371 --- /dev/null +++ b/src/services/oauth-2.ts @@ -0,0 +1,409 @@ +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'; + + +export class Oauth2 extends Service { + + constructor(client: Client) + { + super(client); + } + + /** + * Approve an OAuth2 grant after the user gives consent. Returns the `redirectUrl` the end user should be sent to. The consent screen may optionally pass enriched `authorization_details` to record the concrete resources the user selected. You can pass Accept header of `application/json` to receive a JSON response instead of a redirect. + * + * @param {string} params.projectId - Project ID in which OAuth2 client that created grant during authorization exists. + * @param {string} params.grantId - Grant ID made during authorization, provided to consent screen in URL search params. + * @param {string} params.authorizationDetails - Enriched `authorization_details` the user consented to, replacing what the client requested. Each entry must use a `type` the project accepts. Optional; omit to keep the originally requested details. + * @throws {AppwriteException} + * @returns {Promise} + */ + approve(params: { projectId: string, grantId: string, authorizationDetails?: string }): Promise; + /** + * Approve an OAuth2 grant after the user gives consent. Returns the `redirectUrl` the end user should be sent to. The consent screen may optionally pass enriched `authorization_details` to record the concrete resources the user selected. You can pass Accept header of `application/json` to receive a JSON response instead of a redirect. + * + * @param {string} projectId - Project ID in which OAuth2 client that created grant during authorization exists. + * @param {string} grantId - Grant ID made during authorization, provided to consent screen in URL search params. + * @param {string} authorizationDetails - Enriched `authorization_details` the user consented to, replacing what the client requested. Each entry must use a `type` the project accepts. Optional; omit to keep the originally requested details. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + approve(projectId: string, grantId: string, authorizationDetails?: string): Promise; + approve( + paramsOrFirst: { projectId: string, grantId: string, authorizationDetails?: string } | string, + ...rest: [(string)?, (string)?] + ): Promise { + let params: { projectId: string, grantId: string, authorizationDetails?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { projectId: string, grantId: string, authorizationDetails?: string }; + } else { + params = { + projectId: paramsOrFirst as string, + grantId: rest[0] as string, + authorizationDetails: rest[1] as string + }; + } + + const projectId = params.projectId; + const grantId = params.grantId; + const authorizationDetails = params.authorizationDetails; + + if (typeof projectId === 'undefined') { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + + if (typeof grantId === 'undefined') { + throw new AppwriteException('Missing required parameter: "grantId"'); + } + + const apiPath = '/oauth2/{project_id}/approve'.replace('{project_id}', projectId); + const payload: Payload = {}; + + if (typeof grantId !== 'undefined') { + payload['grant_id'] = grantId; + } + + if (typeof authorizationDetails !== 'undefined') { + payload['authorization_details'] = authorizationDetails; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + uri.searchParams.append('project', this.client.config.project); + return this.client.call('post', uri, { + 'content-type': 'application/json', + 'accept': 'application/json', + }, payload); + } + + /** + * Begin the OAuth2 authorization flow. When called without a session, the user is redirected to the consent screen without grant ID. When called with a session, the redirect URL includes param for grant ID. You can pass Accept header of `application/json` to receive a JSON response instead of a redirect. + * + * @param {string} params.projectId - Project ID in which OAuth2 client exists. + * @param {string} params.clientId - OAuth2 client ID. + * @param {string} params.redirectUri - Redirect URI where visitor will be redirected after authorization, whether successful or not. + * @param {string} params.responseType - OAuth2 / OIDC response type. One of `code` (Authorization Code Flow), `id_token` (Implicit Flow, OIDC login only), or `code id_token` (Hybrid Flow). + * @param {string} params.scope - Space-separated OAuth2 scopes. Can include project scopes, and built-in scopes: `openid`, `email`, `profile`. + * @param {string} params.state - OAuth2 state. You receive this back in the redirect URI. + * @param {string} params.nonce - OIDC nonce parameter to prevent replay attacks. Required when response_type includes `id_token`. + * @param {string} params.codeChallenge - PKCE code challenge. Required when OAuth2 app is public. + * @param {string} params.codeChallengeMethod - PKCE code challenge method. Required when OAuth2 app is public. + * @param {string} params.prompt - OIDC prompt parameter for customization of consent screen. Space-separated list of: none, login, consent, select_account. + * @param {number} params.maxAge - OIDC max_age paraleter for customization of consent screen. Maximum allowable elapsed time in seconds since the user last authenticated. If exceeded, re-authentication is required. + * @param {string} params.authorizationDetails - Rich authorization request. JSON array of objects, each with a `type` and project-defined fields + * @throws {AppwriteException} + * @returns {Promise} + */ + authorize(params: { projectId: string, clientId: string, redirectUri: string, responseType: string, scope: string, state?: string, nonce?: string, codeChallenge?: string, codeChallengeMethod?: string, prompt?: string, maxAge?: number, authorizationDetails?: string }): Promise; + /** + * Begin the OAuth2 authorization flow. When called without a session, the user is redirected to the consent screen without grant ID. When called with a session, the redirect URL includes param for grant ID. You can pass Accept header of `application/json` to receive a JSON response instead of a redirect. + * + * @param {string} projectId - Project ID in which OAuth2 client exists. + * @param {string} clientId - OAuth2 client ID. + * @param {string} redirectUri - Redirect URI where visitor will be redirected after authorization, whether successful or not. + * @param {string} responseType - OAuth2 / OIDC response type. One of `code` (Authorization Code Flow), `id_token` (Implicit Flow, OIDC login only), or `code id_token` (Hybrid Flow). + * @param {string} scope - Space-separated OAuth2 scopes. Can include project scopes, and built-in scopes: `openid`, `email`, `profile`. + * @param {string} state - OAuth2 state. You receive this back in the redirect URI. + * @param {string} nonce - OIDC nonce parameter to prevent replay attacks. Required when response_type includes `id_token`. + * @param {string} codeChallenge - PKCE code challenge. Required when OAuth2 app is public. + * @param {string} codeChallengeMethod - PKCE code challenge method. Required when OAuth2 app is public. + * @param {string} prompt - OIDC prompt parameter for customization of consent screen. Space-separated list of: none, login, consent, select_account. + * @param {number} maxAge - OIDC max_age paraleter for customization of consent screen. Maximum allowable elapsed time in seconds since the user last authenticated. If exceeded, re-authentication is required. + * @param {string} authorizationDetails - Rich authorization request. JSON array of objects, each with a `type` and project-defined fields + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + authorize(projectId: string, clientId: string, redirectUri: string, responseType: string, scope: string, state?: string, nonce?: string, codeChallenge?: string, codeChallengeMethod?: string, prompt?: string, maxAge?: number, authorizationDetails?: string): Promise; + authorize( + paramsOrFirst: { projectId: string, clientId: string, redirectUri: string, responseType: string, scope: string, state?: string, nonce?: string, codeChallenge?: string, codeChallengeMethod?: string, prompt?: string, maxAge?: number, authorizationDetails?: string } | string, + ...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (number)?, (string)?] + ): Promise { + let params: { projectId: string, clientId: string, redirectUri: string, responseType: string, scope: string, state?: string, nonce?: string, codeChallenge?: string, codeChallengeMethod?: string, prompt?: string, maxAge?: number, authorizationDetails?: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { projectId: string, clientId: string, redirectUri: string, responseType: string, scope: string, state?: string, nonce?: string, codeChallenge?: string, codeChallengeMethod?: string, prompt?: string, maxAge?: number, authorizationDetails?: string }; + } else { + params = { + projectId: paramsOrFirst as string, + clientId: rest[0] as string, + redirectUri: rest[1] as string, + responseType: rest[2] as string, + scope: rest[3] as string, + state: rest[4] as string, + nonce: rest[5] as string, + codeChallenge: rest[6] as string, + codeChallengeMethod: rest[7] as string, + prompt: rest[8] as string, + maxAge: rest[9] as number, + authorizationDetails: rest[10] as string + }; + } + + const projectId = params.projectId; + const clientId = params.clientId; + const redirectUri = params.redirectUri; + const responseType = params.responseType; + const scope = params.scope; + const state = params.state; + const nonce = params.nonce; + const codeChallenge = params.codeChallenge; + const codeChallengeMethod = params.codeChallengeMethod; + const prompt = params.prompt; + const maxAge = params.maxAge; + const authorizationDetails = params.authorizationDetails; + + if (typeof projectId === 'undefined') { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + + if (typeof clientId === 'undefined') { + throw new AppwriteException('Missing required parameter: "clientId"'); + } + + if (typeof redirectUri === 'undefined') { + throw new AppwriteException('Missing required parameter: "redirectUri"'); + } + + if (typeof responseType === 'undefined') { + throw new AppwriteException('Missing required parameter: "responseType"'); + } + + if (typeof scope === 'undefined') { + throw new AppwriteException('Missing required parameter: "scope"'); + } + + const apiPath = '/oauth2/{project_id}/authorize'.replace('{project_id}', projectId); + const payload: Payload = {}; + + if (typeof clientId !== 'undefined') { + payload['client_id'] = clientId; + } + + if (typeof redirectUri !== 'undefined') { + payload['redirect_uri'] = redirectUri; + } + + if (typeof responseType !== 'undefined') { + payload['response_type'] = responseType; + } + + if (typeof scope !== 'undefined') { + payload['scope'] = scope; + } + + if (typeof state !== 'undefined') { + payload['state'] = state; + } + + if (typeof nonce !== 'undefined') { + payload['nonce'] = nonce; + } + + if (typeof codeChallenge !== 'undefined') { + payload['code_challenge'] = codeChallenge; + } + + if (typeof codeChallengeMethod !== 'undefined') { + payload['code_challenge_method'] = codeChallengeMethod; + } + + if (typeof prompt !== 'undefined') { + payload['prompt'] = prompt; + } + + if (typeof maxAge !== 'undefined') { + payload['max_age'] = maxAge; + } + + if (typeof authorizationDetails !== 'undefined') { + payload['authorization_details'] = authorizationDetails; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + uri.searchParams.append('project', this.client.config.project); + return this.client.call('get', uri, { + 'accept': 'application/json', + }, payload); + } + + /** + * Exchange a device flow user code for an OAuth2 grant. The authenticated user is bound to the pending grant. Pass the returned grant ID to the get grant endpoint to render the consent screen, then to the approve or reject endpoint to complete the flow. + * + * @param {string} params.projectId - Project ID in which OAuth2 client exists. + * @param {string} params.userCode - User code displayed on the device. + * @throws {AppwriteException} + * @returns {Promise} + */ + createGrant(params: { projectId: string, userCode: string }): Promise; + /** + * Exchange a device flow user code for an OAuth2 grant. The authenticated user is bound to the pending grant. Pass the returned grant ID to the get grant endpoint to render the consent screen, then to the approve or reject endpoint to complete the flow. + * + * @param {string} projectId - Project ID in which OAuth2 client exists. + * @param {string} userCode - User code displayed on the device. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + createGrant(projectId: string, userCode: string): Promise; + createGrant( + paramsOrFirst: { projectId: string, userCode: string } | string, + ...rest: [(string)?] + ): Promise { + let params: { projectId: string, userCode: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { projectId: string, userCode: string }; + } else { + params = { + projectId: paramsOrFirst as string, + userCode: rest[0] as string + }; + } + + const projectId = params.projectId; + const userCode = params.userCode; + + if (typeof projectId === 'undefined') { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + + if (typeof userCode === 'undefined') { + throw new AppwriteException('Missing required parameter: "userCode"'); + } + + const apiPath = '/oauth2/{project_id}/grants'.replace('{project_id}', projectId); + const payload: Payload = {}; + + if (typeof userCode !== 'undefined') { + payload['user_code'] = userCode; + } + + 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 OAuth2 grant by its ID. Used by the consent screen to display the details of the authorization the user is being asked to approve. A grant can only be read by the user it belongs to, or by server SDK. + * + * @param {string} params.projectId - Project ID in which OAuth2 client that created grant during authorization exists. + * @param {string} params.grantId - Grant ID made during authorization, provided to consent screen in URL search params. + * @throws {AppwriteException} + * @returns {Promise} + */ + getGrant(params: { projectId: string, grantId: string }): Promise; + /** + * Get an OAuth2 grant by its ID. Used by the consent screen to display the details of the authorization the user is being asked to approve. A grant can only be read by the user it belongs to, or by server SDK. + * + * @param {string} projectId - Project ID in which OAuth2 client that created grant during authorization exists. + * @param {string} grantId - Grant ID made during authorization, provided to consent screen in URL search params. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + getGrant(projectId: string, grantId: string): Promise; + getGrant( + paramsOrFirst: { projectId: string, grantId: string } | string, + ...rest: [(string)?] + ): Promise { + let params: { projectId: string, grantId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { projectId: string, grantId: string }; + } else { + params = { + projectId: paramsOrFirst as string, + grantId: rest[0] as string + }; + } + + const projectId = params.projectId; + const grantId = params.grantId; + + if (typeof projectId === 'undefined') { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + + if (typeof grantId === 'undefined') { + throw new AppwriteException('Missing required parameter: "grantId"'); + } + + const apiPath = '/oauth2/{project_id}/grants/{grant_id}'.replace('{project_id}', projectId).replace('{grant_id}', grantId); + 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); + } + + /** + * Reject an OAuth2 grant when the user denies consent. Returns the `redirectUrl` the end user should be sent to with an `access_denied` error. You can pass Accept header of `application/json` to receive a JSON response instead of a redirect. + * + * @param {string} params.projectId - Project ID in which OAuth2 client that created grant during authorization exists. + * @param {string} params.grantId - Grant ID made during authorization, provided to consent screen in URL search params. + * @throws {AppwriteException} + * @returns {Promise} + */ + reject(params: { projectId: string, grantId: string }): Promise; + /** + * Reject an OAuth2 grant when the user denies consent. Returns the `redirectUrl` the end user should be sent to with an `access_denied` error. You can pass Accept header of `application/json` to receive a JSON response instead of a redirect. + * + * @param {string} projectId - Project ID in which OAuth2 client that created grant during authorization exists. + * @param {string} grantId - Grant ID made during authorization, provided to consent screen in URL search params. + * @throws {AppwriteException} + * @returns {Promise} + * @deprecated Use the object parameter style method for a better developer experience. + */ + reject(projectId: string, grantId: string): Promise; + reject( + paramsOrFirst: { projectId: string, grantId: string } | string, + ...rest: [(string)?] + ): Promise { + let params: { projectId: string, grantId: string }; + + if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { + params = (paramsOrFirst || {}) as { projectId: string, grantId: string }; + } else { + params = { + projectId: paramsOrFirst as string, + grantId: rest[0] as string + }; + } + + const projectId = params.projectId; + const grantId = params.grantId; + + if (typeof projectId === 'undefined') { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + + if (typeof grantId === 'undefined') { + throw new AppwriteException('Missing required parameter: "grantId"'); + } + + const apiPath = '/oauth2/{project_id}/reject'.replace('{project_id}', projectId); + const payload: Payload = {}; + + if (typeof grantId !== 'undefined') { + payload['grant_id'] = grantId; + } + + const uri = new URL(this.client.config.endpoint + apiPath); + uri.searchParams.append('project', this.client.config.project); + return this.client.call('post', uri, { + 'content-type': 'application/json', + 'accept': 'application/json', + }, payload); + } +}; diff --git a/src/services/presences.ts b/src/services/presences.ts index acf920a8..99db891a 100644 --- a/src/services/presences.ts +++ b/src/services/presences.ts @@ -23,7 +23,7 @@ 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. * @@ -32,14 +32,14 @@ export class Presences extends Service { * @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 caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, collection, schema version (attributes and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; document writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours). * @throws {AppwriteException} - * @returns {Promise>} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - list(queries?: string[], total?: boolean, ttl?: number): Promise>; - list( + list(queries?: string[], total?: boolean, ttl?: number): Promise; + list( paramsOrFirst?: { queries?: string[], total?: boolean, ttl?: number } | string[], ...rest: [(boolean)?, (number)?] - ): Promise> { + ): Promise { let params: { queries?: string[], total?: boolean, ttl?: number }; if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { @@ -73,6 +73,8 @@ 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); } @@ -84,20 +86,20 @@ export class Presences extends Service { * @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} - * @returns {Promise} + * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - get(presenceId: string): Promise; - get( + get(presenceId: string): Promise; + get( paramsOrFirst: { presenceId: string } | string - ): Promise { + ): Promise { let params: { presenceId: string }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { @@ -119,6 +121,8 @@ 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); } @@ -134,7 +138,7 @@ 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. * @@ -145,14 +149,14 @@ export class Presences extends Service { * @param {string} expiresAt - Presence expiry datetime. * @param {object} metadata - Presence metadata object. * @throws {AppwriteException} - * @returns {Promise} + * @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( + 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)?] - ): Promise { + ): Promise { let params: { presenceId: string, status: string, permissions?: string[], expiresAt?: string, metadata?: object }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { @@ -202,7 +206,9 @@ 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); } @@ -219,7 +225,7 @@ 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. * @@ -231,14 +237,14 @@ export class Presences extends Service { * @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 {boolean} purge - When true, purge cached responses used by list presences endpoint. * @throws {AppwriteException} - * @returns {Promise} + * @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( + 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)?] - ): Promise { + ): Promise { let params: { presenceId: string, status?: string, expiresAt?: string, metadata?: object, permissions?: string[], purge?: boolean }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { @@ -290,7 +296,9 @@ 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); } @@ -337,6 +345,7 @@ export class Presences 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); } diff --git a/src/services/realtime.ts b/src/services/realtime.ts index 3f04d946..f51a2fc0 100644 --- a/src/services/realtime.ts +++ b/src/services/realtime.ts @@ -239,11 +239,13 @@ export class Realtime { try { const connectionId = ++this.connectionId; const WebSocketCtor: any = WebSocket; - const socket = (this.socket = new WebSocketCtor(url, undefined, { - headers: { - Origin: `appwrite-${Platform.OS}://${this.client.config.platform}` - } - })); + const socket = (this.socket = Platform.OS === 'web' + ? new WebSocketCtor(url) + : new WebSocketCtor(url, undefined, { + headers: { + Origin: `appwrite-${Platform.OS}://${this.client.config.platform}` + } + })); socket.addEventListener('open', () => { if (connectionId !== this.connectionId) { diff --git a/src/services/storage.ts b/src/services/storage.ts index 7ff32afb..1aa82328 100644 --- a/src/services/storage.ts +++ b/src/services/storage.ts @@ -81,6 +81,8 @@ 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); } @@ -179,12 +181,16 @@ export class Storage extends Service { 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); } const apiHeaders: { [header: string]: string } = { + 'X-Appwrite-Project': this.client.config.project, 'content-type': 'multipart/form-data', + 'accept': 'application/json', } let offset = 0; @@ -195,42 +201,139 @@ export class Storage extends Service { } catch(e) { } - let timestamp = new Date().getTime(); - while (offset < size) { - let end = Math.min(offset + Service.CHUNK_SIZE - 1, size - 1); + const totalChunks = Math.ceil(size / Service.CHUNK_SIZE); - apiHeaders['content-range'] = 'bytes ' + offset + '-' + end + '/' + size; - if (response && response.$id) { - apiHeaders['x-appwrite-id'] = response.$id; - } + // 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 }; - let chunk = await FileSystem.readAsStringAsync(file.uri, { + let firstChunk = await FileSystem.readAsStringAsync(file.uri, { encoding: FileSystem.EncodingType.Base64, - position: offset, + position: 0, length: Service.CHUNK_SIZE }); - var path = `data:${file.type};base64,${chunk}`; + var firstPath = `data:${file.type};base64,${firstChunk}`; if (RNPlatform.OS.toLowerCase() === 'android') { - path = FileSystem.cacheDirectory + '/tmp_chunk_' + timestamp; - await FileSystem.writeAsStringAsync(path, chunk, {encoding: FileSystem.EncodingType.Base64}); + firstPath = FileSystem.cacheDirectory + '/tmp_chunk_' + new Date().getTime(); + await FileSystem.writeAsStringAsync(firstPath, firstChunk, {encoding: FileSystem.EncodingType.Base64}); } - payload['file'] = { uri: path, name: file.name, type: file.type }; + payload['file'] = { uri: firstPath, name: file.name, type: file.type }; - response = await this.client.call('post', uri, apiHeaders, payload); + response = await this.client.call('post', uri, firstChunkHeaders, payload); + offset = firstChunkEnd; if (onProgress) { onProgress({ $id: response.$id, progress: (offset / size) * 100, sizeUploaded: offset, - chunksTotal: response.chunksTotal, - chunksUploaded: response.chunksUploaded + chunksTotal: totalChunks, + chunksUploaded: 1 }); } - offset += Service.CHUNK_SIZE; } - return response; + + if (offset >= size) { + return response; + } + + const uploadId = response?.$id; + const chunks: { index: number; start: number; end: number }[] = []; + const startChunkIndex = Math.ceil(offset / Service.CHUNK_SIZE); + for (let i = startChunkIndex; i < totalChunks; i++) { + const start = i * Service.CHUNK_SIZE; + const end = Math.min(start + Service.CHUNK_SIZE, size); + chunks.push({ index: i, start, end }); + } + + // Upload remaining chunks with max concurrency of 8 + const CONCURRENCY = 8; + let completedCount = startChunkIndex; + let uploadedBytes = offset; + let finalResponse = null; + let failed = false; + + const isUploadComplete = (chunkResponse: any) => { + const chunksUploaded = chunkResponse?.chunksUploaded; + const chunksTotal = chunkResponse?.chunksTotal ?? totalChunks; + return typeof chunksUploaded === 'number' && typeof chunksTotal === 'number' && chunksUploaded >= chunksTotal; + }; + + 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; + + const chunkData = await FileSystem.readAsStringAsync(file.uri, { + encoding: FileSystem.EncodingType.Base64, + position: 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}); + } + + const chunkPayload = { ...payload }; + chunkPayload['file'] = { uri: chunkPath, name: file.name, type: file.type }; + + const chunkResponse = await this.client.call('post', uri, chunkHeaders, chunkPayload); + + if (failed) { + return chunkResponse; + } + + completedCount++; + uploadedBytes += (chunk.end - chunk.start); + + response = chunkResponse; + if (isUploadComplete(chunkResponse)) { + finalResponse = chunkResponse; + } + + if (onProgress) { + onProgress({ + $id: uploadId, + progress: (uploadedBytes / size) * 100, + sizeUploaded: uploadedBytes, + chunksTotal: totalChunks, + chunksUploaded: completedCount + }); + } + + return chunkResponse; + }; + + // Process with limited concurrency using a worker pool + const queue = [...chunks]; + const workers: Promise[] = []; + const workerCount = Math.min(CONCURRENCY, queue.length); + + for (let i = 0; i < workerCount; i++) { + workers.push( + (async () => { + while (!failed && queue.length > 0) { + const chunk = queue.shift()!; + try { + await uploadChunk(chunk); + } catch (error) { + failed = true; + throw error; + } + } + })() + ); + } + + await Promise.all(workers); + + return finalResponse ?? response; } /** @@ -283,6 +386,8 @@ 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); } @@ -352,7 +457,9 @@ 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); } @@ -406,6 +513,7 @@ export class Storage 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); } @@ -474,6 +582,8 @@ export class Storage extends Service { uri.searchParams.append(key, value); } return this.client.call('get', uri, { + 'X-Appwrite-Project': this.client.config.project, + 'accept': '*/*', }, payload, 'arrayBuffer'); } @@ -629,6 +739,8 @@ export class Storage extends Service { uri.searchParams.append(key, value); } return this.client.call('get', uri, { + 'X-Appwrite-Project': this.client.config.project, + 'accept': 'image/*', }, payload, 'arrayBuffer'); } @@ -696,6 +808,8 @@ export class Storage extends Service { uri.searchParams.append(key, value); } return this.client.call('get', uri, { + 'X-Appwrite-Project': this.client.config.project, + 'accept': '*/*', }, payload, 'arrayBuffer'); } diff --git a/src/services/tables-db.ts b/src/services/tables-db.ts index 2d21b4b3..418198b3 100644 --- a/src/services/tables-db.ts +++ b/src/services/tables-db.ts @@ -54,6 +54,8 @@ 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); } @@ -98,7 +100,9 @@ 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); } @@ -143,6 +147,8 @@ 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); } @@ -204,7 +210,9 @@ 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); } @@ -249,6 +257,7 @@ 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); } @@ -303,7 +312,9 @@ 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); } @@ -389,6 +400,8 @@ 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); } @@ -482,7 +495,9 @@ 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); } @@ -560,6 +575,8 @@ 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); } @@ -645,7 +662,9 @@ 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); } @@ -731,7 +750,9 @@ 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); } @@ -801,6 +822,7 @@ 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); } @@ -895,7 +917,9 @@ 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); } @@ -989,7 +1013,9 @@ 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); } }; diff --git a/src/services/teams.ts b/src/services/teams.ts index 5af20fb3..b991637f 100644 --- a/src/services/teams.ts +++ b/src/services/teams.ts @@ -71,6 +71,8 @@ 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); } @@ -140,7 +142,9 @@ 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); } @@ -185,6 +189,8 @@ 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); } @@ -242,7 +248,9 @@ 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); } @@ -287,6 +295,7 @@ export class Teams 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); } @@ -357,6 +366,8 @@ 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); } @@ -468,7 +479,9 @@ 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); } @@ -522,6 +535,8 @@ 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); } @@ -589,7 +604,9 @@ 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); } @@ -643,6 +660,7 @@ export class Teams 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); } @@ -727,7 +745,9 @@ 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); } @@ -772,6 +792,8 @@ 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); } @@ -829,7 +851,9 @@ 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); } }; From 61772ced9effd68e213dcff32fe7a06dcff26694 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 8 Jun 2026 11:26:37 +0530 Subject: [PATCH 2/5] chore: update React Native SDK to 0.32.0 --- CHANGELOG.md | 4 - docs/examples/apps/create-secret.md | 15 - docs/examples/apps/create.md | 21 - docs/examples/apps/delete-secret.md | 16 - docs/examples/apps/delete-tokens.md | 15 - docs/examples/apps/delete.md | 15 - docs/examples/apps/get-secret.md | 16 - docs/examples/apps/get.md | 15 - docs/examples/apps/list-secrets.md | 17 - docs/examples/apps/list.md | 16 - docs/examples/apps/update-team.md | 16 - docs/examples/apps/update.md | 20 - docs/examples/oauth2/approve.md | 17 - docs/examples/oauth2/authorize.md | 26 - docs/examples/oauth2/create-grant.md | 16 - docs/examples/oauth2/get-grant.md | 16 - docs/examples/oauth2/reject.md | 16 - src/index.ts | 2 - src/models.ts | 246 ---------- src/services/apps.ts | 691 --------------------------- src/services/oauth-2.ts | 409 ---------------- 21 files changed, 1625 deletions(-) delete mode 100644 docs/examples/apps/create-secret.md delete mode 100644 docs/examples/apps/create.md delete mode 100644 docs/examples/apps/delete-secret.md delete mode 100644 docs/examples/apps/delete-tokens.md delete mode 100644 docs/examples/apps/delete.md delete mode 100644 docs/examples/apps/get-secret.md delete mode 100644 docs/examples/apps/get.md delete mode 100644 docs/examples/apps/list-secrets.md delete mode 100644 docs/examples/apps/list.md delete mode 100644 docs/examples/apps/update-team.md delete mode 100644 docs/examples/apps/update.md delete mode 100644 docs/examples/oauth2/approve.md delete mode 100644 docs/examples/oauth2/authorize.md delete mode 100644 docs/examples/oauth2/create-grant.md delete mode 100644 docs/examples/oauth2/get-grant.md delete mode 100644 docs/examples/oauth2/reject.md delete mode 100644 src/services/apps.ts delete mode 100644 src/services/oauth-2.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index ba0bfb33..63a607dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,6 @@ * Breaking: Renamed `Theme` enum to `BrowserTheme`. * Breaking: Removed `Models.DefaultPresence` and dropped the `Presence` generic from `presences` methods. -* Added: `apps` service with app and secret management methods. -* Added: `oauth2` service with `authorize`, `approve`, `reject`, `createGrant`, and `getGrant`. -* Added: `App`, `AppSecret`, `AppSecretPlaintext`, `AppsList`, and `AppSecretList` models. -* Added: `Oauth2Authorize`, `Oauth2Approve`, `Oauth2Reject`, and `Oauth2Grant` models. * Added: Email metadata fields to `User`, plus `Membership.userAccessedAt` and `Presence.metadata`. ## 0.30.1 diff --git a/docs/examples/apps/create-secret.md b/docs/examples/apps/create-secret.md deleted file mode 100644 index 04aa08c4..00000000 --- a/docs/examples/apps/create-secret.md +++ /dev/null @@ -1,15 +0,0 @@ -```javascript -import { Client, Apps } from "react-native-appwrite"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const apps = new Apps(client); - -const result = await apps.createSecret({ - appId: '' -}); - -console.log(result); -``` diff --git a/docs/examples/apps/create.md b/docs/examples/apps/create.md deleted file mode 100644 index a7436ae3..00000000 --- a/docs/examples/apps/create.md +++ /dev/null @@ -1,21 +0,0 @@ -```javascript -import { Client, Apps } from "react-native-appwrite"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const apps = new Apps(client); - -const result = await apps.create({ - appId: '', - name: '', - redirectUris: [], - enabled: false, // optional - type: 'public', // optional - deviceFlow: false, // optional - teamId: '' // optional -}); - -console.log(result); -``` diff --git a/docs/examples/apps/delete-secret.md b/docs/examples/apps/delete-secret.md deleted file mode 100644 index ec517fdf..00000000 --- a/docs/examples/apps/delete-secret.md +++ /dev/null @@ -1,16 +0,0 @@ -```javascript -import { Client, Apps } from "react-native-appwrite"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const apps = new Apps(client); - -const result = await apps.deleteSecret({ - appId: '', - secretId: '' -}); - -console.log(result); -``` diff --git a/docs/examples/apps/delete-tokens.md b/docs/examples/apps/delete-tokens.md deleted file mode 100644 index ec4bdcac..00000000 --- a/docs/examples/apps/delete-tokens.md +++ /dev/null @@ -1,15 +0,0 @@ -```javascript -import { Client, Apps } from "react-native-appwrite"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const apps = new Apps(client); - -const result = await apps.deleteTokens({ - appId: '' -}); - -console.log(result); -``` diff --git a/docs/examples/apps/delete.md b/docs/examples/apps/delete.md deleted file mode 100644 index 2d0e0cf3..00000000 --- a/docs/examples/apps/delete.md +++ /dev/null @@ -1,15 +0,0 @@ -```javascript -import { Client, Apps } from "react-native-appwrite"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const apps = new Apps(client); - -const result = await apps.delete({ - appId: '' -}); - -console.log(result); -``` diff --git a/docs/examples/apps/get-secret.md b/docs/examples/apps/get-secret.md deleted file mode 100644 index 3bd7794c..00000000 --- a/docs/examples/apps/get-secret.md +++ /dev/null @@ -1,16 +0,0 @@ -```javascript -import { Client, Apps } from "react-native-appwrite"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const apps = new Apps(client); - -const result = await apps.getSecret({ - appId: '', - secretId: '' -}); - -console.log(result); -``` diff --git a/docs/examples/apps/get.md b/docs/examples/apps/get.md deleted file mode 100644 index 6995f784..00000000 --- a/docs/examples/apps/get.md +++ /dev/null @@ -1,15 +0,0 @@ -```javascript -import { Client, Apps } from "react-native-appwrite"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const apps = new Apps(client); - -const result = await apps.get({ - appId: '' -}); - -console.log(result); -``` diff --git a/docs/examples/apps/list-secrets.md b/docs/examples/apps/list-secrets.md deleted file mode 100644 index 362be887..00000000 --- a/docs/examples/apps/list-secrets.md +++ /dev/null @@ -1,17 +0,0 @@ -```javascript -import { Client, Apps } from "react-native-appwrite"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const apps = new Apps(client); - -const result = await apps.listSecrets({ - appId: '', - queries: [], // optional - total: false // optional -}); - -console.log(result); -``` diff --git a/docs/examples/apps/list.md b/docs/examples/apps/list.md deleted file mode 100644 index b6d14871..00000000 --- a/docs/examples/apps/list.md +++ /dev/null @@ -1,16 +0,0 @@ -```javascript -import { Client, Apps } from "react-native-appwrite"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const apps = new Apps(client); - -const result = await apps.list({ - queries: [], // optional - total: false // optional -}); - -console.log(result); -``` diff --git a/docs/examples/apps/update-team.md b/docs/examples/apps/update-team.md deleted file mode 100644 index e5638faf..00000000 --- a/docs/examples/apps/update-team.md +++ /dev/null @@ -1,16 +0,0 @@ -```javascript -import { Client, Apps } from "react-native-appwrite"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const apps = new Apps(client); - -const result = await apps.updateTeam({ - appId: '', - teamId: '' -}); - -console.log(result); -``` diff --git a/docs/examples/apps/update.md b/docs/examples/apps/update.md deleted file mode 100644 index 272e69b9..00000000 --- a/docs/examples/apps/update.md +++ /dev/null @@ -1,20 +0,0 @@ -```javascript -import { Client, Apps } from "react-native-appwrite"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const apps = new Apps(client); - -const result = await apps.update({ - appId: '', - name: '', - enabled: false, // optional - redirectUris: [], // optional - type: 'public', // optional - deviceFlow: false // optional -}); - -console.log(result); -``` diff --git a/docs/examples/oauth2/approve.md b/docs/examples/oauth2/approve.md deleted file mode 100644 index dddadb47..00000000 --- a/docs/examples/oauth2/approve.md +++ /dev/null @@ -1,17 +0,0 @@ -```javascript -import { Client, Oauth2 } from "react-native-appwrite"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProjectQuery(''); // Your project ID - -const oauth2 = new Oauth2(client); - -const result = await oauth2.approve({ - projectId: '', - grantId: '', - authorizationDetails: '' // optional -}); - -console.log(result); -``` diff --git a/docs/examples/oauth2/authorize.md b/docs/examples/oauth2/authorize.md deleted file mode 100644 index fa6a2dc9..00000000 --- a/docs/examples/oauth2/authorize.md +++ /dev/null @@ -1,26 +0,0 @@ -```javascript -import { Client, Oauth2 } from "react-native-appwrite"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProjectQuery(''); // Your project ID - -const oauth2 = new Oauth2(client); - -const result = await oauth2.authorize({ - projectId: '', - clientId: '', - redirectUri: 'https://example.com', - responseType: 'code', - scope: '', - state: '', // optional - nonce: '', // optional - codeChallenge: '', // optional - codeChallengeMethod: 's256', // optional - prompt: '', // optional - maxAge: 0, // optional - authorizationDetails: '' // optional -}); - -console.log(result); -``` diff --git a/docs/examples/oauth2/create-grant.md b/docs/examples/oauth2/create-grant.md deleted file mode 100644 index 862c6499..00000000 --- a/docs/examples/oauth2/create-grant.md +++ /dev/null @@ -1,16 +0,0 @@ -```javascript -import { Client, Oauth2 } from "react-native-appwrite"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const oauth2 = new Oauth2(client); - -const result = await oauth2.createGrant({ - projectId: '', - userCode: '' -}); - -console.log(result); -``` diff --git a/docs/examples/oauth2/get-grant.md b/docs/examples/oauth2/get-grant.md deleted file mode 100644 index feea161f..00000000 --- a/docs/examples/oauth2/get-grant.md +++ /dev/null @@ -1,16 +0,0 @@ -```javascript -import { Client, Oauth2 } from "react-native-appwrite"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID - -const oauth2 = new Oauth2(client); - -const result = await oauth2.getGrant({ - projectId: '', - grantId: '' -}); - -console.log(result); -``` diff --git a/docs/examples/oauth2/reject.md b/docs/examples/oauth2/reject.md deleted file mode 100644 index c297dce6..00000000 --- a/docs/examples/oauth2/reject.md +++ /dev/null @@ -1,16 +0,0 @@ -```javascript -import { Client, Oauth2 } from "react-native-appwrite"; - -const client = new Client() - .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProjectQuery(''); // Your project ID - -const oauth2 = new Oauth2(client); - -const result = await oauth2.reject({ - projectId: '', - grantId: '' -}); - -console.log(result); -``` diff --git a/src/index.ts b/src/index.ts index 28a7b709..1905aafd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,13 +1,11 @@ export { Client, AppwriteException } from './client'; export { Account } from './services/account'; -export { Apps } from './services/apps'; export { Avatars } from './services/avatars'; export { Databases } from './services/databases'; export { Functions } from './services/functions'; export { Graphql } from './services/graphql'; export { Locale } from './services/locale'; export { Messaging } from './services/messaging'; -export { Oauth2 } from './services/oauth-2'; export { Presences } from './services/presences'; export { Storage } from './services/storage'; export { TablesDB } from './services/tables-db'; diff --git a/src/models.ts b/src/models.ts index e49dc895..6140c788 100644 --- a/src/models.ts +++ b/src/models.ts @@ -1473,250 +1473,4 @@ export namespace Models { */ expired: boolean; } - - /** - * App - */ - export type App = { - /** - * App ID. - */ - $id: string; - /** - * App creation time in ISO 8601 format. - */ - $createdAt: string; - /** - * App update date in ISO 8601 format. - */ - $updatedAt: string; - /** - * Application name. - */ - name: string; - /** - * List of authorized redirect URIs. These URIs can be used to redirect users after they authenticate. - */ - redirectUris: string[]; - /** - * Whether the app is enabled or not. - */ - enabled: boolean; - /** - * OAuth2 client type. `public` for SPAs, mobile, and native apps that cannot keep a client secret (PKCE required); `confidential` for server-side clients that authenticate with a client secret. - */ - type: string; - /** - * Whether this client may use the OAuth2 Device Authorization Grant (RFC 8628). - */ - deviceFlow: boolean; - /** - * ID of team that owns the application, if owned by team. Otherwise, user ID will be used. - */ - teamId: string; - /** - * ID of user who owns the application, if owned by user. Otherwise, team ID will be used. - */ - userId: string; - /** - * List of application secrets. - */ - secrets: AppSecret[]; - } - - /** - * AppSecret - */ - export type AppSecret = { - /** - * Secret ID. - */ - $id: string; - /** - * Secret creation time in ISO 8601 format. - */ - $createdAt: string; - /** - * Secret update time in ISO 8601 format. - */ - $updatedAt: string; - /** - * Application ID this secret belongs to. - */ - appId: string; - /** - * Hashed application client secret. - */ - secret: string; - /** - * Last few characters of the client secret, used to help identify it. - */ - hint: string; - /** - * ID of the user who created the secret. - */ - createdById: string; - /** - * Name of the user who created the secret. - */ - createdByName: string; - /** - * Time the secret was last used for authentication in ISO 8601 format. Null if never used. - */ - lastAccessedAt?: string; - } - - /** - * AppSecretPlaintext - */ - export type AppSecretPlaintext = { - /** - * Secret ID. - */ - $id: string; - /** - * Secret creation time in ISO 8601 format. - */ - $createdAt: string; - /** - * Secret update time in ISO 8601 format. - */ - $updatedAt: string; - /** - * Application ID this secret belongs to. - */ - appId: string; - /** - * Application client secret. Returned in full only when the secret is created; subsequent reads return a masked value. - */ - secret: string; - /** - * Last few characters of the client secret, used to help identify it. - */ - hint: string; - /** - * ID of the user who created the secret. - */ - createdById: string; - /** - * Name of the user who created the secret. - */ - createdByName: string; - /** - * Time the secret was last used for authentication in ISO 8601 format. Null if never used. - */ - lastAccessedAt?: string; - } - - /** - * OAuth2 Authorize - */ - export type Oauth2Authorize = { - /** - * OAuth2 grant ID. Set when the user must give explicit consent; pass it to the approve or reject endpoint. Empty when a redirect URL is returned instead. - */ - grantId: string; - /** - * URL the end user should be redirected to when the flow can complete without consent. Empty when consent is still required. - */ - redirectUrl: string; - } - - /** - * OAuth2 Approve - */ - export type Oauth2Approve = { - /** - * URL the end user should be redirected to after the grant is approved, carrying the authorization `code` and/or `id_token` along with the original `state`. - */ - redirectUrl: string; - } - - /** - * OAuth2 Reject - */ - export type Oauth2Reject = { - /** - * URL the end user should be redirected to after the grant is rejected, carrying an `access_denied` error. - */ - redirectUrl: string; - } - - /** - * OAuth2 Grant - */ - export type Oauth2Grant = { - /** - * Grant ID. - */ - $id: string; - /** - * Grant creation time in ISO 8601 format. - */ - $createdAt: string; - /** - * Grant update date in ISO 8601 format. - */ - $updatedAt: string; - /** - * ID of the user the grant belongs to. - */ - userId: string; - /** - * ID of the OAuth2 client (app) the grant was requested for. - */ - appId: string; - /** - * Requested OAuth2 scopes the user is being asked to consent to. - */ - scopes: string[]; - /** - * Requested authorization_details the user is being asked to consent to, as a JSON string. Each entry has a `type` plus project-defined fields. - */ - authorizationDetails: string; - /** - * OIDC prompt directive the consent screen should honor. Space-separated list of: login, consent, select_account. - */ - prompt: string; - /** - * Redirect URI the user will be sent to after the flow completes. - */ - redirectUri: string; - /** - * Unix timestamp of when the user last authenticated. - */ - authTime: number; - /** - * Grant expiration time in ISO 8601 format. - */ - expire: string; - } - - /** - * Apps list - */ - export type AppsList = { - /** - * Total number of apps that matched your query. - */ - total: number; - /** - * List of apps. - */ - apps: App[]; - } - - /** - * App secrets list - */ - export type AppSecretList = { - /** - * Total number of secrets that matched your query. - */ - total: number; - /** - * List of secrets. - */ - secrets: AppSecret[]; - } } diff --git a/src/services/apps.ts b/src/services/apps.ts deleted file mode 100644 index b5a2a678..00000000 --- a/src/services/apps.ts +++ /dev/null @@ -1,691 +0,0 @@ -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'; - - -export class Apps extends Service { - - constructor(client: Client) - { - super(client); - } - - /** - * List applications. - * - * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. - * @throws {AppwriteException} - * @returns {Promise} - */ - list(params?: { queries?: string[], total?: boolean }): Promise; - /** - * List applications. - * - * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - list(queries?: string[], total?: boolean): Promise; - list( - paramsOrFirst?: { queries?: string[], total?: boolean } | string[], - ...rest: [(boolean)?] - ): Promise { - let params: { queries?: string[], total?: boolean }; - - if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { queries?: string[], total?: boolean }; - } else { - params = { - queries: paramsOrFirst as string[], - total: rest[0] as boolean - }; - } - - const queries = params.queries; - const total = params.total; - - const apiPath = '/apps'; - const payload: Payload = {}; - - if (typeof queries !== 'undefined') { - payload['queries'] = queries; - } - - if (typeof total !== 'undefined') { - payload['total'] = total; - } - - const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); - } - - /** - * Create a new application. - * - * @param {string} params.appId - Application ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param {string} params.name - Application name. - * @param {string[]} params.redirectUris - Redirect URIs (array of valid URLs). - * @param {boolean} params.enabled - Is application enabled? - * @param {string} params.type - OAuth2 client type. Use `public` for SPAs, mobile, and native apps that cannot keep a `client_secret` — PKCE is then required at the token endpoint. Use `confidential` for server-side clients that present a `client_secret`. Defaults to `confidential`. - * @param {boolean} params.deviceFlow - Allow this client to use the OAuth2 Device Authorization Grant (RFC 8628) for input-constrained devices such as TVs and CLIs. Defaults to false. - * @param {string} params.teamId - Team unique ID. - * @throws {AppwriteException} - * @returns {Promise} - */ - create(params: { appId: string, name: string, redirectUris: string[], enabled?: boolean, type?: string, deviceFlow?: boolean, teamId?: string }): Promise; - /** - * Create a new application. - * - * @param {string} appId - Application ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. - * @param {string} name - Application name. - * @param {string[]} redirectUris - Redirect URIs (array of valid URLs). - * @param {boolean} enabled - Is application enabled? - * @param {string} type - OAuth2 client type. Use `public` for SPAs, mobile, and native apps that cannot keep a `client_secret` — PKCE is then required at the token endpoint. Use `confidential` for server-side clients that present a `client_secret`. Defaults to `confidential`. - * @param {boolean} deviceFlow - Allow this client to use the OAuth2 Device Authorization Grant (RFC 8628) for input-constrained devices such as TVs and CLIs. Defaults to false. - * @param {string} teamId - Team unique ID. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - create(appId: string, name: string, redirectUris: string[], enabled?: boolean, type?: string, deviceFlow?: boolean, teamId?: string): Promise; - create( - paramsOrFirst: { appId: string, name: string, redirectUris: string[], enabled?: boolean, type?: string, deviceFlow?: boolean, teamId?: string } | string, - ...rest: [(string)?, (string[])?, (boolean)?, (string)?, (boolean)?, (string)?] - ): Promise { - let params: { appId: string, name: string, redirectUris: string[], enabled?: boolean, type?: string, deviceFlow?: boolean, teamId?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { appId: string, name: string, redirectUris: string[], enabled?: boolean, type?: string, deviceFlow?: boolean, teamId?: string }; - } else { - params = { - appId: paramsOrFirst as string, - name: rest[0] as string, - redirectUris: rest[1] as string[], - enabled: rest[2] as boolean, - type: rest[3] as string, - deviceFlow: rest[4] as boolean, - teamId: rest[5] as string - }; - } - - const appId = params.appId; - const name = params.name; - const redirectUris = params.redirectUris; - const enabled = params.enabled; - const type = params.type; - const deviceFlow = params.deviceFlow; - const teamId = params.teamId; - - if (typeof appId === 'undefined') { - throw new AppwriteException('Missing required parameter: "appId"'); - } - - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - - if (typeof redirectUris === 'undefined') { - throw new AppwriteException('Missing required parameter: "redirectUris"'); - } - - const apiPath = '/apps'; - const payload: Payload = {}; - - if (typeof appId !== 'undefined') { - payload['appId'] = appId; - } - - if (typeof name !== 'undefined') { - payload['name'] = name; - } - - if (typeof redirectUris !== 'undefined') { - payload['redirectUris'] = redirectUris; - } - - if (typeof enabled !== 'undefined') { - payload['enabled'] = enabled; - } - - if (typeof type !== 'undefined') { - payload['type'] = type; - } - - if (typeof deviceFlow !== 'undefined') { - payload['deviceFlow'] = deviceFlow; - } - - if (typeof teamId !== 'undefined') { - payload['teamId'] = teamId; - } - - const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('post', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); - } - - /** - * Get an application by its unique ID. - * - * @param {string} params.appId - Application unique ID. - * @throws {AppwriteException} - * @returns {Promise} - */ - get(params: { appId: string }): Promise; - /** - * Get an application by its unique ID. - * - * @param {string} appId - Application unique ID. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - get(appId: string): Promise; - get( - paramsOrFirst: { appId: string } | string - ): Promise { - let params: { appId: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { appId: string }; - } else { - params = { - appId: paramsOrFirst as string - }; - } - - const appId = params.appId; - - if (typeof appId === 'undefined') { - throw new AppwriteException('Missing required parameter: "appId"'); - } - - const apiPath = '/apps/{appId}'.replace('{appId}', appId); - 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 application by its unique ID. - * - * @param {string} params.appId - Application unique ID. - * @param {string} params.name - Application name. - * @param {boolean} params.enabled - Is application enabled? - * @param {string[]} params.redirectUris - Redirect URIs (array of valid URLs). - * @param {string} params.type - OAuth2 client type. Use `public` for SPAs, mobile, and native apps that cannot keep a `client_secret` — PKCE is then required at the token endpoint. Use `confidential` for server-side clients that present a `client_secret`. Defaults to `confidential`. - * @param {boolean} params.deviceFlow - Allow this client to use the OAuth2 Device Authorization Grant (RFC 8628) for input-constrained devices such as TVs and CLIs. Defaults to false. - * @throws {AppwriteException} - * @returns {Promise} - */ - update(params: { appId: string, name: string, enabled?: boolean, redirectUris?: string[], type?: string, deviceFlow?: boolean }): Promise; - /** - * Update an application by its unique ID. - * - * @param {string} appId - Application unique ID. - * @param {string} name - Application name. - * @param {boolean} enabled - Is application enabled? - * @param {string[]} redirectUris - Redirect URIs (array of valid URLs). - * @param {string} type - OAuth2 client type. Use `public` for SPAs, mobile, and native apps that cannot keep a `client_secret` — PKCE is then required at the token endpoint. Use `confidential` for server-side clients that present a `client_secret`. Defaults to `confidential`. - * @param {boolean} deviceFlow - Allow this client to use the OAuth2 Device Authorization Grant (RFC 8628) for input-constrained devices such as TVs and CLIs. Defaults to false. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - update(appId: string, name: string, enabled?: boolean, redirectUris?: string[], type?: string, deviceFlow?: boolean): Promise; - update( - paramsOrFirst: { appId: string, name: string, enabled?: boolean, redirectUris?: string[], type?: string, deviceFlow?: boolean } | string, - ...rest: [(string)?, (boolean)?, (string[])?, (string)?, (boolean)?] - ): Promise { - let params: { appId: string, name: string, enabled?: boolean, redirectUris?: string[], type?: string, deviceFlow?: boolean }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { appId: string, name: string, enabled?: boolean, redirectUris?: string[], type?: string, deviceFlow?: boolean }; - } else { - params = { - appId: paramsOrFirst as string, - name: rest[0] as string, - enabled: rest[1] as boolean, - redirectUris: rest[2] as string[], - type: rest[3] as string, - deviceFlow: rest[4] as boolean - }; - } - - const appId = params.appId; - const name = params.name; - const enabled = params.enabled; - const redirectUris = params.redirectUris; - const type = params.type; - const deviceFlow = params.deviceFlow; - - if (typeof appId === 'undefined') { - throw new AppwriteException('Missing required parameter: "appId"'); - } - - if (typeof name === 'undefined') { - throw new AppwriteException('Missing required parameter: "name"'); - } - - const apiPath = '/apps/{appId}'.replace('{appId}', appId); - const payload: Payload = {}; - - if (typeof name !== 'undefined') { - payload['name'] = name; - } - - if (typeof enabled !== 'undefined') { - payload['enabled'] = enabled; - } - - if (typeof redirectUris !== 'undefined') { - payload['redirectUris'] = redirectUris; - } - - if (typeof type !== 'undefined') { - payload['type'] = type; - } - - if (typeof deviceFlow !== 'undefined') { - payload['deviceFlow'] = deviceFlow; - } - - const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('put', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); - } - - /** - * Delete an application by its unique ID. - * - * @param {string} params.appId - Application unique ID. - * @throws {AppwriteException} - * @returns {Promise} - */ - delete(params: { appId: string }): Promise<{}>; - /** - * Delete an application by its unique ID. - * - * @param {string} appId - Application unique ID. - * @throws {AppwriteException} - * @returns {Promise<{}>} - * @deprecated Use the object parameter style method for a better developer experience. - */ - delete(appId: string): Promise<{}>; - delete( - paramsOrFirst: { appId: string } | string - ): Promise<{}> { - let params: { appId: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { appId: string }; - } else { - params = { - appId: paramsOrFirst as string - }; - } - - const appId = params.appId; - - if (typeof appId === 'undefined') { - throw new AppwriteException('Missing required parameter: "appId"'); - } - - const apiPath = '/apps/{appId}'.replace('{appId}', appId); - 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); - } - - /** - * List client secrets for an application. - * - * @param {string} params.appId - Application unique ID. - * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated. - * @throws {AppwriteException} - * @returns {Promise} - */ - listSecrets(params: { appId: string, queries?: string[], total?: boolean }): Promise; - /** - * List client secrets for an application. - * - * @param {string} appId - Application unique ID. - * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. - * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - listSecrets(appId: string, queries?: string[], total?: boolean): Promise; - listSecrets( - paramsOrFirst: { appId: string, queries?: string[], total?: boolean } | string, - ...rest: [(string[])?, (boolean)?] - ): Promise { - let params: { appId: string, queries?: string[], total?: boolean }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { appId: string, queries?: string[], total?: boolean }; - } else { - params = { - appId: paramsOrFirst as string, - queries: rest[0] as string[], - total: rest[1] as boolean - }; - } - - const appId = params.appId; - const queries = params.queries; - const total = params.total; - - if (typeof appId === 'undefined') { - throw new AppwriteException('Missing required parameter: "appId"'); - } - - const apiPath = '/apps/{appId}/secrets'.replace('{appId}', appId); - const payload: Payload = {}; - - if (typeof queries !== 'undefined') { - payload['queries'] = queries; - } - - if (typeof total !== 'undefined') { - payload['total'] = total; - } - - const uri = new URL(this.client.config.endpoint + apiPath); - return this.client.call('get', uri, { - 'X-Appwrite-Project': this.client.config.project, - 'accept': 'application/json', - }, payload); - } - - /** - * Create a new client secret for an application. - * - * @param {string} params.appId - Application unique ID. - * @throws {AppwriteException} - * @returns {Promise} - */ - createSecret(params: { appId: string }): Promise; - /** - * Create a new client secret for an application. - * - * @param {string} appId - Application unique ID. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - createSecret(appId: string): Promise; - createSecret( - paramsOrFirst: { appId: string } | string - ): Promise { - let params: { appId: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { appId: string }; - } else { - params = { - appId: paramsOrFirst as string - }; - } - - const appId = params.appId; - - if (typeof appId === 'undefined') { - throw new AppwriteException('Missing required parameter: "appId"'); - } - - const apiPath = '/apps/{appId}/secrets'.replace('{appId}', appId); - 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); - } - - /** - * Get an application client secret by its unique ID. - * - * @param {string} params.appId - Application unique ID. - * @param {string} params.secretId - Secret unique ID. - * @throws {AppwriteException} - * @returns {Promise} - */ - getSecret(params: { appId: string, secretId: string }): Promise; - /** - * Get an application client secret by its unique ID. - * - * @param {string} appId - Application unique ID. - * @param {string} secretId - Secret unique ID. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getSecret(appId: string, secretId: string): Promise; - getSecret( - paramsOrFirst: { appId: string, secretId: string } | string, - ...rest: [(string)?] - ): Promise { - let params: { appId: string, secretId: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { appId: string, secretId: string }; - } else { - params = { - appId: paramsOrFirst as string, - secretId: rest[0] as string - }; - } - - const appId = params.appId; - const secretId = params.secretId; - - if (typeof appId === 'undefined') { - throw new AppwriteException('Missing required parameter: "appId"'); - } - - if (typeof secretId === 'undefined') { - throw new AppwriteException('Missing required parameter: "secretId"'); - } - - const apiPath = '/apps/{appId}/secrets/{secretId}'.replace('{appId}', appId).replace('{secretId}', secretId); - 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 application client secret by its unique ID. - * - * @param {string} params.appId - Application unique ID. - * @param {string} params.secretId - Secret unique ID. - * @throws {AppwriteException} - * @returns {Promise} - */ - deleteSecret(params: { appId: string, secretId: string }): Promise<{}>; - /** - * Delete an application client secret by its unique ID. - * - * @param {string} appId - Application unique ID. - * @param {string} secretId - Secret unique ID. - * @throws {AppwriteException} - * @returns {Promise<{}>} - * @deprecated Use the object parameter style method for a better developer experience. - */ - deleteSecret(appId: string, secretId: string): Promise<{}>; - deleteSecret( - paramsOrFirst: { appId: string, secretId: string } | string, - ...rest: [(string)?] - ): Promise<{}> { - let params: { appId: string, secretId: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { appId: string, secretId: string }; - } else { - params = { - appId: paramsOrFirst as string, - secretId: rest[0] as string - }; - } - - const appId = params.appId; - const secretId = params.secretId; - - if (typeof appId === 'undefined') { - throw new AppwriteException('Missing required parameter: "appId"'); - } - - if (typeof secretId === 'undefined') { - throw new AppwriteException('Missing required parameter: "secretId"'); - } - - const apiPath = '/apps/{appId}/secrets/{secretId}'.replace('{appId}', appId).replace('{secretId}', secretId); - 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); - } - - /** - * Transfer an application to another team by its unique ID. - * - * @param {string} params.appId - Application unique ID. - * @param {string} params.teamId - Team ID of the team to transfer application to. - * @throws {AppwriteException} - * @returns {Promise} - */ - updateTeam(params: { appId: string, teamId: string }): Promise; - /** - * Transfer an application to another team by its unique ID. - * - * @param {string} appId - Application unique ID. - * @param {string} teamId - Team ID of the team to transfer application to. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - updateTeam(appId: string, teamId: string): Promise; - updateTeam( - paramsOrFirst: { appId: string, teamId: string } | string, - ...rest: [(string)?] - ): Promise { - let params: { appId: string, teamId: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { appId: string, teamId: string }; - } else { - params = { - appId: paramsOrFirst as string, - teamId: rest[0] as string - }; - } - - const appId = params.appId; - const teamId = params.teamId; - - if (typeof appId === 'undefined') { - throw new AppwriteException('Missing required parameter: "appId"'); - } - - if (typeof teamId === 'undefined') { - throw new AppwriteException('Missing required parameter: "teamId"'); - } - - const apiPath = '/apps/{appId}/team'.replace('{appId}', appId); - const payload: Payload = {}; - - if (typeof teamId !== 'undefined') { - payload['teamId'] = teamId; - } - - 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); - } - - /** - * Revoke all tokens for an application by its unique ID. - * - * @param {string} params.appId - Application unique ID. - * @throws {AppwriteException} - * @returns {Promise} - */ - deleteTokens(params: { appId: string }): Promise<{}>; - /** - * Revoke all tokens for an application by its unique ID. - * - * @param {string} appId - Application unique ID. - * @throws {AppwriteException} - * @returns {Promise<{}>} - * @deprecated Use the object parameter style method for a better developer experience. - */ - deleteTokens(appId: string): Promise<{}>; - deleteTokens( - paramsOrFirst: { appId: string } | string - ): Promise<{}> { - let params: { appId: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { appId: string }; - } else { - params = { - appId: paramsOrFirst as string - }; - } - - const appId = params.appId; - - if (typeof appId === 'undefined') { - throw new AppwriteException('Missing required parameter: "appId"'); - } - - const apiPath = '/apps/{appId}/tokens'.replace('{appId}', appId); - 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/oauth-2.ts b/src/services/oauth-2.ts deleted file mode 100644 index cd9cb371..00000000 --- a/src/services/oauth-2.ts +++ /dev/null @@ -1,409 +0,0 @@ -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'; - - -export class Oauth2 extends Service { - - constructor(client: Client) - { - super(client); - } - - /** - * Approve an OAuth2 grant after the user gives consent. Returns the `redirectUrl` the end user should be sent to. The consent screen may optionally pass enriched `authorization_details` to record the concrete resources the user selected. You can pass Accept header of `application/json` to receive a JSON response instead of a redirect. - * - * @param {string} params.projectId - Project ID in which OAuth2 client that created grant during authorization exists. - * @param {string} params.grantId - Grant ID made during authorization, provided to consent screen in URL search params. - * @param {string} params.authorizationDetails - Enriched `authorization_details` the user consented to, replacing what the client requested. Each entry must use a `type` the project accepts. Optional; omit to keep the originally requested details. - * @throws {AppwriteException} - * @returns {Promise} - */ - approve(params: { projectId: string, grantId: string, authorizationDetails?: string }): Promise; - /** - * Approve an OAuth2 grant after the user gives consent. Returns the `redirectUrl` the end user should be sent to. The consent screen may optionally pass enriched `authorization_details` to record the concrete resources the user selected. You can pass Accept header of `application/json` to receive a JSON response instead of a redirect. - * - * @param {string} projectId - Project ID in which OAuth2 client that created grant during authorization exists. - * @param {string} grantId - Grant ID made during authorization, provided to consent screen in URL search params. - * @param {string} authorizationDetails - Enriched `authorization_details` the user consented to, replacing what the client requested. Each entry must use a `type` the project accepts. Optional; omit to keep the originally requested details. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - approve(projectId: string, grantId: string, authorizationDetails?: string): Promise; - approve( - paramsOrFirst: { projectId: string, grantId: string, authorizationDetails?: string } | string, - ...rest: [(string)?, (string)?] - ): Promise { - let params: { projectId: string, grantId: string, authorizationDetails?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { projectId: string, grantId: string, authorizationDetails?: string }; - } else { - params = { - projectId: paramsOrFirst as string, - grantId: rest[0] as string, - authorizationDetails: rest[1] as string - }; - } - - const projectId = params.projectId; - const grantId = params.grantId; - const authorizationDetails = params.authorizationDetails; - - if (typeof projectId === 'undefined') { - throw new AppwriteException('Missing required parameter: "projectId"'); - } - - if (typeof grantId === 'undefined') { - throw new AppwriteException('Missing required parameter: "grantId"'); - } - - const apiPath = '/oauth2/{project_id}/approve'.replace('{project_id}', projectId); - const payload: Payload = {}; - - if (typeof grantId !== 'undefined') { - payload['grant_id'] = grantId; - } - - if (typeof authorizationDetails !== 'undefined') { - payload['authorization_details'] = authorizationDetails; - } - - const uri = new URL(this.client.config.endpoint + apiPath); - uri.searchParams.append('project', this.client.config.project); - return this.client.call('post', uri, { - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); - } - - /** - * Begin the OAuth2 authorization flow. When called without a session, the user is redirected to the consent screen without grant ID. When called with a session, the redirect URL includes param for grant ID. You can pass Accept header of `application/json` to receive a JSON response instead of a redirect. - * - * @param {string} params.projectId - Project ID in which OAuth2 client exists. - * @param {string} params.clientId - OAuth2 client ID. - * @param {string} params.redirectUri - Redirect URI where visitor will be redirected after authorization, whether successful or not. - * @param {string} params.responseType - OAuth2 / OIDC response type. One of `code` (Authorization Code Flow), `id_token` (Implicit Flow, OIDC login only), or `code id_token` (Hybrid Flow). - * @param {string} params.scope - Space-separated OAuth2 scopes. Can include project scopes, and built-in scopes: `openid`, `email`, `profile`. - * @param {string} params.state - OAuth2 state. You receive this back in the redirect URI. - * @param {string} params.nonce - OIDC nonce parameter to prevent replay attacks. Required when response_type includes `id_token`. - * @param {string} params.codeChallenge - PKCE code challenge. Required when OAuth2 app is public. - * @param {string} params.codeChallengeMethod - PKCE code challenge method. Required when OAuth2 app is public. - * @param {string} params.prompt - OIDC prompt parameter for customization of consent screen. Space-separated list of: none, login, consent, select_account. - * @param {number} params.maxAge - OIDC max_age paraleter for customization of consent screen. Maximum allowable elapsed time in seconds since the user last authenticated. If exceeded, re-authentication is required. - * @param {string} params.authorizationDetails - Rich authorization request. JSON array of objects, each with a `type` and project-defined fields - * @throws {AppwriteException} - * @returns {Promise} - */ - authorize(params: { projectId: string, clientId: string, redirectUri: string, responseType: string, scope: string, state?: string, nonce?: string, codeChallenge?: string, codeChallengeMethod?: string, prompt?: string, maxAge?: number, authorizationDetails?: string }): Promise; - /** - * Begin the OAuth2 authorization flow. When called without a session, the user is redirected to the consent screen without grant ID. When called with a session, the redirect URL includes param for grant ID. You can pass Accept header of `application/json` to receive a JSON response instead of a redirect. - * - * @param {string} projectId - Project ID in which OAuth2 client exists. - * @param {string} clientId - OAuth2 client ID. - * @param {string} redirectUri - Redirect URI where visitor will be redirected after authorization, whether successful or not. - * @param {string} responseType - OAuth2 / OIDC response type. One of `code` (Authorization Code Flow), `id_token` (Implicit Flow, OIDC login only), or `code id_token` (Hybrid Flow). - * @param {string} scope - Space-separated OAuth2 scopes. Can include project scopes, and built-in scopes: `openid`, `email`, `profile`. - * @param {string} state - OAuth2 state. You receive this back in the redirect URI. - * @param {string} nonce - OIDC nonce parameter to prevent replay attacks. Required when response_type includes `id_token`. - * @param {string} codeChallenge - PKCE code challenge. Required when OAuth2 app is public. - * @param {string} codeChallengeMethod - PKCE code challenge method. Required when OAuth2 app is public. - * @param {string} prompt - OIDC prompt parameter for customization of consent screen. Space-separated list of: none, login, consent, select_account. - * @param {number} maxAge - OIDC max_age paraleter for customization of consent screen. Maximum allowable elapsed time in seconds since the user last authenticated. If exceeded, re-authentication is required. - * @param {string} authorizationDetails - Rich authorization request. JSON array of objects, each with a `type` and project-defined fields - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - authorize(projectId: string, clientId: string, redirectUri: string, responseType: string, scope: string, state?: string, nonce?: string, codeChallenge?: string, codeChallengeMethod?: string, prompt?: string, maxAge?: number, authorizationDetails?: string): Promise; - authorize( - paramsOrFirst: { projectId: string, clientId: string, redirectUri: string, responseType: string, scope: string, state?: string, nonce?: string, codeChallenge?: string, codeChallengeMethod?: string, prompt?: string, maxAge?: number, authorizationDetails?: string } | string, - ...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (string)?, (number)?, (string)?] - ): Promise { - let params: { projectId: string, clientId: string, redirectUri: string, responseType: string, scope: string, state?: string, nonce?: string, codeChallenge?: string, codeChallengeMethod?: string, prompt?: string, maxAge?: number, authorizationDetails?: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { projectId: string, clientId: string, redirectUri: string, responseType: string, scope: string, state?: string, nonce?: string, codeChallenge?: string, codeChallengeMethod?: string, prompt?: string, maxAge?: number, authorizationDetails?: string }; - } else { - params = { - projectId: paramsOrFirst as string, - clientId: rest[0] as string, - redirectUri: rest[1] as string, - responseType: rest[2] as string, - scope: rest[3] as string, - state: rest[4] as string, - nonce: rest[5] as string, - codeChallenge: rest[6] as string, - codeChallengeMethod: rest[7] as string, - prompt: rest[8] as string, - maxAge: rest[9] as number, - authorizationDetails: rest[10] as string - }; - } - - const projectId = params.projectId; - const clientId = params.clientId; - const redirectUri = params.redirectUri; - const responseType = params.responseType; - const scope = params.scope; - const state = params.state; - const nonce = params.nonce; - const codeChallenge = params.codeChallenge; - const codeChallengeMethod = params.codeChallengeMethod; - const prompt = params.prompt; - const maxAge = params.maxAge; - const authorizationDetails = params.authorizationDetails; - - if (typeof projectId === 'undefined') { - throw new AppwriteException('Missing required parameter: "projectId"'); - } - - if (typeof clientId === 'undefined') { - throw new AppwriteException('Missing required parameter: "clientId"'); - } - - if (typeof redirectUri === 'undefined') { - throw new AppwriteException('Missing required parameter: "redirectUri"'); - } - - if (typeof responseType === 'undefined') { - throw new AppwriteException('Missing required parameter: "responseType"'); - } - - if (typeof scope === 'undefined') { - throw new AppwriteException('Missing required parameter: "scope"'); - } - - const apiPath = '/oauth2/{project_id}/authorize'.replace('{project_id}', projectId); - const payload: Payload = {}; - - if (typeof clientId !== 'undefined') { - payload['client_id'] = clientId; - } - - if (typeof redirectUri !== 'undefined') { - payload['redirect_uri'] = redirectUri; - } - - if (typeof responseType !== 'undefined') { - payload['response_type'] = responseType; - } - - if (typeof scope !== 'undefined') { - payload['scope'] = scope; - } - - if (typeof state !== 'undefined') { - payload['state'] = state; - } - - if (typeof nonce !== 'undefined') { - payload['nonce'] = nonce; - } - - if (typeof codeChallenge !== 'undefined') { - payload['code_challenge'] = codeChallenge; - } - - if (typeof codeChallengeMethod !== 'undefined') { - payload['code_challenge_method'] = codeChallengeMethod; - } - - if (typeof prompt !== 'undefined') { - payload['prompt'] = prompt; - } - - if (typeof maxAge !== 'undefined') { - payload['max_age'] = maxAge; - } - - if (typeof authorizationDetails !== 'undefined') { - payload['authorization_details'] = authorizationDetails; - } - - const uri = new URL(this.client.config.endpoint + apiPath); - uri.searchParams.append('project', this.client.config.project); - return this.client.call('get', uri, { - 'accept': 'application/json', - }, payload); - } - - /** - * Exchange a device flow user code for an OAuth2 grant. The authenticated user is bound to the pending grant. Pass the returned grant ID to the get grant endpoint to render the consent screen, then to the approve or reject endpoint to complete the flow. - * - * @param {string} params.projectId - Project ID in which OAuth2 client exists. - * @param {string} params.userCode - User code displayed on the device. - * @throws {AppwriteException} - * @returns {Promise} - */ - createGrant(params: { projectId: string, userCode: string }): Promise; - /** - * Exchange a device flow user code for an OAuth2 grant. The authenticated user is bound to the pending grant. Pass the returned grant ID to the get grant endpoint to render the consent screen, then to the approve or reject endpoint to complete the flow. - * - * @param {string} projectId - Project ID in which OAuth2 client exists. - * @param {string} userCode - User code displayed on the device. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - createGrant(projectId: string, userCode: string): Promise; - createGrant( - paramsOrFirst: { projectId: string, userCode: string } | string, - ...rest: [(string)?] - ): Promise { - let params: { projectId: string, userCode: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { projectId: string, userCode: string }; - } else { - params = { - projectId: paramsOrFirst as string, - userCode: rest[0] as string - }; - } - - const projectId = params.projectId; - const userCode = params.userCode; - - if (typeof projectId === 'undefined') { - throw new AppwriteException('Missing required parameter: "projectId"'); - } - - if (typeof userCode === 'undefined') { - throw new AppwriteException('Missing required parameter: "userCode"'); - } - - const apiPath = '/oauth2/{project_id}/grants'.replace('{project_id}', projectId); - const payload: Payload = {}; - - if (typeof userCode !== 'undefined') { - payload['user_code'] = userCode; - } - - 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 OAuth2 grant by its ID. Used by the consent screen to display the details of the authorization the user is being asked to approve. A grant can only be read by the user it belongs to, or by server SDK. - * - * @param {string} params.projectId - Project ID in which OAuth2 client that created grant during authorization exists. - * @param {string} params.grantId - Grant ID made during authorization, provided to consent screen in URL search params. - * @throws {AppwriteException} - * @returns {Promise} - */ - getGrant(params: { projectId: string, grantId: string }): Promise; - /** - * Get an OAuth2 grant by its ID. Used by the consent screen to display the details of the authorization the user is being asked to approve. A grant can only be read by the user it belongs to, or by server SDK. - * - * @param {string} projectId - Project ID in which OAuth2 client that created grant during authorization exists. - * @param {string} grantId - Grant ID made during authorization, provided to consent screen in URL search params. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - getGrant(projectId: string, grantId: string): Promise; - getGrant( - paramsOrFirst: { projectId: string, grantId: string } | string, - ...rest: [(string)?] - ): Promise { - let params: { projectId: string, grantId: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { projectId: string, grantId: string }; - } else { - params = { - projectId: paramsOrFirst as string, - grantId: rest[0] as string - }; - } - - const projectId = params.projectId; - const grantId = params.grantId; - - if (typeof projectId === 'undefined') { - throw new AppwriteException('Missing required parameter: "projectId"'); - } - - if (typeof grantId === 'undefined') { - throw new AppwriteException('Missing required parameter: "grantId"'); - } - - const apiPath = '/oauth2/{project_id}/grants/{grant_id}'.replace('{project_id}', projectId).replace('{grant_id}', grantId); - 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); - } - - /** - * Reject an OAuth2 grant when the user denies consent. Returns the `redirectUrl` the end user should be sent to with an `access_denied` error. You can pass Accept header of `application/json` to receive a JSON response instead of a redirect. - * - * @param {string} params.projectId - Project ID in which OAuth2 client that created grant during authorization exists. - * @param {string} params.grantId - Grant ID made during authorization, provided to consent screen in URL search params. - * @throws {AppwriteException} - * @returns {Promise} - */ - reject(params: { projectId: string, grantId: string }): Promise; - /** - * Reject an OAuth2 grant when the user denies consent. Returns the `redirectUrl` the end user should be sent to with an `access_denied` error. You can pass Accept header of `application/json` to receive a JSON response instead of a redirect. - * - * @param {string} projectId - Project ID in which OAuth2 client that created grant during authorization exists. - * @param {string} grantId - Grant ID made during authorization, provided to consent screen in URL search params. - * @throws {AppwriteException} - * @returns {Promise} - * @deprecated Use the object parameter style method for a better developer experience. - */ - reject(projectId: string, grantId: string): Promise; - reject( - paramsOrFirst: { projectId: string, grantId: string } | string, - ...rest: [(string)?] - ): Promise { - let params: { projectId: string, grantId: string }; - - if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { projectId: string, grantId: string }; - } else { - params = { - projectId: paramsOrFirst as string, - grantId: rest[0] as string - }; - } - - const projectId = params.projectId; - const grantId = params.grantId; - - if (typeof projectId === 'undefined') { - throw new AppwriteException('Missing required parameter: "projectId"'); - } - - if (typeof grantId === 'undefined') { - throw new AppwriteException('Missing required parameter: "grantId"'); - } - - const apiPath = '/oauth2/{project_id}/reject'.replace('{project_id}', projectId); - const payload: Payload = {}; - - if (typeof grantId !== 'undefined') { - payload['grant_id'] = grantId; - } - - const uri = new URL(this.client.config.endpoint + apiPath); - uri.searchParams.append('project', this.client.config.project); - return this.client.call('post', uri, { - 'content-type': 'application/json', - 'accept': 'application/json', - }, payload); - } -}; From 0ed3e5e0e27225a893f9c693594748a8c4d5d294 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 8 Jun 2026 11:37:16 +0530 Subject: [PATCH 3/5] docs: add accept header and toString notes to changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 63a607dc..1fb25ac9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * Breaking: Renamed `Theme` enum to `BrowserTheme`. * Breaking: Removed `Models.DefaultPresence` and dropped the `Presence` generic from `presences` methods. * Added: Email metadata fields to `User`, plus `Membership.userAccessedAt` and `Presence.metadata`. +* Updated: Requests now send an explicit `accept` header matching each endpoint's response type. ## 0.30.1 From c935985701d0b3ae738955fb237c10cd13e250c6 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 8 Jun 2026 11:59:22 +0530 Subject: [PATCH 4/5] chore: update React Native SDK to 0.32.0 --- src/services/functions.ts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/services/functions.ts b/src/services/functions.ts index a342a7d2..53d366b0 100644 --- a/src/services/functions.ts +++ b/src/services/functions.ts @@ -90,7 +90,7 @@ 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; + async createExecution(params: { functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string , onProgress?: (progress: UploadProgress) => void }): 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 +105,17 @@ 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)?] + async createExecution(functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string, onProgress?: (progress: UploadProgress) => void): Promise; + async createExecution( + paramsOrFirst: { functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string, onProgress?: (progress: UploadProgress) => void } | string, + ...rest: [(string)?, (boolean)?, (string)?, (ExecutionMethod)?, (object)?, (string)?,((progress: UploadProgress) => void)?] ): Promise { let params: { functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string }; + let onProgress: ((progress: UploadProgress) => void); 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 }; + onProgress = paramsOrFirst?.onProgress as ((progress: UploadProgress) => void); } else { params = { functionId: paramsOrFirst as string, @@ -124,6 +126,7 @@ export class Functions extends Service { headers: rest[4] as object, scheduledAt: rest[5] as string }; + onProgress = rest[6] as ((progress: UploadProgress) => void); } const functionId = params.functionId; @@ -166,11 +169,6 @@ 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': 'multipart/form-data', - }, payload); } /** From 38aa9c2f800eb2b8ad74a51b003e86884696b125 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 8 Jun 2026 12:53:58 +0530 Subject: [PATCH 5/5] chore: update React Native SDK to 0.32.0 --- src/services/functions.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/services/functions.ts b/src/services/functions.ts index 53d366b0..b2ebf957 100644 --- a/src/services/functions.ts +++ b/src/services/functions.ts @@ -90,7 +90,7 @@ export class Functions extends Service { * @throws {AppwriteException} * @returns {Promise} */ - async createExecution(params: { functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string , onProgress?: (progress: UploadProgress) => void }): 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,17 +105,15 @@ export class Functions extends Service { * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - async createExecution(functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string, onProgress?: (progress: UploadProgress) => void): Promise; - async createExecution( - paramsOrFirst: { functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string, onProgress?: (progress: UploadProgress) => void } | string, - ...rest: [(string)?, (boolean)?, (string)?, (ExecutionMethod)?, (object)?, (string)?,((progress: UploadProgress) => void)?] + 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)?] ): Promise { let params: { functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string }; - let onProgress: ((progress: UploadProgress) => void); 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 }; - onProgress = paramsOrFirst?.onProgress as ((progress: UploadProgress) => void); } else { params = { functionId: paramsOrFirst as string, @@ -126,7 +124,6 @@ export class Functions extends Service { headers: rest[4] as object, scheduledAt: rest[5] as string }; - onProgress = rest[6] as ((progress: UploadProgress) => void); } const functionId = params.functionId; @@ -169,6 +166,11 @@ 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); } /**